xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/sprd,gpio.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
1*cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*cb7aa33aSEmmanuel Vadot# Copyright 2022 Unisoc Inc.
3*cb7aa33aSEmmanuel Vadot%YAML 1.2
4*cb7aa33aSEmmanuel Vadot---
5*cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/sprd,gpio.yaml#
6*cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7*cb7aa33aSEmmanuel Vadot
8*cb7aa33aSEmmanuel Vadottitle: Unisoc GPIO controller
9*cb7aa33aSEmmanuel Vadot
10*cb7aa33aSEmmanuel Vadotmaintainers:
11*cb7aa33aSEmmanuel Vadot  - Orson Zhai <orsonzhai@gmail.com>
12*cb7aa33aSEmmanuel Vadot  - Baolin Wang <baolin.wang7@gmail.com>
13*cb7aa33aSEmmanuel Vadot  - Chunyan Zhang <zhang.lyra@gmail.com>
14*cb7aa33aSEmmanuel Vadot
15*cb7aa33aSEmmanuel Vadotdescription: |
16*cb7aa33aSEmmanuel Vadot  The controller's registers are organized as sets of sixteen 16-bit
17*cb7aa33aSEmmanuel Vadot  registers with each set controlling a bank of up to 16 pins. A single
18*cb7aa33aSEmmanuel Vadot  interrupt is shared for all of the banks handled by the controller.
19*cb7aa33aSEmmanuel Vadot
20*cb7aa33aSEmmanuel Vadotproperties:
21*cb7aa33aSEmmanuel Vadot  compatible:
22*cb7aa33aSEmmanuel Vadot    oneOf:
23*cb7aa33aSEmmanuel Vadot      - const: sprd,sc9860-gpio
24*cb7aa33aSEmmanuel Vadot      - items:
25*cb7aa33aSEmmanuel Vadot          - enum:
26*cb7aa33aSEmmanuel Vadot              - sprd,ums512-gpio
27*cb7aa33aSEmmanuel Vadot          - const: sprd,sc9860-gpio
28*cb7aa33aSEmmanuel Vadot
29*cb7aa33aSEmmanuel Vadot  reg:
30*cb7aa33aSEmmanuel Vadot    maxItems: 1
31*cb7aa33aSEmmanuel Vadot
32*cb7aa33aSEmmanuel Vadot  gpio-controller: true
33*cb7aa33aSEmmanuel Vadot
34*cb7aa33aSEmmanuel Vadot  "#gpio-cells":
35*cb7aa33aSEmmanuel Vadot    const: 2
36*cb7aa33aSEmmanuel Vadot
37*cb7aa33aSEmmanuel Vadot  interrupt-controller: true
38*cb7aa33aSEmmanuel Vadot
39*cb7aa33aSEmmanuel Vadot  "#interrupt-cells":
40*cb7aa33aSEmmanuel Vadot    const: 2
41*cb7aa33aSEmmanuel Vadot
42*cb7aa33aSEmmanuel Vadot  interrupts:
43*cb7aa33aSEmmanuel Vadot    maxItems: 1
44*cb7aa33aSEmmanuel Vadot    description: The interrupt shared by all GPIO lines for this controller.
45*cb7aa33aSEmmanuel Vadot
46*cb7aa33aSEmmanuel Vadotrequired:
47*cb7aa33aSEmmanuel Vadot  - compatible
48*cb7aa33aSEmmanuel Vadot  - reg
49*cb7aa33aSEmmanuel Vadot  - gpio-controller
50*cb7aa33aSEmmanuel Vadot  - "#gpio-cells"
51*cb7aa33aSEmmanuel Vadot  - interrupt-controller
52*cb7aa33aSEmmanuel Vadot  - "#interrupt-cells"
53*cb7aa33aSEmmanuel Vadot  - interrupts
54*cb7aa33aSEmmanuel Vadot
55*cb7aa33aSEmmanuel VadotadditionalProperties: false
56*cb7aa33aSEmmanuel Vadot
57*cb7aa33aSEmmanuel Vadotexamples:
58*cb7aa33aSEmmanuel Vadot  - |
59*cb7aa33aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
60*cb7aa33aSEmmanuel Vadot
61*cb7aa33aSEmmanuel Vadot    soc {
62*cb7aa33aSEmmanuel Vadot        #address-cells = <2>;
63*cb7aa33aSEmmanuel Vadot        #size-cells = <2>;
64*cb7aa33aSEmmanuel Vadot
65*cb7aa33aSEmmanuel Vadot        ap_gpio: gpio@40280000 {
66*cb7aa33aSEmmanuel Vadot            compatible = "sprd,sc9860-gpio";
67*cb7aa33aSEmmanuel Vadot            reg = <0 0x40280000 0 0x1000>;
68*cb7aa33aSEmmanuel Vadot            gpio-controller;
69*cb7aa33aSEmmanuel Vadot            #gpio-cells = <2>;
70*cb7aa33aSEmmanuel Vadot            interrupt-controller;
71*cb7aa33aSEmmanuel Vadot            #interrupt-cells = <2>;
72*cb7aa33aSEmmanuel Vadot            interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
73*cb7aa33aSEmmanuel Vadot        };
74*cb7aa33aSEmmanuel Vadot    };
75*cb7aa33aSEmmanuel Vadot...
76