diff options
author | Len Brown <len.brown@intel.com> | 2010-10-26 14:51:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-10-26 14:51:00 -0400 |
commit | 7e31842441776b4d6ec7fd916c91663ad05b7814 (patch) | |
tree | 8d97d41b4f6861dcbc0dc3ac96fab7afddbed731 /drivers/acpi | |
parent | 1bd64d42abdd4f9d44f77011a31f0292112f4c3b (diff) | |
parent | b1d248d96c71665c79befb81207f38f894c7c082 (diff) |
Merge branch 'misc' into release
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/Kconfig | 2 | ||||
-rw-r--r-- | drivers/acpi/bus.c | 7 | ||||
-rw-r--r-- | drivers/acpi/dock.c | 6 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 25 | ||||
-rw-r--r-- | drivers/acpi/processor_driver.c | 2 | ||||
-rw-r--r-- | drivers/acpi/processor_thermal.c | 178 | ||||
-rw-r--r-- | drivers/acpi/sleep.c | 12 | ||||
-rw-r--r-- | drivers/acpi/sleep.h | 1 |
8 files changed, 20 insertions, 213 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 0f9de2b44c0..3f3489c5ca8 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -9,7 +9,6 @@ menuconfig ACPI | |||
9 | depends on PCI | 9 | depends on PCI |
10 | depends on PM | 10 | depends on PM |
11 | select PNP | 11 | select PNP |
12 | select CPU_IDLE | ||
13 | default y | 12 | default y |
14 | help | 13 | help |
15 | Advanced Configuration and Power Interface (ACPI) support for | 14 | Advanced Configuration and Power Interface (ACPI) support for |
@@ -200,6 +199,7 @@ config ACPI_DOCK | |||
200 | config ACPI_PROCESSOR | 199 | config ACPI_PROCESSOR |
201 | tristate "Processor" | 200 | tristate "Processor" |
202 | select THERMAL | 201 | select THERMAL |
202 | select CPU_IDLE | ||
203 | default y | 203 | default y |
204 | help | 204 | help |
205 | This driver installs ACPI as the idle handler for Linux and uses | 205 | This driver installs ACPI as the idle handler for Linux and uses |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 310e3b9749c..d68bd61072b 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -935,6 +935,12 @@ static int __init acpi_bus_init(void) | |||
935 | goto error1; | 935 | goto error1; |
936 | } | 936 | } |
937 | 937 | ||
938 | /* | ||
939 | * _PDC control method may load dynamic SSDT tables, | ||
940 | * and we need to install the table handler before that. | ||
941 | */ | ||
942 | acpi_sysfs_init(); | ||
943 | |||
938 | acpi_early_processor_set_pdc(); | 944 | acpi_early_processor_set_pdc(); |
939 | 945 | ||
940 | /* | 946 | /* |
@@ -1026,7 +1032,6 @@ static int __init acpi_init(void) | |||
1026 | acpi_scan_init(); | 1032 | acpi_scan_init(); |
1027 | acpi_ec_init(); | 1033 | acpi_ec_init(); |
1028 | acpi_power_init(); | 1034 | acpi_power_init(); |
1029 | acpi_sysfs_init(); | ||
1030 | acpi_debugfs_init(); | 1035 | acpi_debugfs_init(); |
1031 | acpi_sleep_proc_init(); | 1036 | acpi_sleep_proc_init(); |
1032 | acpi_wakeup_device_init(); | 1037 | acpi_wakeup_device_init(); |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 44f99bd8374..81514a4918c 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -930,7 +930,7 @@ static struct attribute_group dock_attribute_group = { | |||
930 | * allocated and initialize a new dock station device. Find all devices | 930 | * allocated and initialize a new dock station device. Find all devices |
931 | * that are on the dock station, and register for dock event notifications. | 931 | * that are on the dock station, and register for dock event notifications. |
932 | */ | 932 | */ |
933 | static int dock_add(acpi_handle handle) | 933 | static int __init dock_add(acpi_handle handle) |
934 | { | 934 | { |
935 | int ret, id; | 935 | int ret, id; |
936 | struct dock_station ds, *dock_station; | 936 | struct dock_station ds, *dock_station; |
@@ -1024,7 +1024,7 @@ static int dock_remove(struct dock_station *ds) | |||
1024 | * | 1024 | * |
1025 | * This is called by acpi_walk_namespace to look for dock stations. | 1025 | * This is called by acpi_walk_namespace to look for dock stations. |
1026 | */ | 1026 | */ |
1027 | static acpi_status | 1027 | static __init acpi_status |
1028 | find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) | 1028 | find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) |
1029 | { | 1029 | { |
1030 | if (is_dock(handle)) | 1030 | if (is_dock(handle)) |
@@ -1033,7 +1033,7 @@ find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
1033 | return AE_OK; | 1033 | return AE_OK; |
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | static acpi_status | 1036 | static __init acpi_status |
1037 | find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) | 1037 | find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) |
1038 | { | 1038 | { |
1039 | /* If bay is a dock, it's already handled */ | 1039 | /* If bay is a dock, it's already handled */ |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 0c2e445410a..966feddf6b1 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -875,16 +875,6 @@ void acpi_os_wait_events_complete(void *context) | |||
875 | EXPORT_SYMBOL(acpi_os_wait_events_complete); | 875 | EXPORT_SYMBOL(acpi_os_wait_events_complete); |
876 | 876 | ||
877 | /* | 877 | /* |
878 | * Allocate the memory for a spinlock and initialize it. | ||
879 | */ | ||
880 | acpi_status acpi_os_create_lock(acpi_spinlock * handle) | ||
881 | { | ||
882 | spin_lock_init(*handle); | ||
883 | |||
884 | return AE_OK; | ||
885 | } | ||
886 | |||
887 | /* | ||
888 | * Deallocate the memory for a spinlock. | 878 | * Deallocate the memory for a spinlock. |
889 | */ | 879 | */ |
890 | void acpi_os_delete_lock(acpi_spinlock handle) | 880 | void acpi_os_delete_lock(acpi_spinlock handle) |
@@ -1265,21 +1255,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n, | |||
1265 | } | 1255 | } |
1266 | EXPORT_SYMBOL(acpi_check_region); | 1256 | EXPORT_SYMBOL(acpi_check_region); |
1267 | 1257 | ||
1268 | int acpi_check_mem_region(resource_size_t start, resource_size_t n, | ||
1269 | const char *name) | ||
1270 | { | ||
1271 | struct resource res = { | ||
1272 | .start = start, | ||
1273 | .end = start + n - 1, | ||
1274 | .name = name, | ||
1275 | .flags = IORESOURCE_MEM, | ||
1276 | }; | ||
1277 | |||
1278 | return acpi_check_resource_conflict(&res); | ||
1279 | |||
1280 | } | ||
1281 | EXPORT_SYMBOL(acpi_check_mem_region); | ||
1282 | |||
1283 | /* | 1258 | /* |
1284 | * Let drivers know whether the resource checks are effective | 1259 | * Let drivers know whether the resource checks are effective |
1285 | */ | 1260 | */ |
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 356c320bdd0..85e48047d7b 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -917,6 +917,4 @@ static void __exit acpi_processor_exit(void) | |||
917 | module_init(acpi_processor_init); | 917 | module_init(acpi_processor_init); |
918 | module_exit(acpi_processor_exit); | 918 | module_exit(acpi_processor_exit); |
919 | 919 | ||
920 | EXPORT_SYMBOL(acpi_processor_set_thermal_limit); | ||
921 | |||
922 | MODULE_ALIAS("processor"); | 920 | MODULE_ALIAS("processor"); |
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 953b25fb986..fde49b9b1d9 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -44,47 +44,6 @@ | |||
44 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 44 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
45 | ACPI_MODULE_NAME("processor_thermal"); | 45 | ACPI_MODULE_NAME("processor_thermal"); |
46 | 46 | ||
47 | /* -------------------------------------------------------------------------- | ||
48 | Limit Interface | ||
49 | -------------------------------------------------------------------------- */ | ||
50 | static int acpi_processor_apply_limit(struct acpi_processor *pr) | ||
51 | { | ||
52 | int result = 0; | ||
53 | u16 px = 0; | ||
54 | u16 tx = 0; | ||
55 | |||
56 | |||
57 | if (!pr) | ||
58 | return -EINVAL; | ||
59 | |||
60 | if (!pr->flags.limit) | ||
61 | return -ENODEV; | ||
62 | |||
63 | if (pr->flags.throttling) { | ||
64 | if (pr->limit.user.tx > tx) | ||
65 | tx = pr->limit.user.tx; | ||
66 | if (pr->limit.thermal.tx > tx) | ||
67 | tx = pr->limit.thermal.tx; | ||
68 | |||
69 | result = acpi_processor_set_throttling(pr, tx, false); | ||
70 | if (result) | ||
71 | goto end; | ||
72 | } | ||
73 | |||
74 | pr->limit.state.px = px; | ||
75 | pr->limit.state.tx = tx; | ||
76 | |||
77 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
78 | "Processor [%d] limit set to (P%d:T%d)\n", pr->id, | ||
79 | pr->limit.state.px, pr->limit.state.tx)); | ||
80 | |||
81 | end: | ||
82 | if (result) | ||
83 | printk(KERN_ERR PREFIX "Unable to set limit\n"); | ||
84 | |||
85 | return result; | ||
86 | } | ||
87 | |||
88 | #ifdef CONFIG_CPU_FREQ | 47 | #ifdef CONFIG_CPU_FREQ |
89 | 48 | ||
90 | /* If a passive cooling situation is detected, primarily CPUfreq is used, as it | 49 | /* If a passive cooling situation is detected, primarily CPUfreq is used, as it |
@@ -107,36 +66,6 @@ static int cpu_has_cpufreq(unsigned int cpu) | |||
107 | return 1; | 66 | return 1; |
108 | } | 67 | } |
109 | 68 | ||
110 | static int acpi_thermal_cpufreq_increase(unsigned int cpu) | ||
111 | { | ||
112 | if (!cpu_has_cpufreq(cpu)) | ||
113 | return -ENODEV; | ||
114 | |||
115 | if (per_cpu(cpufreq_thermal_reduction_pctg, cpu) < | ||
116 | CPUFREQ_THERMAL_MAX_STEP) { | ||
117 | per_cpu(cpufreq_thermal_reduction_pctg, cpu)++; | ||
118 | cpufreq_update_policy(cpu); | ||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | return -ERANGE; | ||
123 | } | ||
124 | |||
125 | static int acpi_thermal_cpufreq_decrease(unsigned int cpu) | ||
126 | { | ||
127 | if (!cpu_has_cpufreq(cpu)) | ||
128 | return -ENODEV; | ||
129 | |||
130 | if (per_cpu(cpufreq_thermal_reduction_pctg, cpu) > | ||
131 | (CPUFREQ_THERMAL_MIN_STEP + 1)) | ||
132 | per_cpu(cpufreq_thermal_reduction_pctg, cpu)--; | ||
133 | else | ||
134 | per_cpu(cpufreq_thermal_reduction_pctg, cpu) = 0; | ||
135 | cpufreq_update_policy(cpu); | ||
136 | /* We reached max freq again and can leave passive mode */ | ||
137 | return !per_cpu(cpufreq_thermal_reduction_pctg, cpu); | ||
138 | } | ||
139 | |||
140 | static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb, | 69 | static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb, |
141 | unsigned long event, void *data) | 70 | unsigned long event, void *data) |
142 | { | 71 | { |
@@ -238,113 +167,6 @@ static int acpi_thermal_cpufreq_decrease(unsigned int cpu) | |||
238 | 167 | ||
239 | #endif | 168 | #endif |
240 | 169 | ||
241 | int acpi_processor_set_thermal_limit(acpi_handle handle, int type) | ||
242 | { | ||
243 | int result = 0; | ||
244 | struct acpi_processor *pr = NULL; | ||
245 | struct acpi_device *device = NULL; | ||
246 | int tx = 0, max_tx_px = 0; | ||
247 | |||
248 | |||
249 | if ((type < ACPI_PROCESSOR_LIMIT_NONE) | ||
250 | || (type > ACPI_PROCESSOR_LIMIT_DECREMENT)) | ||
251 | return -EINVAL; | ||
252 | |||
253 | result = acpi_bus_get_device(handle, &device); | ||
254 | if (result) | ||
255 | return result; | ||
256 | |||
257 | pr = acpi_driver_data(device); | ||
258 | if (!pr) | ||
259 | return -ENODEV; | ||
260 | |||
261 | /* Thermal limits are always relative to the current Px/Tx state. */ | ||
262 | if (pr->flags.throttling) | ||
263 | pr->limit.thermal.tx = pr->throttling.state; | ||
264 | |||
265 | /* | ||
266 | * Our default policy is to only use throttling at the lowest | ||
267 | * performance state. | ||
268 | */ | ||
269 | |||
270 | tx = pr->limit.thermal.tx; | ||
271 | |||
272 | switch (type) { | ||
273 | |||
274 | case ACPI_PROCESSOR_LIMIT_NONE: | ||
275 | do { | ||
276 | result = acpi_thermal_cpufreq_decrease(pr->id); | ||
277 | } while (!result); | ||
278 | tx = 0; | ||
279 | break; | ||
280 | |||
281 | case ACPI_PROCESSOR_LIMIT_INCREMENT: | ||
282 | /* if going up: P-states first, T-states later */ | ||
283 | |||
284 | result = acpi_thermal_cpufreq_increase(pr->id); | ||
285 | if (!result) | ||
286 | goto end; | ||
287 | else if (result == -ERANGE) | ||
288 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
289 | "At maximum performance state\n")); | ||
290 | |||
291 | if (pr->flags.throttling) { | ||
292 | if (tx == (pr->throttling.state_count - 1)) | ||
293 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
294 | "At maximum throttling state\n")); | ||
295 | else | ||
296 | tx++; | ||
297 | } | ||
298 | break; | ||
299 | |||
300 | case ACPI_PROCESSOR_LIMIT_DECREMENT: | ||
301 | /* if going down: T-states first, P-states later */ | ||
302 | |||
303 | if (pr->flags.throttling) { | ||
304 | if (tx == 0) { | ||
305 | max_tx_px = 1; | ||
306 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
307 | "At minimum throttling state\n")); | ||
308 | } else { | ||
309 | tx--; | ||
310 | goto end; | ||
311 | } | ||
312 | } | ||
313 | |||
314 | result = acpi_thermal_cpufreq_decrease(pr->id); | ||
315 | if (result) { | ||
316 | /* | ||
317 | * We only could get -ERANGE, 1 or 0. | ||
318 | * In the first two cases we reached max freq again. | ||
319 | */ | ||
320 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
321 | "At minimum performance state\n")); | ||
322 | max_tx_px = 1; | ||
323 | } else | ||
324 | max_tx_px = 0; | ||
325 | |||
326 | break; | ||
327 | } | ||
328 | |||
329 | end: | ||
330 | if (pr->flags.throttling) { | ||
331 | pr->limit.thermal.px = 0; | ||
332 | pr->limit.thermal.tx = tx; | ||
333 | |||
334 | result = acpi_processor_apply_limit(pr); | ||
335 | if (result) | ||
336 | printk(KERN_ERR PREFIX "Unable to set thermal limit\n"); | ||
337 | |||
338 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n", | ||
339 | pr->limit.thermal.px, pr->limit.thermal.tx)); | ||
340 | } else | ||
341 | result = 0; | ||
342 | if (max_tx_px) | ||
343 | return 1; | ||
344 | else | ||
345 | return result; | ||
346 | } | ||
347 | |||
348 | int acpi_processor_get_limit_info(struct acpi_processor *pr) | 170 | int acpi_processor_get_limit_info(struct acpi_processor *pr) |
349 | { | 171 | { |
350 | 172 | ||
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index e807f4196f8..721d93b3cee 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "internal.h" | 25 | #include "internal.h" |
26 | #include "sleep.h" | 26 | #include "sleep.h" |
27 | 27 | ||
28 | u8 sleep_states[ACPI_S_STATE_COUNT]; | 28 | static u8 sleep_states[ACPI_S_STATE_COUNT]; |
29 | 29 | ||
30 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | 30 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; |
31 | 31 | ||
@@ -419,6 +419,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
419 | DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), | 419 | DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), |
420 | }, | 420 | }, |
421 | }, | 421 | }, |
422 | { | ||
423 | .callback = init_nvs_nosave, | ||
424 | .ident = "Sony Vaio VPCEB1Z1E", | ||
425 | .matches = { | ||
426 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
427 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), | ||
428 | }, | ||
429 | }, | ||
422 | {}, | 430 | {}, |
423 | }; | 431 | }; |
424 | #endif /* CONFIG_SUSPEND */ | 432 | #endif /* CONFIG_SUSPEND */ |
@@ -706,7 +714,7 @@ static void acpi_power_off(void) | |||
706 | * paths through the BIOS, so disable _GTS and _BFS by default, | 714 | * paths through the BIOS, so disable _GTS and _BFS by default, |
707 | * but do speak up and offer the option to enable them. | 715 | * but do speak up and offer the option to enable them. |
708 | */ | 716 | */ |
709 | void __init acpi_gts_bfs_check(void) | 717 | static void __init acpi_gts_bfs_check(void) |
710 | { | 718 | { |
711 | acpi_handle dummy; | 719 | acpi_handle dummy; |
712 | 720 | ||
diff --git a/drivers/acpi/sleep.h b/drivers/acpi/sleep.h index d8821805c3b..74d59c8f467 100644 --- a/drivers/acpi/sleep.h +++ b/drivers/acpi/sleep.h | |||
@@ -1,5 +1,4 @@ | |||
1 | 1 | ||
2 | extern u8 sleep_states[]; | ||
3 | extern int acpi_suspend(u32 state); | 2 | extern int acpi_suspend(u32 state); |
4 | 3 | ||
5 | extern void acpi_enable_wakeup_devices(u8 sleep_state); | 4 | extern void acpi_enable_wakeup_devices(u8 sleep_state); |