spi: Compatibility with direction which is used in samsung DMA operation
Subsystems (3)
PATCH 1/1 spi: Compatibility with direction which is used in samsung DMA operation
I found that there are two kind of direction type.
First one is dma_data_direction defined in include/linux/dma-direction.h. It is used for parameter of dma_map/unmap_single in spi-s3c64xx. The other one is dma_transter_direction defined in include/linux/dmaengine.h. It is used for direction of samsung DMA operation (arch/arm/plat-samsung/dma-ops.c).
This patch is just some changes to use direction defines
which is used in samsung DMA operation.
--- drivers/spi/spi-s3c64xx.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/spi/spi-s3c64xx.c +5 -5
@@ -239,7 +239,7 @@ static void s3c64xx_spi_dmacb(void *data)struct s3c64xx_spi_dma_data *dma = data;unsigned long flags; -if (dma->direction ==DMA_FROM_DEVICE ) +if (dma->direction ==DMA_DEV_TO_MEM ) sdd =container_of (data, struct s3c64xx_spi_driver_data, rx_dma);else
@@ -248,7 +248,7 @@ static void s3c64xx_spi_dmacb(void *data)spin_lock_irqsave (&sdd->lock, flags); -if (dma->direction ==DMA_FROM_DEVICE ) { +if (dma->direction ==DMA_DEV_TO_MEM ) { sdd->state &= ~RXBUSY ;if (!(sdd->state &TXBUSY ))complete (&sdd->xfer_completion);
@@ -267,7 +267,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,struct s3c64xx_spi_driver_data *sdd;struct samsung_dma_prep_info info; -if (dma->direction ==DMA_FROM_DEVICE ) +if (dma->direction ==DMA_DEV_TO_MEM ) { sdd =container_of ((void *)dma, struct s3c64xx_spi_driver_data, rx_dma); else
@@ -1021,9 +1021,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) sdd->pdev = pdev; sdd->sfr_start = mem_res->start; sdd->tx_dma.dmach = dmatx_res->start; - sdd->tx_dma.direction =DMA_TO_DEVICE ; + sdd->tx_dma.direction =DMA_MEM_TO_DEV ; sdd->rx_dma.dmach = dmarx_res->start; - sdd->rx_dma.direction =DMA_FROM_DEVICE ; + sdd->rx_dma.direction =DMA_DEV_TO_MEM ; sdd->cur_bpw =8 ;
Signature · 1 line
1.7.1
Grant Likely
AppliedQuoted 11 lines · Kyoungil Kim
I found that there are two kind of direction type.
First one isdma_data_directiondefined ininclude/linux/dma-direction.h. It is used for parameter of dma_map/unmap_single in spi-s3c64xx. The other one isdma_transter_directiondefined ininclude/linux/dmaengine.h. It is used for direction of samsung DMA operation (arch/arm/plat-samsung/dma-ops.c).
This patch is just some changes to use direction defines
which is used in samsung DMA operation.Signed-off-by Boojin Kim <[email protected]>Signed-off-by Kyoungil Kim <[email protected]>
Applied, thanks.
g.
Quoted 50 lines
--- drivers/spi/spi-s3c64xx.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)drivers/spi/spi-s3c64xx.c +5
-5@@ -239,7 +239,7 @@ static void s3c64xx_spi_dmacb(void *data)struct s3c64xx_spi_dma_data *dma = data;unsigned long flags; -if (dma->direction ==DMA_FROM_DEVICE ) +if (dma->direction ==DMA_DEV_TO_MEM ) sdd =container_of (data, struct s3c64xx_spi_driver_data, rx_dma);else @@ -248,7 +248,7 @@ static void s3c64xx_spi_dmacb(void *data)spin_lock_irqsave (&sdd->lock, flags); -if (dma->direction ==DMA_FROM_DEVICE ) { +if (dma->direction ==DMA_DEV_TO_MEM ) { sdd->state &= ~RXBUSY ;if (!(sdd->state &TXBUSY ))complete (&sdd->xfer_completion);@@ -267,7 +267,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,struct s3c64xx_spi_driver_data *sdd;struct samsung_dma_prep_info info; -if (dma->direction ==DMA_FROM_DEVICE ) +if (dma->direction ==DMA_DEV_TO_MEM ) { sdd =container_of ((void *)dma, struct s3c64xx_spi_driver_data, rx_dma); else@@ -1021,9 +1021,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) sdd->pdev = pdev; sdd->sfr_start = mem_res->start; sdd->tx_dma.dmach = dmatx_res->start; - sdd->tx_dma.direction =DMA_TO_DEVICE ; + sdd->tx_dma.direction =DMA_MEM_TO_DEV ; sdd->rx_dma.dmach = dmarx_res->start; - sdd->rx_dma.direction =DMA_FROM_DEVICE ; + sdd->rx_dma.direction =DMA_DEV_TO_MEM ; sdd->cur_bpw =8 ;Signature · 1 line
1.7.1
Signature · 2 lines
Grant Likely, B.Sc, P.Eng. Secret Lab Technologies,Ltd.