xref: /linux/Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml (revision ee2fe81cdcd17f875aeca074afe64d7e8f57750f)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/apple,pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Apple GPIO controller
8
9maintainers:
10  - Mark Kettenis <kettenis@openbsd.org>
11
12description: |
13  The Apple GPIO controller is a simple combined pin and GPIO
14  controller present on Apple ARM SoC platforms, including various
15  iPhone and iPad devices and the "Apple Silicon" Macs.
16
17properties:
18  compatible:
19    oneOf:
20      - items:
21          - const: apple,t6020-pinctrl
22          - const: apple,t8103-pinctrl
23      - items:
24          # Do not add additional SoC to this list.
25          - enum:
26              - apple,s5l8960x-pinctrl
27              - apple,t7000-pinctrl
28              - apple,s8000-pinctrl
29              - apple,t8010-pinctrl
30              - apple,t8015-pinctrl
31              - apple,t8103-pinctrl
32              - apple,t8112-pinctrl
33              - apple,t6000-pinctrl
34          - const: apple,pinctrl
35
36  reg:
37    maxItems: 1
38
39  clocks:
40    maxItems: 1
41
42  gpio-controller: true
43
44  '#gpio-cells':
45    const: 2
46
47  gpio-ranges:
48    maxItems: 1
49
50  apple,npins:
51    $ref: /schemas/types.yaml#/definitions/uint32
52    description: The number of pins in this GPIO controller.
53
54  interrupts:
55    description: One interrupt for each of the (up to 7) interrupt
56      groups supported by the controller sorted by interrupt group
57      number in ascending order.
58    minItems: 1
59    maxItems: 7
60
61  interrupt-controller: true
62
63  '#interrupt-cells':
64    const: 2
65
66  power-domains:
67    maxItems: 1
68
69patternProperties:
70  '-pins$':
71    type: object
72    $ref: pinmux-node.yaml#
73
74    properties:
75      pinmux:
76        description:
77          Values are constructed from pin number and alternate function
78          configuration number using the APPLE_PINMUX() helper macro
79          defined in include/dt-bindings/pinctrl/apple.h.
80
81    required:
82      - pinmux
83
84    additionalProperties: false
85
86allOf:
87  - $ref: pinctrl.yaml#
88
89required:
90  - compatible
91  - reg
92  - gpio-controller
93  - '#gpio-cells'
94  - gpio-ranges
95  - apple,npins
96
97additionalProperties: false
98
99examples:
100  - |
101    #include <dt-bindings/interrupt-controller/apple-aic.h>
102    #include <dt-bindings/pinctrl/apple.h>
103
104    soc {
105      #address-cells = <2>;
106      #size-cells = <2>;
107
108      pinctrl: pinctrl@23c100000 {
109        compatible = "apple,t8103-pinctrl", "apple,pinctrl";
110        reg = <0x2 0x3c100000 0x0 0x100000>;
111        clocks = <&gpio_clk>;
112
113        gpio-controller;
114        #gpio-cells = <2>;
115        gpio-ranges = <&pinctrl 0 0 212>;
116        apple,npins = <212>;
117
118        interrupt-controller;
119        #interrupt-cells = <2>;
120        interrupt-parent = <&aic>;
121        interrupts = <AIC_IRQ 16 IRQ_TYPE_LEVEL_HIGH>,
122                     <AIC_IRQ 17 IRQ_TYPE_LEVEL_HIGH>,
123                     <AIC_IRQ 18 IRQ_TYPE_LEVEL_HIGH>,
124                     <AIC_IRQ 19 IRQ_TYPE_LEVEL_HIGH>,
125                     <AIC_IRQ 20 IRQ_TYPE_LEVEL_HIGH>,
126                     <AIC_IRQ 21 IRQ_TYPE_LEVEL_HIGH>,
127                     <AIC_IRQ 22 IRQ_TYPE_LEVEL_HIGH>;
128
129        pcie_pins: pcie-pins {
130          pinmux = <APPLE_PINMUX(150, 1)>,
131                   <APPLE_PINMUX(151, 1)>,
132                   <APPLE_PINMUX(32, 1)>;
133        };
134      };
135    };
136