aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2014-01-16 10:02:11 -0500
committerShengjiu Wang <b02247@freescale.com>2014-05-13 04:55:00 -0400
commitb9d8007b7b1b32f386c82958d5740ed9424b013a (patch)
treedb44d682d6457fa90dd78750315ef3f549f4d579
parent2dac3d5a08aa3e8f18610113264eb8dc7781b4ae (diff)
ASoC: core: Add SOC_DOUBLE_R_S_TLV
Add a macro for signed mixer with two registers and tlv array. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit cd21b123346c6a2f033d8c3bd2bf240198b5712a)
-rw-r--r--include/sound/soc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1bb8e304b0db..802f6a79b622 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -44,6 +44,11 @@
44 ((unsigned long)&(struct soc_mixer_control) \ 44 ((unsigned long)&(struct soc_mixer_control) \
45 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 45 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
46 .max = xmax, .platform_max = xmax, .invert = xinvert}) 46 .max = xmax, .platform_max = xmax, .invert = xinvert})
47#define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \
48 ((unsigned long)&(struct soc_mixer_control) \
49 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
50 .max = xmax, .min = xmin, .platform_max = xmax, .sign_bit = xsign_bit, \
51 .invert = xinvert})
47#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ 52#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
48 ((unsigned long)&(struct soc_mixer_control) \ 53 ((unsigned long)&(struct soc_mixer_control) \
49 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 54 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
@@ -151,6 +156,15 @@
151 {.reg = xreg, .rreg = xrreg, \ 156 {.reg = xreg, .rreg = xrreg, \
152 .shift = xshift, .rshift = xshift, \ 157 .shift = xshift, .rshift = xshift, \
153 .max = xmax, .min = xmin} } 158 .max = xmax, .min = xmin} }
159#define SOC_DOUBLE_R_S_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \
160{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
161 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
162 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
163 .tlv.p = (tlv_array), \
164 .info = snd_soc_info_volsw, \
165 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
166 .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
167 xmin, xmax, xsign_bit, xinvert) }
154#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ 168#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
155{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 169{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
156 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 170 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \