Lines Matching refs:msgs
69 static int sbs_charger_emul_transfer_i2c(const struct emul *target, struct i2c_msg *msgs, in sbs_charger_emul_transfer_i2c() argument
80 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in sbs_charger_emul_transfer_i2c()
83 if (msgs->flags & I2C_MSG_READ) { in sbs_charger_emul_transfer_i2c()
87 if (msgs->len != 1) { in sbs_charger_emul_transfer_i2c()
88 LOG_ERR("Unexpected msg0 length %d", msgs->len); in sbs_charger_emul_transfer_i2c()
91 reg = msgs->buf[0]; in sbs_charger_emul_transfer_i2c()
94 msgs++; in sbs_charger_emul_transfer_i2c()
95 if (msgs->flags & I2C_MSG_READ) { in sbs_charger_emul_transfer_i2c()
96 switch (msgs->len - 1) { in sbs_charger_emul_transfer_i2c()
105 sys_put_le16(val, msgs->buf); in sbs_charger_emul_transfer_i2c()
108 LOG_ERR("Unexpected msg1 length %d", msgs->len); in sbs_charger_emul_transfer_i2c()
113 if (msgs->len != 2) { in sbs_charger_emul_transfer_i2c()
114 LOG_ERR("Unexpected msg1 length %d", msgs->len); in sbs_charger_emul_transfer_i2c()
116 uint16_t value = sys_get_le16(msgs->buf); in sbs_charger_emul_transfer_i2c()