Skip to content

Commit

Permalink
ASoC: wm9712: Fix wrong value references for boolean kctl
Browse files Browse the repository at this point in the history
The correct values referred by a boolean control are
value.integer.value[], not value.enumerated.item[].
The former is long while the latter is int, so it's even incompatible
on 64bit architectures.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Mar 10, 2015
1 parent b4a18c8 commit 4b0b669
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/soc/codecs/wm9712.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
unsigned int val = ucontrol->value.enumerated.item[0];
unsigned int val = ucontrol->value.integer.value[0];
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
unsigned int mixer, mask, shift, old;
Expand All @@ -193,7 +193,7 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol,

mutex_lock(&wm9712->lock);
old = wm9712->hp_mixer[mixer];
if (ucontrol->value.enumerated.item[0])
if (ucontrol->value.integer.value[0])
wm9712->hp_mixer[mixer] |= mask;
else
wm9712->hp_mixer[mixer] &= ~mask;
Expand Down Expand Up @@ -231,7 +231,7 @@ static int wm9712_hp_mixer_get(struct snd_kcontrol *kcontrol,
mixer = mc->shift >> 8;
shift = mc->shift & 0xff;

ucontrol->value.enumerated.item[0] =
ucontrol->value.integer.value[0] =
(wm9712->hp_mixer[mixer] >> shift) & 1;

return 0;
Expand Down

0 comments on commit 4b0b669

Please sign in to comment.