aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-10-16 09:10:08 -0400
committerTakashi Iwai <tiwai@suse.de>2012-10-30 05:39:59 -0400
commit1a8506d4402b6e96c2ed778dc7ccbb48d1e02fce (patch)
tree23172e90d10c71f3b4bb20eec44b90f150c28f09 /sound/pci/hda/hda_intel.c
parent4ee3bffca4fad13a4cb672158dce0def41ab3a54 (diff)
ALSA: hda - Add tracepoints to HD-audio controller driver
Add a couple of tracepoints to snd-hda-intel for tracing the position and the trigger timings. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index d96a14e1fa95..d7481f0c194a 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -527,6 +527,9 @@ struct azx {
527 struct list_head list; 527 struct list_head list;
528}; 528};
529 529
530#define CREATE_TRACE_POINTS
531#include "hda_intel_trace.h"
532
530/* driver types */ 533/* driver types */
531enum { 534enum {
532 AZX_DRIVER_ICH, 535 AZX_DRIVER_ICH,
@@ -2059,6 +2062,9 @@ static int azx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
2059 int rstart = 0, start, nsync = 0, sbits = 0; 2062 int rstart = 0, start, nsync = 0, sbits = 0;
2060 int nwait, timeout; 2063 int nwait, timeout;
2061 2064
2065 azx_dev = get_azx_dev(substream);
2066 trace_azx_pcm_trigger(chip, azx_dev, cmd);
2067
2062 switch (cmd) { 2068 switch (cmd) {
2063 case SNDRV_PCM_TRIGGER_START: 2069 case SNDRV_PCM_TRIGGER_START:
2064 rstart = 1; 2070 rstart = 1;
@@ -2231,6 +2237,7 @@ static unsigned int azx_get_position(struct azx *chip,
2231{ 2237{
2232 unsigned int pos; 2238 unsigned int pos;
2233 int stream = azx_dev->substream->stream; 2239 int stream = azx_dev->substream->stream;
2240 int delay = 0;
2234 2241
2235 switch (chip->position_fix[stream]) { 2242 switch (chip->position_fix[stream]) {
2236 case POS_FIX_LPIB: 2243 case POS_FIX_LPIB:
@@ -2264,7 +2271,6 @@ static unsigned int azx_get_position(struct azx *chip,
2264 chip->position_fix[stream] == POS_FIX_POSBUF && 2271 chip->position_fix[stream] == POS_FIX_POSBUF &&
2265 (chip->driver_caps & AZX_DCAPS_COUNT_LPIB_DELAY)) { 2272 (chip->driver_caps & AZX_DCAPS_COUNT_LPIB_DELAY)) {
2266 unsigned int lpib_pos = azx_sd_readl(azx_dev, SD_LPIB); 2273 unsigned int lpib_pos = azx_sd_readl(azx_dev, SD_LPIB);
2267 int delay;
2268 if (stream == SNDRV_PCM_STREAM_PLAYBACK) 2274 if (stream == SNDRV_PCM_STREAM_PLAYBACK)
2269 delay = pos - lpib_pos; 2275 delay = pos - lpib_pos;
2270 else 2276 else
@@ -2279,6 +2285,7 @@ static unsigned int azx_get_position(struct azx *chip,
2279 azx_dev->substream->runtime->delay = 2285 azx_dev->substream->runtime->delay =
2280 bytes_to_frames(azx_dev->substream->runtime, delay); 2286 bytes_to_frames(azx_dev->substream->runtime, delay);
2281 } 2287 }
2288 trace_azx_get_position(chip, azx_dev, pos, delay);
2282 return pos; 2289 return pos;
2283} 2290}
2284 2291