diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 18:34:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 18:34:57 -0400 |
commit | ef08e78268423fc4d7fbc3e54bd9a67fc8da7cc5 (patch) | |
tree | d0561d3ef89c9cd277a38168e33850666cbd33c4 /drivers/mmc | |
parent | 71db34fc4330f7c784397acb9f1e6ee7f7b32eb2 (diff) | |
parent | 5b2e02e401deb44e7f5befe19404d8b2688efea4 (diff) |
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine update from Vinod Koul:
"This includes the cookie cleanup by Russell, the addition of context
parameter for dmaengine APIs, more arm dmaengine driver cleanup by
moving code to dmaengine, this time for imx by Javier and pl330 by
Boojin along with the usual driver fixes."
Fix up some fairly trivial conflicts with various other cleanups.
* 'next' of git://git.infradead.org/users/vkoul/slave-dma: (67 commits)
dmaengine: imx: fix the build failure on x86_64
dmaengine: i.MX: Fix merge of cookie branch.
dmaengine: i.MX: Add support for interleaved transfers.
dmaengine: imx-dma: use 'dev_dbg' and 'dev_warn' for messages.
dmaengine: imx-dma: remove 'imx_dmav1_baseaddr' and 'dma_clk'.
dmaengine: imx-dma: remove unused arg of imxdma_sg_next.
dmaengine: imx-dma: remove internal structure.
dmaengine: imx-dma: remove 'resbytes' field of 'internal' structure.
dmaengine: imx-dma: remove 'in_use' field of 'internal' structure.
dmaengine: imx-dma: remove sg member from internal structure.
dmaengine: imx-dma: remove 'imxdma_setup_sg_hw' function.
dmaengine: imx-dma: remove 'imxdma_config_channel_hw' function.
dmaengine: imx-dma: remove 'imxdma_setup_mem2mem_hw' function.
dmaengine: imx-dma: remove dma_mode member of internal structure.
dmaengine: imx-dma: remove data member from internal structure.
dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c
dmaengine: at_hdmac: add slave config operation
dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic
dmaengine/dma_slave: introduce inline wrappers
dma: imx-sdma: Treat firmware messages as warnings instead of erros
...
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 21 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/mxcmmc.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/mxs-mmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sh_mmcif.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc_dma.c | 4 |
6 files changed, 26 insertions, 14 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 390863e7efbd..9819dc09ce08 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/seq_file.h> | 24 | #include <linux/seq_file.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/stat.h> | 26 | #include <linux/stat.h> |
27 | #include <linux/types.h> | ||
27 | 28 | ||
28 | #include <linux/mmc/host.h> | 29 | #include <linux/mmc/host.h> |
29 | #include <linux/mmc/sdio.h> | 30 | #include <linux/mmc/sdio.h> |
@@ -173,6 +174,7 @@ struct atmel_mci { | |||
173 | 174 | ||
174 | struct atmel_mci_dma dma; | 175 | struct atmel_mci_dma dma; |
175 | struct dma_chan *data_chan; | 176 | struct dma_chan *data_chan; |
177 | struct dma_slave_config dma_conf; | ||
176 | 178 | ||
177 | u32 cmd_status; | 179 | u32 cmd_status; |
178 | u32 data_status; | 180 | u32 data_status; |
@@ -863,16 +865,17 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) | |||
863 | 865 | ||
864 | if (data->flags & MMC_DATA_READ) { | 866 | if (data->flags & MMC_DATA_READ) { |
865 | direction = DMA_FROM_DEVICE; | 867 | direction = DMA_FROM_DEVICE; |
866 | slave_dirn = DMA_DEV_TO_MEM; | 868 | host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM; |
867 | } else { | 869 | } else { |
868 | direction = DMA_TO_DEVICE; | 870 | direction = DMA_TO_DEVICE; |
869 | slave_dirn = DMA_MEM_TO_DEV; | 871 | host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV; |
870 | } | 872 | } |
871 | 873 | ||
872 | sglen = dma_map_sg(chan->device->dev, data->sg, | 874 | sglen = dma_map_sg(chan->device->dev, data->sg, |
873 | data->sg_len, direction); | 875 | data->sg_len, direction); |
874 | 876 | ||
875 | desc = chan->device->device_prep_slave_sg(chan, | 877 | dmaengine_slave_config(chan, &host->dma_conf); |
878 | desc = dmaengine_prep_slave_sg(chan, | ||
876 | data->sg, sglen, slave_dirn, | 879 | data->sg, sglen, slave_dirn, |
877 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 880 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
878 | if (!desc) | 881 | if (!desc) |
@@ -1960,10 +1963,6 @@ static bool atmci_configure_dma(struct atmel_mci *host) | |||
1960 | if (pdata && find_slave_dev(pdata->dma_slave)) { | 1963 | if (pdata && find_slave_dev(pdata->dma_slave)) { |
1961 | dma_cap_mask_t mask; | 1964 | dma_cap_mask_t mask; |
1962 | 1965 | ||
1963 | setup_dma_addr(pdata->dma_slave, | ||
1964 | host->mapbase + ATMCI_TDR, | ||
1965 | host->mapbase + ATMCI_RDR); | ||
1966 | |||
1967 | /* Try to grab a DMA channel */ | 1966 | /* Try to grab a DMA channel */ |
1968 | dma_cap_zero(mask); | 1967 | dma_cap_zero(mask); |
1969 | dma_cap_set(DMA_SLAVE, mask); | 1968 | dma_cap_set(DMA_SLAVE, mask); |
@@ -1977,6 +1976,14 @@ static bool atmci_configure_dma(struct atmel_mci *host) | |||
1977 | dev_info(&host->pdev->dev, | 1976 | dev_info(&host->pdev->dev, |
1978 | "using %s for DMA transfers\n", | 1977 | "using %s for DMA transfers\n", |
1979 | dma_chan_name(host->dma.chan)); | 1978 | dma_chan_name(host->dma.chan)); |
1979 | |||
1980 | host->dma_conf.src_addr = host->mapbase + ATMCI_RDR; | ||
1981 | host->dma_conf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
1982 | host->dma_conf.src_maxburst = 1; | ||
1983 | host->dma_conf.dst_addr = host->mapbase + ATMCI_TDR; | ||
1984 | host->dma_conf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
1985 | host->dma_conf.dst_maxburst = 1; | ||
1986 | host->dma_conf.device_fc = false; | ||
1980 | return true; | 1987 | return true; |
1981 | } | 1988 | } |
1982 | } | 1989 | } |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 983e244eca76..032b84791a16 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/dma-mapping.h> | 30 | #include <linux/dma-mapping.h> |
31 | #include <linux/amba/mmci.h> | 31 | #include <linux/amba/mmci.h> |
32 | #include <linux/pm_runtime.h> | 32 | #include <linux/pm_runtime.h> |
33 | #include <linux/types.h> | ||
33 | 34 | ||
34 | #include <asm/div64.h> | 35 | #include <asm/div64.h> |
35 | #include <asm/io.h> | 36 | #include <asm/io.h> |
@@ -400,6 +401,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, | |||
400 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, | 401 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, |
401 | .src_maxburst = variant->fifohalfsize >> 2, /* # of words */ | 402 | .src_maxburst = variant->fifohalfsize >> 2, /* # of words */ |
402 | .dst_maxburst = variant->fifohalfsize >> 2, /* # of words */ | 403 | .dst_maxburst = variant->fifohalfsize >> 2, /* # of words */ |
404 | .device_fc = false, | ||
403 | }; | 405 | }; |
404 | struct dma_chan *chan; | 406 | struct dma_chan *chan; |
405 | struct dma_device *device; | 407 | struct dma_device *device; |
@@ -441,7 +443,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data, | |||
441 | return -EINVAL; | 443 | return -EINVAL; |
442 | 444 | ||
443 | dmaengine_slave_config(chan, &conf); | 445 | dmaengine_slave_config(chan, &conf); |
444 | desc = device->device_prep_slave_sg(chan, data->sg, nr_sg, | 446 | desc = dmaengine_prep_slave_sg(chan, data->sg, nr_sg, |
445 | conf.direction, DMA_CTRL_ACK); | 447 | conf.direction, DMA_CTRL_ACK); |
446 | if (!desc) | 448 | if (!desc) |
447 | goto unmap_exit; | 449 | goto unmap_exit; |
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 4184b7946bbf..b2058b432320 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/gpio.h> | 33 | #include <linux/gpio.h> |
34 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
35 | #include <linux/dmaengine.h> | 35 | #include <linux/dmaengine.h> |
36 | #include <linux/types.h> | ||
36 | 37 | ||
37 | #include <asm/dma.h> | 38 | #include <asm/dma.h> |
38 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
@@ -254,7 +255,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) | |||
254 | if (nents != data->sg_len) | 255 | if (nents != data->sg_len) |
255 | return -EINVAL; | 256 | return -EINVAL; |
256 | 257 | ||
257 | host->desc = host->dma->device->device_prep_slave_sg(host->dma, | 258 | host->desc = dmaengine_prep_slave_sg(host->dma, |
258 | data->sg, data->sg_len, slave_dirn, | 259 | data->sg, data->sg_len, slave_dirn, |
259 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 260 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
260 | 261 | ||
@@ -267,6 +268,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data) | |||
267 | wmb(); | 268 | wmb(); |
268 | 269 | ||
269 | dmaengine_submit(host->desc); | 270 | dmaengine_submit(host->desc); |
271 | dma_async_issue_pending(host->dma); | ||
270 | 272 | ||
271 | return 0; | 273 | return 0; |
272 | } | 274 | } |
@@ -710,6 +712,7 @@ static int mxcmci_setup_dma(struct mmc_host *mmc) | |||
710 | config->src_addr_width = 4; | 712 | config->src_addr_width = 4; |
711 | config->dst_maxburst = host->burstlen; | 713 | config->dst_maxburst = host->burstlen; |
712 | config->src_maxburst = host->burstlen; | 714 | config->src_maxburst = host->burstlen; |
715 | config->device_fc = false; | ||
713 | 716 | ||
714 | return dmaengine_slave_config(host->dma, config); | 717 | return dmaengine_slave_config(host->dma, config); |
715 | } | 718 | } |
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 382c835d217c..65f36cf2ff33 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c | |||
@@ -324,7 +324,7 @@ static struct dma_async_tx_descriptor *mxs_mmc_prep_dma( | |||
324 | sg_len = SSP_PIO_NUM; | 324 | sg_len = SSP_PIO_NUM; |
325 | } | 325 | } |
326 | 326 | ||
327 | desc = host->dmach->device->device_prep_slave_sg(host->dmach, | 327 | desc = dmaengine_prep_slave_sg(host->dmach, |
328 | sgl, sg_len, host->slave_dirn, append); | 328 | sgl, sg_len, host->slave_dirn, append); |
329 | if (desc) { | 329 | if (desc) { |
330 | desc->callback = mxs_mmc_dma_irq_callback; | 330 | desc->callback = mxs_mmc_dma_irq_callback; |
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 60f205708f54..aafaf0b6eb1c 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c | |||
@@ -286,7 +286,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host) | |||
286 | DMA_FROM_DEVICE); | 286 | DMA_FROM_DEVICE); |
287 | if (ret > 0) { | 287 | if (ret > 0) { |
288 | host->dma_active = true; | 288 | host->dma_active = true; |
289 | desc = chan->device->device_prep_slave_sg(chan, sg, ret, | 289 | desc = dmaengine_prep_slave_sg(chan, sg, ret, |
290 | DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 290 | DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
291 | } | 291 | } |
292 | 292 | ||
@@ -335,7 +335,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host) | |||
335 | DMA_TO_DEVICE); | 335 | DMA_TO_DEVICE); |
336 | if (ret > 0) { | 336 | if (ret > 0) { |
337 | host->dma_active = true; | 337 | host->dma_active = true; |
338 | desc = chan->device->device_prep_slave_sg(chan, sg, ret, | 338 | desc = dmaengine_prep_slave_sg(chan, sg, ret, |
339 | DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 339 | DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
340 | } | 340 | } |
341 | 341 | ||
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index 8253ec12003e..fff928604859 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c | |||
@@ -88,7 +88,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host) | |||
88 | 88 | ||
89 | ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE); | 89 | ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE); |
90 | if (ret > 0) | 90 | if (ret > 0) |
91 | desc = chan->device->device_prep_slave_sg(chan, sg, ret, | 91 | desc = dmaengine_prep_slave_sg(chan, sg, ret, |
92 | DMA_DEV_TO_MEM, DMA_CTRL_ACK); | 92 | DMA_DEV_TO_MEM, DMA_CTRL_ACK); |
93 | 93 | ||
94 | if (desc) { | 94 | if (desc) { |
@@ -169,7 +169,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) | |||
169 | 169 | ||
170 | ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE); | 170 | ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE); |
171 | if (ret > 0) | 171 | if (ret > 0) |
172 | desc = chan->device->device_prep_slave_sg(chan, sg, ret, | 172 | desc = dmaengine_prep_slave_sg(chan, sg, ret, |
173 | DMA_MEM_TO_DEV, DMA_CTRL_ACK); | 173 | DMA_MEM_TO_DEV, DMA_CTRL_ACK); |
174 | 174 | ||
175 | if (desc) { | 175 | if (desc) { |