• Giovanni Mascellani's avatar
    hwmon: (dell-smm) Add support for disabling automatic BIOS fan control · afe45277
    Giovanni Mascellani authored
    This patch exports standard hwmon pwmX_enable sysfs attribute for
    enabling or disabling automatic fan control by BIOS. Standard value
    "1" is for disabling automatic BIOS fan control and value "2" for
    enabling.
    
    By default BIOS auto mode is enabled by laptop firmware.
    
    When BIOS auto mode is enabled, custom fan speed value (set via hwmon
    pwmX sysfs attribute) is overwritten by SMM in few seconds and
    therefore any custom settings are without effect. So this is reason
    why implementing option for disabling BIOS auto mode is needed.
    
    So finally this patch allows kernel to set and control fan speed on
    laptops, but it can be dangerous (like setting speed of other fans).
    
    The SMM commands to enable or disable automatic fan control are not
    documented and are not the same on all Dell laptops. Therefore a
    whitelist is used to send the correct codes only on laptopts for which
    they are known.
    
    This patch was originally developed by Pali Rohár; later Giovanni
    Mascellani implemented the whitelist.
    Signed-off-by: default avatarGiovanni Mascellani <gio@debian.org>
    Co-Developed-by: default avatarPali Rohár <pali.rohar@gmail.com>
    Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
    Link: https://lore.kernel.org/r/20191122101519.1246458-1-gio@debian.org
    [groeck: Fixed checkpatch warnings]
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    afe45277
dell-smm-hwmon.c 32 KB