diff options
author | xiaoqiang.zhu <xiaoqiang.zhu@bitland.corp-partner.google.com> | 2019-12-04 17:04:53 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-10 07:52:19 +0000 |
commit | 11790bb3ae7d541448bc23f1505346bd20c524c2 (patch) | |
tree | c7a5daa45b817896d30c3416b94e1ef7319994c4 /board/akemi | |
parent | 33cc661bd206d8f5a3d599c5cde503a3f89f6b2e (diff) | |
download | chrome-ec-11790bb3ae7d541448bc23f1505346bd20c524c2.tar.gz |
akemi: enable ec feature flag override function
Akemi supports keyboard backlight by default, but the
new SKU does not support keyboard backlight.
We need to increase sku_id to distinguish whether
keyboard backlight is supported. So, enable ec feature
flag override to report keyboard backlight feature by sku_id.
BUG=b:144815890
BRANCH=master
TEST=Boot akemi boards, press Alt+Brightness-Up/Down to change
keyboard backlight, it has no function on sku_id=1/2, and it
works fine on sku_id=3/4.
Change-Id: I081256be210fd004332f01771ad05d2f06f9f131
Signed-off-by: xiaoqiang.zhu <xiaoqiang.zhu@bitland.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1950007
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: Cherish Wang <cherish.wang@bitland.corp-partner.google.com>
Diffstat (limited to 'board/akemi')
-rw-r--r-- | board/akemi/board.c | 20 | ||||
-rw-r--r-- | board/akemi/board.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/board/akemi/board.c b/board/akemi/board.c index 5ec34712f9..7cd7feb006 100644 --- a/board/akemi/board.c +++ b/board/akemi/board.c @@ -374,3 +374,23 @@ 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); } + +uint32_t board_override_feature_flags0(uint32_t flags0) +{ + uint8_t sku = get_board_sku(); + /* + * Check if the current sku id does not support keyboard backlight + * and return the feature flag without EC_FEATURE_PWM_KEYB + * sku_id = 1/2 - without keyboard backlight + * sku_id = 3/4 - with keyboard backlight + */ + if (sku == 1 || sku == 2) + return (flags0 & ~EC_FEATURE_MASK_0(EC_FEATURE_PWM_KEYB)); + else + return flags0; +} + +uint32_t board_override_feature_flags1(uint32_t flags1) +{ + return flags1; +} diff --git a/board/akemi/board.h b/board/akemi/board.h index 389112da51..6fb0fa6ee5 100644 --- a/board/akemi/board.h +++ b/board/akemi/board.h @@ -29,6 +29,8 @@ /* Keyboard features */ #define CONFIG_PWM_KBLIGHT +#define CONFIG_EC_FEATURE_BOARD_OVERRIDE + /* Sensors */ /* LSM6DS3TR-C Base accel/gyro */ #define CONFIG_ACCEL_INTERRUPTS |