aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpuidle.h
diff options
context:
space:
mode:
authorRobert Lee <rob.lee@linaro.org>2012-03-20 16:22:42 -0400
committerLen Brown <len.brown@intel.com>2012-03-21 01:59:40 -0400
commite1689795a784a7c41ac4cf9032794986b095a133 (patch)
tree19619c24579875e344af337c86c6a604425627b5 /include/linux/cpuidle.h
parentc16fa4f2ad19908a47c63d8fa436a1178438c7e7 (diff)
cpuidle: Add common time keeping and irq enabling
Make necessary changes to implement time keeping and irq enabling in the core cpuidle code. This will allow the removal of these functionalities from various platform cpuidle implementations whose timekeeping and irq enabling follows the form in this common code. Signed-off-by: Robert Lee <rob.lee@linaro.org> Tested-by: Jean Pihet <j-pihet@ti.com> Tested-by: Amit Daniel <amit.kachhap@linaro.org> Tested-by: Robert Lee <rob.lee@linaro.org> Reviewed-by: Kevin Hilman <khilman@ti.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Acked-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/cpuidle.h')
-rw-r--r--include/linux/cpuidle.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 712abcc205ae..927db28a2a4c 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -15,6 +15,7 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/completion.h> 17#include <linux/completion.h>
18#include <linux/hrtimer.h>
18 19
19#define CPUIDLE_STATE_MAX 8 20#define CPUIDLE_STATE_MAX 8
20#define CPUIDLE_NAME_LEN 16 21#define CPUIDLE_NAME_LEN 16
@@ -122,6 +123,8 @@ struct cpuidle_driver {
122 struct module *owner; 123 struct module *owner;
123 124
124 unsigned int power_specified:1; 125 unsigned int power_specified:1;
126 /* set to 1 to use the core cpuidle time keeping (for all states). */
127 unsigned int en_core_tk_irqen:1;
125 struct cpuidle_state states[CPUIDLE_STATE_MAX]; 128 struct cpuidle_state states[CPUIDLE_STATE_MAX];
126 int state_count; 129 int state_count;
127 int safe_state_index; 130 int safe_state_index;
@@ -140,7 +143,10 @@ extern void cpuidle_pause_and_lock(void);
140extern void cpuidle_resume_and_unlock(void); 143extern void cpuidle_resume_and_unlock(void);
141extern int cpuidle_enable_device(struct cpuidle_device *dev); 144extern int cpuidle_enable_device(struct cpuidle_device *dev);
142extern void cpuidle_disable_device(struct cpuidle_device *dev); 145extern void cpuidle_disable_device(struct cpuidle_device *dev);
143 146extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
147 struct cpuidle_driver *drv, int index,
148 int (*enter)(struct cpuidle_device *dev,
149 struct cpuidle_driver *drv, int index));
144#else 150#else
145static inline void disable_cpuidle(void) { } 151static inline void disable_cpuidle(void) { }
146static inline int cpuidle_idle_call(void) { return -ENODEV; } 152static inline int cpuidle_idle_call(void) { return -ENODEV; }
@@ -157,6 +163,11 @@ static inline void cpuidle_resume_and_unlock(void) { }
157static inline int cpuidle_enable_device(struct cpuidle_device *dev) 163static inline int cpuidle_enable_device(struct cpuidle_device *dev)
158{return -ENODEV; } 164{return -ENODEV; }
159static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 165static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
166static inline int cpuidle_wrap_enter(struct cpuidle_device *dev,
167 struct cpuidle_driver *drv, int index,
168 int (*enter)(struct cpuidle_device *dev,
169 struct cpuidle_driver *drv, int index))
170{ return -ENODEV; }
160 171
161#endif 172#endif
162 173