ASoC: Trace Wolfson jack detection IRQs
Add jack detection interrupt trace to Wolfson CODEC drivers. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
Родитель
6d3c26bcb7
Коммит
2bbb5d6679
|
@ -26,6 +26,7 @@
|
||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include <sound/initval.h>
|
#include <sound/initval.h>
|
||||||
#include <sound/tlv.h>
|
#include <sound/tlv.h>
|
||||||
|
#include <trace/events/asoc.h>
|
||||||
|
|
||||||
#include "wm8350.h"
|
#include "wm8350.h"
|
||||||
|
|
||||||
|
@ -1378,10 +1379,12 @@ static irqreturn_t wm8350_hp_jack_handler(int irq, void *data)
|
||||||
|
|
||||||
switch (irq - wm8350->irq_base) {
|
switch (irq - wm8350->irq_base) {
|
||||||
case WM8350_IRQ_CODEC_JCK_DET_L:
|
case WM8350_IRQ_CODEC_JCK_DET_L:
|
||||||
|
trace_snd_soc_jack_irq("WM8350 HPL");
|
||||||
jack = &priv->hpl;
|
jack = &priv->hpl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM8350_IRQ_CODEC_JCK_DET_R:
|
case WM8350_IRQ_CODEC_JCK_DET_R:
|
||||||
|
trace_snd_soc_jack_irq("WM8350 HPR");
|
||||||
jack = &priv->hpr;
|
jack = &priv->hpr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1456,6 +1459,8 @@ static irqreturn_t wm8350_mic_handler(int irq, void *data)
|
||||||
u16 reg;
|
u16 reg;
|
||||||
int report = 0;
|
int report = 0;
|
||||||
|
|
||||||
|
trace_snd_soc_jack_irq("WM8350 mic");
|
||||||
|
|
||||||
reg = wm8350_reg_read(wm8350, WM8350_JACK_PIN_STATUS);
|
reg = wm8350_reg_read(wm8350, WM8350_JACK_PIN_STATUS);
|
||||||
if (reg & WM8350_JACK_MICSCD_LVL)
|
if (reg & WM8350_JACK_MICSCD_LVL)
|
||||||
report |= priv->mic.short_report;
|
report |= priv->mic.short_report;
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include <sound/initval.h>
|
#include <sound/initval.h>
|
||||||
#include <sound/wm8903.h>
|
#include <sound/wm8903.h>
|
||||||
|
#include <trace/events/asoc.h>
|
||||||
|
|
||||||
#include "wm8903.h"
|
#include "wm8903.h"
|
||||||
|
|
||||||
|
@ -1533,6 +1534,9 @@ static irqreturn_t wm8903_irq(int irq, void *data)
|
||||||
mic_report = wm8903->mic_last_report;
|
mic_report = wm8903->mic_last_report;
|
||||||
int_pol = snd_soc_read(codec, WM8903_INTERRUPT_POLARITY_1);
|
int_pol = snd_soc_read(codec, WM8903_INTERRUPT_POLARITY_1);
|
||||||
|
|
||||||
|
if (int_val & (WM8903_MICSHRT_EINT | WM8903_MICDET_EINT))
|
||||||
|
trace_snd_soc_jack_irq(dev_name(codec->dev));
|
||||||
|
|
||||||
if (int_val & WM8903_MICSHRT_EINT) {
|
if (int_val & WM8903_MICSHRT_EINT) {
|
||||||
dev_dbg(codec->dev, "Microphone short (pol=%x)\n", int_pol);
|
dev_dbg(codec->dev, "Microphone short (pol=%x)\n", int_pol);
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <sound/initval.h>
|
#include <sound/initval.h>
|
||||||
#include <sound/tlv.h>
|
#include <sound/tlv.h>
|
||||||
#include <sound/wm8962.h>
|
#include <sound/wm8962.h>
|
||||||
|
#include <trace/events/asoc.h>
|
||||||
|
|
||||||
#include "wm8962.h"
|
#include "wm8962.h"
|
||||||
|
|
||||||
|
@ -3353,6 +3354,8 @@ static irqreturn_t wm8962_irq(int irq, void *data)
|
||||||
if (active & (WM8962_MICSCD_EINT | WM8962_MICD_EINT)) {
|
if (active & (WM8962_MICSCD_EINT | WM8962_MICD_EINT)) {
|
||||||
dev_dbg(codec->dev, "Microphone event detected\n");
|
dev_dbg(codec->dev, "Microphone event detected\n");
|
||||||
|
|
||||||
|
trace_snd_soc_jack_irq(dev_name(codec->dev));
|
||||||
|
|
||||||
pm_wakeup_event(codec->dev, 300);
|
pm_wakeup_event(codec->dev, 300);
|
||||||
|
|
||||||
schedule_delayed_work(&wm8962->mic_work,
|
schedule_delayed_work(&wm8962->mic_work,
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
#include <sound/initval.h>
|
#include <sound/initval.h>
|
||||||
#include <sound/tlv.h>
|
#include <sound/tlv.h>
|
||||||
|
#include <trace/events/asoc.h>
|
||||||
|
|
||||||
#include <linux/mfd/wm8994/core.h>
|
#include <linux/mfd/wm8994/core.h>
|
||||||
#include <linux/mfd/wm8994/registers.h>
|
#include <linux/mfd/wm8994/registers.h>
|
||||||
|
@ -2755,6 +2756,8 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data)
|
||||||
int reg;
|
int reg;
|
||||||
int report;
|
int report;
|
||||||
|
|
||||||
|
trace_snd_soc_jack_irq(dev_name(codec->dev));
|
||||||
|
|
||||||
reg = snd_soc_read(codec, WM8994_INTERRUPT_RAW_STATUS_2);
|
reg = snd_soc_read(codec, WM8994_INTERRUPT_RAW_STATUS_2);
|
||||||
if (reg < 0) {
|
if (reg < 0) {
|
||||||
dev_err(codec->dev, "Failed to read microphone status: %d\n",
|
dev_err(codec->dev, "Failed to read microphone status: %d\n",
|
||||||
|
@ -2901,6 +2904,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace_snd_soc_jack_irq(dev_name(codec->dev));
|
||||||
|
|
||||||
if (wm8994->jack_cb)
|
if (wm8994->jack_cb)
|
||||||
wm8994->jack_cb(reg, wm8994->jack_cb_data);
|
wm8994->jack_cb(reg, wm8994->jack_cb_data);
|
||||||
else
|
else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче