Felix Held submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Shelley Chen: Looks good to me, approved
acpigen_ps2_keybd: Add Fn key to linux,keymap

Some devices may generate scancodes for the Fn key if they have one.
If they do, we should add them to the linux,keymap binding.

BUG=b:333096023
TEST=Flash DUT that emits a scancode for the Fn key, verify that it is
mapped to KEY_FN in the Linux kernel using `evtest` when pressing the Fn
key.

Change-Id: Ie4daa64bc6b619392276d0b5f16e2d195d5bd68c
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81895
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shelley Chen <shchen@google.com>
---
M src/acpi/Kconfig
M src/acpi/acpigen_ps2_keybd.c
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig
index 417ff60..2bb56ba 100644
--- a/src/acpi/Kconfig
+++ b/src/acpi/Kconfig
@@ -14,6 +14,14 @@
Specifies the ACPI name format string used by the acpigen
function to generate the processor scope. Default is CPxx.

+config ACPI_FNKEY_GEN_SCANCODE
+ int
+ default 0
+ help
+ Specifies the scancode, if any, which is generated when the Fn key is
+ pressed. A value of 0 is ignored, which is the default since most
+ keyboards do not emit a scancode for the Fn key.
+
config ACPI_HAVE_PCAT_8259
def_bool y if !ACPI_NO_PCAT_8259

diff --git a/src/acpi/acpigen_ps2_keybd.c b/src/acpi/acpigen_ps2_keybd.c
index 6590e66..cc21d5d 100644
--- a/src/acpi/acpigen_ps2_keybd.c
+++ b/src/acpi/acpigen_ps2_keybd.c
@@ -244,6 +244,13 @@
acpi_dp_add_integer(dp_array, NULL, keymap);
}

+ /* Add the Fn-key */
+ if (CONFIG_ACPI_FNKEY_GEN_SCANCODE != 0) {
+ acpi_dp_add_integer(dp_array, NULL, KEYMAP(CONFIG_ACPI_FNKEY_GEN_SCANCODE,
+ KEY_FN));
+ total++;
+ }
+
total += num_top_row_keys;
}


To view, visit change 81895. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ie4daa64bc6b619392276d0b5f16e2d195d5bd68c
Gerrit-Change-Number: 81895
Gerrit-PatchSet: 5
Gerrit-Owner: Aseda Aboagye <aaboagye@google.com>
Gerrit-Reviewer: Cliff Huang <cliff.huang@intel.com>
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Lance Zhao <lance.zhao@gmail.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro@google.com>
Gerrit-Reviewer: Shelley Chen <shchen@google.com>
Gerrit-Reviewer: Tim Wawrzynczak <inforichland@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged