Lines Matching refs:t
173 struct spi_transfer *t) in sprd_spi_transfer_max_timeout() argument
179 u32 size = t->bits_per_word * SPRD_SPI_FIFO_SIZE; in sprd_spi_transfer_max_timeout()
193 static int sprd_spi_wait_for_tx_end(struct sprd_spi *ss, struct spi_transfer *t) in sprd_spi_wait_for_tx_end() argument
198 us = sprd_spi_transfer_max_timeout(ss, t); in sprd_spi_wait_for_tx_end()
218 static int sprd_spi_wait_for_rx_end(struct sprd_spi *ss, struct spi_transfer *t) in sprd_spi_wait_for_rx_end() argument
223 us = sprd_spi_transfer_max_timeout(ss, t); in sprd_spi_wait_for_rx_end()
401 static int sprd_spi_txrx_bufs(struct spi_device *sdev, struct spi_transfer *t) in sprd_spi_txrx_bufs() argument
421 ret = sprd_spi_wait_for_tx_end(ss, t); in sprd_spi_txrx_bufs()
434 ret = sprd_spi_wait_for_rx_end(ss, t); in sprd_spi_txrx_bufs()
516 static int sprd_spi_dma_rx_config(struct sprd_spi *ss, struct spi_transfer *t) in sprd_spi_dma_rx_config() argument
527 ret = sprd_spi_dma_submit(dma_chan, &config, &t->rx_sg, DMA_DEV_TO_MEM); in sprd_spi_dma_rx_config()
534 static int sprd_spi_dma_tx_config(struct sprd_spi *ss, struct spi_transfer *t) in sprd_spi_dma_tx_config() argument
545 ret = sprd_spi_dma_submit(dma_chan, &config, &t->tx_sg, DMA_MEM_TO_DEV); in sprd_spi_dma_tx_config()
549 return t->len; in sprd_spi_dma_tx_config()
579 struct spi_transfer *t) in sprd_spi_dma_txrx_bufs() argument
588 write_size = sprd_spi_dma_tx_config(ss, t); in sprd_spi_dma_txrx_bufs()
624 ss->dma.rx_len = t->len > ss->dma.fragmens_len ? in sprd_spi_dma_txrx_bufs()
625 (t->len - t->len % ss->dma.fragmens_len) : in sprd_spi_dma_txrx_bufs()
626 t->len; in sprd_spi_dma_txrx_bufs()
627 ret = sprd_spi_dma_rx_config(ss, t); in sprd_spi_dma_txrx_bufs()
664 static int sprd_spi_init_hw(struct sprd_spi *ss, struct spi_transfer *t) in sprd_spi_init_hw() argument
666 struct spi_delay *d = &t->word_delay; in sprd_spi_init_hw()
715 struct spi_transfer *t) in sprd_spi_setup_transfer() argument
718 u8 bits_per_word = t->bits_per_word; in sprd_spi_setup_transfer()
722 ss->len = t->len; in sprd_spi_setup_transfer()
723 ss->tx_buf = t->tx_buf; in sprd_spi_setup_transfer()
724 ss->rx_buf = t->rx_buf; in sprd_spi_setup_transfer()
727 ret = sprd_spi_init_hw(ss, t); in sprd_spi_setup_transfer()
732 sprd_spi_set_speed(ss, t->speed_hz); in sprd_spi_setup_transfer()
742 ss->trans_len = t->len; in sprd_spi_setup_transfer()
749 ss->trans_len = t->len >> 1; in sprd_spi_setup_transfer()
756 ss->trans_len = t->len >> 2; in sprd_spi_setup_transfer()
769 if (t->tx_buf) in sprd_spi_setup_transfer()
771 if (t->rx_buf) in sprd_spi_setup_transfer()
790 struct spi_transfer *t) in sprd_spi_transfer_one() argument
794 ret = sprd_spi_setup_transfer(sdev, t); in sprd_spi_transfer_one()
798 if (sctlr->can_dma(sctlr, sdev, t)) in sprd_spi_transfer_one()
799 ret = sprd_spi_dma_txrx_bufs(sdev, t); in sprd_spi_transfer_one()
801 ret = sprd_spi_txrx_bufs(sdev, t); in sprd_spi_transfer_one()
803 if (ret == t->len) in sprd_spi_transfer_one()
890 struct spi_device *spi, struct spi_transfer *t) in sprd_spi_can_dma() argument
894 return ss->dma.enable && (t->len > SPRD_SPI_FIFO_SIZE); in sprd_spi_can_dma()