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/arm/mach-omap2/mmc-twl4030.c | |
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/arm/mach-omap2/mmc-twl4030.c')
-rw-r--r-- | arch/arm/mach-omap2/mmc-twl4030.c | 15 |
1 files changed, 15 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"); |