diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/mmc.c | 10 | ||||
-rw-r--r-- | drivers/mmc/mmc_block.c | 14 |
2 files changed, 18 insertions, 6 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index b586a83a9b4c..eb41391e06e9 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -679,7 +679,15 @@ static void mmc_idle_cards(struct mmc_host *host) | |||
679 | } | 679 | } |
680 | 680 | ||
681 | /* | 681 | /* |
682 | * Apply power to the MMC stack. | 682 | * Apply power to the MMC stack. This is a two-stage process. |
683 | * First, we enable power to the card without the clock running. | ||
684 | * We then wait a bit for the power to stabilise. Finally, | ||
685 | * enable the bus drivers and clock to the card. | ||
686 | * | ||
687 | * We must _NOT_ enable the clock prior to power stablising. | ||
688 | * | ||
689 | * If a host does all the power sequencing itself, ignore the | ||
690 | * initial MMC_POWER_UP stage. | ||
683 | */ | 691 | */ |
684 | static void mmc_power_up(struct mmc_host *host) | 692 | static void mmc_power_up(struct mmc_host *host) |
685 | { | 693 | { |
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index d91fcf7c3178..abcf19116d70 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c | |||
@@ -359,7 +359,12 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) | |||
359 | md->block_bits = card->csd.read_blkbits; | 359 | md->block_bits = card->csd.read_blkbits; |
360 | 360 | ||
361 | blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); | 361 | blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); |
362 | set_capacity(md->disk, card->csd.capacity); | 362 | |
363 | /* | ||
364 | * The CSD capacity field is in units of read_blkbits. | ||
365 | * set_capacity takes units of 512 bytes. | ||
366 | */ | ||
367 | set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9)); | ||
363 | } | 368 | } |
364 | out: | 369 | out: |
365 | return md; | 370 | return md; |
@@ -373,7 +378,7 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) | |||
373 | 378 | ||
374 | mmc_card_claim_host(card); | 379 | mmc_card_claim_host(card); |
375 | cmd.opcode = MMC_SET_BLOCKLEN; | 380 | cmd.opcode = MMC_SET_BLOCKLEN; |
376 | cmd.arg = 1 << card->csd.read_blkbits; | 381 | cmd.arg = 1 << md->block_bits; |
377 | cmd.flags = MMC_RSP_R1; | 382 | cmd.flags = MMC_RSP_R1; |
378 | err = mmc_wait_for_cmd(card->host, &cmd, 5); | 383 | err = mmc_wait_for_cmd(card->host, &cmd, 5); |
379 | mmc_card_release_host(card); | 384 | mmc_card_release_host(card); |
@@ -412,10 +417,9 @@ static int mmc_blk_probe(struct mmc_card *card) | |||
412 | if (err) | 417 | if (err) |
413 | goto out; | 418 | goto out; |
414 | 419 | ||
415 | printk(KERN_INFO "%s: %s %s %dKiB %s\n", | 420 | printk(KERN_INFO "%s: %s %s %luKiB %s\n", |
416 | md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), | 421 | md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), |
417 | (card->csd.capacity << card->csd.read_blkbits) / 1024, | 422 | get_capacity(md->disk) >> 1, mmc_blk_readonly(card)?"(ro)":""); |
418 | mmc_blk_readonly(card)?"(ro)":""); | ||
419 | 423 | ||
420 | mmc_set_drvdata(card, md); | 424 | mmc_set_drvdata(card, md); |
421 | add_disk(md->disk); | 425 | add_disk(md->disk); |