diff options
Diffstat (limited to 'drivers/acpi')
42 files changed, 314 insertions, 285 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 4f5bfb1e629a..e942ffe8b57e 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -13,6 +13,7 @@ config ACPI | |||
13 | depends on IA64 || X86 | 13 | depends on IA64 || X86 |
14 | depends on PCI | 14 | depends on PCI |
15 | depends on PM | 15 | depends on PM |
16 | select PNP | ||
16 | default y | 17 | default y |
17 | ---help--- | 18 | ---help--- |
18 | Advanced Configuration and Power Interface (ACPI) support for | 19 | Advanced Configuration and Power Interface (ACPI) support for |
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 6daeace796a8..37c7dc4f9fe5 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #define ACPI_AC_COMPONENT 0x00020000 | 35 | #define ACPI_AC_COMPONENT 0x00020000 |
36 | #define ACPI_AC_CLASS "ac_adapter" | 36 | #define ACPI_AC_CLASS "ac_adapter" |
37 | #define ACPI_AC_HID "ACPI0003" | 37 | #define ACPI_AC_HID "ACPI0003" |
38 | #define ACPI_AC_DRIVER_NAME "ACPI AC Adapter Driver" | ||
39 | #define ACPI_AC_DEVICE_NAME "AC Adapter" | 38 | #define ACPI_AC_DEVICE_NAME "AC Adapter" |
40 | #define ACPI_AC_FILE_STATE "state" | 39 | #define ACPI_AC_FILE_STATE "state" |
41 | #define ACPI_AC_NOTIFY_STATUS 0x80 | 40 | #define ACPI_AC_NOTIFY_STATUS 0x80 |
@@ -44,10 +43,10 @@ | |||
44 | #define ACPI_AC_STATUS_UNKNOWN 0xFF | 43 | #define ACPI_AC_STATUS_UNKNOWN 0xFF |
45 | 44 | ||
46 | #define _COMPONENT ACPI_AC_COMPONENT | 45 | #define _COMPONENT ACPI_AC_COMPONENT |
47 | ACPI_MODULE_NAME("acpi_ac") | 46 | ACPI_MODULE_NAME("ac"); |
48 | 47 | ||
49 | MODULE_AUTHOR("Paul Diefenbaugh"); | 48 | MODULE_AUTHOR("Paul Diefenbaugh"); |
50 | MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME); | 49 | MODULE_DESCRIPTION("ACPI AC Adapter Driver"); |
51 | MODULE_LICENSE("GPL"); | 50 | MODULE_LICENSE("GPL"); |
52 | 51 | ||
53 | extern struct proc_dir_entry *acpi_lock_ac_dir(void); | 52 | extern struct proc_dir_entry *acpi_lock_ac_dir(void); |
@@ -58,7 +57,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type); | |||
58 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); | 57 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); |
59 | 58 | ||
60 | static struct acpi_driver acpi_ac_driver = { | 59 | static struct acpi_driver acpi_ac_driver = { |
61 | .name = ACPI_AC_DRIVER_NAME, | 60 | .name = "ac", |
62 | .class = ACPI_AC_CLASS, | 61 | .class = ACPI_AC_CLASS, |
63 | .ids = ACPI_AC_HID, | 62 | .ids = ACPI_AC_HID, |
64 | .ops = { | 63 | .ops = { |
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index cd946ed192d3..c26172671fd8 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -35,14 +35,13 @@ | |||
35 | #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000UL | 35 | #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000UL |
36 | #define ACPI_MEMORY_DEVICE_CLASS "memory" | 36 | #define ACPI_MEMORY_DEVICE_CLASS "memory" |
37 | #define ACPI_MEMORY_DEVICE_HID "PNP0C80" | 37 | #define ACPI_MEMORY_DEVICE_HID "PNP0C80" |
38 | #define ACPI_MEMORY_DEVICE_DRIVER_NAME "Hotplug Mem Driver" | ||
39 | #define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" | 38 | #define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" |
40 | 39 | ||
41 | #define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT | 40 | #define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT |
42 | 41 | ||
43 | ACPI_MODULE_NAME("acpi_memory") | 42 | ACPI_MODULE_NAME("acpi_memhotplug"); |
44 | MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>"); | 43 | MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>"); |
45 | MODULE_DESCRIPTION(ACPI_MEMORY_DEVICE_DRIVER_NAME); | 44 | MODULE_DESCRIPTION("Hotplug Mem Driver"); |
46 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
47 | 46 | ||
48 | /* ACPI _STA method values */ | 47 | /* ACPI _STA method values */ |
@@ -60,7 +59,7 @@ static int acpi_memory_device_remove(struct acpi_device *device, int type); | |||
60 | static int acpi_memory_device_start(struct acpi_device *device); | 59 | static int acpi_memory_device_start(struct acpi_device *device); |
61 | 60 | ||
62 | static struct acpi_driver acpi_memory_device_driver = { | 61 | static struct acpi_driver acpi_memory_device_driver = { |
63 | .name = ACPI_MEMORY_DEVICE_DRIVER_NAME, | 62 | .name = "acpi_memhotplug", |
64 | .class = ACPI_MEMORY_DEVICE_CLASS, | 63 | .class = ACPI_MEMORY_DEVICE_CLASS, |
65 | .ids = ACPI_MEMORY_DEVICE_HID, | 64 | .ids = ACPI_MEMORY_DEVICE_HID, |
66 | .ops = { | 65 | .ops = { |
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index ab8c5cb8384d..772299fb5f9d 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -141,6 +141,7 @@ struct asus_hotk { | |||
141 | W5A, //W5A | 141 | W5A, //W5A |
142 | W3V, //W3030V | 142 | W3V, //W3030V |
143 | xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N | 143 | xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N |
144 | A4S, //Z81sp | ||
144 | //(Centrino) | 145 | //(Centrino) |
145 | END_MODEL | 146 | END_MODEL |
146 | } model; //Models currently supported | 147 | } model; //Models currently supported |
@@ -397,7 +398,16 @@ static struct model_data model_conf[END_MODEL] = { | |||
397 | .brightness_set = "SPLV", | 398 | .brightness_set = "SPLV", |
398 | .brightness_get = "GPLV", | 399 | .brightness_get = "GPLV", |
399 | .display_set = "SDSP", | 400 | .display_set = "SDSP", |
400 | .display_get = "\\ADVG"} | 401 | .display_get = "\\ADVG"}, |
402 | |||
403 | { | ||
404 | .name = "A4S", | ||
405 | .brightness_set = "SPLV", | ||
406 | .brightness_get = "GPLV", | ||
407 | .mt_bt_switch = "BLED", | ||
408 | .mt_wled = "WLED" | ||
409 | } | ||
410 | |||
401 | }; | 411 | }; |
402 | 412 | ||
403 | /* procdir we use */ | 413 | /* procdir we use */ |
@@ -421,7 +431,7 @@ static struct asus_hotk *hotk; | |||
421 | static int asus_hotk_add(struct acpi_device *device); | 431 | static int asus_hotk_add(struct acpi_device *device); |
422 | static int asus_hotk_remove(struct acpi_device *device, int type); | 432 | static int asus_hotk_remove(struct acpi_device *device, int type); |
423 | static struct acpi_driver asus_hotk_driver = { | 433 | static struct acpi_driver asus_hotk_driver = { |
424 | .name = ACPI_HOTK_NAME, | 434 | .name = "asus_acpi", |
425 | .class = ACPI_HOTK_CLASS, | 435 | .class = ACPI_HOTK_CLASS, |
426 | .ids = ACPI_HOTK_HID, | 436 | .ids = ACPI_HOTK_HID, |
427 | .ops = { | 437 | .ops = { |
@@ -1117,6 +1127,8 @@ static int asus_model_match(char *model) | |||
1117 | return W3V; | 1127 | return W3V; |
1118 | else if (strncmp(model, "W5A", 3) == 0) | 1128 | else if (strncmp(model, "W5A", 3) == 0) |
1119 | return W5A; | 1129 | return W5A; |
1130 | else if (strncmp(model, "A4S", 3) == 0) | ||
1131 | return A4S; | ||
1120 | else | 1132 | else |
1121 | return END_MODEL; | 1133 | return END_MODEL; |
1122 | } | 1134 | } |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 2f4521a48fe7..02de49ef1bce 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #define ACPI_BATTERY_COMPONENT 0x00040000 | 42 | #define ACPI_BATTERY_COMPONENT 0x00040000 |
43 | #define ACPI_BATTERY_CLASS "battery" | 43 | #define ACPI_BATTERY_CLASS "battery" |
44 | #define ACPI_BATTERY_HID "PNP0C0A" | 44 | #define ACPI_BATTERY_HID "PNP0C0A" |
45 | #define ACPI_BATTERY_DRIVER_NAME "ACPI Battery Driver" | ||
46 | #define ACPI_BATTERY_DEVICE_NAME "Battery" | 45 | #define ACPI_BATTERY_DEVICE_NAME "Battery" |
47 | #define ACPI_BATTERY_FILE_INFO "info" | 46 | #define ACPI_BATTERY_FILE_INFO "info" |
48 | #define ACPI_BATTERY_FILE_STATUS "state" | 47 | #define ACPI_BATTERY_FILE_STATUS "state" |
@@ -53,10 +52,10 @@ | |||
53 | #define ACPI_BATTERY_UNITS_AMPS "mA" | 52 | #define ACPI_BATTERY_UNITS_AMPS "mA" |
54 | 53 | ||
55 | #define _COMPONENT ACPI_BATTERY_COMPONENT | 54 | #define _COMPONENT ACPI_BATTERY_COMPONENT |
56 | ACPI_MODULE_NAME("acpi_battery") | 55 | ACPI_MODULE_NAME("battery"); |
57 | 56 | ||
58 | MODULE_AUTHOR("Paul Diefenbaugh"); | 57 | MODULE_AUTHOR("Paul Diefenbaugh"); |
59 | MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME); | 58 | MODULE_DESCRIPTION("ACPI Battery Driver"); |
60 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
61 | 60 | ||
62 | extern struct proc_dir_entry *acpi_lock_battery_dir(void); | 61 | extern struct proc_dir_entry *acpi_lock_battery_dir(void); |
@@ -67,7 +66,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type); | |||
67 | static int acpi_battery_resume(struct acpi_device *device); | 66 | static int acpi_battery_resume(struct acpi_device *device); |
68 | 67 | ||
69 | static struct acpi_driver acpi_battery_driver = { | 68 | static struct acpi_driver acpi_battery_driver = { |
70 | .name = ACPI_BATTERY_DRIVER_NAME, | 69 | .name = "battery", |
71 | .class = ACPI_BATTERY_CLASS, | 70 | .class = ACPI_BATTERY_CLASS, |
72 | .ids = ACPI_BATTERY_HID, | 71 | .ids = ACPI_BATTERY_HID, |
73 | .ops = { | 72 | .ops = { |
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index 91082ce6f5d1..fb3f31b5e69f 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c | |||
@@ -32,11 +32,9 @@ | |||
32 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
33 | #include <linux/platform_device.h> | 33 | #include <linux/platform_device.h> |
34 | 34 | ||
35 | #define ACPI_BAY_DRIVER_NAME "ACPI Removable Drive Bay Driver" | 35 | ACPI_MODULE_NAME("bay"); |
36 | |||
37 | ACPI_MODULE_NAME("bay") | ||
38 | MODULE_AUTHOR("Kristen Carlson Accardi"); | 36 | MODULE_AUTHOR("Kristen Carlson Accardi"); |
39 | MODULE_DESCRIPTION(ACPI_BAY_DRIVER_NAME); | 37 | MODULE_DESCRIPTION("ACPI Removable Drive Bay Driver"); |
40 | MODULE_LICENSE("GPL"); | 38 | MODULE_LICENSE("GPL"); |
41 | #define ACPI_BAY_CLASS "bay" | 39 | #define ACPI_BAY_CLASS "bay" |
42 | #define ACPI_BAY_COMPONENT 0x10000000 | 40 | #define ACPI_BAY_COMPONENT 0x10000000 |
@@ -47,18 +45,6 @@ MODULE_LICENSE("GPL"); | |||
47 | acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\ | 45 | acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\ |
48 | printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); } | 46 | printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); } |
49 | static void bay_notify(acpi_handle handle, u32 event, void *data); | 47 | static void bay_notify(acpi_handle handle, u32 event, void *data); |
50 | static int acpi_bay_add(struct acpi_device *device); | ||
51 | static int acpi_bay_remove(struct acpi_device *device, int type); | ||
52 | |||
53 | static struct acpi_driver acpi_bay_driver = { | ||
54 | .name = ACPI_BAY_DRIVER_NAME, | ||
55 | .class = ACPI_BAY_CLASS, | ||
56 | .ids = ACPI_BAY_HID, | ||
57 | .ops = { | ||
58 | .add = acpi_bay_add, | ||
59 | .remove = acpi_bay_remove, | ||
60 | }, | ||
61 | }; | ||
62 | 48 | ||
63 | struct bay { | 49 | struct bay { |
64 | acpi_handle handle; | 50 | acpi_handle handle; |
@@ -234,14 +220,6 @@ int eject_removable_drive(struct device *dev) | |||
234 | } | 220 | } |
235 | EXPORT_SYMBOL_GPL(eject_removable_drive); | 221 | EXPORT_SYMBOL_GPL(eject_removable_drive); |
236 | 222 | ||
237 | static int acpi_bay_add(struct acpi_device *device) | ||
238 | { | ||
239 | bay_dprintk(device->handle, "adding bay device"); | ||
240 | strcpy(acpi_device_name(device), "Dockable Bay"); | ||
241 | strcpy(acpi_device_class(device), "bay"); | ||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | static int acpi_bay_add_fs(struct bay *bay) | 223 | static int acpi_bay_add_fs(struct bay *bay) |
246 | { | 224 | { |
247 | int ret; | 225 | int ret; |
@@ -303,7 +281,7 @@ static int bay_add(acpi_handle handle, int id) | |||
303 | 281 | ||
304 | /* initialize platform device stuff */ | 282 | /* initialize platform device stuff */ |
305 | pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0); | 283 | pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0); |
306 | if (pdev == NULL) { | 284 | if (IS_ERR(pdev)) { |
307 | printk(KERN_ERR PREFIX "Error registering bay device\n"); | 285 | printk(KERN_ERR PREFIX "Error registering bay device\n"); |
308 | goto bay_add_err; | 286 | goto bay_add_err; |
309 | } | 287 | } |
@@ -339,52 +317,6 @@ bay_add_err: | |||
339 | return -ENODEV; | 317 | return -ENODEV; |
340 | } | 318 | } |
341 | 319 | ||
342 | static int acpi_bay_remove(struct acpi_device *device, int type) | ||
343 | { | ||
344 | /*** FIXME: do something here */ | ||
345 | return 0; | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * bay_create_acpi_device - add new devices to acpi | ||
350 | * @handle - handle of the device to add | ||
351 | * | ||
352 | * This function will create a new acpi_device for the given | ||
353 | * handle if one does not exist already. This should cause | ||
354 | * acpi to scan for drivers for the given devices, and call | ||
355 | * matching driver's add routine. | ||
356 | * | ||
357 | * Returns a pointer to the acpi_device corresponding to the handle. | ||
358 | */ | ||
359 | static struct acpi_device * bay_create_acpi_device(acpi_handle handle) | ||
360 | { | ||
361 | struct acpi_device *device = NULL; | ||
362 | struct acpi_device *parent_device; | ||
363 | acpi_handle parent; | ||
364 | int ret; | ||
365 | |||
366 | bay_dprintk(handle, "Trying to get device"); | ||
367 | if (acpi_bus_get_device(handle, &device)) { | ||
368 | /* | ||
369 | * no device created for this object, | ||
370 | * so we should create one. | ||
371 | */ | ||
372 | bay_dprintk(handle, "No device for handle"); | ||
373 | acpi_get_parent(handle, &parent); | ||
374 | if (acpi_bus_get_device(parent, &parent_device)) | ||
375 | parent_device = NULL; | ||
376 | |||
377 | ret = acpi_bus_add(&device, parent_device, handle, | ||
378 | ACPI_BUS_TYPE_DEVICE); | ||
379 | if (ret) { | ||
380 | pr_debug("error adding bus, %x\n", | ||
381 | -ret); | ||
382 | return NULL; | ||
383 | } | ||
384 | } | ||
385 | return device; | ||
386 | } | ||
387 | |||
388 | /** | 320 | /** |
389 | * bay_notify - act upon an acpi bay notification | 321 | * bay_notify - act upon an acpi bay notification |
390 | * @handle: the bay handle | 322 | * @handle: the bay handle |
@@ -394,38 +326,19 @@ static struct acpi_device * bay_create_acpi_device(acpi_handle handle) | |||
394 | */ | 326 | */ |
395 | static void bay_notify(acpi_handle handle, u32 event, void *data) | 327 | static void bay_notify(acpi_handle handle, u32 event, void *data) |
396 | { | 328 | { |
397 | struct acpi_device *dev; | 329 | struct bay *bay_dev = (struct bay *)data; |
330 | struct device *dev = &bay_dev->pdev->dev; | ||
398 | 331 | ||
399 | bay_dprintk(handle, "Bay event"); | 332 | bay_dprintk(handle, "Bay event"); |
400 | 333 | ||
401 | switch(event) { | 334 | switch(event) { |
402 | case ACPI_NOTIFY_BUS_CHECK: | 335 | case ACPI_NOTIFY_BUS_CHECK: |
403 | printk("Bus Check\n"); | ||
404 | case ACPI_NOTIFY_DEVICE_CHECK: | 336 | case ACPI_NOTIFY_DEVICE_CHECK: |
405 | printk("Device Check\n"); | ||
406 | dev = bay_create_acpi_device(handle); | ||
407 | if (dev) | ||
408 | acpi_bus_generate_event(dev, event, 0); | ||
409 | else | ||
410 | printk("No device for generating event\n"); | ||
411 | /* wouldn't it be a good idea to just rescan SATA | ||
412 | * right here? | ||
413 | */ | ||
414 | break; | ||
415 | case ACPI_NOTIFY_EJECT_REQUEST: | 337 | case ACPI_NOTIFY_EJECT_REQUEST: |
416 | printk("Eject request\n"); | 338 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); |
417 | dev = bay_create_acpi_device(handle); | ||
418 | if (dev) | ||
419 | acpi_bus_generate_event(dev, event, 0); | ||
420 | else | ||
421 | printk("No device for generating eventn"); | ||
422 | |||
423 | /* wouldn't it be a good idea to just call the | ||
424 | * eject_device here if we were a SATA device? | ||
425 | */ | ||
426 | break; | 339 | break; |
427 | default: | 340 | default: |
428 | printk("unknown event %d\n", event); | 341 | printk(KERN_ERR PREFIX "Bay: unknown event %d\n", event); |
429 | } | 342 | } |
430 | } | 343 | } |
431 | 344 | ||
@@ -457,10 +370,6 @@ static int __init bay_init(void) | |||
457 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, | 370 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |
458 | ACPI_UINT32_MAX, find_bay, &bays, NULL); | 371 | ACPI_UINT32_MAX, find_bay, &bays, NULL); |
459 | 372 | ||
460 | if (bays) | ||
461 | if ((acpi_bus_register_driver(&acpi_bay_driver) < 0)) | ||
462 | printk(KERN_ERR "Unable to register bay driver\n"); | ||
463 | |||
464 | if (!bays) | 373 | if (!bays) |
465 | return -ENODEV; | 374 | return -ENODEV; |
466 | 375 | ||
@@ -481,8 +390,6 @@ static void __exit bay_exit(void) | |||
481 | kfree(bay->name); | 390 | kfree(bay->name); |
482 | kfree(bay); | 391 | kfree(bay); |
483 | } | 392 | } |
484 | |||
485 | acpi_bus_unregister_driver(&acpi_bay_driver); | ||
486 | } | 393 | } |
487 | 394 | ||
488 | postcore_initcall(bay_init); | 395 | postcore_initcall(bay_init); |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index c26468da4295..fd37e19360d0 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <acpi/acpi_drivers.h> | 39 | #include <acpi/acpi_drivers.h> |
40 | 40 | ||
41 | #define _COMPONENT ACPI_BUS_COMPONENT | 41 | #define _COMPONENT ACPI_BUS_COMPONENT |
42 | ACPI_MODULE_NAME("acpi_bus") | 42 | ACPI_MODULE_NAME("bus"); |
43 | #ifdef CONFIG_X86 | 43 | #ifdef CONFIG_X86 |
44 | extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger); | 44 | extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger); |
45 | #endif | 45 | #endif |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index c726612fafb6..cb4110b50cd0 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <acpi/acpi_drivers.h> | 34 | #include <acpi/acpi_drivers.h> |
35 | 35 | ||
36 | #define ACPI_BUTTON_COMPONENT 0x00080000 | 36 | #define ACPI_BUTTON_COMPONENT 0x00080000 |
37 | #define ACPI_BUTTON_DRIVER_NAME "ACPI Button Driver" | ||
38 | #define ACPI_BUTTON_CLASS "button" | 37 | #define ACPI_BUTTON_CLASS "button" |
39 | #define ACPI_BUTTON_FILE_INFO "info" | 38 | #define ACPI_BUTTON_FILE_INFO "info" |
40 | #define ACPI_BUTTON_FILE_STATE "state" | 39 | #define ACPI_BUTTON_FILE_STATE "state" |
@@ -61,10 +60,10 @@ | |||
61 | #define ACPI_BUTTON_TYPE_LID 0x05 | 60 | #define ACPI_BUTTON_TYPE_LID 0x05 |
62 | 61 | ||
63 | #define _COMPONENT ACPI_BUTTON_COMPONENT | 62 | #define _COMPONENT ACPI_BUTTON_COMPONENT |
64 | ACPI_MODULE_NAME("acpi_button") | 63 | ACPI_MODULE_NAME("button"); |
65 | 64 | ||
66 | MODULE_AUTHOR("Paul Diefenbaugh"); | 65 | MODULE_AUTHOR("Paul Diefenbaugh"); |
67 | MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME); | 66 | MODULE_DESCRIPTION("ACPI Button Driver"); |
68 | MODULE_LICENSE("GPL"); | 67 | MODULE_LICENSE("GPL"); |
69 | 68 | ||
70 | static int acpi_button_add(struct acpi_device *device); | 69 | static int acpi_button_add(struct acpi_device *device); |
@@ -73,7 +72,7 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file); | |||
73 | static int acpi_button_state_open_fs(struct inode *inode, struct file *file); | 72 | static int acpi_button_state_open_fs(struct inode *inode, struct file *file); |
74 | 73 | ||
75 | static struct acpi_driver acpi_button_driver = { | 74 | static struct acpi_driver acpi_button_driver = { |
76 | .name = ACPI_BUTTON_DRIVER_NAME, | 75 | .name = "button", |
77 | .class = ACPI_BUTTON_CLASS, | 76 | .class = ACPI_BUTTON_CLASS, |
78 | .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E", | 77 | .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E", |
79 | .ops = { | 78 | .ops = { |
diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c index 4a9b7bf6f44e..f9db4f444bd0 100644 --- a/drivers/acpi/cm_sbs.c +++ b/drivers/acpi/cm_sbs.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <acpi/actypes.h> | 31 | #include <acpi/actypes.h> |
32 | #include <acpi/acutils.h> | 32 | #include <acpi/acutils.h> |
33 | 33 | ||
34 | ACPI_MODULE_NAME("cm_sbs") | 34 | ACPI_MODULE_NAME("cm_sbs"); |
35 | #define ACPI_AC_CLASS "ac_adapter" | 35 | #define ACPI_AC_CLASS "ac_adapter" |
36 | #define ACPI_BATTERY_CLASS "battery" | 36 | #define ACPI_BATTERY_CLASS "battery" |
37 | #define ACPI_SBS_COMPONENT 0x00080000 | 37 | #define ACPI_SBS_COMPONENT 0x00080000 |
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 69a68fd394cf..0930d9413dfa 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <acpi/acpi_drivers.h> | 35 | #include <acpi/acpi_drivers.h> |
36 | #include <acpi/container.h> | 36 | #include <acpi/container.h> |
37 | 37 | ||
38 | #define ACPI_CONTAINER_DRIVER_NAME "ACPI container driver" | ||
39 | #define ACPI_CONTAINER_DEVICE_NAME "ACPI container device" | 38 | #define ACPI_CONTAINER_DEVICE_NAME "ACPI container device" |
40 | #define ACPI_CONTAINER_CLASS "container" | 39 | #define ACPI_CONTAINER_CLASS "container" |
41 | 40 | ||
@@ -44,10 +43,10 @@ | |||
44 | 43 | ||
45 | #define ACPI_CONTAINER_COMPONENT 0x01000000 | 44 | #define ACPI_CONTAINER_COMPONENT 0x01000000 |
46 | #define _COMPONENT ACPI_CONTAINER_COMPONENT | 45 | #define _COMPONENT ACPI_CONTAINER_COMPONENT |
47 | ACPI_MODULE_NAME("acpi_container") | 46 | ACPI_MODULE_NAME("container"); |
48 | 47 | ||
49 | MODULE_AUTHOR("Anil S Keshavamurthy"); | 48 | MODULE_AUTHOR("Anil S Keshavamurthy"); |
50 | MODULE_DESCRIPTION(ACPI_CONTAINER_DRIVER_NAME); | 49 | MODULE_DESCRIPTION("ACPI container driver"); |
51 | MODULE_LICENSE("GPL"); | 50 | MODULE_LICENSE("GPL"); |
52 | 51 | ||
53 | #define ACPI_STA_PRESENT (0x00000001) | 52 | #define ACPI_STA_PRESENT (0x00000001) |
@@ -56,7 +55,7 @@ static int acpi_container_add(struct acpi_device *device); | |||
56 | static int acpi_container_remove(struct acpi_device *device, int type); | 55 | static int acpi_container_remove(struct acpi_device *device, int type); |
57 | 56 | ||
58 | static struct acpi_driver acpi_container_driver = { | 57 | static struct acpi_driver acpi_container_driver = { |
59 | .name = ACPI_CONTAINER_DRIVER_NAME, | 58 | .name = "container", |
60 | .class = ACPI_CONTAINER_CLASS, | 59 | .class = ACPI_CONTAINER_CLASS, |
61 | .ids = "ACPI0004,PNP0A05,PNP0A06", | 60 | .ids = "ACPI0004,PNP0A05,PNP0A06", |
62 | .ops = { | 61 | .ops = { |
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index d48f65a8f658..bf513e07b773 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <acpi/acglobal.h> | 12 | #include <acpi/acglobal.h> |
13 | 13 | ||
14 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | 14 | #define _COMPONENT ACPI_SYSTEM_COMPONENT |
15 | ACPI_MODULE_NAME("debug") | 15 | ACPI_MODULE_NAME("debug"); |
16 | 16 | ||
17 | #ifdef MODULE_PARAM_PREFIX | 17 | #ifdef MODULE_PARAM_PREFIX |
18 | #undef MODULE_PARAM_PREFIX | 18 | #undef MODULE_PARAM_PREFIX |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 688e83a16906..54a697f9aa18 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -32,11 +32,11 @@ | |||
32 | #include <acpi/acpi_bus.h> | 32 | #include <acpi/acpi_bus.h> |
33 | #include <acpi/acpi_drivers.h> | 33 | #include <acpi/acpi_drivers.h> |
34 | 34 | ||
35 | #define ACPI_DOCK_DRIVER_NAME "ACPI Dock Station Driver" | 35 | #define ACPI_DOCK_DRIVER_DESCRIPTION "ACPI Dock Station Driver" |
36 | 36 | ||
37 | ACPI_MODULE_NAME("dock") | 37 | ACPI_MODULE_NAME("dock"); |
38 | MODULE_AUTHOR("Kristen Carlson Accardi"); | 38 | MODULE_AUTHOR("Kristen Carlson Accardi"); |
39 | MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_NAME); | 39 | MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_DESCRIPTION); |
40 | MODULE_LICENSE("GPL"); | 40 | MODULE_LICENSE("GPL"); |
41 | 41 | ||
42 | static struct atomic_notifier_head dock_notifier_list; | 42 | static struct atomic_notifier_head dock_notifier_list; |
@@ -741,7 +741,7 @@ static int dock_add(acpi_handle handle) | |||
741 | goto dock_add_err; | 741 | goto dock_add_err; |
742 | } | 742 | } |
743 | 743 | ||
744 | printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_NAME); | 744 | printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_DESCRIPTION); |
745 | 745 | ||
746 | return 0; | 746 | return 0; |
747 | 747 | ||
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 743ce27fa0bb..ab6888373795 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -38,11 +38,10 @@ | |||
38 | #include <acpi/actypes.h> | 38 | #include <acpi/actypes.h> |
39 | 39 | ||
40 | #define _COMPONENT ACPI_EC_COMPONENT | 40 | #define _COMPONENT ACPI_EC_COMPONENT |
41 | ACPI_MODULE_NAME("acpi_ec") | 41 | ACPI_MODULE_NAME("ec"); |
42 | #define ACPI_EC_COMPONENT 0x00100000 | 42 | #define ACPI_EC_COMPONENT 0x00100000 |
43 | #define ACPI_EC_CLASS "embedded_controller" | 43 | #define ACPI_EC_CLASS "embedded_controller" |
44 | #define ACPI_EC_HID "PNP0C09" | 44 | #define ACPI_EC_HID "PNP0C09" |
45 | #define ACPI_EC_DRIVER_NAME "ACPI Embedded Controller Driver" | ||
46 | #define ACPI_EC_DEVICE_NAME "Embedded Controller" | 45 | #define ACPI_EC_DEVICE_NAME "Embedded Controller" |
47 | #define ACPI_EC_FILE_INFO "info" | 46 | #define ACPI_EC_FILE_INFO "info" |
48 | #undef PREFIX | 47 | #undef PREFIX |
@@ -80,7 +79,7 @@ static int acpi_ec_stop(struct acpi_device *device, int type); | |||
80 | static int acpi_ec_add(struct acpi_device *device); | 79 | static int acpi_ec_add(struct acpi_device *device); |
81 | 80 | ||
82 | static struct acpi_driver acpi_ec_driver = { | 81 | static struct acpi_driver acpi_ec_driver = { |
83 | .name = ACPI_EC_DRIVER_NAME, | 82 | .name = "ec", |
84 | .class = ACPI_EC_CLASS, | 83 | .class = ACPI_EC_CLASS, |
85 | .ids = ACPI_EC_HID, | 84 | .ids = ACPI_EC_HID, |
86 | .ops = { | 85 | .ops = { |
@@ -280,8 +279,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, | |||
280 | mutex_lock(&ec->lock); | 279 | mutex_lock(&ec->lock); |
281 | if (ec->global_lock) { | 280 | if (ec->global_lock) { |
282 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | 281 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); |
283 | if (ACPI_FAILURE(status)) | 282 | if (ACPI_FAILURE(status)) { |
283 | mutex_unlock(&ec->lock); | ||
284 | return -ENODEV; | 284 | return -ENODEV; |
285 | } | ||
285 | } | 286 | } |
286 | 287 | ||
287 | /* Make sure GPE is enabled before doing transaction */ | 288 | /* Make sure GPE is enabled before doing transaction */ |
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 959a893c8d1f..3b23562e6f92 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <acpi/acpi_drivers.h> | 13 | #include <acpi/acpi_drivers.h> |
14 | 14 | ||
15 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | 15 | #define _COMPONENT ACPI_SYSTEM_COMPONENT |
16 | ACPI_MODULE_NAME("event") | 16 | ACPI_MODULE_NAME("event"); |
17 | 17 | ||
18 | /* Global vars for handling event proc entry */ | 18 | /* Global vars for handling event proc entry */ |
19 | static DEFINE_SPINLOCK(acpi_system_event_lock); | 19 | static DEFINE_SPINLOCK(acpi_system_event_lock); |
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c index dfac3ecc596e..635ba449ebc2 100644 --- a/drivers/acpi/events/evgpe.c +++ b/drivers/acpi/events/evgpe.c | |||
@@ -636,17 +636,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) | |||
636 | } | 636 | } |
637 | } | 637 | } |
638 | 638 | ||
639 | if (!acpi_gbl_system_awake_and_running) { | ||
640 | /* | ||
641 | * We just woke up because of a wake GPE. Disable any further GPEs | ||
642 | * until we are fully up and running (Only wake GPEs should be enabled | ||
643 | * at this time, but we just brute-force disable them all.) | ||
644 | * 1) We must disable this particular wake GPE so it won't fire again | ||
645 | * 2) We want to disable all wake GPEs, since we are now awake | ||
646 | */ | ||
647 | (void)acpi_hw_disable_all_gpes(); | ||
648 | } | ||
649 | |||
650 | /* | 639 | /* |
651 | * Dispatch the GPE to either an installed handler, or the control method | 640 | * Dispatch the GPE to either an installed handler, or the control method |
652 | * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke | 641 | * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke |
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index af22fdf73413..ec655c539492 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -36,14 +36,13 @@ | |||
36 | 36 | ||
37 | #define ACPI_FAN_COMPONENT 0x00200000 | 37 | #define ACPI_FAN_COMPONENT 0x00200000 |
38 | #define ACPI_FAN_CLASS "fan" | 38 | #define ACPI_FAN_CLASS "fan" |
39 | #define ACPI_FAN_DRIVER_NAME "ACPI Fan Driver" | ||
40 | #define ACPI_FAN_FILE_STATE "state" | 39 | #define ACPI_FAN_FILE_STATE "state" |
41 | 40 | ||
42 | #define _COMPONENT ACPI_FAN_COMPONENT | 41 | #define _COMPONENT ACPI_FAN_COMPONENT |
43 | ACPI_MODULE_NAME("acpi_fan") | 42 | ACPI_MODULE_NAME("fan"); |
44 | 43 | ||
45 | MODULE_AUTHOR("Paul Diefenbaugh"); | 44 | MODULE_AUTHOR("Paul Diefenbaugh"); |
46 | MODULE_DESCRIPTION(ACPI_FAN_DRIVER_NAME); | 45 | MODULE_DESCRIPTION("ACPI Fan Driver"); |
47 | MODULE_LICENSE("GPL"); | 46 | MODULE_LICENSE("GPL"); |
48 | 47 | ||
49 | static int acpi_fan_add(struct acpi_device *device); | 48 | static int acpi_fan_add(struct acpi_device *device); |
@@ -52,7 +51,7 @@ static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); | |||
52 | static int acpi_fan_resume(struct acpi_device *device); | 51 | static int acpi_fan_resume(struct acpi_device *device); |
53 | 52 | ||
54 | static struct acpi_driver acpi_fan_driver = { | 53 | static struct acpi_driver acpi_fan_driver = { |
55 | .name = ACPI_FAN_DRIVER_NAME, | 54 | .name = "fan", |
56 | .class = ACPI_FAN_CLASS, | 55 | .class = ACPI_FAN_CLASS, |
57 | .ids = "PNP0C0B", | 56 | .ids = "PNP0C0B", |
58 | .ops = { | 57 | .ops = { |
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 7b6c9ff9bebe..4334c208841a 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -241,3 +241,65 @@ static int __init init_acpi_device_notify(void) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | arch_initcall(init_acpi_device_notify); | 243 | arch_initcall(init_acpi_device_notify); |
244 | |||
245 | |||
246 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) | ||
247 | |||
248 | /* Every ACPI platform has a mc146818 compatible "cmos rtc". Here we find | ||
249 | * its device node and pass extra config data. This helps its driver use | ||
250 | * capabilities that the now-obsolete mc146818 didn't have, and informs it | ||
251 | * that this board's RTC is wakeup-capable (per ACPI spec). | ||
252 | */ | ||
253 | #include <linux/mc146818rtc.h> | ||
254 | |||
255 | static struct cmos_rtc_board_info rtc_info; | ||
256 | |||
257 | |||
258 | /* PNP devices are registered in a subsys_initcall(); | ||
259 | * ACPI specifies the PNP IDs to use. | ||
260 | */ | ||
261 | #include <linux/pnp.h> | ||
262 | |||
263 | static int __init pnp_match(struct device *dev, void *data) | ||
264 | { | ||
265 | static const char *ids[] = { "PNP0b00", "PNP0b01", "PNP0b02", }; | ||
266 | struct pnp_dev *pnp = to_pnp_dev(dev); | ||
267 | int i; | ||
268 | |||
269 | for (i = 0; i < ARRAY_SIZE(ids); i++) { | ||
270 | if (compare_pnp_id(pnp->id, ids[i]) != 0) | ||
271 | return 1; | ||
272 | } | ||
273 | return 0; | ||
274 | } | ||
275 | |||
276 | static struct device *__init get_rtc_dev(void) | ||
277 | { | ||
278 | return bus_find_device(&pnp_bus_type, NULL, NULL, pnp_match); | ||
279 | } | ||
280 | |||
281 | static int __init acpi_rtc_init(void) | ||
282 | { | ||
283 | struct device *dev = get_rtc_dev(); | ||
284 | |||
285 | if (dev) { | ||
286 | rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm; | ||
287 | rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm; | ||
288 | rtc_info.rtc_century = acpi_gbl_FADT.century; | ||
289 | |||
290 | /* NOTE: acpi_gbl_FADT->rtcs4 is NOT currently useful */ | ||
291 | |||
292 | dev->platform_data = &rtc_info; | ||
293 | |||
294 | /* RTC always wakes from S1/S2/S3, and often S4/STD */ | ||
295 | device_init_wakeup(dev, 1); | ||
296 | |||
297 | put_device(dev); | ||
298 | } else | ||
299 | pr_debug("ACPI: RTC unavailable?\n"); | ||
300 | return 0; | ||
301 | } | ||
302 | /* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */ | ||
303 | fs_initcall(acpi_rtc_init); | ||
304 | |||
305 | #endif | ||
diff --git a/drivers/acpi/i2c_ec.c b/drivers/acpi/i2c_ec.c index 8338be0990bc..acab4a481897 100644 --- a/drivers/acpi/i2c_ec.c +++ b/drivers/acpi/i2c_ec.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/stddef.h> | 16 | #include <linux/stddef.h> |
17 | #include <linux/sched.h> | ||
18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
19 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
20 | #include <linux/acpi.h> | 19 | #include <linux/acpi.h> |
@@ -28,18 +27,17 @@ | |||
28 | #define ACPI_EC_HC_COMPONENT 0x00080000 | 27 | #define ACPI_EC_HC_COMPONENT 0x00080000 |
29 | #define ACPI_EC_HC_CLASS "ec_hc_smbus" | 28 | #define ACPI_EC_HC_CLASS "ec_hc_smbus" |
30 | #define ACPI_EC_HC_HID "ACPI0001" | 29 | #define ACPI_EC_HC_HID "ACPI0001" |
31 | #define ACPI_EC_HC_DRIVER_NAME "ACPI EC HC smbus driver" | ||
32 | #define ACPI_EC_HC_DEVICE_NAME "EC HC smbus" | 30 | #define ACPI_EC_HC_DEVICE_NAME "EC HC smbus" |
33 | 31 | ||
34 | #define _COMPONENT ACPI_EC_HC_COMPONENT | 32 | #define _COMPONENT ACPI_EC_HC_COMPONENT |
35 | 33 | ||
36 | ACPI_MODULE_NAME("acpi_smbus") | 34 | ACPI_MODULE_NAME("i2c_ec"); |
37 | 35 | ||
38 | static int acpi_ec_hc_add(struct acpi_device *device); | 36 | static int acpi_ec_hc_add(struct acpi_device *device); |
39 | static int acpi_ec_hc_remove(struct acpi_device *device, int type); | 37 | static int acpi_ec_hc_remove(struct acpi_device *device, int type); |
40 | 38 | ||
41 | static struct acpi_driver acpi_ec_hc_driver = { | 39 | static struct acpi_driver acpi_ec_hc_driver = { |
42 | .name = ACPI_EC_HC_DRIVER_NAME, | 40 | .name = "i2c_ec", |
43 | .class = ACPI_EC_HC_CLASS, | 41 | .class = ACPI_EC_HC_CLASS, |
44 | .ids = ACPI_EC_HC_HID, | 42 | .ids = ACPI_EC_HC_HID, |
45 | .ops = { | 43 | .ops = { |
@@ -340,6 +338,7 @@ static int acpi_ec_hc_add(struct acpi_device *device) | |||
340 | smbus->adapter.owner = THIS_MODULE; | 338 | smbus->adapter.owner = THIS_MODULE; |
341 | smbus->adapter.algo = &acpi_ec_smbus_algorithm; | 339 | smbus->adapter.algo = &acpi_ec_smbus_algorithm; |
342 | smbus->adapter.algo_data = smbus; | 340 | smbus->adapter.algo_data = smbus; |
341 | smbus->adapter.dev.parent = &device->dev; | ||
343 | 342 | ||
344 | if (i2c_add_adapter(&smbus->adapter)) { | 343 | if (i2c_add_adapter(&smbus->adapter)) { |
345 | ACPI_DEBUG_PRINT((ACPI_DB_WARN, | 344 | ACPI_DEBUG_PRINT((ACPI_DB_WARN, |
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 4def52ca69e5..1a0ed3dc409c 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -496,6 +496,10 @@ static int ibm_acpi_driver_init(void) | |||
496 | printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION); | 496 | printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION); |
497 | printk(IBM_INFO "%s\n", IBM_URL); | 497 | printk(IBM_INFO "%s\n", IBM_URL); |
498 | 498 | ||
499 | if (ibm_thinkpad_ec_found) | ||
500 | printk(IBM_INFO "ThinkPad EC firmware %s\n", | ||
501 | ibm_thinkpad_ec_found); | ||
502 | |||
499 | return 0; | 503 | return 0; |
500 | } | 504 | } |
501 | 505 | ||
@@ -2617,7 +2621,7 @@ static void __init ibm_handle_init(char *name, | |||
2617 | ibm_handle_init(#object, &object##_handle, *object##_parent, \ | 2621 | ibm_handle_init(#object, &object##_handle, *object##_parent, \ |
2618 | object##_paths, ARRAY_SIZE(object##_paths), &object##_path) | 2622 | object##_paths, ARRAY_SIZE(object##_paths), &object##_path) |
2619 | 2623 | ||
2620 | static int set_ibm_param(const char *val, struct kernel_param *kp) | 2624 | static int __init set_ibm_param(const char *val, struct kernel_param *kp) |
2621 | { | 2625 | { |
2622 | unsigned int i; | 2626 | unsigned int i; |
2623 | 2627 | ||
@@ -2659,7 +2663,8 @@ static void acpi_ibm_exit(void) | |||
2659 | for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--) | 2663 | for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--) |
2660 | ibm_exit(&ibms[i]); | 2664 | ibm_exit(&ibms[i]); |
2661 | 2665 | ||
2662 | remove_proc_entry(IBM_DIR, acpi_root_dir); | 2666 | if (proc_dir) |
2667 | remove_proc_entry(IBM_DIR, acpi_root_dir); | ||
2663 | 2668 | ||
2664 | if (ibm_thinkpad_ec_found) | 2669 | if (ibm_thinkpad_ec_found) |
2665 | kfree(ibm_thinkpad_ec_found); | 2670 | kfree(ibm_thinkpad_ec_found); |
@@ -2705,9 +2710,6 @@ static int __init acpi_ibm_init(void) | |||
2705 | 2710 | ||
2706 | /* Models with newer firmware report the EC in DMI */ | 2711 | /* Models with newer firmware report the EC in DMI */ |
2707 | ibm_thinkpad_ec_found = check_dmi_for_ec(); | 2712 | ibm_thinkpad_ec_found = check_dmi_for_ec(); |
2708 | if (ibm_thinkpad_ec_found) | ||
2709 | printk(IBM_INFO "ThinkPad EC firmware %s\n", | ||
2710 | ibm_thinkpad_ec_found); | ||
2711 | 2713 | ||
2712 | /* these handles are not required */ | 2714 | /* these handles are not required */ |
2713 | IBM_HANDLE_INIT(vid); | 2715 | IBM_HANDLE_INIT(vid); |
@@ -2737,6 +2739,7 @@ static int __init acpi_ibm_init(void) | |||
2737 | proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir); | 2739 | proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir); |
2738 | if (!proc_dir) { | 2740 | if (!proc_dir) { |
2739 | printk(IBM_ERR "unable to create proc dir %s", IBM_DIR); | 2741 | printk(IBM_ERR "unable to create proc dir %s", IBM_DIR); |
2742 | acpi_ibm_exit(); | ||
2740 | return -ENODEV; | 2743 | return -ENODEV; |
2741 | } | 2744 | } |
2742 | proc_dir->owner = THIS_MODULE; | 2745 | proc_dir->owner = THIS_MODULE; |
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index 326af8fc0ce7..33db2241044e 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <acpi/acnamesp.h> | 45 | #include <acpi/acnamesp.h> |
46 | #include <acpi/acdispat.h> | 46 | #include <acpi/acdispat.h> |
47 | #include <acpi/acinterp.h> | 47 | #include <acpi/acinterp.h> |
48 | #include <linux/nmi.h> | ||
48 | 49 | ||
49 | #define _COMPONENT ACPI_NAMESPACE | 50 | #define _COMPONENT ACPI_NAMESPACE |
50 | ACPI_MODULE_NAME("nsinit") | 51 | ACPI_MODULE_NAME("nsinit") |
@@ -534,7 +535,15 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
534 | info->parameter_type = ACPI_PARAM_ARGS; | 535 | info->parameter_type = ACPI_PARAM_ARGS; |
535 | info->flags = ACPI_IGNORE_RETURN_VALUE; | 536 | info->flags = ACPI_IGNORE_RETURN_VALUE; |
536 | 537 | ||
538 | /* | ||
539 | * Some hardware relies on this being executed as atomically | ||
540 | * as possible (without an NMI being received in the middle of | ||
541 | * this) - so disable NMIs and initialize the device: | ||
542 | */ | ||
543 | acpi_nmi_disable(); | ||
537 | status = acpi_ns_evaluate(info); | 544 | status = acpi_ns_evaluate(info); |
545 | acpi_nmi_enable(); | ||
546 | |||
538 | if (ACPI_SUCCESS(status)) { | 547 | if (ACPI_SUCCESS(status)) { |
539 | walk_info->num_INI++; | 548 | walk_info->num_INI++; |
540 | 549 | ||
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 4a9faff4c01d..8fcd6a15517f 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | #define ACPI_NUMA 0x80000000 | 34 | #define ACPI_NUMA 0x80000000 |
35 | #define _COMPONENT ACPI_NUMA | 35 | #define _COMPONENT ACPI_NUMA |
36 | ACPI_MODULE_NAME("numa") | 36 | ACPI_MODULE_NAME("numa"); |
37 | 37 | ||
38 | static nodemask_t nodes_found_map = NODE_MASK_NONE; | 38 | static nodemask_t nodes_found_map = NODE_MASK_NONE; |
39 | #define PXM_INVAL -1 | 39 | #define PXM_INVAL -1 |
@@ -45,12 +45,6 @@ int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS] | |||
45 | int __cpuinitdata node_to_pxm_map[MAX_NUMNODES] | 45 | int __cpuinitdata node_to_pxm_map[MAX_NUMNODES] |
46 | = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; | 46 | = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; |
47 | 47 | ||
48 | extern int __init acpi_table_parse_madt_family(char *id, | ||
49 | unsigned long madt_size, | ||
50 | int entry_id, | ||
51 | acpi_madt_entry_handler handler, | ||
52 | unsigned int max_entries); | ||
53 | |||
54 | int __cpuinit pxm_to_node(int pxm) | 48 | int __cpuinit pxm_to_node(int pxm) |
55 | { | 49 | { |
56 | if (pxm < 0) | 50 | if (pxm < 0) |
@@ -208,9 +202,9 @@ static int __init acpi_parse_srat(struct acpi_table_header *table) | |||
208 | 202 | ||
209 | int __init | 203 | int __init |
210 | acpi_table_parse_srat(enum acpi_srat_type id, | 204 | acpi_table_parse_srat(enum acpi_srat_type id, |
211 | acpi_madt_entry_handler handler, unsigned int max_entries) | 205 | acpi_table_entry_handler handler, unsigned int max_entries) |
212 | { | 206 | { |
213 | return acpi_table_parse_madt_family(ACPI_SIG_SRAT, | 207 | return acpi_table_parse_entries(ACPI_SIG_SRAT, |
214 | sizeof(struct acpi_table_srat), id, | 208 | sizeof(struct acpi_table_srat), id, |
215 | handler, max_entries); | 209 | handler, max_entries); |
216 | } | 210 | } |
@@ -220,9 +214,7 @@ int __init acpi_numa_init(void) | |||
220 | int result; | 214 | int result; |
221 | 215 | ||
222 | /* SRAT: Static Resource Affinity Table */ | 216 | /* SRAT: Static Resource Affinity Table */ |
223 | result = acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat); | 217 | if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { |
224 | |||
225 | if (result > 0) { | ||
226 | result = acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, | 218 | result = acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, |
227 | acpi_parse_processor_affinity, | 219 | acpi_parse_processor_affinity, |
228 | NR_CPUS); | 220 | NR_CPUS); |
@@ -230,7 +222,7 @@ int __init acpi_numa_init(void) | |||
230 | } | 222 | } |
231 | 223 | ||
232 | /* SLIT: System Locality Information Table */ | 224 | /* SLIT: System Locality Information Table */ |
233 | result = acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); | 225 | acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); |
234 | 226 | ||
235 | acpi_numa_arch_fixup(); | 227 | acpi_numa_arch_fixup(); |
236 | return 0; | 228 | return 0; |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 368e111100bd..971eca4864fa 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/efi.h> | 46 | #include <linux/efi.h> |
47 | 47 | ||
48 | #define _COMPONENT ACPI_OS_SERVICES | 48 | #define _COMPONENT ACPI_OS_SERVICES |
49 | ACPI_MODULE_NAME("osl") | 49 | ACPI_MODULE_NAME("osl"); |
50 | #define PREFIX "ACPI: " | 50 | #define PREFIX "ACPI: " |
51 | struct acpi_os_dpc { | 51 | struct acpi_os_dpc { |
52 | acpi_osd_exec_callback function; | 52 | acpi_osd_exec_callback function; |
@@ -202,7 +202,7 @@ void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size) | |||
202 | { | 202 | { |
203 | if (phys > ULONG_MAX) { | 203 | if (phys > ULONG_MAX) { |
204 | printk(KERN_ERR PREFIX "Cannot map memory that high\n"); | 204 | printk(KERN_ERR PREFIX "Cannot map memory that high\n"); |
205 | return 0; | 205 | return NULL; |
206 | } | 206 | } |
207 | if (acpi_gbl_permanent_mmap) | 207 | if (acpi_gbl_permanent_mmap) |
208 | /* | 208 | /* |
@@ -887,26 +887,6 @@ u32 acpi_os_get_line(char *buffer) | |||
887 | } | 887 | } |
888 | #endif /* ACPI_FUTURE_USAGE */ | 888 | #endif /* ACPI_FUTURE_USAGE */ |
889 | 889 | ||
890 | /* Assumes no unreadable holes inbetween */ | ||
891 | u8 acpi_os_readable(void *ptr, acpi_size len) | ||
892 | { | ||
893 | #if defined(__i386__) || defined(__x86_64__) | ||
894 | char tmp; | ||
895 | return !__get_user(tmp, (char __user *)ptr) | ||
896 | && !__get_user(tmp, (char __user *)ptr + len - 1); | ||
897 | #endif | ||
898 | return 1; | ||
899 | } | ||
900 | |||
901 | #ifdef ACPI_FUTURE_USAGE | ||
902 | u8 acpi_os_writable(void *ptr, acpi_size len) | ||
903 | { | ||
904 | /* could do dummy write (racy) or a kernel page table lookup. | ||
905 | The later may be difficult at early boot when kmap doesn't work yet. */ | ||
906 | return 1; | ||
907 | } | ||
908 | #endif | ||
909 | |||
910 | acpi_status acpi_os_signal(u32 function, void *info) | 890 | acpi_status acpi_os_signal(u32 function, void *info) |
911 | { | 891 | { |
912 | switch (function) { | 892 | switch (function) { |
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c index 55f57a61c55e..028969370bbf 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <acpi/acpi_drivers.h> | 36 | #include <acpi/acpi_drivers.h> |
37 | 37 | ||
38 | #define _COMPONENT ACPI_PCI_COMPONENT | 38 | #define _COMPONENT ACPI_PCI_COMPONENT |
39 | ACPI_MODULE_NAME("pci_bind") | 39 | ACPI_MODULE_NAME("pci_bind"); |
40 | 40 | ||
41 | struct acpi_pci_data { | 41 | struct acpi_pci_data { |
42 | struct acpi_pci_id id; | 42 | struct acpi_pci_id id; |
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index fe7d007833ad..dd3186abe07a 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <acpi/acpi_drivers.h> | 38 | #include <acpi/acpi_drivers.h> |
39 | 39 | ||
40 | #define _COMPONENT ACPI_PCI_COMPONENT | 40 | #define _COMPONENT ACPI_PCI_COMPONENT |
41 | ACPI_MODULE_NAME("pci_irq") | 41 | ACPI_MODULE_NAME("pci_irq"); |
42 | 42 | ||
43 | static struct acpi_prt_list acpi_prt; | 43 | static struct acpi_prt_list acpi_prt; |
44 | static DEFINE_SPINLOCK(acpi_prt_lock); | 44 | static DEFINE_SPINLOCK(acpi_prt_lock); |
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 0f683c8c6fbc..acc594771379 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -44,10 +44,9 @@ | |||
44 | #include <acpi/acpi_drivers.h> | 44 | #include <acpi/acpi_drivers.h> |
45 | 45 | ||
46 | #define _COMPONENT ACPI_PCI_COMPONENT | 46 | #define _COMPONENT ACPI_PCI_COMPONENT |
47 | ACPI_MODULE_NAME("pci_link") | 47 | ACPI_MODULE_NAME("pci_link"); |
48 | #define ACPI_PCI_LINK_CLASS "pci_irq_routing" | 48 | #define ACPI_PCI_LINK_CLASS "pci_irq_routing" |
49 | #define ACPI_PCI_LINK_HID "PNP0C0F" | 49 | #define ACPI_PCI_LINK_HID "PNP0C0F" |
50 | #define ACPI_PCI_LINK_DRIVER_NAME "ACPI PCI Interrupt Link Driver" | ||
51 | #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" | 50 | #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" |
52 | #define ACPI_PCI_LINK_FILE_INFO "info" | 51 | #define ACPI_PCI_LINK_FILE_INFO "info" |
53 | #define ACPI_PCI_LINK_FILE_STATUS "state" | 52 | #define ACPI_PCI_LINK_FILE_STATUS "state" |
@@ -56,7 +55,7 @@ static int acpi_pci_link_add(struct acpi_device *device); | |||
56 | static int acpi_pci_link_remove(struct acpi_device *device, int type); | 55 | static int acpi_pci_link_remove(struct acpi_device *device, int type); |
57 | 56 | ||
58 | static struct acpi_driver acpi_pci_link_driver = { | 57 | static struct acpi_driver acpi_pci_link_driver = { |
59 | .name = ACPI_PCI_LINK_DRIVER_NAME, | 58 | .name = "pci_link", |
60 | .class = ACPI_PCI_LINK_CLASS, | 59 | .class = ACPI_PCI_LINK_CLASS, |
61 | .ids = ACPI_PCI_LINK_HID, | 60 | .ids = ACPI_PCI_LINK_HID, |
62 | .ops = { | 61 | .ops = { |
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 4ecf701687e8..ad4145a37786 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -36,17 +36,16 @@ | |||
36 | #include <acpi/acpi_drivers.h> | 36 | #include <acpi/acpi_drivers.h> |
37 | 37 | ||
38 | #define _COMPONENT ACPI_PCI_COMPONENT | 38 | #define _COMPONENT ACPI_PCI_COMPONENT |
39 | ACPI_MODULE_NAME("pci_root") | 39 | ACPI_MODULE_NAME("pci_root"); |
40 | #define ACPI_PCI_ROOT_CLASS "pci_bridge" | 40 | #define ACPI_PCI_ROOT_CLASS "pci_bridge" |
41 | #define ACPI_PCI_ROOT_HID "PNP0A03" | 41 | #define ACPI_PCI_ROOT_HID "PNP0A03" |
42 | #define ACPI_PCI_ROOT_DRIVER_NAME "ACPI PCI Root Bridge Driver" | ||
43 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" | 42 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" |
44 | static int acpi_pci_root_add(struct acpi_device *device); | 43 | static int acpi_pci_root_add(struct acpi_device *device); |
45 | static int acpi_pci_root_remove(struct acpi_device *device, int type); | 44 | static int acpi_pci_root_remove(struct acpi_device *device, int type); |
46 | static int acpi_pci_root_start(struct acpi_device *device); | 45 | static int acpi_pci_root_start(struct acpi_device *device); |
47 | 46 | ||
48 | static struct acpi_driver acpi_pci_root_driver = { | 47 | static struct acpi_driver acpi_pci_root_driver = { |
49 | .name = ACPI_PCI_ROOT_DRIVER_NAME, | 48 | .name = "pci_root", |
50 | .class = ACPI_PCI_ROOT_CLASS, | 49 | .class = ACPI_PCI_ROOT_CLASS, |
51 | .ids = ACPI_PCI_ROOT_HID, | 50 | .ids = ACPI_PCI_ROOT_HID, |
52 | .ops = { | 51 | .ops = { |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 0ba7dfbbb2ee..92f80ba491c5 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -45,10 +45,9 @@ | |||
45 | #include <acpi/acpi_drivers.h> | 45 | #include <acpi/acpi_drivers.h> |
46 | 46 | ||
47 | #define _COMPONENT ACPI_POWER_COMPONENT | 47 | #define _COMPONENT ACPI_POWER_COMPONENT |
48 | ACPI_MODULE_NAME("acpi_power") | 48 | ACPI_MODULE_NAME("power"); |
49 | #define ACPI_POWER_COMPONENT 0x00800000 | 49 | #define ACPI_POWER_COMPONENT 0x00800000 |
50 | #define ACPI_POWER_CLASS "power_resource" | 50 | #define ACPI_POWER_CLASS "power_resource" |
51 | #define ACPI_POWER_DRIVER_NAME "ACPI Power Resource Driver" | ||
52 | #define ACPI_POWER_DEVICE_NAME "Power Resource" | 51 | #define ACPI_POWER_DEVICE_NAME "Power Resource" |
53 | #define ACPI_POWER_FILE_INFO "info" | 52 | #define ACPI_POWER_FILE_INFO "info" |
54 | #define ACPI_POWER_FILE_STATUS "state" | 53 | #define ACPI_POWER_FILE_STATUS "state" |
@@ -60,7 +59,7 @@ static int acpi_power_remove(struct acpi_device *device, int type); | |||
60 | static int acpi_power_open_fs(struct inode *inode, struct file *file); | 59 | static int acpi_power_open_fs(struct inode *inode, struct file *file); |
61 | 60 | ||
62 | static struct acpi_driver acpi_power_driver = { | 61 | static struct acpi_driver acpi_power_driver = { |
63 | .name = ACPI_POWER_DRIVER_NAME, | 62 | .name = "power", |
64 | .class = ACPI_POWER_CLASS, | 63 | .class = ACPI_POWER_CLASS, |
65 | .ids = ACPI_POWER_HID, | 64 | .ids = ACPI_POWER_HID, |
66 | .ops = { | 65 | .ops = { |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 0079bc51082c..99d1516d1e70 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -60,7 +60,6 @@ | |||
60 | 60 | ||
61 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 | 61 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 |
62 | #define ACPI_PROCESSOR_CLASS "processor" | 62 | #define ACPI_PROCESSOR_CLASS "processor" |
63 | #define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" | ||
64 | #define ACPI_PROCESSOR_DEVICE_NAME "Processor" | 63 | #define ACPI_PROCESSOR_DEVICE_NAME "Processor" |
65 | #define ACPI_PROCESSOR_FILE_INFO "info" | 64 | #define ACPI_PROCESSOR_FILE_INFO "info" |
66 | #define ACPI_PROCESSOR_FILE_THROTTLING "throttling" | 65 | #define ACPI_PROCESSOR_FILE_THROTTLING "throttling" |
@@ -74,10 +73,10 @@ | |||
74 | #define ACPI_STA_PRESENT 0x00000001 | 73 | #define ACPI_STA_PRESENT 0x00000001 |
75 | 74 | ||
76 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 75 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
77 | ACPI_MODULE_NAME("acpi_processor") | 76 | ACPI_MODULE_NAME("processor_core"); |
78 | 77 | ||
79 | MODULE_AUTHOR("Paul Diefenbaugh"); | 78 | MODULE_AUTHOR("Paul Diefenbaugh"); |
80 | MODULE_DESCRIPTION(ACPI_PROCESSOR_DRIVER_NAME); | 79 | MODULE_DESCRIPTION("ACPI Processor Driver"); |
81 | MODULE_LICENSE("GPL"); | 80 | MODULE_LICENSE("GPL"); |
82 | 81 | ||
83 | static int acpi_processor_add(struct acpi_device *device); | 82 | static int acpi_processor_add(struct acpi_device *device); |
@@ -89,7 +88,7 @@ static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); | |||
89 | static int acpi_processor_handle_eject(struct acpi_processor *pr); | 88 | static int acpi_processor_handle_eject(struct acpi_processor *pr); |
90 | 89 | ||
91 | static struct acpi_driver acpi_processor_driver = { | 90 | static struct acpi_driver acpi_processor_driver = { |
92 | .name = ACPI_PROCESSOR_DRIVER_NAME, | 91 | .name = "processor", |
93 | .class = ACPI_PROCESSOR_CLASS, | 92 | .class = ACPI_PROCESSOR_CLASS, |
94 | .ids = ACPI_PROCESSOR_HID, | 93 | .ids = ACPI_PROCESSOR_HID, |
95 | .ops = { | 94 | .ops = { |
@@ -404,7 +403,7 @@ static int map_lsapic_id(struct acpi_subtable_header *entry, | |||
404 | if (lsapic->lapic_flags & ACPI_MADT_ENABLED) { | 403 | if (lsapic->lapic_flags & ACPI_MADT_ENABLED) { |
405 | /* First check against id */ | 404 | /* First check against id */ |
406 | if (lsapic->processor_id == acpi_id) { | 405 | if (lsapic->processor_id == acpi_id) { |
407 | *apic_id = lsapic->id; | 406 | *apic_id = (lsapic->id << 8) | lsapic->eid; |
408 | return 1; | 407 | return 1; |
409 | /* Check against optional uid */ | 408 | /* Check against optional uid */ |
410 | } else if (entry->length >= 16 && | 409 | } else if (entry->length >= 16 && |
@@ -1005,7 +1004,7 @@ static int __init acpi_processor_init(void) | |||
1005 | #ifdef CONFIG_SMP | 1004 | #ifdef CONFIG_SMP |
1006 | if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0, | 1005 | if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0, |
1007 | (struct acpi_table_header **)&madt))) | 1006 | (struct acpi_table_header **)&madt))) |
1008 | madt = 0; | 1007 | madt = NULL; |
1009 | #endif | 1008 | #endif |
1010 | 1009 | ||
1011 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1010 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6c6751b1405b..60773005b8af 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -39,6 +39,25 @@ | |||
39 | #include <linux/moduleparam.h> | 39 | #include <linux/moduleparam.h> |
40 | #include <linux/sched.h> /* need_resched() */ | 40 | #include <linux/sched.h> /* need_resched() */ |
41 | #include <linux/latency.h> | 41 | #include <linux/latency.h> |
42 | #include <linux/clockchips.h> | ||
43 | |||
44 | /* | ||
45 | * Include the apic definitions for x86 to have the APIC timer related defines | ||
46 | * available also for UP (on SMP it gets magically included via linux/smp.h). | ||
47 | * asm/acpi.h is not an option, as it would require more include magic. Also | ||
48 | * creating an empty asm-ia64/apic.h would just trade pest vs. cholera. | ||
49 | */ | ||
50 | #ifdef CONFIG_X86 | ||
51 | #include <asm/apic.h> | ||
52 | #endif | ||
53 | |||
54 | /* | ||
55 | * Include the apic definitions for x86 to have the APIC timer related defines | ||
56 | * available also for UP (on SMP it gets magically included via linux/smp.h). | ||
57 | */ | ||
58 | #ifdef CONFIG_X86 | ||
59 | #include <asm/apic.h> | ||
60 | #endif | ||
42 | 61 | ||
43 | #include <asm/io.h> | 62 | #include <asm/io.h> |
44 | #include <asm/uaccess.h> | 63 | #include <asm/uaccess.h> |
@@ -48,9 +67,8 @@ | |||
48 | 67 | ||
49 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 | 68 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 |
50 | #define ACPI_PROCESSOR_CLASS "processor" | 69 | #define ACPI_PROCESSOR_CLASS "processor" |
51 | #define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" | ||
52 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 70 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
53 | ACPI_MODULE_NAME("acpi_processor") | 71 | ACPI_MODULE_NAME("processor_idle"); |
54 | #define ACPI_PROCESSOR_FILE_POWER "power" | 72 | #define ACPI_PROCESSOR_FILE_POWER "power" |
55 | #define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000) | 73 | #define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000) |
56 | #define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */ | 74 | #define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */ |
@@ -238,6 +256,81 @@ static void acpi_cstate_enter(struct acpi_processor_cx *cstate) | |||
238 | } | 256 | } |
239 | } | 257 | } |
240 | 258 | ||
259 | #ifdef ARCH_APICTIMER_STOPS_ON_C3 | ||
260 | |||
261 | /* | ||
262 | * Some BIOS implementations switch to C3 in the published C2 state. | ||
263 | * This seems to be a common problem on AMD boxen, but other vendors | ||
264 | * are affected too. We pick the most conservative approach: we assume | ||
265 | * that the local APIC stops in both C2 and C3. | ||
266 | */ | ||
267 | static void acpi_timer_check_state(int state, struct acpi_processor *pr, | ||
268 | struct acpi_processor_cx *cx) | ||
269 | { | ||
270 | struct acpi_processor_power *pwr = &pr->power; | ||
271 | |||
272 | /* | ||
273 | * Check, if one of the previous states already marked the lapic | ||
274 | * unstable | ||
275 | */ | ||
276 | if (pwr->timer_broadcast_on_state < state) | ||
277 | return; | ||
278 | |||
279 | if (cx->type >= ACPI_STATE_C2) | ||
280 | pr->power.timer_broadcast_on_state = state; | ||
281 | } | ||
282 | |||
283 | static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) | ||
284 | { | ||
285 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
286 | unsigned long reason; | ||
287 | |||
288 | reason = pr->power.timer_broadcast_on_state < INT_MAX ? | ||
289 | CLOCK_EVT_NOTIFY_BROADCAST_ON : CLOCK_EVT_NOTIFY_BROADCAST_OFF; | ||
290 | |||
291 | clockevents_notify(reason, &pr->id); | ||
292 | #else | ||
293 | cpumask_t mask = cpumask_of_cpu(pr->id); | ||
294 | |||
295 | if (pr->power.timer_broadcast_on_state < INT_MAX) | ||
296 | on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); | ||
297 | else | ||
298 | on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); | ||
299 | #endif | ||
300 | } | ||
301 | |||
302 | /* Power(C) State timer broadcast control */ | ||
303 | static void acpi_state_timer_broadcast(struct acpi_processor *pr, | ||
304 | struct acpi_processor_cx *cx, | ||
305 | int broadcast) | ||
306 | { | ||
307 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
308 | |||
309 | int state = cx - pr->power.states; | ||
310 | |||
311 | if (state >= pr->power.timer_broadcast_on_state) { | ||
312 | unsigned long reason; | ||
313 | |||
314 | reason = broadcast ? CLOCK_EVT_NOTIFY_BROADCAST_ENTER : | ||
315 | CLOCK_EVT_NOTIFY_BROADCAST_EXIT; | ||
316 | clockevents_notify(reason, &pr->id); | ||
317 | } | ||
318 | #endif | ||
319 | } | ||
320 | |||
321 | #else | ||
322 | |||
323 | static void acpi_timer_check_state(int state, struct acpi_processor *pr, | ||
324 | struct acpi_processor_cx *cstate) { } | ||
325 | static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) { } | ||
326 | static void acpi_state_timer_broadcast(struct acpi_processor *pr, | ||
327 | struct acpi_processor_cx *cx, | ||
328 | int broadcast) | ||
329 | { | ||
330 | } | ||
331 | |||
332 | #endif | ||
333 | |||
241 | static void acpi_processor_idle(void) | 334 | static void acpi_processor_idle(void) |
242 | { | 335 | { |
243 | struct acpi_processor *pr = NULL; | 336 | struct acpi_processor *pr = NULL; |
@@ -382,6 +475,7 @@ static void acpi_processor_idle(void) | |||
382 | /* Get start time (ticks) */ | 475 | /* Get start time (ticks) */ |
383 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 476 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
384 | /* Invoke C2 */ | 477 | /* Invoke C2 */ |
478 | acpi_state_timer_broadcast(pr, cx, 1); | ||
385 | acpi_cstate_enter(cx); | 479 | acpi_cstate_enter(cx); |
386 | /* Get end time (ticks) */ | 480 | /* Get end time (ticks) */ |
387 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 481 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
@@ -396,6 +490,7 @@ static void acpi_processor_idle(void) | |||
396 | /* Compute time (ticks) that we were actually asleep */ | 490 | /* Compute time (ticks) that we were actually asleep */ |
397 | sleep_ticks = | 491 | sleep_ticks = |
398 | ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD; | 492 | ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD; |
493 | acpi_state_timer_broadcast(pr, cx, 0); | ||
399 | break; | 494 | break; |
400 | 495 | ||
401 | case ACPI_STATE_C3: | 496 | case ACPI_STATE_C3: |
@@ -417,6 +512,7 @@ static void acpi_processor_idle(void) | |||
417 | /* Get start time (ticks) */ | 512 | /* Get start time (ticks) */ |
418 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 513 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
419 | /* Invoke C3 */ | 514 | /* Invoke C3 */ |
515 | acpi_state_timer_broadcast(pr, cx, 1); | ||
420 | acpi_cstate_enter(cx); | 516 | acpi_cstate_enter(cx); |
421 | /* Get end time (ticks) */ | 517 | /* Get end time (ticks) */ |
422 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 518 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
@@ -436,6 +532,7 @@ static void acpi_processor_idle(void) | |||
436 | /* Compute time (ticks) that we were actually asleep */ | 532 | /* Compute time (ticks) that we were actually asleep */ |
437 | sleep_ticks = | 533 | sleep_ticks = |
438 | ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD; | 534 | ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD; |
535 | acpi_state_timer_broadcast(pr, cx, 0); | ||
439 | break; | 536 | break; |
440 | 537 | ||
441 | default: | 538 | default: |
@@ -904,11 +1001,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
904 | unsigned int i; | 1001 | unsigned int i; |
905 | unsigned int working = 0; | 1002 | unsigned int working = 0; |
906 | 1003 | ||
907 | #ifdef ARCH_APICTIMER_STOPS_ON_C3 | 1004 | pr->power.timer_broadcast_on_state = INT_MAX; |
908 | int timer_broadcast = 0; | ||
909 | cpumask_t mask = cpumask_of_cpu(pr->id); | ||
910 | on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); | ||
911 | #endif | ||
912 | 1005 | ||
913 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { | 1006 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { |
914 | struct acpi_processor_cx *cx = &pr->power.states[i]; | 1007 | struct acpi_processor_cx *cx = &pr->power.states[i]; |
@@ -920,21 +1013,14 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
920 | 1013 | ||
921 | case ACPI_STATE_C2: | 1014 | case ACPI_STATE_C2: |
922 | acpi_processor_power_verify_c2(cx); | 1015 | acpi_processor_power_verify_c2(cx); |
923 | #ifdef ARCH_APICTIMER_STOPS_ON_C3 | 1016 | if (cx->valid) |
924 | /* Some AMD systems fake C3 as C2, but still | 1017 | acpi_timer_check_state(i, pr, cx); |
925 | have timer troubles */ | ||
926 | if (cx->valid && | ||
927 | boot_cpu_data.x86_vendor == X86_VENDOR_AMD) | ||
928 | timer_broadcast++; | ||
929 | #endif | ||
930 | break; | 1018 | break; |
931 | 1019 | ||
932 | case ACPI_STATE_C3: | 1020 | case ACPI_STATE_C3: |
933 | acpi_processor_power_verify_c3(pr, cx); | 1021 | acpi_processor_power_verify_c3(pr, cx); |
934 | #ifdef ARCH_APICTIMER_STOPS_ON_C3 | ||
935 | if (cx->valid) | 1022 | if (cx->valid) |
936 | timer_broadcast++; | 1023 | acpi_timer_check_state(i, pr, cx); |
937 | #endif | ||
938 | break; | 1024 | break; |
939 | } | 1025 | } |
940 | 1026 | ||
@@ -942,10 +1028,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
942 | working++; | 1028 | working++; |
943 | } | 1029 | } |
944 | 1030 | ||
945 | #ifdef ARCH_APICTIMER_STOPS_ON_C3 | 1031 | acpi_propagate_timer_broadcast(pr); |
946 | if (timer_broadcast) | ||
947 | on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); | ||
948 | #endif | ||
949 | 1032 | ||
950 | return (working); | 1033 | return (working); |
951 | } | 1034 | } |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 058f13cf3b79..2f2e7964226d 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -44,10 +44,9 @@ | |||
44 | 44 | ||
45 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 | 45 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 |
46 | #define ACPI_PROCESSOR_CLASS "processor" | 46 | #define ACPI_PROCESSOR_CLASS "processor" |
47 | #define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" | ||
48 | #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" | 47 | #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" |
49 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 48 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
50 | ACPI_MODULE_NAME("acpi_processor") | 49 | ACPI_MODULE_NAME("processor_perflib"); |
51 | 50 | ||
52 | static DEFINE_MUTEX(performance_mutex); | 51 | static DEFINE_MUTEX(performance_mutex); |
53 | 52 | ||
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 40fecd67ad83..06e6f3fb8825 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -41,9 +41,8 @@ | |||
41 | 41 | ||
42 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 | 42 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 |
43 | #define ACPI_PROCESSOR_CLASS "processor" | 43 | #define ACPI_PROCESSOR_CLASS "processor" |
44 | #define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" | ||
45 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 44 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
46 | ACPI_MODULE_NAME("acpi_processor") | 45 | ACPI_MODULE_NAME("processor_thermal"); |
47 | 46 | ||
48 | /* -------------------------------------------------------------------------- | 47 | /* -------------------------------------------------------------------------- |
49 | Limit Interface | 48 | Limit Interface |
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index 89dff3639abe..b33486009f41 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
@@ -41,9 +41,8 @@ | |||
41 | 41 | ||
42 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 | 42 | #define ACPI_PROCESSOR_COMPONENT 0x01000000 |
43 | #define ACPI_PROCESSOR_CLASS "processor" | 43 | #define ACPI_PROCESSOR_CLASS "processor" |
44 | #define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver" | ||
45 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 44 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
46 | ACPI_MODULE_NAME("acpi_processor") | 45 | ACPI_MODULE_NAME("processor_throttling"); |
47 | 46 | ||
48 | /* -------------------------------------------------------------------------- | 47 | /* -------------------------------------------------------------------------- |
49 | Throttling Control | 48 | Throttling Control |
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index f58fc7447ab4..1eab2034c9a5 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -59,7 +59,6 @@ extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); | |||
59 | #define ACPI_AC_CLASS "ac_adapter" | 59 | #define ACPI_AC_CLASS "ac_adapter" |
60 | #define ACPI_BATTERY_CLASS "battery" | 60 | #define ACPI_BATTERY_CLASS "battery" |
61 | #define ACPI_SBS_HID "ACPI0002" | 61 | #define ACPI_SBS_HID "ACPI0002" |
62 | #define ACPI_SBS_DRIVER_NAME "ACPI Smart Battery System Driver" | ||
63 | #define ACPI_SBS_DEVICE_NAME "Smart Battery System" | 62 | #define ACPI_SBS_DEVICE_NAME "Smart Battery System" |
64 | #define ACPI_SBS_FILE_INFO "info" | 63 | #define ACPI_SBS_FILE_INFO "info" |
65 | #define ACPI_SBS_FILE_STATE "state" | 64 | #define ACPI_SBS_FILE_STATE "state" |
@@ -78,7 +77,7 @@ extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); | |||
78 | #define MAX_SBS_BAT 4 | 77 | #define MAX_SBS_BAT 4 |
79 | #define MAX_SMBUS_ERR 1 | 78 | #define MAX_SMBUS_ERR 1 |
80 | 79 | ||
81 | ACPI_MODULE_NAME("acpi_sbs"); | 80 | ACPI_MODULE_NAME("sbs"); |
82 | 81 | ||
83 | MODULE_AUTHOR("Rich Townsend"); | 82 | MODULE_AUTHOR("Rich Townsend"); |
84 | MODULE_DESCRIPTION("Smart Battery System ACPI interface driver"); | 83 | MODULE_DESCRIPTION("Smart Battery System ACPI interface driver"); |
@@ -110,7 +109,7 @@ static void acpi_battery_smbus_err_handler(struct acpi_ec_smbus *smbus); | |||
110 | static void acpi_sbs_update_queue(void *data); | 109 | static void acpi_sbs_update_queue(void *data); |
111 | 110 | ||
112 | static struct acpi_driver acpi_sbs_driver = { | 111 | static struct acpi_driver acpi_sbs_driver = { |
113 | .name = ACPI_SBS_DRIVER_NAME, | 112 | .name = "sbs", |
114 | .class = ACPI_SBS_CLASS, | 113 | .class = ACPI_SBS_CLASS, |
115 | .ids = ACPI_SBS_HID, | 114 | .ids = ACPI_SBS_HID, |
116 | .ops = { | 115 | .ops = { |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 64f26db10c8e..bb0e0da39fb1 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -11,13 +11,12 @@ | |||
11 | #include <acpi/acinterp.h> /* for acpi_ex_eisa_id_to_string() */ | 11 | #include <acpi/acinterp.h> /* for acpi_ex_eisa_id_to_string() */ |
12 | 12 | ||
13 | #define _COMPONENT ACPI_BUS_COMPONENT | 13 | #define _COMPONENT ACPI_BUS_COMPONENT |
14 | ACPI_MODULE_NAME("scan") | 14 | ACPI_MODULE_NAME("scan"); |
15 | #define STRUCT_TO_INT(s) (*((int*)&s)) | 15 | #define STRUCT_TO_INT(s) (*((int*)&s)) |
16 | extern struct acpi_device *acpi_root; | 16 | extern struct acpi_device *acpi_root; |
17 | 17 | ||
18 | #define ACPI_BUS_CLASS "system_bus" | 18 | #define ACPI_BUS_CLASS "system_bus" |
19 | #define ACPI_BUS_HID "ACPI_BUS" | 19 | #define ACPI_BUS_HID "ACPI_BUS" |
20 | #define ACPI_BUS_DRIVER_NAME "ACPI Bus Driver" | ||
21 | #define ACPI_BUS_DEVICE_NAME "System Bus" | 20 | #define ACPI_BUS_DEVICE_NAME "System Bus" |
22 | 21 | ||
23 | static LIST_HEAD(acpi_device_list); | 22 | static LIST_HEAD(acpi_device_list); |
diff --git a/drivers/acpi/sleep/poweroff.c b/drivers/acpi/sleep/poweroff.c index 47fb4b394eec..d9801eff6489 100644 --- a/drivers/acpi/sleep/poweroff.c +++ b/drivers/acpi/sleep/poweroff.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/pm.h> | 12 | #include <linux/pm.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <acpi/acpi_bus.h> | 14 | #include <acpi/acpi_bus.h> |
15 | #include <linux/sched.h> | ||
16 | #include <linux/sysdev.h> | 15 | #include <linux/sysdev.h> |
17 | #include <asm/io.h> | 16 | #include <asm/io.h> |
18 | #include "sleep.h" | 17 | #include "sleep.h" |
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index 7147b0bdab0a..83a8d3097904 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
@@ -31,14 +31,13 @@ | |||
31 | #include <acpi/acpi_drivers.h> | 31 | #include <acpi/acpi_drivers.h> |
32 | 32 | ||
33 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | 33 | #define _COMPONENT ACPI_SYSTEM_COMPONENT |
34 | ACPI_MODULE_NAME("acpi_system") | 34 | ACPI_MODULE_NAME("system"); |
35 | #ifdef MODULE_PARAM_PREFIX | 35 | #ifdef MODULE_PARAM_PREFIX |
36 | #undef MODULE_PARAM_PREFIX | 36 | #undef MODULE_PARAM_PREFIX |
37 | #endif | 37 | #endif |
38 | #define MODULE_PARAM_PREFIX "acpi." | 38 | #define MODULE_PARAM_PREFIX "acpi." |
39 | 39 | ||
40 | #define ACPI_SYSTEM_CLASS "system" | 40 | #define ACPI_SYSTEM_CLASS "system" |
41 | #define ACPI_SYSTEM_DRIVER_NAME "ACPI System Driver" | ||
42 | #define ACPI_SYSTEM_DEVICE_NAME "System" | 41 | #define ACPI_SYSTEM_DEVICE_NAME "System" |
43 | #define ACPI_SYSTEM_FILE_INFO "info" | 42 | #define ACPI_SYSTEM_FILE_INFO "info" |
44 | #define ACPI_SYSTEM_FILE_EVENT "event" | 43 | #define ACPI_SYSTEM_FILE_EVENT "event" |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index ba4cb200314a..849e2c361804 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/sched.h> | ||
29 | #include <linux/smp.h> | 28 | #include <linux/smp.h> |
30 | #include <linux/string.h> | 29 | #include <linux/string.h> |
31 | #include <linux/types.h> | 30 | #include <linux/types.h> |
@@ -170,40 +169,40 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header * header) | |||
170 | 169 | ||
171 | 170 | ||
172 | int __init | 171 | int __init |
173 | acpi_table_parse_madt_family(char *id, | 172 | acpi_table_parse_entries(char *id, |
174 | unsigned long madt_size, | 173 | unsigned long table_size, |
175 | int entry_id, | 174 | int entry_id, |
176 | acpi_madt_entry_handler handler, | 175 | acpi_table_entry_handler handler, |
177 | unsigned int max_entries) | 176 | unsigned int max_entries) |
178 | { | 177 | { |
179 | struct acpi_table_header *madt = NULL; | 178 | struct acpi_table_header *table_header = NULL; |
180 | struct acpi_subtable_header *entry; | 179 | struct acpi_subtable_header *entry; |
181 | unsigned int count = 0; | 180 | unsigned int count = 0; |
182 | unsigned long madt_end; | 181 | unsigned long table_end; |
183 | 182 | ||
184 | if (!handler) | 183 | if (!handler) |
185 | return -EINVAL; | 184 | return -EINVAL; |
186 | 185 | ||
187 | /* Locate the MADT (if exists). There should only be one. */ | 186 | /* Locate the table (if exists). There should only be one. */ |
188 | acpi_get_table(id, 0, &madt); | 187 | acpi_get_table(id, 0, &table_header); |
189 | 188 | ||
190 | if (!madt) { | 189 | if (!table_header) { |
191 | printk(KERN_WARNING PREFIX "%4.4s not present\n", id); | 190 | printk(KERN_WARNING PREFIX "%4.4s not present\n", id); |
192 | return -ENODEV; | 191 | return -ENODEV; |
193 | } | 192 | } |
194 | 193 | ||
195 | madt_end = (unsigned long)madt + madt->length; | 194 | table_end = (unsigned long)table_header + table_header->length; |
196 | 195 | ||
197 | /* Parse all entries looking for a match. */ | 196 | /* Parse all entries looking for a match. */ |
198 | 197 | ||
199 | entry = (struct acpi_subtable_header *) | 198 | entry = (struct acpi_subtable_header *) |
200 | ((unsigned long)madt + madt_size); | 199 | ((unsigned long)table_header + table_size); |
201 | 200 | ||
202 | while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) < | 201 | while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) < |
203 | madt_end) { | 202 | table_end) { |
204 | if (entry->type == entry_id | 203 | if (entry->type == entry_id |
205 | && (!max_entries || count++ < max_entries)) | 204 | && (!max_entries || count++ < max_entries)) |
206 | if (handler(entry, madt_end)) | 205 | if (handler(entry, table_end)) |
207 | return -EINVAL; | 206 | return -EINVAL; |
208 | 207 | ||
209 | entry = (struct acpi_subtable_header *) | 208 | entry = (struct acpi_subtable_header *) |
@@ -219,13 +218,22 @@ acpi_table_parse_madt_family(char *id, | |||
219 | 218 | ||
220 | int __init | 219 | int __init |
221 | acpi_table_parse_madt(enum acpi_madt_type id, | 220 | acpi_table_parse_madt(enum acpi_madt_type id, |
222 | acpi_madt_entry_handler handler, unsigned int max_entries) | 221 | acpi_table_entry_handler handler, unsigned int max_entries) |
223 | { | 222 | { |
224 | return acpi_table_parse_madt_family(ACPI_SIG_MADT, | 223 | return acpi_table_parse_entries(ACPI_SIG_MADT, |
225 | sizeof(struct acpi_table_madt), id, | 224 | sizeof(struct acpi_table_madt), id, |
226 | handler, max_entries); | 225 | handler, max_entries); |
227 | } | 226 | } |
228 | 227 | ||
228 | /** | ||
229 | * acpi_table_parse - find table with @id, run @handler on it | ||
230 | * | ||
231 | * @id: table id to find | ||
232 | * @handler: handler to run | ||
233 | * | ||
234 | * Scan the ACPI System Descriptor Table (STD) for a table matching @id, | ||
235 | * run @handler on it. Return 0 if table found, return on if not. | ||
236 | */ | ||
229 | int __init acpi_table_parse(char *id, acpi_table_handler handler) | 237 | int __init acpi_table_parse(char *id, acpi_table_handler handler) |
230 | { | 238 | { |
231 | struct acpi_table_header *table = NULL; | 239 | struct acpi_table_header *table = NULL; |
@@ -235,9 +243,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) | |||
235 | acpi_get_table(id, 0, &table); | 243 | acpi_get_table(id, 0, &table); |
236 | if (table) { | 244 | if (table) { |
237 | handler(table); | 245 | handler(table); |
238 | return 1; | ||
239 | } else | ||
240 | return 0; | 246 | return 0; |
247 | } else | ||
248 | return 1; | ||
241 | } | 249 | } |
242 | 250 | ||
243 | /* | 251 | /* |
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index 807978d5381a..417ef5fa7666 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c | |||
@@ -338,9 +338,9 @@ acpi_status acpi_unload_table_id(acpi_owner_id id) | |||
338 | int i; | 338 | int i; |
339 | acpi_status status = AE_NOT_EXIST; | 339 | acpi_status status = AE_NOT_EXIST; |
340 | 340 | ||
341 | ACPI_FUNCTION_TRACE(acpi_unload_table); | 341 | ACPI_FUNCTION_TRACE(acpi_unload_table_id); |
342 | 342 | ||
343 | /* Find table from the requested type list */ | 343 | /* Find table in the global table list */ |
344 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 344 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { |
345 | if (id != acpi_gbl_root_table_list.tables[i].owner_id) { | 345 | if (id != acpi_gbl_root_table_list.tables[i].owner_id) { |
346 | continue; | 346 | continue; |
@@ -352,8 +352,9 @@ acpi_status acpi_unload_table_id(acpi_owner_id id) | |||
352 | * simply a position within the hierarchy | 352 | * simply a position within the hierarchy |
353 | */ | 353 | */ |
354 | acpi_tb_delete_namespace_by_owner(i); | 354 | acpi_tb_delete_namespace_by_owner(i); |
355 | acpi_tb_release_owner_id(i); | 355 | status = acpi_tb_release_owner_id(i); |
356 | acpi_tb_set_table_loaded_flag(i, FALSE); | 356 | acpi_tb_set_table_loaded_flag(i, FALSE); |
357 | break; | ||
357 | } | 358 | } |
358 | return_ACPI_STATUS(status); | 359 | return_ACPI_STATUS(status); |
359 | } | 360 | } |
@@ -408,7 +409,7 @@ acpi_get_table(char *signature, | |||
408 | } | 409 | } |
409 | 410 | ||
410 | if (!acpi_gbl_permanent_mmap) { | 411 | if (!acpi_gbl_permanent_mmap) { |
411 | acpi_gbl_root_table_list.tables[i].pointer = 0; | 412 | acpi_gbl_root_table_list.tables[i].pointer = NULL; |
412 | } | 413 | } |
413 | 414 | ||
414 | return (status); | 415 | return (status); |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index f76d3168c2b2..15022bc86336 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -36,7 +36,8 @@ | |||
36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
37 | #include <linux/types.h> | 37 | #include <linux/types.h> |
38 | #include <linux/proc_fs.h> | 38 | #include <linux/proc_fs.h> |
39 | #include <linux/sched.h> | 39 | #include <linux/timer.h> |
40 | #include <linux/jiffies.h> | ||
40 | #include <linux/kmod.h> | 41 | #include <linux/kmod.h> |
41 | #include <linux/seq_file.h> | 42 | #include <linux/seq_file.h> |
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
@@ -46,7 +47,6 @@ | |||
46 | 47 | ||
47 | #define ACPI_THERMAL_COMPONENT 0x04000000 | 48 | #define ACPI_THERMAL_COMPONENT 0x04000000 |
48 | #define ACPI_THERMAL_CLASS "thermal_zone" | 49 | #define ACPI_THERMAL_CLASS "thermal_zone" |
49 | #define ACPI_THERMAL_DRIVER_NAME "ACPI Thermal Zone Driver" | ||
50 | #define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" | 50 | #define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" |
51 | #define ACPI_THERMAL_FILE_STATE "state" | 51 | #define ACPI_THERMAL_FILE_STATE "state" |
52 | #define ACPI_THERMAL_FILE_TEMPERATURE "temperature" | 52 | #define ACPI_THERMAL_FILE_TEMPERATURE "temperature" |
@@ -70,10 +70,10 @@ | |||
70 | #define CELSIUS_TO_KELVIN(t) ((t+273)*10) | 70 | #define CELSIUS_TO_KELVIN(t) ((t+273)*10) |
71 | 71 | ||
72 | #define _COMPONENT ACPI_THERMAL_COMPONENT | 72 | #define _COMPONENT ACPI_THERMAL_COMPONENT |
73 | ACPI_MODULE_NAME("acpi_thermal") | 73 | ACPI_MODULE_NAME("thermal"); |
74 | 74 | ||
75 | MODULE_AUTHOR("Paul Diefenbaugh"); | 75 | MODULE_AUTHOR("Paul Diefenbaugh"); |
76 | MODULE_DESCRIPTION(ACPI_THERMAL_DRIVER_NAME); | 76 | MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); |
77 | MODULE_LICENSE("GPL"); | 77 | MODULE_LICENSE("GPL"); |
78 | 78 | ||
79 | static int tzp; | 79 | static int tzp; |
@@ -98,7 +98,7 @@ static ssize_t acpi_thermal_write_polling(struct file *, const char __user *, | |||
98 | size_t, loff_t *); | 98 | size_t, loff_t *); |
99 | 99 | ||
100 | static struct acpi_driver acpi_thermal_driver = { | 100 | static struct acpi_driver acpi_thermal_driver = { |
101 | .name = ACPI_THERMAL_DRIVER_NAME, | 101 | .name = "thermal", |
102 | .class = ACPI_THERMAL_CLASS, | 102 | .class = ACPI_THERMAL_CLASS, |
103 | .ids = ACPI_THERMAL_HID, | 103 | .ids = ACPI_THERMAL_HID, |
104 | .ops = { | 104 | .ops = { |
@@ -269,7 +269,7 @@ static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds) | |||
269 | 269 | ||
270 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 270 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
271 | "Polling frequency set to %lu seconds\n", | 271 | "Polling frequency set to %lu seconds\n", |
272 | tz->polling_frequency)); | 272 | tz->polling_frequency/10)); |
273 | 273 | ||
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 56ec5503a124..faf8a5232d8e 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c | |||
@@ -125,7 +125,7 @@ static int write_acpi_int(const char *methodName, int val) | |||
125 | union acpi_object in_objs[1]; | 125 | union acpi_object in_objs[1]; |
126 | acpi_status status; | 126 | acpi_status status; |
127 | 127 | ||
128 | params.count = sizeof(in_objs) / sizeof(in_objs[0]); | 128 | params.count = ARRAY_SIZE(in_objs); |
129 | params.pointer = in_objs; | 129 | params.pointer = in_objs; |
130 | in_objs[0].type = ACPI_TYPE_INTEGER; | 130 | in_objs[0].type = ACPI_TYPE_INTEGER; |
131 | in_objs[0].integer.value = val; | 131 | in_objs[0].integer.value = val; |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 68a809fa7b19..34f157571080 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <acpi/acpi_drivers.h> | 31 | #include <acpi/acpi_drivers.h> |
32 | 32 | ||
33 | #define _COMPONENT ACPI_BUS_COMPONENT | 33 | #define _COMPONENT ACPI_BUS_COMPONENT |
34 | ACPI_MODULE_NAME("acpi_utils") | 34 | ACPI_MODULE_NAME("utils"); |
35 | 35 | ||
36 | /* -------------------------------------------------------------------------- | 36 | /* -------------------------------------------------------------------------- |
37 | Object Evaluation Helpers | 37 | Object Evaluation Helpers |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index e0b97add8c63..bf525cca3b63 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -40,7 +40,6 @@ | |||
40 | 40 | ||
41 | #define ACPI_VIDEO_COMPONENT 0x08000000 | 41 | #define ACPI_VIDEO_COMPONENT 0x08000000 |
42 | #define ACPI_VIDEO_CLASS "video" | 42 | #define ACPI_VIDEO_CLASS "video" |
43 | #define ACPI_VIDEO_DRIVER_NAME "ACPI Video Driver" | ||
44 | #define ACPI_VIDEO_BUS_NAME "Video Bus" | 43 | #define ACPI_VIDEO_BUS_NAME "Video Bus" |
45 | #define ACPI_VIDEO_DEVICE_NAME "Video Device" | 44 | #define ACPI_VIDEO_DEVICE_NAME "Video Device" |
46 | #define ACPI_VIDEO_NOTIFY_SWITCH 0x80 | 45 | #define ACPI_VIDEO_NOTIFY_SWITCH 0x80 |
@@ -65,17 +64,17 @@ | |||
65 | #define ACPI_VIDEO_DISPLAY_LCD 4 | 64 | #define ACPI_VIDEO_DISPLAY_LCD 4 |
66 | 65 | ||
67 | #define _COMPONENT ACPI_VIDEO_COMPONENT | 66 | #define _COMPONENT ACPI_VIDEO_COMPONENT |
68 | ACPI_MODULE_NAME("acpi_video") | 67 | ACPI_MODULE_NAME("video"); |
69 | 68 | ||
70 | MODULE_AUTHOR("Bruno Ducrot"); | 69 | MODULE_AUTHOR("Bruno Ducrot"); |
71 | MODULE_DESCRIPTION(ACPI_VIDEO_DRIVER_NAME); | 70 | MODULE_DESCRIPTION("ACPI Video Driver"); |
72 | MODULE_LICENSE("GPL"); | 71 | MODULE_LICENSE("GPL"); |
73 | 72 | ||
74 | static int acpi_video_bus_add(struct acpi_device *device); | 73 | static int acpi_video_bus_add(struct acpi_device *device); |
75 | static int acpi_video_bus_remove(struct acpi_device *device, int type); | 74 | static int acpi_video_bus_remove(struct acpi_device *device, int type); |
76 | 75 | ||
77 | static struct acpi_driver acpi_video_bus = { | 76 | static struct acpi_driver acpi_video_bus = { |
78 | .name = ACPI_VIDEO_DRIVER_NAME, | 77 | .name = "video", |
79 | .class = ACPI_VIDEO_CLASS, | 78 | .class = ACPI_VIDEO_CLASS, |
80 | .ids = ACPI_VIDEO_HID, | 79 | .ids = ACPI_VIDEO_HID, |
81 | .ops = { | 80 | .ops = { |