aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-17 19:20:33 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-21 14:34:48 -0500
commitf831b055ececb3172f7fe498db5ca1fb43ff644d (patch)
treecf0209339df80b83065986fe4db7f1ad61b9a154 /include/sound
parent71d08516b80638a69d5efea4e8cb832c053f9dd9 (diff)
ASoC: core: Add support for masking out parts of coefficient blocks
Chip designers frequently include things like the enable and disable controls for algorithms in the register blocks which also hold the coefficients. Since it's desirable to split out the enable/disable control from userspace the plain SND_SOC_BYTES() isn't optimal for these devices. Add a SND_SOC_BYTES_MASK() which allows a bitmask from the first word of the block to be excluded from the control. This supports the needs of devices I've looked at and lets us have a reasonably simple API. Further controls can be added in future if that's needed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 3e9cae001eab..82bd773f8ab1 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -192,6 +192,14 @@
192 ((unsigned long)&(struct soc_bytes) \ 192 ((unsigned long)&(struct soc_bytes) \
193 {.base = xbase, .num_regs = xregs }) } 193 {.base = xbase, .num_regs = xregs }) }
194 194
195#define SND_SOC_BYTES_MASK(xname, xbase, xregs, xmask) \
196{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
197 .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
198 .put = snd_soc_bytes_put, .private_value = \
199 ((unsigned long)&(struct soc_bytes) \
200 {.base = xbase, .num_regs = xregs, \
201 .mask = xmask }) }
202
195/* 203/*
196 * Simplified versions of above macros, declaring a struct and calculating 204 * Simplified versions of above macros, declaring a struct and calculating
197 * ARRAY_SIZE internally 205 * ARRAY_SIZE internally
@@ -904,6 +912,7 @@ struct soc_mixer_control {
904struct soc_bytes { 912struct soc_bytes {
905 int base; 913 int base;
906 int num_regs; 914 int num_regs;
915 u32 mask;
907}; 916};
908 917
909/* enumerated kcontrol */ 918/* enumerated kcontrol */