diff options
author | Armin Wolf <W_Armin@gmx.de> | 2022-02-15 20:11:10 +0100 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-02-28 02:03:19 +0100 |
commit | c82fdd42fb50d281f6c7268e136178f096af6c69 (patch) | |
tree | 0d3c3ad8390afaa09e375452bc3eb329703345c8 /drivers | |
parent | hwmon: (dell-smm) Make fan/temp sensor number a u8 (diff) | |
download | linux-c82fdd42fb50d281f6c7268e136178f096af6c69.tar.xz linux-c82fdd42fb50d281f6c7268e136178f096af6c69.zip |
hwmon: (dell-smm) Improve temperature sensors detection
On the Dell Inspiron 3505, three temperature sensors are
available through the SMM interface. However since they
do not have an associated type, they are not detected.
Probe for those sensors in case no type was detected.
_i8k_get_temp() is used instead of i8k_get_temp()
since it is sometimes faster and the result is
easier to check (no -ENODATA) since we do not
care about the actual temp value.
Tested on a Dell Inspiron 3505.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20220215191113.16640-5-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/dell-smm-hwmon.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c index 1cde005ff4e4..c5939e68586d 100644 --- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -651,6 +651,11 @@ static umode_t dell_smm_is_visible(const void *drvdata, enum hwmon_sensor_types case hwmon_temp: switch (attr) { case hwmon_temp_input: + /* _i8k_get_temp() is fine since we do not care about the actual value */ + if (data->temp_type[channel] >= 0 || _i8k_get_temp(channel) >= 0) + return 0444; + + break; case hwmon_temp_label: if (data->temp_type[channel] >= 0) return 0444; |