summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorConstantine A. Murenin <cnst@cvs.openbsd.org>2008-04-01 03:28:33 +0000
committerConstantine A. Murenin <cnst@cvs.openbsd.org>2008-04-01 03:28:33 +0000
commit34eb4f81d2e72fc60b339491bc0505ba75cba3bc (patch)
tree34733e5c691b03ce1606a014b1e909934721a1a3 /sys/dev/i2c
parent0b99a924137d3a35b72277143f20f55d7667e205 (diff)
match more versions of w83793g; whilst here, also ensure that the bank 0
registers are only tested if bank 0 is selected; 'looks ok' deraadt
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/i2c_scan.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index 181f785b914..fcb51e6a380 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.115 2008/04/01 01:10:49 deraadt Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.116 2008/04/01 03:28:32 cnst Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -785,10 +785,11 @@ iic_probe_sensor(struct device *self, u_int8_t addr)
iicprobe(0x4c) == 0xa3 && iicprobe(0x4d) == 0x5c) {
name = "w83l785ts-l";
} else if (addr >= 0x2c && addr <= 0x2f &&
- addr * 2 == iicprobe(0x0b) &&
- (iicprobe(0x0c) & 0x40) && !(iicprobe(0x0c) & 0x04) &&
+ ((iicprobe(0x00) & 0x07) != 0x0 ||
+ ((iicprobe(0x00) & 0x07) == 0x0 && addr * 2 == iicprobe(0x0b) &&
+ (iicprobe(0x0c) & 0x40) && !(iicprobe(0x0c) & 0x04))) &&
iicprobe(0x0e) == 0x7b &&
- (iicprobe(0x0f) == 0x11 || iicprobe(0x0f) == 0x12) &&
+ (iicprobe(0x0f) & 0xf0) == 0x10 &&
((iicprobe(0x0d) == 0x5c && (iicprobe(0x00) & 0x80)) ||
(iicprobe(0x0d) == 0xa3 && !(iicprobe(0x00) & 0x80)))) {
name = "w83793g";