Commit 630cc598 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: wm5110: Fix DRE control

The DRE controls on wm5110 should return a value of 1 if the DRE state
is actually changed, update to fix this.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220621102041.1713504-2-ckeepax@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 81d74dda
...@@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, ...@@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift; unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
unsigned int lold, rold; unsigned int lold, rold;
unsigned int lena, rena; unsigned int lena, rena;
bool change = false;
int ret; int ret;
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_lock(dapm);
...@@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, ...@@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
goto err; goto err;
} }
ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE, ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE,
mask, lnew | rnew); mask, lnew | rnew, &change);
if (ret) { if (ret) {
dev_err(arizona->dev, "Failed to set DRE: %d\n", ret); dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
goto err; goto err;
...@@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, ...@@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
if (!rnew && rold) if (!rnew && rold)
wm5110_clear_pga_volume(arizona, mc->rshift); wm5110_clear_pga_volume(arizona, mc->rshift);
if (change)
ret = 1;
err: err:
snd_soc_dapm_mutex_unlock(dapm); snd_soc_dapm_mutex_unlock(dapm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment