Fix wrong ctl value references in ASoC codecs
Subsystems (6)
cover Fix wrong ctl value references in ASoC codecs
Hi,
while looking through the ASoC codec codes, I noticed that lots of drivers refer to the wrong union value type for boolean controls. They should be value.integer.value[], but the code accesses to value.enumerated.item[]. They haven't been noticed so far maybe just because both are same on 32bit architectures. But they are incompatible on 64bit architectures, thus must be fixed.
Takashi
===
Takashi Iwai (14):
ASoC: adav80x: Fix wrong value references for boolean kctl
ASoC: ak4641: Fix wrong value references for boolean kctl
ASoC: cs4271: Fix wrong value references for boolean kctl
ASoC: es8238: Fix wrong value references for boolean kctl
ASoC: pcm1681: Fix wrong value references for boolean kctl
ASoC: tas5086: Fix wrong value references for boolean kctl
ASoC: wm2000: Fix wrong value references for boolean kctl
ASoC: wm8731: Fix wrong value references for boolean kctl
ASoC: wm8903: Fix wrong value references for boolean kctl
ASoC: wm8904: Fix wrong value references for boolean kctl
ASoC: wm8955: Fix wrong value references for boolean kctl
ASoC: wm8960: Fix wrong value references for boolean kctl
ASoC: wm9712: Fix wrong value references for boolean kctl
ASoC: wm9713: Fix wrong value references for boolean kctl
sound/soc/codecs/adav80x.c | 4 ++-- sound/soc/codecs/ak4641.c | 4 ++-- sound/soc/codecs/cs4271.c | 4 ++-- sound/soc/codecs/es8328.c | 4 ++-- sound/soc/codecs/pcm1681.c | 4 ++-- sound/soc/codecs/tas5086.c | 4 ++-- sound/soc/codecs/wm2000.c | 8 ++++---- sound/soc/codecs/wm8731.c | 4 ++-- sound/soc/codecs/wm8903.c | 4 ++-- sound/soc/codecs/wm8904.c | 4 ++-- sound/soc/codecs/wm8955.c | 4 ++-- sound/soc/codecs/wm8960.c | 4 ++-- sound/soc/codecs/wm9712.c | 6 +++--- sound/soc/codecs/wm9713.c | 6 +++--- 14 files changed, 32 insertions(+), 32 deletions(-)
Signature · 1 line
2.3.2
PATCH 1/14 ASoC: adav80x: Fix wrong value references for boolean kctl
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.
--- sound/soc/codecs/adav80x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/adav80x.c +2 -2
@@ -317,7 +317,7 @@ static int adav80x_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct adav80x *adav80x =snd_soc_codec_get_drvdata (codec); -unsigned int deemph = ucontrol->value.enumerated.item[0 ]; +unsigned int deemph = ucontrol->value.integer.value[0 ];if (deemph >1 )return -EINVAL ;
@@ -333,7 +333,7 @@ static int adav80x_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct adav80x *adav80x =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = adav80x->deemph; + ucontrol->value.integer.value[0 ] = adav80x->deemph;return 0 ; };
Signature · 1 line
2.3.2
Re: [PATCH 01/14] ASoC: adav80x: Fix wrong value references for boolean kctl
Quoted 7 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>
Thanks.
PATCH 2/14 ASoC: ak4641: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/ak4641.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/ak4641.c +2 -2
@@ -76,7 +76,7 @@ static int ak4641_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct ak4641_priv *ak4641 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];if (deemph >1 )return -EINVAL ;
@@ -92,7 +92,7 @@ static int ak4641_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct ak4641_priv *ak4641 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = ak4641->deemph; + ucontrol->value.integer.value[0 ] = ak4641->deemph;return 0 ; };
Signature · 1 line
2.3.2
PATCH 3/14 ASoC: cs4271: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/cs4271.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4271.c +2 -2
@@ -286,7 +286,7 @@ static int cs4271_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct cs4271_private *cs4271 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = cs4271->deemph; + ucontrol->value.integer.value[0 ] = cs4271->deemph;return 0 ; }
@@ -296,7 +296,7 @@ static int cs4271_put_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct cs4271_private *cs4271 =snd_soc_codec_get_drvdata (codec); - cs4271->deemph = ucontrol->value.enumerated.item[0 ]; + cs4271->deemph = ucontrol->value.integer.value[0 ];return cs4271_set_deemph (codec); }
Signature · 1 line
2.3.2
Re: [PATCH 03/14] ASoC: cs4271: Fix wrong value references for boolean kctl
------ Original message------
From: Takashi Iwai
Date: Tue, Mar 10, 2015 6:39 AM
To: Mark Brown;
Subject:[PATCH 03/14] ASoC: cs4271: Fix wrong value references for boolean kctl
The correct values referred by a boolean control are value.integer.va<http://value.integer.va>lue[], not value.enumerated.it<http://value.enumerated.it>em[]. The former is long while the latter is int, so it's even incompatible
on 64bit architectures.
--- sound/soc/codecs/cs4271.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4271.c +0 -0
Thanks!
Mark Brown
maintainerRe: [PATCH 03/14] ASoC: cs4271: Fix wrong value references for boolean kctl
Quoted 5 lines · Paul
------ Original message------
From: Takashi Iwai
Dunno what your mail client is doing here Paul but it's pretty spectacular...!
Quoted 30 lines
Date: Tue, Mar 10, 2015 6:39 AM
To: Mark Brown;
Cc Liam Girdwood;Lars-Peter Clausen;Austin, Brian;Handrigan, Paul;Charles Keepax;[email protected]<mailto:;[email protected]>;Subject:[PATCH 03/14] ASoC: cs4271: Fix wrong value references for boolean kctl
The correct values referred by a boolean control are value.integer.va<http://value.integer.va>lue[], not value.enumerated.it<http://value.enumerated.it>em[]. The former is long while the latter is int, so it's even incompatible
on 64bit architectures.Cc ><mailto:<[email protected]>Signed-off-by Takashi Iwai ><mailto:<[email protected]>--- sound/soc/codecs/cs4271.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)sound/soc/codecs/cs4271.c +0
-0Thanks!
PATCH 4/14 ASoC: es8238: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/es8328.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/es8328.c +2 -2
@@ -120,7 +120,7 @@ static int es8328_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct es8328_priv *es8328 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = es8328->deemph; + ucontrol->value.integer.value[0 ] = es8328->deemph;return 0 ; }
@@ -129,7 +129,7 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct es8328_priv *es8328 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];int ret;if (deemph >1 )
Signature · 1 line
2.3.2
PATCH 5/14 ASoC: pcm1681: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/pcm1681.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/pcm1681.c +2 -2
@@ -118,7 +118,7 @@ static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct pcm1681_private *priv =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = priv->deemph; + ucontrol->value.integer.value[0 ] = priv->deemph;return 0 ; }
@@ -129,7 +129,7 @@ static int pcm1681_put_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct pcm1681_private *priv =snd_soc_codec_get_drvdata (codec); - priv->deemph = ucontrol->value.enumerated.item[0 ]; + priv->deemph = ucontrol->value.integer.value[0 ];return pcm1681_set_deemph (codec); }
Signature · 1 line
2.3.2
PATCH 6/14 ASoC: tas5086: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/tas5086.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/tas5086.c +2 -2
@@ -281,7 +281,7 @@ static int tas5086_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct tas5086_private *priv =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = priv->deemph; + ucontrol->value.integer.value[0 ] = priv->deemph;return 0 ; }
@@ -292,7 +292,7 @@ static int tas5086_put_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct tas5086_private *priv =snd_soc_codec_get_drvdata (codec); - priv->deemph = ucontrol->value.enumerated.item[0 ]; + priv->deemph = ucontrol->value.integer.value[0 ];return tas5086_set_deemph (codec); }
Signature · 1 line
2.3.2
PATCH 7/14 ASoC: wm2000: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm2000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/wm2000.c +4 -4
@@ -610,7 +610,7 @@ static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm2000_priv *wm2000 =dev_get_drvdata (codec->dev); - ucontrol->value.enumerated.item[0 ] = wm2000->anc_active; + ucontrol->value.integer.value[0 ] = wm2000->anc_active;return 0 ; }
@@ -620,7 +620,7 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm2000_priv *wm2000 =dev_get_drvdata (codec->dev); -int anc_active = ucontrol->value.enumerated.item[0 ]; +int anc_active = ucontrol->value.integer.value[0 ];int ret;if (anc_active >1 )
@@ -643,7 +643,7 @@ static int wm2000_speaker_get(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm2000_priv *wm2000 =dev_get_drvdata (codec->dev); - ucontrol->value.enumerated.item[0 ] = wm2000->spk_ena; + ucontrol->value.integer.value[0 ] = wm2000->spk_ena;return 0 ; }
@@ -653,7 +653,7 @@ static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm2000_priv *wm2000 =dev_get_drvdata (codec->dev); -int val = ucontrol->value.enumerated.item[0 ]; +int val = ucontrol->value.integer.value[0 ];int ret;if (val >1 )
Signature · 1 line
2.3.2
Re: [PATCH 07/14] ASoC: wm2000: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 8/14 ASoC: wm8731: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm8731.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8731.c +2 -2
@@ -125,7 +125,7 @@ static int wm8731_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8731_priv *wm8731 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = wm8731->deemph; + ucontrol->value.integer.value[0 ] = wm8731->deemph;return 0 ; }
@@ -135,7 +135,7 @@ static int wm8731_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8731_priv *wm8731 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];int ret =0 ;if (deemph >1 )
Signature · 1 line
2.3.2
Re: [PATCH 08/14] ASoC: wm8731: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 9/14 ASoC: wm8903: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm8903.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8903.c +2 -2
@@ -442,7 +442,7 @@ static int wm8903_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8903_priv *wm8903 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = wm8903->deemph; + ucontrol->value.integer.value[0 ] = wm8903->deemph;return 0 ; }
@@ -452,7 +452,7 @@ static int wm8903_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8903_priv *wm8903 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];int ret =0 ;if (deemph >1 )
Signature · 1 line
2.3.2
Re: [PATCH 09/14] ASoC: wm8903: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 10/14 ASoC: wm8904: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm8904.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8904.c +2 -2
@@ -525,7 +525,7 @@ static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8904_priv *wm8904 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = wm8904->deemph; + ucontrol->value.integer.value[0 ] = wm8904->deemph;return 0 ; }
@@ -534,7 +534,7 @@ static int wm8904_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8904_priv *wm8904 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];if (deemph >1 )return -EINVAL ;
Signature · 1 line
2.3.2
Re: [PATCH 10/14] ASoC: wm8904: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 11/14 ASoC: wm8955: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm8955.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8955.c +2 -2
@@ -393,7 +393,7 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8955_priv *wm8955 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = wm8955->deemph; + ucontrol->value.integer.value[0 ] = wm8955->deemph;return 0 ; }
@@ -402,7 +402,7 @@ static int wm8955_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8955_priv *wm8955 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];if (deemph >1 )return -EINVAL ;
Signature · 1 line
2.3.2
Re: [PATCH 11/14] ASoC: wm8955: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 12/14 ASoC: wm8960: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm8960.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8960.c +2 -2
@@ -184,7 +184,7 @@ static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8960_priv *wm8960 =snd_soc_codec_get_drvdata (codec); - ucontrol->value.enumerated.item[0 ] = wm8960->deemph; + ucontrol->value.integer.value[0 ] = wm8960->deemph;return 0 ; }
@@ -193,7 +193,7 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol, {struct snd_soc_codec *codec =snd_soc_kcontrol_codec (kcontrol);struct wm8960_priv *wm8960 =snd_soc_codec_get_drvdata (codec); -int deemph = ucontrol->value.enumerated.item[0 ]; +int deemph = ucontrol->value.integer.value[0 ];if (deemph >1 )return -EINVAL ;
Signature · 1 line
2.3.2
Re: [PATCH 12/14] ASoC: wm8960: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 13/14 ASoC: wm9712: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm9712.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm9712.c +3 -3
@@ -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;
@@ -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;
@@ -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 ;
Signature · 1 line
2.3.2
Re: [PATCH 13/14] ASoC: wm9712: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 14/14 ASoC: wm9713: Fix wrong value references for boolean kctl
In reply to Takashi IwaiThe 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.
--- sound/soc/codecs/wm9713.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm9713.c +3 -3
@@ -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_codec *codec =snd_soc_dapm_to_codec (dapm);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 *)kcontrol->private_value;unsigned int mixer, mask, shift, old;
@@ -268,7 +268,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol,mutex_lock (&wm9713->lock); old = wm9713->hp_mixer[mixer]; -if (ucontrol->value.enumerated.item[0 ]) +if (ucontrol->value.integer.value[0 ]) wm9713->hp_mixer[mixer] |= mask;else wm9713->hp_mixer[mixer] &= ~mask;
@@ -306,7 +306,7 @@ static int wm9713_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 ] = (wm9713->hp_mixer[mixer] >> shift) &1 ;return 0 ;
Signature · 1 line
2.3.2
Re: [PATCH 14/14] ASoC: wm9713: Fix wrong value references for boolean kctl
Quoted 8 lines · Takashi Iwai
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.Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
Quoted 4 lines · Takashi Iwai
Hi,
while looking through the ASoC codec codes, I noticed that lots of drivers refer to the wrong union value type for boolean controls.
Applied all, thanks.