aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorKyoungil Kim <ki0351.kim@samsung.com>2012-03-09 19:48:46 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-03-09 23:09:10 -0500
commit054ebcc4a88509e2488f341e8f0400045258f2a1 (patch)
tree6f9a4dea88fde10687200df6452f83ead9d3bc6d /drivers/spi
parent0f57e168aa109775430c76cc663fb64909813d84 (diff)
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. Signed-off-by: Boojin Kim <boojin.kim@samsung.com> Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-s3c64xx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 1174d802ff4..c40d1184a99 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -236,7 +236,7 @@ static void s3c64xx_spi_dmacb(void *data)
236 struct s3c64xx_spi_dma_data *dma = data; 236 struct s3c64xx_spi_dma_data *dma = data;
237 unsigned long flags; 237 unsigned long flags;
238 238
239 if (dma->direction == DMA_FROM_DEVICE) 239 if (dma->direction == DMA_DEV_TO_MEM)
240 sdd = container_of(data, 240 sdd = container_of(data,
241 struct s3c64xx_spi_driver_data, rx_dma); 241 struct s3c64xx_spi_driver_data, rx_dma);
242 else 242 else
@@ -245,7 +245,7 @@ static void s3c64xx_spi_dmacb(void *data)
245 245
246 spin_lock_irqsave(&sdd->lock, flags); 246 spin_lock_irqsave(&sdd->lock, flags);
247 247
248 if (dma->direction == DMA_FROM_DEVICE) { 248 if (dma->direction == DMA_DEV_TO_MEM) {
249 sdd->state &= ~RXBUSY; 249 sdd->state &= ~RXBUSY;
250 if (!(sdd->state & TXBUSY)) 250 if (!(sdd->state & TXBUSY))
251 complete(&sdd->xfer_completion); 251 complete(&sdd->xfer_completion);
@@ -264,7 +264,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
264 struct s3c64xx_spi_driver_data *sdd; 264 struct s3c64xx_spi_driver_data *sdd;
265 struct samsung_dma_prep_info info; 265 struct samsung_dma_prep_info info;
266 266
267 if (dma->direction == DMA_FROM_DEVICE) 267 if (dma->direction == DMA_DEV_TO_MEM) {
268 sdd = container_of((void *)dma, 268 sdd = container_of((void *)dma,
269 struct s3c64xx_spi_driver_data, rx_dma); 269 struct s3c64xx_spi_driver_data, rx_dma);
270 else 270 else
@@ -1012,9 +1012,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
1012 sdd->pdev = pdev; 1012 sdd->pdev = pdev;
1013 sdd->sfr_start = mem_res->start; 1013 sdd->sfr_start = mem_res->start;
1014 sdd->tx_dma.dmach = dmatx_res->start; 1014 sdd->tx_dma.dmach = dmatx_res->start;
1015 sdd->tx_dma.direction = DMA_TO_DEVICE; 1015 sdd->tx_dma.direction = DMA_MEM_TO_DEV;
1016 sdd->rx_dma.dmach = dmarx_res->start; 1016 sdd->rx_dma.dmach = dmarx_res->start;
1017 sdd->rx_dma.direction = DMA_FROM_DEVICE; 1017 sdd->rx_dma.direction = DMA_DEV_TO_MEM;
1018 1018
1019 sdd->cur_bpw = 8; 1019 sdd->cur_bpw = 8;
1020 1020