diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-12-29 16:08:04 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-12-29 16:08:04 +0000 |
commit | 6a96019bc1f06c0290e4f61281f4990d19fdd92d (patch) | |
tree | 0a90cb4403fcd53955a8585e507aa6166fc41217 /sys/dev | |
parent | d2d7733cdc56dcf927eab6b192d4ebc51c7bc74e (diff) |
Match a few more lm(4) Winbond and ASUS chips.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/i2c/i2c_scan.c | 40 | ||||
-rw-r--r-- | sys/dev/i2c/lm_i2c.c | 18 |
2 files changed, 53 insertions, 5 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c index 64bb2a9400d..f5f2e281630 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.36 2005/12/29 14:51:08 deraadt Exp $ */ +/* $OpenBSD: i2c_scan.c,v 1.37 2005/12/29 16:08:03 kettenis Exp $ */ /* * Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org> @@ -411,10 +411,44 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr) } else if (iicprobe(0x4f) == 0x5c && (iicprobe(0x4e) & 0x80)) { /* * We should toggle 0x4e bit 0x80, then re-read - * 0x4f to see if it is 0xa3 (for Winbond) + * 0x4f to see if it is 0xa3 (for Winbond). + */ + switch (iicprobe(0x58)) { + case 0x10: + name = "w83781d"; + break; + case 0x11: + name = "w83781d"; /* rev 2? */ + break; + case 0x21: + name = "w83627hf"; + break; + case 0x30: + name = "w83782d"; + break; + case 0x31: + name = "as99127f"; /* rev 2 */ + break; + case 0x40: + name = "w83783s"; + break; + case 0x71: + name = "w83791d"; + break; + case 0x72: + name = "w12345x"; /* unknown chip id */ + break; + case 0x7a: + name = "w83792d"; + break; + } + } else if (iicprobe(0x4f) == 0x12 && (iicprobe(0x4e) & 0x80)) { + /* + * We should toggle 0x4e bit 0x80, then re-read + * 0x4f to see if it is 0xc3 (for ASUS). */ if (iicprobe(0x58) == 0x31) - name = "as99127f"; + name = "as99127f"; /* rev 1 */ } else if (iicprobe(0x16) == 0x41 && ((iicprobe(0x17) & 0xf0) == 0x40) && (addr == 0x2c || addr == 0x2d || addr == 0x2e)) { name = "adm1026"; diff --git a/sys/dev/i2c/lm_i2c.c b/sys/dev/i2c/lm_i2c.c index 5ddfa4d39d1..289e853ae21 100644 --- a/sys/dev/i2c/lm_i2c.c +++ b/sys/dev/i2c/lm_i2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lm_i2c.c,v 1.3 2005/12/29 14:51:08 deraadt Exp $ */ +/* $OpenBSD: lm_i2c.c,v 1.4 2005/12/29 16:08:03 kettenis Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -46,7 +46,21 @@ lm_i2c_match(struct device *parent, void *match, void *aux) { struct i2c_attach_args *ia = aux; - if (strcmp(ia->ia_name, "as99127f") == 0) { + if (strcmp(ia->ia_name, "as99127f") == 0 || + strcmp(ia->ia_name, "w83783s") == 0 || + strcmp(ia->ia_name, "w83791d") == 0 || + strcmp(ia->ia_name, "w83792d") == 0 || + strcmp(ia->ia_name, "w12345x") == 0) { + return (1); + } + /* + * XXX These chips also have an ISA bus interface and are + * likely to attach twice. That's ok for now, but we should + * probably disable these. + */ + if (strcmp(ia->ia_name, "w83781d") == 0 || + strcmp(ia->ia_name, "w83782d") == 0 || + strcmp(ia->ia_name, "w83627hf") == 0) { return (1); } return (0); |