提交 dcea83ad 编写于 作者: R Russell King 提交者: Russell King

[ARM] Hide ISA DMA API when ISA_DMA_API is unset

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: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 c72e005b
#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.
......@@ -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
*/
......@@ -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 */
/*
* arch/arm/mach-aaec2000/include/mach/dma.h
*
* Copyright (c) 2005 Nicolas Bellido Y Ortega
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* arch/arm/mach-at91/include/mach/dma.h
*
* Copyright (C) 2003 SAN People
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* arch/arm/mach-clps711x/include/mach/dma.h
*
* Copyright (C) 1997,1998 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* DaVinci DMA definitions
*
* Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
/*
* arch/arm/mach-ebsa110/include/mach/dma.h
*
* Copyright (C) 1997,1998 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* EBSA110 DMA definitions
*/
/*
* arch/arm/mach-ep93xx/include/mach/dma.h
*/
......@@ -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];
......@@ -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];
......@@ -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];
......
......@@ -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
......@@ -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;
......@@ -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,
......
/*
* arch/arm/mach-integrator/include/mach/dma.h
*
* Copyright (C) 1997,1998 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _IOP13XX_DMA_H
#define _IOP13XX_DMA_H
#endif
/*
* arch/arm/mach-iop32x/include/mach/dma.h
*
* Copyright (C) 2004 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* arch/arm/mach-iop33x/include/mach/dma.h
*
* Copyright (C) 2004 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* arch/arm/mach-ixp2000/include/mach/dma.h
*
* Copyright (C) 2002 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* arch/arm/mach-ixp23xx/include/mach/dma.h
*/
/*
* arch/arm/mach-ixp4xx/include/mach/dma.h
*
* Copyright (C) 2001-2004 MontaVista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
/*
* arch/arm/mach-ks8695/include/mach/dma.h
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* arch/arm/mach-l7200/include/mach/dma.h
*
* Copyright (C) 2000 Steve Hill (sjhill@cotw.com)
*
* Changelog:
* 08-29-2000 SJH Created
*/
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
/* DMA is not yet implemented! It should be the same as acorn, copy over.. */
#define DMA_S0 0
#endif /* _ASM_ARCH_DMA_H */
/*
* arch/arm/mach-netx/include/mach/dma.h
*
* Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define MAX_DMA_CHANNELS 0
/*
* arch/arm/mach-ns9xxx/include/mach/dma.h
*
* Copyright (C) 2006 by Digi International Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
#endif /* ifndef __ASM_ARCH_DMA_H */
......@@ -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 {
......
......@@ -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>
......
/*
* arch/arm/mach-realview/include/mach/dma.h
*
* Copyright (C) 2003 ARM Limited.
* Copyright (C) 1997,1998 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
......@@ -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>
......
......@@ -249,7 +249,7 @@ typedef unsigned long dma_device_t;
* request a dma channel exclusivley
*/
extern int s3c2410_dma_request(dmach_t channel,
extern int s3c2410_dma_request(unsigned int channel,
struct s3c2410_dma_client *, void *dev);
......@@ -258,14 +258,14 @@ extern int s3c2410_dma_request(dmach_t channel,
* change the state of the dma channel
*/
extern int s3c2410_dma_ctrl(dmach_t channel, enum s3c2410_chan_op op);
extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op);
/* s3c2410_dma_setflags
*
* set the channel's flags to a given state
*/
extern int s3c2410_dma_setflags(dmach_t channel,
extern int s3c2410_dma_setflags(unsigned int channel,
unsigned int flags);
/* s3c2410_dma_free
......@@ -273,7 +273,7 @@ extern int s3c2410_dma_setflags(dmach_t channel,
* free the dma channel (will also abort any outstanding operations)
*/
extern int s3c2410_dma_free(dmach_t channel, struct s3c2410_dma_client *);
extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *);
/* s3c2410_dma_enqueue
*
......@@ -282,7 +282,7 @@ extern int s3c2410_dma_free(dmach_t channel, struct s3c2410_dma_client *);
* drained before the buffer is given to the DMA system.
*/
extern int s3c2410_dma_enqueue(dmach_t channel, void *id,
extern int s3c2410_dma_enqueue(unsigned int channel, void *id,
dma_addr_t data, int size);
/* s3c2410_dma_config
......@@ -290,7 +290,7 @@ extern int s3c2410_dma_enqueue(dmach_t channel, void *id,
* configure the dma channel
*/
extern int s3c2410_dma_config(dmach_t channel, int xferunit, int dcon);
extern int s3c2410_dma_config(unsigned int channel, int xferunit, int dcon);
/* s3c2410_dma_devconfig
*
......@@ -305,11 +305,11 @@ extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source,
* get the position that the dma transfer is currently at
*/
extern int s3c2410_dma_getposition(dmach_t channel,
extern int s3c2410_dma_getposition(unsigned int channel,
dma_addr_t *src, dma_addr_t *dest);
extern int s3c2410_dma_set_opfn(dmach_t, s3c2410_dma_opfn_t rtn);
extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn);
extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn);
extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn);
/* DMA Register definitions */
......
......@@ -18,7 +18,6 @@
#include <linux/serial_core.h>
#include <linux/io.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <plat/dma.h>
......
......@@ -17,7 +17,6 @@
#include <linux/sysdev.h>
#include <linux/serial_core.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <plat/dma.h>
......
......@@ -18,7 +18,6 @@
#include <linux/serial_core.h>
#include <linux/io.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <plat/dma.h>
......
......@@ -26,7 +26,7 @@
#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/hardware/scoop.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/collie.h>
#include <asm/mach/sharpsl_param.h>
#include <asm/hardware/sharpsl_pm.h>
......
......@@ -19,7 +19,7 @@
#include <asm/system.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>
#undef DEBUG
......
/*
* arch/arm/mach-versatile/include/mach/dma.h
*
* Copyright (C) 2003 ARM Limited.
* Copyright (C) 1997,1998 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
......@@ -34,7 +34,7 @@
#include <asm/system.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/dma-mx1-mx2.h>
#define DMA_DCR 0x00 /* Control Register */
......
......@@ -22,7 +22,7 @@
* MA 02110-1301, USA.
*/
#include <asm/dma.h>
#include <mach/dma.h>
#ifndef __ASM_ARCH_MXC_DMA_H
#define __ASM_ARCH_MXC_DMA_H
......
/*
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_ARCH_MXC_DMA_H__
#define __ASM_ARCH_MXC_DMA_H__
#endif
......@@ -29,7 +29,7 @@
#include <asm/system.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/tc.h>
......
......@@ -31,9 +31,8 @@
#include <asm/system.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <asm/mach/dma.h>
#include <mach/map.h>
#include <plat/dma.h>
......@@ -804,7 +803,7 @@ EXPORT_SYMBOL(s3c2410_dma_request);
* allowed to go through.
*/
int s3c2410_dma_free(dmach_t channel, struct s3c2410_dma_client *client)
int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
unsigned long flags;
......@@ -995,7 +994,7 @@ static int s3c2410_dma_started(struct s3c2410_dma_chan *chan)
}
int
s3c2410_dma_ctrl(dmach_t channel, enum s3c2410_chan_op op)
s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
......@@ -1043,7 +1042,7 @@ EXPORT_SYMBOL(s3c2410_dma_ctrl);
* dcon: base value of the DCONx register
*/
int s3c2410_dma_config(dmach_t channel,
int s3c2410_dma_config(unsigned int channel,
int xferunit,
int dcon)
{
......@@ -1092,7 +1091,7 @@ int s3c2410_dma_config(dmach_t channel,
EXPORT_SYMBOL(s3c2410_dma_config);
int s3c2410_dma_setflags(dmach_t channel, unsigned int flags)
int s3c2410_dma_setflags(unsigned int channel, unsigned int flags)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
......@@ -1113,7 +1112,7 @@ EXPORT_SYMBOL(s3c2410_dma_setflags);
* irq?
*/
int s3c2410_dma_set_opfn(dmach_t channel, s3c2410_dma_opfn_t rtn)
int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
......@@ -1129,7 +1128,7 @@ int s3c2410_dma_set_opfn(dmach_t channel, s3c2410_dma_opfn_t rtn)
EXPORT_SYMBOL(s3c2410_dma_set_opfn);
int s3c2410_dma_set_buffdone_fn(dmach_t channel, s3c2410_dma_cbfn_t rtn)
int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
......@@ -1219,7 +1218,7 @@ EXPORT_SYMBOL(s3c2410_dma_devconfig);
* returns the current transfer points for the dma source and destination
*/
int s3c2410_dma_getposition(dmach_t channel, dma_addr_t *src, dma_addr_t *dst)
int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst)
{
struct s3c2410_dma_chan *chan = lookup_dma_channel(channel);
......
......@@ -18,7 +18,7 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <asm/system.h>
#include "mcp.h"
......
......@@ -20,7 +20,7 @@
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/system.h>
......
......@@ -15,7 +15,7 @@
#include <linux/proc_fs.h>
#include <linux/device.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include "ucb1x00.h"
......
......@@ -25,7 +25,7 @@
#include <linux/device.h>
#include <linux/mutex.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/hardware.h>
#include "ucb1x00.h"
......
......@@ -31,7 +31,7 @@
#include <linux/slab.h>
#include <linux/kthread.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/collie.h>
#include <asm/mach-types.h>
......
......@@ -28,9 +28,9 @@
#include <linux/mmc/host.h>
#include <linux/io.h>
#include <asm/dma.h>
#include <asm/sizes.h>
#include <mach/dma.h>
#include <mach/hardware.h>
#include <mach/pxa-regs.h>
#include <mach/mmc.h>
......
......@@ -22,7 +22,7 @@
#include <net/irda/wrapper.h>
#include <net/irda/irda_device.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/irda.h>
#include <mach/hardware.h>
#include <mach/pxa-regs.h>
......
......@@ -527,7 +527,7 @@ struct smc_local {
* as RX which can overrun memory and lose packets.
*/
#include <linux/dma-mapping.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/hardware.h>
#include <mach/pxa-regs.h>
......
......@@ -32,8 +32,8 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/delay.h>
#include <asm/dma.h>
#include <mach/dma.h>
#include <mach/hardware.h>
#include <mach/pxa-regs.h>
#include <mach/regs-ssp.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册