Re: [PATCH] clk: Add clk_determine_rate function call

From: Russell King (Oracle)
Date: Tue Jun 17 2025 - 18:28:22 EST


On Mon, Jun 16, 2025 at 04:05:27PM +0530, Jayesh Choudhary wrote:
> Add a function to determine if a particular rate can be set for a clock
> with its argument being the clock and the desired rate so that it could
> be exposed to other peripherals.
> For example, the display controllers typically has to perform multiple
> checks for supported display resolutions including those related to
> clock rates. The controller has to check this way before it actually
> enables the clock and has to do it multiple times (typically for each
> mode), and therefore using the clk_set_rate when its not needed, does
> not make sense.

So what's up with using clk_round_rate(), which returns the clock rate
that one would actually get if one calls clk_set_rate() with the the
value passed into clk_round_rate() ?

Why is clk_round_rate() not sufficient?

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!