Skip to contentSkip to conversation

emc6d102 support

DISCUSSION Rafael Ávila de Espíndola 3 participants 12 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

The attached patchs add support for the emc6d102. It already worked as a "generic lm85" so the patchs are mostly cosmetic.

The emc6d102 has a 10bits A/D converter. Do you think that it would be worthwhile to add support to it?

Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emc6d102-kernel.patch
Type: text/x-diff
Size: 1320 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050201/b0c5d861/emc6d102-kernel.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emc6d102-sensors.patch
Type: text/x-diff
Size: 3047 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050201/b0c5d861/emc6d102-sensors.bin

#1 lore raw

Yes, you should add the additional two bits of resolution.

If you don't, there isn't any reason to break the emc6d102 out as a separate "kind." It doesn't change the functionality at all.

In fact, if you've implemented the three additional sensors that exist in the '100 and '102 in the driver previously, then you've actually got less functionality than if you made the '102 be detected as a '100 (Assuming it actually *has* the additional inputs).

:v)

Quoted 128 lines · Rafael ?vila de Esp?ndola

The attached patchs add support for the emc6d102. It already worked as a "generic lm85" so the patchs are mostly cosmetic.

The emc6d102 has a 10bits A/D converter. Do you think that it would be worthwhile to add support to it?

Rafael

------------------------------------------------------------------------

Index: drivers/i2c/chips/lm85.c
=================================>--- drivers/i2c/chips/lm85.c (revision 26268)
+++ drivers/i2c/chips/lm85.c (working copy)

(quoted diff) +7 -2
@@ -36,7 +36,7 @@
 static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_5(lm85b, lm85c, adm1027, adt7463, emc6d100);
+SENSORS_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102);
 
 /* The LM85 registers */
 
@@ -75,6 +75,7 @@
 #define	LM85_VERSTEP_ADT7463		0x62
 #define	LM85_VERSTEP_EMC6D100_A0        0x60
 #define	LM85_VERSTEP_EMC6D100_A1        0x61
+#define	LM85_VERSTEP_EMC6D102           0x65
 
 #define	LM85_REG_CONFIG			0x40
 
