<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><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.75.2" /><link rel="home" href="index.html" title="Linux Device Drivers" /><link rel="up" href="ch09.html" title="Chapter 9. Serial Peripheral Interface (SPI)" /><link rel="prev" href="re739.html" title="spi_w8r16" /><link rel="next" href="re741.html" title="spi_register_board_info" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>struct spi_board_info</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re739.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Serial Peripheral Interface (SPI)</th><td width="20%" align="right"> <a accesskey="n" href="re741.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="struct spi_board_info"><a id="API-struct-spi-board-info"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct spi_board_info — board-specific template for a SPI device </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><pre class="programlisting"> struct spi_board_info { char modalias[SPI_NAME_SIZE]; const void * platform_data; void * controller_data; int irq; u32 max_speed_hz; u16 bus_num; u16 chip_select; u8 mode; }; </pre></div><div class="refsect1" title="Members"><a id="id2705901"></a><h2>Members</h2><div class="variablelist"><dl><dt><span class="term">modalias[SPI_NAME_SIZE]</span></dt><dd><p> Initializes spi_device.modalias; identifies the driver. </p></dd><dt><span class="term">platform_data</span></dt><dd><p> Initializes spi_device.platform_data; the particular data stored there is driver-specific. </p></dd><dt><span class="term">controller_data</span></dt><dd><p> Initializes spi_device.controller_data; some controllers need hints about hardware setup, e.g. for DMA. </p></dd><dt><span class="term">irq</span></dt><dd><p> Initializes spi_device.irq; depends on how the board is wired. </p></dd><dt><span class="term">max_speed_hz</span></dt><dd><p> Initializes spi_device.max_speed_hz; based on limits from the chip datasheet and board-specific signal quality issues. </p></dd><dt><span class="term">bus_num</span></dt><dd><p> Identifies which spi_master parents the spi_device; unused by <code class="function">spi_new_device</code>, and otherwise depends on board wiring. </p></dd><dt><span class="term">chip_select</span></dt><dd><p> Initializes spi_device.chip_select; depends on how the board is wired. </p></dd><dt><span class="term">mode</span></dt><dd><p> Initializes spi_device.mode; based on the chip datasheet, board wiring (some devices support both 3WIRE and standard modes), and possibly presence of an inverter in the chipselect path. </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2706021"></a><h2>Description</h2><p> When adding new SPI devices to the device tree, these structures serve as a partial device template. They hold information which can't always be determined by drivers. Information that <code class="function">probe</code> can establish (such as the default transfer wordsize) is not included here. </p><p> These structures are used in two places. Their primary role is to be stored in tables of board-specific device descriptors, which are declared early in board initialization and then used (much later) to populate a controller's device tree after the that controller's driver initializes. A secondary (and atypical) role is as a parameter to <code class="function">spi_new_device</code> call, which happens after those controller drivers are active in some dynamic board configuration models. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re739.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch09.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re741.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>spi_w8r16</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>spi_register_board_info</span></td></tr></table></div></body></html>