diff options
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index f7c84c9abd30..5c4c8b18c8b7 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -326,6 +326,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops; | |||
326 | * requested by a driver. | 326 | * requested by a driver. |
327 | */ | 327 | */ |
328 | 328 | ||
329 | #define PM_EVENT_INVALID (-1) | ||
329 | #define PM_EVENT_ON 0x0000 | 330 | #define PM_EVENT_ON 0x0000 |
330 | #define PM_EVENT_FREEZE 0x0001 | 331 | #define PM_EVENT_FREEZE 0x0001 |
331 | #define PM_EVENT_SUSPEND 0x0002 | 332 | #define PM_EVENT_SUSPEND 0x0002 |
@@ -346,6 +347,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops; | |||
346 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) | 347 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) |
347 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) | 348 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) |
348 | 349 | ||
350 | #define PMSG_INVALID ((struct pm_message){ .event = PM_EVENT_INVALID, }) | ||
349 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | 351 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) |
350 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) | 352 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) |
351 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) | 353 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) |
@@ -366,6 +368,8 @@ extern struct dev_pm_ops generic_subsys_pm_ops; | |||
366 | #define PMSG_AUTO_RESUME ((struct pm_message) \ | 368 | #define PMSG_AUTO_RESUME ((struct pm_message) \ |
367 | { .event = PM_EVENT_AUTO_RESUME, }) | 369 | { .event = PM_EVENT_AUTO_RESUME, }) |
368 | 370 | ||
371 | #define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0) | ||
372 | |||
369 | /** | 373 | /** |
370 | * Device run-time power management status. | 374 | * Device run-time power management status. |
371 | * | 375 | * |
@@ -421,17 +425,35 @@ enum rpm_request { | |||
421 | 425 | ||
422 | struct wakeup_source; | 426 | struct wakeup_source; |
423 | 427 | ||
428 | struct pm_domain_data { | ||
429 | struct list_head list_node; | ||
430 | struct device *dev; | ||
431 | }; | ||
432 | |||
433 | struct pm_subsys_data { | ||
434 | spinlock_t lock; | ||
435 | unsigned int refcount; | ||
436 | #ifdef CONFIG_PM_CLK | ||
437 | struct list_head clock_list; | ||
438 | #endif | ||
439 | #ifdef CONFIG_PM_GENERIC_DOMAINS | ||
440 | struct pm_domain_data *domain_data; | ||
441 | #endif | ||
442 | }; | ||
443 | |||
424 | struct dev_pm_info { | 444 | struct dev_pm_info { |
425 | pm_message_t power_state; | 445 | pm_message_t power_state; |
426 | unsigned int can_wakeup:1; | 446 | unsigned int can_wakeup:1; |
427 | unsigned int async_suspend:1; | 447 | unsigned int async_suspend:1; |
428 | bool is_prepared:1; /* Owned by the PM core */ | 448 | bool is_prepared:1; /* Owned by the PM core */ |
429 | bool is_suspended:1; /* Ditto */ | 449 | bool is_suspended:1; /* Ditto */ |
450 | bool ignore_children:1; | ||
430 | spinlock_t lock; | 451 | spinlock_t lock; |
431 | #ifdef CONFIG_PM_SLEEP | 452 | #ifdef CONFIG_PM_SLEEP |
432 | struct list_head entry; | 453 | struct list_head entry; |
433 | struct completion completion; | 454 | struct completion completion; |
434 | struct wakeup_source *wakeup; | 455 | struct wakeup_source *wakeup; |
456 | bool wakeup_path:1; | ||
435 | #else | 457 | #else |
436 | unsigned int should_wakeup:1; | 458 | unsigned int should_wakeup:1; |
437 | #endif | 459 | #endif |
@@ -443,7 +465,6 @@ struct dev_pm_info { | |||
443 | atomic_t usage_count; | 465 | atomic_t usage_count; |
444 | atomic_t child_count; | 466 | atomic_t child_count; |
445 | unsigned int disable_depth:3; | 467 | unsigned int disable_depth:3; |
446 | unsigned int ignore_children:1; | ||
447 | unsigned int idle_notification:1; | 468 | unsigned int idle_notification:1; |
448 | unsigned int request_pending:1; | 469 | unsigned int request_pending:1; |
449 | unsigned int deferred_resume:1; | 470 | unsigned int deferred_resume:1; |
@@ -462,10 +483,13 @@ struct dev_pm_info { | |||
462 | unsigned long suspended_jiffies; | 483 | unsigned long suspended_jiffies; |
463 | unsigned long accounting_timestamp; | 484 | unsigned long accounting_timestamp; |
464 | #endif | 485 | #endif |
465 | void *subsys_data; /* Owned by the subsystem. */ | 486 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ |
487 | struct pm_qos_constraints *constraints; | ||
466 | }; | 488 | }; |
467 | 489 | ||
468 | extern void update_pm_runtime_accounting(struct device *dev); | 490 | extern void update_pm_runtime_accounting(struct device *dev); |
491 | extern int dev_pm_get_subsys_data(struct device *dev); | ||
492 | extern int dev_pm_put_subsys_data(struct device *dev); | ||
469 | 493 | ||
470 | /* | 494 | /* |
471 | * Power domains provide callbacks that are executed during system suspend, | 495 | * Power domains provide callbacks that are executed during system suspend, |