Lines Matching refs:xfer

581 	struct cdns_i3c_xfer xfer;  member
1200 if (data->xfer.num_cmds == 0) { in cdns_i3c_cancel_transfer()
1204 data->xfer.num_cmds = 0; in cdns_i3c_cancel_transfer()
1223 data->xfer.ret = -ETIMEDOUT; in cdns_i3c_cancel_transfer()
1248 struct cdns_i3c_xfer *xfer = &data->xfer; in cdns_i3c_start_transfer() local
1263 for (unsigned int i = 0; i < xfer->num_cmds; i++) { in cdns_i3c_start_transfer()
1264 if (xfer->cmds[i].hdr == I3C_DATA_RATE_SDR) { in cdns_i3c_start_transfer()
1265 if (!(xfer->cmds[i].cmd0 & CMD0_FIFO_RNW)) { in cdns_i3c_start_transfer()
1266 cdns_i3c_write_tx_fifo(config, xfer->cmds[i].buf, in cdns_i3c_start_transfer()
1267 xfer->cmds[i].len); in cdns_i3c_start_transfer()
1269 } else if (xfer->cmds[i].hdr == I3C_DATA_RATE_HDR_DDR) { in cdns_i3c_start_transfer()
1271 cdns_i3c_write_tx_fifo(config, &xfer->cmds[i].ddr_header, in cdns_i3c_start_transfer()
1274 if (!(DDR_DATA(xfer->cmds[i].ddr_header) & HDR_CMD_RD)) { in cdns_i3c_start_transfer()
1275 uint8_t *buf = (uint8_t *)xfer->cmds[i].buf; in cdns_i3c_start_transfer()
1283 for (int j = 2; j < ((xfer->cmds[i].len - 2) * 2); j += 2) { in cdns_i3c_start_transfer()
1291 cdns_i3c_write_tx_fifo(config, &xfer->cmds[i].ddr_crc, in cdns_i3c_start_transfer()
1295 xfer->ret = -ENOTSUP; in cdns_i3c_start_transfer()
1301 for (unsigned int i = 0; i < xfer->num_cmds; i++) { in cdns_i3c_start_transfer()
1303 xfer->cmds[i].cmd1 |= CMD1_FIFO_CMDID(i); in cdns_i3c_start_transfer()
1304 sys_write32(xfer->cmds[i].cmd1, config->base + CMD1_FIFO); in cdns_i3c_start_transfer()
1305 sys_write32(xfer->cmds[i].cmd0, config->base + CMD0_FIFO); in cdns_i3c_start_transfer()
1307 if (xfer->cmds[i].hdr == I3C_DATA_RATE_HDR_DDR) { in cdns_i3c_start_transfer()
1309 if ((DDR_DATA(xfer->cmds[i].ddr_header) & HDR_CMD_RD)) { in cdns_i3c_start_transfer()
1313 sys_write32(CMD0_FIFO_IS_DDR | CMD0_FIFO_PL_LEN(xfer->cmds[i].len), in cdns_i3c_start_transfer()
1399 cmd = &data->xfer.cmds[i]; in cdns_i3c_do_ccc()
1447 cmd = &data->xfer.cmds[0]; in cdns_i3c_do_ccc()
1469 data->xfer.ret = -ETIMEDOUT; in cdns_i3c_do_ccc()
1470 data->xfer.num_cmds = num_cmds; in cdns_i3c_do_ccc()
1473 if (k_sem_take(&data->xfer.complete, K_MSEC(1000)) != 0) { in cdns_i3c_do_ccc()
1477 if (data->xfer.ret < 0) { in cdns_i3c_do_ccc()
1478 LOG_ERR("%s: CCC[0x%02x] error (%d)", dev->name, payload->ccc.id, data->xfer.ret); in cdns_i3c_do_ccc()
1481 ret = data->xfer.ret; in cdns_i3c_do_ccc()
1692 uint32_t xfer = 0; in cdns_i3c_complete_transfer() local
1704 if (data->xfer.num_cmds == 0) { in cdns_i3c_complete_transfer()
1715 id >= data->xfer.num_cmds) { in cdns_i3c_complete_transfer()
1719 cmd = &data->xfer.cmds[id]; in cdns_i3c_complete_transfer()
1721 xfer = MIN(CMDR_XFER_BYTES(cmdr), cmd->len); in cdns_i3c_complete_transfer()
1723 *cmd->num_xfer = xfer; in cdns_i3c_complete_transfer()
1727 ret = cdns_i3c_read_rx_fifo(config, cmd->buf, xfer); in cdns_i3c_complete_transfer()
1732 ret = cdns_i3c_read_rx_fifo_ddr_xfer(config, cmd->buf, xfer, in cdns_i3c_complete_transfer()
1740 for (int i = 0; i < data->xfer.num_cmds; i++) { in cdns_i3c_complete_transfer()
1741 switch (data->xfer.cmds[i].error) { in cdns_i3c_complete_transfer()
1758 if ((was_full) && (data->xfer.cmds[i].len > *data->xfer.cmds[i].num_xfer)) { in cdns_i3c_complete_transfer()
1768 uint8_t ccc = data->xfer.cmds[i].cmd1 & 0xFF; in cdns_i3c_complete_transfer()
1784 if ((*data->xfer.cmds[i].num_xfer != in cdns_i3c_complete_transfer()
1786 (*data->xfer.cmds[i].num_xfer != in cdns_i3c_complete_transfer()
1792 if (*data->xfer.cmds[i].num_xfer > sizeof(union i3c_ccc_getcaps)) { in cdns_i3c_complete_transfer()
1822 data->xfer.ret = ret; in cdns_i3c_complete_transfer()
1825 data->xfer.num_cmds = 0; in cdns_i3c_complete_transfer()
1827 k_sem_give(&data->xfer.complete); in cdns_i3c_complete_transfer()
1889 struct cdns_i3c_cmd *cmd = &data->xfer.cmds[i]; in cdns_i3c_i2c_transfer()
1917 data->xfer.ret = -ETIMEDOUT; in cdns_i3c_i2c_transfer()
1918 data->xfer.num_cmds = num_msgs; in cdns_i3c_i2c_transfer()
1921 if (k_sem_take(&data->xfer.complete, K_MSEC(1000)) != 0) { in cdns_i3c_i2c_transfer()
1925 ret = data->xfer.ret; in cdns_i3c_i2c_transfer()
2196 struct cdns_i3c_cmd *cmd = &data->xfer.cmds[i]; in cdns_i3c_transfer()
2301 data->xfer.ret = -ETIMEDOUT; in cdns_i3c_transfer()
2302 data->xfer.num_cmds = num_msgs; in cdns_i3c_transfer()
2305 if (k_sem_take(&data->xfer.complete, K_MSEC(1000)) != 0) { in cdns_i3c_transfer()
2310 ret = data->xfer.ret; in cdns_i3c_transfer()
2776 data->hw_cfg.cmd_mem_depth = MIN(data->hw_cfg.cmd_mem_depth, ARRAY_SIZE(data->xfer.cmds)); in cdns_i3c_read_hw_cfg()
3166 k_sem_init(&data->xfer.complete, 0, 1); in cdns_i3c_bus_init()