ASoC: Add SND_SOC_DAPM_PIN_SWITCH controls for exposing DAPM pins

Previous thread: ASoC: wm8753 - Fix build error by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:08 pm. (1 message)

Next thread: ASoC: Only unregister drivers we registered for WM8753 by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:08 pm. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 12:08 pm

Gitweb:     http://git.kernel.org/linus/8b37dbd2a180667e51db0552383df18743239c25
Commit:     8b37dbd2a180667e51db0552383df18743239c25
Parent:     4eae080dda3a563160be2f642cfbda27ffc42178
Author:     Mark Brown <broonie@opensource.wolfsonmicro.com>
AuthorDate: Sat Feb 28 21:14:20 2009 +0000
Committer:  Mark Brown <broonie@opensource.wolfsonmicro.com>
CommitDate: Sat Feb 28 21:31:21 2009 +0000

    ASoC: Add SND_SOC_DAPM_PIN_SWITCH controls for exposing DAPM pins
    
    On some systems it is desirable for control for DAPM pins to be provided
    to user space. This is the case with things like GSM modems which are
    controlled primarily from user space, for example. Provide a helper which
    exposes the state of a DAPM pin to user space for use in cases like this.
    
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/sound/soc-dapm.h |   12 ++++++++
 sound/soc/soc-dapm.c     |   70 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index bb3a863..a7def6a 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -192,6 +192,12 @@
 	.get = snd_soc_dapm_get_value_enum_double, \
 	.put = snd_soc_dapm_put_value_enum_double, \
 	.private_value = (unsigned long)&xenum }
+#define SOC_DAPM_PIN_SWITCH(xname) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \
+	.info = snd_soc_dapm_info_pin_switch, \
+	.get = snd_soc_dapm_get_pin_switch, \
+	.put = snd_soc_dapm_put_pin_switch, \
+	.private_value = (unsigned long)xname }
 
 /* dapm stream operations */
 #define SND_SOC_DAPM_STREAM_NOP			0x0
@@ -238,6 +244,12 @@ int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol);
 int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol);
+int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol,
+	struct ...
Previous thread: ASoC: wm8753 - Fix build error by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:08 pm. (1 message)

Next thread: ASoC: Only unregister drivers we registered for WM8753 by Linux Kernel Mailing List on Thursday, March 26, 2009 - 12:08 pm. (1 message)