Lines Matching refs:tfr

122 	struct spi_transfer *tfr;  member
404 struct spi_transfer *tfr, in bcm2835_spi_transfer_one_irq() argument
478 struct spi_transfer *tfr, in bcm2835_spi_transfer_prologue() argument
484 bs->tfr = tfr; in bcm2835_spi_transfer_prologue()
489 if (bs->tx_buf && !sg_is_last(&tfr->tx_sg.sgl[0])) in bcm2835_spi_transfer_prologue()
490 bs->tx_prologue = sg_dma_len(&tfr->tx_sg.sgl[0]) & 3; in bcm2835_spi_transfer_prologue()
492 if (bs->rx_buf && !sg_is_last(&tfr->rx_sg.sgl[0])) { in bcm2835_spi_transfer_prologue()
493 bs->rx_prologue = sg_dma_len(&tfr->rx_sg.sgl[0]) & 3; in bcm2835_spi_transfer_prologue()
496 if (!bs->tx_buf || sg_is_last(&tfr->tx_sg.sgl[0])) { in bcm2835_spi_transfer_prologue()
501 !(sg_dma_len(&tfr->tx_sg.sgl[0]) & ~3); in bcm2835_spi_transfer_prologue()
523 sg_dma_address(&tfr->rx_sg.sgl[0]), in bcm2835_spi_transfer_prologue()
526 sg_dma_address(&tfr->rx_sg.sgl[0]) += bs->rx_prologue; in bcm2835_spi_transfer_prologue()
527 sg_dma_len(&tfr->rx_sg.sgl[0]) -= bs->rx_prologue; in bcm2835_spi_transfer_prologue()
549 sg_dma_address(&tfr->tx_sg.sgl[0]) += bs->tx_prologue; in bcm2835_spi_transfer_prologue()
550 sg_dma_len(&tfr->tx_sg.sgl[0]) -= bs->tx_prologue; in bcm2835_spi_transfer_prologue()
552 sg_dma_len(&tfr->tx_sg.sgl[0]) = 0; in bcm2835_spi_transfer_prologue()
553 sg_dma_address(&tfr->tx_sg.sgl[1]) += 4; in bcm2835_spi_transfer_prologue()
554 sg_dma_len(&tfr->tx_sg.sgl[1]) -= 4; in bcm2835_spi_transfer_prologue()
568 struct spi_transfer *tfr = bs->tfr; in bcm2835_spi_undo_prologue() local
574 sg_dma_address(&tfr->rx_sg.sgl[0]) -= bs->rx_prologue; in bcm2835_spi_undo_prologue()
575 sg_dma_len(&tfr->rx_sg.sgl[0]) += bs->rx_prologue; in bcm2835_spi_undo_prologue()
582 sg_dma_address(&tfr->tx_sg.sgl[0]) -= bs->tx_prologue; in bcm2835_spi_undo_prologue()
583 sg_dma_len(&tfr->tx_sg.sgl[0]) += bs->tx_prologue; in bcm2835_spi_undo_prologue()
585 sg_dma_len(&tfr->tx_sg.sgl[0]) = bs->tx_prologue - 4; in bcm2835_spi_undo_prologue()
586 sg_dma_address(&tfr->tx_sg.sgl[1]) -= 4; in bcm2835_spi_undo_prologue()
587 sg_dma_len(&tfr->tx_sg.sgl[1]) += 4; in bcm2835_spi_undo_prologue()
664 struct spi_transfer *tfr, in bcm2835_spi_prepare_sg() argument
681 nents = tfr->tx_sg.nents; in bcm2835_spi_prepare_sg()
682 sgl = tfr->tx_sg.sgl; in bcm2835_spi_prepare_sg()
683 flags = tfr->rx_buf ? 0 : DMA_PREP_INTERRUPT; in bcm2835_spi_prepare_sg()
687 nents = tfr->rx_sg.nents; in bcm2835_spi_prepare_sg()
688 sgl = tfr->rx_sg.sgl; in bcm2835_spi_prepare_sg()
703 } else if (!tfr->rx_buf) { in bcm2835_spi_prepare_sg()
763 struct spi_transfer *tfr, in bcm2835_spi_transfer_one_dma() argument
778 bcm2835_spi_transfer_prologue(ctlr, tfr, bs, cs); in bcm2835_spi_transfer_one_dma()
782 ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, true); in bcm2835_spi_transfer_one_dma()
808 ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, false); in bcm2835_spi_transfer_one_dma()
846 struct spi_transfer *tfr) in bcm2835_spi_can_dma() argument
849 if (tfr->len < BCM2835_SPI_DMA_MIN_LENGTH) in bcm2835_spi_can_dma()
991 struct spi_transfer *tfr, in bcm2835_spi_transfer_one_poll() argument
1034 tfr, cs, false); in bcm2835_spi_transfer_one_poll()
1046 struct spi_transfer *tfr) in bcm2835_spi_transfer_one() argument
1055 spi_hz = tfr->speed_hz; in bcm2835_spi_transfer_one()
1069 tfr->effective_speed_hz = cdiv ? (bs->clk_hz / cdiv) : (bs->clk_hz / 65536); in bcm2835_spi_transfer_one()
1073 if (spi->mode & SPI_3WIRE && tfr->rx_buf) in bcm2835_spi_transfer_one()
1077 bs->tx_buf = tfr->tx_buf; in bcm2835_spi_transfer_one()
1078 bs->rx_buf = tfr->rx_buf; in bcm2835_spi_transfer_one()
1079 bs->tx_len = tfr->len; in bcm2835_spi_transfer_one()
1080 bs->rx_len = tfr->len; in bcm2835_spi_transfer_one()
1089 byte_limit = hz_per_byte ? tfr->effective_speed_hz / hz_per_byte : 1; in bcm2835_spi_transfer_one()
1092 if (tfr->len < byte_limit) in bcm2835_spi_transfer_one()
1093 return bcm2835_spi_transfer_one_poll(ctlr, spi, tfr, cs); in bcm2835_spi_transfer_one()
1099 if (ctlr->can_dma && bcm2835_spi_can_dma(ctlr, spi, tfr)) in bcm2835_spi_transfer_one()
1100 return bcm2835_spi_transfer_one_dma(ctlr, tfr, slv, cs); in bcm2835_spi_transfer_one()
1103 return bcm2835_spi_transfer_one_irq(ctlr, spi, tfr, cs, true); in bcm2835_spi_transfer_one()