Skip to content

Commit b340c7d

Browse files
Sakari Ailusrafaeljw
authored andcommitted
ACPI: scan: Obtain device's desired enumeration power state
Store a device's desired enumeration power state in struct acpi_device_power during acpi_device object's initialisation. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent c0d6586 commit b340c7d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/acpi/scan.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state)
10171017

10181018
static void acpi_bus_get_power_flags(struct acpi_device *device)
10191019
{
1020+
unsigned long long dsc = ACPI_STATE_D0;
10201021
u32 i;
10211022

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

1042+
acpi_evaluate_integer(device->handle, "_DSC", NULL, &dsc);
1043+
device->power.state_for_enumeration = dsc;
1044+
10411045
/*
10421046
* Enumerate supported power management states
10431047
*/

include/acpi/acpi_bus.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ struct acpi_device_power {
278278
int state; /* Current state */
279279
struct acpi_device_power_flags flags;
280280
struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
281+
u8 state_for_enumeration; /* Deepest power state for enumeration */
281282
};
282283

283284
struct acpi_dep_data {

0 commit comments

Comments
 (0)