Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293393
b: refs/heads/master
c: 07fb9d9
h: refs/heads/master
i:
  293391: 33a1b87
v: v3
  • Loading branch information
Mark Brown committed Feb 21, 2012
1 parent 99383c5 commit 56f8ae4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55a27786856458a785e1ed7221aee22a06def877
refs/heads/master: 07fb9d9e935a07aaed557c58d795c18fcd99aab4
3 changes: 3 additions & 0 deletions trunk/include/linux/mfd/wm8994/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ struct wm8994_pdata {
unsigned int jd_scthr:2;
unsigned int jd_thr:2;

/* Configure WM1811 jack detection for use with external capacitor */
unsigned int jd_ext_cap:1;

/* WM8958 microphone bias configuration */
int micbias[2];

Expand Down
24 changes: 24 additions & 0 deletions trunk/sound/soc/codecs/wm8994.c
Original file line number Diff line number Diff line change
Expand Up @@ -3172,6 +3172,14 @@ static void wm8958_default_micdet(u16 status, void *data)

wm1811_jackdet_set_mode(codec,
WM1811_JACKDET_MODE_JACK);

if (wm8994->pdata->jd_ext_cap) {
mutex_lock(&codec->mutex);
snd_soc_dapm_disable_pin(&codec->dapm,
"MICBIAS2");
snd_soc_dapm_sync(&codec->dapm);
mutex_unlock(&codec->mutex);
}
}
}

Expand Down Expand Up @@ -3227,6 +3235,15 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
snd_soc_update_bits(codec, WM8958_MICBIAS2,
WM8958_MICB2_DISCH, 0);

/* If required for an external cap force MICBIAS on */
if (wm8994->pdata->jd_ext_cap) {
mutex_lock(&codec->mutex);
snd_soc_dapm_force_enable_pin(&codec->dapm,
"MICBIAS2");
snd_soc_dapm_sync(&codec->dapm);
mutex_unlock(&codec->mutex);
}

/*
* Start off measument of microphone impedence to find
* out what's actually there.
Expand All @@ -3241,6 +3258,13 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
snd_soc_update_bits(codec, WM8958_MICBIAS2,
WM8958_MICB2_DISCH, WM8958_MICB2_DISCH);

if (wm8994->pdata->jd_ext_cap) {
mutex_lock(&codec->mutex);
snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS2");
snd_soc_dapm_sync(&codec->dapm);
mutex_unlock(&codec->mutex);
}

snd_soc_jack_report(wm8994->micdet[0].jack, 0,
SND_JACK_MECHANICAL | SND_JACK_HEADSET |
wm8994->btn_mask);
Expand Down

0 comments on commit 56f8ae4

Please sign in to comment.