aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 12:49:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 12:49:37 -0400
commitd6a4c0e5d3d433ef296f8f417e835329a834a256 (patch)
treea65de394ea1afeeccee9f84dc7e6cd21e2660639 /drivers/mmc
parent474095e46cd14421821da3201a9fd6a4c070996b (diff)
parentcdde0e61cf2d41123604c6c9d8f09ef5c23464ee (diff)
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul: - new drivers for: - Ingenic JZ4780 controller - APM X-Gene controller - Freescale RaidEngine device - Renesas USB Controller - remove device_alloc_chan_resources dummy handlers - sh driver cleanups for peri peri and related emmc and asoc patches as well - fixes and enhancements spread over the drivers * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits) dmaengine: dw: don't prompt for DW_DMAC_CORE dmaengine: shdmac: avoid unused variable warnings dmaengine: fix platform_no_drv_owner.cocci warnings dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe() dmaengine: at_xdmac: unlock spin lock before return dmaengine: xgene: devm_ioremap() returns NULL on error dmaengine: xgene: buffer overflow in xgene_dma_init_channels() dmaengine: usb-dmac: Fix dereferencing freed memory 'desc' dmaengine: sa11x0: report slave capabilities to upper layers dmaengine: vdma: Fix compilation warnings dmaengine: fsl_raid: statify fsl_re_chan_probe dmaengine: Driver support for FSL RaidEngine device. dmaengine: xgene_dma_init_ring_mngr() can be static Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes dmaengine: Add support for APM X-Gene SoC DMA engine driver dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver dmaengine: renesas,usb-dmac: Add device tree bindings documentation dmaengine: edma: fixed wrongly initialized data parameter to the edma callback dmaengine: ste_dma40: fix implicit conversion ...
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sh_mmcif.c13
-rw-r--r--drivers/mmc/host/sh_mobile_sdhi.c26
-rw-r--r--drivers/mmc/host/tmio_mmc.h4
-rw-r--r--drivers/mmc/host/tmio_mmc_dma.c10
4 files changed, 13 insertions, 40 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 072f67066df3..2b6ef6bd5d5f 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -388,7 +388,7 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
388{ 388{
389 struct dma_slave_config cfg = { 0, }; 389 struct dma_slave_config cfg = { 0, };
390 struct dma_chan *chan; 390 struct dma_chan *chan;
391 unsigned int slave_id; 391 void *slave_data = NULL;
392 struct resource *res; 392 struct resource *res;
393 dma_cap_mask_t mask; 393 dma_cap_mask_t mask;
394 int ret; 394 int ret;
@@ -397,13 +397,12 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
397 dma_cap_set(DMA_SLAVE, mask); 397 dma_cap_set(DMA_SLAVE, mask);
398 398
399 if (pdata) 399 if (pdata)
400 slave_id = direction == DMA_MEM_TO_DEV 400 slave_data = direction == DMA_MEM_TO_DEV ?
401 ? pdata->slave_id_tx : pdata->slave_id_rx; 401 (void *)pdata->slave_id_tx :
402 else 402 (void *)pdata->slave_id_rx;
403 slave_id = 0;
404 403
405 chan = dma_request_slave_channel_compat(mask, shdma_chan_filter, 404 chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
406 (void *)(unsigned long)slave_id, &host->pd->dev, 405 slave_data, &host->pd->dev,
407 direction == DMA_MEM_TO_DEV ? "tx" : "rx"); 406 direction == DMA_MEM_TO_DEV ? "tx" : "rx");
408 407
409 dev_dbg(&host->pd->dev, "%s: %s: got channel %p\n", __func__, 408 dev_dbg(&host->pd->dev, "%s: %s: got channel %p\n", __func__,
@@ -414,8 +413,6 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
414 413
415 res = platform_get_resource(host->pd, IORESOURCE_MEM, 0); 414 res = platform_get_resource(host->pd, IORESOURCE_MEM, 0);
416 415
417 /* In the OF case the driver will get the slave ID from the DT */
418 cfg.slave_id = slave_id;
419 cfg.direction = direction; 416 cfg.direction = direction;
420 417
421 if (direction == DMA_DEV_TO_MEM) { 418 if (direction == DMA_DEV_TO_MEM) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 6906a905cd54..354f4f335ed5 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -201,7 +201,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
201 of_match_device(sh_mobile_sdhi_of_match, &pdev->dev); 201 of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
202 struct sh_mobile_sdhi *priv; 202 struct sh_mobile_sdhi *priv;
203 struct tmio_mmc_data *mmc_data; 203 struct tmio_mmc_data *mmc_data;
204 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; 204 struct tmio_mmc_data *mmd = pdev->dev.platform_data;
205 struct tmio_mmc_host *host; 205 struct tmio_mmc_host *host;
206 struct resource *res; 206 struct resource *res;
207 int irq, ret, i = 0; 207 int irq, ret, i = 0;
@@ -245,30 +245,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
245 else 245 else
246 host->bus_shift = 0; 246 host->bus_shift = 0;
247 247
248 mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; 248 if (mmd)
249 if (p) { 249 *mmc_data = *mmd;
250 mmc_data->flags = p->tmio_flags; 250
251 mmc_data->ocr_mask = p->tmio_ocr_mask;
252 mmc_data->capabilities |= p->tmio_caps;
253 mmc_data->capabilities2 |= p->tmio_caps2;
254 mmc_data->cd_gpio = p->cd_gpio;
255
256 if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
257 /*
258 * Yes, we have to provide slave IDs twice to TMIO:
259 * once as a filter parameter and once for channel
260 * configuration as an explicit slave ID
261 */
262 dma_priv->chan_priv_tx = (void *)p->dma_slave_tx;
263 dma_priv->chan_priv_rx = (void *)p->dma_slave_rx;
264 dma_priv->slave_id_tx = p->dma_slave_tx;
265 dma_priv->slave_id_rx = p->dma_slave_rx;
266 }
267 }
268 dma_priv->filter = shdma_chan_filter; 251 dma_priv->filter = shdma_chan_filter;
269 dma_priv->enable = sh_mobile_sdhi_enable_dma; 252 dma_priv->enable = sh_mobile_sdhi_enable_dma;
270 253
271 mmc_data->alignment_shift = 1; /* 2-byte alignment */ 254 mmc_data->alignment_shift = 1; /* 2-byte alignment */
255 mmc_data->capabilities |= MMC_CAP_MMC_HIGHSPEED;
272 256
273 /* 257 /*
274 * All SDHI blocks support 2-byte and larger block sizes in 4-bit 258 * All SDHI blocks support 2-byte and larger block sizes in 4-bit
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index fc3805ed69d1..4a597f5a53e2 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -43,10 +43,6 @@ struct tmio_mmc_data;
43struct tmio_mmc_host; 43struct tmio_mmc_host;
44 44
45struct tmio_mmc_dma { 45struct tmio_mmc_dma {
46 void *chan_priv_tx;
47 void *chan_priv_rx;
48 int slave_id_tx;
49 int slave_id_rx;
50 enum dma_slave_buswidth dma_buswidth; 46 enum dma_slave_buswidth dma_buswidth;
51 bool (*filter)(struct dma_chan *chan, void *arg); 47 bool (*filter)(struct dma_chan *chan, void *arg);
52 void (*enable)(struct tmio_mmc_host *host, bool enable); 48 void (*enable)(struct tmio_mmc_host *host, bool enable);
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 331bb618e398..e4b05dbb9ca8 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -261,7 +261,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
261{ 261{
262 /* We can only either use DMA for both Tx and Rx or not use it at all */ 262 /* We can only either use DMA for both Tx and Rx or not use it at all */
263 if (!host->dma || (!host->pdev->dev.of_node && 263 if (!host->dma || (!host->pdev->dev.of_node &&
264 (!host->dma->chan_priv_tx || !host->dma->chan_priv_rx))) 264 (!pdata->chan_priv_tx || !pdata->chan_priv_rx)))
265 return; 265 return;
266 266
267 if (!host->chan_tx && !host->chan_rx) { 267 if (!host->chan_tx && !host->chan_rx) {
@@ -278,7 +278,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
278 dma_cap_set(DMA_SLAVE, mask); 278 dma_cap_set(DMA_SLAVE, mask);
279 279
280 host->chan_tx = dma_request_slave_channel_compat(mask, 280 host->chan_tx = dma_request_slave_channel_compat(mask,
281 host->dma->filter, host->dma->chan_priv_tx, 281 host->dma->filter, pdata->chan_priv_tx,
282 &host->pdev->dev, "tx"); 282 &host->pdev->dev, "tx");
283 dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__, 283 dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__,
284 host->chan_tx); 284 host->chan_tx);
@@ -286,8 +286,6 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
286 if (!host->chan_tx) 286 if (!host->chan_tx)
287 return; 287 return;
288 288
289 if (host->dma->chan_priv_tx)
290 cfg.slave_id = host->dma->slave_id_tx;
291 cfg.direction = DMA_MEM_TO_DEV; 289 cfg.direction = DMA_MEM_TO_DEV;
292 cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift); 290 cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
293 cfg.dst_addr_width = host->dma->dma_buswidth; 291 cfg.dst_addr_width = host->dma->dma_buswidth;
@@ -299,7 +297,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
299 goto ecfgtx; 297 goto ecfgtx;
300 298
301 host->chan_rx = dma_request_slave_channel_compat(mask, 299 host->chan_rx = dma_request_slave_channel_compat(mask,
302 host->dma->filter, host->dma->chan_priv_rx, 300 host->dma->filter, pdata->chan_priv_rx,
303 &host->pdev->dev, "rx"); 301 &host->pdev->dev, "rx");
304 dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__, 302 dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__,
305 host->chan_rx); 303 host->chan_rx);
@@ -307,8 +305,6 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
307 if (!host->chan_rx) 305 if (!host->chan_rx)
308 goto ereqrx; 306 goto ereqrx;
309 307
310 if (host->dma->chan_priv_rx)
311 cfg.slave_id = host->dma->slave_id_rx;
312 cfg.direction = DMA_DEV_TO_MEM; 308 cfg.direction = DMA_DEV_TO_MEM;
313 cfg.src_addr = cfg.dst_addr + host->pdata->dma_rx_offset; 309 cfg.src_addr = cfg.dst_addr + host->pdata->dma_rx_offset;
314 cfg.src_addr_width = host->dma->dma_buswidth; 310 cfg.src_addr_width = host->dma->dma_buswidth;