summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ec/google/wilco/chip.c6
-rw-r--r--src/ec/google/wilco/commands.h4
-rw-r--r--src/ec/google/wilco/smihandler.c1
3 files changed, 11 insertions, 0 deletions
diff --git a/src/ec/google/wilco/chip.c b/src/ec/google/wilco/chip.c
index 9a200bd720..929d1cc312 100644
--- a/src/ec/google/wilco/chip.c
+++ b/src/ec/google/wilco/chip.c
@@ -44,6 +44,12 @@ static void wilco_ec_post_video_init(void *unused)
BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT,
wilco_ec_post_video_init, NULL);
+static void wilco_ec_resume(void *unused)
+{
+ wilco_ec_send_noargs(KB_RESTORE);
+}
+BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, wilco_ec_resume, NULL);
+
static void wilco_ec_init(struct device *dev)
{
if (!dev->enabled)
diff --git a/src/ec/google/wilco/commands.h b/src/ec/google/wilco/commands.h
index 61eb460bfa..7a9bc05a07 100644
--- a/src/ec/google/wilco/commands.h
+++ b/src/ec/google/wilco/commands.h
@@ -26,6 +26,10 @@ enum {
KB_POWER_STATUS = 0x05,
/* Inform the EC aboout the reason host is turning off */
KB_POWER_OFF = 0x08,
+ /* Save PS/2 data before S3 suspend */
+ KB_SAVE = 0x2f,
+ /* Restore PS/2 data after S3 resume */
+ KB_RESTORE = 0x30,
/* Retrieve information about the EC */
KB_EC_INFO = 0x38,
/* Set ACPI mode on or off */
diff --git a/src/ec/google/wilco/smihandler.c b/src/ec/google/wilco/smihandler.c
index 8c4bfd364d..60ad8139fe 100644
--- a/src/ec/google/wilco/smihandler.c
+++ b/src/ec/google/wilco/smihandler.c
@@ -25,6 +25,7 @@ void wilco_ec_smi_sleep(int slp_type)
{
switch (slp_type) {
case ACPI_S3:
+ wilco_ec_send_noargs(KB_SAVE);
wilco_ec_slp_en();
break;
case ACPI_S5: