diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/brya/board.c | 26 | ||||
-rw-r--r-- | board/brya/board.h | 2 |
2 files changed, 26 insertions, 2 deletions
diff --git a/board/brya/board.c b/board/brya/board.c index 8f336c9dee..4c3c89567e 100644 --- a/board/brya/board.c +++ b/board/brya/board.c @@ -47,7 +47,11 @@ __override void board_cbi_init(void) static void board_chipset_resume(void) { /* Allow keyboard backlight to be enabled */ - gpio_set_level(GPIO_EC_KB_BL_EN, 1); + + if (get_board_id() == 1) + gpio_set_level(GPIO_ID_1_EC_KB_BL_EN, 1); + else + gpio_set_level(GPIO_EC_KB_BL_EN_L, 0); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); @@ -55,7 +59,11 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); static void board_chipset_suspend(void) { /* Turn off the keyboard backlight if it's on. */ - gpio_set_level(GPIO_EC_KB_BL_EN, 0); + + if (get_board_id() == 1) + gpio_set_level(GPIO_ID_1_EC_KB_BL_EN, 0); + else + gpio_set_level(GPIO_EC_KB_BL_EN_L, 1); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); @@ -99,3 +107,17 @@ enum battery_present battery_hw_present(void) return gpio_get_level(GPIO_EC_BATT_PRES_ODL) ? BP_NO : BP_YES; } +/* + * Explicitly apply the board ID 1 *gpio.inc settings to pins that + * were reassigned on current boards. + */ + +static void set_board_id_1_gpios(void) +{ + if (get_board_id() != 1) + return; + + gpio_set_flags(GPIO_ID_1_EC_KB_BL_EN, GPIO_OUT_LOW); +} +DECLARE_HOOK(HOOK_INIT, set_board_id_1_gpios, HOOK_PRIO_FIRST); + diff --git a/board/brya/board.h b/board/brya/board.h index b14543e031..b3c79ccdd8 100644 --- a/board/brya/board.h +++ b/board/brya/board.h @@ -138,6 +138,8 @@ #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_WP_L GPIO_EC_WP_ODL +#define GPIO_ID_1_EC_KB_BL_EN GPIO_EC_BATT_PRES_ODL + /* System has back-lit keyboard */ #define CONFIG_PWM_KBLIGHT |