|
@@ -1957,19 +1957,17 @@ static int mmc_reset(struct mmc_host *host)
|
|
|
{
|
|
|
struct mmc_card *card = host->card;
|
|
|
|
|
|
- if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
|
|
|
- return -EOPNOTSUPP;
|
|
|
-
|
|
|
- if (!mmc_can_reset(card))
|
|
|
- return -EOPNOTSUPP;
|
|
|
-
|
|
|
- mmc_set_clock(host, host->f_init);
|
|
|
-
|
|
|
- host->ops->hw_reset(host);
|
|
|
-
|
|
|
- /* Set initial state and call mmc_set_ios */
|
|
|
- mmc_set_initial_state(host);
|
|
|
-
|
|
|
+ if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
|
|
|
+ mmc_can_reset(card)) {
|
|
|
+ /* If the card accept RST_n signal, send it. */
|
|
|
+ mmc_set_clock(host, host->f_init);
|
|
|
+ host->ops->hw_reset(host);
|
|
|
+ /* Set initial state and call mmc_set_ios */
|
|
|
+ mmc_set_initial_state(host);
|
|
|
+ } else {
|
|
|
+ /* Do a brute force power cycle */
|
|
|
+ mmc_power_cycle(host, card->ocr);
|
|
|
+ }
|
|
|
return mmc_init_card(host, card->ocr, card);
|
|
|
}
|
|
|
|