1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * corsair-psu.c - Linux driver for Corsair power supplies with HID sensors interface
7 #include <linux/completion.h>
8 #include <linux/debugfs.h>
9 #include <linux/errno.h>
10 #include <linux/hid.h>
11 #include <linux/hwmon.h>
12 #include <linux/hwmon-sysfs.h>
13 #include <linux/jiffies.h>
14 #include <linux/kernel.h>
15 #include <linux/module.h>
16 #include <linux/mutex.h>
17 #include <linux/slab.h>
18 #include <linux/types.h>
21 * Corsair protocol for PSUs
23 * message size = 64 bytes (request and response, little endian)
25 * [length][command][param0][param1][paramX]...
27 * [echo of length][echo of command][data0][data1][dataX]...
29 * - commands are byte sized opcodes
30 * - length is the sum of all bytes of the commands/params
31 * - the micro-controller of most of these PSUs support concatenation in the request and reply,
32 * but it is better to not rely on this (it is also hard to parse)
33 * - the driver uses raw events to be accessible from userspace (though this is not really
34 * supported, it is just there for convenience, may be removed in the future)
35 * - a reply always start with the length and command in the same order the request used it
36 * - length of the reply data is specific to the command used
37 * - some of the commands work on a rail and can be switched to a specific rail (0 = 12v,
39 * - the format of the init command 0xFE is swapped length/command bytes
40 * - parameter bytes amount and values are specific to the command (rail setting is the only
41 * for now that uses non-zero values)
42 * - there are much more commands, especially for configuring the device, but they are not
43 * supported because a wrong command/length can lockup the micro-controller
44 * - the driver supports debugfs for values not fitting into the hwmon class
45 * - not every device class (HXi, RMi or AXi) supports all commands
46 * - it is a pure sensors reading driver (will not support configuring)
49 #define DRIVER_NAME "corsair-psu"
51 #define REPLY_SIZE 16 /* max length of a reply to a single command */
52 #define CMD_BUFFER_SIZE 64
53 #define CMD_TIMEOUT_MS 250
54 #define SECONDS_PER_HOUR (60 * 60)
55 #define SECONDS_PER_DAY (SECONDS_PER_HOUR * 24)
56 #define RAIL_COUNT 3 /* 3v3 + 5v + 12v */
58 #define OCP_MULTI_RAIL 0x02
60 #define PSU_CMD_SELECT_RAIL 0x00 /* expects length 2 */
61 #define PSU_CMD_RAIL_VOLTS_HCRIT 0x40 /* the rest of the commands expect length 3 */
62 #define PSU_CMD_RAIL_VOLTS_LCRIT 0x44
63 #define PSU_CMD_RAIL_AMPS_HCRIT 0x46
64 #define PSU_CMD_TEMP_HCRIT 0x4F
65 #define PSU_CMD_IN_VOLTS 0x88
66 #define PSU_CMD_IN_AMPS 0x89
67 #define PSU_CMD_RAIL_VOLTS 0x8B
68 #define PSU_CMD_RAIL_AMPS 0x8C
69 #define PSU_CMD_TEMP0 0x8D
70 #define PSU_CMD_TEMP1 0x8E
71 #define PSU_CMD_FAN 0x90
72 #define PSU_CMD_RAIL_WATTS 0x96
73 #define PSU_CMD_VEND_STR 0x99
74 #define PSU_CMD_PROD_STR 0x9A
75 #define PSU_CMD_TOTAL_UPTIME 0xD1
76 #define PSU_CMD_UPTIME 0xD2
77 #define PSU_CMD_OCPMODE 0xD8
78 #define PSU_CMD_TOTAL_WATTS 0xEE
79 #define PSU_CMD_INIT 0xFE
81 #define L_IN_VOLTS "v_in"
82 #define L_OUT_VOLTS_12V "v_out +12v"
83 #define L_OUT_VOLTS_5V "v_out +5v"
84 #define L_OUT_VOLTS_3_3V "v_out +3.3v"
85 #define L_IN_AMPS "curr in"
86 #define L_AMPS_12V "curr +12v"
87 #define L_AMPS_5V "curr +5v"
88 #define L_AMPS_3_3V "curr +3.3v"
89 #define L_FAN "psu fan"
90 #define L_TEMP0 "vrm temp"
91 #define L_TEMP1 "case temp"
92 #define L_WATTS "power total"
93 #define L_WATTS_12V "power +12v"
94 #define L_WATTS_5V "power +5v"
95 #define L_WATTS_3_3V "power +3.3v"
97 static const char *const label_watts[] = {
104 static const char *const label_volts[] = {
111 static const char *const label_amps[] = {
118 struct corsairpsu_data {
119 struct hid_device *hdev;
120 struct device *hwmon_dev;
121 struct dentry *debugfs;
122 struct completion wait_completion;
123 struct mutex lock; /* for locking access to cmd_buffer */
125 char vendor[REPLY_SIZE];
126 char product[REPLY_SIZE];
127 long temp_crit[TEMP_COUNT];
128 long in_crit[RAIL_COUNT];
129 long in_lcrit[RAIL_COUNT];
130 long curr_crit[RAIL_COUNT];
131 u8 temp_crit_support;
134 u8 curr_crit_support;
135 bool in_curr_cmd_support; /* not all commands are supported on every PSU */
138 /* some values are SMBus LINEAR11 data which need a conversion */
139 static int corsairpsu_linear11_to_int(const u16 val, const int scale)
141 const int exp = ((s16)val) >> 11;
142 const int mant = (((s16)(val & 0x7ff)) << 5) >> 5;
143 const int result = mant * scale;
145 return (exp >= 0) ? (result << exp) : (result >> -exp);
148 static int corsairpsu_usb_cmd(struct corsairpsu_data *priv, u8 p0, u8 p1, u8 p2, void *data)
153 memset(priv->cmd_buffer, 0, CMD_BUFFER_SIZE);
154 priv->cmd_buffer[0] = p0;
155 priv->cmd_buffer[1] = p1;
156 priv->cmd_buffer[2] = p2;
158 reinit_completion(&priv->wait_completion);
160 ret = hid_hw_output_report(priv->hdev, priv->cmd_buffer, CMD_BUFFER_SIZE);
164 time = wait_for_completion_timeout(&priv->wait_completion,
165 msecs_to_jiffies(CMD_TIMEOUT_MS));
170 * at the start of the reply is an echo of the send command/length in the same order it
171 * was send, not every command is supported on every device class, if a command is not
172 * supported, the length value in the reply is okay, but the command value is set to 0
174 if (p0 != priv->cmd_buffer[0] || p1 != priv->cmd_buffer[1])
178 memcpy(data, priv->cmd_buffer + 2, REPLY_SIZE);
183 static int corsairpsu_init(struct corsairpsu_data *priv)
186 * PSU_CMD_INIT uses swapped length/command and expects 2 parameter bytes, this command
187 * actually generates a reply, but we don't need it
189 return corsairpsu_usb_cmd(priv, PSU_CMD_INIT, 3, 0, NULL);
192 static int corsairpsu_fwinfo(struct corsairpsu_data *priv)
196 ret = corsairpsu_usb_cmd(priv, 3, PSU_CMD_VEND_STR, 0, priv->vendor);
200 ret = corsairpsu_usb_cmd(priv, 3, PSU_CMD_PROD_STR, 0, priv->product);
207 static int corsairpsu_request(struct corsairpsu_data *priv, u8 cmd, u8 rail, void *data)
211 mutex_lock(&priv->lock);
213 case PSU_CMD_RAIL_VOLTS_HCRIT:
214 case PSU_CMD_RAIL_VOLTS_LCRIT:
215 case PSU_CMD_RAIL_AMPS_HCRIT:
216 case PSU_CMD_RAIL_VOLTS:
217 case PSU_CMD_RAIL_AMPS:
218 case PSU_CMD_RAIL_WATTS:
219 ret = corsairpsu_usb_cmd(priv, 2, PSU_CMD_SELECT_RAIL, rail, NULL);
227 ret = corsairpsu_usb_cmd(priv, 3, cmd, 0, data);
230 mutex_unlock(&priv->lock);
234 static int corsairpsu_get_value(struct corsairpsu_data *priv, u8 cmd, u8 rail, long *val)
240 ret = corsairpsu_request(priv, cmd, rail, data);
245 * the biggest value here comes from the uptime command and to exceed MAXINT total uptime
246 * needs to be about 68 years, the rest are u16 values and the biggest value coming out of
247 * the LINEAR11 conversion are the watts values which are about 1200 for the strongest psu
248 * supported (HX1200i)
250 tmp = ((long)data[3] << 24) + (data[2] << 16) + (data[1] << 8) + data[0];
252 case PSU_CMD_RAIL_VOLTS_HCRIT:
253 case PSU_CMD_RAIL_VOLTS_LCRIT:
254 case PSU_CMD_RAIL_AMPS_HCRIT:
255 case PSU_CMD_TEMP_HCRIT:
256 case PSU_CMD_IN_VOLTS:
257 case PSU_CMD_IN_AMPS:
258 case PSU_CMD_RAIL_VOLTS:
259 case PSU_CMD_RAIL_AMPS:
262 *val = corsairpsu_linear11_to_int(tmp & 0xFFFF, 1000);
265 *val = corsairpsu_linear11_to_int(tmp & 0xFFFF, 1);
267 case PSU_CMD_RAIL_WATTS:
268 case PSU_CMD_TOTAL_WATTS:
269 *val = corsairpsu_linear11_to_int(tmp & 0xFFFF, 1000000);
271 case PSU_CMD_TOTAL_UPTIME:
273 case PSU_CMD_OCPMODE:
284 static void corsairpsu_get_criticals(struct corsairpsu_data *priv)
289 for (rail = 0; rail < TEMP_COUNT; ++rail) {
290 if (!corsairpsu_get_value(priv, PSU_CMD_TEMP_HCRIT, rail, &tmp)) {
291 priv->temp_crit_support |= BIT(rail);
292 priv->temp_crit[rail] = tmp;
296 for (rail = 0; rail < RAIL_COUNT; ++rail) {
297 if (!corsairpsu_get_value(priv, PSU_CMD_RAIL_VOLTS_HCRIT, rail, &tmp)) {
298 priv->in_crit_support |= BIT(rail);
299 priv->in_crit[rail] = tmp;
302 if (!corsairpsu_get_value(priv, PSU_CMD_RAIL_VOLTS_LCRIT, rail, &tmp)) {
303 priv->in_lcrit_support |= BIT(rail);
304 priv->in_lcrit[rail] = tmp;
307 if (!corsairpsu_get_value(priv, PSU_CMD_RAIL_AMPS_HCRIT, rail, &tmp)) {
308 priv->curr_crit_support |= BIT(rail);
309 priv->curr_crit[rail] = tmp;
314 static void corsairpsu_check_cmd_support(struct corsairpsu_data *priv)
318 priv->in_curr_cmd_support = !corsairpsu_get_value(priv, PSU_CMD_IN_AMPS, 0, &tmp);
321 static umode_t corsairpsu_hwmon_temp_is_visible(const struct corsairpsu_data *priv, u32 attr,
327 case hwmon_temp_input:
328 case hwmon_temp_label:
329 case hwmon_temp_crit:
330 if (channel > 0 && !(priv->temp_crit_support & BIT(channel - 1)))
340 static umode_t corsairpsu_hwmon_fan_is_visible(const struct corsairpsu_data *priv, u32 attr,
344 case hwmon_fan_input:
345 case hwmon_fan_label:
352 static umode_t corsairpsu_hwmon_power_is_visible(const struct corsairpsu_data *priv, u32 attr,
356 case hwmon_power_input:
357 case hwmon_power_label:
364 static umode_t corsairpsu_hwmon_in_is_visible(const struct corsairpsu_data *priv, u32 attr,
373 if (channel > 0 && !(priv->in_crit_support & BIT(channel - 1)))
377 if (channel > 0 && !(priv->in_lcrit_support & BIT(channel - 1)))
387 static umode_t corsairpsu_hwmon_curr_is_visible(const struct corsairpsu_data *priv, u32 attr,
393 case hwmon_curr_input:
394 if (channel == 0 && !priv->in_curr_cmd_support)
397 case hwmon_curr_label:
398 case hwmon_curr_crit:
399 if (channel > 0 && !(priv->curr_crit_support & BIT(channel - 1)))
409 static umode_t corsairpsu_hwmon_ops_is_visible(const void *data, enum hwmon_sensor_types type,
410 u32 attr, int channel)
412 const struct corsairpsu_data *priv = data;
416 return corsairpsu_hwmon_temp_is_visible(priv, attr, channel);
418 return corsairpsu_hwmon_fan_is_visible(priv, attr, channel);
420 return corsairpsu_hwmon_power_is_visible(priv, attr, channel);
422 return corsairpsu_hwmon_in_is_visible(priv, attr, channel);
424 return corsairpsu_hwmon_curr_is_visible(priv, attr, channel);
430 static int corsairpsu_hwmon_temp_read(struct corsairpsu_data *priv, u32 attr, int channel,
433 int err = -EOPNOTSUPP;
436 case hwmon_temp_input:
437 return corsairpsu_get_value(priv, channel ? PSU_CMD_TEMP1 : PSU_CMD_TEMP0,
439 case hwmon_temp_crit:
440 *val = priv->temp_crit[channel];
450 static int corsairpsu_hwmon_power_read(struct corsairpsu_data *priv, u32 attr, int channel,
453 if (attr == hwmon_power_input) {
456 return corsairpsu_get_value(priv, PSU_CMD_TOTAL_WATTS, 0, val);
458 return corsairpsu_get_value(priv, PSU_CMD_RAIL_WATTS, channel - 1, val);
467 static int corsairpsu_hwmon_in_read(struct corsairpsu_data *priv, u32 attr, int channel, long *val)
469 int err = -EOPNOTSUPP;
475 return corsairpsu_get_value(priv, PSU_CMD_IN_VOLTS, 0, val);
477 return corsairpsu_get_value(priv, PSU_CMD_RAIL_VOLTS, channel - 1, val);
483 *val = priv->in_crit[channel - 1];
487 *val = priv->in_lcrit[channel - 1];
495 static int corsairpsu_hwmon_curr_read(struct corsairpsu_data *priv, u32 attr, int channel,
498 int err = -EOPNOTSUPP;
501 case hwmon_curr_input:
504 return corsairpsu_get_value(priv, PSU_CMD_IN_AMPS, 0, val);
506 return corsairpsu_get_value(priv, PSU_CMD_RAIL_AMPS, channel - 1, val);
511 case hwmon_curr_crit:
512 *val = priv->curr_crit[channel - 1];
522 static int corsairpsu_hwmon_ops_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
523 int channel, long *val)
525 struct corsairpsu_data *priv = dev_get_drvdata(dev);
529 return corsairpsu_hwmon_temp_read(priv, attr, channel, val);
531 if (attr == hwmon_fan_input)
532 return corsairpsu_get_value(priv, PSU_CMD_FAN, 0, val);
535 return corsairpsu_hwmon_power_read(priv, attr, channel, val);
537 return corsairpsu_hwmon_in_read(priv, attr, channel, val);
539 return corsairpsu_hwmon_curr_read(priv, attr, channel, val);
545 static int corsairpsu_hwmon_ops_read_string(struct device *dev, enum hwmon_sensor_types type,
546 u32 attr, int channel, const char **str)
548 if (type == hwmon_temp && attr == hwmon_temp_label) {
549 *str = channel ? L_TEMP1 : L_TEMP0;
551 } else if (type == hwmon_fan && attr == hwmon_fan_label) {
554 } else if (type == hwmon_power && attr == hwmon_power_label && channel < 4) {
555 *str = label_watts[channel];
557 } else if (type == hwmon_in && attr == hwmon_in_label && channel < 4) {
558 *str = label_volts[channel];
560 } else if (type == hwmon_curr && attr == hwmon_curr_label && channel < 4) {
561 *str = label_amps[channel];
568 static const struct hwmon_ops corsairpsu_hwmon_ops = {
569 .is_visible = corsairpsu_hwmon_ops_is_visible,
570 .read = corsairpsu_hwmon_ops_read,
571 .read_string = corsairpsu_hwmon_ops_read_string,
574 static const struct hwmon_channel_info * const corsairpsu_info[] = {
575 HWMON_CHANNEL_INFO(chip,
576 HWMON_C_REGISTER_TZ),
577 HWMON_CHANNEL_INFO(temp,
578 HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT,
579 HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT),
580 HWMON_CHANNEL_INFO(fan,
581 HWMON_F_INPUT | HWMON_F_LABEL),
582 HWMON_CHANNEL_INFO(power,
583 HWMON_P_INPUT | HWMON_P_LABEL,
584 HWMON_P_INPUT | HWMON_P_LABEL,
585 HWMON_P_INPUT | HWMON_P_LABEL,
586 HWMON_P_INPUT | HWMON_P_LABEL),
587 HWMON_CHANNEL_INFO(in,
588 HWMON_I_INPUT | HWMON_I_LABEL,
589 HWMON_I_INPUT | HWMON_I_LABEL | HWMON_I_LCRIT | HWMON_I_CRIT,
590 HWMON_I_INPUT | HWMON_I_LABEL | HWMON_I_LCRIT | HWMON_I_CRIT,
591 HWMON_I_INPUT | HWMON_I_LABEL | HWMON_I_LCRIT | HWMON_I_CRIT),
592 HWMON_CHANNEL_INFO(curr,
593 HWMON_C_INPUT | HWMON_C_LABEL,
594 HWMON_C_INPUT | HWMON_C_LABEL | HWMON_C_CRIT,
595 HWMON_C_INPUT | HWMON_C_LABEL | HWMON_C_CRIT,
596 HWMON_C_INPUT | HWMON_C_LABEL | HWMON_C_CRIT),
600 static const struct hwmon_chip_info corsairpsu_chip_info = {
601 .ops = &corsairpsu_hwmon_ops,
602 .info = corsairpsu_info,
605 #ifdef CONFIG_DEBUG_FS
607 static void print_uptime(struct seq_file *seqf, u8 cmd)
609 struct corsairpsu_data *priv = seqf->private;
613 ret = corsairpsu_get_value(priv, cmd, 0, &val);
615 seq_puts(seqf, "N/A\n");
619 if (val > SECONDS_PER_DAY) {
620 seq_printf(seqf, "%ld day(s), %02ld:%02ld:%02ld\n", val / SECONDS_PER_DAY,
621 val % SECONDS_PER_DAY / SECONDS_PER_HOUR, val % SECONDS_PER_HOUR / 60,
626 seq_printf(seqf, "%02ld:%02ld:%02ld\n", val % SECONDS_PER_DAY / SECONDS_PER_HOUR,
627 val % SECONDS_PER_HOUR / 60, val % 60);
630 static int uptime_show(struct seq_file *seqf, void *unused)
632 print_uptime(seqf, PSU_CMD_UPTIME);
636 DEFINE_SHOW_ATTRIBUTE(uptime);
638 static int uptime_total_show(struct seq_file *seqf, void *unused)
640 print_uptime(seqf, PSU_CMD_TOTAL_UPTIME);
644 DEFINE_SHOW_ATTRIBUTE(uptime_total);
646 static int vendor_show(struct seq_file *seqf, void *unused)
648 struct corsairpsu_data *priv = seqf->private;
650 seq_printf(seqf, "%s\n", priv->vendor);
654 DEFINE_SHOW_ATTRIBUTE(vendor);
656 static int product_show(struct seq_file *seqf, void *unused)
658 struct corsairpsu_data *priv = seqf->private;
660 seq_printf(seqf, "%s\n", priv->product);
664 DEFINE_SHOW_ATTRIBUTE(product);
666 static int ocpmode_show(struct seq_file *seqf, void *unused)
668 struct corsairpsu_data *priv = seqf->private;
673 * The rail mode is switchable on the fly. The RAW interface can be used for this. But it
674 * will not be included here, because I consider it somewhat dangerous for the health of the
675 * PSU. The returned value can be a bogus one, if the PSU is in the process of switching and
676 * getting of the value itself can also fail during this. Because of this every other value
677 * than OCP_MULTI_RAIL can be considered as "single rail".
679 ret = corsairpsu_get_value(priv, PSU_CMD_OCPMODE, 0, &val);
681 seq_puts(seqf, "N/A\n");
683 seq_printf(seqf, "%s\n", (val == OCP_MULTI_RAIL) ? "multi rail" : "single rail");
687 DEFINE_SHOW_ATTRIBUTE(ocpmode);
689 static void corsairpsu_debugfs_init(struct corsairpsu_data *priv)
693 scnprintf(name, sizeof(name), "%s-%s", DRIVER_NAME, dev_name(&priv->hdev->dev));
695 priv->debugfs = debugfs_create_dir(name, NULL);
696 debugfs_create_file("uptime", 0444, priv->debugfs, priv, &uptime_fops);
697 debugfs_create_file("uptime_total", 0444, priv->debugfs, priv, &uptime_total_fops);
698 debugfs_create_file("vendor", 0444, priv->debugfs, priv, &vendor_fops);
699 debugfs_create_file("product", 0444, priv->debugfs, priv, &product_fops);
700 debugfs_create_file("ocpmode", 0444, priv->debugfs, priv, &ocpmode_fops);
705 static void corsairpsu_debugfs_init(struct corsairpsu_data *priv)
711 static int corsairpsu_probe(struct hid_device *hdev, const struct hid_device_id *id)
713 struct corsairpsu_data *priv;
716 priv = devm_kzalloc(&hdev->dev, sizeof(struct corsairpsu_data), GFP_KERNEL);
720 priv->cmd_buffer = devm_kmalloc(&hdev->dev, CMD_BUFFER_SIZE, GFP_KERNEL);
721 if (!priv->cmd_buffer)
724 ret = hid_parse(hdev);
728 ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
732 ret = hid_hw_open(hdev);
737 hid_set_drvdata(hdev, priv);
738 mutex_init(&priv->lock);
739 init_completion(&priv->wait_completion);
741 hid_device_io_start(hdev);
743 ret = corsairpsu_init(priv);
745 dev_err(&hdev->dev, "unable to initialize device (%d)\n", ret);
749 ret = corsairpsu_fwinfo(priv);
751 dev_err(&hdev->dev, "unable to query firmware (%d)\n", ret);
755 corsairpsu_get_criticals(priv);
756 corsairpsu_check_cmd_support(priv);
758 priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "corsairpsu", priv,
759 &corsairpsu_chip_info, NULL);
761 if (IS_ERR(priv->hwmon_dev)) {
762 ret = PTR_ERR(priv->hwmon_dev);
766 corsairpsu_debugfs_init(priv);
777 static void corsairpsu_remove(struct hid_device *hdev)
779 struct corsairpsu_data *priv = hid_get_drvdata(hdev);
781 debugfs_remove_recursive(priv->debugfs);
782 hwmon_device_unregister(priv->hwmon_dev);
787 static int corsairpsu_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data,
790 struct corsairpsu_data *priv = hid_get_drvdata(hdev);
792 if (completion_done(&priv->wait_completion))
795 memcpy(priv->cmd_buffer, data, min(CMD_BUFFER_SIZE, size));
796 complete(&priv->wait_completion);
802 static int corsairpsu_resume(struct hid_device *hdev)
804 struct corsairpsu_data *priv = hid_get_drvdata(hdev);
806 /* some PSUs turn off the microcontroller during standby, so a reinit is required */
807 return corsairpsu_init(priv);
811 static const struct hid_device_id corsairpsu_idtable[] = {
812 { HID_USB_DEVICE(0x1b1c, 0x1c03) }, /* Corsair HX550i */
813 { HID_USB_DEVICE(0x1b1c, 0x1c04) }, /* Corsair HX650i */
814 { HID_USB_DEVICE(0x1b1c, 0x1c05) }, /* Corsair HX750i */
815 { HID_USB_DEVICE(0x1b1c, 0x1c06) }, /* Corsair HX850i */
816 { HID_USB_DEVICE(0x1b1c, 0x1c07) }, /* Corsair HX1000i revision 1 */
817 { HID_USB_DEVICE(0x1b1c, 0x1c08) }, /* Corsair HX1200i */
818 { HID_USB_DEVICE(0x1b1c, 0x1c09) }, /* Corsair RM550i */
819 { HID_USB_DEVICE(0x1b1c, 0x1c0a) }, /* Corsair RM650i */
820 { HID_USB_DEVICE(0x1b1c, 0x1c0b) }, /* Corsair RM750i */
821 { HID_USB_DEVICE(0x1b1c, 0x1c0c) }, /* Corsair RM850i */
822 { HID_USB_DEVICE(0x1b1c, 0x1c0d) }, /* Corsair RM1000i */
823 { HID_USB_DEVICE(0x1b1c, 0x1c1e) }, /* Corsair HX1000i revision 2 */
824 { HID_USB_DEVICE(0x1b1c, 0x1c1f) }, /* Corsair HX1500i */
827 MODULE_DEVICE_TABLE(hid, corsairpsu_idtable);
829 static struct hid_driver corsairpsu_driver = {
831 .id_table = corsairpsu_idtable,
832 .probe = corsairpsu_probe,
833 .remove = corsairpsu_remove,
834 .raw_event = corsairpsu_raw_event,
836 .resume = corsairpsu_resume,
837 .reset_resume = corsairpsu_resume,
840 module_hid_driver(corsairpsu_driver);
842 MODULE_LICENSE("GPL");
844 MODULE_DESCRIPTION("Linux driver for Corsair power supplies with HID sensors interface");