diff options
author | 2008-04-01 03:28:32 +0000 | |
---|---|---|
committer | 2008-04-01 03:28:32 +0000 | |
commit | 7c26d915c8917f3754301335aa9d94054aa21e3e (patch) | |
tree | 79b5eb14811b7b3ff4268404a18f9fce20a6ced3 /sys/dev/i2c | |
parent | Add some defines and remove some of the magic numbers from the code. (diff) | |
download | wireguard-openbsd-7c26d915c8917f3754301335aa9d94054aa21e3e.tar.xz wireguard-openbsd-7c26d915c8917f3754301335aa9d94054aa21e3e.zip |
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.c | 9 |
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"; |