ASoC: core: Add DOUBLE_R variants of the _RANGE controls
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 22 Jun 2012 10:40:55 +0000 (11:40 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 23 Jun 2012 11:11:30 +0000 (12:11 +0100)
The code handles this fine already, we just need new macros in the header
for drivers to create the controls.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
include/sound/soc.h

index e4348d2..e063380 100644 (file)
        ((unsigned long)&(struct soc_mixer_control) \
        {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
        .max = xmax, .platform_max = xmax, .invert = xinvert})
+#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
+       ((unsigned long)&(struct soc_mixer_control) \
+       {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
+       .min = xmin, .max = xmax, .platform_max = xmax, .invert = xinvert})
 #define SOC_SINGLE(xname, reg, shift, max, invert) \
 {      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
        .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
        .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
        .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
                                            xmax, xinvert) }
+#define SOC_DOUBLE_R_RANGE(xname, reg_left, reg_right, xshift, xmin, \
+                          xmax, xinvert)               \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+       .info = snd_soc_info_volsw_range, \
+       .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
+       .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \
+                                           xshift, xmin, xmax, xinvert) }
 #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \
 {      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
        .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
        .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
        .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
                                            xmax, xinvert) }
+#define SOC_DOUBLE_R_RANGE_TLV(xname, reg_left, reg_right, xshift, xmin, \
+                              xmax, xinvert, 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 = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
+       .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \
+                                           xshift, xmin, xmax, xinvert) }
 #define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \
 {       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
        .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \