[PATCH 0/2] platform/x86: intel-vbtn: Fix ASUS VivoBook boot state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux