Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228900
b: refs/heads/master
c: 080bc97
h: refs/heads/master
v: v3
  • Loading branch information
Ohad Ben-Cohen authored and Chris Ball committed Jan 9, 2011
1 parent a5c3f82 commit 90f9656
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e594573d790bd7e269f05955d316b88f7be0c14a
refs/heads/master: 080bc9774b6f1e3866747b18631bad26f47c22ce
16 changes: 14 additions & 2 deletions trunk/drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,15 +627,27 @@ static int mmc_sdio_suspend(struct mmc_host *host)

static int mmc_sdio_resume(struct mmc_host *host)
{
int i, err;
int i, err = 0;

BUG_ON(!host);
BUG_ON(!host->card);

/* Basic card reinitialization. */
mmc_claim_host(host);
err = mmc_sdio_init_card(host, host->ocr, host->card,

/* No need to reinitialize powered-resumed nonremovable cards */
if (mmc_card_is_removable(host) || !mmc_card_is_powered_resumed(host))
err = mmc_sdio_init_card(host, host->ocr, host->card,
(host->pm_flags & MMC_PM_KEEP_POWER));
else if (mmc_card_is_powered_resumed(host)) {
/* We may have switched to 1-bit mode during suspend */
err = sdio_enable_4bit_bus(host->card);
if (err > 0) {
mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
err = 0;
}
}

if (!err && host->sdio_irqs)
mmc_signal_sdio_irq(host);
mmc_release_host(host);
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,10 @@ static inline int mmc_card_is_removable(struct mmc_host *host)
return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable;
}

static inline int mmc_card_is_powered_resumed(struct mmc_host *host)
{
return host->pm_flags & MMC_PM_KEEP_POWER;
}

#endif

0 comments on commit 90f9656

Please sign in to comment.