]> git.baikalelectronics.ru Git - kernel.git/commit
clk: starfive: jh7100: Handle audio_div clock properly
authorEmil Renner Berthing <kernel@esmil.dk>
Wed, 26 Jan 2022 17:39:48 +0000 (18:39 +0100)
committerStephen Boyd <sboyd@kernel.org>
Fri, 11 Mar 2022 02:17:32 +0000 (18:17 -0800)
commitafd18ce779a0157cf2c9f211bd93f92a816ca9b9
treec632a26c0fff6282829add09d926f1887ab75a26
parenta078aa1e20196f8d6ac1f5f1e50a1debf5a336a3
clk: starfive: jh7100: Handle audio_div clock properly

It turns out the audio_div clock is a fractional divider where the
lowest byte of the ctrl register is the integer part of the divider and
the 2nd byte is the number of 100th added to the divider.

The children of this clock is used by the audio peripherals for their
sample rate clock, so round to the closest possible rate rather than
always rounding down like regular dividers.

Fixes: 4034eb2ae865 ("clk: starfive: Add JH7100 clock generator driver")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Link: https://lore.kernel.org/r/20220126173953.1016706-3-kernel@esmil.dk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/starfive/clk-starfive-jh7100.c