First, thanks to Guenter for porting this, looks good.

On Mon, Feb 27, 2012 at 02:06:12PM -0800, Guenter Roeck wrote:
> From: Nikolaus Schulz <[email protected]>
> 
> By hwmon sysfs interface convention, setting pwm_enable to zero sets a fan
> to full speed.  In the f75375s driver, this need be done by enabling
> manual fan control, plus duty mode for the F875387 chip, and then setting
> the maximum duty cycle.  Fix a bug where the two necessary register writes
> were swapped, effectively discarding the setting to full-speed.

One minor thing: the F875387 is only supported by Linux as of v3.3, so
it might make sense to drop the referral to this chip from the commit
message, like so:

<q>
By hwmon sysfs interface convention, setting pwm_enable to zero sets a
fan to full speed.  In the f75375s driver, this need be done by enabling
manual fan control, and then setting the maximum duty cycle.  Fix a bug
where the two necessary register writes were swapped, effectively
discarding the setting to full-speed.
</q>

> Signed-off-by: Nikolaus Schulz <[email protected]>
> Cc: Riku Voipio <[email protected]>
> Signed-off-by: Guenter Roeck <[email protected]>
> ---
> Backport from upstream commit c1c1a3d012fe5e82a9a025fb4b5a4f8ee67a53f6.
> Please apply to v3.0+.

This also applies to the 2.6.32 stable kernel.

>  drivers/hwmon/f75375s.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
> index e4ab491..040a820 100644
> --- a/drivers/hwmon/f75375s.c
> +++ b/drivers/hwmon/f75375s.c
> @@ -304,8 +304,6 @@ static int set_pwm_enable_direct(struct i2c_client 
> *client, int nr, int val)
>       case 0: /* Full speed */
>               fanmode  |= (3 << FAN_CTRL_MODE(nr));
>               data->pwm[nr] = 255;
> -             f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
> -                             data->pwm[nr]);
>               break;
>       case 1: /* PWM */
>               fanmode  |= (3 << FAN_CTRL_MODE(nr));
> @@ -318,6 +316,9 @@ static int set_pwm_enable_direct(struct i2c_client 
> *client, int nr, int val)
>       }
>       f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
>       data->pwm_enable[nr] = val;
> +     if (val == 0)
> +             f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
> +                             data->pwm[nr]);
>       return 0;
>  }
>  
> -- 
> 1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to