aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-09-09 02:45:46 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-09-09 08:15:42 -0400
commit8b4efe2f58b1699a57f6c30d17345b801ab4213b (patch)
treeab9565d51d565596b2856e200aca343ab4a06d67 /drivers/mmc
parentbbf0208d39121bd8873b032459cb2b5f35e14593 (diff)
mmc: use .multi_io_quirk on sh_mobile
Now, sh_mobile_sdhi can use .multi_io_quirk callback instead of MMC_CAP2_NO_MULTI_READ flags. let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sh_mobile_sdhi.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f2585b6c1414..a2e81a1ea6af 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -58,7 +58,6 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
58 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | 58 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
59 TMIO_MMC_CLK_ACTUAL, 59 TMIO_MMC_CLK_ACTUAL,
60 .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, 60 .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
61 .capabilities2 = MMC_CAP2_NO_MULTI_READ,
62 .dma_rx_offset = 0x2000, 61 .dma_rx_offset = 0x2000,
63}; 62};
64 63
@@ -139,6 +138,24 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
139 return 0; 138 return 0;
140} 139}
141 140
141static int sh_mobile_sdhi_multi_io_quirk(struct mmc_card *card,
142 unsigned int direction, int blk_size)
143{
144 /*
145 * In Renesas controllers, when performing a
146 * multiple block read of one or two blocks,
147 * depending on the timing with which the
148 * response register is read, the response
149 * value may not be read properly.
150 * Use single block read for this HW bug
151 */
152 if ((direction == MMC_DATA_READ) &&
153 blk_size == 2)
154 return 1;
155
156 return blk_size;
157}
158
142static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev) 159static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev)
143{ 160{
144 mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100)); 161 mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100));
@@ -194,6 +211,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
194 mmc_data->clk_disable = sh_mobile_sdhi_clk_disable; 211 mmc_data->clk_disable = sh_mobile_sdhi_clk_disable;
195 mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; 212 mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
196 mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; 213 mmc_data->write16_hook = sh_mobile_sdhi_write16_hook;
214 mmc_data->multi_io_quirk = sh_mobile_sdhi_multi_io_quirk;
197 if (p) { 215 if (p) {
198 mmc_data->flags = p->tmio_flags; 216 mmc_data->flags = p->tmio_flags;
199 mmc_data->ocr_mask = p->tmio_ocr_mask; 217 mmc_data->ocr_mask = p->tmio_ocr_mask;