diff options
author | Logan_Liao <logan_Liao@compal.corp-partner.google.com> | 2022-08-29 14:52:15 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-30 21:09:10 +0000 |
commit | 3bba60ed4b2c1ac3e271c8c535eb5f5ce06e22ff (patch) | |
tree | b23023732d29bc3957e546a26618a2c9a548f7fd | |
parent | 37529325bdefe38729ecde12862a52e6525df6c3 (diff) | |
download | chrome-ec-3bba60ed4b2c1ac3e271c8c535eb5f5ce06e22ff.tar.gz |
Mithrax : Modify RGBKBD config for non-gaming SKU.
This patch modify RGB_type setting to distinguish gaming and non-gaming
SKU.
BUG=b:242259557
BRANCH=none
TEST=test Mithrax without RGB keyboard that return EC_RGBKBD_TYPE_UNKNOWN.
Cq-Depend: chromium:3864981, chromium:3864982, chromium:3866411
Change-Id: I3f6485319d36b2ef619d597ea75dc074838b7562
Signed-off-by: Logan_Liao <logan_Liao@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3861817
Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
Reviewed-by: YH Lin <yueherngl@chromium.org>
Reviewed-by: Parth Malkan <parthmalkan@google.com>
Commit-Queue: Parth Malkan <parthmalkan@google.com>
Tested-by: Parth Malkan <parthmalkan@google.com>
Reviewed-by: Ko Ko <ko_ko@compal.corp-partner.google.com>
-rw-r--r-- | board/mithrax/board.c | 10 | ||||
-rw-r--r-- | board/mithrax/keyboard.c | 3 | ||||
-rw-r--r-- | include/rgb_keyboard.h | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/board/mithrax/board.c b/board/mithrax/board.c index 876121aaa3..686da1bbb1 100644 --- a/board/mithrax/board.c +++ b/board/mithrax/board.c @@ -27,6 +27,7 @@ #include "usbc_config.h" #include "keyboard_backlight.h" #include "rgb_keyboard.h" +#include "ec_commands.h" #include "gpio_list.h" /* Must come after other header files. */ @@ -172,9 +173,12 @@ static void rgb_backlight_config(void) void board_kblight_init(void) { if ((IS_ENABLED(CONFIG_PWM_KBLIGHT)) && - (ec_cfg_kb_backlight() == SOLID_COLOR)) + (ec_cfg_kb_backlight() == SOLID_COLOR)) { kblight_register(&kblight_pwm); - else if ((IS_ENABLED(CONFIG_RGB_KEYBOARD)) && - (ec_cfg_kb_backlight() == RGB)) + rgbkbd_type = EC_RGBKBD_TYPE_UNKNOWN; + } else if ((IS_ENABLED(CONFIG_RGB_KEYBOARD)) && + (ec_cfg_kb_backlight() == RGB)) { kblight_register(&kblight_rgbkbd); + rgbkbd_type = EC_RGBKBD_TYPE_FOUR_ZONES_4_LEDS; + } } diff --git a/board/mithrax/keyboard.c b/board/mithrax/keyboard.c index 1e43f8fdb6..21e75ee56a 100644 --- a/board/mithrax/keyboard.c +++ b/board/mithrax/keyboard.c @@ -61,8 +61,7 @@ const uint8_t rgbkbd_count = ARRAY_SIZE(rgbkbds); const uint8_t rgbkbd_hsize = RGB_GRID0_COL; const uint8_t rgbkbd_vsize = RGB_GRID0_ROW; -const enum ec_rgbkbd_type rgbkbd_type = EC_RGBKBD_TYPE_FOUR_ZONES_4_LEDS; - +enum ec_rgbkbd_type rgbkbd_type; #define LED(x, y) RGBKBD_COORD((x), (y)) #define DELM RGBKBD_DELM diff --git a/include/rgb_keyboard.h b/include/rgb_keyboard.h index c02b29d5f3..9fd50d5ecf 100644 --- a/include/rgb_keyboard.h +++ b/include/rgb_keyboard.h @@ -157,7 +157,7 @@ extern const uint8_t rgbkbd_vsize; * rgbkbd_type describes the rgb kb type supported. * i.e. Number of zones and number of LEDs */ -extern const enum ec_rgbkbd_type rgbkbd_type; +extern enum ec_rgbkbd_type rgbkbd_type; /* * rgbkbd_map describes a mapping from key IDs to LED IDs. |