Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a9c42cc authored by Tomoya MORINAGA's avatar Tomoya MORINAGA Committed by Ben Dooks
Browse files

i2c-eg20t : Support Combined R/W transfer mode



Currently, Combined R/W transfer mode is not supported.
This patch enables Combined R/W transfer mode.

Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 5c470f39
Loading
Loading
Loading
Loading
+20 −19
Original line number Original line Diff line number Diff line
@@ -673,7 +673,8 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
	/* transfer not completed */
	/* transfer not completed */
	adap->pch_i2c_xfer_in_progress = true;
	adap->pch_i2c_xfer_in_progress = true;


	pmsg = &msgs[0];
	for (i = 0; i < num; i++) {
		pmsg = &msgs[i];
		pmsg->flags |= adap->pch_buff_mode_en;
		pmsg->flags |= adap->pch_buff_mode_en;
		status = pmsg->flags;
		status = pmsg->flags;
		pch_dbg(adap,
		pch_dbg(adap,
@@ -684,15 +685,15 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
		/* calculate actual message length excluding
		/* calculate actual message length excluding
		 * the sub address fields */
		 * the sub address fields */
		msglen = (pmsg->len) - (subaddrlen + 1);
		msglen = (pmsg->len) - (subaddrlen + 1);
	if (status & (I2C_M_RD)) {

		pch_dbg(adap, "invoking pch_i2c_readbytes\n");
		if ((status & (I2C_M_RD)) != false) {
			ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num),
			ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num),
						(i == 0));
						(i == 0));
		} else {
		} else {
		pch_dbg(adap, "invoking pch_i2c_writebytes\n");
			ret = pch_i2c_writebytes(i2c_adap, pmsg, (i + 1 == num),
			ret = pch_i2c_writebytes(i2c_adap, pmsg, (i + 1 == num),
						 (i == 0));
						 (i == 0));
		}
		}
	}


	adap->pch_i2c_xfer_in_progress = false;	/* transfer completed */
	adap->pch_i2c_xfer_in_progress = false;	/* transfer completed */