Patrick Georgi submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Patrick Rudolph: Looks good to me, approved
ec/lenovo/h8/acpi: Add alternative Fn-F2 and Fn-F3 layout

thinkpad_acpi maps the battery hotkey (KEY_BATTERY) on scancode 0x01 and
the lock hotkey (KEY_COFFEE) on scancode 0x02.

On the Thinkpad X1 Carbon (and possibly others), the hotkeys for Fn-F2
and Fn-F3 are different from the default one so a new layout has to be
defined.

Change-Id: Ib2d96be1a7815d7d03e6e8c6d300fd671c8598ca
Signed-off-by: Nicola Corna <nicola@corna.info>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31470
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
---
M src/ec/lenovo/h8/acpi/ec.asl
M src/mainboard/lenovo/x1_carbon_gen1/dsdt.asl
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index 327a2cf..5a11681 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -195,6 +195,26 @@
^HKEY.RHK (0x01)
}

+ /*
+ * Alternative layout (like in the Thinkpad X1 Carbon 1st generation):
+ * * Fn-F2 (_Q11) -> not mapped
+ * * Fn-F3 (_Q12) -> scancode 0x01 (KEY_COFFEE)
+ *
+ * Default layout (like in the Thinkpad X220):
+ * * Fn-F2 (_Q11) -> scancode 0x01 (KEY_COFFEE)
+ * * Fn-F3 (_Q12) -> scancode 0x02 (KEY_BATTERY)
+ */
+#ifdef EC_LENOVO_H8_ALT_FN_F2F3_LAYOUT
+ Method (_Q11, 0, NotSerialized)
+ {
+ // Not mapped
+ }
+
+ Method (_Q12, 0, NotSerialized)
+ {
+ ^HKEY.RHK (0x02)
+ }
+#else
Method (_Q11, 0, NotSerialized)
{
^HKEY.RHK (0x02)
@@ -204,6 +224,7 @@
{
^HKEY.RHK (0x03)
}
+#endif

Method (_Q64, 0, NotSerialized)
{
diff --git a/src/mainboard/lenovo/x1_carbon_gen1/dsdt.asl b/src/mainboard/lenovo/x1_carbon_gen1/dsdt.asl
index de6866d..29235d7 100644
--- a/src/mainboard/lenovo/x1_carbon_gen1/dsdt.asl
+++ b/src/mainboard/lenovo/x1_carbon_gen1/dsdt.asl
@@ -20,6 +20,7 @@
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
#define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
#define EC_LENOVO_H8_ME_WORKAROUND 1
+#define EC_LENOVO_H8_ALT_FN_F2F3_LAYOUT 1

#include <arch/acpi.h>
DefinitionBlock(

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib2d96be1a7815d7d03e6e8c6d300fd671c8598ca
Gerrit-Change-Number: 31470
Gerrit-PatchSet: 4
Gerrit-Owner: Nicola Corna <nicola@corna.info>
Gerrit-Reviewer: Alexander Couzens <lynxis@fe80.eu>
Gerrit-Reviewer: Nicola Corna <nicola@corna.info>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged