Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350923
b: refs/heads/master
c: 0596a52
h: refs/heads/master
i:
  350921: 65a42a5
  350919: 5aab871
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 17, 2013
1 parent 26324c4 commit c019c79
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e88c9c603b2ad0cd0fbe90afedba3f1becbbeb79
refs/heads/master: 0596a52b8357b25185e06af32973225baeb7196a
1 change: 1 addition & 0 deletions trunk/drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
struct list_head *list);
int acpi_add_power_resource(acpi_handle handle);
void acpi_power_add_remove_device(struct acpi_device *adev, bool add);
int acpi_power_min_system_level(struct list_head *list);
int acpi_device_sleep_wake(struct acpi_device *dev,
int enable, int sleep_state, int dev_state);
int acpi_power_get_inferred_state(struct acpi_device *device, int *state);
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,20 @@ void acpi_power_add_remove_device(struct acpi_device *adev, bool add)
}
}

int acpi_power_min_system_level(struct list_head *list)
{
struct acpi_power_resource_entry *entry;
int system_level = 5;

list_for_each_entry(entry, list, node) {
struct acpi_power_resource *resource = entry->resource;

if (system_level > resource->system_level)
system_level = resource->system_level;
}
return system_level;
}

/* --------------------------------------------------------------------------
Device Power Management
-------------------------------------------------------------------------- */
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,17 @@ static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
if (err)
goto out;

if (!list_empty(&wakeup->resources)) {
int sleep_state;

sleep_state = acpi_power_min_system_level(&wakeup->resources);
if (sleep_state < wakeup->sleep_state) {
acpi_handle_warn(handle, "Overriding _PRW sleep state "
"(S%d) by S%d from power resources\n",
(int)wakeup->sleep_state, sleep_state);
wakeup->sleep_state = sleep_state;
}
}
acpi_setup_gpe_for_wake(handle, wakeup->gpe_device, wakeup->gpe_number);

out:
Expand Down

0 comments on commit c019c79

Please sign in to comment.