Skip to content

Commit f8fd4b5

Browse files
AngeloGioacchino Del Regnowens
authored andcommitted
clk: mediatek: clk-mt8195-topckgen: Add GPU clock mux notifier
Following the changes done to MT8183, register a similar notifier for MT8195 as well, allowing safe clockrate updates for the MFGPLL. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Miles Chen <miles.chen@mediatek.com> Link: https://lore.kernel.org/r/20220927101128.44758-8-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
1 parent deeb2af commit f8fd4b5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/clk/mediatek/clk-mt8195-topckgen.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,21 @@ static const struct of_device_id of_match_clk_mt8195_topck[] = {
12171217
{}
12181218
};
12191219

1220+
/* Register mux notifier for MFG mux */
1221+
static int clk_mt8195_reg_mfg_mux_notifier(struct device *dev, struct clk *clk)
1222+
{
1223+
struct mtk_mux_nb *mfg_mux_nb;
1224+
1225+
mfg_mux_nb = devm_kzalloc(dev, sizeof(*mfg_mux_nb), GFP_KERNEL);
1226+
if (!mfg_mux_nb)
1227+
return -ENOMEM;
1228+
1229+
mfg_mux_nb->ops = &clk_mux_ops;
1230+
mfg_mux_nb->bypass_index = 0; /* Bypass to TOP_MFG_CORE_TMP */
1231+
1232+
return devm_mtk_clk_mux_notifier_register(dev, clk, mfg_mux_nb);
1233+
}
1234+
12201235
static int clk_mt8195_topck_probe(struct platform_device *pdev)
12211236
{
12221237
struct clk_hw_onecell_data *top_clk_data;
@@ -1256,6 +1271,11 @@ static int clk_mt8195_topck_probe(struct platform_device *pdev)
12561271
goto unregister_muxes;
12571272
top_clk_data->hws[CLK_TOP_MFG_CK_FAST_REF] = hw;
12581273

1274+
r = clk_mt8195_reg_mfg_mux_notifier(&pdev->dev,
1275+
top_clk_data->hws[CLK_TOP_MFG_CK_FAST_REF]->clk);
1276+
if (r)
1277+
goto unregister_muxes;
1278+
12591279
r = mtk_clk_register_composites(top_adj_divs, ARRAY_SIZE(top_adj_divs), base,
12601280
&mt8195_clk_lock, top_clk_data);
12611281
if (r)

0 commit comments

Comments
 (0)