Lines Matching full:transfer
231 * @transfer_one_dma_start: routine to start transfer a single spi_transfer
284 * @cur_xferlen: current transfer length in bytes
285 * @cur_usedma: boolean to know if dma is used in current transfer
290 * @dma_tx: dma channel for TX transfer
291 * @dma_rx: dma channel for RX transfer
343 /* SPI data transfer is enabled but spi_ker_ck is idle.
738 * stm32_spi_can_dma - Determine if the transfer is eligible for DMA use
741 * @transfer: pointer to spi transfer
743 * If driver has fifo and the current transfer size is greater than fifo size,
744 * use DMA. Otherwise use DMA for transfer longer than defined DMA min bytes.
748 struct spi_transfer *transfer) in stm32_spi_can_dma() argument
759 (transfer->len > dma_size) ? "true" : "false"); in stm32_spi_can_dma()
761 return (transfer->len > dma_size); in stm32_spi_can_dma()
815 * so stop the current transfer. Transfer can wait for next in stm32f4_spi_irq_event()
918 * that something went wrong, so stop the current transfer in stm32h7_spi_irq_thread()
925 dev_warn(spi->dev, "Mode fault: transfer aborted\n"); in stm32h7_spi_irq_thread()
963 * stm32_spi_prepare_msg - set up the controller to transfer a single message
1039 * DMA callback is called when the transfer is complete for DMA TX channel.
1055 * DMA callback is called when the transfer is complete for DMA RX channel.
1067 * transfer bits_per_word.
1070 * @dir: direction of the dma transfer
1116 * stm32f4_spi_transfer_one_irq - transfer a single spi_transfer using
1120 * It must returns 0 if the transfer is finished or 1 if the transfer is still
1149 /* starting data transfer when buffer is loaded */ in stm32f4_spi_transfer_one_irq()
1159 * stm32h7_spi_transfer_one_irq - transfer a single spi_transfer using
1163 * It must returns 0 if the transfer is finished or 1 if the transfer is still
1179 /* Enable the interrupts relative to the end of transfer */ in stm32h7_spi_transfer_one_irq()
1187 /* Be sure to have data in fifo before starting data transfer */ in stm32h7_spi_transfer_one_irq()
1203 * transfer using DMA
1208 /* In DMA mode end of transfer is handled by DMA TX or RX callback. */ in stm32f4_spi_transfer_one_dma_start()
1224 * transfer using DMA
1244 * stm32_spi_transfer_one_dma - transfer a single spi_transfer using DMA
1248 * It must returns 0 if the transfer is finished or 1 if the transfer is still
1342 dev_info(spi->dev, "DMA issue: fall back to irq transfer\n"); in stm32_spi_transfer_one_dma()
1404 * stm32_spi_communication_type - return transfer communication type
1406 * @transfer: pointer to spi transfer
1409 struct spi_transfer *transfer) in stm32_spi_communication_type() argument
1418 * transfer. in stm32_spi_communication_type()
1420 if (!transfer->tx_buf) in stm32_spi_communication_type()
1425 if (!transfer->tx_buf) in stm32_spi_communication_type()
1427 else if (!transfer->rx_buf) in stm32_spi_communication_type()
1501 * @len: transfer len
1527 * stm32h7_spi_number_of_data - configure number of data at current transfer
1529 * @nb_words: transfer length (in words)
1544 * stm32_spi_transfer_one_setup - common setup to transfer a single
1549 * @transfer: pointer to spi transfer
1553 struct spi_transfer *transfer) in stm32_spi_transfer_one_setup() argument
1562 spi->cur_xferlen = transfer->len; in stm32_spi_transfer_one_setup()
1564 spi->cur_bpw = transfer->bits_per_word; in stm32_spi_transfer_one_setup()
1569 mbr = stm32_spi_prepare_mbr(spi, transfer->speed_hz, in stm32_spi_transfer_one_setup()
1577 transfer->speed_hz = spi->cur_speed; in stm32_spi_transfer_one_setup()
1581 comm_type = stm32_spi_communication_type(spi_dev, transfer); in stm32_spi_transfer_one_setup()
1589 spi->cfg->set_data_idleness(spi, transfer->len); in stm32_spi_transfer_one_setup()
1592 nb_words = transfer->len; in stm32_spi_transfer_one_setup()
1594 nb_words = DIV_ROUND_UP(transfer->len * 8, 16); in stm32_spi_transfer_one_setup()
1596 nb_words = DIV_ROUND_UP(transfer->len * 8, 32); in stm32_spi_transfer_one_setup()
1604 dev_dbg(spi->dev, "transfer communication mode set to %d\n", in stm32_spi_transfer_one_setup()
1611 dev_dbg(spi->dev, "transfer of %d bytes (%d data frames)\n", in stm32_spi_transfer_one_setup()
1623 * stm32_spi_transfer_one - transfer a single spi_transfer
1626 * @transfer: pointer to spi transfer
1628 * It must return 0 if the transfer is finished or 1 if the transfer is still
1633 struct spi_transfer *transfer) in stm32_spi_transfer_one() argument
1638 spi->tx_buf = transfer->tx_buf; in stm32_spi_transfer_one()
1639 spi->rx_buf = transfer->rx_buf; in stm32_spi_transfer_one()
1640 spi->tx_len = spi->tx_buf ? transfer->len : 0; in stm32_spi_transfer_one()
1641 spi->rx_len = spi->rx_buf ? transfer->len : 0; in stm32_spi_transfer_one()
1644 ctrl->can_dma(ctrl, spi_dev, transfer)); in stm32_spi_transfer_one()
1646 ret = stm32_spi_transfer_one_setup(spi, spi_dev, transfer); in stm32_spi_transfer_one()
1648 dev_err(spi->dev, "SPI transfer setup failed\n"); in stm32_spi_transfer_one()
1653 return stm32_spi_transfer_one_dma(spi, transfer); in stm32_spi_transfer_one()