Commit | Line | Data |
---|---|---|
acc20979 TR |
1 | Specifying interrupt information for devices |
2 | ============================================ | |
3 | ||
4 | 1) Interrupt client nodes | |
5 | ------------------------- | |
6 | ||
79d97015 GL |
7 | Nodes that describe devices which generate interrupts must contain an either an |
8 | "interrupts" property or an "interrupts-extended" property. These properties | |
9 | contain a list of interrupt specifiers, one per output interrupt. The format of | |
10 | the interrupt specifier is determined by the interrupt controller to which the | |
11 | interrupts are routed; see section 2 below for details. | |
12 | ||
13 | Example: | |
14 | interrupt-parent = <&intc1>; | |
15 | interrupts = <5 0>, <6 0>; | |
acc20979 TR |
16 | |
17 | The "interrupt-parent" property is used to specify the controller to which | |
18 | interrupts are routed and contains a single phandle referring to the interrupt | |
19 | controller node. This property is inherited, so it may be specified in an | |
79d97015 GL |
20 | interrupt client node or in any of its parent nodes. Interrupts listed in the |
21 | "interrupts" property are always in reference to the node's interrupt parent. | |
22 | ||
23 | The "interrupts-extended" property is a special form for use when a node needs | |
24 | to reference multiple interrupt parents. Each entry in this property contains | |
25 | both the parent phandle and the interrupt specifier. "interrupts-extended" | |
26 | should only be used when a device has multiple interrupt parents. | |
27 | ||
28 | Example: | |
29 | interrupts-extended = <&intc1 5 1>, <&intc2 1 0>; | |
30 | ||
31 | A device node may contain either "interrupts" or "interrupts-extended", but not | |
32 | both. If both properties are present, then the operating system should log an | |
33 | error and use only the data in "interrupts". | |
acc20979 TR |
34 | |
35 | 2) Interrupt controller nodes | |
36 | ----------------------------- | |
37 | ||
38 | A device is marked as an interrupt controller with the "interrupt-controller" | |
39 | property. This is a empty, boolean property. An additional "#interrupt-cells" | |
40 | property defines the number of cells needed to specify a single interrupt. | |
41 | ||
42 | It is the responsibility of the interrupt controller's binding to define the | |
43 | length and format of the interrupt specifier. The following two variants are | |
44 | commonly used: | |
45 | ||
46 | a) one cell | |
47 | ----------- | |
48 | The #interrupt-cells property is set to 1 and the single cell defines the | |
49 | index of the interrupt within the controller. | |
50 | ||
51 | Example: | |
52 | ||
53 | vic: intc@10140000 { | |
54 | compatible = "arm,versatile-vic"; | |
55 | interrupt-controller; | |
56 | #interrupt-cells = <1>; | |
57 | reg = <0x10140000 0x1000>; | |
58 | }; | |
59 | ||
60 | sic: intc@10003000 { | |
61 | compatible = "arm,versatile-sic"; | |
62 | interrupt-controller; | |
63 | #interrupt-cells = <1>; | |
64 | reg = <0x10003000 0x1000>; | |
65 | interrupt-parent = <&vic>; | |
66 | interrupts = <31>; /* Cascaded to vic */ | |
67 | }; | |
68 | ||
69 | b) two cells | |
70 | ------------ | |
71 | The #interrupt-cells property is set to 2 and the first cell defines the | |
72 | index of the interrupt within the controller, while the second cell is used | |
73 | to specify any of the following flags: | |
74 | - bits[3:0] trigger type and level flags | |
75 | 1 = low-to-high edge triggered | |
76 | 2 = high-to-low edge triggered | |
77 | 4 = active high level-sensitive | |
78 | 8 = active low level-sensitive | |
79 | ||
80 | Example: | |
81 | ||
82 | i2c@7000c000 { | |
83 | gpioext: gpio-adnp@41 { | |
84 | compatible = "ad,gpio-adnp"; | |
85 | reg = <0x41>; | |
86 | ||
87 | interrupt-parent = <&gpio>; | |
88 | interrupts = <160 1>; | |
89 | ||
90 | gpio-controller; | |
91 | #gpio-cells = <1>; | |
92 | ||
93 | interrupt-controller; | |
94 | #interrupt-cells = <2>; | |
95 | ||
96 | nr-gpios = <64>; | |
97 | }; | |
98 | ||
99 | sx8634@2b { | |
100 | compatible = "smtc,sx8634"; | |
101 | reg = <0x2b>; | |
102 | ||
103 | interrupt-parent = <&gpioext>; | |
104 | interrupts = <3 0x8>; | |
105 | ||
106 | #address-cells = <1>; | |
107 | #size-cells = <0>; | |
108 | ||
109 | threshold = <0x40>; | |
110 | sensitivity = <7>; | |
111 | }; | |
112 | }; |