Skip to content

Commit

Permalink
[ARM] Hide ISA DMA API when ISA_DMA_API is unset
Browse files Browse the repository at this point in the history
When ISA_DMA_API is unset, we're not implementing the ISA DMA API,
so there's no point in publishing the prototypes via asm/dma.h, nor
including the machine dependent parts of that API.

This allows us to remove a lot of mach/dma.h files which don't contain
any useful code.  Unfortunately though, some platforms put their own
private non-ISA definitions into mach/dma.h, so we leave these behind
and fix the appropriate #include statments.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Nov 29, 2008
1 parent c72e005 commit dcea83a
Show file tree
Hide file tree
Showing 49 changed files with 61 additions and 311 deletions.
23 changes: 16 additions & 7 deletions arch/arm/include/asm/dma.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#ifndef __ASM_ARM_DMA_H
#define __ASM_ARM_DMA_H

typedef unsigned int dmach_t;

#include <linux/spinlock.h>
#include <asm/memory.h>
#include <asm/system.h>
#include <asm/scatterlist.h>
#include <mach/dma.h>

/*
* This is the maximum virtual address which can be DMA'd from.
Expand All @@ -16,6 +10,19 @@ typedef unsigned int dmach_t;
#define MAX_DMA_ADDRESS 0xffffffff
#endif

#ifdef CONFIG_ISA_DMA_API
/*
* This is used to support drivers written for the x86 ISA DMA API.
* It should not be re-used except for that purpose.
*/
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/scatterlist.h>

typedef unsigned int dmach_t;

#include <mach/dma.h>

/*
* DMA modes
*/
Expand Down Expand Up @@ -141,4 +148,6 @@ extern int isa_dma_bridge_buggy;
#define isa_dma_bridge_buggy (0)
#endif

#endif /* _ARM_DMA_H */
#endif /* CONFIG_ISA_DMA_API */

#endif /* __ASM_ARM_DMA_H */
9 changes: 0 additions & 9 deletions arch/arm/mach-aaec2000/include/mach/dma.h

This file was deleted.

19 changes: 0 additions & 19 deletions arch/arm/mach-at91/include/mach/dma.h

This file was deleted.

19 changes: 0 additions & 19 deletions arch/arm/mach-clps711x/include/mach/dma.h

This file was deleted.

10 changes: 0 additions & 10 deletions arch/arm/mach-davinci/include/mach/dma.h

This file was deleted.

11 changes: 0 additions & 11 deletions arch/arm/mach-ebsa110/include/mach/dma.h

This file was deleted.

3 changes: 0 additions & 3 deletions arch/arm/mach-ep93xx/include/mach/dma.h

This file was deleted.

7 changes: 4 additions & 3 deletions arch/arm/mach-imx/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
#include <linux/interrupt.h>
#include <linux/errno.h>

#include <asm/scatterlist.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/imx-dma.h>

struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
Expand Down Expand Up @@ -138,7 +139,7 @@ imx_dma_setup_sg_base(imx_dmach_t dma_ch,
int
imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
unsigned int dma_length, unsigned int dev_addr,
dmamode_t dmamode)
unsigned int dmamode)
{
struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];

Expand Down Expand Up @@ -223,7 +224,7 @@ imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
int
imx_dma_setup_sg(imx_dmach_t dma_ch,
struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
unsigned int dev_addr, dmamode_t dmamode)
unsigned int dev_addr, unsigned int dmamode)
{
int res;
struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
Expand Down
12 changes: 8 additions & 4 deletions arch/arm/mach-imx/include/mach/imx-dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <asm/dma.h>
#include <mach/dma.h>

#ifndef __ASM_ARCH_IMX_DMA_H
#define __ASM_ARCH_IMX_DMA_H
Expand Down Expand Up @@ -48,7 +48,7 @@ struct imx_dma_channel {
void (*irq_handler) (int, void *);
void (*err_handler) (int, void *, int errcode);
void *data;
dmamode_t dma_mode;
unsigned int dma_mode;
struct scatterlist *sg;
unsigned int sgbc;
unsigned int sgcount;
Expand All @@ -66,14 +66,18 @@ extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
/* The type to distinguish channel numbers parameter from ordinal int type */
typedef int imx_dmach_t;

#define DMA_MODE_READ 0
#define DMA_MODE_WRITE 1
#define DMA_MODE_MASK 1

int
imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
unsigned int dma_length, unsigned int dev_addr, dmamode_t dmamode);
unsigned int dma_length, unsigned int dev_addr, unsigned int dmamode);

int
imx_dma_setup_sg(imx_dmach_t dma_ch,
struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length,
unsigned int dev_addr, dmamode_t dmamode);
unsigned int dev_addr, unsigned int dmamode);

int
imx_dma_setup_handlers(imx_dmach_t dma_ch,
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/mach-integrator/include/mach/dma.h

This file was deleted.

3 changes: 0 additions & 3 deletions arch/arm/mach-iop13xx/include/mach/dma.h

This file was deleted.

9 changes: 0 additions & 9 deletions arch/arm/mach-iop32x/include/mach/dma.h

This file was deleted.

9 changes: 0 additions & 9 deletions arch/arm/mach-iop33x/include/mach/dma.h

This file was deleted.

9 changes: 0 additions & 9 deletions arch/arm/mach-ixp2000/include/mach/dma.h

This file was deleted.

3 changes: 0 additions & 3 deletions arch/arm/mach-ixp23xx/include/mach/dma.h

This file was deleted.

10 changes: 0 additions & 10 deletions arch/arm/mach-ixp4xx/include/mach/dma.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/arm/mach-kirkwood/include/mach/dma.h

This file was deleted.

17 changes: 0 additions & 17 deletions arch/arm/mach-ks8695/include/mach/dma.h

This file was deleted.

16 changes: 0 additions & 16 deletions arch/arm/mach-l7200/include/mach/dma.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/arm/mach-loki/include/mach/dma.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/arm/mach-mv78xx0/include/mach/dma.h

This file was deleted.

20 changes: 0 additions & 20 deletions arch/arm/mach-netx/include/mach/dma.h

This file was deleted.

14 changes: 0 additions & 14 deletions arch/arm/mach-ns9xxx/include/mach/dma.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/arm/mach-orion5x/include/mach/dma.h

This file was deleted.

3 changes: 1 addition & 2 deletions arch/arm/mach-pnx4008/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@

#include <asm/system.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <asm/dma-mapping.h>
#include <asm/mach/dma.h>
#include <mach/clock.h>

static struct dma_channel {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <asm/system.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>

#include <mach/pxa-regs.h>

Expand Down
20 changes: 0 additions & 20 deletions arch/arm/mach-realview/include/mach/dma.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/arm/mach-s3c2410/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <linux/sysdev.h>
#include <linux/serial_core.h>

#include <asm/dma.h>
#include <mach/dma.h>

#include <plat/cpu.h>
Expand Down
Loading

0 comments on commit dcea83a

Please sign in to comment.