Lines Matching refs:msgs

478 					struct i2c_msg *msgs)
485 dma->dma_buf = dma_map_single(chan_dev, msgs->buf,
1153 struct i2c_msg *msgs)
1167 dma->dma_len = msgs->len - 1;
1168 result = i2c_imx_dma_xfer(i2c_imx, msgs);
1180 imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
1207 imx_i2c_write_reg(msgs->buf[msgs->len-1],
1217 struct i2c_msg *msgs, bool use_dma)
1223 imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
1241 if (msgs->len - 1)
1253 struct i2c_msg *msgs, bool is_lastmsg)
1264 result = i2c_imx_prepare_read(i2c_imx, msgs, true);
1274 dma->dma_len = msgs->len - 2;
1275 result = i2c_imx_dma_xfer(i2c_imx, msgs);
1309 msgs->buf[msgs->len-2] = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
1340 msgs->buf[msgs->len-1] = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
1346 struct i2c_msg *msgs)
1351 __func__, i2c_8bit_addr_from_msg(msgs));
1354 imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
1364 for (i = 0; i < msgs->len; i++) {
1367 __func__, i, msgs->buf[i]);
1368 imx_i2c_write_reg(msgs->buf[i], i2c_imx, IMX_I2C_I2DR);
1379 static int i2c_imx_write(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs)
1382 __func__, i2c_8bit_addr_from_msg(msgs));
1385 i2c_imx->msg = msgs;
1392 imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
1396 (msgs->len + 1) * HZ / 10);
1410 struct i2c_msg *msgs, bool is_lastmsg)
1414 int block_data = msgs->flags & I2C_M_RECV_LEN;
1416 result = i2c_imx_prepare_read(i2c_imx, msgs, false);
1423 for (i = 0; i < msgs->len; i++) {
1432 * msgs->len.
1441 msgs->len += len;
1443 if (i == (msgs->len - 1)) {
1470 } else if (i == (msgs->len - 2)) {
1478 msgs->buf[0] = len;
1480 msgs->buf[i] = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
1483 __func__, i, msgs->buf[i]);
1488 static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs,
1491 int block_data = msgs->flags & I2C_M_RECV_LEN;
1495 __func__, i2c_8bit_addr_from_msg(msgs));
1503 i2c_imx->msg = msgs;
1510 imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
1514 (msgs->len + 1) * HZ / 10);
1531 struct i2c_msg *msgs, int num, bool atomic)
1591 use_dma = i2c_imx->dma && msgs[i].len >= DMA_THRESHOLD &&
1592 msgs[i].flags & I2C_M_DMA_SAFE;
1593 if (msgs[i].flags & I2C_M_RD) {
1594 int block_data = msgs->flags & I2C_M_RECV_LEN;
1597 result = i2c_imx_atomic_read(i2c_imx, &msgs[i], is_lastmsg);
1599 result = i2c_imx_dma_read(i2c_imx, &msgs[i], is_lastmsg);
1601 result = i2c_imx_read(i2c_imx, &msgs[i], is_lastmsg);
1604 result = i2c_imx_atomic_write(i2c_imx, &msgs[i]);
1606 result = i2c_imx_dma_write(i2c_imx, &msgs[i]);
1608 result = i2c_imx_write(i2c_imx, &msgs[i]);
1629 struct i2c_msg *msgs, int num)
1638 result = i2c_imx_xfer_common(adapter, msgs, num, false);
1647 struct i2c_msg *msgs, int num)
1656 result = i2c_imx_xfer_common(adapter, msgs, num, true);