summaryrefslogtreecommitdiff
path: root/board/zoombini/board.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-12-06 10:53:57 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-06 17:30:46 -0800
commitbedf1f5a614ef324e111f761c8c9693e2b8c2812 (patch)
tree5f19286445ae1105afde97d4763ab44d3d76529a /board/zoombini/board.c
parenteab8143d0baca0e85d9b76fc28326e3dcba2c9e9 (diff)
downloadchrome-ec-bedf1f5a614ef324e111f761c8c9693e2b8c2812.tar.gz
meowth: zoombini: Add display backlight control.
This commit just adds the GPIO for controlling the display backlight for meowth and zoombini. The backlight should be enabled from the EC side on transitions to S0 and turned off when suspending. Additionally, if the lid is opened or closed the display backlight will be enabled or disabled respectively. BUG=b:69972660 BRANCH=None TEST=`make -j buildall` TEST=Flash meowth; Boot to S0, verify that the ENABLE_BACKLIGHT GPIO is set high; Shut down; Verify that ENABLE_BACKLIGHT is 0. TEST=Repeat above test on zoombini. Also, boot to S0, use a magnet to simulate the lid closing, verify that ENABLE_BACKLIGHT is 0 when lid is "closed". Verify it is 1 when lid is "open". Change-Id: Iffc5db89a0378d354b1fe9e9e5347d57e7caf69b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/811752 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/zoombini/board.c')
-rw-r--r--board/zoombini/board.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/zoombini/board.c b/board/zoombini/board.c
index d0eae53784..f3d6ae1012 100644
--- a/board/zoombini/board.c
+++ b/board/zoombini/board.c
@@ -216,6 +216,13 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
#endif /* defined(BOARD_ZOOMBINI) */
};
+static void board_chipset_resume(void)
+{
+ /* Enable display backlight. */
+ gpio_set_level(GPIO_ENABLE_BACKLIGHT, 1);
+}
+DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
+
static void board_chipset_startup(void)
{
#ifdef BOARD_ZOOMBINI
@@ -240,6 +247,13 @@ static void board_chipset_shutdown(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
+static void board_chipset_suspend(void)
+{
+ /* Disable display backlight. */
+ gpio_set_level(GPIO_ENABLE_BACKLIGHT, 0);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
+
static void board_init(void)
{
#ifdef BOARD_ZOOMBINI