Skip to content

Commit 1a4b0c9

Browse files
aford173broonie
authored andcommitted
regulator: mt6363: Fix interrmittent timeout
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: 3c36965 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators") Signed-off-by: Adam Ford <aford173@gmail.com> Link: https://patch.msgid.link/20260210053708.17239-4-aford173@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 914809c commit 1a4b0c9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/regulator/mt6363-regulator.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
861861
struct irq_domain *domain;
862862
struct irq_fwspec fwspec;
863863
struct spmi_device *sdev;
864-
int i, ret;
864+
int i, ret, val;
865865

866866
config.regmap = mt6363_spmi_register_regmap(dev);
867867
if (IS_ERR(config.regmap))
@@ -870,6 +870,13 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
870870
config.dev = dev;
871871
sdev = to_spmi_device(dev->parent);
872872

873+
/*
874+
* The first read may fail if the bootloader sets sleep mode: wake up
875+
* this PMIC with W/R on the SPMI bus and ignore the first result.
876+
* This matches the MT6373 driver behavior.
877+
*/
878+
regmap_read(config.regmap, MT6363_TOP_TRAP, &val);
879+
873880
interrupt_parent = of_irq_find_parent(dev->of_node);
874881
if (!interrupt_parent)
875882
return dev_err_probe(dev, -EINVAL, "Cannot find IRQ parent\n");

0 commit comments

Comments
 (0)