interrupts.txt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. Specifying interrupt information for devices
  2. ============================================
  3. 1) Interrupt client nodes
  4. -------------------------
  5. Nodes that describe devices which generate interrupts must contain an
  6. "interrupts" property. This property must contain a list of interrupt
  7. specifiers, one per output interrupt. The format of the interrupt specifier is
  8. determined by the interrupt controller to which the interrupts are routed; see
  9. section 2 below for details.
  10. The "interrupt-parent" property is used to specify the controller to which
  11. interrupts are routed and contains a single phandle referring to the interrupt
  12. controller node. This property is inherited, so it may be specified in an
  13. interrupt client node or in any of its parent nodes.
  14. 2) Interrupt controller nodes
  15. -----------------------------
  16. A device is marked as an interrupt controller with the "interrupt-controller"
  17. property. This is a empty, boolean property. An additional "#interrupt-cells"
  18. property defines the number of cells needed to specify a single interrupt.
  19. It is the responsibility of the interrupt controller's binding to define the
  20. length and format of the interrupt specifier. The following two variants are
  21. commonly used:
  22. a) one cell
  23. -----------
  24. The #interrupt-cells property is set to 1 and the single cell defines the
  25. index of the interrupt within the controller.
  26. Example:
  27. vic: intc@10140000 {
  28. compatible = "arm,versatile-vic";
  29. interrupt-controller;
  30. #interrupt-cells = <1>;
  31. reg = <0x10140000 0x1000>;
  32. };
  33. sic: intc@10003000 {
  34. compatible = "arm,versatile-sic";
  35. interrupt-controller;
  36. #interrupt-cells = <1>;
  37. reg = <0x10003000 0x1000>;
  38. interrupt-parent = <&vic>;
  39. interrupts = <31>; /* Cascaded to vic */
  40. };
  41. b) two cells
  42. ------------
  43. The #interrupt-cells property is set to 2 and the first cell defines the
  44. index of the interrupt within the controller, while the second cell is used
  45. to specify any of the following flags:
  46. - bits[3:0] trigger type and level flags
  47. 1 = low-to-high edge triggered
  48. 2 = high-to-low edge triggered
  49. 4 = active high level-sensitive
  50. 8 = active low level-sensitive
  51. Example:
  52. i2c@7000c000 {
  53. gpioext: gpio-adnp@41 {
  54. compatible = "ad,gpio-adnp";
  55. reg = <0x41>;
  56. interrupt-parent = <&gpio>;
  57. interrupts = <160 1>;
  58. gpio-controller;
  59. #gpio-cells = <1>;
  60. interrupt-controller;
  61. #interrupt-cells = <2>;
  62. nr-gpios = <64>;
  63. };
  64. sx8634@2b {
  65. compatible = "smtc,sx8634";
  66. reg = <0x2b>;
  67. interrupt-parent = <&gpioext>;
  68. interrupts = <3 0x8>;
  69. #address-cells = <1>;
  70. #size-cells = <0>;
  71. threshold = <0x40>;
  72. sensitivity = <7>;
  73. };
  74. };