Commit 5a903e6a authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

ASoC: wm9713: Fix wrong value references for boolean kctl

commit 87a8b286 upstream.

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: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ecec5e54
...@@ -255,7 +255,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol, ...@@ -255,7 +255,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(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 snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); struct wm9713_priv *wm9713 = 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 *mc =
(struct soc_mixer_control *)kcontrol->private_value; (struct soc_mixer_control *)kcontrol->private_value;
unsigned int mixer, mask, shift, old; unsigned int mixer, mask, shift, old;
...@@ -268,7 +268,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol, ...@@ -268,7 +268,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol,
mutex_lock(&wm9713->lock); mutex_lock(&wm9713->lock);
old = wm9713->hp_mixer[mixer]; old = wm9713->hp_mixer[mixer];
if (ucontrol->value.enumerated.item[0]) if (ucontrol->value.integer.value[0])
wm9713->hp_mixer[mixer] |= mask; wm9713->hp_mixer[mixer] |= mask;
else else
wm9713->hp_mixer[mixer] &= ~mask; wm9713->hp_mixer[mixer] &= ~mask;
...@@ -306,7 +306,7 @@ static int wm9713_hp_mixer_get(struct snd_kcontrol *kcontrol, ...@@ -306,7 +306,7 @@ static int wm9713_hp_mixer_get(struct snd_kcontrol *kcontrol,
mixer = mc->shift >> 8; mixer = mc->shift >> 8;
shift = mc->shift & 0xff; shift = mc->shift & 0xff;
ucontrol->value.enumerated.item[0] = ucontrol->value.integer.value[0] =
(wm9713->hp_mixer[mixer] >> shift) & 1; (wm9713->hp_mixer[mixer] >> shift) & 1;
return 0; return 0;
......
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