summaryrefslogtreecommitdiff
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-07-30 07:55:28 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:37:58 -0800
commitbeb9eb38c6eb46c3ba9028356c3abe8d2f62cafd (patch)
treeb2278cd168288c5cf11f97aef10149584b00afc9 /include/linux/mmc
parent46c813f9a973671e2b25a1bd1cb2732eaafd49b8 (diff)
mmc: core: Add deferred bus resume policy.
A card driver can now specify that the underlying bus should *not* auto-resume with the rest of the system. This is useful for reducing resume latency as well as saving power when the card driver is not using the bus. In the future, we'll add support for manual suspend Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/host.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index fb29e2261fe4..3926a7487426 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -284,6 +284,10 @@ struct mmc_host {
const struct mmc_bus_ops *bus_ops; /* current bus driver */
unsigned int bus_refs; /* reference counter */
+ unsigned int bus_resume_flags;
+#define MMC_BUSRESUME_MANUAL_RESUME (1 << 0)
+#define MMC_BUSRESUME_NEEDS_RESUME (1 << 1)
+
unsigned int sdio_irqs;
struct task_struct *sdio_irq_thread;
atomic_t sdio_irq_thread_abort;
@@ -337,6 +341,17 @@ static inline void *mmc_priv(struct mmc_host *host)
#define mmc_dev(x) ((x)->parent)
#define mmc_classdev(x) (&(x)->class_dev)
#define mmc_hostname(x) (dev_name(&(x)->class_dev))
+#define mmc_bus_needs_resume(host) ((host)->bus_resume_flags & MMC_BUSRESUME_NEEDS_RESUME)
+
+static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual)
+{
+ if (manual)
+ host->bus_resume_flags |= MMC_BUSRESUME_MANUAL_RESUME;
+ else
+ host->bus_resume_flags &= ~MMC_BUSRESUME_MANUAL_RESUME;
+}
+
+extern int mmc_resume_bus(struct mmc_host *host);
extern int mmc_suspend_host(struct mmc_host *);
extern int mmc_resume_host(struct mmc_host *);