Skip to contentSkip to conversation

sensors-detect: Add support for NCT6775F and

PATCH Applied Guenter Roeck 2 participants 11 messages Jul 6, 2010 – Jun 26, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sensors-detect: Add support for NCT6775F and

The following patch adds support for SE97 to sensors-detect. It also displays the new chip names for W83677HG-I (NCT677xF).

---
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (revision 5850)
+++ prog/detect/sensors-detect (working copy)
@@ -1190,6 +1190,11 @@ use vars qw(@i2c_adapter_names);
i2c_addrs => [0x18..0x1f],
i2c_detect => sub { jedec_JC42_4_detect(@_, 0); },
}, {
+ name => "NXP SE97/SE97B",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
+ }, {
name => "Smart Battery",
driver => "sbs", # ACPI driver, not sure if it always works i2c_addrs => [0x0b],
@@ -1730,7 +1735,7 @@ use constant FEAT_SMBUS => (1 << 7);
logdev => 0x0b,
features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
}, {
- name => "Nuvoton W83677HG-I Super IO Sensors",
+ name => "Nuvoton W83677HG-I (NCT6771F/NCT6772F/NCT6775F) Super IO Sensors",
driver => "to-be-written", # Probably w83627ehf
devid => 0xB470,
devid_mask => 0xFFF0,
@@ -5309,7 +5314,7 @@ sub max6655_detect
return 6;
}

-# Chip to detect: 0 = STTS424
+# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
# Registers used:
# 0x00: Capabilities
# 0x01: Configuration
@@ -5332,9 +5337,13 @@ sub jedec_JC42_4_detect
# Check for manufacturer and device ID $manid = i2c_smbus_read_byte_data($file, 0x06); $devid = i2c_smbus_read_byte_data($file, 0x07);
+
if ($chip = 0) {
return unless $manid = 0x10; # STMicrolectronics
return unless $devid = 0x00; # STTS424
+ } elsif ($chip = 1) {
+ return unless $manid = 0x11; # NXP
+ return unless $devid = 0xa2; # SE97
}

# Now, do it all again with words. Note that we get
@@ -5342,7 +5351,7 @@ sub jedec_JC42_4_detect

# Check for unused bits
$reg = i2c_smbus_read_word_data($file, 0x00);

-	return if $reg < 0 || $reg & 0xc0ff;
+	return if $reg < 0 || $reg & 0x00ff;

$manid = i2c_smbus_read_word_data($file, 0x06); $devid = i2c_smbus_read_word_data($file, 0x07);
@@ -5350,6 +5359,9 @@ sub jedec_JC42_4_detect
if ($chip = 0) {
return unless $manid = 0x4a10; # STMicrolectronics
return unless ($devid & 0xfeff) = 0x0000; # STTS424
+ } elsif ($chip = 1) {
+ return unless $manid = 0x3111; # NXP
+ return unless ($devid & 0xfcff) = 0x00a2; # SE97
}

return 5;
Index: CHANGES
=================================--- CHANGES (revision 5850)
+++ CHANGES (working copy)
@@ -18,6 +18,8 @@ SVN HEAD
Fix Maxim MAX6690 support
Fix handling of duplicate detections Add support for STMicroelectronics STTS424
+ Add support for NXP SE97 / SE97B
+ Add reference to NCT6771F/NCT6772F/NCT6775F

3.1.2 (2010-02-02)
libsensors: Support upcoming sysfs path to i2c adapters

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

#1 lore raw

Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F

Hi Guenter,

Quoted 74 lines · Guenter Roeck

The following patch adds support for SE97 to sensors-detect. It also displays the new chip names for W83677HG-I (NCT677xF).

---
Index: prog/detect/sensors-detect
=================================> --- prog/detect/sensors-detect (revision 5850)
+++ prog/detect/sensors-detect (working copy)

(quoted diff) +15 -3
@@ -1190,6 +1190,11 @@ use vars qw(@i2c_adapter_names);
 		i2c_addrs => [0x18..0x1f],
 		i2c_detect => sub { jedec_JC42_4_detect(@_, 0); },
 	}, {
+		name => "NXP SE97/SE97B",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
+	}, {
 		name => "Smart Battery",
 		driver => "sbs", # ACPI driver, not sure if it always works
 		i2c_addrs => [0x0b],
@@ -1730,7 +1735,7 @@ use constant FEAT_SMBUS	=> (1 << 7);
 		logdev => 0x0b,
 		features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
 	}, {
-		name => "Nuvoton W83677HG-I Super IO Sensors",
+		name => "Nuvoton W83677HG-I (NCT6771F/NCT6772F/NCT6775F) Super IO Sensors",
 		driver => "to-be-written",	# Probably w83627ehf
 		devid => 0xB470,
 		devid_mask => 0xFFF0,
@@ -5309,7 +5314,7 @@ sub max6655_detect
 	return 6;
 }
 
