Skip to contentSkip to conversation

sensors-detect: Add detection of MCP98244

PATCH In review Guenter Roeck 3 participants 7 messages Jan 29, 2013 – Jun 26, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 sensors-detect: Add detection of MCP98244

MCP98244 is a JC42 temperature sensor.

---
 CHANGES                    |    3 ++-
 prog/detect/sensors-detect |   13 ++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
CHANGES +2 -1
index 465bd61..90e1e89 100644
@@ -4,7 +4,8 @@ lm-sensors CHANGES file
 SVN HEAD
   sensors.conf.5: Mention "sensors -u" to get the raw feature names
   sensors: Clarify what option -u is good for
-  sensors-detect: Add detection of IT8752F
+  sensors-detect: Add detection of MCP98244
+                  Add detection of IT8752F
                   Add detection of AMD family 16h power sensors
                   Map IT8771E, IT8772E, IT8782F and IT8783F to it87
                   Use /sys/module instead of /proc/modules where available
prog/detect/sensors-detect +12 -1
index 59378c2..7db4812 100755
@@ -1400,6 +1400,11 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x18..0x1f],
 		i2c_detect => sub { jedec_JC42_4_detect(@_, 7); },
 	}, {
+		name => "Microchip MCP98244",
+		driver => "jc42",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 15); },
+	}, {
 		name => "Microchip MCP9843",
 		driver => "jc42",
 		i2c_addrs => [0x18..0x1f],
@@ -6058,7 +6063,7 @@ sub max6655_detect
 #                 4 = TS3000/TSE2002, 5 = MAX6604, 6 = MCP98242,
 #                 7 = MCP98243, 8 = MCP9843, 9 = CAT6095 / CAT34TS02,
 #                 10 = STTS424E, 11 = STTS2002, 12 = STTS3000
-#                 13 = MCP9804, 14 = AT30TS00
+#                 13 = MCP9804, 14 = AT30TS00, 15 = MCP98244
 # Registers used:
 #   0x00: Capabilities
 #   0x01: Configuration
@@ -6127,6 +6132,9 @@ sub jedec_JC42_4_detect
 	} elsif ($chip = 14) {
 		return unless $manid = 0x00;		# Atmel
 		return unless $devid = 0x82;		# AT30TS00
+	} elsif ($chip = 15) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x22;		# MCP98244
 	}
 
 	# Now, do it all again with words. Note that we get
@@ -6184,6 +6192,9 @@ sub jedec_JC42_4_detect
 	} elsif ($chip = 14) {
 		return unless $manid = 0x1f00;		# Atmel
 		return unless ($devid & 0xfeff) = 0x0082; # AT30TS00
+	} elsif ($chip = 15) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0022; # MCP98244
 	}
 
 	return 5;
Signature · 7 lines
1.7.9.7


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

PATCH 2/2 sensors-detect: Add detection of TMP431 and TMP432

---
 CHANGES                    |    1 +
 prog/detect/sensors-detect |   24 +++++++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)
CHANGES +1 -0
index 51ac3c8..ba6409f 100644
@@ -12,6 +12,7 @@ SVN HEAD
                   Add detection of IT8752F
                   Add detection of MCP98244
                   Add detection of LM95234
+                  Add detection of TMP431/TMP432
 
 3.3.3 "Happy Birthday Sophie" (2012-11-06)
   documentation: Update fan-divisors, fan divisors are optional
prog/detect/sensors-detect +23 -1
index f238802..00e3904 100755
@@ -1023,6 +1023,16 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x4c, 0x4d],
 		i2c_detect => sub { tmp42x_detect(@_, 2); },
 	}, {
+		name => "Texas Instruments TMP431",
+		driver => "to-be-written",		# tmp401
+		i2c_addrs => [0x4c, 0x4d],
+		i2c_detect => sub { lm90_detect(@_, 16); },
+	}, {
+		name => "Texas Instruments TMP432",
+		driver => "to-be-written",		# tmp401
+		i2c_addrs => [0x4c, 0x4d],
+		i2c_detect => sub { lm90_detect(@_, 17); },
+	}, {
 		name => "Texas Instruments AMC6821",
 		driver => "amc6821",
 		i2c_addrs => [0x18..0x1a, 0x2c..0x2e, 0x4c..0x4e],
@@ -4537,7 +4547,7 @@ sub max6680_95_detect
 #		  8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690,
 #		  13 = ADT7461A/NCT1008, 14 = SA56004,
-#		  15 = G781
+#		  15 = G781, 16 = TMP431, 17 = TMP432
 # Registers used:
 #   0x03: Configuration
 #   0x04: Conversion rate
@@ -4655,6 +4665,18 @@ sub lm90_detect
 		return if $mid != 0x47;		# GMT
 		return 8 if $cid = 0x01;	# G781
 	}
