aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpuidle.h1
-rw-r--r--include/linux/pm_domain.h17
2 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 27cfced7b57b..8684a0d07b87 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -47,6 +47,7 @@ struct cpuidle_state {
47 unsigned int exit_latency; /* in US */ 47 unsigned int exit_latency; /* in US */
48 int power_usage; /* in mW */ 48 int power_usage; /* in mW */
49 unsigned int target_residency; /* in US */ 49 unsigned int target_residency; /* in US */
50 bool disabled; /* disabled on all CPUs */
50 51
51 int (*enter) (struct cpuidle_device *dev, 52 int (*enter) (struct cpuidle_device *dev,
52 struct cpuidle_driver *drv, 53 struct cpuidle_driver *drv,
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 30f794eb3826..2febe31d2675 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -15,6 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/cpuidle.h>
18 19
19enum gpd_status { 20enum gpd_status {
20 GPD_STATE_ACTIVE = 0, /* PM domain is active */ 21 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -45,6 +46,11 @@ struct gpd_dev_ops {
45 bool (*active_wakeup)(struct device *dev); 46 bool (*active_wakeup)(struct device *dev);
46}; 47};
47 48
49struct gpd_cpu_data {
50 unsigned int saved_exit_latency;
51 struct cpuidle_state *idle_state;
52};
53
48struct generic_pm_domain { 54struct generic_pm_domain {
49 struct dev_pm_domain domain; /* PM domain operations */ 55 struct dev_pm_domain domain; /* PM domain operations */
50 struct list_head gpd_list_node; /* Node in the global PM domains list */ 56 struct list_head gpd_list_node; /* Node in the global PM domains list */
@@ -75,6 +81,7 @@ struct generic_pm_domain {
75 bool max_off_time_changed; 81 bool max_off_time_changed;
76 bool cached_power_down_ok; 82 bool cached_power_down_ok;
77 struct device_node *of_node; /* Node in device tree */ 83 struct device_node *of_node; /* Node in device tree */
84 struct gpd_cpu_data *cpu_data;
78}; 85};
79 86
80static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) 87static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
@@ -155,6 +162,8 @@ extern int pm_genpd_add_callbacks(struct device *dev,
155 struct gpd_dev_ops *ops, 162 struct gpd_dev_ops *ops,
156 struct gpd_timing_data *td); 163 struct gpd_timing_data *td);
157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 164extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
165extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
166extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd);
158extern void pm_genpd_init(struct generic_pm_domain *genpd, 167extern void pm_genpd_init(struct generic_pm_domain *genpd,
159 struct dev_power_governor *gov, bool is_off); 168 struct dev_power_governor *gov, bool is_off);
160 169
@@ -211,6 +220,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
211{ 220{
212 return -ENOSYS; 221 return -ENOSYS;
213} 222}
223static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
224{
225 return -ENOSYS;
226}
227static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd)
228{
229 return -ENOSYS;
230}
214static inline void pm_genpd_init(struct generic_pm_domain *genpd, 231static inline void pm_genpd_init(struct generic_pm_domain *genpd,
215 struct dev_power_governor *gov, bool is_off) 232 struct dev_power_governor *gov, bool is_off)
216{ 233{