• Enver Balalic's avatar
    platform/x86: hp-wmi: add support for omen laptops · 4c51ba9a
    Enver Balalic authored
    This patch adds support for HP Omen laptops.
    It adds support for most things that can be controlled via the
    Windows Omen Command Center application.
    
     - Fan speed monitoring through hwmon
     - Platform Profile support (cool, balanced, performance)
     - Max fan speed function toggle
    
    Also exposes the existing HDD temperature through hwmon since
    this driver didn't use hwmon before this patch.
    
    This patch has been tested on a 2020 HP Omen 15 (AMD) 15-en0023dx.
    
     - V1
       Initial Patch
     - V2
       Use standard hwmon ABI attributes
       Add existing non-standard "hddtemp" to hwmon
     - V3
       Fix overflow issue in "hp_wmi_get_fan_speed"
       Map max fan speed value back to hwmon values on read
       Code style fixes
       Fix issue with returning values from "hp_wmi_hwmon_read",
       the value to return should be written to val and not just
       returned from the function
     - V4
       Use DMI Board names to detect if a device should use the omen
       specific thermal profile method.
       Select HWMON instead of depending on it.
       Code style fixes.
       Replace some error codes with more specific/meaningful ones.
       Remove the HDD temperature from HWMON since we don't know what
       unit it's expressed in.
       Handle error from hp_wmi_hwmon_init
     - V5
       Handle possible NULL from dmi_get_system_info()
       Use match_string function instead of manually checking
       Directly use is_omen_thermal_profile() without the static
       variable.
    Signed-off-by: default avatarEnver Balalic <balalic.enver@gmail.com>
    Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20210902182234.vtwl72n5rjql22qa@omen.localdomainReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    4c51ba9a
hp-wmi.c 32.6 KB