aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@linux.intel.com>2011-11-17 04:24:38 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2011-11-17 04:24:57 -0500
commite0d23ef29ed637dc6bd739f590985746d9ad9caa (patch)
treec5b5856dc88582697997bb10ccacad6fc2535465 /drivers/spi
parentca7fe2db892dcf91b2c72ee352eda4ff867903a7 (diff)
parent55ba4e5ed4ac57b60fe56acfd324f6a87123cc34 (diff)
Merge branch 'dma_slave_direction' into next_test_dirn
resolved conflicts: drivers/media/video/mx3_camera.c
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-dw-mid.c8
-rw-r--r--drivers/spi/spi-ep93xx.c9
-rw-r--r--drivers/spi/spi-pl022.c8
-rw-r--r--drivers/spi/spi-topcliff-pch.c4
4 files changed, 16 insertions, 13 deletions
diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index e743a45ee92c..8418eb036651 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -131,7 +131,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
131 rxchan = dws->rxchan; 131 rxchan = dws->rxchan;
132 132
133 /* 2. Prepare the TX dma transfer */ 133 /* 2. Prepare the TX dma transfer */
134 txconf.direction = DMA_TO_DEVICE; 134 txconf.direction = DMA_MEM_TO_DEV;
135 txconf.dst_addr = dws->dma_addr; 135 txconf.dst_addr = dws->dma_addr;
136 txconf.dst_maxburst = LNW_DMA_MSIZE_16; 136 txconf.dst_maxburst = LNW_DMA_MSIZE_16;
137 txconf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 137 txconf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -147,13 +147,13 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
147 txdesc = txchan->device->device_prep_slave_sg(txchan, 147 txdesc = txchan->device->device_prep_slave_sg(txchan,
148 &dws->tx_sgl, 148 &dws->tx_sgl,
149 1, 149 1,
150 DMA_TO_DEVICE, 150 DMA_MEM_TO_DEV,
151 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP); 151 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
152 txdesc->callback = dw_spi_dma_done; 152 txdesc->callback = dw_spi_dma_done;
153 txdesc->callback_param = dws; 153 txdesc->callback_param = dws;
154 154
155 /* 3. Prepare the RX dma transfer */ 155 /* 3. Prepare the RX dma transfer */
156 rxconf.direction = DMA_FROM_DEVICE; 156 rxconf.direction = DMA_DEV_TO_MEM;
157 rxconf.src_addr = dws->dma_addr; 157 rxconf.src_addr = dws->dma_addr;
158 rxconf.src_maxburst = LNW_DMA_MSIZE_16; 158 rxconf.src_maxburst = LNW_DMA_MSIZE_16;
159 rxconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 159 rxconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -169,7 +169,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
169 rxdesc = rxchan->device->device_prep_slave_sg(rxchan, 169 rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
170 &dws->rx_sgl, 170 &dws->rx_sgl,
171 1, 171 1,
172 DMA_FROM_DEVICE, 172 DMA_DEV_TO_MEM,
173 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP); 173 DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
174 rxdesc->callback = dw_spi_dma_done; 174 rxdesc->callback = dw_spi_dma_done;
175 rxdesc->callback_param = dws; 175 rxdesc->callback_param = dws;
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index 0a282e5fcc9c..d46e55c720b7 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -551,6 +551,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
551 struct dma_async_tx_descriptor *txd; 551 struct dma_async_tx_descriptor *txd;
552 enum dma_slave_buswidth buswidth; 552 enum dma_slave_buswidth buswidth;
553 struct dma_slave_config conf; 553 struct dma_slave_config conf;
554 enum dma_transfer_direction slave_dirn;
554 struct scatterlist *sg; 555 struct scatterlist *sg;
555 struct sg_table *sgt; 556 struct sg_table *sgt;
556 struct dma_chan *chan; 557 struct dma_chan *chan;
@@ -573,6 +574,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
573 574
574 conf.src_addr = espi->sspdr_phys; 575 conf.src_addr = espi->sspdr_phys;
575 conf.src_addr_width = buswidth; 576 conf.src_addr_width = buswidth;
577 slave_dirn = DMA_DEV_TO_MEM;
576 } else { 578 } else {
577 chan = espi->dma_tx; 579 chan = espi->dma_tx;
578 buf = t->tx_buf; 580 buf = t->tx_buf;
@@ -580,6 +582,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
580 582
581 conf.dst_addr = espi->sspdr_phys; 583 conf.dst_addr = espi->sspdr_phys;
582 conf.dst_addr_width = buswidth; 584 conf.dst_addr_width = buswidth;
585 slave_dirn = DMA_MEM_TO_DEV;
583 } 586 }
584 587
585 ret = dmaengine_slave_config(chan, &conf); 588 ret = dmaengine_slave_config(chan, &conf);
@@ -631,7 +634,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
631 return ERR_PTR(-ENOMEM); 634 return ERR_PTR(-ENOMEM);
632 635
633 txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents, 636 txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents,
634 dir, DMA_CTRL_ACK); 637 slave_dirn, DMA_CTRL_ACK);
635 if (!txd) { 638 if (!txd) {
636 dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); 639 dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
637 return ERR_PTR(-ENOMEM); 640 return ERR_PTR(-ENOMEM);
@@ -979,7 +982,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
979 dma_cap_set(DMA_SLAVE, mask); 982 dma_cap_set(DMA_SLAVE, mask);
980 983
981 espi->dma_rx_data.port = EP93XX_DMA_SSP; 984 espi->dma_rx_data.port = EP93XX_DMA_SSP;
982 espi->dma_rx_data.direction = DMA_FROM_DEVICE; 985 espi->dma_rx_data.direction = DMA_DEV_TO_MEM;
983 espi->dma_rx_data.name = "ep93xx-spi-rx"; 986 espi->dma_rx_data.name = "ep93xx-spi-rx";
984 987
985 espi->dma_rx = dma_request_channel(mask, ep93xx_spi_dma_filter, 988 espi->dma_rx = dma_request_channel(mask, ep93xx_spi_dma_filter,
@@ -990,7 +993,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
990 } 993 }
991 994
992 espi->dma_tx_data.port = EP93XX_DMA_SSP; 995 espi->dma_tx_data.port = EP93XX_DMA_SSP;
993 espi->dma_tx_data.direction = DMA_TO_DEVICE; 996 espi->dma_tx_data.direction = DMA_MEM_TO_DEV;
994 espi->dma_tx_data.name = "ep93xx-spi-tx"; 997 espi->dma_tx_data.name = "ep93xx-spi-tx";
995 998
996 espi->dma_tx = dma_request_channel(mask, ep93xx_spi_dma_filter, 999 espi->dma_tx = dma_request_channel(mask, ep93xx_spi_dma_filter,
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index f103e470cb63..95400fa99d90 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -904,11 +904,11 @@ static int configure_dma(struct pl022 *pl022)
904{ 904{
905 struct dma_slave_config rx_conf = { 905 struct dma_slave_config rx_conf = {
906 .src_addr = SSP_DR(pl022->phybase), 906 .src_addr = SSP_DR(pl022->phybase),
907 .direction = DMA_FROM_DEVICE, 907 .direction = DMA_DEV_TO_MEM,
908 }; 908 };
909 struct dma_slave_config tx_conf = { 909 struct dma_slave_config tx_conf = {
910 .dst_addr = SSP_DR(pl022->phybase), 910 .dst_addr = SSP_DR(pl022->phybase),
911 .direction = DMA_TO_DEVICE, 911 .direction = DMA_MEM_TO_DEV,
912 }; 912 };
913 unsigned int pages; 913 unsigned int pages;
914 int ret; 914 int ret;
@@ -1045,7 +1045,7 @@ static int configure_dma(struct pl022 *pl022)
1045 rxdesc = rxchan->device->device_prep_slave_sg(rxchan, 1045 rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
1046 pl022->sgt_rx.sgl, 1046 pl022->sgt_rx.sgl,
1047 rx_sglen, 1047 rx_sglen,
1048 DMA_FROM_DEVICE, 1048 DMA_DEV_TO_MEM,
1049 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 1049 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1050 if (!rxdesc) 1050 if (!rxdesc)
1051 goto err_rxdesc; 1051 goto err_rxdesc;
@@ -1053,7 +1053,7 @@ static int configure_dma(struct pl022 *pl022)
1053 txdesc = txchan->device->device_prep_slave_sg(txchan, 1053 txdesc = txchan->device->device_prep_slave_sg(txchan,
1054 pl022->sgt_tx.sgl, 1054 pl022->sgt_tx.sgl,
1055 tx_sglen, 1055 tx_sglen,
1056 DMA_TO_DEVICE, 1056 DMA_MEM_TO_DEV,
1057 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 1057 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1058 if (!txdesc) 1058 if (!txdesc)
1059 goto err_txdesc; 1059 goto err_txdesc;
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 6a80749391db..99ec279bc46d 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1076,7 +1076,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
1076 } 1076 }
1077 sg = dma->sg_rx_p; 1077 sg = dma->sg_rx_p;
1078 desc_rx = dma->chan_rx->device->device_prep_slave_sg(dma->chan_rx, sg, 1078 desc_rx = dma->chan_rx->device->device_prep_slave_sg(dma->chan_rx, sg,
1079 num, DMA_FROM_DEVICE, 1079 num, DMA_DEV_TO_MEM,
1080 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 1080 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1081 if (!desc_rx) { 1081 if (!desc_rx) {
1082 dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n", 1082 dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n",
@@ -1121,7 +1121,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
1121 } 1121 }
1122 sg = dma->sg_tx_p; 1122 sg = dma->sg_tx_p;
1123 desc_tx = dma->chan_tx->device->device_prep_slave_sg(dma->chan_tx, 1123 desc_tx = dma->chan_tx->device->device_prep_slave_sg(dma->chan_tx,
1124 sg, num, DMA_TO_DEVICE, 1124 sg, num, DMA_MEM_TO_DEV,
1125 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 1125 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1126 if (!desc_tx) { 1126 if (!desc_tx) {
1127 dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n", 1127 dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n",