Commit 1dd6c077 authored by Mark Brown's avatar Mark Brown

Merge branch 'for-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-3.2

parents 1ea6b8f4 19940b3d
...@@ -6122,7 +6122,7 @@ F: sound/ ...@@ -6122,7 +6122,7 @@ F: sound/
SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
M: Liam Girdwood <lrg@ti.com> M: Liam Girdwood <lrg@ti.com>
M: Mark Brown <broonie@opensource.wolfsonmicro.com> M: Mark Brown <broonie@opensource.wolfsonmicro.com>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
W: http://alsa-project.org/main/index.php/ASoC W: http://alsa-project.org/main/index.php/ASoC
S: Supported S: Supported
......
...@@ -1962,6 +1962,21 @@ ...@@ -1962,6 +1962,21 @@
#define WM8958_MICB2_DISCH_SHIFT 0 /* MICB2_DISCH */ #define WM8958_MICB2_DISCH_SHIFT 0 /* MICB2_DISCH */
#define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */
/*
* R210 (0xD2) - Mic Detect 3
*/
#define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
#define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
#define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
#define WM8958_MICD_VALID 0x0002 /* MICD_VALID */
#define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */
#define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */
#define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */
#define WM8958_MICD_STS 0x0001 /* MICD_STS */
#define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */
#define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */
#define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */
/* /*
* R76 (0x4C) - Charge Pump (1) * R76 (0x4C) - Charge Pump (1)
*/ */
......
...@@ -56,7 +56,7 @@ static int wm8994_retune_mobile_base[] = { ...@@ -56,7 +56,7 @@ static int wm8994_retune_mobile_base[] = {
static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg) static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg)
{ {
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->control_data; struct wm8994 *control = codec->control_data;
switch (reg) { switch (reg) {
case WM8994_GPIO_1: case WM8994_GPIO_1:
...@@ -3030,19 +3030,34 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) ...@@ -3030,19 +3030,34 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
{ {
struct wm8994_priv *wm8994 = data; struct wm8994_priv *wm8994 = data;
struct snd_soc_codec *codec = wm8994->codec; struct snd_soc_codec *codec = wm8994->codec;
int reg; int reg, count;
reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); /* We may occasionally read a detection without an impedence
if (reg < 0) { * range being provided - if that happens loop again.
dev_err(codec->dev, "Failed to read mic detect status: %d\n", */
reg); count = 10;
return IRQ_NONE; do {
} reg = snd_soc_read(codec, WM8958_MIC_DETECT_3);
if (reg < 0) {
dev_err(codec->dev,
"Failed to read mic detect status: %d\n",
reg);
return IRQ_NONE;
}
if (!(reg & WM8958_MICD_VALID)) { if (!(reg & WM8958_MICD_VALID)) {
dev_dbg(codec->dev, "Mic detect data not valid\n"); dev_dbg(codec->dev, "Mic detect data not valid\n");
goto out; goto out;
} }
if (!(reg & WM8958_MICD_STS) || (reg & WM8958_MICD_LVL_MASK))
break;
msleep(1);
} while (count--);
if (count == 0)
dev_warn(codec->dev, "No impedence range reported for jack\n");
#ifndef CONFIG_SND_SOC_WM8994_MODULE #ifndef CONFIG_SND_SOC_WM8994_MODULE
trace_snd_soc_jack_irq(dev_name(codec->dev)); trace_snd_soc_jack_irq(dev_name(codec->dev));
...@@ -3180,9 +3195,9 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) ...@@ -3180,9 +3195,9 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
wm8994_request_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR, wm8994_request_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR,
wm8994_fifo_error, "FIFO error", codec); wm8994_fifo_error, "FIFO error", codec);
wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_WARN, wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_WARN,
wm8994_temp_warn, "Thermal warning", codec); wm8994_temp_warn, "Thermal warning", codec);
wm8994_request_irq(wm8994->control_data, WM8994_IRQ_TEMP_SHUT, wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT,
wm8994_temp_shut, "Thermal shutdown", codec); wm8994_temp_shut, "Thermal shutdown", codec);
ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_DCS_DONE, ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_DCS_DONE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment