1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct spi_driver</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="spi.html" title="Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)"><link rel="prev" href="API-struct-spi-device.html" title="struct spi_device"><link rel="next" href="API-spi-unregister-driver.html" title="spi_unregister_driver"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct spi_driver</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-spi-device.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-spi-unregister-driver.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-spi-driver"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct spi_driver &#8212; 
2     Host side <span class="quote">&#8220;<span class="quote">protocol</span>&#8221;</span> driver
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct spi_driver {
5  const struct spi_device_id * id_table;
6  int (* probe) (struct spi_device *spi);
7  int (* remove) (struct spi_device *spi);
8  void (* shutdown) (struct spi_device *spi);
9  struct device_driver driver;
10};  </pre></div><div class="refsect1"><a name="idp1114834252"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">id_table</span></dt><dd><p>
11   List of SPI devices supported by this driver
12      </p></dd><dt><span class="term">probe</span></dt><dd><p>
13   Binds this driver to the spi device.  Drivers can verify
14   that the device is actually present, and may need to configure
15   characteristics (such as bits_per_word) which weren't needed for
16   the initial configuration done during system setup.
17      </p></dd><dt><span class="term">remove</span></dt><dd><p>
18   Unbinds this driver from the spi device
19      </p></dd><dt><span class="term">shutdown</span></dt><dd><p>
20   Standard shutdown callback used during system state
21   transitions such as powerdown/halt and kexec
22      </p></dd><dt><span class="term">driver</span></dt><dd><p>
23   SPI device drivers should initialize the name and owner
24   field of this structure.
25      </p></dd></dl></div></div><div class="refsect1"><a name="idp1114838732"></a><h2>Description</h2><p>
26   This represents the kind of device driver that uses SPI messages to
27   interact with the hardware at the other end of a SPI link.  It's called
28   a <span class="quote">&#8220;<span class="quote">protocol</span>&#8221;</span> driver because it works through messages rather than talking
29   directly to SPI hardware (which is what the underlying SPI controller
30   driver does to pass those messages).  These protocols are defined in the
31   specification for the device(s) supported by the driver.
32   </p><p>
33
34   As a rule, those device protocols represent the lowest level interface
35   supported by a driver, and it will support upper level interfaces too.
36   Examples of such upper levels include frameworks like MTD, networking,
37   MMC, RTC, filesystem character device nodes, and hardware monitoring.
38</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-spi-device.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="spi.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-spi-unregister-driver.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct spi_device</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">spi_unregister_driver</span></td></tr></table></div></body></html>
39