/* Description: This function implements combined transactions. Combined transactions consist of combinations of reading and writing blocks of data. FROM THE SAME ADDRESS Each transfer (i.e. a read or a write) is separated by a repeated start condition.  */
static int iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg *pmsg)
/* Description: This function implements combined transactions. Combined transactions consist of combinations of reading and writing blocks of data. FROM THE SAME ADDRESS Each transfer (i.e. a read or a write) is separated by a repeated start condition.  */
static int iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg *pmsg)
{
	struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
	int rc;
	rc = iop3xx_i2c_send_target_addr(iop3xx_adap, pmsg);
	if (rc < 0) {
		return rc;
	}
	if ((pmsg->flags&I2C_M_RD)) {
		return iop3xx_i2c_readbytes(i2c_adap, pmsg->buf, pmsg->len);
	} else {
		return iop3xx_i2c_writebytes(i2c_adap, pmsg->buf, pmsg->len);
	}
}