clk: rockchip: rk3399: Allow to set rate of clk_i2s0_frac's parent
authorOndrej Jirman <megi@xff.cz>
Sat, 17 Feb 2024 19:34:38 +0000 (20:34 +0100)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 27 Feb 2024 22:45:53 +0000 (23:45 +0100)
commit1361d75503fccc0e6b3ecbcd5bb53bbdfdc52f0a
tree44b8c8eab092260d7de219cfef62d17d82d2a545
parentdae3e57000fb2d6f491e3ee2956f5918326d6b72
clk: rockchip: rk3399: Allow to set rate of clk_i2s0_frac's parent

Otherwise when when clk_i2s0 muxes to clk_i2s0_div which requires
setting high divider value on clk_i2s0_div, and then muxes back to
clk_i2s0_frac, clk_i2s0_frac would have no way to change the
clk_i2s0_div's divider ratio back to 1 so that it can satisfy the
condition for m/n > 20 for fractional division to work correctly.

Bug is reproducible by playing 44.1k audio, then 48k audio, and then
44.1k audio again. This results in clk_i2s0_div being set to 49 and
clk_i2s0_frac not being able to cope with such a low input clock rate
and audio playing extremely slowly.

The identical issue is on i2s1 and i2s2 clocks, too.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Link: https://lore.kernel.org/r/20240217193439.1762213-1-megi@xff.cz
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/clk/rockchip/clk-rk3399.c