Lines Matching refs:msg
25 struct rt_i2c_msg *msg; member
51 struct rt_i2c_msg *msg) in wm_i2c_send_address() argument
55 if (msg->flags & RT_I2C_ADDR_10BIT) in wm_i2c_send_address()
57 addr_msb = 0xf0 | ((msg->addr >> 7) & 0x06); in wm_i2c_send_address()
58 addr_lsb = msg->addr & 0xff; in wm_i2c_send_address()
60 if (msg->flags & RT_I2C_RD) in wm_i2c_send_address()
71 tls_i2c_write_byte((msg->addr << 1) | msg->flags, 1); in wm_i2c_send_address()
87 wm_i2c->msg = msgs; in wm_i2c_mst_xfer()
94 if (!(wm_i2c->msg[i].flags & RT_I2C_NO_START)) in wm_i2c_mst_xfer()
96 wm_i2c_send_address(bus, &(wm_i2c->msg[i])); in wm_i2c_mst_xfer()
98 if (wm_i2c->msg[i].flags & RT_I2C_RD) in wm_i2c_mst_xfer()
100 while (wm_i2c->msg[i].len > 1) in wm_i2c_mst_xfer()
102 *wm_i2c->msg[i].buf++ = tls_i2c_read_byte(1, 0); in wm_i2c_mst_xfer()
103 wm_i2c->msg[i].len--; in wm_i2c_mst_xfer()
105 *wm_i2c->msg[i].buf = tls_i2c_read_byte(0, 0); in wm_i2c_mst_xfer()
109 while (wm_i2c->msg[i].len > 0) in wm_i2c_mst_xfer()
111 tls_i2c_write_byte(*wm_i2c->msg[i].buf, 0); in wm_i2c_mst_xfer()
113 wm_i2c->msg[i].len--; in wm_i2c_mst_xfer()
114 wm_i2c->msg[i].buf++; in wm_i2c_mst_xfer()
118 wm_i2c->msg = RT_NULL; in wm_i2c_mst_xfer()