Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321355
b: refs/heads/master
c: b817662
h: refs/heads/master
i:
  321353: 91011f3
  321351: 992cf57
v: v3
  • Loading branch information
Mark Brown committed Jul 24, 2012
1 parent e090327 commit d6d5d20
Show file tree
Hide file tree
Showing 2 changed files with 14 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: a07e8d49e8b48d3dc458e234a15e36f379a36dff
refs/heads/master: b8176627b84adfea3a729265a5a0f02c850e9275
13 changes: 13 additions & 0 deletions trunk/sound/soc/codecs/wm8994.c
Original file line number Diff line number Diff line change
Expand Up @@ -3253,10 +3253,13 @@ static void wm8994_mic_work(struct work_struct *work)
int ret;
int report;

pm_runtime_get_sync(dev);

ret = regmap_read(regmap, WM8994_INTERRUPT_RAW_STATUS_2, &reg);
if (ret < 0) {
dev_err(dev, "Failed to read microphone status: %d\n",
ret);
pm_runtime_put(dev);
return;
}

Expand Down Expand Up @@ -3299,6 +3302,8 @@ static void wm8994_mic_work(struct work_struct *work)

snd_soc_jack_report(priv->micdet[1].jack, report,
SND_JACK_HEADSET | SND_JACK_BTN_0);

pm_runtime_put(dev);
}

static irqreturn_t wm8994_mic_irq(int irq, void *data)
Expand Down Expand Up @@ -3421,12 +3426,15 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
int reg;
bool present;

pm_runtime_get_sync(codec->dev);

mutex_lock(&wm8994->accdet_lock);

reg = snd_soc_read(codec, WM1811_JACKDET_CTRL);
if (reg < 0) {
dev_err(codec->dev, "Failed to read jack status: %d\n", reg);
mutex_unlock(&wm8994->accdet_lock);
pm_runtime_put(codec->dev);
return IRQ_NONE;
}

Expand Down Expand Up @@ -3491,6 +3499,7 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
SND_JACK_MECHANICAL | SND_JACK_HEADSET |
wm8994->btn_mask);

pm_runtime_put(codec->dev);
return IRQ_HANDLED;
}

Expand Down Expand Up @@ -3602,6 +3611,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
if (!(snd_soc_read(codec, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA))
return IRQ_HANDLED;

pm_runtime_get_sync(codec->dev);

/* We may occasionally read a detection without an impedence
* range being provided - if that happens loop again.
*/
Expand All @@ -3612,6 +3623,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
dev_err(codec->dev,
"Failed to read mic detect status: %d\n",
reg);
pm_runtime_put(codec->dev);
return IRQ_NONE;
}

Expand Down Expand Up @@ -3639,6 +3651,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
dev_warn(codec->dev, "Accessory detection with no callback\n");

out:
pm_runtime_put(codec->dev);
return IRQ_HANDLED;
}

Expand Down

0 comments on commit d6d5d20

Please sign in to comment.