Lines Matching +full:spi +full:- +full:slave
1 /* SPDX-License-Identifier: GPL-2.0 */
4 * simple SPI master driver. Two do polled word-at-a-time I/O:
6 * - GPIO/parport bitbangers. Provide chipselect() and txrx_word[](),
7 * expanding the per-word routines from the inline templates below.
9 * - Drivers for controllers resembling bare shift registers. Provide
15 * - Drivers leveraging smarter hardware, with fifos or DMA; or for half
36 * A non-inlined routine would call bitbang_txrx_*() routines. The
47 bitbang_txrx_be_cpha0(struct spi_device *spi, in bitbang_txrx_be_cpha0() argument
53 u32 oldbit = (!(word & (1<<(bits-1)))) << 31; in bitbang_txrx_be_cpha0()
55 for (word <<= (32 - bits); likely(bits); bits--) { in bitbang_txrx_be_cpha0()
57 /* setup MSB (to slave) on trailing edge */ in bitbang_txrx_be_cpha0()
60 setmosi(spi, word & (1 << 31)); in bitbang_txrx_be_cpha0()
66 setsck(spi, !cpol); in bitbang_txrx_be_cpha0()
69 /* sample MSB (from slave) on leading edge */ in bitbang_txrx_be_cpha0()
72 word |= getmiso(spi); in bitbang_txrx_be_cpha0()
73 setsck(spi, cpol); in bitbang_txrx_be_cpha0()
79 bitbang_txrx_be_cpha1(struct spi_device *spi, in bitbang_txrx_be_cpha1() argument
85 u32 oldbit = (!(word & (1<<(bits-1)))) << 31; in bitbang_txrx_be_cpha1()
87 for (word <<= (32 - bits); likely(bits); bits--) { in bitbang_txrx_be_cpha1()
89 /* setup MSB (to slave) on leading edge */ in bitbang_txrx_be_cpha1()
90 setsck(spi, !cpol); in bitbang_txrx_be_cpha1()
93 setmosi(spi, word & (1 << 31)); in bitbang_txrx_be_cpha1()
99 setsck(spi, cpol); in bitbang_txrx_be_cpha1()
102 /* sample MSB (from slave) on trailing edge */ in bitbang_txrx_be_cpha1()
105 word |= getmiso(spi); in bitbang_txrx_be_cpha1()