xref: /linux/Documentation/devicetree/bindings/pinctrl/sophgo,sg2042-pinctrl.yaml (revision bbfd5594756011167b8f8de9a00e0c946afda1e6)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/sophgo,sg2042-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Sophgo SG2042 Pin Controller
8
9maintainers:
10  - Inochi Amaoto <inochiama@outlook.com>
11
12properties:
13  compatible:
14    enum:
15      - sophgo,sg2042-pinctrl
16      - sophgo,sg2044-pinctrl
17
18  reg:
19    maxItems: 1
20
21patternProperties:
22  '-cfg$':
23    type: object
24    description:
25      A pinctrl node should contain at least one subnode representing the
26      pinctrl groups available on the machine.
27
28    additionalProperties: false
29
30    patternProperties:
31      '-pins$':
32        type: object
33        description: |
34          Each subnode will list the pins it needs, and how they should
35          be configured, with regard to muxer configuration, bias input
36          enable/disable, input schmitt trigger enable, drive strength
37          output enable/disable state. For configuration detail,
38          refer to https://github.com/sophgo/sophgo-doc/.
39
40        allOf:
41          - $ref: pincfg-node.yaml#
42          - $ref: pinmux-node.yaml#
43
44        properties:
45          pinmux:
46            description: |
47              The list of GPIOs and their mux settings that properties in the
48              node apply to. This should be set using the PINMUX macro.
49
50          bias-disable: true
51
52          bias-pull-up:
53            type: boolean
54
55          bias-pull-down:
56            type: boolean
57
58          drive-strength-microamp:
59            description: typical current when output low level.
60
61          input-schmitt-enable: true
62
63          input-schmitt-disable: true
64
65        required:
66          - pinmux
67
68        additionalProperties: false
69
70required:
71  - compatible
72  - reg
73
74allOf:
75  - if:
76      properties:
77        compatible:
78          contains:
79            const: sophgo,sg2042-pinctrl
80    then:
81      patternProperties:
82        '-cfg$':
83          patternProperties:
84            '-pins$':
85              properties:
86                drive-strength-microamp:
87                  enum: [ 5400, 8100, 10700, 13400,
88                          16100, 18800, 21400, 24100,
89                          26800, 29400, 32100, 34800,
90                          37400, 40100, 42800, 45400 ]
91
92  - if:
93      properties:
94        compatible:
95          contains:
96            const: sophgo,sg2044-pinctrl
97    then:
98      patternProperties:
99        '-cfg$':
100          patternProperties:
101            '-pins$':
102              properties:
103                drive-strength-microamp:
104                  enum: [ 3200, 6400, 9600, 12700,
105                          15900, 19100, 22200, 25300,
106                          29500, 32700, 35900, 39000,
107                          42000, 45200, 48300, 51400]
108
109additionalProperties: false
110
111examples:
112  - |
113    #include <dt-bindings/pinctrl/pinctrl-sg2042.h>
114
115    pinctrl@30011000 {
116        compatible = "sophgo,sg2042-pinctrl";
117        reg = <30011000 0x1000>;
118
119        uart0_cfg: uart0-cfg {
120            uart0-pins {
121                pinmux = <PINMUX(PIN_UART0_TX, 0)>,
122                         <PINMUX(PIN_UART0_RX, 0)>;
123                bias-pull-up;
124                drive-strength-microamp = <13400>;
125            };
126        };
127    };
128
129...
130