diff options
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index c26468da4295..dd49ea0d0ed3 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 |
@@ -147,7 +147,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state) | |||
147 | *state = ACPI_STATE_D0; | 147 | *state = ACPI_STATE_D0; |
148 | } else { | 148 | } else { |
149 | /* | 149 | /* |
150 | * Get the device's power state either directly (via _PSC) or | 150 | * Get the device's power state either directly (via _PSC) or |
151 | * indirectly (via power resources). | 151 | * indirectly (via power resources). |
152 | */ | 152 | */ |
153 | if (device->power.flags.explicit_get) { | 153 | if (device->power.flags.explicit_get) { |
@@ -199,15 +199,14 @@ int acpi_bus_set_power(acpi_handle handle, int state) | |||
199 | * Get device's current power state if it's unknown | 199 | * Get device's current power state if it's unknown |
200 | * This means device power state isn't initialized or previous setting failed | 200 | * This means device power state isn't initialized or previous setting failed |
201 | */ | 201 | */ |
202 | if (!device->flags.force_power_state) { | 202 | if ((device->power.state == ACPI_STATE_UNKNOWN) || device->flags.force_power_state) |
203 | if (device->power.state == ACPI_STATE_UNKNOWN) | 203 | acpi_bus_get_power(device->handle, &device->power.state); |
204 | acpi_bus_get_power(device->handle, &device->power.state); | 204 | if ((state == device->power.state) && !device->flags.force_power_state) { |
205 | if (state == device->power.state) { | 205 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", |
206 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", | 206 | state)); |
207 | state)); | 207 | return 0; |
208 | return 0; | ||
209 | } | ||
210 | } | 208 | } |
209 | |||
211 | if (!device->power.states[state].flags.valid) { | 210 | if (!device->power.states[state].flags.valid) { |
212 | printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); | 211 | printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); |
213 | return -ENODEV; | 212 | return -ENODEV; |
@@ -462,7 +461,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | |||
462 | "Received BUS CHECK notification for device [%s]\n", | 461 | "Received BUS CHECK notification for device [%s]\n", |
463 | device->pnp.bus_id)); | 462 | device->pnp.bus_id)); |
464 | result = acpi_bus_check_scope(device); | 463 | result = acpi_bus_check_scope(device); |
465 | /* | 464 | /* |
466 | * TBD: We'll need to outsource certain events to non-ACPI | 465 | * TBD: We'll need to outsource certain events to non-ACPI |
467 | * drivers via the device manager (device.c). | 466 | * drivers via the device manager (device.c). |
468 | */ | 467 | */ |
@@ -473,7 +472,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | |||
473 | "Received DEVICE CHECK notification for device [%s]\n", | 472 | "Received DEVICE CHECK notification for device [%s]\n", |
474 | device->pnp.bus_id)); | 473 | device->pnp.bus_id)); |
475 | result = acpi_bus_check_device(device, NULL); | 474 | result = acpi_bus_check_device(device, NULL); |
476 | /* | 475 | /* |
477 | * TBD: We'll need to outsource certain events to non-ACPI | 476 | * TBD: We'll need to outsource certain events to non-ACPI |
478 | * drivers via the device manager (device.c). | 477 | * drivers via the device manager (device.c). |
479 | */ | 478 | */ |
@@ -543,7 +542,7 @@ static int __init acpi_bus_init_irq(void) | |||
543 | char *message = NULL; | 542 | char *message = NULL; |
544 | 543 | ||
545 | 544 | ||
546 | /* | 545 | /* |
547 | * Let the system know what interrupt model we are using by | 546 | * Let the system know what interrupt model we are using by |
548 | * evaluating the \_PIC object, if exists. | 547 | * evaluating the \_PIC object, if exists. |
549 | */ | 548 | */ |
@@ -684,7 +683,7 @@ static int __init acpi_bus_init(void) | |||
684 | * the EC device is found in the namespace (i.e. before acpi_initialize_objects() | 683 | * the EC device is found in the namespace (i.e. before acpi_initialize_objects() |
685 | * is called). | 684 | * is called). |
686 | * | 685 | * |
687 | * This is accomplished by looking for the ECDT table, and getting | 686 | * This is accomplished by looking for the ECDT table, and getting |
688 | * the EC parameters out of that. | 687 | * the EC parameters out of that. |
689 | */ | 688 | */ |
690 | status = acpi_ec_ecdt_probe(); | 689 | status = acpi_ec_ecdt_probe(); |
@@ -699,6 +698,9 @@ static int __init acpi_bus_init(void) | |||
699 | 698 | ||
700 | printk(KERN_INFO PREFIX "Interpreter enabled\n"); | 699 | printk(KERN_INFO PREFIX "Interpreter enabled\n"); |
701 | 700 | ||
701 | /* Initialize sleep structures */ | ||
702 | acpi_sleep_init(); | ||
703 | |||
702 | /* | 704 | /* |
703 | * Get the system interrupt model and evaluate \_PIC. | 705 | * Get the system interrupt model and evaluate \_PIC. |
704 | */ | 706 | */ |