From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2D28CCF9E3 for ; Tue, 4 Nov 2025 07:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uilWK9pxP4N3+juvbcZo5GClSyfc42uLaTShdPX4r0I=; b=BZJETq9qkw0YOmyvdg+z/T3eep qA59SZ7ULmuIU224l6GyoT4xEl88uow1i5Pjly7u9u75n8M/V7wwDsehKTbNXdMSNoQyYvR06GP57 q3NA5CKpREaZV80tsMTJZm+BuERYwiZGj+N6jA3CvCcJAN+OquLhHlYgxZSTkSRqoPYrlqJXuiSlR 26sqTJfX72GbbvPnvsVIOUUqHimRDBDVdiwUYJzCWTUnVGlg8PAk5kBJP3KujwjCtdfWXFtknbJ3e OM18BoRaB45om1Mvws30T0RXMaaL9723vQERkPpKfA9ynJghGH6SQqG5k1MQpCwi883lYBOSqjEkm lGWiDbiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGBE3-0000000BIoj-3ghe; Tue, 04 Nov 2025 07:13:07 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGBE1-0000000BInW-2MZV; Tue, 04 Nov 2025 07:13:06 +0000 X-UUID: b28f64b0b94d11f0a52f393f94899d25-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=MYHs57c6oi+2sujB3vog1XY68lg7caw4Gd/r9jQW3+DciHsTkRBmudvk+VF/i6o20hFpOcPbIad/GsDll8VIaXXnEU1lpv2PZTeniDJb6O7ounOWw4vHNsbN671LfY3omLXQ38zKFJQT3pmc/GMw+zgT1wPV7YJEyioHU7AHysY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.6,REQID:09d4c191-af7b-4303-b885-a89d66dbb339,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:a2c61be0-3890-4bb9-a90e-2a6a4ecf6c66,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: b28f64b0b94d11f0a52f393f94899d25-20251104 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 625282060; Tue, 04 Nov 2025 00:13:00 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) 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 15:12:58 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1748.26 via Frontend Transport; Tue, 4 Nov 2025 15:12:57 +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 15:12:41 +0800 Message-ID: <20251104071252.12539-2-Niklaus.Liu@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20251104071252.12539-1-Niklaus.Liu@mediatek.com> References: <20251104071252.12539-1-Niklaus.Liu@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251103_231305_603636_4756FD59 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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