diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2011-05-13 12:16:52 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-16 12:06:47 -0400 |
commit | 9d03545d886bedd2c81b8f28ae0cc68c356d02f7 (patch) | |
tree | bc1d7c1d2d94c4e4eba1c51bcf77f50e467bb21e /sound/soc | |
parent | fa63e477ddb09075f68cd5fe4db8f8045627a787 (diff) |
ASoC: Fix wrong data type access in a few codec drivers
Commit fafd217 ("ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol")
changed the control private data type that is passed to snd_soc_cnew when
creating dapm mixer and mux controls. Commit did not update a few codec
drivers that are using their own put callbacks and thus are accessing a
wrong data type.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8903.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8993.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/wm8995.c | 4 |
5 files changed, 12 insertions, 7 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 6c43c13f0430..c3d96fc8c267 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -157,7 +157,8 @@ static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg, | |||
157 | static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, | 157 | static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, |
158 | struct snd_ctl_elem_value *ucontrol) | 158 | struct snd_ctl_elem_value *ucontrol) |
159 | { | 159 | { |
160 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 160 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); |
161 | struct snd_soc_dapm_widget *widget = wlist->widgets[0]; | ||
161 | struct soc_mixer_control *mc = | 162 | struct soc_mixer_control *mc = |
162 | (struct soc_mixer_control *)kcontrol->private_value; | 163 | (struct soc_mixer_control *)kcontrol->private_value; |
163 | unsigned int reg = mc->reg; | 164 | unsigned int reg = mc->reg; |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 957cd66177d6..43e3d760766f 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -382,7 +382,8 @@ static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm, | |||
382 | static int wm8903_class_w_put(struct snd_kcontrol *kcontrol, | 382 | static int wm8903_class_w_put(struct snd_kcontrol *kcontrol, |
383 | struct snd_ctl_elem_value *ucontrol) | 383 | struct snd_ctl_elem_value *ucontrol) |
384 | { | 384 | { |
385 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 385 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); |
386 | struct snd_soc_dapm_widget *widget = wlist->widgets[0]; | ||
386 | struct snd_soc_codec *codec = widget->codec; | 387 | struct snd_soc_codec *codec = widget->codec; |
387 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); | 388 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); |
388 | u16 reg; | 389 | u16 reg; |
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 056aef904347..9e5ff789b805 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c | |||
@@ -718,7 +718,8 @@ static int clk_sys_event(struct snd_soc_dapm_widget *w, | |||
718 | static int class_w_put(struct snd_kcontrol *kcontrol, | 718 | static int class_w_put(struct snd_kcontrol *kcontrol, |
719 | struct snd_ctl_elem_value *ucontrol) | 719 | struct snd_ctl_elem_value *ucontrol) |
720 | { | 720 | { |
721 | struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol); | 721 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); |
722 | struct snd_soc_dapm_widget *widget = wlist->widgets[0]; | ||
722 | struct snd_soc_codec *codec = widget->codec; | 723 | struct snd_soc_codec *codec = widget->codec; |
723 | struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); | 724 | struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); |
724 | int ret; | 725 | int ret; |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index e6dfa103ad2a..970a95c5360b 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -877,7 +877,8 @@ static const char *hp_mux_text[] = { | |||
877 | static int wm8994_put_hp_enum(struct snd_kcontrol *kcontrol, | 877 | static int wm8994_put_hp_enum(struct snd_kcontrol *kcontrol, |
878 | struct snd_ctl_elem_value *ucontrol) | 878 | struct snd_ctl_elem_value *ucontrol) |
879 | { | 879 | { |
880 | struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol); | 880 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); |
881 | struct snd_soc_dapm_widget *w = wlist->widgets[0]; | ||
881 | struct snd_soc_codec *codec = w->codec; | 882 | struct snd_soc_codec *codec = w->codec; |
882 | int ret; | 883 | int ret; |
883 | 884 | ||
@@ -1004,7 +1005,8 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING, | |||
1004 | static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, | 1005 | static int wm8994_put_class_w(struct snd_kcontrol *kcontrol, |
1005 | struct snd_ctl_elem_value *ucontrol) | 1006 | struct snd_ctl_elem_value *ucontrol) |
1006 | { | 1007 | { |
1007 | struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol); | 1008 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); |
1009 | struct snd_soc_dapm_widget *w = wlist->widgets[0]; | ||
1008 | struct snd_soc_codec *codec = w->codec; | 1010 | struct snd_soc_codec *codec = w->codec; |
1009 | int ret; | 1011 | int ret; |
1010 | 1012 | ||
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 67eaaecbb42e..5ad873fda814 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c | |||
@@ -305,11 +305,11 @@ static int check_clk_sys(struct snd_soc_dapm_widget *source, | |||
305 | static int wm8995_put_class_w(struct snd_kcontrol *kcontrol, | 305 | static int wm8995_put_class_w(struct snd_kcontrol *kcontrol, |
306 | struct snd_ctl_elem_value *ucontrol) | 306 | struct snd_ctl_elem_value *ucontrol) |
307 | { | 307 | { |
308 | struct snd_soc_dapm_widget *w; | 308 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); |
309 | struct snd_soc_dapm_widget *w = wlist->widgets[0]; | ||
309 | struct snd_soc_codec *codec; | 310 | struct snd_soc_codec *codec; |
310 | int ret; | 311 | int ret; |
311 | 312 | ||
312 | w = snd_kcontrol_chip(kcontrol); | ||
313 | codec = w->codec; | 313 | codec = w->codec; |
314 | ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); | 314 | ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); |
315 | wm8995_update_class_w(codec); | 315 | wm8995_update_class_w(codec); |