aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/omap-pm-noop.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 19:14:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 19:14:26 -0500
commit075cb105cb6dcda8a585989ebd4a71f0b3c33f3e (patch)
tree288b8ceb07f2f9780c572ca8c15b9d3096928ba0 /arch/arm/plat-omap/omap-pm-noop.c
parenta3fbbde70a0cec017f2431e8f8de208708c76acc (diff)
parentd30cc16c8e48368e0518f4975a78711e53e14a0f (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (31 commits) ARM: OMAP: Fix export.h or module.h includes ARM: OMAP: omap_device: Include linux/export.h ARM: OMAP2: Fix H4 matrix keyboard warning ARM: OMAP1: Remove unused omap-alsa.h ARM: OMAP1: Fix warnings about enabling 32 KiHz timer ARM: OMAP2+: timer: Remove omap_device_pm_latency ARM: OMAP2+: clock data: Remove redundant timer clkdev ARM: OMAP: Devkit8000: Remove double omap_mux_init_gpio ARM: OMAP: usb: musb: OMAP: Delete unused function MAINTAINERS: Update linux-omap git repository ARM: OMAP: change get_context_loss_count ret value to int ARM: OMAP4: hsmmc: configure SDMMC1_DR0 properly ARM: OMAP4: hsmmc: Fix Pbias configuration on regulator OFF ARM: OMAP3: hwmod: fix variant registration and remove SmartReflex from common list ARM: OMAP: I2C: Fix omap_register_i2c_bus() return value on success ARM: OMAP: dmtimer: Include linux/module.h ARM: OMAP2+: l3-noc: Include linux/module.h ARM: OMAP2+: devices: Fixes for McPDM ARM: OMAP: Fix errors and warnings when building for one board ARM: OMAP3: PM: restrict erratum i443 handling to OMAP3430 only ...
Diffstat (limited to 'arch/arm/plat-omap/omap-pm-noop.c')
-rw-r--r--arch/arm/plat-omap/omap-pm-noop.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index b0471bb2d47d..3dc3801aace4 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -27,7 +27,7 @@
27#include <plat/omap_device.h> 27#include <plat/omap_device.h>
28 28
29static bool off_mode_enabled; 29static bool off_mode_enabled;
30static u32 dummy_context_loss_counter; 30static int dummy_context_loss_counter;
31 31
32/* 32/*
33 * Device-driver-originated constraints (via board-*.c files) 33 * Device-driver-originated constraints (via board-*.c files)
@@ -311,22 +311,32 @@ void omap_pm_disable_off_mode(void)
311 311
312#ifdef CONFIG_ARCH_OMAP2PLUS 312#ifdef CONFIG_ARCH_OMAP2PLUS
313 313
314u32 omap_pm_get_dev_context_loss_count(struct device *dev) 314int omap_pm_get_dev_context_loss_count(struct device *dev)
315{ 315{
316 struct platform_device *pdev = to_platform_device(dev); 316 struct platform_device *pdev = to_platform_device(dev);
317 u32 count; 317 int count;
318 318
319 if (WARN_ON(!dev)) 319 if (WARN_ON(!dev))
320 return 0; 320 return -ENODEV;
321 321
322 if (dev->parent == &omap_device_parent) { 322 if (dev->parent == &omap_device_parent) {
323 count = omap_device_get_context_loss_count(pdev); 323 count = omap_device_get_context_loss_count(pdev);
324 } else { 324 } else {
325 WARN_ONCE(off_mode_enabled, "omap_pm: using dummy context loss counter; device %s should be converted to omap_device", 325 WARN_ONCE(off_mode_enabled, "omap_pm: using dummy context loss counter; device %s should be converted to omap_device",
326 dev_name(dev)); 326 dev_name(dev));
327 if (off_mode_enabled) 327
328 dummy_context_loss_counter++;
329 count = dummy_context_loss_counter; 328 count = dummy_context_loss_counter;
329
330 if (off_mode_enabled) {
331 count++;
332 /*
333 * Context loss count has to be a non-negative value.
334 * Clear the sign bit to get a value range from 0 to
335 * INT_MAX.
336 */
337 count &= INT_MAX;
338 dummy_context_loss_counter = count;
339 }
330 } 340 }
331 341
332 pr_debug("OMAP PM: context loss count for dev %s = %d\n", 342 pr_debug("OMAP PM: context loss count for dev %s = %d\n",
@@ -337,7 +347,7 @@ u32 omap_pm_get_dev_context_loss_count(struct device *dev)
337 347
338#else 348#else
339 349
340u32 omap_pm_get_dev_context_loss_count(struct device *dev) 350int omap_pm_get_dev_context_loss_count(struct device *dev)
341{ 351{
342 return dummy_context_loss_counter; 352 return dummy_context_loss_counter;
343} 353}