Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kuninori Morimoto and committed by
Vinod Koul
f33c9d65 7c6cc8f2

+31 -21
+26 -16
drivers/mmc/host/sh_mobile_sdhi.c
··· 201 201 of_match_device(sh_mobile_sdhi_of_match, &pdev->dev); 202 202 struct sh_mobile_sdhi *priv; 203 203 struct tmio_mmc_data *mmc_data; 204 + struct tmio_mmc_data *mmd = pdev->dev.platform_data; 204 205 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; 205 206 struct tmio_mmc_host *host; 206 207 struct resource *res; ··· 246 245 else 247 246 host->bus_shift = 0; 248 247 249 - mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; 250 - if (p) { 251 - mmc_data->flags = p->tmio_flags; 252 - mmc_data->ocr_mask = p->tmio_ocr_mask; 253 - mmc_data->capabilities |= p->tmio_caps; 254 - mmc_data->capabilities2 |= p->tmio_caps2; 255 - mmc_data->cd_gpio = p->cd_gpio; 248 + if (mmd) { 249 + /* 250 + * FIXME 251 + * 252 + * sh_mobile_sdhi_info will be replaced to tmio_mmc_data soon. 253 + * But, sh_mobile_sdhi_info is used under 254 + * ${LINUX}/arch/arm/mach-shmobile/ 255 + * ${LINUX}/arch/sh/ 256 + * To separate large patch into "tmio_mmc_data has .chan_priv_?x" 257 + * and "replace sh_mobile_sdhi_info in tmio_mmc_data", 258 + * here has dummy method. 259 + * These should be removed. 260 + */ 261 + struct tmio_mmc_data m; 256 262 257 - if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) { 258 - /* 259 - * Yes, we have to provide slave IDs twice to TMIO: 260 - * once as a filter parameter and once for channel 261 - * configuration as an explicit slave ID 262 - */ 263 - dma_priv->chan_priv_tx = (void *)p->dma_slave_tx; 264 - dma_priv->chan_priv_rx = (void *)p->dma_slave_rx; 265 - } 263 + mmd = &m; 264 + m.flags = p->tmio_flags; 265 + m.ocr_mask = p->tmio_ocr_mask; 266 + m.capabilities = p->tmio_caps; 267 + m.capabilities2 = p->tmio_caps2; 268 + m.cd_gpio = p->cd_gpio; 269 + m.chan_priv_tx = (void *)p->dma_slave_tx; 270 + m.chan_priv_rx = (void *)p->dma_slave_rx; 271 + 272 + *mmc_data = *mmd; 266 273 } 267 274 dma_priv->filter = shdma_chan_filter; 268 275 dma_priv->enable = sh_mobile_sdhi_enable_dma; 269 276 270 277 mmc_data->alignment_shift = 1; /* 2-byte alignment */ 278 + mmc_data->capabilities |= MMC_CAP_MMC_HIGHSPEED; 271 279 272 280 /* 273 281 * All SDHI blocks support 2-byte and larger block sizes in 4-bit
-2
drivers/mmc/host/tmio_mmc.h
··· 43 43 struct tmio_mmc_host; 44 44 45 45 struct tmio_mmc_dma { 46 - void *chan_priv_tx; 47 - void *chan_priv_rx; 48 46 enum dma_slave_buswidth dma_buswidth; 49 47 bool (*filter)(struct dma_chan *chan, void *arg); 50 48 void (*enable)(struct tmio_mmc_host *host, bool enable);
+3 -3
drivers/mmc/host/tmio_mmc_dma.c
··· 261 261 { 262 262 /* We can only either use DMA for both Tx and Rx or not use it at all */ 263 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 265 return; 266 266 267 267 if (!host->chan_tx && !host->chan_rx) { ··· 278 278 dma_cap_set(DMA_SLAVE, mask); 279 279 280 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 282 &host->pdev->dev, "tx"); 283 283 dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__, 284 284 host->chan_tx); ··· 297 297 goto ecfgtx; 298 298 299 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 301 &host->pdev->dev, "rx"); 302 302 dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__, 303 303 host->chan_rx);
+2
include/linux/mfd/tmio.h
··· 111 111 * data for the MMC controller 112 112 */ 113 113 struct tmio_mmc_data { 114 + void *chan_priv_tx; 115 + void *chan_priv_rx; 114 116 unsigned int hclk; 115 117 unsigned long capabilities; 116 118 unsigned long capabilities2;