Skip to content

lib: clock: allow rate change on disabled clocks#84

Merged
slingappa merged 1 commit into
riscv-software-src:mainfrom
ch-perry:fix-clock-set-rate
May 15, 2026
Merged

lib: clock: allow rate change on disabled clocks#84
slingappa merged 1 commit into
riscv-software-src:mainfrom
ch-perry:fix-clock-set-rate

Conversation

@ch-perry
Copy link
Copy Markdown
Contributor

Changing the rate of a disabled clock is a common thing to do and should be allowed. Otherwise, there is no way to make sure that the clock has the right frequency when it is first enabled.

This makes it possible to use any Linux driver which uses "clk_set_rate()" before "clk_prepare_enable()", for which a random example is 1.

Changing the rate of a disabled clock is a common thing to do and should be
allowed. Otherwise, there is no way to make sure that the clock has the
right frequency when it is first enabled.

This makes it possible to use any Linux driver which uses "clk_set_rate()"
before "clk_prepare_enable()", for which a random example is [1].

[1]: https://elixir.bootlin.com/linux/v7.0.6/source/drivers/iio/adc/ad4130.c#L1882

Fixes: b153230 ("lib: Implement clock infra and clock service group")
Signed-off-by: Charles Perry <charles.perry@microchip.com>
@slingappa
Copy link
Copy Markdown
Collaborator

Looks OK to me.

@slingappa slingappa merged commit 1363b67 into riscv-software-src:main May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants