Skip to contentSkip to conversation

Support for Winbond W83687THF in Lm_sensors-2.9.1

lm-sensors Hugo Vanwoerkom 2 participants 4 messages Jul 26, 2005 – Jul 31, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

A little while ago Jean Delvare helped me to set up support for this in 2.6.x.

I am now trying to get it to work in 2.4.31. But the w83627hf modules in 2.6.x and 2.9.1 are very different.

I attach a patch I attempted. The module loads but no sensors found.

Could someone with more knowledge than I take a look at this please?

Thanks!

Hugo

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w83627hf.diff
Type: text/x-patch
Size: 3222 bytes
Desc: 128220096-w83627hf.diff
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050726/a751c9f7/w83627hf.bin

#1 lore raw

Hi Hugo,

Quoted 7 lines

A little while ago Jean Delvare helped me to set up support for this in 2.6.x.

I am now trying to get it to work in 2.4.31. But the w83627hf modules in 2.6.x and 2.9.1 are very different.

Quoted 5 lines

I attach a patch I attempted. The module loads but no sensors found.

Could someone with more knowledge than I take a look at this please?

Your patch looks almost correct to me, I think you simply forgot to update this part:

	if (kind = w83627hf) {
		type_name = "w83627hf";
		client_name = "W83627HF chip";
	} else if (kind = w83627thf) {
		type_name = "w83627thf";
		client_name = "W83627THF chip";
	} else if (kind = w83697hf) {
		type_name = "w83697hf";
		client_name = "W83697HF chip";
	} else if (kind = w83637hf) {
		type_name = "w83637hf";
		client_name = "W83637HF chip";
	} else {
		goto ERROR1;
	}

You need another "else if" statement for the W83687THF here, and it should be OK after that.

Let us know :)

Signature · 1 line
Jean Delvare
#2 lore raw
In reply to Hugo Vanwoerkom

Hi Jean,

Hate to bother you, you are so busy!

Quoted 23 lines · --- Jean Delvare

Hi Hugo,

Your patch looks almost correct to me, I think you simply forgot to
update this part:

	if (kind = w83627hf) {
		type_name = "w83627hf";
		client_name = "W83627HF chip";
	} else if (kind = w83627thf) {
		type_name = "w83627thf";
		client_name = "W83627THF chip";
	} else if (kind = w83697hf) {
		type_name = "w83697hf";
		client_name = "W83697HF chip";
	} else if (kind = w83637hf) {
		type_name = "w83637hf";
		client_name = "W83637HF chip";
	} else {
		goto ERROR1;
	}
Quoted 6 lines

You need another "else if" statement for the
W83687THF here, and it
should be OK after that.

Let us know :)

I got that one after I posted, still "no sensors
found".

I attach my updated patch, with that change added.

Thanks for answering!

Hugo

____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs

-------------- next part --------------

w83627hf.c renamed from w83627hf.orig.c +13 -7
@@ -27,6 +27,7 @@
     w83627hf	9	3	2	3	0x20	0x5ca3	no	yes(LPC)
     w83627thf	7	3	3	3	0x90	0x5ca3	no	yes(LPC)
     w83637hf	7	3	3	3	0x80	0x5ca3	no	yes(LPC)
+    w83687thf   ?       ?       ?       ?       0x90    0x5ca3  no      yes(LPC)
     w83697hf	8	2	2	2	0x60	0x5ca3	no	yes(LPC)
 
     For other winbond chips, and for i2c support in the above chips,
@@ -35,7 +36,7 @@
     Note: automatic ("cruise") fan control for 697, 637 & 627thf not
     supported yet.
 */
