Skip to content

Commit

Permalink
ASoC: codecs: wcd934x: return correct value from mixer put
Browse files Browse the repository at this point in the history
wcd934x_compander_set() currently returns zero eventhough it changes the value.
Fix this, so that change notifications are sent correctly.

Fixes: 1cde8b8 ("ASoC: wcd934x: add basic controls")
Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Srinivas-Kandagatla authored and broonie committed Dec 1, 2021
1 parent 23ba286 commit d9be0ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/soc/codecs/wcd934x.c
Original file line number Diff line number Diff line change
Expand Up @@ -3256,6 +3256,9 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc,
int value = ucontrol->value.integer.value[0];
int sel;

if (wcd->comp_enabled[comp] == value)
return 0;

wcd->comp_enabled[comp] = value;
sel = value ? WCD934X_HPH_GAIN_SRC_SEL_COMPANDER :
WCD934X_HPH_GAIN_SRC_SEL_REGISTER;
Expand All @@ -3279,10 +3282,10 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc,
case COMPANDER_8:
break;
default:
break;
return 0;
}

return 0;
return 1;
}

static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc,
Expand Down

0 comments on commit d9be0ff

Please sign in to comment.