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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7f103af commit e3cabbe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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)