Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342963
b: refs/heads/master
c: 63dd545
h: refs/heads/master
i:
  342961: c1b0c1c
  342959: 830f6df
v: v3
  • Loading branch information
Mark Brown committed Dec 3, 2012
1 parent 65657ec commit 3f73df2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78b76dbec8da6437e30519e6bbe4fb44d798addf
refs/heads/master: 63dd54521f1d143fbc6584ace66ef264a7f867f7
36 changes: 21 additions & 15 deletions trunk/sound/soc/codecs/wm8994.c
Original file line number Diff line number Diff line change
Expand Up @@ -3504,15 +3504,20 @@ static void wm1811_mic_work(struct work_struct *work)

dev_dbg(codec->dev, "Starting mic detection\n");

/*
* Start off measument of microphone impedence to find out
* what's actually there.
*/
wm8994->mic_detecting = true;
wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_MIC);
/* Use a user-supplied callback if we have one */
if (wm8994->micd_cb) {
wm8994->micd_cb(wm8994->micd_cb_data);
} else {
/*
* Start off measument of microphone impedence to find out
* what's actually there.
*/
wm8994->mic_detecting = true;
wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_MIC);

snd_soc_update_bits(codec, WM8958_MIC_DETECT_1,
WM8958_MICD_ENA, WM8958_MICD_ENA);
snd_soc_update_bits(codec, WM8958_MIC_DETECT_1,
WM8958_MICD_ENA, WM8958_MICD_ENA);
}

mutex_unlock(&wm8994->accdet_lock);

Expand Down Expand Up @@ -3624,7 +3629,7 @@ static void wm1811_jackdet_bootstrap(struct work_struct *work)
* detection algorithm.
*/
int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
wm8958_micdet_cb cb, void *cb_data)
wm1811_micdet_cb cb, void *cb_data)
{
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
Expand All @@ -3639,17 +3644,18 @@ int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
}

if (jack) {
/* No longer supported */
if (cb)
return -EINVAL;

snd_soc_dapm_force_enable_pin(&codec->dapm, "CLK_SYS");
snd_soc_dapm_sync(&codec->dapm);

wm8994->micdet[0].jack = jack;

wm8994->mic_detecting = true;
wm8994->jack_mic = false;
if (cb) {
wm8994->micd_cb = cb;
wm8994->micd_cb_data = cb_data;
} else {
wm8994->mic_detecting = true;
wm8994->jack_mic = false;
}

wm8958_micd_set_rate(codec);

Expand Down
6 changes: 4 additions & 2 deletions trunk/sound/soc/codecs/wm8994.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ enum wm8994_vmid_mode {
WM8994_VMID_FORCE,
};

typedef void (*wm8958_micdet_cb)(u16 status, void *data);
typedef void (*wm1811_micdet_cb)(void *data);

int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
int micbias);
int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
wm8958_micdet_cb cb, void *cb_data);
wm1811_micdet_cb cb, void *cb_data);

int wm8994_vmid_mode(struct snd_soc_codec *codec, enum wm8994_vmid_mode mode);

Expand Down Expand Up @@ -138,6 +138,8 @@ struct wm8994_priv {
struct delayed_work jackdet_bootstrap;

int micdet_irq;
wm1811_micdet_cb micd_cb;
void *micd_cb_data;

int revision;

Expand Down

0 comments on commit 3f73df2

Please sign in to comment.