Lines Matching defs:xfer
142 * @workqueue: Work queue for the SPI xfer requests.
146 * @queue: To log SPI xfer requests.
153 * @xfer_completion: To indicate completion of xfer task.
156 * @cur_speed: Stores the active xfer clock speed.
234 struct spi_transfer *xfer, int dma_mode)
249 /* Always shift in data in FIFO, even if xfer is Tx only,
254 writel(((xfer->len * 8 / sdd->cur_bpw) & 0xffff)
259 if (xfer->tx_buf != NULL) {
266 xfer->tx_dma, xfer->len);
269 unsigned char *buf = (unsigned char *) xfer->tx_buf;
271 while (i < xfer->len)
276 if (xfer->rx_buf != NULL) {
286 writel(((xfer->len * 8 / sdd->cur_bpw) & 0xffff)
291 xfer->rx_dma, xfer->len);
320 struct spi_transfer *xfer, int dma_mode)
327 /* millisecs to xfer 'len' bytes @ 'cur_speed' */
328 ms = xfer->len * 8 * 1000 / sdd->cur_speed;
339 } while (RX_FIFO_LVL(status, sci) < xfer->len && --val);
355 if (xfer->rx_buf == NULL) {
373 if (xfer->rx_buf == NULL) {
379 buf = xfer->rx_buf;
380 while (i < xfer->len)
503 struct spi_transfer *xfer;
508 /* First mark all xfer unmapped */
509 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
510 xfer->rx_dma = XFER_DMAADDR_INVALID;
511 xfer->tx_dma = XFER_DMAADDR_INVALID;
515 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
517 if (xfer->tx_buf != NULL) {
518 xfer->tx_dma = dma_map_single(dev,
519 (void *)xfer->tx_buf, xfer->len,
521 if (dma_mapping_error(dev, xfer->tx_dma)) {
523 xfer->tx_dma = XFER_DMAADDR_INVALID;
528 if (xfer->rx_buf != NULL) {
529 xfer->rx_dma = dma_map_single(dev, xfer->rx_buf,
530 xfer->len, DMA_FROM_DEVICE);
531 if (dma_mapping_error(dev, xfer->rx_dma)) {
533 dma_unmap_single(dev, xfer->tx_dma,
534 xfer->len, DMA_TO_DEVICE);
535 xfer->tx_dma = XFER_DMAADDR_INVALID;
536 xfer->rx_dma = XFER_DMAADDR_INVALID;
549 struct spi_transfer *xfer;
554 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
556 if (xfer->rx_buf != NULL
557 && xfer->rx_dma != XFER_DMAADDR_INVALID)
558 dma_unmap_single(dev, xfer->rx_dma,
559 xfer->len, DMA_FROM_DEVICE);
561 if (xfer->tx_buf != NULL
562 && xfer->tx_dma != XFER_DMAADDR_INVALID)
563 dma_unmap_single(dev, xfer->tx_dma,
564 xfer->len, DMA_TO_DEVICE);
574 struct spi_transfer *xfer;
600 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
608 bpw = xfer->bits_per_word ? : spi->bits_per_word;
609 speed = xfer->speed_hz ? : spi->max_speed_hz;
618 if (xfer->len <= ((sci->fifo_lvl_mask >> 1) + 1))
629 enable_datapath(sdd, spi, xfer, use_dma);
639 status = wait_for_xfer(sdd, xfer, use_dma);
647 xfer->rx_buf ? 1 : 0, xfer->tx_buf ? 1 : 0,
650 xfer->len);
653 if (xfer->tx_buf != NULL
657 if (xfer->rx_buf != NULL
666 if (xfer->delay_usecs)
667 udelay(xfer->delay_usecs);
669 if (xfer->cs_change) {
672 if (list_is_last(&xfer->transfer_list,
679 msg->actual_length += xfer->len;