+	if ($chip = 16) {
+		return if ($conf & 0x1B) != 0;
+		return if $rate > 0x0F;
+		return if $mid != 0x55;		# Texas Instruments
+		return 6 if ($cid = 0x31);	# TMP431A/B/C/D
+	}
+	if ($chip = 17) {
+		return if ($conf & 0x1B) != 0;
+		return if $rate > 0x0F;
+		return if $mid != 0x55;		# Texas Instruments
+		return 6 if ($cid = 0x32);	# TMP432A/B
+	}
 	return;
 }
 
Signature · 7 lines
1.7.9.7


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw

Re: [lm-sensors] [PATCH 2/2] sensors-detect: Add detection of TMP431 and TMP432

In reply to Guenter Roeck
Quoted 57 lines · Guenter Roeck
---
 CHANGES                    |    1 +
 prog/detect/sensors-detect |   24 +++++++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)
CHANGES +1 -0
index 51ac3c8..ba6409f 100644
@@ -12,6 +12,7 @@ SVN HEAD
                   Add detection of IT8752F
                   Add detection of MCP98244
                   Add detection of LM95234
+                  Add detection of TMP431/TMP432
 
 3.3.3 "Happy Birthday Sophie" (2012-11-06)
   documentation: Update fan-divisors, fan divisors are optional
prog/detect/sensors-detect +16 -1
index f238802..00e3904 100755
@@ -1023,6 +1023,16 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x4c, 0x4d],
 		i2c_detect => sub { tmp42x_detect(@_, 2); },
 	}, {
+		name => "Texas Instruments TMP431",
+		driver => "to-be-written",		# tmp401
+		i2c_addrs => [0x4c, 0x4d],
+		i2c_detect => sub { lm90_detect(@_, 16); },
+	}, {
+		name => "Texas Instruments TMP432",
+		driver => "to-be-written",		# tmp401
+		i2c_addrs => [0x4c, 0x4d],
+		i2c_detect => sub { lm90_detect(@_, 17); },
+	}, {
 		name => "Texas Instruments AMC6821",
 		driver => "amc6821",
 		i2c_addrs => [0x18..0x1a, 0x2c..0x2e, 0x4c..0x4e],
@@ -4537,7 +4547,7 @@ sub max6680_95_detect
 #		  8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690,
 #		  13 = ADT7461A/NCT1008, 14 = SA56004,
-#		  15 = G781
+#		  15 = G781, 16 = TMP431, 17 = TMP432
 # Registers used:
 #   0x03: Configuration
 #   0x04: Conversion rate
@@ -4655,6 +4665,18 @@ sub lm90_detect
 		return if $mid != 0x47;		# GMT
 		return 8 if $cid = 0x01;	# G781
 	}
+	if ($chip = 16) {
+		return if ($conf & 0x1B) != 0;
+		return if $rate > 0x0F;
+		return if $mid != 0x55;		# Texas Instruments
+		return 6 if ($cid = 0x31);	# TMP431A/B/C/D

prog/detect/sensors-detect sub lm90_detect · line 4682

Quoted 10 lines
prog/detect/sensors-detect +7 -0
+	}
+	if ($chip = 17) {
+		return if ($conf & 0x1B) != 0;
+		return if $rate > 0x0F;
+		return if $mid != 0x55;		# Texas Instruments
+		return 6 if ($cid = 0x32);	# TMP432A/B
+	}
 	return;
 }
 

