All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] platform/x86: intel-vbtn: Fix ASUS VivoBook boot state
@ 2024-03-29 14:32 Gwendal Grignou
  2024-03-29 14:32 ` [PATCH 1/2] platform/x86: intel-vbtn: Use acpi_has_method to check for switch Gwendal Grignou
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gwendal Grignou @ 2024-03-29 14:32 UTC (permalink / raw)
  To: hdegoede; +Cc: platform-driver-x86, Gwendal Grignou

While qualifying ASUS VivoBook Flip 14 (TP401NAS) for ChromeOS Plex,
we notice it always boot in tablet mode, with the keyboard and touchpad
disabled. We have to rotate its lid over 180 degree and back to get into
clamshell mode, or put it into sleep and wake it up.

Disassembling the ACPI table, the virtual button/switch ACPI device is
implemented as follow:

  Device (VGBI)
  {
      Name (_HID, EisaId ("INT33D6") /* Intel Virtual Buttons Device */)  // _HID: Hardware ID
      Name (VBDS, Zero)
      Method (_STA, 0, Serialized)  // _STA: Status
      {
          PB1E |= 0x20
          If ((OSYS >= 0x07DD))
          {
              Return (0x0F)
          }

          Return (Zero)
      }

      Method (VBDL, 0, Serialized)
      {
          PB1E |= 0x20
          VBDS |= 0x40
      }

      Method (VGBS, 0, Serialized)
      {
          Return (VBDS) /* \_SB_.PCI0.SBRG.EC0_.VGBI.VBDS */
      }

      Method (UPBT, 2, Serialized)
      {
          Local0 = (One << Arg0)
          If (Arg1)
          {
              VBDS |= Local0
          }
          Else
          {
              VBDS &= ~Local0
          }
      }
  }

Method UBPT is called when lid angle cross 180 degree boundary or when
the device is woken up.

At boot, VBDS is set to 0 ("tablet mode") until UBPT or VBDL are called.

VBDL used to be evaluated before VGBS by the intel-vbtn driver probe
routine, but since commit 26173179fae1 ("platform/x86: intel-vbtn: Eval VBDL after registering our notifier"),
call to VGBS is delayed until after the notifier is register.

To bring back the expected behavior (device booting in clamshell
mode), make sure we evaluate VGBS after VBDL.

While at it, use function acpi_has_method() when we only need to know if a
method exist, as commit 26173179fae1 does.

Gwendal Grignou (2):
  platform/x86: intel-vbtn: Use acpi_has_method to check for switch
  platform/x86: intel-vbtn: Update tablet mode switch at end of probe

 drivers/platform/x86/intel/vbtn.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-08 15:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-29 14:32 [PATCH 0/2] platform/x86: intel-vbtn: Fix ASUS VivoBook boot state Gwendal Grignou
2024-03-29 14:32 ` [PATCH 1/2] platform/x86: intel-vbtn: Use acpi_has_method to check for switch Gwendal Grignou
2024-03-29 18:49   ` Kuppuswamy Sathyanarayanan
2024-04-08 15:44     ` Ilpo Järvinen
2024-03-29 14:32 ` [PATCH 2/2] platform/x86: intel-vbtn: Update tablet mode switch at end of probe Gwendal Grignou
2024-03-29 18:50   ` Kuppuswamy Sathyanarayanan
2024-04-08 13:17 ` [PATCH 0/2] platform/x86: intel-vbtn: Fix ASUS VivoBook boot state Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.