* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: pnpacpi: print resource shortage message only once PM: ACPI and APM must not be enabled at the same time ACPI: apply quirk_ich6_lpc_acpi to more ICH8 and ICH9 ACPICA: fix acpi_serialize hang regression ACPI : Not register gsi for PCI IDE controller in legacy mode ACPI: Reintroduce run time configurable max_cstate for !CPU_IDLE case ACPI: Make sysfs interface in ACPI power optional. ACPI: EC: Enable boot EC before bus_scan increase PNP_MAX_PORT to 40 from 24
Unified · Split
| @@ -2256,14 +2256,12 @@ static int __init apm_init(void) · 2255 unmodified lines | ||
| 2256 | 2256 | apm_info.disabled = 1; |
| 2257 | 2257 | return -ENODEV; |
| 2258 | 2258 | } |
| 2259 | − if (PM_IS_ACTIVE()) { | |
| 2259 | + if (pm_flags & PM_ACPI) { | |
| 2260 | 2260 | printk(KERN_NOTICE "apm: overridden by ACPI.\n"); |
| 2261 | 2261 | apm_info.disabled = 1; |
| 2262 | 2262 | return -ENODEV; |
| 2263 | 2263 | } |
| 2264 | −#ifdef CONFIG_PM_LEGACY | |
| 2265 | − pm_active = 1; | |
| 2266 | −#endif | |
| 2264 | + pm_flags |= PM_APM; | |
| 2267 | 2265 | |
| 2268 | 2266 | /* |
| 2269 | 2267 | * Set up a segment that references the real mode segment 0x40 |
| @@ -2366,9 +2364,7 @@ static void __exit apm_exit(void) · 96 unmodified lines | ||
| 2366 | 2364 | kthread_stop(kapmd_task); |
| 2367 | 2365 | kapmd_task = NULL; |
| 2368 | 2366 | } |
| 2369 | −#ifdef CONFIG_PM_LEGACY | |
| 2370 | − pm_active = 0; | |
| 2371 | −#endif | |
| 2367 | + pm_flags &= ~PM_APM; | |
| 2372 | 2368 | } |
| 2373 | 2369 | |
| 2374 | 2370 | module_init(apm_init); |
| @@ -82,6 +82,12 @@ config ACPI_PROCFS_POWER · 81 unmodified lines | ||
| 82 | 82 | and functions, which do not yet exist in /sys |
| 83 | 83 | |
| 84 | 84 | Say N to delete power /proc/acpi/ folders that have moved to /sys/ |
| 85 | +config ACPI_SYSFS_POWER | |
| 86 | + bool "Future power /sys interface" | |
| 87 | + select POWER_SUPPLY | |
| 88 | + default y | |
| 89 | + ---help--- | |
| 90 | + Say N to disable power /sys interface | |
| 85 | 91 | config ACPI_PROC_EVENT |
| 86 | 92 | bool "Deprecated /proc/acpi/event support" |
| 87 | 93 | depends on PROC_FS |
| @@ -103,7 +109,6 @@ config ACPI_PROC_EVENT · 15 unmodified lines | ||
| 103 | 109 | config ACPI_AC |
| 104 | 110 | tristate "AC Adapter" |
| 105 | 111 | depends on X86 |
| 106 | − select POWER_SUPPLY | |
| 107 | 112 | default y |
| 108 | 113 | help |
| 109 | 114 | This driver adds support for the AC Adapter object, which indicates |
| @@ -113,7 +118,6 @@ config ACPI_AC · 3 unmodified lines | ||
| 113 | 118 | config ACPI_BATTERY |
| 114 | 119 | tristate "Battery" |
| 115 | 120 | depends on X86 |
| 116 | − select POWER_SUPPLY | |
| 117 | 121 | default y |
| 118 | 122 | help |
| 119 | 123 | This driver adds support for battery information through |
| @@ -368,7 +372,6 @@ config ACPI_HOTPLUG_MEMORY · 248 unmodified lines | ||
| 368 | 372 | config ACPI_SBS |
| 369 | 373 | tristate "Smart Battery System" |
| 370 | 374 | depends on X86 |
| 371 | − select POWER_SUPPLY | |
| 372 | 375 | help |
| 373 | 376 | This driver adds support for the Smart Battery System, another |
| 374 | 377 | type of access to battery information, found on some laptops. |
| @@ -31,7 +31,9 @@ · 30 unmodified lines | ||
| 31 | 31 | #include <linux/proc_fs.h> |
| 32 | 32 | #include <linux/seq_file.h> |
| 33 | 33 | #endif |
| 34 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 34 | 35 | #include <linux/power_supply.h> |
| 36 | +#endif | |
| 35 | 37 | #include <acpi/acpi_bus.h> |
| 36 | 38 | #include <acpi/acpi_drivers.h> |
| 37 | 39 | |
| @@ -79,7 +81,9 @@ static struct acpi_driver acpi_ac_driver = { · 41 unmodified lines | ||
| 79 | 81 | }; |
| 80 | 82 | |
| 81 | 83 | struct acpi_ac { |
| 84 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 82 | 85 | struct power_supply charger; |
| 86 | +#endif | |
| 83 | 87 | struct acpi_device * device; |
| 84 | 88 | unsigned long state; |
| 85 | 89 | }; |
| @@ -94,7 +98,7 @@ static const struct file_operations acpi_ac_fops = { · 8 unmodified lines | ||
| 94 | 98 | .release = single_release, |
| 95 | 99 | }; |
| 96 | 100 | #endif |
| 97 | − | |
| 101 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 98 | 102 | static int get_ac_property(struct power_supply *psy, |
| 99 | 103 | enum power_supply_property psp, |
| 100 | 104 | union power_supply_propval *val) |
| @@ -113,7 +117,7 @@ static int get_ac_property(struct power_supply *psy, · 12 unmodified lines | ||
| 113 | 117 | static enum power_supply_property ac_props[] = { |
| 114 | 118 | POWER_SUPPLY_PROP_ONLINE, |
| 115 | 119 | }; |
| 116 | − | |
| 120 | +#endif | |
| 117 | 121 | /* -------------------------------------------------------------------------- |
| 118 | 122 | AC Adapter Management |
| 119 | 123 | -------------------------------------------------------------------------- */ |
| @@ -241,7 +245,9 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) · 121 unmodified lines | ||
| 241 | 245 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
| 242 | 246 | device->dev.bus_id, event, |
| 243 | 247 | (u32) ac->state); |
| 248 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 244 | 249 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
| 250 | +#endif | |
| 245 | 251 | break; |
| 246 | 252 | default: |
| 247 | 253 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| @@ -280,12 +286,14 @@ static int acpi_ac_add(struct acpi_device *device) · 32 unmodified lines | ||
| 280 | 286 | #endif |
| 281 | 287 | if (result) |
| 282 | 288 | goto end; |
| 289 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 283 | 290 | ac->charger.name = acpi_device_bid(device); |
| 284 | 291 | ac->charger.type = POWER_SUPPLY_TYPE_MAINS; |
| 285 | 292 | ac->charger.properties = ac_props; |
| 286 | 293 | ac->charger.num_properties = ARRAY_SIZE(ac_props); |
| 287 | 294 | ac->charger.get_property = get_ac_property; |
| 288 | 295 | power_supply_register(&ac->device->dev, &ac->charger); |
| 296 | +#endif | |
| 289 | 297 | status = acpi_install_notify_handler(device->handle, |
| 290 | 298 | ACPI_ALL_NOTIFY, acpi_ac_notify, |
| 291 | 299 | ac); |
| @@ -319,8 +327,10 @@ static int acpi_ac_resume(struct acpi_device *device) · 27 unmodified lines | ||
| 319 | 327 | old_state = ac->state; |
| 320 | 328 | if (acpi_ac_get_state(ac)) |
| 321 | 329 | return 0; |
| 330 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 322 | 331 | if (old_state != ac->state) |
| 323 | 332 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
| 333 | +#endif | |
| 324 | 334 | return 0; |
| 325 | 335 | } |
| 326 | 336 | |
| @@ -337,8 +347,10 @@ static int acpi_ac_remove(struct acpi_device *device, int type) · 10 unmodified lines | ||
| 337 | 347 | |
| 338 | 348 | status = acpi_remove_notify_handler(device->handle, |
| 339 | 349 | ACPI_ALL_NOTIFY, acpi_ac_notify); |
| 350 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 340 | 351 | if (ac->charger.dev) |
| 341 | 352 | power_supply_unregister(&ac->charger); |
| 353 | +#endif | |
| 342 | 354 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 343 | 355 | acpi_ac_remove_fs(device); |
| 344 | 356 | #endif |
| @@ -40,7 +40,9 @@ · 39 unmodified lines | ||
| 40 | 40 | #include <acpi/acpi_bus.h> |
| 41 | 41 | #include <acpi/acpi_drivers.h> |
| 42 | 42 | |
| 43 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 43 | 44 | #include <linux/power_supply.h> |
| 45 | +#endif | |
| 44 | 46 | |
| 45 | 47 | #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF |
| 46 | 48 | |
| @@ -86,7 +88,9 @@ MODULE_DEVICE_TABLE(acpi, battery_device_ids); · 39 unmodified lines | ||
| 86 | 88 | |
| 87 | 89 | struct acpi_battery { |
| 88 | 90 | struct mutex lock; |
| 91 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 89 | 92 | struct power_supply bat; |
| 93 | +#endif | |
| 90 | 94 | struct acpi_device *device; |
| 91 | 95 | unsigned long update_time; |
| 92 | 96 | int current_now; |
| @@ -117,6 +121,7 @@ inline int acpi_battery_present(struct acpi_battery *battery) · 24 unmodified lines | ||
| 117 | 121 | return battery->device->status.battery_present; |
| 118 | 122 | } |
| 119 | 123 | |
| 124 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 120 | 125 | static int acpi_battery_technology(struct acpi_battery *battery) |
| 121 | 126 | { |
| 122 | 127 | if (!strcasecmp("NiCd", battery->type)) |
| @@ -222,6 +227,7 @@ static enum power_supply_property energy_battery_props[] = { · 99 unmodified lines | ||
| 222 | 227 | POWER_SUPPLY_PROP_MODEL_NAME, |
| 223 | 228 | POWER_SUPPLY_PROP_MANUFACTURER, |
| 224 | 229 | }; |
| 230 | +#endif | |
| 225 | 231 | |
| 226 | 232 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 227 | 233 | inline char *acpi_battery_units(struct acpi_battery *battery) |
| @@ -398,6 +404,7 @@ static int acpi_battery_init_alarm(struct acpi_battery *battery) · 170 unmodified lines | ||
| 398 | 404 | return acpi_battery_set_alarm(battery); |
| 399 | 405 | } |
| 400 | 406 | |
| 407 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 401 | 408 | static ssize_t acpi_battery_alarm_show(struct device *dev, |
| 402 | 409 | struct device_attribute *attr, |
| 403 | 410 | char *buf) |
| @@ -429,11 +436,6 @@ static int sysfs_add_battery(struct acpi_battery *battery) · 25 unmodified lines | ||
| 429 | 436 | { |
| 430 | 437 | int result; |
| 431 | 438 | |
| 432 | − battery->update_time = 0; | |
| 433 | − result = acpi_battery_get_info(battery); | |
| 434 | − acpi_battery_init_alarm(battery); | |
| 435 | − if (result) | |
| 436 | − return result; | |
| 437 | 439 | if (battery->power_unit) { |
| 438 | 440 | battery->bat.properties = charge_battery_props; |
| 439 | 441 | battery->bat.num_properties = |
| @@ -462,18 +464,31 @@ static void sysfs_remove_battery(struct acpi_battery *battery) · 22 unmodified lines | ||
| 462 | 464 | power_supply_unregister(&battery->bat); |
| 463 | 465 | battery->bat.dev = NULL; |
| 464 | 466 | } |
| 467 | +#endif | |
| 465 | 468 | |
| 466 | 469 | static int acpi_battery_update(struct acpi_battery *battery) |
| 467 | 470 | { |
| 468 | − int result = acpi_battery_get_status(battery); | |
| 471 | + int result; | |
| 472 | + result = acpi_battery_get_status(battery); | |
| 469 | 473 | if (result) |
| 470 | 474 | return result; |
| 475 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 471 | 476 | if (!acpi_battery_present(battery)) { |
| 472 | 477 | sysfs_remove_battery(battery); |
| 478 | + battery->update_time = 0; | |
| 473 | 479 | return 0; |
| 474 | 480 | } |
| 481 | +#endif | |
| 482 | + if (!battery->update_time) { | |
| 483 | + result = acpi_battery_get_info(battery); | |
| 484 | + if (result) | |
| 485 | + return result; | |
| 486 | + acpi_battery_init_alarm(battery); | |
| 487 | + } | |
| 488 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 475 | 489 | if (!battery->bat.dev) |
| 476 | 490 | sysfs_add_battery(battery); |
| 491 | +#endif | |
| 477 | 492 | return acpi_battery_get_state(battery); |
| 478 | 493 | } |
| 479 | 494 | |
| @@ -767,9 +782,11 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) · 287 unmodified lines | ||
| 767 | 782 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
| 768 | 783 | device->dev.bus_id, event, |
| 769 | 784 | acpi_battery_present(battery)); |
| 785 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 770 | 786 | /* acpi_batter_update could remove power_supply object */ |
| 771 | 787 | if (battery->bat.dev) |
| 772 | 788 | kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE); |
| 789 | +#endif | |
| 773 | 790 | } |
| 774 | 791 | |
| 775 | 792 | static int acpi_battery_add(struct acpi_device *device) |
| @@ -828,7 +845,9 @@ static int acpi_battery_remove(struct acpi_device *device, int type) · 52 unmodified lines | ||
| 828 | 845 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 829 | 846 | acpi_battery_remove_fs(device); |
| 830 | 847 | #endif |
| 848 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 831 | 849 | sysfs_remove_battery(battery); |
| 850 | +#endif | |
| 832 | 851 | mutex_destroy(&battery->lock); |
| 833 | 852 | kfree(battery); |
| 834 | 853 | return 0; |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <linux/list.h> |
| 30 | 30 | #include <linux/sched.h> |
| 31 | 31 | #include <linux/pm.h> |
| 32 | −#include <linux/pm_legacy.h> | |
| 33 | 32 | #include <linux/device.h> |
| 34 | 33 | #include <linux/proc_fs.h> |
| 35 | 34 | #ifdef CONFIG_X86 |
| @@ -764,16 +763,14 @@ static int __init acpi_init(void) · 728 unmodified lines | ||
| 764 | 763 | result = acpi_bus_init(); |
| 765 | 764 | |
| 766 | 765 | if (!result) { |
| 767 | −#ifdef CONFIG_PM_LEGACY | |
| 768 | − if (!PM_IS_ACTIVE()) | |
| 769 | − pm_active = 1; | |
| 766 | + if (!(pm_flags & PM_APM)) | |
| 767 | + pm_flags |= PM_ACPI; | |
| 770 | 768 | else { |
| 771 | 769 | printk(KERN_INFO PREFIX |
| 772 | 770 | "APM is already active, exiting\n"); |
| 773 | 771 | disable_acpi(); |
| 774 | 772 | result = -ENODEV; |
| 775 | 773 | } |
| 776 | −#endif | |
| 777 | 774 | } else |
| 778 | 775 | disable_acpi(); |
| 779 | 776 | |
| @@ -892,6 +892,17 @@ static int acpi_ec_stop(struct acpi_device *device, int type) · 891 unmodified lines | ||
| 892 | 892 | return 0; |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | +int __init acpi_boot_ec_enable(void) | |
| 896 | +{ | |
| 897 | + if (!boot_ec || boot_ec->handlers_installed) | |
| 898 | + return 0; | |
| 899 | + if (!ec_install_handlers(boot_ec)) { | |
| 900 | + first_ec = boot_ec; | |
| 901 | + return 0; | |
| 902 | + } | |
| 903 | + return -EFAULT; | |
| 904 | +} | |
| 905 | + | |
| 895 | 906 | int __init acpi_ec_ecdt_probe(void) |
| 896 | 907 | { |
| 897 | 908 | int ret; |
| @@ -924,9 +935,10 @@ int __init acpi_ec_ecdt_probe(void) · 26 unmodified lines | ||
| 924 | 935 | goto error; |
| 925 | 936 | /* We really need to limit this workaround, the only ASUS, |
| 926 | 937 | * which needs it, has fake EC._INI method, so use it as flag. |
| 938 | + * Keep boot_ec struct as it will be needed soon. | |
| 927 | 939 | */ |
| 928 | 940 | if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x))) |
| 929 | − goto error; | |
| 941 | + return -ENODEV; | |
| 930 | 942 | } |
| 931 | 943 | |
| 932 | 944 | ret = ec_install_handlers(boot_ec); |
| @@ -344,7 +344,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 343 unmodified lines | ||
| 344 | 344 | * setup will potentially execute control methods |
| 345 | 345 | * (e.g., _REG method for this region) |
| 346 | 346 | */ |
| 347 | − acpi_ex_relinquish_interpreter(); | |
| 347 | + acpi_ex_exit_interpreter(); | |
| 348 | 348 | |
| 349 | 349 | status = region_setup(region_obj, ACPI_REGION_ACTIVATE, |
| 350 | 350 | handler_desc->address_space.context, |
| @@ -352,7 +352,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 1 unmodified line | ||
| 352 | 352 | |
| 353 | 353 | /* Re-enter the interpreter */ |
| 354 | 354 | |
| 355 | − acpi_ex_reacquire_interpreter(); | |
| 355 | + acpi_ex_enter_interpreter(); | |
| 356 | 356 | |
| 357 | 357 | /* Check for failure of the Region Setup */ |
| 358 | 358 | |
| @@ -405,7 +405,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 46 unmodified lines | ||
| 405 | 405 | * exit the interpreter because the handler *might* block -- we don't |
| 406 | 406 | * know what it will do, so we can't hold the lock on the intepreter. |
| 407 | 407 | */ |
| 408 | − acpi_ex_relinquish_interpreter(); | |
| 408 | + acpi_ex_exit_interpreter(); | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /* Call the handler */ |
| @@ -426,7 +426,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 14 unmodified lines | ||
| 426 | 426 | * We just returned from a non-default handler, we must re-enter the |
| 427 | 427 | * interpreter |
| 428 | 428 | */ |
| 429 | − acpi_ex_reacquire_interpreter(); | |
| 429 | + acpi_ex_enter_interpreter(); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | return_ACPI_STATUS(status); |
| @@ -429,6 +429,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev) · 428 unmodified lines | ||
| 429 | 429 | &polarity, &link, |
| 430 | 430 | acpi_pci_allocate_irq); |
| 431 | 431 | |
| 432 | + if (irq < 0) { | |
| 433 | + /* | |
| 434 | + * IDE legacy mode controller IRQs are magic. Why do compat | |
| 435 | + * extensions always make such a nasty mess. | |
| 436 | + */ | |
| 437 | + if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE && | |
| 438 | + (dev->class & 0x05) == 0) | |
| 439 | + return 0; | |
| 440 | + } | |
| 432 | 441 | /* |
| 433 | 442 | * No IRQ known to the ACPI subsystem - maybe the BIOS / |
| 434 | 443 | * driver reported one, then use it. Exit in any case. |
| @@ -76,7 +76,11 @@ static void (*pm_idle_save) (void) __read_mostly; · 75 unmodified lines | ||
| 76 | 76 | #define PM_TIMER_TICKS_TO_US(p) (((p) * 1000)/(PM_TIMER_FREQUENCY/1000)) |
| 77 | 77 | |
| 78 | 78 | static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; |
| 79 | +#ifdef CONFIG_CPU_IDLE | |
| 79 | 80 | module_param(max_cstate, uint, 0000); |
| 81 | +#else | |
| 82 | +module_param(max_cstate, uint, 0644); | |
| 83 | +#endif | |
| 80 | 84 | static unsigned int nocst __read_mostly; |
| 81 | 85 | module_param(nocst, uint, 0000); |
| 82 | 86 | |
| @@ -40,7 +40,9 @@ · 39 unmodified lines | ||
| 40 | 40 | #include <linux/jiffies.h> |
| 41 | 41 | #include <linux/delay.h> |
| 42 | 42 | |
| 43 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 43 | 44 | #include <linux/power_supply.h> |
| 45 | +#endif | |
| 44 | 46 | |
| 45 | 47 | #include "sbshc.h" |
| 46 | 48 | |
| @@ -80,7 +82,9 @@ static const struct acpi_device_id sbs_device_ids[] = { · 33 unmodified lines | ||
| 80 | 82 | MODULE_DEVICE_TABLE(acpi, sbs_device_ids); |
| 81 | 83 | |
| 82 | 84 | struct acpi_battery { |
| 85 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 83 | 86 | struct power_supply bat; |
| 87 | +#endif | |
| 84 | 88 | struct acpi_sbs *sbs; |
| 85 | 89 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 86 | 90 | struct proc_dir_entry *proc_entry; |
| @@ -113,7 +117,9 @@ struct acpi_battery { · 26 unmodified lines | ||
| 113 | 117 | #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat); |
| 114 | 118 | |
| 115 | 119 | struct acpi_sbs { |
| 120 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 116 | 121 | struct power_supply charger; |
| 122 | +#endif | |
| 117 | 123 | struct acpi_device *device; |
| 118 | 124 | struct acpi_smb_hc *hc; |
| 119 | 125 | struct mutex lock; |
| @@ -157,6 +163,7 @@ static inline int acpi_battery_scale(struct acpi_battery *battery) · 37 unmodified lines | ||
| 157 | 163 | acpi_battery_ipscale(battery); |
| 158 | 164 | } |
| 159 | 165 | |
| 166 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 160 | 167 | static int sbs_get_ac_property(struct power_supply *psy, |
| 161 | 168 | enum power_supply_property psp, |
| 162 | 169 | union power_supply_propval *val) |
| @@ -294,6 +301,7 @@ static enum power_supply_property sbs_energy_battery_props[] = { · 131 unmodified lines | ||
| 294 | 301 | POWER_SUPPLY_PROP_MODEL_NAME, |
| 295 | 302 | POWER_SUPPLY_PROP_MANUFACTURER, |
| 296 | 303 | }; |
| 304 | +#endif | |
| 297 | 305 | |
| 298 | 306 | /* -------------------------------------------------------------------------- |
| 299 | 307 | Smart Battery System Management |
| @@ -429,6 +437,7 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs) · 129 unmodified lines | ||
| 429 | 437 | return result; |
| 430 | 438 | } |
| 431 | 439 | |
| 440 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 432 | 441 | static ssize_t acpi_battery_alarm_show(struct device *dev, |
| 433 | 442 | struct device_attribute *attr, |
| 434 | 443 | char *buf) |
| @@ -458,6 +467,7 @@ static struct device_attribute alarm_attr = { · 23 unmodified lines | ||
| 458 | 467 | .show = acpi_battery_alarm_show, |
| 459 | 468 | .store = acpi_battery_alarm_store, |
| 460 | 469 | }; |
| 470 | +#endif | |
| 461 | 471 | |
| 462 | 472 | /* -------------------------------------------------------------------------- |
| 463 | 473 | FS Interface (/proc/acpi) |
| @@ -793,6 +803,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id) · 329 unmodified lines | ||
| 793 | 803 | &acpi_battery_state_fops, &acpi_battery_alarm_fops, |
| 794 | 804 | battery); |
| 795 | 805 | #endif |
| 806 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 796 | 807 | battery->bat.name = battery->name; |
| 797 | 808 | battery->bat.type = POWER_SUPPLY_TYPE_BATTERY; |
| 798 | 809 | if (!acpi_battery_mode(battery)) { |
| @@ -813,6 +824,7 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id) · 14 unmodified lines | ||
| 813 | 824 | goto end; |
| 814 | 825 | battery->have_sysfs_alarm = 1; |
| 815 | 826 | end: |
| 827 | +#endif | |
| 816 | 828 | printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n", |
| 817 | 829 | ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device), |
| 818 | 830 | battery->name, sbs->battery->present ? "present" : "absent"); |
| @@ -822,12 +834,13 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id) · 3 unmodified lines | ||
| 822 | 834 | static void acpi_battery_remove(struct acpi_sbs *sbs, int id) |
| 823 | 835 | { |
| 824 | 836 | struct acpi_battery *battery = &sbs->battery[id]; |
| 825 | − | |
| 837 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 826 | 838 | if (battery->bat.dev) { |
| 827 | 839 | if (battery->have_sysfs_alarm) |
| 828 | 840 | device_remove_file(battery->bat.dev, &alarm_attr); |
| 829 | 841 | power_supply_unregister(&battery->bat); |
| 830 | 842 | } |
| 843 | +#endif | |
| 831 | 844 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 832 | 845 | if (battery->proc_entry) |
| 833 | 846 | acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); |
| @@ -848,12 +861,14 @@ static int acpi_charger_add(struct acpi_sbs *sbs) · 14 unmodified lines | ||
| 848 | 861 | if (result) |
| 849 | 862 | goto end; |
| 850 | 863 | #endif |
| 864 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 851 | 865 | sbs->charger.name = "sbs-charger"; |
| 852 | 866 | sbs->charger.type = POWER_SUPPLY_TYPE_MAINS; |
| 853 | 867 | sbs->charger.properties = sbs_ac_props; |
| 854 | 868 | sbs->charger.num_properties = ARRAY_SIZE(sbs_ac_props); |
| 855 | 869 | sbs->charger.get_property = sbs_get_ac_property; |
| 856 | 870 | power_supply_register(&sbs->device->dev, &sbs->charger); |
| 871 | +#endif | |
| 857 | 872 | printk(KERN_INFO PREFIX "%s [%s]: AC Adapter [%s] (%s)\n", |
| 858 | 873 | ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device), |
| 859 | 874 | ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line"); |
| @@ -863,8 +878,10 @@ static int acpi_charger_add(struct acpi_sbs *sbs) · 3 unmodified lines | ||
| 863 | 878 | |
| 864 | 879 | static void acpi_charger_remove(struct acpi_sbs *sbs) |
| 865 | 880 | { |
| 881 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 866 | 882 | if (sbs->charger.dev) |
| 867 | 883 | power_supply_unregister(&sbs->charger); |
| 884 | +#endif | |
| 868 | 885 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 869 | 886 | if (sbs->charger_entry) |
| 870 | 887 | acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); |
| @@ -885,7 +902,9 @@ void acpi_sbs_callback(void *context) · 14 unmodified lines | ||
| 885 | 902 | ACPI_SBS_NOTIFY_STATUS, |
| 886 | 903 | sbs->charger_present); |
| 887 | 904 | #endif |
| 905 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 888 | 906 | kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE); |
| 907 | +#endif | |
| 889 | 908 | } |
| 890 | 909 | if (sbs->manager_present) { |
| 891 | 910 | for (id = 0; id < MAX_SBS_BAT; ++id) { |
| @@ -902,7 +921,9 @@ void acpi_sbs_callback(void *context) · 10 unmodified lines | ||
| 902 | 921 | ACPI_SBS_NOTIFY_STATUS, |
| 903 | 922 | bat->present); |
| 904 | 923 | #endif |
| 924 | +#ifdef CONFIG_ACPI_SYSFS_POWER | |
| 905 | 925 | kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE); |
| 926 | +#endif | |
| 906 | 927 | } |
| 907 | 928 | } |
| 908 | 929 | } |
| @@ -1449,6 +1449,8 @@ static int acpi_bus_scan_fixed(struct acpi_device *root) · 1448 unmodified lines | ||
| 1449 | 1449 | return result; |
| 1450 | 1450 | } |
| 1451 | 1451 | |
| 1452 | +int __init acpi_boot_ec_enable(void); | |
| 1453 | + | |
| 1452 | 1454 | static int __init acpi_scan_init(void) |
| 1453 | 1455 | { |
| 1454 | 1456 | int result; |
| @@ -1480,6 +1482,10 @@ static int __init acpi_scan_init(void) · 25 unmodified lines | ||
| 1480 | 1482 | * Enumerate devices in the ACPI namespace. |
| 1481 | 1483 | */ |
| 1482 | 1484 | result = acpi_bus_scan_fixed(acpi_root); |
| 1485 | + | |
| 1486 | + /* EC region might be needed at bus_scan, so enable it now */ | |
| 1487 | + acpi_boot_ec_enable(); | |
| 1488 | + | |
| 1483 | 1489 | if (!result) |
| 1484 | 1490 | result = acpi_bus_scan(acpi_root, &ops); |
| 1485 | 1491 | |
| @@ -465,6 +465,12 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk · 464 unmodified lines | ||
| 465 | 465 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich6_lpc_acpi ); |
| 466 | 466 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich6_lpc_acpi ); |
| 467 | 467 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich6_lpc_acpi ); |
| 468 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich6_lpc_acpi ); | |
| 469 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich6_lpc_acpi ); | |
| 470 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich6_lpc_acpi ); | |
| 471 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich6_lpc_acpi ); | |
| 472 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich6_lpc_acpi ); | |
| 473 | +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich6_lpc_acpi ); | |
| 468 | 474 | |
| 469 | 475 | /* |
| 470 | 476 | * VIA ACPI: One IO region pointed to by longword at |
| @@ -76,6 +76,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, · 75 unmodified lines | ||
| 76 | 76 | int i = 0; |
| 77 | 77 | int irq; |
| 78 | 78 | int p, t; |
| 79 | + static unsigned char warned; | |
| 79 | 80 | |
| 80 | 81 | if (!valid_IRQ(gsi)) |
| 81 | 82 | return; |
| @@ -83,9 +84,10 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, · 1 unmodified line | ||
| 83 | 84 | while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) && |
| 84 | 85 | i < PNP_MAX_IRQ) |
| 85 | 86 | i++; |
| 86 | − if (i >= PNP_MAX_IRQ) { | |
| 87 | + if (i >= PNP_MAX_IRQ && !warned) { | |
| 87 | 88 | printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " |
| 88 | 89 | "resources: %d \n", PNP_MAX_IRQ); |
| 90 | + warned = 1; | |
| 89 | 91 | return; |
| 90 | 92 | } |
| 91 | 93 | /* |
| @@ -169,6 +171,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, · 77 unmodified lines | ||
| 169 | 171 | int bus_master, int transfer) |
| 170 | 172 | { |
| 171 | 173 | int i = 0; |
| 174 | + static unsigned char warned; | |
| 172 | 175 | |
| 173 | 176 | while (i < PNP_MAX_DMA && |
| 174 | 177 | !(res->dma_resource[i].flags & IORESOURCE_UNSET)) |
| @@ -183,9 +186,10 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, · 8 unmodified lines | ||
| 183 | 186 | } |
| 184 | 187 | res->dma_resource[i].start = dma; |
| 185 | 188 | res->dma_resource[i].end = dma; |
| 186 | − } else { | |
| 189 | + } else if (!warned) { | |
| 187 | 190 | printk(KERN_ERR "pnpacpi: exceeded the max number of DMA " |
| 188 | 191 | "resources: %d \n", PNP_MAX_DMA); |
| 192 | + warned = 1; | |
| 189 | 193 | } |
| 190 | 194 | } |
| 191 | 195 | |
| @@ -193,6 +197,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, · 1 unmodified line | ||
| 193 | 197 | u64 io, u64 len, int io_decode) |
| 194 | 198 | { |
| 195 | 199 | int i = 0; |
| 200 | + static unsigned char warned; | |
| 196 | 201 | |
| 197 | 202 | while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && |
| 198 | 203 | i < PNP_MAX_PORT) |
| @@ -207,7 +212,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, · 8 unmodified lines | ||
| 207 | 212 | } |
| 208 | 213 | res->port_resource[i].start = io; |
| 209 | 214 | res->port_resource[i].end = io + len - 1; |
| 210 | − } else { | |
| 215 | + } else if (!warned) { | |
| 211 | 216 | printk(KERN_ERR "pnpacpi: exceeded the max number of IO " |
| 212 | 217 | "resources: %d \n", PNP_MAX_PORT); |
| 213 | 218 | } |
| @@ -218,6 +223,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, · 4 unmodified lines | ||
| 218 | 223 | int write_protect) |
| 219 | 224 | { |
| 220 | 225 | int i = 0; |
| 226 | + static unsigned char warned; | |
| 221 | 227 | |
| 222 | 228 | while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && |
| 223 | 229 | (i < PNP_MAX_MEM)) |
| @@ -233,7 +239,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, · 9 unmodified lines | ||
| 233 | 239 | |
| 234 | 240 | res->mem_resource[i].start = mem; |
| 235 | 241 | res->mem_resource[i].end = mem + len - 1; |
| 236 | − } else { | |
| 242 | + } else if (!warned) { | |
| 237 | 243 | printk(KERN_ERR "pnpacpi: exceeded the max number of mem " |
| 238 | 244 | "resources: %d\n", PNP_MAX_MEM); |
| 239 | 245 | } |
| @@ -2322,6 +2322,8 @@ · 2321 unmodified lines | ||
| 2322 | 2322 | #define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914 |
| 2323 | 2323 | #define PCI_DEVICE_ID_INTEL_ICH9_5 0x2919 |
| 2324 | 2324 | #define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 |
| 2325 | +#define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916 | |
| 2326 | +#define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918 | |
| 2325 | 2327 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
| 2326 | 2328 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
| 2327 | 2329 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
| @@ -246,6 +246,15 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) · 245 unmodified lines | ||
| 246 | 246 | device_set_wakeup_enable(dev,val); \ |
| 247 | 247 | } while(0) |
| 248 | 248 | |
| 249 | +/* | |
| 250 | + * Global Power Management flags | |
| 251 | + * Used to keep APM and ACPI from both being active | |
| 252 | + */ | |
| 253 | +extern unsigned int pm_flags; | |
| 254 | + | |
| 255 | +#define PM_APM 1 | |
| 256 | +#define PM_ACPI 2 | |
| 257 | + | |
| 249 | 258 | #endif /* __KERNEL__ */ |
| 250 | 259 | |
| 251 | 260 | #endif /* _LINUX_PM_H */ |
| @@ -4,10 +4,6 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | #ifdef CONFIG_PM_LEGACY |
| 6 | 6 | |
| 7 | −extern int pm_active; | |
| 8 | − | |
| 9 | −#define PM_IS_ACTIVE() (pm_active != 0) | |
| 10 | − | |
| 11 | 7 | /* |
| 12 | 8 | * Register a device with power management |
| 13 | 9 | */ |
| @@ -21,8 +17,6 @@ int __deprecated pm_send_all(pm_request_t rqst, void *data); · 7 unmodified lines | ||
| 21 | 17 | |
| 22 | 18 | #else /* CONFIG_PM_LEGACY */ |
| 23 | 19 | |
| 24 | −#define PM_IS_ACTIVE() 0 | |
| 25 | − | |
| 26 | 20 | static inline struct pm_dev *pm_register(pm_dev_t type, |
| 27 | 21 | unsigned long id, |
| 28 | 22 | pm_callback callback) |
| @@ -13,7 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <linux/errno.h> |
| 14 | 14 | #include <linux/mod_devicetable.h> |
| 15 | 15 | |
| 16 | −#define PNP_MAX_PORT 24 | |
| 16 | +#define PNP_MAX_PORT 40 | |
| 17 | 17 | #define PNP_MAX_MEM 12 |
| 18 | 18 | #define PNP_MAX_IRQ 2 |
| 19 | 19 | #define PNP_MAX_DMA 2 |
| @@ -28,6 +28,9 @@ BLOCKING_NOTIFIER_HEAD(pm_chain_head); · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | DEFINE_MUTEX(pm_mutex); |
| 30 | 30 | |
| 31 | +unsigned int pm_flags; | |
| 32 | +EXPORT_SYMBOL(pm_flags); | |
| 33 | + | |
| 31 | 34 | #ifdef CONFIG_SUSPEND |
| 32 | 35 | |
| 33 | 36 | /* This is just an arbitrary number */ |
| @@ -27,8 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | #include <linux/interrupt.h> |
| 28 | 28 | #include <linux/mutex.h> |
| 29 | 29 | |
| 30 | −int pm_active; | |
| 31 | − | |
| 32 | 30 | /* |
| 33 | 31 | * Locking notes: |
| 34 | 32 | * pm_devs_lock can be a semaphore providing pm ops are not called |
| @@ -204,6 +202,4 @@ int pm_send_all(pm_request_t rqst, void *data) · 169 unmodified lines | ||
| 204 | 202 | |
| 205 | 203 | EXPORT_SYMBOL(pm_register); |
| 206 | 204 | EXPORT_SYMBOL(pm_send_all); |
| 207 | −EXPORT_SYMBOL(pm_active); | |
| 208 | − | |
| 209 | 205 | |