-# Chip to detect: 0 = STTS424
+# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
 # Registers used:
 #   0x00: Capabilities
 #   0x01: Configuration
@@ -5332,9 +5337,13 @@ sub jedec_JC42_4_detect
 	# Check for manufacturer and device ID
 	$manid = i2c_smbus_read_byte_data($file, 0x06);
 	$devid = i2c_smbus_read_byte_data($file, 0x07);
+
 	if ($chip = 0) {
 		return unless $manid = 0x10;		# STMicrolectronics
 		return unless $devid = 0x00;		# STTS424
+	} elsif ($chip = 1) {
+		return unless $manid = 0x11;		# NXP
+		return unless $devid = 0xa2;		# SE97
 	}
 
 	# Now, do it all again with words. Note that we get
@@ -5342,7 +5351,7 @@ sub jedec_JC42_4_detect
 
 	# Check for unused bits
 	$reg = i2c_smbus_read_word_data($file, 0x00);
-	return if $reg < 0 || $reg & 0xc0ff;
+	return if $reg < 0 || $reg & 0x00ff;
 
 	$manid = i2c_smbus_read_word_data($file, 0x06);
 	$devid = i2c_smbus_read_word_data($file, 0x07);
@@ -5350,6 +5359,9 @@ sub jedec_JC42_4_detect
 	if ($chip = 0) {
 		return unless $manid = 0x4a10;		# STMicrolectronics
 		return unless ($devid & 0xfeff) = 0x0000; # STTS424
+	} elsif ($chip = 1) {
+		return unless $manid = 0x3111;		# NXP
+		return unless ($devid & 0xfcff) = 0x00a2; # SE97
 	}
 
 	return 5;

Index: CHANGES
=================================> --- CHANGES (revision 5850)
+++ CHANGES (working copy)

Review SVN HEAD · line 25

Quoted 8 lines
(quoted diff) +2 -0
@@ -18,6 +18,8 @@ SVN HEAD
                   Fix Maxim MAX6690 support
                   Fix handling of duplicate detections
                   Add support for STMicroelectronics STTS424
+                  Add support for NXP SE97 / SE97B
+                  Add reference to NCT6771F/NCT6772F/NCT6775F
 
 3.1.2 (2010-02-02)
   libsensors: Support upcoming sysfs path to i2c adapters

Looks all sane, thanks for doing this. Shall I commit it, or should I create a developer account and let you commit it? You already have an account for the wiki, letting you commit to the repository is only one configuration line away. So it's as you prefer.

Signature · 6 lines
Jean Delvare

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

Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F

In reply to Guenter Roeck
Quoted 11 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare

Looks all sane, thanks for doing this. Shall I commit it, or should I create a developer account and let you commit it? You already have an account for the wiki, letting you commit to the repository is only one configuration line away. So it's as you prefer.

I really prefer the git way of doing things, meaning I prefer to have someone else have a close look at my code, and not commit my own junk myself. I also never worked with svn before, so I would be a bit concerned about screwing up the repository. Not really a good idea to make my first svn commit into a public repository.

SVN is really easy. It's almost the same as CVS if you've used CVS before. And it's definitely easier than git.

Quoted 2 lines

So let's keep it as is for now, and go ahead and commit. We can revisit that when you get tired having to deal with my patches.

I'm tired already ;)

Just joking. I'll be glad to review and commit your patches if such is your desire.

Quoted 1 line

Any plans to switch to git ?

No. The complexity incurred far outweighs the benefits, given the little activity the project has.

Signature · 6 lines
Jean Delvare

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

Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F

In reply to Guenter Roeck
Quoted 7 lines · Jean Delvare
Quoted 6 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare

Looks all sane, thanks for doing this. Shall I commit it, or should I create a developer account and let you commit it? You already have an account for the wiki, letting you commit to the repository is only one configuration line away. So it's as you prefer.

Quoted 9 lines
Quoted 5 lines

I really prefer the git way of doing things, meaning I prefer to have someone else have a close look at my code, and not commit my own junk myself. I also never worked with svn before, so I would be a bit concerned about screwing up the repository. Not really a good idea to make my first svn commit into a public repository.

SVN is really easy. It's almost the same as CVS if you've used CVS before. And it's definitely easier than git.

Easier than git - really ? After having worked with git for several years, I am still amazed (or, rather, I am more and more amazed) how easy and fast things are with git. Granted, one problem is that it is also very easy to screw up, which makes it very difficult to use with junior engineers ...

Quoted 8 lines
Quoted 2 lines

So let's keep it as is for now, and go ahead and commit. We can revisit that when you get tired having to deal with my patches.

I'm tired already ;)

Just joking. I'll be glad to review and commit your patches if such is your desire.

Let's at least stick with it for now.

Guenter

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

#4 lore raw

