1
linux/sound/soc/codecs
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
..
ac97.c ASoC: fixup oops in generic AC97 codec glue 2010-01-04 18:30:01 +00:00
ac97.h
ad193x.c ASoC: Unexport AD193x bus probe/remove functions 2010-03-19 12:22:03 +00:00
ad193x.h ASoC: Unexport AD193x bus probe/remove functions 2010-03-19 12:22:03 +00:00
ad1836.c ASoC: ad1836: use soc-cache framework for codec registers access 2010-01-27 10:42:59 +00:00
ad1836.h ASoC: ad1836: reset and restore clock control mode in suspend/resume entry 2010-01-25 14:52:22 +00:00
ad1980.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
ad1980.h
ad73311.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
ad73311.h ASoC: Blackfin: fix typo in MUTE definition 2009-03-06 13:37:18 +00:00
ads117x.c ASoC: Update ads117x to current APIs 2009-11-04 21:43:27 +00:00
ads117x.h ASoC: ADS117x ADC driver 2009-11-04 21:27:53 +00:00
ak4104.c ASoC: fix ak4104 register array access 2010-03-03 19:19:36 +00:00
ak4104.h ASoC: Add a driver for AK4104 S/PDIF transmitter 2009-03-09 10:46:17 +00:00
ak4535.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
ak4535.h
ak4642.c ASoC: ak4642: Add default return value in ak4642_modinit 2009-12-15 14:54:01 +00:00
ak4642.h ASoC: Add ak4642/ak4643 codec support 2009-08-21 10:54:02 +01:00
ak4671.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
ak4671.h ASoC: AK4671: add ak4671 codec driver 2009-09-10 00:27:57 +01:00
cq93vc.c ASoC: DaVinci: CQ93VC Voice Codec 2010-03-12 11:12:22 +00:00
cq93vc.h ASoC: DaVinci: CQ93VC Voice Codec 2010-03-12 11:12:22 +00:00
cs4270.c ASoC: cs4270: enable regulators at probe time 2010-02-10 10:42:56 +00:00
cs4270.h
cx20442.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
cx20442.h ASoC: CX20442: push down machine independent line discipline bits 2009-07-31 22:38:44 +01:00
da7210.c ASoC: da7210: Add 11025/22050/44100/88200 rate support 2010-03-11 10:58:33 +00:00
da7210.h ASoC: Add DA7210 codec device support for ALSA 2009-12-16 17:31:04 +00:00
Kconfig ASoC: rename ad1938 to ad193x and add support for ad1936/7/8/9 2010-03-19 12:12:16 +00:00
l3.c
Makefile ASoC: rename ad1938 to ad193x and add support for ad1936/7/8/9 2010-03-19 12:12:16 +00:00
max9877.c ASoC: MAX9877: fix write operation for register 2009-07-23 11:08:30 +01:00
max9877.h ASoC: MAX9877: add MAX9877 amp driver 2009-07-15 16:59:31 +01:00
pcm3008.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
pcm3008.h
spdif_transciever.c ASoC: spdif: set module licence to GPL 2009-07-13 23:01:30 +01:00
spdif_transciever.h ASoC: Add dummy S/PDIF codec support 2009-05-28 14:48:38 +01:00
ssm2602.c ASoC: SSM2602: add SND control for mic boost2 and default it to off 2010-03-10 11:59:56 +00:00
ssm2602.h
stac9766.c ASoC: Fix disable of SPDIF on STAC9766 codec 2009-12-16 15:56:57 +00:00
stac9766.h ASoC: Codec for STAC9766 used on the Efika 2009-05-24 13:15:21 +01:00
tlv320aic3x.c ASoC: Fix variable shadowing warning in TLV320AIC3x 2010-01-04 21:49:53 +00:00
tlv320aic3x.h ASoC: tlv320aic3x: Change to use device model 2009-08-21 10:52:49 +01:00
tlv320aic23.c ASoC: AIC23: Fixing writes to non-existing registers in resume function 2010-01-29 13:42:37 +00:00
tlv320aic23.h
tlv320aic26.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
tlv320aic26.h
tlv320dac33.c Merge branch 'for-2.6.34' into for-2.6.35 2010-03-19 19:39:23 +00:00
tlv320dac33.h ASoC: tlv320dac33: typo fix in the header 2009-10-21 19:08:21 +01:00
tpa6130a2.c ASoC: Add missing __devexit and __devinit annotations 2010-01-12 14:13:00 +00:00
tpa6130a2.h ASoC: TPA6130A2: Make tpa6130a2_power as static 2009-10-12 13:40:54 +01:00
twl4030.c ASoC: TWL4030: PM fix for output amplifiers 2010-03-22 16:47:12 +00:00
twl4030.h ASoC: TWL4030: Fix typo in comment in header file 2010-01-14 10:36:52 +00:00
twl6040.c ASoC: TWL6040: Add twl6040 codec driver 2010-03-19 11:29:33 +00:00
twl6040.h ASoC: TWL6040: Add twl6040 codec driver 2010-03-19 11:29:33 +00:00
uda134x.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
uda134x.h
uda1380.c bitops: rename for_each_bit() to for_each_set_bit() 2010-03-06 11:26:23 -08:00
uda1380.h ASoC: UDA1380: refactor device registration 2009-06-15 21:54:48 +01:00
wm2000.c ASoC: Add WM2000 driver 2010-02-12 10:31:06 +00:00
wm2000.h ASoC: Add WM2000 driver 2010-02-12 10:31:06 +00:00
wm8350.c ASoC: Implement WM835x microphone jack detection support 2010-03-17 09:27:19 +00:00
wm8350.h ASoC: Implement WM835x microphone jack detection support 2010-03-17 09:27:19 +00:00
wm8400.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8400.h ASoC: Add initial driver for the WM8400 CODEC 2009-03-11 13:49:46 +00:00
wm8510.c ASoC: fix params_rate() macro use in several codecs 2009-12-24 11:41:21 +00:00
wm8510.h
wm8523.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8523.h ASoC: Add WM8523 CODEC driver 2009-07-01 18:47:45 +01:00
wm8580.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8580.h ASoC: Move WM8580 to normal I2C device probe 2009-03-12 15:43:24 +00:00
wm8711.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8711.h ASoC: Add WM8711 CODEC driver 2009-08-18 20:37:49 +01:00
wm8727.c ASoC: Register the CODEC in WM8727 2009-12-16 17:30:51 +00:00
wm8727.h ASoC: Add support for the WM8727 DAC. 2009-11-02 15:24:19 +00:00
wm8728.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8728.h
wm8731.c ASoC: Only restore non-default registers for WM8731 2010-01-04 21:50:23 +00:00
wm8731.h ASoC: Refactor WM8731 device registration 2009-02-18 11:55:22 +00:00
wm8750.c ASoC: Refresh WM8750 bias management 2010-03-17 14:09:02 +00:00
wm8750.h
wm8753.c ASoC: Remove unneeded suspend checks from CODEC drivers 2009-12-31 12:44:28 +00:00
wm8753.h ASoC: Convert WM8753 to register via normal device probe 2009-02-24 23:49:53 +00:00
wm8776.c ASoC: Only restore non-default registers for WM8776 2010-01-04 21:50:43 +00:00
wm8776.h ASoC: Add WM8776 CODEC driver 2009-08-06 11:36:45 +01:00
wm8900.c ASoC: Correct code taking the size of a pointer 2009-12-14 11:37:57 +00:00
wm8900.h
wm8903.c ASoC: Implement interrupt driven microphone detection for WM8903 2010-03-16 15:57:43 +00:00
wm8903.h ASoC: Implement interrupt driven microphone detection for WM8903 2010-03-16 15:57:43 +00:00
wm8904.c ASoC: Support GPIO based microphone detection for WM8904 2010-03-16 16:03:30 +00:00
wm8904.h ASoC: Support GPIO based microphone detection for WM8904 2010-03-16 16:03:30 +00:00
wm8940.c ASoC: fix params_rate() macro use in several codecs 2009-12-24 11:41:21 +00:00
wm8940.h ASoC WM8940 Driver 2009-04-27 20:37:13 +01:00
wm8955.c ASoC: Add initial WM8955 CODEC driver 2009-12-18 13:06:47 +00:00
wm8955.h ASoC: Add initial WM8955 CODEC driver 2009-12-18 13:06:47 +00:00
wm8960.c ASoC: Add support for WM8960 capless mode 2010-03-03 17:08:43 +00:00
wm8960.h ASoC: Move WM8960 platform data into include/sound 2010-03-03 17:08:42 +00:00
wm8961.c ASoC: Only restore non-default registers for WM8961 2010-01-04 21:50:58 +00:00
wm8961.h ASoC: Add WM8961 driver 2009-06-12 17:16:06 +01:00
wm8971.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8971.h
wm8974.c ASoC: clean up wm8974 and wm8978 clock divider handling 2010-01-29 14:32:52 +00:00
wm8974.h ASoC: clean up wm8974 and wm8978 clock divider handling 2010-01-29 14:32:52 +00:00
wm8978.c ASoC: improve MCLKDIV calculation in wm8978, when OPCLK is not used 2010-02-01 14:35:08 +00:00
wm8978.h ASoC: clean up wm8974 and wm8978 clock divider handling 2010-01-29 14:32:52 +00:00
wm8988.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8988.h ASoC: Add WM8988 CODEC driver 2009-04-07 18:51:23 +01:00
wm8990.c ASoC: Remove unneeded suspend checks from CODEC drivers 2009-12-31 12:44:28 +00:00
wm8990.h
wm8993.c ASoC: Disable WM8993 regulators when turning bias off 2010-02-04 10:41:54 +00:00
wm8993.h ASoC: Add WM8993 CODEC driver 2009-07-08 17:20:20 +01:00
wm8994.c ASoC: Fix BCLK calculation of WM8994 2010-02-02 11:21:11 +00:00
wm8994.h ASoC: Add WM8994 CODEC driver 2010-02-01 18:37:01 +00:00
wm9081.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm9081.h ASoC: WM9081 mono DAC with integrated 2.6W class AB/D amplifier driver 2009-05-22 15:11:22 +01:00
wm9705.c ASoC: Revert missing reset_err in wm97*.c 2009-11-27 15:14:09 +01:00
wm9705.h ASoC: Driver for the WM9705 AC97 codec. 2009-01-16 16:40:25 +00:00
wm9712.c ASoC: Do not write to invalid registers on the wm9712. 2009-12-23 15:20:56 +00:00
wm9712.h
wm9713.c ASoC: Add TLV information and additional volumes to WM9713 2010-01-28 14:35:20 +00:00
wm9713.h
wm_hubs.c ASoC: Bail out of wm_hubs DC servo if calibration fails 2010-03-19 11:17:36 +00:00
wm_hubs.h ASoC: Improved wm_hubs headphone handling 2010-02-01 18:35:46 +00:00