summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-27 19:46:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-27 19:46:29 +0000
commit754c60a2dc644236085c8a0ebdd20f764b3c26ea (patch)
tree9933e190dacf90d41677908b1e09b9724d9538bd /sys
parentd0548b8382a42d9a941533b79b6fcb6f5e94826e (diff)
correct adm2940 probe
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/i2c_scan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index 734af40cf28..259341a4fbf 100644
--- a/sys/dev/i2c/i2c_scan.c
+++ b/sys/dev/i2c/i2c_scan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c_scan.c,v 1.22 2005/12/27 17:18:18 deraadt Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.23 2005/12/27 19:46:28 deraadt Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -266,16 +266,13 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
name = "adm1024"; /* complete check */
else if ((probe(0xff) & 0xf0) == 0x30)
name = "adm1023";
- if ((probe(0x3f) & 0xf0) == 0xd0 && addr == 0x2e &&
+ else if ((probe(0x3f) & 0xf0) == 0xd0 && addr == 0x2e &&
(probe(0x40) & 0x80) == 0x00)
name = "adm1028"; /* adm1022 clone? */
else if ((probe(0x3f) & 0xf0) == 0xc0 &&
(addr == 0x2c || addr == 0x2e || addr == 0x2f) &&
(probe(0x40) & 0x80) == 0x00)
name = "adm1022";
- else if (probe(0x48) == addr && probe(0x00) == 0x00 &&
- (addr & 0x7c) == 0x2c)
- name = "adm9240"; /* getting desperate! */
break;
case 0xa1:
/* Philips vendor code 0xa1 at 0x3e */
@@ -285,6 +282,12 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
(probe(0x42) & 0xbc) == 0x00)
name = "ne1619"; /* adm1025 compat */
break;
+ case 0x23: /* 2nd ADM id? */
+ if (probe(0x48) == addr &&
+ (probe(0x40) & 0x80) == 0x00 &&
+ (addr & 0x7c) == 0x2c)
+ name = "adm9240"; /* lm87 clone */
+ break;
case 0x55:
if (probe(0x3f) == 0x20)
name = "47m192"; /* adm1025 compat */