aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@nokia.com>2010-08-24 06:20:26 -0400
committerChris Ball <cjb@laptop.org>2010-10-23 09:11:16 -0400
commit0f8d8ea64ec7c77ca5beb59534d386fe0235961a (patch)
tree8d6aebd250897aa33cb166994720497f40a9aaa6 /drivers/mmc/card/block.c
parentdfc13e8402c75e7c2e0a52e123c0500a3259866b (diff)
mmc: Fixes for Dual Data Rate (DDR) support
The DDR support patch needs the following fixes: - The block driver does not need to know about DDR, any more than it needs to know about bus width. - Not only the card must be switched to DDR mode. The host controller must also be configured, which is done through the 'set_ios()' function. - Do not set the DDR mode state until after the switch command is successful. - Setting block length is not supported in DDR mode. Make that a core function and change the other place it is used (mmc_test) also. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index aab593480975..a9970504cabb 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -373,8 +373,6 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
373 readcmd = MMC_READ_SINGLE_BLOCK; 373 readcmd = MMC_READ_SINGLE_BLOCK;
374 writecmd = MMC_WRITE_BLOCK; 374 writecmd = MMC_WRITE_BLOCK;
375 } 375 }
376 if (mmc_card_ddr_mode(card))
377 brq.data.flags |= MMC_DDR_MODE;
378 if (rq_data_dir(req) == READ) { 376 if (rq_data_dir(req) == READ) {
379 brq.cmd.opcode = readcmd; 377 brq.cmd.opcode = readcmd;
380 brq.data.flags |= MMC_DATA_READ; 378 brq.data.flags |= MMC_DATA_READ;
@@ -653,26 +651,15 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
653static int 651static int
654mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) 652mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
655{ 653{
656 struct mmc_command cmd;
657 int err; 654 int err;
658 655
659 /*
660 * Block-addressed and ddr mode supported cards
661 * ignore MMC_SET_BLOCKLEN.
662 */
663 if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
664 return 0;
665
666 mmc_claim_host(card->host); 656 mmc_claim_host(card->host);
667 cmd.opcode = MMC_SET_BLOCKLEN; 657 err = mmc_set_blocklen(card, 512);
668 cmd.arg = 512;
669 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
670 err = mmc_wait_for_cmd(card->host, &cmd, 5);
671 mmc_release_host(card->host); 658 mmc_release_host(card->host);
672 659
673 if (err) { 660 if (err) {
674 printk(KERN_ERR "%s: unable to set block size to %d: %d\n", 661 printk(KERN_ERR "%s: unable to set block size to 512: %d\n",
675 md->disk->disk_name, cmd.arg, err); 662 md->disk->disk_name, err);
676 return -EINVAL; 663 return -EINVAL;
677 } 664 }
678 665