Lines Matching refs:xfer

171 	struct qspi_xfer xfer;
203 const struct qspi_xfer *xfer;
205 xfer = &ctrl->xfer;
208 pio_xfer_cfg |= xfer->dir;
209 if (xfer->is_last)
214 iomode = qspi_buswidth_to_iomode(ctrl, xfer->buswidth);
226 pio_xfer_ctrl |= ctrl->xfer.rem_bytes;
240 if (ctrl->xfer.dir == QSPI_WRITE)
262 ctrl->xfer.rem_bytes = 0;
323 virt_cmd_desc->direction = ctrl->xfer.dir;
324 virt_cmd_desc->multi_io_mode = qspi_buswidth_to_iomode(ctrl, ctrl->xfer.buswidth);
325 virt_cmd_desc->fragment = !ctrl->xfer.is_last;
339 struct spi_transfer *xfer)
352 sgt = (ctrl->xfer.dir == QSPI_READ) ? &xfer->rx_sg : &xfer->tx_sg;
371 if (ctrl->xfer.dir == QSPI_READ && (dma_len_sg & 0x03)) {
409 struct spi_device *slv, struct spi_transfer *xfer)
411 return xfer->len > QSPI_MAX_BYTES_FIFO;
416 struct spi_transfer *xfer)
425 if (xfer->speed_hz)
426 speed_hz = xfer->speed_hz;
436 if (xfer->rx_buf) {
437 ctrl->xfer.dir = QSPI_READ;
438 ctrl->xfer.buswidth = xfer->rx_nbits;
439 ctrl->xfer.rx_buf = xfer->rx_buf;
441 ctrl->xfer.dir = QSPI_WRITE;
442 ctrl->xfer.buswidth = xfer->tx_nbits;
443 ctrl->xfer.tx_buf = xfer->tx_buf;
445 ctrl->xfer.is_last = list_is_last(&xfer->transfer_list,
447 ctrl->xfer.rem_bytes = xfer->len;
449 if (xfer->rx_sg.nents || xfer->tx_sg.nents) {
456 ret = qcom_qspi_setup_dma_desc(ctrl, xfer);
543 wr_cnts = min(wr_cnts, ctrl->xfer.rem_bytes);
549 word_buf = ctrl->xfer.rx_buf;
550 ctrl->xfer.rem_bytes -= words_to_read * QSPI_BYTES_PER_WORD;
552 ctrl->xfer.rx_buf = word_buf + words_to_read;
556 byte_buf = ctrl->xfer.rx_buf;
558 ctrl->xfer.rem_bytes -= bytes_to_read;
561 ctrl->xfer.rx_buf = byte_buf;
569 const void *xfer_buf = ctrl->xfer.tx_buf;
580 if (ctrl->xfer.rem_bytes < QSPI_BYTES_PER_WORD) {
582 wr_size = min(wr_fifo_bytes, ctrl->xfer.rem_bytes);
583 ctrl->xfer.rem_bytes -= wr_size;
589 ctrl->xfer.tx_buf = byte_buf;
596 rem_words = ctrl->xfer.rem_bytes / QSPI_BYTES_PER_WORD;
600 ctrl->xfer.rem_bytes -= wr_size * QSPI_BYTES_PER_WORD;
604 ctrl->xfer.tx_buf = word_buf + wr_size;
626 if (ctrl->xfer.dir == QSPI_WRITE) {
644 if (!ctrl->xfer.rem_bytes) {
654 ctrl->xfer.rem_bytes = 0;