summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2005-12-20 05:42:33 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2005-12-20 05:42:33 +0000
commit9039a07b0e8eda34651f5dde950c2f6b36f53852 (patch)
treea87b1206a819132a36320bbd31dc9f79bf22e766
parentc226a1a5746a6ef88d5315d2c1060b2004d48c7d (diff)
Do bus scanning only if underlying controller asked for it.
-rw-r--r--sys/dev/i2c/i2c.c5
-rw-r--r--sys/dev/i2c/i2cvar.h3
-rw-r--r--sys/dev/pci/ichiic.c3
3 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index b10da67a8a7..1cb87375a11 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c.c,v 1.3 2005/12/19 19:36:46 grange Exp $ */
+/* $OpenBSD: i2c.c,v 1.4 2005/12/20 05:42:32 grange Exp $ */
/* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -137,5 +137,6 @@ iic_attach(struct device *parent, struct device *self, void *aux)
/*
* Scan for known device signatures.
*/
- iic_scan(self, aux);
+ if (iba->iba_scan)
+ iic_scan(self, aux);
}
diff --git a/sys/dev/i2c/i2cvar.h b/sys/dev/i2c/i2cvar.h
index cc2da79e84f..0081a2ae828 100644
--- a/sys/dev/i2c/i2cvar.h
+++ b/sys/dev/i2c/i2cvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2cvar.h,v 1.3 2005/12/19 19:36:46 grange Exp $ */
+/* $OpenBSD: i2cvar.h,v 1.4 2005/12/20 05:42:32 grange Exp $ */
/* $NetBSD: i2cvar.h,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -94,6 +94,7 @@ typedef struct i2c_controller {
struct i2cbus_attach_args {
const char *iba_name; /* bus name ("iic") */
i2c_tag_t iba_tag; /* the controller */
+ int iba_scan; /* do bus scanning */
};
/* Used to attach devices on the i2c bus. */
diff --git a/sys/dev/pci/ichiic.c b/sys/dev/pci/ichiic.c
index ffabf667087..a5421aa8814 100644
--- a/sys/dev/pci/ichiic.c
+++ b/sys/dev/pci/ichiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ichiic.c,v 1.1 2005/12/19 19:31:56 grange Exp $ */
+/* $OpenBSD: ichiic.c,v 1.2 2005/12/20 05:42:32 grange Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -151,6 +151,7 @@ ichiic_attach(struct device *parent, struct device *self, void *aux)
sc->sc_i2c_tag.ic_exec = ichiic_i2c_exec;
iba.iba_name = "iic";
iba.iba_tag = &sc->sc_i2c_tag;
+ iba.iba_scan = 1;
config_found(self, &iba, iicbus_print);
return;