All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 1/6] hwmon: (f75375s) Fix register write order when setting fans to full spe
Date: Thu, 23 Feb 2012 01:14:22 +0000	[thread overview]
Message-ID: <20120223011422.GA4930@ericsson.com> (raw)
In-Reply-To: <1329949129-4265-2-git-send-email-mail@microschulz.de>

On Wed, Feb 22, 2012 at 05:18:44PM -0500, Nikolaus Schulz wrote:
> From: Nikolaus Schulz <schulz@macnetix.de>
> 
> 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.
> 
> Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
> ---
>  drivers/hwmon/f75375s.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
Nikolaus,

this patch modifies register write order for the other chips as well.
Does that have any impact on the other chips ? Or, in other words,
is this patch also necessary for stable ?

Thanks,
Guenter

> diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
> index faf66c8..5dae122 100644
> --- a/drivers/hwmon/f75375s.c
> +++ b/drivers/hwmon/f75375s.c
> @@ -340,8 +340,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
>  			fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
>  			fanmode |= (1 << F75387_FAN_DUTY_MODE(nr));
>  			data->pwm[nr] = 255;
> -			f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
> -					data->pwm[nr]);
>  			break;
>  		case 1: /* PWM */
>  			fanmode  |= (1 << F75387_FAN_MANU_MODE(nr));
> @@ -361,8 +359,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));
> @@ -377,6 +373,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.9.1
> 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  reply	other threads:[~2012-02-23  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 22:18 [lm-sensors] [PATCH 1/6] hwmon: (f75375s) Fix register write order when setting fans to full speed Nikolaus Schulz
2012-02-23  1:14 ` Guenter Roeck [this message]
2012-02-23  1:46 ` [lm-sensors] [PATCH 1/6] hwmon: (f75375s) Fix register write order when setting fans to full spe Nikolaus Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120223011422.GA4930@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.