All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] RFC PATCH I2C: w83781d: remove non-i2c sensor chips
@ 2005-06-02 21:07 Grant Coady
  2005-06-03 21:46 ` [lm-sensors] " Jean Delvare
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Grant Coady @ 2005-06-02 21:07 UTC (permalink / raw)
  To: lm-sensors

Greetings,

This patch removes non-i2c w83697hf, w83627thf sensor chips from the 
w83781d driver.  Compile tested.

Also remove references to those sensor chips in w83781d docs.

--Grant.


Signed-off-by: Grant Coady <gcoady@gmail.com>

---
 Documentation/i2c/chips/w83781d |   14 +------
 drivers/i2c/chips/w83781d.c     |   73 ++++++++++++----------------------------
 2 files changed, 24 insertions(+), 63 deletions(-)

diff -X dontdiff -Nrup linux-2.6.12-rc5-mm2/Documentation/i2c/chips/w83781d linux-2.6.12-rc5-mm2a/Documentation/i2c/chips/w83781d
--- linux-2.6.12-rc5-mm2/Documentation/i2c/chips/w83781d	2005-06-01 22:14:06.000000000 +1000
+++ linux-2.6.12-rc5-mm2a/Documentation/i2c/chips/w83781d	2005-06-03 04:52:14.000000000 +1000
@@ -18,14 +18,6 @@ Supported chips:
     Prefix: 'w83627hf'
     Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
     Datasheet: http://www.winbond.com/PDF/sheet/w83627hf.pdf
-  * Winbond W83627THF
-    Prefix: 'w83627thf'
-    Addresses scanned: ISA address 0x290 (8 I/O ports)
-    Datasheet: http://www.winbond.com/PDF/sheet/w83627thf.pdf
-  * Winbond W83697HF
-    Prefix: 'w83697hf'
-    Addresses scanned: ISA 0x290 (8 I/O ports)
-    Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83697hf.pdf
   * Asus AS99127F
     Prefix: 'as99127f'
     Addresses scanned: I2C 0x28 - 0x2f
@@ -53,8 +45,8 @@ force_subclients=bus,caddr,saddr,saddr
 Description
 -----------
 
-This driver implements support for the Winbond W83627HF, W83627THF, W83781D,
-W83782D, W83783S, W83697HF chips, and the Asus AS99127F chips. We will refer
+This driver implements support for the Winbond W83627HF, W83781D,
+W83782D, W83783S chips, and the Asus AS99127F chips. We will refer
 to them collectively as W8378* chips.
 
 There is quite some difference between these chips, but they are similar
@@ -67,10 +59,8 @@ as99127f    7       3       0       3   
 as99127f rev.2 (type_name = as99127f)       0x31    0x5ca3  yes     no
 w83781d     7       3       0       3       0x10-1  0x5ca3  yes     yes
 w83627hf    9       3       2       3       0x21    0x5ca3  yes     yes(LPC)
-w83627thf   9       3       2       3       0x90    0x5ca3  no      yes(LPC)
 w83782d     9       3       2-4     3       0x30    0x5ca3  yes     yes
 w83783s     5-6     3       2       1-2     0x40    0x5ca3  yes     no
-w83697hf    8       2       2       2       0x60    0x5ca3  no      yes(LPC)
 
 Detection of these chips can sometimes be foiled because they can be in
 an internal state that allows no clean access. If you know the address
diff -X dontdiff -Nrup linux-2.6.12-rc5-mm2/drivers/i2c/chips/w83781d.c linux-2.6.12-rc5-mm2a/drivers/i2c/chips/w83781d.c
--- linux-2.6.12-rc5-mm2/drivers/i2c/chips/w83781d.c	2005-06-01 22:14:06.000000000 +1000
+++ linux-2.6.12-rc5-mm2a/drivers/i2c/chips/w83781d.c	2005-06-03 04:55:51.000000000 +1000
@@ -28,10 +28,8 @@
     as99127f rev.2 (type_name = as99127f)	0x31	0x5ca3	yes	no
     w83781d	7	3	0	3	0x10-1	0x5ca3	yes	yes
     w83627hf	9	3	2	3	0x21	0x5ca3	yes	yes(LPC)
-    w83627thf	9	3	2	3	0x90	0x5ca3	no	yes(LPC)
     w83782d	9	3	2-4	3	0x30	0x5ca3	yes	yes
     w83783s	5-6	3	2	1-2	0x40	0x5ca3	yes	no
-    w83697hf	8	2	2	2	0x60	0x5ca3	no	yes(LPC)
 
 */
 
@@ -52,7 +50,7 @@ static unsigned short normal_i2c[] = { 0
 static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_6(w83781d, w83782d, w83783s, w83627hf, as99127f, w83697hf);
+SENSORS_INSMOD_5(w83781d, w83782d, w83783s, w83627hf, as99127f);
 I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "
 		    "{bus, clientaddr, subclientaddr1, subclientaddr2}");
 
@@ -998,14 +996,7 @@ w83781d_detect(struct i2c_adapter *adapt
 		err = -EINVAL;
 		goto ERROR0;
 	}
-	if (!is_isa && kind = w83697hf) {
-		dev_err(&adapter->dev,
-			"Cannot force ISA-only chip for I2C address 0x%02x.\n",
-			address);
-		err = -EINVAL;
-		goto ERROR0;
-	}
-	
+
 	if (is_isa)
 		if (!request_region(address, W83781D_EXTENT,
 				    w83781d_driver.name)) {
@@ -1137,12 +1128,10 @@ w83781d_detect(struct i2c_adapter *adapt
 		else if (val1 = 0x40 && vendid = winbond && !is_isa
 				&& address = 0x2d)
 			kind = w83783s;
-		else if ((val1 = 0x21 || val1 = 0x90) && vendid = winbond)
+		else if (val1 = 0x21 && vendid = winbond)
 			kind = w83627hf;
 		else if (val1 = 0x31 && !is_isa && address >= 0x28)
 			kind = as99127f;
-		else if (val1 = 0x60 && vendid = winbond && is_isa)
-			kind = w83697hf;
 		else {
 			if (kind = 0)
 				dev_warn(&new_client->dev, "Ignoring 'force' "
@@ -1161,14 +1150,9 @@ w83781d_detect(struct i2c_adapter *adapt
 	} else if (kind = w83783s) {
 		client_name = "w83783s";
 	} else if (kind = w83627hf) {
-		if (val1 = 0x90)
-			client_name = "w83627thf";
-		else
-			client_name = "w83627hf";
+		client_name = "w83627hf";
 	} else if (kind = as99127f) {
 		client_name = "as99127f";
-	} else if (kind = w83697hf) {
-		client_name = "w83697hf";
 	}
 
 	/* Fill in the remaining client fields and put into the global list */
@@ -1206,7 +1190,7 @@ w83781d_detect(struct i2c_adapter *adapt
 
 	/* Register sysfs hooks */
 	device_create_file_in(new_client, 0);
-	if (kind != w83783s && kind != w83697hf)
+	if (kind != w83783s)
 		device_create_file_in(new_client, 1);
 	device_create_file_in(new_client, 2);
 	device_create_file_in(new_client, 3);
@@ -1220,24 +1204,20 @@ w83781d_detect(struct i2c_adapter *adapt
 
 	device_create_file_fan(new_client, 1);
 	device_create_file_fan(new_client, 2);
-	if (kind != w83697hf)
-		device_create_file_fan(new_client, 3);
+	device_create_file_fan(new_client, 3);
 
 	device_create_file_temp(new_client, 1);
 	device_create_file_temp(new_client, 2);
-	if (kind != w83783s && kind != w83697hf)
+	if (kind != w83783s)
 		device_create_file_temp(new_client, 3);
 
-	if (kind != w83697hf)
-		device_create_file_vid(new_client);
+	device_create_file_vid(new_client);
 
-	if (kind != w83697hf)
-		device_create_file_vrm(new_client);
+	device_create_file_vrm(new_client);
 
 	device_create_file_fan_div(new_client, 1);
 	device_create_file_fan_div(new_client, 2);
-	if (kind != w83697hf)
-		device_create_file_fan_div(new_client, 3);
+	device_create_file_fan_div(new_client, 3);
 
 	device_create_file_alarms(new_client);
 
@@ -1256,7 +1236,7 @@ w83781d_detect(struct i2c_adapter *adapt
 	if (kind != as99127f && kind != w83781d) {
 		device_create_file_sensor(new_client, 1);
 		device_create_file_sensor(new_client, 2);
-		if (kind != w83783s && kind != w83697hf)
+		if (kind != w83783s)
 			device_create_file_sensor(new_client, 3);
 	}
 
@@ -1479,7 +1459,7 @@ w83781d_init_client(struct i2c_client *c
 				else
 					data->sens[i - 1] = 2;
 			}
-			if ((type = w83783s || type = w83697hf) && (i = 2))
+			if (type = w83783s && i = 2)
 				break;
 		}
 	}
@@ -1495,7 +1475,7 @@ w83781d_init_client(struct i2c_client *c
 		}
 
 		/* Enable temp3 */
-		if (type != w83783s && type != w83697hf) {
+		if (type != w83783s) {
 			tmp = w83781d_read_value(client,
 				W83781D_REG_TEMP3_CONFIG);
 			if (tmp & 0x01) {
@@ -1536,8 +1516,7 @@ static struct w83781d_data *w83781d_upda
 		dev_dbg(dev, "Starting device update\n");
 
 		for (i = 0; i <= 8; i++) {
-			if ((data->type = w83783s || data->type = w83697hf)
-			    && (i = 1))
+			if (data->type = w83783s && i = 1)
 				continue;	/* 783S has no in1 */
 			data->in[i]  			    w83781d_read_value(client, W83781D_REG_IN(i));
@@ -1545,7 +1524,7 @@ static struct w83781d_data *w83781d_upda
 			    w83781d_read_value(client, W83781D_REG_IN_MIN(i));
 			data->in_max[i]  			    w83781d_read_value(client, W83781D_REG_IN_MAX(i));
-			if ((data->type != w83782d) && (data->type != w83697hf)
+			if ((data->type != w83782d)
 			    && (data->type != w83627hf) && (i = 6))
 				break;
 		}
@@ -1581,7 +1560,7 @@ static struct w83781d_data *w83781d_upda
 		    w83781d_read_value(client, W83781D_REG_TEMP_OVER(2));
 		data->temp_max_hyst_add[0]  		    w83781d_read_value(client, W83781D_REG_TEMP_HYST(2));
-		if (data->type != w83783s && data->type != w83697hf) {
+		if (data->type != w83783s) {
 			data->temp_add[1]  			    w83781d_read_value(client, W83781D_REG_TEMP(3));
 			data->temp_max_add[1] @@ -1592,26 +1571,18 @@ static struct w83781d_data *w83781d_upda
 					       W83781D_REG_TEMP_HYST(3));
 		}
 		i = w83781d_read_value(client, W83781D_REG_VID_FANDIV);
-		if (data->type != w83697hf) {
-			data->vid = i & 0x0f;
-			data->vid |-			    (w83781d_read_value(client, W83781D_REG_CHIPID) &
-			     0x01)
-			    << 4;
-		}
+		data->vid = i & 0x0f;
+		data->vid |= (w83781d_read_value(client,
+					W83781D_REG_CHIPID) & 0x01) << 4;
 		data->fan_div[0] = (i >> 4) & 0x03;
 		data->fan_div[1] = (i >> 6) & 0x03;
-		if (data->type != w83697hf) {
-			data->fan_div[2] = (w83781d_read_value(client,
-							       W83781D_REG_PIN)
-					    >> 6) & 0x03;
-		}
+		data->fan_div[2] = (w83781d_read_value(client,
+					W83781D_REG_PIN) >> 6) & 0x03;
 		if ((data->type != w83781d) && (data->type != as99127f)) {
 			i = w83781d_read_value(client, W83781D_REG_VBAT);
 			data->fan_div[0] |= (i >> 3) & 0x04;
 			data->fan_div[1] |= (i >> 4) & 0x04;
-			if (data->type != w83697hf)
-				data->fan_div[2] |= (i >> 5) & 0x04;
+			data->fan_div[2] |= (i >> 5) & 0x04;
 		}
 		data->alarms  		    w83781d_read_value(client,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor chips
  2005-06-02 21:07 [lm-sensors] RFC PATCH I2C: w83781d: remove non-i2c sensor chips Grant Coady
@ 2005-06-03 21:46 ` Jean Delvare
  2005-06-03 23:30 ` Grant Coady
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2005-06-03 21:46 UTC (permalink / raw)
  To: lm-sensors

Hi Grant,

> This patch removes non-i2c w83697hf, w83627thf sensor chips from the 
> w83781d driver.  Compile tested.
> 
> Also remove references to those sensor chips in w83781d docs.

Great, except for:

> -	}
> -	
> +

Please avoid this "noise" change (same holds for all future patches, of
course).

> -	if (kind != w83697hf)
> -		device_create_file_vid(new_client);
> +	device_create_file_vid(new_client);
>  
> -	if (kind != w83697hf)
> -		device_create_file_vrm(new_client);
> +	device_create_file_vrm(new_client);

You could additionally remove the blank line in between, as vid and vrm
are tightly linked.

All the rest is OK, good work.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor chips
  2005-06-02 21:07 [lm-sensors] RFC PATCH I2C: w83781d: remove non-i2c sensor chips Grant Coady
  2005-06-03 21:46 ` [lm-sensors] " Jean Delvare
