aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw_dmac.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2012-06-19 06:34:03 -0400
committerVinod Koul <vinod.koul@linux.intel.com>2012-06-20 22:35:34 -0400
commit1d4554376549d50e8555e6617a4005623ea91788 (patch)
tree331d1d0b31fef835920c6d32378a40315dd7211c /drivers/dma/dw_dmac.c
parent2f45d613ffae00d3355de7871d9cbfd0f2292971 (diff)
dw_dmac: introduce dwc_dump_chan_regs to dump registers
There is three places where values of the most significant registers were printed. Make such piece of code as separate function. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Viresh Kumar <viresh.linux@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/dw_dmac.c')
-rw-r--r--drivers/dma/dw_dmac.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 9794f00810f6..467599a4b9b6 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -191,6 +191,19 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
191 191
192/*----------------------------------------------------------------------*/ 192/*----------------------------------------------------------------------*/
193 193
194static void dwc_dump_chan_regs(struct dw_dma_chan *dwc)
195{
196 dev_err(chan2dev(&dwc->chan),
197 " SAR: 0x%x DAR: 0x%x LLP: 0x%x CTL: 0x%x:%08x\n",
198 channel_readl(dwc, SAR),
199 channel_readl(dwc, DAR),
200 channel_readl(dwc, LLP),
201 channel_readl(dwc, CTL_HI),
202 channel_readl(dwc, CTL_LO));
203}
204
205/*----------------------------------------------------------------------*/
206
194/* Called with dwc->lock held and bh disabled */ 207/* Called with dwc->lock held and bh disabled */
195static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first) 208static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first)
196{ 209{
@@ -200,13 +213,7 @@ static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first)
200 if (dma_readl(dw, CH_EN) & dwc->mask) { 213 if (dma_readl(dw, CH_EN) & dwc->mask) {
201 dev_err(chan2dev(&dwc->chan), 214 dev_err(chan2dev(&dwc->chan),
202 "BUG: Attempted to start non-idle channel\n"); 215 "BUG: Attempted to start non-idle channel\n");
203 dev_err(chan2dev(&dwc->chan), 216 dwc_dump_chan_regs(dwc);
204 " SAR: 0x%x DAR: 0x%x LLP: 0x%x CTL: 0x%x:%08x\n",
205 channel_readl(dwc, SAR),
206 channel_readl(dwc, DAR),
207 channel_readl(dwc, LLP),
208 channel_readl(dwc, CTL_HI),
209 channel_readl(dwc, CTL_LO));
210 217
211 /* The tasklet will hopefully advance the queue... */ 218 /* The tasklet will hopefully advance the queue... */
212 return; 219 return;
@@ -490,13 +497,7 @@ static void dwc_handle_cyclic(struct dw_dma *dw, struct dw_dma_chan *dwc,
490 497
491 spin_lock_irqsave(&dwc->lock, flags); 498 spin_lock_irqsave(&dwc->lock, flags);
492 499
493 dev_err(chan2dev(&dwc->chan), 500 dwc_dump_chan_regs(dwc);
494 " SAR: 0x%x DAR: 0x%x LLP: 0x%x CTL: 0x%x:%08x\n",
495 channel_readl(dwc, SAR),
496 channel_readl(dwc, DAR),
497 channel_readl(dwc, LLP),
498 channel_readl(dwc, CTL_HI),
499 channel_readl(dwc, CTL_LO));
500 501
501 channel_clear_bit(dw, CH_EN, dwc->mask); 502 channel_clear_bit(dw, CH_EN, dwc->mask);
502 while (dma_readl(dw, CH_EN) & dwc->mask) 503 while (dma_readl(dw, CH_EN) & dwc->mask)
@@ -1131,13 +1132,7 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
1131 if (dma_readl(dw, CH_EN) & dwc->mask) { 1132 if (dma_readl(dw, CH_EN) & dwc->mask) {
1132 dev_err(chan2dev(&dwc->chan), 1133 dev_err(chan2dev(&dwc->chan),
1133 "BUG: Attempted to start non-idle channel\n"); 1134 "BUG: Attempted to start non-idle channel\n");
1134 dev_err(chan2dev(&dwc->chan), 1135 dwc_dump_chan_regs(dwc);
1135 " SAR: 0x%x DAR: 0x%x LLP: 0x%x CTL: 0x%x:%08x\n",
1136 channel_readl(dwc, SAR),
1137 channel_readl(dwc, DAR),
1138 channel_readl(dwc, LLP),
1139 channel_readl(dwc, CTL_HI),
1140 channel_readl(dwc, CTL_LO));
1141 spin_unlock_irqrestore(&dwc->lock, flags); 1136 spin_unlock_irqrestore(&dwc->lock, flags);
1142 return -EBUSY; 1137 return -EBUSY;
1143 } 1138 }