Looks good, please commit.

BTW, please use ISO8601 date format in wiki/Devices. MM/DD/YYYY as you used is potentially ambiguous.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw

PATCH 2/2 sensors-detect: Add detection of NCT7802Y

In reply to Guenter Roeck
---
 CHANGES                    |  1 +
 prog/detect/sensors-detect | 68 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
CHANGES +1 -0
index 3390942..a16e7be 100644
@@ -13,6 +13,7 @@ SVN HEAD
                   Add detection of ITE IT8620E and IT8623E
                   Add detection of TMP441, TMP442, LM95233, LM95234,
                   and LM95235
+                  Add detection of NCT7802Y
 
 3.3.5 "Happy Birthday Beddy" (2014-01-22)
   libsensors: Improve documentation of two functions
prog/detect/sensors-detect +68 -0

80 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#4 lore raw

Re: [lm-sensors] [PATCH 2/2] sensors-detect: Add detection of NCT7802Y

In reply to Guenter Roeck
Quoted 6 lines · Guenter Roeck
---
 CHANGES                    |  1 +
 prog/detect/sensors-detect | 68 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

Register maps for NCT7802Y:

Bank 0:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 3f 00 00 2d 20 2e 00 00 ce d7 00 83 96 d3 00    .?..- ...??.???.
10: ff ff ff f8 00 64 00 00 00 00 00 00 00 11 00 00    ...?.d.......?..
20: 00 81 7d 03 03 03 03 03 00 04 ee 80 f4 32 40 00    .?}?????.????2@.
30: 55 00 55 00 55 00 55 00 55 00 64 64 64 64 64 ff    U.U.U.U.U.ddddd.
40: 00 ff 00 ff 00 ff 00 cc cc ff ff ff f8 f8 f8 7f    .......??...????
50: 3f 07 8f bf 3f 00 3f 00 00 00 00 00 00 00 00 00    ?????.?.........
60: 00 00 7f 00 21 00 00 00 44 00 00 00 d1 02 01 01    ..?.!...D...????
70: 7f 84 84 84 53 53 53 80 0a 00 80 00 00 ff ff ff    ????SSS??.?.....
80: 3b 3c 4b 5a 5f 00 4c a5 ff ff ff ff ff ff ff ff    ;<KZ_.L?........
90: 3b 3c 4b 5a 5f 00 4c a5 ff ff ff ff ff ff ff ff    ;<KZ_.L?........
a0: 36 37 43 4f 5f 00 b2 d8 ff ff ff ff ff ff ff ff    67CO_.??........
b0: 47 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 0b    G..............?
c0: 00 08 3d 3d 00 00 00 39 33 33 ff 00 00 00 40 00    .?=...933....@.
d0: 00 aa 0a 0a 0a 0a 02 f2 81 1e 00 18 07 41 7f 70    .?????????.??A?p
e0: e4 00 00 00 00 00 00 00 00 00 00 00 00 00 10 f0    ?.............??
f0: 00 30 00 ff 00 05 ff ff 00 08 07 01 ff 50 c3 21    .0...?...???.P?!

Bank 1:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 01 91 00 30 00 00 00 00 00 64 64 00 00 00 00 00    ??.0.....dd.....
10: 00 00 00 00 00 00 00 f2 92 f8 80 f8 80 f8 80 01    .......?????????
20: 2e 01 06 00 02 09 00 1b 00 f9 00 00 00 00 00 00    .??.??.?.?......
30: 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
40: 01 91 00 30 00 00 00 00 00 64 64 00 00 00 00 00    ??.0.....dd.....
50: 00 00 00 00 00 00 00 f2 ab f8 80 f8 80 f8 80 01    .......?????????
60: 2e 02 06 00 02 09 00 5f 00 f9 00 00 00 00 00 00    .??.??._.?......
70: 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
80: 01 91 00 30 00 00 00 00 00 64 64 00 00 00 00 00    ??.0.....dd.....
90: 00 00 00 00 00 00 00 f2 ab f8 80 f8 80 f8 80 01    .......?????????
a0: 2e 02 06 00 02 09 00 5f 00 f9 00 00 00 00 00 00    .??.??._.?......
b0: 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: 01 91 00 30 00 00 00 00 00 64 64 00 00 00 00 00    ??.0.....dd.....
d0: 00 00 00 00 00 00 00 f2 ab f8 80 f8 80 f8 80 01    .......?????????
e0: 2e 02 06 00 02 09 00 5f 00 f9 00 00 00 00 00 00    .??.??._.?......
f0: 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#5 lore raw

