linux/drivers/clk/imx
Maxime Ripard 1c2c20dbb5 clk: imx: scu: Add a determine_rate hook
The iMX SCU mux 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: Abel Vesa <abelvesa@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-28-971d5077e7d2@cerno.tech
| Reported-by: kernel test robot <lkp@intel.com>:
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2023-06-08 18:39:29 -07:00
..
clk-busy.c clk: imx: busy: Add a determine_rate hook 2023-06-08 18:39:28 -07:00
clk-composite-7ulp.c clk: imx: Remove values for mmask and nmask in struct clk_fractional_divider 2023-04-05 12:09:27 -07:00
clk-composite-8m.c Revert "clk: imx: composite-8m: Add support to determine_rate" 2023-05-02 18:22:48 -07:00
clk-composite-93.c clk: imx: imx93: add mcore_booted module paratemter 2023-04-09 16:48:54 +03:00
clk-cpu.c clk: imx: Support building i.MX common clock driver as module 2020-08-22 12:38:20 +08:00
clk-divider-gate.c clk: imx: clk-divider-gate: Switch to clk_divider.determine_rate 2021-08-24 16:09:07 +03:00
clk-fixup-div.c clk: imx: drop redundant initialization 2020-02-17 14:32:32 +08:00
clk-fixup-mux.c clk: imx: fixup-mux: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
clk-frac-pll.c clk: imx: Support building i.MX common clock driver as module 2020-08-22 12:38:20 +08:00
clk-fracn-gppll.c clk: imx: fracn-gppll: Add 300MHz freq support for imx9 2023-04-09 16:48:54 +03:00
clk-gate-93.c clk: imx: add i.MX93 clk gate 2022-09-19 13:06:45 +03:00
clk-gate-exclusive.c This round of clk driver and framework updates is heavy on the driver update 2019-07-17 10:07:48 -07:00
clk-gate2.c clk: imx: gate2: Remove unused variable ret 2020-11-10 09:08:03 +08:00
clk-gpr-mux.c clk: imx: clk-gpr-mux: Provide clock name in error message 2023-03-31 15:42:32 +03:00
clk-imx1.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336 2019-06-05 17:37:07 +02:00
clk-imx5.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx6q.c clk: imx6q: add ethernet refclock mux support 2023-01-31 14:45:03 +02:00
clk-imx6sl.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx6sll.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx6sx.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx6ul.c clk: imx6ul: fix "failed to get parent" error 2023-03-20 14:25:38 -07:00
clk-imx7d.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx7ulp.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx8dxl-rsrc.c clk: imx: Add imx8dxl clk driver 2022-01-29 15:12:07 +02:00
clk-imx8mm.c clk: imx8mm: Let IMX8MM_CLK_LCDIF_PIXEL set parent rate 2023-03-31 15:27:36 +03:00
clk-imx8mn.c clk: imx: Let IMX8MN_CLK_DISP_PIXEL set parent rate 2023-03-31 15:27:36 +03:00
clk-imx8mp-audiomix.c clk: imx: imx8mp: Add audiomix block control 2023-03-31 15:03:19 +03:00
clk-imx8mp.c clk: imx: imx8mp: change the 'nand_usdhc_bus' clock to non-critical 2023-04-09 16:36:29 +03:00
clk-imx8mq.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx8qm-rsrc.c clk: imx8qm: add clock valid resource checking 2021-06-14 12:33:22 +03:00
clk-imx8qxp-lpcg.c clk: imx: off by one in imx_lpcg_parse_clks_from_dt() 2022-03-04 17:06:29 +02:00
clk-imx8qxp-lpcg.h clk: imx: add imx8qxp lpcg driver 2018-12-14 13:01:14 -08:00
clk-imx8qxp-rsrc.c clk: imx8qxp: add clock valid checking mechnism 2021-06-14 12:33:19 +03:00
clk-imx8qxp.c clk: imx: Add imx8dxl clk driver 2022-01-29 15:12:07 +02:00
clk-imx8ulp.c clk: imx: imx8ulp: update clk flag for system critical clock 2023-04-09 17:12:49 +03:00
clk-imx25.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx27.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx31.c clk: imx: clk-imx31: Remove unused static const table 'uart_clks' 2021-01-29 21:31:52 +08:00
clk-imx35.c clk: imx: remove clk_count of imx_register_uart_clocks 2023-01-29 20:29:29 +02:00
clk-imx93.c clk: imx: imx93: Add nic and A55 clk 2023-04-09 16:48:54 +03:00
clk-imxrt1050.c clk: imx: fix compile testing imxrt1050 2023-02-10 15:25:33 -08:00
clk-lpcg-scu.c clk: imx: Reference preceded by free 2021-04-04 22:39:05 +03:00
clk-pfd.c clk: imx: fix compile testing imxrt1050 2023-02-10 15:25:33 -08:00
clk-pfdv2.c clk: imx: Fix the build break when clk-imx8ulp build as module 2021-10-01 10:15:42 +03:00
clk-pll14xx.c clk: imx: pll14xx: fix recalc_rate for negative kdiv 2023-02-21 09:34:36 -08:00
clk-pllv1.c clk: imx: pllv1: fix kernel-doc notation for struct clk_pllv1 2021-12-02 17:26:40 -08:00
clk-pllv2.c clk: imx: pllv2: Switch to clk_hw based API 2019-12-11 19:19:44 +08:00
clk-pllv3.c clk: imx: fix compile testing imxrt1050 2023-02-10 15:25:33 -08:00
clk-pllv4.c clk: imx: Fix the build break when clk-imx8ulp build as module 2021-10-01 10:15:42 +03:00
clk-scu.c clk: imx: scu: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
clk-scu.h clk: imx: Add imx8dxl clk driver 2022-01-29 15:12:07 +02:00
clk-sscg-pll.c clk: imx: remove redundant re-assignment of pll->base 2022-03-09 10:39:25 -08:00
clk-vf610.c clk: imx: vf610: Add CRC clock 2020-08-23 10:08:35 +08:00
clk.c clk: imx: add imx_obtain_fixed_of_clock() 2023-01-31 14:45:14 +02:00
clk.h clk: imx: imx8ulp: Add divider closest support to get more accurate clock rate 2023-04-09 17:12:49 +03:00
Kconfig clk: imx: fix compile testing imxrt1050 2023-02-10 15:25:33 -08:00
Makefile clk: imx: imx8mp: Add audiomix block control 2023-03-31 15:03:19 +03:00