diff options
Diffstat (limited to 'arch/arm/plat-omap/omap-pm-noop.c')
-rw-r--r-- | arch/arm/plat-omap/omap-pm-noop.c | 78 |
1 files changed, 55 insertions, 23 deletions
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c index e129ce80c53b..b0471bb2d47d 100644 --- a/arch/arm/plat-omap/omap-pm-noop.c +++ b/arch/arm/plat-omap/omap-pm-noop.c | |||
@@ -20,15 +20,14 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/cpufreq.h> | 21 | #include <linux/cpufreq.h> |
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | #include <linux/platform_device.h> | ||
23 | 24 | ||
24 | /* Interface documentation is in mach/omap-pm.h */ | 25 | /* Interface documentation is in mach/omap-pm.h */ |
25 | #include <plat/omap-pm.h> | 26 | #include <plat/omap-pm.h> |
27 | #include <plat/omap_device.h> | ||
26 | 28 | ||
27 | #include <plat/powerdomain.h> | 29 | static bool off_mode_enabled; |
28 | 30 | static u32 dummy_context_loss_counter; | |
29 | struct omap_opp *dsp_opps; | ||
30 | struct omap_opp *mpu_opps; | ||
31 | struct omap_opp *l3_opps; | ||
32 | 31 | ||
33 | /* | 32 | /* |
34 | * Device-driver-originated constraints (via board-*.c files) | 33 | * Device-driver-originated constraints (via board-*.c files) |
@@ -284,37 +283,70 @@ unsigned long omap_pm_cpu_get_freq(void) | |||
284 | return 0; | 283 | return 0; |
285 | } | 284 | } |
286 | 285 | ||
286 | /** | ||
287 | * omap_pm_enable_off_mode - notify OMAP PM that off-mode is enabled | ||
288 | * | ||
289 | * Intended for use only by OMAP PM core code to notify this layer | ||
290 | * that off mode has been enabled. | ||
291 | */ | ||
292 | void omap_pm_enable_off_mode(void) | ||
293 | { | ||
294 | off_mode_enabled = true; | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * omap_pm_disable_off_mode - notify OMAP PM that off-mode is disabled | ||
299 | * | ||
300 | * Intended for use only by OMAP PM core code to notify this layer | ||
301 | * that off mode has been disabled. | ||
302 | */ | ||
303 | void omap_pm_disable_off_mode(void) | ||
304 | { | ||
305 | off_mode_enabled = false; | ||
306 | } | ||
307 | |||
287 | /* | 308 | /* |
288 | * Device context loss tracking | 309 | * Device context loss tracking |
289 | */ | 310 | */ |
290 | 311 | ||
291 | int omap_pm_get_dev_context_loss_count(struct device *dev) | 312 | #ifdef CONFIG_ARCH_OMAP2PLUS |
313 | |||
314 | u32 omap_pm_get_dev_context_loss_count(struct device *dev) | ||
292 | { | 315 | { |
293 | if (!dev) { | 316 | struct platform_device *pdev = to_platform_device(dev); |
294 | WARN_ON(1); | 317 | u32 count; |
295 | return -EINVAL; | 318 | |
296 | }; | 319 | if (WARN_ON(!dev)) |
320 | return 0; | ||
321 | |||
322 | if (dev->parent == &omap_device_parent) { | ||
323 | count = omap_device_get_context_loss_count(pdev); | ||
324 | } else { | ||
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)); | ||
327 | if (off_mode_enabled) | ||
328 | dummy_context_loss_counter++; | ||
329 | count = dummy_context_loss_counter; | ||
330 | } | ||
297 | 331 | ||
298 | pr_debug("OMAP PM: returning context loss count for dev %s\n", | 332 | pr_debug("OMAP PM: context loss count for dev %s = %d\n", |
299 | dev_name(dev)); | 333 | dev_name(dev), count); |
300 | 334 | ||
301 | /* | 335 | return count; |
302 | * Map the device to the powerdomain. Return the powerdomain | 336 | } |
303 | * off counter. | ||
304 | */ | ||
305 | 337 | ||
306 | return 0; | 338 | #else |
339 | |||
340 | u32 omap_pm_get_dev_context_loss_count(struct device *dev) | ||
341 | { | ||
342 | return dummy_context_loss_counter; | ||
307 | } | 343 | } |
308 | 344 | ||
345 | #endif | ||
309 | 346 | ||
310 | /* Should be called before clk framework init */ | 347 | /* Should be called before clk framework init */ |
311 | int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table, | 348 | int __init omap_pm_if_early_init(void) |
312 | struct omap_opp *dsp_opp_table, | ||
313 | struct omap_opp *l3_opp_table) | ||
314 | { | 349 | { |
315 | mpu_opps = mpu_opp_table; | ||
316 | dsp_opps = dsp_opp_table; | ||
317 | l3_opps = l3_opp_table; | ||
318 | return 0; | 350 | return 0; |
319 | } | 351 | } |
320 | 352 | ||