Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5054459rwj; Tue, 20 Dec 2022 19:47:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvV2o0ROqvWkpWhFBK1o2ekm23F1bwy2367P+h5a0gYeHMLyYvaRbIPbkiQtABrgaRIzav3 X-Received: by 2002:a05:6a20:9f85:b0:ac:16ae:f46 with SMTP id mm5-20020a056a209f8500b000ac16ae0f46mr1059041pzb.15.1671594439653; Tue, 20 Dec 2022 19:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671594439; cv=none; d=google.com; s=arc-20160816; b=t4ofojFrjLNbqMDUJF0x4Re2M5Tzad+DN5d94itvS48fFBgfrL9Xq1lw+TMEzXv+Uu 07qVOMOOT+p0L+6wOQCuBn0hnSQEf+W/xFMQG7jW/usPaZVyMW5W6DM9Q4RGR0VazGkO ZhGon/B8TNEBx7afitVCpdABkAUJ9A7Lke04/1YxLh0PplhH5aFzYGII64DMoJoUh5Vf NVoADSRI+/WvxQ9TpvLZyW8wD71EqHusbhG8Y0mr+VVkB2CNKHzd4pEQ/jzB5zdnyeab Th8/zu13DhB1xxtsFfTyNsAvHj28rMShbh8PZ7yAvGeWspelZimdVxvtJega4fShjAB7 5joA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8A0q6r84X2XKK3CAuRIml9dZUg+GB7moOddAKx6LC+0=; b=AE5V8iV06fMR7059cfgQiPPg2QiEW4phQES8I1saNlOxw+ckNDOHFeOn7UPHrMHIbj 73QQuCfXMwBSi5HZTJ4sYi7mRepafctEFdc9ZM3Az/0MX1PT65do2KxdwuedHq465tG0 0Sap2Eg+Fd71RE4fsCOBau9Jz0StIFn+xZmgMunuUCPIpg+h+s0UvbhYV9pefPHg2etC y31bzqev7jEV6ykpojtQERYF60aGmTJ7s9FSljVC0Cz4QC8/5gnFA7MwNRqEq7qUMwHe PQNxqHOpz8n33M7eMBHyOca50YbQSZextA0wCbT4gnkLernZkMWQuZlCDUWMROngUejE Kh5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="CLUZa6/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y63-20020a638a42000000b0047856c2590esi16610746pgd.35.2022.12.20.19.47.10; Tue, 20 Dec 2022 19:47:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="CLUZa6/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234404AbiLUDoY (ORCPT + 69 others); Tue, 20 Dec 2022 22:44:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233411AbiLUDoW (ORCPT ); Tue, 20 Dec 2022 22:44:22 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E74B1EADC; Tue, 20 Dec 2022 19:44:17 -0800 (PST) X-UUID: fb46169b23a743fc913fa85c80cba7d3-20221221 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=8A0q6r84X2XKK3CAuRIml9dZUg+GB7moOddAKx6LC+0=; b=CLUZa6/EthcMKPGjYUzE7HS7bwOzVf1daE8B4VpX8I5qKNL9oqDqWcgPN8RRwo6zXeGF5icW+cBH9VwmoZDoBYmmq/yMx/mn00Ii+qCBDovT7hTTOpaF1/YQ4JIXyicdYesqgwMEb+vNMkcGFBgL0t/1b5kyK9X4MnhYm7hpa+Y=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:6c485bc7-588c-46a7-b36b-1c70315953c7,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:dcaaed0,CLOUDID:a89df489-8530-4eff-9f77-222cf6e2895b,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: fb46169b23a743fc913fa85c80cba7d3-20221221 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 702773652; Wed, 21 Dec 2022 11:44:12 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 21 Dec 2022 11:44:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 21 Dec 2022 11:44:11 +0800 From: Allen-KH Cheng To: Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Chun-Jie Chen , Stephen Boyd , Ikjoon Jang CC: , , , , , , Chen-Yu Tsai , Allen-KH Cheng Subject: [PATCH v2 2/6] soc: mediatek: pm-domains: Add buck isolation setting in power domain Date: Wed, 21 Dec 2022 11:44:03 +0800 Message-ID: <20221221034407.19605-3-allen-kh.cheng@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221221034407.19605-1-allen-kh.cheng@mediatek.com> References: <20221221034407.19605-1-allen-kh.cheng@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In MT8192, we need to disable EXT_BUCK_ISO before turning on the ADSP power pm-domains (mtcmos). Add the MTK_SCPD_EXT_BUCK_ISO flag to control the buck isolation setting in the mediatek power domain driver. Fixes: 59b644b01cf4 ("soc: mediatek: Add MediaTek SCPSYS power domains") Signed-off-by: Allen-KH Cheng --- drivers/soc/mediatek/mtk-pm-domains.c | 8 ++++++++ drivers/soc/mediatek/mtk-pm-domains.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c index 09e3c38b8466..63f1e183f645 100644 --- a/drivers/soc/mediatek/mtk-pm-domains.c +++ b/drivers/soc/mediatek/mtk-pm-domains.c @@ -218,6 +218,10 @@ static int scpsys_power_on(struct generic_pm_domain *genpd) if (ret) goto err_reg; + if (MTK_SCPD_CAPS(pd, MTK_SCPD_EXT_BUCK_ISO)) + regmap_clear_bits(scpsys->base, pd->data->ext_buck_iso_offs, + pd->data->ext_buck_iso_mask); + /* subsys power on */ regmap_set_bits(scpsys->base, pd->data->ctl_offs, PWR_ON_BIT); regmap_set_bits(scpsys->base, pd->data->ctl_offs, PWR_ON_2ND_BIT); @@ -272,6 +276,10 @@ static int scpsys_power_off(struct generic_pm_domain *genpd) if (ret < 0) return ret; + if (MTK_SCPD_CAPS(pd, MTK_SCPD_EXT_BUCK_ISO)) + regmap_set_bits(scpsys->base, pd->data->ext_buck_iso_offs, + pd->data->ext_buck_iso_mask); + clk_bulk_disable_unprepare(pd->num_subsys_clks, pd->subsys_clks); /* subsys power off */ diff --git a/drivers/soc/mediatek/mtk-pm-domains.h b/drivers/soc/mediatek/mtk-pm-domains.h index a5f24c58e35a..5ec53ee073c4 100644 --- a/drivers/soc/mediatek/mtk-pm-domains.h +++ b/drivers/soc/mediatek/mtk-pm-domains.h @@ -10,6 +10,7 @@ #define MTK_SCPD_DOMAIN_SUPPLY BIT(4) /* can't set MTK_SCPD_KEEP_DEFAULT_OFF at the same time */ #define MTK_SCPD_ALWAYS_ON BIT(5) +#define MTK_SCPD_EXT_BUCK_ISO BIT(6) #define MTK_SCPD_CAPS(_scpd, _x) ((_scpd)->data->caps & (_x)) #define SPM_VDE_PWR_CON 0x0210 -- 2.18.0