Lines Matching refs:tfr

212 				 struct spi_transfer *tfr)  in sun6i_spi_prepare_dma()  argument
218 if (tfr->rx_buf) { in sun6i_spi_prepare_dma()
229 tfr->rx_sg.sgl, in sun6i_spi_prepare_dma()
230 tfr->rx_sg.nents, in sun6i_spi_prepare_dma()
240 if (tfr->tx_buf) { in sun6i_spi_prepare_dma()
251 tfr->tx_sg.sgl, in sun6i_spi_prepare_dma()
252 tfr->tx_sg.nents, in sun6i_spi_prepare_dma()
262 if (tfr->rx_buf) { in sun6i_spi_prepare_dma()
267 if (tfr->tx_buf) { in sun6i_spi_prepare_dma()
277 struct spi_transfer *tfr) in sun6i_spi_transfer_one() argument
289 if (tfr->len > SUN6I_MAX_XFER_SIZE) in sun6i_spi_transfer_one()
294 sspi->tx_buf = tfr->tx_buf; in sun6i_spi_transfer_one()
295 sspi->rx_buf = tfr->rx_buf; in sun6i_spi_transfer_one()
296 sspi->len = tfr->len; in sun6i_spi_transfer_one()
297 use_dma = host->can_dma ? host->can_dma(host, spi, tfr) : false; in sun6i_spi_transfer_one()
324 if (tfr->tx_buf) in sun6i_spi_transfer_one()
326 if (tfr->rx_buf) in sun6i_spi_transfer_one()
362 rx_len = tfr->len; in sun6i_spi_transfer_one()
376 if (mclk_rate < (2 * tfr->speed_hz)) { in sun6i_spi_transfer_one()
377 clk_set_rate(sspi->mclk, 2 * tfr->speed_hz); in sun6i_spi_transfer_one()
395 div_cdr1 = DIV_ROUND_UP(mclk_rate, tfr->speed_hz); in sun6i_spi_transfer_one()
399 tfr->effective_speed_hz = mclk_rate / (2 * div_cdr2); in sun6i_spi_transfer_one()
403 tfr->effective_speed_hz = mclk_rate / (1 << div); in sun6i_spi_transfer_one()
408 clk_set_rate(sspi->mclk, tfr->speed_hz); in sun6i_spi_transfer_one()
409 tfr->effective_speed_hz = clk_get_rate(sspi->mclk); in sun6i_spi_transfer_one()
423 if (tfr->effective_speed_hz <= 24000000) in sun6i_spi_transfer_one()
425 else if (tfr->effective_speed_hz >= 80000000) in sun6i_spi_transfer_one()
438 tx_len = tfr->len; in sun6i_spi_transfer_one()
439 nbits = tfr->tx_nbits; in sun6i_spi_transfer_one()
440 } else if (tfr->rx_buf) { in sun6i_spi_transfer_one()
441 nbits = tfr->rx_nbits; in sun6i_spi_transfer_one()
458 sun6i_spi_write(sspi, SUN6I_BURST_CNT_REG, tfr->len); in sun6i_spi_transfer_one()
465 ret = sun6i_spi_prepare_dma(sspi, tfr); in sun6i_spi_transfer_one()
490 tx_time = spi_controller_xfer_timeout(host, tfr); in sun6i_spi_transfer_one()
514 dev_name(&spi->dev), tfr->len, tfr->speed_hz, in sun6i_spi_transfer_one()