-
+#define DEBUG 1
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
@@ -63,7 +64,7 @@
 static unsigned int normal_isa_range[] = { SENSORS_ISA_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_4(w83627hf, w83627thf, w83697hf, w83637hf);
+SENSORS_INSMOD_5(w83627hf, w83627thf, w83697hf, w83637hf, w83687thf);
 
 static int init = 1;
 MODULE_PARM(init, "i");
@@ -135,6 +136,7 @@
 #define W627THF_DEVID 0x82
 #define W697_DEVID 0x60
 #define W637_DEVID 0x70
+#define W687THF_DEVID 0x85
 #define WINB_ACT_REG 0x30
 #define WINB_BASE_REG 0x60
 /* Constants specified below */
@@ -596,7 +598,7 @@
 
 	superio_enter();
 	val= superio_inb(DEVID);
-	if(val != W627_DEVID && val !=W627THF_DEVID && val != W697_DEVID && val != W637_DEVID) {
+	if(val != W687THF_DEVID && val != W627_DEVID && val !=W627THF_DEVID && val != W697_DEVID && val != W637_DEVID) {
 		superio_exit();
 		return -ENODEV;
 	}
@@ -655,6 +657,8 @@
 		kind = w83627thf;
 	else if(val = W637_DEVID)
 		kind = w83637hf;
+	else if(val = W687THF_DEVID)
+		kind = w83687thf;
 		
 	superio_select(W83627HF_LD_HWM);
 	if((val = 0x01 & superio_inb(WINB_ACT_REG)) = 0)
@@ -691,10 +695,12 @@
 	} else if (kind = w83637hf) {
 		type_name = "w83637hf";
 		client_name = "W83637HF chip";
+	} else if (kind = w83687thf) {
+		type_name = "w83687thf";
+		client_name = "W83687THF chip";
 	} else {
 		goto ERROR1;
 	}
-
 	request_region(address, WINB_EXTENT, type_name);
 
 	/* Fill in the remaining client fields and put it into the global list */
@@ -888,12 +894,12 @@
 		int lo = w83627hf_read_value(client, W83781D_REG_VID_FANDIV);
 		int hi = w83627hf_read_value(client, W83781D_REG_CHIPID);
 		data->vid = (lo & 0x0f) | ((hi & 0x01) << 4);
-	} else if (w83627thf = data->type) {
+	} else if (w83627thf = data->type || w83687thf = data->type) {
 		data->vid = w83627thf_read_gpio5(client) & 0x3f;
 	}
 
 	/* Read VRM & OVT Config only once */
-	if (w83627thf = data->type || w83637hf = data->type)
+	if (w83627thf = data->type || w83687thf = data->type || w83637hf = data->type)
 		data->vrm_ovt  			w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG);
 	else
@@ -973,7 +979,7 @@
 		for (i = 0; i <= 8; i++) {
 			/* skip missing sensors */
 			if (((data->type = w83697hf) && (i = 1)) ||
-			    ((data->type = w83627thf || data->type = w83637hf) &&
+			    ((data->type = w83627thf || data->type = w83637hf || w83687thf = data->type) &&
 			     (i = 4 || i = 5)))
 				continue;
 			data->in[i] @@ -995,7 +1001,7 @@

for (i = 1; i <= 3; i++) {
u8 tmp = w83627hf_read_value(client,
W836X7HF_REG_PWM(data->type, i));
- if (data->type = w83627thf)
+ if (data->type = w83627thf || w83687thf = data->type)
tmp &= 0xf0; /* bits 0-3 are reserved in 627THF */
data->pwm[i - 1] = tmp;
if(i = 2 && (data->type = w83627hf || data->type = w83697hf))
@@ -1345,7 +1351,7 @@
*nrels_mag = 1;
} else if (operation = SENSORS_PROC_REAL_WRITE) {
if (*nrels_mag >= 1) {
- if (data->type = w83627thf) {
+ if (data->type = w83627thf || w83687thf = data->type) {
/* bits 0-3 are reserved in 627THF */ data->pwm[nr - 1] = PWM_TO_REG(results[0]) & 0xf0; w83627hf_write_value(client,

#3 lore raw
In reply to Hugo Vanwoerkom

Hi Hugo,

Quoted 4 lines
Quoted 2 lines

You need another "else if" statement for the
W83687THF here, and it should be OK after that.

I got that one after I posted, still "no sensors found".

I appreciate when people follow up on the mailing-list when they were able to solve their problem (even partly). That way we don't try to solve problems that are already solved.

Make sure you loaded i2c-isa and i2c-proc.

Check the logs and see if at least the chip is detected when you load the w83627hf driver.

Make sure you patched the user-space part of lm_sensors to add the w83687thf support.

http://jdelvare.net1.nerim.net/sensors/CVS-w83687thf.diff

Signature · 1 line
Jean Delvare