linux/sound/soc
Lars-Peter Clausen 57295073b6 ASoC: dapm: Implement mixer input auto-disable
Some devices have the problem that if a internal audio signal source is disabled
the output of the source becomes undefined or goes to a undesired state (E.g.
DAC output goes to ground instead of VMID). In this case it is necessary, in
order to avoid unwanted clicks and pops, to disable any mixer input the signal
feeds into or to active a mute control along the path to the output. Often it is
still desirable to expose the same mixer input control to userspace, so cerain
paths can sill be disabled manually. This means we can not use conventional DAPM
to manage the mixer input control. This patch implements a method for letting
DAPM overwrite the state of a userspace visible control. I.e. DAPM will disable
the control if the path on which the control sits becomes inactive. Userspace
will then only see a cached copy of the controls state. Once DAPM powers the
path up again it will sync the userspace setting with the hardware and give
control back to userspace.

To implement this a new widget type is introduced. One widget of this type will
be created for each DAPM kcontrol which has the auto-disable feature enabled.
For each path that is controlled by the kcontrol the widget will be connected to
the source of that path. The new widget type behaves like a supply widget,
which means it will power up if one of its sinks are powered up and will only
power down if all of its sinks are powered down. In order to only have the mixer
input enabled when the source signal is valid the new widget type will be
disabled before all other widget types and only be enabled after all other
widget types.

E.g. consider the following simplified example. A DAC is connected to a mixer
and the mixer has a control to enable or disable the signal from the DAC.

                     +-------+
  +-----+            |       |
  | DAC |-----[Ctrl]-| Mixer |
  +-----+       :    |       |
     |          :    +-------+
     |          :
    +-------------+
    | Ctrl widget |
    +-------------+

If the control has the auto-disable feature enabled we'll create a widget for
the control. This widget is connected to the DAC as it is the source for the
mixer input. If the DAC powers up the control widget powers up and if the DAC
powers down the control widget is powered down. As long as the control widget
is powered down the hardware input control is kept disabled and if it is enabled
userspace can freely change the control's state.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-05 15:50:27 +01:00
..
atmel ASoC: atmel: Fix unlocked snd_pcm_stop() call 2013-07-15 21:25:13 +02:00
au1x ASoC: ac97: Support multi-platform AC'97 2013-06-27 09:48:42 +01:00
blackfin ASoC: More updates for v3.11 2013-06-28 13:36:22 +02:00
cirrus ASoC: More updates for v3.11 2013-06-28 13:36:22 +02:00
codecs ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrol 2013-07-29 18:40:59 +01:00
davinci sound updates for 3.11 2013-07-03 19:52:22 -07:00
dwc ASoC: dwc: Folder path correction in file header. 2013-06-12 16:19:01 +01:00
fsl ASoC: Updates for v3.11 2013-07-05 11:54:27 +02:00
generic ASoC: simple-card: add asoc_simple_dai for initializing 2013-01-14 06:55:43 +09:00
jz4740 ASoC: jz4740-i2s: Use clk_prepare_enable/clk_disable_unprepare 2013-05-12 22:09:03 +04:00
kirkwood Merge remote-tracking branch 'asoc/topic/kirkwood' into asoc-next 2013-06-17 17:20:22 +01:00
mid-x86 ASoC: mfld: Remove unused variable 2013-06-28 10:59:14 +01:00
mxs Merge remote-tracking branch 'asoc/fix/mxs' into asoc-linus 2013-07-04 18:30:02 +01:00
nuc900 ASoC: ac97: Support multi-platform AC'97 2013-06-27 09:48:42 +01:00
omap Merge remote-tracking branch 'asoc/fix/omap' into asoc-linus 2013-07-15 11:13:53 +01:00
pxa ASoC: Final updates for v3.11 2013-07-01 11:23:13 +02:00
s6000 ASoC: s6000: Fix unlocked snd_pcm_stop() call 2013-07-15 21:25:14 +02:00
samsung Merge remote-tracking branch 'asoc/fix/samsung' into asoc-linus 2013-07-15 11:13:54 +01:00
sh ASoC: More updates for v3.11 2013-06-28 13:36:22 +02:00
spear ASoC: spear: Convert to use devm_ioremap_resource 2013-06-17 17:19:58 +01:00
tegra ASoC: Final updates for v3.11 2013-07-01 11:23:13 +02:00
txx9 ASoC: ac97: Support multi-platform AC'97 2013-06-27 09:48:42 +01:00
ux500 sound updates for 3.11 2013-07-03 19:52:22 -07:00
Kconfig ASoC: Add Kconfig and Makefile to support SPEAr audio driver 2013-06-12 16:25:22 +01:00
Makefile ASoC: Add Kconfig and Makefile to support SPEAr audio driver 2013-06-12 16:25:22 +01:00
soc-cache.c ASoC: cache: Standardise ASoC cache messages 2012-11-21 11:39:51 +09:00
soc-compress.c ASoC: soc-compress: Send correct stream event for capture start 2013-05-20 08:01:48 -05:00
soc-core.c ASoC: Final updates for v3.11 2013-07-01 11:23:13 +02:00
soc-dapm.c ASoC: dapm: Implement mixer input auto-disable 2013-08-05 15:50:27 +01:00
soc-dmaengine-pcm.c ASoC: dmaengine_pcm: Add support for compat platforms 2013-04-17 14:21:36 +01:00
soc-generic-dmaengine-pcm.c ASoC: generic-dmaengine-pcm: call dma_request_slave_channel() 2013-04-23 11:34:29 +01:00
soc-io.c ASoC: core: Use PTR_RET function 2013-03-26 14:12:01 +00:00
soc-jack.c ASoC: jack: Use power efficient workqueue 2013-07-19 12:08:31 +01:00
soc-pcm.c Merge branch 'topic/core' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-dapm 2013-07-29 18:40:55 +01:00
soc-utils.c ASoC: simplify registration of snd-soc-dummy device 2013-05-17 12:07:49 +01:00