Lines Matching refs:xspi
43 static inline void xtfpga_spi_wait_busy(struct xtfpga_spi *xspi)
47 for (i = 0; xtfpga_spi_read32(xspi, XTFPGA_SPI_BUSY) &&
56 struct xtfpga_spi *xspi = spi_master_get_devdata(spi->master);
58 xspi->data = (xspi->data << bits) | (v & GENMASK(bits - 1, 0));
59 xspi->data_sz += bits;
60 if (xspi->data_sz >= 16) {
61 xtfpga_spi_write32(xspi, XTFPGA_SPI_DATA,
62 xspi->data >> (xspi->data_sz - 16));
63 xspi->data_sz -= 16;
64 xtfpga_spi_write32(xspi, XTFPGA_SPI_START, 1);
65 xtfpga_spi_wait_busy(xspi);
66 xtfpga_spi_write32(xspi, XTFPGA_SPI_START, 0);
74 struct xtfpga_spi *xspi = spi_master_get_devdata(spi->master);
76 WARN_ON(xspi->data_sz != 0);
77 xspi->data_sz = 0;
82 struct xtfpga_spi *xspi;
95 xspi = spi_master_get_devdata(master);
96 xspi->bitbang.master = master;
97 xspi->bitbang.chipselect = xtfpga_spi_chipselect;
98 xspi->bitbang.txrx_word[SPI_MODE_0] = xtfpga_spi_txrx_word;
99 xspi->regs = devm_platform_ioremap_resource(pdev, 0);
100 if (IS_ERR(xspi->regs))
101 return PTR_ERR(xspi->regs);
103 xtfpga_spi_write32(xspi, XTFPGA_SPI_START, 0);
105 if (xtfpga_spi_read32(xspi, XTFPGA_SPI_BUSY)) {
110 ret = spi_bitbang_start(&xspi->bitbang);
123 struct xtfpga_spi *xspi = spi_master_get_devdata(master);
125 spi_bitbang_stop(&xspi->bitbang);