@@ -1109,6 +1110,9 @@
 			 */
 			kind = emc6d100 ;
 		} else if( company = LM85_COMPANY_SMSC
+		    && verstep = LM85_VERSTEP_EMC6D102) {
+			kind = emc6d102 ;
+		} else if( company = LM85_COMPANY_SMSC
 		    && (verstep & LM85_VERSTEP_VMASK) = LM85_VERSTEP_GENERIC) {
 			dev_err(&adapter->dev, "lm85: Detected SMSC chip\n");
 			dev_err(&adapter->dev, "lm85: Unrecognized version/stepping 0x%02x"
@@ -1144,6 +1148,8 @@
 		type_name = "adt7463";
 	} else if ( kind = emc6d100){
 		type_name = "emc6d100";
+	} else if ( kind = emc6d102 ) {
+		type_name = "emc6d102";
 	}
 	strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
 
 
 
------------------------------------------------------------------------

Index: README
=================================>RCS file: /home/cvs/lm_sensors2/README,v retrieving revision 1.97
diff -u -r1.97 README

README +1 -1
@@ -92,7 +92,7 @@
                         PC87363, PC87364, PC87365, PC87366
  Philips NE1617, NE1617A, NE1619
  SiS 5595, 950 embedded sensors
-  SMSC 47M1xx embedded sensors, EMC6D100, EMC6D101
+  SMSC 47M1xx embedded sensors, EMC6D100, EMC6D101, EMC6D102
  TI THMC10 and THMC50
  VIA Technologies VT1211, VT8231 and VT82C686A/B embedded sensors
  Winbond W83781D, W83782D, W83783S, W83791D,

Index: lib/chips.c
=================================>RCS file: /home/cvs/lm_sensors2/lib/chips.c,v retrieving revision 1.158
diff -u -r1.158 chips.c

chips.c +1 -0
@@ -5341,6 +5341,7 @@
 { SENSORS_LM85B_PREFIX, lm85_features },
 { SENSORS_LM85C_PREFIX, lm85_features },
 { SENSORS_EMC6D100_PREFIX, lm85_features },
+ { SENSORS_EMC6D102_PREFIX, lm85_features },
 { SENSORS_ADM1027_PREFIX, adm1027_features },
 { SENSORS_ADT7463_PREFIX, adm1027_features },
 { SENSORS_LM83_PREFIX, lm83_features },

Index: lib/chips.h
=================================>RCS file: /home/cvs/lm_sensors2/lib/chips.h,v retrieving revision 1.102
diff -u -r1.102 chips.h

chips.h +1 -0
@@ -372,6 +372,7 @@
 #define SENSORS_ADM1027_PREFIX "adm1027"
 #define SENSORS_ADT7463_PREFIX "adt7463"
 #define SENSORS_EMC6D100_PREFIX "emc6d100"
+#define SENSORS_EMC6D102_PREFIX "emc6d102"
 
 #define SENSORS_ADM1027_ALARM_MASK           1  /* RW -- alarm_mask  */
 #define SENSORS_ADM1027_FAN1_PPR             2  /* RW -- fan1_ppr  */

Index: prog/detect/sensors-detect
=================================>RCS file: /home/cvs/lm_sensors2/prog/detect/sensors-detect,v retrieving revision 1.361
diff -u -r1.361 sensors-detect

detect/sensors-detect +1 -1
@@ -953,7 +953,7 @@
       i2c_detect => sub { lm85_detect 0x41, @_},
     },
     {
-       name => "SMSC EMC6D100 or EMC6D101",
+       name => "SMSC EMC6D100, EMC6D101 or EMC6D102",
       driver => "lm85",
       i2c_addrs => [0x2c..0x2e],
       i2c_detect => sub { lm85_detect 0x5c, @_},

Index: prog/sensors/main.c
=================================>RCS file: /home/cvs/lm_sensors2/prog/sensors/main.c,v retrieving revision 1.106
diff -u -r1.106 main.c

sensors/main.c +1 -0
@@ -347,6 +347,7 @@
 	{ "adm1027", print_lm85 },
 	{ "adt7463", print_lm85 },
 	{ "emc6d100", print_lm85 },
+	{ "emc6d102", print_lm85 },
 	{ "lm87", print_lm87 },
 	{ "gl518sm", print_gl518 },
 	{ "adm1025", print_adm1025 },
#2 lore raw
In reply to Rafael Ávila de Espíndola
Quoted 10 lines · Rafael Esp?ndola
Quoted 3 lines · Philip Pokorny

Yes, you should add the additional two bits of resolution.

Ok. I will take a look during the next weekend.

This is similar to the ADM1027 which also has extended bits of resolution. Support for reading the extended bits exists in the 2.4 version of the lm85 driver (look for ADM1027_REG_EXTEND_ADC and related bits).

Interestingly, the EMC6D102 does things a bit differently than the ADM1027. It actually offer *12* bits of resolution if the chip is running in x16 or x32 averaging mode. The 8-bit register must be read *first* before the LSB are read. It's the other way round on the ADM1027.

It might make sense to change the "extend_adc" member to an array, and then have "lm85_update_client" function break the registers into the array members depending on if it's an ADM1027 or a EMC6D102. That way you can keep a single function to get the value in a way that adds in the extended bits.

:v)

Signature · 4 lines
Philip Pokorny, Director of Engineering
Tel: 415-954-2823   Fax: 415-954-2899   Toll Free: 888-PENGUIN
PENGUIN COMPUTING, INC.
www.penguincomputing.com
#4 lore raw
In reply to Rafael Ávila de Espíndola
Quoted 6 lines

Review

Quoted 4 lines
(quoted diff) +0 -4
-/* IN are scaled 1.000 = 0xc0, mag = 3 */
-#define IN_TO_REG(val)		(SENSORS_LIMIT((((val)*0xc0+500)/1000),0,255))
-#define INEXT_FROM_REG(val,ext) (((val)*1000 + (ext)*250 + 96)/0xc0)
-#define IN_FROM_REG(val)	(INEXT_FROM_REG(val,0))

Doh. Dead code. Should have been removed before... Good catch.

One reason among others to use inline functions instead of macros.

Signature · 1 line
Jean Delvare
#5 lore raw
In reply to Rafael Ávila de Espíndola

I have some comments...

Quoted 30 lines · Rafael ?vila de Esp?ndola

The attached patchs add support for the extended precision ADC present in the emc6d102 and adm1027. The kernel patch also redefines some macros to explicitly use SCALE. This change makes then more readable.

Rafael

Index: drivers/i2c/chips/lm85.c
=================================>--- drivers/i2c/chips/lm85.c (revision 26738)
+++ drivers/i2c/chips/lm85.c (working copy)

(quoted diff) +2 -1
@@ -36,7 +36,7 @@
 static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_5(lm85b, lm85c, adm1027, adt7463, emc6d100);
