Aseda Aboagye has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81996?usp=email )
Change subject: acpigen_ps2_keybd: Add assistant to linux,keymap ......................................................................
acpigen_ps2_keybd: Add assistant to linux,keymap
If the ChromiumOS EC indicates that the device has an assistant key, we should also add it to the generated linux,keymap binding. This commit simply does so by examining the keyboard capabilities reported by the EC.
BUG=b:333088656 TEST=With a device that has an assistant key, flash AP FW and verify that the key is mapped to `KEY_ASSISTANT`` in the Linux kernel using `evtest`.
Change-Id: I217220e89bce88e3045a4fc3b124954696276442 Signed-off-by: Aseda Aboagye aaboagye@google.com --- M src/acpi/acpigen_ps2_keybd.c M src/ec/google/chromeec/ec_acpi.c M src/include/acpi/acpigen_ps2_keybd.h 3 files changed, 15 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/81996/1
diff --git a/src/acpi/acpigen_ps2_keybd.c b/src/acpi/acpigen_ps2_keybd.c index 6590e66..611cf79 100644 --- a/src/acpi/acpigen_ps2_keybd.c +++ b/src/acpi/acpigen_ps2_keybd.c @@ -211,7 +211,8 @@ bool can_send_function_keys, bool has_numeric_keypad, bool has_scrnlock_key, - bool has_alpha_num_punct_keys) + bool has_alpha_num_punct_keys, + bool has_assistant_key) { struct acpi_dp *dp_array; enum ps2_action_key key; @@ -273,6 +274,12 @@ } }
+ /* Add the keymap for the assistant key if present */ + if (has_assistant_key) { + acpi_dp_add_integer(dp_array, NULL, KEYMAP(0x5c, KEY_ASSISTANT)); + total++; + } + total += ARRAY_SIZE(rest_of_keymaps); printk(BIOS_INFO, "PS2K: Passing %u keymaps to kernel\n", total);
@@ -284,7 +291,8 @@ bool can_send_function_keys, bool has_numeric_keypad, bool has_scrnlock_key, - bool has_alpha_num_punct_keys) + bool has_alpha_num_punct_keys, + bool has_assistant_key) { struct acpi_dp *dsd;
@@ -305,7 +313,8 @@ ssdt_generate_physmap(dsd, num_top_row_keys, action_keys); ssdt_generate_keymap(dsd, num_top_row_keys, action_keys, can_send_function_keys, has_numeric_keypad, - has_scrnlock_key, has_alpha_num_punct_keys); + has_scrnlock_key, has_alpha_num_punct_keys, + has_assistant_key); acpi_dp_write(dsd); acpigen_pop_len(); /* Scope */ } diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index cf29636..f1f534b 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -252,6 +252,7 @@ !!(keybd.capabilities & KEYBD_CAP_FUNCTION_KEYS), !!(keybd.capabilities & KEYBD_CAP_NUMERIC_KEYPAD), !!(keybd.capabilities & KEYBD_CAP_SCRNLOCK_KEY), + !!(keybd.capabilities & KEYBD_CAP_ASSISTANT_KEY), true); }
diff --git a/src/include/acpi/acpigen_ps2_keybd.h b/src/include/acpi/acpigen_ps2_keybd.h index 263eb05..502d026 100644 --- a/src/include/acpi/acpigen_ps2_keybd.h +++ b/src/include/acpi/acpigen_ps2_keybd.h @@ -37,6 +37,7 @@ enum ps2_action_key action_keys[], bool can_send_function_keys, bool has_numeric_keypad, bool has_scrnlock_key, - bool has_alpha_num_punct_keys); + bool has_alpha_num_punct_keys, + bool has_assistant_key);
#endif /* __ACPI_ACPIGEN_PS2_KEYBD_H__ */