1
linux/sound/soc
Peter Ujfalusi c96907f21f ASoC: TWL4030: PM fix for output amplifiers
Gain controls on outputs affect the power consumption
when the gain is set to non 0 value.

Outputs with amps have one register to configure the
routing and the gain:
PREDL_CTL (0x25):
bit 0: Voice enable
bit 1: Audio L1 enable
bit 2: Audio L2 enable
bit 3: Audio R2 enable
bit 4-5: Gain (0x0 - power down, 0x1 - 6dB, 0x2 - 0dB, 0x3 - -6dB)

bit 0 - 3: is handled in DAPM domain (DAPM_MIXER)
bit 4 - 5: has simple volume control

If there is no audio activity (BIAS_STANDBY), and
user changes the volume, than the output amplifier will
be enabled.
If the user changes the routing (but the codec remains in
BIAS_STANDBY), than the cached gain value also be written
to the register, which enables the amplifier.

The existing workaround for this is to have virtual
PGAs associated with the outputs, and whit DAPM PMD
the gain on the output will be forced to 0 (off) by
bypassing the regcache.
This failed to disable the amplifiers in several
scenario (as mentioned above).

Also if the codec is in BIAS_ON state, and user modifies
a volume control, which path is actually not enabled, than
that amplifier will be enabled as well, but it will
be not turned off, since there is no DAPM path, which
would make mute it.

To prevent amps being enabled, when they are not
needed, introduce the following workaround:
Track the state of each of this type of output.
In twl4030_write only allow actual write, when the
given output is enabled, otherwise only update
the reg_cache.
The PGA event handlers on power up will write the cached
value to the chip (restoring gain, routing selection).
On power down 0 is written to the register (disabling
the amp, and also just in case clearing the routing).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-22 16:47:12 +00:00
..
atmel ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
au1x MIPS/SOUND: Alchemy: DB1200 AC97+I2S audio support. 2010-02-27 12:53:01 +01:00
blackfin ASoC: change bf5xx-ad1938 machine driver to bf5xx-ad193x machine driver 2010-03-19 12:47:34 +00:00
codecs ASoC: TWL4030: PM fix for output amplifiers 2010-03-22 16:47:12 +00:00
davinci ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
fsl of: add 'of_' prefix to machine_is_compatible() 2010-02-09 08:33:00 -07:00
imx ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
omap ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
pxa ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
s3c24xx ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
s6000 ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream 2010-03-19 19:37:29 +00:00
sh ASoC: SIU driver shall select FW_LOADER 2010-03-18 11:31:13 +00:00
txx9
Kconfig
Makefile
soc-cache.c ASoC: soc-cache: let reg be AND'ed by 0xff instead of data buffer for 8_8 mode 2010-03-18 11:23:23 +00:00
soc-core.c ASoC: remove a card from the list, if instantiation failed 2010-03-19 19:39:18 +00:00
soc-dapm.c ASoC: Remove current PGA control handling 2010-03-17 14:08:31 +00:00
soc-jack.c
soc-utils.c