From f02c8c4c87cdf9c30b44be9c7ba49e506115a188 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Wed, 17 Jan 2018 16:55:19 -0800 Subject: grunt: Enabling backlight lid control module Enabling backlight control module with active low mode enabled. BUG=b:72007261 BRANCH=none TEST=Booted grunt board and verified lid sensor toggles backlight Change-Id: I14a6eec01c4cda6fcb4b821b9a4b6f266b8fe78b Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/872234 Reviewed-by: Edward Hill --- board/grunt/board.c | 20 ++++++++++++-------- board/grunt/board.h | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/board/grunt/board.c b/board/grunt/board.c index 600151e655..deac1ead57 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -219,20 +219,24 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); -static void board_chipset_resume(void) -{ - /* Turn on display backlight (active low GPIO). */ - gpio_set_level(GPIO_ENABLE_BACKLIGHT_L, 0); -} -DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); - static void board_chipset_suspend(void) { - /* Turn off display backlight (active low GPIO). */ + /* + * Turn off display backlight. This ensures that the backlight stays off + * in S3, no matter what the AP has it set to. The AP also controls it. + * This is here more for legacy reasons. + */ gpio_set_level(GPIO_ENABLE_BACKLIGHT_L, 1); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); +static void board_chipset_resume(void) +{ + /* Allow display backlight to turn on. See above backlight comment */ + gpio_set_level(GPIO_ENABLE_BACKLIGHT_L, 0); +} +DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); + /** * Power on (or off) a single TCPC. * minimum on/off delays are included. diff --git a/board/grunt/board.h b/board/grunt/board.h index 973b9e76cd..bcec4887f7 100644 --- a/board/grunt/board.h +++ b/board/grunt/board.h @@ -24,6 +24,8 @@ #define CONFIG_SPI_FLASH_W25Q80 /* Internal SPI flash type. */ #define CONFIG_ADC +#define CONFIG_BACKLIGHT_LID +#define CONFIG_BACKLIGHT_LID_ACTIVE_LOW #define CONFIG_BOARD_VERSION #define CONFIG_I2C #define CONFIG_I2C_MASTER -- cgit v1.2.1