Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: (21 commits) PM / Hibernate: Reduce autotuned default image size PM / Core: Introduce struct syscore_ops for core subsystems PM PM QoS: Make pm_qos settings readable PM / OPP: opp_find_freq_exact() documentation fix PM: Documentation/power/states.txt: fix repetition PM: Make system-wide PM and runtime PM treat subsystems consistently PM: Simplify kernel/power/Kconfig PM: Add support for device power domains PM: Drop pm_flags that is not necessary PM: Allow pm_runtime_suspend() to succeed during system suspend PM: Clean up PM_TRACE dependencies and drop unnecessary Kconfig option PM: Remove CONFIG_PM_OPS PM: Reorder power management Kconfig options PM: Make CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME) PM / ACPI: Remove references to pm_flags from bus.c PM: Do not create wakeup sysfs files for devices that cannot wake up USB / Hub: Do not call device_set_wakeup_capable() under spinlock PM: Use appropriate printk() priority level in trace.c PM / Wakeup: Don't update events_check_enabled in pm_get_wakeup_count() PM / Wakeup: Make pm_save_wakeup_count() work as documented ...
This commit is contained in:
@@ -420,6 +420,7 @@ struct device {
|
||||
void *platform_data; /* Platform specific data, device
|
||||
core doesn't touch it */
|
||||
struct dev_pm_info power;
|
||||
struct dev_power_domain *pwr_domain;
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
int numa_node; /* NUMA node this device is close to */
|
||||
|
||||
@@ -267,7 +267,7 @@ const struct dev_pm_ops name = { \
|
||||
* callbacks provided by device drivers supporting both the system sleep PM and
|
||||
* runtime PM, make the pm member point to generic_subsys_pm_ops.
|
||||
*/
|
||||
#ifdef CONFIG_PM_OPS
|
||||
#ifdef CONFIG_PM
|
||||
extern struct dev_pm_ops generic_subsys_pm_ops;
|
||||
#define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops)
|
||||
#else
|
||||
@@ -465,6 +465,14 @@ struct dev_pm_info {
|
||||
|
||||
extern void update_pm_runtime_accounting(struct device *dev);
|
||||
|
||||
/*
|
||||
* Power domains provide callbacks that are executed during system suspend,
|
||||
* hibernation, system resume and during runtime PM transitions along with
|
||||
* subsystem-level and driver-level callbacks.
|
||||
*/
|
||||
struct dev_power_domain {
|
||||
struct dev_pm_ops ops;
|
||||
};
|
||||
|
||||
/*
|
||||
* The PM_EVENT_ messages are also used by drivers implementing the legacy
|
||||
@@ -565,15 +573,6 @@ enum dpm_order {
|
||||
DPM_ORDER_DEV_LAST,
|
||||
};
|
||||
|
||||
/*
|
||||
* Global Power Management flags
|
||||
* Used to keep APM and ACPI from both being active
|
||||
*/
|
||||
extern unsigned int pm_flags;
|
||||
|
||||
#define PM_APM 1
|
||||
#define PM_ACPI 2
|
||||
|
||||
extern int pm_generic_suspend(struct device *dev);
|
||||
extern int pm_generic_resume(struct device *dev);
|
||||
extern int pm_generic_freeze(struct device *dev);
|
||||
|
||||
@@ -87,6 +87,11 @@ static inline bool pm_runtime_enabled(struct device *dev)
|
||||
return !dev->power.disable_depth;
|
||||
}
|
||||
|
||||
static inline bool pm_runtime_callbacks_present(struct device *dev)
|
||||
{
|
||||
return !dev->power.no_callbacks;
|
||||
}
|
||||
|
||||
static inline void pm_runtime_mark_last_busy(struct device *dev)
|
||||
{
|
||||
ACCESS_ONCE(dev->power.last_busy) = jiffies;
|
||||
@@ -133,6 +138,7 @@ static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
|
||||
static inline void pm_runtime_no_callbacks(struct device *dev) {}
|
||||
static inline void pm_runtime_irq_safe(struct device *dev) {}
|
||||
|
||||
static inline bool pm_runtime_callbacks_present(struct device *dev) { return false; }
|
||||
static inline void pm_runtime_mark_last_busy(struct device *dev) {}
|
||||
static inline void __pm_runtime_use_autosuspend(struct device *dev,
|
||||
bool use) {}
|
||||
|
||||
@@ -62,18 +62,11 @@ struct wakeup_source {
|
||||
* Changes to device_may_wakeup take effect on the next pm state change.
|
||||
*/
|
||||
|
||||
static inline void device_set_wakeup_capable(struct device *dev, bool capable)
|
||||
{
|
||||
dev->power.can_wakeup = capable;
|
||||
}
|
||||
|
||||
static inline bool device_can_wakeup(struct device *dev)
|
||||
{
|
||||
return dev->power.can_wakeup;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static inline bool device_may_wakeup(struct device *dev)
|
||||
{
|
||||
return dev->power.can_wakeup && !!dev->power.wakeup;
|
||||
@@ -88,6 +81,7 @@ extern struct wakeup_source *wakeup_source_register(const char *name);
|
||||
extern void wakeup_source_unregister(struct wakeup_source *ws);
|
||||
extern int device_wakeup_enable(struct device *dev);
|
||||
extern int device_wakeup_disable(struct device *dev);
|
||||
extern void device_set_wakeup_capable(struct device *dev, bool capable);
|
||||
extern int device_init_wakeup(struct device *dev, bool val);
|
||||
extern int device_set_wakeup_enable(struct device *dev, bool enable);
|
||||
extern void __pm_stay_awake(struct wakeup_source *ws);
|
||||
|
||||
29
include/linux/syscore_ops.h
Normal file
29
include/linux/syscore_ops.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* syscore_ops.h - System core operations.
|
||||
*
|
||||
* Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_SYSCORE_OPS_H
|
||||
#define _LINUX_SYSCORE_OPS_H
|
||||
|
||||
#include <linux/list.h>
|
||||
|
||||
struct syscore_ops {
|
||||
struct list_head node;
|
||||
int (*suspend)(void);
|
||||
void (*resume)(void);
|
||||
void (*shutdown)(void);
|
||||
};
|
||||
|
||||
extern void register_syscore_ops(struct syscore_ops *ops);
|
||||
extern void unregister_syscore_ops(struct syscore_ops *ops);
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
extern int syscore_suspend(void);
|
||||
extern void syscore_resume(void);
|
||||
#endif
|
||||
extern void syscore_shutdown(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user