Re: [lm-sensors] [PATCH] sensors-detect: Add support for NCT6775F

In reply to Guenter Roeck
Quoted 14 lines · Guenter Roeck
Quoted 13 lines · Jean Delvare
Quoted 11 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare

Looks all sane, thanks for doing this. Shall I commit it, or should I create a developer account and let you commit it? You already have an account for the wiki, letting you commit to the repository is only one configuration line away. So it's as you prefer.

I really prefer the git way of doing things, meaning I prefer to have someone else have a close look at my code, and not commit my own junk myself. I also never worked with svn before, so I would be a bit concerned about screwing up the repository. Not really a good idea to make my first svn commit into a public repository.

Quoted 7 lines
Quoted 3 lines

SVN is really easy. It's almost the same as CVS if you've used CVS before. And it's definitely easier than git.

Easier than git - really ? After having worked with git for several years, I am still amazed (or, rather, I am more and more amazed) how easy and fast things are with git. Granted, one problem is that it is also very easy to screw up, which makes it very difficult to use with junior engineers ...

It is indeed very easy to screw up with git. It is also easy to put your local repository in a state from which you don't know to recover. It isn't surprising anyway, as git is much more powerful than SVN (let alone CVS). With greater power comes greater ways to mess everything up.

Anyway, enough of this, I really don't have the time to discuss the merits of git vs SVN, others have done it already. The only thing I keep in mind is that you would have been more likely to contribute directly if we were using git. If a lot of other developers start claiming the same, then who knows...

Quoted 9 lines
Quoted 7 lines
Quoted 2 lines

So let's keep it as is for now, and go ahead and commit. We can revisit that when you get tired having to deal with my patches.

I'm tired already ;)

Just joking. I'll be glad to review and commit your patches if such is your desire.

Let's at least stick with it for now.

I've just applied your patch, thanks for your contribution.

Signature · 6 lines
Jean Delvare

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

PATCH 1/1 sensors-detect: Add support for several JC42.4

In reply to Guenter Roeck

This patch adds support for several JC42.4 compliant temperature sensors to sensors-detect.

---
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (revision 5851)
+++ prog/detect/sensors-detect (working copy)
@@ -1195,6 +1195,51 @@
i2c_addrs => [0x18..0x1f],
i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
}, {
+ name => "NXP SE98",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 2); },
+ }, {
+ name => "Analog Devices ADT7408",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 3); },
+ }, {
+ name => "IDT TS3000/TSE2002",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 4); },
+ }, {
+ name => "Maxim MAX6604",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 5); },
+ }, {
+ name => "Microchip MCP98242",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 6); },
+ }, {
+ name => "Microchip MCP98243",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 7); },
+ }, {
+ name => "Microchip MCP9843",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 8); },
+ }, {
+ name => "ON CAT6095/CAT34TS02",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 9); },
+ }, {
+ name => "ST STTS424E",
+ driver => "to-be-written",
+ i2c_addrs => [0x18..0x1f],
+ i2c_detect => sub { jedec_JC42_4_detect(@_, 10); },
+ }, {
name => "Smart Battery",
driver => "sbs", # ACPI driver, not sure if it always works i2c_addrs => [0x0b],
@@ -5314,7 +5359,10 @@
return 6;
}

-# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
+# Chip to detect: 0 = STTS424, 1 = SE97/SE97B, 2 = SE98, 3 = ADT7408,

+#                 4 = TS3000/TSE2002, 5 = MAX6604, 6 = MCP98242,
+#                 7 = MCP98243, 8 = MCP9843, 9 = CAT6095 / CAT34TS02,
+#                 10 = STTS424E

# Registers used:
# 0x00: Capabilities
# 0x01: Configuration
@@ -5340,10 +5388,37 @@

if ($chip = 0) {
return unless $manid = 0x10; # STMicrolectronics
- return unless $devid = 0x00; # STTS424
+ return unless $devid = 0x01; # STTS424
} elsif ($chip = 1) {
return unless $manid = 0x11; # NXP
return unless $devid = 0xa2; # SE97
+ } elsif ($chip = 2) {
+ return unless $manid = 0x11; # NXP
+ return unless $devid = 0xa1; # SE98
+ } elsif ($chip = 3) {
+ return unless $manid = 0x11; # ADT
+ return unless $devid = 0x08; # ADT7408
+ } elsif ($chip = 4) {
+ return unless $manid = 0x00; # IDT
+ return unless $devid = 0x29; # TS3000/TSE2002
+ } elsif ($chip = 5) {
+ return unless $manid = 0x00; # MAXIM
+ return unless $devid = 0x3e; # MAX6604
+ } elsif ($chip = 6) {
+ return unless $manid = 0x00; # MCP
+ return unless $devid = 0x20; # MCP98242
+ } elsif ($chip = 7) {
+ return unless $manid = 0x00; # MCP
+ return unless $devid = 0x21; # MCP98243
+ } elsif ($chip = 8) {
+ return unless $manid = 0x00; # MCP
+ return unless $devid = 0x00; # MCP9843
+ } elsif ($chip = 9) {
+ return unless $manid = 0x1b; # ONS
+ return unless $devid = 0x08; # CAT6095 / CAT34TS02
+ } elsif ($chip = 10) {
+ return unless $manid = 0x10; # STMicrolectronics
+ return unless $devid = 0x00; # STTS424E02
}

