summaryrefslogtreecommitdiffstats
path: root/drivers/dma/mv_xor.h
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-15 15:17:05 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-20 15:58:59 +0100
commit1ef48a262b0d50add7d293a37b8c8bad4bec30a1 (patch)
tree651c17044708d7e3ef91987dec72010241a797c9 /drivers/dma/mv_xor.h
parent275cc0c8bd3c0a6b826d46a4d1a8135897387ca9 (diff)
downloadlinux-1ef48a262b0d50add7d293a37b8c8bad4bec30a1.tar.bz2
dma: mv_xor: merge mv_xor_device and mv_xor_chan
Even though the DMA engine infrastructure has support for multiple channels per device, the mv_xor driver registers one DMA engine device for each channel, because the mv_xor channels inside the same XOR engine have different capabilities, and the DMA engine infrastructure only allows to express capabilities at the DMA engine device level. The mv_xor driver has therefore been registering one DMA engine device and one DMA engine channel for each XOR channel since its introduction in the kernel. However, it kept two separate internal structures, mv_xor_device and mv_xor_channel, which didn't make a lot of sense since there was a 1:1 mapping between those structures. This patch gets rid of this duplication, and merges everything into the mv_xor_chan structure. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/dma/mv_xor.h')
-rw-r--r--drivers/dma/mv_xor.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h
index 84255e699830..16de1f62c950 100644
--- a/drivers/dma/mv_xor.h
+++ b/drivers/dma/mv_xor.h
@@ -57,24 +57,7 @@ struct mv_xor_private {
void __iomem *xor_base;
void __iomem *xor_high_base;
struct clk *clk;
- struct mv_xor_device *channels[MV_XOR_MAX_CHANNELS];
-};
-
-
-/**
- * struct mv_xor_device - internal representation of a XOR device
- * @pdev: Platform device
- * @id: HW XOR Device selector
- * @dma_desc_pool: base of DMA descriptor region (DMA address)
- * @dma_desc_pool_virt: base of DMA descriptor region (CPU address)
- * @common: embedded struct dma_device
- */
-struct mv_xor_device {
- dma_addr_t dma_desc_pool;
- void *dma_desc_pool_virt;
- size_t pool_size;
- struct dma_device dmadev;
- struct mv_xor_private *shared;
+ struct mv_xor_chan *channels[MV_XOR_MAX_CHANNELS];
};
/**
@@ -100,7 +83,11 @@ struct mv_xor_chan {
enum dma_transaction_type current_type;
struct list_head chain;
struct list_head completed_slots;
- struct mv_xor_device *device;
+ dma_addr_t dma_desc_pool;
+ void *dma_desc_pool_virt;
+ size_t pool_size;
+ struct dma_device dmadev;
+ struct mv_xor_private *shared;
struct dma_chan dmachan;
struct mv_xor_desc_slot *last_used;
struct list_head all_slots;