History log of /linux-master/drivers/hwmon/corsair-cpro.c
Revision Date Author Comments
# b4498792 10-Dec-2023 Marius Zachmann <mail@mariuszachmann.de>

hwmon: (corsair-cpro) use NULL instead of 0

Replaces the integer 0 with NULL.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312100455.k6m2eO4N-lkp@intel.com/
Signed-off-by: Marius Zachmann <mail@mariuszachmann.de>
Link: https://lore.kernel.org/r/20231210220357.77036-1-mail@mariuszachmann.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 42bd7a59 06-Apr-2023 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

hwmon: corsair: constify pointers to hwmon_channel_info

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 3752445d 19-Nov-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

hwmon: (corsair-cpro) Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Acked-by: Guenter Roeck <linux@roeck-us.net>
Marius Zachmann <mail@mariuszachmann.de>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# fa4dac3e 21-Jul-2020 Marius Zachmann <mail@mariuszachmann.de>

hwmon: (corsair-cpro) add reading pwm values

This adds the possibility for reading pwm values.
These can not be read if the device is controlled via
fan_target or a fan curve and will return an error in
this case. Since an error is expected, this adds some
rudimentary error handling.

Changes:
- add CTL_GET_FAN_PWM and use it via get_data
- pwm returns -ENODATA if the device returns error 0x12
- fan_target now returns -ENODATA when the driver is
started or a pwm value is set.
- add ccp_get_errno to determine errno from device error.
- get_data now has a parameter to determine whether
to read one or two bytes of data.
- update documentation
- fix missing surname in MAINTAINERS

Signed-off-by: Marius Zachmann <mail@mariuszachmann.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 40c3a445 25-Jun-2020 Marius Zachmann <mail@mariuszachmann.de>

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 <mail@mariuszachmann.de>
Reviewed-by: Guenter 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: Guenter Roeck <linux@roeck-us.net>