diff options
author | Zhang Shurong <zhang_shurong@foxmail.com> | 2023-09-30 12:55:50 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-10-02 16:06:15 +0300 |
commit | 892fbdb203945d887ad2a109a3700b091a8e3b97 (patch) | |
tree | 7cff827287cd2845f8f7179055557a9f286e2607 /sound | |
parent | b84b53149476b22cc3b8677b771fb4cf06d1d455 (diff) | |
download | linux-892fbdb203945d887ad2a109a3700b091a8e3b97.tar.xz |
ASoC: rt5682: Fix regulator enable/disable sequence
This will attempt to disable the regulators if the initial enable fails
which is a bug.
Fix this bug by modifying the code to the correct sequence.
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_4F37C9B5315B7960041E8E0ADDA869128F08@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/rt5682-i2c.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c index b05b4f73d8aa..fbad1ed06626 100644 --- a/sound/soc/codecs/rt5682-i2c.c +++ b/sound/soc/codecs/rt5682-i2c.c @@ -157,11 +157,6 @@ static int rt5682_i2c_probe(struct i2c_client *i2c) return ret; } - ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators, - rt5682); - if (ret) - return ret; - ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies), rt5682->supplies); if (ret) { @@ -169,6 +164,11 @@ static int rt5682_i2c_probe(struct i2c_client *i2c) return ret; } + ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators, + rt5682); + if (ret) + return ret; + ret = rt5682_get_ldo1(rt5682, &i2c->dev); if (ret) return ret; |