# Now, do it all again with words. Note that we get
@@ -5358,10 +5433,37 @@
return if $manid < 0 || $devid < 0;
if ($chip = 0) {
return unless $manid = 0x4a10; # STMicrolectronics
- return unless ($devid & 0xfeff) = 0x0000; # STTS424
+ return unless ($devid & 0xfeff) = 0x0001; # STTS424
} elsif ($chip = 1) {
return unless $manid = 0x3111; # NXP
return unless ($devid & 0xfcff) = 0x00a2; # SE97
+ } elsif ($chip = 2) {
+ return unless $manid = 0x3111; # NXP
+ return unless ($devid & 0xfcff) = 0x00a1; # SE98
+ } elsif ($chip = 3) {
+ return unless $manid = 0xd411; # ADT
+ return unless $devid = 0x0108; # ADT7408
+ } elsif ($chip = 4) {
+ return unless $manid = 0xb300; # IDT
+ return unless $devid = 0x0329; # TS3000/TSE2002
+ } elsif ($chip = 5) {
+ return unless $manid = 0x4d00; # MAXIM
+ return unless $devid = 0x003e; # MAX6604
+ } elsif ($chip = 6) {
+ return unless $manid = 0x5400; # MCP
+ return unless ($devid & 0xfcff) = 0x0020; # MCP98242
+ } elsif ($chip = 7) {
+ return unless $manid = 0x5400; # MCP
+ return unless ($devid & 0xfcff) = 0x0021; # MCP98243
+ } elsif ($chip = 8) {
+ return unless $manid = 0x5400; # MCP
+ return unless ($devid & 0xfcff) = 0x0000; # MCP9843
+ } elsif ($chip = 9) {
+ return unless $manid = 0x091b; # ONS
+ return unless ($devid & 0xe0ff) = 0x0008; # CAT6095 / CAT34TS02
+ } elsif ($chip = 10) {
+ return unless $manid = 0x4a10; # STMicrolectronics
+ return unless ($devid & 0xfeff) = 0x0000; # STTS424E02
}

return 5;
Index: CHANGES
=================================--- CHANGES (revision 5851)
+++ CHANGES (working copy)
@@ -20,6 +20,7 @@
Add support for STMicroelectronics STTS424 Add support for NXP SE97 / SE97B Add reference to NCT6771F/NCT6772F/NCT6775F
+ Add support for several JC42.4 compliant temperature sensors

3.1.2 (2010-02-02)
libsensors: Support upcoming sysfs path to i2c adapters

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

Applied
#6 lore raw

Re: [lm-sensors] [PATCH] sensors-detect: Add support for several

In reply to Guenter Roeck

Hi Gunter,

Quoted 2 lines · Guenter Roeck

This patch adds support for several JC42.4 compliant temperature sensors to sensors-detect.

Applied, thanks.

Quoted 43 lines

---
Index: prog/detect/sensors-detect
=================================> --- prog/detect/sensors-detect (revision 5851)
+++ prog/detect/sensors-detect (working copy)

(quoted diff) +35 -0
@@ -1195,6 +1195,51 @@
 		i2c_addrs => [0x18..0x1f],
 		i2c_detect => sub { jedec_JC42_4_detect(@_, 1); },
 	}, {
+		name => "NXP SE98",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 2); },
+	}, {
+		name => "Analog Devices ADT7408",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 3); },
+	}, {
+		name => "IDT TS3000/TSE2002",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 4); },
+	}, {
+		name => "Maxim MAX6604",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 5); },
+	}, {
+		name => "Microchip MCP98242",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 6); },
+	}, {
+		name => "Microchip MCP98243",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 7); },
+	}, {
+		name => "Microchip MCP9843",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 8); },
+	}, {

Review line 1242

Quoted 10 lines
(quoted diff) +10 -0
+		name => "ON CAT6095/CAT34TS02",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 9); },
+	}, {
+		name => "ST STTS424E",
+		driver => "to-be-written",
+		i2c_addrs => [0x18..0x1f],
+		i2c_detect => sub { jedec_JC42_4_detect(@_, 10); },
+	}, {

FYI, I moved this one right after the STTS424 entry. The output of sensors-detect looks slightly nicer when several chips of the same manufacturer are tested in a row.

Quoted 104 lines
(quoted diff) +60 -3
 		name => "Smart Battery",
 		driver => "sbs", # ACPI driver, not sure if it always works
 		i2c_addrs => [0x0b],
@@ -5314,7 +5359,10 @@
 	return 6;
 }
 
