aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown2022-04-25 18:22:55 +0100
committerMark Brown2022-04-25 18:22:55 +0100
commit9a2fb6e78136cfd4499c745ace0f7bc7473556da (patch)
treef13a640e3db0ffe230e2211ec7e26bd0fb8211c9 /include
parentb34a068c0286ba9ca4068d7c85595e7b908007a0 (diff)
parent5349c0c93d15dff27d99fec12fc82040fab340bd (diff)
ASoC: Add macros for signed TLV controls with callbacks
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: This adds SOC_DOUBLE_R_S_EXT_TLV and SOC_SINGLE_S_EXT_TLV macros for signed TLV controls that need custom get/put callbacks. These will be needed by future Cirrus codec drivers, but are not particularly exotic so could be useful for others.
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2d3261799d2c..f906e5a70830 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -282,6 +282,23 @@
.get = xhandler_get, .put = xhandler_put, \
.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
xmax, xinvert) }
+#define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \
+ xsign_bit, 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, \
+ .get = xhandler_get, .put = xhandler_put, \
+ .private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
+ xmin, xmax, xsign_bit, xinvert) }
+#define SOC_SINGLE_S_EXT_TLV(xname, xreg, xshift, xmin, xmax, \
+ xsign_bit, xinvert, xhandler_get, xhandler_put, \
+ tlv_array) \
+ SOC_DOUBLE_R_S_EXT_TLV(xname, xreg, xreg, xshift, xmin, xmax, \
+ xsign_bit, xinvert, xhandler_get, xhandler_put, \
+ tlv_array)
#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_bool_ext, \