Skip to content

Commit 120584c

Browse files
aleksamagickagroeck
authored andcommitted
hwmon: (aquacomputer_d5next) Add support for Octo flow sensor
Add support for reading the flow sensor value on the Aquacomputer Octo. Implemented by David Flemstrom [1]. [1] aleksamagicka/aquacomputer_d5next-hwmon#95 Originally-from: David Flemstrom <[email protected]> Signed-off-by: Aleksa Savic <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 70118f8 commit 120584c

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

Documentation/hwmon/aquacomputer_d5next.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ seems to require sending it a complete configuration. That includes addressable
4545
RGB LEDs, for which there is no standard sysfs interface. Thus, that task is
4646
better suited for userspace tools.
4747

48-
The Octo exposes four physical and sixteen virtual temperature sensors, as well as
49-
eight PWM controllable fans, along with their speed (in RPM), power, voltage and
50-
current.
48+
The Octo exposes four physical and sixteen virtual temperature sensors, a flow sensor
49+
as well as eight PWM controllable fans, along with their speed (in RPM), power, voltage
50+
and current.
5151

5252
The Quadro exposes four physical and sixteen virtual temperature sensors, a flow
5353
sensor and four PWM controllable fans, along with their speed (in RPM), power,
@@ -95,7 +95,7 @@ Sysfs entries
9595
================ ==============================================================
9696
temp[1-20]_input Physical/virtual temperature sensors (in millidegrees Celsius)
9797
temp[1-8]_offset Temperature sensor correction offset (in millidegrees Celsius)
98-
fan[1-8]_input Pump/fan speed (in RPM) / Flow speed (in dL/h)
98+
fan[1-9]_input Pump/fan speed (in RPM) / Flow speed (in dL/h)
9999
fan1_min Minimal fan speed (in RPM)
100100
fan1_max Maximal fan speed (in RPM)
101101
fan1_target Target fan speed (in RPM)

drivers/hwmon/aquacomputer_d5next.c

+21-13
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,14 @@ static u16 aquastreamult_sensor_fan_offsets[] = { AQUASTREAMULT_FAN_OFFSET };
202202
#define OCTO_NUM_FANS 8
203203
#define OCTO_NUM_SENSORS 4
204204
#define OCTO_NUM_VIRTUAL_SENSORS 16
205+
#define OCTO_NUM_FLOW_SENSORS 1
205206
#define OCTO_CTRL_REPORT_SIZE 0x65F
206207

207208
/* Sensor report offsets for the Octo */
208209
#define OCTO_POWER_CYCLES 0x18
209210
#define OCTO_SENSOR_START 0x3D
210211
#define OCTO_VIRTUAL_SENSORS_START 0x45
212+
#define OCTO_FLOW_SENSOR_OFFSET 0x7B
211213
static u16 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xCB, 0xD8 };
212214

213215
/* Control report offsets for the Octo */
@@ -363,18 +365,6 @@ static const char *const label_aquaero_calc_temp_sensors[] = {
363365
"Calc. virtual sensor 4"
364366
};
365367

366-
/* Labels for Octo and Quadro (except speed) */
367-
static const char *const label_fan_speed[] = {
368-
"Fan 1 speed",
369-
"Fan 2 speed",
370-
"Fan 3 speed",
371-
"Fan 4 speed",
372-
"Fan 5 speed",
373-
"Fan 6 speed",
374-
"Fan 7 speed",
375-
"Fan 8 speed"
376-
};
377-
378368
static const char *const label_fan_power[] = {
379369
"Fan 1 power",
380370
"Fan 2 power",
@@ -408,6 +398,19 @@ static const char *const label_fan_current[] = {
408398
"Fan 8 current"
409399
};
410400

401+
/* Labels for Octo fan speeds */
402+
static const char *const label_octo_speeds[] = {
403+
"Fan 1 speed",
404+
"Fan 2 speed",
405+
"Fan 3 speed",
406+
"Fan 4 speed",
407+
"Fan 5 speed",
408+
"Fan 6 speed",
409+
"Fan 7 speed",
410+
"Fan 8 speed",
411+
"Flow speed [dL/h]",
412+
};
413+
411414
/* Labels for Quadro fan speeds */
412415
static const char *const label_quadro_speeds[] = {
413416
"Fan 1 speed",
@@ -844,6 +847,7 @@ static umode_t aqc_is_visible(const void *data, enum hwmon_sensor_types type, u3
844847
return 0444;
845848
break;
846849
case aquaero:
850+
case octo:
847851
case quadro:
848852
case highflow:
849853
/* Special case to support flow sensors */
@@ -1289,6 +1293,7 @@ static const struct hwmon_channel_info * const aqc_info[] = {
12891293
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_PULSES,
12901294
HWMON_F_INPUT | HWMON_F_LABEL,
12911295
HWMON_F_INPUT | HWMON_F_LABEL,
1296+
HWMON_F_INPUT | HWMON_F_LABEL,
12921297
HWMON_F_INPUT | HWMON_F_LABEL),
12931298
HWMON_CHANNEL_INFO(power,
12941299
HWMON_P_INPUT | HWMON_P_LABEL,
@@ -1658,6 +1663,9 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
16581663
priv->temp_sensor_start_offset = OCTO_SENSOR_START;
16591664
priv->num_virtual_temp_sensors = OCTO_NUM_VIRTUAL_SENSORS;
16601665
priv->virtual_temp_sensor_start_offset = OCTO_VIRTUAL_SENSORS_START;
1666+
priv->num_flow_sensors = OCTO_NUM_FLOW_SENSORS;
1667+
priv->flow_sensors_start_offset = OCTO_FLOW_SENSOR_OFFSET;
1668+
16611669
priv->temp_ctrl_offset = OCTO_TEMP_CTRL_OFFSET;
16621670

16631671
priv->buffer_size = OCTO_CTRL_REPORT_SIZE;
@@ -1667,7 +1675,7 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
16671675

16681676
priv->temp_label = label_temp_sensors;
16691677
priv->virtual_temp_label = label_virtual_temp_sensors;
1670-
priv->speed_label = label_fan_speed;
1678+
priv->speed_label = label_octo_speeds;
16711679
priv->power_label = label_fan_power;
16721680
priv->voltage_label = label_fan_voltage;
16731681
priv->current_label = label_fan_current;

0 commit comments

Comments
 (0)