aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-jack.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-05 07:22:46 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-06 09:13:42 -0500
commit3028eb8c51d968b9e7b44a9786a4e521e37afb13 (patch)
treea55b75b799209c2d850082eedcc3395e3b82b8de /sound/soc/soc-jack.c
parent1badabd980da3bc09933c14970017067940ecd57 (diff)
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/soc/soc-jack.c')
-rw-r--r--sound/soc/soc-jack.c7
1 files changed, 7 insertions, 0 deletions
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 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/workqueue.h> 18#include <linux/workqueue.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <trace/events/asoc.h>
20 21
21/** 22/**
22 * snd_soc_jack_new - Create a new jack 23 * 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)
64 int enable; 65 int enable;
65 int oldstatus; 66 int oldstatus;
66 67
68 trace_snd_soc_jack_report(jack, mask, status);
69
67 if (!jack) 70 if (!jack)
68 return; 71 return;
69 72
@@ -82,6 +85,8 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
82 if (mask && (jack->status == oldstatus)) 85 if (mask && (jack->status == oldstatus))
83 goto out; 86 goto out;
84 87
88 trace_snd_soc_jack_notify(jack, status);
89
85 list_for_each_entry(pin, &jack->pins, list) { 90 list_for_each_entry(pin, &jack->pins, list) {
86 enable = pin->mask & jack->status; 91 enable = pin->mask & jack->status;
87 92
@@ -210,6 +215,8 @@ static irqreturn_t gpio_handler(int irq, void *data)
210 struct snd_soc_jack_gpio *gpio = data; 215 struct snd_soc_jack_gpio *gpio = data;
211 struct device *dev = gpio->jack->codec->card->dev; 216 struct device *dev = gpio->jack->codec->card->dev;
212 217
218 trace_snd_soc_jack_irq(gpio->name);
219
213 if (device_may_wakeup(dev)) 220 if (device_may_wakeup(dev))
214 pm_wakeup_event(dev, gpio->debounce_time + 50); 221 pm_wakeup_event(dev, gpio->debounce_time + 50);
215 222