+SENSORS_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102);
 
 /* The LM85 registers */
 
@@ -75,6 +75,7 @@
 #define	LM85_VERSTEP_ADT7463		0x62
 #define	LM85_VERSTEP_EMC6D100_A0        0x60
 #define	LM85_VERSTEP_EMC6D100_A1        0x61
+#define	LM85_VERSTEP_EMC6D102		0x65
 
 #define	LM85_REG_CONFIG			0x40
 

Review line 108

Quoted 7 lines
(quoted diff) +0 -1
@@ -102,7 +103,6 @@
 #define	ADM1027_REG_INTMASK1		0x74
 #define	ADM1027_REG_INTMASK2		0x75
 #define	ADM1027_REG_EXTEND_ADC1		0x76
-#define	ADM1027_REG_EXTEND_ADC2		0x77
 #define	ADM1027_REG_CONFIG3		0x78
 #define	ADM1027_REG_FAN_PPR		0x7b
 

Why did you remove the definition of EXTEND_ADC2? It's not used by name, but it's there to document the registers that are used by the driver.

Review line 118

Quoted 13 lines
(quoted diff) +3 -3
@@ -111,9 +111,10 @@
 
 #define EMC6D100_REG_ALARM3             0x7d
 /* IN5, IN6 and IN7 */
-#define EMC6D100_REG_IN(nr)             (0x70 + ((nr)-5))
-#define EMC6D100_REG_IN_MIN(nr)         (0x73 + ((nr)-5) * 2)
-#define EMC6D100_REG_IN_MAX(nr)         (0x74 + ((nr)-5) * 2)
+#define	EMC6D100_REG_IN(nr)             (0x70 + ((nr)-5))
+#define	EMC6D100_REG_IN_MIN(nr)         (0x73 + ((nr)-5) * 2)
+#define	EMC6D100_REG_IN_MAX(nr)         (0x74 + ((nr)-5) * 2)
 
 

Hmmm.. The EMC6D102 datasheet shows these registers (0x70 - 0x78) as
"test registers" that are "reserved".

http://www.smsc.com/main/datasheets/6d102.pdf

We should add addtional code to prevent reading or setting the additional in5, in6 and in7 inputs if the chip is an emc6d102.

Review line 120

Quoted 3 lines
(quoted diff) +1 -0
+#define	EMC6D102_REG_EXTEND_ADC		0x85
 

As above, I recommend you #define ADC1, ADC2, ADC3, ADC4 to show that there are four registers whose values you will be using.

Review line 143

Quoted 10 lines
(quoted diff) +0 -4
@@ -138,35 +139,37 @@
   these macros are called: arguments may be evaluated more than once.
 */
 
-/* IN are scaled 1.000 = 0xc0, mag = 3 */
-#define IN_TO_REG(val)		(SENSORS_LIMIT((((val)*0xc0+500)/1000),0,255))
-#define INEXT_FROM_REG(val,ext) (((val)*1000 + (ext)*250 + 96)/0xc0)
-#define IN_FROM_REG(val)	(INEXT_FROM_REG(val,0))
 
 

Doh. Dead code. Should have been removed before... Good catch.

Review line 150

Quoted 7 lines
(quoted diff) +5 -0
+#define INS_TO_REG(n,val)	\
+		SENSORS_LIMIT(SCALE(val,lm85_scaling[n],192),0,255)
+
+#define INSEXT_FROM_REG(n,val,ext,scale)	\
+		SCALE((val)*(scale) + (ext),192*(scale),lm85_scaling[n])
 
 

I think I'd leave those on one line so a 'grep' for the function would pick out the definition as well as the function name. But that's just me. Perhaps there is some applicable style guideline?

Quoted 7 lines
(quoted diff) +0 -1
-#define EXT_FROM_REG(val,sensor)	(((val)>>(sensor * 2))&0x03)
 
 /* ZONEs have the following parameters:
 *    Limit (low) temp,           1. degC

Review line 363

Quoted 8 lines
(quoted diff) +1 -1
@@ -354,7 +357,7 @@
 	u8 pwm[3];		/* Register value */
 	u8 spinup_ctl;		/* Register encoding, combined */
 	u8 tach_mode;		/* Register encoding, combined */
-	u16 extend_adc;		/* Register value */
+	u8 extend_adc[4];	/* Register value */
 	u8 fan_ppr;		/* Register value */
 	u8 smooth[3];		/* Register encoding */
 	u8 vid;			/* Register value */

