Skip to content

Commit

Permalink
ACPI: scan: Obtain device's desired enumeration power state
Browse files Browse the repository at this point in the history
Store a device's desired enumeration power state in struct
acpi_device_power during acpi_device object's initialisation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Sakari Ailus authored and Rafael J. Wysocki committed Nov 3, 2021
1 parent c0d6586 commit b340c7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state)

static void acpi_bus_get_power_flags(struct acpi_device *device)
{
unsigned long long dsc = ACPI_STATE_D0;
u32 i;

/* Presence of _PS0|_PR0 indicates 'power manageable' */
Expand All @@ -1038,6 +1039,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
if (acpi_has_method(device->handle, "_DSW"))
device->power.flags.dsw_present = 1;

acpi_evaluate_integer(device->handle, "_DSC", NULL, &dsc);
device->power.state_for_enumeration = dsc;

/*
* Enumerate supported power management states
*/
Expand Down
1 change: 1 addition & 0 deletions include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ struct acpi_device_power {
int state; /* Current state */
struct acpi_device_power_flags flags;
struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
u8 state_for_enumeration; /* Deepest power state for enumeration */
};

struct acpi_dep_data {
Expand Down

0 comments on commit b340c7d

Please sign in to comment.