Commit 261bbd463a091b939770255d559bbc89b1bad568

Authored by Philip Rakity
Committed by Chris Ball
1 parent 756515c626

mmc: core: eMMC signal voltage does not use CMD11

eMMC chips do not use CMD11 when changing voltage.  Add extra
argument to call to indicate if CMD11 needs to be sent.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

Showing 3 changed files with 6 additions and 5 deletions Side-by-side Diff

drivers/mmc/core/core.c
... ... @@ -942,7 +942,7 @@
942 942 return ocr;
943 943 }
944 944  
945   -int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
  945 +int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, bool cmd11)
946 946 {
947 947 struct mmc_command cmd = {0};
948 948 int err = 0;
... ... @@ -953,7 +953,7 @@
953 953 * Send CMD11 only if the request is to switch the card to
954 954 * 1.8V signalling.
955 955 */
956   - if (signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
  956 + if ((signal_voltage != MMC_SIGNAL_VOLTAGE_330) && cmd11) {
957 957 cmd.opcode = SD_SWITCH_VOLTAGE;
958 958 cmd.arg = 0;
959 959 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
drivers/mmc/core/core.h
... ... @@ -41,7 +41,8 @@
41 41 void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
42 42 unsigned int ddr);
43 43 u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
44   -int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage);
  44 +int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage,
  45 + bool cmd11);
45 46 void mmc_set_timing(struct mmc_host *host, unsigned int timing);
46 47 void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
47 48  
drivers/mmc/core/sd.c
... ... @@ -725,7 +725,7 @@
725 725 */
726 726 if (!mmc_host_is_spi(host) && rocr &&
727 727 ((*rocr & 0x41000000) == 0x41000000)) {
728   - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180);
  728 + err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, true);
729 729 if (err) {
730 730 ocr &= ~SD_OCR_S18R;
731 731 goto try_again;
... ... @@ -1098,7 +1098,7 @@
1098 1098 WARN_ON(!host->claimed);
1099 1099  
1100 1100 /* Make sure we are at 3.3V signalling voltage */
1101   - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330);
  1101 + err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, false);
1102 1102 if (err)
1103 1103 return err;
1104 1104