aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-11-07 03:34:18 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-11-07 07:40:08 -0500
commitc4878274750ae0bb90c351a737ac6cdcb608e546 (patch)
treec703dff48cb6427f594fccf67267939a8848328c
parentd56b6eb6df7f6fb92383a52d640e27f71e6262d0 (diff)
ASoC/mpc5200: Improve printk debug output for trigger
Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/fsl/mpc5200_dma.c15
-rw-r--r--sound/soc/fsl/mpc5200_dma.h1
2 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index 4e475861f5db..658e3fa14663 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -77,6 +77,7 @@ static irqreturn_t psc_dma_bcom_irq_tx(int irq, void *_psc_dma_stream)
77 bcom_retrieve_buffer(s->bcom_task, NULL, NULL); 77 bcom_retrieve_buffer(s->bcom_task, NULL, NULL);
78 78
79 s->period_current = (s->period_current+1) % s->runtime->periods; 79 s->period_current = (s->period_current+1) % s->runtime->periods;
80 s->period_count++;
80 81
81 psc_dma_bcom_enqueue_next_buffer(s); 82 psc_dma_bcom_enqueue_next_buffer(s);
82 } 83 }
@@ -101,6 +102,7 @@ static irqreturn_t psc_dma_bcom_irq_rx(int irq, void *_psc_dma_stream)
101 bcom_retrieve_buffer(s->bcom_task, NULL, NULL); 102 bcom_retrieve_buffer(s->bcom_task, NULL, NULL);
102 103
103 s->period_current = (s->period_current+1) % s->runtime->periods; 104 s->period_current = (s->period_current+1) % s->runtime->periods;
105 s->period_count++;
104 106
105 psc_dma_bcom_enqueue_next_buffer(s); 107 psc_dma_bcom_enqueue_next_buffer(s);
106 } 108 }
@@ -142,17 +144,17 @@ static int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd)
142 else 144 else
143 s = &psc_dma->playback; 145 s = &psc_dma->playback;
144 146
145 dev_dbg(psc_dma->dev, "psc_dma_trigger(substream=%p, cmd=%i)"
146 " stream_id=%i\n",
147 substream, cmd, substream->pstr->stream);
148
149 switch (cmd) { 147 switch (cmd) {
150 case SNDRV_PCM_TRIGGER_START: 148 case SNDRV_PCM_TRIGGER_START:
149 dev_dbg(psc_dma->dev, "START: stream=%i fbits=%u ps=%u #p=%u\n",
150 substream->pstr->stream, runtime->frame_bits,
151 (int)runtime->period_size, runtime->periods);
151 s->period_bytes = frames_to_bytes(runtime, 152 s->period_bytes = frames_to_bytes(runtime,
152 runtime->period_size); 153 runtime->period_size);
153 s->period_next = 0; 154 s->period_next = 0;
154 s->period_current = 0; 155 s->period_current = 0;
155 s->active = 1; 156 s->active = 1;
157 s->period_count = 0;
156 s->runtime = runtime; 158 s->runtime = runtime;
157 159
158 /* Fill up the bestcomm bd queue and enable DMA. 160 /* Fill up the bestcomm bd queue and enable DMA.
@@ -177,6 +179,8 @@ static int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd)
177 break; 179 break;
178 180
179 case SNDRV_PCM_TRIGGER_STOP: 181 case SNDRV_PCM_TRIGGER_STOP:
182 dev_dbg(psc_dma->dev, "STOP: stream=%i periods_count=%i\n",
183 substream->pstr->stream, s->period_count);
180 s->active = 0; 184 s->active = 0;
181 185
182 spin_lock_irqsave(&psc_dma->lock, flags); 186 spin_lock_irqsave(&psc_dma->lock, flags);
@@ -190,7 +194,8 @@ static int psc_dma_trigger(struct snd_pcm_substream *substream, int cmd)
190 break; 194 break;
191 195
192 default: 196 default:
193 dev_dbg(psc_dma->dev, "invalid command\n"); 197 dev_dbg(psc_dma->dev, "unhandled trigger: stream=%i cmd=%i\n",
198 substream->pstr->stream, cmd);
194 return -EINVAL; 199 return -EINVAL;
195 } 200 }
196 201
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h
index d9c741bf9ab6..c6f29e4d093c 100644
--- a/sound/soc/fsl/mpc5200_dma.h
+++ b/sound/soc/fsl/mpc5200_dma.h
@@ -27,6 +27,7 @@ struct psc_dma_stream {
27 int period_next; 27 int period_next;
28 int period_current; 28 int period_current;
29 int period_bytes; 29 int period_bytes;
30 int period_count;
30}; 31};
31 32
32/** 33/**