Skip to content

Commit 40c3a44

Browse files
MisterZ42groeck
authored andcommitted
hwmon: add Corsair Commander Pro driver
This is v7 of a driver for the Corsair Commander Pro. It provides sysfs attributes for: - Reading fan speed - Reading temp sensors - Reading voltage values - Writing pwm and reading last written pwm - Reading fan and temp connection status It is an usb driver, so it needs to be ignored by usbhid. The Corsair Commander Pro is a fan controller and provides no means for user interaction. The two device numbers are there, because there is a slightly different version of the same device. (Only difference seem to be in some presets.) Squashed: hwmon: (corsair-cpro) add fan_target This adds fan_target entries to the corsair-cpro driver. Reading the attribute from the device does not seem possible, so it returns the last set value (same as pwm). send_usb_cmd now has one more argument, which is needed for the fan_target command. hwmon: corsair-cpro: Change to HID driver This changes corsair-cpro to a hid driver using hid reports. Signed-off-by: Marius Zachmann <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] [groeck: Squashed follow-up patches to avoid changes in HID code] Signed-off-by: Guenter Roeck <[email protected]>
1 parent a686024 commit 40c3a44

File tree

6 files changed

+618
-0
lines changed

6 files changed

+618
-0
lines changed

Documentation/hwmon/corsair-cpro.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
Kernel driver corsair-cpro
4+
==========================
5+
6+
Supported devices:
7+
8+
* Corsair Commander Pro
9+
* Corsair Commander Pro (1000D)
10+
11+
Author: Marius Zachmann
12+
13+
Description
14+
-----------
15+
16+
This driver implements the sysfs interface for the Corsair Commander Pro.
17+
The Corsair Commander Pro is a USB device with 6 fan connectors,
18+
4 temperature sensor connectors and 2 Corsair LED connectors.
19+
It can read the voltage levels on the SATA power connector.
20+
21+
Usage Notes
22+
-----------
23+
24+
Since it is a USB device, hotswapping is possible. The device is autodetected.
25+
26+
Sysfs entries
27+
-------------
28+
29+
======================= =====================================================================
30+
in0_input Voltage on SATA 12v
31+
in1_input Voltage on SATA 5v
32+
in2_input Voltage on SATA 3.3v
33+
temp[1-4]_input Temperature on connected temperature sensors
34+
fan[1-6]_input Connected fan rpm.
35+
fan[1-6]_label Shows fan type as detected by the device.
36+
fan[1-6]_target Sets fan speed target rpm.
37+
When reading, it reports the last value if it was set by the driver.
38+
Otherwise returns 0.
39+
pwm[1-6] Sets the fan speed. Values from 0-255.
40+
When reading, it reports the last value if it was set by the driver.
41+
Otherwise returns 0.
42+
======================= =====================================================================

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Hardware Monitoring Kernel Drivers
4747
bel-pfe
4848
bt1-pvt
4949
coretemp
50+
corsair-cpro
5051
da9052
5152
da9055
5253
dell-smm-hwmon

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,6 +4401,12 @@ S: Maintained
44014401
F: Documentation/hwmon/coretemp.rst
44024402
F: drivers/hwmon/coretemp.c
44034403

4404+
CORSAIR-CPRO HARDWARE MONITOR DRIVER
4405+
M: Marius <[email protected]>
4406+
4407+
S: Maintained
4408+
F: drivers/hwmon/corsair-cpro.c
4409+
44044410
COSA/SRP SYNC SERIAL DRIVER
44054411
M: Jan "Yenya" Kasprzak <[email protected]>
44064412
S: Maintained

drivers/hwmon/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,16 @@ config SENSORS_BT1_PVT_ALARMS
439439
the data conversion will be periodically performed and the data will be
440440
saved in the internal driver cache.
441441

442+
config SENSORS_CORSAIR_CPRO
443+
tristate "Corsair Commander Pro controller"
444+
depends on HID
445+
help
446+
If you say yes here you get support for the Corsair Commander Pro
447+
controller.
448+
449+
This driver can also be built as a module. If so, the module
450+
will be called corsair-cpro.
451+
442452
config SENSORS_DRIVETEMP
443453
tristate "Hard disk drives with temperature sensors"
444454
depends on SCSI && ATA

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
5656
obj-$(CONFIG_SENSORS_AXI_FAN_CONTROL) += axi-fan-control.o
5757
obj-$(CONFIG_SENSORS_BT1_PVT) += bt1-pvt.o
5858
obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o
59+
obj-$(CONFIG_SENSORS_CORSAIR_CPRO) += corsair-cpro.o
5960
obj-$(CONFIG_SENSORS_DA9052_ADC)+= da9052-hwmon.o
6061
obj-$(CONFIG_SENSORS_DA9055)+= da9055-hwmon.o
6162
obj-$(CONFIG_SENSORS_DELL_SMM) += dell-smm-hwmon.o

0 commit comments

Comments
 (0)