Sean Rhodes has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83879?usp=email )
Change subject: ec/starlabs/merlin: Add Intel Virtual Button Driver for Tablet Mode ......................................................................
ec/starlabs/merlin: Add Intel Virtual Button Driver for Tablet Mode
This patch adds support for the Intel Virtual Button driver, which reports whether a tablet is docked or undocked. The GPIO used for detection is hardcoded to GPP_F15 for now, specific to the `mb/starlite_adl` board.
The GPIO value is returned to the HID driver via the `_STA` and `VGBS` methods. These methods ensure proper notification to the OS, allowing it to show or hide the virtual keyboard depending on the docking status.
Tested on `starlite_adl` with Ubuntu 24.04, confirming the virtual keyboard appears when the tablet is undocked and hides when docked. This was verified with ACPI debug enabled, as dmesg does not report the state of the GPIO.
Change-Id: I574a1b2d3907b2341a0dfdc412151d574ba4848e Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/83879 Reviewed-by: Matt DeVillier matt.devillier@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- A src/ec/starlabs/merlin/acpi/dock.asl M src/ec/starlabs/merlin/acpi/ec.asl M src/ec/starlabs/merlin/acpi/hid.asl 3 files changed, 57 insertions(+), 1 deletion(-)
Approvals: Matt DeVillier: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/ec/starlabs/merlin/acpi/dock.asl b/src/ec/starlabs/merlin/acpi/dock.asl new file mode 100644 index 0000000..8d648bc --- /dev/null +++ b/src/ec/starlabs/merlin/acpi/dock.asl @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Device (VBTN) +{ + Name (_HID, "INT33D6") + Name (_UID, 1) + Name (_DDN, "Intel Virtual Button Driver") + + Method (_STA, 0, NotSerialized) + { + Return (0x0f) + } + + Method (VBDL) + { + } + + Method (UPDK, 0, Serialized) + { + Local0 = VGBS() + + If (Local0 == 0) { + Printf ("Tablet Mode") + Notify (HIDD, 0xcc) /* Tablet */ + } Else { + Printf ("Docked") + Notify (HIDD, 0xcd) /* Docked */ + } + Return (Local0) + } + + Method (VGBS, 0) + { +#if CONFIG(SYSTEM_TYPE_DETACHABLE) + If (!GRXS (GPP_F15)) + { + Return (0x40) + } +#endif + Return (0x00) + } +} + +Device (VBTO) +{ + Name (_HID, "INT33D3") + Name (_CID, "PNP0C60") + Name (_UID, 1) + Name (_DDN, "Laptop/tablet mode indicator driver") + + Method (_STA, 0) + { + Return (0xf) + } +} diff --git a/src/ec/starlabs/merlin/acpi/ec.asl b/src/ec/starlabs/merlin/acpi/ec.asl index 52cab91..7eec057 100644 --- a/src/ec/starlabs/merlin/acpi/ec.asl +++ b/src/ec/starlabs/merlin/acpi/ec.asl @@ -137,6 +137,7 @@ #include "battery.asl" #include "events.asl" #include "lid.asl" + #include "dock.asl"
Method (_REG, 2, NotSerialized) { diff --git a/src/ec/starlabs/merlin/acpi/hid.asl b/src/ec/starlabs/merlin/acpi/hid.asl index a9de7da..15f02fc 100644 --- a/src/ec/starlabs/merlin/acpi/hid.asl +++ b/src/ec/starlabs/merlin/acpi/hid.asl @@ -351,7 +351,7 @@ // Case (0x08) { - Return (0x00) + Return (_SB.PCI0.LPCB.EC.VBTN.VGBS()) } // // Function 9 H2BC. Button implemented state.