Lines Matching +full:0 +full:x53
3 * hwmon driver for NZXT Kraken X53/X63/X73, Z53/Z63/Z73 and 2023/2023 Elite all in one coolers.
4 * X53 and Z53 in code refer to all models in their respective series (shortened for brevity).
22 #define USB_VENDOR_ID_NZXT 0x1e71
23 #define USB_PRODUCT_ID_X53 0x2007
24 #define USB_PRODUCT_ID_X53_SECOND 0x2014
25 #define USB_PRODUCT_ID_Z53 0x3008
26 #define USB_PRODUCT_ID_KRAKEN2023 0x300E
27 #define USB_PRODUCT_ID_KRAKEN2023_ELITE 0x300C
29 enum kinds { X53, Z53, KRAKEN2023 } __packed; enumerator
33 #define STATUS_REPORT_ID 0x75
34 #define FIRMWARE_REPORT_ID 0x11
39 /* Sensor report offsets for Kraken X53 and Z53 */
45 /* Firmware version report offset for Kraken X53 and Z53 */
52 /* Report offsets for control commands for Kraken X53 and Z53 */
55 /* Control commands and their lengths for Kraken X53 and Z53 */
58 static const u8 set_interval_cmd[] = { 0x70, 0x02, 0x01, 0xB8, 1 };
59 static const u8 finish_init_cmd[] = { 0x70, 0x01 };
60 static const u8 __maybe_unused get_fw_version_cmd[] = { 0x10, 0x01 };
61 static const u8 set_pump_duty_cmd_header[] = { 0x72, 0x00, 0x00, 0x00 };
62 static const u8 z53_get_status_cmd[] = { 0x74, 0x01 };
101 * For X53 devices, tracks whether an initial (one) sensor report was received to
135 case X53: in kraken3_is_visible()
155 case X53: in kraken3_is_visible()
178 return 0; in kraken3_is_visible()
191 memcpy_and_pad(priv->buffer, MAX_REPORT_LENGTH, cmd, cmd_length, 0x00); in kraken3_write_expanded()
207 if (val < 0 || val > 255) in kraken3_pwm_to_percent()
213 if (channel == 0 && percent_value < PUMP_DUTY_MIN) in kraken3_pwm_to_percent()
240 if (ret == 0) in kraken3_read_x53()
242 else if (ret < 0) in kraken3_read_x53()
246 return 0; in kraken3_read_x53()
254 if (ret < 0) in kraken3_read_z53()
272 if (ret < 0) in kraken3_read_z53()
278 if (ret == 0) in kraken3_read_z53()
283 if (ret < 0) in kraken3_read_z53()
286 return 0; in kraken3_read_z53()
296 if (priv->kind == X53) in kraken3_read()
301 if (ret < 0) in kraken3_read()
331 return 0; in kraken3_read()
348 return 0; in kraken3_read_string()
360 /* Set the correct ID for writing pump/fan duty (0x01 or 0x02, respectively) */ in kraken3_write_curve()
383 if (percent_val < 0) in kraken3_write_fixed_duty()
395 for (i = 0; i < CUSTOM_CURVE_POINTS - 1; i++) in kraken3_write_fixed_duty()
421 if (ret < 0) in kraken3_write()
432 if (val < 0 || val > 2) in kraken3_write()
436 case 0: in kraken3_write()
439 if (ret < 0) in kraken3_write()
451 if (ret < 0) in kraken3_write()
462 if (ret < 0) in kraken3_write()
479 return 0; in kraken3_write()
490 if (kstrtol(buf, 10, &val) < 0) in kraken3_fan_curve_pwm_store()
494 if (val < 0) in kraken3_fan_curve_pwm_store()
504 if (ret < 0) in kraken3_fan_curve_pwm_store()
517 /* X53 does not have a fan */ in kraken3_curve_props_are_visible()
518 if (index >= CUSTOM_CURVE_POINTS && priv->kind == X53) in kraken3_curve_props_are_visible()
519 return 0; in kraken3_curve_props_are_visible()
525 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point1_pwm, kraken3_fan_curve_pwm, 0, 0);
526 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point2_pwm, kraken3_fan_curve_pwm, 0, 1);
527 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point3_pwm, kraken3_fan_curve_pwm, 0, 2);
528 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point4_pwm, kraken3_fan_curve_pwm, 0, 3);
529 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point5_pwm, kraken3_fan_curve_pwm, 0, 4);
530 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point6_pwm, kraken3_fan_curve_pwm, 0, 5);
531 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point7_pwm, kraken3_fan_curve_pwm, 0, 6);
532 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point8_pwm, kraken3_fan_curve_pwm, 0, 7);
533 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point9_pwm, kraken3_fan_curve_pwm, 0, 8);
534 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point10_pwm, kraken3_fan_curve_pwm, 0, 9);
535 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point11_pwm, kraken3_fan_curve_pwm, 0, 10);
536 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point12_pwm, kraken3_fan_curve_pwm, 0, 11);
537 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point13_pwm, kraken3_fan_curve_pwm, 0, 12);
538 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point14_pwm, kraken3_fan_curve_pwm, 0, 13);
539 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point15_pwm, kraken3_fan_curve_pwm, 0, 14);
540 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point16_pwm, kraken3_fan_curve_pwm, 0, 15);
541 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point17_pwm, kraken3_fan_curve_pwm, 0, 16);
542 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point18_pwm, kraken3_fan_curve_pwm, 0, 17);
543 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point19_pwm, kraken3_fan_curve_pwm, 0, 18);
544 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point20_pwm, kraken3_fan_curve_pwm, 0, 19);
545 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point21_pwm, kraken3_fan_curve_pwm, 0, 20);
546 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point22_pwm, kraken3_fan_curve_pwm, 0, 21);
547 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point23_pwm, kraken3_fan_curve_pwm, 0, 22);
548 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point24_pwm, kraken3_fan_curve_pwm, 0, 23);
549 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point25_pwm, kraken3_fan_curve_pwm, 0, 24);
550 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point26_pwm, kraken3_fan_curve_pwm, 0, 25);
551 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point27_pwm, kraken3_fan_curve_pwm, 0, 26);
552 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point28_pwm, kraken3_fan_curve_pwm, 0, 27);
553 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point29_pwm, kraken3_fan_curve_pwm, 0, 28);
554 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point30_pwm, kraken3_fan_curve_pwm, 0, 29);
555 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point31_pwm, kraken3_fan_curve_pwm, 0, 30);
556 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point32_pwm, kraken3_fan_curve_pwm, 0, 31);
557 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point33_pwm, kraken3_fan_curve_pwm, 0, 32);
558 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point34_pwm, kraken3_fan_curve_pwm, 0, 33);
559 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point35_pwm, kraken3_fan_curve_pwm, 0, 34);
560 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point36_pwm, kraken3_fan_curve_pwm, 0, 35);
561 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point37_pwm, kraken3_fan_curve_pwm, 0, 36);
562 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point38_pwm, kraken3_fan_curve_pwm, 0, 37);
563 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point39_pwm, kraken3_fan_curve_pwm, 0, 38);
564 static SENSOR_DEVICE_ATTR_2_WO(temp1_auto_point40_pwm, kraken3_fan_curve_pwm, 0, 39);
567 static SENSOR_DEVICE_ATTR_2_WO(temp2_auto_point1_pwm, kraken3_fan_curve_pwm, 1, 0);
736 return 0; in kraken3_raw_event()
740 for (i = 0; i < 3; i++) in kraken3_raw_event()
746 return 0; in kraken3_raw_event()
750 return 0; in kraken3_raw_event()
752 if (data[TEMP_SENSOR_START_OFFSET] == 0xff && data[TEMP_SENSOR_END_OFFSET] == 0xff) { in kraken3_raw_event()
761 if (priv->kind != X53 || !completion_done(&priv->status_report_processed)) { in kraken3_raw_event()
767 return 0; in kraken3_raw_event()
774 priv->temp_input[0] = in kraken3_raw_event()
777 priv->fan_input[0] = get_unaligned_le16(data + PUMP_SPEED_OFFSET); in kraken3_raw_event()
778 priv->channel_info[0].reported_duty = kraken3_percent_to_pwm(data[PUMP_DUTY_OFFSET]); in kraken3_raw_event()
781 if (priv->kind == X53 && !completion_done(&priv->status_report_processed)) { in kraken3_raw_event()
797 return 0; in kraken3_raw_event()
807 if (ret < 0) in kraken3_init_device()
812 if (ret < 0) in kraken3_init_device()
815 return 0; in kraken3_init_device()
824 if (ret < 0) in kraken3_get_fw_ver()
829 if (ret == 0) in kraken3_get_fw_ver()
831 else if (ret < 0) in kraken3_get_fw_ver()
834 return 0; in kraken3_get_fw_ver()
852 seq_printf(seqf, "%u.%u.%u\n", priv->firmware_version[0], priv->firmware_version[1], in firmware_version_show()
855 return 0; in firmware_version_show()
863 if (!priv->firmware_version[0]) in kraken3_debugfs_init()
915 priv->kind = X53; in kraken3_probe()
916 device_name = "x53"; in kraken3_probe()
949 if (ret < 0) { in kraken3_probe()
955 if (ret < 0) in kraken3_probe()
968 return 0; in kraken3_probe()
989 /* NZXT Kraken X53/X63/X73 have two possible product IDs */
1028 MODULE_DESCRIPTION("Hwmon driver for NZXT Kraken X53/X63/X73, Z53/Z63/Z73 coolers");