Sophie

Sophie

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

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>request_threaded_irq</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="The Linux Kernel API" /><link rel="up" href="hardware.html#idm139749896835088" title="Interrupt Handling" /><link rel="prev" href="API-free-irq.html" title="free_irq" /><link rel="next" href="API-request-any-context-irq.html" title="request_any_context_irq" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">request_threaded_irq</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-free-irq.html">Prev</a>&#160;</td><th width="60%" align="center">Interrupt Handling</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-request-any-context-irq.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="API-request-threaded-irq"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>request_threaded_irq &#8212; 
     allocate an interrupt line
 </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 <strong class="fsfunc">request_threaded_irq </strong>(</code></td><td>unsigned int <var class="pdparam">irq</var>, </td></tr><tr><td>&#160;</td><td>irq_handler_t <var class="pdparam">handler</var>, </td></tr><tr><td>&#160;</td><td>irq_handler_t <var class="pdparam">thread_fn</var>, </td></tr><tr><td>&#160;</td><td>unsigned long <var class="pdparam">irqflags</var>, </td></tr><tr><td>&#160;</td><td>const char * <var class="pdparam">devname</var>, </td></tr><tr><td>&#160;</td><td>void * <var class="pdparam">dev_id</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a id="idm139749896676144"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>irq</code></em></span></dt><dd><p>
     Interrupt line to allocate
    </p></dd><dt><span class="term"><em class="parameter"><code>handler</code></em></span></dt><dd><p>
     Function to be called when the IRQ occurs.
     Primary handler for threaded interrupts
     If NULL and thread_fn != NULL the default
     primary handler is installed
    </p></dd><dt><span class="term"><em class="parameter"><code>thread_fn</code></em></span></dt><dd><p>
     Function called from the irq handler thread
     If NULL, no irq thread is created
    </p></dd><dt><span class="term"><em class="parameter"><code>irqflags</code></em></span></dt><dd><p>
     Interrupt type flags
    </p></dd><dt><span class="term"><em class="parameter"><code>devname</code></em></span></dt><dd><p>
     An ascii name for the claiming device
    </p></dd><dt><span class="term"><em class="parameter"><code>dev_id</code></em></span></dt><dd><p>
     A cookie passed back to the handler function
    </p></dd></dl></div></div><div class="refsect1"><a id="idm139749896662656"></a><h2>Description</h2><p>
   This call allocates interrupt resources and enables the
   interrupt line and IRQ handling. From the point this
   call is made your handler function may be invoked. Since
   your handler function must clear any interrupt the board
   raises, you must take care both to initialise your hardware
   and to set up the interrupt handler in the right order.
   </p><p>

   If you want to set up a threaded irq handler for your device
   then you need to supply <em class="parameter"><code>handler</code></em> and <em class="parameter"><code>thread_fn</code></em>. <em class="parameter"><code>handler</code></em> is
   still called in hard interrupt context and has to check
   whether the interrupt originates from the device. If yes it
   needs to disable the interrupt on the device and return
   IRQ_WAKE_THREAD which will wake up the handler thread and run
   <em class="parameter"><code>thread_fn</code></em>. This split handler design is necessary to support
   shared interrupts.
   </p><p>

   Dev_id must be globally unique. Normally the address of the
   device data structure is used as the cookie. Since the handler
   receives this value it makes sense to use it.
   </p><p>

   If your interrupt is shared you must pass a non NULL dev_id
   as this is required when freeing the interrupt.
</p></div><div class="refsect1"><a id="idm139749896656736"></a><h2>Flags</h2><p>
   </p><p>

   IRQF_SHARED		Interrupt is shared
   IRQF_TRIGGER_*		Specify active edge(s) or level
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-free-irq.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="hardware.html#idm139749896835088">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-request-any-context-irq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">free_irq</span>&#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">request_any_context_irq</span></td></tr></table></div></body></html>