Commit 0f791fda authored by Ulf Hansson's avatar Ulf Hansson Committed by Chris Ball

mmc: core: Let mmc_set_signal_voltage take ocr as parameter

This is yet another step of restructure code to be able to fixup the
setup of the negotiated ocr mask.
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 4a065193
...@@ -1397,7 +1397,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) ...@@ -1397,7 +1397,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) int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr)
{ {
struct mmc_command cmd = {0}; struct mmc_command cmd = {0};
int err = 0; int err = 0;
...@@ -1479,7 +1479,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) ...@@ -1479,7 +1479,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
if (err) { if (err) {
pr_debug("%s: Signal voltage switch failed, " pr_debug("%s: Signal voltage switch failed, "
"power cycling card\n", mmc_hostname(host)); "power cycling card\n", mmc_hostname(host));
mmc_power_cycle(host, host->ocr); mmc_power_cycle(host, ocr);
} }
mmc_host_clk_release(host); mmc_host_clk_release(host);
......
...@@ -42,7 +42,7 @@ void mmc_set_ungated(struct mmc_host *host); ...@@ -42,7 +42,7 @@ void mmc_set_ungated(struct mmc_host *host);
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); int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, 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);
......
...@@ -773,7 +773,8 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr) ...@@ -773,7 +773,8 @@ 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_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
host->ocr);
if (err == -EAGAIN) { if (err == -EAGAIN) {
retries--; retries--;
goto try_again; goto try_again;
......
...@@ -664,7 +664,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, ...@@ -664,7 +664,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
* it. * it.
*/ */
if (!powered_resume && (ocr & R4_18V_PRESENT) && mmc_host_uhs(host)) { if (!powered_resume && (ocr & R4_18V_PRESENT) && mmc_host_uhs(host)) {
err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180); err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
host->ocr);
if (err == -EAGAIN) { if (err == -EAGAIN) {
sdio_reset(host); sdio_reset(host);
mmc_go_idle(host); mmc_go_idle(host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment