Skip to content

Commit 9855caf

Browse files
mmindlag-linaro
authored andcommitted
hwmon: add driver for the hwmon parts of qnap-mcu devices
The MCU can be found on network-attached-storage devices made by QNAP and provides access to fan control including reading back its RPM as well as reading the temperature of the NAS case. Signed-off-by: Heiko Stuebner <[email protected]> Acked-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent bb7e361 commit 9855caf

File tree

6 files changed

+406
-0
lines changed

6 files changed

+406
-0
lines changed

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ Hardware Monitoring Kernel Drivers
201201
pxe1610
202202
pwm-fan
203203
q54sj108a2
204+
qnap-mcu-hwmon
204205
raspberrypi-hwmon
205206
sbrmi
206207
sbtsi_temp
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
Kernel driver qnap-mcu-hwmon
4+
============================
5+
6+
This driver enables the use of the hardware monitoring and fan control
7+
of the MCU used on some QNAP network attached storage devices.
8+
9+
Author: Heiko Stuebner <[email protected]>
10+
11+
Description
12+
-----------
13+
14+
The driver implements a simple interface for driving the fan controlled by
15+
setting its PWM output value and exposes the fan rpm and case-temperature
16+
to user space through hwmon's sysfs interface.
17+
18+
The fan rotation speed returned via the optional 'fan1_input' is calculated
19+
inside the MCU device.
20+
21+
The driver provides the following sensor accesses in sysfs:
22+
23+
=============== ======= =======================================================
24+
fan1_input ro fan tachometer speed in RPM
25+
pwm1 rw relative speed (0-255), 255=max. speed.
26+
temp1_input ro Measured temperature in millicelsius
27+
=============== ======= =======================================================

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19108,6 +19108,7 @@ F: drivers/media/tuners/qm1d1c0042*
1910819108
QNAP MCU DRIVER
1910919109
M: Heiko Stuebner <[email protected]>
1911019110
S: Maintained
19111+
F: drivers/hwmon/qnap-mcu-hwmon.c
1911119112
F: drivers/input/misc/qnap-mcu-input.c
1911219113
F: drivers/leds/leds-qnap-mcu.c
1911319114
F: drivers/mfd/qnap-mcu.c

drivers/hwmon/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,6 +1822,18 @@ config SENSORS_PWM_FAN
18221822
This driver can also be built as a module. If so, the module
18231823
will be called pwm-fan.
18241824

1825+
config SENSORS_QNAP_MCU_HWMON
1826+
tristate "QNAP MCU hardware monitoring"
1827+
depends on MFD_QNAP_MCU
1828+
depends on THERMAL || THERMAL=n
1829+
help
1830+
Say yes here to enable support for fan and temperature sensor
1831+
connected to a QNAP MCU, as found in a number of QNAP network
1832+
attached storage devices.
1833+
1834+
This driver can also be built as a module. If so, the module
1835+
will be called qnap-mcu-hwmon.
1836+
18251837
config SENSORS_RASPBERRYPI_HWMON
18261838
tristate "Raspberry Pi voltage monitor"
18271839
depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE)

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ obj-$(CONFIG_SENSORS_POWERZ) += powerz.o
189189
obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o
190190
obj-$(CONFIG_SENSORS_PT5161L) += pt5161l.o
191191
obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
192+
obj-$(CONFIG_SENSORS_QNAP_MCU_HWMON) += qnap-mcu-hwmon.o
192193
obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o
193194
obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o
194195
obj-$(CONFIG_SENSORS_SBRMI) += sbrmi.o

0 commit comments

Comments
 (0)