From 7ffcd686db8dfc22edf3e94aa6008fbab6aa8bcd Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Tue, 30 Jan 2018 15:25:15 +0800 Subject: [PATCH] whiskers: Enable LM3630A LED driver Used to control keyboard backlight. BRANCH=none BUG=b:68934906 TEST=make BOARD=whiskers -j Change-Id: Ie793ebe91670965a434896530084561a7f1c57d4 Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/892842 Reviewed-by: Benjamin Gordon Reviewed-by: Wei-Han Chen --- board/hammer/board.c | 11 +++++++++-- board/hammer/board.h | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/board/hammer/board.c b/board/hammer/board.c index 42a35332ac..f1dadcd8f5 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -5,6 +5,7 @@ /* Hammer board configuration */ #include "common.h" +#include "driver/led/lm3630a.h" #include "ec_version.h" #include "ec_ec_comm_slave.h" #include "gpio.h" @@ -162,14 +163,20 @@ static void board_init(void) } #endif /* BOARD_STAFF */ -#if defined(BOARD_WAND) && defined(SECTION_IS_RW) +#ifdef SECTION_IS_RW +#ifdef BOARD_WAND /* USB to serial queues */ queue_init(&ec_ec_comm_slave_input); queue_init(&ec_ec_comm_slave_output); /* UART init */ usart_init(&ec_ec_usart); -#endif +#endif /* BOARD_WAND */ + +#ifdef BOARD_WHISKERS + lm3630a_poweron(); +#endif /* BOARD_WHISKERS */ +#endif /* SECTION_IS_RW */ } /* This needs to happen before PWM is initialized. */ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_INIT_PWM - 1); diff --git a/board/hammer/board.h b/board/hammer/board.h index 5063499f6a..9d824e0c32 100644 --- a/board/hammer/board.h +++ b/board/hammer/board.h @@ -205,11 +205,16 @@ #define CONFIG_I2C #define CONFIG_I2C_MASTER #define I2C_PORT_MASTER 0 +#define I2C_PORT_KBLIGHT 0 #define I2C_PORT_CHARGER 1 /* Enable PWM */ #define CONFIG_PWM +#ifdef BOARD_WHISKERS +#define CONFIG_LED_DRIVER_LM3630A +#endif + /* Enable Elan touchpad driver */ #define CONFIG_TOUCHPAD #define CONFIG_TOUCHPAD_ELAN