Lines Matching refs:qup
367 struct spi_qup *qup = data; in spi_qup_dma_done() local
369 complete(&qup->done); in spi_qup_dma_done()
417 struct spi_qup *qup = spi_controller_get_devdata(host); in spi_qup_prep_sg() local
433 desc->callback_param = qup; in spi_qup_prep_sg()
474 struct spi_qup *qup = spi_controller_get_devdata(host); in spi_qup_do_dma() local
478 ret = spi_qup_vote_bw(qup, xfer->speed_hz); in spi_qup_do_dma()
480 dev_err(qup->dev, "fail to vote for ICC bandwidth: %d\n", ret); in spi_qup_do_dma()
496 qup->n_words = spi_qup_sgl_get_nents_len(rx_sgl, in spi_qup_do_dma()
497 SPI_MAX_XFER, &rx_nents) / qup->w_size; in spi_qup_do_dma()
499 qup->n_words = spi_qup_sgl_get_nents_len(tx_sgl, in spi_qup_do_dma()
500 SPI_MAX_XFER, &tx_nents) / qup->w_size; in spi_qup_do_dma()
501 if (!qup->n_words) in spi_qup_do_dma()
509 ret = spi_qup_set_state(qup, QUP_STATE_RUN); in spi_qup_do_dma()
511 dev_warn(qup->dev, "cannot set RUN state\n"); in spi_qup_do_dma()
531 if (!wait_for_completion_timeout(&qup->done, timeout)) in spi_qup_do_dma()
548 struct spi_qup *qup = spi_controller_get_devdata(host); in spi_qup_do_pio() local
551 n_words = qup->n_words; in spi_qup_do_pio()
553 qup->rx_buf = xfer->rx_buf; in spi_qup_do_pio()
554 qup->tx_buf = xfer->tx_buf; in spi_qup_do_pio()
558 qup->n_words = SPI_MAX_XFER; in spi_qup_do_pio()
560 qup->n_words = n_words % SPI_MAX_XFER; in spi_qup_do_pio()
562 if (qup->tx_buf && offset) in spi_qup_do_pio()
563 qup->tx_buf = xfer->tx_buf + offset * SPI_MAX_XFER; in spi_qup_do_pio()
565 if (qup->rx_buf && offset) in spi_qup_do_pio()
566 qup->rx_buf = xfer->rx_buf + offset * SPI_MAX_XFER; in spi_qup_do_pio()
572 if (qup->n_words <= (qup->in_fifo_sz / sizeof(u32))) in spi_qup_do_pio()
573 qup->mode = QUP_IO_M_MODE_FIFO; in spi_qup_do_pio()
579 ret = spi_qup_set_state(qup, QUP_STATE_RUN); in spi_qup_do_pio()
581 dev_warn(qup->dev, "cannot set RUN state\n"); in spi_qup_do_pio()
585 ret = spi_qup_set_state(qup, QUP_STATE_PAUSE); in spi_qup_do_pio()
587 dev_warn(qup->dev, "cannot set PAUSE state\n"); in spi_qup_do_pio()
591 if (qup->mode == QUP_IO_M_MODE_FIFO) in spi_qup_do_pio()
592 spi_qup_write(qup); in spi_qup_do_pio()
594 ret = spi_qup_set_state(qup, QUP_STATE_RUN); in spi_qup_do_pio()
596 dev_warn(qup->dev, "cannot set RUN state\n"); in spi_qup_do_pio()
600 if (!wait_for_completion_timeout(&qup->done, timeout)) in spi_qup_do_pio()
918 struct spi_qup *qup = spi_controller_get_devdata(host); in spi_qup_can_dma() local
926 if (qup->qup_v1 && (xfer->len % qup->in_blk_sz)) in spi_qup_can_dma()
934 if (qup->qup_v1 && (xfer->len % qup->out_blk_sz)) in spi_qup_can_dma()
939 if (n_words <= (qup->in_fifo_sz / sizeof(u32))) in spi_qup_can_dma()