Skip to content

Commit 0bc0ae9

Browse files
charleskeepaxbroonie
authored andcommitted
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: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9896c02 commit 0bc0ae9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sound/soc/codecs/wm5110.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
413413
unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
414414
unsigned int lold, rold;
415415
unsigned int lena, rena;
416+
bool change = false;
416417
int ret;
417418

418419
snd_soc_dapm_mutex_lock(dapm);
@@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
440441
goto err;
441442
}
442443

443-
ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE,
444-
mask, lnew | rnew);
444+
ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE,
445+
mask, lnew | rnew, &change);
445446
if (ret) {
446447
dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
447448
goto err;
@@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
454455
if (!rnew && rold)
455456
wm5110_clear_pga_volume(arizona, mc->rshift);
456457

458+
if (change)
459+
ret = 1;
460+
457461
err:
458462
snd_soc_dapm_mutex_unlock(dapm);
459463

0 commit comments

Comments
 (0)