Lines Matching full:xspi

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