Skip to content

Commit 9a2fb6e

Browse files
committed
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.
2 parents b34a068 + 5349c0c commit 9a2fb6e

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

include/sound/soc.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,23 @@
282282
.get = xhandler_get, .put = xhandler_put, \
283283
.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
284284
xmax, xinvert) }
285+
#define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \
286+
xsign_bit, xinvert, xhandler_get, xhandler_put, \
287+
tlv_array) \
288+
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
289+
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
290+
SNDRV_CTL_ELEM_ACCESS_READWRITE, \
291+
.tlv.p = (tlv_array), \
292+
.info = snd_soc_info_volsw, \
293+
.get = xhandler_get, .put = xhandler_put, \
294+
.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
295+
xmin, xmax, xsign_bit, xinvert) }
296+
#define SOC_SINGLE_S_EXT_TLV(xname, xreg, xshift, xmin, xmax, \
297+
xsign_bit, xinvert, xhandler_get, xhandler_put, \
298+
tlv_array) \
299+
SOC_DOUBLE_R_S_EXT_TLV(xname, xreg, xreg, xshift, xmin, xmax, \
300+
xsign_bit, xinvert, xhandler_get, xhandler_put, \
301+
tlv_array)
285302
#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
286303
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
287304
.info = snd_soc_info_bool_ext, \

0 commit comments

Comments
 (0)