xref: /linux/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml (revision 184e56e77c06a7eef68a021e9d4b11a11a8ab096)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/amlogic,pinctrl-a4.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Amlogic pinmux controller
8
9maintainers:
10  - Xianwei Zhao <xianwei.zhao@amlogic.com>
11
12allOf:
13  - $ref: pinctrl.yaml#
14
15properties:
16  compatible:
17    const: amlogic,pinctrl-a4
18
19  "#address-cells":
20    const: 2
21
22  "#size-cells":
23    const: 2
24
25  ranges: true
26
27patternProperties:
28  "^gpio@[0-9a-f]+$":
29    type: object
30
31    additionalProperties: false
32    properties:
33      reg:
34        minItems: 1
35        items:
36          - description: pin config register
37          - description: pin mux setting register (some special pin fixed function)
38          - description: pin drive strength register (optional)
39
40      reg-names:
41        minItems: 1
42        items:
43          - const: gpio
44          - const: mux
45          - const: ds
46
47      gpio-controller: true
48
49      "#gpio-cells":
50        const: 2
51
52      gpio-ranges:
53        maxItems: 1
54
55    required:
56      - reg
57      - reg-names
58      - gpio-controller
59      - "#gpio-cells"
60      - gpio-ranges
61
62  "^func-[0-9a-z-]+$":
63    type: object
64    additionalProperties: false
65    patternProperties:
66      "^group-[0-9a-z-]+$":
67        type: object
68        allOf:
69          - $ref: /schemas/pinctrl/pincfg-node.yaml
70          - $ref: /schemas/pinctrl/pinmux-node.yaml
71
72        required:
73          - pinmux
74
75required:
76  - compatible
77  - "#address-cells"
78  - "#size-cells"
79  - ranges
80
81additionalProperties: false
82
83examples:
84  - |
85    #include <dt-bindings/pinctrl/amlogic,pinctrl.h>
86    apb {
87      #address-cells = <2>;
88      #size-cells = <2>;
89      periphs_pinctrl: pinctrl {
90        compatible = "amlogic,pinctrl-a4";
91        #address-cells = <2>;
92        #size-cells = <2>;
93        ranges;
94
95        gpio@4240 {
96          reg = <0 0x4240 0 0x40>, <0 0x4000 0 0x8>;
97          reg-names = "gpio", "mux";
98          gpio-controller;
99          #gpio-cells = <2>;
100          gpio-ranges = <&periphs_pinctrl 0 8 10>;
101        };
102
103        func-uart-b {
104          group-default {
105            pinmux = <AML_PINMUX(AMLOGIC_GPIO_B, 1, 4)>;
106            bias-pull-up;
107            drive-strength-microamp = <4000>;
108          };
109
110          group-pins1 {
111            pinmux = <AML_PINMUX(AMLOGIC_GPIO_B, 5, 2)>;
112            bias-pull-up;
113            drive-strength-microamp = <4000>;
114          };
115        };
116
117        func-uart-c {
118          group-default {
119            pinmux = <AML_PINMUX(AMLOGIC_GPIO_B, 3, 1)>,
120                     <AML_PINMUX(AMLOGIC_GPIO_B, 2, 1)>;
121            bias-pull-up;
122            drive-strength-microamp = <4000>;
123          };
124        };
125      };
126    };
127