aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2015-05-01 07:37:26 -0400
committerMark Brown <broonie@kernel.org>2015-05-06 12:13:01 -0400
commit561ed680b764b288feeb74a24e1d9fb3da98ec7b (patch)
treedf2de90bd178c0873e526b4ea985ee97a17a29da /include/sound
parent773da9b358bfbef1b7a862425fea0d9d9d3443f8 (diff)
ASoC: dapm: Add support for autodisable mux controls
Commit 57295073b6ac ("ASoC: dapm: Implement mixer input auto-disable") added support for autodisable controls, controls whose values are only written to the hardware when their respective widgets are powered up. But it only added support for controls based on the mixer abstraction. This patch add support for mux controls (DAPM controls based on the enum abstraction) to be auto-disabled as well. As each mux can only have a single control, there is no need to tie the autodisable widget to the inputs (as is done for the mixer controls) it can be tided directly to the mux widget itself. Note that it is assumed that the first entry in a autodisable mux control will always represent the off state for the mux and is what the mux will be set to whilst it is disabled. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index b257a09a98d1..2f2e59e1513e 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -192,6 +192,10 @@
192 .mask = xmask, .items = xitems, .texts = xtexts, .values = xvalues} 192 .mask = xmask, .items = xitems, .texts = xtexts, .values = xvalues}
193#define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xitems, xtexts, xvalues) \ 193#define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xitems, xtexts, xvalues) \
194 SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xitems, xtexts, xvalues) 194 SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xitems, xtexts, xvalues)
195#define SOC_VALUE_ENUM_SINGLE_AUTODISABLE(xreg, xshift, xmask, xitems, xtexts, xvalues) \
196{ .reg = xreg, .shift_l = xshift, .shift_r = xshift, \
197 .mask = xmask, .items = xitems, .texts = xtexts, \
198 .values = xvalues, .autodisable = 1}
195#define SOC_ENUM_SINGLE_VIRT(xitems, xtexts) \ 199#define SOC_ENUM_SINGLE_VIRT(xitems, xtexts) \
196 SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, xitems, xtexts) 200 SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, xitems, xtexts)
197#define SOC_ENUM(xname, xenum) \ 201#define SOC_ENUM(xname, xenum) \
@@ -312,6 +316,11 @@
312 ARRAY_SIZE(xtexts), xtexts, xvalues) 316 ARRAY_SIZE(xtexts), xtexts, xvalues)
313#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ 317#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
314 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) 318 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
319
320#define SOC_VALUE_ENUM_SINGLE_AUTODISABLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
321 const struct soc_enum name = SOC_VALUE_ENUM_SINGLE_AUTODISABLE(xreg, \
322 xshift, xmask, ARRAY_SIZE(xtexts), xtexts, xvalues)
323
315#define SOC_ENUM_SINGLE_VIRT_DECL(name, xtexts) \ 324#define SOC_ENUM_SINGLE_VIRT_DECL(name, xtexts) \
316 const struct soc_enum name = SOC_ENUM_SINGLE_VIRT(ARRAY_SIZE(xtexts), xtexts) 325 const struct soc_enum name = SOC_ENUM_SINGLE_VIRT(ARRAY_SIZE(xtexts), xtexts)
317 326
@@ -1188,6 +1197,7 @@ struct soc_enum {
1188 unsigned int mask; 1197 unsigned int mask;
1189 const char * const *texts; 1198 const char * const *texts;
1190 const unsigned int *values; 1199 const unsigned int *values;
1200 unsigned int autodisable:1;
1191}; 1201};
1192 1202
1193/** 1203/**