linux/drivers/clk
Maxime Ripard 326cc42f9f clk: Forbid to register a mux without determine_rate
The determine_rate hook allows to select the proper parent and its rate
for a given clock configuration. On another hand, set_parent is there to
change the parent of a mux.

Some clocks provide a set_parent hook but don't implement
determine_rate. In such a case, set_parent is pretty much useless since
the clock framework will always assume the current parent is to be used,
and we will thus never change it.

This situation can be solved in two ways:
  - either we don't need to change the parent, and we thus shouldn't
    implement set_parent;
  - or we don't want to change the parent, in this case we should set
    CLK_SET_RATE_NO_REPARENT;
  - or we're missing a determine_rate implementation.

The latter is probably just an oversight from the driver's author, and
we should thus raise their awareness about the fact that the current
state of the driver is confusing.

All the drivers in-tree have been converted by now, so let's prevent any
clock with set_parent but without determine_rate to register so that it
can't sneak in again in the future.

Cc: Abel Vesa <abelvesa@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@gmail.com>
Cc: David Lechner <david@lechnology.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Kishon Vijay Abraham I <kishon@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Markus Schneider-Pargmann <msp@baylibre.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: Samuel Holland <samuel@sholland.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-actions@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@vger.kernel.org
Cc: linux-phy@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-rtc@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-sunxi@lists.linux.dev
Cc: linux-tegra@vger.kernel.org
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: patches@opensource.cirrus.com
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-68-971d5077e7d2@cerno.tech
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2023-06-08 18:39:36 -07:00
..
actions clk: actions: composite: fact: Switch to determine_rate 2023-06-08 18:39:32 -07:00
analogbits
at91 clk: at91: smd: Switch to determine_rate 2023-06-08 18:39:32 -07:00
axis
axs10x clk: axs10x: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
baikal-t1 clk: baikal-t1: Convert to platform device driver 2022-09-30 14:20:56 -07:00
bcm Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
berlin clk: berlin: div: Add a determine_rate hook 2023-06-08 18:39:26 -07:00
davinci clk: da8xx: clk48: Switch to determine_rate 2023-06-08 18:39:34 -07:00
hisilicon Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
imgtec
imx clk: imx: scu: Switch to determine_rate 2023-06-08 18:39:34 -07:00
ingenic clk: ingenic: tcu: Switch to determine_rate 2023-06-08 18:39:34 -07:00
keystone clk: keystone: Convert to platform remove callback returning void 2023-03-28 19:23:38 -07:00
mediatek clk: mediatek: cpumux: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
meson clk: meson: clk-cpu-dyndiv: switch from .round_rate to .determine_rate 2023-01-13 15:14:12 +01:00
microchip Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
mmp clk: mmp: Convert to platform remove callback returning void 2023-03-28 19:31:44 -07:00
mstar clk: mstar: msc313 cpupll clk driver 2022-10-27 11:44:27 -07:00
mvebu clk: mvebu: Convert to platform remove callback returning void 2023-03-28 19:31:44 -07:00
mxs
nxp clk: nxp: fix typo in comment 2022-10-03 12:34:32 -07:00
pistachio clk: pistachio: Fix initconst confusion 2022-09-28 18:35:45 -07:00
pxa clk: pxa: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
qcom clk: qcom: gcc-sc8280xp: Add EMAC GDSCs 2023-04-24 07:22:01 -07:00
ralink clk: ralink: fix 'mt7621_gate_is_enabled()' function 2023-02-10 16:07:56 -08:00
renesas clk: renesas: r9a06g032: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
rockchip Merge branches 'clk-of', 'clk-samsung', 'clk-rockchip' and 'clk-qcom' into clk-next 2023-04-25 11:52:25 -07:00
samsung clk: samsung: exynos850: Make PMU_ALIVE_PCLK critical 2023-03-13 08:24:57 +01:00
sifive clk: sifive: make SiFive clk drivers depend on ARCH_ symbols 2023-04-10 13:00:59 -07:00
socfpga clk: socfpga: gate: Add a determine_rate hook 2023-06-08 18:39:29 -07:00
spear clk: spear: Fix SSP clock definition on SPEAr600 2022-11-22 18:03:52 -08:00
sprd clk: sprd: composite: Switch to determine_rate 2023-06-08 18:39:34 -07:00
st clk: st: flexgen: Switch to determine_rate 2023-06-08 18:39:35 -07:00
starfive clk: starfive: Fix RESET_STARFIVE_JH7110 can't be selected in a specified case 2023-05-02 18:34:49 -07:00
stm32 clk: stm32: composite: Switch to determine_rate 2023-06-08 18:39:35 -07:00
sunxi clk: sunxi: Do not select the PRCM MFD 2022-07-04 21:59:30 +02:00
sunxi-ng clk: sunxi-ng: d1: Add CAN bus gates and resets 2023-01-08 22:06:10 +01:00
tegra clk: tegra: super: Switch to determine_rate 2023-06-08 18:39:35 -07:00
ti Merge branches 'clk-xilinx', 'clk-broadcom' and 'clk-platform' into clk-next 2023-04-25 11:50:36 -07:00
uniphier clk: uniphier: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:25 -07:00
ux500 clk: ux500: sysctrl: Add a determine_rate hook 2023-06-08 18:39:30 -07:00
versatile clk: versatile: sp810: Add a determine_rate hook 2023-06-08 18:39:31 -07:00
visconti clk: visconti: remove unused visconti_pll_provider::regmap 2023-03-06 11:43:29 -08:00
x86 clk: x86: Convert to platform remove callback returning void 2023-03-28 19:31:45 -07:00
xilinx Merge branches 'clk-xilinx', 'clk-broadcom' and 'clk-platform' into clk-next 2023-04-25 11:50:36 -07:00
zynq
zynqmp clk: zynqmp: pll: Remove the limit 2023-03-27 12:08:28 -07:00
.kunitconfig clk: explicitly disable CONFIG_UML_PCI_OVER_VIRTIO in .kunitconfig 2022-07-14 10:35:44 -06:00
clk-apple-nco.c
clk-asm9260.c clk: asm9260: use parent index to link the reference clock 2022-09-29 17:55:26 -07:00
clk-aspeed.c
clk-aspeed.h
clk-ast2600.c clk: ast2600: Add comment about combined clock + reset handling 2023-03-06 14:11:29 -08:00
clk-axi-clkgen.c clk: axi-clkgen: Switch to determine_rate 2023-06-08 18:39:33 -07:00
clk-axm5516.c clk: axm5516: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
clk-bd718x7.c
clk-bm1880.c clk: bm1880: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:50 -07:00
clk-bulk.c clk: bulk: Use dev_err_probe() helper in __clk_bulk_get() 2022-10-17 16:07:51 -07:00
clk-cdce706.c clk: cdce706: clkout: Switch to determine_rate 2023-06-08 18:39:33 -07:00
clk-cdce925.c clk: cdce925: simplify using devm_regulator_get_enable() 2022-10-17 16:06:49 -07:00
clk-clps711x.c
clk-composite.c clk: Stop forwarding clk_rate_requests to the parent 2022-09-15 09:32:11 -07:00
clk-conf.c clk: add missing of_node_put() in "assigned-clocks" property parsing 2023-03-29 13:53:28 -07:00
clk-cs2000-cp.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
clk-devres.c
clk-divider.c clk: Introduce clk_hw_init_rate_request() 2022-09-15 09:31:40 -07:00
clk-en7523.c
clk-fixed-factor.c clk: fixed-factor: Convert to platform remove callback returning void 2023-03-28 19:23:36 -07:00
clk-fixed-mmio.c Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
clk-fixed-rate.c clk: fixed-rate: Convert to platform remove callback returning void 2023-03-28 19:23:36 -07:00
clk-fractional-divider.c clk: Compute masks for fractional_divider clk when needed. 2023-04-05 12:09:26 -07:00
clk-fractional-divider.h
clk-fsl-flexspi.c
clk-fsl-sai.c kbuild, clk: remove MODULE_LICENSE in non-modules 2023-03-06 11:29:18 -08:00
clk-gate.c
clk-gate_test.c
clk-gemini.c
clk-gpio.c
clk-hi655x.c
clk-highbank.c
clk-hsdk-pll.c clk: hsdk-pll: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
clk-k210.c clk: k210: mux: Add a determine_rate hook 2023-06-08 18:39:27 -07:00
clk-lan966x.c clk: lan966x: Remove unused round_rate hook 2023-06-08 18:39:25 -07:00
clk-lmk04832.c clk: lmk04832: clkout: Add a determine_rate hook 2023-06-08 18:39:27 -07:00
clk-lochnagar.c clk: lochnagar: Add a determine_rate hook 2023-06-08 18:39:27 -07:00
clk-loongson1.c clk: loongson1: Re-implement the clock driver 2023-03-21 16:34:23 -07:00
clk-loongson2.c clk: clk-loongson2: add clock controller driver support 2023-03-27 12:15:26 -07:00
clk-max9485.c
clk-max77686.c
clk-milbeaut.c clock: milbeaut: use devm_platform_get_and_ioremap_resource() 2023-03-29 14:48:32 -07:00
clk-moxart.c
clk-multiplier.c
clk-mux.c
clk-nomadik.c clk: nomadik: correct struct name kernel-doc warning 2022-12-09 10:26:25 -08:00
clk-npcm7xx.c clk: clk-npcm7xx: Remove unused struct npcm7xx_clk_gate_data and npcm7xx_clk_div_fixed_data 2022-09-28 17:39:04 -07:00
clk-nspire.c
clk-oxnas.c clk: oxnas: Hold reference returned by of_get_parent() 2022-08-19 14:35:43 -07:00
clk-palmas.c clk: palmas: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-plldig.c
clk-pwm.c clk: pwm: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-qoriq.c clk: qoriq: Add a determine_rate hook 2023-06-08 18:39:27 -07:00
clk-renesas-pcie.c Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
clk-rk808.c
clk-s2mps11.c clk: s2mps11: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-scmi.c
clk-scpi.c clk: scpi: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-si514.c clk: si514: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:24 -07:00
clk-si521xx.c clk: si521xx: Clock driver for Skyworks Si521xx I2C PCIe clock generators 2023-03-27 10:47:42 -07:00
clk-si544.c
clk-si570.c clk: si570: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:24 -07:00
clk-si5341.c clk: si5341: Switch to determine_rate 2023-06-08 18:39:33 -07:00
clk-si5351.c clk: si5351: clkout: Switch to determine_rate 2023-06-08 18:39:34 -07:00
clk-si5351.h
clk-sp7021.c clk: sp7021: Adjust width of _m in HWM_FIELD_PREP() 2023-05-02 18:34:26 -07:00
clk-sparx5.c
clk-stm32f4.c clk: stm32f4: mux: Add a determine_rate hook 2023-06-08 18:39:27 -07:00
clk-stm32h7.c clk: stm32h7: Remove an unused field in struct stm32_fractional_divider 2023-04-03 14:10:42 -07:00
clk-stm32mp1.c clk: stm32mp1: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-tps68470.c platform/x86: int3472: Support multiple clock consumers 2022-09-24 19:12:32 +02:00
clk-twl6040.c
clk-versaclock5.c clk: vc5: clkout: Add a determine_rate hook 2023-06-08 18:39:28 -07:00
clk-versaclock7.c Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
clk-vt8500.c
clk-wm831x.c clk: wm831x: clkout: Add a determine_rate hook 2023-06-08 18:39:28 -07:00
clk-xgene.c clk: clk-xgene: simplify if-if to if-else 2022-10-03 14:13:29 -07:00
clk.c clk: Forbid to register a mux without determine_rate 2023-06-08 18:39:36 -07:00
clk.h
clk_test.c clk: test: Add a determine_rate hook 2023-06-08 18:39:25 -07:00
clkdev.c clkdev: Simplify devm_clk_hw_register_clkdev() function 2022-09-30 14:50:11 -07:00
Kconfig Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
Makefile Merge branches 'clk-starfive', 'clk-fractional' and 'clk-devmof' into clk-next 2023-04-25 11:50:49 -07:00