summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorLiu Ying <victor.liu@nxp.com>2017-10-13 11:37:18 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit9629389ddc91a348f632e9687b42c3600e9a0f68 (patch)
treeb2dd11394ddfaa5c5e1746b4bc342ebf69d01ba2 /drivers/phy
parent5186d401f1df52351eb6a04613dcbc7e9acfa44a (diff)
MLK-16581-1 phy: mixel-lvds: Get PHY clock rate before setting it's rate
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>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-mixel-lvds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/phy/phy-mixel-lvds.c b/drivers/phy/phy-mixel-lvds.c
index 824b251020a4..31188884f331 100644
--- a/drivers/phy/phy-mixel-lvds.c
+++ b/drivers/phy/phy-mixel-lvds.c
@@ -96,6 +96,13 @@ void mixel_phy_lvds_set_phy_speed(struct phy *phy, unsigned long phy_clk_rate)
mutex_unlock(&priv->lock);
clk_disable_unprepare(priv->phy_clk);
+ /*
+ * 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(priv->phy_clk);
clk_set_rate(priv->phy_clk, phy_clk_rate);
}
EXPORT_SYMBOL_GPL(mixel_phy_lvds_set_phy_speed);