hwmon: (dell-smm) Support additional attributes
Subsystems (3)
v2 cover hwmon: (dell-smm) Support additional attributes
From: Armin Wolf <[email protected]>
This patch series adds support for fanX_min, fanX_max and fanX_target. A second patch also removes some unnecessary includes.
Both patches where tested on a Dell Inspiron 3505 and a Dell Latitude C600.
Changes in v2:
- update documentation
- prevent out-of-bounds read/write when module is loaded with custom fan_max value
Armin Wolf (2):
hwmon: (dell-smm) Add support for fanX_min, fanX_max and fanX_target
hwmon: (dell-smm) Remove unnecessary includes
Documentation/hwmon/dell-smm-hwmon.rst | 3 ++ drivers/hwmon/dell-smm-hwmon.c | 65 ++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 8 deletions(-)
--
2.20.1
PATCH v2 1/2 hwmon: (dell-smm) Add support for fanX_min, fanX_max and fanX_target
From: Armin Wolf <[email protected]>
The nominal speed of each fan can be obtained with i8k_get_fan_nominal_speed(), however the result is not available from userspace.
Change that by adding fanX_min, fanX_max and fanX_target attributes. All are RO since fan control happens over pwm.
Tested on a Dell Inspiron 3505 and a Dell Latitude C600.
--- Documentation/hwmon/dell-smm-hwmon.rst | 3 ++ drivers/hwmon/dell-smm-hwmon.c | 63 +++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 6 deletions(-)
Documentation/hwmon/dell-smm-hwmon.rst +3 -0
@@ -34,6 +34,9 @@ Name Perm Description =============================== ======= ======================================= fan[1-3]_input RO Fan speed in RPM. fan[1-3]_label RO Fan label. +fan[1-3]_min RO Minimal Fan speed in RPM +fan[1-3]_max RO Maximal Fan speed in RPM +fan[1-3]_target RO Expected Fan speed in RPM pwm[1-3] RW Control the fan PWM duty-cycle. pwm1_enable WO Enable or disable automatic BIOS fan control (not supported on all laptops,
drivers/hwmon/dell-smm-hwmon.c +57 -6
99 lines not on this page · raw message
--
2.20.1
PATCH v2 2/2 hwmon: (dell-smm) Remove unnecessary includes
In reply to [email protected]From: Armin Wolf <[email protected]>
sched.h and io.h are not used anywhere in dell-smm-hwmon.c.
--- drivers/hwmon/dell-smm-hwmon.c | 2 -- 1 file changed, 2 deletions(-)
drivers/hwmon/dell-smm-hwmon.c +0 -2
@@ -26,8 +26,6 @@#include <linux/mutex.h> #include <linux/hwmon.h> #include <linux/uaccess.h> -#include <linux/io.h> -#include <linux/sched.h> #include <linux/ctype.h> #include <linux/smp.h>
--
2.20.1
Re: [PATCH v2 2/2] hwmon: (dell-smm) Remove unnecessary includes
Quoted 5 lines · On Friday 24 September 2021 13:45:05 [email protected] wrote:
From: Armin Wolf <[email protected]>
sched.handio.hare not used anywhere indell-smm-hwmon.c.Signed-off-by Armin Wolf <[email protected]>
sched.h is not used anymore as driver now calls smp_call_on_cpu() function.
Quoted 20 lines
--- drivers/hwmon/dell-smm-hwmon.c | 2 -- 1 file changed, 2 deletions(-)drivers/hwmon/dell-smm-hwmon.c +0
-3@@ -26,8 +26,6 @@#include <linux/mutex.h> #include <linux/hwmon.h> #include <linux/uaccess.h> -#include <linux/io.h> -#include <linux/sched.h> #include <linux/ctype.h> #include <linux/smp.h> --2.20.1