/* i2c_isr_set_cleared: - wait until certain bits of the I2C status register are set and cleared */
static int i2c_isr_set_cleared(struct mv_i2c *base, unsigned long set_mask, unsigned long cleared_mask)
/* i2c_isr_set_cleared: - wait until certain bits of the I2C status register are set and cleared */
static int i2c_isr_set_cleared(struct mv_i2c *base, unsigned long set_mask, unsigned long cleared_mask)
{
	int timeout = 1000, isr;
	do {
		isr = readl(&base->isr);
		udelay(10);
		if (timeout-- < 0)
			return 0;
	} while (((isr & set_mask) != set_mask)
		|| ((isr & cleared_mask) != 0));
	return 1;
}