From: Rex-BC Chen <rex-bc.chen@mediatek.com>
To: <mturquette@baylibre.com>, <sboyd@kernel.org>
Cc: <matthias.bgg@gmail.com>, <p.zabel@pengutronix.de>,
<angelogioacchino.delregno@collabora.com>,
<chun-jie.chen@mediatek.com>, <wenst@chromium.org>,
<yong.liang@mediatek.com>, <runyang.chen@mediatek.com>,
<linux-kernel@vger.kernel.org>, <allen-kh.cheng@mediatek.com>,
<linux-clk@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
Rex-BC Chen <rex-bc.chen@mediatek.com>
Subject: [PATCH 7/7] clk: mediatek: reset: Add reset support for simple probe/remove
Date: Mon, 18 Apr 2022 21:21:54 +0800 [thread overview]
Message-ID: <20220418132154.7401-8-rex-bc.chen@mediatek.com> (raw)
In-Reply-To: <20220418132154.7401-1-rex-bc.chen@mediatek.com>
- 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(+)
diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index b4063261cf56..4ecdf0be26d5 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -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);
diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h
index dfb0549ceb6c..453d12cb57ac 100644
--- a/drivers/clk/mediatek/clk-mtk.h
+++ b/drivers/clk/mediatek/clk-mtk.h
@@ -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);
--
2.18.0
prev parent reply other threads:[~2022-04-18 14:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 13:21 [PATCH 0/7] Cleanup MediaTek clk reset drivers Rex-BC Chen
2022-04-18 13:21 ` [PATCH 1/7] clk: mediatek: reset: Correct the logic of setting register Rex-BC Chen
2022-04-19 5:48 ` Chen-Yu Tsai
2022-04-19 6:38 ` Rex-BC Chen
2022-04-18 13:21 ` [PATCH 2/7] clk: mediatek: reset: Rename reset function Rex-BC Chen
2022-04-19 5:57 ` Chen-Yu Tsai
2022-04-19 6:37 ` Rex-BC Chen
2022-04-19 6:59 ` Chen-Yu Tsai
2022-04-18 13:21 ` [PATCH 3/7] clk: mediatek: reset: Merge and revise reset register function Rex-BC Chen
2022-04-19 7:26 ` Chen-Yu Tsai
2022-04-19 8:15 ` Rex-BC Chen
2022-04-18 13:21 ` [PATCH 4/7] clk: mediatek: reset: Add reset.h Rex-BC Chen
2022-04-19 10:46 ` AngeloGioacchino Del Regno
2022-04-20 2:16 ` Rex-BC Chen
2022-04-18 13:21 ` [PATCH 5/7] clk: mediatek: reset: Revise structure to control reset register Rex-BC Chen
2022-04-19 10:46 ` AngeloGioacchino Del Regno
2022-04-20 2:20 ` Rex-BC Chen
2022-04-18 13:21 ` [PATCH 6/7] clk: mediatek: reset: Add support for unregister reset controller Rex-BC Chen
2022-04-18 13:21 ` Rex-BC Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220418132154.7401-8-rex-bc.chen@mediatek.com \
--to=rex-bc.chen@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=allen-kh.cheng@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chun-jie.chen@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=runyang.chen@mediatek.com \
--cc=sboyd@kernel.org \
--cc=wenst@chromium.org \
--cc=yong.liang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox