Commit 82e3430d authored by Jonas Malaco's avatar Jonas Malaco Committed by Guenter Roeck
Browse files

hwmon: add driver for NZXT Kraken X42/X52/X62/X72



These are "all-in-one" CPU liquid coolers that can be monitored and
controlled through a proprietary USB HID protocol.

While the models have differently sized radiators and come with varying
numbers of fans, they are all indistinguishable at the software level.

The driver exposes fan/pump speeds and coolant temperature through the
standard hwmon sysfs interface.

Fan and pump control, while supported by the devices, are not currently
exposed.  The firmware accepts up to 61 trip points per channel
(fan/pump), but the same set of trip temperatures has to be maintained
for both; with pwmX_auto_point_Y_temp attributes, users would need to
maintain this invariant themselves.

Instead, fan and pump control, as well as LED control (which the device
also supports for 9 addressable RGB LEDs on the CPU water block) are
left for existing and already mature user-space tools, which can still
be used alongside the driver, thanks to hidraw.  A link to one, which I
also maintain, is provided in the documentation.

The implementation is based on USB traffic analysis.  It has been
runtime tested on x86_64, both as a built-in driver and as a module.

Signed-off-by: default avatarJonas Malaco <jonas@protocubo.io>
Link: https://lore.kernel.org/r/20210319045544.416138-1-jonas@protocubo.io


[groeck: Removed unnecessary spinlock.h include]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent af9a9730
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ Hardware Monitoring Kernel Drivers
   npcm750-pwm-fan
   nsa320
   ntc_thermistor
   nzxt-kraken2
   occ
   pc87360
   pc87427
+42 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver nzxt-kraken2
==========================

Supported devices:

* NZXT Kraken X42
* NZXT Kraken X52
* NZXT Kraken X62
* NZXT Kraken X72

Author: Jonas Malaco

Description
-----------

This driver enables hardware monitoring support for NZXT Kraken X42/X52/X62/X72
all-in-one CPU liquid coolers.  Three sensors are available: fan speed, pump
speed and coolant temperature.

Fan and pump control, while supported by the firmware, are not currently
exposed.  The addressable RGB LEDs, present in the integrated CPU water block
and pump head, are not supported either.  But both features can be found in
existing user-space tools (e.g. `liquidctl`_).

.. _liquidctl: https://github.com/liquidctl/liquidctl

Usage Notes
-----------

As these are USB HIDs, the driver can be loaded automatically by the kernel and
supports hot swapping.

Sysfs entries
-------------

=======================	========================================================
fan1_input		Fan speed (in rpm)
fan2_input		Pump speed (in rpm)
temp1_input		Coolant temperature (in millidegrees Celsius)
=======================	========================================================
+7 −0
Original line number Diff line number Diff line
@@ -12911,6 +12911,13 @@ L: linux-nfc@lists.01.org (moderated for non-subscribers)
S:	Supported
F:	drivers/nfc/nxp-nci
NZXT-KRAKEN2 HARDWARE MONITORING DRIVER
M:	Jonas Malaco <jonas@protocubo.io>
L:	linux-hwmon@vger.kernel.org
S:	Maintained
F:	Documentation/hwmon/nzxt-kraken2.rst
F:	drivers/hwmon/nzxt-kraken2.c
OBJAGG
M:	Jiri Pirko <jiri@nvidia.com>
L:	netdev@vger.kernel.org
+10 −0
Original line number Diff line number Diff line
@@ -1492,6 +1492,16 @@ config SENSORS_NSA320
	  This driver can also be built as a module. If so, the module
	  will be called nsa320-hwmon.

config SENSORS_NZXT_KRAKEN2
	tristate "NZXT Kraken X42/X51/X62/X72 liquid coolers"
	depends on USB_HID
	help
	  If you say yes here you get support for hardware monitoring for the
	  NZXT Kraken X42/X52/X62/X72 all-in-one CPU liquid coolers.

	  This driver can also be built as a module. If so, the module
	  will be called nzxt-kraken2.

source "drivers/hwmon/occ/Kconfig"

config SENSORS_PCF8591
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ obj-$(CONFIG_SENSORS_NCT7904) += nct7904.o
obj-$(CONFIG_SENSORS_NPCM7XX)	+= npcm750-pwm-fan.o
obj-$(CONFIG_SENSORS_NSA320)	+= nsa320-hwmon.o
obj-$(CONFIG_SENSORS_NTC_THERMISTOR)	+= ntc_thermistor.o
obj-$(CONFIG_SENSORS_NZXT_KRAKEN2) += nzxt-kraken2.o
obj-$(CONFIG_SENSORS_PC87360)	+= pc87360.o
obj-$(CONFIG_SENSORS_PC87427)	+= pc87427.o
obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591.o
Loading