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] hwmon: (it87) Drop uart6 condition for vin5&vin6 for IT8783F
Date: Wed, 16 May 2012 13:41:26 +0000	[thread overview]
Message-ID: <20120516134126.GA28590@ericsson.com> (raw)
In-Reply-To: <50AE10ED-22C6-474A-90F2-81685F17B042@extracloud.de>

On Wed, May 16, 2012 at 05:23:17AM -0400, Jean Delvare wrote:
> On Wed, 16 May 2012 08:52:31 +0200, Jean Delvare wrote:
> > On Tue, 15 May 2012 12:51:08 -0700, Guenter Roeck wrote:
> > > The data sheet says, with Register 0x27/Bit 0:
> > > 
> > > Function Selection of Pin 93 (FSP)
> > > 0: VIN5/FAN_TAC3/SIN6
> > > If bit 2 of index 2Ch is 1, FAN_TAC3/SIN6 input is enabled; otherwise
> > > select VIN5 input.
> > > 1: GP30
> > > 
> > > Assuming the above is correct, I think I'll rename "uart6" to "fan3" and
> > > use
> > > 
> > > 	fan3 = reg2C & (1 << 2);
> > > ...
> > > 	/* Check if fan3 is there or not */
> > > 	if ((reg27 & (1 << 0)) || !fan3)
> > >                 sio_data->skip_fan |= (1 << 2);
> > > ...
> > > 	if ((reg27 & (1 << 0)) || fan3)
> > > 		sio_data->skip_in |= (1 << 5); /* No VIN5 */
> > > 
> > > Does that make sense ?
> > 
> > That's what the datasheet says, at least. I find it weird that enabling
> > UART6 has an effect on VIN5 vs. FAN3_TAC, especially when UART6 pins
> > can be remapped to a completely different location, but maybe this is
> > really how the chip works.
> > 
> > I think I wouldn't introduce variable fan3, as it is kind of a
> > misnomer, and a proper name would be overly long. But this is an
> > implementation detail.
> > 
> > Björn, what is your design using pin 93 for?
> 
> I've updated the driver at
> http://khali.linux-fr.org/devel/misc/it87/
> 
> with Björn's patch updated per the discussion above. Björn, can you
> please give it a try and confirm it works for you?
> 
> Guenter, I attach the delta between your code and my standalone driver.
> This is what could be folded into your previous patches, unless you no
> longer want to touch them.
> 
Looks good. I'll fold it in. Thanks for taking care of it.

Guenter

> -- 
> Jean Delvare

> --- linux-3.4-rc7.orig/drivers/hwmon/it87.c	2012-05-16 08:53:21.000000000 +0200
> +++ linux-3.4-rc7/drivers/hwmon/it87.c	2012-05-16 09:36:31.828155337 +0200
> @@ -1744,7 +1744,6 @@ static int __init it87_find(unsigned sho
>  		sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f;
>  	} else if (sio_data->type == it8783) {
>  		int reg25, reg27, reg2A, reg2C, regEF;
> -		bool uart6;
>  
>  		sio_data->skip_vid = 1;	/* No VID */
>  
> @@ -1756,10 +1755,8 @@ static int __init it87_find(unsigned sho
>  		reg2C = superio_inb(IT87_SIO_PINX2_REG);
>  		regEF = superio_inb(IT87_SIO_SPI_REG);
>  
> -		uart6 = reg2C & (1 << 2);
> -
>  		/* Check if fan3 is there or not */
> -		if ((reg27 & (1 << 0)) || !uart6)
> +		if ((reg27 & (1 << 0)) || !(reg2C & (1 << 2)))
>  			sio_data->skip_fan |= (1 << 2);
>  		if ((reg25 & (1 << 4))
>  		    || (!(reg2A & (1 << 1)) && (regEF & (1 << 0))))
> @@ -1772,11 +1769,11 @@ static int __init it87_find(unsigned sho
>  			sio_data->skip_pwm |= (1 << 1);
>  
>  		/* VIN5 */
> -		if ((reg27 & (1 << 0)) || uart6)
> +		if ((reg27 & (1 << 0)) || (reg2C & (1 << 2)))
>  			sio_data->skip_in |= (1 << 5); /* No VIN5 */
>  
>  		/* VIN6 */
> -		if ((reg27 & (1 << 1)) || uart6)
> +		if (reg27 & (1 << 1))
>  			sio_data->skip_in |= (1 << 6); /* No VIN6 */
>  
>  		/*


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

  parent reply	other threads:[~2012-05-16 13:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 17:25 [lm-sensors] [PATCH] hwmon: (it87) Drop uart6 condition for vin5&vin6 for IT8783F Björn Gerhart
2012-05-15 18:21 ` Jean Delvare
2012-05-15 18:49 ` Björn Gerhart
2012-05-15 18:51 ` Guenter Roeck
2012-05-15 19:51 ` Guenter Roeck
2012-05-16  6:52 ` Jean Delvare
2012-05-16  9:23 ` Jean Delvare
2012-05-16 13:41 ` Guenter Roeck [this message]
2012-05-16 17:07 ` Björn Gerhart
2012-05-16 17:41 ` Guenter Roeck

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=20120516134126.GA28590@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.