• Home
  • Raw
  • Download

Lines Matching refs:xfer

147 				       struct spi_transfer *xfer)  in mtk_spi_slave_fifo_transfer()  argument
155 if (xfer->rx_buf) in mtk_spi_slave_fifo_transfer()
157 if (xfer->tx_buf) in mtk_spi_slave_fifo_transfer()
161 cnt = xfer->len / 4; in mtk_spi_slave_fifo_transfer()
162 if (xfer->tx_buf) in mtk_spi_slave_fifo_transfer()
164 xfer->tx_buf, cnt); in mtk_spi_slave_fifo_transfer()
166 remainder = xfer->len % 4; in mtk_spi_slave_fifo_transfer()
167 if (xfer->tx_buf && remainder > 0) { in mtk_spi_slave_fifo_transfer()
169 memcpy(&reg_val, xfer->tx_buf + cnt * 4, remainder); in mtk_spi_slave_fifo_transfer()
184 struct spi_transfer *xfer) in mtk_spi_slave_dma_transfer() argument
192 if (xfer->tx_buf) { in mtk_spi_slave_dma_transfer()
196 void *nonconst_tx = (void *)xfer->tx_buf; in mtk_spi_slave_dma_transfer()
198 xfer->tx_dma = dma_map_single(dev, nonconst_tx, in mtk_spi_slave_dma_transfer()
199 xfer->len, DMA_TO_DEVICE); in mtk_spi_slave_dma_transfer()
200 if (dma_mapping_error(dev, xfer->tx_dma)) { in mtk_spi_slave_dma_transfer()
206 if (xfer->rx_buf) { in mtk_spi_slave_dma_transfer()
207 xfer->rx_dma = dma_map_single(dev, xfer->rx_buf, in mtk_spi_slave_dma_transfer()
208 xfer->len, DMA_FROM_DEVICE); in mtk_spi_slave_dma_transfer()
209 if (dma_mapping_error(dev, xfer->rx_dma)) { in mtk_spi_slave_dma_transfer()
215 writel(xfer->tx_dma, mdata->base + SPIS_TX_SRC_REG); in mtk_spi_slave_dma_transfer()
216 writel(xfer->rx_dma, mdata->base + SPIS_RX_DST_REG); in mtk_spi_slave_dma_transfer()
222 if (xfer->tx_buf) in mtk_spi_slave_dma_transfer()
224 if (xfer->rx_buf) in mtk_spi_slave_dma_transfer()
230 reg_val |= (xfer->len - 1) & TX_DMA_LEN; in mtk_spi_slave_dma_transfer()
234 if (xfer->tx_buf) in mtk_spi_slave_dma_transfer()
236 if (xfer->rx_buf) in mtk_spi_slave_dma_transfer()
248 if (xfer->rx_buf) in mtk_spi_slave_dma_transfer()
249 dma_unmap_single(dev, xfer->rx_dma, in mtk_spi_slave_dma_transfer()
250 xfer->len, DMA_FROM_DEVICE); in mtk_spi_slave_dma_transfer()
253 if (xfer->tx_buf) in mtk_spi_slave_dma_transfer()
254 dma_unmap_single(dev, xfer->tx_dma, in mtk_spi_slave_dma_transfer()
255 xfer->len, DMA_TO_DEVICE); in mtk_spi_slave_dma_transfer()
267 struct spi_transfer *xfer) in mtk_spi_slave_transfer_one() argument
273 mdata->cur_transfer = xfer; in mtk_spi_slave_transfer_one()
275 if (xfer->len > MTK_SPI_SLAVE_MAX_FIFO_SIZE) in mtk_spi_slave_transfer_one()
276 return mtk_spi_slave_dma_transfer(ctlr, spi, xfer); in mtk_spi_slave_transfer_one()
278 return mtk_spi_slave_fifo_transfer(ctlr, spi, xfer); in mtk_spi_slave_transfer_one()