From 9304a574b574c02271befe59ccc2b0ffebb94b0d Mon Sep 17 00:00:00 2001 From: Shaunak Saha Date: Sun, 24 Jul 2016 22:54:13 -0700 Subject: [PATCH] UPSTREAM: google/reef: Add mainboard handler function for gpio SMI This patch adds mainboard_smi_gpi_handler which handles the SMI event. This can happen in situations like lidclose and system goes to shutdown. BUG=chrome-os-partner:54977 BRANCH=None TEST=When system is in firmware mode executing the command lidclose from ec console shuts down the system. Signed-off-by: Shaunak Saha Reviewed-on: https://review.coreboot.org/15834 Reviewed-by: Aaron Durbin Change-Id: I8ff6001e48dcbbd4cee5097e759352d8fea6189b Reviewed-on: https://chromium-review.googlesource.com/368948 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh --- src/mainboard/google/reef/ec.h | 3 +++ src/mainboard/google/reef/smihandler.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/mainboard/google/reef/ec.h b/src/mainboard/google/reef/ec.h index f76c5a8876..c4b1505c2c 100644 --- a/src/mainboard/google/reef/ec.h +++ b/src/mainboard/google/reef/ec.h @@ -24,6 +24,9 @@ */ #define EC_SCI_GPI GPE0_DW1_11 +/* EC SMI */ +#define EC_SMI_GPI GPIO_49 + /* * On lidopen/lidclose GPIO_22 from North Community gets toggled and * is used in _PRW to wake up device from sleep. GPIO_22 maps to diff --git a/src/mainboard/google/reef/smihandler.c b/src/mainboard/google/reef/smihandler.c index 05d363f876..e26c176b1b 100644 --- a/src/mainboard/google/reef/smihandler.c +++ b/src/mainboard/google/reef/smihandler.c @@ -18,8 +18,15 @@ #include #include #include +#include #include "ec.h" +void mainboard_smi_gpi_handler(const struct gpi_status *sts) +{ + if (gpi_status_get(sts, EC_SMI_GPI)) + chromeec_smi_process_events(); +} + void mainboard_smi_sleep(u8 slp_typ) { if (slp_typ == ACPI_S3)