summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-05 12:22:46 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-06 14:13:42 +0000
commit3028eb8c51d968b9e7b44a9786a4e521e37afb13 (patch)
treea55b75b799209c2d850082eedcc3395e3b82b8de /sound
parent1badabd980da3bc09933c14970017067940ecd57 (diff)
downloadlinux-stable-3028eb8c51d968b9e7b44a9786a4e521e37afb13.tar.gz
linux-stable-3028eb8c51d968b9e7b44a9786a4e521e37afb13.tar.bz2
linux-stable-3028eb8c51d968b9e7b44a9786a4e521e37afb13.zip
ASoC: Add trace events for jack detection
As jack detection can trigger DAPM and the latency in debouncing can create confusing windows in operation provide some trace events which will hopefully help in diagnostics. The soc-jack core traces all reports that it gets and the resulting notifications to upper layers. An event for jack IRQs is also provided for instrumentation of debounce, and used in the GPIO jack code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c1
-rw-r--r--sound/soc/soc-jack.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 78a01014079a..822bd3bcf148 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -33,6 +33,7 @@
#include <linux/slab.h>
#include <sound/ac97_codec.h>
#include <sound/core.h>
+#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 0e9b0710928b..ac5a5bc7375a 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
+#include <trace/events/asoc.h>
/**
* snd_soc_jack_new - Create a new jack
@@ -64,6 +65,8 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
int enable;
int oldstatus;
+ trace_snd_soc_jack_report(jack, mask, status);
+
if (!jack)
return;
@@ -82,6 +85,8 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
if (mask && (jack->status == oldstatus))
goto out;
+ trace_snd_soc_jack_notify(jack, status);
+
list_for_each_entry(pin, &jack->pins, list) {
enable = pin->mask & jack->status;
@@ -210,6 +215,8 @@ static irqreturn_t gpio_handler(int irq, void *data)
struct snd_soc_jack_gpio *gpio = data;
struct device *dev = gpio->jack->codec->card->dev;
+ trace_snd_soc_jack_irq(gpio->name);
+
if (device_may_wakeup(dev))
pm_wakeup_event(dev, gpio->debounce_time + 50);