Message ID | 20230609083009.2822259-5-wenst@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp796896vqr; Fri, 9 Jun 2023 01:34:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UGdrZppz+xm9V8aukohgcf13Eu07lHnKd+56Hyx0pjI5mXZ7ud9GZGZwI88lrh9WU/HsD X-Received: by 2002:a17:902:e541:b0:1b2:5d90:fc3f with SMTP id n1-20020a170902e54100b001b25d90fc3fmr1422224plf.17.1686299684158; Fri, 09 Jun 2023 01:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686299684; cv=none; d=google.com; s=arc-20160816; b=OwFkudBajJAoz3d1J/ruPCpTIOXnT5bSvV7Z5sWYN4zhztdLMJG88kmhuPeEKK9xm0 5z4XlAoIxqrwhUIlXDlk++7pazGrUGdfaAiGcaOScS/PGG9L+QmrU+zxYQ0lllZsOSjB NyfIdb4rFzKVk56zh+1QXFrwVOJhtDT78USbr9uOszdyvrnWvIbqutSugJjyZEwaDA1r pEDdS5/jyqKPRiZHyxeW8JNxa2EA7A3kHYqg2YWm0H/tGqCIyedk/0a6RtYrjUCgr2Od s/QDFNALj2LkNhFlxxvv8YjmRKBLpJQVjUedsff1/kk7SVpcZOrCnr1qEv4LAIj3OppM DbaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=11zc4FsjjThT9aF4m1qk+2IflC0iJrne6V3Jm40ZBR0=; b=bdA1OF12aCrMA50cuO6iXFe9RLb/oQKhowGJP4i5a4TD6ww4t7Hl1E9TBOZ8q+9oaX nC4n5TfU7JxqqJYEamynXWb59NXvhqc0hoStRmpnXd1X31eUCy/eaAGqkBBFxR2xgNcV bpgxkIDXtAr0fkCcmKDtl4CDDLf5GdxZW8Sx6SjqaMiWmkIfaLFaV8Nm+nemQ4Oae4wE 72XlY+P7oX+JtZtYDTTYGFYG7tZRe6kROcM8M/GHMO6wPfyrFKPc1moSCU01xu4IHhFH WBIgNoL8LouTaCcBJE8bhCcNvWN06bRekg+rJdGQbfOBM+KSf/Cu/lZBxCzhI6jZphM3 0l/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="WMoYiK/i"; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a170902e15400b001ae5fb1436asi2234732pla.184.2023.06.09.01.34.32; Fri, 09 Jun 2023 01:34:44 -0700 (PDT) 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=@chromium.org header.s=google header.b="WMoYiK/i"; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240860AbjFIIcW (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 04:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240899AbjFIIbU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 04:31:20 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE2EC3A94 for <linux-kernel@vger.kernel.org>; Fri, 9 Jun 2023 01:30:46 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-64d44b198baso1184328b3a.0 for <linux-kernel@vger.kernel.org>; Fri, 09 Jun 2023 01:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686299445; x=1688891445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=11zc4FsjjThT9aF4m1qk+2IflC0iJrne6V3Jm40ZBR0=; b=WMoYiK/iXxPeqvuSRQWk/tYTcNjJU80QxtgpGB3hlLcCXiJQnqNF15avOkmQ0GpyLx eKy8+A8sRWAeorUOpjs6DmNg4x6M9M53n99aD7PcmPhHY7VafIuaT+b5NDGJ+TUXiofz eMoLcBQ1o8hK+kMDaGcJauXBShrpPGiPGuHMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686299445; x=1688891445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=11zc4FsjjThT9aF4m1qk+2IflC0iJrne6V3Jm40ZBR0=; b=YU+OlcynumVcdM2+ELzwa3uxbQi8AdcNh2zRDAUDM5GQ7KAbmVchEY/ahADBBON0pA mmqq72Hz/yVoTTbsPtPu/YH0XRYo51R4s0N2nWLLt6XV3rstlkFwkrAnk8Jo25UROyke Zyo7x3FyIDNYNZhG5PIZG0D0xY2r89bT9NLLRkJGJNJTyaX4zqZpDntkzVqdwcAuUo7R 2hNYpKh0uVccmBNI4aN/wVQv9sUeI7n3obYWAZ45eXo6FO+xHkjP3L+7H1ufBeNMWghd UAfGXO/BxecoImRoeiYC85+DCbHg0hrOorZUeS0mZs014Eu/E8j+vMfud5Ajo1wmosIZ xSqA== X-Gm-Message-State: AC+VfDxHERhqk2qb4PqGWiXC4GMSgK9+djrwEwHMq48Cd/9Eli+cbhIs 6mnU3OqJsJ8LA3J7DMeSjCYO2A== X-Received: by 2002:a05:6a21:6d84:b0:116:fc1b:fa38 with SMTP id wl4-20020a056a216d8400b00116fc1bfa38mr1344531pzb.7.1686299444790; Fri, 09 Jun 2023 01:30:44 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:c2ea:d8e4:1fe8:21f0]) by smtp.gmail.com with ESMTPSA id 23-20020aa79157000000b0063b806b111csm2184327pfi.169.2023.06.09.01.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 01:30:44 -0700 (PDT) From: Chen-Yu Tsai <wenst@chromium.org> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chen-Yu Tsai <wenst@chromium.org>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] regulator: mt6358: Drop *_SSHUB regulators Date: Fri, 9 Jun 2023 16:30:01 +0800 Message-ID: <20230609083009.2822259-5-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230609083009.2822259-1-wenst@chromium.org> References: <20230609083009.2822259-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768213377675231115?= X-GMAIL-MSGID: =?utf-8?q?1768213377675231115?= |
Series |
regulator: mt6358: Remove bogus regulators and improvements
|
|
Commit Message
Chen-Yu Tsai
June 9, 2023, 8:30 a.m. UTC
The *_SSHUB regulators are actually alternate configuration interfaces
for their non *_SSHUB counterparts. They are not separate regulator
outputs. These registers are intended for the companion processor to
use to configure the power rails while the main processor is sleeping.
They are not intended for the main operating system to use.
Since they are not real outputs they shouldn't be modeled separately.
Remove them. Luckily no device tree actually uses them.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
drivers/regulator/mt6358-regulator.c | 14 --------------
include/linux/regulator/mt6358-regulator.h | 4 ----
2 files changed, 18 deletions(-)
Comments
Il 09/06/23 10:30, Chen-Yu Tsai ha scritto: > The *_SSHUB regulators are actually alternate configuration interfaces > for their non *_SSHUB counterparts. They are not separate regulator > outputs. These registers are intended for the companion processor to > use to configure the power rails while the main processor is sleeping. > They are not intended for the main operating system to use. > > Since they are not real outputs they shouldn't be modeled separately. > Remove them. Luckily no device tree actually uses them. > I'm not sure that MT6358/6366 are used only on Chromebook SoCs, and that this SSHUB mechanism (companion processor) is the same across all firmwares. I'd like someone from MediaTek to confirm that this is valid for both Chromebook and Smartphone firmwares. Regards, Angelo > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> > --- > drivers/regulator/mt6358-regulator.c | 14 -------------- > include/linux/regulator/mt6358-regulator.h | 4 ---- > 2 files changed, 18 deletions(-) > > diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c > index faf6b0757019..946a251a8b3a 100644 > --- a/drivers/regulator/mt6358-regulator.c > +++ b/drivers/regulator/mt6358-regulator.c > @@ -505,9 +505,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { > MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, > buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, > MT6358_VCORE_VGPU_ANA_CON0, 1), > - MT6358_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, > - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, > - MT6358_VCORE_VGPU_ANA_CON0, 1), > MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, > buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, > MT6358_VPA_ANA_CON0, 3), > @@ -583,10 +580,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { > MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON2, 0x7f), > - MT6358_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, > - 1293750, 6250, buck_volt_range1, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), > MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON3, 0x7f), > @@ -603,9 +596,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { > MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, > buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, > MT6358_VCORE_VGPU_ANA_CON0, 1), > - MT6366_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, > - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, > - MT6358_VCORE_VGPU_ANA_CON0, 1), > MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, > buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, > MT6358_VPA_ANA_CON0, 3), > @@ -670,10 +660,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { > MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON2, 0x7f), > - MT6366_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, > - 1293750, 6250, buck_volt_range1, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), > MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON3, 0x7f), > diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/mt6358-regulator.h > index a4307cd9edd6..c71a6a9fce7a 100644 > --- a/include/linux/regulator/mt6358-regulator.h > +++ b/include/linux/regulator/mt6358-regulator.h > @@ -47,8 +47,6 @@ enum { > MT6358_ID_VLDO28, > MT6358_ID_VAUD28, > MT6358_ID_VSIM2, > - MT6358_ID_VCORE_SSHUB, > - MT6358_ID_VSRAM_OTHERS_SSHUB, > MT6358_ID_RG_MAX, > }; > > @@ -88,8 +86,6 @@ enum { > MT6366_ID_VMC, > MT6366_ID_VAUD28, > MT6366_ID_VSIM2, > - MT6366_ID_VCORE_SSHUB, > - MT6366_ID_VSRAM_OTHERS_SSHUB, > MT6366_ID_RG_MAX, > }; >
On 09/06/2023 10:30, Chen-Yu Tsai wrote: > The *_SSHUB regulators are actually alternate configuration interfaces > for their non *_SSHUB counterparts. They are not separate regulator > outputs. These registers are intended for the companion processor to > use to configure the power rails while the main processor is sleeping. > They are not intended for the main operating system to use. > > Since they are not real outputs they shouldn't be modeled separately. > Remove them. Luckily no device tree actually uses them. > > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > --- > drivers/regulator/mt6358-regulator.c | 14 -------------- > include/linux/regulator/mt6358-regulator.h | 4 ---- > 2 files changed, 18 deletions(-) > > diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c > index faf6b0757019..946a251a8b3a 100644 > --- a/drivers/regulator/mt6358-regulator.c > +++ b/drivers/regulator/mt6358-regulator.c > @@ -505,9 +505,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { > MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, > buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, > MT6358_VCORE_VGPU_ANA_CON0, 1), > - MT6358_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, > - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, > - MT6358_VCORE_VGPU_ANA_CON0, 1), > MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, > buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, > MT6358_VPA_ANA_CON0, 3), > @@ -583,10 +580,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { > MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON2, 0x7f), > - MT6358_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, > - 1293750, 6250, buck_volt_range1, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), > MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON3, 0x7f), > @@ -603,9 +596,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { > MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, > buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, > MT6358_VCORE_VGPU_ANA_CON0, 1), > - MT6366_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, > - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, > - MT6358_VCORE_VGPU_ANA_CON0, 1), > MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, > buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, > MT6358_VPA_ANA_CON0, 3), > @@ -670,10 +660,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { > MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON2, 0x7f), > - MT6366_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, > - 1293750, 6250, buck_volt_range1, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), > MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, > buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, > MT6358_LDO_VSRAM_CON3, 0x7f), > diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/mt6358-regulator.h > index a4307cd9edd6..c71a6a9fce7a 100644 > --- a/include/linux/regulator/mt6358-regulator.h > +++ b/include/linux/regulator/mt6358-regulator.h > @@ -47,8 +47,6 @@ enum { > MT6358_ID_VLDO28, > MT6358_ID_VAUD28, > MT6358_ID_VSIM2, > - MT6358_ID_VCORE_SSHUB, > - MT6358_ID_VSRAM_OTHERS_SSHUB, > MT6358_ID_RG_MAX, > }; > > @@ -88,8 +86,6 @@ enum { > MT6366_ID_VMC, > MT6366_ID_VAUD28, > MT6366_ID_VSIM2, > - MT6366_ID_VCORE_SSHUB, > - MT6366_ID_VSRAM_OTHERS_SSHUB, > MT6366_ID_RG_MAX, > }; >
On Fri, Jun 9, 2023 at 5:03 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > Il 09/06/23 10:30, Chen-Yu Tsai ha scritto: > > The *_SSHUB regulators are actually alternate configuration interfaces > > for their non *_SSHUB counterparts. They are not separate regulator > > outputs. These registers are intended for the companion processor to > > use to configure the power rails while the main processor is sleeping. > > They are not intended for the main operating system to use. > > > > Since they are not real outputs they shouldn't be modeled separately. > > Remove them. Luckily no device tree actually uses them. > > > > I'm not sure that MT6358/6366 are used only on Chromebook SoCs, and that this SSHUB > mechanism (companion processor) is the same across all firmwares. AFAICT from Internet sources there's also the MT6771 and MT6781, which are used on some phones. But what part are you concerned about? The upstream regulator driver does not actually have any code to switch to/from normal operation and SSHUB mode. In a downstream kernel I found that the SSHUB mode is only used if SCP is doing DVFS [1]. In that same kernel, the regulator driver [2] doesn't even list the *_SSHUB versions. So if SCP DVFS is used, the regulator driver has no idea what's going on, and can't interfere either, which I think is actually a good thing. Only one side should have complete control of one output. ChenYu [1] https://github.com/nokia-dev/android_kernel_nokia_mt6771/blob/android-9.0/drivers/misc/mediatek/scp/mt6771/scp_dvfs.c [2] https://github.com/nokia-dev/android_kernel_nokia_mt6771/blob/android-9.0/drivers/misc/mediatek/pmic/mt6358/v1/regulator_codegen.c > I'd like someone from MediaTek to confirm that this is valid for both Chromebook > and Smartphone firmwares. > > Regards, > Angelo > > > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> > > --- > > drivers/regulator/mt6358-regulator.c | 14 -------------- > > include/linux/regulator/mt6358-regulator.h | 4 ---- > > 2 files changed, 18 deletions(-) > > > > diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c > > index faf6b0757019..946a251a8b3a 100644 > > --- a/drivers/regulator/mt6358-regulator.c > > +++ b/drivers/regulator/mt6358-regulator.c > > @@ -505,9 +505,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { > > MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, > > buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, > > MT6358_VCORE_VGPU_ANA_CON0, 1), > > - MT6358_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, > > - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, > > - MT6358_VCORE_VGPU_ANA_CON0, 1), > > MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, > > buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, > > MT6358_VPA_ANA_CON0, 3), > > @@ -583,10 +580,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { > > MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, > > buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, > > MT6358_LDO_VSRAM_CON2, 0x7f), > > - MT6358_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, > > - 1293750, 6250, buck_volt_range1, > > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, > > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), > > MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, > > buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, > > MT6358_LDO_VSRAM_CON3, 0x7f), > > @@ -603,9 +596,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { > > MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, > > buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, > > MT6358_VCORE_VGPU_ANA_CON0, 1), > > - MT6366_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, > > - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, > > - MT6358_VCORE_VGPU_ANA_CON0, 1), > > MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, > > buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, > > MT6358_VPA_ANA_CON0, 3), > > @@ -670,10 +660,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { > > MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, > > buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, > > MT6358_LDO_VSRAM_CON2, 0x7f), > > - MT6366_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, > > - 1293750, 6250, buck_volt_range1, > > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, > > - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), > > MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, > > buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, > > MT6358_LDO_VSRAM_CON3, 0x7f), > > diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/mt6358-regulator.h > > index a4307cd9edd6..c71a6a9fce7a 100644 > > --- a/include/linux/regulator/mt6358-regulator.h > > +++ b/include/linux/regulator/mt6358-regulator.h > > @@ -47,8 +47,6 @@ enum { > > MT6358_ID_VLDO28, > > MT6358_ID_VAUD28, > > MT6358_ID_VSIM2, > > - MT6358_ID_VCORE_SSHUB, > > - MT6358_ID_VSRAM_OTHERS_SSHUB, > > MT6358_ID_RG_MAX, > > }; > > > > @@ -88,8 +86,6 @@ enum { > > MT6366_ID_VMC, > > MT6366_ID_VAUD28, > > MT6366_ID_VSIM2, > > - MT6366_ID_VCORE_SSHUB, > > - MT6366_ID_VSRAM_OTHERS_SSHUB, > > MT6366_ID_RG_MAX, > > }; > > >
On Mon, Jun 12, 2023 at 12:45:21PM +0800, Chen-Yu Tsai wrote: > list the *_SSHUB versions. So if SCP DVFS is used, the regulator driver > has no idea what's going on, and can't interfere either, which I think is > actually a good thing. Only one side should have complete control of one > output. Very much so - there's a SCMI regulator interface for communicating with SCPs where that's required (eg, for things like SD cards).
Il 12/06/23 06:45, Chen-Yu Tsai ha scritto: > On Fri, Jun 9, 2023 at 5:03 PM AngeloGioacchino Del Regno > <angelogioacchino.delregno@collabora.com> wrote: >> >> Il 09/06/23 10:30, Chen-Yu Tsai ha scritto: >>> The *_SSHUB regulators are actually alternate configuration interfaces >>> for their non *_SSHUB counterparts. They are not separate regulator >>> outputs. These registers are intended for the companion processor to >>> use to configure the power rails while the main processor is sleeping. >>> They are not intended for the main operating system to use. >>> >>> Since they are not real outputs they shouldn't be modeled separately. >>> Remove them. Luckily no device tree actually uses them. >>> >> >> I'm not sure that MT6358/6366 are used only on Chromebook SoCs, and that this SSHUB >> mechanism (companion processor) is the same across all firmwares. > > AFAICT from Internet sources there's also the MT6771 and MT6781, which > are used on some phones. > > But what part are you concerned about? The upstream regulator driver does > not actually have any code to switch to/from normal operation and SSHUB > mode. > > In a downstream kernel I found that the SSHUB mode is only used if SCP is > doing DVFS [1]. In that same kernel, the regulator driver [2] doesn't even > list the *_SSHUB versions. So if SCP DVFS is used, the regulator driver > has no idea what's going on, and can't interfere either, which I think is > actually a good thing. Only one side should have complete control of one > output. > Ok, I'm sold! :-P Jokes apart, thanks for clarifying. At this point, I agree with you in that this is safe to do, so: Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> P.S.: Sorry for the late reply and thank you for the links to that old downstream kernel. Cheers, Angelo > ChenYu > > [1] https://github.com/nokia-dev/android_kernel_nokia_mt6771/blob/android-9.0/drivers/misc/mediatek/scp/mt6771/scp_dvfs.c > [2] https://github.com/nokia-dev/android_kernel_nokia_mt6771/blob/android-9.0/drivers/misc/mediatek/pmic/mt6358/v1/regulator_codegen.c > >> I'd like someone from MediaTek to confirm that this is valid for both Chromebook >> and Smartphone firmwares. >> >> Regards, >> Angelo >> >>> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> >>> --- >>> drivers/regulator/mt6358-regulator.c | 14 -------------- >>> include/linux/regulator/mt6358-regulator.h | 4 ---- >>> 2 files changed, 18 deletions(-) >>> >>> diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c >>> index faf6b0757019..946a251a8b3a 100644 >>> --- a/drivers/regulator/mt6358-regulator.c >>> +++ b/drivers/regulator/mt6358-regulator.c >>> @@ -505,9 +505,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { >>> MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, >>> buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, >>> MT6358_VCORE_VGPU_ANA_CON0, 1), >>> - MT6358_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, >>> - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, >>> - MT6358_VCORE_VGPU_ANA_CON0, 1), >>> MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, >>> buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, >>> MT6358_VPA_ANA_CON0, 3), >>> @@ -583,10 +580,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { >>> MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, >>> buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, >>> MT6358_LDO_VSRAM_CON2, 0x7f), >>> - MT6358_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, >>> - 1293750, 6250, buck_volt_range1, >>> - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, >>> - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), >>> MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, >>> buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, >>> MT6358_LDO_VSRAM_CON3, 0x7f), >>> @@ -603,9 +596,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { >>> MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, >>> buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, >>> MT6358_VCORE_VGPU_ANA_CON0, 1), >>> - MT6366_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, >>> - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, >>> - MT6358_VCORE_VGPU_ANA_CON0, 1), >>> MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, >>> buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, >>> MT6358_VPA_ANA_CON0, 3), >>> @@ -670,10 +660,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { >>> MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, >>> buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, >>> MT6358_LDO_VSRAM_CON2, 0x7f), >>> - MT6366_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, >>> - 1293750, 6250, buck_volt_range1, >>> - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, >>> - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), >>> MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, >>> buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, >>> MT6358_LDO_VSRAM_CON3, 0x7f), >>> diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/mt6358-regulator.h >>> index a4307cd9edd6..c71a6a9fce7a 100644 >>> --- a/include/linux/regulator/mt6358-regulator.h >>> +++ b/include/linux/regulator/mt6358-regulator.h >>> @@ -47,8 +47,6 @@ enum { >>> MT6358_ID_VLDO28, >>> MT6358_ID_VAUD28, >>> MT6358_ID_VSIM2, >>> - MT6358_ID_VCORE_SSHUB, >>> - MT6358_ID_VSRAM_OTHERS_SSHUB, >>> MT6358_ID_RG_MAX, >>> }; >>> >>> @@ -88,8 +86,6 @@ enum { >>> MT6366_ID_VMC, >>> MT6366_ID_VAUD28, >>> MT6366_ID_VSIM2, >>> - MT6366_ID_VCORE_SSHUB, >>> - MT6366_ID_VSRAM_OTHERS_SSHUB, >>> MT6366_ID_RG_MAX, >>> }; >>> >>
diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index faf6b0757019..946a251a8b3a 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -505,9 +505,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1), - MT6358_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, - MT6358_VCORE_VGPU_ANA_CON0, 1), MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3), @@ -583,10 +580,6 @@ static struct mt6358_regulator_info mt6358_regulators[] = { MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6358_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, - 1293750, 6250, buck_volt_range1, - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), @@ -603,9 +596,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1), - MT6366_BUCK("buck_vcore_sshub", VCORE_SSHUB, 500000, 1293750, 6250, - buck_volt_range1, 0x7f, MT6358_BUCK_VCORE_SSHUB_ELR0, 0x7f, - MT6358_VCORE_VGPU_ANA_CON0, 1), MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, buck_volt_range3, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3), @@ -670,10 +660,6 @@ static struct mt6358_regulator_info mt6366_regulators[] = { MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, buck_volt_range1, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6366_LDO1("ldo_vsram_others_sshub", VSRAM_OTHERS_SSHUB, 500000, - 1293750, 6250, buck_volt_range1, - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f, - MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1, 0x7f), MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, buck_volt_range1, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/mt6358-regulator.h index a4307cd9edd6..c71a6a9fce7a 100644 --- a/include/linux/regulator/mt6358-regulator.h +++ b/include/linux/regulator/mt6358-regulator.h @@ -47,8 +47,6 @@ enum { MT6358_ID_VLDO28, MT6358_ID_VAUD28, MT6358_ID_VSIM2, - MT6358_ID_VCORE_SSHUB, - MT6358_ID_VSRAM_OTHERS_SSHUB, MT6358_ID_RG_MAX, }; @@ -88,8 +86,6 @@ enum { MT6366_ID_VMC, MT6366_ID_VAUD28, MT6366_ID_VSIM2, - MT6366_ID_VCORE_SSHUB, - MT6366_ID_VSRAM_OTHERS_SSHUB, MT6366_ID_RG_MAX, };