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>
This commit is contained in:
Sean Rhodes 2024-08-12 09:58:23 +01:00
commit eaf87422b1
3 changed files with 57 additions and 1 deletions

View file

@ -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)
}
}

View file

@ -137,6 +137,7 @@ Scope (\_SB.PCI0.LPCB)
#include "battery.asl"
#include "events.asl"
#include "lid.asl"
#include "dock.asl"
Method (_REG, 2, NotSerialized)
{

View file

@ -351,7 +351,7 @@ Device (HIDD) // HID Device
//
Case (0x08)
{
Return (0x00)
Return (\_SB.PCI0.LPCB.EC.VBTN.VGBS())
}
//
// Function 9 H2BC. Button implemented state.