Commit be0192aa authored by Pierre Ossman's avatar Pierre Ossman

mmc: remove confusing flag

The MMC_DATA_MULTI flag never had a proper definition of what it
means, so remove it and let the drivers check the block count in
the request.
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 255d01af
...@@ -241,7 +241,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) ...@@ -241,7 +241,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
brq.data.blocks = 1; brq.data.blocks = 1;
if (brq.data.blocks > 1) { if (brq.data.blocks > 1) {
brq.data.flags |= MMC_DATA_MULTI;
brq.mrq.stop = &brq.stop; brq.mrq.stop = &brq.stop;
readcmd = MMC_READ_MULTIPLE_BLOCK; readcmd = MMC_READ_MULTIPLE_BLOCK;
writecmd = MMC_WRITE_MULTIPLE_BLOCK; writecmd = MMC_WRITE_MULTIPLE_BLOCK;
......
...@@ -328,7 +328,7 @@ static void at91_mci_handle_transmitted(struct at91mci_host *host) ...@@ -328,7 +328,7 @@ static void at91_mci_handle_transmitted(struct at91mci_host *host)
data = cmd->data; data = cmd->data;
if (!data) return; if (!data) return;
if (cmd->data->flags & MMC_DATA_MULTI) { if (cmd->data->blocks > 1) {
pr_debug("multiple write : wait for BLKE...\n"); pr_debug("multiple write : wait for BLKE...\n");
at91_mci_write(host, AT91_MCI_IER, AT91_MCI_BLKE); at91_mci_write(host, AT91_MCI_IER, AT91_MCI_BLKE);
} else } else
...@@ -439,7 +439,7 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command ...@@ -439,7 +439,7 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command
if (data->flags & MMC_DATA_STREAM) if (data->flags & MMC_DATA_STREAM)
cmdr |= AT91_MCI_TRTYP_STREAM; cmdr |= AT91_MCI_TRTYP_STREAM;
if (data->flags & MMC_DATA_MULTI) if (data->blocks > 1)
cmdr |= AT91_MCI_TRTYP_MULTIPLE; cmdr |= AT91_MCI_TRTYP_MULTIPLE;
} }
else { else {
......
...@@ -186,7 +186,7 @@ static void au1xmmc_tasklet_finish(unsigned long param) ...@@ -186,7 +186,7 @@ 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, unsigned int flags) struct mmc_command *cmd, struct mmc_data *data)
{ {
u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT); u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
...@@ -211,17 +211,19 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, ...@@ -211,17 +211,19 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
return -EINVAL; return -EINVAL;
} }
if (data) {
if (flags & MMC_DATA_READ) { if (flags & MMC_DATA_READ) {
if (flags & MMC_DATA_MULTI) if (data->blocks > 1)
mmccmd |= SD_CMD_CT_4; mmccmd |= SD_CMD_CT_4;
else else
mmccmd |= SD_CMD_CT_2; mmccmd |= SD_CMD_CT_2;
} else if (flags & MMC_DATA_WRITE) { } else if (flags & MMC_DATA_WRITE) {
if (flags & MMC_DATA_MULTI) if (data->blocks > 1)
mmccmd |= SD_CMD_CT_3; mmccmd |= SD_CMD_CT_3;
else else
mmccmd |= SD_CMD_CT_1; mmccmd |= SD_CMD_CT_1;
} }
}
au_writel(cmd->arg, HOST_CMDARG(host)); au_writel(cmd->arg, HOST_CMDARG(host));
au_sync(); au_sync();
...@@ -673,7 +675,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) ...@@ -673,7 +675,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
} }
if (!ret) if (!ret)
ret = au1xmmc_send_command(host, 0, mrq->cmd, flags); ret = au1xmmc_send_command(host, 0, mrq->cmd, mrq->data);
if (ret) { if (ret) {
mrq->cmd->error = ret; mrq->cmd->error = ret;
......
...@@ -83,7 +83,6 @@ struct mmc_data { ...@@ -83,7 +83,6 @@ struct mmc_data {
#define MMC_DATA_WRITE (1 << 8) #define MMC_DATA_WRITE (1 << 8)
#define MMC_DATA_READ (1 << 9) #define MMC_DATA_READ (1 << 9)
#define MMC_DATA_STREAM (1 << 10) #define MMC_DATA_STREAM (1 << 10)
#define MMC_DATA_MULTI (1 << 11)
unsigned int bytes_xfered; unsigned int bytes_xfered;
......
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