[alsa-devel] [PATCH V2 1/3] ASoC: Add SOC_DOUBLE_STS macro

Damien Horsley Damien.Horsley at imgtec.com
Tue Dec 8 16:58:58 CET 2015


From: "Damien.Horsley" <Damien.Horsley at imgtec.com>

Add SOC_DOUBLE_STS macro for read-only volatile status controls

Signed-off-by: Damien.Horsley <Damien.Horsley at imgtec.com>
---
 include/sound/soc.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 03431e7..e8d834f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -110,6 +110,14 @@
 	.put = snd_soc_put_volsw, \
 	.private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
 					  max, invert, 0) }
+#define SOC_DOUBLE_STS(xname, reg, shift_left, shift_right, max, invert) \
+{									\
+	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),		\
+	.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,		\
+	.access = SNDRV_CTL_ELEM_ACCESS_READ |				\
+		SNDRV_CTL_ELEM_ACCESS_VOLATILE,				\
+	.private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right,	\
+					  max, invert, 0) }
 #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
 {	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
 	.info = snd_soc_info_volsw, \
-- 
2.1.4



More information about the Alsa-devel mailing list