Skip to content

Commit 92d96b6

Browse files
xc-racer99broonie
authored andcommitted
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@live.ca> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/CY4PR04MB056771CFB80DC447C30D5A31CB1D9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3123109 commit 92d96b6

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

drivers/regulator/wm8994-regulator.c

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,35 @@ static const struct regulator_ops wm8994_ldo2_ops = {
7171
};
7272

7373
static const struct regulator_desc wm8994_ldo_desc[] = {
74+
{
75+
.name = "LDO1",
76+
.id = 1,
77+
.type = REGULATOR_VOLTAGE,
78+
.n_voltages = WM8994_LDO1_MAX_SELECTOR + 1,
79+
.vsel_reg = WM8994_LDO_1,
80+
.vsel_mask = WM8994_LDO1_VSEL_MASK,
81+
.ops = &wm8994_ldo1_ops,
82+
.min_uV = 2400000,
83+
.uV_step = 100000,
84+
.enable_time = 3000,
85+
.off_on_delay = 36000,
86+
.owner = THIS_MODULE,
87+
},
88+
{
89+
.name = "LDO2",
90+
.id = 2,
91+
.type = REGULATOR_VOLTAGE,
92+
.n_voltages = WM8994_LDO2_MAX_SELECTOR + 1,
93+
.vsel_reg = WM8994_LDO_2,
94+
.vsel_mask = WM8994_LDO2_VSEL_MASK,
95+
.ops = &wm8994_ldo2_ops,
96+
.enable_time = 3000,
97+
.off_on_delay = 36000,
98+
.owner = THIS_MODULE,
99+
},
100+
};
101+
102+
static const struct regulator_desc wm8958_ldo_desc[] = {
74103
{
75104
.name = "LDO1",
76105
.id = 1,
@@ -172,9 +201,16 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
172201
* regulator core and we need not worry about it on the
173202
* error path.
174203
*/
175-
ldo->regulator = devm_regulator_register(&pdev->dev,
176-
&wm8994_ldo_desc[id],
177-
&config);
204+
if (ldo->wm8994->type == WM8994) {
205+
ldo->regulator = devm_regulator_register(&pdev->dev,
206+
&wm8994_ldo_desc[id],
207+
&config);
208+
} else {
209+
ldo->regulator = devm_regulator_register(&pdev->dev,
210+
&wm8958_ldo_desc[id],
211+
&config);
212+
}
213+
178214
if (IS_ERR(ldo->regulator)) {
179215
ret = PTR_ERR(ldo->regulator);
180216
dev_err(wm8994->dev, "Failed to register LDO%d: %d\n",

0 commit comments

Comments
 (0)