diff options
author | Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 2007-05-13 18:23:15 +0200 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-05-14 18:51:24 +0200 |
commit | c0f3b6c777af071063984fdbc4efb6c904f665f4 (patch) | |
tree | bf747258c71ac0323b95d388210ad1ea76a0a9c6 /drivers/mmc | |
parent | 39403865d2e4590802553370a56c9ab93131e4ee (diff) | |
download | linux-c0f3b6c777af071063984fdbc4efb6c904f665f4.tar.gz linux-c0f3b6c777af071063984fdbc4efb6c904f665f4.tar.bz2 linux-c0f3b6c777af071063984fdbc4efb6c904f665f4.zip |
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: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/au1xmmc.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c index b7156a4555b5..f967226d7505 100644 --- a/drivers/mmc/host/au1xmmc.c +++ b/drivers/mmc/host/au1xmmc.c @@ -187,9 +187,8 @@ static void au1xmmc_tasklet_finish(unsigned long param) } 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); switch (mmc_resp_type(cmd)) { @@ -213,24 +212,16 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, return MMC_ERR_INVALID; } - switch(cmd->opcode) { - case MMC_READ_SINGLE_BLOCK: - case SD_APP_SEND_SCR: - mmccmd |= SD_CMD_CT_2; - break; - case MMC_READ_MULTIPLE_BLOCK: - mmccmd |= SD_CMD_CT_4; - break; - case MMC_WRITE_BLOCK: - 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; + if (flags & MMC_DATA_READ) { + if (flags & MMC_DATA_MULTI) + mmccmd |= SD_CMD_CT_4; + else + mmccmd |= SD_CMD_CT_2; + } else if (flags & MMC_DATA_WRITE) { + if (flags & MMC_DATA_MULTI) + mmccmd |= SD_CMD_CT_3; + else + mmccmd |= SD_CMD_CT_1; } au_writel(cmd->arg, HOST_CMDARG(host)); @@ -665,6 +656,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) { struct au1xmmc_host *host = mmc_priv(mmc); + unsigned int flags = 0; int ret = MMC_ERR_NONE; WARN_ON(irqs_disabled()); @@ -677,11 +669,12 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) if (mrq->data) { FLUSH_FIFO(host); + flags = mrq->data->flags; ret = au1xmmc_prepare_data(host, mrq->data); } 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) { mrq->cmd->error = ret; |