1919#include <asm/system.h>
2020#include <asm/scatterlist.h>
2121
22- typedef unsigned int dmach_t ;
23-
2422#include <mach/isa-dma.h>
2523
2624/*
27- * DMA modes
25+ * The DMA modes reflect the settings for the ISA DMA controller
2826 */
29- typedef unsigned int dmamode_t ;
30-
31- #define DMA_MODE_MASK 3
27+ #define DMA_MODE_MASK 0xcc
3228
33- #define DMA_MODE_READ 0
34- #define DMA_MODE_WRITE 1
35- #define DMA_MODE_CASCADE 2
36- #define DMA_AUTOINIT 4
29+ #define DMA_MODE_READ 0x44
30+ #define DMA_MODE_WRITE 0x48
31+ #define DMA_MODE_CASCADE 0xc0
32+ #define DMA_AUTOINIT 0x10
3733
3834extern spinlock_t dma_spin_lock ;
3935
@@ -52,70 +48,70 @@ static inline void release_dma_lock(unsigned long flags)
5248/* Clear the 'DMA Pointer Flip Flop'.
5349 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
5450 */
55- #define clear_dma_ff (channel )
51+ #define clear_dma_ff (chan )
5652
5753/* Set only the page register bits of the transfer address.
5854 *
5955 * NOTE: This is an architecture specific function, and should
6056 * be hidden from the drivers
6157 */
62- extern void set_dma_page (dmach_t channel , char pagenr );
58+ extern void set_dma_page (unsigned int chan , char pagenr );
6359
6460/* Request a DMA channel
6561 *
6662 * Some architectures may need to do allocate an interrupt
6763 */
68- extern int request_dma (dmach_t channel , const char * device_id );
64+ extern int request_dma (unsigned int chan , const char * device_id );
6965
7066/* Free a DMA channel
7167 *
7268 * Some architectures may need to do free an interrupt
7369 */
74- extern void free_dma (dmach_t channel );
70+ extern void free_dma (unsigned int chan );
7571
7672/* Enable DMA for this channel
7773 *
7874 * On some architectures, this may have other side effects like
7975 * enabling an interrupt and setting the DMA registers.
8076 */
81- extern void enable_dma (dmach_t channel );
77+ extern void enable_dma (unsigned int chan );
8278
8379/* Disable DMA for this channel
8480 *
8581 * On some architectures, this may have other side effects like
8682 * disabling an interrupt or whatever.
8783 */
88- extern void disable_dma (dmach_t channel );
84+ extern void disable_dma (unsigned int chan );
8985
9086/* Test whether the specified channel has an active DMA transfer
9187 */
92- extern int dma_channel_active (dmach_t channel );
88+ extern int dma_channel_active (unsigned int chan );
9389
9490/* Set the DMA scatter gather list for this channel
9591 *
9692 * This should not be called if a DMA channel is enabled,
9793 * especially since some DMA architectures don't update the
9894 * DMA address immediately, but defer it to the enable_dma().
9995 */
100- extern void set_dma_sg (dmach_t channel , struct scatterlist * sg , int nr_sg );
96+ extern void set_dma_sg (unsigned int chan , struct scatterlist * sg , int nr_sg );
10197
10298/* Set the DMA address for this channel
10399 *
104100 * This should not be called if a DMA channel is enabled,
105101 * especially since some DMA architectures don't update the
106102 * DMA address immediately, but defer it to the enable_dma().
107103 */
108- extern void __set_dma_addr (dmach_t channel , void * addr );
109- #define set_dma_addr (channel , addr ) \
110- __set_dma_addr(channel , bus_to_virt(addr))
104+ extern void __set_dma_addr (unsigned int chan , void * addr );
105+ #define set_dma_addr (chan , addr ) \
106+ __set_dma_addr(chan , bus_to_virt(addr))
111107
112108/* Set the DMA byte count for this channel
113109 *
114110 * This should not be called if a DMA channel is enabled,
115111 * especially since some DMA architectures don't update the
116112 * DMA count immediately, but defer it to the enable_dma().
117113 */
118- extern void set_dma_count (dmach_t channel , unsigned long count );
114+ extern void set_dma_count (unsigned int chan , unsigned long count );
119115
120116/* Set the transfer direction for this channel
121117 *
@@ -124,19 +120,19 @@ extern void set_dma_count(dmach_t channel, unsigned long count);
124120 * DMA transfer direction immediately, but defer it to the
125121 * enable_dma().
126122 */
127- extern void set_dma_mode (dmach_t channel , dmamode_t mode );
123+ extern void set_dma_mode (unsigned int chan , unsigned int mode );
128124
129125/* Set the transfer speed for this channel
130126 */
131- extern void set_dma_speed (dmach_t channel , int cycle_ns );
127+ extern void set_dma_speed (unsigned int chan , int cycle_ns );
132128
133129/* Get DMA residue count. After a DMA transfer, this
134130 * should return zero. Reading this while a DMA transfer is
135131 * still in progress will return unpredictable results.
136132 * If called before the channel has been used, it may return 1.
137133 * Otherwise, it returns the number of _bytes_ left to transfer.
138134 */
139- extern int get_dma_residue (dmach_t channel );
135+ extern int get_dma_residue (unsigned int chan );
140136
141137#ifndef NO_DMA
142138#define NO_DMA 255
0 commit comments