59 lines
1.5 KiB
Diff
59 lines
1.5 KiB
Diff
From 592630a4362674aaaa3791bf107e57dbe3d4f0cf Mon Sep 17 00:00:00 2001
|
|
From: Neil Armstrong <narmstrong@baylibre.com>
|
|
Date: Thu, 16 Apr 2020 08:31:55 +0000
|
|
Subject: [PATCH 06/88] HACK: mmc: core: always re-init sdcards to set default
|
|
3.3v regulator ios
|
|
|
|
sd-uhs-** in device-tree changes the voltage to 1.8v, so we need to ensure
|
|
the card is reset to 3.3v before rebooting else on reboot there is no card
|
|
to boot from.
|
|
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
---
|
|
drivers/mmc/core/sd.c | 22 +++++++++++++++++++++-
|
|
1 file changed, 21 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
|
|
index 6f054c449d46..5eeccc8b1e00 100644
|
|
--- a/drivers/mmc/core/sd.c
|
|
+++ b/drivers/mmc/core/sd.c
|
|
@@ -1245,6 +1245,26 @@ static int mmc_sd_suspend(struct mmc_host *host)
|
|
return err;
|
|
}
|
|
|
|
+/*
|
|
+ * Callback for shutdown
|
|
+ */
|
|
+static int mmc_sd_shutdown(struct mmc_host *host)
|
|
+{
|
|
+ mmc_claim_host(host);
|
|
+
|
|
+ if (mmc_card_suspended(host->card))
|
|
+ goto out;
|
|
+
|
|
+ mmc_power_off(host);
|
|
+ mmc_card_set_suspended(host->card);
|
|
+
|
|
+ pm_runtime_disable(&host->card->dev);
|
|
+ pm_runtime_set_suspended(&host->card->dev);
|
|
+
|
|
+out:
|
|
+ return 0;
|
|
+}
|
|
+
|
|
/*
|
|
* This function tries to determine if the same card is still present
|
|
* and, if so, restore all state to it.
|
|
@@ -1323,7 +1343,7 @@ static const struct mmc_bus_ops mmc_sd_ops = {
|
|
.suspend = mmc_sd_suspend,
|
|
.resume = mmc_sd_resume,
|
|
.alive = mmc_sd_alive,
|
|
- .shutdown = mmc_sd_suspend,
|
|
+ .shutdown = mmc_sd_shutdown,
|
|
.hw_reset = mmc_sd_hw_reset,
|
|
};
|
|
|
|
--
|
|
2.17.1
|
|
|