]> asedeno.scripts.mit.edu Git - linux.git/commit
hwmon: (dell-smm) Add support for disabling automatic BIOS fan control
authorGiovanni Mascellani <gio@debian.org>
Fri, 22 Nov 2019 10:15:18 +0000 (11:15 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 23 Nov 2019 04:08:58 +0000 (20:08 -0800)
commitafe45277ade62438db8af8bbd812ead453b5d98d
tree3ab9d807ac1194072f7eb2286784af4a0f82eb0f
parent59dfa75e5d82a1e1b3d090a1d51fc14f66844576
hwmon: (dell-smm) Add support for disabling automatic BIOS fan control

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: Giovanni Mascellani <gio@debian.org>
Co-Developed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pali 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: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/dell-smm-hwmon.c