Skip to contentSkip to conversation

PATCH In review niklaus.liu 2 participants 3 messages Nov 3, 2025 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

This series is based on linux-next, tag: next-20251103
Subject: [PATCH 0/1] soc: mediatek regulator: Add Support for mt8189

changes in V1:
- mediatek-regulator-coupler mechanism for platform MT8189

Niklaus Liu (1):
soc: mediatek regulator: Add Support for mt8189

 drivers/soc/mediatek/mtk-regulator-coupler.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
2.46.0
#1 lore raw

PATCH 1/1 soc: mediatek regulator: Add Support for mt8189

From: Niklaus Liu <[email protected]>

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.

---
 drivers/soc/mediatek/mtk-regulator-coupler.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/soc/mediatek/mtk-regulator-coupler.c +14 -1
index 0b6a2884145e..f6e3b2a3a5a8 100644
@@ -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,7 +160,8 @@ 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,mt8192"))
+	    !of_machine_is_compatible("mediatek,mt8192") &&
+	    !of_machine_is_compatible("mediatek,mt8189"))
 		return 0;
 
 	return regulator_coupler_register(&mediatek_coupler.coupler);
Signature · 1 line
2.46.0
#2 lore raw

Re: [PATCH 1/1] soc: mediatek regulator: Add Support for mt8189

Il 03/11/25 14:42, niklaus.liu ha scritto:

Quoted 2 lines

From: Niklaus Liu <[email protected]>

Please change the title to
"soc: mediatek: mtk-regulator-coupler: Add support for MT8189"

Quoted 17 lines

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.

---
  drivers/soc/mediatek/mtk-regulator-coupler.c | 15 ++++++++++++++-
  1 file changed, 14 insertions(+), 1 deletion(-)
drivers/soc/mediatek/mtk-regulator-coupler.c +0 -0
index 0b6a2884145e..f6e3b2a3a5a8 100644
@@ -42,6 +42,18 @@ static int mediatek_regulator_balance_voltage(struct regulator_coupler *coupler,
  	int max_uV = INT_MAX;
  	int ret;

drivers/soc/mediatek/mtk-regulator-coupler.c static int mediatek_regulator_balance_voltage(struct regulator_coupler *coupler, · line 53

Quoted 10 lines
drivers/soc/mediatek/mtk-regulator-coupler.c +9 -0
 
+	/*
+	 * 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.
+	 */

Looks like you are misconfiguring something here.... VSRAM_GPU on, VGPU off should not be supported if those are coupled.

It's either both are ON, or both are getting OFF: in case of both being offlined, it doesn't matter if the voltage is dropping, because the SRAM is getting powered OFF, as much as the GPU is.

Makes me wonder if you're assigning the power supplies to both of the MFG power domains *and* to Panfrost (vgpu == mali-supply).

Note that VGPU should be assigned to the outer power domain (the main one, usually MFG0), and that VSRAM_GPU should be assigned to the inner-next domain (which is usually MFG1).

Check how it's done in mt8195.dtsi, mt8195-cherry.dtsi :-)

drivers/soc/mediatek/mtk-regulator-coupler.c static int mediatek_regulator_coupler_init(void) · line 162

Quoted 10 lines
drivers/soc/mediatek/mtk-regulator-coupler.c +3 -0
+	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,7 +160,8 @@ 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") &&

Keep entries sorted alphabetically please, 8189 goes here.

Regards,
Angelo

Quoted 6 lines
drivers/soc/mediatek/mtk-regulator-coupler.c +2 -1
-	    !of_machine_is_compatible("mediatek,mt8192"))
+	    !of_machine_is_compatible("mediatek,mt8192") &&
+	    !of_machine_is_compatible("mediatek,mt8189"))
  		return 0;
 
  	return regulator_coupler_register(&mediatek_coupler.coupler);