summaryrefslogtreecommitdiff
path: root/src/mainboard/purism/librem_jsl/acpi/vbtn.asl
diff options
context:
space:
mode:
authorJonathon Hall <jonathon.hall@puri.sm>2023-09-14 14:41:20 -0400
committerMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2023-10-20 14:22:07 +0000
commita86704aa10704c47694606e4ebd83fdabad302fa (patch)
tree22c790638480b2f81403ccd10730b2914cab8a9a /src/mainboard/purism/librem_jsl/acpi/vbtn.asl
parent24502f4cb0e44f53f6868f2e4e0c169ad0b60ab3 (diff)
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 <jonathon.hall@puri.sm> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78343 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'src/mainboard/purism/librem_jsl/acpi/vbtn.asl')
-rw-r--r--src/mainboard/purism/librem_jsl/acpi/vbtn.asl62
1 files changed, 62 insertions, 0 deletions
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)
+ }
+ }
+}