1STRUCT SPI_DRIVER(9) Serial Peripheral Interface (S STRUCT SPI_DRIVER(9)
2
3
4
6 struct_spi_driver - Host side “protocol” driver
7
9 struct spi_driver {
10 const struct spi_device_id * id_table;
11 int (* probe) (struct spi_device *spi);
12 int (* remove) (struct spi_device *spi);
13 void (* shutdown) (struct spi_device *spi);
14 int (* suspend) (struct spi_device *spi, pm_message_t mesg);
15 int (* resume) (struct spi_device *spi);
16 struct device_driver driver;
17 };
18
20 id_table
21 List of SPI devices supported by this driver
22
23 probe
24 Binds this driver to the spi device. Drivers can verify that the
25 device is actually present, and may need to configure
26 characteristics (such as bits_per_word) which weren't needed for
27 the initial configuration done during system setup.
28
29 remove
30 Unbinds this driver from the spi device
31
32 shutdown
33 Standard shutdown callback used during system state transitions
34 such as powerdown/halt and kexec
35
36 suspend
37 Standard suspend callback used during system state transitions
38
39 resume
40 Standard resume callback used during system state transitions
41
42 driver
43 SPI device drivers should initialize the name and owner field of
44 this structure.
45
47 This represents the kind of device driver that uses SPI messages to
48 interact with the hardware at the other end of a SPI link. It's called
49 a “protocol” driver because it works through messages rather than
50 talking directly to SPI hardware (which is what the underlying SPI
51 controller driver does to pass those messages). These protocols are
52 defined in the specification for the device(s) supported by the driver.
53
54 As a rule, those device protocols represent the lowest level interface
55 supported by a driver, and it will support upper level interfaces too.
56 Examples of such upper levels include frameworks like MTD, networking,
57 MMC, RTC, filesystem character device nodes, and hardware monitoring.
58
60Kernel Hackers Manual 3.10 June 2019 STRUCT SPI_DRIVER(9)