Commit 0243c536 authored by Shimoda, Yoshihiro's avatar Shimoda, Yoshihiro Committed by Mark Brown

spi: spi-rspi: fix build error for the latest shdma driver

Because the latest shdma driver changed, it caused build error in
the spi-rspi driver. This patch fixed the build error.
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent ddffeb8c
...@@ -147,8 +147,6 @@ struct rspi_data { ...@@ -147,8 +147,6 @@ struct rspi_data {
unsigned char spsr; unsigned char spsr;
/* for dmaengine */ /* for dmaengine */
struct sh_dmae_slave dma_tx;
struct sh_dmae_slave dma_rx;
struct dma_chan *chan_tx; struct dma_chan *chan_tx;
struct dma_chan *chan_rx; struct dma_chan *chan_rx;
int irq; int irq;
...@@ -663,20 +661,16 @@ static irqreturn_t rspi_irq(int irq, void *_sr) ...@@ -663,20 +661,16 @@ static irqreturn_t rspi_irq(int irq, void *_sr)
return ret; return ret;
} }
static bool rspi_filter(struct dma_chan *chan, void *filter_param) static int __devinit rspi_request_dma(struct rspi_data *rspi,
{ struct platform_device *pdev)
chan->private = filter_param;
return true;
}
static void __devinit rspi_request_dma(struct rspi_data *rspi,
struct platform_device *pdev)
{ {
struct rspi_plat_data *rspi_pd = pdev->dev.platform_data; struct rspi_plat_data *rspi_pd = pdev->dev.platform_data;
dma_cap_mask_t mask; dma_cap_mask_t mask;
struct dma_slave_config cfg;
int ret;
if (!rspi_pd) if (!rspi_pd)
return; return 0; /* The driver assumes no error. */
rspi->dma_width_16bit = rspi_pd->dma_width_16bit; rspi->dma_width_16bit = rspi_pd->dma_width_16bit;
...@@ -684,21 +678,35 @@ static void __devinit rspi_request_dma(struct rspi_data *rspi, ...@@ -684,21 +678,35 @@ static void __devinit rspi_request_dma(struct rspi_data *rspi,
if (rspi_pd->dma_rx_id && rspi_pd->dma_tx_id) { if (rspi_pd->dma_rx_id && rspi_pd->dma_tx_id) {
dma_cap_zero(mask); dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
rspi->dma_rx.slave_id = rspi_pd->dma_rx_id; rspi->chan_rx = dma_request_channel(mask, shdma_chan_filter,
rspi->chan_rx = dma_request_channel(mask, rspi_filter, (void *)rspi_pd->dma_rx_id);
&rspi->dma_rx); if (rspi->chan_rx) {
if (rspi->chan_rx) cfg.slave_id = rspi_pd->dma_rx_id;
dev_info(&pdev->dev, "Use DMA when rx.\n"); cfg.direction = DMA_DEV_TO_MEM;
ret = dmaengine_slave_config(rspi->chan_rx, &cfg);
if (!ret)
dev_info(&pdev->dev, "Use DMA when rx.\n");
else
return ret;
}
} }
if (rspi_pd->dma_tx_id) { if (rspi_pd->dma_tx_id) {
dma_cap_zero(mask); dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
rspi->dma_tx.slave_id = rspi_pd->dma_tx_id; rspi->chan_tx = dma_request_channel(mask, shdma_chan_filter,
rspi->chan_tx = dma_request_channel(mask, rspi_filter, (void *)rspi_pd->dma_tx_id);
&rspi->dma_tx); if (rspi->chan_tx) {
if (rspi->chan_tx) cfg.slave_id = rspi_pd->dma_tx_id;
dev_info(&pdev->dev, "Use DMA when tx\n"); cfg.direction = DMA_MEM_TO_DEV;
ret = dmaengine_slave_config(rspi->chan_tx, &cfg);
if (!ret)
dev_info(&pdev->dev, "Use DMA when tx\n");
else
return ret;
}
} }
return 0;
} }
static void __devexit rspi_release_dma(struct rspi_data *rspi) static void __devexit rspi_release_dma(struct rspi_data *rspi)
...@@ -788,7 +796,11 @@ static int __devinit rspi_probe(struct platform_device *pdev) ...@@ -788,7 +796,11 @@ static int __devinit rspi_probe(struct platform_device *pdev)
} }
rspi->irq = irq; rspi->irq = irq;
rspi_request_dma(rspi, pdev); ret = rspi_request_dma(rspi, pdev);
if (ret < 0) {
dev_err(&pdev->dev, "rspi_request_dma failed.\n");
goto error4;
}
ret = spi_register_master(master); ret = spi_register_master(master);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment