2 * arch/sh/drivers/dma/dma-isa.c
4 * Generic ISA DMA wrapper for SH DMA API
6 * Copyright (C) 2003 Paul Mundt
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
12 #include <linux/kernel.h>
16 * This implements a small wrapper set to make code using the old ISA DMA API
17 * work with the SH DMA API. Since most of the work in the new API happens
18 * at ops->xfer() time, we simply use the various set_dma_xxx() routines to
19 * fill in per-channel info, and then hand hand this off to ops->xfer() at
22 * For channels that are doing on-demand data transfer via cascading, the
23 * channel itself will still need to be configured through the new API. As
24 * such, this code is meant for only the simplest of tasks (and shouldn't be
25 * used in any new drivers at all).
27 * It should also be noted that various functions here are labelled as
28 * being deprecated. This is due to the fact that the ops->xfer() method is
29 * the preferred way of doing things (as well as just grabbing the spinlock
30 * directly). As such, any users of this interface will be warned rather
34 unsigned long __deprecated claim_dma_lock(void)
38 spin_lock_irqsave(&dma_spin_lock, flags);
43 void __deprecated release_dma_lock(unsigned long flags)
45 spin_unlock_irqrestore(&dma_spin_lock, flags);
48 void __deprecated disable_dma(unsigned int chan)
53 void __deprecated enable_dma(unsigned int chan)
55 struct dma_info *info = get_dma_info(chan);
57 info->ops->xfer(info);
60 void clear_dma_ff(unsigned int chan)
65 void set_dma_mode(unsigned int chan, char mode)
67 struct dma_info *info = get_dma_info(chan);
72 void set_dma_addr(unsigned int chan, unsigned int addr)
74 struct dma_info *info = get_dma_info(chan);
77 * Single address mode is the only thing supported through
80 if ((info->mode & DMA_MODE_MASK) == DMA_MODE_READ) {
87 void set_dma_count(unsigned int chan, unsigned int count)
89 struct dma_info *info = get_dma_info(chan);