All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
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 <jia-wei.chang@mediatek.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH] cpufreq: mediatek: correct voltages for MT7622 and MT7623
Date: Mon, 5 Jun 2023 15:18:12 +0100	[thread overview]
Message-ID: <ZH3umLU883eGbYBx@makrotopia.org> (raw)
In-Reply-To: <9d7e62049e3442582bd64dbc9e4d2a64f1ad0c1a.camel@mediatek.com>

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 <Jia-wei.Chang@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 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 },
-- 
2.41.0



WARNING: multiple messages have this Message-ID (diff)
From: Daniel Golle <daniel@makrotopia.org>
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 <jia-wei.chang@mediatek.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH] cpufreq: mediatek: correct voltages for MT7622 and MT7623
Date: Mon, 5 Jun 2023 15:18:12 +0100	[thread overview]
Message-ID: <ZH3umLU883eGbYBx@makrotopia.org> (raw)
In-Reply-To: <9d7e62049e3442582bd64dbc9e4d2a64f1ad0c1a.camel@mediatek.com>

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 <Jia-wei.Chang@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 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 },
-- 
2.41.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-06-05 14:18 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 10:11 [PATCH v2 0/4] Enhance mediatek-cpufreq robustness jia-wei.chang
2023-03-24 10:11 ` jia-wei.chang
2023-03-24 10:11 ` [PATCH v2 1/4] cpufreq: mediatek: fix passing zero to 'PTR_ERR' jia-wei.chang
2023-03-24 10:11   ` jia-wei.chang
2023-03-24 10:11 ` [PATCH v2 2/4] cpufreq: mediatek: fix KP caused by handler usage after regulator_put/clk_put jia-wei.chang
2023-03-24 10:11   ` jia-wei.chang
2023-03-24 10:11 ` [PATCH v2 3/4] cpufreq: mediatek: raise proc/sram max voltage for MT8516 jia-wei.chang
2023-03-24 10:11   ` jia-wei.chang
2023-03-24 13:11   ` AngeloGioacchino Del Regno
2023-03-24 13:11     ` AngeloGioacchino Del Regno
2023-03-24 10:11 ` [PATCH v2 4/4] cpufreq: mediatek: Raise proc and sram max voltage for MT7622/7623 jia-wei.chang
2023-03-24 10:11   ` jia-wei.chang
2023-05-22 18:03   ` Daniel Golle
2023-05-22 18:03     ` Daniel Golle
2023-05-23 14:56     ` AngeloGioacchino Del Regno
2023-05-23 14:56       ` AngeloGioacchino Del Regno
2023-05-23 17:37       ` Daniel Golle
2023-05-23 17:37         ` Daniel Golle
2023-05-24  7:28         ` AngeloGioacchino Del Regno
2023-05-24  7:28           ` AngeloGioacchino Del Regno
2023-05-24  8:43           ` Jia-wei Chang (張佳偉)
2023-05-24  8:43             ` Jia-wei Chang (張佳偉)
2023-05-24 12:42             ` Daniel Golle
2023-05-24 12:42               ` Daniel Golle
2023-05-26  8:27               ` Jia-wei Chang (張佳偉)
2023-05-26  8:27                 ` Jia-wei Chang (張佳偉)
2023-05-26  8:37                 ` Jia-wei Chang (張佳偉)
2023-05-26  8:37                   ` Jia-wei Chang (張佳偉)
2023-05-26 10:27                 ` Daniel Golle
2023-05-26 10:27                   ` Daniel Golle
2023-05-29  4:12                   ` Jia-wei Chang (張佳偉)
2023-06-05 14:18                     ` Daniel Golle [this message]
2023-06-05 14:18                       ` [PATCH] cpufreq: mediatek: correct voltages for MT7622 and MT7623 Daniel Golle
2023-06-06  7:41                       ` AngeloGioacchino Del Regno
2023-06-06  7:41                         ` AngeloGioacchino Del Regno
2023-06-19  4:23                         ` Viresh Kumar
2023-06-19  4:23                           ` Viresh Kumar
2023-03-30  3:50 ` [PATCH v2 0/4] Enhance mediatek-cpufreq robustness Viresh Kumar
2023-03-30  3:50   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZH3umLU883eGbYBx@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=jia-wei.chang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.