Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: core: Add new SOC_DOUBLE_SX_TLV macro

Currently macros only exist for SX style (implicit sign bit 2's
compliment) volume controls where the volumes for left and right
are in separate registers. Some future Cirrus devices will have
both volumes in the same register, as such add a new macro to
support this.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220621102041.1713504-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
6b183919 289a3ec0

+12
+12
include/sound/soc.h
··· 136 136 .put = snd_soc_put_volsw, \ 137 137 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ 138 138 max, invert, 0) } 139 + #define SOC_DOUBLE_SX_TLV(xname, xreg, shift_left, shift_right, xmin, xmax, tlv_array) \ 140 + { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 141 + .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 142 + SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 143 + .tlv.p = (tlv_array), \ 144 + .info = snd_soc_info_volsw_sx, \ 145 + .get = snd_soc_get_volsw_sx, \ 146 + .put = snd_soc_put_volsw_sx, \ 147 + .private_value = (unsigned long)&(struct soc_mixer_control) \ 148 + {.reg = xreg, .rreg = xreg, \ 149 + .shift = shift_left, .rshift = shift_right, \ 150 + .max = xmax, .min = xmin} } 139 151 #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ 140 152 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 141 153 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\