[PATCH 4/5] regulator: mt6363: Fix interrmittent timeout
Adam Ford
aford173 at gmail.com
Mon Feb 9 21:37:04 PST 2026
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 at 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
More information about the linux-arm-kernel
mailing list