From: niklaus.liu <Niklaus.Liu@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
<sirius.wang@mediatek.com>, <vince-wl.liu@mediatek.com>,
<jh.hsu@mediatek.com>, <zhigang.qin@mediatek.com>,
<sen.chu@mediatek.com>, Niklaus Liu <niklaus.liu@mediatek.com>
Subject: [PATCH V3 1/1] soc: mediatek: mtk-regulator-coupler: Add support for MT8189
Date: Tue, 4 Nov 2025 15:12:41 +0800 [thread overview]
Message-ID: <20251104071252.12539-2-Niklaus.Liu@mediatek.com> (raw)
In-Reply-To: <20251104071252.12539-1-Niklaus.Liu@mediatek.com>
From: Niklaus Liu <niklaus.liu@mediatek.com>
Enhance the regulator coupler driver to support GPU power control on the
MediaTek MT8189 platform. This update ensures proper coordination of
multiple regulators required for GPU operation,improving power management
and system stability.
Signed-off-by: Niklaus Liu <niklaus.liu@mediatek.com>
---
drivers/soc/mediatek/mtk-regulator-coupler.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/soc/mediatek/mtk-regulator-coupler.c b/drivers/soc/mediatek/mtk-regulator-coupler.c
index 0b6a2884145e..e2a1fb459e42 100644
--- a/drivers/soc/mediatek/mtk-regulator-coupler.c
+++ b/drivers/soc/mediatek/mtk-regulator-coupler.c
@@ -42,6 +42,18 @@ static int mediatek_regulator_balance_voltage(struct regulator_coupler *coupler,
int max_uV = INT_MAX;
int ret;
+ /*
+ * When vsram_gpu is enabled or disabled and the use_count of the
+ * vsram_gpu regulator is zero, the regulator coupler driver will
+ * execute regulator_do_balance_voltage, which adjusts the vsram_gpu
+ * voltage to the minimum value. This may result in vsram_gpu being
+ * lower than vgpu. Therefore, when enabling or disabling vsram_gpu,
+ * the 8189 temporarily skips the regulator coupler driver's modification
+ * of the vsram_gpu voltage.
+ */
+ if (of_machine_is_compatible("mediatek,mt8189") && rdev == mrc->vsram_rdev)
+ return 0;
+
/*
* If the target device is on, setting the SRAM voltage directly
* is not supported as it scales through its coupled supply voltage.
@@ -148,6 +160,7 @@ static int mediatek_regulator_coupler_init(void)
if (!of_machine_is_compatible("mediatek,mt8183") &&
!of_machine_is_compatible("mediatek,mt8186") &&
!of_machine_is_compatible("mediatek,mt8188") &&
+ !of_machine_is_compatible("mediatek,mt8189") &&
!of_machine_is_compatible("mediatek,mt8192"))
return 0;
--
2.46.0
next prev parent reply other threads:[~2025-11-04 7:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 7:12 niklaus.liu
2025-11-04 7:12 ` niklaus.liu [this message]
2025-11-04 14:24 ` [PATCH V3 1/1] soc: mediatek: mtk-regulator-coupler: Add support for MT8189 AngeloGioacchino Del Regno
-- strict thread matches above, loose matches on Subject: below --
2025-11-04 8:34 niklaus.liu
2025-11-04 8:34 ` [PATCH v3 1/1] soc: mediatek: mtk-regulator-coupler: Add support for MT8189 niklaus.liu
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=20251104071252.12539-2-Niklaus.Liu@mediatek.com \
--to=niklaus.liu@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=jh.hsu@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=sen.chu@mediatek.com \
--cc=sirius.wang@mediatek.com \
--cc=vince-wl.liu@mediatek.com \
--cc=zhigang.qin@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