@@ -453,6 +453,9 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, clk_data);
+ if (mcd->rst && mcd->rst->supported)
+ r = mtk_clk_register_rst_ctrl(node, mcd->rst);
+
return r;
unregister_clks:
@@ -468,6 +471,9 @@ int mtk_clk_simple_remove(struct platform_device *pdev)
struct clk_onecell_data *clk_data = platform_get_drvdata(pdev);
struct device_node *node = pdev->dev.of_node;
+ if (mcd->rst && mcd->rst->supported)
+ mtk_clk_unregister_rst_ctrl(mcd->rst);
+
of_clk_del_provider(node);
mtk_clk_unregister_gates(mcd->clks, mcd->num_clks, clk_data);
mtk_free_clk_data(clk_data);
@@ -194,6 +194,7 @@ struct clk *mtk_clk_register_ref2usb_tx(const char *name,
struct mtk_clk_desc {
const struct mtk_gate *clks;
size_t num_clks;
+ struct mtk_clk_rst_data *rst;
};
int mtk_clk_simple_probe(struct platform_device *pdev);
- Add a pointer of "mtk_clk_rst_data" to "mtk_clk_desc". - Add register reset function in mtk_clk_simple_probe(). - Add unregister reset function in mtk_clk_simple_remove(). Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> --- drivers/clk/mediatek/clk-mtk.c | 6 ++++++ drivers/clk/mediatek/clk-mtk.h | 1 + 2 files changed, 7 insertions(+)