[PATCH v2 42/65] rtc: sun6i: Add a determine_rate hook

Samuel Holland samuel at sholland.org
Fri Nov 4 20:45:05 PDT 2022


Hi Maxime,

On 11/4/22 08:17, Maxime Ripard wrote:
> The Allwinner sun6i RTC clock implements a mux with a set_parent hook,
> but doesn't provide a determine_rate implementation.
> 
> This is a bit odd, since set_parent() is there to, as its name implies,
> change the parent of a clock. However, the most likely candidate to
> trigger that parent change is a call to clk_set_rate(), with
> determine_rate() figuring out which parent is the best suited for a
> given rate.
> 
> The other trigger would be a call to clk_set_parent(), but it's far less
> used, and it doesn't look like there's any obvious user for that clock.
> 
> So, the set_parent hook is effectively unused, possibly because of an
> oversight. However, it could also be an explicit decision by the
> original author to avoid any reparenting but through an explicit call to
> clk_set_parent().

For this driver, we always want to use the more accurate parent if it is
available. The driver enforces this in the probe function already, so I
think it would be better to just remove the .set_parent implementation.

Regards,
Samuel




More information about the linux-arm-kernel mailing list