aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.h
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2009-01-29 07:57:50 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-29 08:58:04 -0500
commit7393958f630ac91e591e62058f2bdb61523ec60c (patch)
tree50df70a912bfeb37901378dc78dd8baff5038fa3 /sound/soc/codecs/twl4030.h
parent0bf5460de96aa66abf9350333ee6711e73b3b31e (diff)
ASoC: TWL4030: Add analog loopback support
This patch adds the analog loopback/bypass support for twl4030 codec. Details for the implementation: It seams that the analog loopback needs the DAC powered on on the channel, where the loopback is selected. The switch for the DACs has been moved from the DAPM_DAC to the "Analog XX Playback Mixer". In this way the DAC will be powered while the audio playback is used or/and the loopback is enabled for the channel. The twl4030 codec powering has been reworked. Now the codec will be powered as long as it does not receives the SND_SOC_BIAS_OFF event. The exceptions are when the given change in the registers needs the codec power down/up cycle in order to take effect. Otherwise the codec is on. When the codec enters to STANDBY state and none of the loopback paths are enabled, than the amplifiers, which are no in the DAPM path are forced to turn off and the PLL is disabled. When playback/capture starts the disabled gains are restored and the PLL is enabled. When one of the loopback enabled in STANDBY mode, the disabled gains are restored and the PLL is enabled also. In short: the codec always goes to the lowest power state based on the bias_level and the bypass_state. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl4030.h')
-rw-r--r--sound/soc/codecs/twl4030.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
index 442e5a828617..33dbb144dad1 100644
--- a/sound/soc/codecs/twl4030.h
+++ b/sound/soc/codecs/twl4030.h
@@ -170,6 +170,9 @@
170#define TWL4030_CLK256FS_EN 0x02 170#define TWL4030_CLK256FS_EN 0x02
171#define TWL4030_AIF_EN 0x01 171#define TWL4030_AIF_EN 0x01
172 172
173/* EAR_CTL (0x21) */
174#define TWL4030_EAR_GAIN 0x30
175
173/* HS_GAIN_SET (0x23) Fields */ 176/* HS_GAIN_SET (0x23) Fields */
174 177
175#define TWL4030_HSR_GAIN 0x0C 178#define TWL4030_HSR_GAIN 0x0C
@@ -198,6 +201,18 @@
198#define TWL4030_RAMP_DELAY_2581MS 0x1C 201#define TWL4030_RAMP_DELAY_2581MS 0x1C
199#define TWL4030_RAMP_EN 0x02 202#define TWL4030_RAMP_EN 0x02
200 203
204/* PREDL_CTL (0x25) */
205#define TWL4030_PREDL_GAIN 0x30
206
207/* PREDR_CTL (0x26) */
208#define TWL4030_PREDR_GAIN 0x30
209
210/* PRECKL_CTL (0x27) */
211#define TWL4030_PRECKL_GAIN 0x30
212
213/* PRECKR_CTL (0x28) */
214#define TWL4030_PRECKR_GAIN 0x30
215
201/* HFL_CTL (0x29, 0x2A) Fields */ 216/* HFL_CTL (0x29, 0x2A) Fields */
202#define TWL4030_HF_CTL_HB_EN 0x04 217#define TWL4030_HF_CTL_HB_EN 0x04
203#define TWL4030_HF_CTL_LOOP_EN 0x08 218#define TWL4030_HF_CTL_LOOP_EN 0x08