<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/clk/starfive, branch linux-5.17.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2022-04-08T11:58:27+00:00</updated>
<entry>
<title>clk: starfive: jh7100: Handle audio_div clock properly</title>
<updated>2022-04-08T11:58:27+00:00</updated>
<author>
<name>Emil Renner Berthing</name>
<email>kernel@esmil.dk</email>
</author>
<published>2022-01-26T17:39:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f6ea015f961d86091e7e2090b8539357322b3021'/>
<id>urn:sha1:f6ea015f961d86091e7e2090b8539357322b3021</id>
<content type='text'>
[ Upstream commit 73bfc8d745a98744088cb30517399222674455b1 ]

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: 4210be668a09 ("clk: starfive: Add JH7100 clock generator driver")
Signed-off-by: Emil Renner Berthing &lt;kernel@esmil.dk&gt;
Link: https://lore.kernel.org/r/20220126173953.1016706-3-kernel@esmil.dk
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: starfive: jh7100: Don't round divisor up twice</title>
<updated>2022-04-08T11:58:27+00:00</updated>
<author>
<name>Emil Renner Berthing</name>
<email>kernel@esmil.dk</email>
</author>
<published>2022-01-26T17:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fb1fb83dcefc759962a069c4bf5a32dc2b60692c'/>
<id>urn:sha1:fb1fb83dcefc759962a069c4bf5a32dc2b60692c</id>
<content type='text'>
[ Upstream commit 40dda3532f903107a063cd6ec1f15e10dd0eccc5 ]

The problem is best illustrated by an example. Suppose a consumer wants
a 4MHz clock rate from a divider with a 10MHz parent. It would then
call

  clk_round_rate(clk, 4000000)

which would call into our determine_rate() callback that correctly
rounds up and finds that a divisor of 3 gives the highest possible
frequency below the requested 4MHz and returns 10000000 / 3 = 3333333Hz.

However the consumer would then call

  clk_set_rate(clk, 3333333)

but since 3333333 doesn't divide 10000000 evenly our set_rate() callback
would again round the divisor up and set it to 4 which results in an
unnecessarily low rate of 2.5MHz.

Fix it by using DIV_ROUND_CLOSEST in the set_rate() callback.

Fixes: 4210be668a09 ("clk: starfive: Add JH7100 clock generator driver")
Signed-off-by: Emil Renner Berthing &lt;kernel@esmil.dk&gt;
Link: https://lore.kernel.org/r/20220126173953.1016706-2-kernel@esmil.dk
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: starfive: Add JH7100 clock generator driver</title>
<updated>2021-12-16T16:23:24+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2021-06-01T13:57:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4210be668a09ee20e4e1c7adf61b47d33d05c480'/>
<id>urn:sha1:4210be668a09ee20e4e1c7adf61b47d33d05c480</id>
<content type='text'>
Add a driver for the StarFive JH7100 clock generator.

Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Acked-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Co-developed-by: Emil Renner Berthing &lt;kernel@esmil.dk&gt;
Signed-off-by: Emil Renner Berthing &lt;kernel@esmil.dk&gt;
</content>
</entry>
</feed>
