diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-01-21 16:04:03 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-01-25 09:51:02 -0500 |
commit | 6c2fb6a8d8c43544e7665859f29373c98d17df75 (patch) | |
tree | b9718d1d66cc4fef22bbf86074e1c580a67b1fd7 /include/sound/soc.h | |
parent | 8484c63f4b363d79febe35f95328e38018b65026 (diff) |
ASoC: add helper macros to declare struct soc_enum instances
Several shortcuts for popular uses of some of SOC_ENUM_* and
SOC_VALUE_ENUM_* macros.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index a8768ea7571a..4bbeb9f83ece 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -169,6 +169,23 @@ | |||
169 | .private_value = (unsigned long)&xenum } | 169 | .private_value = (unsigned long)&xenum } |
170 | 170 | ||
171 | /* | 171 | /* |
172 | * Simplified versions of above macros, declaring a struct and calculating | ||
173 | * ARRAY_SIZE internally | ||
174 | */ | ||
175 | #define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \ | ||
176 | struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \ | ||
177 | ARRAY_SIZE(xtexts), xtexts) | ||
178 | #define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \ | ||
179 | SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts) | ||
180 | #define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \ | ||
181 | struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts) | ||
182 | #define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \ | ||
183 | struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \ | ||
184 | ARRAY_SIZE(xtexts), xtexts, xvalues) | ||
185 | #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ | ||
186 | SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) | ||
187 | |||
188 | /* | ||
172 | * Bias levels | 189 | * Bias levels |
173 | * | 190 | * |
174 | * @ON: Bias is fully on for audio playback and capture operations. | 191 | * @ON: Bias is fully on for audio playback and capture operations. |