[PATCH v3 1/5] regulator: sy7636a: don't wait for power good if already on
From: Pablo Mazzini
Date: Sun Nov 08 2026 - 04:36:55 EST
A boot-on regulator is already on when the core enables it, so there is
no power good edge and the enable waits for the full timeout. Return
early if power good is already set.
Fixes: 9037a00f3845 ("regulator: sy7636a: wait for power good on enable")
Signed-off-by: Pablo Mazzini <pmazzini@xxxxxxxxx>
---
drivers/regulator/sy7636a-regulator.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
index f87144e921da..6269c50348ac 100644
--- a/drivers/regulator/sy7636a-regulator.c
+++ b/drivers/regulator/sy7636a-regulator.c
@@ -90,6 +90,10 @@ static int sy7636a_enable(struct regulator_dev *rdev)
if (ret)
return ret;
+ /* already on, e.g. a boot-on regulator left on by the bootloader */
+ if (gpiod_get_value_cansleep(data->pgood_gpio) > 0)
+ return 0;
+
wait_for_completion_timeout(&data->pgood_completion,
msecs_to_jiffies(PGOOD_TIMEOUT_MSECS));
ret = gpiod_get_value_cansleep(data->pgood_gpio);
--
2.52.0