-# Chip to detect: 0 = STTS424, 1 = SE97/SE97B
+# Chip to detect: 0 = STTS424, 1 = SE97/SE97B, 2 = SE98, 3 = ADT7408,
+#                 4 = TS3000/TSE2002, 5 = MAX6604, 6 = MCP98242,
+#                 7 = MCP98243, 8 = MCP9843, 9 = CAT6095 / CAT34TS02,
+#                 10 = STTS424E
 # Registers used:
 #   0x00: Capabilities
 #   0x01: Configuration
@@ -5340,10 +5388,37 @@
 
 	if ($chip = 0) {
 		return unless $manid = 0x10;		# STMicrolectronics
-		return unless $devid = 0x00;		# STTS424
+		return unless $devid = 0x01;		# STTS424
 	} elsif ($chip = 1) {
 		return unless $manid = 0x11;		# NXP
 		return unless $devid = 0xa2;		# SE97
+	} elsif ($chip = 2) {
+		return unless $manid = 0x11;		# NXP
+		return unless $devid = 0xa1;		# SE98
+	} elsif ($chip = 3) {
+		return unless $manid = 0x11;		# ADT
+		return unless $devid = 0x08;		# ADT7408
+	} elsif ($chip = 4) {
+		return unless $manid = 0x00;		# IDT
+		return unless $devid = 0x29;		# TS3000/TSE2002
+	} elsif ($chip = 5) {
+		return unless $manid = 0x00;		# MAXIM
+		return unless $devid = 0x3e;		# MAX6604
+	} elsif ($chip = 6) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x20;		# MCP98242
+	} elsif ($chip = 7) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x21;		# MCP98243
+	} elsif ($chip = 8) {
+		return unless $manid = 0x00;		# MCP
+		return unless $devid = 0x00;		# MCP9843
+	} elsif ($chip = 9) {
+		return unless $manid = 0x1b;		# ONS
+		return unless $devid = 0x08;		# CAT6095 / CAT34TS02
+	} elsif ($chip = 10) {
+		return unless $manid = 0x10;		# STMicrolectronics
+		return unless $devid = 0x00;		# STTS424E02
 	}
 
 	# Now, do it all again with words. Note that we get
@@ -5358,10 +5433,37 @@
 	return if $manid < 0 || $devid < 0;
 	if ($chip = 0) {
 		return unless $manid = 0x4a10;		# STMicrolectronics
-		return unless ($devid & 0xfeff) = 0x0000; # STTS424
+		return unless ($devid & 0xfeff) = 0x0001; # STTS424
 	} elsif ($chip = 1) {
 		return unless $manid = 0x3111;		# NXP
 		return unless ($devid & 0xfcff) = 0x00a2; # SE97
+	} elsif ($chip = 2) {
+		return unless $manid = 0x3111;		# NXP
+		return unless ($devid & 0xfcff) = 0x00a1; # SE98
+	} elsif ($chip = 3) {
+		return unless $manid = 0xd411;		# ADT
+		return unless $devid = 0x0108;		# ADT7408
+	} elsif ($chip = 4) {
+		return unless $manid = 0xb300;		# IDT
+		return unless $devid = 0x0329;		# TS3000/TSE2002
+	} elsif ($chip = 5) {
+		return unless $manid = 0x4d00;		# MAXIM
+		return unless $devid = 0x003e;		# MAX6604
+	} elsif ($chip = 6) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0020; # MCP98242
+	} elsif ($chip = 7) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0021; # MCP98243
+	} elsif ($chip = 8) {
+		return unless $manid = 0x5400;		# MCP
+		return unless ($devid & 0xfcff) = 0x0000; # MCP9843
+	} elsif ($chip = 9) {
+		return unless $manid = 0x091b;		# ONS
+		return unless ($devid & 0xe0ff) = 0x0008; # CAT6095 / CAT34TS02
+	} elsif ($chip = 10) {
+		return unless $manid = 0x4a10;		# STMicrolectronics
+		return unless ($devid & 0xfeff) = 0x0000; # STTS424E02
 	}
 
 	return 5;

Index: CHANGES
=================================> --- CHANGES (revision 5851)
+++ CHANGES (working copy)

(quoted diff) +1 -0
@@ -20,6 +20,7 @@
                   Add support for STMicroelectronics STTS424
                   Add support for NXP SE97 / SE97B
                   Add reference to NCT6771F/NCT6772F/NCT6775F
+                  Add support for several JC42.4 compliant temperature sensors
 
 3.1.2 (2010-02-02)
   libsensors: Support upcoming sysfs path to i2c adapters
Signature · 6 lines
Jean Delvare

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

PATCH 1/1 sensors-detect: Add support for max6695/96