Re: [lm-sensors] [PATCH 2/2] sensors-detect: Add detection of NCT7802Y

In reply to Guenter Roeck

Hi Guenter,

Quoted 66 lines · Guenter Roeck
---
 CHANGES                    |  1 +
 prog/detect/sensors-detect | 68 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
CHANGES +1 -0
index 3390942..a16e7be 100644
@@ -13,6 +13,7 @@ SVN HEAD
                   Add detection of ITE IT8620E and IT8623E
                   Add detection of TMP441, TMP442, LM95233, LM95234,
                   and LM95235
+                  Add detection of NCT7802Y
 
 3.3.5 "Happy Birthday Beddy" (2014-01-22)
   libsensors: Improve documentation of two functions
prog/detect/sensors-detect +33 -0
index df9a408..159d2cb 100755
@@ -733,6 +733,11 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x2c..0x2f],
 		i2c_detect => sub { w83795_detect(@_); },
 	}, {
+		name => "Nuvoton NCT7802Y",
+		driver => "to-be-written",
+		i2c_addrs => [0x28..0x2f],
+		i2c_detect => sub { nct7802_detect(@_); },
+	}, {
 		name => "Winbond W83627HF",
 		driver => "use-isa-instead",
 		i2c_addrs => [0x28..0x2f],
@@ -5483,6 +5488,69 @@ sub w83795_detect
 }
 
 # Registers used:
