提交 2ed573b6 编写于 作者: U Ulf Hansson

mmc: core: Clarify usage of mmc_set_signal_voltage()

The mmc_set_signal_voltage() function is used for SD/SDIO when switching to
1.8V for UHS mode. To clarify this let's do the following changes.

- We are always providing MMC_SIGNAL_VOLTAGE_180 as the signal_voltage
  parameter to the function. Then, let's just remove the parameter as it
  serves no purpose.
- Rename the function to mmc_set_uhs_voltage().
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: NShawn Lin <shawn.lin@rock-chips.com>
Tested-by: NJan Glauber <jglauber@cavium.com>
Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
上级 a44efa47
...@@ -1647,7 +1647,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) ...@@ -1647,7 +1647,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
} }
int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr)
{ {
struct mmc_command cmd = {}; struct mmc_command cmd = {};
int err = 0; int err = 0;
...@@ -1691,7 +1691,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) ...@@ -1691,7 +1691,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr)
host->ios.clock = 0; host->ios.clock = 0;
mmc_set_ios(host); mmc_set_ios(host);
if (__mmc_set_signal_voltage(host, signal_voltage)) { if (__mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) {
/* /*
* Voltages may not have been switched, but we've already * Voltages may not have been switched, but we've already
* sent CMD11, so a power cycle is required anyway * sent CMD11, so a power cycle is required anyway
......
...@@ -48,7 +48,7 @@ void mmc_set_clock(struct mmc_host *host, unsigned int hz); ...@@ -48,7 +48,7 @@ void mmc_set_clock(struct mmc_host *host, unsigned int hz);
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
void mmc_set_bus_width(struct mmc_host *host, unsigned int width); void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr); int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr);
int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage); int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage);
void mmc_set_timing(struct mmc_host *host, unsigned int timing); void mmc_set_timing(struct mmc_host *host, unsigned int timing);
void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
......
...@@ -788,8 +788,7 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr) ...@@ -788,8 +788,7 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
*/ */
if (!mmc_host_is_spi(host) && rocr && if (!mmc_host_is_spi(host) && rocr &&
((*rocr & 0x41000000) == 0x41000000)) { ((*rocr & 0x41000000) == 0x41000000)) {
err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, err = mmc_set_uhs_voltage(host, pocr);
pocr);
if (err == -EAGAIN) { if (err == -EAGAIN) {
retries--; retries--;
goto try_again; goto try_again;
......
...@@ -642,8 +642,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, ...@@ -642,8 +642,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
* to make sure which speed mode should work. * to make sure which speed mode should work.
*/ */
if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) { if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) {
err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, err = mmc_set_uhs_voltage(host, ocr_card);
ocr_card);
if (err == -EAGAIN) { if (err == -EAGAIN) {
mmc_sdio_resend_if_cond(host, card); mmc_sdio_resend_if_cond(host, card);
retries--; retries--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册