]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
hwmon: (adt7475) Fix default duty on fan is disabled
authorWayne Tung <chineweff@gmail.com>
Mon, 1 Jul 2024 07:32:52 +0000 (15:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2024 06:59:12 +0000 (08:59 +0200)
[ Upstream commit 39b24cced70fdc336dbc0070f8b3bde61d8513a8 ]

According to the comments on fan is disabled, we change to manual mode
and set the duty cycle to 0.
For setting the duty cycle part, the register is wrong. Fix it.

Fixes: 1c301fc5394f ("hwmon: Add a driver for the ADT7475 hardware monitoring chip")
Signed-off-by: Wayne Tung <chineweff@gmail.com>
Link: https://lore.kernel.org/r/20240701073252.317397-1-chineweff@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/adt7475.c

index 4224ffb304832e182bcfa4518b768e322a9a6ff6..ec3336804720e2aa61743f0327a4d3a3af836bf9 100644 (file)
@@ -1900,7 +1900,7 @@ static void adt7475_read_pwm(struct i2c_client *client, int index)
                data->pwm[CONTROL][index] &= ~0xE0;
                data->pwm[CONTROL][index] |= (7 << 5);
 
-               i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index),
+               i2c_smbus_write_byte_data(client, PWM_REG(index),
                                          data->pwm[INPUT][index]);
 
                i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index),