In reply to Guenter Roeck

This patch adds support for max6695/96 to sensors-detect.

---
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (revision 5857)
+++ prog/detect/sensors-detect (working copy)
@@ -921,8 +921,13 @@
name => "Maxim MAX6680/MAX6681",
driver => "lm90",
i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
- i2c_detect => sub { lm90_detect(@_, 7); },
+ i2c_detect => sub { max6680_95_detect(@_, 0); },
}, {
+ name => "Maxim MAX6695/MAX6696",
+ driver => "lm90",
+ i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
+ i2c_detect => sub { max6680_95_detect(@_, 1); },
+ }, {
name => "Winbond W83L771W/G",
driver => "to-be-written",
i2c_addrs => [0x4c],
@@ -4051,10 +4056,46 @@
return $confidence;
}

+# Chip to detect: 0 = MAX6680/81, 1 = MAX6695/96
+# Registers used:

+#   0x03: Configuration
+#   0x04: Conversion rate
+#   0x12: Status2
+#   0x16: Overtemperature 2
+#   0xfe: Manufacturer ID
+#   0xff: Chip ID / die revision

+sub max6680_95_detect
+{
+ my ($file, $addr, $chip) = @_;
+ my $mid = i2c_smbus_read_byte_data($file, 0xfe);
+ my $cid = i2c_smbus_read_byte_data($file, 0xff);
+ my $conf = i2c_smbus_read_byte_data($file, 0x03);
+ my $rate = i2c_smbus_read_byte_data($file, 0x04);
+ my $emerg = i2c_smbus_read_byte_data($file, 0x16);
+ my $status2 = i2c_smbus_read_byte_data($file, 0x12);
+
+ if ($chip = 0) {
+ return if ($conf & 0x03) != 0;
+ return if $rate > 0x07;
+ return if $emerg != $rate;
+ return if $mid != 0x4d; # Maxim
+ return 8 if $cid = 0x01; # MAX6680/MAX6681
+ }
+ if ($chip = 1) {
+ return if ($conf & 0x10) != 0;
+ return if ($status2 & 0x01) != 0;
+ return if $rate > 0x07;
+ return if $emerg = $rate;
+ return if $mid != 0x4d; # Maxim
+ return 8 if $cid = 0x01; # MAX6695/MAX6696
+ }
+ return;
+}
+
# Chip to detect: 0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032,

 #		  4 = MAX6654, 5 = ADT7461,
 #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
-#		  7 = MAX6680/MAX6681, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
+#		  7 = unused, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690

# Registers used:
# 0x03: Configuration
@@ -4116,10 +4157,7 @@
return 8 if $cid = 0x59; # MAX6648/MAX6692
}
if ($chip = 7) {
- return if ($conf & 0x03) != 0;
- return if $rate > 0x07;
- return if $mid != 0x4d; # Maxim
- return 8 if $cid = 0x01; # MAX6680/MAX6681
+ return;
}
if ($chip = 8) {
return if ($conf & 0x2a) != 0;

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

#8 lore raw

Re: [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96

In reply to Guenter Roeck

Hi Guenter,

Quoted 37 lines · Guenter Roeck

This patch adds support for max6695/96 to sensors-detect.

---
Index: prog/detect/sensors-detect
=================================> --- prog/detect/sensors-detect (revision 5857)
+++ prog/detect/sensors-detect (working copy)

(quoted diff) +18 -1
@@ -921,8 +921,13 @@
 		name => "Maxim MAX6680/MAX6681",
 		driver => "lm90",
 		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
-		i2c_detect => sub { lm90_detect(@_, 7); },
+		i2c_detect => sub { max6680_95_detect(@_, 0); },
 	}, {
+		name => "Maxim MAX6695/MAX6696",
+		driver => "lm90",
+		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
+		i2c_detect => sub { max6680_95_detect(@_, 1); },
+	}, {
 		name => "Winbond W83L771W/G",
 		driver => "to-be-written",
 		i2c_addrs => [0x4c],
@@ -4051,10 +4056,46 @@
 	return $confidence;
 }
 
+# Chip to detect: 0 = MAX6680/81, 1 = MAX6695/96
+# Registers used:
+#   0x03: Configuration
+#   0x04: Conversion rate
+#   0x12: Status2
+#   0x16: Overtemperature 2
+#   0xfe: Manufacturer ID
+#   0xff: Chip ID / die revision
+sub max6680_95_detect
+{
+	my ($file, $addr, $chip) = @_;
+	my $mid = i2c_smbus_read_byte_data($file, 0xfe);

Review line 4080

Quoted 10 lines
(quoted diff) +10 -0
+	my $cid = i2c_smbus_read_byte_data($file, 0xff);
+	my $conf = i2c_smbus_read_byte_data($file, 0x03);
+	my $rate = i2c_smbus_read_byte_data($file, 0x04);
+	my $emerg = i2c_smbus_read_byte_data($file, 0x16);
+	my $status2 = i2c_smbus_read_byte_data($file, 0x12);
+
+	if ($chip = 0) {
+		return if ($conf & 0x03) != 0;
+		return if $rate > 0x07;
+		return if $emerg != $rate;

Please take a look at max6657_detect(). Obviously you assume that the SMBus read commands above were executed in a specific order, which isn't actually guaranteed, because sensors-detect has a register cache to speed up detection. You really want to pass NO_CACHE as a third parameter if you want to by-pass the cache and thus ensure that the read order is as desired.

Also, as discussed before, comparing $emerg and $rate is likely to work in most cases, but isn't 100% reliable. You might want to consider the following sequence instead:

	my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE);
	my $emerg1 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);
	my $rate = i2c_smbus_read_byte_data($file, 0x04, NO_CACHE);
	my $emerg2 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);

	if ($emerg1 != $emerg2)
		# MAX6680/MAX6681
	else
		# MAX6695/MAX6696

