FreeBSD/sys/dev/iicbus/twsi/twsi.c
/*
 * timeout given in us
 * returns
 *   0 on successful mask change
 *   non-zero on timeout
 */
timeout given in us
returns
0 on successful mask change
non-zero on timeout
timeout given in us returns 0 on successful mask change non - zero on timeout
static int
twsi_poll_ctrl(struct twsi_softc *sc, int timeout, uint32_t mask)
{
	timeout /= 10;
	while (!(TWSI_READ(sc, sc->reg_control) & mask)) {
		DELAY(10);
		if (--timeout < 0)
			return (timeout);
	}
	return (0);
}
static int twsi_poll_ctrl ( struct twsi_softc * sc , int timeout , uint32_t mask ) { timeout /= 10 ; while ( ! ( TWSI_READ ( sc , sc -> reg_control ) & mask ) ) { DELAY ( 10 ) ; if ( -- timeout < 0 ) return ( timeout ) ; } return ( 0 ) ; }
timeout given in us
 returns
   0 on successful mask change
   non-zero on timeout
timeout given in us returns 0 on successful mask change non - zero on timeout