All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom.de>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 2/2] hwmon: (max6639) Fix PPR register initialization to set both channels
Date: Tue, 21 Feb 2012 19:31:21 +0000	[thread overview]
Message-ID: <4F43F109.3090900@antcom.de> (raw)
In-Reply-To: <1329850735-9876-3-git-send-email-guenter.roeck@ericsson.com>

On 21/02/12 19:58, Guenter Roeck wrote:
> From: Chris D Schimp <silverchris@gmail.com>
> 
> Initialize PPR register for both channels, and set correct PPR register bits.
> Also remove unnecessary variable initializations.
> 
> Signed-off-by: Chris D Schimp <silverchris@gmail.com>
> [guenter.roeck@ericsson.com: Merged two patches into one]
> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>

Acked-by: Roland Stigge <stigge@antcom.de>

> ---
>  drivers/hwmon/max6639.c |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
> index 13e58a1..a6760ba 100644
> --- a/drivers/hwmon/max6639.c
> +++ b/drivers/hwmon/max6639.c
> @@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client)
>  	struct max6639_data *data = i2c_get_clientdata(client);
>  	struct max6639_platform_data *max6639_info >  		client->dev.platform_data;
> -	int i = 0;
> +	int i;
>  	int rpm_range = 1; /* default: 4000 RPM */
> -	int err = 0;
> +	int err;
>  
>  	/* Reset chip to default values, see below for GCONFIG setup */
>  	err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,
> @@ -446,11 +446,6 @@ static int max6639_init_client(struct i2c_client *client)
>  	else
>  		data->ppr = 2;
>  	data->ppr -= 1;
> -	err = i2c_smbus_write_byte_data(client,
> -			MAX6639_REG_FAN_PPR(i),
> -			data->ppr << 5);
> -	if (err)
> -		goto exit;
>  
>  	if (max6639_info)
>  		rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
> @@ -458,6 +453,13 @@ static int max6639_init_client(struct i2c_client *client)
>  
>  	for (i = 0; i < 2; i++) {
>  
> +		/* Set Fan pulse per revolution */
> +		err = i2c_smbus_write_byte_data(client,
> +				MAX6639_REG_FAN_PPR(i),
> +				data->ppr << 6);
> +		if (err)
> +			goto exit;
> +
>  		/* Fans config PWM, RPM */
>  		err = i2c_smbus_write_byte_data(client,
>  			MAX6639_REG_FAN_CONFIG1(i),


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

      reply	other threads:[~2012-02-21 19:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 18:58 [lm-sensors] [PATCH 2/2] hwmon: (max6639) Fix PPR register initialization to set both channels Guenter Roeck
2012-02-21 19:31 ` Roland Stigge [this message]

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=4F43F109.3090900@antcom.de \
    --to=stigge@antcom.de \
    --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.