aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpuidle.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cpuidle.h')
-rw-r--r--include/linux/cpuidle.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index dcf77fa826b5..1be416bbbb82 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -52,6 +52,8 @@ struct cpuidle_state {
52#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ 52#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */
53#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ 53#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
54#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ 54#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
55#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
56#define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */
55 57
56#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 58#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
57 59
@@ -84,6 +86,7 @@ struct cpuidle_state_kobj {
84struct cpuidle_device { 86struct cpuidle_device {
85 unsigned int registered:1; 87 unsigned int registered:1;
86 unsigned int enabled:1; 88 unsigned int enabled:1;
89 unsigned int power_specified:1;
87 unsigned int cpu; 90 unsigned int cpu;
88 91
89 int last_residency; 92 int last_residency;
@@ -97,6 +100,8 @@ struct cpuidle_device {
97 struct completion kobj_unregister; 100 struct completion kobj_unregister;
98 void *governor_data; 101 void *governor_data;
99 struct cpuidle_state *safe_state; 102 struct cpuidle_state *safe_state;
103
104 int (*prepare) (struct cpuidle_device *dev);
100}; 105};
101 106
102DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); 107DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
@@ -125,6 +130,7 @@ struct cpuidle_driver {
125#ifdef CONFIG_CPU_IDLE 130#ifdef CONFIG_CPU_IDLE
126 131
127extern int cpuidle_register_driver(struct cpuidle_driver *drv); 132extern int cpuidle_register_driver(struct cpuidle_driver *drv);
133struct cpuidle_driver *cpuidle_get_driver(void);
128extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); 134extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
129extern int cpuidle_register_device(struct cpuidle_device *dev); 135extern int cpuidle_register_device(struct cpuidle_device *dev);
130extern void cpuidle_unregister_device(struct cpuidle_device *dev); 136extern void cpuidle_unregister_device(struct cpuidle_device *dev);
@@ -137,16 +143,17 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev);
137#else 143#else
138 144
139static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 145static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
140{return 0;} 146{return -ENODEV; }
147static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
141static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } 148static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
142static inline int cpuidle_register_device(struct cpuidle_device *dev) 149static inline int cpuidle_register_device(struct cpuidle_device *dev)
143{return 0;} 150{return -ENODEV; }
144static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } 151static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
145 152
146static inline void cpuidle_pause_and_lock(void) { } 153static inline void cpuidle_pause_and_lock(void) { }
147static inline void cpuidle_resume_and_unlock(void) { } 154static inline void cpuidle_resume_and_unlock(void) { }
148static inline int cpuidle_enable_device(struct cpuidle_device *dev) 155static inline int cpuidle_enable_device(struct cpuidle_device *dev)
149{return 0;} 156{return -ENODEV; }
150static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 157static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
151 158
152#endif 159#endif