Lines Matching refs:tfr
193 struct spi_transfer *tfr) in sun6i_spi_prepare_dma() argument
199 if (tfr->rx_buf) { in sun6i_spi_prepare_dma()
210 tfr->rx_sg.sgl, in sun6i_spi_prepare_dma()
211 tfr->rx_sg.nents, in sun6i_spi_prepare_dma()
219 if (tfr->tx_buf) { in sun6i_spi_prepare_dma()
230 tfr->tx_sg.sgl, in sun6i_spi_prepare_dma()
231 tfr->tx_sg.nents, in sun6i_spi_prepare_dma()
241 if (tfr->rx_buf) { in sun6i_spi_prepare_dma()
246 if (tfr->tx_buf) { in sun6i_spi_prepare_dma()
256 struct spi_transfer *tfr) in sun6i_spi_transfer_one() argument
267 if (tfr->len > SUN6I_MAX_XFER_SIZE) in sun6i_spi_transfer_one()
271 sspi->tx_buf = tfr->tx_buf; in sun6i_spi_transfer_one()
272 sspi->rx_buf = tfr->rx_buf; in sun6i_spi_transfer_one()
273 sspi->len = tfr->len; in sun6i_spi_transfer_one()
274 use_dma = master->can_dma ? master->can_dma(master, spi, tfr) : false; in sun6i_spi_transfer_one()
301 if (tfr->tx_buf) in sun6i_spi_transfer_one()
303 if (tfr->rx_buf) in sun6i_spi_transfer_one()
339 rx_len = tfr->len; in sun6i_spi_transfer_one()
351 if (mclk_rate < (2 * tfr->speed_hz)) { in sun6i_spi_transfer_one()
352 clk_set_rate(sspi->mclk, 2 * tfr->speed_hz); in sun6i_spi_transfer_one()
370 div_cdr1 = DIV_ROUND_UP(mclk_rate, tfr->speed_hz); in sun6i_spi_transfer_one()
374 tfr->effective_speed_hz = mclk_rate / (2 * div_cdr2); in sun6i_spi_transfer_one()
378 tfr->effective_speed_hz = mclk_rate / (1 << div); in sun6i_spi_transfer_one()
389 tx_len = tfr->len; in sun6i_spi_transfer_one()
392 sun6i_spi_write(sspi, SUN6I_BURST_CNT_REG, tfr->len); in sun6i_spi_transfer_one()
400 ret = sun6i_spi_prepare_dma(sspi, tfr); in sun6i_spi_transfer_one()
425 tx_time = max(tfr->len * 8 * 2 / (tfr->speed_hz / 1000), 100U); in sun6i_spi_transfer_one()
433 dev_name(&spi->dev), tfr->len, tfr->speed_hz, in sun6i_spi_transfer_one()