summaryrefslogtreecommitdiff
path: root/board/taeko
diff options
context:
space:
mode:
Diffstat (limited to 'board/taeko')
-rw-r--r--board/taeko/board.c14
-rw-r--r--board/taeko/fw_config.c5
-rw-r--r--board/taeko/fw_config.h8
3 files changed, 21 insertions, 6 deletions
diff --git a/board/taeko/board.c b/board/taeko/board.c
index e4a3814901..d7fe4e4399 100644
--- a/board/taeko/board.c
+++ b/board/taeko/board.c
@@ -53,9 +53,10 @@ static void board_chipset_resume(void)
{
/* Allow keyboard backlight to be enabled */
- /* TODO(b/194477160)
- * Implement keyboard backlight control policy later.
- */
+ if (ec_cfg_has_keyboard_backlight() == 1)
+ gpio_set_level(GPIO_EC_KB_BL_EN_L, 1);
+ else
+ gpio_set_level(GPIO_EC_KB_BL_EN_L, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
@@ -64,9 +65,10 @@ static void board_chipset_suspend(void)
{
/* Turn off the keyboard backlight if it's on. */
- /* TODO(b/194477160)
- * Implement keyboard backlight control policy later.
- */
+ if (ec_cfg_has_keyboard_backlight() == 1)
+ gpio_set_level(GPIO_EC_KB_BL_EN_L, 0);
+ else
+ gpio_set_level(GPIO_EC_KB_BL_EN_L, 1);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
diff --git a/board/taeko/fw_config.c b/board/taeko/fw_config.c
index 886c56b314..4e450b7dfa 100644
--- a/board/taeko/fw_config.c
+++ b/board/taeko/fw_config.c
@@ -58,3 +58,8 @@ enum ec_cfg_usb_db_type ec_cfg_usb_db_type(void)
{
return fw_config.usb_db;
}
+
+bool ec_cfg_has_keyboard_backlight(void)
+{
+ return (fw_config.kb_bl == KEYBOARD_BACKLIGHT_ENABLED);
+}
diff --git a/board/taeko/fw_config.h b/board/taeko/fw_config.h
index 7e59a4308e..db4c6d60c0 100644
--- a/board/taeko/fw_config.h
+++ b/board/taeko/fw_config.h
@@ -51,4 +51,12 @@ union taeko_cbi_fw_config get_fw_config(void);
*/
enum ec_cfg_usb_db_type ec_cfg_usb_db_type(void);
+/**
+ * Check if the FW_CONFIG has enabled keyboard backlight.
+ *
+ * @return true if board supports keyboard backlight, false if the board
+ * doesn't support it.
+ */
+bool ec_cfg_has_keyboard_backlight(void);
+
#endif /* __BOARD_TAEKO_FW_CONFIG_H_ */