From fea7a29cc8d86a0bbcb4bcf740d47924839b1f81 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Sun, 2 Jul 2023 12:41:15 +0000 Subject: [PATCH] power: regulator: rk8xx: Add 500us delay after LDO regulator is enabled A quick power cycle of a LDO regulator during dw-mmc signal voltage change has shown that SD-card does not always get recognized. Linux driver use an enable_time of 400us for LDO regulators. Apply a 500us delay when a LDO regulator is enabled to fix possible issues. Fixes: 94afc1cb466a ("power: regulator: rk8xx: update the driver for rk808 and rk818") Signed-off-by: Jonas Karlman Reviewed-by: elaine.zhang Reviewed-by: Kever Yang --- drivers/power/regulator/rk8xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c index 0ee07ad299..e95640a39b 100644 --- a/drivers/power/regulator/rk8xx.c +++ b/drivers/power/regulator/rk8xx.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -616,6 +617,9 @@ static int _ldo_set_enable(struct udevice *pmic, int ldo, bool enable) break; } + if (enable) + udelay(500); + return ret; } -- 2.39.5