Given the additional complexity introduced by the possibility of different scaling factors (4 for adm1027, 16 for EMC6D102) I think I would change this from a u16 to a *decoded* value in two arrays:

    u8  temp_ext[3];             /* Decoded values */
    u8  in_ext[8];               /* Decoded values */
    u8  adc_scale;               /* ADC Extended bits scaling factor */

Then put all the shift and mask code in 'lm85_update_device' and have it read the values and break them up into the appropriate '_ext[]' values. That's a simple loop for the adm1027 where the bits are in the same order as the sensors. It's a bit more complicated in the case of the EMC6D102 because things are moved around a bit, but I think it would make more sense for that code to be in '_update_device'.

Then set adc_scale appropriately at initial detection time.

Quoted 36 lines
(quoted diff) +32 -0
@@ -369,6 +372,46 @@
 	struct lm85_zone zone[3];
 };
 
+static int extin_from_reg(struct lm85_data *data, int sensor){
+	if( (data->type = adm1027) || (data->type = adt7463) ) {
+		int val = (data->extend_adc[1] << 8) + data->extend_adc[0];
+		return (val>>(sensor * 2))&0x03;
+	} else if (data->type = emc6d102) {
+		if( sensor = 0) {
+			return data->extend_adc[2]&0x0f;
+		} else if (sensor = 1) {
+			return data->extend_adc[3]&0x0f;
+		} else if (sensor = 2) {
+			return (data->extend_adc[3] >> 8)&0x0f;
+		} else if (sensor = 3) {
+			return (data->extend_adc[2] >> 8)&0x0f;
+		} else {
+			/* sensor = 4 */
+			return (data->extend_adc[1] >> 8)&0x0f;
+		}
+	} else {
+		return 0;
+	}
+}
+
+static int exttemp_from_reg(struct lm85_data *data, int sensor){
+	if( (data->type = adm1027) || (data->type = adt7463) ) {
+		int val = (data->extend_adc[1] << 8) + data->extend_adc[0];
+		return (val>>((sensor + 5) * 2))&0x03;
+	} else if (data->type = emc6d102) {
+		if( sensor = 0) {
+			return data->extend_adc[0]&0x0f;
+		} else if (sensor = 1) {
+			return data->extend_adc[1]&0x0f;
+		} else {

Review line 416

Quoted 10 lines
(quoted diff) +8 -0
+			return (data->extend_adc[0] >> 8)&0x0f;
+			/* sensor = 2 */
+		}
+	} else {
+		return 0;
+	}
+}
+
 
 

With the previous recomendation, these go away or are incorporated into _update_device.

Quoted 27 lines
(quoted diff) +0 -0
 static int lm85_attach_adapter(struct i2c_adapter *adapter);

static int lm85_detect(struct i2c_adapter *adapter, int address,

			int kind);
