aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/twl4030.h
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2008-12-02 20:48:58 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-03 12:40:28 +0000
commit5920b45303291057fef827f5bdafe04001c1bbae (patch)
tree1d63ec7971c8f00dee0d380b93c25c5844e007a6 /sound/soc/codecs/twl4030.h
parent87689d567a45f80416feea0a2aa6d3a2a6b8963a (diff)
ASoC: TWL4030: Add input selection and gain controls
The TWL4030 codec device has two ADCs. Both of them can have several inputs routed to them, but TRM says that only one source can be selected for every ADC, even though every source has a dedicated bit in the registers. This patch adds input source controls. It modifies default register values to have no inputs selected and ADCs disabled. When some input is selected, control handlers enable apropriate input amplifier and ADC. If a microphone is selected, bias power is automatically enabled. When some input is deselected, unused chip parts are disabled. Microphone and line input recording tested on OMAP3 pandora board. Signed-off-by: Grazvydas Ignotas <notasas@gmail.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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
index 09865d9f520..a2065d417c2 100644
--- a/sound/soc/codecs/twl4030.h
+++ b/sound/soc/codecs/twl4030.h
@@ -113,7 +113,16 @@
#define TWL4030_CODECPDZ 0x02
#define TWL4030_OPT_MODE 0x01
+/* TWL4030_REG_MICBIAS_CTL (0x04) Fields */
+
+#define TWL4030_MICBIAS2_CTL 0x40
+#define TWL4030_MICBIAS1_CTL 0x20
+#define TWL4030_HSMICBIAS_EN 0x04
+#define TWL4030_MICBIAS2_EN 0x02
+#define TWL4030_MICBIAS1_EN 0x01
+
/* ANAMICL (0x05) Fields */
+
#define TWL4030_CNCL_OFFSET_START 0x80
#define TWL4030_OFFSET_CNCL_SEL 0x60
#define TWL4030_OFFSET_CNCL_SEL_ARX1 0x00
@@ -127,10 +136,17 @@
#define TWL4030_MAINMIC_EN 0x01
/* ANAMICR (0x06) Fields */
+
#define TWL4030_MICAMPR_EN 0x10
#define TWL4030_AUXR_EN 0x04
#define TWL4030_SUBMIC_EN 0x01
+/* AVADC_CTL (0x07) Fields */
+
+#define TWL4030_ADCL_EN 0x08
+#define TWL4030_AVADC_CLK_PRIORITY 0x04
+#define TWL4030_ADCR_EN 0x02
+
/* AUDIO_IF (0x0E) Fields */
#define TWL4030_AIF_SLAVE_EN 0x80