summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantine A. Murenin <cnst@cvs.openbsd.org>2008-03-27 05:46:10 +0000
committerConstantine A. Murenin <cnst@cvs.openbsd.org>2008-03-27 05:46:10 +0000
commitbe57b87783ac040fc3932dc22ddd3fdadc57fb1b (patch)
tree8e3241c007ea1c2b95687aeb93ff501e05e44255
parentec5829349d09e7c0da115de586ffd1209a70bbb2 (diff)
test the Vdd registers of Andigilog chips against the minimum voltage readings;
'good plan' deraadt; ok kettenis, mikeb
-rw-r--r--sys/dev/i2c/i2c_scan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index 76758e1ef5b..ce7cba81143 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.113 2008/03/19 21:01:10 cnst Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.114 2008/03/27 05:46:09 cnst Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -592,11 +592,13 @@ iic_probe_sensor(struct device *self, u_int8_t addr)
case 0x61: /* Andigilog */
if ((addr == 0x2c || addr == 0x2d || addr == 0x2e) &&
iicprobe(0x3f) == 0x69 &&
+ iicprobe(0x22) >= 0xaf && /* Vdd */
(iicprobe(0x09) & 0xbf) == 0x00 && iicprobe(0x0f) == 0x00 &&
(iicprobe(0x40) & 0xf0) == 0x00)
name = "asc7611";
else if ((addr == 0x2c || addr == 0x2d || addr == 0x2e) &&
- iicprobe(0x3f) == 0x6c)
+ iicprobe(0x3f) == 0x6c &&
+ iicprobe(0x22) >= 0xae) /* Vdd */
name = "asc7621";
break;
case 0xa1: /* Philips */