diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 11:48:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 11:48:17 -0400 |
commit | ef54b1bb2e4de212a89a2692a7b2efd70b5fb559 (patch) | |
tree | 41f8a3f0b6bc234efb5151d7b6852babe7fe75a6 /drivers | |
parent | 9fe9293d14e8418f29136216f0180f47270a916a (diff) | |
parent | 1162cf6bc6c4650943735438e2be0785ea40a3c6 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (34 commits)
ACPI, i915: Register ACPI video even when not modesetting
Revert "ACPICA: delete check for AML access to port 0x81-83"
I/O port protection: update for windows compatibility.
sony-laptop: always try to unblock rfkill on load
sony-laptop: fix bogus error message display on resume
ACPI: EC: Fix ACPI EC resume non-query interrupt message
sony-laptop: SNC input event 38 fix
sony-laptop: SNC 127 Initialization Fix
sony-laptop: Duplicate SNC 127 Event Fix
ACPI: prevent processor.max_cstate=0 boot crash
ACPI/hpet: prevent boot hang when hpet=force used on ICH-4M
ACPI: delete obsolete "bus master activity" proc field
ACPI: idle: mark_tsc_unstable() at init-time, not run-time
ACPI: add /sys/firmware/acpi/interrupts/sci_not counter
ACPI video: fix an error when the brightness levels on AC and on Battery are same
acpi-cpufreq: Do not let get_measured perf depend on internal variable
acpi-cpufreq: style-only: add parens to math expression
acpi-cpufreq: Cleanup: Use printk_once
x86, acpi_cpufreq: Fix the NULL pointer dereference in get_measured_perf
thinkpad-acpi: bump up version to 0.23
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/acpica/hwsleep.c | 43 | ||||
-rw-r--r-- | drivers/acpi/acpica/hwvalid.c | 86 | ||||
-rw-r--r-- | drivers/acpi/acpica/rscreate.c | 27 | ||||
-rw-r--r-- | drivers/acpi/button.c | 140 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 1 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 4 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 28 | ||||
-rw-r--r-- | drivers/acpi/sleep.c | 27 | ||||
-rw-r--r-- | drivers/acpi/system.c | 11 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 2 | ||||
-rw-r--r-- | drivers/acpi/video.c | 51 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_opregion.c | 9 | ||||
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 27 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 81 |
14 files changed, 293 insertions, 244 deletions
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index baa5fc05e124..db307a356f08 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c | |||
@@ -211,6 +211,12 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) | |||
211 | 211 | ||
212 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | 212 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) |
213 | 213 | ||
214 | static unsigned int gts, bfs; | ||
215 | module_param(gts, uint, 0644); | ||
216 | module_param(bfs, uint, 0644); | ||
217 | MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); | ||
218 | MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); | ||
219 | |||
214 | /******************************************************************************* | 220 | /******************************************************************************* |
215 | * | 221 | * |
216 | * FUNCTION: acpi_enter_sleep_state | 222 | * FUNCTION: acpi_enter_sleep_state |
@@ -278,16 +284,18 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
278 | return_ACPI_STATUS(status); | 284 | return_ACPI_STATUS(status); |
279 | } | 285 | } |
280 | 286 | ||
281 | /* Execute the _GTS method */ | 287 | if (gts) { |
288 | /* Execute the _GTS method */ | ||
282 | 289 | ||
283 | arg_list.count = 1; | 290 | arg_list.count = 1; |
284 | arg_list.pointer = &arg; | 291 | arg_list.pointer = &arg; |
285 | arg.type = ACPI_TYPE_INTEGER; | 292 | arg.type = ACPI_TYPE_INTEGER; |
286 | arg.integer.value = sleep_state; | 293 | arg.integer.value = sleep_state; |
287 | 294 | ||
288 | status = acpi_evaluate_object(NULL, METHOD_NAME__GTS, &arg_list, NULL); | 295 | status = acpi_evaluate_object(NULL, METHOD_NAME__GTS, &arg_list, NULL); |
289 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | 296 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
290 | return_ACPI_STATUS(status); | 297 | return_ACPI_STATUS(status); |
298 | } | ||
291 | } | 299 | } |
292 | 300 | ||
293 | /* Get current value of PM1A control */ | 301 | /* Get current value of PM1A control */ |
@@ -513,18 +521,19 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) | |||
513 | } | 521 | } |
514 | } | 522 | } |
515 | 523 | ||
516 | /* Execute the _BFS method */ | 524 | if (bfs) { |
525 | /* Execute the _BFS method */ | ||
517 | 526 | ||
518 | arg_list.count = 1; | 527 | arg_list.count = 1; |
519 | arg_list.pointer = &arg; | 528 | arg_list.pointer = &arg; |
520 | arg.type = ACPI_TYPE_INTEGER; | 529 | arg.type = ACPI_TYPE_INTEGER; |
521 | arg.integer.value = sleep_state; | 530 | arg.integer.value = sleep_state; |
522 | 531 | ||
523 | status = acpi_evaluate_object(NULL, METHOD_NAME__BFS, &arg_list, NULL); | 532 | status = acpi_evaluate_object(NULL, METHOD_NAME__BFS, &arg_list, NULL); |
524 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | 533 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
525 | ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS")); | 534 | ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS")); |
535 | } | ||
526 | } | 536 | } |
527 | |||
528 | return_ACPI_STATUS(status); | 537 | return_ACPI_STATUS(status); |
529 | } | 538 | } |
530 | 539 | ||
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c index 7737afb157c3..ec33f270c5b7 100644 --- a/drivers/acpi/acpica/hwvalid.c +++ b/drivers/acpi/acpica/hwvalid.c | |||
@@ -90,6 +90,7 @@ static const struct acpi_port_info acpi_protected_ports[] = { | |||
90 | {"PIT2", 0x0048, 0x004B, ACPI_OSI_WIN_XP}, | 90 | {"PIT2", 0x0048, 0x004B, ACPI_OSI_WIN_XP}, |
91 | {"RTC", 0x0070, 0x0071, ACPI_OSI_WIN_XP}, | 91 | {"RTC", 0x0070, 0x0071, ACPI_OSI_WIN_XP}, |
92 | {"CMOS", 0x0074, 0x0076, ACPI_OSI_WIN_XP}, | 92 | {"CMOS", 0x0074, 0x0076, ACPI_OSI_WIN_XP}, |
93 | {"DMA1", 0x0081, 0x0083, ACPI_OSI_WIN_XP}, | ||
93 | {"DMA1L", 0x0087, 0x0087, ACPI_OSI_WIN_XP}, | 94 | {"DMA1L", 0x0087, 0x0087, ACPI_OSI_WIN_XP}, |
94 | {"DMA2", 0x0089, 0x008B, ACPI_OSI_WIN_XP}, | 95 | {"DMA2", 0x0089, 0x008B, ACPI_OSI_WIN_XP}, |
95 | {"DMA2L", 0x008F, 0x008F, ACPI_OSI_WIN_XP}, | 96 | {"DMA2L", 0x008F, 0x008F, ACPI_OSI_WIN_XP}, |
@@ -151,7 +152,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) | |||
151 | ACPI_ERROR((AE_INFO, | 152 | ACPI_ERROR((AE_INFO, |
152 | "Illegal I/O port address/length above 64K: 0x%p/%X", | 153 | "Illegal I/O port address/length above 64K: 0x%p/%X", |
153 | ACPI_CAST_PTR(void, address), byte_width)); | 154 | ACPI_CAST_PTR(void, address), byte_width)); |
154 | return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS); | 155 | return_ACPI_STATUS(AE_LIMIT); |
155 | } | 156 | } |
156 | 157 | ||
157 | /* Exit if requested address is not within the protected port table */ | 158 | /* Exit if requested address is not within the protected port table */ |
@@ -178,11 +179,12 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) | |||
178 | /* Port illegality may depend on the _OSI calls made by the BIOS */ | 179 | /* Port illegality may depend on the _OSI calls made by the BIOS */ |
179 | 180 | ||
180 | if (acpi_gbl_osi_data >= port_info->osi_dependency) { | 181 | if (acpi_gbl_osi_data >= port_info->osi_dependency) { |
181 | ACPI_ERROR((AE_INFO, | 182 | ACPI_DEBUG_PRINT((ACPI_DB_IO, |
182 | "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)", | 183 | "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)", |
183 | ACPI_CAST_PTR(void, address), | 184 | ACPI_CAST_PTR(void, address), |
184 | byte_width, port_info->name, | 185 | byte_width, port_info->name, |
185 | port_info->start, port_info->end)); | 186 | port_info->start, |
187 | port_info->end)); | ||
186 | 188 | ||
187 | return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS); | 189 | return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS); |
188 | } | 190 | } |
@@ -206,7 +208,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) | |||
206 | * Value Where value is placed | 208 | * Value Where value is placed |
207 | * Width Number of bits | 209 | * Width Number of bits |
208 | * | 210 | * |
209 | * RETURN: Value read from port | 211 | * RETURN: Status and value read from port |
210 | * | 212 | * |
211 | * DESCRIPTION: Read data from an I/O port or register. This is a front-end | 213 | * DESCRIPTION: Read data from an I/O port or register. This is a front-end |
212 | * to acpi_os_read_port that performs validation on both the port | 214 | * to acpi_os_read_port that performs validation on both the port |
@@ -217,14 +219,43 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width) | |||
217 | acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width) | 219 | acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width) |
218 | { | 220 | { |
219 | acpi_status status; | 221 | acpi_status status; |
222 | u32 one_byte; | ||
223 | u32 i; | ||
224 | |||
225 | /* Validate the entire request and perform the I/O */ | ||
220 | 226 | ||
221 | status = acpi_hw_validate_io_request(address, width); | 227 | status = acpi_hw_validate_io_request(address, width); |
222 | if (ACPI_FAILURE(status)) { | 228 | if (ACPI_SUCCESS(status)) { |
229 | status = acpi_os_read_port(address, value, width); | ||
223 | return status; | 230 | return status; |
224 | } | 231 | } |
225 | 232 | ||
226 | status = acpi_os_read_port(address, value, width); | 233 | if (status != AE_AML_ILLEGAL_ADDRESS) { |
227 | return status; | 234 | return status; |
235 | } | ||
236 | |||
237 | /* | ||
238 | * There has been a protection violation within the request. Fall | ||
239 | * back to byte granularity port I/O and ignore the failing bytes. | ||
240 | * This provides Windows compatibility. | ||
241 | */ | ||
242 | for (i = 0, *value = 0; i < width; i += 8) { | ||
243 | |||
244 | /* Validate and read one byte */ | ||
245 | |||
246 | if (acpi_hw_validate_io_request(address, 8) == AE_OK) { | ||
247 | status = acpi_os_read_port(address, &one_byte, 8); | ||
248 | if (ACPI_FAILURE(status)) { | ||
249 | return status; | ||
250 | } | ||
251 | |||
252 | *value |= (one_byte << i); | ||
253 | } | ||
254 | |||
255 | address++; | ||
256 | } | ||
257 | |||
258 | return AE_OK; | ||
228 | } | 259 | } |
229 | 260 | ||
230 | /****************************************************************************** | 261 | /****************************************************************************** |
@@ -235,7 +266,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width) | |||
235 | * Value Value to write | 266 | * Value Value to write |
236 | * Width Number of bits | 267 | * Width Number of bits |
237 | * | 268 | * |
238 | * RETURN: None | 269 | * RETURN: Status |
239 | * | 270 | * |
240 | * DESCRIPTION: Write data to an I/O port or register. This is a front-end | 271 | * DESCRIPTION: Write data to an I/O port or register. This is a front-end |
241 | * to acpi_os_write_port that performs validation on both the port | 272 | * to acpi_os_write_port that performs validation on both the port |
@@ -246,12 +277,39 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width) | |||
246 | acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width) | 277 | acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width) |
247 | { | 278 | { |
248 | acpi_status status; | 279 | acpi_status status; |
280 | u32 i; | ||
281 | |||
282 | /* Validate the entire request and perform the I/O */ | ||
249 | 283 | ||
250 | status = acpi_hw_validate_io_request(address, width); | 284 | status = acpi_hw_validate_io_request(address, width); |
251 | if (ACPI_FAILURE(status)) { | 285 | if (ACPI_SUCCESS(status)) { |
286 | status = acpi_os_write_port(address, value, width); | ||
252 | return status; | 287 | return status; |
253 | } | 288 | } |
254 | 289 | ||
255 | status = acpi_os_write_port(address, value, width); | 290 | if (status != AE_AML_ILLEGAL_ADDRESS) { |
256 | return status; | 291 | return status; |
292 | } | ||
293 | |||
294 | /* | ||
295 | * There has been a protection violation within the request. Fall | ||
296 | * back to byte granularity port I/O and ignore the failing bytes. | ||
297 | * This provides Windows compatibility. | ||
298 | */ | ||
299 | for (i = 0; i < width; i += 8) { | ||
300 | |||
301 | /* Validate and write one byte */ | ||
302 | |||
303 | if (acpi_hw_validate_io_request(address, 8) == AE_OK) { | ||
304 | status = | ||
305 | acpi_os_write_port(address, (value >> i) & 0xFF, 8); | ||
306 | if (ACPI_FAILURE(status)) { | ||
307 | return status; | ||
308 | } | ||
309 | } | ||
310 | |||
311 | address++; | ||
312 | } | ||
313 | |||
314 | return AE_OK; | ||
257 | } | 315 | } |
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 663f692fffcf..a3c23d686d5f 100644 --- a/drivers/acpi/acpica/rscreate.c +++ b/drivers/acpi/acpica/rscreate.c | |||
@@ -191,8 +191,6 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
191 | user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); | 191 | user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); |
192 | 192 | ||
193 | for (index = 0; index < number_of_elements; index++) { | 193 | for (index = 0; index < number_of_elements; index++) { |
194 | int source_name_index = 2; | ||
195 | int source_index_index = 3; | ||
196 | 194 | ||
197 | /* | 195 | /* |
198 | * Point user_prt past this current structure | 196 | * Point user_prt past this current structure |
@@ -261,27 +259,6 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
261 | return_ACPI_STATUS(AE_BAD_DATA); | 259 | return_ACPI_STATUS(AE_BAD_DATA); |
262 | } | 260 | } |
263 | 261 | ||
264 | /* | ||
265 | * If BIOS erroneously reversed the _PRT source_name and source_index, | ||
266 | * then reverse them back. | ||
267 | */ | ||
268 | if ((sub_object_list[3])->common.type != | ||
269 | ACPI_TYPE_INTEGER) { | ||
270 | if (acpi_gbl_enable_interpreter_slack) { | ||
271 | source_name_index = 3; | ||
272 | source_index_index = 2; | ||
273 | printk(KERN_WARNING | ||
274 | "ACPI: Handling Garbled _PRT entry\n"); | ||
275 | } else { | ||
276 | ACPI_ERROR((AE_INFO, | ||
277 | "(PRT[%X].source_index) Need Integer, found %s", | ||
278 | index, | ||
279 | acpi_ut_get_object_type_name | ||
280 | (sub_object_list[3]))); | ||
281 | return_ACPI_STATUS(AE_BAD_DATA); | ||
282 | } | ||
283 | } | ||
284 | |||
285 | user_prt->pin = (u32) obj_desc->integer.value; | 262 | user_prt->pin = (u32) obj_desc->integer.value; |
286 | 263 | ||
287 | /* | 264 | /* |
@@ -304,7 +281,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
304 | * 3) Third subobject: Dereference the PRT.source_name | 281 | * 3) Third subobject: Dereference the PRT.source_name |
305 | * The name may be unresolved (slack mode), so allow a null object | 282 | * The name may be unresolved (slack mode), so allow a null object |
306 | */ | 283 | */ |
307 | obj_desc = sub_object_list[source_name_index]; | 284 | obj_desc = sub_object_list[2]; |
308 | if (obj_desc) { | 285 | if (obj_desc) { |
309 | switch (obj_desc->common.type) { | 286 | switch (obj_desc->common.type) { |
310 | case ACPI_TYPE_LOCAL_REFERENCE: | 287 | case ACPI_TYPE_LOCAL_REFERENCE: |
@@ -378,7 +355,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
378 | 355 | ||
379 | /* 4) Fourth subobject: Dereference the PRT.source_index */ | 356 | /* 4) Fourth subobject: Dereference the PRT.source_index */ |
380 | 357 | ||
381 | obj_desc = sub_object_list[source_index_index]; | 358 | obj_desc = sub_object_list[3]; |
382 | if (obj_desc->common.type != ACPI_TYPE_INTEGER) { | 359 | if (obj_desc->common.type != ACPI_TYPE_INTEGER) { |
383 | ACPI_ERROR((AE_INFO, | 360 | ACPI_ERROR((AE_INFO, |
384 | "(PRT[%X].SourceIndex) Need Integer, found %s", | 361 | "(PRT[%X].SourceIndex) Need Integer, found %s", |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index d73c94b8441d..9195deba9d94 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * acpi_button.c - ACPI Button Driver ($Revision: 30 $) | 2 | * button.c - ACPI Button Driver |
3 | * | 3 | * |
4 | * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> | 4 | * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> |
5 | * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> | 5 | * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> |
@@ -41,17 +41,13 @@ | |||
41 | 41 | ||
42 | #define ACPI_BUTTON_SUBCLASS_POWER "power" | 42 | #define ACPI_BUTTON_SUBCLASS_POWER "power" |
43 | #define ACPI_BUTTON_HID_POWER "PNP0C0C" | 43 | #define ACPI_BUTTON_HID_POWER "PNP0C0C" |
44 | #define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button (CM)" | 44 | #define ACPI_BUTTON_DEVICE_NAME_POWER "Power Button" |
45 | #define ACPI_BUTTON_DEVICE_NAME_POWERF "Power Button (FF)" | ||
46 | #define ACPI_BUTTON_TYPE_POWER 0x01 | 45 | #define ACPI_BUTTON_TYPE_POWER 0x01 |
47 | #define ACPI_BUTTON_TYPE_POWERF 0x02 | ||
48 | 46 | ||
49 | #define ACPI_BUTTON_SUBCLASS_SLEEP "sleep" | 47 | #define ACPI_BUTTON_SUBCLASS_SLEEP "sleep" |
50 | #define ACPI_BUTTON_HID_SLEEP "PNP0C0E" | 48 | #define ACPI_BUTTON_HID_SLEEP "PNP0C0E" |
51 | #define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button (CM)" | 49 | #define ACPI_BUTTON_DEVICE_NAME_SLEEP "Sleep Button" |
52 | #define ACPI_BUTTON_DEVICE_NAME_SLEEPF "Sleep Button (FF)" | ||
53 | #define ACPI_BUTTON_TYPE_SLEEP 0x03 | 50 | #define ACPI_BUTTON_TYPE_SLEEP 0x03 |
54 | #define ACPI_BUTTON_TYPE_SLEEPF 0x04 | ||
55 | 51 | ||
56 | #define ACPI_BUTTON_SUBCLASS_LID "lid" | 52 | #define ACPI_BUTTON_SUBCLASS_LID "lid" |
57 | #define ACPI_BUTTON_HID_LID "PNP0C0D" | 53 | #define ACPI_BUTTON_HID_LID "PNP0C0D" |
@@ -95,7 +91,6 @@ static struct acpi_driver acpi_button_driver = { | |||
95 | }; | 91 | }; |
96 | 92 | ||
97 | struct acpi_button { | 93 | struct acpi_button { |
98 | struct acpi_device *device; /* Fixed button kludge */ | ||
99 | unsigned int type; | 94 | unsigned int type; |
100 | struct input_dev *input; | 95 | struct input_dev *input; |
101 | char phys[32]; /* for input device */ | 96 | char phys[32]; /* for input device */ |
@@ -126,14 +121,10 @@ static struct proc_dir_entry *acpi_button_dir; | |||
126 | 121 | ||
127 | static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) | 122 | static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) |
128 | { | 123 | { |
129 | struct acpi_button *button = seq->private; | 124 | struct acpi_device *device = seq->private; |
130 | |||
131 | if (!button || !button->device) | ||
132 | return 0; | ||
133 | 125 | ||
134 | seq_printf(seq, "type: %s\n", | 126 | seq_printf(seq, "type: %s\n", |
135 | acpi_device_name(button->device)); | 127 | acpi_device_name(device)); |
136 | |||
137 | return 0; | 128 | return 0; |
138 | } | 129 | } |
139 | 130 | ||
@@ -144,14 +135,11 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file) | |||
144 | 135 | ||
145 | static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) | 136 | static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) |
146 | { | 137 | { |
147 | struct acpi_button *button = seq->private; | 138 | struct acpi_device *device = seq->private; |
148 | acpi_status status; | 139 | acpi_status status; |
149 | unsigned long long state; | 140 | unsigned long long state; |
150 | 141 | ||
151 | if (!button || !button->device) | 142 | status = acpi_evaluate_integer(device->handle, "_LID", NULL, &state); |
152 | return 0; | ||
153 | |||
154 | status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, &state); | ||
155 | seq_printf(seq, "state: %s\n", | 143 | seq_printf(seq, "state: %s\n", |
156 | ACPI_FAILURE(status) ? "unsupported" : | 144 | ACPI_FAILURE(status) ? "unsupported" : |
157 | (state ? "open" : "closed")); | 145 | (state ? "open" : "closed")); |
@@ -169,24 +157,17 @@ static struct proc_dir_entry *acpi_lid_dir; | |||
169 | 157 | ||
170 | static int acpi_button_add_fs(struct acpi_device *device) | 158 | static int acpi_button_add_fs(struct acpi_device *device) |
171 | { | 159 | { |
160 | struct acpi_button *button = acpi_driver_data(device); | ||
172 | struct proc_dir_entry *entry = NULL; | 161 | struct proc_dir_entry *entry = NULL; |
173 | struct acpi_button *button; | ||
174 | |||
175 | if (!device || !acpi_driver_data(device)) | ||
176 | return -EINVAL; | ||
177 | |||
178 | button = acpi_driver_data(device); | ||
179 | 162 | ||
180 | switch (button->type) { | 163 | switch (button->type) { |
181 | case ACPI_BUTTON_TYPE_POWER: | 164 | case ACPI_BUTTON_TYPE_POWER: |
182 | case ACPI_BUTTON_TYPE_POWERF: | ||
183 | if (!acpi_power_dir) | 165 | if (!acpi_power_dir) |
184 | acpi_power_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER, | 166 | acpi_power_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER, |
185 | acpi_button_dir); | 167 | acpi_button_dir); |
186 | entry = acpi_power_dir; | 168 | entry = acpi_power_dir; |
187 | break; | 169 | break; |
188 | case ACPI_BUTTON_TYPE_SLEEP: | 170 | case ACPI_BUTTON_TYPE_SLEEP: |
189 | case ACPI_BUTTON_TYPE_SLEEPF: | ||
190 | if (!acpi_sleep_dir) | 171 | if (!acpi_sleep_dir) |
191 | acpi_sleep_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP, | 172 | acpi_sleep_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP, |
192 | acpi_button_dir); | 173 | acpi_button_dir); |
@@ -210,8 +191,7 @@ static int acpi_button_add_fs(struct acpi_device *device) | |||
210 | /* 'info' [R] */ | 191 | /* 'info' [R] */ |
211 | entry = proc_create_data(ACPI_BUTTON_FILE_INFO, | 192 | entry = proc_create_data(ACPI_BUTTON_FILE_INFO, |
212 | S_IRUGO, acpi_device_dir(device), | 193 | S_IRUGO, acpi_device_dir(device), |
213 | &acpi_button_info_fops, | 194 | &acpi_button_info_fops, device); |
214 | acpi_driver_data(device)); | ||
215 | if (!entry) | 195 | if (!entry) |
216 | return -ENODEV; | 196 | return -ENODEV; |
217 | 197 | ||
@@ -219,8 +199,7 @@ static int acpi_button_add_fs(struct acpi_device *device) | |||
219 | if (button->type == ACPI_BUTTON_TYPE_LID) { | 199 | if (button->type == ACPI_BUTTON_TYPE_LID) { |
220 | entry = proc_create_data(ACPI_BUTTON_FILE_STATE, | 200 | entry = proc_create_data(ACPI_BUTTON_FILE_STATE, |
221 | S_IRUGO, acpi_device_dir(device), | 201 | S_IRUGO, acpi_device_dir(device), |
222 | &acpi_button_state_fops, | 202 | &acpi_button_state_fops, device); |
223 | acpi_driver_data(device)); | ||
224 | if (!entry) | 203 | if (!entry) |
225 | return -ENODEV; | 204 | return -ENODEV; |
226 | } | 205 | } |
@@ -250,15 +229,16 @@ static int acpi_button_remove_fs(struct acpi_device *device) | |||
250 | /* -------------------------------------------------------------------------- | 229 | /* -------------------------------------------------------------------------- |
251 | Driver Interface | 230 | Driver Interface |
252 | -------------------------------------------------------------------------- */ | 231 | -------------------------------------------------------------------------- */ |
253 | static int acpi_lid_send_state(struct acpi_button *button) | 232 | static int acpi_lid_send_state(struct acpi_device *device) |
254 | { | 233 | { |
234 | struct acpi_button *button = acpi_driver_data(device); | ||
255 | unsigned long long state; | 235 | unsigned long long state; |
256 | acpi_status status; | 236 | acpi_status status; |
257 | 237 | ||
258 | status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, | 238 | status = acpi_evaluate_integer(device->handle, "_LID", NULL, &state); |
259 | &state); | ||
260 | if (ACPI_FAILURE(status)) | 239 | if (ACPI_FAILURE(status)) |
261 | return -ENODEV; | 240 | return -ENODEV; |
241 | |||
262 | /* input layer checks if event is redundant */ | 242 | /* input layer checks if event is redundant */ |
263 | input_report_switch(button->input, SW_LID, !state); | 243 | input_report_switch(button->input, SW_LID, !state); |
264 | input_sync(button->input); | 244 | input_sync(button->input); |
@@ -270,9 +250,6 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) | |||
270 | struct acpi_button *button = acpi_driver_data(device); | 250 | struct acpi_button *button = acpi_driver_data(device); |
271 | struct input_dev *input; | 251 | struct input_dev *input; |
272 | 252 | ||
273 | if (!button || !button->device) | ||
274 | return; | ||
275 | |||
276 | switch (event) { | 253 | switch (event) { |
277 | case ACPI_FIXED_HARDWARE_EVENT: | 254 | case ACPI_FIXED_HARDWARE_EVENT: |
278 | event = ACPI_BUTTON_NOTIFY_STATUS; | 255 | event = ACPI_BUTTON_NOTIFY_STATUS; |
@@ -280,7 +257,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) | |||
280 | case ACPI_BUTTON_NOTIFY_STATUS: | 257 | case ACPI_BUTTON_NOTIFY_STATUS: |
281 | input = button->input; | 258 | input = button->input; |
282 | if (button->type == ACPI_BUTTON_TYPE_LID) { | 259 | if (button->type == ACPI_BUTTON_TYPE_LID) { |
283 | acpi_lid_send_state(button); | 260 | acpi_lid_send_state(device); |
284 | } else { | 261 | } else { |
285 | int keycode = test_bit(KEY_SLEEP, input->keybit) ? | 262 | int keycode = test_bit(KEY_SLEEP, input->keybit) ? |
286 | KEY_SLEEP : KEY_POWER; | 263 | KEY_SLEEP : KEY_POWER; |
@@ -291,43 +268,35 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) | |||
291 | input_sync(input); | 268 | input_sync(input); |
292 | } | 269 | } |
293 | 270 | ||
294 | acpi_bus_generate_proc_event(button->device, event, | 271 | acpi_bus_generate_proc_event(device, event, ++button->pushed); |
295 | ++button->pushed); | ||
296 | break; | 272 | break; |
297 | default: | 273 | default: |
298 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 274 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
299 | "Unsupported event [0x%x]\n", event)); | 275 | "Unsupported event [0x%x]\n", event)); |
300 | break; | 276 | break; |
301 | } | 277 | } |
302 | |||
303 | return; | ||
304 | } | 278 | } |
305 | 279 | ||
306 | static int acpi_button_resume(struct acpi_device *device) | 280 | static int acpi_button_resume(struct acpi_device *device) |
307 | { | 281 | { |
308 | struct acpi_button *button; | 282 | struct acpi_button *button = acpi_driver_data(device); |
309 | if (!device) | 283 | |
310 | return -EINVAL; | 284 | if (button->type == ACPI_BUTTON_TYPE_LID) |
311 | button = acpi_driver_data(device); | 285 | return acpi_lid_send_state(device); |
312 | if (button && button->type == ACPI_BUTTON_TYPE_LID) | ||
313 | return acpi_lid_send_state(button); | ||
314 | return 0; | 286 | return 0; |
315 | } | 287 | } |
316 | 288 | ||
317 | static int acpi_button_add(struct acpi_device *device) | 289 | static int acpi_button_add(struct acpi_device *device) |
318 | { | 290 | { |
319 | int error; | ||
320 | struct acpi_button *button; | 291 | struct acpi_button *button; |
321 | struct input_dev *input; | 292 | struct input_dev *input; |
322 | 293 | char *hid, *name, *class; | |
323 | if (!device) | 294 | int error; |
324 | return -EINVAL; | ||
325 | 295 | ||
326 | button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL); | 296 | button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL); |
327 | if (!button) | 297 | if (!button) |
328 | return -ENOMEM; | 298 | return -ENOMEM; |
329 | 299 | ||
330 | button->device = device; | ||
331 | device->driver_data = button; | 300 | device->driver_data = button; |
332 | 301 | ||
333 | button->input = input = input_allocate_device(); | 302 | button->input = input = input_allocate_device(); |
@@ -336,40 +305,29 @@ static int acpi_button_add(struct acpi_device *device) | |||
336 | goto err_free_button; | 305 | goto err_free_button; |
337 | } | 306 | } |
338 | 307 | ||
339 | /* | 308 | hid = acpi_device_hid(device); |
340 | * Determine the button type (via hid), as fixed-feature buttons | 309 | name = acpi_device_name(device); |
341 | * need to be handled a bit differently than generic-space. | 310 | class = acpi_device_class(device); |
342 | */ | 311 | |
343 | if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) { | 312 | if (!strcmp(hid, ACPI_BUTTON_HID_POWER) || |
313 | !strcmp(hid, ACPI_BUTTON_HID_POWERF)) { | ||
344 | button->type = ACPI_BUTTON_TYPE_POWER; | 314 | button->type = ACPI_BUTTON_TYPE_POWER; |
345 | strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_POWER); | 315 | strcpy(name, ACPI_BUTTON_DEVICE_NAME_POWER); |
346 | sprintf(acpi_device_class(device), "%s/%s", | 316 | sprintf(class, "%s/%s", |
347 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); | ||
348 | } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) { | ||
349 | button->type = ACPI_BUTTON_TYPE_POWERF; | ||
350 | strcpy(acpi_device_name(device), | ||
351 | ACPI_BUTTON_DEVICE_NAME_POWERF); | ||
352 | sprintf(acpi_device_class(device), "%s/%s", | ||
353 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); | 317 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); |
354 | } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) { | 318 | } else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEP) || |
319 | !strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) { | ||
355 | button->type = ACPI_BUTTON_TYPE_SLEEP; | 320 | button->type = ACPI_BUTTON_TYPE_SLEEP; |
356 | strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_SLEEP); | 321 | strcpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEP); |
357 | sprintf(acpi_device_class(device), "%s/%s", | 322 | sprintf(class, "%s/%s", |
358 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); | ||
359 | } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) { | ||
360 | button->type = ACPI_BUTTON_TYPE_SLEEPF; | ||
361 | strcpy(acpi_device_name(device), | ||
362 | ACPI_BUTTON_DEVICE_NAME_SLEEPF); | ||
363 | sprintf(acpi_device_class(device), "%s/%s", | ||
364 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); | 323 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); |
365 | } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) { | 324 | } else if (!strcmp(hid, ACPI_BUTTON_HID_LID)) { |
366 | button->type = ACPI_BUTTON_TYPE_LID; | 325 | button->type = ACPI_BUTTON_TYPE_LID; |
367 | strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_LID); | 326 | strcpy(name, ACPI_BUTTON_DEVICE_NAME_LID); |
368 | sprintf(acpi_device_class(device), "%s/%s", | 327 | sprintf(class, "%s/%s", |
369 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); | 328 | ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); |
370 | } else { | 329 | } else { |
371 | printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", | 330 | printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid); |
372 | acpi_device_hid(device)); | ||
373 | error = -ENODEV; | 331 | error = -ENODEV; |
374 | goto err_free_input; | 332 | goto err_free_input; |
375 | } | 333 | } |
@@ -378,10 +336,9 @@ static int acpi_button_add(struct acpi_device *device) | |||
378 | if (error) | 336 | if (error) |
379 | goto err_free_input; | 337 | goto err_free_input; |
380 | 338 | ||
381 | snprintf(button->phys, sizeof(button->phys), | 339 | snprintf(button->phys, sizeof(button->phys), "%s/button/input0", hid); |
382 | "%s/button/input0", acpi_device_hid(device)); | ||
383 | 340 | ||
384 | input->name = acpi_device_name(device); | 341 | input->name = name; |
385 | input->phys = button->phys; | 342 | input->phys = button->phys; |
386 | input->id.bustype = BUS_HOST; | 343 | input->id.bustype = BUS_HOST; |
387 | input->id.product = button->type; | 344 | input->id.product = button->type; |
@@ -389,13 +346,11 @@ static int acpi_button_add(struct acpi_device *device) | |||
389 | 346 | ||
390 | switch (button->type) { | 347 | switch (button->type) { |
391 | case ACPI_BUTTON_TYPE_POWER: | 348 | case ACPI_BUTTON_TYPE_POWER: |
392 | case ACPI_BUTTON_TYPE_POWERF: | ||
393 | input->evbit[0] = BIT_MASK(EV_KEY); | 349 | input->evbit[0] = BIT_MASK(EV_KEY); |
394 | set_bit(KEY_POWER, input->keybit); | 350 | set_bit(KEY_POWER, input->keybit); |
395 | break; | 351 | break; |
396 | 352 | ||
397 | case ACPI_BUTTON_TYPE_SLEEP: | 353 | case ACPI_BUTTON_TYPE_SLEEP: |
398 | case ACPI_BUTTON_TYPE_SLEEPF: | ||
399 | input->evbit[0] = BIT_MASK(EV_KEY); | 354 | input->evbit[0] = BIT_MASK(EV_KEY); |
400 | set_bit(KEY_SLEEP, input->keybit); | 355 | set_bit(KEY_SLEEP, input->keybit); |
401 | break; | 356 | break; |
@@ -410,7 +365,7 @@ static int acpi_button_add(struct acpi_device *device) | |||
410 | if (error) | 365 | if (error) |
411 | goto err_remove_fs; | 366 | goto err_remove_fs; |
412 | if (button->type == ACPI_BUTTON_TYPE_LID) | 367 | if (button->type == ACPI_BUTTON_TYPE_LID) |
413 | acpi_lid_send_state(button); | 368 | acpi_lid_send_state(device); |
414 | 369 | ||
415 | if (device->wakeup.flags.valid) { | 370 | if (device->wakeup.flags.valid) { |
416 | /* Button's GPE is run-wake GPE */ | 371 | /* Button's GPE is run-wake GPE */ |
@@ -422,9 +377,7 @@ static int acpi_button_add(struct acpi_device *device) | |||
422 | device->wakeup.state.enabled = 1; | 377 | device->wakeup.state.enabled = 1; |
423 | } | 378 | } |
424 | 379 | ||
425 | printk(KERN_INFO PREFIX "%s [%s]\n", | 380 | printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); |
426 | acpi_device_name(device), acpi_device_bid(device)); | ||
427 | |||
428 | return 0; | 381 | return 0; |
429 | 382 | ||
430 | err_remove_fs: | 383 | err_remove_fs: |
@@ -438,17 +391,11 @@ static int acpi_button_add(struct acpi_device *device) | |||
438 | 391 | ||
439 | static int acpi_button_remove(struct acpi_device *device, int type) | 392 | static int acpi_button_remove(struct acpi_device *device, int type) |
440 | { | 393 | { |
441 | struct acpi_button *button; | 394 | struct acpi_button *button = acpi_driver_data(device); |
442 | |||
443 | if (!device || !acpi_driver_data(device)) | ||
444 | return -EINVAL; | ||
445 | |||
446 | button = acpi_driver_data(device); | ||
447 | 395 | ||
448 | acpi_button_remove_fs(device); | 396 | acpi_button_remove_fs(device); |
449 | input_unregister_device(button->input); | 397 | input_unregister_device(button->input); |
450 | kfree(button); | 398 | kfree(button); |
451 | |||
452 | return 0; | 399 | return 0; |
453 | } | 400 | } |
454 | 401 | ||
@@ -459,6 +406,7 @@ static int __init acpi_button_init(void) | |||
459 | acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); | 406 | acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); |
460 | if (!acpi_button_dir) | 407 | if (!acpi_button_dir) |
461 | return -ENODEV; | 408 | return -ENODEV; |
409 | |||
462 | result = acpi_bus_register_driver(&acpi_button_driver); | 410 | result = acpi_bus_register_driver(&acpi_button_driver); |
463 | if (result < 0) { | 411 | if (result < 0) { |
464 | remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); | 412 | remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 04e90443eff7..391f331674c7 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1065,6 +1065,7 @@ static int acpi_ec_resume(struct acpi_device *device) | |||
1065 | struct acpi_ec *ec = acpi_driver_data(device); | 1065 | struct acpi_ec *ec = acpi_driver_data(device); |
1066 | /* Enable use of GPE back */ | 1066 | /* Enable use of GPE back */ |
1067 | clear_bit(EC_FLAGS_NO_GPE, &ec->flags); | 1067 | clear_bit(EC_FLAGS_NO_GPE, &ec->flags); |
1068 | set_bit(EC_FLAGS_GPE_MODE, &ec->flags); | ||
1068 | acpi_enable_gpe(NULL, ec->gpe); | 1069 | acpi_enable_gpe(NULL, ec->gpe); |
1069 | return 0; | 1070 | return 0; |
1070 | } | 1071 | } |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index d59f08ecaf16..d916bea729f1 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -353,8 +353,10 @@ static irqreturn_t acpi_irq(int irq, void *dev_id) | |||
353 | if (handled) { | 353 | if (handled) { |
354 | acpi_irq_handled++; | 354 | acpi_irq_handled++; |
355 | return IRQ_HANDLED; | 355 | return IRQ_HANDLED; |
356 | } else | 356 | } else { |
357 | acpi_irq_not_handled++; | ||
357 | return IRQ_NONE; | 358 | return IRQ_NONE; |
359 | } | ||
358 | } | 360 | } |
359 | 361 | ||
360 | acpi_status | 362 | acpi_status |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6fe121434ffb..f7ca8c55956b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -581,6 +581,11 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
581 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { | 581 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { |
582 | struct acpi_processor_cx *cx = &pr->power.states[i]; | 582 | struct acpi_processor_cx *cx = &pr->power.states[i]; |
583 | 583 | ||
584 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
585 | /* TSC could halt in idle, so notify users */ | ||
586 | if (tsc_halts_in_c(cx->type)) | ||
587 | mark_tsc_unstable("TSC halts in idle");; | ||
588 | #endif | ||
584 | switch (cx->type) { | 589 | switch (cx->type) { |
585 | case ACPI_STATE_C1: | 590 | case ACPI_STATE_C1: |
586 | cx->valid = 1; | 591 | cx->valid = 1; |
@@ -657,11 +662,9 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
657 | 662 | ||
658 | seq_printf(seq, "active state: C%zd\n" | 663 | seq_printf(seq, "active state: C%zd\n" |
659 | "max_cstate: C%d\n" | 664 | "max_cstate: C%d\n" |
660 | "bus master activity: %08x\n" | ||
661 | "maximum allowed latency: %d usec\n", | 665 | "maximum allowed latency: %d usec\n", |
662 | pr->power.state ? pr->power.state - pr->power.states : 0, | 666 | pr->power.state ? pr->power.state - pr->power.states : 0, |
663 | max_cstate, (unsigned)pr->power.bm_activity, | 667 | max_cstate, pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)); |
664 | pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)); | ||
665 | 668 | ||
666 | seq_puts(seq, "states:\n"); | 669 | seq_puts(seq, "states:\n"); |
667 | 670 | ||
@@ -871,11 +874,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
871 | kt2 = ktime_get_real(); | 874 | kt2 = ktime_get_real(); |
872 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 875 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); |
873 | 876 | ||
874 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
875 | /* TSC could halt in idle, so notify users */ | ||
876 | if (tsc_halts_in_c(cx->type)) | ||
877 | mark_tsc_unstable("TSC halts in idle");; | ||
878 | #endif | ||
879 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 877 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
880 | 878 | ||
881 | /* Tell the scheduler how much we idled: */ | 879 | /* Tell the scheduler how much we idled: */ |
@@ -955,6 +953,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
955 | */ | 953 | */ |
956 | acpi_state_timer_broadcast(pr, cx, 1); | 954 | acpi_state_timer_broadcast(pr, cx, 1); |
957 | 955 | ||
956 | kt1 = ktime_get_real(); | ||
958 | /* | 957 | /* |
959 | * disable bus master | 958 | * disable bus master |
960 | * bm_check implies we need ARB_DIS | 959 | * bm_check implies we need ARB_DIS |
@@ -976,10 +975,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
976 | ACPI_FLUSH_CPU_CACHE(); | 975 | ACPI_FLUSH_CPU_CACHE(); |
977 | } | 976 | } |
978 | 977 | ||
979 | kt1 = ktime_get_real(); | ||
980 | acpi_idle_do_entry(cx); | 978 | acpi_idle_do_entry(cx); |
981 | kt2 = ktime_get_real(); | ||
982 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | ||
983 | 979 | ||
984 | /* Re-enable bus master arbitration */ | 980 | /* Re-enable bus master arbitration */ |
985 | if (pr->flags.bm_check && pr->flags.bm_control) { | 981 | if (pr->flags.bm_check && pr->flags.bm_control) { |
@@ -988,12 +984,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
988 | c3_cpu_count--; | 984 | c3_cpu_count--; |
989 | spin_unlock(&c3_lock); | 985 | spin_unlock(&c3_lock); |
990 | } | 986 | } |
987 | kt2 = ktime_get_real(); | ||
988 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | ||
991 | 989 | ||
992 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
993 | /* TSC could halt in idle, so notify users */ | ||
994 | if (tsc_halts_in_c(ACPI_STATE_C3)) | ||
995 | mark_tsc_unstable("TSC halts in idle"); | ||
996 | #endif | ||
997 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 990 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
998 | /* Tell the scheduler how much we idled: */ | 991 | /* Tell the scheduler how much we idled: */ |
999 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 992 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); |
@@ -1037,6 +1030,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1037 | dev->states[i].desc[0] = '\0'; | 1030 | dev->states[i].desc[0] = '\0'; |
1038 | } | 1031 | } |
1039 | 1032 | ||
1033 | if (max_cstate == 0) | ||
1034 | max_cstate = 1; | ||
1035 | |||
1040 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { | 1036 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
1041 | cx = &pr->power.states[i]; | 1037 | cx = &pr->power.states[i]; |
1042 | state = &dev->states[count]; | 1038 | state = &dev->states[count]; |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index d060e6fd7fd5..01574a066534 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -713,6 +713,32 @@ static void acpi_power_off(void) | |||
713 | acpi_enter_sleep_state(ACPI_STATE_S5); | 713 | acpi_enter_sleep_state(ACPI_STATE_S5); |
714 | } | 714 | } |
715 | 715 | ||
716 | /* | ||
717 | * ACPI 2.0 created the optional _GTS and _BFS, | ||
718 | * but industry adoption has been neither rapid nor broad. | ||
719 | * | ||
720 | * Linux gets into trouble when it executes poorly validated | ||
721 | * paths through the BIOS, so disable _GTS and _BFS by default, | ||
722 | * but do speak up and offer the option to enable them. | ||
723 | */ | ||
724 | void __init acpi_gts_bfs_check(void) | ||
725 | { | ||
726 | acpi_handle dummy; | ||
727 | |||
728 | if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_NAME__GTS, &dummy))) | ||
729 | { | ||
730 | printk(KERN_NOTICE PREFIX "BIOS offers _GTS\n"); | ||
731 | printk(KERN_NOTICE PREFIX "If \"acpi.gts=1\" improves suspend, " | ||
732 | "please notify linux-acpi@vger.kernel.org\n"); | ||
733 | } | ||
734 | if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_NAME__BFS, &dummy))) | ||
735 | { | ||
736 | printk(KERN_NOTICE PREFIX "BIOS offers _BFS\n"); | ||
737 | printk(KERN_NOTICE PREFIX "If \"acpi.bfs=1\" improves resume, " | ||
738 | "please notify linux-acpi@vger.kernel.org\n"); | ||
739 | } | ||
740 | } | ||
741 | |||
716 | int __init acpi_sleep_init(void) | 742 | int __init acpi_sleep_init(void) |
717 | { | 743 | { |
718 | acpi_status status; | 744 | acpi_status status; |
@@ -771,5 +797,6 @@ int __init acpi_sleep_init(void) | |||
771 | * object can also be evaluated when the system enters S5. | 797 | * object can also be evaluated when the system enters S5. |
772 | */ | 798 | */ |
773 | register_reboot_notifier(&tts_notifier); | 799 | register_reboot_notifier(&tts_notifier); |
800 | acpi_gts_bfs_check(); | ||
774 | return 0; | 801 | return 0; |
775 | } | 802 | } |
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index da51f05ef8d8..0944daec064f 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
@@ -38,6 +38,7 @@ ACPI_MODULE_NAME("system"); | |||
38 | #define ACPI_SYSTEM_DEVICE_NAME "System" | 38 | #define ACPI_SYSTEM_DEVICE_NAME "System" |
39 | 39 | ||
40 | u32 acpi_irq_handled; | 40 | u32 acpi_irq_handled; |
41 | u32 acpi_irq_not_handled; | ||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * Make ACPICA version work as module param | 44 | * Make ACPICA version work as module param |
@@ -214,8 +215,9 @@ err: | |||
214 | 215 | ||
215 | #define COUNT_GPE 0 | 216 | #define COUNT_GPE 0 |
216 | #define COUNT_SCI 1 /* acpi_irq_handled */ | 217 | #define COUNT_SCI 1 /* acpi_irq_handled */ |
217 | #define COUNT_ERROR 2 /* other */ | 218 | #define COUNT_SCI_NOT 2 /* acpi_irq_not_handled */ |
218 | #define NUM_COUNTERS_EXTRA 3 | 219 | #define COUNT_ERROR 3 /* other */ |
220 | #define NUM_COUNTERS_EXTRA 4 | ||
219 | 221 | ||
220 | struct event_counter { | 222 | struct event_counter { |
221 | u32 count; | 223 | u32 count; |
@@ -317,6 +319,8 @@ static ssize_t counter_show(struct kobject *kobj, | |||
317 | 319 | ||
318 | all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI].count = | 320 | all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI].count = |
319 | acpi_irq_handled; | 321 | acpi_irq_handled; |
322 | all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI_NOT].count = | ||
323 | acpi_irq_not_handled; | ||
320 | all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count = | 324 | all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count = |
321 | acpi_gpe_count; | 325 | acpi_gpe_count; |
322 | 326 | ||
@@ -363,6 +367,7 @@ static ssize_t counter_set(struct kobject *kobj, | |||
363 | all_counters[i].count = 0; | 367 | all_counters[i].count = 0; |
364 | acpi_gpe_count = 0; | 368 | acpi_gpe_count = 0; |
365 | acpi_irq_handled = 0; | 369 | acpi_irq_handled = 0; |
370 | acpi_irq_not_handled = 0; | ||
366 | goto end; | 371 | goto end; |
367 | } | 372 | } |
368 | 373 | ||
@@ -456,6 +461,8 @@ void acpi_irq_stats_init(void) | |||
456 | sprintf(buffer, "gpe_all"); | 461 | sprintf(buffer, "gpe_all"); |
457 | else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI) | 462 | else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI) |
458 | sprintf(buffer, "sci"); | 463 | sprintf(buffer, "sci"); |
464 | else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI_NOT) | ||
465 | sprintf(buffer, "sci_not"); | ||
459 | else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR) | 466 | else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR) |
460 | sprintf(buffer, "error"); | 467 | sprintf(buffer, "error"); |
461 | else | 468 | else |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 9cd15e8c8932..564ea1424288 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -909,7 +909,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
909 | thermal_zone_device_register("acpitz", trips, tz, | 909 | thermal_zone_device_register("acpitz", trips, tz, |
910 | &acpi_thermal_zone_ops, | 910 | &acpi_thermal_zone_ops, |
911 | 0, 0, 0, | 911 | 0, 0, 0, |
912 | tz->polling_frequency); | 912 | tz->polling_frequency*100); |
913 | if (IS_ERR(tz->thermal_zone)) | 913 | if (IS_ERR(tz->thermal_zone)) |
914 | return -ENODEV; | 914 | return -ENODEV; |
915 | 915 | ||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index cd4fb7543a90..1705d947ea09 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -770,10 +770,12 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
770 | * In this case, the first two elements in _BCL packages | 770 | * In this case, the first two elements in _BCL packages |
771 | * are also supported brightness levels that OS should take care of. | 771 | * are also supported brightness levels that OS should take care of. |
772 | */ | 772 | */ |
773 | for (i = 2; i < count; i++) | 773 | for (i = 2; i < count; i++) { |
774 | if (br->levels[i] == br->levels[0] || | 774 | if (br->levels[i] == br->levels[0]) |
775 | br->levels[i] == br->levels[1]) | ||
776 | level_ac_battery++; | 775 | level_ac_battery++; |
776 | if (br->levels[i] == br->levels[1]) | ||
777 | level_ac_battery++; | ||
778 | } | ||
777 | 779 | ||
778 | if (level_ac_battery < 2) { | 780 | if (level_ac_battery < 2) { |
779 | level_ac_battery = 2 - level_ac_battery; | 781 | level_ac_battery = 2 - level_ac_battery; |
@@ -807,12 +809,19 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
807 | br->flags._BCM_use_index = br->flags._BCL_use_index; | 809 | br->flags._BCM_use_index = br->flags._BCL_use_index; |
808 | 810 | ||
809 | /* _BQC uses INDEX while _BCL uses VALUE in some laptops */ | 811 | /* _BQC uses INDEX while _BCL uses VALUE in some laptops */ |
810 | br->curr = max_level; | 812 | br->curr = level_old = max_level; |
813 | |||
814 | if (!device->cap._BQC) | ||
815 | goto set_level; | ||
816 | |||
811 | result = acpi_video_device_lcd_get_level_current(device, &level_old); | 817 | result = acpi_video_device_lcd_get_level_current(device, &level_old); |
812 | if (result) | 818 | if (result) |
813 | goto out_free_levels; | 819 | goto out_free_levels; |
814 | 820 | ||
815 | result = acpi_video_device_lcd_set_level(device, br->curr); | 821 | /* |
822 | * Set the level to maximum and check if _BQC uses indexed value | ||
823 | */ | ||
824 | result = acpi_video_device_lcd_set_level(device, max_level); | ||
816 | if (result) | 825 | if (result) |
817 | goto out_free_levels; | 826 | goto out_free_levels; |
818 | 827 | ||
@@ -820,25 +829,19 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
820 | if (result) | 829 | if (result) |
821 | goto out_free_levels; | 830 | goto out_free_levels; |
822 | 831 | ||
823 | if ((level != level_old) && !br->flags._BCM_use_index) { | 832 | br->flags._BQC_use_index = (level == max_level ? 0 : 1); |
824 | /* Note: | 833 | |
825 | * This piece of code does not work correctly if the current | 834 | if (!br->flags._BQC_use_index) |
826 | * brightness levels is 0. | 835 | goto set_level; |
827 | * But I guess boxes that boot with such a dark screen are rare | 836 | |
828 | * and no more code is needed to cover this specifial case. | 837 | if (br->flags._BCL_reversed) |
829 | */ | 838 | level_old = (br->count - 1) - level_old; |
830 | 839 | level_old = br->levels[level_old]; | |
831 | if (level_ac_battery != 2) { | 840 | |
832 | /* | 841 | set_level: |
833 | * For now, we don't support the _BCL like this: | 842 | result = acpi_video_device_lcd_set_level(device, level_old); |
834 | * 16, 15, 0, 1, 2, 3, ..., 14, 15, 16 | 843 | if (result) |
835 | * because we may mess up the index returned by _BQC. | 844 | goto out_free_levels; |
836 | * Plus: we have not got a box like this. | ||
837 | */ | ||
838 | ACPI_ERROR((AE_INFO, "_BCL not supported\n")); | ||
839 | } | ||
840 | br->flags._BQC_use_index = 1; | ||
841 | } | ||
842 | 845 | ||
843 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 846 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
844 | "found %d brightness levels\n", count - 2)); | 847 | "found %d brightness levels\n", count - 2)); |
diff --git a/drivers/gpu/drm/i915/i915_opregion.c b/drivers/gpu/drm/i915/i915_opregion.c index 69427722d20e..8dc1fd3115c2 100644 --- a/drivers/gpu/drm/i915/i915_opregion.c +++ b/drivers/gpu/drm/i915/i915_opregion.c | |||
@@ -370,11 +370,8 @@ int intel_opregion_init(struct drm_device *dev, int resume) | |||
370 | if (mboxes & MBOX_ACPI) { | 370 | if (mboxes & MBOX_ACPI) { |
371 | DRM_DEBUG("Public ACPI methods supported\n"); | 371 | DRM_DEBUG("Public ACPI methods supported\n"); |
372 | opregion->acpi = base + OPREGION_ACPI_OFFSET; | 372 | opregion->acpi = base + OPREGION_ACPI_OFFSET; |
373 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 373 | if (drm_core_check_feature(dev, DRIVER_MODESET)) |
374 | intel_didl_outputs(dev); | 374 | intel_didl_outputs(dev); |
375 | if (!resume) | ||
376 | acpi_video_register(); | ||
377 | } | ||
378 | } else { | 375 | } else { |
379 | DRM_DEBUG("Public ACPI methods not supported\n"); | 376 | DRM_DEBUG("Public ACPI methods not supported\n"); |
380 | err = -ENOTSUPP; | 377 | err = -ENOTSUPP; |
@@ -391,6 +388,10 @@ int intel_opregion_init(struct drm_device *dev, int resume) | |||
391 | opregion->asle = base + OPREGION_ASLE_OFFSET; | 388 | opregion->asle = base + OPREGION_ASLE_OFFSET; |
392 | } | 389 | } |
393 | 390 | ||
391 | if (!resume) | ||
392 | acpi_video_register(); | ||
393 | |||
394 | |||
394 | /* Notify BIOS we are ready to handle ACPI video ext notifs. | 395 | /* Notify BIOS we are ready to handle ACPI video ext notifs. |
395 | * Right now, all the events are handled by the ACPI video module. | 396 | * Right now, all the events are handled by the ACPI video module. |
396 | * We don't actually need to do anything with them. */ | 397 | * We don't actually need to do anything with them. */ |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index d3c92d777bde..552958545f94 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -317,7 +317,8 @@ static void sony_laptop_report_input_event(u8 event) | |||
317 | struct input_dev *key_dev = sony_laptop_input.key_dev; | 317 | struct input_dev *key_dev = sony_laptop_input.key_dev; |
318 | struct sony_laptop_keypress kp = { NULL }; | 318 | struct sony_laptop_keypress kp = { NULL }; |
319 | 319 | ||
320 | if (event == SONYPI_EVENT_FNKEY_RELEASED) { | 320 | if (event == SONYPI_EVENT_FNKEY_RELEASED || |
321 | event == SONYPI_EVENT_ANYBUTTON_RELEASED) { | ||
321 | /* Nothing, not all VAIOs generate this event */ | 322 | /* Nothing, not all VAIOs generate this event */ |
322 | return; | 323 | return; |
323 | } | 324 | } |
@@ -905,7 +906,6 @@ static struct sony_nc_event sony_127_events[] = { | |||
905 | { 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED }, | 906 | { 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED }, |
906 | { 0x86, SONYPI_EVENT_PKEY_P5 }, | 907 | { 0x86, SONYPI_EVENT_PKEY_P5 }, |
907 | { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED }, | 908 | { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED }, |
908 | { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED }, | ||
909 | { 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED }, | 909 | { 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED }, |
910 | { 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED }, | 910 | { 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED }, |
911 | { 0, 0 }, | 911 | { 0, 0 }, |
@@ -1004,6 +1004,7 @@ static int sony_nc_function_setup(struct acpi_device *device) | |||
1004 | sony_call_snc_handle(0x0100, 0, &result); | 1004 | sony_call_snc_handle(0x0100, 0, &result); |
1005 | sony_call_snc_handle(0x0101, 0, &result); | 1005 | sony_call_snc_handle(0x0101, 0, &result); |
1006 | sony_call_snc_handle(0x0102, 0x100, &result); | 1006 | sony_call_snc_handle(0x0102, 0x100, &result); |
1007 | sony_call_snc_handle(0x0127, 0, &result); | ||
1007 | 1008 | ||
1008 | return 0; | 1009 | return 0; |
1009 | } | 1010 | } |
@@ -1040,7 +1041,7 @@ static int sony_nc_resume(struct acpi_device *device) | |||
1040 | 1041 | ||
1041 | /* set the last requested brightness level */ | 1042 | /* set the last requested brightness level */ |
1042 | if (sony_backlight_device && | 1043 | if (sony_backlight_device && |
1043 | !sony_backlight_update_status(sony_backlight_device)) | 1044 | sony_backlight_update_status(sony_backlight_device) < 0) |
1044 | printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n"); | 1045 | printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n"); |
1045 | 1046 | ||
1046 | return 0; | 1047 | return 0; |
@@ -1102,8 +1103,11 @@ static int sony_nc_setup_wifi_rfkill(struct acpi_device *device) | |||
1102 | err = rfkill_register(sony_wifi_rfkill); | 1103 | err = rfkill_register(sony_wifi_rfkill); |
1103 | if (err) | 1104 | if (err) |
1104 | rfkill_free(sony_wifi_rfkill); | 1105 | rfkill_free(sony_wifi_rfkill); |
1105 | else | 1106 | else { |
1106 | sony_rfkill_devices[SONY_WIFI] = sony_wifi_rfkill; | 1107 | sony_rfkill_devices[SONY_WIFI] = sony_wifi_rfkill; |
1108 | sony_nc_rfkill_set(sony_wifi_rfkill->data, | ||
1109 | RFKILL_STATE_UNBLOCKED); | ||
1110 | } | ||
1107 | return err; | 1111 | return err; |
1108 | } | 1112 | } |
1109 | 1113 | ||
@@ -1124,8 +1128,11 @@ static int sony_nc_setup_bluetooth_rfkill(struct acpi_device *device) | |||
1124 | err = rfkill_register(sony_bluetooth_rfkill); | 1128 | err = rfkill_register(sony_bluetooth_rfkill); |
1125 | if (err) | 1129 | if (err) |
1126 | rfkill_free(sony_bluetooth_rfkill); | 1130 | rfkill_free(sony_bluetooth_rfkill); |
1127 | else | 1131 | else { |
1128 | sony_rfkill_devices[SONY_BLUETOOTH] = sony_bluetooth_rfkill; | 1132 | sony_rfkill_devices[SONY_BLUETOOTH] = sony_bluetooth_rfkill; |
1133 | sony_nc_rfkill_set(sony_bluetooth_rfkill->data, | ||
1134 | RFKILL_STATE_UNBLOCKED); | ||
1135 | } | ||
1129 | return err; | 1136 | return err; |
1130 | } | 1137 | } |
1131 | 1138 | ||
@@ -1145,8 +1152,11 @@ static int sony_nc_setup_wwan_rfkill(struct acpi_device *device) | |||
1145 | err = rfkill_register(sony_wwan_rfkill); | 1152 | err = rfkill_register(sony_wwan_rfkill); |
1146 | if (err) | 1153 | if (err) |
1147 | rfkill_free(sony_wwan_rfkill); | 1154 | rfkill_free(sony_wwan_rfkill); |
1148 | else | 1155 | else { |
1149 | sony_rfkill_devices[SONY_WWAN] = sony_wwan_rfkill; | 1156 | sony_rfkill_devices[SONY_WWAN] = sony_wwan_rfkill; |
1157 | sony_nc_rfkill_set(sony_wwan_rfkill->data, | ||
1158 | RFKILL_STATE_UNBLOCKED); | ||
1159 | } | ||
1150 | return err; | 1160 | return err; |
1151 | } | 1161 | } |
1152 | 1162 | ||
@@ -1166,8 +1176,11 @@ static int sony_nc_setup_wimax_rfkill(struct acpi_device *device) | |||
1166 | err = rfkill_register(sony_wimax_rfkill); | 1176 | err = rfkill_register(sony_wimax_rfkill); |
1167 | if (err) | 1177 | if (err) |
1168 | rfkill_free(sony_wimax_rfkill); | 1178 | rfkill_free(sony_wimax_rfkill); |
1169 | else | 1179 | else { |
1170 | sony_rfkill_devices[SONY_WIMAX] = sony_wimax_rfkill; | 1180 | sony_rfkill_devices[SONY_WIMAX] = sony_wimax_rfkill; |
1181 | sony_nc_rfkill_set(sony_wimax_rfkill->data, | ||
1182 | RFKILL_STATE_UNBLOCKED); | ||
1183 | } | ||
1171 | return err; | 1184 | return err; |
1172 | } | 1185 | } |
1173 | 1186 | ||
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a40b075743d9..912be65b6261 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -21,7 +21,7 @@ | |||
21 | * 02110-1301, USA. | 21 | * 02110-1301, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define TPACPI_VERSION "0.22" | 24 | #define TPACPI_VERSION "0.23" |
25 | #define TPACPI_SYSFS_VERSION 0x020300 | 25 | #define TPACPI_SYSFS_VERSION 0x020300 |
26 | 26 | ||
27 | /* | 27 | /* |
@@ -303,11 +303,17 @@ static u32 dbg_level; | |||
303 | 303 | ||
304 | static struct workqueue_struct *tpacpi_wq; | 304 | static struct workqueue_struct *tpacpi_wq; |
305 | 305 | ||
306 | enum led_status_t { | ||
307 | TPACPI_LED_OFF = 0, | ||
308 | TPACPI_LED_ON, | ||
309 | TPACPI_LED_BLINK, | ||
310 | }; | ||
311 | |||
306 | /* Special LED class that can defer work */ | 312 | /* Special LED class that can defer work */ |
307 | struct tpacpi_led_classdev { | 313 | struct tpacpi_led_classdev { |
308 | struct led_classdev led_classdev; | 314 | struct led_classdev led_classdev; |
309 | struct work_struct work; | 315 | struct work_struct work; |
310 | enum led_brightness new_brightness; | 316 | enum led_status_t new_state; |
311 | unsigned int led; | 317 | unsigned int led; |
312 | }; | 318 | }; |
313 | 319 | ||
@@ -2946,12 +2952,18 @@ static int hotkey_read(char *p) | |||
2946 | return len; | 2952 | return len; |
2947 | } | 2953 | } |
2948 | 2954 | ||
2949 | static void hotkey_enabledisable_warn(void) | 2955 | static void hotkey_enabledisable_warn(bool enable) |
2950 | { | 2956 | { |
2951 | tpacpi_log_usertask("procfs hotkey enable/disable"); | 2957 | tpacpi_log_usertask("procfs hotkey enable/disable"); |
2952 | WARN(1, TPACPI_WARN | 2958 | if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable), |
2953 | "hotkey enable/disable functionality has been " | 2959 | TPACPI_WARN |
2954 | "removed from the driver. Hotkeys are always enabled.\n"); | 2960 | "hotkey enable/disable functionality has been " |
2961 | "removed from the driver. Hotkeys are always " | ||
2962 | "enabled\n")) | ||
2963 | printk(TPACPI_ERR | ||
2964 | "Please remove the hotkey=enable module " | ||
2965 | "parameter, it is deprecated. Hotkeys are always " | ||
2966 | "enabled\n"); | ||
2955 | } | 2967 | } |
2956 | 2968 | ||
2957 | static int hotkey_write(char *buf) | 2969 | static int hotkey_write(char *buf) |
@@ -2971,9 +2983,9 @@ static int hotkey_write(char *buf) | |||
2971 | res = 0; | 2983 | res = 0; |
2972 | while ((cmd = next_cmd(&buf))) { | 2984 | while ((cmd = next_cmd(&buf))) { |
2973 | if (strlencmp(cmd, "enable") == 0) { | 2985 | if (strlencmp(cmd, "enable") == 0) { |
2974 | hotkey_enabledisable_warn(); | 2986 | hotkey_enabledisable_warn(1); |
2975 | } else if (strlencmp(cmd, "disable") == 0) { | 2987 | } else if (strlencmp(cmd, "disable") == 0) { |
2976 | hotkey_enabledisable_warn(); | 2988 | hotkey_enabledisable_warn(0); |
2977 | res = -EPERM; | 2989 | res = -EPERM; |
2978 | } else if (strlencmp(cmd, "reset") == 0) { | 2990 | } else if (strlencmp(cmd, "reset") == 0) { |
2979 | mask = hotkey_orig_mask; | 2991 | mask = hotkey_orig_mask; |
@@ -4207,7 +4219,7 @@ static void light_set_status_worker(struct work_struct *work) | |||
4207 | container_of(work, struct tpacpi_led_classdev, work); | 4219 | container_of(work, struct tpacpi_led_classdev, work); |
4208 | 4220 | ||
4209 | if (likely(tpacpi_lifecycle == TPACPI_LIFE_RUNNING)) | 4221 | if (likely(tpacpi_lifecycle == TPACPI_LIFE_RUNNING)) |
4210 | light_set_status((data->new_brightness != LED_OFF)); | 4222 | light_set_status((data->new_state != TPACPI_LED_OFF)); |
4211 | } | 4223 | } |
4212 | 4224 | ||
4213 | static void light_sysfs_set(struct led_classdev *led_cdev, | 4225 | static void light_sysfs_set(struct led_classdev *led_cdev, |
@@ -4217,7 +4229,8 @@ static void light_sysfs_set(struct led_classdev *led_cdev, | |||
4217 | container_of(led_cdev, | 4229 | container_of(led_cdev, |
4218 | struct tpacpi_led_classdev, | 4230 | struct tpacpi_led_classdev, |
4219 | led_classdev); | 4231 | led_classdev); |
4220 | data->new_brightness = brightness; | 4232 | data->new_state = (brightness != LED_OFF) ? |
4233 | TPACPI_LED_ON : TPACPI_LED_OFF; | ||
4221 | queue_work(tpacpi_wq, &data->work); | 4234 | queue_work(tpacpi_wq, &data->work); |
4222 | } | 4235 | } |
4223 | 4236 | ||
@@ -4724,12 +4737,6 @@ enum { /* For TPACPI_LED_OLD */ | |||
4724 | TPACPI_LED_EC_HLMS = 0x0e, /* EC reg to select led to command */ | 4737 | TPACPI_LED_EC_HLMS = 0x0e, /* EC reg to select led to command */ |
4725 | }; | 4738 | }; |
4726 | 4739 | ||
4727 | enum led_status_t { | ||
4728 | TPACPI_LED_OFF = 0, | ||
4729 | TPACPI_LED_ON, | ||
4730 | TPACPI_LED_BLINK, | ||
4731 | }; | ||
4732 | |||
4733 | static enum led_access_mode led_supported; | 4740 | static enum led_access_mode led_supported; |
4734 | 4741 | ||
4735 | TPACPI_HANDLE(led, ec, "SLED", /* 570 */ | 4742 | TPACPI_HANDLE(led, ec, "SLED", /* 570 */ |
@@ -4841,23 +4848,13 @@ static int led_set_status(const unsigned int led, | |||
4841 | return rc; | 4848 | return rc; |
4842 | } | 4849 | } |
4843 | 4850 | ||
4844 | static void led_sysfs_set_status(unsigned int led, | ||
4845 | enum led_brightness brightness) | ||
4846 | { | ||
4847 | led_set_status(led, | ||
4848 | (brightness == LED_OFF) ? | ||
4849 | TPACPI_LED_OFF : | ||
4850 | (tpacpi_led_state_cache[led] == TPACPI_LED_BLINK) ? | ||
4851 | TPACPI_LED_BLINK : TPACPI_LED_ON); | ||
4852 | } | ||
4853 | |||
4854 | static void led_set_status_worker(struct work_struct *work) | 4851 | static void led_set_status_worker(struct work_struct *work) |
4855 | { | 4852 | { |
4856 | struct tpacpi_led_classdev *data = | 4853 | struct tpacpi_led_classdev *data = |
4857 | container_of(work, struct tpacpi_led_classdev, work); | 4854 | container_of(work, struct tpacpi_led_classdev, work); |
4858 | 4855 | ||
4859 | if (likely(tpacpi_lifecycle == TPACPI_LIFE_RUNNING)) | 4856 | if (likely(tpacpi_lifecycle == TPACPI_LIFE_RUNNING)) |
4860 | led_sysfs_set_status(data->led, data->new_brightness); | 4857 | led_set_status(data->led, data->new_state); |
4861 | } | 4858 | } |
4862 | 4859 | ||
4863 | static void led_sysfs_set(struct led_classdev *led_cdev, | 4860 | static void led_sysfs_set(struct led_classdev *led_cdev, |
@@ -4866,7 +4863,13 @@ static void led_sysfs_set(struct led_classdev *led_cdev, | |||
4866 | struct tpacpi_led_classdev *data = container_of(led_cdev, | 4863 | struct tpacpi_led_classdev *data = container_of(led_cdev, |
4867 | struct tpacpi_led_classdev, led_classdev); | 4864 | struct tpacpi_led_classdev, led_classdev); |
4868 | 4865 | ||
4869 | data->new_brightness = brightness; | 4866 | if (brightness == LED_OFF) |
4867 | data->new_state = TPACPI_LED_OFF; | ||
4868 | else if (tpacpi_led_state_cache[data->led] != TPACPI_LED_BLINK) | ||
4869 | data->new_state = TPACPI_LED_ON; | ||
4870 | else | ||
4871 | data->new_state = TPACPI_LED_BLINK; | ||
4872 | |||
4870 | queue_work(tpacpi_wq, &data->work); | 4873 | queue_work(tpacpi_wq, &data->work); |
4871 | } | 4874 | } |
4872 | 4875 | ||
@@ -4884,7 +4887,7 @@ static int led_sysfs_blink_set(struct led_classdev *led_cdev, | |||
4884 | } else if ((*delay_on != 500) || (*delay_off != 500)) | 4887 | } else if ((*delay_on != 500) || (*delay_off != 500)) |
4885 | return -EINVAL; | 4888 | return -EINVAL; |
4886 | 4889 | ||
4887 | data->new_brightness = TPACPI_LED_BLINK; | 4890 | data->new_state = TPACPI_LED_BLINK; |
4888 | queue_work(tpacpi_wq, &data->work); | 4891 | queue_work(tpacpi_wq, &data->work); |
4889 | 4892 | ||
4890 | return 0; | 4893 | return 0; |
@@ -7858,6 +7861,15 @@ static int __init thinkpad_acpi_module_init(void) | |||
7858 | MODULE_ALIAS(TPACPI_DRVR_SHORTNAME); | 7861 | MODULE_ALIAS(TPACPI_DRVR_SHORTNAME); |
7859 | 7862 | ||
7860 | /* | 7863 | /* |
7864 | * This will autoload the driver in almost every ThinkPad | ||
7865 | * in widespread use. | ||
7866 | * | ||
7867 | * Only _VERY_ old models, like the 240, 240x and 570 lack | ||
7868 | * the HKEY event interface. | ||
7869 | */ | ||
7870 | MODULE_DEVICE_TABLE(acpi, ibm_htk_device_ids); | ||
7871 | |||
7872 | /* | ||
7861 | * DMI matching for module autoloading | 7873 | * DMI matching for module autoloading |
7862 | * | 7874 | * |
7863 | * See http://thinkwiki.org/wiki/List_of_DMI_IDs | 7875 | * See http://thinkwiki.org/wiki/List_of_DMI_IDs |
@@ -7869,18 +7881,13 @@ MODULE_ALIAS(TPACPI_DRVR_SHORTNAME); | |||
7869 | #define IBM_BIOS_MODULE_ALIAS(__type) \ | 7881 | #define IBM_BIOS_MODULE_ALIAS(__type) \ |
7870 | MODULE_ALIAS("dmi:bvnIBM:bvr" __type "ET??WW*") | 7882 | MODULE_ALIAS("dmi:bvnIBM:bvr" __type "ET??WW*") |
7871 | 7883 | ||
7872 | /* Non-ancient thinkpads */ | ||
7873 | MODULE_ALIAS("dmi:bvnIBM:*:svnIBM:*:pvrThinkPad*:rvnIBM:*"); | ||
7874 | MODULE_ALIAS("dmi:bvnLENOVO:*:svnLENOVO:*:pvrThinkPad*:rvnLENOVO:*"); | ||
7875 | |||
7876 | /* Ancient thinkpad BIOSes have to be identified by | 7884 | /* Ancient thinkpad BIOSes have to be identified by |
7877 | * BIOS type or model number, and there are far less | 7885 | * BIOS type or model number, and there are far less |
7878 | * BIOS types than model numbers... */ | 7886 | * BIOS types than model numbers... */ |
7879 | IBM_BIOS_MODULE_ALIAS("I[BDHIMNOTWVYZ]"); | 7887 | IBM_BIOS_MODULE_ALIAS("I[MU]"); /* 570, 570e */ |
7880 | IBM_BIOS_MODULE_ALIAS("1[0368A-GIKM-PST]"); | ||
7881 | IBM_BIOS_MODULE_ALIAS("K[UX-Z]"); | ||
7882 | 7888 | ||
7883 | MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh"); | 7889 | MODULE_AUTHOR("Borislav Deianov <borislav@users.sf.net>"); |
7890 | MODULE_AUTHOR("Henrique de Moraes Holschuh <hmh@hmh.eng.br>"); | ||
7884 | MODULE_DESCRIPTION(TPACPI_DESC); | 7891 | MODULE_DESCRIPTION(TPACPI_DESC); |
7885 | MODULE_VERSION(TPACPI_VERSION); | 7892 | MODULE_VERSION(TPACPI_VERSION); |
7886 | MODULE_LICENSE("GPL"); | 7893 | MODULE_LICENSE("GPL"); |