[PATCH] ide: hotplug mark __devinit sc1200.c
[linux-2.6/s3c2410-cpufreq.git] / include / acpi / processor.h
blob2f50a5bb0c781d3cc61ec3b5e4fb5fc480347722
1 #ifndef __ACPI_PROCESSOR_H
2 #define __ACPI_PROCESSOR_H
4 #include <linux/kernel.h>
5 #include <linux/config.h>
7 #define ACPI_PROCESSOR_BUSY_METRIC 10
9 #define ACPI_PROCESSOR_MAX_POWER 8
10 #define ACPI_PROCESSOR_MAX_C2_LATENCY 100
11 #define ACPI_PROCESSOR_MAX_C3_LATENCY 1000
13 #define ACPI_PROCESSOR_MAX_THROTTLING 16
14 #define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */
15 #define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4
17 /* Power Management */
19 struct acpi_processor_cx;
21 struct acpi_power_register {
22 u8 descriptor;
23 u16 length;
24 u8 space_id;
25 u8 bit_width;
26 u8 bit_offset;
27 u8 reserved;
28 u64 address;
29 } __attribute__ ((packed));
32 struct acpi_processor_cx_policy {
33 u32 count;
34 struct acpi_processor_cx *state;
35 struct {
36 u32 time;
37 u32 ticks;
38 u32 count;
39 u32 bm;
40 } threshold;
43 struct acpi_processor_cx {
44 u8 valid;
45 u8 type;
46 u32 address;
47 u32 latency;
48 u32 latency_ticks;
49 u32 power;
50 u32 usage;
51 struct acpi_processor_cx_policy promotion;
52 struct acpi_processor_cx_policy demotion;
55 struct acpi_processor_power {
56 struct acpi_processor_cx *state;
57 unsigned long bm_check_timestamp;
58 u32 default_state;
59 u32 bm_activity;
60 int count;
61 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
64 /* Performance Management */
66 struct acpi_pct_register {
67 u8 descriptor;
68 u16 length;
69 u8 space_id;
70 u8 bit_width;
71 u8 bit_offset;
72 u8 reserved;
73 u64 address;
74 } __attribute__ ((packed));
76 struct acpi_processor_px {
77 acpi_integer core_frequency; /* megahertz */
78 acpi_integer power; /* milliWatts */
79 acpi_integer transition_latency; /* microseconds */
80 acpi_integer bus_master_latency; /* microseconds */
81 acpi_integer control; /* control value */
82 acpi_integer status; /* success indicator */
85 #define ACPI_PDC_REVISION_ID 0x1
87 struct acpi_processor_performance {
88 unsigned int state;
89 unsigned int platform_limit;
90 struct acpi_pct_register control_register;
91 struct acpi_pct_register status_register;
92 unsigned int state_count;
93 struct acpi_processor_px *states;
95 /* the _PDC objects passed by the driver, if any */
96 struct acpi_object_list *pdc;
101 /* Throttling Control */
103 struct acpi_processor_tx {
104 u16 power;
105 u16 performance;
108 struct acpi_processor_throttling {
109 int state;
110 u32 address;
111 u8 duty_offset;
112 u8 duty_width;
113 int state_count;
114 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
117 /* Limit Interface */
119 struct acpi_processor_lx {
120 int px; /* performace state */
121 int tx; /* throttle level */
124 struct acpi_processor_limit {
125 struct acpi_processor_lx state; /* current limit */
126 struct acpi_processor_lx thermal; /* thermal limit */
127 struct acpi_processor_lx user; /* user limit */
131 struct acpi_processor_flags {
132 u8 power:1;
133 u8 performance:1;
134 u8 throttling:1;
135 u8 limit:1;
136 u8 bm_control:1;
137 u8 bm_check:1;
138 u8 has_cst:1;
139 u8 power_setup_done:1;
142 struct acpi_processor {
143 acpi_handle handle;
144 u32 acpi_id;
145 u32 id;
146 u32 pblk;
147 int performance_platform_limit;
148 struct acpi_processor_flags flags;
149 struct acpi_processor_power power;
150 struct acpi_processor_performance *performance;
151 struct acpi_processor_throttling throttling;
152 struct acpi_processor_limit limit;
155 struct acpi_processor_errata {
156 u8 smp;
157 struct {
158 u8 throttle:1;
159 u8 fdma:1;
160 u8 reserved:6;
161 u32 bmisx;
162 } piix4;
165 extern int acpi_processor_register_performance (
166 struct acpi_processor_performance * performance,
167 unsigned int cpu);
168 extern void acpi_processor_unregister_performance (
169 struct acpi_processor_performance * performance,
170 unsigned int cpu);
172 /* note: this locks both the calling module and the processor module
173 if a _PPC object exists, rmmod is disallowed then */
174 int acpi_processor_notify_smm(struct module *calling_module);
178 /* for communication between multiple parts of the processor kernel module */
179 extern struct acpi_processor *processors[NR_CPUS];
180 extern struct acpi_processor_errata errata;
182 /* in processor_perflib.c */
183 #ifdef CONFIG_CPU_FREQ
184 void acpi_processor_ppc_init(void);
185 void acpi_processor_ppc_exit(void);
186 int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
187 #else
188 static inline void acpi_processor_ppc_init(void) { return; }
189 static inline void acpi_processor_ppc_exit(void) { return; }
190 static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) {
191 static unsigned int printout = 1;
192 if (printout) {
193 printk(KERN_WARNING "Warning: Processor Platform Limit event detected, but not handled.\n");
194 printk(KERN_WARNING "Consider compiling CPUfreq support into your kernel.\n");
195 printout = 0;
197 return 0;
199 #endif /* CONFIG_CPU_FREQ */
201 /* in processor_throttling.c */
202 int acpi_processor_get_throttling_info (struct acpi_processor *pr);
203 int acpi_processor_set_throttling (struct acpi_processor *pr, int state);
204 ssize_t acpi_processor_write_throttling (
205 struct file *file,
206 const char __user *buffer,
207 size_t count,
208 loff_t *data);
209 extern struct file_operations acpi_processor_throttling_fops;
211 /* in processor_idle.c */
212 int acpi_processor_power_init(struct acpi_processor *pr, struct acpi_device *device);
213 int acpi_processor_cst_has_changed (struct acpi_processor *pr);
214 int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device);
217 /* in processor_thermal.c */
218 int acpi_processor_get_limit_info (struct acpi_processor *pr);
219 ssize_t acpi_processor_write_limit (
220 struct file *file,
221 const char __user *buffer,
222 size_t count,
223 loff_t *data);
224 extern struct file_operations acpi_processor_limit_fops;
226 #ifdef CONFIG_CPU_FREQ
227 void acpi_thermal_cpufreq_init(void);
228 void acpi_thermal_cpufreq_exit(void);
229 #else
230 static inline void acpi_thermal_cpufreq_init(void) { return; }
231 static inline void acpi_thermal_cpufreq_exit(void) { return; }
232 #endif
235 #endif