This is guaranteed to work because $mid and $rate can't have the same value.

Quoted 23 lines
(quoted diff) +15 -1
+		return if $mid != 0x4d;		# Maxim
+		return 8 if $cid = 0x01;	# MAX6680/MAX6681
+	}
+	if ($chip = 1) {
+		return if ($conf & 0x10) != 0;
+		return if ($status2 & 0x01) != 0;
+		return if $rate > 0x07;
+		return if $emerg = $rate;
+		return if $mid != 0x4d;		# Maxim
+		return 8 if $cid = 0x01;	# MAX6695/MAX6696
+	}
+	return;
+}
+
 # Chip to detect: 0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032,
 #		  4 = MAX6654, 5 = ADT7461,
 #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
-#		  7 = MAX6680/MAX6681, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
+#		  7 = unused, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690
 # Registers used:
 #   0x03: Configuration

Review line 4161

Quoted 9 lines
(quoted diff) +1 -4
@@ -4116,10 +4157,7 @@
 		return 8 if $cid = 0x59;	# MAX6648/MAX6692
 	}
 	if ($chip = 7) {
-		return if ($conf & 0x03) != 0;
-		return if $rate > 0x07;
-		return if $mid != 0x4d;		# Maxim
-		return 8 if $cid = 0x01;	# MAX6680/MAX6681
+		return;
 	}

Why not skip it altogether? And same for the comment above? These are arbitrary numbers, it's totally OK if they don't follow each other.

Quoted 2 lines
(quoted diff) +0 -0
 	if ($chip = 8) {
 		return if ($conf & 0x2a) != 0;
Signature · 6 lines
Jean Delvare

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

Re: [lm-sensors] [PATCH] sensors-detect: Add support for max6695/96

In reply to Guenter Roeck

Hi Jean,

Quoted 49 lines · Jean Delvare

Hi Guenter,

Quoted 46 lines · Guenter Roeck

This patch adds support for max6695/96 to sensors-detect.

---
Index: prog/detect/sensors-detect
=================================> > --- prog/detect/sensors-detect (revision 5857)
+++ prog/detect/sensors-detect (working copy)

(quoted diff) +27 -1
@@ -921,8 +921,13 @@
 		name => "Maxim MAX6680/MAX6681",
 		driver => "lm90",
 		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
-		i2c_detect => sub { lm90_detect(@_, 7); },
+		i2c_detect => sub { max6680_95_detect(@_, 0); },
 	}, {
+		name => "Maxim MAX6695/MAX6696",
+		driver => "lm90",
+		i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
+		i2c_detect => sub { max6680_95_detect(@_, 1); },
+	}, {
 		name => "Winbond W83L771W/G",
 		driver => "to-be-written",
 		i2c_addrs => [0x4c],
@@ -4051,10 +4056,46 @@
 	return $confidence;
 }
 
