Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46207
b: refs/heads/master
c: dba4acc
h: refs/heads/master
i:
  46205: 39bd523
  46203: c6a3738
  46199: f2350a6
  46191: be87466
  46175: 2b93910
  46143: b56e0b5
  46079: a05d720
v: v3
  • Loading branch information
Alex Dubov authored and Pierre Ossman committed Feb 4, 2007
1 parent 28a6ebc commit f8b0fbc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 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: 41d78f7405659b55e082c5f0b3d1b625e75e1294
refs/heads/master: dba4accab17bd2e2e09088f746257a8c14af1cc2
39 changes: 38 additions & 1 deletion trunk/drivers/mmc/tifm_sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,41 @@ static void tifm_sd_remove(struct tifm_dev *sock)
mmc_free_host(mmc);
}

#ifdef CONFIG_PM

static int tifm_sd_suspend(struct tifm_dev *sock, pm_message_t state)
{
struct mmc_host *mmc = tifm_get_drvdata(sock);
int rc;

rc = mmc_suspend_host(mmc, state);
/* The meaning of the bit majority in this constant is unknown. */
writel(0xfff8 & readl(sock->addr + SOCK_CONTROL),
sock->addr + SOCK_CONTROL);
return rc;
}

static int tifm_sd_resume(struct tifm_dev *sock)
{
struct mmc_host *mmc = tifm_get_drvdata(sock);
struct tifm_sd *host = mmc_priv(mmc);

if (sock->media_id != FM_SD
|| tifm_sd_initialize_host(host)) {
tifm_eject(sock);
return 0;
} else {
return mmc_resume_host(mmc);
}
}

#else

#define tifm_sd_suspend NULL
#define tifm_sd_resume NULL

#endif /* CONFIG_PM */

static tifm_media_id tifm_sd_id_tbl[] = {
FM_SD, 0
};
Expand All @@ -932,7 +967,9 @@ static struct tifm_driver tifm_sd_driver = {
},
.id_table = tifm_sd_id_tbl,
.probe = tifm_sd_probe,
.remove = tifm_sd_remove
.remove = tifm_sd_remove,
.suspend = tifm_sd_suspend,
.resume = tifm_sd_resume
};

static int __init tifm_sd_init(void)
Expand Down

0 comments on commit f8b0fbc

Please sign in to comment.