aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/laptops
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2017-06-20 20:45:13 -0700
committerDarren Hart (VMware) <dvhart@infradead.org>2017-08-18 15:57:24 -0700
commit6b99e3569ba17b9fd38514d66591ae728b778e3b (patch)
tree6ce0db7daf6022f9e8433e1de46377a75991d3ee /Documentation/laptops
parentplatform/x86: wmi: Fix check for method instance number (diff)
downloadlinux-dev-6b99e3569ba17b9fd38514d66591ae728b778e3b.tar.xz
linux-dev-6b99e3569ba17b9fd38514d66591ae728b778e3b.zip
platform/x86: thinkpad_acpi: Fix warning about deprecated hwmon_device_register
Use hwmon_device_register_with_groups instead of deprecated hwmon_device_register and fix a dmesg warning. This patch however changes the userspace API. hwmon_device_register_with_groups takes `hwmon' name as an argument and creates a name file in the `hwmon' device, not in the `platform_device'. This allows us to remove custom `name' device attribute, but in order to make lm-sensors happy we also have to move fans and thermal attributes to the `hwmon' device. Even though this patch changes userspace API, it's still compatible with the lm-sensors. Starting with lm-sensors 3.0 (circa 2007), it looks at both hwmon and the backing device for the name and other attributes. before: $ cat /sys/devices/platform/thinkpad_hwmon/{name,fan1_input} thinkpad 2007 $ cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/{name,fan1_input} cat: /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/name: No such file or directory cat: /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/fan1_input: No such file or directory $ cat /sys/class/hwmon/hwmon1/{name,fan1_input} cat: /sys/class/hwmon/hwmon1/name: No such file or directory cat: /sys/class/hwmon/hwmon1/fan1_input: No such file or directory $ sensors thinkpad-isa-0000 Adapter: ISA adapter fan1: 3533 RPM after: $ cat /sys/devices/platform/thinkpad_hwmon/{name,fan1_input} cat: /sys/devices/platform/thinkpad_hwmon/name: No such file or directory cat: /sys/devices/platform/thinkpad_hwmon/fan1_input: No such file or directory $ cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/{name,fan1_input} thinkpad 3478 $ cat /sys/class/hwmon/hwmon1/{name,fan1_input} thinkpad 3478 $ sensors thinkpad-isa-0000 Adapter: ISA adapter fan1: 3489 RPM $ sensors -v sensors version 3.4.0 with libsensors version 3.4.0 Signed-off-by: Stanislav Fomichev <kernel@fomichev.me> [dvhart: cleaned up commit log, bumped version to 4.14 in the doc change] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'Documentation/laptops')
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index ba2e7d254842..00b6dfed573c 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -121,8 +121,9 @@ space, for 2.6.23+ this is /sys/devices/platform/thinkpad_acpi/.
Sysfs device attributes for the sensors and fan are on the
thinkpad_hwmon device's sysfs attribute space, but you should locate it
looking for a hwmon device with the name attribute of "thinkpad", or
-better yet, through libsensors.
-
+better yet, through libsensors. For 4.14+ sysfs attributes were moved to the
+hwmon device (/sys/bus/platform/devices/thinkpad_hwmon/hwmon/hwmon? or
+/sys/class/hwmon/hwmon?).
Driver version
--------------
@@ -1478,3 +1479,7 @@ Sysfs interface changelog:
0x020700: Support for mute-only mixers.
Volume control in read-only mode by default.
Marker for ALSA mixer support.
+
+0x030000: Thermal and fan sysfs attributes were moved to the hwmon
+ device instead of being attached to the backing platform
+ device.