diff options
author | Philip Rakity <prakity@marvell.com> | 2011-05-13 01:47:17 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-24 23:53:58 -0400 |
commit | 261bbd463a091b939770255d559bbc89b1bad568 (patch) | |
tree | 3d28f9b3d2da6677e6564c752bd15bd8d97a4db9 /drivers/mmc | |
parent | 756515c6267a580aecc67d114bb289dd30a466a1 (diff) |
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/core.c | 4 | ||||
-rw-r--r-- | drivers/mmc/core/core.h | 3 | ||||
-rw-r--r-- | drivers/mmc/core/sd.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 72e113e7f253..94c8d5a9ecae 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -942,7 +942,7 @@ u32 mmc_select_voltage(struct mmc_host *host, u32 ocr) | |||
942 | return ocr; | 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 | struct mmc_command cmd = {0}; | 947 | struct mmc_command cmd = {0}; |
948 | int err = 0; | 948 | int err = 0; |
@@ -953,7 +953,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) | |||
953 | * Send CMD11 only if the request is to switch the card to | 953 | * Send CMD11 only if the request is to switch the card to |
954 | * 1.8V signalling. | 954 | * 1.8V signalling. |
955 | */ | 955 | */ |
956 | if (signal_voltage == MMC_SIGNAL_VOLTAGE_180) { | 956 | if ((signal_voltage != MMC_SIGNAL_VOLTAGE_330) && cmd11) { |
957 | cmd.opcode = SD_SWITCH_VOLTAGE; | 957 | cmd.opcode = SD_SWITCH_VOLTAGE; |
958 | cmd.arg = 0; | 958 | cmd.arg = 0; |
959 | cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; | 959 | cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; |
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 93f33973de39..53d23c240324 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h | |||
@@ -41,7 +41,8 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width); | |||
41 | void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, | 41 | void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, |
42 | unsigned int ddr); | 42 | unsigned int ddr); |
43 | u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); | 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 | void mmc_set_timing(struct mmc_host *host, unsigned int timing); | 46 | void mmc_set_timing(struct mmc_host *host, unsigned int timing); |
46 | void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); | 47 | void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); |
47 | 48 | ||
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index b461b290ce25..596d0b9d30b8 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -725,7 +725,7 @@ try_again: | |||
725 | */ | 725 | */ |
726 | if (!mmc_host_is_spi(host) && rocr && | 726 | if (!mmc_host_is_spi(host) && rocr && |
727 | ((*rocr & 0x41000000) == 0x41000000)) { | 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 | if (err) { | 729 | if (err) { |
730 | ocr &= ~SD_OCR_S18R; | 730 | ocr &= ~SD_OCR_S18R; |
731 | goto try_again; | 731 | goto try_again; |
@@ -1098,7 +1098,7 @@ int mmc_attach_sd(struct mmc_host *host) | |||
1098 | WARN_ON(!host->claimed); | 1098 | WARN_ON(!host->claimed); |
1099 | 1099 | ||
1100 | /* Make sure we are at 3.3V signalling voltage */ | 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 | if (err) | 1102 | if (err) |
1103 | return err; | 1103 | return err; |
1104 | 1104 | ||