Skip to contentSkip to conversation

Fix wrong ctl value references in ASoC codecs

PATCH Applied Takashi Iwai 5 participants 27 messages Mar 10, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index b67480f1b1aa..4373ada95648 100644
@@ -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
maintainer Acked-by on v1 1/14
#2 lore raw

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.

Thanks.

#3 lore raw

PATCH 2/14 ASoC: ak4641: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/ak4641.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/ak4641.c +2 -2
index 70861c7b1631..81b54a270bd8 100644
@@ -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
#4 lore raw

PATCH 3/14 ASoC: cs4271: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/cs4271.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4271.c +2 -2
index 79a4efcb894c..7d3a6accaf9a 100644
@@ -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
Acked-by Paul Handrigan > on v1 3/14
#5 lore raw

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;

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.

---
 sound/soc/codecs/cs4271.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4271.c +0 -0
index 79a4efcb894c..7d3a6accaf9a 100644

Thanks!

maintainer
#6 lore raw

Re: [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.

---
 sound/soc/codecs/cs4271.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4271.c +0 -0
index 79a4efcb894c..7d3a6accaf9a 100644

Thanks!

#7 lore raw

PATCH 4/14 ASoC: es8238: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/es8328.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/es8328.c +2 -2
index f27325155ace..c5f35a07e8e4 100644
@@ -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
#8 lore raw

PATCH 5/14 ASoC: pcm1681: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/pcm1681.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/pcm1681.c +2 -2
index a722a023c262..477e13d30971 100644
@@ -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
#9 lore raw

PATCH 6/14 ASoC: tas5086: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/tas5086.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/tas5086.c +2 -2
index 249ef5c4c762..32942bed34b1 100644
@@ -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
#10 lore raw

PATCH 7/14 ASoC: wm2000: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm2000.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/wm2000.c +4 -4
index 8d9de49a5052..21d5402e343f 100644
@@ -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
Acked-by on v1 7/14
#11 lore raw

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.

---

Thanks,
Charles

#12 lore raw

PATCH 8/14 ASoC: wm8731: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm8731.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8731.c +2 -2
index 098c143f44d6..c6d10533e2bd 100644
@@ -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
Acked-by on v1 8/14
#13 lore raw

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.

---

Thanks,
Charles

#14 lore raw

PATCH 9/14 ASoC: wm8903: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm8903.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8903.c +2 -2
index dde462c082be..04b04f8e147c 100644
@@ -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
Acked-by on v1 9/14
#15 lore raw

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.

---

Thanks,
Charles

#16 lore raw

PATCH 10/14 ASoC: wm8904: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm8904.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8904.c +2 -2
index d3b3f57668cc..215e93c1ddf0 100644
@@ -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
Acked-by on v1 10/14
#17 lore raw

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.

---

Thanks,
Charles

#18 lore raw

PATCH 11/14 ASoC: wm8955: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm8955.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8955.c +2 -2
index 1ab2d462afad..00bec915d652 100644
@@ -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
Acked-by on v1 11/14
#19 lore raw

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.

---

Thanks,
Charles

#20 lore raw

PATCH 12/14 ASoC: wm8960: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm8960.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8960.c +2 -2
index cf8fecf97f2c..3035d9856415 100644
@@ -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
Acked-by on v1 12/14
#21 lore raw

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.

---

Thanks,
Charles

#22 lore raw

PATCH 13/14 ASoC: wm9712: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm9712.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm9712.c +3 -3
index 9517571e820d..98c9525bd751 100644
@@ -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
Acked-by on v1 13/14
#23 lore raw

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.

---

Thanks,
Charles

#24 lore raw

PATCH 14/14 ASoC: wm9713: Fix wrong value references for boolean kctl

In reply to 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.

---
 sound/soc/codecs/wm9713.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/wm9713.c +3 -3
index 68222917b396..79552953e1bd 100644
@@ -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
Acked-by on v1 14/14
#25 lore raw

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.

---

Thanks,
Charles

maintainer Applied
#26 lore raw
In reply to Takashi Iwai
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.