(quoted diff) +9 -2
@@ -538,7 +581,14 @@
 static ssize_t show_in(struct device *dev, char *buf, int nr)
 {
 	struct lm85_data *data = lm85_update_device(dev);
-	return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr]) );
+	/* scale is 2^(number of LSBs). There are 4 extra bits in the
+	   emc6d102 and 2 in the adt7463 and adm1027. In all other chips ext
+	   is always 0 and the value of scale is irrelevant. So it is left in
+	   4*/
+	int scale = (data->type = emc6d102 ) ? 16 : 4;
+	int ext = extin_from_reg(data, nr);
+	return sprintf(buf,"%d\n",
+		       INSEXT_FROM_REG(nr, data->in[nr], ext, scale) );
 }
 static ssize_t show_in_min(struct device *dev, char *buf, int nr)
 {
@@ -619,7 +669,14 @@
 static ssize_t show_temp(struct device *dev, char *buf, int nr)
 {
 	struct lm85_data *data = lm85_update_device(dev);
-	return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr]) );
+	/* scale is 2^(number of LSBs). There are 4 extra bits in the

Review line 682

Quoted 10 lines
(quoted diff) +7 -0
+	   emc6d102 and 2 in the adt7463 and adm1027. In all other chips ext
+	   is always 0 and the value of scale is irrelevant. So it is left in
+	   4*/
+	int scale = (data->type = emc6d102 ) ? 16 : 4;
+	int ext = exttemp_from_reg(data, nr);
+	return sprintf(buf,"%d\n",
+		       TEMPEXT_FROM_REG(data->temp[nr], ext, scale) );
 }
 static ssize_t show_temp_min(struct device *dev, char *buf, int nr)
 {

With the previous recommendation, these become a bit simpler:

return sprintf(buf, "%d\n", INSEXT_FROM_REG(nr, data->in[nr],
data->in_ext[nr], data->adc_scale) );

for example. It might even make sense to just pass 'data' to the '???EXT_FROM_REG()' macro and let it dereference the structure pointer...

Review line 1174

Quoted 12 lines
(quoted diff) +3 -0
@@ -1109,6 +1166,9 @@
 			 */
 			kind = emc6d100 ;
 		} else if( company = LM85_COMPANY_SMSC
+		    && verstep = LM85_VERSTEP_EMC6D102) {
+			kind = emc6d102 ;
+		} else if( company = LM85_COMPANY_SMSC
 		    && (verstep & LM85_VERSTEP_VMASK) = LM85_VERSTEP_GENERIC) {
 			dev_err(&adapter->dev, "lm85: Detected SMSC chip\n");
 			dev_err(&adapter->dev, "lm85: Unrecognized version/stepping 0x%02x"

Excellent.

Quoted 19 lines
(quoted diff) +2 -1
@@ -1144,6 +1204,8 @@
 		type_name = "adt7463";
 	} else if ( kind = emc6d100){
 		type_name = "emc6d100";
+	} else if ( kind = emc6d102 ) {
+		type_name = "emc6d102";
 	}
 	strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
 
@@ -1267,7 +1329,6 @@
 	case LM85_REG_FAN_MIN(2) :
 	case LM85_REG_FAN_MIN(3) :
 	case LM85_REG_ALARM1 :	/* Read both bytes at once */
-	case ADM1027_REG_EXTEND_ADC1 :  /* Read two bytes at once */
 		res = i2c_smbus_read_byte_data(client, reg) & 0xff ;
 		res |= i2c_smbus_read_byte_data(client, reg+1) << 8 ;
 		break ;

Review line 1439

Quoted 9 lines
(quoted diff) +1 -1
@@ -1371,8 +1432,10 @@
 		 * more significant bits that are read later.
 		 */
 		if ( (data->type = adm1027) || (data->type = adt7463) ) {
-			data->extend_adc >+			data->extend_adc[0] > 			    lm85_read_value(client, ADM1027_REG_EXTEND_ADC1);
+			data->extend_adc[1] >+			    lm85_read_value(client, ADM1027_REG_EXTEND_ADC1+1);
 		}
 
 		for (i = 0; i <= 4; ++i) {
 

I would have been clearer to leave in 'ADM1027_REG_EXTEND_ADC2', don't you think?

Quoted 8 lines
(quoted diff) +4 -0
@@ -1411,6 +1474,16 @@
 			/* More alarm bits */
 			data->alarms |> 				lm85_read_value(client, EMC6D100_REG_ALARM3) << 16;
+		} else if (data->type = emc6d102 ) {
+			/* LSBs */
+			data->extend_adc[0] = lm85_read_value(
+				client, EMC6D102_REG_EXTEND_ADC);

Review line 1489

Quoted 10 lines
(quoted diff) +6 -0
+			data->extend_adc[1] = lm85_read_value(
+				client, EMC6D102_REG_EXTEND_ADC + 1);
+			data->extend_adc[2] = lm85_read_value(
+				client, EMC6D102_REG_EXTEND_ADC + 2);
+			data->extend_adc[3] = lm85_read_value(
+				client, EMC6D102_REG_EXTEND_ADC + 3);
 		}
 
 		data->last_reading = jiffies ;
 

I don't see any comment about the time ordering of reading the LSB's and the MSB's. The data sheet says that reading the upper 8-bit MSB's latch the corresponding lower 4 bit LSB's. You'll note that this is *backward* from the ADM1027 where the LSB need to be read *first* to latch the MSB's.

A note regarding this difference should be included in comments for the code to read the EMC6D102 extended bits.

Also, make sure that the EMC6D100 and 101 registers 0x70-0x78 are *not* read if this device is an EMC6D102.

:v)

#6 lore raw
In reply to Rafael Ávila de Espíndola
Quoted 4 lines · Philip Pokorny

I have some comments...

Why did you remove the definition of EXTEND_ADC2? It's not used by name, but it's there to document the registers that are used by the driver.

ok. I added it back.

Quoted 7 lines

Hmmm.. The EMC6D102 datasheet shows these registers (0x70 - 0x78) as
"test registers" that are "reserved".

http://www.smsc.com/main/datasheets/6d102.pdf

We should add addtional code to prevent reading or setting the additional in5, in6 and in7 inputs if the chip is an emc6d102.

