aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/mmc_block.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-02-17 16:15:27 -0500
committerPierre Ossman <drzeus@drzeus.cx>2007-05-01 07:04:15 -0400
commit85a18ad93ec66888d85758630019b10a84257f3c (patch)
tree46b1b7f72a8d4baac51916ca4ea09884ed043822 /drivers/mmc/mmc_block.c
parentde85989511f3a0e15b04d18582b23d428d6ddbbd (diff)
mmc: MMC sector based cards
Support for MMC 4.2 sector based cards. This tweaks the init a bit and reads a new field out of the EXT_CSD. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/mmc_block.c')
-rw-r--r--drivers/mmc/mmc_block.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index 95b0da6abe87..63fbde8756ac 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -491,11 +491,20 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
491 491
492 blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); 492 blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits);
493 493
494 /* 494 if (!mmc_card_sd(card) && mmc_card_blockaddr(card)) {
495 * The CSD capacity field is in units of read_blkbits. 495 /*
496 * set_capacity takes units of 512 bytes. 496 * The EXT_CSD sector count is in number or 512 byte
497 */ 497 * sectors.
498 set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9)); 498 */
499 set_capacity(md->disk, card->ext_csd.sectors);
500 } else {
501 /*
502 * The CSD capacity field is in units of read_blkbits.
503 * set_capacity takes units of 512 bytes.
504 */
505 set_capacity(md->disk,
506 card->csd.capacity << (card->csd.read_blkbits - 9));
507 }
499 return md; 508 return md;
500 509
501 err_putdisk: 510 err_putdisk: