Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Jan Glauber <jglauber@cavium.com>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

+5 -7
+2 -2
drivers/mmc/core/core.c
··· 1647 1647 1648 1648 } 1649 1649 1650 - int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) 1650 + int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) 1651 1651 { 1652 1652 struct mmc_command cmd = {}; 1653 1653 int err = 0; ··· 1691 1691 host->ios.clock = 0; 1692 1692 mmc_set_ios(host); 1693 1693 1694 - if (__mmc_set_signal_voltage(host, signal_voltage)) { 1694 + if (__mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) { 1695 1695 /* 1696 1696 * Voltages may not have been switched, but we've already 1697 1697 * sent CMD11, so a power cycle is required anyway
+1 -1
drivers/mmc/core/core.h
··· 48 48 void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); 49 49 void mmc_set_bus_width(struct mmc_host *host, unsigned int width); 50 50 u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); 51 - int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr); 51 + int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr); 52 52 int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage); 53 53 void mmc_set_timing(struct mmc_host *host, unsigned int timing); 54 54 void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
+1 -2
drivers/mmc/core/sd.c
··· 788 788 */ 789 789 if (!mmc_host_is_spi(host) && rocr && 790 790 ((*rocr & 0x41000000) == 0x41000000)) { 791 - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 792 - pocr); 791 + err = mmc_set_uhs_voltage(host, pocr); 793 792 if (err == -EAGAIN) { 794 793 retries--; 795 794 goto try_again;
+1 -2
drivers/mmc/core/sdio.c
··· 642 642 * to make sure which speed mode should work. 643 643 */ 644 644 if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) { 645 - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 646 - ocr_card); 645 + err = mmc_set_uhs_voltage(host, ocr_card); 647 646 if (err == -EAGAIN) { 648 647 mmc_sdio_resend_if_cond(host, card); 649 648 retries--;