Skip to content

Commit 10b74af

Browse files
QSchulzmmind
authored andcommitted
clk: rockchip: re-add rational best approximation algorithm to the fractional divider
In commit 4e7cf74 ("clk: fractional-divider: Export approximation algorithm to the CCF users"), the code handling the rational best approximation algorithm was replaced by a call to the core clk_fractional_divider_general_approximation function which did the same thing back then. However, in commit 82f53f9 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag"), this common code was made conditional on CLK_FRAC_DIVIDER_POWER_OF_TWO_PS flag which was not added back to the rockchip clock driver. This broke the ltk050h3146w-a2 MIPI DSI display present on a PX30-based downstream board. Let's add the flag to the fractional divider flags so that the original and intended behavior is brought back to the rockchip clock drivers. Fixes: 82f53f9 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag") Cc: stable@vger.kernel.org Cc: Quentin Schulz <foss+kernel@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Link: https://lore.kernel.org/r/20220131163224.708002-1-quentin.schulz@theobroma-systems.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 9f56539 commit 10b74af

File tree

1 file changed

+3
-0
lines changed
  • drivers/clk/rockchip

1 file changed

+3
-0
lines changed

drivers/clk/rockchip/clk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
180180
unsigned long rate, unsigned long *parent_rate,
181181
unsigned long *m, unsigned long *n)
182182
{
183+
struct clk_fractional_divider *fd = to_clk_fd(hw);
183184
unsigned long p_rate, p_parent_rate;
184185
struct clk_hw *p_parent;
185186

@@ -190,6 +191,8 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
190191
*parent_rate = p_parent_rate;
191192
}
192193

194+
fd->flags |= CLK_FRAC_DIVIDER_POWER_OF_TWO_PS;
195+
193196
clk_fractional_divider_general_approximation(hw, rate, parent_rate, m, n);
194197
}
195198

0 commit comments

Comments
 (0)