i2c-imx: fix clear IFF race condition
During i2c read the original pattern was:

1. write i2c slave address
2. wait for transmit complete + clear IIF
3. wait for receive acknowledge
4. wait for IIF interrupt

Due to the clear of the I2SR register, the IIF flag was cleared, too. So
in step 4 the Interrupt wasn't detected. To fix this problem, we move
the clean of IIF before the writing of the slave address. So that it
looks this way:

0. clear IIF
1. write i2c slave address
2. wait for transmit complete
3. wait for receive acknowledge
4. wait for IIF interrupt

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 180a3a9 commit 90e3f0516d19c934d554f94561118fde405da6a1
@Marc Kleine-Budde Marc Kleine-Budde authored on 9 Dec 2009
Showing 1 changed file
View
drivers/i2c/i2c-imx.c