Lines Matching +full:0 +full:x259
7 * Aquacomputer devices send HID reports (with ID 0x01) every second to report
27 #define USB_VENDOR_ID_AQUACOMPUTER 0x0c70
28 #define USB_PRODUCT_ID_AQUAERO 0xf001
29 #define USB_PRODUCT_ID_FARBWERK 0xf00a
30 #define USB_PRODUCT_ID_QUADRO 0xf00d
31 #define USB_PRODUCT_ID_D5NEXT 0xf00e
32 #define USB_PRODUCT_ID_FARBWERK360 0xf010
33 #define USB_PRODUCT_ID_OCTO 0xf011
34 #define USB_PRODUCT_ID_HIGHFLOWNEXT 0xf012
35 #define USB_PRODUCT_ID_LEAKSHIELD 0xf014
36 #define USB_PRODUCT_ID_AQUASTREAMXT 0xf0b6
37 #define USB_PRODUCT_ID_AQUASTREAMULT 0xf00b
38 #define USB_PRODUCT_ID_POWERADJUST3 0xf0bd
39 #define USB_PRODUCT_ID_HIGHFLOW 0xf003
64 #define STATUS_REPORT_ID 0x01
68 #define CTRL_REPORT_ID 0x03
69 #define AQUAERO_CTRL_REPORT_ID 0x0b
76 #define SECONDARY_CTRL_REPORT_ID 0x02
77 #define SECONDARY_CTRL_REPORT_SIZE 0x0B
80 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x34, 0xC6
84 #define AQUAERO_SECONDARY_CTRL_REPORT_ID 0x06
85 #define AQUAERO_SECONDARY_CTRL_REPORT_SIZE 0x07
88 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
92 #define AQUASTREAMXT_STATUS_REPORT_ID 0x04
94 #define POWERADJUST3_STATUS_REPORT_ID 0x03
96 #define HIGHFLOW_STATUS_REPORT_ID 0x02
99 #define AQC_8 0
103 #define AQC_SERIAL_START 0x3
104 #define AQC_FIRMWARE_VERSION 0xD
106 #define AQC_SENSOR_SIZE 0x02
107 #define AQC_SENSOR_NA 0x7FFF
108 #define AQC_FAN_PERCENT_OFFSET 0x00
109 #define AQC_FAN_VOLTAGE_OFFSET 0x02
110 #define AQC_FAN_CURRENT_OFFSET 0x04
111 #define AQC_FAN_POWER_OFFSET 0x06
112 #define AQC_FAN_SPEED_OFFSET 0x08
115 #define AQUAERO_SERIAL_START 0x07
116 #define AQUAERO_FIRMWARE_VERSION 0x0B
122 #define AQUAERO_CTRL_REPORT_SIZE 0xa93
123 #define AQUAERO_CTRL_PRESET_ID 0x5c
124 #define AQUAERO_CTRL_PRESET_SIZE 0x02
125 #define AQUAERO_CTRL_PRESET_START 0x55c
128 #define AQUAERO_SENSOR_START 0x65
129 #define AQUAERO_VIRTUAL_SENSOR_START 0x85
130 #define AQUAERO_CALC_VIRTUAL_SENSOR_START 0x95
131 #define AQUAERO_FLOW_SENSORS_START 0xF9
132 #define AQUAERO_FAN_VOLTAGE_OFFSET 0x04
133 #define AQUAERO_FAN_CURRENT_OFFSET 0x06
134 #define AQUAERO_FAN_POWER_OFFSET 0x08
135 #define AQUAERO_FAN_SPEED_OFFSET 0x00
136 static u16 aquaero_sensor_fan_offsets[] = { 0x167, 0x173, 0x17f, 0x18B };
139 #define AQUAERO_TEMP_CTRL_OFFSET 0xdb
140 #define AQUAERO_FAN_CTRL_MIN_PWR_OFFSET 0x04
141 #define AQUAERO_FAN_CTRL_MAX_PWR_OFFSET 0x06
142 #define AQUAERO_FAN_CTRL_SRC_OFFSET 0x10
143 static u16 aquaero_ctrl_fan_offsets[] = { 0x20c, 0x220, 0x234, 0x248 };
149 #define D5NEXT_CTRL_REPORT_SIZE 0x329
152 #define D5NEXT_POWER_CYCLES 0x18
153 #define D5NEXT_COOLANT_TEMP 0x57
154 #define D5NEXT_PUMP_OFFSET 0x6c
155 #define D5NEXT_FAN_OFFSET 0x5f
156 #define D5NEXT_5V_VOLTAGE 0x39
157 #define D5NEXT_12V_VOLTAGE 0x37
158 #define D5NEXT_VIRTUAL_SENSORS_START 0x3f
162 #define D5NEXT_TEMP_CTRL_OFFSET 0x2D /* Temperature sensor offsets location */
163 static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 }; /* Pump and fan speed (from 0-100%) */
171 #define AQUASTREAMULT_SENSOR_START 0x2D
172 #define AQUASTREAMULT_PUMP_OFFSET 0x51
173 #define AQUASTREAMULT_PUMP_VOLTAGE 0x3D
174 #define AQUASTREAMULT_PUMP_CURRENT 0x53
175 #define AQUASTREAMULT_PUMP_POWER 0x55
176 #define AQUASTREAMULT_FAN_OFFSET 0x41
177 #define AQUASTREAMULT_PRESSURE_OFFSET 0x57
178 #define AQUASTREAMULT_FLOW_SENSOR_OFFSET 0x37
179 #define AQUASTREAMULT_FAN_VOLTAGE_OFFSET 0x02
180 #define AQUASTREAMULT_FAN_CURRENT_OFFSET 0x00
181 #define AQUASTREAMULT_FAN_POWER_OFFSET 0x04
182 #define AQUASTREAMULT_FAN_SPEED_OFFSET 0x06
187 #define FARBWERK_SENSOR_START 0x2f
192 #define FARBWERK360_CTRL_REPORT_SIZE 0x682
195 #define FARBWERK360_SENSOR_START 0x32
196 #define FARBWERK360_VIRTUAL_SENSORS_START 0x3a
199 #define FARBWERK360_TEMP_CTRL_OFFSET 0x8
206 #define OCTO_CTRL_REPORT_SIZE 0x65F
209 #define OCTO_POWER_CYCLES 0x18
210 #define OCTO_SENSOR_START 0x3D
211 #define OCTO_VIRTUAL_SENSORS_START 0x45
212 #define OCTO_FLOW_SENSOR_OFFSET 0x7B
213 static u16 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xCB, 0xD8 };
216 #define OCTO_TEMP_CTRL_OFFSET 0xA
217 #define OCTO_FLOW_PULSES_CTRL_OFFSET 0x6
218 /* Fan speed offsets (0-100%) */
219 static u16 octo_ctrl_fan_offsets[] = { 0x5B, 0xB0, 0x105, 0x15A, 0x1AF, 0x204, 0x259, 0x2AE };
226 #define QUADRO_CTRL_REPORT_SIZE 0x3c1
229 #define QUADRO_POWER_CYCLES 0x18
230 #define QUADRO_SENSOR_START 0x34
231 #define QUADRO_VIRTUAL_SENSORS_START 0x3c
232 #define QUADRO_FLOW_SENSOR_OFFSET 0x6e
233 static u16 quadro_sensor_fan_offsets[] = { 0x70, 0x7D, 0x8A, 0x97 };
236 #define QUADRO_TEMP_CTRL_OFFSET 0xA
237 #define QUADRO_FLOW_PULSES_CTRL_OFFSET 0x6
238 static u16 quadro_ctrl_fan_offsets[] = { 0x37, 0x8c, 0xe1, 0x136 }; /* Fan speed offsets (0-100%) */
269 #define AQUASTREAMXT_SERIAL_START 0x3a
270 #define AQUASTREAMXT_FIRMWARE_VERSION 0x32
273 #define AQUASTREAMXT_FAN_STOPPED 0x4
276 #define AQUASTREAMXT_SENSOR_REPORT_SIZE 0x42
279 #define AQUASTREAMXT_SENSOR_START 0xd
280 #define AQUASTREAMXT_FAN_VOLTAGE_OFFSET 0x7
281 #define AQUASTREAMXT_FAN_STATUS_OFFSET 0x1d
282 #define AQUASTREAMXT_PUMP_VOLTAGE_OFFSET 0x9
283 #define AQUASTREAMXT_PUMP_CURR_OFFSET 0xb
284 static u16 aquastreamxt_sensor_fan_offsets[] = { 0x13, 0x1b };
288 #define POWERADJUST3_SENSOR_REPORT_SIZE 0x32
291 #define POWERADJUST3_SENSOR_START 0x03
296 #define HIGHFLOW_SENSOR_REPORT_SIZE 0x76
299 #define HIGHFLOW_FIRMWARE_VERSION 0x3
300 #define HIGHFLOW_SERIAL_START 0x9
301 #define HIGHFLOW_FLOW_SENSOR_OFFSET 0x23
302 #define HIGHFLOW_SENSOR_START 0x2b
629 if (val < 0 || val > 255) in aqc_pwm_to_percent()
638 if (val > 0) in aqc_aquastreamxt_convert_pump_rpm()
640 return 0; in aqc_aquastreamxt_convert_pump_rpm()
646 if (val > 0) in aqc_aquastreamxt_convert_fan_rpm()
648 return 0; in aqc_aquastreamxt_convert_fan_rpm()
672 memset(priv->buffer, 0x00, priv->buffer_size); in aqc_get_ctrl_data()
675 if (ret < 0) in aqc_get_ctrl_data()
693 /* Init and xorout value for CRC-16/USB is 0xffff */ in aqc_send_ctrl_data()
694 checksum = crc16(0xffff, priv->buffer + priv->checksum_start, in aqc_send_ctrl_data()
696 checksum ^= 0xffff; in aqc_send_ctrl_data()
705 if (ret < 0) in aqc_send_ctrl_data()
727 if (ret < 0) in aqc_get_ctrl_val()
753 if (ret < 0) in aqc_set_ctrl_vals()
756 for (i = 0; i < len; i++) { in aqc_set_ctrl_vals()
769 if (ret < 0) in aqc_set_ctrl_vals()
796 if (priv->temp_ctrl_offset != 0) in aqc_is_visible()
880 if (priv->kind == leakshield && channel == 0) in aqc_is_visible()
896 if (channel == 0) in aqc_is_visible()
916 if (channel == 0) in aqc_is_visible()
948 return 0; in aqc_is_visible()
958 memset(priv->buffer, 0x00, priv->buffer_size); in aqc_legacy_read()
961 if (ret < 0) in aqc_legacy_read()
965 for (i = 0; i < priv->num_temp_sensors; i++) { in aqc_legacy_read()
978 priv->serial_number[0] = get_unaligned_le16(priv->buffer + in aqc_legacy_read()
984 sensor_value = get_unaligned_le16(priv->buffer + priv->fan_sensor_offsets[0]); in aqc_legacy_read()
985 priv->speed_input[0] = aqc_aquastreamxt_convert_pump_rpm(sensor_value); in aqc_legacy_read()
990 priv->speed_input[1] = 0; in aqc_legacy_read()
999 priv->current_input[0] = DIV_ROUND_CLOSEST(sensor_value * 176, 100) - 52; in aqc_legacy_read()
1002 priv->voltage_input[0] = DIV_ROUND_CLOSEST(sensor_value * 1000, 61); in aqc_legacy_read()
1009 priv->serial_number[0] = get_unaligned_le16(priv->buffer + in aqc_legacy_read()
1015 priv->speed_input[0] = get_unaligned_le16(priv->buffer + in aqc_legacy_read()
1036 if (priv->status_report_id != 0) { in aqc_read()
1039 if (ret < 0) in aqc_read()
1059 if (ret < 0) in aqc_read()
1088 if (ret < 0) in aqc_read()
1104 if (ret < 0) in aqc_read()
1111 if (ret < 0) in aqc_read()
1128 return 0; in aqc_read()
1167 return 0; in aqc_read_string()
1189 if (ret < 0) in aqc_write()
1202 if (ret < 0) in aqc_write()
1213 if (pwm_value < 0) in aqc_write()
1219 ctrl_values_offsets[0] = AQUAERO_CTRL_PRESET_START + in aqc_write()
1221 ctrl_values[0] = pwm_value; in aqc_write()
1222 ctrl_values_types[0] = AQC_BE16; in aqc_write()
1230 /* Set minimum power to 0 to allow the fan to turn off */ in aqc_write()
1233 ctrl_values[2] = 0; in aqc_write()
1244 if (ret < 0) in aqc_write()
1250 if (ret < 0) in aqc_write()
1263 return 0; in aqc_write()
1356 return 0; in aqc_raw_event()
1361 priv->serial_number[0] = get_unaligned_be16(data + priv->serial_number_start_offset); in aqc_raw_event()
1367 for (i = 0; i < priv->num_temp_sensors; i++) { in aqc_raw_event()
1378 for (j = 0; j < priv->num_virtual_temp_sensors; j++) { in aqc_raw_event()
1390 for (i = 0; i < priv->num_fans; i++) { in aqc_raw_event()
1406 for (j = 0; j < priv->num_flow_sensors; j++) { in aqc_raw_event()
1412 if (priv->power_cycle_count_offset != 0) in aqc_raw_event()
1420 for (j = 0; j < priv->num_calc_virt_temp_sensors; j++) { in aqc_raw_event()
1449 priv->power_input[0] = -ENODATA; in aqc_raw_event()
1451 priv->power_input[0] = in aqc_raw_event()
1454 priv->voltage_input[0] = get_unaligned_be16(data + HIGHFLOWNEXT_5V_VOLTAGE) * 10; in aqc_raw_event()
1462 priv->speed_input[0] = in aqc_raw_event()
1464 priv->speed_input_min[0] = get_unaligned_be16(data + LEAKSHIELD_PRESSURE_MIN) * 100; in aqc_raw_event()
1465 priv->speed_input_target[0] = in aqc_raw_event()
1467 priv->speed_input_max[0] = get_unaligned_be16(data + LEAKSHIELD_PRESSURE_MAX) * 100; in aqc_raw_event()
1489 return 0; in aqc_raw_event()
1496 seq_printf(seqf, "%05u-%05u\n", priv->serial_number[0], priv->serial_number[1]); in serial_number_show()
1498 return 0; in serial_number_show()
1508 return 0; in firmware_version_show()
1518 return 0; in power_cycles_show()
1531 if (priv->serial_number_start_offset != 0) in aqc_debugfs_init()
1534 if (priv->firmware_version_offset != 0) in aqc_debugfs_init()
1537 if (priv->power_cycle_count_offset != 0) in aqc_debugfs_init()
1578 * their respective collections set to 1, while the real device has it set to 0. in aqc_probe()
1580 if (hdev->collection[1].type != 0) { in aqc_probe()
1640 priv->num_fans = 0; in aqc_probe()
1650 priv->num_fans = 0; in aqc_probe()
1724 priv->num_fans = 0; in aqc_probe()
1750 priv->num_fans = 0; in aqc_probe()
1790 priv->num_fans = 0; in aqc_probe()
1801 priv->num_fans = 0; in aqc_probe()
1859 if (priv->buffer_size != 0) { in aqc_probe()
1860 priv->checksum_start = 0x01; in aqc_probe()
1885 return 0; in aqc_probe()