diff options
author | Rob Barnes <robbarnes@google.com> | 2021-01-06 15:47:19 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-13 00:09:59 +0000 |
commit | be3176576d93395ebfc4e87160efa3c9c4a983dd (patch) | |
tree | 9d09059e6be9900a96d882cd394935570c35dd56 /baseboard/guybrush/baseboard.c | |
parent | 527c905d0709f2310c428159b9e403de2946c6de (diff) | |
download | chrome-ec-be3176576d93395ebfc4e87160efa3c9c4a983dd.tar.gz |
guybrush: implement baseboard_chipset_suspend/resume
Turn off backlights at suspend and turn on at resume.
BUG=None
BRANCH=None
TEST=Build
Signed-off-by: Rob Barnes <robbarnes@google.com>
Change-Id: I3a8b000395c30538b9d6e7183b6bdf5016995869
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613733
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'baseboard/guybrush/baseboard.c')
-rw-r--r-- | baseboard/guybrush/baseboard.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c index ab1b092b9a..aafb1c3fd6 100644 --- a/baseboard/guybrush/baseboard.c +++ b/baseboard/guybrush/baseboard.c @@ -18,6 +18,7 @@ #include "driver/ppc/nx20p348x.h" #include "driver/tcpm/nct38xx.h" #include "gpio.h" +#include "hooks.h" #include "i2c.h" #include "ioexpander.h" #include "isl9241.h" @@ -652,3 +653,20 @@ void board_hibernate(void) msleep(SAFE_RESET_VBUS_DELAY_MS); } } + +static void baseboard_chipset_suspend(void) +{ + /* Disable display and keyboard backlights. */ + gpio_set_level(GPIO_EC_DISABLE_DISP_BL, 1); + ioex_set_level(GPIO_EN_KB_BL, 0); +} +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, baseboard_chipset_suspend, + HOOK_PRIO_DEFAULT); + +static void baseboard_chipset_resume(void) +{ + /* Enable display and keyboard backlights. */ + gpio_set_level(GPIO_EC_DISABLE_DISP_BL, 0); + ioex_set_level(GPIO_EN_KB_BL, 1); +} +DECLARE_HOOK(HOOK_CHIPSET_RESUME, baseboard_chipset_resume, HOOK_PRIO_DEFAULT); |