[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR04MB05676D46494F722485CE7551CB1C9@CY4PR04MB0567.namprd04.prod.outlook.com>
Date: Sun, 27 Mar 2022 15:15:53 -0700
From: Jonathan Bakker <xc-racer2@...e.ca>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: patches@...nsource.cirrus.com, linux-kernel@...r.kernel.org,
Jonathan Bakker <xc-racer2@...e.ca>
Subject: [PATCH] regulator: wm8994: Add an off-on delay for WM8994 variant
As per Table 130 of the wm8994 datasheet at [1], there is an off-on
delay for LDO1 and LDO2. In the wm8958 datasheet [2], I could not
find any reference to it. I could not find a wm1811 datasheet to
double-check there, but as no one has complained presumably it works
without it.
This solves the issue on Samsung Aries boards with a wm8994 where
register writes fail when the device is powered off and back-on
quickly.
[1] https://statics.cirrus.com/pubs/proDatasheet/WM8994_Rev4.6.pdf
[2] https://statics.cirrus.com/pubs/proDatasheet/WM8958_v3.5.pdf
Signed-off-by: Jonathan Bakker <xc-racer2@...e.ca>
---
drivers/regulator/wm8994-regulator.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c
index cadea0344486..135fdf3f9fdd 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -70,7 +70,7 @@ static const struct regulator_ops wm8994_ldo2_ops = {
.set_voltage_sel = regulator_set_voltage_sel_regmap,
};
-static const struct regulator_desc wm8994_ldo_desc[] = {
+static struct regulator_desc wm8994_ldo_desc[] = {
{
.name = "LDO1",
.id = 1,
@@ -167,6 +167,10 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
ldo->init_data = *pdata->ldo[id].init_data;
}
+ /* WM8994 requires an off-on delay while others do not */
+ if (ldo->wm8994->type == WM8994)
+ wm8994_ldo_desc[id].off_on_delay = 36000;
+
/*
* At this point the GPIO descriptor is handled over to the
* regulator core and we need not worry about it on the
--
2.20.1
Powered by blists - more mailing lists