Lines Matching +full:max +full:- +full:msgs

6  * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/dt-bindings/i2c/i2c.h>
31 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_msg_start()
32 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_msg_start()
45 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_start()
46 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_start()
47 struct rtio_sqe *sqe = &ctx->txn_curr->sqe; in i2c_nrfx_twim_rtio_start()
48 struct i2c_dt_spec *dt_spec = sqe->iodev->data; in i2c_nrfx_twim_rtio_start()
50 switch (sqe->op) { in i2c_nrfx_twim_rtio_start()
52 return i2c_nrfx_twim_rtio_msg_start(dev, I2C_MSG_READ | sqe->iodev_flags, in i2c_nrfx_twim_rtio_start()
53 sqe->rx.buf, sqe->rx.buf_len, dt_spec->addr); in i2c_nrfx_twim_rtio_start()
55 return i2c_nrfx_twim_rtio_msg_start(dev, I2C_MSG_WRITE | sqe->iodev_flags, in i2c_nrfx_twim_rtio_start()
56 sqe->tiny_tx.buf, sqe->tiny_tx.buf_len, in i2c_nrfx_twim_rtio_start()
57 dt_spec->addr); in i2c_nrfx_twim_rtio_start()
60 if (!nrf_dma_accessible_check(&config->common.twim, sqe->tx.buf)) { in i2c_nrfx_twim_rtio_start()
62 if (sqe->tx.buf_len > config->common.msg_buf_size) { in i2c_nrfx_twim_rtio_start()
66 "Adjust the zephyr,concat-buf-size or " in i2c_nrfx_twim_rtio_start()
67 "zephyr,flash-buf-max-size property " in i2c_nrfx_twim_rtio_start()
70 sqe->tx.buf_len, config->common.msg_buf_size, dev->name); in i2c_nrfx_twim_rtio_start()
71 return i2c_rtio_complete(ctx, -ENOSPC); in i2c_nrfx_twim_rtio_start()
73 memcpy(config->common.msg_buf, sqe->tx.buf, sqe->tx.buf_len); in i2c_nrfx_twim_rtio_start()
74 sqe->tx.buf = config->common.msg_buf; in i2c_nrfx_twim_rtio_start()
76 return i2c_nrfx_twim_rtio_msg_start(dev, I2C_MSG_WRITE | sqe->iodev_flags, in i2c_nrfx_twim_rtio_start()
77 sqe->tx.buf, sqe->tx.buf_len, dt_spec->addr); in i2c_nrfx_twim_rtio_start()
79 (void)i2c_nrfx_twim_configure(dev, sqe->i2c_config); in i2c_nrfx_twim_rtio_start()
85 LOG_ERR("Invalid op code %d for submission %p\n", sqe->op, (void *)sqe); in i2c_nrfx_twim_rtio_start()
86 return i2c_rtio_complete(ctx, -EINVAL); in i2c_nrfx_twim_rtio_start()
93 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_complete()
94 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_complete()
106 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_configure()
107 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_configure()
112 static int i2c_nrfx_twim_rtio_transfer(const struct device *dev, struct i2c_msg *msgs, in i2c_nrfx_twim_rtio_transfer() argument
115 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_transfer()
116 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_transfer()
118 return i2c_rtio_transfer(ctx, msgs, num_msgs, addr); in i2c_nrfx_twim_rtio_transfer()
123 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_recover_bus()
124 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_recover_bus()
131 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_submit()
132 struct i2c_rtio *ctx = config->ctx; in i2c_nrfx_twim_rtio_submit()
136 (void)i2c_rtio_complete(ctx, -EINVAL); in i2c_nrfx_twim_rtio_submit()
146 int status = p_event->type == NRFX_TWIM_EVT_DONE ? 0 : -EIO; in event_handler()
160 const struct i2c_nrfx_twim_rtio_config *config = dev->config; in i2c_nrfx_twim_rtio_init()
162 i2c_rtio_init(config->ctx, dev); in i2c_nrfx_twim_rtio_init()
175 #define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx))