From ecab79365054c6f3582ef09528424130f8c7ac87 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Wed, 18 Mar 2026 18:35:51 -0500 Subject: [PATCH] ec/chromeec: Add Kconfig and asl for vendor tablet ACPI Introduce EC_CHROMEEC_USE_VENDOR_TABLET_CONTROLS to control inclusion of Intel VBTN and AMD VGBI ACPI devices used for tablet/convertible mode. Default is y for non-ChromeOS builds when the board selects SYSTEM_TYPE_CONVERTIBLE or SYSTEM_TYPE_DETACHABLE. Add vbtn.asl (Intel INT33D6/INT33D3) and vgbi.asl (AMD AMD33D6/AMD33D3). In ec.asl, gate VBTN/VGBI notify and these includes on the new config. Boards that are convertibles or detachables will enable the vendor tablet controls by selecting the appropriate SMBIOS enclosure type in subsequent changes. Change-Id: I208c1f1856a9223af5109464ecf316e76de3a976 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/91742 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai --- src/ec/google/chromeec/Kconfig | 8 ++++++ src/ec/google/chromeec/acpi/ec.asl | 21 +++++++++++++++ src/ec/google/chromeec/acpi/vbtn.asl | 38 ++++++++++++++++++++++++++++ src/ec/google/chromeec/acpi/vgbi.asl | 30 ++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 src/ec/google/chromeec/acpi/vbtn.asl create mode 100644 src/ec/google/chromeec/acpi/vgbi.asl diff --git a/src/ec/google/chromeec/Kconfig b/src/ec/google/chromeec/Kconfig index 081f7cb754..223d7caa6c 100644 --- a/src/ec/google/chromeec/Kconfig +++ b/src/ec/google/chromeec/Kconfig @@ -267,6 +267,14 @@ config EC_GOOGLE_CHROMEEC_LED_CONTROL Enable manual AP control over ChromeEC LEDs/lightbars to ensure visual continuity with AP-side boot animations. +config EC_CHROMEEC_USE_VENDOR_TABLET_CONTROLS + bool "Include vendor tablet mode controls (VBTN/VGBI) in ACPI" + default y if !CHROMEOS && (SYSTEM_TYPE_CONVERTIBLE || SYSTEM_TYPE_DETACHABLE) + help + Include ACPI devices for tablet mode / convertible controls (Intel VBTN, + AMD VGBI). Default is enabled for non-ChromeOS builds when the board + reports SMBIOS enclosure type convertible or detachable. + endif # EC_GOOGLE_CHROMEEC source "src/ec/google/chromeec/*/Kconfig" diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl index 93b04718ec..21e0045fb8 100644 --- a/src/ec/google/chromeec/acpi/ec.asl +++ b/src/ec/google/chromeec/acpi/ec.asl @@ -461,6 +461,18 @@ Device (EC0) #ifdef EC_ENABLE_TBMC_DEVICE Notify (^CREC.TBMC, 0x80) #endif +#if CONFIG(EC_CHROMEEC_USE_VENDOR_TABLET_CONTROLS) +#if CONFIG(SOC_INTEL_COMMON) + If (^TBMD == 1) { + Notify (VBTN, 0xCC) + } Else { + Notify (VBTN, 0xCD) + } +#endif +#if CONFIG(SOC_AMD_COMMON) + Notify (VGBI, 0x81) +#endif +#endif #if CONFIG(SOC_AMD_COMMON_BLOCK_ACPI_DPTC) If (CondRefOf (\_SB.DPTC)) { \_SB.DPTC() @@ -667,4 +679,13 @@ Device (EC0) #ifdef EC_ENABLE_KEYBOARD_BACKLIGHT #include "keyboard_backlight.asl" #endif + +#if CONFIG(EC_CHROMEEC_USE_VENDOR_TABLET_CONTROLS) +#if CONFIG(SOC_INTEL_COMMON) + #include "vbtn.asl" +#endif +#if CONFIG(SOC_AMD_COMMON) + #include "vgbi.asl" +#endif +#endif } diff --git a/src/ec/google/chromeec/acpi/vbtn.asl b/src/ec/google/chromeec/acpi/vbtn.asl new file mode 100644 index 0000000000..3bddc304de --- /dev/null +++ b/src/ec/google/chromeec/acpi/vbtn.asl @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* VGBS reports 0x40 when NOT in tablet mode. */ +/* Sent event 0xCC for tablet mode, 0xCD for laptop */ +/* Linux driver expects SMBIOS_ENCLOSURE_TYPE=SMBIOS_ENCLOSURE_CONVERTIBLE */ + +Device (VBTN) +{ + Name (_HID, "INT33D6") + Name (_DDN, "Tablet Virtual Buttons") + + Method (VBDL, 0) + { + } + + Method (VGBS) + { + If (^^RCTM == 1) { + Return (0x0) + } Else { + Return (0x40) + } + } + Method(_STA, 0) + { + Return (0xF) + } +} + +Device (VBTO) +{ + Name (_HID, "INT33D3") + Name (_CID, "PNP0C60") + Method (_STA, 0) + { + Return (0xF) + } +} diff --git a/src/ec/google/chromeec/acpi/vgbi.asl b/src/ec/google/chromeec/acpi/vgbi.asl new file mode 100644 index 0000000000..be71f11429 --- /dev/null +++ b/src/ec/google/chromeec/acpi/vgbi.asl @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Device (CIND) +{ + Name (_HID, "AMD33D3") // _HID: Hardware ID + Name (_CID, "PNP0C60" /* Display Sensor Device */) // _CID: Compatible ID + Method (_STA, 0, Serialized) // _STA: Status + { + Return (0x0F) + } +} + +Device (VGBI) +{ + Name (_HID, "AMD33D6") // _HID: Hardware ID + + Method (_STA, 0, NotSerialized) // _STA: Status + { + Return (0x0F) + } + + Method (AMWF, 0, Serialized) + { + If (^^RCTM == 1) { + Return (0) + } Else { + Return (1) + } + } +}