From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 916F1313260 for ; Tue, 4 Nov 2025 08:36:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762245408; cv=none; b=B6ghzyxdQaO3cC41JbK4W3FYqTNSH577EILppXC7GqV0Y7l2DoNvnVsLfMdS/nM++75J3LexwU8fSsFKSYeNW3aKr/y4OdRM9K3em+Nnv8ZOxUeQ6ka+wRxvomCTb1P7MAF3lFAmfNpuzfp60ln1aJQDEmalu6yL7vDBpriG978= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762245408; c=relaxed/simple; bh=1TAbvzEfD/RA+9spWTBUiFFmFjivd3g5DCmnmcqcHIc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qKrJ6ZsgJpqTII/lOPm0yPFU/BeCc05jlUJtRDb3lA0se7dsudB8zCC38e1k9eZDhSu5u9P0AF8edOglzuB7hgZhbxHgRX5DMsC9B5JEL/2Aowe2wEnszVWWqIneKM2/+pxNze08NVQJ4kHvEH+mvT9ormneziVU5LIvByTq7xI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=oxajwmwZ; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="oxajwmwZ" X-UUID: 617eac64b95911f0b33aeb1e7f16c2b6-20251104 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=uilWK9pxP4N3+juvbcZo5GClSyfc42uLaTShdPX4r0I=; b=oxajwmwZJi14iAdDZqFI9XRC/qfthGT1nY3eWdlx9eHU5pANcwp7t7HQERu/K7IOj4Ix3EXRY/y7fVfFcKblK/UNxnzQ8JKOI8FBYXwCve56kmG+a+DdBu+mkqDLHiKec0kbKk71gCbcRZhnlw9avusgozPuU2klS0xPA/IDU5o=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.6,REQID:1eb7a09e-cb44-4361-b23d-5fe2d17c89a8,IP:0,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:0 X-CID-META: VersionHash:a9d874c,CLOUDID:360fe47c-f9d7-466d-a1f7-15b5fcad2ce6,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|836|888|898,TC:-5,Content: 0|15|50,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 617eac64b95911f0b33aeb1e7f16c2b6-20251104 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 440322643; Tue, 04 Nov 2025 16:36:38 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.26; Tue, 4 Nov 2025 16:36:37 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1748.26 via Frontend Transport; Tue, 4 Nov 2025 16:36:36 +0800 From: niklaus.liu To: Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , , , , , Niklaus Liu Subject: [PATCH v3 1/1] soc: mediatek: mtk-regulator-coupler: Add support for MT8189 Date: Tue, 4 Nov 2025 16:34:13 +0800 Message-ID: <20251104083630.13541-2-Niklaus.Liu@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20251104083630.13541-1-Niklaus.Liu@mediatek.com> References: <20251104083630.13541-1-Niklaus.Liu@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain From: Niklaus Liu 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 --- 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