Skip to contentSkip to conversation

hwmon: (adt7475) Fix default duty on fan is disabled

PATCH Applied Wayne Tung 2 participants 4 messages Jul 1, 2024 – Jul 2, 2024 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Wayne Tung

author
#0 lore raw

PATCH 1/1 hwmon: (adt7475) Fix default duty on fan is disabled

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.

---
 drivers/hwmon/adt7475.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/adt7475.c +1 -1
index 4224ffb30483..ec3336804720 100644
@@ -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),
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Wayne Tung

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.

---

Applied.

Curious - how did you find that ? That bug existed since the driver was introduced.

Thanks,
Guenter

Quoted 16 lines
 drivers/hwmon/adt7475.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/adt7475.c +1 -1
index 4224ffb30483..ec3336804720 100644
@@ -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),
author
#2 lore raw

I'm using adt7475 on the x86 system.
When I tried to probe the driver manually, fans would run at full speed (It's in disabled mode by default).
It's not the expected behavior.
I traced the driver and found the issue.

Thanks,
Wayne

Guenter Roeck <[email protected]> 於 2024年7月2日 週二 上午6:45寫道:

Quoted 33 lines · Wayne Tung
Quoted 6 lines

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.

---

Applied.

Curious - how did you find that ? That bug existed since the driver was introduced.

Thanks,
Guenter

Quoted 16 lines
 drivers/hwmon/adt7475.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/adt7475.c +1 -1
index 4224ffb30483..ec3336804720 100644
@@ -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),

A message that is not in the archive (sent off-list or not yet received): CABrnb7xqZFWwp9A3==ccDkkyAWy855O7JKYrf4EDUGEbhMEZnw@mail.gmail.com

maintainer
#4 lore raw
Quoted 4 lines · Wayne Tung

I'm using adt7475 on the x86 system.
I found that when I tried to probe the driver manually, fans would run full speed (It's in disabled mode by default). So I traced the driver and found the issue.

Thanks for the update. It is interesting to learn that this chip is still actively used.

Guenter