* [PATCH] hwmon: (adt7475) Fix default duty on fan is disabled
@ 2024-07-01 7:32 Wayne Tung
2024-07-01 22:45 ` Guenter Roeck
0 siblings, 1 reply; 4+ messages in thread
From: Wayne Tung @ 2024-07-01 7:32 UTC (permalink / raw)
To: jdelvare, linux; +Cc: linux-hwmon, linux-kernel, 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.
Signed-off-by: Wayne Tung <chineweff@gmail.com>
---
drivers/hwmon/adt7475.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 4224ffb30483..ec3336804720 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -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),
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hwmon: (adt7475) Fix default duty on fan is disabled
2024-07-01 7:32 [PATCH] hwmon: (adt7475) Fix default duty on fan is disabled Wayne Tung
@ 2024-07-01 22:45 ` Guenter Roeck
2024-07-02 11:04 ` Wayne Tung
[not found] ` <CABrnb7xqZFWwp9A3==ccDkkyAWy855O7JKYrf4EDUGEbhMEZnw@mail.gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-07-01 22:45 UTC (permalink / raw)
To: Wayne Tung; +Cc: jdelvare, linux-hwmon, linux-kernel
On Mon, Jul 01, 2024 at 03:32:52PM +0800, Wayne Tung wrote:
> 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.
>
> Signed-off-by: Wayne Tung <chineweff@gmail.com>
> ---
Applied.
Curious - how did you find that ? That bug existed since the driver was
introduced.
Thanks,
Guenter
> drivers/hwmon/adt7475.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
> index 4224ffb30483..ec3336804720 100644
> --- a/drivers/hwmon/adt7475.c
> +++ b/drivers/hwmon/adt7475.c
> @@ -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),
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hwmon: (adt7475) Fix default duty on fan is disabled
2024-07-01 22:45 ` Guenter Roeck
@ 2024-07-02 11:04 ` Wayne Tung
[not found] ` <CABrnb7xqZFWwp9A3==ccDkkyAWy855O7JKYrf4EDUGEbhMEZnw@mail.gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Wayne Tung @ 2024-07-02 11:04 UTC (permalink / raw)
To: Guenter Roeck; +Cc: jdelvare, linux-hwmon, linux-kernel
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 <linux@roeck-us.net> 於 2024年7月2日 週二 上午6:45寫道:
>
> On Mon, Jul 01, 2024 at 03:32:52PM +0800, Wayne Tung wrote:
> > 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.
> >
> > Signed-off-by: Wayne Tung <chineweff@gmail.com>
> > ---
>
> Applied.
>
> Curious - how did you find that ? That bug existed since the driver was
> introduced.
>
> Thanks,
> Guenter
>
> > drivers/hwmon/adt7475.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
> > index 4224ffb30483..ec3336804720 100644
> > --- a/drivers/hwmon/adt7475.c
> > +++ b/drivers/hwmon/adt7475.c
> > @@ -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),
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hwmon: (adt7475) Fix default duty on fan is disabled
[not found] ` <CABrnb7xqZFWwp9A3==ccDkkyAWy855O7JKYrf4EDUGEbhMEZnw@mail.gmail.com>
@ 2024-07-02 19:41 ` Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-07-02 19:41 UTC (permalink / raw)
To: Wayne Tung; +Cc: jdelvare, linux-hwmon, linux-kernel
On 7/2/24 03:31, Wayne Tung wrote:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-02 19:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 7:32 [PATCH] hwmon: (adt7475) Fix default duty on fan is disabled Wayne Tung
2024-07-01 22:45 ` Guenter Roeck
2024-07-02 11:04 ` Wayne Tung
[not found] ` <CABrnb7xqZFWwp9A3==ccDkkyAWy855O7JKYrf4EDUGEbhMEZnw@mail.gmail.com>
2024-07-02 19:41 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox