Skip to content

Commit 870d72a

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: cs47l92: Fix event generation for OUT1 demux
cs47l92_put_demux 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/20220628153409.3266932-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 15b2e5d commit 870d72a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sound/soc/codecs/cs47l92.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ static int cs47l92_put_demux(struct snd_kcontrol *kcontrol,
119119
end:
120120
snd_soc_dapm_mutex_unlock(dapm);
121121

122-
return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
122+
ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
123+
if (ret < 0) {
124+
dev_err(madera->dev, "Failed to update demux power state: %d\n", ret);
125+
return ret;
126+
}
127+
128+
return change;
123129
}
124130

125131
static SOC_ENUM_SINGLE_DECL(cs47l92_outdemux_enum,

0 commit comments

Comments
 (0)