static void iicbb_setscl(device_t dev, int val, int timeout) { int k = 0; IICBB_SETSCL(device_get_parent(dev), val); DELAY(IIC_DELAY); while (val && !I2C_GETSCL(dev) && k++ < timeout) { IICBB_SETSCL(device_get_parent(dev), val); DELAY(IIC_DELAY); } return; }
static void iicbb_setscl(device_t dev, int val, int timeout) { struct iicbb_softc *sc = device_get_softc(dev); int k = 0; IICBB_SETSCL(device_get_parent(dev), val); DELAY(sc->udelay); while (val && !I2C_GETSCL(dev) && k++ < timeout) { IICBB_SETSCL(device_get_parent(dev), val); DELAY(sc->udelay); } return; }