aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c64xx
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2009-11-05 13:44:26 +0900
committerBen Dooks <ben-linux@fluff.org>2009-11-09 23:50:39 +0000
commit6d0b8627d545aed7d4bcaad2156b6cb95e105715 (patch)
treebf4956e05e26c0bccd7b1d3e40937b1c364f7f9a /arch/arm/plat-s3c64xx
parent210012a6cd8770a73d1aa74b742667b462d04511 (diff)
downloadkernel_samsung_espresso10-6d0b8627d545aed7d4bcaad2156b6cb95e105715.zip
kernel_samsung_espresso10-6d0b8627d545aed7d4bcaad2156b6cb95e105715.tar.gz
kernel_samsung_espresso10-6d0b8627d545aed7d4bcaad2156b6cb95e105715.tar.bz2
ARM: S3C64XX: DMA: Unify callback functions for success/failure
Replace s3c64xx_dma_tcirq and s3c64xx_dma_errirq with the common s3c64xx_dma_buffdone. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c64xx')
-rw-r--r--arch/arm/plat-s3c64xx/dma.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c
index 6fa706f..5a08a86 100644
--- a/arch/arm/plat-s3c64xx/dma.c
+++ b/arch/arm/plat-s3c64xx/dma.c
@@ -565,26 +565,11 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
EXPORT_SYMBOL(s3c2410_dma_free);
-
-static void s3c64xx_dma_tcirq(struct s3c64xx_dmac *dmac, int offs)
-{
- struct s3c2410_dma_chan *chan = dmac->channels + offs;
-
- /* note, we currently do not bother to work out which buffer
- * or buffers have been completed since the last tc-irq. */
-
- if (chan->callback_fn)
- (chan->callback_fn)(chan, chan->curr->pw, 0, S3C2410_RES_OK);
-}
-
-static void s3c64xx_dma_errirq(struct s3c64xx_dmac *dmac, int offs)
-{
- printk(KERN_DEBUG "%s: offs %d\n", __func__, offs);
-}
-
static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
{
struct s3c64xx_dmac *dmac = pw;
+ struct s3c2410_dma_chan *chan;
+ enum s3c2410_dma_buffresult res;
u32 tcstat, errstat;
u32 bit;
int offs;
@@ -593,15 +578,22 @@ static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
errstat = readl(dmac->regs + PL080_ERR_STATUS);
for (offs = 0, bit = 1; offs < 8; offs++, bit <<= 1) {
+
+ if (!(errstat & bit) && !(tcstat & bit))
+ continue;
+
+ chan = dmac->channels + offs;
+ res = S3C2410_RES_ERR;
+
if (tcstat & bit) {
writel(bit, dmac->regs + PL080_TC_CLEAR);
- s3c64xx_dma_tcirq(dmac, offs);
+ res = S3C2410_RES_OK;
}
- if (errstat & bit) {
- s3c64xx_dma_errirq(dmac, offs);
+ if (errstat & bit)
writel(bit, dmac->regs + PL080_ERR_CLEAR);
- }
+
+ s3c64xx_dma_bufffdone(chan, chan->curr, res);
}
return IRQ_HANDLED;