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

mmc: tmio/sdhi: introduce flag for RCar 2+ specific features

RCar Gen2 and later implementations of TMIO/SDHI have their own set of
features and additions. FAST_CLK_CHG is just one of them and I see a few
others being added soon. Some may work on older chipsets but this needs
to be tested case by case. Instead of adding a bunch of flags for each
feature, add a global RCar2+ one for now. We can still break out
features if the need arises.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Wolfram Sang and committed by
Ulf Hansson
3d376fb2 3072ba8c

+7 -7
+2 -2
drivers/mmc/host/sh_mobile_sdhi.c
··· 62 62 63 63 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { 64 64 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | 65 - TMIO_MMC_CLK_ACTUAL | TMIO_MMC_FAST_CLK_CHG, 65 + TMIO_MMC_CLK_ACTUAL | TMIO_MMC_MIN_RCAR2, 66 66 .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, 67 67 .dma_buswidth = DMA_SLAVE_BUSWIDTH_4_BYTES, 68 68 .dma_rx_offset = 0x2000, ··· 70 70 71 71 static const struct sh_mobile_sdhi_of_data of_rcar_gen3_compatible = { 72 72 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | 73 - TMIO_MMC_CLK_ACTUAL | TMIO_MMC_FAST_CLK_CHG, 73 + TMIO_MMC_CLK_ACTUAL | TMIO_MMC_MIN_RCAR2, 74 74 .capabilities = MMC_CAP_SD_HIGHSPEED, 75 75 .bus_shift = 2, 76 76 };
+3 -3
drivers/mmc/host/tmio_mmc_pio.c
··· 157 157 { 158 158 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, CLK_CTL_SCLKEN | 159 159 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); 160 - msleep(host->pdata->flags & TMIO_MMC_FAST_CLK_CHG ? 1 : 10); 160 + msleep(host->pdata->flags & TMIO_MMC_MIN_RCAR2 ? 1 : 10); 161 161 162 162 if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { 163 163 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100); ··· 174 174 175 175 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & 176 176 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); 177 - msleep(host->pdata->flags & TMIO_MMC_FAST_CLK_CHG ? 5 : 10); 177 + msleep(host->pdata->flags & TMIO_MMC_MIN_RCAR2 ? 5 : 10); 178 178 } 179 179 180 180 static void tmio_mmc_set_clock(struct tmio_mmc_host *host, ··· 205 205 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & 206 206 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); 207 207 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & CLK_CTL_DIV_MASK); 208 - if (!(host->pdata->flags & TMIO_MMC_FAST_CLK_CHG)) 208 + if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) 209 209 msleep(10); 210 210 211 211 tmio_mmc_clk_start(host);
+2 -2
include/linux/mfd/tmio.h
··· 66 66 */ 67 67 #define TMIO_MMC_SDIO_IRQ (1 << 2) 68 68 69 - /* Some controllers don't need to wait 10ms for clock changes */ 70 - #define TMIO_MMC_FAST_CLK_CHG (1 << 3) 69 + /* Some features are only available or tested on RCar Gen2 or later */ 70 + #define TMIO_MMC_MIN_RCAR2 (1 << 3) 71 71 72 72 /* 73 73 * Some controllers require waiting for the SD bus to become