linux-stable/drivers/clk/socfpga
Maxime Ripard 9607beb917 clk: socfpga: gate: Add a determine_rate hook
The SoCFGPA gate 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 candidates to
trigger that parent change are either the assigned-clock-parents device
tree property or 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.

Similarly, it doesn't look like the device tree using that clock driver
uses any of the assigned-clock properties on 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().

The latter case would be equivalent to setting the determine_rate
implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
determine_rate implementation is provided, clk_round_rate() (through
clk_core_round_rate_nolock()) will call itself on the parent if
CLK_SET_RATE_PARENT is set, and will not change the clock rate
otherwise.

And if it was an oversight, then we are at least explicit about our
behavior now and it can be further refined down the line.

Cc: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-32-971d5077e7d2@cerno.tech
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2023-06-08 18:39:29 -07:00
..
Kconfig clk: socfpga: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs (and compile test) 2021-03-23 11:03:36 -05:00
Makefile clk: socfpga: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs (and compile test) 2021-03-23 11:03:36 -05:00
clk-agilex.c clk: socfpga: agilex: Make use of the helper function devm_platform_ioremap_resource() 2022-01-05 16:43:41 -08:00
clk-gate-a10.c clk: socfpga: arria10: use of_clk_add_hw_provider and improve error handling 2023-03-21 16:47:48 -07:00
clk-gate-s10.c clk: cleanup comments 2022-03-11 18:22:15 -08:00
clk-gate.c clk: socfpga: gate: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
clk-periph-a10.c clk: socfpga: arria10: use of_clk_add_hw_provider and improve error handling 2023-03-21 16:47:48 -07:00
clk-periph-s10.c clk: socfpga: cleanup spdx tags 2022-03-11 18:21:45 -08:00
clk-periph.c clk: socfpga: use of_clk_add_hw_provider and improve error handling 2023-03-21 16:47:48 -07:00
clk-pll-a10.c clk: socfpga: arria10: use of_clk_add_hw_provider and improve error handling 2023-03-21 16:47:48 -07:00
clk-pll-s10.c clk: socfpga: cleanup spdx tags 2022-03-11 18:21:45 -08:00
clk-pll.c clk: socfpga: use of_clk_add_hw_provider and improve error handling 2023-03-21 16:47:48 -07:00
clk-s10.c clk: socfpga: cleanup spdx tags 2022-03-11 18:21:45 -08:00
clk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
clk.h clk: socfpga: remove the setting of clk-phase for sdmmc_clk 2022-12-07 13:22:37 +01:00
stratix10-clk.h clk: agilex/stratix10: add support for the 2nd bypass 2021-06-27 16:39:59 -07:00