From: Adam Ford <aford173@gmail.com>
To: linux-mediatek@lists.infradead.org
Cc: angelogioacchino.delregno@collabora.com,
"Adam Ford" <aford173@gmail.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Laura Nao" <laura.nao@collabora.com>,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: [PATCH 4/5] regulator: mt6363: Fix interrmittent timeout
Date: Mon, 9 Feb 2026 23:37:04 -0600 [thread overview]
Message-ID: <20260210053708.17239-4-aford173@gmail.com> (raw)
In-Reply-To: <20260210053708.17239-1-aford173@gmail.com>
Sometimes, the mt6363 regulator would fail to initialize and return with
a TIMEOUT error, so add an extra instruction to wake up the bus before
issuing the commands.
Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators")
Signed-off-by: Adam Ford <aford173@gmail.com>
---
drivers/regulator/mt6363-regulator.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/mt6363-regulator.c b/drivers/regulator/mt6363-regulator.c
index e0fbf92e7685..03af5fa53600 100644
--- a/drivers/regulator/mt6363-regulator.c
+++ b/drivers/regulator/mt6363-regulator.c
@@ -861,7 +861,7 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
struct irq_domain *domain;
struct irq_fwspec fwspec;
struct spmi_device *sdev;
- int i, ret;
+ int i, ret, val;
config.regmap = mt6363_spmi_register_regmap(dev);
if (IS_ERR(config.regmap))
@@ -870,6 +870,13 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
config.dev = dev;
sdev = to_spmi_device(dev->parent);
+ /*
+ * The first read may fail if the bootloader sets sleep mode: wake up
+ * this PMIC with W/R on the SPMI bus and ignore the first result.
+ * This matches the MT6373 driver behavior.
+ */
+ regmap_read(config.regmap, MT6363_TOP_TRAP, &val);
+
interrupt_parent = of_irq_find_parent(dev->of_node);
if (!interrupt_parent)
return dev_err_probe(dev, -EINVAL, "Cannot find IRQ parent\n");
--
2.51.0
next prev parent reply other threads:[~2026-02-10 5:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 5:37 [PATCH 1/5] pmdomain: mediatek: Fix power domain count Adam Ford
2026-02-10 5:37 ` [PATCH 2/5] clk: mediatek: Fix MT8196 topckgen2 orphan clocks Adam Ford
2026-02-10 16:10 ` Laura Nao
2026-02-10 5:37 ` [PATCH 3/5] clk: mediatek: Fix MT8196 topckgen orphan clock Adam Ford
2026-02-10 16:12 ` Laura Nao
2026-02-10 5:37 ` Adam Ford [this message]
2026-02-10 13:46 ` [PATCH 4/5] regulator: mt6363: Fix interrmittent timeout Mark Brown
2026-02-10 5:37 ` [PATCH 5/5] drivers: clk: mediatek: Fix error finding regmap Adam Ford
2026-02-10 16:14 ` Laura Nao
2026-02-10 16:19 ` (subset) [PATCH 1/5] pmdomain: mediatek: Fix power domain count Mark Brown
2026-02-12 11:34 ` Ulf Hansson
2026-03-06 9:50 ` AngeloGioacchino Del Regno
2026-03-11 17:29 ` Ulf Hansson
2026-03-12 12:46 ` AngeloGioacchino Del Regno
2026-03-12 14:42 ` Ulf Hansson
2026-03-12 15:07 ` AngeloGioacchino Del Regno
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=20260210053708.17239-4-aford173@gmail.com \
--to=aford173@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=laura.nao@collabora.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.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=mturquette@baylibre.com \
--cc=nfraprado@collabora.com \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox