diff options
author | Johan Rudholm <johan.rudholm@axis.com> | 2015-01-12 09:38:06 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-19 03:56:28 -0500 |
commit | dc0ecfef29c60d3765f8e7991b3a4527733238b1 (patch) | |
tree | 7211940653a7201ad99cc07df6f243619bf71851 /drivers/mmc/core | |
parent | f855a3717eaff1179837060c4796f1cd706331e7 (diff) |
mmc: sd: add reset bus_ops callback
Enable power cycle and re-initialization of SD cards via the reset
bus_ops. Power cycling a buggy SD card sometimes helps it get back on
track.
Signed-off-by: Johan Rudholm <johanru@axis.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/sd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 29fccdcacd68..36d5333838cb 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -1197,6 +1197,12 @@ static int mmc_sd_power_restore(struct mmc_host *host) | |||
1197 | return ret; | 1197 | return ret; |
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | static int mmc_sd_reset(struct mmc_host *host) | ||
1201 | { | ||
1202 | mmc_power_cycle(host, host->card->ocr); | ||
1203 | return mmc_sd_power_restore(host); | ||
1204 | } | ||
1205 | |||
1200 | static const struct mmc_bus_ops mmc_sd_ops = { | 1206 | static const struct mmc_bus_ops mmc_sd_ops = { |
1201 | .remove = mmc_sd_remove, | 1207 | .remove = mmc_sd_remove, |
1202 | .detect = mmc_sd_detect, | 1208 | .detect = mmc_sd_detect, |
@@ -1207,6 +1213,7 @@ static const struct mmc_bus_ops mmc_sd_ops = { | |||
1207 | .power_restore = mmc_sd_power_restore, | 1213 | .power_restore = mmc_sd_power_restore, |
1208 | .alive = mmc_sd_alive, | 1214 | .alive = mmc_sd_alive, |
1209 | .shutdown = mmc_sd_suspend, | 1215 | .shutdown = mmc_sd_suspend, |
1216 | .reset = mmc_sd_reset, | ||
1210 | }; | 1217 | }; |
1211 | 1218 | ||
1212 | /* | 1219 | /* |