Skip to contentSkip to conversation

ASoC: wm8994: Fix class W controls

PATCH In review Mark Brown 2 participants 3 messages Aug 5, 2013

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 ASoC: wm8994: Fix class W controls

From: Mark Brown <[email protected]>

Commit 6e0650 (ASoC: wm8994: Use SOC_SINGLE_EXT() instead of open-coding it) went too far and converted a DAPM control to use SOC_SINGLE_EXT() which crashes. Revert that portion of the patch.

---
 sound/soc/codecs/wm8994.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8994.c +4 -2
index d76b056..f32998a 100644
@@ -1432,8 +1432,10 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
 };
 
 #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \
-	SOC_SINGLE_EXT(xname, reg, shift, max, invert, \
-		snd_soc_get_volsw, wm8994_put_class_w)
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
+	.info = snd_soc_info_volsw, \
+	.get = snd_soc_dapm_get_volsw, .put = wm8994_put_class_w, \
+	.private_value =  SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
 
 static int wm8994_put_class_w(struct snd_kcontrol *kcontrol,
 			      struct snd_ctl_elem_value *ucontrol)
Signature · 1 line
1.8.4.rc0
#1 lore raw
Quoted 16 lines · Mark Brown

From: Mark Brown <[email protected]>

Commit 6e0650 (ASoC: wm8994: Use SOC_SINGLE_EXT() instead of open-coding it) went too far and converted a DAPM control to use SOC_SINGLE_EXT() which crashes. Revert that portion of the patch.

---
  sound/soc/codecs/wm8994.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8994.c +0 -0
index d76b056..f32998a 100644

sound/soc/codecs/wm8994.c SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING, · line 1438

Quoted 9 lines
sound/soc/codecs/wm8994.c +4 -2
@@ -1432,8 +1432,10 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
  };
 
  #define WM8994_CLASS_W_SWITCH(xname, reg, shift, max, invert) \
-	SOC_SINGLE_EXT(xname, reg, shift, max, invert, \
-		snd_soc_get_volsw, wm8994_put_class_w)
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
+	.info = snd_soc_info_volsw, \
+	.get = snd_soc_dapm_get_volsw, .put = wm8994_put_class_w, \
+	.private_value =  SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }

Hm, right. But I think it should be enough to just replace the snd_soc_get_volsw with snd_soc_dapm_get_volsw

- Lars

author maintainer
#2 lore raw
Quoted 2 lines · Lars-Peter Clausen

Hm, right. But I think it should be enough to just replace the snd_soc_get_volsw with snd_soc_dapm_get_volsw

Yes, that should work too.