Commit 40c3a445 authored by Marius Zachmann's avatar Marius Zachmann Committed by Guenter Roeck
Browse files

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: default avatarMarius Zachmann <mail@mariuszachmann.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200626055936.4441-1-mail@mariuszachmann.de
Link: https://lore.kernel.org/r/20200709141413.30790-1-mail@mariuszachmann.de


[groeck: Squashed follow-up patches to avoid changes in HID code]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent a686024e
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver corsair-cpro
==========================

Supported devices:

  * Corsair Commander Pro
  * Corsair Commander Pro (1000D)

Author: Marius Zachmann

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

This driver implements the sysfs interface for the Corsair Commander Pro.
The Corsair Commander Pro is a USB device with 6 fan connectors,
4 temperature sensor connectors and 2 Corsair LED connectors.
It can read the voltage levels on the SATA power connector.

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

Since it is a USB device, hotswapping is possible. The device is autodetected.

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

======================= =====================================================================
in0_input		Voltage on SATA 12v
in1_input		Voltage on SATA 5v
in2_input		Voltage on SATA 3.3v
temp[1-4]_input		Temperature on connected temperature sensors
fan[1-6]_input		Connected fan rpm.
fan[1-6]_label		Shows fan type as detected by the device.
fan[1-6]_target		Sets fan speed target rpm.
			When reading, it reports the last value if it was set by the driver.
			Otherwise returns 0.
pwm[1-6]		Sets the fan speed. Values from 0-255.
			When reading, it reports the last value if it was set by the driver.
			Otherwise returns 0.
======================= =====================================================================
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ Hardware Monitoring Kernel Drivers
   bel-pfe
   bt1-pvt
   coretemp
   corsair-cpro
   da9052
   da9055
   dell-smm-hwmon
+6 −0
Original line number Diff line number Diff line
@@ -4401,6 +4401,12 @@ S: Maintained
F:	Documentation/hwmon/coretemp.rst
F:	drivers/hwmon/coretemp.c
CORSAIR-CPRO HARDWARE MONITOR DRIVER
M:	Marius  <mail@mariuszachmann.de>
L:	linux-hwmon@vger.kernel.org
S:	Maintained
F:	drivers/hwmon/corsair-cpro.c
COSA/SRP SYNC SERIAL DRIVER
M:	Jan "Yenya" Kasprzak <kas@fi.muni.cz>
S:	Maintained
+10 −0
Original line number Diff line number Diff line
@@ -439,6 +439,16 @@ config SENSORS_BT1_PVT_ALARMS
	  the data conversion will be periodically performed and the data will be
	  saved in the internal driver cache.

config SENSORS_CORSAIR_CPRO
	tristate "Corsair Commander Pro controller"
	depends on HID
	help
	  If you say yes here you get support for the Corsair Commander Pro
	  controller.

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

config SENSORS_DRIVETEMP
	tristate "Hard disk drives with temperature sensors"
	depends on SCSI && ATA
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
obj-$(CONFIG_SENSORS_AXI_FAN_CONTROL) += axi-fan-control.o
obj-$(CONFIG_SENSORS_BT1_PVT)	+= bt1-pvt.o
obj-$(CONFIG_SENSORS_CORETEMP)	+= coretemp.o
obj-$(CONFIG_SENSORS_CORSAIR_CPRO) += corsair-cpro.o
obj-$(CONFIG_SENSORS_DA9052_ADC)+= da9052-hwmon.o
obj-$(CONFIG_SENSORS_DA9055)+= da9055-hwmon.o
obj-$(CONFIG_SENSORS_DELL_SMM)	+= dell-smm-hwmon.o
Loading