diff options
author | Devin Lu <devin.lu@quantatw.com> | 2019-10-09 18:13:38 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-16 06:01:23 +0000 |
commit | 826c22e41a500be5da388b511f958666b9bc5620 (patch) | |
tree | acc6f3e5ae71bfbeac73efffb5ae79ee300cb811 /board/dratini | |
parent | ab6c4c651d3c8fb1f522ea97818f460583c5cbc8 (diff) | |
download | chrome-ec-826c22e41a500be5da388b511f958666b9bc5620.tar.gz |
dratini: enable ec_feature kbbacklit by SKUID
BUG=b:140610519
BRANCH=none
TEST=make sure ectool inventory has shown keyboard backlight support
with dratini/dragonair kbbacklit SKU.
Change-Id: I8fceebc417d4b5b319dbc6126d8311346f09bdcf
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859234
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'board/dratini')
-rw-r--r-- | board/dratini/board.c | 24 | ||||
-rw-r--r-- | board/dratini/board.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/board/dratini/board.c b/board/dratini/board.c index 0bb5a1a785..f6fe06cdbc 100644 --- a/board/dratini/board.c +++ b/board/dratini/board.c @@ -372,3 +372,27 @@ void board_overcurrent_event(int port, int is_overcurrented) /* Note that the level is inverted because the pin is active low. */ gpio_set_level(GPIO_USB_C_OC_ODL, !is_overcurrented); } + +bool board_has_kb_backlight(void) +{ + uint8_t sku_id = get_board_sku(); + /* + * SKUs have keyboard backlight. + * Dratini: 2, 3 + * Dragonair: 22 + */ + return sku_id == 2 || sku_id == 3 || sku_id == 22; +} + +uint32_t board_override_feature_flags0(uint32_t flags0) +{ + if (board_has_kb_backlight()) + return flags0; + else + return (flags0 & ~EC_FEATURE_MASK_0(EC_FEATURE_PWM_KEYB)); +} + +uint32_t board_override_feature_flags1(uint32_t flags1) +{ + return flags1; +} diff --git a/board/dratini/board.h b/board/dratini/board.h index 6b0f1e34c7..700c45769a 100644 --- a/board/dratini/board.h +++ b/board/dratini/board.h @@ -11,6 +11,7 @@ /* Baseboard features */ #include "baseboard.h" +#define CONFIG_EC_FEATURE_BOARD_OVERRIDE #define CONFIG_POWER_BUTTON #define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_PROTOCOL_8042 |