The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Flora Fu <flora.fu@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>,
	Pi-Cheng Chen <pi-cheng.chen@mediatek.com>,
	Yong Wu <yong.wu@mediatek.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	Flora Fu <flora.fu@mediatek.com>, JB Tsai <jb.tsai@mediatek.com>
Subject: [PATCH 06/12] soc: mediatek: apu: Add MT8195 APU power driver
Date: Sat, 11 Dec 2021 01:52:17 +0800	[thread overview]
Message-ID: <20211210175223.31131-7-flora.fu@mediatek.com> (raw)
In-Reply-To: <20211210175223.31131-1-flora.fu@mediatek.com>

Add APU power driver for MT8195 to support for
subsys clock and regulator controller.

Signed-off-by: Flora Fu <flora.fu@mediatek.com>

---
 drivers/soc/mediatek/apusys/apu-pwr.c | 34 ++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/apusys/apu-pwr.c b/drivers/soc/mediatek/apusys/apu-pwr.c
index e8e54a767aff..73e08b442558 100644
--- a/drivers/soc/mediatek/apusys/apu-pwr.c
+++ b/drivers/soc/mediatek/apusys/apu-pwr.c
@@ -578,10 +578,25 @@ static struct apupwr_plat_data mt8192_apu_power_data = {
 	.ops = &mt8192_pwr_ops,
 };
 
+static const struct apupwr_plat_reg mt8195_pwr_reg = {
+	.opp_user = 0x40,
+	.opp_thermal = 0x44,
+	.opp_curr = 0x48,
+	.opp_mask = 0xF,
+};
+
+static struct apupwr_plat_data mt8195_apu_power_data = {
+	.dvfs_user = MDLA1,
+	.plat_regs = &mt8195_pwr_reg,
+};
+
 static const struct of_device_id apu_power_of_match[] = {
 	{
 		.compatible = "mediatek,mt8192-apu-power",
 		.data = &mt8192_apu_power_data
+	}, {
+		.compatible = "mediatek,mt8195-apu-power",
+		.data = &mt8195_apu_power_data
 	}, {
 		/* Terminator */
 	},
@@ -597,13 +612,30 @@ static struct platform_driver apu_power_driver = {
 	},
 };
 
+static const struct of_device_id apu_combo_iommu[] = {
+	{ .compatible = "mediatek,apu_combo_iommu0"},
+	{ .compatible = "mediatek,apu_combo_iommu1"},
+	{},
+};
+MODULE_DEVICE_TABLE(of, apu_combo_iommu);
+
+static struct platform_driver apu_combo_iommu_driver = {
+	.driver = {
+		.name = "apu_combo_iommu",
+		.of_match_table = of_match_ptr(apu_combo_iommu),
+	},
+};
+
 static int __init apu_power_drv_init(void)
 {
-	return platform_driver_register(&apu_power_driver);
+	platform_driver_register(&apu_power_driver);
+	platform_driver_register(&apu_combo_iommu_driver);
+	return 0;
 }
 
 static void __exit apu_power_drv_exit(void)
 {
+	platform_driver_unregister(&apu_combo_iommu_driver);
 	platform_driver_unregister(&apu_power_driver);
 }
 
-- 
2.18.0


  parent reply	other threads:[~2021-12-10 17:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 17:52 [PATCH 00/12] MediaTek MT8195 APU Flora Fu
2021-12-10 17:52 ` [PATCH 01/12] dt-bindings: memory: mediatek: Add MT8195 apu iommu bindings Flora Fu
2021-12-10 17:52 ` [PATCH 02/12] dt-bindings: remoteproc: mediatek: Add MT8195 in apu rproc Flora Fu
2021-12-10 17:52 ` [PATCH 03/12] dt-bindings: soc: mediatek: apu: Add MT8195 APU power bindings Flora Fu
2021-12-10 17:52 ` [PATCH 04/12] iommu/mediatek: Add APU iommu data for mt8195 Flora Fu
2021-12-10 17:52 ` [PATCH 05/12] remoteproc: mediatek: Add MT8195 APU remoteproc support Flora Fu
2021-12-10 17:52 ` Flora Fu [this message]
2021-12-10 17:52 ` [PATCH 07/12] arm64: dts: mt8195: Add APU mtk-apu-mailbox node Flora Fu
2021-12-10 17:52 ` [PATCH 08/12] arm64: dts: mt8195: Add APU-IOMMU nodes Flora Fu
2021-12-10 17:52 ` [PATCH 09/12] arm64: dts: mt8195: Add apu tinysys node Flora Fu
2021-12-10 17:52 ` [PATCH 10/12] arm64: dts: mt8195: Add APU power nodes Flora Fu
2021-12-10 17:52 ` [PATCH 11/12] arm64: dts: mt8195: Add apu-sw-logger node Flora Fu
2021-12-10 17:52 ` [PATCH 12/12] arm64: dts: mt8195: Set up regulators for APU subsys Flora Fu

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=20211210175223.31131-7-flora.fu@mediatek.com \
    --to=flora.fu@mediatek.com \
    --cc=jb.tsai@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=pi-cheng.chen@mediatek.com \
    --cc=yong.wu@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