Skip to content

Commit fd9fe65

Browse files
AngeloGioacchino Del Regnobebarino
authored andcommitted
clk: mediatek: clk-mtk: Register MFG notifier in mtk_clk_simple_probe()
In preparation for commonizing topckgen probe on various MediaTek SoCs clock drivers, add the ability to register the MFG MUX notifier in mtk_clk_simple_probe() by passing a custom notifier register function pointer, as this function will be slightly different across different SoCs. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Miles Chen <miles.chen@mediatek.com> Link: https://lore.kernel.org/r/20230120092053.182923-19-angelogioacchino.delregno@collabora.com Tested-by: Mingming Su <mingming.su@mediatek.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent d7595dd commit fd9fe65

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/clk/mediatek/clk-mtk.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,14 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
534534
goto unregister_composites;
535535
}
536536

537+
if (mcd->clk_notifier_func) {
538+
struct clk *mfg_mux = clk_data->hws[mcd->mfg_clk_idx]->clk;
539+
540+
r = mcd->clk_notifier_func(&pdev->dev, mfg_mux);
541+
if (r)
542+
goto unregister_clks;
543+
}
544+
537545
r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
538546
if (r)
539547
goto unregister_clks;

drivers/clk/mediatek/clk-mtk.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ struct mtk_clk_desc {
231231
const struct mtk_clk_rst_desc *rst_desc;
232232
spinlock_t *clk_lock;
233233
bool shared_io;
234+
235+
int (*clk_notifier_func)(struct device *dev, struct clk *clk);
236+
unsigned int mfg_clk_idx;
234237
};
235238

236239
int mtk_clk_simple_probe(struct platform_device *pdev);

0 commit comments

Comments
 (0)