* [PATCH] spi: spi-rspi: fix build error for the latest shdma driver
@ 2012-08-02 8:17 Shimoda, Yoshihiro
2012-08-27 8:28 ` Simon Horman
2012-10-05 11:43 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Shimoda, Yoshihiro @ 2012-08-02 8:17 UTC (permalink / raw)
To: Grant Likely; +Cc: spi-devel-general, SH-Linux
Because the latest shdma driver changed, it caused build error in
the spi-rspi driver. This patch fixed the build error.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
drivers/spi/spi-rspi.c | 56 +++++++++++++++++++++++++++++------------------
1 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 4894bde..30faf6d 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -147,8 +147,6 @@ struct rspi_data {
unsigned char spsr;
/* for dmaengine */
- struct sh_dmae_slave dma_tx;
- struct sh_dmae_slave dma_rx;
struct dma_chan *chan_tx;
struct dma_chan *chan_rx;
int irq;
@@ -663,20 +661,16 @@ static irqreturn_t rspi_irq(int irq, void *_sr)
return ret;
}
-static bool rspi_filter(struct dma_chan *chan, void *filter_param)
-{
- chan->private = filter_param;
- return true;
-}
-
-static void __devinit rspi_request_dma(struct rspi_data *rspi,
- struct platform_device *pdev)
+static int __devinit rspi_request_dma(struct rspi_data *rspi,
+ struct platform_device *pdev)
{
struct rspi_plat_data *rspi_pd = pdev->dev.platform_data;
dma_cap_mask_t mask;
+ struct dma_slave_config cfg;
+ int ret;
if (!rspi_pd)
- return;
+ return 0; /* The driver assumes no error. */
rspi->dma_width_16bit = rspi_pd->dma_width_16bit;
@@ -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) {
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
- rspi->dma_rx.slave_id = rspi_pd->dma_rx_id;
- rspi->chan_rx = dma_request_channel(mask, rspi_filter,
- &rspi->dma_rx);
- if (rspi->chan_rx)
- dev_info(&pdev->dev, "Use DMA when rx.\n");
+ rspi->chan_rx = dma_request_channel(mask, shdma_chan_filter,
+ (void *)rspi_pd->dma_rx_id);
+ if (rspi->chan_rx) {
+ cfg.slave_id = rspi_pd->dma_rx_id;
+ 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) {
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
- rspi->dma_tx.slave_id = rspi_pd->dma_tx_id;
- rspi->chan_tx = dma_request_channel(mask, rspi_filter,
- &rspi->dma_tx);
- if (rspi->chan_tx)
- dev_info(&pdev->dev, "Use DMA when tx\n");
+ rspi->chan_tx = dma_request_channel(mask, shdma_chan_filter,
+ (void *)rspi_pd->dma_tx_id);
+ if (rspi->chan_tx) {
+ cfg.slave_id = rspi_pd->dma_tx_id;
+ 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)
@@ -788,7 +796,11 @@ static int __devinit rspi_probe(struct platform_device *pdev)
}
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);
if (ret < 0) {
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: spi-rspi: fix build error for the latest shdma driver
2012-08-02 8:17 [PATCH] spi: spi-rspi: fix build error for the latest shdma driver Shimoda, Yoshihiro
@ 2012-08-27 8:28 ` Simon Horman
[not found] ` <20120827082801.GB29274-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2012-10-05 11:43 ` Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Simon Horman @ 2012-08-27 8:28 UTC (permalink / raw)
To: Shimoda, Yoshihiro; +Cc: Grant Likely, spi-devel-general, SH-Linux
On Thu, Aug 02, 2012 at 05:17:33PM +0900, Shimoda, Yoshihiro wrote:
> Because the latest shdma driver changed, it caused build error in
> the spi-rspi driver. This patch fixed the build error.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Hi Shimoda-san,
could you let me know what the merge-status of this patch is?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: spi-rspi: fix build error for the latest shdma driver
[not found] ` <20120827082801.GB29274-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
@ 2012-08-27 8:56 ` Shimoda, Yoshihiro
0 siblings, 0 replies; 4+ messages in thread
From: Shimoda, Yoshihiro @ 2012-08-27 8:56 UTC (permalink / raw)
To: Simon Horman; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, SH-Linux
2012/08/27 17:28, Simon Horman wrote:
>
> could you let me know what the merge-status of this patch is?
>
Hi Simon-san,
The patch needs Grant's review. So, the patch is not merged to
his repository yet.
Best regards,
Yoshihiro Shimoda
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: spi-rspi: fix build error for the latest shdma driver
2012-08-02 8:17 [PATCH] spi: spi-rspi: fix build error for the latest shdma driver Shimoda, Yoshihiro
2012-08-27 8:28 ` Simon Horman
@ 2012-10-05 11:43 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-10-05 11:43 UTC (permalink / raw)
To: Shimoda, Yoshihiro; +Cc: Grant Likely, spi-devel-general, SH-Linux
On Thu, Aug 02, 2012 at 05:17:33PM +0900, Shimoda, Yoshihiro wrote:
> Because the latest shdma driver changed, it caused build error in
> the spi-rspi driver. This patch fixed the build error.
Applied, thanks. This should really have been done as part of the shdma
update...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-05 11:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 8:17 [PATCH] spi: spi-rspi: fix build error for the latest shdma driver Shimoda, Yoshihiro
2012-08-27 8:28 ` Simon Horman
[not found] ` <20120827082801.GB29274-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2012-08-27 8:56 ` Shimoda, Yoshihiro
2012-10-05 11:43 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).