Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313214
b: refs/heads/master
c: 4969c32
h: refs/heads/master
v: v3
  • Loading branch information
Boojin Kim authored and Kukjin Kim committed Jun 19, 2012
1 parent dea83cf commit 8877d42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fbb20e81bd26e41667d8d0929fd08ed60b24d9ec
refs/heads/master: 4969c32bab70d71e07b0a76e1699782857d5aa22
33 changes: 19 additions & 14 deletions trunk/drivers/spi/spi-s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,24 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
unsigned len, dma_addr_t buf)
{
struct s3c64xx_spi_driver_data *sdd;
struct samsung_dma_prep_info info;
struct samsung_dma_prep info;
struct samsung_dma_config config;

if (dma->direction == DMA_DEV_TO_MEM)
if (dma->direction == DMA_DEV_TO_MEM) {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, rx_dma);
else
config.direction = sdd->rx_dma.direction;
config.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
config.width = sdd->cur_bpw / 8;
sdd->ops->config(sdd->rx_dma.ch, &config);
} else {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, tx_dma);
config.direction = sdd->tx_dma.direction;
config.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
config.width = sdd->cur_bpw / 8;
sdd->ops->config(sdd->tx_dma.ch, &config);
}

info.cap = DMA_SLAVE;
info.len = len;
Expand All @@ -284,20 +294,15 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,

static int acquire_dma(struct s3c64xx_spi_driver_data *sdd)
{
struct samsung_dma_info info;
struct samsung_dma_req req;

sdd->ops = samsung_dma_get_ops();

info.cap = DMA_SLAVE;
info.client = &s3c64xx_spi_dma_client;
info.width = sdd->cur_bpw / 8;

info.direction = sdd->rx_dma.direction;
info.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
sdd->rx_dma.ch = sdd->ops->request(sdd->rx_dma.dmach, &info);
info.direction = sdd->tx_dma.direction;
info.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
sdd->tx_dma.ch = sdd->ops->request(sdd->tx_dma.dmach, &info);
req.cap = DMA_SLAVE;
req.client = &s3c64xx_spi_dma_client;

sdd->rx_dma.ch = sdd->ops->request(sdd->rx_dma.dmach, &req);
sdd->tx_dma.ch = sdd->ops->request(sdd->tx_dma.dmach, &req);

return 1;
}
Expand Down

0 comments on commit 8877d42

Please sign in to comment.