Skip to contentSkip to conversation

PATCH Superseded niklaus.liu 1 participant 2 messages Nov 4, 2025 Arm MediaTek

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

This series is based on linux-next, tag: next-20251103

Refer to the discussion in the link:
v1: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
v2: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

Subject: [PATCH v3 0/1] soc: mediatek: mtk-regulator-coupler: Add support for MT8189

changes in v3:
- modify for comment[add the new entry by alphabetical order]

changes in v2:
- change title for patch
- reply comment: This is a software regulator coupler mechanism, and the regulator-coupled-with
configuration has been added in the MT8189 device tree. This patchaddresses an issue reported by a Chromebook customer. When the GPU regulator is turned on, mediatek_regulator_balance_voltage already sets both the GPU and GPU_SRAM voltages at the same time, so there is no need to adjust the GPU_SRAM voltage again in a second round. Therefore, a return is set for MT8189.
If the user calls mediatek_regulator_balance_voltage again for GPU_SRAM, it may cause abnormal behavior of GPU_SRAM.

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

Niklaus Liu (1):
soc: mediatek: mtk-regulator-coupler: Add support for MT8189

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

PATCH v3 1/1 soc: mediatek: mtk-regulator-coupler: 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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/soc/mediatek/mtk-regulator-coupler.c +13 -0
index 0b6a2884145e..e2a1fb459e42 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,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;
 
Signature · 1 line
2.46.0