Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/mediatek: no change parent rate in round_rate() for MT2701 hdmi phy

This is the third step to make MT2701 HDMI stable.
We should not change the rate of parent for hdmi phy when
doing round_rate for this clock. The parent clock of hdmi
phy must be the same as it. We change it when doing set_rate
only.

Signed-off-by: Wangyan Wang <wangyan.wang@mediatek.com>
Signed-off-by: CK Hu <ck.hu@mediatek.com>

authored by

Wangyan Wang and committed by
CK Hu
9ee76098 8eeb3946

+20 -16
-14
drivers/gpu/drm/mediatek/mtk_hdmi_phy.c
··· 15 15 .owner = THIS_MODULE, 16 16 }; 17 17 18 - long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, 19 - unsigned long *parent_rate) 20 - { 21 - struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw); 22 - 23 - hdmi_phy->pll_rate = rate; 24 - if (rate <= 74250000) 25 - *parent_rate = rate; 26 - else 27 - *parent_rate = rate / 2; 28 - 29 - return rate; 30 - } 31 - 32 18 void mtk_hdmi_phy_clear_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset, 33 19 u32 bits) 34 20 {
-2
drivers/gpu/drm/mediatek/mtk_hdmi_phy.h
··· 49 49 void mtk_hdmi_phy_mask(struct mtk_hdmi_phy *hdmi_phy, u32 offset, 50 50 u32 val, u32 mask); 51 51 struct mtk_hdmi_phy *to_mtk_hdmi_phy(struct clk_hw *hw); 52 - long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, 53 - unsigned long *parent_rate); 54 52 55 53 extern struct platform_driver mtk_hdmi_phy_driver; 56 54 extern struct mtk_hdmi_phy_conf mtk_hdmi_phy_8173_conf;
+6
drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c
··· 106 106 usleep_range(80, 100); 107 107 } 108 108 109 + static long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, 110 + unsigned long *parent_rate) 111 + { 112 + return rate; 113 + } 114 + 109 115 static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, 110 116 unsigned long parent_rate) 111 117 {
+14
drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c
··· 199 199 usleep_range(100, 150); 200 200 } 201 201 202 + static long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, 203 + unsigned long *parent_rate) 204 + { 205 + struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw); 206 + 207 + hdmi_phy->pll_rate = rate; 208 + if (rate <= 74250000) 209 + *parent_rate = rate; 210 + else 211 + *parent_rate = rate / 2; 212 + 213 + return rate; 214 + } 215 + 202 216 static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, 203 217 unsigned long parent_rate) 204 218 {