@ 2005-06-03 23:30 ` Grant Coady
  2005-06-06 10:42 ` [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor Grant Coady
  2005-06-06 11:23 ` Jean Delvare
  3 siblings, 0 replies; 5+ messages in thread
From: Grant Coady @ 2005-06-03 23:30 UTC (permalink / raw)
  To: lm-sensors

Hi Khali,
On Fri, 3 Jun 2005 21:46:32 +0200, Jean Delvare <khali@linux-fr.org> wrote:

>Hi Grant,
>
>> This patch removes non-i2c w83697hf, w83627thf sensor chips from the 
>> w83781d driver.  Compile tested.
>> 
>> Also remove references to those sensor chips in w83781d docs.
>
>Great, except for:
>
>> -	}
>> -	
>> +
That 'innocent blank line' had a <tab> in it, now I give back trailing 
whitespace, sigh . . .  _no_ whitespace mangling producing gratuitous 
noise, okay :o)
>
>Please avoid this "noise" change (same holds for all future patches, of
>course).
>
>> -	if (kind != w83697hf)
>> -		device_create_file_vid(new_client);
>> +	device_create_file_vid(new_client);
>>  
>> -	if (kind != w83697hf)
>> -		device_create_file_vrm(new_client);
>> +	device_create_file_vrm(new_client);
>
>You could additionally remove the blank line in between, as vid and vrm
>are tightly linked.
>
>All the rest is OK, good work.

So visible whitespace alignment okay, as above, but not 'noise' in top 
one.  Try to match surrounding whitespace style.  Subtle.

I'll make those changes, send new patch to Greg, copy list.

Thanks,
--Grant.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor
  2005-06-02 21:07 [lm-sensors] RFC PATCH I2C: w83781d: remove non-i2c sensor chips Grant Coady
  2005-06-03 21:46 ` [lm-sensors] " Jean Delvare
  2005-06-03 23:30 ` Grant Coady
@ 2005-06-06 10:42 ` Grant Coady
  2005-06-06 11:23 ` Jean Delvare
  3 siblings, 0 replies; 5+ messages in thread
From: Grant Coady @ 2005-06-06 10:42 UTC (permalink / raw)
  To: lm-sensors

On Fri, 3 Jun 2005 21:46:32 +0200, Jean Delvare <khali@linux-fr.org> wrote:

>Hi Grant,
>
>> This patch removes non-i2c w83697hf, w83627thf sensor chips from the 
>> w83781d driver.  Compile tested.
>> 
>> Also remove references to those sensor chips in w83781d docs.
>
>Great, except for:
>
>> -	}
>> -	
>> +
>
>Please avoid this "noise" change (same holds for all future patches, of
>course).
Fine, I'll wait until your CodingStyle patches go through, as twice now 
I've been told by you to violate CodingStyle.  Understanding yet to dawn 
as to why this is so.

--Grant.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor
  2005-06-02 21:07 [lm-sensors] RFC PATCH I2C: w83781d: remove non-i2c sensor chips Grant Coady
                   ` (2 preceding siblings ...)
  2005-06-06 10:42 ` [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor Grant Coady
@ 2005-06-06 11:23 ` Jean Delvare
  3 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2005-06-06 11:23 UTC (permalink / raw)
  To: lm-sensors


Hi Grant,

> > Great, except for:
> >
> > > -	}
> > > -
> > > +
> >
> > Please avoid this "noise" change (same holds for all future patches, of
> > course).
>
> Fine, I'll wait until your CodingStyle patches go through, as twice now
> I've been told by you to violate CodingStyle.  Understanding yet to dawn
> as to why this is so.

Can you please point me to the exact rule you think I told you to
violate? I don't think I really did.

What you were doing here is fix coding style while the main point of your
patch was to remove a deprecated feature. As per
Documentation/SubmittingPatches section 3, these changes should be sent
as two different patches. Doing so eases the work of all reviewers and
maintainers up the chain, and is all I was asking for.

Thanks,
--
Jean Delvare

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-06 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-02 21:07 [lm-sensors] RFC PATCH I2C: w83781d: remove non-i2c sensor chips Grant Coady
2005-06-03 21:46 ` [lm-sensors] " Jean Delvare
2005-06-03 23:30 ` Grant Coady
2005-06-06 10:42 ` [lm-sensors] Re: RFC PATCH I2C: w83781d: remove non-i2c sensor Grant Coady
2005-06-06 11:23 ` Jean Delvare

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.