diff options
author | Patrick Georgi <pgeorgi@google.com> | 2017-08-24 23:10:53 +0200 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-30 03:58:28 -0700 |
commit | 09136dea764dbe482392c29b3c8d1763149df3e6 (patch) | |
tree | b6cff30ac999c763082c285f6bd3ef7ef0016c5d /board/coral/board.c | |
parent | f1dfc4cbac2140f51f4a40fec790755ca7d4fafe (diff) | |
download | chrome-ec-09136dea764dbe482392c29b3c8d1763149df3e6.tar.gz |
ec_features / coral: Allow disabling keyboard backlight feature
Allow reporting that keyboard backlight doesn't exist even when the code
is compiled in. Useful if there are multiple device models that should
share firmware.
BUG=b:64705535
BRANCH=none
TEST=none
Change-Id: I9c1fc370aedf66ef856a571f73831095d27e3d39
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/633926
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'board/coral/board.c')
-rw-r--r-- | board/coral/board.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/board/coral/board.c b/board/coral/board.c index 6c1768ce6e..a1ebd18e7b 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -1170,3 +1170,27 @@ struct keyboard_scan_config keyscan_config = { 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */ }, }; + +uint32_t board_override_feature_flags0(uint32_t flags0) +{ + uint32_t sku = system_get_sku_id(); + + /* + * We always compile in backlight support for coral, but only some + * models come with the hardware. Therefore, check if the current + * device is one of them and return the default value - with backlight + * here. + */ + if (sku == 8) + return flags0; + + // Report that there is no keyboard backlight + flags0 &= ~EC_FEATURE_MASK_0(EC_FEATURE_PWM_KEYB); + + return flags0; +} + +uint32_t board_override_feature_flags1(uint32_t flags1) +{ + return flags1; +} |