Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > 2c51d8eb79f8810ada971ee8c30ce1e5 > files > 4112

kernel-doc-2.6.32-71.14.1.el6.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>Chapter&#160;3.&#160;Management of Cards and Components</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="Writing an ALSA Driver" /><link rel="up" href="index.html" title="Writing an ALSA Driver" /><link rel="prev" href="ch02s05.html" title="Header Files" /><link rel="next" href="ch03s02.html" title="Components" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;3.&#160;Management of Cards and Components</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter&#160;3.&#160;Management of Cards and Components"><div class="titlepage"><div><div><h2 class="title"><a id="card-management"></a>Chapter&#160;3.&#160;Management of Cards and Components</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch03.html#card-management-card-instance">Card Instance</a></span></dt><dt><span class="section"><a href="ch03s02.html">Components</a></span></dt><dt><span class="section"><a href="ch03s03.html">Chip-Specific Data</a></span></dt><dd><dl><dt><span class="section"><a href="ch03s03.html#card-management-chip-specific-snd-card-new">1. Allocating via <code class="function">snd_card_create()</code>.</a></span></dt><dt><span class="section"><a href="ch03s03.html#card-management-chip-specific-allocate-extra">2. Allocating an extra device.</a></span></dt></dl></dd><dt><span class="section"><a href="ch03s04.html">Registration and Release</a></span></dt></dl></div><div class="section" title="Card Instance"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="card-management-card-instance"></a>Card Instance</h2></div></div></div><p>
      For each soundcard, a <span class="quote">&#8220;<span class="quote">card</span>&#8221;</span> record must be allocated.
      </p><p>
      A card record is the headquarters of the soundcard.  It manages
      the whole list of devices (components) on the soundcard, such as
      PCM, mixers, MIDI, synthesizer, and so on.  Also, the card
      record holds the ID and the name strings of the card, manages
      the root of proc files, and controls the power-management states
      and hotplug disconnections.  The component list on the card
      record is used to manage the correct release of resources at
      destruction. 
      </p><p>
        As mentioned above, to create a card instance, call
      <code class="function">snd_card_create()</code>.

        </p><div class="informalexample"><pre class="programlisting">

  struct snd_card *card;
  int err;
  err = snd_card_create(index, id, module, extra_size, &amp;card);

          </pre></div><p>
      </p><p>
        The function takes five arguments, the card-index number, the
        id string, the module pointer (usually
        <code class="constant">THIS_MODULE</code>),
        the size of extra-data space, and the pointer to return the
        card instance.  The extra_size argument is used to
        allocate card-&gt;private_data for the
        chip-specific data.  Note that these data
        are allocated by <code class="function">snd_card_create()</code>.
      </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Header Files&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Components</td></tr></table></div></body></html>