diff options
author | Shinobu Uehara <shinobu.uehara.xc@renesas.com> | 2014-08-24 23:00:25 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-09-09 07:59:14 -0400 |
commit | b8d11962c2d83c984d5afd091e5b725ad2fd5607 (patch) | |
tree | e418779bef7c9c251698f7217940c3b76a77f2c2 /drivers/mmc/host/tmio_mmc_pio.c | |
parent | f83bfa751babb521924f6d8c93055215d2eb33cc (diff) |
mmc: tmio: control multiple block transfer mode
Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.
This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc_pio.c')
-rw-r--r-- | drivers/mmc/host/tmio_mmc_pio.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 3d0ad737abea..c2804827be9f 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/pm_qos.h> | 44 | #include <linux/pm_qos.h> |
45 | #include <linux/pm_runtime.h> | 45 | #include <linux/pm_runtime.h> |
46 | #include <linux/regulator/consumer.h> | 46 | #include <linux/regulator/consumer.h> |
47 | #include <linux/mmc/sdio.h> | ||
47 | #include <linux/scatterlist.h> | 48 | #include <linux/scatterlist.h> |
48 | #include <linux/spinlock.h> | 49 | #include <linux/spinlock.h> |
49 | #include <linux/workqueue.h> | 50 | #include <linux/workqueue.h> |
@@ -310,6 +311,7 @@ static void tmio_mmc_done_work(struct work_struct *work) | |||
310 | #define TRANSFER_READ 0x1000 | 311 | #define TRANSFER_READ 0x1000 |
311 | #define TRANSFER_MULTI 0x2000 | 312 | #define TRANSFER_MULTI 0x2000 |
312 | #define SECURITY_CMD 0x4000 | 313 | #define SECURITY_CMD 0x4000 |
314 | #define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */ | ||
313 | 315 | ||
314 | static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd) | 316 | static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd) |
315 | { | 317 | { |
@@ -346,6 +348,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command | |||
346 | if (data->blocks > 1) { | 348 | if (data->blocks > 1) { |
347 | sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100); | 349 | sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100); |
348 | c |= TRANSFER_MULTI; | 350 | c |= TRANSFER_MULTI; |
351 | |||
352 | /* | ||
353 | * Disable auto CMD12 at IO_RW_EXTENDED when | ||
354 | * multiple block transfer | ||
355 | */ | ||
356 | if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) && | ||
357 | (cmd->opcode == SD_IO_RW_EXTENDED)) | ||
358 | c |= NO_CMD12_ISSUE; | ||
349 | } | 359 | } |
350 | if (data->flags & MMC_DATA_READ) | 360 | if (data->flags & MMC_DATA_READ) |
351 | c |= TRANSFER_READ; | 361 | c |= TRANSFER_READ; |