[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090710124123.1262.89652.sendpatchset@ahunter-tower>
Date: Fri, 10 Jul 2009 15:41:23 +0300
From: Adrian Hunter <adrian.hunter@...ia.com>
To: Pierre Ossman <pierre@...man.eu>
Cc: Jarkko Lavinen <jarkko.lavinen@...ia.com>,
Denis Karpov <ext-denis.2.karpov@...ia.com>,
Adrian Hunter <adrian.hunter@...ia.com>,
linux-omap Mailing List <linux-omap@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH 11/32] ARM: OMAP: mmc-twl4030: add context loss counter support
>From 57e1d1301b974e57f65a8f7b1287629b3c97a3b8 Mon Sep 17 00:00:00 2001
From: Denis Karpov <ext-denis.2.karpov@...ia.com>
Date: Tue, 7 Jul 2009 15:54:44 +0300
Subject: [PATCH] ARM: OMAP: mmc-twl4030: add context loss counter support
PM dynamic OFF state results in context loss. That is, the host
controller has been powered off at some point, which means the
registers have been reset. The driver must detect when this
happens, and restore the context. This patch adds the means
to detect context loss.
Note, the PM side is not yet implemented.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@...ia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@...ia.com>
---
arch/arm/mach-omap2/mmc-twl4030.c | 15 +++++++++++++++
arch/arm/plat-omap/include/mach/mmc.h | 3 +++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 1541fd4..5be3111 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -192,6 +192,18 @@ static int twl_mmc_resume(struct device *dev, int slot)
#define twl_mmc_resume NULL
#endif
+#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
+
+static int twl4030_mmc_get_context_loss(struct device *dev)
+{
+ /* FIXME: PM DPS not implemented yet */
+ return 0;
+}
+
+#else
+#define twl4030_mmc_get_context_loss NULL
+#endif
+
static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
int vdd)
{
@@ -384,6 +396,9 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
} else
mmc->slots[0].switch_pin = -EINVAL;
+ mmc->get_context_loss_count =
+ twl4030_mmc_get_context_loss;
+
/* write protect normally uses an OMAP gpio */
if (gpio_is_valid(c->gpio_wp)) {
gpio_request(c->gpio_wp, "mmc_wp");
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
index 81d5b36..2f7cf31 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -59,6 +59,9 @@ struct omap_mmc_platform_data {
int (*suspend)(struct device *dev, int slot);
int (*resume)(struct device *dev, int slot);
+ /* Return context loss count due to PM states changing */
+ int (*get_context_loss_count)(struct device *dev);
+
u64 dma_mask;
struct omap_mmc_slot_data {
--
1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists