clk: sunxi-ng: a64: select closest rate for pll-video0
authorFrank Oltmanns <frank@oltmanns.dev>
Mon, 7 Aug 2023 12:43:43 +0000 (14:43 +0200)
committerChen-Yu Tsai <wens@csie.org>
Wed, 9 Aug 2023 15:41:44 +0000 (23:41 +0800)
commitbf8eb12f52c49e10ca1d86564bfa096e09c51c38
tree95074715765d36854a3d33415aba15cf3d2133ed
parent253795abdb04bdc762a9c2dd842ad6e549a9e2d7
clk: sunxi-ng: a64: select closest rate for pll-video0

Selecting the closest rate for pll-video0 instead of the closest rate
that is less than the requested rate has no downside for this clock,
while allowing for selecting a more suitable rate, e.g. for the
connected panels.

Furthermore, the algorithm that sets an NKM clock's parent benefits from
the closest rate. Without it, the NKM clock's rate might drift away from
the requested rate in the multiple successive calls to
ccu_nkm_determine_rate that the clk framework performs when setting a
clock rate.

Therefore, configure pll-video0 and, in consequence, all of its
descendents to select the closest rate.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Link: https://lore.kernel.org/r/20230807-pll-mipi_set_rate_parent-v6-10-f173239a4b59@oltmanns.dev
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
drivers/clk/sunxi-ng/ccu-sun50i-a64.c