Skip to content

Commit

Permalink
ASoC: cs47l15: Fix event generation for low power mux control
Browse files Browse the repository at this point in the history
cs47l15_in1_adc_put always returns zero regardless of if the control
value was updated. This results in missing notifications to user-space
of the control change. Update the handling to return 1 when the value is
changed.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623105120.1981154-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Charles Keepax authored and Mark Brown committed Jun 24, 2022
1 parent 46b0d05 commit 7f103af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/soc/codecs/cs47l15.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol,
snd_soc_kcontrol_component(kcontrol);
struct cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component);

if (!!ucontrol->value.integer.value[0] == cs47l15->in1_lp_mode)
return 0;

switch (ucontrol->value.integer.value[0]) {
case 0:
/* Set IN1 to normal mode */
Expand Down Expand Up @@ -150,7 +153,7 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol,
break;
}

return 0;
return 1;
}

static const struct snd_kcontrol_new cs47l15_snd_controls[] = {
Expand Down

0 comments on commit 7f103af

Please sign in to comment.