Skip to contentSkip to conversation

ASoC: Add SOC_DOUBLE_S8_TLV control type

PATCH In review Mark Brown 2 participants 3 messages May 28, 2008 – May 29, 2008

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/2 ASoC: Add SOC_DOUBLE_S8_TLV control type

The SOC_DOUBLE_S8_TLV control type was originally implemented in the UDA1380 driver by Philipp Zabel and was moved into the core by me.

---
 include/sound/soc.h  |   15 ++++++++++
 sound/soc/soc-core.c |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 0 deletions(-)
include/sound/soc.h +15 -0
index bca9538..9fa2093 100644
@@ -73,6 +73,15 @@
 	.get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
 	.private_value = (reg_left) | ((shift) << 8)  | \
 		((max) << 12) | ((invert) << 20) | ((reg_right) << 24) }
+#define SOC_DOUBLE_S8_TLV(xname, reg, min, max, tlv_array) \
+{	.iface  = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
+	.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
+		  SNDRV_CTL_ELEM_ACCESS_READWRITE, \
+	.tlv.p  = (tlv_array), \
+	.info   = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \
+	.put    = snd_soc_put_volsw_s8, \
+	.private_value = (reg) | (((signed char)max) << 16) | \
+			 (((signed char)min) << 24) }
 #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
 {	.reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
 	.mask = xmask, .texts = xtexts }
@@ -267,6 +276,12 @@ int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol);
 int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol);
+int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_info *uinfo);
+int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol);
+int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol);
 
 /* SoC PCM stream information */
 struct snd_soc_pcm_stream {
sound/soc/soc-core.c +72 -0

78 lines not on this page · raw message

Signature · 1 line
1.5.5.1
author
#1 lore raw

PATCH 2/2 ASoC: Add UDA1380 driver

From: Philipp Zabel <[email protected]>

The UDA1380 codec is used by the HTC Magician and a number of Samsung reference boards.

This driver has had a long out of tree history, having originally been written by Giorgio Padrin and converted to ASoC by Richard Purdie. Since conversion to ASoC most of the work on the driver has been done by Philipp Zabel with some review and updates for new APIs by Liam Girdwood and Mark Brown.

---
 sound/soc/codecs/Kconfig   |    4 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/uda1380.c |  852 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/uda1380.h |   89 +++++
 4 files changed, 947 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/uda1380.c
 create mode 100644 sound/soc/codecs/uda1380.h
sound/soc/codecs/Kconfig +4 -0
index d4a5fe4..04b99a5 100644
@@ -2,6 +2,10 @@ config SND_SOC_AC97_CODEC
 	tristate
 	select SND_AC97_CODEC
 
+config SND_SOC_UDA1380
+        tristate
+        depends on SND_SOC
+
 config SND_SOC_WM8731
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 4e1314c..d5926a1 100644
@@ -1,4 +1,5 @@
 snd-soc-ac97-objs := ac97.o
+snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8731-objs := wm8731.o
 snd-soc-wm8750-objs := wm8750.o
 snd-soc-wm8753-objs := wm8753.o
@@ -8,6 +9,7 @@ snd-soc-cs4270-objs := cs4270.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 
 obj-$(CONFIG_SND_SOC_AC97_CODEC)	+= snd-soc-ac97.o
+obj-$(CONFIG_SND_SOC_UDA1380)	+= snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8731)	+= snd-soc-wm8731.o
 obj-$(CONFIG_SND_SOC_WM8750)	+= snd-soc-wm8750.o
 obj-$(CONFIG_SND_SOC_WM8753)	+= snd-soc-wm8753.o
sound/soc/codecs/uda1380.c new file +852 -0

852 lines not on this page · raw message

sound/soc/codecs/uda1380.h new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
1.5.5.1