diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-16 10:26:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-16 12:03:30 -0400 |
commit | fbc2dae854da5fc44e2ce2f97446c8bd283c7e17 (patch) | |
tree | c4ae6006cd66ae286036330b40c668431bfe9db3 /include/sound | |
parent | cdce4e9ba7ff86a5f43b971a9af88b25a3f6c9a4 (diff) |
ASoC: Support GPIO based microphone detection for WM8904
The WM8904 allows microphone detection signals to be brought out as
alternate functions of the GPIO signals which can be detected using
interrupt inputs on the CPU. Allow this to be configured using
platform data.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/wm8904.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/sound/wm8904.h b/include/sound/wm8904.h index ddeeebf7c426..898be3a8db9a 100644 --- a/include/sound/wm8904.h +++ b/include/sound/wm8904.h | |||
@@ -19,6 +19,40 @@ | |||
19 | #define WM8904_GPIO_NO_CONFIG 0x8000 | 19 | #define WM8904_GPIO_NO_CONFIG 0x8000 |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * R6 (0x06) - Mic Bias Control 0 | ||
23 | */ | ||
24 | #define WM8904_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
25 | #define WM8904_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
26 | #define WM8904_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
27 | #define WM8904_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | ||
28 | #define WM8904_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | ||
29 | #define WM8904_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | ||
30 | #define WM8904_MICDET_ENA 0x0002 /* MICDET_ENA */ | ||
31 | #define WM8904_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */ | ||
32 | #define WM8904_MICDET_ENA_SHIFT 1 /* MICDET_ENA */ | ||
33 | #define WM8904_MICDET_ENA_WIDTH 1 /* MICDET_ENA */ | ||
34 | #define WM8904_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */ | ||
35 | #define WM8904_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */ | ||
36 | #define WM8904_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */ | ||
37 | #define WM8904_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ | ||
38 | |||
39 | /* | ||
40 | * R7 (0x07) - Mic Bias Control 1 | ||
41 | */ | ||
42 | #define WM8904_MIC_DET_FILTER_ENA 0x8000 /* MIC_DET_FILTER_ENA */ | ||
43 | #define WM8904_MIC_DET_FILTER_ENA_MASK 0x8000 /* MIC_DET_FILTER_ENA */ | ||
44 | #define WM8904_MIC_DET_FILTER_ENA_SHIFT 15 /* MIC_DET_FILTER_ENA */ | ||
45 | #define WM8904_MIC_DET_FILTER_ENA_WIDTH 1 /* MIC_DET_FILTER_ENA */ | ||
46 | #define WM8904_MIC_SHORT_FILTER_ENA 0x4000 /* MIC_SHORT_FILTER_ENA */ | ||
47 | #define WM8904_MIC_SHORT_FILTER_ENA_MASK 0x4000 /* MIC_SHORT_FILTER_ENA */ | ||
48 | #define WM8904_MIC_SHORT_FILTER_ENA_SHIFT 14 /* MIC_SHORT_FILTER_ENA */ | ||
49 | #define WM8904_MIC_SHORT_FILTER_ENA_WIDTH 1 /* MIC_SHORT_FILTER_ENA */ | ||
50 | #define WM8904_MICBIAS_SEL_MASK 0x0007 /* MICBIAS_SEL - [2:0] */ | ||
51 | #define WM8904_MICBIAS_SEL_SHIFT 0 /* MICBIAS_SEL - [2:0] */ | ||
52 | #define WM8904_MICBIAS_SEL_WIDTH 3 /* MICBIAS_SEL - [2:0] */ | ||
53 | |||
54 | |||
55 | /* | ||
22 | * R121 (0x79) - GPIO Control 1 | 56 | * R121 (0x79) - GPIO Control 1 |
23 | */ | 57 | */ |
24 | #define WM8904_GPIO1_PU 0x0020 /* GPIO1_PU */ | 58 | #define WM8904_GPIO1_PU 0x0020 /* GPIO1_PU */ |
@@ -82,6 +116,7 @@ | |||
82 | #define WM8904_GPIO_BCLK_SEL_SHIFT 0 /* GPIO_BCLK_SEL - [3:0] */ | 116 | #define WM8904_GPIO_BCLK_SEL_SHIFT 0 /* GPIO_BCLK_SEL - [3:0] */ |
83 | #define WM8904_GPIO_BCLK_SEL_WIDTH 4 /* GPIO_BCLK_SEL - [3:0] */ | 117 | #define WM8904_GPIO_BCLK_SEL_WIDTH 4 /* GPIO_BCLK_SEL - [3:0] */ |
84 | 118 | ||
119 | #define WM8904_MIC_REGS 2 | ||
85 | #define WM8904_GPIO_REGS 4 | 120 | #define WM8904_GPIO_REGS 4 |
86 | #define WM8904_DRC_REGS 4 | 121 | #define WM8904_DRC_REGS 4 |
87 | #define WM8904_EQ_REGS 25 | 122 | #define WM8904_EQ_REGS 25 |
@@ -122,6 +157,7 @@ struct wm8904_pdata { | |||
122 | struct wm8904_retune_mobile_cfg *retune_mobile_cfgs; | 157 | struct wm8904_retune_mobile_cfg *retune_mobile_cfgs; |
123 | 158 | ||
124 | u32 gpio_cfg[WM8904_GPIO_REGS]; | 159 | u32 gpio_cfg[WM8904_GPIO_REGS]; |
160 | u32 mic_cfg[WM8904_MIC_REGS]; | ||
125 | }; | 161 | }; |
126 | 162 | ||
127 | #endif | 163 | #endif |