+#   0x00: bank selection (Bank 0, 1)
+#   0x40, 0x80, 0xc0: bank selection (Bank 1)
+#   0x01, 0x41, 0x81, 0xc1: PECI control register 1 (Bank 1)
+#   0x02, 0x42, 0x82, 0xc2: PECI control register 2 (Bank 1)
+#   0x03, 0x43, 0x83, 0xc3: PECI control register 3 (Bank 1)
+#   0xfd: Vendor ID (Bank 0)
+#   0xfe: Device ID (Bank 0)
+#   0xff: Device Revision (Bank 0)
+sub nct7802_detect
+{
+	my ($bank, $reg, $pc1, $pc2, $pc3);
+	my ($file, $addr) = @_;
+
+	$bank = i2c_smbus_read_byte_data($file, 0x00);
+	return unless ($bank = 0x00 or $bank = 0x01);
+
+	# we can not do much if bank 1 is selected
+	if ($bank = 0x01) {
+		# We can not use bit masks since all bits
+		# (including reserved bits) can be set.
+		$pc1 = i2c_smbus_read_byte_data($file, 0x01);
+		$pc2 = i2c_smbus_read_byte_data($file, 0x02);
+		$pc3 = i2c_smbus_read_byte_data($file, 0x03);
+
+		# Register values repeat every 64 registers on bank 1.
+		# Check the first four registers of each group.
+		for (my $i = 0x40; $i <= 0xc0; $i += 0x40) {
+			$reg = i2c_smbus_read_byte_data($file, $i);

prog/detect/sensors-detect sub w83795_detect · line 5528

Quoted 10 lines
prog/detect/sensors-detect +10 -0
+			return if $reg != 0x01;
+			$reg = i2c_smbus_read_byte_data($file, $i + 1);
+			return if $reg != $pc1;
+			$reg = i2c_smbus_read_byte_data($file, $i + 2);
+			return if $reg != $pc2;
+			$reg = i2c_smbus_read_byte_data($file, $i + 3);
+			return if $reg != $pc3;
+		}
+		return 3;
+	}

Bah. I discussed the need to have the identification registers in non-banked registers with Winbond/Nuvoton engineers years ago, and it looked like they did listen to me with the W83795G/ADG, but now they are doing it all wrong again :-(

The above is simply too weak, I'm afraid. Chips cycling over 8, 16, 32 or 64 register addresses are legions. Just from my register dump collection, the LM80 and the VIA 686A chips would both be detected by the loop above. There may be more, in particular if Nuvoton keeps using the same strategy for future chips.

So I would say, just skip the detection if the chip is in bank 1. Let's hope the BIOS will leave the chip in bank 0. When we have a driver for that chip, we'll make sure to leave the chip in bank 0 too.

prog/detect/sensors-detect sub w83795_detect · line 5533

Quoted 5 lines
prog/detect/sensors-detect +5 -0
+
+	# bank 0, can support real chip detection
+
+	$reg = i2c_smbus_read_byte_data($file, 0xfd);
+	return unless ($reg = 0x50);

Unneeded parentheses.

Quoted 5 lines
prog/detect/sensors-detect +5 -0
+
+	$reg = i2c_smbus_read_byte_data($file, 0xfe);
+	return unless $reg = 0xc3;
+
+	$reg = i2c_smbus_read_byte_data($file, 0xff);

prog/detect/sensors-detect sub w83795_detect · line 5548

Quoted 10 lines
prog/detect/sensors-detect +10 -0
+	return unless ($reg & 0xf0) = 0x20;
+
+	$reg = i2c_smbus_read_byte_data($file, 0x05);
+	return unless ($reg & 0x1f) = 0x00;
+
+	$reg = i2c_smbus_read_byte_data($file, 0x08);
+	return unless ($reg & 0x3f) = 0x00;
+
+	$reg = i2c_smbus_read_byte_data($file, 0x0f);
+	return unless ($reg & 0x3f) = 0x00;

You did not say above, what these last 3 registers were. Also I am surprised because checking these is in contradiction with your statement above that "we can not use bit masks since all bits (including reserved bits) can be set."

Quoted 8 lines
prog/detect/sensors-detect +5 -0
+
+	return 8;
+}
+
+# Registers used:
 #   0x48: Full I2C Address
 #   0x4e: Vendor ID byte selection
 #   0x4f: Vendor ID
Signature · 7 lines
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#6 lore raw

Re: [lm-sensors] [PATCH 2/2] sensors-detect: Add detection of NCT7802Y

In reply to Guenter Roeck
Quoted 91 lines · Jean Delvare

Hi Guenter,

Quoted 66 lines · Guenter Roeck
---
  CHANGES                    |  1 +
  prog/detect/sensors-detect | 68 ++++++++++++++++++++++++++++++++++++++++++++++
  2 files changed, 69 insertions(+)
CHANGES +1 -0
index 3390942..a16e7be 100644
@@ -13,6 +13,7 @@ SVN HEAD
                    Add detection of ITE IT8620E and IT8623E
                    Add detection of TMP441, TMP442, LM95233, LM95234,
                    and LM95235
+                  Add detection of NCT7802Y
 
  3.3.5 "Happy Birthday Beddy" (2014-01-22)
    libsensors: Improve documentation of two functions
prog/detect/sensors-detect +33 -0
index df9a408..159d2cb 100755
@@ -733,6 +733,11 @@ use vars qw(@i2c_adapter_names);
  		i2c_addrs => [0x2c..0x2f],
  		i2c_detect => sub { w83795_detect(@_); },
  	}, {
+		name => "Nuvoton NCT7802Y",
+		driver => "to-be-written",
+		i2c_addrs => [0x28..0x2f],
+		i2c_detect => sub { nct7802_detect(@_); },
+	}, {
  		name => "Winbond W83627HF",
  		driver => "use-isa-instead",
  		i2c_addrs => [0x28..0x2f],
@@ -5483,6 +5488,69 @@ sub w83795_detect
  }
 
  # Registers used:
