Skip to content

Commit 434e578

Browse files
gwendalcrij-intel
authored andcommitted
platform/x86: intel-vbtn: Update tablet mode switch at end of probe
ACER Vivobook Flip (TP401NAS) virtual intel switch is implemented as follow: Device (VGBI) { Name (_HID, EisaId ("INT33D6") ... Name (VBDS, Zero) Method (_STA, 0, Serialized) // _STA: Status ... Method (VBDL, 0, Serialized) { PB1E |= 0x20 VBDS |= 0x40 } Method (VGBS, 0, Serialized) { Return (VBDS) /* \_SB_.PCI0.SBRG.EC0_.VGBI.VBDS */ } ... } By default VBDS is set to 0. At boot it is set to clamshell (bit 6 set) only after method VBDL is executed. Since VBDL is now evaluated in the probe routine later, after the device is registered, the retrieved value of VBDS was still 0 ("tablet mode") when setting up the virtual switch. Make sure to evaluate VGBS after VBDL, to ensure the convertible boots in clamshell mode, the expected default. Fixes: 2617317 ("platform/x86: intel-vbtn: Eval VBDL after registering our notifier") Signed-off-by: Gwendal Grignou <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 868adf8 commit 434e578

File tree

1 file changed

+3
-2
lines changed
  • drivers/platform/x86/intel

1 file changed

+3
-2
lines changed

drivers/platform/x86/intel/vbtn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ static int intel_vbtn_input_setup(struct platform_device *device)
136136
priv->switches_dev->id.bustype = BUS_HOST;
137137

138138
if (priv->has_switches) {
139-
detect_tablet_mode(&device->dev);
140-
141139
ret = input_register_device(priv->switches_dev);
142140
if (ret)
143141
return ret;
@@ -312,6 +310,9 @@ static int intel_vbtn_probe(struct platform_device *device)
312310
if (ACPI_FAILURE(status))
313311
dev_err(&device->dev, "Error VBDL failed with ACPI status %d\n", status);
314312
}
313+
// Check switches after buttons since VBDL may have side effects.
314+
if (has_switches)
315+
detect_tablet_mode(&device->dev);
315316

316317
device_init_wakeup(&device->dev, true);
317318
/*

0 commit comments

Comments
 (0)