Re: [PATCH] hwmon: (it87) Drop uart6 condition for vin5&vin6 for IT8783F

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux