diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-04 10:08:30 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-04 10:08:30 -0500 |
commit | 7cdad482974792419cfe4b0affca689170116f49 (patch) | |
tree | f9ee204f8848274ffb3323f425ad039cf4807de6 /arch/arm/kernel/dma-isa.c | |
parent | 333c9624b728a9e83b741ea75836aa114ec35272 (diff) |
[ARM] Remove '__address' from scatterlist and convert to DMA API
The old __address element in struct scatterlist remained from older
kernels because the ARM DMA emulation code made use of it. Move
this field into struct dma_struct, and convert DMA emulation code
to setup a SG entry as required.
Also, convert DMA emulation code to use the new DMA API rather
than the PCI DMA API.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/dma-isa.c')
-rw-r--r-- | arch/arm/kernel/dma-isa.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c index e9a36304ec3e..03532769a97f 100644 --- a/arch/arm/kernel/dma-isa.c +++ b/arch/arm/kernel/dma-isa.c | |||
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/pci.h> | 21 | #include <linux/dma-mapping.h> |
22 | 22 | ||
23 | #include <asm/dma.h> | 23 | #include <asm/dma.h> |
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
@@ -65,37 +65,41 @@ static void isa_enable_dma(dmach_t channel, dma_t *dma) | |||
65 | { | 65 | { |
66 | if (dma->invalid) { | 66 | if (dma->invalid) { |
67 | unsigned long address, length; | 67 | unsigned long address, length; |
68 | unsigned int mode, direction; | 68 | unsigned int mode; |
69 | enum dma_data_direction direction; | ||
69 | 70 | ||
70 | mode = channel & 3; | 71 | mode = channel & 3; |
71 | switch (dma->dma_mode & DMA_MODE_MASK) { | 72 | switch (dma->dma_mode & DMA_MODE_MASK) { |
72 | case DMA_MODE_READ: | 73 | case DMA_MODE_READ: |
73 | mode |= ISA_DMA_MODE_READ; | 74 | mode |= ISA_DMA_MODE_READ; |
74 | direction = PCI_DMA_FROMDEVICE; | 75 | direction = DMA_FROM_DEVICE; |
75 | break; | 76 | break; |
76 | 77 | ||
77 | case DMA_MODE_WRITE: | 78 | case DMA_MODE_WRITE: |
78 | mode |= ISA_DMA_MODE_WRITE; | 79 | mode |= ISA_DMA_MODE_WRITE; |
79 | direction = PCI_DMA_TODEVICE; | 80 | direction = DMA_TO_DEVICE; |
80 | break; | 81 | break; |
81 | 82 | ||
82 | case DMA_MODE_CASCADE: | 83 | case DMA_MODE_CASCADE: |
83 | mode |= ISA_DMA_MODE_CASCADE; | 84 | mode |= ISA_DMA_MODE_CASCADE; |
84 | direction = PCI_DMA_BIDIRECTIONAL; | 85 | direction = DMA_BIDIRECTIONAL; |
85 | break; | 86 | break; |
86 | 87 | ||
87 | default: | 88 | default: |
88 | direction = PCI_DMA_NONE; | 89 | direction = DMA_NONE; |
89 | break; | 90 | break; |
90 | } | 91 | } |
91 | 92 | ||
92 | if (!dma->using_sg) { | 93 | if (!dma->sg) { |
93 | /* | 94 | /* |
94 | * Cope with ISA-style drivers which expect cache | 95 | * Cope with ISA-style drivers which expect cache |
95 | * coherence. | 96 | * coherence. |
96 | */ | 97 | */ |
97 | dma->buf.dma_address = pci_map_single(NULL, | 98 | dma->sg = &dma->buf; |
98 | dma->buf.__address, dma->buf.length, | 99 | dma->sgcount = 1; |
100 | dma->buf.length = dma->count; | ||
101 | dma->buf.dma_address = dma_map_single(NULL, | ||
102 | dma->addr, dma->count, | ||
99 | direction); | 103 | direction); |
100 | } | 104 | } |
101 | 105 | ||