diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-19 00:03:17 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-19 00:03:17 +0200 |
commit | 7791bd230c6fe65348456564743f99fa066f00e7 (patch) | |
tree | e9ed6b3e1baea455a65274aa054ebd29d2623b92 /include/linux | |
parent | 3db0bc97678d7de32f25514b290a0ca028dd4512 (diff) | |
parent | 8e9afafdad59f5973a5e72e05db9802f82091398 (diff) |
Merge branch 'pm-domains'
* pm-domains:
PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset
PM / Domains: Replace plain integer with NULL pointer in domain.c file
PM / Domains: Add missing static storage class specifier in domain.c file
PM / Domains: Allow device callbacks to be added at any time
PM / Domains: Add device domain data reference counter
PM / Domains: Add preliminary support for cpuidle, v2
PM / Domains: Do not stop devices after restoring their states
PM / Domains: Use subsystem runtime suspend/resume callbacks by default
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/cpuidle.h | 1 | ||||
-rw-r--r-- | include/linux/pm_domain.h | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index ca6cdf55eb1..89dcd30ac8e 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -47,6 +47,7 @@ struct cpuidle_state { unsigned int exit_latency; /* in US */ int power_usage; /* in mW */ unsigned int target_residency; /* in US */ + bool disabled; /* disabled on all CPUs */ int (*enter) (struct cpuidle_device *dev, struct cpuidle_driver *drv, diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 30f794eb382..a7d6172922d 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -15,6 +15,7 @@ #include <linux/err.h> #include <linux/of.h> #include <linux/notifier.h> +#include <linux/cpuidle.h> enum gpd_status { GPD_STATE_ACTIVE = 0, /* PM domain is active */ @@ -45,6 +46,11 @@ struct gpd_dev_ops { bool (*active_wakeup)(struct device *dev); }; +struct gpd_cpu_data { + unsigned int saved_exit_latency; + struct cpuidle_state *idle_state; +}; + struct generic_pm_domain { struct dev_pm_domain domain; /* PM domain operations */ struct list_head gpd_list_node; /* Node in the global PM domains list */ @@ -75,6 +81,7 @@ struct generic_pm_domain { bool max_off_time_changed; bool cached_power_down_ok; struct device_node *of_node; /* Node in device tree */ + struct gpd_cpu_data *cpu_data; }; static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) @@ -105,6 +112,7 @@ struct generic_pm_domain_data { struct gpd_timing_data td; struct notifier_block nb; struct mutex lock; + unsigned int refcount; bool need_restore; bool always_on; }; @@ -155,6 +163,8 @@ extern int pm_genpd_add_callbacks(struct device *dev, struct gpd_dev_ops *ops, struct gpd_timing_data *td); extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); +extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); +extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); extern void pm_genpd_init(struct generic_pm_domain *genpd, struct dev_power_governor *gov, bool is_off); @@ -211,6 +221,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) { return -ENOSYS; } +static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) +{ + return -ENOSYS; +} +static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) +{ + return -ENOSYS; +} static inline void pm_genpd_init(struct generic_pm_domain *genpd, struct dev_power_governor *gov, bool is_off) { |