diff options
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 46029d5c036..7cb352b3b24 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -651,14 +651,23 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) | |||
651 | } | 651 | } |
652 | 652 | ||
653 | /* | 653 | /* |
654 | * Change data bus width of a host. | 654 | * Change data bus width and DDR mode of a host. |
655 | */ | 655 | */ |
656 | void mmc_set_bus_width(struct mmc_host *host, unsigned int width) | 656 | void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr) |
657 | { | 657 | { |
658 | host->ios.bus_width = width; | 658 | host->ios.bus_width = width; |
659 | host->ios.ddr = ddr ? MMC_DDR_MODE : MMC_SDR_MODE; | ||
659 | mmc_set_ios(host); | 660 | mmc_set_ios(host); |
660 | } | 661 | } |
661 | 662 | ||
663 | /* | ||
664 | * Change data bus width of a host. | ||
665 | */ | ||
666 | void mmc_set_bus_width(struct mmc_host *host, unsigned int width) | ||
667 | { | ||
668 | mmc_set_bus_width_ddr(host, width, 0); | ||
669 | } | ||
670 | |||
662 | /** | 671 | /** |
663 | * mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number | 672 | * mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number |
664 | * @vdd: voltage (mV) | 673 | * @vdd: voltage (mV) |
@@ -1399,6 +1408,21 @@ int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | |||
1399 | } | 1408 | } |
1400 | EXPORT_SYMBOL(mmc_erase_group_aligned); | 1409 | EXPORT_SYMBOL(mmc_erase_group_aligned); |
1401 | 1410 | ||
1411 | int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen) | ||
1412 | { | ||
1413 | struct mmc_command cmd; | ||
1414 | |||
1415 | if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card)) | ||
1416 | return 0; | ||
1417 | |||
1418 | memset(&cmd, 0, sizeof(struct mmc_command)); | ||
1419 | cmd.opcode = MMC_SET_BLOCKLEN; | ||
1420 | cmd.arg = blocklen; | ||
1421 | cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; | ||
1422 | return mmc_wait_for_cmd(card->host, &cmd, 5); | ||
1423 | } | ||
1424 | EXPORT_SYMBOL(mmc_set_blocklen); | ||
1425 | |||
1402 | void mmc_rescan(struct work_struct *work) | 1426 | void mmc_rescan(struct work_struct *work) |
1403 | { | 1427 | { |
1404 | struct mmc_host *host = | 1428 | struct mmc_host *host = |