All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: add SOC_DOUBLE_EXT_TLV control type
@ 2009-07-15 11:33 Joonyoung Shim
  0 siblings, 0 replies; only message in thread
From: Joonyoung Shim @ 2009-07-15 11:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: kyungmin.park, broonie

This is a macro for double controls with special callback function and
TLV. The SOC_DOUBLE_EXT_TLV needs one register and two shifts for double
controls.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 include/sound/soc.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 94fcc65..795a6b4 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -135,6 +135,17 @@
 	.info = snd_soc_info_volsw, \
 	.get = xhandler_get, .put = xhandler_put, \
 	.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
+#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
+	 xhandler_get, xhandler_put, 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, \
+	.get = xhandler_get, .put = xhandler_put, \
+	.private_value = (unsigned long)&(struct soc_mixer_control) \
+		{.reg = xreg, .shift = shift_left, .rshift = shift_right, \
+		.max = xmax, .invert = xinvert} }
 #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
 {	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
 	.info = snd_soc_info_bool_ext, \
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-15 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 11:33 [PATCH 1/3] ASoC: add SOC_DOUBLE_EXT_TLV control type Joonyoung Shim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.