From 0a5642be03293f73706961a7649ac1d12bd0be59 Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Sat, 11 Oct 2014 21:16:44 +0530 Subject: dmaengine: freescale: add and export fsl_dma_external_start() The freescale driver uses custom device control FSLDMA_EXTERNAL_START to put the controller in external start mode. Since we are planning to deprecate the device control, move this to exported API. Subsequent patches will remove the FSLDMA_EXTERNAL_START Signed-off-by: Vinod Koul --- drivers/dma/fsldma.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index d5d6885ab34..0cded86f946 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -36,7 +36,7 @@ #include #include #include - +#include #include "dmaengine.h" #include "fsldma.h" @@ -367,6 +367,20 @@ static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable) chan->feature &= ~FSL_DMA_CHAN_START_EXT; } +int fsl_dma_external_start(struct dma_chan *dchan, int enable) +{ + struct fsldma_chan *chan; + + if (!dchan) + return -EINVAL; + + chan = to_fsl_chan(dchan); + + fsl_chan_toggle_ext_start(chan, enable); + return 0; +} +EXPORT_SYMBOL_GPL(fsl_dma_external_start); + static void append_ld_queue(struct fsldma_chan *chan, struct fsl_desc_sw *desc) { struct fsl_desc_sw *tail = to_fsl_desc(chan->ld_pending.prev); -- cgit v1.2.3-70-g09d2 From 4fdcf68487e520844e077f75943b1e04cc05943b Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Sat, 11 Oct 2014 21:16:45 +0530 Subject: carma-fpga: use dmaengine_xxx() API The drivers should use dmaengine_slave_config() and dmaengine_prep_dma_sg() API instead of accessing the device_control which will be deprecated soon Signed-off-by: Vinod Koul --- drivers/misc/carma/carma-fpga-program.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c index 7be89832db1..fd0cb8b1eef 100644 --- a/drivers/misc/carma/carma-fpga-program.c +++ b/drivers/misc/carma/carma-fpga-program.c @@ -518,8 +518,7 @@ static noinline int fpga_program_dma(struct fpga_dev *priv) config.direction = DMA_MEM_TO_DEV; config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; config.dst_maxburst = fpga_fifo_size(priv->regs) / 2 / 4; - ret = chan->device->device_control(chan, DMA_SLAVE_CONFIG, - (unsigned long)&config); + ret = dmaengine_slave_config(chan, &config); if (ret) { dev_err(priv->dev, "DMA slave configuration failed\n"); goto out_dma_unmap; @@ -532,9 +531,9 @@ static noinline int fpga_program_dma(struct fpga_dev *priv) } /* setup and submit the DMA transaction */ - tx = chan->device->device_prep_dma_sg(chan, - table.sgl, num_pages, - vb->sglist, vb->sglen, 0); + + tx = dmaengine_prep_dma_sg(chan, table.sgl, num_pages, + vb->sglist, vb->sglen, 0); if (!tx) { dev_err(priv->dev, "Unable to prep DMA transaction\n"); ret = -ENOMEM; -- cgit v1.2.3-70-g09d2 From 7abfe6eca8f978f090b3c203cfb53d37a66ea9f2 Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Sat, 11 Oct 2014 21:16:46 +0530 Subject: carma-fpga: move to fsl_dma_external_start() carma-fpga driver uses device control with custom FSLDMA_EXTERNAL_START command. Since we wnat to deprecate the device control, move this driver to use new fsl_dma_external_start() API Signed-off-by: Vinod Koul --- drivers/misc/carma/carma-fpga-program.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c index fd0cb8b1eef..298f9127e69 100644 --- a/drivers/misc/carma/carma-fpga-program.c +++ b/drivers/misc/carma/carma-fpga-program.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -524,7 +525,7 @@ static noinline int fpga_program_dma(struct fpga_dev *priv) goto out_dma_unmap; } - ret = chan->device->device_control(chan, FSLDMA_EXTERNAL_START, 1); + ret = fsl_dma_external_start(chan, 1) if (ret) { dev_err(priv->dev, "DMA external control setup failed\n"); goto out_dma_unmap; -- cgit v1.2.3-70-g09d2 From 01c6ad660cb4a388d15d0e7ba9744c5ffc583a61 Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Sat, 11 Oct 2014 21:16:47 +0530 Subject: dmaengine: freescale: remove FSLDMA_EXTERNAL_START control method since users have been move to fsl_dma_external_start() API, so remove this now Signed-off-by: Vinod Koul --- drivers/dma/fsldma.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers') diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 0cded86f946..994bcb2c6b9 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -1012,15 +1012,6 @@ static int fsl_dma_device_control(struct dma_chan *dchan, chan->set_request_count(chan, size); return 0; - case FSLDMA_EXTERNAL_START: - - /* make sure the channel supports external start */ - if (!chan->toggle_ext_start) - return -ENXIO; - - chan->toggle_ext_start(chan, arg); - return 0; - default: return -ENXIO; } -- cgit v1.2.3-70-g09d2