ASoC: wcd9310: Correct the mixer controls for Compander switches
- Compander1 never gets enabled though the user space sets the
corresponding mixer control.
- Compander switch kcontrols are configured wrongly as integer
type with max value as 0.
- Correct kcontrol creation to fix the issue.
CRs-Fixed: 441091
Change-Id: Iad99b44c9226da3bcc1132e61ea989a0543ae56e
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c
index 6d3eb98..a3312b3 100644
--- a/sound/soc/codecs/wcd9310.c
+++ b/sound/soc/codecs/wcd9310.c
@@ -777,7 +777,7 @@
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct tabla_priv *tabla = snd_soc_codec_get_drvdata(codec);
int comp = ((struct soc_multi_mixer_control *)
- kcontrol->private_value)->max;
+ kcontrol->private_value)->shift;
int value = ucontrol->value.integer.value[0];
if (value == tabla->comp_enabled[comp]) {
@@ -1088,9 +1088,9 @@
tabla_get_iir_band_audio_mixer, tabla_put_iir_band_audio_mixer),
SOC_SINGLE_MULTI_EXT("IIR2 Band5", IIR2, BAND5, 255, 0, 5,
tabla_get_iir_band_audio_mixer, tabla_put_iir_band_audio_mixer),
- SOC_SINGLE_EXT("COMP1 Switch", SND_SOC_NOPM, 1, COMPANDER_1, 0,
+ SOC_SINGLE_EXT("COMP1 Switch", SND_SOC_NOPM, COMPANDER_1, 1, 0,
tabla_get_compander, tabla_set_compander),
- SOC_SINGLE_EXT("COMP2 Switch", SND_SOC_NOPM, 0, COMPANDER_2, 0,
+ SOC_SINGLE_EXT("COMP2 Switch", SND_SOC_NOPM, COMPANDER_2, 1, 0,
tabla_get_compander, tabla_set_compander),
};