Skip to contentSkip to conversation

mmc: sdio: add reset callback to bus operations

PATCH Applied Andreas Fenkart 2 participants 2 messages Apr 23, 2015 – May 5, 2015 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mmc: sdio: add reset callback to bus operations

Some drivers schedule automatic hw resets. An example is mwifiex, which schedules a card reset if the command handler between driver and card firmware becomes out of sync

---
 drivers/mmc/core/sdio.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/mmc/core/sdio.c +7 -0
index ce6cc47..01255ef 100644
@@ -1064,6 +1064,12 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host)
 	return mmc_sdio_power_restore(host);
 }
 
+static int mmc_sdio_reset(struct mmc_host *host)
+{
+	mmc_power_cycle(host, host->card->ocr);
+	return mmc_sdio_power_restore(host);
+}
+
 static const struct mmc_bus_ops mmc_sdio_ops = {
 	.remove = mmc_sdio_remove,
 	.detect = mmc_sdio_detect,
@@ -1074,6 +1080,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = {
 	.runtime_resume = mmc_sdio_runtime_resume,
 	.power_restore = mmc_sdio_power_restore,
 	.alive = mmc_sdio_alive,
+	.reset = mmc_sdio_reset,
 };
 
 
Signature · 1 line
2.1.4
Applied
#1 lore raw
Quoted 5 lines · Andreas Fenkart

Some drivers schedule automatic hw resets. An example is mwifiex, which schedules a card reset if the command handler between driver and card firmware becomes out of sync

Thanks, applied!

Kind regards
Uffe

Quoted 32 lines
---
 drivers/mmc/core/sdio.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/mmc/core/sdio.c +7 -1
index ce6cc47..01255ef 100644
@@ -1064,6 +1064,12 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host)
        return mmc_sdio_power_restore(host);
 }
 
+static int mmc_sdio_reset(struct mmc_host *host)
+{
+       mmc_power_cycle(host, host->card->ocr);
+       return mmc_sdio_power_restore(host);
+}
+
 static const struct mmc_bus_ops mmc_sdio_ops = {
        .remove = mmc_sdio_remove,
        .detect = mmc_sdio_detect,
@@ -1074,6 +1080,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = {
        .runtime_resume = mmc_sdio_runtime_resume,
        .power_restore = mmc_sdio_power_restore,
        .alive = mmc_sdio_alive,
+       .reset = mmc_sdio_reset,
 };
 
 
--

2.1.4