Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230895
b: refs/heads/master
c: ade3e7f
h: refs/heads/master
i:
  230893: c833bc0
  230891: be1d66c
  230887: 825de1c
  230879: 0c7d7d0
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Len Brown committed Jan 12, 2011
1 parent 225c57a commit 7afe0d9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e6d4fe4296782f1f095575b8213a97c3e925a16
refs/heads/master: ade3e7fef794781c0798d0cf0f046123842ba550
25 changes: 25 additions & 0 deletions trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,31 @@ int acpi_bus_set_power(acpi_handle handle, int state)

EXPORT_SYMBOL(acpi_bus_set_power);


int acpi_bus_init_power(struct acpi_device *device)
{
int state;
int result;

if (!device)
return -EINVAL;

device->power.state = ACPI_STATE_UNKNOWN;

result = __acpi_bus_get_power(device, &state);
if (result)
return result;

if (device->power.flags.power_resources)
result = acpi_power_on_resources(device, state);

if (!result)
device->power.state = state;

return result;
}


bool acpi_bus_power_manageable(acpi_handle handle)
{
struct acpi_device *device;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ int acpi_device_sleep_wake(struct acpi_device *dev,
int acpi_power_get_inferred_state(struct acpi_device *device, int *state);
int acpi_power_on_resources(struct acpi_device *device, int state);
int acpi_power_transition(struct acpi_device *device, int state);
int acpi_bus_init_power(struct acpi_device *device);
extern int acpi_power_nocheck;

int acpi_wakeup_device_init(void);
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
device->power.states[ACPI_STATE_D3].flags.valid = 1;
device->power.states[ACPI_STATE_D3].power = 0;

/* TBD: System wake support and resource requirements. */

device->power.state = ACPI_STATE_UNKNOWN;
acpi_bus_get_power(device->handle, &(device->power.state));
acpi_bus_init_power(device);

return 0;
}
Expand Down

0 comments on commit 7afe0d9

Please sign in to comment.