diff options
Diffstat (limited to 'arch/arm/kernel/dma-isa.c')
-rw-r--r-- | arch/arm/kernel/dma-isa.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c index 4a3a50495c60..29eca48925d8 100644 --- a/arch/arm/kernel/dma-isa.c +++ b/arch/arm/kernel/dma-isa.c | |||
@@ -49,25 +49,25 @@ static unsigned int isa_dma_port[8][7] = { | |||
49 | { 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce } | 49 | { 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce } |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static int isa_get_dma_residue(dmach_t channel, dma_t *dma) | 52 | static int isa_get_dma_residue(unsigned int chan, dma_t *dma) |
53 | { | 53 | { |
54 | unsigned int io_port = isa_dma_port[channel][ISA_DMA_COUNT]; | 54 | unsigned int io_port = isa_dma_port[chan][ISA_DMA_COUNT]; |
55 | int count; | 55 | int count; |
56 | 56 | ||
57 | count = 1 + inb(io_port); | 57 | count = 1 + inb(io_port); |
58 | count |= inb(io_port) << 8; | 58 | count |= inb(io_port) << 8; |
59 | 59 | ||
60 | return channel < 4 ? count : (count << 1); | 60 | return chan < 4 ? count : (count << 1); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void isa_enable_dma(dmach_t channel, dma_t *dma) | 63 | static void isa_enable_dma(unsigned int chan, dma_t *dma) |
64 | { | 64 | { |
65 | if (dma->invalid) { | 65 | if (dma->invalid) { |
66 | unsigned long address, length; | 66 | unsigned long address, length; |
67 | unsigned int mode; | 67 | unsigned int mode; |
68 | enum dma_data_direction direction; | 68 | enum dma_data_direction direction; |
69 | 69 | ||
70 | mode = channel & 3; | 70 | mode = chan & 3; |
71 | switch (dma->dma_mode & DMA_MODE_MASK) { | 71 | switch (dma->dma_mode & DMA_MODE_MASK) { |
72 | case DMA_MODE_READ: | 72 | case DMA_MODE_READ: |
73 | mode |= ISA_DMA_MODE_READ; | 73 | mode |= ISA_DMA_MODE_READ; |
@@ -105,34 +105,34 @@ static void isa_enable_dma(dmach_t channel, dma_t *dma) | |||
105 | address = dma->buf.dma_address; | 105 | address = dma->buf.dma_address; |
106 | length = dma->buf.length - 1; | 106 | length = dma->buf.length - 1; |
107 | 107 | ||
108 | outb(address >> 16, isa_dma_port[channel][ISA_DMA_PGLO]); | 108 | outb(address >> 16, isa_dma_port[chan][ISA_DMA_PGLO]); |
109 | outb(address >> 24, isa_dma_port[channel][ISA_DMA_PGHI]); | 109 | outb(address >> 24, isa_dma_port[chan][ISA_DMA_PGHI]); |
110 | 110 | ||
111 | if (channel >= 4) { | 111 | if (chan >= 4) { |
112 | address >>= 1; | 112 | address >>= 1; |
113 | length >>= 1; | 113 | length >>= 1; |
114 | } | 114 | } |
115 | 115 | ||
116 | outb(0, isa_dma_port[channel][ISA_DMA_CLRFF]); | 116 | outb(0, isa_dma_port[chan][ISA_DMA_CLRFF]); |
117 | 117 | ||
118 | outb(address, isa_dma_port[channel][ISA_DMA_ADDR]); | 118 | outb(address, isa_dma_port[chan][ISA_DMA_ADDR]); |
119 | outb(address >> 8, isa_dma_port[channel][ISA_DMA_ADDR]); | 119 | outb(address >> 8, isa_dma_port[chan][ISA_DMA_ADDR]); |
120 | 120 | ||
121 | outb(length, isa_dma_port[channel][ISA_DMA_COUNT]); | 121 | outb(length, isa_dma_port[chan][ISA_DMA_COUNT]); |
122 | outb(length >> 8, isa_dma_port[channel][ISA_DMA_COUNT]); | 122 | outb(length >> 8, isa_dma_port[chan][ISA_DMA_COUNT]); |
123 | 123 | ||
124 | if (dma->dma_mode & DMA_AUTOINIT) | 124 | if (dma->dma_mode & DMA_AUTOINIT) |
125 | mode |= ISA_DMA_AUTOINIT; | 125 | mode |= ISA_DMA_AUTOINIT; |
126 | 126 | ||
127 | outb(mode, isa_dma_port[channel][ISA_DMA_MODE]); | 127 | outb(mode, isa_dma_port[chan][ISA_DMA_MODE]); |
128 | dma->invalid = 0; | 128 | dma->invalid = 0; |
129 | } | 129 | } |
130 | outb(channel & 3, isa_dma_port[channel][ISA_DMA_MASK]); | 130 | outb(chan & 3, isa_dma_port[chan][ISA_DMA_MASK]); |
131 | } | 131 | } |
132 | 132 | ||
133 | static void isa_disable_dma(dmach_t channel, dma_t *dma) | 133 | static void isa_disable_dma(unsigned int chan, dma_t *dma) |
134 | { | 134 | { |
135 | outb(channel | 4, isa_dma_port[channel][ISA_DMA_MASK]); | 135 | outb(chan | 4, isa_dma_port[chan][ISA_DMA_MASK]); |
136 | } | 136 | } |
137 | 137 | ||
138 | static struct dma_ops isa_dma_ops = { | 138 | static struct dma_ops isa_dma_ops = { |
@@ -178,11 +178,11 @@ void __init isa_init_dma(dma_t *dma) | |||
178 | outb(0xaa, 0x00); | 178 | outb(0xaa, 0x00); |
179 | 179 | ||
180 | if (inb(0) == 0x55 && inb(0) == 0xaa) { | 180 | if (inb(0) == 0x55 && inb(0) == 0xaa) { |
181 | int channel, i; | 181 | int chan, i; |
182 | 182 | ||
183 | for (channel = 0; channel < 8; channel++) { | 183 | for (chan = 0; chan < 8; chan++) { |
184 | dma[channel].d_ops = &isa_dma_ops; | 184 | dma[chan].d_ops = &isa_dma_ops; |
185 | isa_disable_dma(channel, NULL); | 185 | isa_disable_dma(chan, NULL); |
186 | } | 186 | } |
187 | 187 | ||
188 | outb(0x40, 0x0b); | 188 | outb(0x40, 0x0b); |