Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

AngeloGioacchino Del Regno and committed by
Stephen Boyd
fd9fe654 d7595dde

+11
+8
drivers/clk/mediatek/clk-mtk.c
··· 534 534 goto unregister_composites; 535 535 } 536 536 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 + 537 545 r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); 538 546 if (r) 539 547 goto unregister_clks;
+3
drivers/clk/mediatek/clk-mtk.h
··· 231 231 const struct mtk_clk_rst_desc *rst_desc; 232 232 spinlock_t *clk_lock; 233 233 bool shared_io; 234 + 235 + int (*clk_notifier_func)(struct device *dev, struct clk *clk); 236 + unsigned int mfg_clk_idx; 234 237 }; 235 238 236 239 int mtk_clk_simple_probe(struct platform_device *pdev);