Jamie Iles | 7779b34 | 2014-02-25 17:01:01 -0600 | [diff] [blame] | 1 | * Synopsys DesignWare APB GPIO controller |
| 2 | |
| 3 | Required properties: |
| 4 | - compatible : Should contain "snps,dw-apb-gpio" |
| 5 | - reg : Address and length of the register set for the device. |
| 6 | - #address-cells : should be 1 (for addressing port subnodes). |
| 7 | - #size-cells : should be 0 (port subnodes). |
| 8 | |
| 9 | The GPIO controller has a configurable number of ports, each of which are |
| 10 | represented as child nodes with the following properties: |
| 11 | |
| 12 | Required properties: |
| 13 | - compatible : "snps,dw-apb-gpio-port" |
| 14 | - gpio-controller : Marks the device node as a gpio controller. |
Alan Tull | 1d4a216 | 2014-03-14 11:08:54 -0500 | [diff] [blame] | 15 | - #gpio-cells : Should be two. The first cell is the pin number and |
| 16 | the second cell is used to specify the gpio polarity: |
| 17 | 0 = active high |
| 18 | 1 = active low |
Jamie Iles | 7779b34 | 2014-02-25 17:01:01 -0600 | [diff] [blame] | 19 | - reg : The integer port index of the port, a single cell. |
| 20 | |
| 21 | Optional properties: |
| 22 | - interrupt-controller : The first port may be configured to be an interrupt |
| 23 | controller. |
| 24 | - #interrupt-cells : Specifies the number of cells needed to encode an |
| 25 | interrupt. Shall be set to 2. The first cell defines the interrupt number, |
| 26 | the second encodes the triger flags encoded as described in |
Andrew F. Davis | 51669f8 | 2015-09-21 11:25:40 -0500 | [diff] [blame] | 27 | Documentation/devicetree/bindings/interrupt-controller/interrupts.txt |
Jamie Iles | 7779b34 | 2014-02-25 17:01:01 -0600 | [diff] [blame] | 28 | - interrupt-parent : The parent interrupt controller. |
| 29 | - interrupts : The interrupt to the parent controller raised when GPIOs |
| 30 | generate the interrupts. |
| 31 | - snps,nr-gpios : The number of pins in the port, a single cell. |
| 32 | |
| 33 | Example: |
| 34 | |
| 35 | gpio: gpio@20000 { |
| 36 | compatible = "snps,dw-apb-gpio"; |
| 37 | reg = <0x20000 0x1000>; |
| 38 | #address-cells = <1>; |
| 39 | #size-cells = <0>; |
| 40 | |
| 41 | porta: gpio-controller@0 { |
| 42 | compatible = "snps,dw-apb-gpio-port"; |
| 43 | gpio-controller; |
Sebastian Andrzej Siewior | a54aef5 | 2014-03-22 17:16:39 +0100 | [diff] [blame] | 44 | #gpio-cells = <2>; |
Jamie Iles | 7779b34 | 2014-02-25 17:01:01 -0600 | [diff] [blame] | 45 | snps,nr-gpios = <8>; |
| 46 | reg = <0>; |
| 47 | interrupt-controller; |
| 48 | #interrupt-cells = <2>; |
| 49 | interrupt-parent = <&vic1>; |
| 50 | interrupts = <0>; |
| 51 | }; |
| 52 | |
| 53 | portb: gpio-controller@1 { |
| 54 | compatible = "snps,dw-apb-gpio-port"; |
| 55 | gpio-controller; |
Sebastian Andrzej Siewior | a54aef5 | 2014-03-22 17:16:39 +0100 | [diff] [blame] | 56 | #gpio-cells = <2>; |
Jamie Iles | 7779b34 | 2014-02-25 17:01:01 -0600 | [diff] [blame] | 57 | snps,nr-gpios = <8>; |
| 58 | reg = <1>; |
| 59 | }; |
| 60 | }; |