aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/au1xmmc.c35
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)
187} 187}
188 188
189static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, 189static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
190 struct mmc_command *cmd) 190 struct mmc_command *cmd, unsigned int flags)
191{ 191{
192
193 u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT); 192 u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
194 193
195 switch (mmc_resp_type(cmd)) { 194 switch (mmc_resp_type(cmd)) {
@@ -213,24 +212,16 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
213 return MMC_ERR_INVALID; 212 return MMC_ERR_INVALID;
214 } 213 }
215 214
216 switch(cmd->opcode) { 215 if (flags & MMC_DATA_READ) {
217 case MMC_READ_SINGLE_BLOCK: 216 if (flags & MMC_DATA_MULTI)
218 case SD_APP_SEND_SCR: 217 mmccmd |= SD_CMD_CT_4;
219 mmccmd |= SD_CMD_CT_2; 218 else
220 break; 219 mmccmd |= SD_CMD_CT_2;
221 case MMC_READ_MULTIPLE_BLOCK: 220 } else if (flags & MMC_DATA_WRITE) {
222 mmccmd |= SD_CMD_CT_4; 221 if (flags & MMC_DATA_MULTI)
223 break; 222 mmccmd |= SD_CMD_CT_3;
224 case MMC_WRITE_BLOCK: 223 else
225 mmccmd |= SD_CMD_CT_1; 224 mmccmd |= SD_CMD_CT_1;
226 break;
227
228 case MMC_WRITE_MULTIPLE_BLOCK:
229 mmccmd |= SD_CMD_CT_3;
230 break;
231 case MMC_STOP_TRANSMISSION:
232 mmccmd |= SD_CMD_CT_7;
233 break;
234 } 225 }
235 226
236 au_writel(cmd->arg, HOST_CMDARG(host)); 227 au_writel(cmd->arg, HOST_CMDARG(host));
@@ -665,6 +656,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
665{ 656{
666 657
667 struct au1xmmc_host *host = mmc_priv(mmc); 658 struct au1xmmc_host *host = mmc_priv(mmc);
659 unsigned int flags = 0;
668 int ret = MMC_ERR_NONE; 660 int ret = MMC_ERR_NONE;
669 661
670 WARN_ON(irqs_disabled()); 662 WARN_ON(irqs_disabled());
@@ -677,11 +669,12 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
677 669
678 if (mrq->data) { 670 if (mrq->data) {
679 FLUSH_FIFO(host); 671 FLUSH_FIFO(host);
672 flags = mrq->data->flags;
680 ret = au1xmmc_prepare_data(host, mrq->data); 673 ret = au1xmmc_prepare_data(host, mrq->data);
681 } 674 }
682 675
683 if (ret == MMC_ERR_NONE) 676 if (ret == MMC_ERR_NONE)
684 ret = au1xmmc_send_command(host, 0, mrq->cmd); 677 ret = au1xmmc_send_command(host, 0, mrq->cmd, flags);
685 678
686 if (ret != MMC_ERR_NONE) { 679 if (ret != MMC_ERR_NONE) {
687 mrq->cmd->error = ret; 680 mrq->cmd->error = ret;