Commit 8af465db authored by Roger Tseng's avatar Roger Tseng Committed by Ulf Hansson

mmc: core: Add new power_mode MMC_POWER_UNDEFINED

Add MMC_POWER_UNDEFINED for power_mode in struct mmc_ios and use it as
the initial value of host->ios.power_mode.

For hosts with MMC_CAP2_NO_PRESCAN_POWERUP, this makes the later
mmc_power_off() do real power-off things instead of NOP, and further
prevents state messed up in cards that was already initialized (eg. by
BIOS of UEFI driver).
Signed-off-by: default avatarRoger Tseng <rogerable@realtek.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 7756a96d
...@@ -2482,6 +2482,7 @@ void mmc_start_host(struct mmc_host *host) ...@@ -2482,6 +2482,7 @@ void mmc_start_host(struct mmc_host *host)
{ {
host->f_init = max(freqs[0], host->f_min); host->f_init = max(freqs[0], host->f_min);
host->rescan_disable = 0; host->rescan_disable = 0;
host->ios.power_mode = MMC_POWER_UNDEFINED;
if (host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP) if (host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)
mmc_power_off(host); mmc_power_off(host);
else else
......
...@@ -42,6 +42,7 @@ struct mmc_ios { ...@@ -42,6 +42,7 @@ struct mmc_ios {
#define MMC_POWER_OFF 0 #define MMC_POWER_OFF 0
#define MMC_POWER_UP 1 #define MMC_POWER_UP 1
#define MMC_POWER_ON 2 #define MMC_POWER_ON 2
#define MMC_POWER_UNDEFINED 3
unsigned char bus_width; /* data bus width */ unsigned char bus_width; /* data bus width */
......
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