dw_dmac: return proper residue value
[deliverable/linux.git] / drivers / dma / dw_dmac_regs.h
index 88965597b7d08c9e2b9987957f85284cc9851f4c..88dd8eb31957771e26f67a099cd0d7a48fd2d8aa 100644 (file)
@@ -9,6 +9,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/dmaengine.h>
 #include <linux/dw_dmac.h>
 
 #define DW_DMA_MAX_NR_CHANNELS 8
@@ -184,15 +185,15 @@ enum dw_dmac_flags {
 };
 
 struct dw_dma_chan {
-       struct dma_chan         chan;
-       void __iomem            *ch_regs;
-       u8                      mask;
-       u8                      priority;
-       bool                    paused;
-       bool                    initialized;
+       struct dma_chan                 chan;
+       void __iomem                    *ch_regs;
+       u8                              mask;
+       u8                              priority;
+       enum dma_transfer_direction     direction;
+       bool                            paused;
+       bool                            initialized;
 
        /* software emulation of the LLP transfers */
-       struct list_head        *tx_list;
        struct list_head        *tx_node_active;
 
        spinlock_t              lock;
@@ -202,6 +203,7 @@ struct dw_dma_chan {
        struct list_head        active_list;
        struct list_head        queue;
        struct list_head        free_list;
+       u32                     residue;
        struct dw_cyclic_desc   *cdesc;
 
        unsigned int            descs_allocated;
@@ -212,9 +214,6 @@ struct dw_dma_chan {
 
        /* configuration passed via DMA_SLAVE_CONFIG */
        struct dma_slave_config dma_sconfig;
-
-       /* backlink to dw_dma */
-       struct dw_dma           *dw;
 };
 
 static inline struct dw_dma_chan_regs __iomem *
@@ -236,9 +235,14 @@ static inline struct dw_dma_chan *to_dw_dma_chan(struct dma_chan *chan)
 struct dw_dma {
        struct dma_device       dma;
        void __iomem            *regs;
+       struct dma_pool         *desc_pool;
        struct tasklet_struct   tasklet;
        struct clk              *clk;
 
+       /* slave information */
+       struct dw_dma_slave     *sd;
+       unsigned int            sd_count;
+
        u8                      all_chan_mask;
 
        /* hardware configuration */
@@ -293,8 +297,11 @@ struct dw_desc {
        struct list_head                tx_list;
        struct dma_async_tx_descriptor  txd;
        size_t                          len;
+       size_t                          total_len;
 };
 
+#define to_dw_desc(h)  list_entry(h, struct dw_desc, desc_node)
+
 static inline struct dw_desc *
 txd_to_dw_desc(struct dma_async_tx_descriptor *txd)
 {
This page took 0.042668 seconds and 5 git commands to generate.