[alsa-devel] [PATCH 07/16] ASoC: core: Add macro for hwdep range of regs control

Ola Lilja ola.o.lilja at stericsson.com
Tue Mar 13 16:11:34 CET 2012


From: Kristoffer KARLSSON <kristoffer.karlsson at stericsson.com>

Added convenience macro for hwdep range of register controls
that maps a range of consecutive registers exposed as
a multiple value control.

This is specifically useful for hardware that exposes for instance
a range of filter parameters as a range of registers that with
this could be written and read back in one single ioctl operation.

SOC_HWDEP_MULTIPLE_1R  Multiple hwdep signed control values spans one register each

Signed-off-by: Kristoffer KARLSSON <kristoffer.karlsson at stericsson.com>
---
 include/sound/soc.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 4acdd35..644167d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -237,6 +237,12 @@
 	.private_value =  \
 		SOC_SINGLE_VALUE_S4R(reg0, reg1, reg2, reg3, \
 			reg4, reg5, reg6, reg7, 1, min, max, invert) }
+#define SOC_HWDEP_MULTIPLE_1R(xname, reg0, count, min, max, invert) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_HWDEP, .name = xname, \
+	.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
+	.info = snd_soc_info_xr_sx, .get = snd_soc_get_m1r_sx, \
+	.put = snd_soc_put_m1r_sx, \
+	.private_value = SOC_SINGLE_VALUE_S1R(reg0, count, min, max, invert) }
 
 #define SOC_ENUM_STROBE(xname, xenum) \
 	SOC_ENUM_EXT(xname, xenum, \
-- 
1.7.8.3



More information about the Alsa-devel mailing list