1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Driver with A Single Source File</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Writing an ALSA Driver"><link rel="up" href="how-to-put-your-driver.html" title="Chapter&#160;15.&#160;How To Put Your Driver Into ALSA Tree"><link rel="prev" href="how-to-put-your-driver.html" title="Chapter&#160;15.&#160;How To Put Your Driver Into ALSA Tree"><link rel="next" href="ch15s03.html" title="Drivers with Several Source Files"></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">Driver with A Single Source File</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="how-to-put-your-driver.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;15.&#160;How To Put Your Driver Into ALSA Tree</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch15s03.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1094434828"></a>Driver with A Single Source File</h2></div></div></div><p>
2	</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
3	Modify alsa-driver/pci/Makefile
4	</p><p>
5	Suppose you have a file xyz.c.  Add the following
6	two lines
7      </p><div class="informalexample"><pre class="programlisting">
8
9  snd-xyz-objs := xyz.o
10  obj-$(CONFIG_SND_XYZ) += snd-xyz.o
11
12        </pre></div><p>
13	</p></li><li class="listitem"><p>
14	Create the Kconfig entry
15	</p><p>
16	Add the new entry of Kconfig for your xyz driver.
17      </p><div class="informalexample"><pre class="programlisting">
18
19  config SND_XYZ
20          tristate "Foobar XYZ"
21          depends on SND
22          select SND_PCM
23          help
24            Say Y here to include support for Foobar XYZ soundcard.
25
26            To compile this driver as a module, choose M here: the module
27            will be called snd-xyz.
28
29        </pre></div><p>
30
31	the line, select SND_PCM, specifies that the driver xyz supports
32	PCM.  In addition to SND_PCM, the following components are
33	supported for select command:
34	SND_RAWMIDI, SND_TIMER, SND_HWDEP, SND_MPU401_UART,
35	SND_OPL3_LIB, SND_OPL4_LIB, SND_VX_LIB, SND_AC97_CODEC.
36	Add the select command for each supported component.
37	</p><p>
38	Note that some selections imply the lowlevel selections.
39	For example, PCM includes TIMER, MPU401_UART includes RAWMIDI,
40	AC97_CODEC includes PCM, and OPL3_LIB includes HWDEP.
41	You don't need to give the lowlevel selections again.
42	</p><p>
43	For the details of Kconfig script, refer to the kbuild
44	documentation.
45	</p></li><li class="listitem"><p>
46	Run cvscompile script to re-generate the configure script and
47	build the whole stuff again.
48	</p></li></ol></div><p>
49	</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="how-to-put-your-driver.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="how-to-put-your-driver.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch15s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;15.&#160;How To Put Your Driver Into ALSA Tree&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Drivers with Several Source Files</td></tr></table></div></body></html>
50