summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAleksa Savic <savicaleksa83@gmail.com>2022-07-17 19:14:12 +0200
committerGuenter Roeck <linux@roeck-us.net>2022-07-21 07:15:55 -0700
commit09e893092e005a191c1103c00d04806b5fd2e886 (patch)
tree9f43db00369710e7f1b5e7706fb8a0180d7e5c1a /drivers/hwmon
parent03508eea538557b4f61bf1df2e842d252cb9a6e6 (diff)
hwmon: (aquacomputer_d5next) Add D5 Next fan control support
Define pump and fan speed register offsets in D5 Next control report, as well as its size, to expose PWM fan control. Originally-from: Jack Doan <me@jackdoan.com> Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20220717171412.11142-1-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/aquacomputer_d5next.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c
index 0e56cc711a26..997d72ea6182 100644
--- a/drivers/hwmon/aquacomputer_d5next.c
+++ b/drivers/hwmon/aquacomputer_d5next.c
@@ -71,8 +71,12 @@ static u8 secondary_ctrl_report[] = {
#define D5NEXT_PUMP_OFFSET 0x6c
#define D5NEXT_FAN_OFFSET 0x5f
#define D5NEXT_5V_VOLTAGE 0x39
+#define D5NEXT_CTRL_REPORT_SIZE 0x329
static u8 d5next_sensor_fan_offsets[] = { D5NEXT_PUMP_OFFSET, D5NEXT_FAN_OFFSET };
+/* Pump and fan speed registers in D5 Next control report (from 0-100%) */
+static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 };
+
/* Register offsets for the Farbwerk RGB controller */
#define FARBWERK_NUM_SENSORS 4
#define FARBWERK_SENSOR_START 0x2f
@@ -667,9 +671,11 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
priv->num_fans = D5NEXT_NUM_FANS;
priv->fan_sensor_offsets = d5next_sensor_fan_offsets;
+ priv->fan_ctrl_offsets = d5next_ctrl_fan_offsets;
priv->num_temp_sensors = D5NEXT_NUM_SENSORS;
priv->temp_sensor_start_offset = D5NEXT_COOLANT_TEMP;
priv->power_cycle_count_offset = D5NEXT_POWER_CYCLES;
+ priv->buffer_size = D5NEXT_CTRL_REPORT_SIZE;
priv->temp_label = label_d5next_temp;
priv->speed_label = label_d5next_speeds;