xref: /linux/Documentation/devicetree/bindings/gpio/cdns,gpio.yaml (revision 4df9c0a2465a523e399e46a8d3b5866c769b381b)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpio/cdns,gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cadence GPIO Controller
8
9maintainers:
10  - Jan Kotas <jank@cadence.com>
11
12properties:
13  compatible:
14    oneOf:
15      - const: cdns,gpio-r1p02
16      - items:
17          - enum:
18              - axiado,ax3000-gpio
19          - const: cdns,gpio-r1p02
20
21  reg:
22    maxItems: 1
23
24  clocks:
25    maxItems: 1
26
27  ngpios:
28    minimum: 1
29    maximum: 32
30
31  gpio-controller: true
32
33  "#gpio-cells":
34    const: 2
35    description: |
36      - First cell is the GPIO line number.
37      - Second cell is flags as defined in <dt-bindings/gpio/gpio.h>,
38        only GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW supported.
39
40  interrupt-controller: true
41
42  "#interrupt-cells":
43    const: 2
44    description: |
45      - First cell is the GPIO line number used as IRQ.
46      - Second cell is the trigger type, as defined in
47        <dt-bindings/interrupt-controller/irq.h>.
48
49  interrupts:
50    maxItems: 1
51
52required:
53  - compatible
54  - reg
55  - clocks
56  - gpio-controller
57  - "#gpio-cells"
58
59if:
60  required: [interrupt-controller]
61then:
62  required:
63    - interrupts
64
65additionalProperties: false
66
67examples:
68  - |
69    #include <dt-bindings/interrupt-controller/arm-gic.h>
70    #include <dt-bindings/interrupt-controller/irq.h>
71    gpio0: gpio-controller@fd060000 {
72        compatible = "cdns,gpio-r1p02";
73        reg = <0xfd060000 0x1000>;
74        clocks = <&gpio_clk>;
75
76        interrupt-parent = <&gic>;
77        interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
78
79        gpio-controller;
80        #gpio-cells = <2>;
81
82        interrupt-controller;
83        #interrupt-cells = <2>;
84    };
85