• Jorge Lopez's avatar
    platform/x86: hp-wmi: Fix SW_TABLET_MODE detection method · 520ee4ea
    Jorge Lopez authored
    The purpose of this patch is to introduce a fix and removal of the
    current hack when determining tablet mode status.
    
    Determining the tablet mode status requires reading Byte 0 bit 2 as
    reported by HPWMI_HARDWARE_QUERY.  The investigation identified the
    failure was rooted in two areas: HPWMI_HARDWARE_QUERY failure (0x05)
    and reading Byte 0, bit 2 only to determine the table mode status.
    HPWMI_HARDWARE_QUERY WMI failure also rendered the dock state value
    invalid.
    
    The latest changes use SMBIOS Type 3 (chassis type) and WMI Command
    0x40 (device_mode_status) information to determine if the device is
    in tablet mode or not.
    
    hp_wmi_hw_state function was split into two functions;
    hp_wmi_get_dock_state and hp_wmi_get_tablet_mode.  The new functions
    separate how dock_state and tablet_mode is handled in a cleaner
    manner.
    
    All changes were validated on a HP ZBook Workstation notebook,
    HP EliteBook x360, and HP EliteBook 850 G8.
    Signed-off-by: default avatarJorge Lopez <jorge.lopez2@hp.com>
    Link: https://lore.kernel.org/r/20220310210853.28367-3-jorge.lopez2@hp.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    520ee4ea
hp-wmi.c 33.3 KB