aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2024-06-19 20:21:53 +0200
committerRobert Foss <[email protected]>2024-06-27 11:52:07 +0200
commit73f613908eb1c8a1361bac9d6e15d054ab959457 (patch)
tree53be8bacbdc550c9724d51c7661980dfc2ce462e
parentdcbaaa239dd3bf3d9edc01cdb4661a16d9a73520 (diff)
drm/bridge: analogix_dp: move platform and PHY power handling into runtime PM
Platform and PHY power isn't only required when the actual display data stream is active, but may be required earlier to support AUX channel transactions. Move them into the runtime PM calls, so they are properly managed whenever various other parts of the driver need them to be active. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Robert Foss <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Robert Foss <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/bridge/analogix/analogix_dp_core.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index d8c0751ab5c0..d2b6d5a87188 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1251,11 +1251,6 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
pm_runtime_get_sync(dp->dev);
- if (dp->plat_data->power_on)
- dp->plat_data->power_on(dp->plat_data);
-
- phy_power_on(dp->phy);
-
ret = analogix_dp_init_dp(dp);
if (ret)
goto out_dp_init;
@@ -1281,10 +1276,6 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
return 0;
out_dp_init:
- phy_power_off(dp->phy);
- if (dp->plat_data->power_off)
- dp->plat_data->power_off(dp->plat_data);
-
pm_runtime_put_sync(dp->dev);
return ret;
@@ -1347,11 +1338,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
disable_irq(dp->irq);
- if (dp->plat_data->power_off)
- dp->plat_data->power_off(dp->plat_data);
-
analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
- phy_power_off(dp->phy);
pm_runtime_put_sync(dp->dev);
@@ -1705,6 +1692,11 @@ EXPORT_SYMBOL_GPL(analogix_dp_probe);
int analogix_dp_suspend(struct analogix_dp_device *dp)
{
+ phy_power_off(dp->phy);
+
+ if (dp->plat_data->power_off)
+ dp->plat_data->power_off(dp->plat_data);
+
clk_disable_unprepare(dp->clock);
return 0;
@@ -1721,6 +1713,11 @@ int analogix_dp_resume(struct analogix_dp_device *dp)
return ret;
}
+ if (dp->plat_data->power_on)
+ dp->plat_data->power_on(dp->plat_data);
+
+ phy_power_on(dp->phy);
+
return 0;
}
EXPORT_SYMBOL_GPL(analogix_dp_resume);