diff options
author | Denis Karpov <ext-denis.2.karpov@nokia.com> | 2009-09-22 19:44:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:34 -0400 |
commit | 1887bde391a3216789c9a03ac111d5f6ebfb0c00 (patch) | |
tree | cd37724ad4984f8bf2d469516e5338e0fcdcb721 /arch | |
parent | 5e2ea6173d71cee81e53da00911dcab8cc092acc (diff) |
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@nokia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Matt Fleming <matt@console-pimps.org>
Cc: Ian Molton <ian@mnementh.co.uk>
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Philip Langdale <philipl@overt.org>
Cc: "Madhusudhan" <madhu.cr@ti.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/mmc-twl4030.c | 15 | ||||
-rw-r--r-- | 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 3c04c2f1b23f..30d028627c5b 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c | |||
@@ -198,6 +198,18 @@ static int twl_mmc_resume(struct device *dev, int slot) | |||
198 | #define twl_mmc_resume NULL | 198 | #define twl_mmc_resume NULL |
199 | #endif | 199 | #endif |
200 | 200 | ||
201 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | ||
202 | |||
203 | static int twl4030_mmc_get_context_loss(struct device *dev) | ||
204 | { | ||
205 | /* FIXME: PM DPS not implemented yet */ | ||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | #else | ||
210 | #define twl4030_mmc_get_context_loss NULL | ||
211 | #endif | ||
212 | |||
201 | static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, | 213 | static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, |
202 | int vdd) | 214 | int vdd) |
203 | { | 215 | { |
@@ -390,6 +402,9 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | |||
390 | } else | 402 | } else |
391 | mmc->slots[0].switch_pin = -EINVAL; | 403 | mmc->slots[0].switch_pin = -EINVAL; |
392 | 404 | ||
405 | mmc->get_context_loss_count = | ||
406 | twl4030_mmc_get_context_loss; | ||
407 | |||
393 | /* write protect normally uses an OMAP gpio */ | 408 | /* write protect normally uses an OMAP gpio */ |
394 | if (gpio_is_valid(c->gpio_wp)) { | 409 | if (gpio_is_valid(c->gpio_wp)) { |
395 | gpio_request(c->gpio_wp, "mmc_wp"); | 410 | 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 81d5b36534b3..2f7cf31f9cd6 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 { | |||
59 | int (*suspend)(struct device *dev, int slot); | 59 | int (*suspend)(struct device *dev, int slot); |
60 | int (*resume)(struct device *dev, int slot); | 60 | int (*resume)(struct device *dev, int slot); |
61 | 61 | ||
62 | /* Return context loss count due to PM states changing */ | ||
63 | int (*get_context_loss_count)(struct device *dev); | ||
64 | |||
62 | u64 dma_mask; | 65 | u64 dma_mask; |
63 | 66 | ||
64 | struct omap_mmc_slot_data { | 67 | struct omap_mmc_slot_data { |