aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-s3c64xx.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 972a94c58be3..3c36cfaa1b93 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -262,14 +262,24 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
262 unsigned len, dma_addr_t buf) 262 unsigned len, dma_addr_t buf)
263{ 263{
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;
266 struct samsung_dma_config config;
266 267
267 if (dma->direction == DMA_DEV_TO_MEM) 268 if (dma->direction == DMA_DEV_TO_MEM) {
268 sdd = container_of((void *)dma, 269 sdd = container_of((void *)dma,
269 struct s3c64xx_spi_driver_data, rx_dma); 270 struct s3c64xx_spi_driver_data, rx_dma);
270 else 271 config.direction = sdd->rx_dma.direction;
272 config.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
273 config.width = sdd->cur_bpw / 8;
274 sdd->ops->config(sdd->rx_dma.ch, &config);
275 } else {
271 sdd = container_of((void *)dma, 276 sdd = container_of((void *)dma,
272 struct s3c64xx_spi_driver_data, tx_dma); 277 struct s3c64xx_spi_driver_data, tx_dma);
278 config.direction = sdd->tx_dma.direction;
279 config.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
280 config.width = sdd->cur_bpw / 8;
281 sdd->ops->config(sdd->tx_dma.ch, &config);
282 }
273 283
274 info.cap = DMA_SLAVE; 284 info.cap = DMA_SLAVE;
275 info.len = len; 285 info.len = len;
@@ -284,20 +294,15 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
284 294
285static int acquire_dma(struct s3c64xx_spi_driver_data *sdd) 295static int acquire_dma(struct s3c64xx_spi_driver_data *sdd)
286{ 296{
287 struct samsung_dma_info info; 297 struct samsung_dma_req req;
288 298
289 sdd->ops = samsung_dma_get_ops(); 299 sdd->ops = samsung_dma_get_ops();
290 300
291 info.cap = DMA_SLAVE; 301 req.cap = DMA_SLAVE;
292 info.client = &s3c64xx_spi_dma_client; 302 req.client = &s3c64xx_spi_dma_client;
293 info.width = sdd->cur_bpw / 8; 303
294 304 sdd->rx_dma.ch = sdd->ops->request(sdd->rx_dma.dmach, &req);
295 info.direction = sdd->rx_dma.direction; 305 sdd->tx_dma.ch = sdd->ops->request(sdd->tx_dma.dmach, &req);
296 info.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
297 sdd->rx_dma.ch = sdd->ops->request(sdd->rx_dma.dmach, &info);
298 info.direction = sdd->tx_dma.direction;
299 info.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
300 sdd->tx_dma.ch = sdd->ops->request(sdd->tx_dma.dmach, &info);
301 306
302 return 1; 307 return 1;
303} 308}