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