diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-15 14:14:34 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-16 11:56:54 -0400 |
commit | 37f88e8407f75fc6ced5cefb633c314556de3ad1 (patch) | |
tree | 95b4bd8d967f4c229becaad4b5dc503be6f46448 /include/sound | |
parent | 73b34ead7429789f35eea147a3e185abd61c7d94 (diff) |
ASoC: Initial WM8903 microphone bias and short detection
Provide support for WM8903 microphone presence and short detection
using the GPIOs to route out a logic signal suitable for handling
using snd_soc_jack_add_gpios() on the processor GPIOs.
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/wm8903.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h index 00458589fe85..22b66a76febd 100644 --- a/include/sound/wm8903.h +++ b/include/sound/wm8903.h | |||
@@ -15,6 +15,28 @@ | |||
15 | #define WM8903_GPIO_NO_CONFIG 0x8000 | 15 | #define WM8903_GPIO_NO_CONFIG 0x8000 |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * R6 (0x06) - Mic Bias Control 0 | ||
19 | */ | ||
20 | #define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ | ||
21 | #define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ | ||
22 | #define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ | ||
23 | #define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */ | ||
24 | #define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
25 | #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
26 | #define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
27 | #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | ||
28 | #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | ||
29 | #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | ||
30 | #define WM8903_MICDET_ENA 0x0002 /* MICDET_ENA */ | ||
31 | #define WM8903_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */ | ||
32 | #define WM8903_MICDET_ENA_SHIFT 1 /* MICDET_ENA */ | ||
33 | #define WM8903_MICDET_ENA_WIDTH 1 /* MICDET_ENA */ | ||
34 | #define WM8903_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */ | ||
35 | #define WM8903_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */ | ||
36 | #define WM8903_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */ | ||
37 | #define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ | ||
38 | |||
39 | /* | ||
18 | * R116 (0x74) - GPIO Control 1 | 40 | * R116 (0x74) - GPIO Control 1 |
19 | */ | 41 | */ |
20 | #define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ | 42 | #define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ |
@@ -210,6 +232,13 @@ | |||
210 | #define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ | 232 | #define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ |
211 | 233 | ||
212 | struct wm8903_platform_data { | 234 | struct wm8903_platform_data { |
235 | /* Default register value for R6 (Mic bias), used to configure | ||
236 | * microphone detection. In conjunction with gpio_cfg this | ||
237 | * can be used to route the microphone status signals out onto | ||
238 | * the GPIOs for use with snd_soc_jack_add_gpios(). | ||
239 | */ | ||
240 | u16 micdet_cfg; | ||
241 | |||
213 | u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ | 242 | u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ |
214 | }; | 243 | }; |
215 | 244 | ||