Lines Matching +full:0 +full:x0c10

24 #define USB_VENDOR_ID_CORSAIR			0x1b1c
25 #define USB_PRODUCT_ID_CORSAIR_COMMANDERPRO 0x0c10
26 #define USB_PRODUCT_ID_CORSAIR_1000D 0x1d00
33 #define CTL_GET_FW_VER 0x02 /* returns the firmware version in bytes 1-3 */
34 #define CTL_GET_BL_VER 0x06 /* returns the bootloader version in bytes 1-2 */
35 #define CTL_GET_TMP_CNCT 0x10 /*
37 * 0 not connected
40 #define CTL_GET_TMP 0x11 /*
44 * returns 0x11 in byte 0 if no sensor is connected
46 #define CTL_GET_VOLT 0x12 /*
47 * send: byte 1 is rail number: 0 = 12v, 1 = 5v, 2 = 3.3v
49 * returns error 0x10 if request is invalid
51 #define CTL_GET_FAN_CNCT 0x20 /*
53 * 0 not connected
57 #define CTL_GET_FAN_RPM 0x21 /*
61 #define CTL_GET_FAN_PWM 0x22 /*
64 * returns error 0x12 if fan is controlled via
67 #define CTL_SET_FAN_FPWM 0x23 /*
70 * send: byte 2 is percentage from 0 - 100
72 #define CTL_SET_FAN_TARGET 0x24 /*
76 * device accepts all values from 0x00 - 0xFFFF
103 switch (ccp->buffer[0]) { in ccp_get_errno()
104 case 0x00: /* success */ in ccp_get_errno()
105 return 0; in ccp_get_errno()
106 case 0x01: /* called invalid command */ in ccp_get_errno()
108 case 0x10: /* called GET_VOLT / GET_TMP with invalid arguments */ in ccp_get_errno()
110 case 0x11: /* requested temps of disconnected sensors */ in ccp_get_errno()
111 case 0x12: /* requested pwm of not pwm controlled channels */ in ccp_get_errno()
114 hid_dbg(ccp->hdev, "unknown device response error: %d", ccp->buffer[0]); in ccp_get_errno()
125 memset(ccp->cmd_buffer, 0x00, OUT_BUFFER_SIZE); in send_usb_cmd()
126 ccp->cmd_buffer[0] = command; in send_usb_cmd()
142 if (ret < 0) in send_usb_cmd()
164 return 0; in ccp_raw_event()
174 ret = send_usb_cmd(ccp, command, channel, 0, 0); in get_data()
191 if (val < 0 || val > 255) in set_pwm()
194 /* The Corsair Commander Pro uses values from 0-100 */ in set_pwm()
199 ret = send_usb_cmd(ccp, CTL_SET_FAN_FPWM, channel, val, 0); in set_pwm()
211 val = clamp_val(val, 0, 0xFFFF); in set_target()
231 return 0; in ccp_read_string()
254 if (ret < 0) in ccp_read()
257 return 0; in ccp_read()
266 if (ret < 0) in ccp_read()
269 return 0; in ccp_read()
272 /* driver returns last set value or 0 */ in ccp_read()
273 if (ccp->target[channel] < 0) in ccp_read()
276 return 0; in ccp_read()
285 if (ret < 0) in ccp_read()
288 return 0; in ccp_read()
297 if (ret < 0) in ccp_read()
300 return 0; in ccp_read()
398 return 0; in ccp_is_visible()
453 ret = send_usb_cmd(ccp, CTL_GET_FAN_CNCT, 0, 0, 0); in get_fan_cnct()
457 for (channel = 0; channel < NUM_FANS; channel++) { in get_fan_cnct()
459 if (mode == 0) in get_fan_cnct()
481 return 0; in get_fan_cnct()
491 ret = send_usb_cmd(ccp, CTL_GET_TMP_CNCT, 0, 0, 0); in get_temp_cnct()
495 for (channel = 0; channel < NUM_TEMP_SENSORS; channel++) { in get_temp_cnct()
497 if (mode == 0) in get_temp_cnct()
503 return 0; in get_temp_cnct()
511 ret = send_usb_cmd(ccp, CTL_GET_FW_VER, 0, 0, 0); in get_fw_version()
516 ccp->firmware_ver[0] = ccp->buffer[1]; in get_fw_version()
520 return 0; in get_fw_version()
528 ret = send_usb_cmd(ccp, CTL_GET_BL_VER, 0, 0, 0); in get_bl_version()
533 ccp->bootloader_ver[0] = ccp->buffer[1]; in get_bl_version()
536 return 0; in get_bl_version()
544 ccp->firmware_ver[0], in firmware_show()
548 return 0; in firmware_show()
557 ccp->bootloader_ver[0], in bootloader_show()
560 return 0; in bootloader_show()
639 return 0; in ccp_probe()