aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-14 20:11:15 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-15 11:01:31 -0500
commit48a8c3943d1010c81d8144cc773f81c30bf59246 (patch)
tree3c21dcdc715ef23e8cc860f7e3e316152b8b7c2b /sound/soc/soc-dapm.c
parent64e60f9f9e59f861fe9b79802b3cb03ca06b422f (diff)
ASoC: dapm: Convert pin switches to use snd_soc_card
Since the addition of the non-CODEC control adds card controls like the DAPM pin switch have been broken as they are expecting the private data for the control to be the CODEC but it's now the card. Fix that for the pin switches, an audit of other drivers is required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 63a5614d33cb..0740cfc3d991 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2657,15 +2657,15 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_info_pin_switch);
2657int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, 2657int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
2658 struct snd_ctl_elem_value *ucontrol) 2658 struct snd_ctl_elem_value *ucontrol)
2659{ 2659{
2660 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2660 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
2661 const char *pin = (const char *)kcontrol->private_value; 2661 const char *pin = (const char *)kcontrol->private_value;
2662 2662
2663 mutex_lock(&codec->mutex); 2663 mutex_lock(&card->mutex);
2664 2664
2665 ucontrol->value.integer.value[0] = 2665 ucontrol->value.integer.value[0] =
2666 snd_soc_dapm_get_pin_status(&codec->dapm, pin); 2666 snd_soc_dapm_get_pin_status(&card->dapm, pin);
2667 2667
2668 mutex_unlock(&codec->mutex); 2668 mutex_unlock(&card->mutex);
2669 2669
2670 return 0; 2670 return 0;
2671} 2671}
@@ -2680,19 +2680,19 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_switch);
2680int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, 2680int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
2681 struct snd_ctl_elem_value *ucontrol) 2681 struct snd_ctl_elem_value *ucontrol)
2682{ 2682{
2683 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2683 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
2684 const char *pin = (const char *)kcontrol->private_value; 2684 const char *pin = (const char *)kcontrol->private_value;
2685 2685
2686 mutex_lock(&codec->mutex); 2686 mutex_lock(&card->mutex);
2687 2687
2688 if (ucontrol->value.integer.value[0]) 2688 if (ucontrol->value.integer.value[0])
2689 snd_soc_dapm_enable_pin(&codec->dapm, pin); 2689 snd_soc_dapm_enable_pin(&card->dapm, pin);
2690 else 2690 else
2691 snd_soc_dapm_disable_pin(&codec->dapm, pin); 2691 snd_soc_dapm_disable_pin(&card->dapm, pin);
2692 2692
2693 snd_soc_dapm_sync(&codec->dapm); 2693 snd_soc_dapm_sync(&card->dapm);
2694 2694
2695 mutex_unlock(&codec->mutex); 2695 mutex_unlock(&card->mutex);
2696 2696
2697 return 0; 2697 return 0;
2698} 2698}