summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2006-01-29 17:29:31 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2006-01-29 17:29:31 +0000
commitffaecc25b227281d46a1db7e86e04e9174ba4017 (patch)
tree5002d2365e683d5d7423b459c529d5046d9e314b /sys/dev/i2c
parent8853b2988adaf32bd6f8bbbe4b4b5f27d93bcce6 (diff)
Disable iic whenever ipmi is enabled. This fixes boxes like Sun x4200 that
freak out when more than one device driver touch the i2c devices. Reported by: Srebrenko Sehic <ssehic at gmail dot com> ok kettenis@
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/i2c.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index d6549ae1f33..90efd50f0f6 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c.c,v 1.11 2006/01/01 20:52:25 deraadt Exp $ */
+/* $OpenBSD: i2c.c,v 1.12 2006/01/29 17:29:30 marco Exp $ */
/* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -48,6 +48,8 @@
#define IICCF_ADDR 0
#define IICCF_SIZE 1
+#include "ipmi.h"
+
struct iic_softc {
struct device sc_dev;
i2c_tag_t sc_tag;
@@ -115,6 +117,13 @@ iic_match(struct device *parent, void *arg, void *aux)
struct cfdata *cf = arg;
struct i2cbus_attach_args *iba = aux;
+#if NIPMI > 0
+ extern int ipmi_enabled;
+
+ if (ipmi_enabled)
+ return (0);
+#endif
+
/* Just make sure we're looking for i2c. */
return (strcmp(iba->iba_name, cf->cf_driver->cd_name) == 0);
}