• Carlo Caione's avatar
    platform/x86: hp-wmi: Fix detection for dock and tablet mode · 298747b7
    Carlo Caione authored
    The current driver code is not checking for the error values returned by
    'hp_wmi_dock_state()' and 'hp_wmi_tablet_state()' before passing the
    returned values down to 'input_report_switch()'. This error code is
    being translated to '1' in the input subsystem, reporting the wrong
    status.
    
    The biggest problem caused by this issue is that several laptops are
    wrongly reported by the driver as docked, preventing them to be put to
    sleep using the LID (and in most cases they are not even dockable).
    
    With this patch we create the report switches only if we are able to
    read the dock and tablet mode status correctly from ACPI.
    Signed-off-by: default avatarCarlo Caione <carlo@endlessm.com>
    Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
    298747b7
hp-wmi.c 25.1 KB