diff options
author | 2006-01-01 20:52:23 +0000 | |
---|---|---|
committer | 2006-01-01 20:52:23 +0000 | |
commit | a5a63700732a163222ba2d66b44531386ed788b2 (patch) | |
tree | 827b895b98c14af611f719e7f6b9b1437b01955b /sys/dev/i2c | |
parent | thread stack handling changes. Add guard zones and allow stack (diff) | |
download | wireguard-openbsd-a5a63700732a163222ba2d66b44531386ed788b2.tar.xz wireguard-openbsd-a5a63700732a163222ba2d66b44531386ed788b2.zip |
switch from macppc-specific maciic(4) driver to the generic iic(4),
after teaching it to use a function pointer to get back to the OFW
scan.. this will also help the sparc64 later; ok kettenis
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r-- | sys/dev/i2c/i2c.c | 10 | ||||
-rw-r--r-- | sys/dev/i2c/i2cvar.h | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c index 1b4c74cb4cf..d6549ae1f33 100644 --- a/sys/dev/i2c/i2c.c +++ b/sys/dev/i2c/i2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2c.c,v 1.10 2005/12/27 17:18:18 deraadt Exp $ */ +/* $OpenBSD: i2c.c,v 1.11 2006/01/01 20:52:25 deraadt Exp $ */ /* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */ /* @@ -73,7 +73,7 @@ iicbus_print(void *aux, const char *pnp) struct i2cbus_attach_args *iba = aux; if (pnp != NULL) - printf("\"%s\" at %s", iba->iba_name, pnp); + printf("%s at %s", iba->iba_name, pnp); return (UNCONF); } @@ -84,7 +84,7 @@ iic_print(void *aux, const char *pnp) struct i2c_attach_args *ia = aux; if (pnp != NULL) - printf("%s at %s", ia->ia_name, pnp); + printf("\"%s\" at %s", ia->ia_name, pnp); printf(" addr 0x%x", ia->ia_addr); return (UNCONF); @@ -138,6 +138,8 @@ iic_attach(struct device *parent, struct device *self, void *aux) /* * Scan for known device signatures. */ - if (iba->iba_scan) + if (iba->iba_bus_scan) + (iba->iba_bus_scan)(self, aux, iba->iba_bus_scan_arg); + else iic_scan(self, aux); } diff --git a/sys/dev/i2c/i2cvar.h b/sys/dev/i2c/i2cvar.h index c4e803cc6f5..0d463f1d945 100644 --- a/sys/dev/i2c/i2cvar.h +++ b/sys/dev/i2c/i2cvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i2cvar.h,v 1.8 2005/12/31 04:31:27 deraadt Exp $ */ +/* $OpenBSD: i2cvar.h,v 1.9 2006/01/01 20:52:25 deraadt Exp $ */ /* $NetBSD: i2cvar.h,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */ /* @@ -94,7 +94,9 @@ 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 */ + void (*iba_bus_scan)(struct device *, struct i2cbus_attach_args *, + void *); + void *iba_bus_scan_arg; }; /* Used to attach devices on the i2c bus. */ |