Lines Matching refs:msg
236 static int fsi_i2c_start(struct fsi_i2c_port *port, struct i2c_msg *msg, in fsi_i2c_start() argument
244 if (msg->flags & I2C_M_RD) in fsi_i2c_start()
247 if (stop || msg->flags & I2C_M_STOP) in fsi_i2c_start()
250 cmd |= FIELD_PREP(I2C_CMD_ADDR, msg->addr); in fsi_i2c_start()
251 cmd |= FIELD_PREP(I2C_CMD_LEN, msg->len); in fsi_i2c_start()
266 static int fsi_i2c_write_fifo(struct fsi_i2c_port *port, struct i2c_msg *msg, in fsi_i2c_write_fifo() argument
273 int bytes_remaining = msg->len - port->xfrd; in fsi_i2c_write_fifo()
281 &msg->buf[port->xfrd], write); in fsi_i2c_write_fifo()
292 static int fsi_i2c_read_fifo(struct fsi_i2c_port *port, struct i2c_msg *msg, in fsi_i2c_read_fifo() argument
299 int xfr_remaining = msg->len - port->xfrd; in fsi_i2c_read_fifo()
309 &msg->buf[port->xfrd], read); in fsi_i2c_read_fifo()
526 struct i2c_msg *msg, u32 status) in fsi_i2c_handle_status() argument
558 if (msg->flags & I2C_M_RD) in fsi_i2c_handle_status()
559 return fsi_i2c_read_fifo(port, msg, fifo_count); in fsi_i2c_handle_status()
561 return fsi_i2c_write_fifo(port, msg, fifo_count); in fsi_i2c_handle_status()
565 if (port->xfrd < msg->len) in fsi_i2c_handle_status()
568 return msg->len; in fsi_i2c_handle_status()
574 static int fsi_i2c_wait(struct fsi_i2c_port *port, struct i2c_msg *msg, in fsi_i2c_wait() argument
588 rc = fsi_i2c_handle_status(port, msg, status); in fsi_i2c_wait()
593 if (rc == msg->len) in fsi_i2c_wait()
613 struct i2c_msg *msg; in fsi_i2c_xfer() local
622 msg = msgs + i; in fsi_i2c_xfer()
625 rc = fsi_i2c_start(port, msg, i == num - 1); in fsi_i2c_xfer()
629 rc = fsi_i2c_wait(port, msg, in fsi_i2c_xfer()