It is already there. These registers are read only if (data->type = emc6d100)

Quoted 3 lines

I think I'd leave those on one line so a 'grep' for the function would pick out the definition as well as the function name. But that's just me. Perhaps there is some applicable style guideline?

Those macro definitions had more then 80 columns.

Quoted 8 lines

Given the additional complexity introduced by the possibility of different scaling factors (4 for adm1027, 16 for EMC6D102) I think I would change this from a u16 to a *decoded* value in two arrays:

    u8  temp_ext[3];             /* Decoded values */
    u8  in_ext[8];               /* Decoded values */
    u8  adc_scale;               /* ADC Extended bits scaling factor */
Quoted 8 lines

Then put all the shift and mask code in 'lm85_update_device' and have it read the values and break them up into the appropriate '_ext[]' values. That's a simple loop for the adm1027 where the bits are in the same order as the sensors. It's a bit more complicated in the case of the EMC6D102 because things are moved around a bit, but I think it would make more sense for that code to be in '_update_device'.

Then set adc_scale appropriately at initial detection time.

Did it. The resulting code is indeed simpler.

Quoted 2 lines

for example. It might even make sense to just pass 'data' to the '???EXT_FROM_REG()' macro and let it dereference the structure pointer...

I fill a bit uncomfortable with big macros...

Quoted 8 lines

I don't see any comment about the time ordering of reading the LSB's and the MSB's. The data sheet says that reading the upper 8-bit MSB's latch the corresponding lower 4 bit LSB's. You'll note that this is *backward* from the ADM1027 where the LSB need to be read *first* to latch the MSB's.

A note regarding this difference should be included in comments for the code to read the EMC6D102 extended bits.

Added one.

Thanks for the comments.
The resulting patch is attached.
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emc6d102-kernel.patch
Type: application/octet-stream
Size: 7525 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050226/89c1c04b/emc6d102-kernel.obj

#7 lore raw
In reply to Rafael Ávila de Espíndola

Some time ago I submitted a patch that adds support for the extendend precision ADC in the emc6d102. There was some discussion about it and the last version was posted in:
http://archives.andrew.net.au/lm-sensors/msg29686.html

There are some other comments? Should I forward it Greg KH?

Thanks for any comments,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050308/49c92eb6/attachment.bin

#8 lore raw
In reply to Rafael Ávila de Espíndola

The attached patchs add support for the extended precision ADC present in the emc6d102 and adm1027. The kernel patch also redefines some macros to explicitly use SCALE. This change makes then more readable.

Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emc6d102-sensors.patch
Type: text/x-diff
Size: 3048 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050320/f030a8a0/emc6d102-sensors.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emc6d102-kernel.patch
Type: text/x-diff
Size: 8505 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050320/f030a8a0/emc6d102-kernel.bin

#9 lore raw
In reply to Rafael Ávila de Espíndola

Hi Rafael,

Quoted 3 lines

The attached patchs add support for the extended precision ADC present in the emc6d102 and adm1027. The kernel patch also redefines some macros to explicitly use SCALE. This change makes then more readable.

I applied the user-space part of your patch, thanks (and sorry for the delay). The kernel part seems to be for the 2.6 kernel, not for lm_sensors CVS. Greg accepted this kernel patch recently. Do you have something similar for lm_sensors CVS? It would be great to at least support the emc6d102 there too, even if we don't support the extended precition (which might be a bit hard anyway due to the lack of flexibility of the procfs interface anyway).

Please tell us if you have something ready, or plan to propose such a patch. If not I'll give it a try.

Thanks,

Signature · 1 line
Jean Delvare
#11 lore raw
In reply to Rafael Ávila de Espíndola

Hi Rafael,

Quoted 2 lines

A minimal patch is attached, but I am not sure about the "template_used = 0"...

Looks OK to me, will apply tonight.

Quoted 4 lines

It seems to be possible to port the support for the extended precision since the ADM1027 has support for it. I could do it if there is some interest in it. But I am a bit short of time so I can work only during the weekend. By the way, sorry for the delay in answering.

No problem. Adding support for the extended precision can be done anytime later, and actually it might be preferable to postpone it until after lm_sensors 2.9.1 is released.

What I was minly interested in was that the emc6d102 itself was recognized by the lm_sensors driver, because the Linux 2.6 driver and sensors-detect now know about it and it's quite confusing for the user when suggested to load a driver for his/her chip, and the driver then doesn't seem to support that chip.

Thanks,
--
Jean Delvare