Lines Matching defs:spi
17 #include <linux/spi/spi.h>
154 static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer);
445 static int spi_qup_do_dma(struct spi_device *spi, struct spi_transfer *xfer,
449 struct spi_master *master = spi->master;
474 ret = spi_qup_io_config(spi, xfer);
514 static int spi_qup_do_pio(struct spi_device *spi, struct spi_transfer *xfer,
517 struct spi_master *master = spi->master;
545 ret = spi_qup_io_config(spi, xfer);
661 static int spi_qup_io_prep(struct spi_device *spi, struct spi_transfer *xfer)
663 struct spi_qup *controller = spi_master_get_devdata(spi->master);
666 if (spi->mode & SPI_LOOP && xfer->len > controller->in_fifo_sz) {
684 else if (spi->master->can_dma &&
685 spi->master->can_dma(spi->master, spi, xfer) &&
686 spi->master->cur_msg_mapped)
694 /* prep qup for another spi transaction of specific type */
695 static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)
697 struct spi_qup *controller = spi_master_get_devdata(spi->master);
783 if (spi->mode & SPI_CPOL)
792 if (spi->mode & SPI_LOOP)
797 if (spi->mode & SPI_CPHA)
803 * HS_MODE improves signal stability for spi-clk high rates,
806 if ((xfer->speed_hz >= SPI_HS_MIN_RATE) && !(spi->mode & SPI_LOOP))
846 struct spi_device *spi,
853 ret = spi_qup_io_prep(spi, xfer);
872 ret = spi_qup_do_dma(spi, xfer, timeout);
874 ret = spi_qup_do_pio(spi, xfer, timeout);
888 static bool spi_qup_can_dma(struct spi_master *master, struct spi_device *spi,
928 struct spi_qup *spi = spi_master_get_devdata(master);
929 struct dma_slave_config *rx_conf = &spi->rx_conf,
930 *tx_conf = &spi->tx_conf;
931 struct device *dev = spi->dev;
949 rx_conf->src_maxburst = spi->in_blk_sz;
954 tx_conf->dst_maxburst = spi->out_blk_sz;
977 static void spi_qup_set_cs(struct spi_device *spi, bool val)
983 controller = spi_master_get_devdata(spi->master);
1025 if (of_property_read_u32(dev->of_node, "spi-max-frequency", &max_freq))
1302 { .compatible = "qcom,spi-qup-v1.1.1", .data = (void *)1, },
1303 { .compatible = "qcom,spi-qup-v2.1.1", },
1304 { .compatible = "qcom,spi-qup-v2.2.1", },