diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-20 12:30:25 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-20 12:30:25 -0400 |
commit | 995a0605a6665858d73f9e80053414909be33f27 (patch) | |
tree | fcc66a6a77acdaae492f77c0c58c0233db74a2b4 /arch/openrisc/kernel/dma.c | |
parent | a32750c2ca6f697903b19063fc86f4272865e3a1 (diff) | |
parent | 677d3e2f07d1b3d6d2f76fd5552d16a53b9236a0 (diff) |
Merge branch 'at91/trng' into next/driver
Diffstat (limited to 'arch/openrisc/kernel/dma.c')
-rw-r--r-- | arch/openrisc/kernel/dma.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/openrisc/kernel/dma.c b/arch/openrisc/kernel/dma.c index 968d3ee477e3..f1c8ee2895d0 100644 --- a/arch/openrisc/kernel/dma.c +++ b/arch/openrisc/kernel/dma.c | |||
@@ -154,6 +154,33 @@ void or1k_unmap_page(struct device *dev, dma_addr_t dma_handle, | |||
154 | /* Nothing special to do here... */ | 154 | /* Nothing special to do here... */ |
155 | } | 155 | } |
156 | 156 | ||
157 | int or1k_map_sg(struct device *dev, struct scatterlist *sg, | ||
158 | int nents, enum dma_data_direction dir, | ||
159 | struct dma_attrs *attrs) | ||
160 | { | ||
161 | struct scatterlist *s; | ||
162 | int i; | ||
163 | |||
164 | for_each_sg(sg, s, nents, i) { | ||
165 | s->dma_address = or1k_map_page(dev, sg_page(s), s->offset, | ||
166 | s->length, dir, NULL); | ||
167 | } | ||
168 | |||
169 | return nents; | ||
170 | } | ||
171 | |||
172 | void or1k_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
173 | int nents, enum dma_data_direction dir, | ||
174 | struct dma_attrs *attrs) | ||
175 | { | ||
176 | struct scatterlist *s; | ||
177 | int i; | ||
178 | |||
179 | for_each_sg(sg, s, nents, i) { | ||
180 | or1k_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir, NULL); | ||
181 | } | ||
182 | } | ||
183 | |||
157 | void or1k_sync_single_for_cpu(struct device *dev, | 184 | void or1k_sync_single_for_cpu(struct device *dev, |
158 | dma_addr_t dma_handle, size_t size, | 185 | dma_addr_t dma_handle, size_t size, |
159 | enum dma_data_direction dir) | 186 | enum dma_data_direction dir) |
@@ -187,5 +214,4 @@ static int __init dma_init(void) | |||
187 | 214 | ||
188 | return 0; | 215 | return 0; |
189 | } | 216 | } |
190 | |||
191 | fs_initcall(dma_init); | 217 | fs_initcall(dma_init); |