@@ -77,6 +77,8 @@ struct dp_ctrl_private {
struct dp_parser *parser;
struct dp_catalog *catalog;
+ bool is_phy_on;
+
struct opp_table *opp_table;
struct completion idle_comp;
@@ -1336,6 +1338,7 @@ static int dp_ctrl_enable_mainlink_clocks(struct dp_ctrl_private *ctrl)
phy_configure(phy, &dp_io->phy_opts);
phy_power_on(phy);
+ ctrl->is_phy_on = true;
ret = dp_power_clk_enable(ctrl->power, DP_CTRL_PM, true);
if (ret)
@@ -1414,6 +1417,11 @@ void dp_ctrl_host_deinit(struct dp_ctrl *dp_ctrl)
phy = dp_io->phy;
dp_catalog_ctrl_enable_irq(ctrl->catalog, false);
+ if (ctrl->is_phy_on) {
+ phy_power_off(phy);
+ ctrl->is_phy_on = false;
+ }
+
phy_exit(phy);
DRM_DEBUG_DP("Host deinitialized successfully\n");
@@ -1457,6 +1465,8 @@ static int dp_ctrl_reinitialize_mainlink(struct dp_ctrl_private *ctrl)
return ret;
}
phy_power_off(phy);
+ ctrl->is_phy_on = false;
+
/* hw recommended delay before re-enabling clocks */
msleep(20);
@@ -1488,6 +1498,8 @@ static int dp_ctrl_deinitialize_mainlink(struct dp_ctrl_private *ctrl)
}
phy_power_off(phy);
+ ctrl->is_phy_on = false;
+
phy_exit(phy);
return 0;
@@ -1840,6 +1852,7 @@ int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl)
}
phy_power_off(phy);
+ ctrl->is_phy_on = false;
/* aux channel down, reinit phy */
phy_exit(phy);
@@ -1894,6 +1907,8 @@ int dp_ctrl_off(struct dp_ctrl *dp_ctrl)
}
phy_power_off(phy);
+ ctrl->is_phy_on = false;
+
phy_exit(phy);
DRM_DEBUG_DP("DP off done\n");