]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt
gpio: add a driver for the Synopsys DesignWare APB GPIO block
[karo-tx-linux.git] / Documentation / devicetree / bindings / gpio / snps-dwapb-gpio.txt
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.
15 - #gpio-cells : Should be 1.  It is the pin number.
16 - reg : The integer port index of the port, a single cell.
17
18 Optional properties:
19 - interrupt-controller : The first port may be configured to be an interrupt
20 controller.
21 - #interrupt-cells : Specifies the number of cells needed to encode an
22   interrupt.  Shall be set to 2.  The first cell defines the interrupt number,
23   the second encodes the triger flags encoded as described in
24   Documentation/devicetree/bindings/interrupts.txt
25 - interrupt-parent : The parent interrupt controller.
26 - interrupts : The interrupt to the parent controller raised when GPIOs
27   generate the interrupts.
28 - snps,nr-gpios : The number of pins in the port, a single cell.
29
30 Example:
31
32 gpio: gpio@20000 {
33         compatible = "snps,dw-apb-gpio";
34         reg = <0x20000 0x1000>;
35         #address-cells = <1>;
36         #size-cells = <0>;
37
38         porta: gpio-controller@0 {
39                 compatible = "snps,dw-apb-gpio-port";
40                 gpio-controller;
41                 #gpio-cells = <1>;
42                 snps,nr-gpios = <8>;
43                 reg = <0>;
44                 interrupt-controller;
45                 #interrupt-cells = <2>;
46                 interrupt-parent = <&vic1>;
47                 interrupts = <0>;
48         };
49
50         portb: gpio-controller@1 {
51                 compatible = "snps,dw-apb-gpio-port";
52                 gpio-controller;
53                 #gpio-cells = <1>;
54                 snps,nr-gpios = <8>;
55                 reg = <1>;
56         };
57 };