From 8f4518e75849ed61b837c673f9e9bc2b9120218f Mon Sep 17 00:00:00 2001 From: Leonard Anderweit Date: Thu, 7 Sep 2023 23:53:46 +0200 Subject: [PATCH] aquaero: Do not set control mode when setting PWM Signed-off-by: Leonard Anderweit --- aquacomputer_d5next.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/aquacomputer_d5next.c b/aquacomputer_d5next.c index d363a3e..3792100 100644 --- a/aquacomputer_d5next.c +++ b/aquacomputer_d5next.c @@ -1753,29 +1753,23 @@ static int aqc_write(struct device *dev, enum hwmon_sensor_types type, u32 attr, ctrl_values[0] = pwm_value; ctrl_values_types[0] = AQC_BE16; - /* Write preset number in fan control source */ - ctrl_values_offsets[1] = priv->fan_ctrl_offsets[channel] + - AQUAERO_FAN_CTRL_SRC_OFFSET; - ctrl_values[1] = AQUAERO_CTRL_PRESET_ID_PWM + channel; - ctrl_values_types[1] = AQC_BE16; - /* Set minimum power to 0 to allow the fan to turn off */ - ctrl_values_offsets[2] = priv->fan_ctrl_offsets[channel] + + ctrl_values_offsets[1] = priv->fan_ctrl_offsets[channel] + AQUAERO_FAN_CTRL_MIN_PWR_OFFSET; - ctrl_values[2] = 0; - ctrl_values_types[2] = AQC_BE16; + ctrl_values[1] = 0; + ctrl_values_types[1] = AQC_BE16; /* * Set maximum power to 100% to allow the fan to * reach maximum speed */ - ctrl_values_offsets[3] = priv->fan_ctrl_offsets[channel] + + ctrl_values_offsets[2] = priv->fan_ctrl_offsets[channel] + AQUAERO_FAN_CTRL_MAX_PWR_OFFSET; - ctrl_values[3] = aqc_pwm_to_percent(255); - ctrl_values_types[3] = AQC_BE16; + ctrl_values[2] = aqc_pwm_to_percent(255); + ctrl_values_types[2] = AQC_BE16; ret = aqc_set_ctrl_vals(priv, ctrl_values_offsets, ctrl_values, - ctrl_values_types, 4); + ctrl_values_types, 3); if (ret < 0) return ret; break;