Skip to content

Commit

Permalink
hwmon: (aquacomputer_d5next) Add support for Octo flow sensor pulses
Browse files Browse the repository at this point in the history
Add support for reading and writing the flow sensor pulses on
the Aquacomputer Octo. Implemented by David Flemstrom [1].

[1] #95

Originally-from: David Flemstrom <david.flemstrom@gmail.com>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
  • Loading branch information
aleksamagicka committed Mar 31, 2024
1 parent 3a9af81 commit bf03fb0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 13 additions & 4 deletions aquacomputer_d5next.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ static u16 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xC

/* Control report offsets for the Octo */
#define OCTO_TEMP_CTRL_OFFSET 0xA
#define OCTO_FLOW_PULSES_CTRL_OFFSET 0x6
/* Fan speed offsets (0-100%) */
static u16 octo_ctrl_fan_offsets[] = { 0x5B, 0xB0, 0x105, 0x15A, 0x1AF, 0x204, 0x259, 0x2AE };

Expand Down Expand Up @@ -861,9 +862,16 @@ static umode_t aqc_is_visible(const void *data, enum hwmon_sensor_types type, u3
}
break;
case hwmon_fan_pulses:
/* Special case for Quadro flow sensor */
if (priv->kind == quadro && channel == priv->num_fans)
return 0644;
/* Special case for Quadro/Octo flow sensor */
if (channel == priv->num_fans) {
switch (priv->kind) {
case quadro:
case octo:
return 0644;
default:
break;
}
}
break;
case hwmon_fan_min:
case hwmon_fan_max:
Expand Down Expand Up @@ -1294,7 +1302,7 @@ static const struct hwmon_channel_info * const aqc_info[] = {
HWMON_F_INPUT | HWMON_F_LABEL,
HWMON_F_INPUT | HWMON_F_LABEL,
HWMON_F_INPUT | HWMON_F_LABEL,
HWMON_F_INPUT | HWMON_F_LABEL),
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_PULSES),
HWMON_CHANNEL_INFO(power,
HWMON_P_INPUT | HWMON_P_LABEL,
HWMON_P_INPUT | HWMON_P_LABEL,
Expand Down Expand Up @@ -1671,6 +1679,7 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
priv->buffer_size = OCTO_CTRL_REPORT_SIZE;
priv->ctrl_report_delay = CTRL_REPORT_DELAY;

priv->flow_pulses_ctrl_offset = OCTO_FLOW_PULSES_CTRL_OFFSET;
priv->power_cycle_count_offset = OCTO_POWER_CYCLES;

priv->temp_label = label_temp_sensors;
Expand Down
3 changes: 2 additions & 1 deletion docs/aquacomputer_d5next.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ better suited for userspace tools.

The Octo exposes four physical and sixteen virtual temperature sensors, a flow sensor
as well as eight PWM controllable fans, along with their speed (in RPM), power, voltage
and current.
and current. Flow sensor pulses are also available.

The Quadro exposes four physical and sixteen virtual temperature sensors, a flow
sensor and four PWM controllable fans, along with their speed (in RPM), power,
Expand Down Expand Up @@ -100,6 +100,7 @@ fan1_min Minimal fan speed (in RPM)
fan1_max Maximal fan speed (in RPM)
fan1_target Target fan speed (in RPM)
fan5_pulses Quadro flow sensor pulses
fan9_pulses Octo flow sensor pulses
power[1-8]_input Pump/fan power (in micro Watts)
in[0-7]_input Pump/fan voltage (in milli Volts)
curr[1-8]_input Pump/fan current (in milli Amperes)
Expand Down

0 comments on commit bf03fb0

Please sign in to comment.