diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-08-30 12:26:39 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-26 16:32:09 -0400 |
commit | 714c4a6e3a0f730834ec8a8bc83b2a6da33f54dc (patch) | |
tree | 1e2a581b44fab2b92d21fc52d134719dde003c45 /drivers/mmc/host/sh_mmcif.c | |
parent | 67716327eec7e9d573e7cb2d806545d6f7c1a38d (diff) |
mmc: sh_mmcif: simplify platform data
Provide platforms with a simplified way to specify MMCIF DMA slave IDs in
a way, similar to SDHI and other sh_dma clients.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sh_mmcif.c')
-rw-r--r-- | drivers/mmc/host/sh_mmcif.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 557886bee9ce..bd91c94ea18e 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c | |||
@@ -165,6 +165,8 @@ struct sh_mmcif_host { | |||
165 | struct mmc_host *mmc; | 165 | struct mmc_host *mmc; |
166 | struct mmc_data *data; | 166 | struct mmc_data *data; |
167 | struct platform_device *pd; | 167 | struct platform_device *pd; |
168 | struct sh_dmae_slave dma_slave_tx; | ||
169 | struct sh_dmae_slave dma_slave_rx; | ||
168 | struct clk *hclk; | 170 | struct clk *hclk; |
169 | unsigned int clk; | 171 | unsigned int clk; |
170 | int bus_width; | 172 | int bus_width; |
@@ -323,25 +325,35 @@ static bool sh_mmcif_filter(struct dma_chan *chan, void *arg) | |||
323 | static void sh_mmcif_request_dma(struct sh_mmcif_host *host, | 325 | static void sh_mmcif_request_dma(struct sh_mmcif_host *host, |
324 | struct sh_mmcif_plat_data *pdata) | 326 | struct sh_mmcif_plat_data *pdata) |
325 | { | 327 | { |
328 | struct sh_dmae_slave *tx, *rx; | ||
326 | host->dma_active = false; | 329 | host->dma_active = false; |
327 | 330 | ||
328 | /* We can only either use DMA for both Tx and Rx or not use it at all */ | 331 | /* We can only either use DMA for both Tx and Rx or not use it at all */ |
329 | if (pdata->dma) { | 332 | if (pdata->dma) { |
333 | dev_warn(&host->pd->dev, | ||
334 | "Update your platform to use embedded DMA slave IDs\n"); | ||
335 | tx = &pdata->dma->chan_priv_tx; | ||
336 | rx = &pdata->dma->chan_priv_rx; | ||
337 | } else { | ||
338 | tx = &host->dma_slave_tx; | ||
339 | tx->slave_id = pdata->slave_id_tx; | ||
340 | rx = &host->dma_slave_rx; | ||
341 | rx->slave_id = pdata->slave_id_rx; | ||
342 | } | ||
343 | if (tx->slave_id > 0 && rx->slave_id > 0) { | ||
330 | dma_cap_mask_t mask; | 344 | dma_cap_mask_t mask; |
331 | 345 | ||
332 | dma_cap_zero(mask); | 346 | dma_cap_zero(mask); |
333 | dma_cap_set(DMA_SLAVE, mask); | 347 | dma_cap_set(DMA_SLAVE, mask); |
334 | 348 | ||
335 | host->chan_tx = dma_request_channel(mask, sh_mmcif_filter, | 349 | host->chan_tx = dma_request_channel(mask, sh_mmcif_filter, tx); |
336 | &pdata->dma->chan_priv_tx); | ||
337 | dev_dbg(&host->pd->dev, "%s: TX: got channel %p\n", __func__, | 350 | dev_dbg(&host->pd->dev, "%s: TX: got channel %p\n", __func__, |
338 | host->chan_tx); | 351 | host->chan_tx); |
339 | 352 | ||
340 | if (!host->chan_tx) | 353 | if (!host->chan_tx) |
341 | return; | 354 | return; |
342 | 355 | ||
343 | host->chan_rx = dma_request_channel(mask, sh_mmcif_filter, | 356 | host->chan_rx = dma_request_channel(mask, sh_mmcif_filter, rx); |
344 | &pdata->dma->chan_priv_rx); | ||
345 | dev_dbg(&host->pd->dev, "%s: RX: got channel %p\n", __func__, | 357 | dev_dbg(&host->pd->dev, "%s: RX: got channel %p\n", __func__, |
346 | host->chan_rx); | 358 | host->chan_rx); |
347 | 359 | ||