aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-22 06:40:55 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-23 07:11:30 -0400
commit229e3fdc1ba49b747e9434b55b3f6bd68a4db251 (patch)
treefb4eb77e26e17565f1caeeaf4953cea510c7ddae /include/sound
parentbb1591b3de7c9c6b28f337e214100a394a126ab2 (diff)
ASoC: core: Add DOUBLE_R variants of the _RANGE controls
The code handles this fine already, we just need new macros in the header for drivers to create the controls. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e4348d25fca3..e063380f63a2 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -42,6 +42,10 @@
42 ((unsigned long)&(struct soc_mixer_control) \ 42 ((unsigned long)&(struct soc_mixer_control) \
43 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 43 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
44 .max = xmax, .platform_max = xmax, .invert = xinvert}) 44 .max = xmax, .platform_max = xmax, .invert = xinvert})
45#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
46 ((unsigned long)&(struct soc_mixer_control) \
47 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
48 .min = xmin, .max = xmax, .platform_max = xmax, .invert = xinvert})
45#define SOC_SINGLE(xname, reg, shift, max, invert) \ 49#define SOC_SINGLE(xname, reg, shift, max, invert) \
46{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 50{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
47 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 51 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
@@ -96,6 +100,13 @@
96 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ 100 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
97 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 101 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
98 xmax, xinvert) } 102 xmax, xinvert) }
103#define SOC_DOUBLE_R_RANGE(xname, reg_left, reg_right, xshift, xmin, \
104 xmax, xinvert) \
105{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
106 .info = snd_soc_info_volsw_range, \
107 .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
108 .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \
109 xshift, xmin, xmax, xinvert) }
99#define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ 110#define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \
100{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 111{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
101 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 112 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -114,6 +125,16 @@
114 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ 125 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
115 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 126 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
116 xmax, xinvert) } 127 xmax, xinvert) }
128#define SOC_DOUBLE_R_RANGE_TLV(xname, reg_left, reg_right, xshift, xmin, \
129 xmax, xinvert, tlv_array) \
130{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
131 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
132 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
133 .tlv.p = (tlv_array), \
134 .info = snd_soc_info_volsw_range, \
135 .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
136 .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \
137 xshift, xmin, xmax, xinvert) }
117#define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \ 138#define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \
118{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 139{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
119 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 140 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \