ASoC: Add SOC_DOUBLE_STS macro
authorDamien.Horsley <Damien.Horsley@imgtec.com>
Tue, 8 Dec 2015 15:58:58 +0000 (15:58 +0000)
committerMark Brown <broonie@kernel.org>
Sat, 12 Dec 2015 22:38:20 +0000 (22:38 +0000)
Add SOC_DOUBLE_STS macro for read-only volatile status controls

Signed-off-by: Damien.Horsley <Damien.Horsley@imgtec.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h

index a8b4b9c8b1d2415e7220913715fc2cd4bd95212c..2b399b0d7f8a7ecbf3bd791db1d7b37d20b5c4a8 100644 (file)
        .put = snd_soc_put_volsw, \
        .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
                                          max, invert, 0) }
+#define SOC_DOUBLE_STS(xname, reg, shift_left, shift_right, max, invert) \
+{                                                                      \
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),           \
+       .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,           \
+       .access = SNDRV_CTL_ELEM_ACCESS_READ |                          \
+               SNDRV_CTL_ELEM_ACCESS_VOLATILE,                         \
+       .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
+                                         max, invert, 0) }
 #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
 {      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
        .info = snd_soc_info_volsw, \