FreeBSD/sys/arm/freescale/vybrid/vf_i2c.c
/* Wait for transfer complete+interrupt flag */
Wait for transfer complete+interrupt flag
Wait for transfer complete + interrupt flag
static int
wait_for_icf(struct i2c_softc *sc)
{
	int retry;
	retry = 1000;
	while (retry --) {
		if (READ1(sc, I2C_IBSR) & IBSR_TCF) {
			if (READ1(sc, I2C_IBSR) & IBSR_IBIF) {
				WRITE1(sc, I2C_IBSR, IBSR_IBIF);
				return (IIC_NOERR);
			}
		}
		DELAY(10);
	}
	return (IIC_ETIMEOUT);
}
static int wait_for_icf ( struct i2c_softc * sc ) { int retry ; retry = 1000 ; while ( retry -- ) { if ( READ1 ( sc , I2C_IBSR ) & IBSR_TCF ) { if ( READ1 ( sc , I2C_IBSR ) & IBSR_IBIF ) { WRITE1 ( sc , I2C_IBSR , IBSR_IBIF ) ; return ( IIC_NOERR ) ; } } DELAY ( 10 ) ; } return ( IIC_ETIMEOUT ) ; }
Wait for transfer complete+interrupt flag
Wait for transfer complete + interrupt flag