From patchwork Mon Jun 5 14:18:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 103307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2735905vqr; Mon, 5 Jun 2023 07:45:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Sa2F2GeMGLaKkp2O4boPKgcCr2jhCPznTqjKInZ7AGIUSDGLH/MDh6s+h8GhveqZxtcSj X-Received: by 2002:a17:90b:4f46:b0:255:614a:7fae with SMTP id pj6-20020a17090b4f4600b00255614a7faemr7127454pjb.20.1685976334775; Mon, 05 Jun 2023 07:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685976334; cv=none; d=google.com; s=arc-20160816; b=EXwIqQEguDQobyUyr9Lju8/aHwxXA3Gvsti2dmpIdtwvrHW6csmPPxCZlrqb+pAlB6 xX/Cr0nvsTsOGv0KJf7AgGlpTPuWX2Nb+f36jAjx6+FH9fZRNnvnMmkxhkeQo9LXBiGk ziHskOQcmNOfGOWO5DkYmeeJmmCeadBXAQj5fCqjJ6b9r/aRW81Ca6BCxO8Esq/eF9/M 4WngrFfvIDRgIl32Pm2lW9ygWn8Z9LZ9/FcBuxyRtpzqe/zp7YNY6vdbvU8296eerJwu mrImwXgl2DlJBQC0wkLVItkUDIUSRn/kIJCR84ASEFcEFVGvBE0NrYDbXlgA1kiDEJg+ SsnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=Ne7iKWynewhvepyffpsn66sALgHa3UPLE7ColAOjqLU=; b=Ze7dWuOfAEFygdPwoB1gDKXTZSh6wT3RPNfdVETLGDeh514tugUpJh6Cj0Zbs8UVFf 2o5Lqb8xrxLwuf2Qg/TOHHY9UhqnuJjeP59IWChxpnDLUUR8ONutjPEgQ+AgxeLeD9Ug tl6DQ/Z7LMGLGSwFE2oviGcSO5Cmpfq2Sn0ux1wm/F50baqmkSDhuUoCfdWSyML/7pOE tcP8Nb6jcB9MsfYgG68YremTqYQQ44B2QFeVVzqGt8REy19Z7yy0T4dc8BWvQM/ufD5N 5ZO8eikC6s8qsO9Fa5k/RkWkhhrEIc/a9ORkqdhNHzl8rsfIdmVMAs1S0MxmNtOoTN/u cKSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d22-20020a637356000000b00542235888a5si5611610pgn.739.2023.06.05.07.45.20; Mon, 05 Jun 2023 07:45:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232362AbjFEOSc (ORCPT + 99 others); Mon, 5 Jun 2023 10:18:32 -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> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767874320769841242?= X-GMAIL-MSGID: =?utf-8?q?1767874320769841242?= 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 for 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_platform_data = { static const struct mtk_cpufreq_platform_data mt7622_platform_data = { .min_volt_shift = 100000, .max_volt_shift = 200000, - .proc_max_volt = 1360000, + .proc_max_volt = 1350000, .sram_min_volt = 0, - .sram_max_volt = 1360000, + .sram_max_volt = 1350000, + .ccifreq_supported = false, +}; + +static const struct mtk_cpufreq_platform_data mt7623_platform_data = { + .min_volt_shift = 100000, + .max_volt_shift = 200000, + .proc_max_volt = 1300000, .ccifreq_supported = false, }; @@ -734,7 +741,7 @@ static const struct of_device_id mtk_cpufreq_machines[] __initconst = { { .compatible = "mediatek,mt2701", .data = &mt2701_platform_data }, { .compatible = "mediatek,mt2712", .data = &mt2701_platform_data }, { .compatible = "mediatek,mt7622", .data = &mt7622_platform_data }, - { .compatible = "mediatek,mt7623", .data = &mt7622_platform_data }, + { .compatible = "mediatek,mt7623", .data = &mt7623_platform_data }, { .compatible = "mediatek,mt8167", .data = &mt8516_platform_data }, { .compatible = "mediatek,mt817x", .data = &mt2701_platform_data }, { .compatible = "mediatek,mt8173", .data = &mt2701_platform_data },