From nobody Fri Sep 20 18:42:08 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C59B2C7EE23 for ; Mon, 5 Jun 2023 14:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232384AbjFEOSd (ORCPT ); Mon, 5 Jun 2023 10:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjFEOS2 (ORCPT ); Mon, 5 Jun 2023 10:18:28 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661B59B; Mon, 5 Jun 2023 07:18:27 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1q6B2N-00073n-07; Mon, 05 Jun 2023 14:18:23 +0000 Date: Mon, 5 Jun 2023 15:18:12 +0100 From: Daniel Golle To: linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jia-Wei Chang , AngeloGioacchino Del Regno , Matthias Brugger , Viresh Kumar , "Rafael J. Wysocki" Subject: [PATCH] cpufreq: mediatek: correct voltages for MT7622 and MT7623 Message-ID: References: <9d7e62049e3442582bd64dbc9e4d2a64f1ad0c1a.camel@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9d7e62049e3442582bd64dbc9e4d2a64f1ad0c1a.camel@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The MT6380 regulator typically used together with MT7622 does not support the current maximum processor and SRAM voltage in the cpufreq driver (1360000uV). For MT7622 limit processor and SRAM supply voltages to 1350000uV to avoid having the tracking algorithm request unsupported voltages from the regulator. On MT7623 there is no separate SRAM supply and the maximum voltage used is 1300000uV. Create dedicated platform data for MT7623 to cover that case as well. Fixes: 0883426fd07e3 ("cpufreq: mediatek: Raise proc and sram max voltage f= or MT7622/7623") Suggested-by: Jia-wei Chang Signed-off-by: Daniel Golle Reviewed-by: AngeloGioacchino Del Regno --- drivers/cpufreq/mediatek-cpufreq.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-= cpufreq.c index 9a39a7ccfae96..fef68cb2b38f7 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -696,9 +696,16 @@ static const struct mtk_cpufreq_platform_data mt2701_p= latform_data =3D { static const struct mtk_cpufreq_platform_data mt7622_platform_data =3D { .min_volt_shift =3D 100000, .max_volt_shift =3D 200000, - .proc_max_volt =3D 1360000, + .proc_max_volt =3D 1350000, .sram_min_volt =3D 0, - .sram_max_volt =3D 1360000, + .sram_max_volt =3D 1350000, + .ccifreq_supported =3D false, +}; + +static const struct mtk_cpufreq_platform_data mt7623_platform_data =3D { + .min_volt_shift =3D 100000, + .max_volt_shift =3D 200000, + .proc_max_volt =3D 1300000, .ccifreq_supported =3D false, }; =20 @@ -734,7 +741,7 @@ static const struct of_device_id mtk_cpufreq_machines[]= __initconst =3D { { .compatible =3D "mediatek,mt2701", .data =3D &mt2701_platform_data }, { .compatible =3D "mediatek,mt2712", .data =3D &mt2701_platform_data }, { .compatible =3D "mediatek,mt7622", .data =3D &mt7622_platform_data }, - { .compatible =3D "mediatek,mt7623", .data =3D &mt7622_platform_data }, + { .compatible =3D "mediatek,mt7623", .data =3D &mt7623_platform_data }, { .compatible =3D "mediatek,mt8167", .data =3D &mt8516_platform_data }, { .compatible =3D "mediatek,mt817x", .data =3D &mt2701_platform_data }, { .compatible =3D "mediatek,mt8173", .data =3D &mt2701_platform_data }, --=20 2.41.0