aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/processor.h1
-rw-r--r--include/linux/cpuidle.h52
2 files changed, 31 insertions, 22 deletions
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 67055f180330..610f6fb1bbc2 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -329,6 +329,7 @@ extern void acpi_processor_throttling_init(void);
329int acpi_processor_power_init(struct acpi_processor *pr, 329int acpi_processor_power_init(struct acpi_processor *pr,
330 struct acpi_device *device); 330 struct acpi_device *device);
331int acpi_processor_cst_has_changed(struct acpi_processor *pr); 331int acpi_processor_cst_has_changed(struct acpi_processor *pr);
332int acpi_processor_hotplug(struct acpi_processor *pr);
332int acpi_processor_power_exit(struct acpi_processor *pr, 333int acpi_processor_power_exit(struct acpi_processor *pr,
333 struct acpi_device *device); 334 struct acpi_device *device);
334int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); 335int acpi_processor_suspend(struct acpi_device * device, pm_message_t state);
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index b51629e15cfc..c90418822f40 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -22,57 +22,62 @@
22#define CPUIDLE_DESC_LEN 32 22#define CPUIDLE_DESC_LEN 32
23 23
24struct cpuidle_device; 24struct cpuidle_device;
25struct cpuidle_driver;
25 26
26 27
27/**************************** 28/****************************
28 * CPUIDLE DEVICE INTERFACE * 29 * CPUIDLE DEVICE INTERFACE *
29 ****************************/ 30 ****************************/
30 31
32struct cpuidle_state_usage {
33 void *driver_data;
34
35 unsigned long long usage;
36 unsigned long long time; /* in US */
37};
38
31struct cpuidle_state { 39struct cpuidle_state {
32 char name[CPUIDLE_NAME_LEN]; 40 char name[CPUIDLE_NAME_LEN];
33 char desc[CPUIDLE_DESC_LEN]; 41 char desc[CPUIDLE_DESC_LEN];
34 void *driver_data;
35 42
36 unsigned int flags; 43 unsigned int flags;
37 unsigned int exit_latency; /* in US */ 44 unsigned int exit_latency; /* in US */
38 unsigned int power_usage; /* in mW */ 45 unsigned int power_usage; /* in mW */
39 unsigned int target_residency; /* in US */ 46 unsigned int target_residency; /* in US */
40 47
41 unsigned long long usage;
42 unsigned long long time; /* in US */
43
44 int (*enter) (struct cpuidle_device *dev, 48 int (*enter) (struct cpuidle_device *dev,
45 struct cpuidle_state *state); 49 struct cpuidle_driver *drv,
50 int index);
46}; 51};
47 52
48/* Idle State Flags */ 53/* Idle State Flags */
49#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ 54#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
50#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
51 55
52#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 56#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
53 57
54/** 58/**
55 * cpuidle_get_statedata - retrieves private driver state data 59 * cpuidle_get_statedata - retrieves private driver state data
56 * @state: the state 60 * @st_usage: the state usage statistics
57 */ 61 */
58static inline void * cpuidle_get_statedata(struct cpuidle_state *state) 62static inline void *cpuidle_get_statedata(struct cpuidle_state_usage *st_usage)
59{ 63{
60 return state->driver_data; 64 return st_usage->driver_data;
61} 65}
62 66
63/** 67/**
64 * cpuidle_set_statedata - stores private driver state data 68 * cpuidle_set_statedata - stores private driver state data
65 * @state: the state 69 * @st_usage: the state usage statistics
66 * @data: the private data 70 * @data: the private data
67 */ 71 */
68static inline void 72static inline void
69cpuidle_set_statedata(struct cpuidle_state *state, void *data) 73cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data)
70{ 74{
71 state->driver_data = data; 75 st_usage->driver_data = data;
72} 76}
73 77
74struct cpuidle_state_kobj { 78struct cpuidle_state_kobj {
75 struct cpuidle_state *state; 79 struct cpuidle_state *state;
80 struct cpuidle_state_usage *state_usage;
76 struct completion kobj_unregister; 81 struct completion kobj_unregister;
77 struct kobject kobj; 82 struct kobject kobj;
78}; 83};
@@ -80,22 +85,17 @@ struct cpuidle_state_kobj {
80struct cpuidle_device { 85struct cpuidle_device {
81 unsigned int registered:1; 86 unsigned int registered:1;
82 unsigned int enabled:1; 87 unsigned int enabled:1;
83 unsigned int power_specified:1;
84 unsigned int cpu; 88 unsigned int cpu;
85 89
86 int last_residency; 90 int last_residency;
87 int state_count; 91 int state_count;
88 struct cpuidle_state states[CPUIDLE_STATE_MAX]; 92 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
89 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 93 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
90 struct cpuidle_state *last_state;
91 94
92 struct list_head device_list; 95 struct list_head device_list;
93 struct kobject kobj; 96 struct kobject kobj;
94 struct completion kobj_unregister; 97 struct completion kobj_unregister;
95 void *governor_data; 98 void *governor_data;
96 struct cpuidle_state *safe_state;
97
98 int (*prepare) (struct cpuidle_device *dev);
99}; 99};
100 100
101DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); 101DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
@@ -119,6 +119,11 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
119struct cpuidle_driver { 119struct cpuidle_driver {
120 char name[CPUIDLE_NAME_LEN]; 120 char name[CPUIDLE_NAME_LEN];
121 struct module *owner; 121 struct module *owner;
122
123 unsigned int power_specified:1;
124 struct cpuidle_state states[CPUIDLE_STATE_MAX];
125 int state_count;
126 int safe_state_index;
122}; 127};
123 128
124#ifdef CONFIG_CPU_IDLE 129#ifdef CONFIG_CPU_IDLE
@@ -165,11 +170,14 @@ struct cpuidle_governor {
165 struct list_head governor_list; 170 struct list_head governor_list;
166 unsigned int rating; 171 unsigned int rating;
167 172
168 int (*enable) (struct cpuidle_device *dev); 173 int (*enable) (struct cpuidle_driver *drv,
169 void (*disable) (struct cpuidle_device *dev); 174 struct cpuidle_device *dev);
175 void (*disable) (struct cpuidle_driver *drv,
176 struct cpuidle_device *dev);
170 177
171 int (*select) (struct cpuidle_device *dev); 178 int (*select) (struct cpuidle_driver *drv,
172 void (*reflect) (struct cpuidle_device *dev); 179 struct cpuidle_device *dev);
180 void (*reflect) (struct cpuidle_device *dev, int index);
173 181
174 struct module *owner; 182 struct module *owner;
175}; 183};