From 4352c5326ca897bc094e810e93efd80e48aff27b Mon Sep 17 00:00:00 2001 From: Ravi Kumar Alamanda Date: Fri, 25 Jan 2013 15:27:43 -0800 Subject: [PATCH] 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 --- sound/soc/codecs/wcd9310.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c index 5563f636ab0..7e454add3de 100644 --- a/sound/soc/codecs/wcd9310.c +++ b/sound/soc/codecs/wcd9310.c @@ -819,7 +819,7 @@ static int tabla_set_compander(struct snd_kcontrol *kcontrol, 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]) { @@ -1136,9 +1136,9 @@ static const struct snd_kcontrol_new tabla_snd_controls[] = { 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), };