hwmon: (corsair-psu) update Series 2022 and 2023 support
authorWilken Gottwalt <wilken.gottwalt@posteo.net>
Sat, 24 Jun 2023 10:14:07 +0000 (10:14 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 24 Jun 2023 15:47:29 +0000 (08:47 -0700)
The series 2022/2023 reports slightly longer vendor/product strings
and shares USB ids. Technically the reply size is the USB HID packet
size (64 bytes) but all the supported commands do not use more than 8
bytes and replies reporting back strings do not use more then 24 bytes
(vendor and product are in one string in the newer devices now). The
rest of the reply is always filled with '\0'. Also update comments
and documentation accordingly.

Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Link: https://lore.kernel.org/r/ZJbB72CAPmLflhHG@monster.localdomain
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/corsair-psu.rst
drivers/hwmon/corsair-psu.c

index 47f8ff6..16db34d 100644 (file)
@@ -15,11 +15,11 @@ Supported devices:
 
   Corsair HX850i
 
-  Corsair HX1000i (Series 2022 and Series 2023)
+  Corsair HX1000i (Series 2022 and 2023)
 
   Corsair HX1200i
 
-  Corsair HX1500i (Series 2022)
+  Corsair HX1500i (Series 2022 and 2023)
 
   Corsair RM550i
 
@@ -80,11 +80,14 @@ temp2_crit          Temperature max critical value of psu case
 Usage Notes
 -----------
 
-It is an USB HID device, so it is auto-detected and supports hot-swapping.
+It is an USB HID device, so it is auto-detected, supports hot-swapping and
+several devices at once.
 
 Flickering values in the rail voltage levels can be an indicator for a failing
-PSU. The driver also provides some additional useful values via debugfs, which
-do not fit into the hwmon class.
+PSU. Accordingly to the default automatic fan speed plan the fan starts at about
+30% of the wattage rating. If this does not happen, a fan failure is likely. The
+driver also provides some additional useful values via debugfs, which do not fit
+into the hwmon class.
 
 Debugfs entries
 ---------------
index 9e3e3c0..9048905 100644 (file)
  *     - the driver supports debugfs for values not fitting into the hwmon class
  *     - not every device class (HXi or RMi) supports all commands
  *     - if configured wrong the PSU resets or shuts down, often before actually hitting the
- *     - reported critical temperature
+ *       reported critical temperature
+ *     - new models like HX1500i Series 2023 have changes in the reported vendor and product
+ *       strings, both are slightly longer now, report vendor and product in one string and are
+ *       the same now
  */
 
 #define DRIVER_NAME            "corsair-psu"
 
-#define REPLY_SIZE             16 /* max length of a reply to a single command */
+#define REPLY_SIZE             24 /* max length of a reply to a single command */
 #define CMD_BUFFER_SIZE                64
 #define CMD_TIMEOUT_MS         250
 #define SECONDS_PER_HOUR       (60 * 60)
@@ -880,7 +883,7 @@ static const struct hid_device_id corsairpsu_idtable[] = {
        { HID_USB_DEVICE(0x1b1c, 0x1c0c) }, /* Corsair RM850i */
        { HID_USB_DEVICE(0x1b1c, 0x1c0d) }, /* Corsair RM1000i */
        { HID_USB_DEVICE(0x1b1c, 0x1c1e) }, /* Corsair HX1000i Series 2023 */
-       { HID_USB_DEVICE(0x1b1c, 0x1c1f) }, /* Corsair HX1500i Series 2022 */
+       { HID_USB_DEVICE(0x1b1c, 0x1c1f) }, /* Corsair HX1500i Series 2022 and 2023 */
        { },
 };
 MODULE_DEVICE_TABLE(hid, corsairpsu_idtable);