summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/corsair-cpro.c
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (corsair-cpro) use NULL instead of 0Marius Zachmann2023-12-111-1/+1
| | | | | | | | | | 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>
* hwmon: corsair: constify pointers to hwmon_channel_infoKrzysztof Kozlowski2023-04-191-1/+1
| | | | | | | | 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>
* hwmon: (corsair-cpro) Fix fall-through warnings for ClangGustavo A. R. Silva2021-05-171-0/+1
| | | | | | | | | | | 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>
* hwmon: (corsair-cpro) add reading pwm valuesMarius Zachmann2020-07-241-20/+44
| | | | | | | | | | | | | | | | | | | | | | 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>
* hwmon: add Corsair Commander Pro driverMarius Zachmann2020-07-241-0/+558
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>