[alsa-devel] [PATCH 04/11] ASoC: Add macros for defining virtual enums
Takashi Iwai
tiwai at suse.de
Mon Feb 24 10:29:20 CET 2014
At Sun, 23 Feb 2014 16:10:14 +0100,
Lars-Peter Clausen wrote:
>
> With the upcoming consolidation of normal MUXs and virtual MUXs we need to be
> able to distinguish between enums with and without a backing register at the
> enum level. Use the same approach as used for virtual mixer controls by setting
> the reg field of the enum to SND_SOC_NOPM for enums without a backing register.
> This patch adds a set of helper macros that can be used to define such enums.
>
> Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
> ---
> include/sound/soc.h | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/sound/soc.h b/include/sound/soc.h
> index e005196..a25de13 100644
> --- a/include/sound/soc.h
> +++ b/include/sound/soc.h
> @@ -189,6 +189,8 @@
> .mask = xmask, .items = xitems, .texts = xtexts, .values = xvalues}
> #define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xnitmes, xtexts, xvalues) \
> SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xnitmes, xtexts, xvalues)
> +#define SOC_ENUM_SINGLE_VIRT(xmax, xtexts) \
> + SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, xmax, xtexts)
Could you replace "max" with "items"?
Takashi
More information about the Alsa-devel
mailing list