1
1
// SPDX-License-Identifier: GPL-2.0+
2
2
/*
3
3
* hwmon driver for Aquacomputer devices (D5 Next, Farbwerk, Farbwerk 360, Octo,
4
- * Quadro, High Flow Next, Aquaero, Aquastream Ultimate, Leakshield)
4
+ * Quadro, High Flow Next, Aquaero, Aquastream Ultimate, Leakshield,
5
+ * High Flow USB/MPS Flow family)
5
6
*
6
7
* Aquacomputer devices send HID reports (with ID 0x01) every second to report
7
8
* sensor values, except for devices that communicate through the
8
- * legacy way (currently, Poweradjust 3).
9
+ * legacy way (currently, Poweradjust 3 and High Flow USB/MPS Flow family ).
9
10
*
10
11
* Copyright 2021 Aleksa Savic <[email protected] >
11
12
* Copyright 2022 Jack Doan <[email protected] >
35
36
#define USB_PRODUCT_ID_AQUASTREAMXT 0xf0b6
36
37
#define USB_PRODUCT_ID_AQUASTREAMULT 0xf00b
37
38
#define USB_PRODUCT_ID_POWERADJUST3 0xf0bd
39
+ #define USB_PRODUCT_ID_HIGHFLOW 0xf003
38
40
39
41
enum kinds {
40
42
d5next , farbwerk , farbwerk360 , octo , quadro ,
41
43
highflownext , aquaero , poweradjust3 , aquastreamult ,
42
- aquastreamxt , leakshield
44
+ aquastreamxt , leakshield , highflow
43
45
};
44
46
45
47
static const char * const aqc_device_names [] = {
@@ -53,7 +55,8 @@ static const char *const aqc_device_names[] = {
53
55
[aquastreamxt ] = "aquastreamxt" ,
54
56
[aquaero ] = "aquaero" ,
55
57
[aquastreamult ] = "aquastreamultimate" ,
56
- [poweradjust3 ] = "poweradjust3"
58
+ [poweradjust3 ] = "poweradjust3" ,
59
+ [highflow ] = "highflow" /* Covers MPS Flow devices */
57
60
};
58
61
59
62
#define DRIVER_NAME "aquacomputer_d5next"
@@ -90,6 +93,8 @@ static u8 aquaero_secondary_ctrl_report[] = {
90
93
91
94
#define POWERADJUST3_STATUS_REPORT_ID 0x03
92
95
96
+ #define HIGHFLOW_STATUS_REPORT_ID 0x02
97
+
93
98
/* Data types for reading and writing control reports */
94
99
#define AQC_8 0
95
100
#define AQC_BE16 1
@@ -282,6 +287,17 @@ static u16 aquastreamxt_sensor_fan_offsets[] = { 0x13, 0x1b };
282
287
/* Sensor report offsets for the Poweradjust 3 */
283
288
#define POWERADJUST3_SENSOR_START 0x03
284
289
290
+ /* Specs of the High Flow USB */
291
+ #define HIGHFLOW_NUM_SENSORS 2
292
+ #define HIGHFLOW_NUM_FLOW_SENSORS 1
293
+ #define HIGHFLOW_SENSOR_REPORT_SIZE 0x76
294
+
295
+ /* Sensor report offsets for the High Flow USB */
296
+ #define HIGHFLOW_FIRMWARE_VERSION 0x3
297
+ #define HIGHFLOW_SERIAL_START 0x9
298
+ #define HIGHFLOW_FLOW_SENSOR_OFFSET 0x23
299
+ #define HIGHFLOW_SENSOR_START 0x2b
300
+
285
301
/* Labels for D5 Next */
286
302
static const char * const label_d5next_temp [] = {
287
303
"Coolant temp"
@@ -486,6 +502,16 @@ static const char *const label_poweradjust3_temp_sensors[] = {
486
502
"External sensor"
487
503
};
488
504
505
+ /* Labels for Highflow */
506
+ static const char * const label_highflow_temp [] = {
507
+ "External temp" ,
508
+ "Internal temp"
509
+ };
510
+
511
+ static const char * const label_highflow_speeds [] = {
512
+ "Flow speed [dL/h]"
513
+ };
514
+
489
515
struct aqc_fan_structure_offsets {
490
516
u8 voltage ;
491
517
u8 curr ;
@@ -819,6 +845,7 @@ static umode_t aqc_is_visible(const void *data, enum hwmon_sensor_types type, u3
819
845
break ;
820
846
case aquaero :
821
847
case quadro :
848
+ case highflow :
822
849
/* Special case to support flow sensors */
823
850
if (channel < priv -> num_fans + priv -> num_flow_sensors )
824
851
return 0444 ;
@@ -962,6 +989,17 @@ static int aqc_legacy_read(struct aqc_data *priv)
962
989
sensor_value = get_unaligned_le16 (priv -> buffer + AQUASTREAMXT_FAN_VOLTAGE_OFFSET );
963
990
priv -> voltage_input [1 ] = DIV_ROUND_CLOSEST (sensor_value * 1000 , 63 );
964
991
break ;
992
+ case highflow :
993
+ /* Info provided with every report */
994
+ priv -> serial_number [0 ] = get_unaligned_le16 (priv -> buffer +
995
+ priv -> serial_number_start_offset );
996
+ priv -> firmware_version =
997
+ get_unaligned_le16 (priv -> buffer + priv -> firmware_version_offset );
998
+
999
+ /* Read flow speed */
1000
+ priv -> speed_input [0 ] = get_unaligned_le16 (priv -> buffer +
1001
+ priv -> flow_sensors_start_offset );
1002
+ break ;
965
1003
default :
966
1004
break ;
967
1005
}
@@ -1747,6 +1785,20 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
1747
1785
1748
1786
priv -> temp_label = label_poweradjust3_temp_sensors ;
1749
1787
break ;
1788
+ case USB_PRODUCT_ID_HIGHFLOW :
1789
+ priv -> kind = highflow ;
1790
+
1791
+ priv -> num_fans = 0 ;
1792
+
1793
+ priv -> num_temp_sensors = HIGHFLOW_NUM_SENSORS ;
1794
+ priv -> temp_sensor_start_offset = HIGHFLOW_SENSOR_START ;
1795
+ priv -> num_flow_sensors = HIGHFLOW_NUM_FLOW_SENSORS ;
1796
+ priv -> flow_sensors_start_offset = HIGHFLOW_FLOW_SENSOR_OFFSET ;
1797
+ priv -> buffer_size = HIGHFLOW_SENSOR_REPORT_SIZE ;
1798
+
1799
+ priv -> temp_label = label_highflow_temp ;
1800
+ priv -> speed_label = label_highflow_speeds ;
1801
+ break ;
1750
1802
default :
1751
1803
break ;
1752
1804
}
@@ -1772,6 +1824,12 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
1772
1824
1773
1825
priv -> status_report_id = AQUASTREAMXT_STATUS_REPORT_ID ;
1774
1826
break ;
1827
+ case highflow :
1828
+ priv -> serial_number_start_offset = HIGHFLOW_SERIAL_START ;
1829
+ priv -> firmware_version_offset = HIGHFLOW_FIRMWARE_VERSION ;
1830
+
1831
+ priv -> status_report_id = HIGHFLOW_STATUS_REPORT_ID ;
1832
+ break ;
1775
1833
default :
1776
1834
priv -> serial_number_start_offset = AQC_SERIAL_START ;
1777
1835
priv -> firmware_version_offset = AQC_FIRMWARE_VERSION ;
@@ -1846,6 +1904,7 @@ static const struct hid_device_id aqc_table[] = {
1846
1904
{ HID_USB_DEVICE (USB_VENDOR_ID_AQUACOMPUTER , USB_PRODUCT_ID_AQUASTREAMXT ) },
1847
1905
{ HID_USB_DEVICE (USB_VENDOR_ID_AQUACOMPUTER , USB_PRODUCT_ID_AQUASTREAMULT ) },
1848
1906
{ HID_USB_DEVICE (USB_VENDOR_ID_AQUACOMPUTER , USB_PRODUCT_ID_POWERADJUST3 ) },
1907
+ { HID_USB_DEVICE (USB_VENDOR_ID_AQUACOMPUTER , USB_PRODUCT_ID_HIGHFLOW ) },
1849
1908
{ }
1850
1909
};
1851
1910
0 commit comments