From 9b7c525dfaa9a1b5f01db1f3a1edc50bbb6eb739 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 17 Feb 2011 20:05:44 -0800 Subject: ASoC: Support WM8958 direct microphone detection IRQ Allow direct routing of the WM8958 microphone detection signal to a GPIO to be used, saving the need to demux the interrupt. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/linux/mfd/wm8994/pdata.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 9eab263658b..06869466b7f 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h @@ -103,6 +103,11 @@ struct wm8994_pdata { unsigned int lineout1fb:1; unsigned int lineout2fb:1; + /* IRQ for microphone detection if brought out directly as a + * signal. + */ + int micdet_irq; + /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ unsigned int micbias1_lvl:1; unsigned int micbias2_lvl:1; -- cgit v1.2.3-70-g09d2 From 48e028eccabc9c246bfad175262582a1ce34a316 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 21 Feb 2011 17:11:59 -0800 Subject: ASoC: Support configuration of WM8958 microphone bias analogue parameters The WM8958 has a different microphone bias architecture to WM8994 so needs different configuration to WM8994. Support this in platform data. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- include/linux/mfd/wm8994/pdata.h | 7 +++++-- include/linux/mfd/wm8994/registers.h | 2 ++ sound/soc/codecs/wm8994.c | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 06869466b7f..466b1c777af 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h @@ -108,13 +108,16 @@ struct wm8994_pdata { */ int micdet_irq; - /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ + /* WM8994 microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ unsigned int micbias1_lvl:1; unsigned int micbias2_lvl:1; - /* Jack detect threashold levels, see datasheet for values */ + /* WM8994 jack detect threashold levels, see datasheet for values */ unsigned int jd_scthr:2; unsigned int jd_thr:2; + + /* WM8958 microphone bias configuration */ + int micbias[2]; }; #endif diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index be072faec6f..f3ee8428467 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h @@ -63,6 +63,8 @@ #define WM8994_MICBIAS 0x3A #define WM8994_LDO_1 0x3B #define WM8994_LDO_2 0x3C +#define WM8958_MICBIAS1 0x3D +#define WM8958_MICBIAS2 0x3E #define WM8994_CHARGE_PUMP_1 0x4C #define WM8958_CHARGE_PUMP_2 0x4D #define WM8994_CLASS_W_1 0x51 diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 1ad6e3db780..9b9c15ffb7d 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -2855,6 +2855,13 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994) else snd_soc_add_controls(wm8994->codec, wm8994_eq_controls, ARRAY_SIZE(wm8994_eq_controls)); + + for (i = 0; i < ARRAY_SIZE(pdata->micbias); i++) { + if (pdata->micbias[i]) { + snd_soc_write(codec, WM8958_MICBIAS1 + i, + pdata->micbias[i] & 0xffff); + } + } } /** -- cgit v1.2.3-70-g09d2