From f71edad1e7da32c1a9f2f4208da2ce57d0cfd100 Mon Sep 17 00:00:00 2001 From: Benjamin Gordon Date: Fri, 19 Jan 2018 12:54:04 -0700 Subject: [PATCH] grunt: Enable LM3630A driver for keyboard backlight BUG=b:69379749 BRANCH=None TEST=kblight 100; kblight 50; kblight 0 Change-Id: I003ae1071de0430fe38a48b2e9bccb08207bc019 Signed-off-by: Benjamin Gordon Reviewed-on: https://chromium-review.googlesource.com/879083 Reviewed-by: Edward Hill Reviewed-by: Jett Rink --- board/grunt/board.c | 8 ++++++++ board/grunt/board.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/board/grunt/board.c b/board/grunt/board.c index 9d9cb14d67..b2c608f3f0 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -17,6 +17,7 @@ #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" #include "driver/accelgyro_bmi160.h" +#include "driver/led/lm3630a.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx74xx.h" #include "driver/tcpm/ps8xxx.h" @@ -226,6 +227,13 @@ static void board_chipset_resume(void) { /* Allow display backlight to turn on. See above backlight comment */ gpio_set_level(GPIO_ENABLE_BACKLIGHT_L, 0); + + /* + * Enable keyboard backlight. This needs to be done here because + * the chip doesn't have power until PP3300_S0 comes up. + */ + gpio_set_level(GPIO_KB_BL_EN, 1); + lm3630a_poweron(); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); diff --git a/board/grunt/board.h b/board/grunt/board.h index fa5002db1a..58b8f120fe 100644 --- a/board/grunt/board.h +++ b/board/grunt/board.h @@ -144,6 +144,9 @@ /* Thermal */ #define CONFIG_TEMP_SENSOR_SB_TSI +/* KB backlight driver */ +#define CONFIG_LED_DRIVER_LM3630A + /* FIFO size is a power of 2. */ #define CONFIG_ACCEL_FIFO 1024 /* TODO(teravest): Check this value. */