--- //depot/vendor/freebsd/src/sys/arm/at91/at91_twi.c 2008/05/28 14:39:08 +++ //depot/user/jhb/acpipci/arm/at91/at91_twi.c 2008/07/25 19:57:25 @@ -155,6 +155,8 @@ if (sc->iicbus && (rv = device_delete_child(dev, sc->iicbus)) != 0) return (rv); + AT91_TWI_LOCK_DESTROY(sc); + return (0); } @@ -211,6 +213,7 @@ status = RD4(sc, TWI_SR); if (status == 0) return; + AT91_TWI_LOCK(sc); sc->flags |= status & (TWI_SR_OVRE | TWI_SR_UNRE | TWI_SR_NACK); if (status & TWI_SR_RXRDY) sc->flags |= TWI_SR_RXRDY; @@ -220,6 +223,7 @@ sc->flags |= TWI_SR_TXCOMP; WR4(sc, TWI_IDR, status); wakeup(sc); + AT91_TWI_UNLOCK(sc); return; } @@ -230,6 +234,7 @@ int counter = 100000; uint32_t sr; + AT91_TWI_ASSERT_LOCKED(sc); while (!((sr = RD4(sc, TWI_SR)) & bit) && counter-- > 0 && !(sr & TWI_SR_NACK)) continue; @@ -247,6 +252,7 @@ int clk; sc = device_get_softc(dev); + AT91_TWI_LOCK(sc); if (oldaddr) *oldaddr = sc->twi_addr; sc->twi_addr = addr; @@ -275,6 +281,7 @@ WR4(sc, TWI_CR, TWI_CR_MSEN | TWI_CR_SVDIS); WR4(sc, TWI_CWGR, sc->cwgr); printf("setting cwgr to %#x\n", sc->cwgr); + AT91_TWI_UNLOCK(sc); return 0; } --- //depot/vendor/freebsd/src/sys/arm/xscale/ixp425/ixp425_iic.c 2008/03/03 06:43:30 +++ //depot/user/jhb/acpipci/arm/xscale/ixp425/ixp425_iic.c 2008/07/25 19:57:25 @@ -106,9 +106,11 @@ struct ixpiic_softc *sc = ixpiic_sc; uint32_t reg; + mtx_lock(&Giant); GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SCL_BIT); reg = GPIO_CONF_READ_4(sc, IXP425_GPIO_GPINR); + mtx_unlock(&Giant); return (reg & GPIO_I2C_SCL_BIT); } @@ -118,9 +120,11 @@ struct ixpiic_softc *sc = ixpiic_sc; uint32_t reg; + mtx_lock(&Giant); GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SDA_BIT); reg = GPIO_CONF_READ_4(sc, IXP425_GPIO_GPINR); + mtx_unlock(&Giant); return (reg & GPIO_I2C_SDA_BIT); } @@ -129,11 +133,13 @@ { struct ixpiic_softc *sc = ixpiic_sc; + mtx_lock(&Giant); GPIO_CONF_CLR(sc, IXP425_GPIO_GPOUTR, GPIO_I2C_SDA_BIT); if (val) GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SDA_BIT); else GPIO_CONF_CLR(sc, IXP425_GPIO_GPOER, GPIO_I2C_SDA_BIT); + mtx_unlock(&Giant); DELAY(I2C_DELAY); } @@ -142,11 +148,13 @@ { struct ixpiic_softc *sc = ixpiic_sc; + mtx_lock(&Giant); GPIO_CONF_CLR(sc, IXP425_GPIO_GPOUTR, GPIO_I2C_SCL_BIT); if (val) GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SCL_BIT); else GPIO_CONF_CLR(sc, IXP425_GPIO_GPOER, GPIO_I2C_SCL_BIT); + mtx_unlock(&Giant); DELAY(I2C_DELAY); } @@ -184,3 +192,4 @@ static devclass_t ixpiic_devclass; DRIVER_MODULE(ixpiic, ixp, ixpiic_driver, ixpiic_devclass, 0, 0); +DRIVER_MODULE(iicbb, ixpiic, iicbb_driver, iicbb_devclass, 0, 0); --- //depot/vendor/freebsd/src/sys/dev/bktr/bktr_i2c.c 2008/06/06 18:46:29 +++ //depot/user/jhb/acpipci/dev/bktr/bktr_i2c.c 2008/07/25 19:57:25 @@ -356,6 +356,7 @@ return (0); } +DRIVER_MODULE(iicbb, bktr, iicbb_driver, iicbb_devclass, 0, 0); DRIVER_MODULE(smbus, bktr, smbus_driver, smbus_devclass, 0, 0); #endif /* defined(BKTR_USE_FREEBSD_SMBUS) */ --- //depot/vendor/freebsd/src/sys/dev/iicbus/ad7418.c 2006/11/19 23:43:36 +++ //depot/user/jhb/acpipci/dev/iicbus/ad7418.c 2008/06/26 13:56:40 @@ -32,11 +32,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include @@ -66,7 +66,7 @@ struct ad7418_softc { device_t sc_dev; - struct mtx sc_mtx; + struct sx sc_lock; int sc_curchan; /* current channel */ int sc_curtemp; int sc_curvolt; @@ -91,8 +91,10 @@ struct ad7418_softc *sc = arg1; int temp; + sx_xlock(&sc->sc_lock); ad7418_update(sc); temp = (sc->sc_curtemp / 64) * 25; + sx_xunlock(&sc->sc_lock); return sysctl_handle_int(oidp, &temp, 0, req); } @@ -102,8 +104,10 @@ struct ad7418_softc *sc = arg1; int volt; + sx_xlock(&sc->sc_lock); ad7418_update(sc); volt = (sc->sc_curvolt >> 6) * 564 / 10; + sx_xunlock(&sc->sc_lock); return sysctl_handle_int(oidp, &volt, 0, req); } @@ -116,7 +120,7 @@ int conf; sc->sc_dev = dev; - mtx_init(&sc->sc_mtx, "ad7418", "ad7418", MTX_DEF); + sx_init(&sc->sc_mtx, "ad7418"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD, sc, 0, @@ -170,13 +174,10 @@ /* * NB: Linux driver delays here but chip data sheet * says nothing and things appear to work fine w/o - * a delay on channel change. If this is enabled - * be sure to account for losing the mutex below - * in ad7418_update. + * a delay on channel change. */ - mtx_assert(&sc->sc_mtx, MA_OWNED); /* let channel change settle, 1 tick should be 'nuf (need ~1ms) */ - msleep(sc, &sc->sc_mtx, 0, "ad7418", 1); + tsleep(sc, 0, "ad7418", hz/1000); #endif } @@ -199,7 +200,7 @@ { int v; - mtx_lock(&sc->sc_mtx); + sx_assert(&sc->sc_lock, SA_XLOCKED); /* NB: no point in updating any faster than the chip */ if (ticks - sc->sc_lastupdate > hz) { ad7418_set_channel(sc, AD7418_CHAN_TEMP); @@ -212,7 +213,6 @@ sc->sc_curvolt = v; sc->sc_lastupdate = ticks; } - mtx_unlock(&sc->sc_mtx); } static device_method_t ad7418_methods[] = { --- //depot/vendor/freebsd/src/sys/dev/iicbus/icee.c 2007/04/17 05:52:25 +++ //depot/user/jhb/acpipci/dev/iicbus/icee.c 2008/06/26 13:56:40 @@ -33,8 +33,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -48,24 +48,21 @@ struct icee_softc { device_t sc_dev; /* Myself */ - struct mtx sc_mtx; /* basically a perimeter lock */ + struct sx sc_lock; /* basically a perimeter lock */ struct cdev *cdev; /* user interface */ int addr; - int flags; -#define OPENED 1 int size; /* How big am I? */ int type; /* What type 8 or 16 bit? */ int rd_sz; /* What's the read page size */ int wr_sz; /* What's the write page size */ }; -#define ICEE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define ICEE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define ICEE_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), "icee", MTX_DEF) -#define ICEE_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define ICEE_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define ICEE_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define ICEE_LOCK(_sc) sx_xlock(&(_sc)->sc_lock) +#define ICEE_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_lock) +#define ICEE_LOCK_INIT(_sc) sx_init(&_sc->sc_lock, "icee") +#define ICEE_LOCK_DESTROY(_sc) sx_destroy(&_sc->sc_lock); +#define ICEE_ASSERT_LOCKED(_sc) sx_assert(&_sc->sc_lock, SA_XLOCKED); +#define ICEE_ASSERT_UNLOCKED(_sc) sx_assert(&_sc->sc_lock, SA_UNLOCKED); #define CDEV2SOFTC(dev) ((dev)->si_drv1) /* cdev routines */ @@ -77,6 +74,7 @@ static struct cdevsw icee_cdevsw = { .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, .d_open = icee_open, .d_close = icee_close, .d_read = icee_read, @@ -127,26 +125,14 @@ static int icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - struct icee_softc *sc; - sc = CDEV2SOFTC(dev); - ICEE_LOCK(sc); - if (!(sc->flags & OPENED)) { - sc->flags |= OPENED; - } - ICEE_UNLOCK(sc); return (0); } static int icee_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { - struct icee_softc *sc; - sc = CDEV2SOFTC(dev); - ICEE_LOCK(sc); - sc->flags &= ~OPENED; - ICEE_UNLOCK(sc); return (0); } --- //depot/vendor/freebsd/src/sys/dev/iicbus/iic.c 2007/03/23 23:12:47 +++ //depot/user/jhb/acpipci/dev/iicbus/iic.c 2008/07/23 14:42:36 @@ -27,14 +27,16 @@ * */ #include +#include +#include +#include +#include #include -#include #include #include -#include -#include +#include +#include #include -#include #include #include @@ -46,6 +48,7 @@ struct iic_softc { + device_t sc_dev; u_char sc_addr; /* 7 bit address on iicbus */ int sc_count; /* >0 if device opened */ @@ -53,14 +56,12 @@ char sc_inbuf[BUFSIZE]; /* input buffer */ struct cdev *sc_devnode; + struct sx sc_lock; }; -#define IIC_SOFTC(unit) \ - ((struct iic_softc *)devclass_get_softc(iic_devclass, (unit))) +#define IIC_LOCK(sc) sx_xlock(&(sc)->sc_lock) +#define IIC_UNLOCK(sc) sx_xunlock(&(sc)->sc_lock) -#define IIC_DEVICE(unit) \ - (devclass_get_device(iic_devclass, (unit))) - static int iic_probe(device_t); static int iic_attach(device_t); static int iic_detach(device_t); @@ -95,7 +96,7 @@ static struct cdevsw iic_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_TRACKCLOSE, .d_open = iicopen, .d_close = iicclose, .d_read = iicread, @@ -107,7 +108,9 @@ static void iic_identify(driver_t *driver, device_t parent) { - BUS_ADD_CHILD(parent, 0, "iic", -1); + + if (device_find_child(parent, "iic", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "iic", -1); } static int @@ -122,9 +125,18 @@ { struct iic_softc *sc = (struct iic_softc *)device_get_softc(dev); + sc->sc_dev = dev; + sx_init(&sc->sc_lock, "iic"); sc->sc_devnode = make_dev(&iic_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "iic%d", device_get_unit(dev)); + if (sc->sc_devnode == NULL) { + device_printf(dev, "failed to create character device\n"); + sx_destroy(&sc->sc_lock); + return (ENXIO); + } + sc->sc_devnode->si_drv1 = sc; + return (0); } @@ -135,6 +147,7 @@ if (sc->sc_devnode) destroy_dev(sc->sc_devnode); + sx_destroy(&sc->sc_lock); return (0); } @@ -142,15 +155,16 @@ static int iicopen(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct iic_softc *sc = IIC_SOFTC(minor(dev)); + struct iic_softc *sc = dev->si_drv1; - if (!sc) - return (EINVAL); - - if (sc->sc_count > 0) + IIC_LOCK(sc); + if (sc->sc_count > 0) { + IIC_UNLOCK(sc); return (EBUSY); + } sc->sc_count++; + IIC_UNLOCK(sc); return (0); } @@ -158,18 +172,20 @@ static int iicclose(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct iic_softc *sc = IIC_SOFTC(minor(dev)); + struct iic_softc *sc = dev->si_drv1; - if (!sc) + IIC_LOCK(sc); + if (!sc->sc_count) { + /* XXX: I don't think this can happen. */ + IIC_UNLOCK(sc); return (EINVAL); + } - if (!sc->sc_count) - return (EINVAL); - sc->sc_count--; if (sc->sc_count < 0) panic("%s: iic_count < 0!", __func__); + IIC_UNLOCK(sc); return (0); } @@ -177,18 +193,28 @@ static int iicwrite(struct cdev *dev, struct uio * uio, int ioflag) { - device_t iicdev = IIC_DEVICE(minor(dev)); - struct iic_softc *sc = IIC_SOFTC(minor(dev)); + struct iic_softc *sc = dev->si_drv1; + device_t iicdev = sc->sc_dev; int sent, error, count; - if (!sc || !iicdev || !sc->sc_addr) + IIC_LOCK(sc); + if (!sc->sc_addr) { + IIC_UNLOCK(sc); return (EINVAL); + } - if (sc->sc_count == 0) + if (sc->sc_count == 0) { + /* XXX: I don't think this can happen. */ + IIC_UNLOCK(sc); return (EINVAL); + } - if ((error = iicbus_request_bus(device_get_parent(iicdev), iicdev, IIC_DONTWAIT))) + error = iicbus_request_bus(device_get_parent(iicdev), iicdev, + IIC_DONTWAIT); + if (error) { + IIC_UNLOCK(sc); return (error); + } count = min(uio->uio_resid, BUFSIZE); uiomove(sc->sc_buffer, count, uio); @@ -197,47 +223,63 @@ sc->sc_buffer, count, &sent); iicbus_release_bus(device_get_parent(iicdev), iicdev); + IIC_UNLOCK(sc); - return(error); + return (error); } static int iicread(struct cdev *dev, struct uio * uio, int ioflag) { - device_t iicdev = IIC_DEVICE(minor(dev)); - struct iic_softc *sc = IIC_SOFTC(minor(dev)); + struct iic_softc *sc = dev->si_drv1; + device_t iicdev = sc->sc_dev; int len, error = 0; int bufsize; - if (!sc || !iicdev || !sc->sc_addr) + IIC_LOCK(sc); + if (!sc->sc_addr) { + IIC_UNLOCK(sc); return (EINVAL); + } - if (sc->sc_count == 0) + if (sc->sc_count == 0) { + /* XXX: I don't think this can happen. */ + IIC_UNLOCK(sc); return (EINVAL); + } - if ((error = iicbus_request_bus(device_get_parent(iicdev), iicdev, IIC_DONTWAIT))) + error = iicbus_request_bus(device_get_parent(iicdev), iicdev, + IIC_DONTWAIT); + if (error) { + IIC_UNLOCK(sc); return (error); + } /* max amount of data to read */ len = min(uio->uio_resid, BUFSIZE); - if ((error = iicbus_block_read(device_get_parent(iicdev), sc->sc_addr, - sc->sc_inbuf, len, &bufsize))) + error = iicbus_block_read(device_get_parent(iicdev), sc->sc_addr, + sc->sc_inbuf, len, &bufsize); + if (error) { + IIC_UNLOCK(sc); return (error); + } if (bufsize > uio->uio_resid) panic("%s: too much data read!", __func__); iicbus_release_bus(device_get_parent(iicdev), iicdev); - return (uiomove(sc->sc_inbuf, bufsize, uio)); + error = uiomove(sc->sc_inbuf, bufsize, uio); + IIC_UNLOCK(sc); + return (error); } static int iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { - device_t iicdev = IIC_DEVICE(minor(dev)); - struct iic_softc *sc = IIC_SOFTC(minor(dev)); + struct iic_softc *sc = dev->si_drv1; + device_t iicdev = sc->sc_dev; device_t parent = device_get_parent(iicdev); struct iiccmd *s = (struct iiccmd *)data; struct iic_rdwr_data *d = (struct iic_rdwr_data *)data; @@ -246,15 +288,13 @@ char *buf = NULL; void **usrbufs = NULL; - if (!sc) - return (EINVAL); - if ((error = iicbus_request_bus(parent, iicdev, (flags & O_NONBLOCK) ? IIC_DONTWAIT : (IIC_WAIT | IIC_INTR)))) return (error); switch (cmd) { case I2CSTART: + IIC_LOCK(sc); error = iicbus_start(parent, s->slave, 0); /* @@ -264,6 +304,7 @@ */ if (!error) sc->sc_addr = s->slave; + IIC_UNLOCK(sc); break; --- //depot/vendor/freebsd/src/sys/dev/iicbus/iicbb.c 2007/03/23 23:06:42 +++ //depot/user/jhb/acpipci/dev/iicbus/iicbb.c 2008/07/25 19:57:25 @@ -413,16 +413,7 @@ return (0); } -/* - * XXX This is lame. We need to have a base iicbb_bridge class that all these - * XXX derive from. - */ -DRIVER_MODULE(iicbb, bktr, iicbb_driver, iicbb_devclass, 0, 0); -DRIVER_MODULE(iicbb, ixpiic, iicbb_driver, iicbb_devclass, 0, 0); -DRIVER_MODULE(iicbb, lpbb, iicbb_driver, iicbb_devclass, 0, 0); -DRIVER_MODULE(iicbb, viapm, iicbb_driver, iicbb_devclass, 0, 0); -DRIVER_MODULE(iicbb, cxm_iic, iicbb_driver, iicbb_devclass, 0, 0); -DRIVER_MODULE(iicbb, at91_bbiic, iicbb_driver, iicbb_devclass, 0, 0); +DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(iicbb, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); MODULE_VERSION(iicbb, IICBB_MODVER); --- //depot/vendor/freebsd/src/sys/dev/iicbus/iicbus.c 2007/03/23 23:12:47 +++ //depot/user/jhb/acpipci/dev/iicbus/iicbus.c 2008/07/25 20:02:54 @@ -34,8 +34,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -90,6 +92,7 @@ struct iicbus_softc *sc = IICBUS_SOFTC(dev); sc->dev = dev; + mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); iicbus_reset(dev, IIC_FASTEST, 0, NULL); /* device probing is meaningless since the bus is supposed to be @@ -108,13 +111,8 @@ } printf("\n"); #endif - /* Always attach the iicsmb children */ - BUS_ADD_CHILD(dev, 0, "iicsmb", -1); - /* attach any known device */ - BUS_ADD_CHILD(dev, 0, "iic", -1); - /* Attach the wired devices via hints */ + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); - /* Now probe and attach them */ bus_generic_attach(dev); return (0); } @@ -122,9 +120,11 @@ static int iicbus_detach(device_t dev) { + struct iicbus_softc *sc = IICBUS_SOFTC(dev); iicbus_reset(dev, IIC_FASTEST, 0, NULL); bus_generic_detach(dev); + mtx_destroy(&sc->lock); return (0); } @@ -265,6 +265,4 @@ devclass_t iicbus_devclass; -DRIVER_MODULE(iicbus, envctrl, iicbus_driver, iicbus_devclass, 0, 0); -DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0); MODULE_VERSION(iicbus, IICBUS_MODVER); --- //depot/vendor/freebsd/src/sys/dev/iicbus/iicbus.h 2007/03/23 23:06:42 +++ //depot/user/jhb/acpipci/dev/iicbus/iicbus.h 2008/07/23 14:42:36 @@ -29,6 +29,9 @@ #ifndef __IICBUS_H #define __IICBUS_H +#include +#include + #define IICBUS_IVAR(d) (struct iicbus_ivar *) device_get_ivars(d) #define IICBUS_SOFTC(d) (struct iicbus_softc *) device_get_softc(d) @@ -38,6 +41,7 @@ device_t owner; /* iicbus owner device structure */ u_char started; /* address of the 'started' slave * 0 if no start condition succeeded */ + struct mtx lock; }; struct iicbus_ivar @@ -50,15 +54,14 @@ }; #define IICBUS_ACCESSOR(A, B, T) \ -__inline static int \ -iicbus_get_ ## A(device_t dev, T *t) \ -{ \ - return BUS_READ_IVAR(device_get_parent(dev), dev, \ - IICBUS_IVAR_ ## B, (uintptr_t *) t); \ -} + __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) +#define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) +#define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) +#define IICBUS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) + extern int iicbus_generic_intr(device_t dev, int event, char *buf); extern driver_t iicbus_driver; --- //depot/vendor/freebsd/src/sys/dev/iicbus/iiconf.c 2007/03/23 23:06:42 +++ //depot/user/jhb/acpipci/dev/iicbus/iiconf.c 2008/07/23 14:42:36 @@ -29,8 +29,10 @@ #include #include +#include #include #include +#include #include #include @@ -57,13 +59,14 @@ { int error; + IICBUS_ASSERT_LOCKED(sc); switch (how) { - case (IIC_WAIT | IIC_INTR): - error = tsleep(sc, IICPRI|PCATCH, "iicreq", 0); + case IIC_WAIT | IIC_INTR: + error = mtx_sleep(sc, &sc->lock, IICPRI|PCATCH, "iicreq", 0); break; - case (IIC_WAIT | IIC_NOINTR): - error = tsleep(sc, IICPRI, "iicreq", 0); + case IIC_WAIT | IIC_NOINTR: + error = mtx_sleep(sc, &sc->lock, IICPRI, "iicreq", 0); break; default: @@ -85,9 +88,10 @@ iicbus_request_bus(device_t bus, device_t dev, int how) { struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); - int s, error = 0; + int error = 0; /* first, ask the underlying layers if the request is ok */ + IICBUS_LOCK(sc); do { error = IICBUS_CALLBACK(device_get_parent(bus), IIC_REQUEST_BUS, (caddr_t)&how); @@ -96,15 +100,13 @@ } while (error == EWOULDBLOCK); while (!error) { - s = splhigh(); if (sc->owner && sc->owner != dev) { - splx(s); error = iicbus_poll(sc, how); } else { sc->owner = dev; - splx(s); + IICBUS_UNLOCK(sc); return (0); } @@ -113,6 +115,7 @@ IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, (caddr_t)&how); } + IICBUS_UNLOCK(sc); return (error); } @@ -126,7 +129,7 @@ iicbus_release_bus(device_t bus, device_t dev) { struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); - int s, error; + int error; /* first, ask the underlying layers if the release is ok */ error = IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL); @@ -134,17 +137,18 @@ if (error) return (error); - s = splhigh(); + IICBUS_LOCK(sc); + if (sc->owner != dev) { - splx(s); + IICBUS_UNLOCK(sc); return (EACCES); } - sc->owner = 0; - splx(s); + sc->owner = NULL; /* wakeup waiting processes */ wakeup(sc); + IICBUS_UNLOCK(sc); return (0); } @@ -334,7 +338,7 @@ } /* - * iicbus_trasnfer() + * iicbus_transfer() * * Do an aribtrary number of transfers on the iicbus. We pass these * raw requests to the bridge driver. If the bridge driver supports @@ -364,7 +368,7 @@ device_get_children(dev, &children, &nkid); if (nkid != 1) - return EIO; + return (EIO); bus = children[0]; free(children, M_TEMP); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { --- //depot/vendor/freebsd/src/sys/dev/iicbus/iicsmb.c 2008/06/06 18:46:29 +++ //depot/user/jhb/acpipci/dev/iicbus/iicsmb.c 2008/07/25 19:57:25 @@ -75,6 +75,7 @@ char low; /* low byte received first */ char high; /* high byte */ + struct mtx lock; device_t smbus; }; @@ -139,7 +140,9 @@ static void iicsmb_identify(driver_t *driver, device_t parent) { - BUS_ADD_CHILD(parent, 0, "iicsmb", -1); + + if (device_find_child(parent, "iicsmb", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "iicsmb", -1); } static int @@ -154,6 +157,8 @@ { struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); + mtx_init(&sc->lock, "iicsmb", NULL, MTX_DEF); + sc->smbus = device_add_child(dev, "smbus", -1); /* probe and attach the smbus */ @@ -171,6 +176,7 @@ if (sc->smbus) { device_delete_child(dev, sc->smbus); } + mtx_destroy(&sc->lock); return (0); } @@ -185,6 +191,7 @@ { struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); + mtx_lock(&sc->lock); switch (event) { case INTR_GENERAL: case INTR_START: @@ -243,6 +250,7 @@ default: panic("%s: unknown event (%d)!", __func__, event); } + mtx_unlock(&sc->lock); return; } @@ -258,16 +266,12 @@ case SMB_REQUEST_BUS: /* request underlying iicbus */ how = *(int *)data; - mtx_lock(&Giant); error = iicbus_request_bus(parent, dev, how); - mtx_unlock(&Giant); break; case SMB_RELEASE_BUS: /* release underlying iicbus */ - mtx_lock(&Giant); error = iicbus_release_bus(parent, dev); - mtx_unlock(&Giant); break; default: @@ -283,7 +287,6 @@ device_t parent = device_get_parent(dev); int error; - mtx_lock(&Giant); switch (how) { case SMB_QWRITE: error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); @@ -300,7 +303,6 @@ if (!error) error = iicbus_stop(parent); - mtx_unlock(&Giant); return (error); } @@ -311,7 +313,6 @@ device_t parent = device_get_parent(dev); int error, sent; - mtx_lock(&Giant); error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT); if (!error) { @@ -319,7 +320,6 @@ iicbus_stop(parent); } - mtx_unlock(&Giant); return (error); } @@ -330,7 +330,6 @@ device_t parent = device_get_parent(dev); int error, read; - mtx_lock(&Giant); error = iicbus_start(parent, slave | LSB, 0); if (!error) { @@ -338,7 +337,6 @@ iicbus_stop(parent); } - mtx_unlock(&Giant); return (error); } @@ -349,7 +347,6 @@ device_t parent = device_get_parent(dev); int error, sent; - mtx_lock(&Giant); error = iicbus_start(parent, slave & ~LSB, 0); if (!error) { @@ -358,7 +355,6 @@ iicbus_stop(parent); } - mtx_unlock(&Giant); return (error); } @@ -372,7 +368,6 @@ char low = (char)(word & 0xff); char high = (char)((word & 0xff00) >> 8); - mtx_lock(&Giant); error = iicbus_start(parent, slave & ~LSB, 0); if (!error) { @@ -382,7 +377,6 @@ iicbus_stop(parent); } - mtx_unlock(&Giant); return (error); } @@ -393,11 +387,8 @@ device_t parent = device_get_parent(dev); int error, sent, read; - mtx_lock(&Giant); - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) { - mtx_unlock(&Giant); + if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) return (error); - } if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) goto error; @@ -410,7 +401,6 @@ error: iicbus_stop(parent); - mtx_unlock(&Giant); return (error); } @@ -424,11 +414,8 @@ int error, sent, read; char buf[2]; - mtx_lock(&Giant); - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) { - mtx_unlock(&Giant); + if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) return (error); - } if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) goto error; @@ -444,7 +431,6 @@ error: iicbus_stop(parent); - mtx_unlock(&Giant); return (error); } @@ -455,11 +441,8 @@ int error, sent, read; char buf[2]; - mtx_lock(&Giant); - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) { - mtx_unlock(&Giant); + if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) return (error); - } if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) goto error; @@ -482,7 +465,6 @@ error: iicbus_stop(parent); - mtx_unlock(&Giant); return (error); } @@ -492,7 +474,6 @@ device_t parent = device_get_parent(dev); int error, sent; - mtx_lock(&Giant); if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) goto error; @@ -506,7 +487,6 @@ goto error; error: - mtx_unlock(&Giant); return (error); } @@ -516,11 +496,8 @@ device_t parent = device_get_parent(dev); int error, sent, read; - mtx_lock(&Giant); - if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) { - mtx_unlock(&Giant); + if ((error = iicbus_start(parent, slave & ~LSB, IICBUS_TIMEOUT))) return (error); - } if ((error = iicbus_write(parent, &cmd, 1, &sent, IICBUS_TIMEOUT))) goto error; @@ -535,7 +512,6 @@ error: iicbus_stop(parent); - mtx_unlock(&Giant); return (error); } --- //depot/vendor/freebsd/src/sys/dev/pcf/envctrl.c 2007/03/21 03:42:53 +++ //depot/user/jhb/acpipci/dev/pcf/envctrl.c 2008/07/25 20:02:54 @@ -37,13 +37,15 @@ */ #include -#include #include #include #include +#include #include #include +#include #include +#include #include #include @@ -107,7 +109,7 @@ int rv = ENXIO; sc = DEVTOSOFTC(dev); - bzero(sc, sizeof(struct pcf_softc)); + mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); /* IO port is mandatory */ sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -116,8 +118,6 @@ device_printf(dev, "cannot reserve I/O port range\n"); goto error; } - sc->bt_ioport = rman_get_bustag(sc->res_ioport); - sc->bh_ioport = rman_get_bushandle(sc->res_ioport); sc->pcf_flags = device_get_flags(dev); @@ -134,7 +134,7 @@ pcf_rst_card(dev, IIC_FASTEST, PCF_DEFAULT_ADDR, NULL); rv = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET /* | INTR_ENTROPY */, + INTR_TYPE_NET | INTR_MPSAFE /* | INTR_ENTROPY */, NULL, pcf_intr, sc, &sc->intr_cookie); if (rv) { device_printf(dev, "could not setup IRQ\n"); @@ -158,6 +158,7 @@ bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport); } + mtx_destroy(&sc->pcf_lock); return (rv); } @@ -181,10 +182,12 @@ } bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport); + mtx_destroy(&sc->pcf_lock); return (0); } DRIVER_MODULE(envctrl, ebus, envctrl_driver, envctrl_devclass, 0, 0); +DRIVER_MODULE(iicbus, envctrl, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(envctrl, iicbus, PCF_MINVER, PCF_PREFVER, PCF_MAXVER); MODULE_VERSION(envctrl, PCF_MODVER); --- //depot/vendor/freebsd/src/sys/dev/pcf/pcf.c 2004/05/31 14:26:18 +++ //depot/user/jhb/acpipci/dev/pcf/pcf.c 2008/07/25 19:57:36 @@ -29,10 +29,12 @@ __FBSDID("$FreeBSD: src/sys/dev/pcf/pcf.c,v 1.25 2004/05/31 14:24:21 nsouch Exp $"); #include -#include +#include +#include #include #include -#include +#include +#include #include #include @@ -48,16 +50,18 @@ static int pcf_wait_byte(struct pcf_softc *pcf); static int pcf_noack(struct pcf_softc *pcf, int timeout); +static void pcf_stop_locked(struct pcf_softc *pcf); /* * Polling mode for master operations wait for a new - * byte incomming or outgoing + * byte incoming or outgoing */ -int +static int pcf_wait_byte(struct pcf_softc *sc) { int counter = TIMEOUT; + PCF_ASSERT_LOCKED(sc); while (counter--) { if ((pcf_get_S1(sc) & PIN) == 0) @@ -71,11 +75,11 @@ return (IIC_ETIMEOUT); } -int -pcf_stop(device_t dev) +static void +pcf_stop_locked(struct pcf_softc *sc) { - struct pcf_softc *sc = DEVTOSOFTC(dev); + PCF_ASSERT_LOCKED(sc); #ifdef PCFDEBUG device_printf(dev, " >> stop\n"); #endif @@ -91,17 +95,15 @@ sc->pcf_started = 0; } - - return (0); } - -int +static int pcf_noack(struct pcf_softc *sc, int timeout) { int noack; int k = timeout/10; + PCF_ASSERT_LOCKED(sc); do { noack = pcf_get_S1(sc) & LRB; if (!noack) @@ -118,6 +120,7 @@ struct pcf_softc *sc = DEVTOSOFTC(dev); int error = 0; + PCF_LOCK(sc); #ifdef PCFDEBUG device_printf(dev, " >> repeated start for slave %#x\n", (unsigned)slave); @@ -142,10 +145,12 @@ goto error; } + PCF_UNLOCK(sc); return (0); error: - pcf_stop(dev); + pcf_stop_locked(sc); + PCF_UNLOCK(sc); return (error); } @@ -155,6 +160,7 @@ struct pcf_softc *sc = DEVTOSOFTC(dev); int error = 0; + PCF_LOCK(sc); #ifdef PCFDEBUG device_printf(dev, " >> start for slave %#x\n", (unsigned)slave); #endif @@ -162,6 +168,7 @@ #ifdef PCFDEBUG printf("pcf: busy!\n"); #endif + PCF_UNLOCK(sc); return (IIC_EBUSBSY); } @@ -187,13 +194,30 @@ goto error; } + PCF_UNLOCK(sc); return (0); error: - pcf_stop(dev); + pcf_stop_locked(sc); + PCF_UNLOCK(sc); return (error); } +int +pcf_stop(device_t dev) +{ + struct pcf_softc *sc = DEVTOSOFTC(dev); + +#ifdef PCFDEBUG + device_printf(dev, " >> stop\n"); +#endif + PCF_LOCK(sc); + pcf_stop_locked(sc); + PCF_UNLOCK(sc); + + return (0); +} + void pcf_intr(void *arg) { @@ -201,6 +225,7 @@ char data, status, addr; char error = 0; + PCF_LOCK(sc); status = pcf_get_S1(sc); if (status & PIN) { @@ -288,6 +313,7 @@ } } while ((pcf_get_S1(sc) & PIN) == 0); + PCF_UNLOCK(sc); return; @@ -296,6 +322,7 @@ pcf_set_S1(sc, PIN|ESO|ENI|ACK); sc->pcf_slave_mode = SLAVE_RECEIVER; + PCF_UNLOCK(sc); return; } @@ -305,6 +332,7 @@ { struct pcf_softc *sc = DEVTOSOFTC(dev); + PCF_LOCK(sc); if (oldaddr) *oldaddr = sc->pcf_addr; @@ -343,6 +371,7 @@ pcf_set_S1(sc, PIN|ESO|ENI|ACK); sc->pcf_slave_mode = SLAVE_RECEIVER; + PCF_UNLOCK(sc); return (0); } @@ -359,6 +388,7 @@ #endif bytes = 0; + PCF_LOCK(sc); while (len) { pcf_set_S0(sc, *buf++); @@ -379,6 +409,7 @@ error: *sent = bytes; + PCF_UNLOCK(sc); #ifdef PCFDEBUG device_printf(dev, " >> %d bytes written (%d)\n", bytes, error); @@ -399,6 +430,7 @@ device_printf(dev, " << reading %d bytes\n", len); #endif + PCF_LOCK(sc); /* trig the bus to get the first data byte in S0 */ if (len) { if (len == 1 && last) @@ -415,14 +447,14 @@ /* wait for trigged byte */ if ((error = pcf_wait_byte(sc))) { - pcf_stop(dev); + pcf_stop_locked(sc); goto error; } if (len == 1 && last) /* ok, last data byte already in S0, no I2C activity * on next pcf_get_S0() */ - pcf_stop(dev); + pcf_stop_locked(sc); else if (len == 2 && last) /* next trigged byte with no ack */ @@ -437,6 +469,7 @@ error: *read = bytes; + PCF_UNLOCK(sc); #ifdef PCFDEBUG device_printf(dev, " << %d bytes read (%d): %#x%s\n", bytes, error, --- //depot/vendor/freebsd/src/sys/dev/pcf/pcf_ebus.c 2007/03/21 03:42:53 +++ //depot/user/jhb/acpipci/dev/pcf/pcf_ebus.c 2008/07/25 19:57:36 @@ -64,11 +64,13 @@ */ #include -#include #include +#include #include #include +#include #include +#include #include #include @@ -142,7 +144,7 @@ uint64_t own_addr; sc = DEVTOSOFTC(dev); - bzero(sc, sizeof(struct pcf_softc)); + mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); /* get OFW node of the pcf */ if ((node = ofw_bus_get_node(dev)) <= 0) { @@ -157,8 +159,6 @@ device_printf(dev, "cannot reserve I/O port range\n"); goto error; } - sc->bt_ioport = rman_get_bustag(sc->res_ioport); - sc->bh_ioport = rman_get_bushandle(sc->res_ioport); sc->pcf_flags = device_get_flags(dev); @@ -219,6 +219,7 @@ bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport); } + mtx_destroy(&sc->pcf_lock); return (rv); } @@ -245,6 +246,7 @@ bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport); + mtx_destroy(&sc->pcf_lock); return (0); } --- //depot/vendor/freebsd/src/sys/dev/pcf/pcf_isa.c 2007/03/21 03:42:53 +++ //depot/user/jhb/acpipci/dev/pcf/pcf_isa.c 2008/07/25 19:57:36 @@ -36,11 +36,13 @@ */ #include -#include #include +#include #include #include +#include #include +#include #include #include @@ -126,7 +128,7 @@ int rv = ENXIO; sc = DEVTOSOFTC(dev); - bzero(sc, sizeof(struct pcf_softc)); + mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); /* IO port is mandatory */ sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, @@ -135,8 +137,6 @@ device_printf(dev, "cannot reserve I/O port range\n"); goto error; } - sc->bt_ioport = rman_get_bustag(sc->res_ioport); - sc->bh_ioport = rman_get_bushandle(sc->res_ioport); sc->pcf_flags = device_get_flags(dev); @@ -179,6 +179,7 @@ bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport, sc->res_ioport); } + mtx_destroy(&sc->pcf_lock); return (rv); } @@ -202,6 +203,7 @@ } bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport, sc->res_ioport); + mtx_destroy(&sc->pcf_lock); return (0); } --- //depot/vendor/freebsd/src/sys/dev/pcf/pcfvar.h 2004/08/11 21:20:40 +++ //depot/user/jhb/acpipci/dev/pcf/pcfvar.h 2008/07/25 19:57:36 @@ -27,6 +27,9 @@ * $FreeBSD: src/sys/dev/pcf/pcfvar.h,v 1.3 2004/08/11 21:19:31 marius Exp $ */ +#ifndef __PCFVAR_H__ +#define __PCFVAR_H__ + #define IO_PCFSIZE 2 #define TIMEOUT 9999 /* XXX */ @@ -63,19 +66,22 @@ int pcf_slave_mode; /* receiver or transmitter */ int pcf_started; /* 1 if start condition sent */ + struct mtx pcf_lock; device_t iicbus; /* the corresponding iicbus */ /* Resource handling stuff. */ struct resource *res_ioport; int rid_ioport; - bus_space_tag_t bt_ioport; - bus_space_handle_t bh_ioport; struct resource *res_irq; int rid_irq; void *intr_cookie; }; #define DEVTOSOFTC(dev) ((struct pcf_softc *)device_get_softc(dev)) +#define PCF_LOCK(sc) mtx_lock(&(sc)->pcf_lock) +#define PCF_UNLOCK(sc) mtx_unlock(&(sc)->pcf_lock) +#define PCF_ASSERT_LOCKED(sc) mtx_assert(&(sc)->pcf_lock, MA_OWNED) + /* * PCF8584 datasheet : when operate at 8 MHz or more, a minimun time of * 6 clocks cycles must be left between two consecutives access @@ -92,7 +98,7 @@ pcf_set_S0(struct pcf_softc *sc, int data) { - bus_space_write_1(sc->bt_ioport, sc->bh_ioport, 0, data); + bus_write_1(sc->res_ioport, 0, data); pcf_nops(); } @@ -100,7 +106,7 @@ pcf_set_S1(struct pcf_softc *sc, int data) { - bus_space_write_1(sc->bt_ioport, sc->bh_ioport, 1, data); + bus_write_1(sc->res_ioport, 1, data); pcf_nops(); } @@ -109,7 +115,7 @@ { char data; - data = bus_space_read_1(sc->bt_ioport, sc->bh_ioport, 0); + data = bus_read_1(sc->res_ioport, 0); pcf_nops(); return (data); @@ -120,7 +126,7 @@ { char data; - data = bus_space_read_1(sc->bt_ioport, sc->bh_ioport, 1); + data = bus_read_1(sc->res_ioport, 1); pcf_nops(); return (data); @@ -138,3 +144,5 @@ #define PCF_MINVER 1 #define PCF_MAXVER 1 #define PCF_PREFVER PCF_MODVER + +#endif /* !__PCFVAR_H__ */ --- //depot/vendor/freebsd/src/sys/dev/ppbus/lpbb.c 2005/12/21 10:56:38 +++ //depot/user/jhb/acpipci/dev/ppbus/lpbb.c 2008/07/25 19:57:25 @@ -36,10 +36,12 @@ */ #include +#include +#include #include +#include +#include #include -#include -#include #include @@ -101,12 +103,16 @@ case IIC_REQUEST_BUS: /* request the ppbus */ how = *(int *)data; + mtx_lock(&Giant); error = ppb_request_bus(ppbus, dev, how); + mtx_unlock(&Giant); break; case IIC_RELEASE_BUS: /* release the ppbus */ + mtx_lock(&Giant); error = ppb_release_bus(ppbus, dev); + mtx_unlock(&Giant); break; default: @@ -123,37 +129,56 @@ #define ALIM 0x20 #define I2CKEY 0x50 -static int lpbb_getscl(device_t dev) +static int +lpbb_getscl(device_t dev) { - return ((ppb_rstr(device_get_parent(dev)) & SCL_in) == SCL_in); + int rval; + + mtx_lock(&Giant); + rval = ((ppb_rstr(device_get_parent(dev)) & SCL_in) == SCL_in); + mtx_unlock(&Giant); + return (rval); } -static int lpbb_getsda(device_t dev) +static int +lpbb_getsda(device_t dev) { - return ((ppb_rstr(device_get_parent(dev)) & SDA_in) == SDA_in); + int rval; + + mtx_lock(&Giant); + rval = ((ppb_rstr(device_get_parent(dev)) & SDA_in) == SDA_in); + mtx_unlock(&Giant); + return (rval); } -static void lpbb_setsda(device_t dev, char val) +static void +lpbb_setsda(device_t dev, char val) { device_t ppbus = device_get_parent(dev); - if(val==0) + mtx_lock(&Giant); + if (val == 0) ppb_wdtr(ppbus, (u_char)SDA_out); else ppb_wdtr(ppbus, (u_char)~SDA_out); + mtx_unlock(&Giant); } -static void lpbb_setscl(device_t dev, unsigned char val) +static void +lpbb_setscl(device_t dev, unsigned char val) { device_t ppbus = device_get_parent(dev); - if(val==0) - ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus)&~SCL_out)); + mtx_lock(&Giant); + if (val == 0) + ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) & ~SCL_out)); else - ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus)|SCL_out)); + ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); + mtx_unlock(&Giant); } -static int lpbb_detect(device_t dev) +static int +lpbb_detect(device_t dev) { device_t ppbus = device_get_parent(dev); @@ -183,6 +208,7 @@ { device_t ppbus = device_get_parent(dev); + mtx_lock(&Giant); if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { device_printf(dev, "can't allocate ppbus\n"); return (0); @@ -193,6 +219,7 @@ lpbb_setscl(dev, 1); ppb_release_bus(ppbus, dev); + mtx_unlock(&Giant); return (IIC_ENOADDR); } @@ -226,6 +253,7 @@ }; DRIVER_MODULE(lpbb, ppbus, lpbb_driver, lpbb_devclass, 0, 0); +DRIVER_MODULE(iicbb, lpbb, iicbb_driver, iicbb_devclass, 0, 0); MODULE_DEPEND(lpbb, ppbus, 1, 1, 1); MODULE_DEPEND(lpbb, iicbb, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER); MODULE_VERSION(lpbb, 1); --- //depot/vendor/freebsd/src/sys/pci/viapm.c 2008/06/06 18:35:14 +++ //depot/user/jhb/acpipci/pci/viapm.c 2008/07/25 19:57:25 @@ -1002,6 +1002,7 @@ DRIVER_MODULE(viapm, pci, viapm_driver, viapm_devclass, 0, 0); DRIVER_MODULE(viapropm, pci, viapropm_driver, viapropm_devclass, 0, 0); +DRIVER_MODULE(iicbb, viapm, iicbb_driver, iicbb_devclass, 0, 0); DRIVER_MODULE(smbus, viapropm, smbus_driver, smbus_devclass, 0, 0); MODULE_DEPEND(viapm, pci, 1, 1, 1);