ACPI: Evaluate _PS3 when entering D3 Cold
PATCH v2 1/1 ACPI: Evaluate _PS3 when entering D3 Cold
V2: set D3 Cold's explicit_set flag in acpi_bus_get_power_flags if _PS3 exists as suggested by Rafael and modify the way to change object_name to _PS3 from _PS4 when doing explicit set to enter D3 Cold. The patch is based on top of Lin Ming's ACPI D3 clean up patch.
V1: When entering D3 Cold from a lower device power state(higher power), evaluate _PS3 before doing power transition.
--- drivers/acpi/bus.c | 3 +++ drivers/acpi/scan.c | 4 ++++ 2 files changed, 7 insertions(+)
drivers/acpi/bus.c +3 -0
@@ -273,6 +273,9 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) } }else {if (device->power.states[state].flags.explicit_set) { +/* Evaluate _PS3 when entering D3cold */ +if (state ==ACPI_STATE_D3 ) + object_name[3 ] ='3' ; status =acpi_evaluate_object (device->handle, object_name,NULL ,NULL );if (ACPI_FAILURE (status)) {
drivers/acpi/scan.c +4 -0
@@ -908,6 +908,10 @@ 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 ; +/* Also set D3cold's explicit flag when _PS3 exists */ +if (device->power.states[ACPI_STATE_D3_HOT ].flags.explicit_set) + device->power.states[ACPI_STATE_D3 ].flags.explicit_set =1 ; +acpi_bus_init_power (device);return 0 ;
Signature · 1 line
1.7.9.6
Quoted 11 lines · Aaron Lu
V2: set D3 Cold's
explicit_setflag inacpi_bus_get_power_flagsif_PS3exists as suggested by Rafael and modify the way to changeobject_nameto_PS3from_PS4when doing explicit set to enter D3 Cold. The patch is based on top of Lin Ming's ACPI D3 clean up patch.V1: When entering D3 Cold from a lower device power state(higher power), evaluate
_PS3before doing power transition.Signed-off-by Aaron Lu <[email protected]>Cc Andiry Xu <[email protected]>Cc Alex He <[email protected]>
Quoted 35 lines
--- drivers/acpi/bus.c | 3 +++ drivers/acpi/scan.c | 4 ++++ 2 files changed, 7 insertions(+)drivers/acpi/bus.c +3
-0@@ -273,6 +273,9 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) } }else {if (device->power.states[state].flags.explicit_set) { +/* Evaluate _PS3 when entering D3cold */ +if (state ==ACPI_STATE_D3 ) + object_name[3 ] ='3' ; status =acpi_evaluate_object (device->handle, object_name,NULL ,NULL );if (ACPI_FAILURE (status)) {drivers/acpi/scan.c +4
-0@@ -908,6 +908,10 @@ 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 ; +/* Also set D3cold's explicit flag when _PS3 exists */ +if (device->power.states[ACPI_STATE_D3_HOT ].flags.explicit_set) + device->power.states[ACPI_STATE_D3 ].flags.explicit_set =1 ; +acpi_bus_init_power (device);return 0 ;