Commit c0f3b6c7 authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Pierre Ossman

mmc: au1xmmc command types check from data flags

This patch has changed command types check from data flags.

MMC_STOP_TRANSMISSION is never passed to au1xmmc_send_command().
SEND_STOP() is used for MMC_STOP_TRANSMISSION.
Signed-off-by: default avatarYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 39403865
...@@ -187,9 +187,8 @@ static void au1xmmc_tasklet_finish(unsigned long param) ...@@ -187,9 +187,8 @@ static void au1xmmc_tasklet_finish(unsigned long param)
} }
static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
struct mmc_command *cmd) struct mmc_command *cmd, unsigned int flags)
{ {
u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT); u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
switch (mmc_resp_type(cmd)) { switch (mmc_resp_type(cmd)) {
...@@ -213,24 +212,16 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, ...@@ -213,24 +212,16 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
return MMC_ERR_INVALID; return MMC_ERR_INVALID;
} }
switch(cmd->opcode) { if (flags & MMC_DATA_READ) {
case MMC_READ_SINGLE_BLOCK: if (flags & MMC_DATA_MULTI)
case SD_APP_SEND_SCR: mmccmd |= SD_CMD_CT_4;
mmccmd |= SD_CMD_CT_2; else
break; mmccmd |= SD_CMD_CT_2;
case MMC_READ_MULTIPLE_BLOCK: } else if (flags & MMC_DATA_WRITE) {
mmccmd |= SD_CMD_CT_4; if (flags & MMC_DATA_MULTI)
break; mmccmd |= SD_CMD_CT_3;
case MMC_WRITE_BLOCK: else
mmccmd |= SD_CMD_CT_1; mmccmd |= SD_CMD_CT_1;
break;
case MMC_WRITE_MULTIPLE_BLOCK:
mmccmd |= SD_CMD_CT_3;
break;
case MMC_STOP_TRANSMISSION:
mmccmd |= SD_CMD_CT_7;
break;
} }
au_writel(cmd->arg, HOST_CMDARG(host)); au_writel(cmd->arg, HOST_CMDARG(host));
...@@ -665,6 +656,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) ...@@ -665,6 +656,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
{ {
struct au1xmmc_host *host = mmc_priv(mmc); struct au1xmmc_host *host = mmc_priv(mmc);
unsigned int flags = 0;
int ret = MMC_ERR_NONE; int ret = MMC_ERR_NONE;
WARN_ON(irqs_disabled()); WARN_ON(irqs_disabled());
...@@ -677,11 +669,12 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) ...@@ -677,11 +669,12 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
if (mrq->data) { if (mrq->data) {
FLUSH_FIFO(host); FLUSH_FIFO(host);
flags = mrq->data->flags;
ret = au1xmmc_prepare_data(host, mrq->data); ret = au1xmmc_prepare_data(host, mrq->data);
} }
if (ret == MMC_ERR_NONE) if (ret == MMC_ERR_NONE)
ret = au1xmmc_send_command(host, 0, mrq->cmd); ret = au1xmmc_send_command(host, 0, mrq->cmd, flags);
if (ret != MMC_ERR_NONE) { if (ret != MMC_ERR_NONE) {
mrq->cmd->error = ret; mrq->cmd->error = ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment