From 1df8130278c4543555fea697e5714fbac300b899 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 8 Dec 2008 15:58:50 +0000 Subject: [ARM] dma: remove dmach_t typedef Remove a pointless integer typedef. Signed-off-by: Russell King --- arch/arm/include/asm/mach/dma.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'arch/arm/include/asm/mach') diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h index fc7278ea7146..281ae7e40a90 100644 --- a/arch/arm/include/asm/mach/dma.h +++ b/arch/arm/include/asm/mach/dma.h @@ -15,12 +15,12 @@ struct dma_struct; typedef struct dma_struct dma_t; struct dma_ops { - int (*request)(dmach_t, dma_t *); /* optional */ - void (*free)(dmach_t, dma_t *); /* optional */ - void (*enable)(dmach_t, dma_t *); /* mandatory */ - void (*disable)(dmach_t, dma_t *); /* mandatory */ - int (*residue)(dmach_t, dma_t *); /* optional */ - int (*setspeed)(dmach_t, dma_t *, int); /* optional */ + int (*request)(unsigned int, dma_t *); /* optional */ + void (*free)(unsigned int, dma_t *); /* optional */ + void (*enable)(unsigned int, dma_t *); /* mandatory */ + void (*disable)(unsigned int, dma_t *); /* mandatory */ + int (*residue)(unsigned int, dma_t *); /* optional */ + int (*setspeed)(unsigned int, dma_t *, int); /* optional */ char *type; }; -- cgit v1.2.3 From 2f757f2ab7411cf0e2779012d8cda0cbf2f80d26 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 8 Dec 2008 16:33:30 +0000 Subject: [ARM] dma: rejig DMA initialization Rather than having the central DMA multiplexer call the architecture specific DMA initialization function, have each architecture DMA initialization function use core_initcall(), and register each DMA channel separately with the multiplexer. This removes the array of dma structures in the central multiplexer, replacing it with an array of pointers instead; this is more flexible since it allows the drivers to wrap the DMA structure (eventually allowing us to transition non-ISA DMA drivers away.) Signed-off-by: Russell King --- arch/arm/include/asm/mach/dma.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'arch/arm/include/asm/mach') diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h index 281ae7e40a90..38a3693f1258 100644 --- a/arch/arm/include/asm/mach/dma.h +++ b/arch/arm/include/asm/mach/dma.h @@ -48,10 +48,12 @@ struct dma_struct { struct dma_ops *d_ops; }; -/* Prototype: void arch_dma_init(dma) - * Purpose : Initialise architecture specific DMA - * Params : dma - pointer to array of DMA structures +/* + * isa_dma_add - add an ISA-style DMA channel */ -extern void arch_dma_init(dma_t *dma); +extern int isa_dma_add(unsigned int, dma_t *dma); -extern void isa_init_dma(dma_t *dma); +/* + * Add the ISA DMA controller. Always takes channels 0-7. + */ +extern void isa_init_dma(void); -- cgit v1.2.3 From ad9dd94c384f7ee37b798a9349b8c42da8fa99ab Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 8 Dec 2008 17:35:48 +0000 Subject: [ARM] dma: move RiscPC specific DMA data out of dma_struct Separate the RiscPC specific (IOMD and floppy FIQ) data out of the core DMA structure by making the IOMD and floppy DMA supersets. Signed-off-by: Russell King --- arch/arm/include/asm/mach/dma.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'arch/arm/include/asm/mach') diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h index 38a3693f1258..4326738ff36f 100644 --- a/arch/arm/include/asm/mach/dma.h +++ b/arch/arm/include/asm/mach/dma.h @@ -40,14 +40,22 @@ struct dma_struct { unsigned int lock; /* Device is allocated */ const char *device_id; /* Device name */ - unsigned int dma_base; /* Controller base address */ - int dma_irq; /* Controller IRQ */ - struct scatterlist cur_sg; /* Current controller buffer */ - unsigned int state; - struct dma_ops *d_ops; }; +struct floppy_dma { + struct dma_struct dma; + unsigned int fiq; +}; + +struct iomd_dma { + struct dma_struct dma; + unsigned int state; + unsigned long base; /* Controller base address */ + int irq; /* Controller IRQ */ + struct scatterlist cur_sg; /* Current controller buffer */ +}; + /* * isa_dma_add - add an ISA-style DMA channel */ -- cgit v1.2.3 From 8c56afcbea22e472d3bfa8ddf06f23cd6bc56826 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 11 Dec 2008 14:50:39 +0000 Subject: [ARM] dma: constify dma controller name and dma ops Signed-off-by: Russell King --- arch/arm/include/asm/mach/dma.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/include/asm/mach') diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h index 4326738ff36f..3122adae80be 100644 --- a/arch/arm/include/asm/mach/dma.h +++ b/arch/arm/include/asm/mach/dma.h @@ -21,7 +21,7 @@ struct dma_ops { void (*disable)(unsigned int, dma_t *); /* mandatory */ int (*residue)(unsigned int, dma_t *); /* optional */ int (*setspeed)(unsigned int, dma_t *, int); /* optional */ - char *type; + const char *type; }; struct dma_struct { @@ -40,7 +40,7 @@ struct dma_struct { unsigned int lock; /* Device is allocated */ const char *device_id; /* Device name */ - struct dma_ops *d_ops; + const struct dma_ops *d_ops; }; struct floppy_dma { -- cgit v1.2.3 From f0ffc816250a8cc28e6824326e2d58333e058eca Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 2 Jan 2009 12:34:55 +0000 Subject: [ARM] dma: remove dmamode_t typedef Signed-off-by: Russell King --- arch/arm/include/asm/mach/dma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/include/asm/mach') diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h index 3122adae80be..5166145d8a3c 100644 --- a/arch/arm/include/asm/mach/dma.h +++ b/arch/arm/include/asm/mach/dma.h @@ -34,7 +34,7 @@ struct dma_struct { unsigned int active:1; /* Transfer active */ unsigned int invalid:1; /* Address/Count changed */ - dmamode_t dma_mode; /* DMA mode */ + unsigned int dma_mode; /* DMA mode */ int speed; /* DMA speed */ unsigned int lock; /* Device is allocated */ -- cgit v1.2.3 From 308d333ad6cc12e39adaed22dc10bac48e17742a Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Feb 2009 21:36:22 +0000 Subject: [ARM] dma: move IOMD and floppy DMA structures to RiscPC DMA code There's no point these being in a generic include file when they're only used in arch/arm/mach-rpc/dma.c. Signed-off-by: Russell King --- arch/arm/include/asm/mach/dma.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'arch/arm/include/asm/mach') diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h index 5166145d8a3c..9e614a18e680 100644 --- a/arch/arm/include/asm/mach/dma.h +++ b/arch/arm/include/asm/mach/dma.h @@ -43,19 +43,6 @@ struct dma_struct { const struct dma_ops *d_ops; }; -struct floppy_dma { - struct dma_struct dma; - unsigned int fiq; -}; - -struct iomd_dma { - struct dma_struct dma; - unsigned int state; - unsigned long base; /* Controller base address */ - int irq; /* Controller IRQ */ - struct scatterlist cur_sg; /* Current controller buffer */ -}; - /* * isa_dma_add - add an ISA-style DMA channel */ -- cgit v1.2.3