Furquan Shaikh submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
drivers/i2c/generic: Set S0W to D3hot for wake device

If device is supported as a wake source, _S0W should be set to D3hot.
This ensures that the device is put into D3hot by the OSPM.

Power resource(PRIC) for the device is listed in both _PR0 and _PR3. Thus, it ensures that the OSPM does not turn off power resource when device is put into D0 and D3hot. Hence, it is capable of waking the system from D3hot state. However, if it is put into D3cold, then the power resource is turned off by the OSPM.

The devices we are currently looking at for touchscreen/touchpad
do not really support auxiliary power and so do not support wake from D3cold.

BUG=b:186070097
TEST=build and check device wake state _S0W set to 3 in ssdt table.

Change-Id: I34e4b2350875530d3337be700276bcc4fb1f810a
Signed-off-by: Tony Huang <tony-huang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52847
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
---
M Documentation/acpi/devicetree.md
M src/drivers/i2c/generic/generic.c
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/acpi/devicetree.md b/Documentation/acpi/devicetree.md
index f121698..c184fa0 100644
--- a/Documentation/acpi/devicetree.md
+++ b/Documentation/acpi/devicetree.md
@@ -65,7 +65,7 @@
0x0000002D,
}
})
- Name (_S0W, 0x04) // _S0W: S0 Device Wake State
+ Name (_S0W, ACPI_DEVICE_SLEEP_D3_HOT) // _S0W: S0 Device Wake State
Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
{
0x15, // GPE #21
@@ -196,7 +196,7 @@

### _S0W (S0 Device Wake State)
_S0W indicates the deepest S0 sleep state this device can wake itself from,
-which in this case is 4, representing _D3cold_.
+which in this case is ACPI_DEVICE_SLEEP_D3_HOT, representing _D3hot_.

### _PRW (Power Resources for Wake)
_PRW indicates the power resources and events required for wake. There are no
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index 1c7267e..656b9e6 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -98,7 +98,7 @@

/* Wake capabilities */
if (config->wake) {
- acpigen_write_name_integer("_S0W", 4);
+ acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_HOT);
acpigen_write_PRW(config->wake, 3);
}


To view, visit change 52847. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I34e4b2350875530d3337be700276bcc4fb1f810a
Gerrit-Change-Number: 52847
Gerrit-PatchSet: 9
Gerrit-Owner: Tony Huang <tony-huang@quanta.corp-partner.google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Keith Tzeng <keith.tzeng@quanta.corp-partner.google.com>
Gerrit-Reviewer: Sam McNally <sammc@google.com>
Gerrit-Reviewer: Wisley Chen <wisley.chen@quanta.corp-partner.google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged