Lines Matching refs:msgs
74 static int akm09918c_emul_transfer_i2c(const struct emul *target, struct i2c_msg *msgs, in akm09918c_emul_transfer_i2c() argument
79 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in akm09918c_emul_transfer_i2c()
85 if (FIELD_GET(I2C_MSG_READ, msgs->flags)) { in akm09918c_emul_transfer_i2c()
89 if (msgs->len < 1) { in akm09918c_emul_transfer_i2c()
90 LOG_ERR("Unexpected msg0 length %d", msgs->len); in akm09918c_emul_transfer_i2c()
94 uint8_t regn = msgs->buf[0]; in akm09918c_emul_transfer_i2c()
95 bool is_read = FIELD_GET(I2C_MSG_READ, msgs->flags) == 1; in akm09918c_emul_transfer_i2c()
96 bool is_stop = FIELD_GET(I2C_MSG_STOP, msgs->flags) == 1; in akm09918c_emul_transfer_i2c()
100 msgs++; in akm09918c_emul_transfer_i2c()
101 is_read = FIELD_GET(I2C_MSG_READ, msgs->flags) == 1; in akm09918c_emul_transfer_i2c()
102 is_stop = FIELD_GET(I2C_MSG_STOP, msgs->flags) == 1; in akm09918c_emul_transfer_i2c()
108 for (int i = 0; i < msgs->len; ++i) { in akm09918c_emul_transfer_i2c()
109 msgs->buf[i] = data->reg[regn + i]; in akm09918c_emul_transfer_i2c()
118 int rc = akm09918c_emul_handle_write(target, regn, msgs->buf[1]); in akm09918c_emul_transfer_i2c()