1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/renesas,pfc.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Renesas Pin Function Controller (GPIO and Pin Mux/Config)
8
9maintainers:
10  - Geert Uytterhoeven <geert+renesas@glider.be>
11
12description:
13  The Pin Function Controller (PFC) is a Pin Mux/Config controller.
14  On SH/R-Mobile SoCs it also acts as a GPIO controller.
15
16properties:
17  compatible:
18    enum:
19      - renesas,pfc-emev2       # EMMA Mobile EV2
20      - renesas,pfc-r8a73a4     # R-Mobile APE6
21      - renesas,pfc-r8a7740     # R-Mobile A1
22      - renesas,pfc-r8a7742     # RZ/G1H
23      - renesas,pfc-r8a7743     # RZ/G1M
24      - renesas,pfc-r8a7744     # RZ/G1N
25      - renesas,pfc-r8a7745     # RZ/G1E
26      - renesas,pfc-r8a77470    # RZ/G1C
27      - renesas,pfc-r8a774a1    # RZ/G2M
28      - renesas,pfc-r8a774b1    # RZ/G2N
29      - renesas,pfc-r8a774c0    # RZ/G2E
30      - renesas,pfc-r8a774e1    # RZ/G2H
31      - renesas,pfc-r8a7778     # R-Car M1
32      - renesas,pfc-r8a7779     # R-Car H1
33      - renesas,pfc-r8a7790     # R-Car H2
34      - renesas,pfc-r8a7791     # R-Car M2-W
35      - renesas,pfc-r8a7792     # R-Car V2H
36      - renesas,pfc-r8a7793     # R-Car M2-N
37      - renesas,pfc-r8a7794     # R-Car E2
38      - renesas,pfc-r8a7795     # R-Car H3
39      - renesas,pfc-r8a7796     # R-Car M3-W
40      - renesas,pfc-r8a77961    # R-Car M3-W+
41      - renesas,pfc-r8a77965    # R-Car M3-N
42      - renesas,pfc-r8a77970    # R-Car V3M
43      - renesas,pfc-r8a77980    # R-Car V3H
44      - renesas,pfc-r8a77990    # R-Car E3
45      - renesas,pfc-r8a77995    # R-Car D3
46      - renesas,pfc-r8a779a0    # R-Car V3U
47      - renesas,pfc-r8a779f0    # R-Car S4-8
48      - renesas,pfc-r8a779g0    # R-Car V4H
49      - renesas,pfc-sh73a0      # SH-Mobile AG5
50
51  reg:
52    minItems: 1
53    maxItems: 10
54
55  gpio-controller: true
56
57  '#gpio-cells':
58    const: 2
59
60  gpio-ranges:
61    minItems: 1
62    maxItems: 16
63
64  interrupts-extended:
65    minItems: 32
66    maxItems: 64
67    description:
68      Specify the interrupts associated with external IRQ pins on SoCs where
69      the PFC acts as a GPIO controller.  It must contain one interrupt per
70      external IRQ, sorted by external IRQ number.
71
72  power-domains:
73    maxItems: 1
74
75allOf:
76  - $ref: pinctrl.yaml#
77
78required:
79  - compatible
80  - reg
81
82if:
83  properties:
84    compatible:
85      enum:
86        - renesas,pfc-r8a73a4
87        - renesas,pfc-r8a7740
88        - renesas,pfc-sh73a0
89then:
90  required:
91    - interrupts-extended
92    - gpio-controller
93    - '#gpio-cells'
94    - gpio-ranges
95    - power-domains
96
97additionalProperties:
98  anyOf:
99    - type: object
100      allOf:
101        - $ref: pincfg-node.yaml#
102        - $ref: pinmux-node.yaml#
103
104      description:
105        Pin controller client devices use pin configuration subnodes (children
106        and grandchildren) for desired pin configuration.
107        Client device subnodes use below standard properties.
108
109      properties:
110        function: true
111        groups: true
112        pins: true
113        bias-disable: true
114        bias-pull-down: true
115        bias-pull-up: true
116        drive-strength:
117          enum: [ 3, 6, 9, 12, 15, 18, 21, 24 ] # Superset of supported values
118        power-source:
119          enum: [ 1800, 3300 ]
120        gpio-hog: true
121        gpios: true
122        input: true
123        output-high: true
124        output-low: true
125
126      additionalProperties: false
127
128    - type: object
129      additionalProperties:
130        $ref: "#/additionalProperties/anyOf/0"
131
132examples:
133  - |
134    pfc: pinctrl@e6050000 {
135            compatible = "renesas,pfc-r8a7740";
136            reg = <0xe6050000 0x8000>,
137                  <0xe605800c 0x20>;
138            gpio-controller;
139            #gpio-cells = <2>;
140            gpio-ranges = <&pfc 0 0 212>;
141            interrupts-extended =
142                <&irqpin0 0 0>, <&irqpin0 1 0>, <&irqpin0 2 0>, <&irqpin0 3 0>,
143                <&irqpin0 4 0>, <&irqpin0 5 0>, <&irqpin0 6 0>, <&irqpin0 7 0>,
144                <&irqpin1 0 0>, <&irqpin1 1 0>, <&irqpin1 2 0>, <&irqpin1 3 0>,
145                <&irqpin1 4 0>, <&irqpin1 5 0>, <&irqpin1 6 0>, <&irqpin1 7 0>,
146                <&irqpin2 0 0>, <&irqpin2 1 0>, <&irqpin2 2 0>, <&irqpin2 3 0>,
147                <&irqpin2 4 0>, <&irqpin2 5 0>, <&irqpin2 6 0>, <&irqpin2 7 0>,
148                <&irqpin3 0 0>, <&irqpin3 1 0>, <&irqpin3 2 0>, <&irqpin3 3 0>,
149                <&irqpin3 4 0>, <&irqpin3 5 0>, <&irqpin3 6 0>, <&irqpin3 7 0>;
150            power-domains = <&pd_c5>;
151
152            lcd0-mux-hog {
153                    /* DBGMD/LCDC0/FSIA MUX */
154                    gpio-hog;
155                    gpios = <176 0>;
156                    output-high;
157            };
158    };
159
160  - |
161    pinctrl@e6060000 {
162            compatible = "renesas,pfc-r8a7795";
163            reg = <0xe6060000 0x50c>;
164
165            avb_pins: avb {
166                    mux {
167                            groups = "avb_link", "avb_mdio", "avb_mii";
168                            function = "avb";
169                    };
170
171                    pins_mdio {
172                            groups = "avb_mdio";
173                            drive-strength = <24>;
174                    };
175
176                    pins_mii_tx {
177                            pins = "PIN_AVB_TX_CTL", "PIN_AVB_TXC",
178                                   "PIN_AVB_TD0", "PIN_AVB_TD1", "PIN_AVB_TD2",
179                                   "PIN_AVB_TD3";
180                            drive-strength = <12>;
181                    };
182            };
183
184            keys_pins: keys {
185                    pins = "GP_5_17", "GP_5_20", "GP_5_22", "GP_2_1";
186                    bias-pull-up;
187            };
188
189            sdhi0_pins: sd0 {
190                    groups = "sdhi0_data4", "sdhi0_ctrl";
191                    function = "sdhi0";
192                    power-source = <3300>;
193            };
194    };
195