mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
phy: phy-rockchip-samsung-hdptx: Enable runtime PM at PHY core level
When a new PHY is created via [devm_]phy_create(), the runtime PM for it
is not enabled unless the parent device (which creates the PHY) has its
own runtime PM already enabled.
Move the call to devm_pm_runtime_enable() before devm_phy_create() to
enable runtime PM at PHY core level.
With this change the ->power_on() and ->power_off() callbacks do not
require explicit runtime PM management anymore, since the PHY core
handles that via phy_pm_runtime_{get,put}_sync() when phy_power_on() and
phy_power_off() are invoked.
Hence drop the now unnecessary calls to pm_runtime_resume_and_get() and
pm_runtime_put() helpers.
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20240620-rk3588-hdmiphy-clkprov-v2-2-6a2d2164e508@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
1b369ff94b
commit
10ba8479f4
|
|
@ -860,7 +860,7 @@ static int rk_hdptx_ropll_tmds_mode_config(struct rk_hdptx_phy *hdptx,
|
||||||
static int rk_hdptx_phy_power_on(struct phy *phy)
|
static int rk_hdptx_phy_power_on(struct phy *phy)
|
||||||
{
|
{
|
||||||
struct rk_hdptx_phy *hdptx = phy_get_drvdata(phy);
|
struct rk_hdptx_phy *hdptx = phy_get_drvdata(phy);
|
||||||
int ret, bus_width = phy_get_bus_width(hdptx->phy);
|
int bus_width = phy_get_bus_width(hdptx->phy);
|
||||||
/*
|
/*
|
||||||
* FIXME: Temporary workaround to pass pixel_clk_rate
|
* FIXME: Temporary workaround to pass pixel_clk_rate
|
||||||
* from the HDMI bridge driver until phy_configure_opts_hdmi
|
* from the HDMI bridge driver until phy_configure_opts_hdmi
|
||||||
|
|
@ -871,17 +871,7 @@ static int rk_hdptx_phy_power_on(struct phy *phy)
|
||||||
dev_dbg(hdptx->dev, "%s bus_width=%x rate=%u\n",
|
dev_dbg(hdptx->dev, "%s bus_width=%x rate=%u\n",
|
||||||
__func__, bus_width, rate);
|
__func__, bus_width, rate);
|
||||||
|
|
||||||
ret = pm_runtime_resume_and_get(hdptx->dev);
|
return rk_hdptx_ropll_tmds_mode_config(hdptx, rate);
|
||||||
if (ret) {
|
|
||||||
dev_err(hdptx->dev, "Failed to resume phy: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = rk_hdptx_ropll_tmds_mode_config(hdptx, rate);
|
|
||||||
if (ret)
|
|
||||||
pm_runtime_put(hdptx->dev);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rk_hdptx_phy_power_off(struct phy *phy)
|
static int rk_hdptx_phy_power_off(struct phy *phy)
|
||||||
|
|
@ -894,8 +884,6 @@ static int rk_hdptx_phy_power_off(struct phy *phy)
|
||||||
if (ret == 0 && (val & HDPTX_O_PLL_LOCK_DONE))
|
if (ret == 0 && (val & HDPTX_O_PLL_LOCK_DONE))
|
||||||
rk_hdptx_phy_disable(hdptx);
|
rk_hdptx_phy_disable(hdptx);
|
||||||
|
|
||||||
pm_runtime_put(hdptx->dev);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -977,6 +965,10 @@ static int rk_hdptx_phy_probe(struct platform_device *pdev)
|
||||||
return dev_err_probe(dev, PTR_ERR(hdptx->grf),
|
return dev_err_probe(dev, PTR_ERR(hdptx->grf),
|
||||||
"Could not get GRF syscon\n");
|
"Could not get GRF syscon\n");
|
||||||
|
|
||||||
|
ret = devm_pm_runtime_enable(dev);
|
||||||
|
if (ret)
|
||||||
|
return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
|
||||||
|
|
||||||
hdptx->phy = devm_phy_create(dev, NULL, &rk_hdptx_phy_ops);
|
hdptx->phy = devm_phy_create(dev, NULL, &rk_hdptx_phy_ops);
|
||||||
if (IS_ERR(hdptx->phy))
|
if (IS_ERR(hdptx->phy))
|
||||||
return dev_err_probe(dev, PTR_ERR(hdptx->phy),
|
return dev_err_probe(dev, PTR_ERR(hdptx->phy),
|
||||||
|
|
@ -986,10 +978,6 @@ static int rk_hdptx_phy_probe(struct platform_device *pdev)
|
||||||
phy_set_drvdata(hdptx->phy, hdptx);
|
phy_set_drvdata(hdptx->phy, hdptx);
|
||||||
phy_set_bus_width(hdptx->phy, 8);
|
phy_set_bus_width(hdptx->phy, 8);
|
||||||
|
|
||||||
ret = devm_pm_runtime_enable(dev);
|
|
||||||
if (ret)
|
|
||||||
return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
|
|
||||||
|
|
||||||
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
||||||
if (IS_ERR(phy_provider))
|
if (IS_ERR(phy_provider))
|
||||||
return dev_err_probe(dev, PTR_ERR(phy_provider),
|
return dev_err_probe(dev, PTR_ERR(phy_provider),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user