1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct spi_board_info</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-spi-w8r16be.html" title="spi_w8r16be"><link rel="next" href="API-spi-register-board-info.html" title="spi_register_board_info"></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_board_info</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-spi-w8r16be.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-register-board-info.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-spi-board-info"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct spi_board_info &#8212; 
2     board-specific template for a SPI device
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct spi_board_info {
5  char modalias[SPI_NAME_SIZE];
6  const void * platform_data;
7  void * controller_data;
8  int irq;
9  u32 max_speed_hz;
10  u16 bus_num;
11  u16 chip_select;
12  u16 mode;
13};  </pre></div><div class="refsect1"><a name="idp1115013820"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">modalias[SPI_NAME_SIZE]</span></dt><dd><p>
14   Initializes spi_device.modalias; identifies the driver.
15      </p></dd><dt><span class="term">platform_data</span></dt><dd><p>
16   Initializes spi_device.platform_data; the particular
17   data stored there is driver-specific.
18      </p></dd><dt><span class="term">controller_data</span></dt><dd><p>
19   Initializes spi_device.controller_data; some
20   controllers need hints about hardware setup, e.g. for DMA.
21      </p></dd><dt><span class="term">irq</span></dt><dd><p>
22   Initializes spi_device.irq; depends on how the board is wired.
23      </p></dd><dt><span class="term">max_speed_hz</span></dt><dd><p>
24   Initializes spi_device.max_speed_hz; based on limits
25   from the chip datasheet and board-specific signal quality issues.
26      </p></dd><dt><span class="term">bus_num</span></dt><dd><p>
27   Identifies which spi_master parents the spi_device; unused
28   by <code class="function">spi_new_device</code>, and otherwise depends on board wiring.
29      </p></dd><dt><span class="term">chip_select</span></dt><dd><p>
30   Initializes spi_device.chip_select; depends on how
31   the board is wired.
32      </p></dd><dt><span class="term">mode</span></dt><dd><p>
33   Initializes spi_device.mode; based on the chip datasheet, board
34   wiring (some devices support both 3WIRE and standard modes), and
35   possibly presence of an inverter in the chipselect path.
36      </p></dd></dl></div></div><div class="refsect1"><a name="idp1115021012"></a><h2>Description</h2><p>
37   When adding new SPI devices to the device tree, these structures serve
38   as a partial device template.  They hold information which can't always
39   be determined by drivers.  Information that <code class="function">probe</code> can establish (such
40   as the default transfer wordsize) is not included here.
41   </p><p>
42
43   These structures are used in two places.  Their primary role is to
44   be stored in tables of board-specific device descriptors, which are
45   declared early in board initialization and then used (much later) to
46   populate a controller's device tree after the that controller's driver
47   initializes.  A secondary (and atypical) role is as a parameter to
48   <code class="function">spi_new_device</code> call, which happens after those controller drivers
49   are active in some dynamic board configuration models.
50</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-spi-w8r16be.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-register-board-info.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">spi_w8r16be</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_register_board_info</span></td></tr></table></div></body></html>
51