xref: /linux/Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
189099d14SMasahiro Yamada# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
289099d14SMasahiro Yamada%YAML 1.2
389099d14SMasahiro Yamada---
489099d14SMasahiro Yamada$id: http://devicetree.org/schemas/gpio/socionext,uniphier-gpio.yaml#
589099d14SMasahiro Yamada$schema: http://devicetree.org/meta-schemas/core.yaml#
689099d14SMasahiro Yamada
789099d14SMasahiro Yamadatitle: UniPhier GPIO controller
889099d14SMasahiro Yamada
989099d14SMasahiro Yamadamaintainers:
1089099d14SMasahiro Yamada  - Masahiro Yamada <yamada.masahiro@socionext.com>
1189099d14SMasahiro Yamada
1289099d14SMasahiro Yamadaproperties:
1389099d14SMasahiro Yamada  $nodename:
1489099d14SMasahiro Yamada    pattern: "^gpio@[0-9a-f]+$"
1589099d14SMasahiro Yamada
1689099d14SMasahiro Yamada  compatible:
1789099d14SMasahiro Yamada    const: socionext,uniphier-gpio
1889099d14SMasahiro Yamada
1989099d14SMasahiro Yamada  reg:
2089099d14SMasahiro Yamada    maxItems: 1
2189099d14SMasahiro Yamada
2289099d14SMasahiro Yamada  gpio-controller: true
2389099d14SMasahiro Yamada
2489099d14SMasahiro Yamada  "#gpio-cells":
2589099d14SMasahiro Yamada    const: 2
2689099d14SMasahiro Yamada
2789099d14SMasahiro Yamada  interrupt-controller: true
2889099d14SMasahiro Yamada
2989099d14SMasahiro Yamada  "#interrupt-cells":
3089099d14SMasahiro Yamada    description: |
3189099d14SMasahiro Yamada      The first cell defines the interrupt number.
3289099d14SMasahiro Yamada      The second cell bits[3:0] is used to specify trigger type as follows:
3389099d14SMasahiro Yamada        1 = low-to-high edge triggered
3489099d14SMasahiro Yamada        2 = high-to-low edge triggered
3589099d14SMasahiro Yamada        4 = active high level-sensitive
3689099d14SMasahiro Yamada        8 = active low level-sensitive
3789099d14SMasahiro Yamada      Valid combinations are 1, 2, 3, 4, 8.
3889099d14SMasahiro Yamada    const: 2
3989099d14SMasahiro Yamada
4089099d14SMasahiro Yamada  ngpios:
4189099d14SMasahiro Yamada    minimum: 0
4289099d14SMasahiro Yamada    maximum: 512
4389099d14SMasahiro Yamada
440d9a302dSRob Herring  gpio-ranges: true
450d9a302dSRob Herring
46c2156348SRob Herring  gpio-ranges-group-names: true
4789099d14SMasahiro Yamada
4889099d14SMasahiro Yamada  socionext,interrupt-ranges:
4989099d14SMasahiro Yamada    description: |
5089099d14SMasahiro Yamada      Specifies an interrupt number mapping between this GPIO controller and
5189099d14SMasahiro Yamada      its interrupt parent, in the form of arbitrary number of
5289099d14SMasahiro Yamada      <child-interrupt-base parent-interrupt-base length> triplets.
5389099d14SMasahiro Yamada    $ref: /schemas/types.yaml#/definitions/uint32-matrix
5489099d14SMasahiro Yamada
55*265a3bf4SKunihiko HayashipatternProperties:
56*265a3bf4SKunihiko Hayashi  "^.+-hog(-[0-9]+)?$":
57*265a3bf4SKunihiko Hayashi    type: object
58*265a3bf4SKunihiko Hayashi    required:
59*265a3bf4SKunihiko Hayashi      - gpio-hog
60*265a3bf4SKunihiko Hayashi
6189099d14SMasahiro Yamadarequired:
6289099d14SMasahiro Yamada  - compatible
6389099d14SMasahiro Yamada  - reg
6489099d14SMasahiro Yamada  - gpio-controller
6589099d14SMasahiro Yamada  - "#gpio-cells"
6689099d14SMasahiro Yamada  - interrupt-controller
6789099d14SMasahiro Yamada  - "#interrupt-cells"
6889099d14SMasahiro Yamada  - ngpios
6989099d14SMasahiro Yamada  - gpio-ranges
7089099d14SMasahiro Yamada  - socionext,interrupt-ranges
7189099d14SMasahiro Yamada
725be478f9SRob HerringadditionalProperties: false
735be478f9SRob Herring
7489099d14SMasahiro Yamadaexamples:
7589099d14SMasahiro Yamada  - |
7689099d14SMasahiro Yamada    #include <dt-bindings/gpio/gpio.h>
7789099d14SMasahiro Yamada    #include <dt-bindings/gpio/uniphier-gpio.h>
7889099d14SMasahiro Yamada
7989099d14SMasahiro Yamada    gpio: gpio@55000000 {
8089099d14SMasahiro Yamada        compatible = "socionext,uniphier-gpio";
8189099d14SMasahiro Yamada        reg = <0x55000000 0x200>;
8289099d14SMasahiro Yamada        interrupt-parent = <&aidet>;
8389099d14SMasahiro Yamada        interrupt-controller;
8489099d14SMasahiro Yamada        #interrupt-cells = <2>;
8589099d14SMasahiro Yamada        gpio-controller;
8689099d14SMasahiro Yamada        #gpio-cells = <2>;
8789099d14SMasahiro Yamada        gpio-ranges = <&pinctrl 0 0 0>;
8889099d14SMasahiro Yamada        gpio-ranges-group-names = "gpio_range";
8989099d14SMasahiro Yamada        ngpios = <248>;
9089099d14SMasahiro Yamada        socionext,interrupt-ranges = <0 48 16>, <16 154 5>, <21 217 3>;
9189099d14SMasahiro Yamada    };
9289099d14SMasahiro Yamada
9389099d14SMasahiro Yamada    // Consumer:
9489099d14SMasahiro Yamada    // Please note UNIPHIER_GPIO_PORT(29, 4) represents PORT294 in the SoC
9589099d14SMasahiro Yamada    // document. Unfortunately, only the one's place is octal in the port
9689099d14SMasahiro Yamada    // numbering. (That is, PORT 8, 9, 18, 19, 28, 29, ... do not exist.)
9789099d14SMasahiro Yamada    // UNIPHIER_GPIO_PORT() is a helper macro to calculate 29 * 8 + 4.
9889099d14SMasahiro Yamada    sdhci0_pwrseq {
9989099d14SMasahiro Yamada        compatible = "mmc-pwrseq-emmc";
10089099d14SMasahiro Yamada        reset-gpios = <&gpio UNIPHIER_GPIO_PORT(29, 4) GPIO_ACTIVE_LOW>;
10189099d14SMasahiro Yamada    };
102