diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-02-23 21:06:43 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-03-05 11:24:17 -0500 |
commit | f33c9d655893d8632460696bbbdee737cb315711 (patch) | |
tree | 0c81b86cef4d1042dc4366a97000c31cf82bf1ee /drivers | |
parent | 7c6cc8f2012f4146b05b8ec7238f98884100db8c (diff) |
mmc: tmio: mmc: tmio: tmio_mmc_data has .chan_priv_?x
dma_request_slave_channel_compat() in tmio_mmc_dma
needs .chan_priv_tx/.chan_priv_rx. But these are copied from
sh_mobile_sdhi only, and sh_mobile_sdhi_info is now almost
same as tmio_mmc_data except .chan_priv_?x.
sh_mobile_sdhi_info can be replaced to tmio_mmc_data, but it is
used from ${LINUX}/arch/arm/mach-shmobile, ${LINUX}/arch/sh.
So, this patch adds .chan_priv_?x into tmio_mmc_data as 1st step,
and sh_mobile_sdhi driver has dummy operation for now.
It will be replaced/removed together with platform data replace.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 44 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc.h | 2 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc_dma.c | 6 |
3 files changed, 30 insertions, 22 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 11991f5f3fef..3137e292270e 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
@@ -201,6 +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 tmio_mmc_data *mmd = pdev->dev.platform_data; | ||
204 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; | 205 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; |
205 | struct tmio_mmc_host *host; | 206 | struct tmio_mmc_host *host; |
206 | struct resource *res; | 207 | struct resource *res; |
@@ -245,28 +246,37 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) | |||
245 | else | 246 | else |
246 | host->bus_shift = 0; | 247 | host->bus_shift = 0; |
247 | 248 | ||
248 | mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; | 249 | if (mmd) { |
249 | if (p) { | 250 | /* |
250 | mmc_data->flags = p->tmio_flags; | 251 | * FIXME |
251 | mmc_data->ocr_mask = p->tmio_ocr_mask; | 252 | * |
252 | mmc_data->capabilities |= p->tmio_caps; | 253 | * sh_mobile_sdhi_info will be replaced to tmio_mmc_data soon. |
253 | mmc_data->capabilities2 |= p->tmio_caps2; | 254 | * But, sh_mobile_sdhi_info is used under |
254 | mmc_data->cd_gpio = p->cd_gpio; | 255 | * ${LINUX}/arch/arm/mach-shmobile/ |
255 | 256 | * ${LINUX}/arch/sh/ | |
256 | if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) { | 257 | * To separate large patch into "tmio_mmc_data has .chan_priv_?x" |
257 | /* | 258 | * and "replace sh_mobile_sdhi_info in tmio_mmc_data", |
258 | * Yes, we have to provide slave IDs twice to TMIO: | 259 | * here has dummy method. |
259 | * once as a filter parameter and once for channel | 260 | * These should be removed. |
260 | * configuration as an explicit slave ID | 261 | */ |
261 | */ | 262 | struct tmio_mmc_data m; |
262 | dma_priv->chan_priv_tx = (void *)p->dma_slave_tx; | 263 | |
263 | dma_priv->chan_priv_rx = (void *)p->dma_slave_rx; | 264 | mmd = &m; |
264 | } | 265 | m.flags = p->tmio_flags; |
266 | m.ocr_mask = p->tmio_ocr_mask; | ||
267 | m.capabilities = p->tmio_caps; | ||
268 | m.capabilities2 = p->tmio_caps2; | ||
269 | m.cd_gpio = p->cd_gpio; | ||
270 | m.chan_priv_tx = (void *)p->dma_slave_tx; | ||
271 | m.chan_priv_rx = (void *)p->dma_slave_rx; | ||
272 | |||
273 | *mmc_data = *mmd; | ||
265 | } | 274 | } |
266 | dma_priv->filter = shdma_chan_filter; | 275 | dma_priv->filter = shdma_chan_filter; |
267 | dma_priv->enable = sh_mobile_sdhi_enable_dma; | 276 | dma_priv->enable = sh_mobile_sdhi_enable_dma; |
268 | 277 | ||
269 | mmc_data->alignment_shift = 1; /* 2-byte alignment */ | 278 | mmc_data->alignment_shift = 1; /* 2-byte alignment */ |
279 | mmc_data->capabilities |= MMC_CAP_MMC_HIGHSPEED; | ||
270 | 280 | ||
271 | /* | 281 | /* |
272 | * All SDHI blocks support 2-byte and larger block sizes in 4-bit | 282 | * 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 1aea5c67af94..4a597f5a53e2 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h | |||
@@ -43,8 +43,6 @@ struct tmio_mmc_data; | |||
43 | struct tmio_mmc_host; | 43 | struct tmio_mmc_host; |
44 | 44 | ||
45 | struct tmio_mmc_dma { | 45 | struct tmio_mmc_dma { |
46 | void *chan_priv_tx; | ||
47 | void *chan_priv_rx; | ||
48 | enum dma_slave_buswidth dma_buswidth; | 46 | enum dma_slave_buswidth dma_buswidth; |
49 | bool (*filter)(struct dma_chan *chan, void *arg); | 47 | bool (*filter)(struct dma_chan *chan, void *arg); |
50 | 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 8dbd785366a6..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); |
@@ -297,7 +297,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat | |||
297 | goto ecfgtx; | 297 | goto ecfgtx; |
298 | 298 | ||
299 | host->chan_rx = dma_request_slave_channel_compat(mask, | 299 | host->chan_rx = dma_request_slave_channel_compat(mask, |
300 | host->dma->filter, host->dma->chan_priv_rx, | 300 | host->dma->filter, pdata->chan_priv_rx, |
301 | &host->pdev->dev, "rx"); | 301 | &host->pdev->dev, "rx"); |
302 | 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__, |
303 | host->chan_rx); | 303 | host->chan_rx); |