Sophie

Sophie

distrib > Fedora > 18 > x86_64 > media > updates > by-pkgid > 1a595394b241504ff370a8d12ebfcea7 > files > 1537

kernel-doc-3.11.10-100.fc18.noarch.rpm

<?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_device</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="spi.html" title="Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)" /><link rel="next" href="API-struct-spi-driver.html" title="struct spi_driver" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct spi_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="spi.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-struct-spi-driver.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="API-struct-spi-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct spi_device &#8212; 
  Master side proxy for an SPI slave device
 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
struct spi_device {
  struct device dev;
  struct spi_master * master;
  u32 max_speed_hz;
  u8 chip_select;
  u8 mode;
#define SPI_CPHA	0x01
#define SPI_CPOL	0x02
#define SPI_MODE_0	(0|0)
#define SPI_MODE_1	(0|SPI_CPHA)
#define SPI_MODE_2	(SPI_CPOL|0)
#define SPI_MODE_3	(SPI_CPOL|SPI_CPHA)
#define SPI_CS_HIGH	0x04
#define SPI_LSB_FIRST	0x08
#define SPI_3WIRE	0x10
#define SPI_LOOP	0x20
#define SPI_NO_CS	0x40
#define SPI_READY	0x80
  u8 bits_per_word;
  int irq;
  void * controller_state;
  void * controller_data;
  char modalias[SPI_NAME_SIZE];
  int cs_gpio;
};  </pre></div><div class="refsect1"><a id="idm140404953585840"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">dev</span></dt><dd><p>
Driver model representation of the device.
      </p></dd><dt><span class="term">master</span></dt><dd><p>
SPI controller used with the device.
      </p></dd><dt><span class="term">max_speed_hz</span></dt><dd><p>
Maximum clock rate to be used with this chip
(on this board); may be changed by the device's driver.
The spi_transfer.speed_hz can override this for each transfer.
      </p></dd><dt><span class="term">chip_select</span></dt><dd><p>
Chipselect, distinguishing chips handled by <em class="parameter"><code>master</code></em>.
      </p></dd><dt><span class="term">mode</span></dt><dd><p>
The spi mode defines how data is clocked out and in.
This may be changed by the device's driver.
The <span class="quote">&#8220;<span class="quote">active low</span>&#8221;</span> default for chipselect mode can be overridden
(by specifying SPI_CS_HIGH) as can the <span class="quote">&#8220;<span class="quote">MSB first</span>&#8221;</span> default for
each word in a transfer (by specifying SPI_LSB_FIRST).
      </p></dd><dt><span class="term">bits_per_word</span></dt><dd><p>
Data transfers involve one or more words; word sizes
like eight or 12 bits are common.  In-memory wordsizes are
powers of two bytes (e.g. 20 bit samples use 32 bits).
This may be changed by the device's driver, or left at the
default (0) indicating protocol words are eight bit bytes.
The spi_transfer.bits_per_word can override this for each transfer.
      </p></dd><dt><span class="term">irq</span></dt><dd><p>
Negative, or the number passed to <code class="function">request_irq</code> to receive
interrupts from this device.
      </p></dd><dt><span class="term">controller_state</span></dt><dd><p>
Controller's runtime state
      </p></dd><dt><span class="term">controller_data</span></dt><dd><p>
Board-specific definitions for controller, such as
FIFO initialization parameters; from board_info.controller_data
      </p></dd><dt><span class="term">modalias[SPI_NAME_SIZE]</span></dt><dd><p>
Name of the driver to use with this device, or an alias
for that name.  This appears in the sysfs <span class="quote">&#8220;<span class="quote">modalias</span>&#8221;</span> attribute
for driver coldplugging, and in uevents used for hotplugging
      </p></dd><dt><span class="term">cs_gpio</span></dt><dd><p>
gpio number of the chipselect line (optional, -ENOENT when
when not using a GPIO line)
      </p></dd></dl></div></div><div class="refsect1"><a id="idm140404953565936"></a><h2>Description</h2><p>
   A <em class="parameter"><code>spi_device</code></em> is used to interchange data between an SPI slave
   (usually a discrete chip) and CPU memory.
   </p><p>

   In <em class="parameter"><code>dev</code></em>, the platform_data is used to hold information about this
   device that's meaningful to the device's protocol driver, but not
   to its controller.  One example might be an identifier for a chip
   variant with slightly different functionality; another might be
   information about how this particular board wires the chip's pins.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spi.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-struct-spi-driver.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)&#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">struct spi_driver</span></td></tr></table></div></body></html>