diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-11 14:55:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-11 14:55:43 -0700 |
commit | 14f69ec706e596a2443fe6c296c522c33584a77e (patch) | |
tree | 1236041b4984d56609edbb6ad80199687df617d4 /arch/openrisc/kernel/dma.c | |
parent | d7a210f3d356371677cf553ce6241b620e389844 (diff) | |
parent | 707b38a00bd2e7cac60afc75abe826e68ca83cfb (diff) |
Merge branch 'for-linus' of git://openrisc.net/~jonas/linux
* 'for-linus' of git://openrisc.net/~jonas/linux:
Add missing DMA ops
openrisc: don't use pt_regs in struct sigcontext
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 968d3ee477e..f1c8ee2895d 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, /* Nothing special to do here... */ } +int or1k_map_sg(struct device *dev, struct scatterlist *sg, + int nents, enum dma_data_direction dir, + struct dma_attrs *attrs) +{ + struct scatterlist *s; + int i; + + for_each_sg(sg, s, nents, i) { + s->dma_address = or1k_map_page(dev, sg_page(s), s->offset, + s->length, dir, NULL); + } + + return nents; +} + +void or1k_unmap_sg(struct device *dev, struct scatterlist *sg, + int nents, enum dma_data_direction dir, + struct dma_attrs *attrs) +{ + struct scatterlist *s; + int i; + + for_each_sg(sg, s, nents, i) { + or1k_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir, NULL); + } +} + void or1k_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) @@ -187,5 +214,4 @@ static int __init dma_init(void) return 0; } - fs_initcall(dma_init); |