diff options
-rw-r--r-- | baseboard/volteer/cbi_ec_fw_config.c | 9 | ||||
-rw-r--r-- | baseboard/volteer/cbi_ec_fw_config.h | 43 | ||||
-rw-r--r-- | board/volteer/board.c | 4 |
3 files changed, 48 insertions, 8 deletions
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_ */ diff --git a/board/volteer/board.c b/board/volteer/board.c index 2aef1e914b..3ad5f588a0 100644 --- a/board/volteer/board.c +++ b/board/volteer/board.c @@ -26,6 +26,7 @@ #include "fan_chip.h" #include "gpio.h" #include "hooks.h" +#include "keyboard_raw.h" #include "keyboard_scan.h" #include "lid_switch.h" #include "power.h" @@ -440,6 +441,9 @@ __override void board_cbi_init(void) default: CPRINTS("%sID %d not supported", db_type_prefix, usb_db); } + + if (!IS_ENABLED(TEST_BUILD) && !ec_cfg_has_numeric_pad()) + keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD); } /******************************************************************************/ |