1SPI_SETUP(9) Serial Peripheral Interface (S SPI_SETUP(9)
2
3
4
6 spi_setup - setup SPI mode and clock rate
7
9 int spi_setup(struct spi_device * spi);
10
12 spi
13 the device whose settings are being modified
14
16 can sleep, and no requests are queued to the device
17
19 SPI protocol drivers may need to update the transfer mode if the device
20 doesn´t work with its default. They may likewise need to update clock
21 rates or word sizes from initial values. This function changes those
22 settings, and must be called from a context that can sleep. Except for
23 SPI_CS_HIGH, which takes effect immediately, the changes take effect
24 the next time the device is selected and data is transferred to or from
25 it. When this function returns, the spi device is deselected.
26
27 Note that this call will fail if the protocol driver specifies an
28 option that the underlying controller or its driver does not support.
29 For example, not all hardware supports wire transfers using nine bit
30 words, LSB-first wire encoding, or active-high chipselects.
31
33Kernel Hackers Manual 2.6. June 2019 SPI_SETUP(9)