Hi Sachin,

looks good to me.

Acked-By: Jochen Friedrich <joc...@scram.de>

Signed-off-by: Sachin Surendran <sachin.surend...@alliedtelesis.co.nz
<mailto:sachin.surend...@alliedtelesis.co.nz>>
---
  drivers/i2c/busses/i2c-cpm.c |    8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index c1e1096..bb94c6d 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -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);


Thanks, Jochen
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to