1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4
5<book id="Generic-IRQ-Guide">
6 <bookinfo>
7  <title>Linux generic IRQ handling</title>
8
9  <authorgroup>
10   <author>
11    <firstname>Thomas</firstname>
12    <surname>Gleixner</surname>
13    <affiliation>
14     <address>
15      <email>tglx@linutronix.de</email>
16     </address>
17    </affiliation>
18   </author>
19   <author>
20    <firstname>Ingo</firstname>
21    <surname>Molnar</surname>
22    <affiliation>
23     <address>
24      <email>mingo@elte.hu</email>
25     </address>
26    </affiliation>
27   </author>
28  </authorgroup>
29
30  <copyright>
31   <year>2005-2010</year>
32   <holder>Thomas Gleixner</holder>
33  </copyright>
34  <copyright>
35   <year>2005-2006</year>
36   <holder>Ingo Molnar</holder>
37  </copyright>
38
39  <legalnotice>
40   <para>
41     This documentation is free software; you can redistribute
42     it and/or modify it under the terms of the GNU General Public
43     License version 2 as published by the Free Software Foundation.
44   </para>
45
46   <para>
47     This program is distributed in the hope that it will be
48     useful, but WITHOUT ANY WARRANTY; without even the implied
49     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
50     See the GNU General Public License for more details.
51   </para>
52
53   <para>
54     You should have received a copy of the GNU General Public
55     License along with this program; if not, write to the Free
56     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
57     MA 02111-1307 USA
58   </para>
59
60   <para>
61     For more details see the file COPYING in the source
62     distribution of Linux.
63   </para>
64  </legalnotice>
65 </bookinfo>
66
67<toc></toc>
68
69  <chapter id="intro">
70    <title>Introduction</title>
71    <para>
72	The generic interrupt handling layer is designed to provide a
73	complete abstraction of interrupt handling for device drivers.
74	It is able to handle all the different types of interrupt controller
75	hardware. Device drivers use generic API functions to request, enable,
76	disable and free interrupts. The drivers do not have to know anything
77	about interrupt hardware details, so they can be used on different
78	platforms without code changes.
79    </para>
80    <para>
81  	This documentation is provided to developers who want to implement
82	an interrupt subsystem based for their architecture, with the help
83	of the generic IRQ handling layer.
84    </para>
85  </chapter>
86
87  <chapter id="rationale">
88    <title>Rationale</title>
89	<para>
90	The original implementation of interrupt handling in Linux uses
91	the __do_IRQ() super-handler, which is able to deal with every
92	type of interrupt logic.
93	</para>
94	<para>
95	Originally, Russell King identified different types of handlers to
96	build a quite universal set for the ARM interrupt handler
97	implementation in Linux 2.5/2.6. He distinguished between:
98	<itemizedlist>
99	  <listitem><para>Level type</para></listitem>
100	  <listitem><para>Edge type</para></listitem>
101	  <listitem><para>Simple type</para></listitem>
102	</itemizedlist>
103	During the implementation we identified another type:
104	<itemizedlist>
105	  <listitem><para>Fast EOI type</para></listitem>
106	</itemizedlist>
107	In the SMP world of the __do_IRQ() super-handler another type
108	was identified:
109	<itemizedlist>
110	  <listitem><para>Per CPU type</para></listitem>
111	</itemizedlist>
112	</para>
113	<para>
114	This split implementation of high-level IRQ handlers allows us to
115	optimize the flow of the interrupt handling for each specific
116	interrupt type. This reduces complexity in that particular code path
117	and allows the optimized handling of a given type.
118	</para>
119	<para>
120	The original general IRQ implementation used hw_interrupt_type
121	structures and their ->ack(), ->end() [etc.] callbacks to
122	differentiate the flow control in the super-handler. This leads to
123	a mix of flow logic and low-level hardware logic, and it also leads
124	to unnecessary code duplication: for example in i386, there is an
125	ioapic_level_irq and an ioapic_edge_irq IRQ-type which share many
126	of the low-level details but have different flow handling.
127	</para>
128	<para>
129	A more natural abstraction is the clean separation of the
130	'irq flow' and the 'chip details'.
131	</para>
132	<para>
133	Analysing a couple of architecture's IRQ subsystem implementations
134	reveals that most of them can use a generic set of 'irq flow'
135	methods and only need to add the chip-level specific code.
136	The separation is also valuable for (sub)architectures
137	which need specific quirks in the IRQ flow itself but not in the
138	chip details - and thus provides a more transparent IRQ subsystem
139	design.
140	</para>
141	<para>
142	Each interrupt descriptor is assigned its own high-level flow
143	handler, which is normally one of the generic
144	implementations. (This high-level flow handler implementation also
145	makes it simple to provide demultiplexing handlers which can be
146	found in embedded platforms on various architectures.)
147	</para>
148	<para>
149	The separation makes the generic interrupt handling layer more
150	flexible and extensible. For example, an (sub)architecture can
151	use a generic IRQ-flow implementation for 'level type' interrupts
152	and add a (sub)architecture specific 'edge type' implementation.
153	</para>
154	<para>
155	To make the transition to the new model easier and prevent the
156	breakage of existing implementations, the __do_IRQ() super-handler
157	is still available. This leads to a kind of duality for the time
158	being. Over time the new model should be used in more and more
159	architectures, as it enables smaller and cleaner IRQ subsystems.
160	It's deprecated for three years now and about to be removed.
161	</para>
162  </chapter>
163  <chapter id="bugs">
164    <title>Known Bugs And Assumptions</title>
165    <para>
166	None (knock on wood).
167    </para>
168  </chapter>
169
170  <chapter id="Abstraction">
171    <title>Abstraction layers</title>
172    <para>
173	There are three main levels of abstraction in the interrupt code:
174	<orderedlist>
175	  <listitem><para>High-level driver API</para></listitem>
176	  <listitem><para>High-level IRQ flow handlers</para></listitem>
177	  <listitem><para>Chip-level hardware encapsulation</para></listitem>
178	</orderedlist>
179    </para>
180    <sect1 id="Interrupt_control_flow">
181	<title>Interrupt control flow</title>
182	<para>
183	Each interrupt is described by an interrupt descriptor structure
184	irq_desc. The interrupt is referenced by an 'unsigned int' numeric
185	value which selects the corresponding interrupt description structure
186	in the descriptor structures array.
187	The descriptor structure contains status information and pointers
188	to the interrupt flow method and the interrupt chip structure
189	which are assigned to this interrupt.
190	</para>
191	<para>
192	Whenever an interrupt triggers, the low-level architecture code calls
193	into the generic interrupt code by calling desc->handle_irq().
194	This high-level IRQ handling function only uses desc->irq_data.chip
195	primitives referenced by the assigned chip descriptor structure.
196	</para>
197    </sect1>
198    <sect1 id="Highlevel_Driver_API">
199	<title>High-level Driver API</title>
200	<para>
201	  The high-level Driver API consists of following functions:
202	  <itemizedlist>
203	  <listitem><para>request_irq()</para></listitem>
204	  <listitem><para>free_irq()</para></listitem>
205	  <listitem><para>disable_irq()</para></listitem>
206	  <listitem><para>enable_irq()</para></listitem>
207	  <listitem><para>disable_irq_nosync() (SMP only)</para></listitem>
208	  <listitem><para>synchronize_irq() (SMP only)</para></listitem>
209	  <listitem><para>irq_set_irq_type()</para></listitem>
210	  <listitem><para>irq_set_irq_wake()</para></listitem>
211	  <listitem><para>irq_set_handler_data()</para></listitem>
212	  <listitem><para>irq_set_chip()</para></listitem>
213	  <listitem><para>irq_set_chip_data()</para></listitem>
214          </itemizedlist>
215	  See the autogenerated function documentation for details.
216	</para>
217    </sect1>
218    <sect1 id="Highlevel_IRQ_flow_handlers">
219	<title>High-level IRQ flow handlers</title>
220	<para>
221	  The generic layer provides a set of pre-defined irq-flow methods:
222	  <itemizedlist>
223	  <listitem><para>handle_level_irq</para></listitem>
224	  <listitem><para>handle_edge_irq</para></listitem>
225	  <listitem><para>handle_fasteoi_irq</para></listitem>
226	  <listitem><para>handle_simple_irq</para></listitem>
227	  <listitem><para>handle_percpu_irq</para></listitem>
228	  <listitem><para>handle_edge_eoi_irq</para></listitem>
229	  <listitem><para>handle_bad_irq</para></listitem>
230	  </itemizedlist>
231	  The interrupt flow handlers (either pre-defined or architecture
232	  specific) are assigned to specific interrupts by the architecture
233	  either during bootup or during device initialization.
234	</para>
235	<sect2 id="Default_flow_implementations">
236	<title>Default flow implementations</title>
237	    <sect3 id="Helper_functions">
238	 	<title>Helper functions</title>
239		<para>
240		The helper functions call the chip primitives and
241		are used by the default flow implementations.
242		The following helper functions are implemented (simplified excerpt):
243		<programlisting>
244default_enable(struct irq_data *data)
245{
246	desc->irq_data.chip->irq_unmask(data);
247}
248
249default_disable(struct irq_data *data)
250{
251	if (!delay_disable(data))
252		desc->irq_data.chip->irq_mask(data);
253}
254
255default_ack(struct irq_data *data)
256{
257	chip->irq_ack(data);
258}
259
260default_mask_ack(struct irq_data *data)
261{
262	if (chip->irq_mask_ack) {
263		chip->irq_mask_ack(data);
264	} else {
265		chip->irq_mask(data);
266		chip->irq_ack(data);
267	}
268}
269
270noop(struct irq_data *data))
271{
272}
273
274		</programlisting>
275	        </para>
276	    </sect3>
277	</sect2>
278	<sect2 id="Default_flow_handler_implementations">
279	<title>Default flow handler implementations</title>
280	    <sect3 id="Default_Level_IRQ_flow_handler">
281	 	<title>Default Level IRQ flow handler</title>
282		<para>
283		handle_level_irq provides a generic implementation
284		for level-triggered interrupts.
285		</para>
286		<para>
287		The following control flow is implemented (simplified excerpt):
288		<programlisting>
289desc->irq_data.chip->irq_mask_ack();
290handle_irq_event(desc->action);
291desc->irq_data.chip->irq_unmask();
292		</programlisting>
293		</para>
294	    </sect3>
295	    <sect3 id="Default_FASTEOI_IRQ_flow_handler">
296		<title>Default Fast EOI IRQ flow handler</title>
297		<para>
298		handle_fasteoi_irq provides a generic implementation
299		for interrupts, which only need an EOI at the end of
300		the handler.
301		</para>
302		<para>
303		The following control flow is implemented (simplified excerpt):
304		<programlisting>
305handle_irq_event(desc->action);
306desc->irq_data.chip->irq_eoi();
307		</programlisting>
308		</para>
309	    </sect3>
310	    <sect3 id="Default_Edge_IRQ_flow_handler">
311	 	<title>Default Edge IRQ flow handler</title>
312		<para>
313		handle_edge_irq provides a generic implementation
314		for edge-triggered interrupts.
315		</para>
316		<para>
317		The following control flow is implemented (simplified excerpt):
318		<programlisting>
319if (desc->status &amp; running) {
320	desc->irq_data.chip->irq_mask_ack();
321	desc->status |= pending | masked;
322	return;
323}
324desc->irq_data.chip->irq_ack();
325desc->status |= running;
326do {
327	if (desc->status &amp; masked)
328		desc->irq_data.chip->irq_unmask();
329	desc->status &amp;= ~pending;
330	handle_irq_event(desc->action);
331} while (status &amp; pending);
332desc->status &amp;= ~running;
333		</programlisting>
334		</para>
335   	    </sect3>
336	    <sect3 id="Default_simple_IRQ_flow_handler">
337	 	<title>Default simple IRQ flow handler</title>
338		<para>
339		handle_simple_irq provides a generic implementation
340		for simple interrupts.
341		</para>
342		<para>
343		Note: The simple flow handler does not call any
344		handler/chip primitives.
345		</para>
346		<para>
347		The following control flow is implemented (simplified excerpt):
348		<programlisting>
349handle_irq_event(desc->action);
350		</programlisting>
351		</para>
352   	    </sect3>
353	    <sect3 id="Default_per_CPU_flow_handler">
354	 	<title>Default per CPU flow handler</title>
355		<para>
356		handle_percpu_irq provides a generic implementation
357		for per CPU interrupts.
358		</para>
359		<para>
360		Per CPU interrupts are only available on SMP and
361		the handler provides a simplified version without
362		locking.
363		</para>
364		<para>
365		The following control flow is implemented (simplified excerpt):
366		<programlisting>
367if (desc->irq_data.chip->irq_ack)
368	desc->irq_data.chip->irq_ack();
369handle_irq_event(desc->action);
370if (desc->irq_data.chip->irq_eoi)
371        desc->irq_data.chip->irq_eoi();
372		</programlisting>
373		</para>
374   	    </sect3>
375	    <sect3 id="EOI_Edge_IRQ_flow_handler">
376	 	<title>EOI Edge IRQ flow handler</title>
377		<para>
378		handle_edge_eoi_irq provides an abnomination of the edge
379		handler which is solely used to tame a badly wreckaged
380		irq controller on powerpc/cell.
381		</para>
382   	    </sect3>
383	    <sect3 id="BAD_IRQ_flow_handler">
384	 	<title>Bad IRQ flow handler</title>
385		<para>
386		handle_bad_irq is used for spurious interrupts which
387		have no real handler assigned..
388		</para>
389   	    </sect3>
390	</sect2>
391	<sect2 id="Quirks_and_optimizations">
392	<title>Quirks and optimizations</title>
393	<para>
394	The generic functions are intended for 'clean' architectures and chips,
395	which have no platform-specific IRQ handling quirks. If an architecture
396	needs to implement quirks on the 'flow' level then it can do so by
397	overriding the high-level irq-flow handler.
398	</para>
399	</sect2>
400	<sect2 id="Delayed_interrupt_disable">
401	<title>Delayed interrupt disable</title>
402	<para>
403	This per interrupt selectable feature, which was introduced by Russell
404	King in the ARM interrupt implementation, does not mask an interrupt
405	at the hardware level when disable_irq() is called. The interrupt is
406	kept enabled and is masked in the flow handler when an interrupt event
407	happens. This prevents losing edge interrupts on hardware which does
408	not store an edge interrupt event while the interrupt is disabled at
409	the hardware level. When an interrupt arrives while the IRQ_DISABLED
410	flag is set, then the interrupt is masked at the hardware level and
411	the IRQ_PENDING bit is set. When the interrupt is re-enabled by
412	enable_irq() the pending bit is checked and if it is set, the
413	interrupt is resent either via hardware or by a software resend
414	mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when
415	you want to use the delayed interrupt disable feature and your
416	hardware is not capable of retriggering	an interrupt.)
417	The delayed interrupt disable is not configurable.
418	</para>
419	</sect2>
420    </sect1>
421    <sect1 id="Chiplevel_hardware_encapsulation">
422	<title>Chip-level hardware encapsulation</title>
423	<para>
424	The chip-level hardware descriptor structure irq_chip
425	contains all the direct chip relevant functions, which
426	can be utilized by the irq flow implementations.
427	  <itemizedlist>
428	  <listitem><para>irq_ack()</para></listitem>
429	  <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem>
430	  <listitem><para>irq_mask()</para></listitem>
431	  <listitem><para>irq_unmask()</para></listitem>
432	  <listitem><para>irq_eoi() - Optional, required for EOI flow handlers</para></listitem>
433	  <listitem><para>irq_retrigger() - Optional</para></listitem>
434	  <listitem><para>irq_set_type() - Optional</para></listitem>
435	  <listitem><para>irq_set_wake() - Optional</para></listitem>
436	  </itemizedlist>
437	These primitives are strictly intended to mean what they say: ack means
438	ACK, masking means masking of an IRQ line, etc. It is up to the flow
439	handler(s) to use these basic units of low-level functionality.
440	</para>
441    </sect1>
442  </chapter>
443
444  <chapter id="doirq">
445     <title>__do_IRQ entry point</title>
446     <para>
447	The original implementation __do_IRQ() was an alternative entry
448	point for all types of interrupts. It no longer exists.
449     </para>
450     <para>
451	This handler turned out to be not suitable for all
452	interrupt hardware and was therefore reimplemented with split
453	functionality for edge/level/simple/percpu interrupts. This is not
454	only a functional optimization. It also shortens code paths for
455	interrupts.
456      </para>
457  </chapter>
458
459  <chapter id="locking">
460     <title>Locking on SMP</title>
461     <para>
462	The locking of chip registers is up to the architecture that
463	defines the chip primitives. The per-irq structure is
464	protected via desc->lock, by the generic layer.
465     </para>
466  </chapter>
467
468  <chapter id="genericchip">
469     <title>Generic interrupt chip</title>
470     <para>
471       To avoid copies of identical implementations of IRQ chips the
472       core provides a configurable generic interrupt chip
473       implementation. Developers should check carefully whether the
474       generic chip fits their needs before implementing the same
475       functionality slightly differently themselves.
476     </para>
477<!-- kernel/irq/generic-chip.c -->
478<refentry id="API-irq-gc-mask-set-bit">
479<refentryinfo>
480 <title>LINUX</title>
481 <productname>Kernel Hackers Manual</productname>
482 <date>July 2017</date>
483</refentryinfo>
484<refmeta>
485 <refentrytitle><phrase>irq_gc_mask_set_bit</phrase></refentrytitle>
486 <manvolnum>9</manvolnum>
487 <refmiscinfo class="version">4.1.27</refmiscinfo>
488</refmeta>
489<refnamediv>
490 <refname>irq_gc_mask_set_bit</refname>
491 <refpurpose>
492  Mask chip via setting bit in mask register
493 </refpurpose>
494</refnamediv>
495<refsynopsisdiv>
496 <title>Synopsis</title>
497  <funcsynopsis><funcprototype>
498   <funcdef>void <function>irq_gc_mask_set_bit </function></funcdef>
499   <paramdef>struct irq_data * <parameter>d</parameter></paramdef>
500  </funcprototype></funcsynopsis>
501</refsynopsisdiv>
502<refsect1>
503 <title>Arguments</title>
504 <variablelist>
505  <varlistentry>
506   <term><parameter>d</parameter></term>
507   <listitem>
508    <para>
509     irq_data
510    </para>
511   </listitem>
512  </varlistentry>
513 </variablelist>
514</refsect1>
515<refsect1>
516<title>Description</title>
517<para>
518   Chip has a single mask register. Values of this register are cached
519   and protected by gc-&gt;lock
520</para>
521</refsect1>
522</refentry>
523
524<refentry id="API-irq-gc-mask-clr-bit">
525<refentryinfo>
526 <title>LINUX</title>
527 <productname>Kernel Hackers Manual</productname>
528 <date>July 2017</date>
529</refentryinfo>
530<refmeta>
531 <refentrytitle><phrase>irq_gc_mask_clr_bit</phrase></refentrytitle>
532 <manvolnum>9</manvolnum>
533 <refmiscinfo class="version">4.1.27</refmiscinfo>
534</refmeta>
535<refnamediv>
536 <refname>irq_gc_mask_clr_bit</refname>
537 <refpurpose>
538     Mask chip via clearing bit in mask register
539 </refpurpose>
540</refnamediv>
541<refsynopsisdiv>
542 <title>Synopsis</title>
543  <funcsynopsis><funcprototype>
544   <funcdef>void <function>irq_gc_mask_clr_bit </function></funcdef>
545   <paramdef>struct irq_data * <parameter>d</parameter></paramdef>
546  </funcprototype></funcsynopsis>
547</refsynopsisdiv>
548<refsect1>
549 <title>Arguments</title>
550 <variablelist>
551  <varlistentry>
552   <term><parameter>d</parameter></term>
553   <listitem>
554    <para>
555     irq_data
556    </para>
557   </listitem>
558  </varlistentry>
559 </variablelist>
560</refsect1>
561<refsect1>
562<title>Description</title>
563<para>
564   Chip has a single mask register. Values of this register are cached
565   and protected by gc-&gt;lock
566</para>
567</refsect1>
568</refentry>
569
570<refentry id="API-irq-gc-ack-set-bit">
571<refentryinfo>
572 <title>LINUX</title>
573 <productname>Kernel Hackers Manual</productname>
574 <date>July 2017</date>
575</refentryinfo>
576<refmeta>
577 <refentrytitle><phrase>irq_gc_ack_set_bit</phrase></refentrytitle>
578 <manvolnum>9</manvolnum>
579 <refmiscinfo class="version">4.1.27</refmiscinfo>
580</refmeta>
581<refnamediv>
582 <refname>irq_gc_ack_set_bit</refname>
583 <refpurpose>
584     Ack pending interrupt via setting bit
585 </refpurpose>
586</refnamediv>
587<refsynopsisdiv>
588 <title>Synopsis</title>
589  <funcsynopsis><funcprototype>
590   <funcdef>void <function>irq_gc_ack_set_bit </function></funcdef>
591   <paramdef>struct irq_data * <parameter>d</parameter></paramdef>
592  </funcprototype></funcsynopsis>
593</refsynopsisdiv>
594<refsect1>
595 <title>Arguments</title>
596 <variablelist>
597  <varlistentry>
598   <term><parameter>d</parameter></term>
599   <listitem>
600    <para>
601     irq_data
602    </para>
603   </listitem>
604  </varlistentry>
605 </variablelist>
606</refsect1>
607</refentry>
608
609<refentry id="API-irq-alloc-generic-chip">
610<refentryinfo>
611 <title>LINUX</title>
612 <productname>Kernel Hackers Manual</productname>
613 <date>July 2017</date>
614</refentryinfo>
615<refmeta>
616 <refentrytitle><phrase>irq_alloc_generic_chip</phrase></refentrytitle>
617 <manvolnum>9</manvolnum>
618 <refmiscinfo class="version">4.1.27</refmiscinfo>
619</refmeta>
620<refnamediv>
621 <refname>irq_alloc_generic_chip</refname>
622 <refpurpose>
623     Allocate a generic chip and initialize it
624 </refpurpose>
625</refnamediv>
626<refsynopsisdiv>
627 <title>Synopsis</title>
628  <funcsynopsis><funcprototype>
629   <funcdef>struct irq_chip_generic * <function>irq_alloc_generic_chip </function></funcdef>
630   <paramdef>const char * <parameter>name</parameter></paramdef>
631   <paramdef>int <parameter>num_ct</parameter></paramdef>
632   <paramdef>unsigned int <parameter>irq_base</parameter></paramdef>
633   <paramdef>void __iomem * <parameter>reg_base</parameter></paramdef>
634   <paramdef>irq_flow_handler_t <parameter>handler</parameter></paramdef>
635  </funcprototype></funcsynopsis>
636</refsynopsisdiv>
637<refsect1>
638 <title>Arguments</title>
639 <variablelist>
640  <varlistentry>
641   <term><parameter>name</parameter></term>
642   <listitem>
643    <para>
644     Name of the irq chip
645    </para>
646   </listitem>
647  </varlistentry>
648  <varlistentry>
649   <term><parameter>num_ct</parameter></term>
650   <listitem>
651    <para>
652     Number of irq_chip_type instances associated with this
653    </para>
654   </listitem>
655  </varlistentry>
656  <varlistentry>
657   <term><parameter>irq_base</parameter></term>
658   <listitem>
659    <para>
660     Interrupt base nr for this chip
661    </para>
662   </listitem>
663  </varlistentry>
664  <varlistentry>
665   <term><parameter>reg_base</parameter></term>
666   <listitem>
667    <para>
668     Register base address (virtual)
669    </para>
670   </listitem>
671  </varlistentry>
672  <varlistentry>
673   <term><parameter>handler</parameter></term>
674   <listitem>
675    <para>
676     Default flow handler associated with this chip
677    </para>
678   </listitem>
679  </varlistentry>
680 </variablelist>
681</refsect1>
682<refsect1>
683<title>Description</title>
684<para>
685   Returns an initialized irq_chip_generic structure. The chip defaults
686   to the primary (index 0) irq_chip_type and <parameter>handler</parameter>
687</para>
688</refsect1>
689</refentry>
690
691<refentry id="API-irq-alloc-domain-generic-chips">
692<refentryinfo>
693 <title>LINUX</title>
694 <productname>Kernel Hackers Manual</productname>
695 <date>July 2017</date>
696</refentryinfo>
697<refmeta>
698 <refentrytitle><phrase>irq_alloc_domain_generic_chips</phrase></refentrytitle>
699 <manvolnum>9</manvolnum>
700 <refmiscinfo class="version">4.1.27</refmiscinfo>
701</refmeta>
702<refnamediv>
703 <refname>irq_alloc_domain_generic_chips</refname>
704 <refpurpose>
705     Allocate generic chips for an irq domain
706 </refpurpose>
707</refnamediv>
708<refsynopsisdiv>
709 <title>Synopsis</title>
710  <funcsynopsis><funcprototype>
711   <funcdef>int <function>irq_alloc_domain_generic_chips </function></funcdef>
712   <paramdef>struct irq_domain * <parameter>d</parameter></paramdef>
713   <paramdef>int <parameter>irqs_per_chip</parameter></paramdef>
714   <paramdef>int <parameter>num_ct</parameter></paramdef>
715   <paramdef>const char * <parameter>name</parameter></paramdef>
716   <paramdef>irq_flow_handler_t <parameter>handler</parameter></paramdef>
717   <paramdef>unsigned int <parameter>clr</parameter></paramdef>
718   <paramdef>unsigned int <parameter>set</parameter></paramdef>
719   <paramdef>enum irq_gc_flags <parameter>gcflags</parameter></paramdef>
720  </funcprototype></funcsynopsis>
721</refsynopsisdiv>
722<refsect1>
723 <title>Arguments</title>
724 <variablelist>
725  <varlistentry>
726   <term><parameter>d</parameter></term>
727   <listitem>
728    <para>
729     irq domain for which to allocate chips
730    </para>
731   </listitem>
732  </varlistentry>
733  <varlistentry>
734   <term><parameter>irqs_per_chip</parameter></term>
735   <listitem>
736    <para>
737     Number of interrupts each chip handles
738    </para>
739   </listitem>
740  </varlistentry>
741  <varlistentry>
742   <term><parameter>num_ct</parameter></term>
743   <listitem>
744    <para>
745     Number of irq_chip_type instances associated with this
746    </para>
747   </listitem>
748  </varlistentry>
749  <varlistentry>
750   <term><parameter>name</parameter></term>
751   <listitem>
752    <para>
753     Name of the irq chip
754    </para>
755   </listitem>
756  </varlistentry>
757  <varlistentry>
758   <term><parameter>handler</parameter></term>
759   <listitem>
760    <para>
761     Default flow handler associated with these chips
762    </para>
763   </listitem>
764  </varlistentry>
765  <varlistentry>
766   <term><parameter>clr</parameter></term>
767   <listitem>
768    <para>
769     IRQ_* bits to clear in the mapping function
770    </para>
771   </listitem>
772  </varlistentry>
773  <varlistentry>
774   <term><parameter>set</parameter></term>
775   <listitem>
776    <para>
777     IRQ_* bits to set in the mapping function
778    </para>
779   </listitem>
780  </varlistentry>
781  <varlistentry>
782   <term><parameter>gcflags</parameter></term>
783   <listitem>
784    <para>
785     Generic chip specific setup flags
786    </para>
787   </listitem>
788  </varlistentry>
789 </variablelist>
790</refsect1>
791</refentry>
792
793<refentry id="API-irq-get-domain-generic-chip">
794<refentryinfo>
795 <title>LINUX</title>
796 <productname>Kernel Hackers Manual</productname>
797 <date>July 2017</date>
798</refentryinfo>
799<refmeta>
800 <refentrytitle><phrase>irq_get_domain_generic_chip</phrase></refentrytitle>
801 <manvolnum>9</manvolnum>
802 <refmiscinfo class="version">4.1.27</refmiscinfo>
803</refmeta>
804<refnamediv>
805 <refname>irq_get_domain_generic_chip</refname>
806 <refpurpose>
807     Get a pointer to the generic chip of a hw_irq
808 </refpurpose>
809</refnamediv>
810<refsynopsisdiv>
811 <title>Synopsis</title>
812  <funcsynopsis><funcprototype>
813   <funcdef>struct irq_chip_generic * <function>irq_get_domain_generic_chip </function></funcdef>
814   <paramdef>struct irq_domain * <parameter>d</parameter></paramdef>
815   <paramdef>unsigned int <parameter>hw_irq</parameter></paramdef>
816  </funcprototype></funcsynopsis>
817</refsynopsisdiv>
818<refsect1>
819 <title>Arguments</title>
820 <variablelist>
821  <varlistentry>
822   <term><parameter>d</parameter></term>
823   <listitem>
824    <para>
825     irq domain pointer
826    </para>
827   </listitem>
828  </varlistentry>
829  <varlistentry>
830   <term><parameter>hw_irq</parameter></term>
831   <listitem>
832    <para>
833     Hardware interrupt number
834    </para>
835   </listitem>
836  </varlistentry>
837 </variablelist>
838</refsect1>
839</refentry>
840
841<refentry id="API-irq-setup-generic-chip">
842<refentryinfo>
843 <title>LINUX</title>
844 <productname>Kernel Hackers Manual</productname>
845 <date>July 2017</date>
846</refentryinfo>
847<refmeta>
848 <refentrytitle><phrase>irq_setup_generic_chip</phrase></refentrytitle>
849 <manvolnum>9</manvolnum>
850 <refmiscinfo class="version">4.1.27</refmiscinfo>
851</refmeta>
852<refnamediv>
853 <refname>irq_setup_generic_chip</refname>
854 <refpurpose>
855     Setup a range of interrupts with a generic chip
856 </refpurpose>
857</refnamediv>
858<refsynopsisdiv>
859 <title>Synopsis</title>
860  <funcsynopsis><funcprototype>
861   <funcdef>void <function>irq_setup_generic_chip </function></funcdef>
862   <paramdef>struct irq_chip_generic * <parameter>gc</parameter></paramdef>
863   <paramdef>u32 <parameter>msk</parameter></paramdef>
864   <paramdef>enum irq_gc_flags <parameter>flags</parameter></paramdef>
865   <paramdef>unsigned int <parameter>clr</parameter></paramdef>
866   <paramdef>unsigned int <parameter>set</parameter></paramdef>
867  </funcprototype></funcsynopsis>
868</refsynopsisdiv>
869<refsect1>
870 <title>Arguments</title>
871 <variablelist>
872  <varlistentry>
873   <term><parameter>gc</parameter></term>
874   <listitem>
875    <para>
876     Generic irq chip holding all data
877    </para>
878   </listitem>
879  </varlistentry>
880  <varlistentry>
881   <term><parameter>msk</parameter></term>
882   <listitem>
883    <para>
884     Bitmask holding the irqs to initialize relative to gc-&gt;irq_base
885    </para>
886   </listitem>
887  </varlistentry>
888  <varlistentry>
889   <term><parameter>flags</parameter></term>
890   <listitem>
891    <para>
892     Flags for initialization
893    </para>
894   </listitem>
895  </varlistentry>
896  <varlistentry>
897   <term><parameter>clr</parameter></term>
898   <listitem>
899    <para>
900     IRQ_* bits to clear
901    </para>
902   </listitem>
903  </varlistentry>
904  <varlistentry>
905   <term><parameter>set</parameter></term>
906   <listitem>
907    <para>
908     IRQ_* bits to set
909    </para>
910   </listitem>
911  </varlistentry>
912 </variablelist>
913</refsect1>
914<refsect1>
915<title>Description</title>
916<para>
917   Set up max. 32 interrupts starting from gc-&gt;irq_base. Note, this
918   initializes all interrupts to the primary irq_chip_type and its
919   associated handler.
920</para>
921</refsect1>
922</refentry>
923
924<refentry id="API-irq-setup-alt-chip">
925<refentryinfo>
926 <title>LINUX</title>
927 <productname>Kernel Hackers Manual</productname>
928 <date>July 2017</date>
929</refentryinfo>
930<refmeta>
931 <refentrytitle><phrase>irq_setup_alt_chip</phrase></refentrytitle>
932 <manvolnum>9</manvolnum>
933 <refmiscinfo class="version">4.1.27</refmiscinfo>
934</refmeta>
935<refnamediv>
936 <refname>irq_setup_alt_chip</refname>
937 <refpurpose>
938     Switch to alternative chip
939 </refpurpose>
940</refnamediv>
941<refsynopsisdiv>
942 <title>Synopsis</title>
943  <funcsynopsis><funcprototype>
944   <funcdef>int <function>irq_setup_alt_chip </function></funcdef>
945   <paramdef>struct irq_data * <parameter>d</parameter></paramdef>
946   <paramdef>unsigned int <parameter>type</parameter></paramdef>
947  </funcprototype></funcsynopsis>
948</refsynopsisdiv>
949<refsect1>
950 <title>Arguments</title>
951 <variablelist>
952  <varlistentry>
953   <term><parameter>d</parameter></term>
954   <listitem>
955    <para>
956     irq_data for this interrupt
957    </para>
958   </listitem>
959  </varlistentry>
960  <varlistentry>
961   <term><parameter>type</parameter></term>
962   <listitem>
963    <para>
964     Flow type to be initialized
965    </para>
966   </listitem>
967  </varlistentry>
968 </variablelist>
969</refsect1>
970<refsect1>
971<title>Description</title>
972<para>
973   Only to be called from chip-&gt;<function>irq_set_type</function> callbacks.
974</para>
975</refsect1>
976</refentry>
977
978<refentry id="API-irq-remove-generic-chip">
979<refentryinfo>
980 <title>LINUX</title>
981 <productname>Kernel Hackers Manual</productname>
982 <date>July 2017</date>
983</refentryinfo>
984<refmeta>
985 <refentrytitle><phrase>irq_remove_generic_chip</phrase></refentrytitle>
986 <manvolnum>9</manvolnum>
987 <refmiscinfo class="version">4.1.27</refmiscinfo>
988</refmeta>
989<refnamediv>
990 <refname>irq_remove_generic_chip</refname>
991 <refpurpose>
992     Remove a chip
993 </refpurpose>
994</refnamediv>
995<refsynopsisdiv>
996 <title>Synopsis</title>
997  <funcsynopsis><funcprototype>
998   <funcdef>void <function>irq_remove_generic_chip </function></funcdef>
999   <paramdef>struct irq_chip_generic * <parameter>gc</parameter></paramdef>
1000   <paramdef>u32 <parameter>msk</parameter></paramdef>
1001   <paramdef>unsigned int <parameter>clr</parameter></paramdef>
1002   <paramdef>unsigned int <parameter>set</parameter></paramdef>
1003  </funcprototype></funcsynopsis>
1004</refsynopsisdiv>
1005<refsect1>
1006 <title>Arguments</title>
1007 <variablelist>
1008  <varlistentry>
1009   <term><parameter>gc</parameter></term>
1010   <listitem>
1011    <para>
1012     Generic irq chip holding all data
1013    </para>
1014   </listitem>
1015  </varlistentry>
1016  <varlistentry>
1017   <term><parameter>msk</parameter></term>
1018   <listitem>
1019    <para>
1020     Bitmask holding the irqs to initialize relative to gc-&gt;irq_base
1021    </para>
1022   </listitem>
1023  </varlistentry>
1024  <varlistentry>
1025   <term><parameter>clr</parameter></term>
1026   <listitem>
1027    <para>
1028     IRQ_* bits to clear
1029    </para>
1030   </listitem>
1031  </varlistentry>
1032  <varlistentry>
1033   <term><parameter>set</parameter></term>
1034   <listitem>
1035    <para>
1036     IRQ_* bits to set
1037    </para>
1038   </listitem>
1039  </varlistentry>
1040 </variablelist>
1041</refsect1>
1042<refsect1>
1043<title>Description</title>
1044<para>
1045   Remove up to 32 interrupts starting from gc-&gt;irq_base.
1046</para>
1047</refsect1>
1048</refentry>
1049
1050  </chapter>
1051
1052  <chapter id="structs">
1053     <title>Structures</title>
1054     <para>
1055     This chapter contains the autogenerated documentation of the structures which are
1056     used in the generic IRQ layer.
1057     </para>
1058<!-- include/linux/irq.h -->
1059<refentry id="API-struct-irq-data">
1060<refentryinfo>
1061 <title>LINUX</title>
1062 <productname>Kernel Hackers Manual</productname>
1063 <date>July 2017</date>
1064</refentryinfo>
1065<refmeta>
1066 <refentrytitle><phrase>struct irq_data</phrase></refentrytitle>
1067 <manvolnum>9</manvolnum>
1068 <refmiscinfo class="version">4.1.27</refmiscinfo>
1069</refmeta>
1070<refnamediv>
1071 <refname>struct irq_data</refname>
1072 <refpurpose>
1073  per irq and irq chip data passed down to chip functions
1074 </refpurpose>
1075</refnamediv>
1076<refsynopsisdiv>
1077 <title>Synopsis</title>
1078  <programlisting>
1079struct irq_data {
1080  u32 mask;
1081  unsigned int irq;
1082  unsigned long hwirq;
1083  unsigned int node;
1084  unsigned int state_use_accessors;
1085  struct irq_chip * chip;
1086  struct irq_domain * domain;
1087#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
1088  struct irq_data * parent_data;
1089#endif
1090  void * handler_data;
1091  void * chip_data;
1092  struct msi_desc * msi_desc;
1093  cpumask_var_t affinity;
1094};  </programlisting>
1095</refsynopsisdiv>
1096 <refsect1>
1097  <title>Members</title>
1098  <variablelist>
1099    <varlistentry>      <term>mask</term>
1100      <listitem><para>
1101precomputed bitmask for accessing the chip registers
1102      </para></listitem>
1103    </varlistentry>
1104    <varlistentry>      <term>irq</term>
1105      <listitem><para>
1106interrupt number
1107      </para></listitem>
1108    </varlistentry>
1109    <varlistentry>      <term>hwirq</term>
1110      <listitem><para>
1111hardware interrupt number, local to the interrupt domain
1112      </para></listitem>
1113    </varlistentry>
1114    <varlistentry>      <term>node</term>
1115      <listitem><para>
1116node index useful for balancing
1117      </para></listitem>
1118    </varlistentry>
1119    <varlistentry>      <term>state_use_accessors</term>
1120      <listitem><para>
1121status information for irq chip functions.
1122Use accessor functions to deal with it
1123      </para></listitem>
1124    </varlistentry>
1125    <varlistentry>      <term>chip</term>
1126      <listitem><para>
1127low level interrupt hardware access
1128      </para></listitem>
1129    </varlistentry>
1130    <varlistentry>      <term>domain</term>
1131      <listitem><para>
1132Interrupt translation domain; responsible for mapping
1133between hwirq number and linux irq number.
1134      </para></listitem>
1135    </varlistentry>
1136    <varlistentry>      <term>parent_data</term>
1137      <listitem><para>
1138pointer to parent struct irq_data to support hierarchy
1139irq_domain
1140      </para></listitem>
1141    </varlistentry>
1142    <varlistentry>      <term>handler_data</term>
1143      <listitem><para>
1144per-IRQ data for the irq_chip methods
1145      </para></listitem>
1146    </varlistentry>
1147    <varlistentry>      <term>chip_data</term>
1148      <listitem><para>
1149platform-specific per-chip private data for the chip
1150methods, to allow shared chip implementations
1151      </para></listitem>
1152    </varlistentry>
1153    <varlistentry>      <term>msi_desc</term>
1154      <listitem><para>
1155MSI descriptor
1156      </para></listitem>
1157    </varlistentry>
1158    <varlistentry>      <term>affinity</term>
1159      <listitem><para>
1160IRQ affinity on SMP
1161      </para></listitem>
1162    </varlistentry>
1163  </variablelist>
1164 </refsect1>
1165<refsect1>
1166<title>Description</title>
1167<para>
1168   The fields here need to overlay the ones in irq_desc until we
1169   cleaned up the direct references and switched everything over to
1170   irq_data.
1171</para>
1172</refsect1>
1173</refentry>
1174
1175<refentry id="API-struct-irq-chip">
1176<refentryinfo>
1177 <title>LINUX</title>
1178 <productname>Kernel Hackers Manual</productname>
1179 <date>July 2017</date>
1180</refentryinfo>
1181<refmeta>
1182 <refentrytitle><phrase>struct irq_chip</phrase></refentrytitle>
1183 <manvolnum>9</manvolnum>
1184 <refmiscinfo class="version">4.1.27</refmiscinfo>
1185</refmeta>
1186<refnamediv>
1187 <refname>struct irq_chip</refname>
1188 <refpurpose>
1189     hardware interrupt chip descriptor
1190 </refpurpose>
1191</refnamediv>
1192<refsynopsisdiv>
1193 <title>Synopsis</title>
1194  <programlisting>
1195struct irq_chip {
1196  const char * name;
1197  unsigned int	(* irq_startup) (struct irq_data *data);
1198  void (* irq_shutdown) (struct irq_data *data);
1199  void (* irq_enable) (struct irq_data *data);
1200  void (* irq_disable) (struct irq_data *data);
1201  void (* irq_ack) (struct irq_data *data);
1202  void (* irq_mask) (struct irq_data *data);
1203  void (* irq_mask_ack) (struct irq_data *data);
1204  void (* irq_unmask) (struct irq_data *data);
1205  void (* irq_eoi) (struct irq_data *data);
1206  int (* irq_set_affinity) (struct irq_data *data, const struct cpumask *dest, bool force);
1207  int (* irq_retrigger) (struct irq_data *data);
1208  int (* irq_set_type) (struct irq_data *data, unsigned int flow_type);
1209  int (* irq_set_wake) (struct irq_data *data, unsigned int on);
1210  void (* irq_bus_lock) (struct irq_data *data);
1211  void (* irq_bus_sync_unlock) (struct irq_data *data);
1212  void (* irq_cpu_online) (struct irq_data *data);
1213  void (* irq_cpu_offline) (struct irq_data *data);
1214  void (* irq_suspend) (struct irq_data *data);
1215  void (* irq_resume) (struct irq_data *data);
1216  void (* irq_pm_shutdown) (struct irq_data *data);
1217  void (* irq_calc_mask) (struct irq_data *data);
1218  void (* irq_print_chip) (struct irq_data *data, struct seq_file *p);
1219  int (* irq_request_resources) (struct irq_data *data);
1220  void (* irq_release_resources) (struct irq_data *data);
1221  void (* irq_compose_msi_msg) (struct irq_data *data, struct msi_msg *msg);
1222  void (* irq_write_msi_msg) (struct irq_data *data, struct msi_msg *msg);
1223  int (* irq_get_irqchip_state) (struct irq_data *data, enum irqchip_irq_state which, bool *state);
1224  int (* irq_set_irqchip_state) (struct irq_data *data, enum irqchip_irq_state which, bool state);
1225  unsigned long flags;
1226};  </programlisting>
1227</refsynopsisdiv>
1228 <refsect1>
1229  <title>Members</title>
1230  <variablelist>
1231    <varlistentry>      <term>name</term>
1232      <listitem><para>
1233   name for /proc/interrupts
1234      </para></listitem>
1235    </varlistentry>
1236    <varlistentry>      <term>irq_startup</term>
1237      <listitem><para>
1238   start up the interrupt (defaults to -&gt;enable if NULL)
1239      </para></listitem>
1240    </varlistentry>
1241    <varlistentry>      <term>irq_shutdown</term>
1242      <listitem><para>
1243   shut down the interrupt (defaults to -&gt;disable if NULL)
1244      </para></listitem>
1245    </varlistentry>
1246    <varlistentry>      <term>irq_enable</term>
1247      <listitem><para>
1248   enable the interrupt (defaults to chip-&gt;unmask if NULL)
1249      </para></listitem>
1250    </varlistentry>
1251    <varlistentry>      <term>irq_disable</term>
1252      <listitem><para>
1253   disable the interrupt
1254      </para></listitem>
1255    </varlistentry>
1256    <varlistentry>      <term>irq_ack</term>
1257      <listitem><para>
1258   start of a new interrupt
1259      </para></listitem>
1260    </varlistentry>
1261    <varlistentry>      <term>irq_mask</term>
1262      <listitem><para>
1263   mask an interrupt source
1264      </para></listitem>
1265    </varlistentry>
1266    <varlistentry>      <term>irq_mask_ack</term>
1267      <listitem><para>
1268   ack and mask an interrupt source
1269      </para></listitem>
1270    </varlistentry>
1271    <varlistentry>      <term>irq_unmask</term>
1272      <listitem><para>
1273   unmask an interrupt source
1274      </para></listitem>
1275    </varlistentry>
1276    <varlistentry>      <term>irq_eoi</term>
1277      <listitem><para>
1278   end of interrupt
1279      </para></listitem>
1280    </varlistentry>
1281    <varlistentry>      <term>irq_set_affinity</term>
1282      <listitem><para>
1283   set the CPU affinity on SMP machines
1284      </para></listitem>
1285    </varlistentry>
1286    <varlistentry>      <term>irq_retrigger</term>
1287      <listitem><para>
1288   resend an IRQ to the CPU
1289      </para></listitem>
1290    </varlistentry>
1291    <varlistentry>      <term>irq_set_type</term>
1292      <listitem><para>
1293   set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
1294      </para></listitem>
1295    </varlistentry>
1296    <varlistentry>      <term>irq_set_wake</term>
1297      <listitem><para>
1298   enable/disable power-management wake-on of an IRQ
1299      </para></listitem>
1300    </varlistentry>
1301    <varlistentry>      <term>irq_bus_lock</term>
1302      <listitem><para>
1303   function to lock access to slow bus (i2c) chips
1304      </para></listitem>
1305    </varlistentry>
1306    <varlistentry>      <term>irq_bus_sync_unlock</term>
1307      <listitem><para>
1308   function to sync and unlock slow bus (i2c) chips
1309      </para></listitem>
1310    </varlistentry>
1311    <varlistentry>      <term>irq_cpu_online</term>
1312      <listitem><para>
1313   configure an interrupt source for a secondary CPU
1314      </para></listitem>
1315    </varlistentry>
1316    <varlistentry>      <term>irq_cpu_offline</term>
1317      <listitem><para>
1318   un-configure an interrupt source for a secondary CPU
1319      </para></listitem>
1320    </varlistentry>
1321    <varlistentry>      <term>irq_suspend</term>
1322      <listitem><para>
1323   function called from core code on suspend once per chip
1324      </para></listitem>
1325    </varlistentry>
1326    <varlistentry>      <term>irq_resume</term>
1327      <listitem><para>
1328   function called from core code on resume once per chip
1329      </para></listitem>
1330    </varlistentry>
1331    <varlistentry>      <term>irq_pm_shutdown</term>
1332      <listitem><para>
1333   function called from core code on shutdown once per chip
1334      </para></listitem>
1335    </varlistentry>
1336    <varlistentry>      <term>irq_calc_mask</term>
1337      <listitem><para>
1338   Optional function to set irq_data.mask for special cases
1339      </para></listitem>
1340    </varlistentry>
1341    <varlistentry>      <term>irq_print_chip</term>
1342      <listitem><para>
1343   optional to print special chip info in show_interrupts
1344      </para></listitem>
1345    </varlistentry>
1346    <varlistentry>      <term>irq_request_resources</term>
1347      <listitem><para>
1348   optional to request resources before calling
1349   any other callback related to this irq
1350      </para></listitem>
1351    </varlistentry>
1352    <varlistentry>      <term>irq_release_resources</term>
1353      <listitem><para>
1354   optional to release resources acquired with
1355   irq_request_resources
1356      </para></listitem>
1357    </varlistentry>
1358    <varlistentry>      <term>irq_compose_msi_msg</term>
1359      <listitem><para>
1360   optional to compose message content for MSI
1361      </para></listitem>
1362    </varlistentry>
1363    <varlistentry>      <term>irq_write_msi_msg</term>
1364      <listitem><para>
1365   optional to write message content for MSI
1366      </para></listitem>
1367    </varlistentry>
1368    <varlistentry>      <term>irq_get_irqchip_state</term>
1369      <listitem><para>
1370   return the internal state of an interrupt
1371      </para></listitem>
1372    </varlistentry>
1373    <varlistentry>      <term>irq_set_irqchip_state</term>
1374      <listitem><para>
1375   set the internal state of a interrupt
1376      </para></listitem>
1377    </varlistentry>
1378    <varlistentry>      <term>flags</term>
1379      <listitem><para>
1380   chip specific flags
1381      </para></listitem>
1382    </varlistentry>
1383  </variablelist>
1384 </refsect1>
1385</refentry>
1386
1387<refentry id="API-struct-irq-chip-regs">
1388<refentryinfo>
1389 <title>LINUX</title>
1390 <productname>Kernel Hackers Manual</productname>
1391 <date>July 2017</date>
1392</refentryinfo>
1393<refmeta>
1394 <refentrytitle><phrase>struct irq_chip_regs</phrase></refentrytitle>
1395 <manvolnum>9</manvolnum>
1396 <refmiscinfo class="version">4.1.27</refmiscinfo>
1397</refmeta>
1398<refnamediv>
1399 <refname>struct irq_chip_regs</refname>
1400 <refpurpose>
1401     register offsets for struct irq_gci
1402 </refpurpose>
1403</refnamediv>
1404<refsynopsisdiv>
1405 <title>Synopsis</title>
1406  <programlisting>
1407struct irq_chip_regs {
1408  unsigned long enable;
1409  unsigned long disable;
1410  unsigned long mask;
1411  unsigned long ack;
1412  unsigned long eoi;
1413  unsigned long type;
1414  unsigned long polarity;
1415};  </programlisting>
1416</refsynopsisdiv>
1417 <refsect1>
1418  <title>Members</title>
1419  <variablelist>
1420    <varlistentry>      <term>enable</term>
1421      <listitem><para>
1422   Enable register offset to reg_base
1423      </para></listitem>
1424    </varlistentry>
1425    <varlistentry>      <term>disable</term>
1426      <listitem><para>
1427   Disable register offset to reg_base
1428      </para></listitem>
1429    </varlistentry>
1430    <varlistentry>      <term>mask</term>
1431      <listitem><para>
1432   Mask register offset to reg_base
1433      </para></listitem>
1434    </varlistentry>
1435    <varlistentry>      <term>ack</term>
1436      <listitem><para>
1437   Ack register offset to reg_base
1438      </para></listitem>
1439    </varlistentry>
1440    <varlistentry>      <term>eoi</term>
1441      <listitem><para>
1442   Eoi register offset to reg_base
1443      </para></listitem>
1444    </varlistentry>
1445    <varlistentry>      <term>type</term>
1446      <listitem><para>
1447   Type configuration register offset to reg_base
1448      </para></listitem>
1449    </varlistentry>
1450    <varlistentry>      <term>polarity</term>
1451      <listitem><para>
1452   Polarity configuration register offset to reg_base
1453      </para></listitem>
1454    </varlistentry>
1455  </variablelist>
1456 </refsect1>
1457</refentry>
1458
1459<refentry id="API-struct-irq-chip-type">
1460<refentryinfo>
1461 <title>LINUX</title>
1462 <productname>Kernel Hackers Manual</productname>
1463 <date>July 2017</date>
1464</refentryinfo>
1465<refmeta>
1466 <refentrytitle><phrase>struct irq_chip_type</phrase></refentrytitle>
1467 <manvolnum>9</manvolnum>
1468 <refmiscinfo class="version">4.1.27</refmiscinfo>
1469</refmeta>
1470<refnamediv>
1471 <refname>struct irq_chip_type</refname>
1472 <refpurpose>
1473     Generic interrupt chip instance for a flow type
1474 </refpurpose>
1475</refnamediv>
1476<refsynopsisdiv>
1477 <title>Synopsis</title>
1478  <programlisting>
1479struct irq_chip_type {
1480  struct irq_chip chip;
1481  struct irq_chip_regs regs;
1482  irq_flow_handler_t handler;
1483  u32 type;
1484  u32 mask_cache_priv;
1485  u32 * mask_cache;
1486};  </programlisting>
1487</refsynopsisdiv>
1488 <refsect1>
1489  <title>Members</title>
1490  <variablelist>
1491    <varlistentry>      <term>chip</term>
1492      <listitem><para>
1493   The real interrupt chip which provides the callbacks
1494      </para></listitem>
1495    </varlistentry>
1496    <varlistentry>      <term>regs</term>
1497      <listitem><para>
1498   Register offsets for this chip
1499      </para></listitem>
1500    </varlistentry>
1501    <varlistentry>      <term>handler</term>
1502      <listitem><para>
1503   Flow handler associated with this chip
1504      </para></listitem>
1505    </varlistentry>
1506    <varlistentry>      <term>type</term>
1507      <listitem><para>
1508   Chip can handle these flow types
1509      </para></listitem>
1510    </varlistentry>
1511    <varlistentry>      <term>mask_cache_priv</term>
1512      <listitem><para>
1513   Cached mask register private to the chip type
1514      </para></listitem>
1515    </varlistentry>
1516    <varlistentry>      <term>mask_cache</term>
1517      <listitem><para>
1518   Pointer to cached mask register
1519      </para></listitem>
1520    </varlistentry>
1521  </variablelist>
1522 </refsect1>
1523<refsect1>
1524<title>Description</title>
1525<para>
1526   A irq_generic_chip can have several instances of irq_chip_type when
1527   it requires different functions and register offsets for different
1528   flow types.
1529</para>
1530</refsect1>
1531</refentry>
1532
1533<refentry id="API-struct-irq-chip-generic">
1534<refentryinfo>
1535 <title>LINUX</title>
1536 <productname>Kernel Hackers Manual</productname>
1537 <date>July 2017</date>
1538</refentryinfo>
1539<refmeta>
1540 <refentrytitle><phrase>struct irq_chip_generic</phrase></refentrytitle>
1541 <manvolnum>9</manvolnum>
1542 <refmiscinfo class="version">4.1.27</refmiscinfo>
1543</refmeta>
1544<refnamediv>
1545 <refname>struct irq_chip_generic</refname>
1546 <refpurpose>
1547     Generic irq chip data structure
1548 </refpurpose>
1549</refnamediv>
1550<refsynopsisdiv>
1551 <title>Synopsis</title>
1552  <programlisting>
1553struct irq_chip_generic {
1554  raw_spinlock_t lock;
1555  void __iomem * reg_base;
1556  u32 (* reg_readl) (void __iomem *addr);
1557  void (* reg_writel) (u32 val, void __iomem *addr);
1558  unsigned int irq_base;
1559  unsigned int irq_cnt;
1560  u32 mask_cache;
1561  u32 type_cache;
1562  u32 polarity_cache;
1563  u32 wake_enabled;
1564  u32 wake_active;
1565  unsigned int num_ct;
1566  void * private;
1567  unsigned long installed;
1568  unsigned long unused;
1569  struct irq_domain * domain;
1570  struct list_head list;
1571  struct irq_chip_type chip_types[0];
1572};  </programlisting>
1573</refsynopsisdiv>
1574 <refsect1>
1575  <title>Members</title>
1576  <variablelist>
1577    <varlistentry>      <term>lock</term>
1578      <listitem><para>
1579   Lock to protect register and cache data access
1580      </para></listitem>
1581    </varlistentry>
1582    <varlistentry>      <term>reg_base</term>
1583      <listitem><para>
1584   Register base address (virtual)
1585      </para></listitem>
1586    </varlistentry>
1587    <varlistentry>      <term>reg_readl</term>
1588      <listitem><para>
1589   Alternate I/O accessor (defaults to readl if NULL)
1590      </para></listitem>
1591    </varlistentry>
1592    <varlistentry>      <term>reg_writel</term>
1593      <listitem><para>
1594   Alternate I/O accessor (defaults to writel if NULL)
1595      </para></listitem>
1596    </varlistentry>
1597    <varlistentry>      <term>irq_base</term>
1598      <listitem><para>
1599   Interrupt base nr for this chip
1600      </para></listitem>
1601    </varlistentry>
1602    <varlistentry>      <term>irq_cnt</term>
1603      <listitem><para>
1604   Number of interrupts handled by this chip
1605      </para></listitem>
1606    </varlistentry>
1607    <varlistentry>      <term>mask_cache</term>
1608      <listitem><para>
1609   Cached mask register shared between all chip types
1610      </para></listitem>
1611    </varlistentry>
1612    <varlistentry>      <term>type_cache</term>
1613      <listitem><para>
1614   Cached type register
1615      </para></listitem>
1616    </varlistentry>
1617    <varlistentry>      <term>polarity_cache</term>
1618      <listitem><para>
1619   Cached polarity register
1620      </para></listitem>
1621    </varlistentry>
1622    <varlistentry>      <term>wake_enabled</term>
1623      <listitem><para>
1624   Interrupt can wakeup from suspend
1625      </para></listitem>
1626    </varlistentry>
1627    <varlistentry>      <term>wake_active</term>
1628      <listitem><para>
1629   Interrupt is marked as an wakeup from suspend source
1630      </para></listitem>
1631    </varlistentry>
1632    <varlistentry>      <term>num_ct</term>
1633      <listitem><para>
1634   Number of available irq_chip_type instances (usually 1)
1635      </para></listitem>
1636    </varlistentry>
1637    <varlistentry>      <term>private</term>
1638      <listitem><para>
1639   Private data for non generic chip callbacks
1640      </para></listitem>
1641    </varlistentry>
1642    <varlistentry>      <term>installed</term>
1643      <listitem><para>
1644   bitfield to denote installed interrupts
1645      </para></listitem>
1646    </varlistentry>
1647    <varlistentry>      <term>unused</term>
1648      <listitem><para>
1649   bitfield to denote unused interrupts
1650      </para></listitem>
1651    </varlistentry>
1652    <varlistentry>      <term>domain</term>
1653      <listitem><para>
1654   irq domain pointer
1655      </para></listitem>
1656    </varlistentry>
1657    <varlistentry>      <term>list</term>
1658      <listitem><para>
1659   List head for keeping track of instances
1660      </para></listitem>
1661    </varlistentry>
1662    <varlistentry>      <term>chip_types[0]</term>
1663      <listitem><para>
1664   Array of interrupt irq_chip_types
1665      </para></listitem>
1666    </varlistentry>
1667  </variablelist>
1668 </refsect1>
1669<refsect1>
1670<title>Description</title>
1671<para>
1672   Note, that irq_chip_generic can have multiple irq_chip_type
1673   implementations which can be associated to a particular irq line of
1674   an irq_chip_generic instance. That allows to share and protect
1675   state in an irq_chip_generic instance when we need to implement
1676   different flow mechanisms (level/edge) for it.
1677</para>
1678</refsect1>
1679</refentry>
1680
1681<refentry id="API-enum-irq-gc-flags">
1682<refentryinfo>
1683 <title>LINUX</title>
1684 <productname>Kernel Hackers Manual</productname>
1685 <date>July 2017</date>
1686</refentryinfo>
1687<refmeta>
1688 <refentrytitle><phrase>enum irq_gc_flags</phrase></refentrytitle>
1689 <manvolnum>9</manvolnum>
1690 <refmiscinfo class="version">4.1.27</refmiscinfo>
1691</refmeta>
1692<refnamediv>
1693 <refname>enum irq_gc_flags</refname>
1694 <refpurpose>
1695     Initialization flags for generic irq chips
1696 </refpurpose>
1697</refnamediv>
1698<refsynopsisdiv>
1699 <title>Synopsis</title>
1700  <programlisting>
1701enum irq_gc_flags {
1702  IRQ_GC_INIT_MASK_CACHE,
1703  IRQ_GC_INIT_NESTED_LOCK,
1704  IRQ_GC_MASK_CACHE_PER_TYPE,
1705  IRQ_GC_NO_MASK,
1706  IRQ_GC_BE_IO
1707};  </programlisting>
1708</refsynopsisdiv>
1709<refsect1>
1710 <title>Constants</title>
1711  <variablelist>
1712    <varlistentry>      <term>IRQ_GC_INIT_MASK_CACHE</term>
1713      <listitem><para>
1714   Initialize the mask_cache by reading mask reg
1715      </para></listitem>
1716    </varlistentry>
1717    <varlistentry>      <term>IRQ_GC_INIT_NESTED_LOCK</term>
1718      <listitem><para>
1719   Set the lock class of the irqs to nested for
1720   irq chips which need to call <function>irq_set_wake</function> on
1721   the parent irq. Usually GPIO implementations
1722      </para></listitem>
1723    </varlistentry>
1724    <varlistentry>      <term>IRQ_GC_MASK_CACHE_PER_TYPE</term>
1725      <listitem><para>
1726   Mask cache is chip type private
1727      </para></listitem>
1728    </varlistentry>
1729    <varlistentry>      <term>IRQ_GC_NO_MASK</term>
1730      <listitem><para>
1731   Do not calculate irq_data-&gt;mask
1732      </para></listitem>
1733    </varlistentry>
1734    <varlistentry>      <term>IRQ_GC_BE_IO</term>
1735      <listitem><para>
1736   Use big-endian register accesses (default: LE)
1737      </para></listitem>
1738    </varlistentry>
1739  </variablelist>
1740</refsect1>
1741</refentry>
1742
1743<!-- include/linux/interrupt.h -->
1744<refentry id="API-struct-irqaction">
1745<refentryinfo>
1746 <title>LINUX</title>
1747 <productname>Kernel Hackers Manual</productname>
1748 <date>July 2017</date>
1749</refentryinfo>
1750<refmeta>
1751 <refentrytitle><phrase>struct irqaction</phrase></refentrytitle>
1752 <manvolnum>9</manvolnum>
1753 <refmiscinfo class="version">4.1.27</refmiscinfo>
1754</refmeta>
1755<refnamediv>
1756 <refname>struct irqaction</refname>
1757 <refpurpose>
1758  per interrupt action descriptor
1759 </refpurpose>
1760</refnamediv>
1761<refsynopsisdiv>
1762 <title>Synopsis</title>
1763  <programlisting>
1764struct irqaction {
1765  irq_handler_t handler;
1766  void * dev_id;
1767  void __percpu * percpu_dev_id;
1768  struct irqaction * next;
1769  irq_handler_t thread_fn;
1770  struct task_struct * thread;
1771  unsigned int irq;
1772  unsigned int flags;
1773  unsigned long thread_flags;
1774  unsigned long thread_mask;
1775  const char * name;
1776  struct proc_dir_entry * dir;
1777};  </programlisting>
1778</refsynopsisdiv>
1779 <refsect1>
1780  <title>Members</title>
1781  <variablelist>
1782    <varlistentry>      <term>handler</term>
1783      <listitem><para>
1784interrupt handler function
1785      </para></listitem>
1786    </varlistentry>
1787    <varlistentry>      <term>dev_id</term>
1788      <listitem><para>
1789cookie to identify the device
1790      </para></listitem>
1791    </varlistentry>
1792    <varlistentry>      <term>percpu_dev_id</term>
1793      <listitem><para>
1794cookie to identify the device
1795      </para></listitem>
1796    </varlistentry>
1797    <varlistentry>      <term>next</term>
1798      <listitem><para>
1799pointer to the next irqaction for shared interrupts
1800      </para></listitem>
1801    </varlistentry>
1802    <varlistentry>      <term>thread_fn</term>
1803      <listitem><para>
1804interrupt handler function for threaded interrupts
1805      </para></listitem>
1806    </varlistentry>
1807    <varlistentry>      <term>thread</term>
1808      <listitem><para>
1809thread pointer for threaded interrupts
1810      </para></listitem>
1811    </varlistentry>
1812    <varlistentry>      <term>irq</term>
1813      <listitem><para>
1814interrupt number
1815      </para></listitem>
1816    </varlistentry>
1817    <varlistentry>      <term>flags</term>
1818      <listitem><para>
1819flags (see IRQF_* above)
1820      </para></listitem>
1821    </varlistentry>
1822    <varlistentry>      <term>thread_flags</term>
1823      <listitem><para>
1824flags related to <parameter>thread</parameter>
1825      </para></listitem>
1826    </varlistentry>
1827    <varlistentry>      <term>thread_mask</term>
1828      <listitem><para>
1829bitmask for keeping track of <parameter>thread</parameter> activity
1830      </para></listitem>
1831    </varlistentry>
1832    <varlistentry>      <term>name</term>
1833      <listitem><para>
1834name of the device
1835      </para></listitem>
1836    </varlistentry>
1837    <varlistentry>      <term>dir</term>
1838      <listitem><para>
1839pointer to the proc/irq/NN/name entry
1840      </para></listitem>
1841    </varlistentry>
1842  </variablelist>
1843 </refsect1>
1844</refentry>
1845
1846<refentry id="API-struct-irq-affinity-notify">
1847<refentryinfo>
1848 <title>LINUX</title>
1849 <productname>Kernel Hackers Manual</productname>
1850 <date>July 2017</date>
1851</refentryinfo>
1852<refmeta>
1853 <refentrytitle><phrase>struct irq_affinity_notify</phrase></refentrytitle>
1854 <manvolnum>9</manvolnum>
1855 <refmiscinfo class="version">4.1.27</refmiscinfo>
1856</refmeta>
1857<refnamediv>
1858 <refname>struct irq_affinity_notify</refname>
1859 <refpurpose>
1860     context for notification of IRQ affinity changes
1861 </refpurpose>
1862</refnamediv>
1863<refsynopsisdiv>
1864 <title>Synopsis</title>
1865  <programlisting>
1866struct irq_affinity_notify {
1867  unsigned int irq;
1868  struct kref kref;
1869  struct work_struct work;
1870  void (* notify) (struct irq_affinity_notify *, const cpumask_t *mask);
1871  void (* release) (struct kref *ref);
1872};  </programlisting>
1873</refsynopsisdiv>
1874 <refsect1>
1875  <title>Members</title>
1876  <variablelist>
1877    <varlistentry>      <term>irq</term>
1878      <listitem><para>
1879   Interrupt to which notification applies
1880      </para></listitem>
1881    </varlistentry>
1882    <varlistentry>      <term>kref</term>
1883      <listitem><para>
1884   Reference count, for internal use
1885      </para></listitem>
1886    </varlistentry>
1887    <varlistentry>      <term>work</term>
1888      <listitem><para>
1889   Work item, for internal use
1890      </para></listitem>
1891    </varlistentry>
1892    <varlistentry>      <term>notify</term>
1893      <listitem><para>
1894   Function to be called on change.  This will be
1895   called in process context.
1896      </para></listitem>
1897    </varlistentry>
1898    <varlistentry>      <term>release</term>
1899      <listitem><para>
1900   Function to be called on release.  This will be
1901   called in process context.  Once registered, the
1902   structure must only be freed when this function is
1903   called or later.
1904      </para></listitem>
1905    </varlistentry>
1906  </variablelist>
1907 </refsect1>
1908</refentry>
1909
1910<refentry id="API-irq-set-affinity">
1911<refentryinfo>
1912 <title>LINUX</title>
1913 <productname>Kernel Hackers Manual</productname>
1914 <date>July 2017</date>
1915</refentryinfo>
1916<refmeta>
1917 <refentrytitle><phrase>irq_set_affinity</phrase></refentrytitle>
1918 <manvolnum>9</manvolnum>
1919 <refmiscinfo class="version">4.1.27</refmiscinfo>
1920</refmeta>
1921<refnamediv>
1922 <refname>irq_set_affinity</refname>
1923 <refpurpose>
1924     Set the irq affinity of a given irq
1925 </refpurpose>
1926</refnamediv>
1927<refsynopsisdiv>
1928 <title>Synopsis</title>
1929  <funcsynopsis><funcprototype>
1930   <funcdef>int <function>irq_set_affinity </function></funcdef>
1931   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
1932   <paramdef>const struct cpumask * <parameter>cpumask</parameter></paramdef>
1933  </funcprototype></funcsynopsis>
1934</refsynopsisdiv>
1935<refsect1>
1936 <title>Arguments</title>
1937 <variablelist>
1938  <varlistentry>
1939   <term><parameter>irq</parameter></term>
1940   <listitem>
1941    <para>
1942     Interrupt to set affinity
1943    </para>
1944   </listitem>
1945  </varlistentry>
1946  <varlistentry>
1947   <term><parameter>cpumask</parameter></term>
1948   <listitem>
1949    <para>
1950     cpumask
1951    </para>
1952   </listitem>
1953  </varlistentry>
1954 </variablelist>
1955</refsect1>
1956<refsect1>
1957<title>Description</title>
1958<para>
1959   Fails if cpumask does not contain an online CPU
1960</para>
1961</refsect1>
1962</refentry>
1963
1964<refentry id="API-irq-force-affinity">
1965<refentryinfo>
1966 <title>LINUX</title>
1967 <productname>Kernel Hackers Manual</productname>
1968 <date>July 2017</date>
1969</refentryinfo>
1970<refmeta>
1971 <refentrytitle><phrase>irq_force_affinity</phrase></refentrytitle>
1972 <manvolnum>9</manvolnum>
1973 <refmiscinfo class="version">4.1.27</refmiscinfo>
1974</refmeta>
1975<refnamediv>
1976 <refname>irq_force_affinity</refname>
1977 <refpurpose>
1978     Force the irq affinity of a given irq
1979 </refpurpose>
1980</refnamediv>
1981<refsynopsisdiv>
1982 <title>Synopsis</title>
1983  <funcsynopsis><funcprototype>
1984   <funcdef>int <function>irq_force_affinity </function></funcdef>
1985   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
1986   <paramdef>const struct cpumask * <parameter>cpumask</parameter></paramdef>
1987  </funcprototype></funcsynopsis>
1988</refsynopsisdiv>
1989<refsect1>
1990 <title>Arguments</title>
1991 <variablelist>
1992  <varlistentry>
1993   <term><parameter>irq</parameter></term>
1994   <listitem>
1995    <para>
1996     Interrupt to set affinity
1997    </para>
1998   </listitem>
1999  </varlistentry>
2000  <varlistentry>
2001   <term><parameter>cpumask</parameter></term>
2002   <listitem>
2003    <para>
2004     cpumask
2005    </para>
2006   </listitem>
2007  </varlistentry>
2008 </variablelist>
2009</refsect1>
2010<refsect1>
2011<title>Description</title>
2012<para>
2013   Same as irq_set_affinity, but without checking the mask against
2014   online cpus.
2015   </para><para>
2016
2017   Solely for low level cpu hotplug code, where we need to make per
2018   cpu interrupts affine before the cpu becomes online.
2019</para>
2020</refsect1>
2021</refentry>
2022
2023  </chapter>
2024
2025  <chapter id="pubfunctions">
2026     <title>Public Functions Provided</title>
2027     <para>
2028     This chapter contains the autogenerated documentation of the kernel API functions
2029      which are exported.
2030     </para>
2031<!-- kernel/irq/manage.c -->
2032<refentry id="API-synchronize-hardirq">
2033<refentryinfo>
2034 <title>LINUX</title>
2035 <productname>Kernel Hackers Manual</productname>
2036 <date>July 2017</date>
2037</refentryinfo>
2038<refmeta>
2039 <refentrytitle><phrase>synchronize_hardirq</phrase></refentrytitle>
2040 <manvolnum>9</manvolnum>
2041 <refmiscinfo class="version">4.1.27</refmiscinfo>
2042</refmeta>
2043<refnamediv>
2044 <refname>synchronize_hardirq</refname>
2045 <refpurpose>
2046  wait for pending hard IRQ handlers (on other CPUs)
2047 </refpurpose>
2048</refnamediv>
2049<refsynopsisdiv>
2050 <title>Synopsis</title>
2051  <funcsynopsis><funcprototype>
2052   <funcdef>bool <function>synchronize_hardirq </function></funcdef>
2053   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2054  </funcprototype></funcsynopsis>
2055</refsynopsisdiv>
2056<refsect1>
2057 <title>Arguments</title>
2058 <variablelist>
2059  <varlistentry>
2060   <term><parameter>irq</parameter></term>
2061   <listitem>
2062    <para>
2063     interrupt number to wait for
2064    </para>
2065   </listitem>
2066  </varlistentry>
2067 </variablelist>
2068</refsect1>
2069<refsect1>
2070<title>Description</title>
2071<para>
2072   This function waits for any pending hard IRQ handlers for this
2073   interrupt to complete before returning. If you use this
2074   function while holding a resource the IRQ handler may need you
2075   will deadlock. It does not take associated threaded handlers
2076   into account.
2077   </para><para>
2078
2079   Do not use this for shutdown scenarios where you must be sure
2080   that all parts (hardirq and threaded handler) have completed.
2081</para>
2082</refsect1>
2083<refsect1>
2084<title>Returns</title>
2085<para>
2086   false if a threaded handler is active.
2087   </para><para>
2088
2089   This function may be called - with care - from IRQ context.
2090</para>
2091</refsect1>
2092</refentry>
2093
2094<refentry id="API-synchronize-irq">
2095<refentryinfo>
2096 <title>LINUX</title>
2097 <productname>Kernel Hackers Manual</productname>
2098 <date>July 2017</date>
2099</refentryinfo>
2100<refmeta>
2101 <refentrytitle><phrase>synchronize_irq</phrase></refentrytitle>
2102 <manvolnum>9</manvolnum>
2103 <refmiscinfo class="version">4.1.27</refmiscinfo>
2104</refmeta>
2105<refnamediv>
2106 <refname>synchronize_irq</refname>
2107 <refpurpose>
2108     wait for pending IRQ handlers (on other CPUs)
2109 </refpurpose>
2110</refnamediv>
2111<refsynopsisdiv>
2112 <title>Synopsis</title>
2113  <funcsynopsis><funcprototype>
2114   <funcdef>void <function>synchronize_irq </function></funcdef>
2115   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2116  </funcprototype></funcsynopsis>
2117</refsynopsisdiv>
2118<refsect1>
2119 <title>Arguments</title>
2120 <variablelist>
2121  <varlistentry>
2122   <term><parameter>irq</parameter></term>
2123   <listitem>
2124    <para>
2125     interrupt number to wait for
2126    </para>
2127   </listitem>
2128  </varlistentry>
2129 </variablelist>
2130</refsect1>
2131<refsect1>
2132<title>Description</title>
2133<para>
2134   This function waits for any pending IRQ handlers for this interrupt
2135   to complete before returning. If you use this function while
2136   holding a resource the IRQ handler may need you will deadlock.
2137   </para><para>
2138
2139   This function may be called - with care - from IRQ context.
2140</para>
2141</refsect1>
2142</refentry>
2143
2144<refentry id="API-irq-set-affinity-notifier">
2145<refentryinfo>
2146 <title>LINUX</title>
2147 <productname>Kernel Hackers Manual</productname>
2148 <date>July 2017</date>
2149</refentryinfo>
2150<refmeta>
2151 <refentrytitle><phrase>irq_set_affinity_notifier</phrase></refentrytitle>
2152 <manvolnum>9</manvolnum>
2153 <refmiscinfo class="version">4.1.27</refmiscinfo>
2154</refmeta>
2155<refnamediv>
2156 <refname>irq_set_affinity_notifier</refname>
2157 <refpurpose>
2158     control notification of IRQ affinity changes
2159 </refpurpose>
2160</refnamediv>
2161<refsynopsisdiv>
2162 <title>Synopsis</title>
2163  <funcsynopsis><funcprototype>
2164   <funcdef>int <function>irq_set_affinity_notifier </function></funcdef>
2165   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2166   <paramdef>struct irq_affinity_notify * <parameter>notify</parameter></paramdef>
2167  </funcprototype></funcsynopsis>
2168</refsynopsisdiv>
2169<refsect1>
2170 <title>Arguments</title>
2171 <variablelist>
2172  <varlistentry>
2173   <term><parameter>irq</parameter></term>
2174   <listitem>
2175    <para>
2176     Interrupt for which to enable/disable notification
2177    </para>
2178   </listitem>
2179  </varlistentry>
2180  <varlistentry>
2181   <term><parameter>notify</parameter></term>
2182   <listitem>
2183    <para>
2184     Context for notification, or <constant>NULL</constant> to disable
2185     notification.  Function pointers must be initialised;
2186     the other fields will be initialised by this function.
2187    </para>
2188   </listitem>
2189  </varlistentry>
2190 </variablelist>
2191</refsect1>
2192<refsect1>
2193<title>Description</title>
2194<para>
2195   Must be called in process context.  Notification may only be enabled
2196   after the IRQ is allocated and must be disabled before the IRQ is
2197   freed using <function>free_irq</function>.
2198</para>
2199</refsect1>
2200</refentry>
2201
2202<refentry id="API-disable-irq-nosync">
2203<refentryinfo>
2204 <title>LINUX</title>
2205 <productname>Kernel Hackers Manual</productname>
2206 <date>July 2017</date>
2207</refentryinfo>
2208<refmeta>
2209 <refentrytitle><phrase>disable_irq_nosync</phrase></refentrytitle>
2210 <manvolnum>9</manvolnum>
2211 <refmiscinfo class="version">4.1.27</refmiscinfo>
2212</refmeta>
2213<refnamediv>
2214 <refname>disable_irq_nosync</refname>
2215 <refpurpose>
2216     disable an irq without waiting
2217 </refpurpose>
2218</refnamediv>
2219<refsynopsisdiv>
2220 <title>Synopsis</title>
2221  <funcsynopsis><funcprototype>
2222   <funcdef>void <function>disable_irq_nosync </function></funcdef>
2223   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2224  </funcprototype></funcsynopsis>
2225</refsynopsisdiv>
2226<refsect1>
2227 <title>Arguments</title>
2228 <variablelist>
2229  <varlistentry>
2230   <term><parameter>irq</parameter></term>
2231   <listitem>
2232    <para>
2233     Interrupt to disable
2234    </para>
2235   </listitem>
2236  </varlistentry>
2237 </variablelist>
2238</refsect1>
2239<refsect1>
2240<title>Description</title>
2241<para>
2242   Disable the selected interrupt line.  Disables and Enables are
2243   nested.
2244   Unlike <function>disable_irq</function>, this function does not ensure existing
2245   instances of the IRQ handler have completed before returning.
2246   </para><para>
2247
2248   This function may be called from IRQ context.
2249</para>
2250</refsect1>
2251</refentry>
2252
2253<refentry id="API-disable-irq">
2254<refentryinfo>
2255 <title>LINUX</title>
2256 <productname>Kernel Hackers Manual</productname>
2257 <date>July 2017</date>
2258</refentryinfo>
2259<refmeta>
2260 <refentrytitle><phrase>disable_irq</phrase></refentrytitle>
2261 <manvolnum>9</manvolnum>
2262 <refmiscinfo class="version">4.1.27</refmiscinfo>
2263</refmeta>
2264<refnamediv>
2265 <refname>disable_irq</refname>
2266 <refpurpose>
2267     disable an irq and wait for completion
2268 </refpurpose>
2269</refnamediv>
2270<refsynopsisdiv>
2271 <title>Synopsis</title>
2272  <funcsynopsis><funcprototype>
2273   <funcdef>void <function>disable_irq </function></funcdef>
2274   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2275  </funcprototype></funcsynopsis>
2276</refsynopsisdiv>
2277<refsect1>
2278 <title>Arguments</title>
2279 <variablelist>
2280  <varlistentry>
2281   <term><parameter>irq</parameter></term>
2282   <listitem>
2283    <para>
2284     Interrupt to disable
2285    </para>
2286   </listitem>
2287  </varlistentry>
2288 </variablelist>
2289</refsect1>
2290<refsect1>
2291<title>Description</title>
2292<para>
2293   Disable the selected interrupt line.  Enables and Disables are
2294   nested.
2295   This function waits for any pending IRQ handlers for this interrupt
2296   to complete before returning. If you use this function while
2297   holding a resource the IRQ handler may need you will deadlock.
2298   </para><para>
2299
2300   This function may be called - with care - from IRQ context.
2301</para>
2302</refsect1>
2303</refentry>
2304
2305<refentry id="API-disable-hardirq">
2306<refentryinfo>
2307 <title>LINUX</title>
2308 <productname>Kernel Hackers Manual</productname>
2309 <date>July 2017</date>
2310</refentryinfo>
2311<refmeta>
2312 <refentrytitle><phrase>disable_hardirq</phrase></refentrytitle>
2313 <manvolnum>9</manvolnum>
2314 <refmiscinfo class="version">4.1.27</refmiscinfo>
2315</refmeta>
2316<refnamediv>
2317 <refname>disable_hardirq</refname>
2318 <refpurpose>
2319     disables an irq and waits for hardirq completion
2320 </refpurpose>
2321</refnamediv>
2322<refsynopsisdiv>
2323 <title>Synopsis</title>
2324  <funcsynopsis><funcprototype>
2325   <funcdef>bool <function>disable_hardirq </function></funcdef>
2326   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2327  </funcprototype></funcsynopsis>
2328</refsynopsisdiv>
2329<refsect1>
2330 <title>Arguments</title>
2331 <variablelist>
2332  <varlistentry>
2333   <term><parameter>irq</parameter></term>
2334   <listitem>
2335    <para>
2336     Interrupt to disable
2337    </para>
2338   </listitem>
2339  </varlistentry>
2340 </variablelist>
2341</refsect1>
2342<refsect1>
2343<title>Description</title>
2344<para>
2345   Disable the selected interrupt line.  Enables and Disables are
2346   nested.
2347   This function waits for any pending hard IRQ handlers for this
2348   interrupt to complete before returning. If you use this function while
2349   holding a resource the hard IRQ handler may need you will deadlock.
2350   </para><para>
2351
2352   When used to optimistically disable an interrupt from atomic context
2353   the return value must be checked.
2354</para>
2355</refsect1>
2356<refsect1>
2357<title>Returns</title>
2358<para>
2359   false if a threaded handler is active.
2360   </para><para>
2361
2362   This function may be called - with care - from IRQ context.
2363</para>
2364</refsect1>
2365</refentry>
2366
2367<refentry id="API-enable-irq">
2368<refentryinfo>
2369 <title>LINUX</title>
2370 <productname>Kernel Hackers Manual</productname>
2371 <date>July 2017</date>
2372</refentryinfo>
2373<refmeta>
2374 <refentrytitle><phrase>enable_irq</phrase></refentrytitle>
2375 <manvolnum>9</manvolnum>
2376 <refmiscinfo class="version">4.1.27</refmiscinfo>
2377</refmeta>
2378<refnamediv>
2379 <refname>enable_irq</refname>
2380 <refpurpose>
2381     enable handling of an irq
2382 </refpurpose>
2383</refnamediv>
2384<refsynopsisdiv>
2385 <title>Synopsis</title>
2386  <funcsynopsis><funcprototype>
2387   <funcdef>void <function>enable_irq </function></funcdef>
2388   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2389  </funcprototype></funcsynopsis>
2390</refsynopsisdiv>
2391<refsect1>
2392 <title>Arguments</title>
2393 <variablelist>
2394  <varlistentry>
2395   <term><parameter>irq</parameter></term>
2396   <listitem>
2397    <para>
2398     Interrupt to enable
2399    </para>
2400   </listitem>
2401  </varlistentry>
2402 </variablelist>
2403</refsect1>
2404<refsect1>
2405<title>Description</title>
2406<para>
2407   Undoes the effect of one call to <function>disable_irq</function>.  If this
2408   matches the last disable, processing of interrupts on this
2409   IRQ line is re-enabled.
2410   </para><para>
2411
2412   This function may be called from IRQ context only when
2413   desc-&gt;irq_data.chip-&gt;bus_lock and desc-&gt;chip-&gt;bus_sync_unlock are NULL !
2414</para>
2415</refsect1>
2416</refentry>
2417
2418<refentry id="API-irq-set-irq-wake">
2419<refentryinfo>
2420 <title>LINUX</title>
2421 <productname>Kernel Hackers Manual</productname>
2422 <date>July 2017</date>
2423</refentryinfo>
2424<refmeta>
2425 <refentrytitle><phrase>irq_set_irq_wake</phrase></refentrytitle>
2426 <manvolnum>9</manvolnum>
2427 <refmiscinfo class="version">4.1.27</refmiscinfo>
2428</refmeta>
2429<refnamediv>
2430 <refname>irq_set_irq_wake</refname>
2431 <refpurpose>
2432     control irq power management wakeup
2433 </refpurpose>
2434</refnamediv>
2435<refsynopsisdiv>
2436 <title>Synopsis</title>
2437  <funcsynopsis><funcprototype>
2438   <funcdef>int <function>irq_set_irq_wake </function></funcdef>
2439   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2440   <paramdef>unsigned int <parameter>on</parameter></paramdef>
2441  </funcprototype></funcsynopsis>
2442</refsynopsisdiv>
2443<refsect1>
2444 <title>Arguments</title>
2445 <variablelist>
2446  <varlistentry>
2447   <term><parameter>irq</parameter></term>
2448   <listitem>
2449    <para>
2450     interrupt to control
2451    </para>
2452   </listitem>
2453  </varlistentry>
2454  <varlistentry>
2455   <term><parameter>on</parameter></term>
2456   <listitem>
2457    <para>
2458     enable/disable power management wakeup
2459    </para>
2460   </listitem>
2461  </varlistentry>
2462 </variablelist>
2463</refsect1>
2464<refsect1>
2465<title>Description</title>
2466<para>
2467   Enable/disable power management wakeup mode, which is
2468   disabled by default.  Enables and disables must match,
2469   just as they match for non-wakeup mode support.
2470   </para><para>
2471
2472   Wakeup mode lets this IRQ wake the system from sleep
2473   states like <quote>suspend to RAM</quote>.
2474</para>
2475</refsect1>
2476</refentry>
2477
2478<refentry id="API-irq-wake-thread">
2479<refentryinfo>
2480 <title>LINUX</title>
2481 <productname>Kernel Hackers Manual</productname>
2482 <date>July 2017</date>
2483</refentryinfo>
2484<refmeta>
2485 <refentrytitle><phrase>irq_wake_thread</phrase></refentrytitle>
2486 <manvolnum>9</manvolnum>
2487 <refmiscinfo class="version">4.1.27</refmiscinfo>
2488</refmeta>
2489<refnamediv>
2490 <refname>irq_wake_thread</refname>
2491 <refpurpose>
2492     wake the irq thread for the action identified by dev_id
2493 </refpurpose>
2494</refnamediv>
2495<refsynopsisdiv>
2496 <title>Synopsis</title>
2497  <funcsynopsis><funcprototype>
2498   <funcdef>void <function>irq_wake_thread </function></funcdef>
2499   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2500   <paramdef>void * <parameter>dev_id</parameter></paramdef>
2501  </funcprototype></funcsynopsis>
2502</refsynopsisdiv>
2503<refsect1>
2504 <title>Arguments</title>
2505 <variablelist>
2506  <varlistentry>
2507   <term><parameter>irq</parameter></term>
2508   <listitem>
2509    <para>
2510     Interrupt line
2511    </para>
2512   </listitem>
2513  </varlistentry>
2514  <varlistentry>
2515   <term><parameter>dev_id</parameter></term>
2516   <listitem>
2517    <para>
2518     Device identity for which the thread should be woken
2519    </para>
2520   </listitem>
2521  </varlistentry>
2522 </variablelist>
2523</refsect1>
2524</refentry>
2525
2526<refentry id="API-setup-irq">
2527<refentryinfo>
2528 <title>LINUX</title>
2529 <productname>Kernel Hackers Manual</productname>
2530 <date>July 2017</date>
2531</refentryinfo>
2532<refmeta>
2533 <refentrytitle><phrase>setup_irq</phrase></refentrytitle>
2534 <manvolnum>9</manvolnum>
2535 <refmiscinfo class="version">4.1.27</refmiscinfo>
2536</refmeta>
2537<refnamediv>
2538 <refname>setup_irq</refname>
2539 <refpurpose>
2540     setup an interrupt
2541 </refpurpose>
2542</refnamediv>
2543<refsynopsisdiv>
2544 <title>Synopsis</title>
2545  <funcsynopsis><funcprototype>
2546   <funcdef>int <function>setup_irq </function></funcdef>
2547   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2548   <paramdef>struct irqaction * <parameter>act</parameter></paramdef>
2549  </funcprototype></funcsynopsis>
2550</refsynopsisdiv>
2551<refsect1>
2552 <title>Arguments</title>
2553 <variablelist>
2554  <varlistentry>
2555   <term><parameter>irq</parameter></term>
2556   <listitem>
2557    <para>
2558     Interrupt line to setup
2559    </para>
2560   </listitem>
2561  </varlistentry>
2562  <varlistentry>
2563   <term><parameter>act</parameter></term>
2564   <listitem>
2565    <para>
2566     irqaction for the interrupt
2567    </para>
2568   </listitem>
2569  </varlistentry>
2570 </variablelist>
2571</refsect1>
2572<refsect1>
2573<title>Description</title>
2574<para>
2575   Used to statically setup interrupts in the early boot process.
2576</para>
2577</refsect1>
2578</refentry>
2579
2580<refentry id="API-remove-irq">
2581<refentryinfo>
2582 <title>LINUX</title>
2583 <productname>Kernel Hackers Manual</productname>
2584 <date>July 2017</date>
2585</refentryinfo>
2586<refmeta>
2587 <refentrytitle><phrase>remove_irq</phrase></refentrytitle>
2588 <manvolnum>9</manvolnum>
2589 <refmiscinfo class="version">4.1.27</refmiscinfo>
2590</refmeta>
2591<refnamediv>
2592 <refname>remove_irq</refname>
2593 <refpurpose>
2594     free an interrupt
2595 </refpurpose>
2596</refnamediv>
2597<refsynopsisdiv>
2598 <title>Synopsis</title>
2599  <funcsynopsis><funcprototype>
2600   <funcdef>void <function>remove_irq </function></funcdef>
2601   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2602   <paramdef>struct irqaction * <parameter>act</parameter></paramdef>
2603  </funcprototype></funcsynopsis>
2604</refsynopsisdiv>
2605<refsect1>
2606 <title>Arguments</title>
2607 <variablelist>
2608  <varlistentry>
2609   <term><parameter>irq</parameter></term>
2610   <listitem>
2611    <para>
2612     Interrupt line to free
2613    </para>
2614   </listitem>
2615  </varlistentry>
2616  <varlistentry>
2617   <term><parameter>act</parameter></term>
2618   <listitem>
2619    <para>
2620     irqaction for the interrupt
2621    </para>
2622   </listitem>
2623  </varlistentry>
2624 </variablelist>
2625</refsect1>
2626<refsect1>
2627<title>Description</title>
2628<para>
2629   Used to remove interrupts statically setup by the early boot process.
2630</para>
2631</refsect1>
2632</refentry>
2633
2634<refentry id="API-free-irq">
2635<refentryinfo>
2636 <title>LINUX</title>
2637 <productname>Kernel Hackers Manual</productname>
2638 <date>July 2017</date>
2639</refentryinfo>
2640<refmeta>
2641 <refentrytitle><phrase>free_irq</phrase></refentrytitle>
2642 <manvolnum>9</manvolnum>
2643 <refmiscinfo class="version">4.1.27</refmiscinfo>
2644</refmeta>
2645<refnamediv>
2646 <refname>free_irq</refname>
2647 <refpurpose>
2648     free an interrupt allocated with request_irq
2649 </refpurpose>
2650</refnamediv>
2651<refsynopsisdiv>
2652 <title>Synopsis</title>
2653  <funcsynopsis><funcprototype>
2654   <funcdef>void <function>free_irq </function></funcdef>
2655   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2656   <paramdef>void * <parameter>dev_id</parameter></paramdef>
2657  </funcprototype></funcsynopsis>
2658</refsynopsisdiv>
2659<refsect1>
2660 <title>Arguments</title>
2661 <variablelist>
2662  <varlistentry>
2663   <term><parameter>irq</parameter></term>
2664   <listitem>
2665    <para>
2666     Interrupt line to free
2667    </para>
2668   </listitem>
2669  </varlistentry>
2670  <varlistentry>
2671   <term><parameter>dev_id</parameter></term>
2672   <listitem>
2673    <para>
2674     Device identity to free
2675    </para>
2676   </listitem>
2677  </varlistentry>
2678 </variablelist>
2679</refsect1>
2680<refsect1>
2681<title>Description</title>
2682<para>
2683   Remove an interrupt handler. The handler is removed and if the
2684   interrupt line is no longer in use by any driver it is disabled.
2685   On a shared IRQ the caller must ensure the interrupt is disabled
2686   on the card it drives before calling this function. The function
2687   does not return until any executing interrupts for this IRQ
2688   have completed.
2689   </para><para>
2690
2691   This function must not be called from interrupt context.
2692</para>
2693</refsect1>
2694</refentry>
2695
2696<refentry id="API-request-threaded-irq">
2697<refentryinfo>
2698 <title>LINUX</title>
2699 <productname>Kernel Hackers Manual</productname>
2700 <date>July 2017</date>
2701</refentryinfo>
2702<refmeta>
2703 <refentrytitle><phrase>request_threaded_irq</phrase></refentrytitle>
2704 <manvolnum>9</manvolnum>
2705 <refmiscinfo class="version">4.1.27</refmiscinfo>
2706</refmeta>
2707<refnamediv>
2708 <refname>request_threaded_irq</refname>
2709 <refpurpose>
2710     allocate an interrupt line
2711 </refpurpose>
2712</refnamediv>
2713<refsynopsisdiv>
2714 <title>Synopsis</title>
2715  <funcsynopsis><funcprototype>
2716   <funcdef>int <function>request_threaded_irq </function></funcdef>
2717   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2718   <paramdef>irq_handler_t <parameter>handler</parameter></paramdef>
2719   <paramdef>irq_handler_t <parameter>thread_fn</parameter></paramdef>
2720   <paramdef>unsigned long <parameter>irqflags</parameter></paramdef>
2721   <paramdef>const char * <parameter>devname</parameter></paramdef>
2722   <paramdef>void * <parameter>dev_id</parameter></paramdef>
2723  </funcprototype></funcsynopsis>
2724</refsynopsisdiv>
2725<refsect1>
2726 <title>Arguments</title>
2727 <variablelist>
2728  <varlistentry>
2729   <term><parameter>irq</parameter></term>
2730   <listitem>
2731    <para>
2732     Interrupt line to allocate
2733    </para>
2734   </listitem>
2735  </varlistentry>
2736  <varlistentry>
2737   <term><parameter>handler</parameter></term>
2738   <listitem>
2739    <para>
2740     Function to be called when the IRQ occurs.
2741     Primary handler for threaded interrupts
2742     If NULL and thread_fn != NULL the default
2743     primary handler is installed
2744    </para>
2745   </listitem>
2746  </varlistentry>
2747  <varlistentry>
2748   <term><parameter>thread_fn</parameter></term>
2749   <listitem>
2750    <para>
2751     Function called from the irq handler thread
2752     If NULL, no irq thread is created
2753    </para>
2754   </listitem>
2755  </varlistentry>
2756  <varlistentry>
2757   <term><parameter>irqflags</parameter></term>
2758   <listitem>
2759    <para>
2760     Interrupt type flags
2761    </para>
2762   </listitem>
2763  </varlistentry>
2764  <varlistentry>
2765   <term><parameter>devname</parameter></term>
2766   <listitem>
2767    <para>
2768     An ascii name for the claiming device
2769    </para>
2770   </listitem>
2771  </varlistentry>
2772  <varlistentry>
2773   <term><parameter>dev_id</parameter></term>
2774   <listitem>
2775    <para>
2776     A cookie passed back to the handler function
2777    </para>
2778   </listitem>
2779  </varlistentry>
2780 </variablelist>
2781</refsect1>
2782<refsect1>
2783<title>Description</title>
2784<para>
2785   This call allocates interrupt resources and enables the
2786   interrupt line and IRQ handling. From the point this
2787   call is made your handler function may be invoked. Since
2788   your handler function must clear any interrupt the board
2789   raises, you must take care both to initialise your hardware
2790   and to set up the interrupt handler in the right order.
2791   </para><para>
2792
2793   If you want to set up a threaded irq handler for your device
2794   then you need to supply <parameter>handler</parameter> and <parameter>thread_fn</parameter>. <parameter>handler</parameter> is
2795   still called in hard interrupt context and has to check
2796   whether the interrupt originates from the device. If yes it
2797   needs to disable the interrupt on the device and return
2798   IRQ_WAKE_THREAD which will wake up the handler thread and run
2799   <parameter>thread_fn</parameter>. This split handler design is necessary to support
2800   shared interrupts.
2801   </para><para>
2802
2803   Dev_id must be globally unique. Normally the address of the
2804   device data structure is used as the cookie. Since the handler
2805   receives this value it makes sense to use it.
2806   </para><para>
2807
2808   If your interrupt is shared you must pass a non NULL dev_id
2809   as this is required when freeing the interrupt.
2810</para>
2811</refsect1>
2812<refsect1>
2813<title>Flags</title>
2814<para>
2815   </para><para>
2816
2817   IRQF_SHARED		Interrupt is shared
2818   IRQF_TRIGGER_*		Specify active edge(s) or level
2819</para>
2820</refsect1>
2821</refentry>
2822
2823<refentry id="API-request-any-context-irq">
2824<refentryinfo>
2825 <title>LINUX</title>
2826 <productname>Kernel Hackers Manual</productname>
2827 <date>July 2017</date>
2828</refentryinfo>
2829<refmeta>
2830 <refentrytitle><phrase>request_any_context_irq</phrase></refentrytitle>
2831 <manvolnum>9</manvolnum>
2832 <refmiscinfo class="version">4.1.27</refmiscinfo>
2833</refmeta>
2834<refnamediv>
2835 <refname>request_any_context_irq</refname>
2836 <refpurpose>
2837     allocate an interrupt line
2838 </refpurpose>
2839</refnamediv>
2840<refsynopsisdiv>
2841 <title>Synopsis</title>
2842  <funcsynopsis><funcprototype>
2843   <funcdef>int <function>request_any_context_irq </function></funcdef>
2844   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2845   <paramdef>irq_handler_t <parameter>handler</parameter></paramdef>
2846   <paramdef>unsigned long <parameter>flags</parameter></paramdef>
2847   <paramdef>const char * <parameter>name</parameter></paramdef>
2848   <paramdef>void * <parameter>dev_id</parameter></paramdef>
2849  </funcprototype></funcsynopsis>
2850</refsynopsisdiv>
2851<refsect1>
2852 <title>Arguments</title>
2853 <variablelist>
2854  <varlistentry>
2855   <term><parameter>irq</parameter></term>
2856   <listitem>
2857    <para>
2858     Interrupt line to allocate
2859    </para>
2860   </listitem>
2861  </varlistentry>
2862  <varlistentry>
2863   <term><parameter>handler</parameter></term>
2864   <listitem>
2865    <para>
2866     Function to be called when the IRQ occurs.
2867     Threaded handler for threaded interrupts.
2868    </para>
2869   </listitem>
2870  </varlistentry>
2871  <varlistentry>
2872   <term><parameter>flags</parameter></term>
2873   <listitem>
2874    <para>
2875     Interrupt type flags
2876    </para>
2877   </listitem>
2878  </varlistentry>
2879  <varlistentry>
2880   <term><parameter>name</parameter></term>
2881   <listitem>
2882    <para>
2883     An ascii name for the claiming device
2884    </para>
2885   </listitem>
2886  </varlistentry>
2887  <varlistentry>
2888   <term><parameter>dev_id</parameter></term>
2889   <listitem>
2890    <para>
2891     A cookie passed back to the handler function
2892    </para>
2893   </listitem>
2894  </varlistentry>
2895 </variablelist>
2896</refsect1>
2897<refsect1>
2898<title>Description</title>
2899<para>
2900   This call allocates interrupt resources and enables the
2901   interrupt line and IRQ handling. It selects either a
2902   hardirq or threaded handling method depending on the
2903   context.
2904   </para><para>
2905
2906   On failure, it returns a negative value. On success,
2907   it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.
2908</para>
2909</refsect1>
2910</refentry>
2911
2912<!-- kernel/irq/chip.c -->
2913<refentry id="API-irq-set-chip">
2914<refentryinfo>
2915 <title>LINUX</title>
2916 <productname>Kernel Hackers Manual</productname>
2917 <date>July 2017</date>
2918</refentryinfo>
2919<refmeta>
2920 <refentrytitle><phrase>irq_set_chip</phrase></refentrytitle>
2921 <manvolnum>9</manvolnum>
2922 <refmiscinfo class="version">4.1.27</refmiscinfo>
2923</refmeta>
2924<refnamediv>
2925 <refname>irq_set_chip</refname>
2926 <refpurpose>
2927  set the irq chip for an irq
2928 </refpurpose>
2929</refnamediv>
2930<refsynopsisdiv>
2931 <title>Synopsis</title>
2932  <funcsynopsis><funcprototype>
2933   <funcdef>int <function>irq_set_chip </function></funcdef>
2934   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2935   <paramdef>struct irq_chip * <parameter>chip</parameter></paramdef>
2936  </funcprototype></funcsynopsis>
2937</refsynopsisdiv>
2938<refsect1>
2939 <title>Arguments</title>
2940 <variablelist>
2941  <varlistentry>
2942   <term><parameter>irq</parameter></term>
2943   <listitem>
2944    <para>
2945     irq number
2946    </para>
2947   </listitem>
2948  </varlistentry>
2949  <varlistentry>
2950   <term><parameter>chip</parameter></term>
2951   <listitem>
2952    <para>
2953     pointer to irq chip description structure
2954    </para>
2955   </listitem>
2956  </varlistentry>
2957 </variablelist>
2958</refsect1>
2959</refentry>
2960
2961<refentry id="API-irq-set-irq-type">
2962<refentryinfo>
2963 <title>LINUX</title>
2964 <productname>Kernel Hackers Manual</productname>
2965 <date>July 2017</date>
2966</refentryinfo>
2967<refmeta>
2968 <refentrytitle><phrase>irq_set_irq_type</phrase></refentrytitle>
2969 <manvolnum>9</manvolnum>
2970 <refmiscinfo class="version">4.1.27</refmiscinfo>
2971</refmeta>
2972<refnamediv>
2973 <refname>irq_set_irq_type</refname>
2974 <refpurpose>
2975     set the irq trigger type for an irq
2976 </refpurpose>
2977</refnamediv>
2978<refsynopsisdiv>
2979 <title>Synopsis</title>
2980  <funcsynopsis><funcprototype>
2981   <funcdef>int <function>irq_set_irq_type </function></funcdef>
2982   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
2983   <paramdef>unsigned int <parameter>type</parameter></paramdef>
2984  </funcprototype></funcsynopsis>
2985</refsynopsisdiv>
2986<refsect1>
2987 <title>Arguments</title>
2988 <variablelist>
2989  <varlistentry>
2990   <term><parameter>irq</parameter></term>
2991   <listitem>
2992    <para>
2993     irq number
2994    </para>
2995   </listitem>
2996  </varlistentry>
2997  <varlistentry>
2998   <term><parameter>type</parameter></term>
2999   <listitem>
3000    <para>
3001     IRQ_TYPE_{LEVEL,EDGE}_* value - see include/linux/irq.h
3002    </para>
3003   </listitem>
3004  </varlistentry>
3005 </variablelist>
3006</refsect1>
3007</refentry>
3008
3009<refentry id="API-irq-set-handler-data">
3010<refentryinfo>
3011 <title>LINUX</title>
3012 <productname>Kernel Hackers Manual</productname>
3013 <date>July 2017</date>
3014</refentryinfo>
3015<refmeta>
3016 <refentrytitle><phrase>irq_set_handler_data</phrase></refentrytitle>
3017 <manvolnum>9</manvolnum>
3018 <refmiscinfo class="version">4.1.27</refmiscinfo>
3019</refmeta>
3020<refnamediv>
3021 <refname>irq_set_handler_data</refname>
3022 <refpurpose>
3023     set irq handler data for an irq
3024 </refpurpose>
3025</refnamediv>
3026<refsynopsisdiv>
3027 <title>Synopsis</title>
3028  <funcsynopsis><funcprototype>
3029   <funcdef>int <function>irq_set_handler_data </function></funcdef>
3030   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3031   <paramdef>void * <parameter>data</parameter></paramdef>
3032  </funcprototype></funcsynopsis>
3033</refsynopsisdiv>
3034<refsect1>
3035 <title>Arguments</title>
3036 <variablelist>
3037  <varlistentry>
3038   <term><parameter>irq</parameter></term>
3039   <listitem>
3040    <para>
3041     Interrupt number
3042    </para>
3043   </listitem>
3044  </varlistentry>
3045  <varlistentry>
3046   <term><parameter>data</parameter></term>
3047   <listitem>
3048    <para>
3049     Pointer to interrupt specific data
3050    </para>
3051   </listitem>
3052  </varlistentry>
3053 </variablelist>
3054</refsect1>
3055<refsect1>
3056<title>Description</title>
3057<para>
3058   Set the hardware irq controller data for an irq
3059</para>
3060</refsect1>
3061</refentry>
3062
3063<refentry id="API-irq-set-chip-data">
3064<refentryinfo>
3065 <title>LINUX</title>
3066 <productname>Kernel Hackers Manual</productname>
3067 <date>July 2017</date>
3068</refentryinfo>
3069<refmeta>
3070 <refentrytitle><phrase>irq_set_chip_data</phrase></refentrytitle>
3071 <manvolnum>9</manvolnum>
3072 <refmiscinfo class="version">4.1.27</refmiscinfo>
3073</refmeta>
3074<refnamediv>
3075 <refname>irq_set_chip_data</refname>
3076 <refpurpose>
3077     set irq chip data for an irq
3078 </refpurpose>
3079</refnamediv>
3080<refsynopsisdiv>
3081 <title>Synopsis</title>
3082  <funcsynopsis><funcprototype>
3083   <funcdef>int <function>irq_set_chip_data </function></funcdef>
3084   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3085   <paramdef>void * <parameter>data</parameter></paramdef>
3086  </funcprototype></funcsynopsis>
3087</refsynopsisdiv>
3088<refsect1>
3089 <title>Arguments</title>
3090 <variablelist>
3091  <varlistentry>
3092   <term><parameter>irq</parameter></term>
3093   <listitem>
3094    <para>
3095     Interrupt number
3096    </para>
3097   </listitem>
3098  </varlistentry>
3099  <varlistentry>
3100   <term><parameter>data</parameter></term>
3101   <listitem>
3102    <para>
3103     Pointer to chip specific data
3104    </para>
3105   </listitem>
3106  </varlistentry>
3107 </variablelist>
3108</refsect1>
3109<refsect1>
3110<title>Description</title>
3111<para>
3112   Set the hardware irq chip data for an irq
3113</para>
3114</refsect1>
3115</refentry>
3116
3117<refentry id="API-handle-simple-irq">
3118<refentryinfo>
3119 <title>LINUX</title>
3120 <productname>Kernel Hackers Manual</productname>
3121 <date>July 2017</date>
3122</refentryinfo>
3123<refmeta>
3124 <refentrytitle><phrase>handle_simple_irq</phrase></refentrytitle>
3125 <manvolnum>9</manvolnum>
3126 <refmiscinfo class="version">4.1.27</refmiscinfo>
3127</refmeta>
3128<refnamediv>
3129 <refname>handle_simple_irq</refname>
3130 <refpurpose>
3131     Simple and software-decoded IRQs.
3132 </refpurpose>
3133</refnamediv>
3134<refsynopsisdiv>
3135 <title>Synopsis</title>
3136  <funcsynopsis><funcprototype>
3137   <funcdef>void <function>handle_simple_irq </function></funcdef>
3138   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3139   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3140  </funcprototype></funcsynopsis>
3141</refsynopsisdiv>
3142<refsect1>
3143 <title>Arguments</title>
3144 <variablelist>
3145  <varlistentry>
3146   <term><parameter>irq</parameter></term>
3147   <listitem>
3148    <para>
3149     the interrupt number
3150    </para>
3151   </listitem>
3152  </varlistentry>
3153  <varlistentry>
3154   <term><parameter>desc</parameter></term>
3155   <listitem>
3156    <para>
3157     the interrupt description structure for this irq
3158    </para>
3159   </listitem>
3160  </varlistentry>
3161 </variablelist>
3162</refsect1>
3163<refsect1>
3164<title>Description</title>
3165<para>
3166   Simple interrupts are either sent from a demultiplexing interrupt
3167   handler or come from hardware, where no interrupt hardware control
3168   is necessary.
3169</para>
3170</refsect1>
3171<refsect1>
3172<title>Note</title>
3173<para>
3174   The caller is expected to handle the ack, clear, mask and
3175   unmask issues if necessary.
3176</para>
3177</refsect1>
3178</refentry>
3179
3180<refentry id="API-handle-level-irq">
3181<refentryinfo>
3182 <title>LINUX</title>
3183 <productname>Kernel Hackers Manual</productname>
3184 <date>July 2017</date>
3185</refentryinfo>
3186<refmeta>
3187 <refentrytitle><phrase>handle_level_irq</phrase></refentrytitle>
3188 <manvolnum>9</manvolnum>
3189 <refmiscinfo class="version">4.1.27</refmiscinfo>
3190</refmeta>
3191<refnamediv>
3192 <refname>handle_level_irq</refname>
3193 <refpurpose>
3194     Level type irq handler
3195 </refpurpose>
3196</refnamediv>
3197<refsynopsisdiv>
3198 <title>Synopsis</title>
3199  <funcsynopsis><funcprototype>
3200   <funcdef>void <function>handle_level_irq </function></funcdef>
3201   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3202   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3203  </funcprototype></funcsynopsis>
3204</refsynopsisdiv>
3205<refsect1>
3206 <title>Arguments</title>
3207 <variablelist>
3208  <varlistentry>
3209   <term><parameter>irq</parameter></term>
3210   <listitem>
3211    <para>
3212     the interrupt number
3213    </para>
3214   </listitem>
3215  </varlistentry>
3216  <varlistentry>
3217   <term><parameter>desc</parameter></term>
3218   <listitem>
3219    <para>
3220     the interrupt description structure for this irq
3221    </para>
3222   </listitem>
3223  </varlistentry>
3224 </variablelist>
3225</refsect1>
3226<refsect1>
3227<title>Description</title>
3228<para>
3229   Level type interrupts are active as long as the hardware line has
3230   the active level. This may require to mask the interrupt and unmask
3231   it after the associated handler has acknowledged the device, so the
3232   interrupt line is back to inactive.
3233</para>
3234</refsect1>
3235</refentry>
3236
3237<refentry id="API-handle-fasteoi-irq">
3238<refentryinfo>
3239 <title>LINUX</title>
3240 <productname>Kernel Hackers Manual</productname>
3241 <date>July 2017</date>
3242</refentryinfo>
3243<refmeta>
3244 <refentrytitle><phrase>handle_fasteoi_irq</phrase></refentrytitle>
3245 <manvolnum>9</manvolnum>
3246 <refmiscinfo class="version">4.1.27</refmiscinfo>
3247</refmeta>
3248<refnamediv>
3249 <refname>handle_fasteoi_irq</refname>
3250 <refpurpose>
3251     irq handler for transparent controllers
3252 </refpurpose>
3253</refnamediv>
3254<refsynopsisdiv>
3255 <title>Synopsis</title>
3256  <funcsynopsis><funcprototype>
3257   <funcdef>void <function>handle_fasteoi_irq </function></funcdef>
3258   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3259   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3260  </funcprototype></funcsynopsis>
3261</refsynopsisdiv>
3262<refsect1>
3263 <title>Arguments</title>
3264 <variablelist>
3265  <varlistentry>
3266   <term><parameter>irq</parameter></term>
3267   <listitem>
3268    <para>
3269     the interrupt number
3270    </para>
3271   </listitem>
3272  </varlistentry>
3273  <varlistentry>
3274   <term><parameter>desc</parameter></term>
3275   <listitem>
3276    <para>
3277     the interrupt description structure for this irq
3278    </para>
3279   </listitem>
3280  </varlistentry>
3281 </variablelist>
3282</refsect1>
3283<refsect1>
3284<title>Only a single callback will be issued to the chip</title>
3285<para>
3286   an -&gt;<function>eoi</function>
3287   call when the interrupt has been serviced. This enables support
3288   for modern forms of interrupt handlers, which handle the flow
3289   details in hardware, transparently.
3290</para>
3291</refsect1>
3292</refentry>
3293
3294<refentry id="API-handle-edge-irq">
3295<refentryinfo>
3296 <title>LINUX</title>
3297 <productname>Kernel Hackers Manual</productname>
3298 <date>July 2017</date>
3299</refentryinfo>
3300<refmeta>
3301 <refentrytitle><phrase>handle_edge_irq</phrase></refentrytitle>
3302 <manvolnum>9</manvolnum>
3303 <refmiscinfo class="version">4.1.27</refmiscinfo>
3304</refmeta>
3305<refnamediv>
3306 <refname>handle_edge_irq</refname>
3307 <refpurpose>
3308     edge type IRQ handler
3309 </refpurpose>
3310</refnamediv>
3311<refsynopsisdiv>
3312 <title>Synopsis</title>
3313  <funcsynopsis><funcprototype>
3314   <funcdef>void <function>handle_edge_irq </function></funcdef>
3315   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3316   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3317  </funcprototype></funcsynopsis>
3318</refsynopsisdiv>
3319<refsect1>
3320 <title>Arguments</title>
3321 <variablelist>
3322  <varlistentry>
3323   <term><parameter>irq</parameter></term>
3324   <listitem>
3325    <para>
3326     the interrupt number
3327    </para>
3328   </listitem>
3329  </varlistentry>
3330  <varlistentry>
3331   <term><parameter>desc</parameter></term>
3332   <listitem>
3333    <para>
3334     the interrupt description structure for this irq
3335    </para>
3336   </listitem>
3337  </varlistentry>
3338 </variablelist>
3339</refsect1>
3340<refsect1>
3341<title>Description</title>
3342<para>
3343   Interrupt occures on the falling and/or rising edge of a hardware
3344   signal. The occurrence is latched into the irq controller hardware
3345   and must be acked in order to be reenabled. After the ack another
3346   interrupt can happen on the same source even before the first one
3347   is handled by the associated event handler. If this happens it
3348   might be necessary to disable (mask) the interrupt depending on the
3349   controller hardware. This requires to reenable the interrupt inside
3350   of the loop which handles the interrupts which have arrived while
3351   the handler was running. If all pending interrupts are handled, the
3352   loop is left.
3353</para>
3354</refsect1>
3355</refentry>
3356
3357  </chapter>
3358
3359  <chapter id="intfunctions">
3360     <title>Internal Functions Provided</title>
3361     <para>
3362     This chapter contains the autogenerated documentation of the internal functions.
3363     </para>
3364<!-- kernel/irq/irqdesc.c -->
3365<refentry id="API---handle-domain-irq">
3366<refentryinfo>
3367 <title>LINUX</title>
3368 <productname>Kernel Hackers Manual</productname>
3369 <date>July 2017</date>
3370</refentryinfo>
3371<refmeta>
3372 <refentrytitle><phrase>__handle_domain_irq</phrase></refentrytitle>
3373 <manvolnum>9</manvolnum>
3374 <refmiscinfo class="version">4.1.27</refmiscinfo>
3375</refmeta>
3376<refnamediv>
3377 <refname>__handle_domain_irq</refname>
3378 <refpurpose>
3379  Invoke the handler for a HW irq belonging to a domain
3380 </refpurpose>
3381</refnamediv>
3382<refsynopsisdiv>
3383 <title>Synopsis</title>
3384  <funcsynopsis><funcprototype>
3385   <funcdef>int <function>__handle_domain_irq </function></funcdef>
3386   <paramdef>struct irq_domain * <parameter>domain</parameter></paramdef>
3387   <paramdef>unsigned int <parameter>hwirq</parameter></paramdef>
3388   <paramdef>bool <parameter>lookup</parameter></paramdef>
3389   <paramdef>struct pt_regs * <parameter>regs</parameter></paramdef>
3390  </funcprototype></funcsynopsis>
3391</refsynopsisdiv>
3392<refsect1>
3393 <title>Arguments</title>
3394 <variablelist>
3395  <varlistentry>
3396   <term><parameter>domain</parameter></term>
3397   <listitem>
3398    <para>
3399     The domain where to perform the lookup
3400    </para>
3401   </listitem>
3402  </varlistentry>
3403  <varlistentry>
3404   <term><parameter>hwirq</parameter></term>
3405   <listitem>
3406    <para>
3407     The HW irq number to convert to a logical one
3408    </para>
3409   </listitem>
3410  </varlistentry>
3411  <varlistentry>
3412   <term><parameter>lookup</parameter></term>
3413   <listitem>
3414    <para>
3415     Whether to perform the domain lookup or not
3416    </para>
3417   </listitem>
3418  </varlistentry>
3419  <varlistentry>
3420   <term><parameter>regs</parameter></term>
3421   <listitem>
3422    <para>
3423     Register file coming from the low-level handling code
3424    </para>
3425   </listitem>
3426  </varlistentry>
3427 </variablelist>
3428</refsect1>
3429<refsect1>
3430<title>Returns</title>
3431<para>
3432   0 on success, or -EINVAL if conversion has failed
3433</para>
3434</refsect1>
3435</refentry>
3436
3437<refentry id="API-irq-get-next-irq">
3438<refentryinfo>
3439 <title>LINUX</title>
3440 <productname>Kernel Hackers Manual</productname>
3441 <date>July 2017</date>
3442</refentryinfo>
3443<refmeta>
3444 <refentrytitle><phrase>irq_get_next_irq</phrase></refentrytitle>
3445 <manvolnum>9</manvolnum>
3446 <refmiscinfo class="version">4.1.27</refmiscinfo>
3447</refmeta>
3448<refnamediv>
3449 <refname>irq_get_next_irq</refname>
3450 <refpurpose>
3451     get next allocated irq number
3452 </refpurpose>
3453</refnamediv>
3454<refsynopsisdiv>
3455 <title>Synopsis</title>
3456  <funcsynopsis><funcprototype>
3457   <funcdef>unsigned int <function>irq_get_next_irq </function></funcdef>
3458   <paramdef>unsigned int <parameter>offset</parameter></paramdef>
3459  </funcprototype></funcsynopsis>
3460</refsynopsisdiv>
3461<refsect1>
3462 <title>Arguments</title>
3463 <variablelist>
3464  <varlistentry>
3465   <term><parameter>offset</parameter></term>
3466   <listitem>
3467    <para>
3468     where to start the search
3469    </para>
3470   </listitem>
3471  </varlistentry>
3472 </variablelist>
3473</refsect1>
3474<refsect1>
3475<title>Description</title>
3476<para>
3477   Returns next irq number after offset or nr_irqs if none is found.
3478</para>
3479</refsect1>
3480</refentry>
3481
3482<refentry id="API-kstat-irqs-cpu">
3483<refentryinfo>
3484 <title>LINUX</title>
3485 <productname>Kernel Hackers Manual</productname>
3486 <date>July 2017</date>
3487</refentryinfo>
3488<refmeta>
3489 <refentrytitle><phrase>kstat_irqs_cpu</phrase></refentrytitle>
3490 <manvolnum>9</manvolnum>
3491 <refmiscinfo class="version">4.1.27</refmiscinfo>
3492</refmeta>
3493<refnamediv>
3494 <refname>kstat_irqs_cpu</refname>
3495 <refpurpose>
3496     Get the statistics for an interrupt on a cpu
3497 </refpurpose>
3498</refnamediv>
3499<refsynopsisdiv>
3500 <title>Synopsis</title>
3501  <funcsynopsis><funcprototype>
3502   <funcdef>unsigned int <function>kstat_irqs_cpu </function></funcdef>
3503   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3504   <paramdef>int <parameter>cpu</parameter></paramdef>
3505  </funcprototype></funcsynopsis>
3506</refsynopsisdiv>
3507<refsect1>
3508 <title>Arguments</title>
3509 <variablelist>
3510  <varlistentry>
3511   <term><parameter>irq</parameter></term>
3512   <listitem>
3513    <para>
3514     The interrupt number
3515    </para>
3516   </listitem>
3517  </varlistentry>
3518  <varlistentry>
3519   <term><parameter>cpu</parameter></term>
3520   <listitem>
3521    <para>
3522     The cpu number
3523    </para>
3524   </listitem>
3525  </varlistentry>
3526 </variablelist>
3527</refsect1>
3528<refsect1>
3529<title>Description</title>
3530<para>
3531   Returns the sum of interrupt counts on <parameter>cpu</parameter> since boot for
3532   <parameter>irq</parameter>. The caller must ensure that the interrupt is not removed
3533   concurrently.
3534</para>
3535</refsect1>
3536</refentry>
3537
3538<refentry id="API-kstat-irqs">
3539<refentryinfo>
3540 <title>LINUX</title>
3541 <productname>Kernel Hackers Manual</productname>
3542 <date>July 2017</date>
3543</refentryinfo>
3544<refmeta>
3545 <refentrytitle><phrase>kstat_irqs</phrase></refentrytitle>
3546 <manvolnum>9</manvolnum>
3547 <refmiscinfo class="version">4.1.27</refmiscinfo>
3548</refmeta>
3549<refnamediv>
3550 <refname>kstat_irqs</refname>
3551 <refpurpose>
3552     Get the statistics for an interrupt
3553 </refpurpose>
3554</refnamediv>
3555<refsynopsisdiv>
3556 <title>Synopsis</title>
3557  <funcsynopsis><funcprototype>
3558   <funcdef>unsigned int <function>kstat_irqs </function></funcdef>
3559   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3560  </funcprototype></funcsynopsis>
3561</refsynopsisdiv>
3562<refsect1>
3563 <title>Arguments</title>
3564 <variablelist>
3565  <varlistentry>
3566   <term><parameter>irq</parameter></term>
3567   <listitem>
3568    <para>
3569     The interrupt number
3570    </para>
3571   </listitem>
3572  </varlistentry>
3573 </variablelist>
3574</refsect1>
3575<refsect1>
3576<title>Description</title>
3577<para>
3578   Returns the sum of interrupt counts on all cpus since boot for
3579   <parameter>irq</parameter>. The caller must ensure that the interrupt is not removed
3580   concurrently.
3581</para>
3582</refsect1>
3583</refentry>
3584
3585<refentry id="API-kstat-irqs-usr">
3586<refentryinfo>
3587 <title>LINUX</title>
3588 <productname>Kernel Hackers Manual</productname>
3589 <date>July 2017</date>
3590</refentryinfo>
3591<refmeta>
3592 <refentrytitle><phrase>kstat_irqs_usr</phrase></refentrytitle>
3593 <manvolnum>9</manvolnum>
3594 <refmiscinfo class="version">4.1.27</refmiscinfo>
3595</refmeta>
3596<refnamediv>
3597 <refname>kstat_irqs_usr</refname>
3598 <refpurpose>
3599     Get the statistics for an interrupt
3600 </refpurpose>
3601</refnamediv>
3602<refsynopsisdiv>
3603 <title>Synopsis</title>
3604  <funcsynopsis><funcprototype>
3605   <funcdef>unsigned int <function>kstat_irqs_usr </function></funcdef>
3606   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3607  </funcprototype></funcsynopsis>
3608</refsynopsisdiv>
3609<refsect1>
3610 <title>Arguments</title>
3611 <variablelist>
3612  <varlistentry>
3613   <term><parameter>irq</parameter></term>
3614   <listitem>
3615    <para>
3616     The interrupt number
3617    </para>
3618   </listitem>
3619  </varlistentry>
3620 </variablelist>
3621</refsect1>
3622<refsect1>
3623<title>Description</title>
3624<para>
3625   Returns the sum of interrupt counts on all cpus since boot for
3626   <parameter>irq</parameter>. Contrary to <function>kstat_irqs</function> this can be called from any
3627   preemptible context. It's protected against concurrent removal of
3628   an interrupt descriptor when sparse irqs are enabled.
3629</para>
3630</refsect1>
3631</refentry>
3632
3633<!-- kernel/irq/handle.c -->
3634<refentry id="API-handle-bad-irq">
3635<refentryinfo>
3636 <title>LINUX</title>
3637 <productname>Kernel Hackers Manual</productname>
3638 <date>July 2017</date>
3639</refentryinfo>
3640<refmeta>
3641 <refentrytitle><phrase>handle_bad_irq</phrase></refentrytitle>
3642 <manvolnum>9</manvolnum>
3643 <refmiscinfo class="version">4.1.27</refmiscinfo>
3644</refmeta>
3645<refnamediv>
3646 <refname>handle_bad_irq</refname>
3647 <refpurpose>
3648  handle spurious and unhandled irqs
3649 </refpurpose>
3650</refnamediv>
3651<refsynopsisdiv>
3652 <title>Synopsis</title>
3653  <funcsynopsis><funcprototype>
3654   <funcdef>void <function>handle_bad_irq </function></funcdef>
3655   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3656   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3657  </funcprototype></funcsynopsis>
3658</refsynopsisdiv>
3659<refsect1>
3660 <title>Arguments</title>
3661 <variablelist>
3662  <varlistentry>
3663   <term><parameter>irq</parameter></term>
3664   <listitem>
3665    <para>
3666     the interrupt number
3667    </para>
3668   </listitem>
3669  </varlistentry>
3670  <varlistentry>
3671   <term><parameter>desc</parameter></term>
3672   <listitem>
3673    <para>
3674     description of the interrupt
3675    </para>
3676   </listitem>
3677  </varlistentry>
3678 </variablelist>
3679</refsect1>
3680<refsect1>
3681<title>Description</title>
3682<para>
3683   Handles spurious and unhandled IRQ's. It also prints a debugmessage.
3684</para>
3685</refsect1>
3686</refentry>
3687
3688<!-- kernel/irq/chip.c -->
3689<refentry id="API-irq-set-msi-desc-off">
3690<refentryinfo>
3691 <title>LINUX</title>
3692 <productname>Kernel Hackers Manual</productname>
3693 <date>July 2017</date>
3694</refentryinfo>
3695<refmeta>
3696 <refentrytitle><phrase>irq_set_msi_desc_off</phrase></refentrytitle>
3697 <manvolnum>9</manvolnum>
3698 <refmiscinfo class="version">4.1.27</refmiscinfo>
3699</refmeta>
3700<refnamediv>
3701 <refname>irq_set_msi_desc_off</refname>
3702 <refpurpose>
3703  set MSI descriptor data for an irq at offset
3704 </refpurpose>
3705</refnamediv>
3706<refsynopsisdiv>
3707 <title>Synopsis</title>
3708  <funcsynopsis><funcprototype>
3709   <funcdef>int <function>irq_set_msi_desc_off </function></funcdef>
3710   <paramdef>unsigned int <parameter>irq_base</parameter></paramdef>
3711   <paramdef>unsigned int <parameter>irq_offset</parameter></paramdef>
3712   <paramdef>struct msi_desc * <parameter>entry</parameter></paramdef>
3713  </funcprototype></funcsynopsis>
3714</refsynopsisdiv>
3715<refsect1>
3716 <title>Arguments</title>
3717 <variablelist>
3718  <varlistentry>
3719   <term><parameter>irq_base</parameter></term>
3720   <listitem>
3721    <para>
3722     Interrupt number base
3723    </para>
3724   </listitem>
3725  </varlistentry>
3726  <varlistentry>
3727   <term><parameter>irq_offset</parameter></term>
3728   <listitem>
3729    <para>
3730     Interrupt number offset
3731    </para>
3732   </listitem>
3733  </varlistentry>
3734  <varlistentry>
3735   <term><parameter>entry</parameter></term>
3736   <listitem>
3737    <para>
3738     Pointer to MSI descriptor data
3739    </para>
3740   </listitem>
3741  </varlistentry>
3742 </variablelist>
3743</refsect1>
3744<refsect1>
3745<title>Description</title>
3746<para>
3747   Set the MSI descriptor entry for an irq at offset
3748</para>
3749</refsect1>
3750</refentry>
3751
3752<refentry id="API-irq-set-msi-desc">
3753<refentryinfo>
3754 <title>LINUX</title>
3755 <productname>Kernel Hackers Manual</productname>
3756 <date>July 2017</date>
3757</refentryinfo>
3758<refmeta>
3759 <refentrytitle><phrase>irq_set_msi_desc</phrase></refentrytitle>
3760 <manvolnum>9</manvolnum>
3761 <refmiscinfo class="version">4.1.27</refmiscinfo>
3762</refmeta>
3763<refnamediv>
3764 <refname>irq_set_msi_desc</refname>
3765 <refpurpose>
3766     set MSI descriptor data for an irq
3767 </refpurpose>
3768</refnamediv>
3769<refsynopsisdiv>
3770 <title>Synopsis</title>
3771  <funcsynopsis><funcprototype>
3772   <funcdef>int <function>irq_set_msi_desc </function></funcdef>
3773   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3774   <paramdef>struct msi_desc * <parameter>entry</parameter></paramdef>
3775  </funcprototype></funcsynopsis>
3776</refsynopsisdiv>
3777<refsect1>
3778 <title>Arguments</title>
3779 <variablelist>
3780  <varlistentry>
3781   <term><parameter>irq</parameter></term>
3782   <listitem>
3783    <para>
3784     Interrupt number
3785    </para>
3786   </listitem>
3787  </varlistentry>
3788  <varlistentry>
3789   <term><parameter>entry</parameter></term>
3790   <listitem>
3791    <para>
3792     Pointer to MSI descriptor data
3793    </para>
3794   </listitem>
3795  </varlistentry>
3796 </variablelist>
3797</refsect1>
3798<refsect1>
3799<title>Description</title>
3800<para>
3801   Set the MSI descriptor entry for an irq
3802</para>
3803</refsect1>
3804</refentry>
3805
3806<refentry id="API-irq-disable">
3807<refentryinfo>
3808 <title>LINUX</title>
3809 <productname>Kernel Hackers Manual</productname>
3810 <date>July 2017</date>
3811</refentryinfo>
3812<refmeta>
3813 <refentrytitle><phrase>irq_disable</phrase></refentrytitle>
3814 <manvolnum>9</manvolnum>
3815 <refmiscinfo class="version">4.1.27</refmiscinfo>
3816</refmeta>
3817<refnamediv>
3818 <refname>irq_disable</refname>
3819 <refpurpose>
3820     Mark interrupt disabled
3821 </refpurpose>
3822</refnamediv>
3823<refsynopsisdiv>
3824 <title>Synopsis</title>
3825  <funcsynopsis><funcprototype>
3826   <funcdef>void <function>irq_disable </function></funcdef>
3827   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3828  </funcprototype></funcsynopsis>
3829</refsynopsisdiv>
3830<refsect1>
3831 <title>Arguments</title>
3832 <variablelist>
3833  <varlistentry>
3834   <term><parameter>desc</parameter></term>
3835   <listitem>
3836    <para>
3837     irq descriptor which should be disabled
3838    </para>
3839   </listitem>
3840  </varlistentry>
3841 </variablelist>
3842</refsect1>
3843<refsect1>
3844<title>Description</title>
3845<para>
3846   If the chip does not implement the irq_disable callback, we
3847   use a lazy disable approach. That means we mark the interrupt
3848   disabled, but leave the hardware unmasked. That's an
3849   optimization because we avoid the hardware access for the
3850   common case where no interrupt happens after we marked it
3851   disabled. If an interrupt happens, then the interrupt flow
3852   handler masks the line at the hardware level and marks it
3853   pending.
3854</para>
3855</refsect1>
3856</refentry>
3857
3858<refentry id="API-handle-edge-eoi-irq">
3859<refentryinfo>
3860 <title>LINUX</title>
3861 <productname>Kernel Hackers Manual</productname>
3862 <date>July 2017</date>
3863</refentryinfo>
3864<refmeta>
3865 <refentrytitle><phrase>handle_edge_eoi_irq</phrase></refentrytitle>
3866 <manvolnum>9</manvolnum>
3867 <refmiscinfo class="version">4.1.27</refmiscinfo>
3868</refmeta>
3869<refnamediv>
3870 <refname>handle_edge_eoi_irq</refname>
3871 <refpurpose>
3872     edge eoi type IRQ handler
3873 </refpurpose>
3874</refnamediv>
3875<refsynopsisdiv>
3876 <title>Synopsis</title>
3877  <funcsynopsis><funcprototype>
3878   <funcdef>void <function>handle_edge_eoi_irq </function></funcdef>
3879   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3880   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3881  </funcprototype></funcsynopsis>
3882</refsynopsisdiv>
3883<refsect1>
3884 <title>Arguments</title>
3885 <variablelist>
3886  <varlistentry>
3887   <term><parameter>irq</parameter></term>
3888   <listitem>
3889    <para>
3890     the interrupt number
3891    </para>
3892   </listitem>
3893  </varlistentry>
3894  <varlistentry>
3895   <term><parameter>desc</parameter></term>
3896   <listitem>
3897    <para>
3898     the interrupt description structure for this irq
3899    </para>
3900   </listitem>
3901  </varlistentry>
3902 </variablelist>
3903</refsect1>
3904<refsect1>
3905<title>Description</title>
3906<para>
3907   Similar as the above handle_edge_irq, but using eoi and w/o the
3908   mask/unmask logic.
3909</para>
3910</refsect1>
3911</refentry>
3912
3913<refentry id="API-handle-percpu-irq">
3914<refentryinfo>
3915 <title>LINUX</title>
3916 <productname>Kernel Hackers Manual</productname>
3917 <date>July 2017</date>
3918</refentryinfo>
3919<refmeta>
3920 <refentrytitle><phrase>handle_percpu_irq</phrase></refentrytitle>
3921 <manvolnum>9</manvolnum>
3922 <refmiscinfo class="version">4.1.27</refmiscinfo>
3923</refmeta>
3924<refnamediv>
3925 <refname>handle_percpu_irq</refname>
3926 <refpurpose>
3927     Per CPU local irq handler
3928 </refpurpose>
3929</refnamediv>
3930<refsynopsisdiv>
3931 <title>Synopsis</title>
3932  <funcsynopsis><funcprototype>
3933   <funcdef>void <function>handle_percpu_irq </function></funcdef>
3934   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3935   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3936  </funcprototype></funcsynopsis>
3937</refsynopsisdiv>
3938<refsect1>
3939 <title>Arguments</title>
3940 <variablelist>
3941  <varlistentry>
3942   <term><parameter>irq</parameter></term>
3943   <listitem>
3944    <para>
3945     the interrupt number
3946    </para>
3947   </listitem>
3948  </varlistentry>
3949  <varlistentry>
3950   <term><parameter>desc</parameter></term>
3951   <listitem>
3952    <para>
3953     the interrupt description structure for this irq
3954    </para>
3955   </listitem>
3956  </varlistentry>
3957 </variablelist>
3958</refsect1>
3959<refsect1>
3960<title>Description</title>
3961<para>
3962   Per CPU interrupts on SMP machines without locking requirements
3963</para>
3964</refsect1>
3965</refentry>
3966
3967<refentry id="API-handle-percpu-devid-irq">
3968<refentryinfo>
3969 <title>LINUX</title>
3970 <productname>Kernel Hackers Manual</productname>
3971 <date>July 2017</date>
3972</refentryinfo>
3973<refmeta>
3974 <refentrytitle><phrase>handle_percpu_devid_irq</phrase></refentrytitle>
3975 <manvolnum>9</manvolnum>
3976 <refmiscinfo class="version">4.1.27</refmiscinfo>
3977</refmeta>
3978<refnamediv>
3979 <refname>handle_percpu_devid_irq</refname>
3980 <refpurpose>
3981     Per CPU local irq handler with per cpu dev ids
3982 </refpurpose>
3983</refnamediv>
3984<refsynopsisdiv>
3985 <title>Synopsis</title>
3986  <funcsynopsis><funcprototype>
3987   <funcdef>void <function>handle_percpu_devid_irq </function></funcdef>
3988   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
3989   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
3990  </funcprototype></funcsynopsis>
3991</refsynopsisdiv>
3992<refsect1>
3993 <title>Arguments</title>
3994 <variablelist>
3995  <varlistentry>
3996   <term><parameter>irq</parameter></term>
3997   <listitem>
3998    <para>
3999     the interrupt number
4000    </para>
4001   </listitem>
4002  </varlistentry>
4003  <varlistentry>
4004   <term><parameter>desc</parameter></term>
4005   <listitem>
4006    <para>
4007     the interrupt description structure for this irq
4008    </para>
4009   </listitem>
4010  </varlistentry>
4011 </variablelist>
4012</refsect1>
4013<refsect1>
4014<title>Description</title>
4015<para>
4016   Per CPU interrupts on SMP machines without locking requirements. Same as
4017   <function>handle_percpu_irq</function> above but with the following extras:
4018   </para><para>
4019
4020   action-&gt;percpu_dev_id is a pointer to percpu variables which
4021   contain the real device id for the cpu on which this handler is
4022   called
4023</para>
4024</refsect1>
4025</refentry>
4026
4027<refentry id="API-irq-cpu-online">
4028<refentryinfo>
4029 <title>LINUX</title>
4030 <productname>Kernel Hackers Manual</productname>
4031 <date>July 2017</date>
4032</refentryinfo>
4033<refmeta>
4034 <refentrytitle><phrase>irq_cpu_online</phrase></refentrytitle>
4035 <manvolnum>9</manvolnum>
4036 <refmiscinfo class="version">4.1.27</refmiscinfo>
4037</refmeta>
4038<refnamediv>
4039 <refname>irq_cpu_online</refname>
4040 <refpurpose>
4041     Invoke all irq_cpu_online functions.
4042 </refpurpose>
4043</refnamediv>
4044<refsynopsisdiv>
4045 <title>Synopsis</title>
4046  <funcsynopsis><funcprototype>
4047   <funcdef>void <function>irq_cpu_online </function></funcdef>
4048   <paramdef> <parameter>void</parameter></paramdef>
4049  </funcprototype></funcsynopsis>
4050</refsynopsisdiv>
4051<refsect1>
4052 <title>Arguments</title>
4053 <variablelist>
4054  <varlistentry>
4055   <term><parameter>void</parameter></term>
4056   <listitem>
4057    <para>
4058     no arguments
4059    </para>
4060   </listitem>
4061  </varlistentry>
4062 </variablelist>
4063</refsect1>
4064<refsect1>
4065<title>Description</title>
4066<para>
4067   </para><para>
4068
4069   Iterate through all irqs and invoke the chip.<function>irq_cpu_online</function>
4070   for each.
4071</para>
4072</refsect1>
4073</refentry>
4074
4075<refentry id="API-irq-cpu-offline">
4076<refentryinfo>
4077 <title>LINUX</title>
4078 <productname>Kernel Hackers Manual</productname>
4079 <date>July 2017</date>
4080</refentryinfo>
4081<refmeta>
4082 <refentrytitle><phrase>irq_cpu_offline</phrase></refentrytitle>
4083 <manvolnum>9</manvolnum>
4084 <refmiscinfo class="version">4.1.27</refmiscinfo>
4085</refmeta>
4086<refnamediv>
4087 <refname>irq_cpu_offline</refname>
4088 <refpurpose>
4089     Invoke all irq_cpu_offline functions.
4090 </refpurpose>
4091</refnamediv>
4092<refsynopsisdiv>
4093 <title>Synopsis</title>
4094  <funcsynopsis><funcprototype>
4095   <funcdef>void <function>irq_cpu_offline </function></funcdef>
4096   <paramdef> <parameter>void</parameter></paramdef>
4097  </funcprototype></funcsynopsis>
4098</refsynopsisdiv>
4099<refsect1>
4100 <title>Arguments</title>
4101 <variablelist>
4102  <varlistentry>
4103   <term><parameter>void</parameter></term>
4104   <listitem>
4105    <para>
4106     no arguments
4107    </para>
4108   </listitem>
4109  </varlistentry>
4110 </variablelist>
4111</refsect1>
4112<refsect1>
4113<title>Description</title>
4114<para>
4115   </para><para>
4116
4117   Iterate through all irqs and invoke the chip.<function>irq_cpu_offline</function>
4118   for each.
4119</para>
4120</refsect1>
4121</refentry>
4122
4123<refentry id="API-irq-chip-ack-parent">
4124<refentryinfo>
4125 <title>LINUX</title>
4126 <productname>Kernel Hackers Manual</productname>
4127 <date>July 2017</date>
4128</refentryinfo>
4129<refmeta>
4130 <refentrytitle><phrase>irq_chip_ack_parent</phrase></refentrytitle>
4131 <manvolnum>9</manvolnum>
4132 <refmiscinfo class="version">4.1.27</refmiscinfo>
4133</refmeta>
4134<refnamediv>
4135 <refname>irq_chip_ack_parent</refname>
4136 <refpurpose>
4137     Acknowledge the parent interrupt
4138 </refpurpose>
4139</refnamediv>
4140<refsynopsisdiv>
4141 <title>Synopsis</title>
4142  <funcsynopsis><funcprototype>
4143   <funcdef>void <function>irq_chip_ack_parent </function></funcdef>
4144   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4145  </funcprototype></funcsynopsis>
4146</refsynopsisdiv>
4147<refsect1>
4148 <title>Arguments</title>
4149 <variablelist>
4150  <varlistentry>
4151   <term><parameter>data</parameter></term>
4152   <listitem>
4153    <para>
4154     Pointer to interrupt specific data
4155    </para>
4156   </listitem>
4157  </varlistentry>
4158 </variablelist>
4159</refsect1>
4160</refentry>
4161
4162<refentry id="API-irq-chip-mask-parent">
4163<refentryinfo>
4164 <title>LINUX</title>
4165 <productname>Kernel Hackers Manual</productname>
4166 <date>July 2017</date>
4167</refentryinfo>
4168<refmeta>
4169 <refentrytitle><phrase>irq_chip_mask_parent</phrase></refentrytitle>
4170 <manvolnum>9</manvolnum>
4171 <refmiscinfo class="version">4.1.27</refmiscinfo>
4172</refmeta>
4173<refnamediv>
4174 <refname>irq_chip_mask_parent</refname>
4175 <refpurpose>
4176     Mask the parent interrupt
4177 </refpurpose>
4178</refnamediv>
4179<refsynopsisdiv>
4180 <title>Synopsis</title>
4181  <funcsynopsis><funcprototype>
4182   <funcdef>void <function>irq_chip_mask_parent </function></funcdef>
4183   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4184  </funcprototype></funcsynopsis>
4185</refsynopsisdiv>
4186<refsect1>
4187 <title>Arguments</title>
4188 <variablelist>
4189  <varlistentry>
4190   <term><parameter>data</parameter></term>
4191   <listitem>
4192    <para>
4193     Pointer to interrupt specific data
4194    </para>
4195   </listitem>
4196  </varlistentry>
4197 </variablelist>
4198</refsect1>
4199</refentry>
4200
4201<refentry id="API-irq-chip-unmask-parent">
4202<refentryinfo>
4203 <title>LINUX</title>
4204 <productname>Kernel Hackers Manual</productname>
4205 <date>July 2017</date>
4206</refentryinfo>
4207<refmeta>
4208 <refentrytitle><phrase>irq_chip_unmask_parent</phrase></refentrytitle>
4209 <manvolnum>9</manvolnum>
4210 <refmiscinfo class="version">4.1.27</refmiscinfo>
4211</refmeta>
4212<refnamediv>
4213 <refname>irq_chip_unmask_parent</refname>
4214 <refpurpose>
4215     Unmask the parent interrupt
4216 </refpurpose>
4217</refnamediv>
4218<refsynopsisdiv>
4219 <title>Synopsis</title>
4220  <funcsynopsis><funcprototype>
4221   <funcdef>void <function>irq_chip_unmask_parent </function></funcdef>
4222   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4223  </funcprototype></funcsynopsis>
4224</refsynopsisdiv>
4225<refsect1>
4226 <title>Arguments</title>
4227 <variablelist>
4228  <varlistentry>
4229   <term><parameter>data</parameter></term>
4230   <listitem>
4231    <para>
4232     Pointer to interrupt specific data
4233    </para>
4234   </listitem>
4235  </varlistentry>
4236 </variablelist>
4237</refsect1>
4238</refentry>
4239
4240<refentry id="API-irq-chip-eoi-parent">
4241<refentryinfo>
4242 <title>LINUX</title>
4243 <productname>Kernel Hackers Manual</productname>
4244 <date>July 2017</date>
4245</refentryinfo>
4246<refmeta>
4247 <refentrytitle><phrase>irq_chip_eoi_parent</phrase></refentrytitle>
4248 <manvolnum>9</manvolnum>
4249 <refmiscinfo class="version">4.1.27</refmiscinfo>
4250</refmeta>
4251<refnamediv>
4252 <refname>irq_chip_eoi_parent</refname>
4253 <refpurpose>
4254     Invoke EOI on the parent interrupt
4255 </refpurpose>
4256</refnamediv>
4257<refsynopsisdiv>
4258 <title>Synopsis</title>
4259  <funcsynopsis><funcprototype>
4260   <funcdef>void <function>irq_chip_eoi_parent </function></funcdef>
4261   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4262  </funcprototype></funcsynopsis>
4263</refsynopsisdiv>
4264<refsect1>
4265 <title>Arguments</title>
4266 <variablelist>
4267  <varlistentry>
4268   <term><parameter>data</parameter></term>
4269   <listitem>
4270    <para>
4271     Pointer to interrupt specific data
4272    </para>
4273   </listitem>
4274  </varlistentry>
4275 </variablelist>
4276</refsect1>
4277</refentry>
4278
4279<refentry id="API-irq-chip-set-affinity-parent">
4280<refentryinfo>
4281 <title>LINUX</title>
4282 <productname>Kernel Hackers Manual</productname>
4283 <date>July 2017</date>
4284</refentryinfo>
4285<refmeta>
4286 <refentrytitle><phrase>irq_chip_set_affinity_parent</phrase></refentrytitle>
4287 <manvolnum>9</manvolnum>
4288 <refmiscinfo class="version">4.1.27</refmiscinfo>
4289</refmeta>
4290<refnamediv>
4291 <refname>irq_chip_set_affinity_parent</refname>
4292 <refpurpose>
4293     Set affinity on the parent interrupt
4294 </refpurpose>
4295</refnamediv>
4296<refsynopsisdiv>
4297 <title>Synopsis</title>
4298  <funcsynopsis><funcprototype>
4299   <funcdef>int <function>irq_chip_set_affinity_parent </function></funcdef>
4300   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4301   <paramdef>const struct cpumask * <parameter>dest</parameter></paramdef>
4302   <paramdef>bool <parameter>force</parameter></paramdef>
4303  </funcprototype></funcsynopsis>
4304</refsynopsisdiv>
4305<refsect1>
4306 <title>Arguments</title>
4307 <variablelist>
4308  <varlistentry>
4309   <term><parameter>data</parameter></term>
4310   <listitem>
4311    <para>
4312     Pointer to interrupt specific data
4313    </para>
4314   </listitem>
4315  </varlistentry>
4316  <varlistentry>
4317   <term><parameter>dest</parameter></term>
4318   <listitem>
4319    <para>
4320     The affinity mask to set
4321    </para>
4322   </listitem>
4323  </varlistentry>
4324  <varlistentry>
4325   <term><parameter>force</parameter></term>
4326   <listitem>
4327    <para>
4328     Flag to enforce setting (disable online checks)
4329    </para>
4330   </listitem>
4331  </varlistentry>
4332 </variablelist>
4333</refsect1>
4334<refsect1>
4335<title>Description</title>
4336<para>
4337   Conditinal, as the underlying parent chip might not implement it.
4338</para>
4339</refsect1>
4340</refentry>
4341
4342<refentry id="API-irq-chip-set-type-parent">
4343<refentryinfo>
4344 <title>LINUX</title>
4345 <productname>Kernel Hackers Manual</productname>
4346 <date>July 2017</date>
4347</refentryinfo>
4348<refmeta>
4349 <refentrytitle><phrase>irq_chip_set_type_parent</phrase></refentrytitle>
4350 <manvolnum>9</manvolnum>
4351 <refmiscinfo class="version">4.1.27</refmiscinfo>
4352</refmeta>
4353<refnamediv>
4354 <refname>irq_chip_set_type_parent</refname>
4355 <refpurpose>
4356     Set IRQ type on the parent interrupt
4357 </refpurpose>
4358</refnamediv>
4359<refsynopsisdiv>
4360 <title>Synopsis</title>
4361  <funcsynopsis><funcprototype>
4362   <funcdef>int <function>irq_chip_set_type_parent </function></funcdef>
4363   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4364   <paramdef>unsigned int <parameter>type</parameter></paramdef>
4365  </funcprototype></funcsynopsis>
4366</refsynopsisdiv>
4367<refsect1>
4368 <title>Arguments</title>
4369 <variablelist>
4370  <varlistentry>
4371   <term><parameter>data</parameter></term>
4372   <listitem>
4373    <para>
4374     Pointer to interrupt specific data
4375    </para>
4376   </listitem>
4377  </varlistentry>
4378  <varlistentry>
4379   <term><parameter>type</parameter></term>
4380   <listitem>
4381    <para>
4382     IRQ_TYPE_{LEVEL,EDGE}_* value - see include/linux/irq.h
4383    </para>
4384   </listitem>
4385  </varlistentry>
4386 </variablelist>
4387</refsect1>
4388<refsect1>
4389<title>Description</title>
4390<para>
4391   Conditional, as the underlying parent chip might not implement it.
4392</para>
4393</refsect1>
4394</refentry>
4395
4396<refentry id="API-irq-chip-retrigger-hierarchy">
4397<refentryinfo>
4398 <title>LINUX</title>
4399 <productname>Kernel Hackers Manual</productname>
4400 <date>July 2017</date>
4401</refentryinfo>
4402<refmeta>
4403 <refentrytitle><phrase>irq_chip_retrigger_hierarchy</phrase></refentrytitle>
4404 <manvolnum>9</manvolnum>
4405 <refmiscinfo class="version">4.1.27</refmiscinfo>
4406</refmeta>
4407<refnamediv>
4408 <refname>irq_chip_retrigger_hierarchy</refname>
4409 <refpurpose>
4410     Retrigger an interrupt in hardware
4411 </refpurpose>
4412</refnamediv>
4413<refsynopsisdiv>
4414 <title>Synopsis</title>
4415  <funcsynopsis><funcprototype>
4416   <funcdef>int <function>irq_chip_retrigger_hierarchy </function></funcdef>
4417   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4418  </funcprototype></funcsynopsis>
4419</refsynopsisdiv>
4420<refsect1>
4421 <title>Arguments</title>
4422 <variablelist>
4423  <varlistentry>
4424   <term><parameter>data</parameter></term>
4425   <listitem>
4426    <para>
4427     Pointer to interrupt specific data
4428    </para>
4429   </listitem>
4430  </varlistentry>
4431 </variablelist>
4432</refsect1>
4433<refsect1>
4434<title>Description</title>
4435<para>
4436   Iterate through the domain hierarchy of the interrupt and check
4437   whether a hw retrigger function exists. If yes, invoke it.
4438</para>
4439</refsect1>
4440</refentry>
4441
4442<refentry id="API-irq-chip-set-wake-parent">
4443<refentryinfo>
4444 <title>LINUX</title>
4445 <productname>Kernel Hackers Manual</productname>
4446 <date>July 2017</date>
4447</refentryinfo>
4448<refmeta>
4449 <refentrytitle><phrase>irq_chip_set_wake_parent</phrase></refentrytitle>
4450 <manvolnum>9</manvolnum>
4451 <refmiscinfo class="version">4.1.27</refmiscinfo>
4452</refmeta>
4453<refnamediv>
4454 <refname>irq_chip_set_wake_parent</refname>
4455 <refpurpose>
4456     Set/reset wake-up on the parent interrupt
4457 </refpurpose>
4458</refnamediv>
4459<refsynopsisdiv>
4460 <title>Synopsis</title>
4461  <funcsynopsis><funcprototype>
4462   <funcdef>int <function>irq_chip_set_wake_parent </function></funcdef>
4463   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4464   <paramdef>unsigned int <parameter>on</parameter></paramdef>
4465  </funcprototype></funcsynopsis>
4466</refsynopsisdiv>
4467<refsect1>
4468 <title>Arguments</title>
4469 <variablelist>
4470  <varlistentry>
4471   <term><parameter>data</parameter></term>
4472   <listitem>
4473    <para>
4474     Pointer to interrupt specific data
4475    </para>
4476   </listitem>
4477  </varlistentry>
4478  <varlistentry>
4479   <term><parameter>on</parameter></term>
4480   <listitem>
4481    <para>
4482     Whether to set or reset the wake-up capability of this irq
4483    </para>
4484   </listitem>
4485  </varlistentry>
4486 </variablelist>
4487</refsect1>
4488<refsect1>
4489<title>Description</title>
4490<para>
4491   Conditional, as the underlying parent chip might not implement it.
4492</para>
4493</refsect1>
4494</refentry>
4495
4496<refentry id="API-irq-chip-compose-msi-msg">
4497<refentryinfo>
4498 <title>LINUX</title>
4499 <productname>Kernel Hackers Manual</productname>
4500 <date>July 2017</date>
4501</refentryinfo>
4502<refmeta>
4503 <refentrytitle><phrase>irq_chip_compose_msi_msg</phrase></refentrytitle>
4504 <manvolnum>9</manvolnum>
4505 <refmiscinfo class="version">4.1.27</refmiscinfo>
4506</refmeta>
4507<refnamediv>
4508 <refname>irq_chip_compose_msi_msg</refname>
4509 <refpurpose>
4510     Componse msi message for a irq chip
4511 </refpurpose>
4512</refnamediv>
4513<refsynopsisdiv>
4514 <title>Synopsis</title>
4515  <funcsynopsis><funcprototype>
4516   <funcdef>int <function>irq_chip_compose_msi_msg </function></funcdef>
4517   <paramdef>struct irq_data * <parameter>data</parameter></paramdef>
4518   <paramdef>struct msi_msg * <parameter>msg</parameter></paramdef>
4519  </funcprototype></funcsynopsis>
4520</refsynopsisdiv>
4521<refsect1>
4522 <title>Arguments</title>
4523 <variablelist>
4524  <varlistentry>
4525   <term><parameter>data</parameter></term>
4526   <listitem>
4527    <para>
4528     Pointer to interrupt specific data
4529    </para>
4530   </listitem>
4531  </varlistentry>
4532  <varlistentry>
4533   <term><parameter>msg</parameter></term>
4534   <listitem>
4535    <para>
4536     Pointer to the MSI message
4537    </para>
4538   </listitem>
4539  </varlistentry>
4540 </variablelist>
4541</refsect1>
4542<refsect1>
4543<title>Description</title>
4544<para>
4545   For hierarchical domains we find the first chip in the hierarchy
4546   which implements the irq_compose_msi_msg callback. For non
4547   hierarchical we use the top level chip.
4548</para>
4549</refsect1>
4550</refentry>
4551
4552  </chapter>
4553
4554  <chapter id="credits">
4555     <title>Credits</title>
4556	<para>
4557		The following people have contributed to this document:
4558		<orderedlist>
4559			<listitem><para>Thomas Gleixner<email>tglx@linutronix.de</email></para></listitem>
4560			<listitem><para>Ingo Molnar<email>mingo@elte.hu</email></para></listitem>
4561		</orderedlist>
4562	</para>
4563  </chapter>
4564</book>
4565