sdio.c (7fbbe725378d62c30a076742a60a7e1812a2515a) sdio.c (6ebc581c3f9e6fd11a1c9da492a5e05bbe96885a)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * linux/drivers/mmc/sdio.c
4 *
5 * Copyright 2006-2007 Pierre Ossman
6 */
7
8#include <linux/err.h>

--- 968 unchanged lines hidden (view full) ---

977
978static int mmc_sdio_resume(struct mmc_host *host)
979{
980 int err = 0;
981
982 /* Basic card reinitialization. */
983 mmc_claim_host(host);
984
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * linux/drivers/mmc/sdio.c
4 *
5 * Copyright 2006-2007 Pierre Ossman
6 */
7
8#include <linux/err.h>

--- 968 unchanged lines hidden (view full) ---

977
978static int mmc_sdio_resume(struct mmc_host *host)
979{
980 int err = 0;
981
982 /* Basic card reinitialization. */
983 mmc_claim_host(host);
984
985 /* Restore power if needed */
985 /*
986 * Restore power and reinitialize the card when needed. Note that a
987 * removable card is checked from a detect work later on in the resume
988 * process.
989 */
986 if (!mmc_card_keep_power(host)) {
987 mmc_power_up(host, host->card->ocr);
988 /*
989 * Tell runtime PM core we just powered up the card,
990 * since it still believes the card is powered off.
991 * Note that currently runtime PM is only enabled
992 * for SDIO cards that are MMC_CAP_POWER_OFF_CARD
993 */
994 if (host->caps & MMC_CAP_POWER_OFF_CARD) {
995 pm_runtime_disable(&host->card->dev);
996 pm_runtime_set_active(&host->card->dev);
997 pm_runtime_enable(&host->card->dev);
998 }
990 if (!mmc_card_keep_power(host)) {
991 mmc_power_up(host, host->card->ocr);
992 /*
993 * Tell runtime PM core we just powered up the card,
994 * since it still believes the card is powered off.
995 * Note that currently runtime PM is only enabled
996 * for SDIO cards that are MMC_CAP_POWER_OFF_CARD
997 */
998 if (host->caps & MMC_CAP_POWER_OFF_CARD) {
999 pm_runtime_disable(&host->card->dev);
1000 pm_runtime_set_active(&host->card->dev);
1001 pm_runtime_enable(&host->card->dev);
1002 }
999 }
1000
1001 /* No need to reinitialize powered-resumed nonremovable cards */
1002 if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) {
1003 err = mmc_sdio_reinit_card(host, mmc_card_keep_power(host));
1004 } else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) {
1003 err = mmc_sdio_reinit_card(host, 0);
1004 } else if (mmc_card_wake_sdio_irq(host)) {
1005 /* We may have switched to 1-bit mode during suspend */
1006 err = sdio_enable_4bit_bus(host->card);
1007 }
1008
1009 if (err)
1010 goto out;
1011
1012 /* Allow SDIO IRQs to be processed again. */

--- 204 unchanged lines hidden ---
1005 /* We may have switched to 1-bit mode during suspend */
1006 err = sdio_enable_4bit_bus(host->card);
1007 }
1008
1009 if (err)
1010 goto out;
1011
1012 /* Allow SDIO IRQs to be processed again. */

--- 204 unchanged lines hidden ---