summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-12-30 09:45:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-12-30 09:45:21 +0000
commit3c7d2c5ea9fed6b853b86213255356dcfeaa2a46 (patch)
tree78164bfe3071990412f4c6efdbbd1320a57901a4 /sys
parent2ef6b179a49244ff48f356625bf6d7344cbc0280 (diff)
Initial W83791D support for lm(4).
ok krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/i2c_scan.c13
-rw-r--r--sys/dev/i2c/lm_i2c.c5
-rw-r--r--sys/dev/ic/nslm7x.c6
-rw-r--r--sys/dev/ic/nslm7xvar.h4
4 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c
index 7d81340a3cb..0ed2878e12d 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.38 2005/12/30 04:05:30 deraadt Exp $ */
+/* $OpenBSD: i2c_scan.c,v 1.39 2005/12/30 09:45:20 kettenis Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org>
@@ -410,18 +410,17 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
addr == 0x4c || addr == 0x4d || addr == 0x4e)) {
name = "adm1021"; /* lots of addresses... bleah */
skip_fc = 1;
- } else if (iicprobe(0x4f) == 0x5c && (iicprobe(0x4e) & 0x80)) {
+ } else if ((iicprobe(0x4f) == 0x5c && (iicprobe(0x4e) & 0x80)) ||
+ (iicprobe(0x4f) == 0xa3 && !(iicprobe(0x4e) & 0x80))) {
/*
* We should toggle 0x4e bit 0x80, then re-read
* 0x4f to see if it is 0xa3 (for Winbond).
*/
switch (iicprobe(0x58)) {
case 0x10:
+ case 0x11: /* rev 2? */
name = "w83781d";
break;
- case 0x11:
- name = "w83781d"; /* rev 2? */
- break;
case 0x21:
name = "w83627hf";
break;
@@ -435,11 +434,9 @@ iic_probe(struct device *self, struct i2cbus_attach_args *iba, u_int8_t addr)
name = "w83783s";
break;
case 0x71:
+ case 0x72: /* rev 2? */
name = "w83791d";
break;
- case 0x72:
- name = "w12345x"; /* unknown chip id */
- break;
case 0x7a:
name = "w83792d";
break;
diff --git a/sys/dev/i2c/lm_i2c.c b/sys/dev/i2c/lm_i2c.c
index 289e853ae21..548defc4971 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.4 2005/12/29 16:08:03 kettenis Exp $ */
+/* $OpenBSD: lm_i2c.c,v 1.5 2005/12/30 09:45:20 kettenis Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -49,8 +49,7 @@ lm_i2c_match(struct device *parent, void *match, void *aux)
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) {
+ strcmp(ia->ia_name, "w83792d") == 0) {
return (1);
}
/*
diff --git a/sys/dev/ic/nslm7x.c b/sys/dev/ic/nslm7x.c
index fcd50ac3052..b1b47640763 100644
--- a/sys/dev/ic/nslm7x.c
+++ b/sys/dev/ic/nslm7x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nslm7x.c,v 1.10 2005/12/25 10:23:27 kettenis Exp $ */
+/* $OpenBSD: nslm7x.c,v 1.11 2005/12/30 09:45:20 kettenis Exp $ */
/* $NetBSD: nslm7x.c,v 1.17 2002/11/15 14:55:41 ad Exp $ */
/*-
@@ -301,6 +301,10 @@ wb_match(struct lm_softc *sc)
case WB_CHIPID_83627THF:
printf(": W83627THF\n");
break;
+ case WB_CHIPID_83791:
+ case WB_CHIPID_83791_2:
+ printf(": W83791D\n");
+ break;
default:
printf(": unknown winbond chip ID 0x%x\n", j);
/* handle as a standart lm7x */
diff --git a/sys/dev/ic/nslm7xvar.h b/sys/dev/ic/nslm7xvar.h
index 4b055856294..705f130a1a8 100644
--- a/sys/dev/ic/nslm7xvar.h
+++ b/sys/dev/ic/nslm7xvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nslm7xvar.h,v 1.5 2005/12/25 10:23:27 kettenis Exp $ */
+/* $OpenBSD: nslm7xvar.h,v 1.6 2005/12/30 09:45:20 kettenis Exp $ */
/* $NetBSD: nslm7xvar.h,v 1.10 2002/11/15 14:55:42 ad Exp $ */
/*-
@@ -97,6 +97,8 @@
#define WB_CHIPID_83627 0x21
#define WB_CHIPID_83627THF 0x90
#define WB_CHIPID_83697 0x60
+#define WB_CHIPID_83791 0x71
+#define WB_CHIPID_83791_2 0x72
#define WB_BANK0_FANBAT 0x5D
/* Bank1 regs */
#define WB_BANK1_T2H 0x50