Bug 190661

Summary: HP-WMI Driver Always Claims Docking Station Fitted And Device Is A Tablet On Pavilion Laptop
Product: Drivers Reporter: Gareth Williams (gareth)
Component: Platform_x86Assignee: drivers_platform_x86 (drivers_platform_x86)
Status: NEW ---    
Severity: normal CC: dmitry.torokhov
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.4.0 Subsystem:
Regression: No Bisected commit-id:

Description Gareth Williams 2016-12-18 07:30:00 UTC
Running:

sudo evtest /dev/input/event8

gives:

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "HP WMI hotkeys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 138 (KEY_HELP)
    Event code 141 (KEY_SETUP)
    Event code 148 (KEY_PROG1)
    Event code 153 (KEY_DIRECTION)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 226 (KEY_MEDIA)
    Event code 240 (KEY_UNKNOWN)
    Event code 358 (KEY_INFO)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 5 (EV_SW)
    Event code 1 (SW_TABLET_MODE) state 1
    Event code 5 (SW_DOCK) state 1
Properties:
Testing ... (interrupt to exit)

The lines of interest are the two switch events (EV_SW) where it shows that the device is a tablet and is connected to a dock.  Neither are true - it is in fact a fully fledged laptop with a keyboard and no touch-screen.

SW_DOCK being set to true causes systemd-logind to not suspend the laptop when the lid is closed.  While there is a workaround by setting:

HandleLidSwitchDocked=suspend

in /etc/systemd/logind.conf, this would cause the laptop to suspend if connected to a dock and the lid closed, which may not always be desired.