summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
blob: 33b5f79e741ab6fab9cdf1a360940af8ca0e3927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/mediatek,mt65xx-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Mediatek MT65xx Pin Controller

maintainers:
  - Sean Wang <sean.wang@kernel.org>

description: |+
  The Mediatek's Pin controller is used to control SoC pins.

properties:
  compatible:
    enum:
      - mediatek,mt2701-pinctrl
      - mediatek,mt2712-pinctrl
      - mediatek,mt6397-pinctrl
      - mediatek,mt7623-pinctrl
      - mediatek,mt8127-pinctrl
      - mediatek,mt8135-pinctrl
      - mediatek,mt8167-pinctrl
      - mediatek,mt8173-pinctrl
      - mediatek,mt8516-pinctrl

  reg:
    maxItems: 1

  pins-are-numbered:
    $ref: /schemas/types.yaml#/definitions/flag
    description: |
      Specify the subnodes are using numbered pinmux to specify pins.

  gpio-controller: true

  "#gpio-cells":
    const: 2
    description: |
      Number of cells in GPIO specifier. Since the generic GPIO
      binding is used, the amount of cells must be specified as 2. See the below
      mentioned gpio binding representation for description of particular cells.

  mediatek,pctl-regmap:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1
    minItems: 1
    maxItems: 2
    description: |
      Should be phandles of the syscfg node.

  interrupt-controller: true

  interrupts:
    minItems: 1
    maxItems: 3

  "#interrupt-cells":
    const: 2

required:
  - compatible
  - pins-are-numbered
  - gpio-controller
  - "#gpio-cells"

allOf:
  - $ref: "pinctrl.yaml#"

patternProperties:
  '-[0-9]+$':
    type: object
    additionalProperties: false
    patternProperties:
      'pins':
        type: object
        additionalProperties: false
        description: |
          A pinctrl node should contain at least one subnodes representing the
          pinctrl groups available on the machine. Each subnode will list the
          pins it needs, and how they should be configured, with regard to muxer
          configuration, pullups, drive strength, input enable/disable and input
          schmitt.
        $ref: "/schemas/pinctrl/pincfg-node.yaml"

        properties:
          pinmux:
            description:
              integer array, represents gpio pin number and mux setting.
              Supported pin number and mux varies for different SoCs, and are
              defined as macros in <soc>-pinfunc.h directly.

          bias-disable: true

          bias-pull-up:
            description: |
              Besides generic pinconfig options, it can be used as the pull up
              settings for 2 pull resistors, R0 and R1. User can configure those
              special pins. Some macros have been defined for this usage, such
              as MTK_PUPD_SET_R1R0_00. See dt-bindings/pinctrl/mt65xx.h for
              valid arguments.

          bias-pull-down: true

          input-enable: true

          input-disable: true

          output-low: true

          output-high: true

          input-schmitt-enable: true

          input-schmitt-disable: true

          drive-strength:
            description: |
              Can support some arguments, such as MTK_DRIVE_4mA, MTK_DRIVE_6mA,
              etc. See dt-bindings/pinctrl/mt65xx.h for valid arguments.

        required:
          - pinmux

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/pinctrl/mt8135-pinfunc.h>

    soc {
        #address-cells = <2>;
        #size-cells = <2>;

        syscfg_pctl_a: syscfg-pctl-a@10005000 {
          compatible = "mediatek,mt8135-pctl-a-syscfg", "syscon";
          reg = <0 0x10005000 0 0x1000>;
        };

        syscfg_pctl_b: syscfg-pctl-b@1020c020 {
          compatible = "mediatek,mt8135-pctl-b-syscfg", "syscon";
          reg = <0 0x1020C020 0 0x1000>;
        };

        pinctrl@1c20800 {
          compatible = "mediatek,mt8135-pinctrl";
          reg = <0 0x1000B000 0 0x1000>;
          mediatek,pctl-regmap = <&syscfg_pctl_a>, <&syscfg_pctl_b>;
          pins-are-numbered;
          gpio-controller;
          #gpio-cells = <2>;
          interrupt-controller;
          #interrupt-cells = <2>;
          interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
              <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
              <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;

          i2c0_pins_a: i2c0-0 {
            pins1 {
              pinmux = <MT8135_PIN_100_SDA0__FUNC_SDA0>,
                <MT8135_PIN_101_SCL0__FUNC_SCL0>;
              bias-disable;
            };
          };

          i2c1_pins_a: i2c1-0 {
            pins {
              pinmux = <MT8135_PIN_195_SDA1__FUNC_SDA1>,
                <MT8135_PIN_196_SCL1__FUNC_SCL1>;
              bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
            };
          };

          i2c2_pins_a: i2c2-0 {
            pins1 {
              pinmux = <MT8135_PIN_193_SDA2__FUNC_SDA2>;
              bias-pull-down;
            };

            pins2 {
              pinmux = <MT8135_PIN_49_WATCHDOG__FUNC_GPIO49>;
              bias-pull-up;
            };
          };

          i2c3_pins_a: i2c3-0 {
            pins1 {
              pinmux = <MT8135_PIN_40_DAC_CLK__FUNC_GPIO40>,
                <MT8135_PIN_41_DAC_WS__FUNC_GPIO41>;
              bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
            };

            pins2 {
              pinmux = <MT8135_PIN_35_SCL3__FUNC_SCL3>,
                <MT8135_PIN_36_SDA3__FUNC_SDA3>;
              output-low;
              bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
            };

            pins3 {
              pinmux = <MT8135_PIN_57_JTCK__FUNC_GPIO57>,
                <MT8135_PIN_60_JTDI__FUNC_JTDI>;
              drive-strength = <32>;
            };
          };
        };
    };