Lines Matching refs:tfr

122 	struct spi_transfer *tfr;  member
408 struct spi_transfer *tfr, in bcm2835_spi_transfer_one_irq() argument
482 struct spi_transfer *tfr, in bcm2835_spi_transfer_prologue() argument
488 bs->tfr = tfr; in bcm2835_spi_transfer_prologue()
493 if (bs->tx_buf && !sg_is_last(&tfr->tx_sg.sgl[0])) in bcm2835_spi_transfer_prologue()
494 bs->tx_prologue = sg_dma_len(&tfr->tx_sg.sgl[0]) & 3; in bcm2835_spi_transfer_prologue()
496 if (bs->rx_buf && !sg_is_last(&tfr->rx_sg.sgl[0])) { in bcm2835_spi_transfer_prologue()
497 bs->rx_prologue = sg_dma_len(&tfr->rx_sg.sgl[0]) & 3; in bcm2835_spi_transfer_prologue()
500 if (!bs->tx_buf || sg_is_last(&tfr->tx_sg.sgl[0])) { in bcm2835_spi_transfer_prologue()
505 !(sg_dma_len(&tfr->tx_sg.sgl[0]) & ~3); in bcm2835_spi_transfer_prologue()
527 sg_dma_address(&tfr->rx_sg.sgl[0]), in bcm2835_spi_transfer_prologue()
530 sg_dma_address(&tfr->rx_sg.sgl[0]) += bs->rx_prologue; in bcm2835_spi_transfer_prologue()
531 sg_dma_len(&tfr->rx_sg.sgl[0]) -= bs->rx_prologue; in bcm2835_spi_transfer_prologue()
553 sg_dma_address(&tfr->tx_sg.sgl[0]) += bs->tx_prologue; in bcm2835_spi_transfer_prologue()
554 sg_dma_len(&tfr->tx_sg.sgl[0]) -= bs->tx_prologue; in bcm2835_spi_transfer_prologue()
556 sg_dma_len(&tfr->tx_sg.sgl[0]) = 0; in bcm2835_spi_transfer_prologue()
557 sg_dma_address(&tfr->tx_sg.sgl[1]) += 4; in bcm2835_spi_transfer_prologue()
558 sg_dma_len(&tfr->tx_sg.sgl[1]) -= 4; in bcm2835_spi_transfer_prologue()
572 struct spi_transfer *tfr = bs->tfr; in bcm2835_spi_undo_prologue() local
578 sg_dma_address(&tfr->rx_sg.sgl[0]) -= bs->rx_prologue; in bcm2835_spi_undo_prologue()
579 sg_dma_len(&tfr->rx_sg.sgl[0]) += bs->rx_prologue; in bcm2835_spi_undo_prologue()
586 sg_dma_address(&tfr->tx_sg.sgl[0]) -= bs->tx_prologue; in bcm2835_spi_undo_prologue()
587 sg_dma_len(&tfr->tx_sg.sgl[0]) += bs->tx_prologue; in bcm2835_spi_undo_prologue()
589 sg_dma_len(&tfr->tx_sg.sgl[0]) = bs->tx_prologue - 4; in bcm2835_spi_undo_prologue()
590 sg_dma_address(&tfr->tx_sg.sgl[1]) -= 4; in bcm2835_spi_undo_prologue()
591 sg_dma_len(&tfr->tx_sg.sgl[1]) += 4; in bcm2835_spi_undo_prologue()
668 struct spi_transfer *tfr, in bcm2835_spi_prepare_sg() argument
685 nents = tfr->tx_sg.nents; in bcm2835_spi_prepare_sg()
686 sgl = tfr->tx_sg.sgl; in bcm2835_spi_prepare_sg()
687 flags = tfr->rx_buf ? 0 : DMA_PREP_INTERRUPT; in bcm2835_spi_prepare_sg()
691 nents = tfr->rx_sg.nents; in bcm2835_spi_prepare_sg()
692 sgl = tfr->rx_sg.sgl; in bcm2835_spi_prepare_sg()
707 } else if (!tfr->rx_buf) { in bcm2835_spi_prepare_sg()
767 struct spi_transfer *tfr, in bcm2835_spi_transfer_one_dma() argument
782 bcm2835_spi_transfer_prologue(ctlr, tfr, bs, cs); in bcm2835_spi_transfer_one_dma()
786 ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, true); in bcm2835_spi_transfer_one_dma()
812 ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, false); in bcm2835_spi_transfer_one_dma()
850 struct spi_transfer *tfr) in bcm2835_spi_can_dma() argument
853 if (tfr->len < BCM2835_SPI_DMA_MIN_LENGTH) in bcm2835_spi_can_dma()
995 struct spi_transfer *tfr, in bcm2835_spi_transfer_one_poll() argument
1038 tfr, cs, false); in bcm2835_spi_transfer_one_poll()
1050 struct spi_transfer *tfr) in bcm2835_spi_transfer_one() argument
1059 spi_hz = tfr->speed_hz; in bcm2835_spi_transfer_one()
1073 tfr->effective_speed_hz = cdiv ? (bs->clk_hz / cdiv) : (bs->clk_hz / 65536); in bcm2835_spi_transfer_one()
1077 if (spi->mode & SPI_3WIRE && tfr->rx_buf) in bcm2835_spi_transfer_one()
1081 bs->tx_buf = tfr->tx_buf; in bcm2835_spi_transfer_one()
1082 bs->rx_buf = tfr->rx_buf; in bcm2835_spi_transfer_one()
1083 bs->tx_len = tfr->len; in bcm2835_spi_transfer_one()
1084 bs->rx_len = tfr->len; in bcm2835_spi_transfer_one()
1093 byte_limit = hz_per_byte ? tfr->effective_speed_hz / hz_per_byte : 1; in bcm2835_spi_transfer_one()
1096 if (tfr->len < byte_limit) in bcm2835_spi_transfer_one()
1097 return bcm2835_spi_transfer_one_poll(ctlr, spi, tfr, cs); in bcm2835_spi_transfer_one()
1103 if (ctlr->can_dma && bcm2835_spi_can_dma(ctlr, spi, tfr)) in bcm2835_spi_transfer_one()
1104 return bcm2835_spi_transfer_one_dma(ctlr, tfr, slv, cs); in bcm2835_spi_transfer_one()
1107 return bcm2835_spi_transfer_one_irq(ctlr, spi, tfr, cs, true); in bcm2835_spi_transfer_one()