From a86704aa10704c47694606e4ebd83fdabad302fa Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Thu, 14 Sep 2023 14:41:20 -0400 Subject: mb/purism/librem_jsl: Add support for Librem 11 This adds support for the Librem 11 tablet, using the ME 13.50.15.1436 binary from the original BIOS (version 28.D8.E1.021) and FSP binaries from a Jasper Lake Chromebook. The following features were tested with PureOS: * Audio (speakers, microphone, headset jack) * Cameras * Display * Touchscreen and pen * Keyboard cover, with tablet/laptop mode switch indicated via ACPI * Power and volume buttons * USB-C ports (USB 2/3, DP alt mode, PD charging) * SD card reader * WLAN * Bluetooth * NVMe SSD (socketed) * Battery state information from EC * Accelerometer A UART is accessible with soldering via test points on the mainboard, documented in the mainboard Kconfig with a toggle to enable it for coreboot logging. Change-Id: I545994889ddfb41f56de09b3a42840bccbd7c4aa Signed-off-by: Jonathon Hall Reviewed-on: https://review.coreboot.org/c/coreboot/+/78343 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/mainboard/purism/librem_jsl/acpi/vbtn.asl | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/mainboard/purism/librem_jsl/acpi/vbtn.asl (limited to 'src/mainboard/purism/librem_jsl/acpi/vbtn.asl') diff --git a/src/mainboard/purism/librem_jsl/acpi/vbtn.asl b/src/mainboard/purism/librem_jsl/acpi/vbtn.asl new file mode 100644 index 0000000000..3cca8a3502 --- /dev/null +++ b/src/mainboard/purism/librem_jsl/acpi/vbtn.asl @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +Name (FLAP, 0x40) /* Flag indicating device is in laptop mode */ + +/* Virtual events */ +Name (VTBL, 0xcc) /* Tablet Mode */ +Name (VLAP, 0xcd) /* Laptop Mode */ + +Device (VBTN) +{ + Name (_HID, "INT33D6") + Name (_UID, 1) + Name (_DDN, "Intel Virtual Button Driver") + + /* + * This method is called at driver probe time and must exist or + * the driver will not load. + */ + Method (VBDL) + { + } + + /* + * This method returns flags indicating tablet and dock modes. + * It is called at driver probe time so the OS knows what the + * state of the device is at boot. + */ + Method (VGBS) + { + Local0 = 0 + If (CKLP ()) { + Local0 |= ^^FLAP + } + Return (Local0) + } + + Method (_STA, 0) + { + Return (0xF) + } + + Method (CKLP, 0) + { + /* 120 = GPP_D4 */ + If (\_SB.PCI0.GRXS (120)) { + Printf ("VBTN: tablet mode") + Return (0) /* Tablet mode */ + } Else { + Printf ("VBTN: laptop mode") + Return (1) /* Laptop mode */ + } + } + + Method (NTFY, 0) + { + /* Notify the new state */ + If (CKLP ()) { + Notify (^^VBTN, ^^VLAP) + } Else { + Notify (^^VBTN, ^^VTBL) + } + } +} -- cgit v1.2.3