Skip to content

Commit 4f510aa

Browse files
Kwibookishon
authored andcommitted
phy/rockchip: inno-hdmi: round clock rate down to closest 1000 Hz
Commit 287422a ("drm/rockchip: Round up _before_ giving to the clock framework") changed what rate clk_round_rate() is called with, an additional 999 Hz added to the requsted mode clock. This has caused a regression on RK3328 and presumably also on RK3228 because the inno-hdmi-phy clock requires an exact match of the requested rate in the pre pll config table. When an exact match is not found the parent clock rate (24MHz) is returned to the clk_round_rate() caller. This cause wrong pixel clock to be used and result in no-signal when configuring a mode on RK3328. Fix this by rounding the rate down to closest 1000 Hz in round_rate func, this allows an exact match to be found in pre pll config table. Fixes: 287422a ("drm/rockchip: Round up _before_ giving to the clock framework") Signed-off-by: Jonas Karlman <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent ea137a8 commit 4f510aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/phy/rockchip/phy-rockchip-inno-hdmi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ static long inno_hdmi_phy_rk3228_clk_round_rate(struct clk_hw *hw,
603603
{
604604
const struct pre_pll_config *cfg = pre_pll_cfg_table;
605605

606+
rate = (rate / 1000) * 1000;
607+
606608
for (; cfg->pixclock != 0; cfg++)
607609
if (cfg->pixclock == rate && !cfg->fracdiv)
608610
break;
@@ -755,6 +757,8 @@ static long inno_hdmi_phy_rk3328_clk_round_rate(struct clk_hw *hw,
755757
{
756758
const struct pre_pll_config *cfg = pre_pll_cfg_table;
757759

760+
rate = (rate / 1000) * 1000;
761+
758762
for (; cfg->pixclock != 0; cfg++)
759763
if (cfg->pixclock == rate)
760764
break;

0 commit comments

Comments
 (0)