Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: suspend: consolidate handling of Sx states addendum
ACPI: suspend: consolidate handling of Sx states.
ACPI: video: remove dmesg spam
ACPI: video: _DOS=0 by default to prevent hotkey hang

+53 -84
+1 -1
drivers/acpi/sleep/Makefile
··· 1 - obj-y := poweroff.o wakeup.o 1 + obj-y := wakeup.o 2 2 obj-$(CONFIG_ACPI_SLEEP) += main.o 3 3 obj-$(CONFIG_ACPI_SLEEP) += proc.o 4 4
+51 -6
drivers/acpi/sleep/main.c
··· 15 15 #include <linux/dmi.h> 16 16 #include <linux/device.h> 17 17 #include <linux/suspend.h> 18 + 19 + #include <asm/io.h> 20 + 18 21 #include <acpi/acpi_bus.h> 19 22 #include <acpi/acpi_drivers.h> 20 23 #include "sleep.h" ··· 58 55 error = -ENOSYS; 59 56 } 60 57 return error; 58 + } 59 + 60 + int acpi_sleep_prepare(u32 acpi_state) 61 + { 62 + #ifdef CONFIG_ACPI_SLEEP 63 + /* do we have a wakeup address for S2 and S3? */ 64 + if (acpi_state == ACPI_STATE_S3) { 65 + if (!acpi_wakeup_address) { 66 + return -EFAULT; 67 + } 68 + acpi_set_firmware_waking_vector((acpi_physical_address) 69 + virt_to_phys((void *) 70 + acpi_wakeup_address)); 71 + 72 + } 73 + ACPI_FLUSH_CPU_CACHE(); 74 + acpi_enable_wakeup_device_prep(acpi_state); 75 + #endif 76 + acpi_gpe_sleep_prepare(acpi_state); 77 + acpi_enter_sleep_state_prep(acpi_state); 78 + return 0; 61 79 } 62 80 63 81 /** ··· 374 350 return d_max; 375 351 } 376 352 353 + static void acpi_power_off_prepare(void) 354 + { 355 + /* Prepare to power off the system */ 356 + acpi_sleep_prepare(ACPI_STATE_S5); 357 + } 358 + 359 + static void acpi_power_off(void) 360 + { 361 + /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ 362 + printk("%s called\n", __FUNCTION__); 363 + local_irq_disable(); 364 + acpi_enter_sleep_state(ACPI_STATE_S5); 365 + } 366 + 377 367 int __init acpi_sleep_init(void) 378 368 { 379 369 acpi_status status; ··· 401 363 if (acpi_disabled) 402 364 return 0; 403 365 366 + sleep_states[ACPI_STATE_S0] = 1; 367 + printk(KERN_INFO PREFIX "(supports S0"); 368 + 404 369 #ifdef CONFIG_SUSPEND 405 - printk(KERN_INFO PREFIX "(supports"); 406 - for (i = ACPI_STATE_S0; i < ACPI_STATE_S4; i++) { 370 + for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) { 407 371 status = acpi_get_sleep_type_data(i, &type_a, &type_b); 408 372 if (ACPI_SUCCESS(status)) { 409 373 sleep_states[i] = 1; 410 374 printk(" S%d", i); 411 375 } 412 376 } 413 - printk(")\n"); 414 377 415 378 pm_set_ops(&acpi_pm_ops); 416 379 #endif ··· 421 382 if (ACPI_SUCCESS(status)) { 422 383 hibernation_set_ops(&acpi_hibernation_ops); 423 384 sleep_states[ACPI_STATE_S4] = 1; 385 + printk(" S4"); 424 386 } 425 - #else 426 - sleep_states[ACPI_STATE_S4] = 0; 427 387 #endif 428 - 388 + status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); 389 + if (ACPI_SUCCESS(status)) { 390 + sleep_states[ACPI_STATE_S5] = 1; 391 + printk(" S5"); 392 + pm_power_off_prepare = acpi_power_off_prepare; 393 + pm_power_off = acpi_power_off; 394 + } 395 + printk(")\n"); 429 396 return 0; 430 397 }
-75
drivers/acpi/sleep/poweroff.c
··· 1 - /* 2 - * poweroff.c - ACPI handler for powering off the system. 3 - * 4 - * AKA S5, but it is independent of whether or not the kernel supports 5 - * any other sleep support in the system. 6 - * 7 - * Copyright (c) 2005 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> 8 - * 9 - * This file is released under the GPLv2. 10 - */ 11 - 12 - #include <linux/pm.h> 13 - #include <linux/init.h> 14 - #include <acpi/acpi_bus.h> 15 - #include <linux/sysdev.h> 16 - #include <asm/io.h> 17 - #include "sleep.h" 18 - 19 - int acpi_sleep_prepare(u32 acpi_state) 20 - { 21 - #ifdef CONFIG_ACPI_SLEEP 22 - /* do we have a wakeup address for S2 and S3? */ 23 - if (acpi_state == ACPI_STATE_S3) { 24 - if (!acpi_wakeup_address) { 25 - return -EFAULT; 26 - } 27 - acpi_set_firmware_waking_vector((acpi_physical_address) 28 - virt_to_phys((void *) 29 - acpi_wakeup_address)); 30 - 31 - } 32 - ACPI_FLUSH_CPU_CACHE(); 33 - acpi_enable_wakeup_device_prep(acpi_state); 34 - #endif 35 - acpi_gpe_sleep_prepare(acpi_state); 36 - acpi_enter_sleep_state_prep(acpi_state); 37 - return 0; 38 - } 39 - 40 - #ifdef CONFIG_PM 41 - 42 - static void acpi_power_off_prepare(void) 43 - { 44 - /* Prepare to power off the system */ 45 - acpi_sleep_prepare(ACPI_STATE_S5); 46 - } 47 - 48 - static void acpi_power_off(void) 49 - { 50 - /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ 51 - printk("%s called\n", __FUNCTION__); 52 - local_irq_disable(); 53 - /* Some SMP machines only can poweroff in boot CPU */ 54 - acpi_enter_sleep_state(ACPI_STATE_S5); 55 - } 56 - 57 - static int acpi_poweroff_init(void) 58 - { 59 - if (!acpi_disabled) { 60 - u8 type_a, type_b; 61 - acpi_status status; 62 - 63 - status = 64 - acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); 65 - if (ACPI_SUCCESS(status)) { 66 - pm_power_off_prepare = acpi_power_off_prepare; 67 - pm_power_off = acpi_power_off; 68 - } 69 - } 70 - return 0; 71 - } 72 - 73 - late_initcall(acpi_poweroff_init); 74 - 75 - #endif /* CONFIG_PM */
+1 -2
drivers/acpi/video.c
··· 417 417 arg0.integer.value = level; 418 418 status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL); 419 419 420 - printk(KERN_DEBUG "set_level status: %x\n", status); 421 420 return status; 422 421 } 423 422 ··· 1753 1754 1754 1755 static int acpi_video_bus_start_devices(struct acpi_video_bus *video) 1755 1756 { 1756 - return acpi_video_bus_DOS(video, 1, 0); 1757 + return acpi_video_bus_DOS(video, 0, 0); 1757 1758 } 1758 1759 1759 1760 static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)