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 960D2CCFA00 for ; Tue, 4 Nov 2025 08:40:17 +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=otUY0win6Isua5cmdGGZxTSZmk PgCCZOWr3ZkHpIo4/gfsRamQRGAc5czM04a8dbxhEwJgJ0GEeQ7ccGE/94pJTYgPygVyTfwaiyWuM VFv16i3W3P0O3lGmXUNBkcraJ4vYDCSXb6r+j6HejC6F85jkuddLPcSQhdTkU2is45hEFKOh6+faE Zo9YATWBx866SzXUqx6nuAW8EuKCd8RGAv4c5zmLbPJ2twL+XNoLkWRbc150wI+36o2nKnfgWYUUy wqkZNe0UHL7w0t6b2GG/JICL7dp3yG5rE+gXQW/tQFLGQ+01Glnmc2DIviwZKmqGu+3Ca58QD1hD9 YNtidr2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGCaO-0000000BRhL-0voP; Tue, 04 Nov 2025 08:40:16 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGCaL-0000000BRee-31Ij; Tue, 04 Nov 2025 08:40:14 +0000 X-UUID: 624f9ccab95911f09f706fa2197c6ceb-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:08dea723-cb93-4bbb-8322-fa4231c39ed4,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:2e0fe47c-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: 624f9ccab95911f09f706fa2197c6ceb-20251104 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 110097527; Tue, 04 Nov 2025 01:36:40 -0700 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> 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-20251104_004013_761061_352B5064 X-CRM114-Status: GOOD ( 15.26 ) 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