* [lm-sensors] [PATCH RESEND] lm-sensors: add detection for
@ 2007-06-25 16:07 Juerg Haefliger
2007-06-25 19:02 ` Jean Delvare
0 siblings, 1 reply; 2+ messages in thread
From: Juerg Haefliger @ 2007-06-25 16:07 UTC (permalink / raw)
To: lm-sensors
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
This patch adds detection logic for non-standard SMSC Super I/Os.
These chips have their device ID register at address 0x0d rather than
0x20.
Signed-off-by: Juerg Haefliger <juergh at gmail.com>
[-- Attachment #2: lm-sensors-non-standard-superio-detection.patch --]
[-- Type: text/x-patch, Size: 2484 bytes --]
--- lm-sensors.orig/prog/detect/sensors-detect 2007-06-13 08:18:39.981298000 -0700
+++ lm-sensors/prog/detect/sensors-detect 2007-06-25 09:05:41.421022000 -0700
@@ -1832,6 +1832,38 @@ use vars qw(@chip_kern24_ids @chip_kern2
devid => 0x77,
},
],
+ # Non-standard SMSC detection callback and chip list. These chips differ
+ # from the standard ones listed above in that the device ID register
+ # address is 0x0d instead of 0x20 (as specified by the ISA PNP spec).
+ ns_detect => \&smsc_ns_detect_superio,
+ ns_chips =>
+ [
+ {
+ name => "SMSC FDC37C665 Super IO",
+ driver => "not-a-sensor",
+ devid => 0x65,
+ },
+ {
+ name => "SMSC FDC37C666 Super IO",
+ driver => "not-a-sensor",
+ devid => 0x66,
+ },
+ {
+ name => "SMSC FDC37C669 Super IO",
+ driver => "not-a-sensor",
+ devid => 0x03,
+ },
+ {
+ name => "SMSC FDC37N769 Super IO",
+ driver => "not-a-sensor",
+ devid => 0x28,
+ },
+ {
+ name => "SMSC LPC47N227 Super IO",
+ driver => "not-a-sensor",
+ devid => 0x5a,
+ },
+ ],
},
{
family => "VIA/Winbond/Fintek",
@@ -3189,6 +3221,36 @@ sub probe_superio($$$)
$new_hash;
}
+# Detection routine for non-standard SMSC Super I/O chips
+# $_[0]: Super I/O LPC config/index port
+# $_[1]: Super I/O LPC data port
+# $_[2]: Reference to array of non-standard chips
+# Return values: 1 if non-standard chip found, 0 otherwise
+sub smsc_ns_detect_superio
+{
+ my ($addrreg, $datareg, $ns_chips) = @_;
+ my ($val, $chip);
+
+ # read alternate device ID register
+ outb($addrreg, 0x0d);
+ $val = inb($datareg);
+ if ($val == 0x00 || $val == 0xff) {
+ return 0;
+ }
+
+ print "Yes\n";
+
+ foreach $chip (@{$ns_chips}) {
+ if ($chip->{devid} == $val) {
+ probe_superio($addrreg, $datareg, $chip);
+ return 1;
+ }
+ }
+
+ printf("Found unknown non-standard chip with ID 0x%02x\n", $val);
+ return 1;
+}
+
sub scan_superio
{
my ($addrreg, $datareg) = @_;
@@ -3206,6 +3268,12 @@ sub scan_superio
foreach $val (@{$family->{enter}->{$addrreg}}) {
outb($addrreg, $val);
}
+# call the non-standard detection routine first if it exists
+ if (defined($family->{ns_detect}) &&
+ &{$family->{ns_detect}}($addrreg, $datareg, $family->{ns_chips})) {
+ exit_superio($addrreg, $datareg);
+ last FAMILY;
+ }
# did it work?
outb($addrreg, $superio{devidreg});
$val = inb($datareg);
[-- Attachment #3: Type: text/plain, Size: 153 bytes --]
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [lm-sensors] [PATCH RESEND] lm-sensors: add detection for
2007-06-25 16:07 [lm-sensors] [PATCH RESEND] lm-sensors: add detection for Juerg Haefliger
@ 2007-06-25 19:02 ` Jean Delvare
0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2007-06-25 19:02 UTC (permalink / raw)
To: lm-sensors
On Mon, 25 Jun 2007 09:07:59 -0700, Juerg Haefliger wrote:
> This patch adds detection logic for non-standard SMSC Super I/Os.
> These chips have their device ID register at address 0x0d rather than
> 0x20.
>
> Signed-off-by: Juerg Haefliger <juergh at gmail.com>
Applied, thanks.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-25 19:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-25 16:07 [lm-sensors] [PATCH RESEND] lm-sensors: add detection for Juerg Haefliger
2007-06-25 19:02 ` Jean Delvare
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.