[PATCH] clk: mediatek: Fix unused 'ops' field in mtk_pll_data

Boris Lysov arz65xx at gmail.com
Sun May 15 05:24:09 PDT 2022


From: Boris Lysov <arzamas-16 at mail.ee>

Allow to specify optional clk_ops in mtk_pll_data which will be picked up in
mtk_clk_register_pll. So far no already supported Mediatek SoC needs
non-default clk_ops for PLLs but instead of removing this field it will be
actually used in the future for supporting older SoCs (see [1] for details)
with quirky PLLs.

This patch depends on series "clk: mediatek: Move to struct clk_hw provider
APIs" [2] by Chen-Yu Tsai.

[1] https://lists.infradead.org/pipermail/linux-mediatek/2022-February/035093.html
[2] https://lists.infradead.org/pipermail/linux-mediatek/2022-May/040921.html

Signed-off-by: Boris Lysov <arzamas-16 at mail.ee>
---
 drivers/clk/mediatek/clk-pll.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c
index cabdf25a27f3..509959a325f0 100644
--- a/drivers/clk/mediatek/clk-pll.c
+++ b/drivers/clk/mediatek/clk-pll.c
@@ -347,7 +347,10 @@ static struct clk_hw *mtk_clk_register_pll(const struct mtk_pll_data *data,
 
 	init.name = data->name;
 	init.flags = (data->flags & PLL_AO) ? CLK_IS_CRITICAL : 0;
-	init.ops = &mtk_pll_ops;
+	if (data->ops)
+		init.ops = data->ops;
+	else
+		init.ops = &mtk_pll_ops;
 	if (data->parent_name)
 		init.parent_names = &data->parent_name;
 	else
-- 
2.20.1




More information about the Linux-mediatek mailing list