1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>snd_mpu401_uart_new</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The ALSA Driver API"><link rel="up" href="ch04s02.html" title="MPU401-UART API"><link rel="prev" href="API-snd-mpu401-uart-interrupt-tx.html" title="snd_mpu401_uart_interrupt_tx"><link rel="next" href="ch05.html" title="Chapter 5. Proc Info API"></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">snd_mpu401_uart_new</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-snd-mpu401-uart-interrupt-tx.html">Prev</a> </td><th width="60%" align="center">MPU401-UART API</th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-snd-mpu401-uart-new"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>snd_mpu401_uart_new — 2 create an MPU401-UART instance 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">snd_mpu401_uart_new </b>(</code></td><td>struct snd_card * <var class="pdparam">card</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">device</var>, </td></tr><tr><td> </td><td>unsigned short <var class="pdparam">hardware</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">port</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">info_flags</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">irq</var>, </td></tr><tr><td> </td><td>struct snd_rawmidi ** <var class="pdparam">rrawmidi</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1094985348"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>card</code></em></span></dt><dd><p> 4 the card instance 5 </p></dd><dt><span class="term"><em class="parameter"><code>device</code></em></span></dt><dd><p> 6 the device index, zero-based 7 </p></dd><dt><span class="term"><em class="parameter"><code>hardware</code></em></span></dt><dd><p> 8 the hardware type, MPU401_HW_XXXX 9 </p></dd><dt><span class="term"><em class="parameter"><code>port</code></em></span></dt><dd><p> 10 the base address of MPU401 port 11 </p></dd><dt><span class="term"><em class="parameter"><code>info_flags</code></em></span></dt><dd><p> 12 bitflags MPU401_INFO_XXX 13 </p></dd><dt><span class="term"><em class="parameter"><code>irq</code></em></span></dt><dd><p> 14 the ISA irq number, -1 if not to be allocated 15 </p></dd><dt><span class="term"><em class="parameter"><code>rrawmidi</code></em></span></dt><dd><p> 16 the pointer to store the new rawmidi instance 17 </p></dd></dl></div></div><div class="refsect1"><a name="idp1094993172"></a><h2>Description</h2><p> 18 Creates a new MPU-401 instance. 19 </p><p> 20 21 Note that the rawmidi instance is returned on the rrawmidi argument, 22 not the mpu401 instance itself. To access to the mpu401 instance, 23 cast from rawmidi->private_data (with struct snd_mpu401 magic-cast). 24</p></div><div class="refsect1"><a name="idp1094994284"></a><h2>Return</h2><p> 25 Zero if successful, or a negative error code. 26</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-snd-mpu401-uart-interrupt-tx.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04s02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">snd_mpu401_uart_interrupt_tx</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. Proc Info API</td></tr></table></div></body></html> 27