Lines Matching refs:msgs
38 static int mcp7940n_emul_transfer_i2c(const struct emul *target, struct i2c_msg *msgs, int num_msgs, in mcp7940n_emul_transfer_i2c() argument
43 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in mcp7940n_emul_transfer_i2c()
49 if (FIELD_GET(I2C_MSG_READ, msgs->flags)) { in mcp7940n_emul_transfer_i2c()
53 if (msgs->len < 1) { in mcp7940n_emul_transfer_i2c()
54 LOG_ERR("Unexpected msg0 length %d", msgs->len); in mcp7940n_emul_transfer_i2c()
58 uint8_t regn = msgs->buf[0]; in mcp7940n_emul_transfer_i2c()
59 bool is_read = FIELD_GET(I2C_MSG_READ, msgs->flags) == 1; in mcp7940n_emul_transfer_i2c()
60 bool is_stop = FIELD_GET(I2C_MSG_STOP, msgs->flags) == 1; in mcp7940n_emul_transfer_i2c()
64 msgs++; in mcp7940n_emul_transfer_i2c()
65 is_read = FIELD_GET(I2C_MSG_READ, msgs->flags) == 1; in mcp7940n_emul_transfer_i2c()
66 is_stop = FIELD_GET(I2C_MSG_STOP, msgs->flags) == 1; in mcp7940n_emul_transfer_i2c()
72 msgs->buf[0] = data->rtcwkday; in mcp7940n_emul_transfer_i2c()
76 regn + msgs->len <= in mcp7940n_emul_transfer_i2c()
78 for (int i = 0; i < msgs->len; ++i) { in mcp7940n_emul_transfer_i2c()
79 msgs->buf[i] = in mcp7940n_emul_transfer_i2c()
87 data->rtcwkday = msgs->buf[1]; in mcp7940n_emul_transfer_i2c()
91 regn + msgs->len - 1 <= in mcp7940n_emul_transfer_i2c()
93 for (int i = 0; i < msgs->len; ++i) { in mcp7940n_emul_transfer_i2c()
95 msgs->buf[1 + i]; in mcp7940n_emul_transfer_i2c()