diff options
author | Vinod Koul <vinod.koul@intel.com> | 2014-10-15 21:39:09 +0530 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-10-15 21:39:09 +0530 |
commit | cf6c0ab54daeb614ae79bdd0168e8b7ec2650134 (patch) | |
tree | a5dbdf23ae9184edce0cab7944df9798da309a1d /drivers | |
parent | 2856fcdc1f7b6dc237afc2dbec6fbd21fe88dd4e (diff) | |
parent | b80719b6bd083130c112cb4d3e5329a164eef4c3 (diff) |
Merge branch 'topic/dma_control_fsl_acks' into for-linus
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/fsldma.c | 25 | ||||
-rw-r--r-- | drivers/misc/carma/carma-fpga-program.c | 12 |
2 files changed, 21 insertions, 16 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index d5d6885ab34..994bcb2c6b9 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -36,7 +36,7 @@ #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> - +#include <linux/fsldma.h> #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); @@ -998,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; } diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c index 7be89832db1..298f9127e69 100644 --- a/drivers/misc/carma/carma-fpga-program.c +++ b/drivers/misc/carma/carma-fpga-program.c @@ -16,6 +16,7 @@ #include <linux/completion.h> #include <linux/miscdevice.h> #include <linux/dmaengine.h> +#include <linux/fsldma.h> #include <linux/interrupt.h> #include <linux/highmem.h> #include <linux/kernel.h> @@ -518,23 +519,22 @@ 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; } - 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; } /* 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; |