Commit 89300b4e authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: cs42l51: Fix enum ctl accesses in a wrong type

"PCM channel mixer" ctl in cs42l51 codec driver is enum, while the
current driver accesses wrongly via value.integer.value[].  They have
to be via value.enumerated.item[] instead.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 92e963f5
...@@ -60,15 +60,15 @@ static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol, ...@@ -60,15 +60,15 @@ static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
switch (value) { switch (value) {
default: default:
case 0: case 0:
ucontrol->value.integer.value[0] = 0; ucontrol->value.enumerated.item[0] = 0;
break; break;
/* same value : (L+R)/2 and (R+L)/2 */ /* same value : (L+R)/2 and (R+L)/2 */
case 1: case 1:
case 2: case 2:
ucontrol->value.integer.value[0] = 1; ucontrol->value.enumerated.item[0] = 1;
break; break;
case 3: case 3:
ucontrol->value.integer.value[0] = 2; ucontrol->value.enumerated.item[0] = 2;
break; break;
} }
...@@ -85,7 +85,7 @@ static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol, ...@@ -85,7 +85,7 @@ static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
unsigned char val; unsigned char val;
switch (ucontrol->value.integer.value[0]) { switch (ucontrol->value.enumerated.item[0]) {
default: default:
case 0: case 0:
val = CHAN_MIX_NORMAL; val = CHAN_MIX_NORMAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment