Skip to content

Commit e3cabbe

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: madera: Fix event generation for OUT1 demux
madera_out1_demux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220623105120.1981154-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7f103af commit e3cabbe

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sound/soc/codecs/madera.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,13 @@ int madera_out1_demux_put(struct snd_kcontrol *kcontrol,
618618
end:
619619
snd_soc_dapm_mutex_unlock(dapm);
620620

621-
return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
621+
ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
622+
if (ret < 0) {
623+
dev_err(madera->dev, "Failed to update demux power state: %d\n", ret);
624+
return ret;
625+
}
626+
627+
return change;
622628
}
623629
EXPORT_SYMBOL_GPL(madera_out1_demux_put);
624630

0 commit comments

Comments
 (0)