+# Chip to detect: 0 = MAX6680/81, 1 = MAX6695/96
+# Registers used:
+#   0x03: Configuration
+#   0x04: Conversion rate
+#   0x12: Status2
+#   0x16: Overtemperature 2
+#   0xfe: Manufacturer ID
+#   0xff: Chip ID / die revision
+sub max6680_95_detect
+{
+	my ($file, $addr, $chip) = @_;
+	my $mid = i2c_smbus_read_byte_data($file, 0xfe);
+	my $cid = i2c_smbus_read_byte_data($file, 0xff);
+	my $conf = i2c_smbus_read_byte_data($file, 0x03);
+	my $rate = i2c_smbus_read_byte_data($file, 0x04);
+	my $emerg = i2c_smbus_read_byte_data($file, 0x16);
+	my $status2 = i2c_smbus_read_byte_data($file, 0x12);
+
+	if ($chip = 0) {
+		return if ($conf & 0x03) != 0;
+		return if $rate > 0x07;
Quoted 9 lines

Review line 4080

Quoted 1 line
(quoted diff) +1 -0
+		return if $emerg != $rate;

Please take a look at max6657_detect(). Obviously you assume that the SMBus read commands above were executed in a specific order, which isn't actually guaranteed, because sensors-detect has a register cache to speed up detection. You really want to pass NO_CACHE as a third parameter if you want to by-pass the cache and thus ensure that the read order is as desired.

Yes, I completely missed that.

Quoted 14 lines

Also, as discussed before, comparing $emerg and $rate is likely to work in most cases, but isn't 100% reliable. You might want to consider the following sequence instead:

	my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE);
	my $emerg1 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);
	my $rate = i2c_smbus_read_byte_data($file, 0x04, NO_CACHE);
	my $emerg2 = i2c_smbus_read_byte_data($file, 0x16, NO_CACHE);

	if ($emerg1 != $emerg2)
		# MAX6680/MAX6681
	else
		# MAX6695/MAX6696
Quoted 2 lines

This is guaranteed to work because $mid and $rate can't have the same value.

Excellent idea. I'll try that.

Quoted 29 lines
Quoted 29 lines
(quoted diff) +15 -2
+		return if $mid != 0x4d;		# Maxim
+		return 8 if $cid = 0x01;	# MAX6680/MAX6681
+	}
+	if ($chip = 1) {
+		return if ($conf & 0x10) != 0;
+		return if ($status2 & 0x01) != 0;
+		return if $rate > 0x07;
+		return if $emerg = $rate;
+		return if $mid != 0x4d;		# Maxim
+		return 8 if $cid = 0x01;	# MAX6695/MAX6696
+	}
+	return;
+}
+
 # Chip to detect: 0 = LM90, 1 = LM89/LM99, 2 = LM86, 3 = ADM1032,
 #		  4 = MAX6654, 5 = ADT7461,
 #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
-#		  7 = MAX6680/MAX6681, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
+#		  7 = unused, 8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690
 # Registers used:
 #   0x03: Configuration
@@ -4116,10 +4157,7 @@
 		return 8 if $cid = 0x59;	# MAX6648/MAX6692
 	}
 	if ($chip = 7) {
-		return if ($conf & 0x03) != 0;
Quoted 9 lines

Review line 4161

Quoted 5 lines
(quoted diff) +1 -3
-		return if $rate > 0x07;
-		return if $mid != 0x4d;		# Maxim
-		return 8 if $cid = 0x01;	# MAX6680/MAX6681
+		return;
 	}

Why not skip it altogether? And same for the comment above? These are arbitrary numbers, it's totally OK if they don't follow each other.

Ok.

Guenter

Quoted 4 lines

Review line 4163

Quoted 2 lines
(quoted diff) +0 -0
 	if ($chip = 8) {
 		return if ($conf & 0x2a) != 0;

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

#10 lore raw

PATCH 1/1 sensors-detect: Add support for NXP/Philips

In reply to Guenter Roeck

Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (revision 5980)
+++ prog/detect/sensors-detect (working copy)
@@ -1055,6 +1055,11 @@
i2c_addrs => [0x4c..0x4d], i2c_detect => sub { lm90_detect(@_, 13); },
}, {
+ name => "NXP/Philips SA56004",
+ driver => "lm90",
+ i2c_addrs => [0x48..0x4f],
+ i2c_detect => sub { lm90_detect(@_, 14); },
+ }, {
name => "Analog Devices ADT7481", driver => "to-be-written", i2c_addrs => [0x4c, 0x4b],
@@ -4352,7 +4357,7 @@

 #		  6 = MAX6646/MAX6647/MAX6648/MAX6649/MAX6692,
 #		  8 = W83L771W/G, 9 = TMP401, 10 = TMP411,
 #		  11 = W83L771AWG/ASG, 12 = MAX6690,
-#		  13 = ADT7461A/NCT1008
+#		  13 = ADT7461A/NCT1008, 14 = SA56004

# Registers used:
# 0x03: Configuration
# 0x04: Conversion rate
@@ -4457,6 +4462,12 @@
return if $mid != 0x41; # Analog Devices
return 8 if $cid = 0x57; # ADT7461A, NCT1008
}
+ if ($chip = 14) {
+ return if ($conf & 0x2a) != 0;
+ return if $rate > 0x09;
+ return if $mid != 0xa1; # NXP Semiconductor/Philips
+ return 8 if $cid = 0x00; # SA56004
+ }
return;
}

Index: CHANGES
=================================--- CHANGES (revision 5980)
+++ CHANGES (working copy)
@@ -15,6 +15,7 @@
Add detection of SMSC EMC2300
Add detection of MAX6642
Add detection of ITE IT8772E
+ Add detection of SE56004

3.3.0 (2011-03-28)
Makefile: Check for bison and flex

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