MLK-16581-2 phy: mixel-lvds-combo: Get PHY clock rate before setting it's rate
authorLiu Ying <victor.liu@nxp.com>
Fri, 13 Oct 2017 03:47:51 +0000 (11:47 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:52 +0000 (15:38 -0500)
Due to i.MX8 clock issue, we need to get PHY clock rate
before setting it's rate when system resumes back from
PM sleep mode, otherwise, we'll fail to set the clock rate.
So, this is a workaround and it can be removed when
the clock issue is properly fixed.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/phy/phy-mixel-lvds-combo.c

index 9d3d469..3b888b1 100644 (file)
@@ -96,6 +96,13 @@ void mixel_phy_combo_lvds_set_phy_speed(struct phy *phy,
 {
        struct mixel_lvds_phy *lvds_phy = phy_get_drvdata(phy);
 
+       /*
+        * To workaround setting clock rate failure issue
+        * when the system resumes back from PM sleep mode,
+        * we need to get the clock rate before setting it's
+        * rate, otherwise, setting the clock rate will fail.
+        */
+       clk_get_rate(lvds_phy->phy_clk);
        clk_set_rate(lvds_phy->phy_clk, phy_clk_rate);
 }
 EXPORT_SYMBOL_GPL(mixel_phy_combo_lvds_set_phy_speed);