xref: /linux/Documentation/devicetree/bindings/gpio/cdns,gpio.yaml (revision 4df9c0a2465a523e399e46a8d3b5866c769b381b)
136f42234SHarshit Shah# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
236f42234SHarshit Shah%YAML 1.2
336f42234SHarshit Shah---
436f42234SHarshit Shah$id: http://devicetree.org/schemas/gpio/cdns,gpio.yaml#
536f42234SHarshit Shah$schema: http://devicetree.org/meta-schemas/core.yaml#
636f42234SHarshit Shah
736f42234SHarshit Shahtitle: Cadence GPIO Controller
836f42234SHarshit Shah
936f42234SHarshit Shahmaintainers:
1036f42234SHarshit Shah  - Jan Kotas <jank@cadence.com>
1136f42234SHarshit Shah
1236f42234SHarshit Shahproperties:
1336f42234SHarshit Shah  compatible:
14*4c5250ebSHarshit Shah    oneOf:
15*4c5250ebSHarshit Shah      - const: cdns,gpio-r1p02
16*4c5250ebSHarshit Shah      - items:
17*4c5250ebSHarshit Shah          - enum:
18*4c5250ebSHarshit Shah              - axiado,ax3000-gpio
19*4c5250ebSHarshit Shah          - const: cdns,gpio-r1p02
2036f42234SHarshit Shah
2136f42234SHarshit Shah  reg:
2236f42234SHarshit Shah    maxItems: 1
2336f42234SHarshit Shah
2436f42234SHarshit Shah  clocks:
2536f42234SHarshit Shah    maxItems: 1
2636f42234SHarshit Shah
2736f42234SHarshit Shah  ngpios:
2836f42234SHarshit Shah    minimum: 1
2936f42234SHarshit Shah    maximum: 32
3036f42234SHarshit Shah
3136f42234SHarshit Shah  gpio-controller: true
3236f42234SHarshit Shah
3336f42234SHarshit Shah  "#gpio-cells":
3436f42234SHarshit Shah    const: 2
3536f42234SHarshit Shah    description: |
3636f42234SHarshit Shah      - First cell is the GPIO line number.
3736f42234SHarshit Shah      - Second cell is flags as defined in <dt-bindings/gpio/gpio.h>,
3836f42234SHarshit Shah        only GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW supported.
3936f42234SHarshit Shah
4036f42234SHarshit Shah  interrupt-controller: true
4136f42234SHarshit Shah
4236f42234SHarshit Shah  "#interrupt-cells":
4336f42234SHarshit Shah    const: 2
4436f42234SHarshit Shah    description: |
4536f42234SHarshit Shah      - First cell is the GPIO line number used as IRQ.
4636f42234SHarshit Shah      - Second cell is the trigger type, as defined in
4736f42234SHarshit Shah        <dt-bindings/interrupt-controller/irq.h>.
4836f42234SHarshit Shah
4936f42234SHarshit Shah  interrupts:
5036f42234SHarshit Shah    maxItems: 1
5136f42234SHarshit Shah
5236f42234SHarshit Shahrequired:
5336f42234SHarshit Shah  - compatible
5436f42234SHarshit Shah  - reg
5536f42234SHarshit Shah  - clocks
5636f42234SHarshit Shah  - gpio-controller
5736f42234SHarshit Shah  - "#gpio-cells"
5836f42234SHarshit Shah
5936f42234SHarshit Shahif:
6036f42234SHarshit Shah  required: [interrupt-controller]
6136f42234SHarshit Shahthen:
6236f42234SHarshit Shah  required:
6336f42234SHarshit Shah    - interrupts
6436f42234SHarshit Shah
6536f42234SHarshit ShahadditionalProperties: false
6636f42234SHarshit Shah
6736f42234SHarshit Shahexamples:
6836f42234SHarshit Shah  - |
6936f42234SHarshit Shah    #include <dt-bindings/interrupt-controller/arm-gic.h>
7036f42234SHarshit Shah    #include <dt-bindings/interrupt-controller/irq.h>
7136f42234SHarshit Shah    gpio0: gpio-controller@fd060000 {
7236f42234SHarshit Shah        compatible = "cdns,gpio-r1p02";
7336f42234SHarshit Shah        reg = <0xfd060000 0x1000>;
7436f42234SHarshit Shah        clocks = <&gpio_clk>;
7536f42234SHarshit Shah
7636f42234SHarshit Shah        interrupt-parent = <&gic>;
7736f42234SHarshit Shah        interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
7836f42234SHarshit Shah
7936f42234SHarshit Shah        gpio-controller;
8036f42234SHarshit Shah        #gpio-cells = <2>;
8136f42234SHarshit Shah
8236f42234SHarshit Shah        interrupt-controller;
8336f42234SHarshit Shah        #interrupt-cells = <2>;
8436f42234SHarshit Shah    };
85