aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/linux
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2020-02-28 23:42:50 +0100
committerChristian Lamparter <chunkeey@gmail.com>2020-03-21 17:48:34 +0100
commitd107aaa910dccf4c748b788eb9b248a399a761de (patch)
treecb41aa68e654667d1dc0cdb2c256a044368d33db /package/kernel/linux
parentdcef8d6093cd54aa990a5ae0099a16e88a18dfbd (diff)
downloadupstream-d107aaa910dccf4c748b788eb9b248a399a761de.tar.gz
upstream-d107aaa910dccf4c748b788eb9b248a399a761de.tar.bz2
upstream-d107aaa910dccf4c748b788eb9b248a399a761de.zip
kernel: backport and package drivetemp hwmon from v5.5
This patch backports the hwmon drivetemp sensor module from vanilla linux 5.5 to be available on OpenWrt's 5.4 kernel. Extract from The upstream commit by Guenter Roeck <linux@roeck-us.net>: hwmon: Driver for disk and solid state drives with temperature sensors "Reading the temperature of ATA drives has been supported for years by userspace tools such as smarttools or hddtemp. The downside of such tools is that they need to run with super-user privilege, that the temperatures are not reported by standard tools such as 'sensors' or 'libsensors', and that drive temperatures are not available for use in the kernel's thermal subsystem. This driver solves this problem by adding support for reading the temperature of ATA drives from the kernel using the hwmon API and by adding a temperature zone for each drive. With this driver, the hard disk temperature can be read [...] using sysfs: $ grep . /sys/class/hwmon/hwmon9/{name,temp1_input} /sys/class/hwmon/hwmon9/name:drivetemp /sys/class/hwmon/hwmon9/temp1_input:23000 If the drive supports SCT transport and reports temperature limits, those are reported as well. drivetemp-scsi-0-0 Adapter: SCSI adapter temp1: +27.0<C2><B0>C (low = +0.0<C2><B0>C, high = +60.0<C2><B0>C) (crit low = -41.0<C2><B0>C, crit = +85.0<C2><B0>C) (lowest = +23.0<C2><B0>C, highest = +34.0<C2><B0>C) The driver attempts to use SCT Command Transport to read the drive temperature. If the SCT Command Transport feature set is not available, or if it does not report the drive temperature, drive temperatures may be readable through SMART attributes. Since SMART attributes are not well defined, this method is only used as fallback mechanism." This patch incorperates a patch made by Linus Walleij: 820-libata-Assign-OF-node-to-the-SCSI-device.patch This patch is necessary in order to wire-up the drivetemp sensor into the device tree's thermal-zones. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'package/kernel/linux')
-rw-r--r--package/kernel/linux/modules/hwmon.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk
index 73b448022d..1f4e4558a9 100644
--- a/package/kernel/linux/modules/hwmon.mk
+++ b/package/kernel/linux/modules/hwmon.mk
@@ -77,6 +77,21 @@ endef
$(eval $(call KernelPackage,hwmon-adt7475))
+define KernelPackage/hwmon-drivetemp
+ TITLE:=Hard disk drives with temperature sensor
+ KCONFIG:=CONFIG_SENSORS_DRIVETEMP
+ FILES:=$(LINUX_DIR)/drivers/hwmon/drivetemp.ko
+ AUTOLOAD:=$(call AutoLoad,60,drivetemp)
+ $(call AddDepends/hwmon,+kmod-ata-core +kmod-scsi-core)
+endef
+
+define KernelPackage/hwmon-drivetemp/description
+ Kernel module for Hard disk drives with temperature sensor
+endef
+
+$(eval $(call KernelPackage,hwmon-drivetemp))
+
+
define KernelPackage/hwmon-gpiofan
TITLE:=Generic GPIO FAN support
KCONFIG:=CONFIG_SENSORS_GPIO_FAN