]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/i2c/busses/i2c-cpm.c
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[karo-tx-linux.git] / drivers / i2c / busses / i2c-cpm.c
index eccf5c2d4a1218ee5a04d4fa9f43ad0c39f9aa80..2e1f7eb55bf4a6f6d525db8548928daa39cbd1f2 100644 (file)
@@ -338,6 +338,14 @@ static int cpm_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
        tptr = 0;
        rptr = 0;
 
+       /*
+        * If there was a collision in the last i2c transaction,
+        * Set I2COM_MASTER as it was cleared during collision.
+        */
+       if (in_be16(&tbdf->cbd_sc) & BD_SC_CL) {
+               out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);
+       }
+
        while (tptr < num) {
                pmsg = &msgs[tptr];
                dev_dbg(&adap->dev, "R: %d T: %d\n", rptr, tptr);