[PATCH v3 02/15] clk: add clk_determine_rate_noop()

Brian Masney bmasney at redhat.com
Tue May 5 17:48:58 PDT 2026


Add a new helper clk_determine_rate_noop() that's for clocks where the
rate rounding is handled by the firmware/hardware, or the clock is
capable of any rate. The requested rate is passed through unchanged,
and the actual rate will be learned via recalc_rate() after the rate
is set.

This shared helper will be used to get rid of the driver-specific empty
determine rate implementations that are present in the tree.

Signed-off-by: Brian Masney <bmasney at redhat.com>
---
To: Michael Turquette <mturquette at baylibre.com>
To: Stephen Boyd <sboyd at kernel.org>
To: Brian Masney <bmasney at redhat.com>
To: Abel Vesa <abelvesa at kernel.org>
To: Peng Fan <peng.fan at nxp.com>
To: Frank Li <Frank.Li at nxp.com>
To: Sascha Hauer <s.hauer at pengutronix.de>
To: Pengutronix Kernel Team <kernel at pengutronix.de>
To: Fabio Estevam <festevam at gmail.com>
To: Anson Huang <anson.huang at nxp.com>
To: Bjorn Andersson <andersson at kernel.org>
To: Geert Uytterhoeven <geert+renesas at glider.be>
To: Andrea della Porta <andrea.porta at suse.com>
To: Tudor Ambarus <tudor.ambarus at linaro.org>
To: Krzysztof Kozlowski <krzk at kernel.org>
To: Sylwester Nawrocki <s.nawrocki at samsung.com>
To: Chanwoo Choi <cw00.choi at samsung.com>
To: Alim Akhtar <alim.akhtar at samsung.com>
To: Sudeep Holla <sudeep.holla at kernel.org>
To: Cristian Marussi <cristian.marussi at arm.com>
To: Orson Zhai <orsonzhai at gmail.com>
To: Baolin Wang <baolin.wang at linux.alibaba.com>
To: Chunyan Zhang <zhang.lyra at gmail.com>
To: Chun-Kuang Hu <chunkuang.hu at kernel.org>
To: Philipp Zabel <p.zabel at pengutronix.de>
To: Chunfeng Yun <chunfeng.yun at mediatek.com>
To: Vinod Koul <vkoul at kernel.org>
To: Neil Armstrong <neil.armstrong at linaro.org>
To: Matthias Brugger <matthias.bgg at gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
To: Ulf Hansson <ulfh at kernel.org>
Cc: linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: imx at lists.linux.dev
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-arm-msm at vger.kernel.org
Cc: linux-renesas-soc at vger.kernel.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: arm-scmi at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: linux-mediatek at lists.infradead.org
Cc: linux-phy at lists.infradead.org
Cc: linux-pm at vger.kernel.org
---
 drivers/clk/clk.c            | 18 ++++++++++++++++++
 include/linux/clk-provider.h |  1 +
 2 files changed, 19 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 048adfa86a5d..956e147f4d4e 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -882,6 +882,24 @@ int clk_hw_determine_rate_no_reparent(struct clk_hw *hw,
 }
 EXPORT_SYMBOL_GPL(clk_hw_determine_rate_no_reparent);
 
+/**
+ * clk_determine_rate_noop - clk_ops::determine_rate noop implementation
+ * @hw: clk to determine rate on
+ * @req: rate request
+ *
+ * Noop determine rate for clocks where the rate rounding is handled by the
+ * firmware/hardware, or the clock is capable of any rate. The requested rate is
+ * passed through unchanged, and the actual rate will be learned via
+ * recalc_rate() after the rate is set.
+ *
+ * Returns: 0 always
+ */
+int clk_determine_rate_noop(struct clk_hw *hw, struct clk_rate_request *req)
+{
+	return 0;
+}
+EXPORT_SYMBOL_GPL(clk_determine_rate_noop);
+
 /***        clk api        ***/
 
 static void clk_core_rate_unprotect(struct clk_core *core)
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index b01a38fef8cf..334b9211a157 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -1431,6 +1431,7 @@ int clk_mux_determine_rate_flags(struct clk_hw *hw,
 				 unsigned long flags);
 int clk_hw_determine_rate_no_reparent(struct clk_hw *hw,
 				      struct clk_rate_request *req);
+int clk_determine_rate_noop(struct clk_hw *hw, struct clk_rate_request *req);
 void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent);
 void clk_hw_get_rate_range(struct clk_hw *hw, unsigned long *min_rate,
 			   unsigned long *max_rate);

-- 
2.54.0




More information about the linux-arm-kernel mailing list