From ebc46d5c4346872860755175033cccd43ca1d924 Mon Sep 17 00:00:00 2001 From: Zhuohao Lee Date: Tue, 8 Sep 2020 19:27:39 +0800 Subject: volteer: encode the keyboard backlight and numeric pad to fw_config In order to support the keyboard backlight and numeric pad switching, we need to encode the keyboard backlight and numeric pad feature to the fw_config. BUG=b:166707536 BRANCH=None TEST=flash the ec.bin to the DUT and checked the keyboard function. Change-Id: I2f85377acd85a0dae635d7bf4fe36c47ce01e9d7 Signed-off-by: Zhuohao Lee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2397933 Reviewed-by: Jett Rink Reviewed-by: Keith Short --- baseboard/volteer/cbi_ec_fw_config.c | 9 ++++++++ baseboard/volteer/cbi_ec_fw_config.h | 43 +++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 8 deletions(-) (limited to 'baseboard') diff --git a/baseboard/volteer/cbi_ec_fw_config.c b/baseboard/volteer/cbi_ec_fw_config.c index 788f152b92..12b96ff5b4 100644 --- a/baseboard/volteer/cbi_ec_fw_config.c +++ b/baseboard/volteer/cbi_ec_fw_config.c @@ -39,4 +39,13 @@ bool ec_cfg_has_tabletmode(void) return (fw_config.tabletmode == TABLETMODE_ENABLED); } +bool ec_cfg_has_keyboard_backlight(void) +{ + return (fw_config.kb_bl == KEYBOARD_BACKLIGHT_ENABLED); +} + +bool ec_cfg_has_numeric_pad(void) +{ + return (fw_config.num_pad == NUMERIC_PAD_ENABLED); +} diff --git a/baseboard/volteer/cbi_ec_fw_config.h b/baseboard/volteer/cbi_ec_fw_config.h index 9669fdf413..5b97f778ec 100644 --- a/baseboard/volteer/cbi_ec_fw_config.h +++ b/baseboard/volteer/cbi_ec_fw_config.h @@ -33,16 +33,27 @@ enum ec_cfg_tabletmode_type { TABLETMODE_ENABLED = 1, }; +enum ec_cfg_keyboard_backlight_type { + KEYBOARD_BACKLIGHT_DISABLED = 0, + KEYBOARD_BACKLIGHT_ENABLED = 1 +}; + +enum ec_cfg_numeric_pad_type { + NUMERIC_PAD_DISABLED = 0, + NUMERIC_PAD_ENABLED = 1 +}; + union volteer_cbi_fw_config { struct { - enum ec_cfg_usb_db_type usb_db : 4; - uint32_t thermal : 4; - uint32_t audio : 3; - enum ec_cfg_tabletmode_type tabletmode : 1; - uint32_t lte_db : 2; - uint32_t reserved_1 : 2; - uint32_t sd_db : 4; - uint32_t reserved_2 : 12; + enum ec_cfg_usb_db_type usb_db : 4; + uint32_t thermal : 4; + uint32_t audio : 3; + enum ec_cfg_tabletmode_type tabletmode : 1; + uint32_t lte_db : 2; + enum ec_cfg_keyboard_backlight_type kb_bl : 1; + enum ec_cfg_numeric_pad_type num_pad : 1; + uint32_t sd_db : 4; + uint32_t reserved_2 : 12; }; uint32_t raw_value; }; @@ -81,4 +92,20 @@ enum ec_cfg_usb_db_type ec_cfg_usb_db_type(void); */ bool ec_cfg_has_tabletmode(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); + +/** + * Check if the FW_CONFIG has enabled numeric pad. + * + * @return true if board supports numeric pad, false if the board + * doesn't support it. + */ +bool ec_cfg_has_numeric_pad(void); + #endif /* __VOLTEER_CBI_EC_FW_CONFIG_H_ */ -- cgit v1.2.1