* [PATCH v3 01/15] clk: imx: scu: drop redundant init.ops variable assignment
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
@ 2026-05-06 0:48 ` Brian Masney
2026-05-06 0:48 ` [PATCH v3 02/15] clk: add clk_determine_rate_noop() Brian Masney
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:48 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Peng Fan, Abel Vesa, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, imx,
linux-arm-kernel
The init.ops is assigned a default value, however right below it is an
if, else if, and else where all of them also assign a value to init.ops.
Drop the redundant init.ops assignment at the top.
Fixes: 3b9ea606cda53 ("clk: imx: scu: add cpu frequency scaling support")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Abel Vesa <abelvesa@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Brian Masney <bmasney@redhat.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
drivers/clk/imx/clk-scu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 9b33df9967ec..658b6d94de9b 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -475,7 +475,6 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
clk->clk_type = clk_type;
init.name = name;
- init.ops = &clk_scu_ops;
if (rsrc_id == IMX_SC_R_A35 || rsrc_id == IMX_SC_R_A53 || rsrc_id == IMX_SC_R_A72)
init.ops = &clk_scu_cpu_ops;
else if (rsrc_id == IMX_SC_R_PI_0_PLL)
--
2.54.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 02/15] clk: add clk_determine_rate_noop()
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
2026-05-06 0:48 ` [PATCH v3 01/15] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
@ 2026-05-06 0:48 ` Brian Masney
2026-05-06 0:49 ` [PATCH v3 04/15] clk: imx: scu: use clk_determine_rate_noop() Brian Masney
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:48 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Abel Vesa, Peng Fan, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Anson Huang,
Bjorn Andersson, Geert Uytterhoeven, Andrea della Porta,
Tudor Ambarus, Krzysztof Kozlowski, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Sudeep Holla, Cristian Marussi,
Orson Zhai, Baolin Wang, Chunyan Zhang, Chun-Kuang Hu,
Philipp Zabel, Chunfeng Yun, Vinod Koul, Neil Armstrong,
Matthias Brugger, AngeloGioacchino Del Regno, Ulf Hansson, imx,
linux-arm-kernel, linux-arm-msm, linux-renesas-soc,
linux-samsung-soc, arm-scmi, dri-devel, linux-mediatek, linux-phy,
linux-pm
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@redhat.com>
---
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney@redhat.com>
To: Abel Vesa <abelvesa@kernel.org>
To: Peng Fan <peng.fan@nxp.com>
To: Frank Li <Frank.Li@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
To: Pengutronix Kernel Team <kernel@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
To: Anson Huang <anson.huang@nxp.com>
To: Bjorn Andersson <andersson@kernel.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>
To: Andrea della Porta <andrea.porta@suse.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Krzysztof Kozlowski <krzk@kernel.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
To: Alim Akhtar <alim.akhtar@samsung.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
To: Cristian Marussi <cristian.marussi@arm.com>
To: Orson Zhai <orsonzhai@gmail.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Chunyan Zhang <zhang.lyra@gmail.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Vinod Koul <vkoul@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Ulf Hansson <ulfh@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: arm-scmi@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-phy@lists.infradead.org
Cc: linux-pm@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
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 04/15] clk: imx: scu: use clk_determine_rate_noop()
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
2026-05-06 0:48 ` [PATCH v3 01/15] clk: imx: scu: drop redundant init.ops variable assignment Brian Masney
2026-05-06 0:48 ` [PATCH v3 02/15] clk: add clk_determine_rate_noop() Brian Masney
@ 2026-05-06 0:49 ` Brian Masney
2026-05-06 0:49 ` [PATCH v3 11/15] clk: scpi: " Brian Masney
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:49 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Abel Vesa, Frank Li, Sascha Hauer,
Peng Fan, Pengutronix Kernel Team, Fabio Estevam, imx,
linux-arm-kernel
Drop the driver-specific empty determine_rate() function and use the new
shared clk_determine_rate_noop() helper.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Abel Vesa <abelvesa@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Frank Li <Frank.Li@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Brian Masney <bmasney@redhat.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
drivers/clk/imx/clk-scu.c | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 658b6d94de9b..44220e9c5c2a 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -262,23 +262,6 @@ static unsigned long clk_scu_recalc_rate(struct clk_hw *hw,
return le32_to_cpu(msg.data.resp.rate);
}
-/*
- * clk_scu_determine_rate - Returns the closest rate for a SCU clock
- * @hw: clock to round rate for
- * @req: clock rate request
- *
- * Returns 0 on success, a negative error on failure
- */
-static int clk_scu_determine_rate(struct clk_hw *hw,
- struct clk_rate_request *req)
-{
- /*
- * Assume we support all the requested rate and let the SCU firmware
- * to handle the left work
- */
- return 0;
-}
-
static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
@@ -436,7 +419,7 @@ static void clk_scu_unprepare(struct clk_hw *hw)
static const struct clk_ops clk_scu_ops = {
.recalc_rate = clk_scu_recalc_rate,
- .determine_rate = clk_scu_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
.set_rate = clk_scu_set_rate,
.get_parent = clk_scu_get_parent,
.set_parent = clk_scu_set_parent,
@@ -446,7 +429,7 @@ static const struct clk_ops clk_scu_ops = {
static const struct clk_ops clk_scu_cpu_ops = {
.recalc_rate = clk_scu_recalc_rate,
- .determine_rate = clk_scu_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
.set_rate = clk_scu_atf_set_cpu_rate,
.prepare = clk_scu_prepare,
.unprepare = clk_scu_unprepare,
@@ -454,7 +437,7 @@ static const struct clk_ops clk_scu_cpu_ops = {
static const struct clk_ops clk_scu_pi_ops = {
.recalc_rate = clk_scu_recalc_rate,
- .determine_rate = clk_scu_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
.set_rate = clk_scu_set_rate,
};
--
2.54.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 11/15] clk: scpi: use clk_determine_rate_noop()
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
` (2 preceding siblings ...)
2026-05-06 0:49 ` [PATCH v3 04/15] clk: imx: scu: use clk_determine_rate_noop() Brian Masney
@ 2026-05-06 0:49 ` Brian Masney
2026-05-06 0:49 ` [PATCH v3 13/15] phy: mediatek: phy-mtk-hdmi-mt2701: " Brian Masney
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:49 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Sudeep Holla, Cristian Marussi, arm-scmi,
linux-arm-kernel
Drop the driver-specific empty determine_rate() function and use the new
shared clk_determine_rate_noop() helper.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Sudeep Holla <sudeep.holla@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Cristian Marussi <cristian.marussi@arm.com>
Cc: Brian Masney <bmasney@redhat.com>
Cc: arm-scmi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/clk/clk-scpi.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 7806569cd0d5..650c85aa0328 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -32,18 +32,6 @@ static unsigned long scpi_clk_recalc_rate(struct clk_hw *hw,
return clk->scpi_ops->clk_get_val(clk->id);
}
-static int scpi_clk_determine_rate(struct clk_hw *hw,
- struct clk_rate_request *req)
-{
- /*
- * We can't figure out what rate it will be, so just return the
- * rate back to the caller. scpi_clk_recalc_rate() will be called
- * after the rate is set and we'll know what rate the clock is
- * running at then.
- */
- return 0;
-}
-
static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
@@ -54,7 +42,7 @@ static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
static const struct clk_ops scpi_clk_ops = {
.recalc_rate = scpi_clk_recalc_rate,
- .determine_rate = scpi_clk_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
.set_rate = scpi_clk_set_rate,
};
--
2.54.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 13/15] phy: mediatek: phy-mtk-hdmi-mt2701: use clk_determine_rate_noop()
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
` (3 preceding siblings ...)
2026-05-06 0:49 ` [PATCH v3 11/15] clk: scpi: " Brian Masney
@ 2026-05-06 0:49 ` Brian Masney
2026-05-10 10:17 ` Vinod Koul
2026-05-06 0:49 ` [PATCH v3 14/15] pmdomain: mediatek: airoha: " Brian Masney
2026-05-06 0:49 ` [PATCH v3 15/15] pmdomain: mediatek: mtk-mfg: " Brian Masney
6 siblings, 1 reply; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:49 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Chun-Kuang Hu, Philipp Zabel,
Chunfeng Yun, Vinod Koul, Matthias Brugger,
AngeloGioacchino Del Regno, Neil Armstrong, dri-devel,
linux-mediatek, linux-arm-kernel, linux-phy
Drop the driver-specific empty determine_rate() function and use the new
shared clk_determine_rate_noop() helper.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Vinod Koul <vkoul@kernel.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney@redhat.com>
Cc: linux-clk@vger.kernel.org
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-phy@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c b/drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c
index b0b6497e7eed..c9a1f20e939b 100644
--- a/drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c
+++ b/drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c
@@ -90,12 +90,6 @@ static void mtk_hdmi_pll_unprepare(struct clk_hw *hw)
usleep_range(80, 100);
}
-static int mtk_hdmi_pll_determine_rate(struct clk_hw *hw,
- struct clk_rate_request *req)
-{
- return 0;
-}
-
static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
@@ -170,7 +164,7 @@ static const struct clk_ops mtk_hdmi_phy_pll_ops = {
.prepare = mtk_hdmi_pll_prepare,
.unprepare = mtk_hdmi_pll_unprepare,
.set_rate = mtk_hdmi_pll_set_rate,
- .determine_rate = mtk_hdmi_pll_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
.recalc_rate = mtk_hdmi_pll_recalc_rate,
};
--
2.54.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3 13/15] phy: mediatek: phy-mtk-hdmi-mt2701: use clk_determine_rate_noop()
2026-05-06 0:49 ` [PATCH v3 13/15] phy: mediatek: phy-mtk-hdmi-mt2701: " Brian Masney
@ 2026-05-10 10:17 ` Vinod Koul
0 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2026-05-10 10:17 UTC (permalink / raw)
To: Brian Masney
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel,
Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun, Matthias Brugger,
AngeloGioacchino Del Regno, Neil Armstrong, dri-devel,
linux-mediatek, linux-arm-kernel, linux-phy
On 05-05-26, 20:49, Brian Masney wrote:
> Drop the driver-specific empty determine_rate() function and use the new
> shared clk_determine_rate_noop() helper.
Acked-by: Vinod Koul <vkoul@kernel.org>
--
~Vinod
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 14/15] pmdomain: mediatek: airoha: use clk_determine_rate_noop()
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
` (4 preceding siblings ...)
2026-05-06 0:49 ` [PATCH v3 13/15] phy: mediatek: phy-mtk-hdmi-mt2701: " Brian Masney
@ 2026-05-06 0:49 ` Brian Masney
2026-05-06 0:49 ` [PATCH v3 15/15] pmdomain: mediatek: mtk-mfg: " Brian Masney
6 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:49 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Ulf Hansson, Matthias Brugger,
AngeloGioacchino Del Regno, linux-pm, linux-arm-kernel,
linux-mediatek
Drop the driver-specific empty determine_rate() function and use the new
shared clk_determine_rate_noop() helper.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Ulf Hansson <ulfh@kernel.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney@redhat.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c b/drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
index 3b1d202f89dc..5efd7a38f4da 100644
--- a/drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
+++ b/drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
@@ -21,12 +21,6 @@ struct airoha_cpu_pmdomain_priv {
struct generic_pm_domain pd;
};
-static int airoha_cpu_pmdomain_clk_determine_rate(struct clk_hw *hw,
- struct clk_rate_request *req)
-{
- return 0;
-}
-
static unsigned long airoha_cpu_pmdomain_clk_get(struct clk_hw *hw,
unsigned long parent_rate)
{
@@ -48,7 +42,7 @@ static int airoha_cpu_pmdomain_clk_is_enabled(struct clk_hw *hw)
static const struct clk_ops airoha_cpu_pmdomain_clk_ops = {
.recalc_rate = airoha_cpu_pmdomain_clk_get,
.is_enabled = airoha_cpu_pmdomain_clk_is_enabled,
- .determine_rate = airoha_cpu_pmdomain_clk_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
};
static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,
--
2.54.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 15/15] pmdomain: mediatek: mtk-mfg: use clk_determine_rate_noop()
2026-05-06 0:48 [PATCH v3 00/15] clk: introduce clk_determine_rate_noop() and update drivers to use it Brian Masney
` (5 preceding siblings ...)
2026-05-06 0:49 ` [PATCH v3 14/15] pmdomain: mediatek: airoha: " Brian Masney
@ 2026-05-06 0:49 ` Brian Masney
6 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2026-05-06 0:49 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney
Cc: linux-clk, linux-kernel, Ulf Hansson, Matthias Brugger,
AngeloGioacchino Del Regno, linux-pm, linux-arm-kernel,
linux-mediatek
Drop the driver-specific empty determine_rate() function and use the new
shared clk_determine_rate_noop() helper.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
To: Ulf Hansson <ulfh@kernel.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney@redhat.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c b/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c
index 3ce6fb74dd53..64fef838776e 100644
--- a/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c
+++ b/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c
@@ -310,25 +310,6 @@ static unsigned long mtk_mfg_recalc_rate_gpu(struct clk_hw *hw,
return readl(mfg->shared_mem + GF_REG_FREQ_OUT_GPU) * HZ_PER_KHZ;
}
-static int mtk_mfg_determine_rate(struct clk_hw *hw,
- struct clk_rate_request *req)
-{
- /*
- * The determine_rate callback needs to be implemented to avoid returning
- * the current clock frequency, rather than something even remotely
- * close to the frequency that was asked for.
- *
- * Instead of writing considerable amounts of possibly slow code just to
- * somehow figure out which of the three PLLs to round for, or even to
- * do a search through one of two OPP tables in order to find the closest
- * OPP of a frequency, just return the rate as-is. This avoids devfreq
- * "rounding" a request for the lowest frequency to the possibly very
- * high current frequency, breaking the powersave governor in the process.
- */
-
- return 0;
-}
-
static unsigned long mtk_mfg_recalc_rate_stack(struct clk_hw *hw,
unsigned long parent_rate)
{
@@ -339,12 +320,12 @@ static unsigned long mtk_mfg_recalc_rate_stack(struct clk_hw *hw,
static const struct clk_ops mtk_mfg_clk_gpu_ops = {
.recalc_rate = mtk_mfg_recalc_rate_gpu,
- .determine_rate = mtk_mfg_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
};
static const struct clk_ops mtk_mfg_clk_stack_ops = {
.recalc_rate = mtk_mfg_recalc_rate_stack,
- .determine_rate = mtk_mfg_determine_rate,
+ .determine_rate = clk_determine_rate_noop,
};
static const struct clk_init_data mtk_mfg_clk_gpu_init = {
--
2.54.0
^ permalink raw reply related [flat|nested] 9+ messages in thread