Unverified Commit 1a4b0c99 authored by Adam Ford's avatar Adam Ford Committed by Mark Brown
Browse files

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: 3c36965d ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators")
Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
Link: https://patch.msgid.link/20260210053708.17239-4-aford173@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 914809c6
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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");