summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-01-13 01:45:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-01-13 01:45:00 +0000
commit76c61326e06e542609a4b9eec8731d3e34b36228 (patch)
tree6a163d95d5af128848d3257946cbb301904affb9 /sys
parentcdc7321d10cfc5d5ccafa150070eefa47ec5d0cb (diff)
introduce the most stupid basic scan check for the maximally braindead
ds1631/1624/1721 chips. this will need improvement -- we MUST check for more registers that alias or don't -- because we tend to write these chips ok grange
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/i2c_scan.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index a6f5534ab52..32c5e29f4f6 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.55 2006/01/12 00:12:37 deraadt Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.56 2006/01/13 01:44:59 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -564,10 +564,19 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
name = "adm1026";
} else if (name == NULL && (addr & 0x7c) == 0x48) {
name = lm75probe();
- } else if (name == NULL && (addr & 0x7c) == 0x48 &&
- (iicprobe(0xac) & 0x7e) == 0x4a &&
- (iicprobew(0xaa) & 0x0007) == 0x0000) {
- name = "ds1624";
+ }
+ if (name == NULL && (addr & 0x7c) == 0x48 &&
+ (iicprobew(0xaa) & 0x0007) == 0x0000 &&
+ (iicprobew(0xa1) & 0x0007) == 0x0000 &&
+ (iicprobew(0xa2) & 0x0007) == 0x0000 &&
+ (iicprobe(0xac) & 0x10) == 0x00) {
+ if ((iicprobe(0xac) & 0x7e) == 0x0a &&
+ iicprobe(0xab) == 0x00 && iicprobe(0xa8) == 0x00)
+ name = "ds1624";
+ else if ((iicprobe(0xac) & 0x7e) == 0x0c)
+ name = "ds1631"; /* terrible probe */
+ else if ((iicprobe(0xac) & 0x7e) == 0x0e)
+ name = "ds1721"; /* terrible probe */
}
if (name == NULL) {
name = amd1032cloneprobe(addr);