diff options
| author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-09-14 08:05:47 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:12:45 -0400 |
| commit | ec8b5e48c03790a68cb875fe5064007a9cbdfdd0 (patch) | |
| tree | 18c572345b2c54d3d50f234e0e913d9f227363ba | |
| parent | 2dcdf570936168d488acf90be9b04a3d32dafce7 (diff) | |
dmaengine: Pass flags via device_prep_dma_cyclic() callback
Change the parameter list of device_prep_dma_cyclic() so the DMA drivers
can receive the flags coming from clients.
This feature can be used during audio operation to disable all audio
related interrupts when the DMA_PREP_INTERRUPT is cleared from the flags.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| -rw-r--r-- | drivers/dma/at_hdmac.c | 3 | ||||
| -rw-r--r-- | drivers/dma/ep93xx_dma.c | 4 | ||||
| -rw-r--r-- | drivers/dma/imx-dma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/imx-sdma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/mmp_tdma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/mxs-dma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/omap-dma.c | 3 | ||||
| -rw-r--r-- | drivers/dma/pl330.c | 2 | ||||
| -rw-r--r-- | drivers/dma/sa11x0-dma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/sirf-dma.c | 2 | ||||
| -rw-r--r-- | drivers/dma/ste_dma40.c | 3 | ||||
| -rw-r--r-- | drivers/dma/tegra20-apb-dma.c | 2 | ||||
| -rw-r--r-- | include/linux/dmaengine.h | 4 |
13 files changed, 19 insertions, 14 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 3934fcc4e00b..7e5f6b65c651 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
| @@ -841,12 +841,13 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc, | |||
| 841 | * @buf_len: total number of bytes for the entire buffer | 841 | * @buf_len: total number of bytes for the entire buffer |
| 842 | * @period_len: number of bytes for each period | 842 | * @period_len: number of bytes for each period |
| 843 | * @direction: transfer direction, to or from device | 843 | * @direction: transfer direction, to or from device |
| 844 | * @flags: tx descriptor status flags | ||
| 844 | * @context: transfer context (ignored) | 845 | * @context: transfer context (ignored) |
| 845 | */ | 846 | */ |
| 846 | static struct dma_async_tx_descriptor * | 847 | static struct dma_async_tx_descriptor * |
| 847 | atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 848 | atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
| 848 | size_t period_len, enum dma_transfer_direction direction, | 849 | size_t period_len, enum dma_transfer_direction direction, |
| 849 | void *context) | 850 | unsigned long flags, void *context) |
| 850 | { | 851 | { |
| 851 | struct at_dma_chan *atchan = to_at_dma_chan(chan); | 852 | struct at_dma_chan *atchan = to_at_dma_chan(chan); |
| 852 | struct at_dma_slave *atslave = chan->private; | 853 | struct at_dma_slave *atslave = chan->private; |
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index c64917ec313d..493735b9b2c9 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c | |||
| @@ -1120,6 +1120,7 @@ fail: | |||
| 1120 | * @buf_len: length of the buffer (in bytes) | 1120 | * @buf_len: length of the buffer (in bytes) |
| 1121 | * @period_len: lenght of a single period | 1121 | * @period_len: lenght of a single period |
| 1122 | * @dir: direction of the operation | 1122 | * @dir: direction of the operation |
| 1123 | * @flags: tx descriptor status flags | ||
| 1123 | * @context: operation context (ignored) | 1124 | * @context: operation context (ignored) |
| 1124 | * | 1125 | * |
| 1125 | * Prepares a descriptor for cyclic DMA operation. This means that once the | 1126 | * Prepares a descriptor for cyclic DMA operation. This means that once the |
| @@ -1133,7 +1134,8 @@ fail: | |||
| 1133 | static struct dma_async_tx_descriptor * | 1134 | static struct dma_async_tx_descriptor * |
| 1134 | ep93xx_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, | 1135 | ep93xx_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, |
| 1135 | size_t buf_len, size_t period_len, | 1136 | size_t buf_len, size_t period_len, |
| 1136 | enum dma_transfer_direction dir, void *context) | 1137 | enum dma_transfer_direction dir, unsigned long flags, |
| 1138 | void *context) | ||
| 1137 | { | 1139 | { |
| 1138 | struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); | 1140 | struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); |
| 1139 | struct ep93xx_dma_desc *desc, *first; | 1141 | struct ep93xx_dma_desc *desc, *first; |
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 5084975d793c..41b4376eb614 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c | |||
| @@ -801,7 +801,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_slave_sg( | |||
| 801 | static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( | 801 | static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( |
| 802 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, | 802 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, |
| 803 | size_t period_len, enum dma_transfer_direction direction, | 803 | size_t period_len, enum dma_transfer_direction direction, |
| 804 | void *context) | 804 | unsigned long flags, void *context) |
| 805 | { | 805 | { |
| 806 | struct imxdma_channel *imxdmac = to_imxdma_chan(chan); | 806 | struct imxdma_channel *imxdmac = to_imxdma_chan(chan); |
| 807 | struct imxdma_engine *imxdma = imxdmac->imxdma; | 807 | struct imxdma_engine *imxdma = imxdmac->imxdma; |
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 1dc2a4ad0026..2c5fd3e9880c 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
| @@ -1012,7 +1012,7 @@ err_out: | |||
| 1012 | static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( | 1012 | static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( |
| 1013 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, | 1013 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, |
| 1014 | size_t period_len, enum dma_transfer_direction direction, | 1014 | size_t period_len, enum dma_transfer_direction direction, |
| 1015 | void *context) | 1015 | unsigned long flags, void *context) |
| 1016 | { | 1016 | { |
| 1017 | struct sdma_channel *sdmac = to_sdma_chan(chan); | 1017 | struct sdma_channel *sdmac = to_sdma_chan(chan); |
| 1018 | struct sdma_engine *sdma = sdmac->sdma; | 1018 | struct sdma_engine *sdma = sdmac->sdma; |
diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 8a15cf2163dc..6d52bd43a527 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c | |||
| @@ -358,7 +358,7 @@ struct mmp_tdma_desc *mmp_tdma_alloc_descriptor(struct mmp_tdma_chan *tdmac) | |||
| 358 | static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic( | 358 | static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic( |
| 359 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, | 359 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, |
| 360 | size_t period_len, enum dma_transfer_direction direction, | 360 | size_t period_len, enum dma_transfer_direction direction, |
| 361 | void *context) | 361 | unsigned long flags, void *context) |
| 362 | { | 362 | { |
| 363 | struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); | 363 | struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); |
| 364 | struct mmp_tdma_desc *desc; | 364 | struct mmp_tdma_desc *desc; |
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 7f41b25805fa..734a4eb84d65 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c | |||
| @@ -531,7 +531,7 @@ err_out: | |||
| 531 | static struct dma_async_tx_descriptor *mxs_dma_prep_dma_cyclic( | 531 | static struct dma_async_tx_descriptor *mxs_dma_prep_dma_cyclic( |
| 532 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, | 532 | struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len, |
| 533 | size_t period_len, enum dma_transfer_direction direction, | 533 | size_t period_len, enum dma_transfer_direction direction, |
| 534 | void *context) | 534 | unsigned long flags, void *context) |
| 535 | { | 535 | { |
| 536 | struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan); | 536 | struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan); |
| 537 | struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma; | 537 | struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma; |
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 71d786973dfd..4d2650f4202c 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
| @@ -366,7 +366,8 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( | |||
| 366 | 366 | ||
| 367 | static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic( | 367 | static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic( |
| 368 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 368 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
| 369 | size_t period_len, enum dma_transfer_direction dir, void *context) | 369 | size_t period_len, enum dma_transfer_direction dir, unsigned long flags, |
| 370 | void *context) | ||
| 370 | { | 371 | { |
| 371 | struct omap_chan *c = to_omap_dma_chan(chan); | 372 | struct omap_chan *c = to_omap_dma_chan(chan); |
| 372 | enum dma_slave_buswidth dev_width; | 373 | enum dma_slave_buswidth dev_width; |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index e4feba6b03c0..00356458e399 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
| @@ -2683,7 +2683,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len) | |||
| 2683 | static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( | 2683 | static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( |
| 2684 | struct dma_chan *chan, dma_addr_t dma_addr, size_t len, | 2684 | struct dma_chan *chan, dma_addr_t dma_addr, size_t len, |
| 2685 | size_t period_len, enum dma_transfer_direction direction, | 2685 | size_t period_len, enum dma_transfer_direction direction, |
| 2686 | void *context) | 2686 | unsigned long flags, void *context) |
| 2687 | { | 2687 | { |
| 2688 | struct dma_pl330_desc *desc; | 2688 | struct dma_pl330_desc *desc; |
| 2689 | struct dma_pl330_chan *pch = to_pchan(chan); | 2689 | struct dma_pl330_chan *pch = to_pchan(chan); |
diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c index f5a73606217e..b893159c1ecb 100644 --- a/drivers/dma/sa11x0-dma.c +++ b/drivers/dma/sa11x0-dma.c | |||
| @@ -614,7 +614,7 @@ static struct dma_async_tx_descriptor *sa11x0_dma_prep_slave_sg( | |||
| 614 | 614 | ||
| 615 | static struct dma_async_tx_descriptor *sa11x0_dma_prep_dma_cyclic( | 615 | static struct dma_async_tx_descriptor *sa11x0_dma_prep_dma_cyclic( |
| 616 | struct dma_chan *chan, dma_addr_t addr, size_t size, size_t period, | 616 | struct dma_chan *chan, dma_addr_t addr, size_t size, size_t period, |
| 617 | enum dma_transfer_direction dir, void *context) | 617 | enum dma_transfer_direction dir, unsigned long flags, void *context) |
| 618 | { | 618 | { |
| 619 | struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan); | 619 | struct sa11x0_dma_chan *c = to_sa11x0_dma_chan(chan); |
| 620 | struct sa11x0_dma_desc *txd; | 620 | struct sa11x0_dma_desc *txd; |
diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c index 434ad31174f2..3eed8b35b0f1 100644 --- a/drivers/dma/sirf-dma.c +++ b/drivers/dma/sirf-dma.c | |||
| @@ -489,7 +489,7 @@ err_dir: | |||
| 489 | static struct dma_async_tx_descriptor * | 489 | static struct dma_async_tx_descriptor * |
| 490 | sirfsoc_dma_prep_cyclic(struct dma_chan *chan, dma_addr_t addr, | 490 | sirfsoc_dma_prep_cyclic(struct dma_chan *chan, dma_addr_t addr, |
| 491 | size_t buf_len, size_t period_len, | 491 | size_t buf_len, size_t period_len, |
| 492 | enum dma_transfer_direction direction, void *context) | 492 | enum dma_transfer_direction direction, unsigned long flags, void *context) |
| 493 | { | 493 | { |
| 494 | struct sirfsoc_dma_chan *schan = dma_chan_to_sirfsoc_dma_chan(chan); | 494 | struct sirfsoc_dma_chan *schan = dma_chan_to_sirfsoc_dma_chan(chan); |
| 495 | struct sirfsoc_dma_desc *sdesc = NULL; | 495 | struct sirfsoc_dma_desc *sdesc = NULL; |
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 000d309602b2..eee8d9b9a20b 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
| @@ -2347,7 +2347,8 @@ static struct dma_async_tx_descriptor *d40_prep_slave_sg(struct dma_chan *chan, | |||
| 2347 | static struct dma_async_tx_descriptor * | 2347 | static struct dma_async_tx_descriptor * |
| 2348 | dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, | 2348 | dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, |
| 2349 | size_t buf_len, size_t period_len, | 2349 | size_t buf_len, size_t period_len, |
| 2350 | enum dma_transfer_direction direction, void *context) | 2350 | enum dma_transfer_direction direction, unsigned long flags, |
| 2351 | void *context) | ||
| 2351 | { | 2352 | { |
| 2352 | unsigned int periods = buf_len / period_len; | 2353 | unsigned int periods = buf_len / period_len; |
| 2353 | struct dma_async_tx_descriptor *txd; | 2354 | struct dma_async_tx_descriptor *txd; |
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 24acd711e032..b42b6ffb75ad 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c | |||
| @@ -990,7 +990,7 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg( | |||
| 990 | struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic( | 990 | struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic( |
| 991 | struct dma_chan *dc, dma_addr_t buf_addr, size_t buf_len, | 991 | struct dma_chan *dc, dma_addr_t buf_addr, size_t buf_len, |
| 992 | size_t period_len, enum dma_transfer_direction direction, | 992 | size_t period_len, enum dma_transfer_direction direction, |
| 993 | void *context) | 993 | unsigned long flags, void *context) |
| 994 | { | 994 | { |
| 995 | struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); | 995 | struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); |
| 996 | struct tegra_dma_desc *dma_desc = NULL; | 996 | struct tegra_dma_desc *dma_desc = NULL; |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 9c02a4508b25..09da4e565297 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -591,7 +591,7 @@ struct dma_device { | |||
| 591 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( | 591 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( |
| 592 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 592 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
| 593 | size_t period_len, enum dma_transfer_direction direction, | 593 | size_t period_len, enum dma_transfer_direction direction, |
| 594 | void *context); | 594 | unsigned long flags, void *context); |
| 595 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( | 595 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( |
| 596 | struct dma_chan *chan, struct dma_interleaved_template *xt, | 596 | struct dma_chan *chan, struct dma_interleaved_template *xt, |
| 597 | unsigned long flags); | 597 | unsigned long flags); |
| @@ -656,7 +656,7 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( | |||
| 656 | size_t period_len, enum dma_transfer_direction dir) | 656 | size_t period_len, enum dma_transfer_direction dir) |
| 657 | { | 657 | { |
| 658 | return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, | 658 | return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, |
| 659 | period_len, dir, NULL); | 659 | period_len, dir, flags, NULL); |
| 660 | } | 660 | } |
| 661 | 661 | ||
| 662 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | 662 | static inline int dmaengine_terminate_all(struct dma_chan *chan) |
