spi: add CONFIG_NEED_SG_DMA_LENGTH for dma_length
authorHuibin Hong <huibin.hong@rock-chips.com>
Thu, 19 Mar 2015 09:53:14 +0000 (17:53 +0800)
committerHuibin Hong <huibin.hong@rock-chips.com>
Thu, 19 Mar 2015 09:53:14 +0000 (17:53 +0800)
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
drivers/spi/spi-rockchip-dma.c

index 7c224da9c1295225ba3c2c4ece8a407f14569211..6952201406cdd2d8cef84ccd316bcc2003d45099 100755 (executable)
@@ -265,8 +265,11 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
                
                memset(&dws->tx_sgl, 0, sizeof(dws->tx_sgl));
                dws->tx_sgl.dma_address = dws->tx_dma;
+#ifdef CONFIG_NEED_SG_DMA_LENGTH
+               dws->tx_sgl.dma_length = dws->len;
+#else
                dws->tx_sgl.length = dws->len;
-
+#endif
                txdesc = dmaengine_prep_slave_sg(txchan,
                                        &dws->tx_sgl,
                                        1,
@@ -298,7 +301,11 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
 
                memset(&dws->rx_sgl, 0, sizeof(dws->rx_sgl));
                dws->rx_sgl.dma_address = dws->rx_dma;
-               dws->rx_sgl.length = dws->len;                          
+#ifdef CONFIG_NEED_SG_DMA_LENGTH
+               dws->rx_sgl.dma_length = dws->len;                              
+#else
+               dws->rx_sgl.length = dws->len;
+#endif
 
                rxdesc = dmaengine_prep_slave_sg(rxchan,
                                        &dws->rx_sgl,