+#   0x00: bank selection (Bank 0, 1)
+#   0x40, 0x80, 0xc0: bank selection (Bank 1)
+#   0x01, 0x41, 0x81, 0xc1: PECI control register 1 (Bank 1)
+#   0x02, 0x42, 0x82, 0xc2: PECI control register 2 (Bank 1)
+#   0x03, 0x43, 0x83, 0xc3: PECI control register 3 (Bank 1)
+#   0xfd: Vendor ID (Bank 0)
+#   0xfe: Device ID (Bank 0)
+#   0xff: Device Revision (Bank 0)
+sub nct7802_detect
+{
+	my ($bank, $reg, $pc1, $pc2, $pc3);
+	my ($file, $addr) = @_;
+
+	$bank = i2c_smbus_read_byte_data($file, 0x00);
+	return unless ($bank = 0x00 or $bank = 0x01);
+
+	# we can not do much if bank 1 is selected
+	if ($bank = 0x01) {
+		# We can not use bit masks since all bits
+		# (including reserved bits) can be set.
+		$pc1 = i2c_smbus_read_byte_data($file, 0x01);
+		$pc2 = i2c_smbus_read_byte_data($file, 0x02);
+		$pc3 = i2c_smbus_read_byte_data($file, 0x03);
+
+		# Register values repeat every 64 registers on bank 1.
+		# Check the first four registers of each group.
+		for (my $i = 0x40; $i <= 0xc0; $i += 0x40) {
+			$reg = i2c_smbus_read_byte_data($file, $i);

prog/detect/sensors-detect sub w83795_detect · line 5528

Quoted 10 lines
prog/detect/sensors-detect +10 -0
+			return if $reg != 0x01;
+			$reg = i2c_smbus_read_byte_data($file, $i + 1);
+			return if $reg != $pc1;
+			$reg = i2c_smbus_read_byte_data($file, $i + 2);
+			return if $reg != $pc2;
+			$reg = i2c_smbus_read_byte_data($file, $i + 3);
+			return if $reg != $pc3;
+		}
+		return 3;
+	}

Bah. I discussed the need to have the identification registers in non-banked registers with Winbond/Nuvoton engineers years ago, and it looked like they did listen to me with the W83795G/ADG, but now they are doing it all wrong again :-(

The above is simply too weak, I'm afraid. Chips cycling over 8, 16, 32 or 64 register addresses are legions. Just from my register dump collection, the LM80 and the VIA 686A chips would both be detected by the loop above. There may be more, in particular if Nuvoton keeps using the same strategy for future chips.

Quoted 4 lines

So I would say, just skip the detection if the chip is in bank 1. Let's hope the BIOS will leave the chip in bank 0. When we have a driver for that chip, we'll make sure to leave the chip in bank 0 too.

Ok with me. I didn't feel comfortable with it either.

Quoted 8 lines

prog/detect/sensors-detect sub w83795_detect · line 5533

Quoted 5 lines
prog/detect/sensors-detect +5 -0
+
+	# bank 0, can support real chip detection
+
+	$reg = i2c_smbus_read_byte_data($file, 0xfd);
+	return unless ($reg = 0x50);

Unneeded parentheses.

Ok.

Quoted 12 lines
Quoted 12 lines
prog/detect/sensors-detect +12 -0
+
+	$reg = i2c_smbus_read_byte_data($file, 0xfe);
+	return unless $reg = 0xc3;
+
+	$reg = i2c_smbus_read_byte_data($file, 0xff);
+	return unless ($reg & 0xf0) = 0x20;
+
+	$reg = i2c_smbus_read_byte_data($file, 0x05);
+	return unless ($reg & 0x1f) = 0x00;
+
+	$reg = i2c_smbus_read_byte_data($file, 0x08);
+	return unless ($reg & 0x3f) = 0x00;
Quoted 9 lines

prog/detect/sensors-detect sub w83795_detect · line 5548

Quoted 3 lines
prog/detect/sensors-detect +3 -0
+
+	$reg = i2c_smbus_read_byte_data($file, 0x0f);
+	return unless ($reg & 0x3f) = 0x00;

You did not say above, what these last 3 registers were. Also I am surprised because checking these is in contradiction with your statement above that "we can not use bit masks since all bits (including reserved bits) can be set."

That only applies to the bank 1 registers. The above registers are read-only. Or at least I hope so - I'll test with the real chip to make sure.

I'll add the documentation and re-submit.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors