ASoC: add SOC_DOUBLE_R_EXT_TLV control type
authorJoonyoung Shim <jy0922.shim@samsung.com>
Wed, 15 Jul 2009 11:33:50 +0000 (20:33 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 15 Jul 2009 15:59:06 +0000 (16:59 +0100)
This is a macro for double controls with special callback function and
TLV. The SOC_DOUBLE_R_EXT_TLV needs two registers and one shift for
double controls.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h

index 795a6b4..756fb59 100644 (file)
        .private_value = (unsigned long)&(struct soc_mixer_control) \
                {.reg = xreg, .shift = shift_left, .rshift = shift_right, \
                .max = xmax, .invert = xinvert} }
+#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, 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_2r, \
+       .get = xhandler_get, .put = xhandler_put, \
+       .private_value = (unsigned long)&(struct soc_mixer_control) \
+               {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
+               .max = xmax, .invert = xinvert} }
 #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, \