diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/marasov/board.c | 15 | ||||
-rw-r--r-- | board/marasov/board.h | 5 | ||||
-rw-r--r-- | board/marasov/keyboard.c | 26 |
3 files changed, 38 insertions, 8 deletions
diff --git a/board/marasov/board.c b/board/marasov/board.c index b7f9745fa8..94ef52a8c4 100644 --- a/board/marasov/board.c +++ b/board/marasov/board.c @@ -37,7 +37,7 @@ static void board_chipset_resume(void) { /* Allow keyboard backlight to be enabled */ - if (IS_ENABLED(CONFIG_PWM_KBLIGHT)) + if (ec_cfg_kb_bl_type()) gpio_set_level(GPIO_EC_KB_BL_EN_L, 0); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); @@ -47,7 +47,18 @@ static void board_chipset_suspend(void) { /* Turn off the keyboard backlight if it's on. */ - if (IS_ENABLED(CONFIG_PWM_KBLIGHT)) + if (ec_cfg_kb_bl_type()) gpio_set_level(GPIO_EC_KB_BL_EN_L, 1); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); + +__override uint32_t board_override_feature_flags0(uint32_t flags0) +{ + /* + * Remove keyboard backlight feature for devices that don't support it. + */ + if (!ec_cfg_kb_bl_type()) + return (flags0 & ~EC_FEATURE_MASK_0(EC_FEATURE_PWM_KEYB)); + else + return flags0; +} diff --git a/board/marasov/board.h b/board/marasov/board.h index 6cb0225edc..168bf795ca 100644 --- a/board/marasov/board.h +++ b/board/marasov/board.h @@ -10,11 +10,6 @@ #include "compile_time_macros.h" -/* - * Early brya boards are not set up for vivaldi - */ -#undef CONFIG_KEYBOARD_VIVALDI - /* Baseboard features */ #include "baseboard.h" diff --git a/board/marasov/keyboard.c b/board/marasov/keyboard.c index 457a55718c..e75af0b516 100644 --- a/board/marasov/keyboard.c +++ b/board/marasov/keyboard.c @@ -4,6 +4,7 @@ */ #include "common.h" +#include "ec_commands.h" #include "keyboard_scan.h" #include "timer.h" @@ -18,7 +19,30 @@ __override struct keyboard_scan_config keyscan_config = { .min_post_scan_delay_us = 1000, .poll_timeout_us = 100 * MSEC, .actual_key_mask = { - 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, + 0x1c, 0xfe, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */ }, }; + +static const struct ec_response_keybd_config marasov_kb = { + .num_top_row_keys = 10, + .action_keys = { + TK_BACK, /* T1 */ + TK_REFRESH, /* T2 */ + TK_FULLSCREEN, /* T3 */ + TK_OVERVIEW, /* T4 */ + TK_SNAPSHOT, /* T5 */ + TK_BRIGHTNESS_DOWN, /* T6 */ + TK_BRIGHTNESS_UP, /* T7 */ + TK_VOL_MUTE, /* T8 */ + TK_VOL_DOWN, /* T9 */ + TK_VOL_UP, /* T10 */ + }, + .capabilities = KEYBD_CAP_SCRNLOCK_KEY, +}; + +__override const struct ec_response_keybd_config * +board_vivaldi_keybd_config(void) +{ + return &marasov_kb; +} |