sensors-detect: Add support for max6695/96
PATCH v2 1/1 sensors-detect: Add support for max6695/96
This patch adds support for max6695/96 to sensors-detect.
---
v2:
Fix and improve max6680/81 vs. max6695/96 detection code Remove chip=7 code from lm90_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,47 @@
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 $cid = i2c_smbus_read_byte_data($file, 0xff);
+ my $conf = i2c_smbus_read_byte_data($file, 0x03);
+ my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE);
+ my $emerg = 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);
+
+ # Check common conditions
+ return if $rate > 0x07;
+ return if $mid != 0x4d; # Not Maxim
+ return if $cid != 0x01; # None of the chips we are looking for
+
+ if ($chip = 0) {
+ return if ($conf & 0x03) != 0;
+ return 8 if $emerg != $emerg2; # MAX6680/MAX6681
+ }
+ if ($chip = 1) {
+ my $status2 = i2c_smbus_read_byte_data($file, 0x12);
+
+ return if ($conf & 0x10) != 0;
+ return if ($status2 & 0x01) != 0;
+ return 8 if $emerg = $emerg2; # 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, +# 8 = W83L771W/G, 9 = TMP401, 10 = TMP411, # 11 = W83L771AWG/ASG, 12 = MAX6690
# Registers used:
# 0x03: Configuration
@@ -4115,12 +4157,6 @@
return if $mid != 0x4d; # Maxim
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
- }
if ($chip = 8) {
return if ($conf & 0x2a) != 0;
return if $rate > 0x09;
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
Hi Guenter,
Quoted 77 lines · Guenter Roeck
This patch adds support for max6695/96 to sensors-detect.
---
v2:
Fix and improve max6680/81 vs. max6695/96 detection code Remove chip=7 code fromlm90_detect---
Index: prog/detect/sensors-detect
=================================> --- prog/detect/sensors-detect (revision 5857)
+++ prog/detect/sensors-detect (working copy)(quoted diff) +44
-2@@ -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,47 @@ 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 $cid = i2c_smbus_read_byte_data($file, 0xff); + my $conf = i2c_smbus_read_byte_data($file, 0x03); + my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE); + my $emerg = 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); + + # Check common conditions + return if $rate > 0x07; + return if $mid != 0x4d; # Not Maxim + return if $cid != 0x01; # None of the chips we are looking for + + if ($chip = 0) { + return if ($conf & 0x03) != 0; + return 8 if $emerg != $emerg2; # MAX6680/MAX6681 + } + if ($chip = 1) { + my $status2 = i2c_smbus_read_byte_data($file, 0x12); + + return if ($conf & 0x10) != 0; + return if ($status2 & 0x01) != 0; + return 8 if $emerg = $emerg2; # 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, +# 8 = W83L771W/G, 9 = TMP401, 10 = TMP411, # 11 = W83L771AWG/ASG, 12 = MAX6690 # Registers used: # 0x03: Configuration@@ -4115,12 +4157,6 @@ return if $mid != 0x4d; # Maxim return 8 if $cid = 0x59; # MAX6648/MAX6692
Review line 4162
Quoted 10 lines
(quoted diff) +0
-6} - if ($chip = 7) { - return if ($conf & 0x03) != 0; - return if $rate > 0x07; - return if $mid != 0x4d; # Maxim - return 8 if $cid = 0x01; # MAX6680/MAX6681 - } if ($chip = 8) { return if ($conf & 0x2a) != 0; return if $rate > 0x09;
Looks good, please commit!
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckHi Jean,
Quoted 84 lines · Jean Delvare
Hi Guenter,
Quoted 81 lines · Guenter Roeck
This patch adds support for max6695/96 to sensors-detect.
---
v2:
Fix and improve max6680/81 vs. max6695/96 detection code Remove chip=7 code fromlm90_detect---
Index: prog/detect/sensors-detect
=================================> > --- prog/detect/sensors-detect (revision 5857)
+++ prog/detect/sensors-detect (working copy)(quoted diff) +44
-5@@ -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,47 @@ 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 $cid = i2c_smbus_read_byte_data($file, 0xff); + my $conf = i2c_smbus_read_byte_data($file, 0x03); + my $mid = i2c_smbus_read_byte_data($file, 0xfe, NO_CACHE); + my $emerg = 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); + + # Check common conditions + return if $rate > 0x07; + return if $mid != 0x4d; # Not Maxim + return if $cid != 0x01; # None of the chips we are looking for + + if ($chip = 0) { + return if ($conf & 0x03) != 0; + return 8 if $emerg != $emerg2; # MAX6680/MAX6681 + } + if ($chip = 1) { + my $status2 = i2c_smbus_read_byte_data($file, 0x12); + + return if ($conf & 0x10) != 0; + return if ($status2 & 0x01) != 0; + return 8 if $emerg = $emerg2; # 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, +# 8 = W83L771W/G, 9 = TMP401, 10 = TMP411, # 11 = W83L771AWG/ASG, 12 = MAX6690 # Registers used: # 0x03: Configuration@@ -4115,12 +4157,6 @@ return if $mid != 0x4d; # Maxim return 8 if $cid = 0x59; # MAX6648/MAX6692 } - if ($chip = 7) { - return if ($conf & 0x03) != 0; - return if $rate > 0x07;
Quoted 9 lines
Review line 4162
Quoted 6 lines
(quoted diff) +0
-3- return if $mid != 0x4d; # Maxim - return 8 if $cid = 0x01; # MAX6680/MAX6681 - } if ($chip = 8) { return if ($conf & 0x2a) != 0; return if $rate > 0x09;Looks good, please commit!
I don't have a svn account, as least not to my knowledge. Guess it is time to create one for me.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckQuoted 2 lines · Guenter Roeck
I don't have a svn account, as least not to my knowledge. Guess it is time to create one for me.
Oh, good point. I've moved you to the lm-sensors commiters group, so it should be OK now. Use the same login and password as for the wiki.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckQuoted 7 lines · Jean Delvare
Quoted 2 lines · Guenter Roeck
I don't have a svn account, as least not to my knowledge. Guess it is time to create one for me.
Oh, good point. I've moved you to the lm-sensors commiters group, so it should be OK now. Use the same login and password as for the wiki.
Unfortunately we are behind a proxy, and svn doesn't seem to like that. And https doesn't work, as it looks like because of a problem with svn on Ubuntu Lucid :-(.
I'll keep playing with it.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckQuoted 5 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare
Quoted 2 lines · Guenter Roeck
I don't have a svn account, as least not to my knowledge. Guess it is time to create one for me.
Quoted 8 lines
Quoted 2 lines
Oh, good point. I've moved you to the lm-sensors commiters group, so it should be OK now. Use the same login and password as for the wiki.
Unfortunately we are behind a proxy, and svn doesn't seem to like that. And https doesn't work, as it looks like because of a problem with svn on Ubuntu Lucid :-(.
I'll keep playing with it.
If there's anything that can be done on the server side that would make it easier for you, please let me know and we can ask Axel Thimm (the lm-sensors.org server admin, Cc'd) if he can help.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckQuoted 13 lines · Jean Delvare
Quoted 12 lines · Guenter Roeck
Quoted 6 lines · Jean Delvare
Quoted 2 lines · Guenter Roeck
I don't have a svn account, as least not to my knowledge. Guess it is time to create one for me.
Oh, good point. I've moved you to the lm-sensors commiters group, so it should be OK now. Use the same login and password as for the wiki.
Unfortunately we are behind a proxy, and svn doesn't seem to like that. And https doesn't work, as it looks like because of a problem with svn on Ubuntu Lucid :-(.
Quoted 6 lines
Quoted 1 line
I'll keep playing with it.
If there's anything that can be done on the server side that would make it easier for you, please let me know and we can ask Axel Thimm (the lm-sensors.org server admin, Cc'd) if he can help.
I managed to commit using http by switching to another system. Turns out the culprit was not the proxy, but NAT.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH v2 1/1 sensors-detect: Add support for NXP/Philips
In reply to Guenter Roeckv2: Stronger detection code. Confidence reduced from 8 to 6.
--
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (revision 5982)
+++ 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,11 +4357,11 @@
# 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 -# 0xbf: Configuration 2 (National Semiconductor and Winbond only) +# 0xbf: Configuration 2 (National Semiconductor, Winbond, and Philips only) # 0xfe: Manufacturer ID # 0xff: Chip ID / die revision
sub lm90_detect
@@ -4457,6 +4462,13 @@
return if $mid != 0x41; # Analog Devices
return 8 if $cid = 0x57; # ADT7461A, NCT1008
}
+ if ($chip = 14) {
+ return if ($conf & 0x2a) != 0;
+ return if ($conf2 & 0xfe) != 0;
+ return if $rate > 0x09;
+ return if $mid != 0xa1; # NXP Semiconductor/Philips
+ return 6 if $cid = 0x00; # SA56004
+ }
return;
}
Index: CHANGES
=================================--- CHANGES (revision 5982)
+++ CHANGES (working copy)
@@ -16,6 +16,7 @@
Add detection of MAX6642
Add detection of ITE IT8772E Don't advertise the ipmisensors driver
+ Add detection of SA56004
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
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckHi Guenter,
Quoted 51 lines · Guenter Roeck
v2: Stronger detection code. Confidence reduced from 8 to 6.
--
Index: prog/detect/sensors-detect
=================================> --- prog/detect/sensors-detect (revision 5982)
+++ prog/detect/sensors-detect (working copy)(quoted diff) +14
-2@@ -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,11 +4357,11 @@ # 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 -# 0xbf: Configuration 2 (National Semiconductor and Winbond only) +# 0xbf: Configuration 2 (National Semiconductor, Winbond, and Philips only) # 0xfe: Manufacturer ID # 0xff: Chip ID / die revision sub lm90_detect@@ -4457,6 +4462,13 @@ return if $mid != 0x41; # Analog Devices return 8 if $cid = 0x57; # ADT7461A, NCT1008 } + if ($chip = 14) { + return if ($conf & 0x2a) != 0; + return if ($conf2 & 0xfe) != 0; + return if $rate > 0x09; + return if $mid != 0xa1; # NXP Semiconductor/Philips + return 6 if $cid = 0x00; # SA56004 + } return; }Index: CHANGES
=================================> --- CHANGES (revision 5982)
+++ CHANGES (working copy)
Review line 22
Quoted 7 lines
(quoted diff) +1
-0@@ -16,6 +16,7 @@ Add detection of MAX6642 Add detection of ITE IT8772E Don't advertise the ipmisensors driver + Add detection of SA56004 3.3.0 (2011-03-28) Makefile: Check for bison and flex
Looks good, please commit and update wiki/Devices accordingly.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2] sensors-detect: Add support for
In reply to Guenter RoeckQuoted 5 lines · Jean Delvare
Hi Guenter,
Quoted 2 lines · Guenter Roeck
v2: Stronger detection code. Confidence reduced from 8 to 6.
[ ... ]
Quoted 3 lines
Looks good, please commit and update wiki/Devices accordingly.
Done, and done.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors