Lines Matching refs:msg

258 				    struct i2c_msg *msg, bool stop)  in stm32_i2c_message_start()  argument
265 if (msg->flags & I2C_M_RD) in stm32_i2c_message_start()
270 if (msg->flags & I2C_M_TEN) { in stm32_i2c_message_start()
272 cr2 |= STM32_I2C_CR2_SADD10(msg->addr); in stm32_i2c_message_start()
276 cr2 |= STM32_I2C_CR2_SADD7(msg->addr); in stm32_i2c_message_start()
282 if (msg->len > STM32_I2C_MAX_LEN) { in stm32_i2c_message_start()
286 cr2 |= STM32_I2C_CR2_NBYTES(msg->len); in stm32_i2c_message_start()
302 struct i2c_msg *msg, bool stop) in stm32_i2c_handle_reload() argument
309 if (msg->len > STM32_I2C_MAX_LEN) { in stm32_i2c_handle_reload()
313 cr2 |= STM32_I2C_CR2_NBYTES(msg->len); in stm32_i2c_handle_reload()
395 struct i2c_msg *msg, bool stop) in stm32_i2c_message_xfer() argument
399 u32 mask = msg->flags & I2C_M_RD ? STM32_I2C_ISR_RXNE : in stm32_i2c_message_xfer()
401 int bytes_to_rw = msg->len > STM32_I2C_MAX_LEN ? in stm32_i2c_message_xfer()
402 STM32_I2C_MAX_LEN : msg->len; in stm32_i2c_message_xfer()
408 stm32_i2c_message_start(i2c_priv, msg, stop); in stm32_i2c_message_xfer()
410 while (msg->len) { in stm32_i2c_message_xfer()
423 *msg->buf++ = readb(&regs->rxdr); in stm32_i2c_message_xfer()
424 msg->len--; in stm32_i2c_message_xfer()
429 writeb(*msg->buf++, &regs->txdr); in stm32_i2c_message_xfer()
430 msg->len--; in stm32_i2c_message_xfer()
434 if (!bytes_to_rw && msg->len) { in stm32_i2c_message_xfer()
441 bytes_to_rw = msg->len > STM32_I2C_MAX_LEN ? in stm32_i2c_message_xfer()
442 STM32_I2C_MAX_LEN : msg->len; in stm32_i2c_message_xfer()
443 mask = msg->flags & I2C_M_RD ? STM32_I2C_ISR_RXNE : in stm32_i2c_message_xfer()
446 stm32_i2c_handle_reload(i2c_priv, msg, stop); in stm32_i2c_message_xfer()
467 static int stm32_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, in stm32_i2c_xfer() argument
477 for (; nmsgs > 0; nmsgs--, msg++) { in stm32_i2c_xfer()
478 ret = stm32_i2c_message_xfer(i2c_priv, msg, nmsgs == 1); in stm32_i2c_xfer()