Lines Matching refs:msgs
73 static int adltc2990_emul_transfer_i2c(const struct emul *target, struct i2c_msg *msgs, in adltc2990_emul_transfer_i2c() argument
78 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in adltc2990_emul_transfer_i2c()
84 if (FIELD_GET(I2C_MSG_READ, msgs->flags)) { in adltc2990_emul_transfer_i2c()
88 if (msgs->len < 1) { in adltc2990_emul_transfer_i2c()
89 LOG_ERR("Unexpected msg0 length %d", msgs->len); in adltc2990_emul_transfer_i2c()
93 uint8_t regn = msgs->buf[0]; in adltc2990_emul_transfer_i2c()
94 bool is_read = FIELD_GET(I2C_MSG_READ, msgs->flags) == 1; in adltc2990_emul_transfer_i2c()
95 bool is_stop = FIELD_GET(I2C_MSG_STOP, msgs->flags) == 1; in adltc2990_emul_transfer_i2c()
99 msgs++; in adltc2990_emul_transfer_i2c()
100 is_read = FIELD_GET(I2C_MSG_READ, msgs->flags) == 1; in adltc2990_emul_transfer_i2c()
101 is_stop = FIELD_GET(I2C_MSG_STOP, msgs->flags) == 1; in adltc2990_emul_transfer_i2c()
105 for (int i = 0; i < msgs->len; ++i) { in adltc2990_emul_transfer_i2c()
106 msgs->buf[i] = data->reg[regn + i]; in adltc2990_emul_transfer_i2c()
109 int rc = adltc2990_emul_handle_write(target, regn, msgs->buf[1]); in adltc2990_emul_transfer_i2c()