diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2021-10-07 12:18:36 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-11 19:11:20 +0000 |
commit | b5df2379298e5899be6e0f902116ee5657b01680 (patch) | |
tree | 0432d05b2fa397d45aa4109c8cc6333ff25dc99a | |
parent | 9479cb8807662c76691529213b69233bef938197 (diff) | |
download | chrome-ec-b5df2379298e5899be6e0f902116ee5657b01680.tar.gz |
anahera: Update FW_CONFIG field
This patch updated the FW_CONFIG field for Anahera.
BUG=b:197169349
BRANCH=none
TEST=make BOARD=anahera
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I097821f39d8c52bf2eaf606dc444de04f4bc519b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211166
Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Commit-Queue: Boris Mittelberg <bmbm@google.com>
-rw-r--r-- | board/anahera/fw_config.c | 17 | ||||
-rw-r--r-- | board/anahera/fw_config.h | 25 |
2 files changed, 28 insertions, 14 deletions
diff --git a/board/anahera/fw_config.c b/board/anahera/fw_config.c index e59688b17d..98b391ed6f 100644 --- a/board/anahera/fw_config.c +++ b/board/anahera/fw_config.c @@ -11,19 +11,19 @@ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) -static union redrix_cbi_fw_config fw_config; +static union anahera_cbi_fw_config fw_config; BUILD_ASSERT(sizeof(fw_config) == sizeof(uint32_t)); /* - * FW_CONFIG defaults for redrix if the CBI.FW_CONFIG data is not + * FW_CONFIG defaults for anahera if the CBI.FW_CONFIG data is not * initialized. */ -static const union redrix_cbi_fw_config fw_config_defaults = { - .kb_bl = KEYBOARD_BACKLIGHT_ENABLED, +static const union anahera_cbi_fw_config fw_config_defaults = { + .kb_bl = KEYBOARD_BACKLIGHT_DISABLED, }; /**************************************************************************** - * Redrix FW_CONFIG access + * Anahera FW_CONFIG access */ void board_init_fw_config(void) { @@ -44,7 +44,7 @@ void board_init_fw_config(void) } } -union redrix_cbi_fw_config get_fw_config(void) +union anahera_cbi_fw_config get_fw_config(void) { return fw_config; } @@ -53,3 +53,8 @@ bool ec_cfg_has_eps(void) { return (fw_config.eps == EPS_ENABLED); } + +bool ec_cfg_has_kblight(void) +{ + return (fw_config.kb_bl == KEYBOARD_BACKLIGHT_ENABLED); +} diff --git a/board/anahera/fw_config.h b/board/anahera/fw_config.h index 6480f07b35..126bbe6423 100644 --- a/board/anahera/fw_config.h +++ b/board/anahera/fw_config.h @@ -3,15 +3,15 @@ * found in the LICENSE file. */ -#ifndef __BOARD_BRYA_FW_CONFIG_H_ -#define __BOARD_BRYA_FW_CONFIG_H_ +#ifndef __BOARD_ANAHERA_FW_CONFIG_H_ +#define __BOARD_ANAHERA_FW_CONFIG_H_ #include <stdint.h> /**************************************************************************** - * CBI FW_CONFIG layout for Redrix board. + * CBI FW_CONFIG layout for Anahera board. * - * Source of truth is the project/brya/redrix/config.star configuration file. + * Source of truth is the project/brya/anahera/config.star configuration file. */ enum ec_cfg_keyboard_backlight_type { @@ -24,7 +24,7 @@ enum ec_cfg_eps_type { EPS_ENABLED = 1 }; -union redrix_cbi_fw_config { +union anahera_cbi_fw_config { struct { uint32_t sd_db : 2; enum ec_cfg_keyboard_backlight_type kb_bl : 1; @@ -32,7 +32,8 @@ union redrix_cbi_fw_config { uint32_t lte_db : 2; uint32_t ufc : 2; enum ec_cfg_eps_type eps : 1; - uint32_t reserved_1 : 21; + uint32_t boot_device : 2; + uint32_t reserved_1 : 19; }; uint32_t raw_value; }; @@ -42,7 +43,7 @@ union redrix_cbi_fw_config { * * @return the FW_CONFIG for the board. */ -union redrix_cbi_fw_config get_fw_config(void); +union anahera_cbi_fw_config get_fw_config(void); /** * Check if the FW_CONFIG has enabled privacy screen. @@ -52,4 +53,12 @@ union redrix_cbi_fw_config get_fw_config(void); */ bool ec_cfg_has_eps(void); -#endif /* __BOARD_BRYA_FW_CONFIG_H_ */ +/** + * 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_kblight(void); + +#endif /* __BOARD_ANAHERA_FW_CONFIG_H_ */ |