i2c-mpc: Do not generate STOP after read.

The driver always ends a read with a STOP condition which
breaks subsequent I2C reads/writes in the same transaction as
these expect to do a repeated START(ReSTART).

This will also help I2C multimaster as the bus will not be released
after the first read, but when the whole transaction ends.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>

authored by Joakim Tjernlund and committed by Ben Dooks 45da790e db3a3d4e

+2 -8
+2 -8
drivers/i2c/busses/i2c-mpc.c
··· 365 365 unsigned timeout = i2c->adap.timeout; 366 366 u32 flags = restart ? CCR_RSTA : 0; 367 367 368 - /* Start with MEN */ 369 - if (!restart) 370 - writeccr(i2c, CCR_MEN); 371 368 /* Start as master */ 372 369 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags); 373 370 /* Write target byte */ ··· 393 396 int i, result; 394 397 u32 flags = restart ? CCR_RSTA : 0; 395 398 396 - /* Start with MEN */ 397 - if (!restart) 398 - writeccr(i2c, CCR_MEN); 399 399 /* Switch to read - restart */ 400 400 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags); 401 401 /* Write target address byte - this time with the read flag set */ ··· 419 425 /* Generate txack on next to last byte */ 420 426 if (i == length - 2) 421 427 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_TXAK); 422 - /* Generate stop on last byte */ 428 + /* Do not generate stop on last byte */ 423 429 if (i == length - 1) 424 - writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_TXAK); 430 + writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX); 425 431 data[i] = readb(i2c->base + MPC_I2C_DR); 426 432 } 427 433