aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2015-09-16 13:59:42 +0100
committerMark Brown <broonie@kernel.org>2015-09-16 21:00:04 +0100
commita54e22f40480eb63533d3f0520e9c84b102dd09f (patch)
tree86dfdc5fa12b317882aa926540cae15966da0d4e /include/sound
parentASoC: arizona: Add utility function to check if an input is analog (diff)
downloadlinux-dev-a54e22f40480eb63533d3f0520e9c84b102dd09f.tar.xz
linux-dev-a54e22f40480eb63533d3f0520e9c84b102dd09f.zip
ASoC: Add SOC_SINGLE_RANGE_EXT_TLV macro
Add a version of the SOC_SINGLE_RANGE_TLV macro that allows a custom get and put to be specified. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 884e728b09d9..9ffa28514fa7 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -226,6 +226,18 @@
.info = snd_soc_info_volsw, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
+#define SOC_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, 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_range, \
+ .get = xhandler_get, .put = xhandler_put, \
+ .private_value = (unsigned long)&(struct soc_mixer_control) \
+ {.reg = xreg, .rreg = xreg, .shift = xshift, \
+ .rshift = xshift, .min = xmin, .max = xmax, \
+ .platform_max = xmax, .invert = 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), \