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