xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/pinctrl/mediatek,mt6779-pinctrl.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: Mediatek MT6779 Pin Controller Device Tree Bindings
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Andy Teng <andy.teng@mediatek.com>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyundescription: |+
13*4882a593Smuzhiyun  The pin controller node should be the child of a syscon node with the
14*4882a593Smuzhiyun  required property:
15*4882a593Smuzhiyun  - compatible: "syscon"
16*4882a593Smuzhiyun
17*4882a593Smuzhiyunproperties:
18*4882a593Smuzhiyun  compatible:
19*4882a593Smuzhiyun    const: mediatek,mt6779-pinctrl
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun  reg:
22*4882a593Smuzhiyun    minItems: 9
23*4882a593Smuzhiyun    maxItems: 9
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun  reg-names:
26*4882a593Smuzhiyun    items:
27*4882a593Smuzhiyun      - const: "gpio"
28*4882a593Smuzhiyun      - const: "iocfg_rm"
29*4882a593Smuzhiyun      - const: "iocfg_br"
30*4882a593Smuzhiyun      - const: "iocfg_lm"
31*4882a593Smuzhiyun      - const: "iocfg_lb"
32*4882a593Smuzhiyun      - const: "iocfg_rt"
33*4882a593Smuzhiyun      - const: "iocfg_lt"
34*4882a593Smuzhiyun      - const: "iocfg_tl"
35*4882a593Smuzhiyun      - const: "eint"
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun  gpio-controller: true
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun  "#gpio-cells":
40*4882a593Smuzhiyun    const: 2
41*4882a593Smuzhiyun    description: |
42*4882a593Smuzhiyun      Number of cells in GPIO specifier. Since the generic GPIO
43*4882a593Smuzhiyun      binding is used, the amount of cells must be specified as 2. See the below
44*4882a593Smuzhiyun      mentioned gpio binding representation for description of particular cells.
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  gpio-ranges:
47*4882a593Smuzhiyun    minItems: 1
48*4882a593Smuzhiyun    maxItems: 5
49*4882a593Smuzhiyun    description: |
50*4882a593Smuzhiyun      GPIO valid number range.
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun  interrupt-controller: true
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun  interrupts:
55*4882a593Smuzhiyun    maxItems: 1
56*4882a593Smuzhiyun    description: |
57*4882a593Smuzhiyun      Specifies the summary IRQ.
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun  "#interrupt-cells":
60*4882a593Smuzhiyun    const: 2
61*4882a593Smuzhiyun
62*4882a593Smuzhiyunrequired:
63*4882a593Smuzhiyun  - compatible
64*4882a593Smuzhiyun  - reg
65*4882a593Smuzhiyun  - reg-names
66*4882a593Smuzhiyun  - gpio-controller
67*4882a593Smuzhiyun  - "#gpio-cells"
68*4882a593Smuzhiyun  - gpio-ranges
69*4882a593Smuzhiyun  - interrupt-controller
70*4882a593Smuzhiyun  - interrupts
71*4882a593Smuzhiyun  - "#interrupt-cells"
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunpatternProperties:
74*4882a593Smuzhiyun  '-[0-9]*$':
75*4882a593Smuzhiyun    type: object
76*4882a593Smuzhiyun    patternProperties:
77*4882a593Smuzhiyun      '-pins*$':
78*4882a593Smuzhiyun        type: object
79*4882a593Smuzhiyun        description: |
80*4882a593Smuzhiyun          A pinctrl node should contain at least one subnodes representing the
81*4882a593Smuzhiyun          pinctrl groups available on the machine. Each subnode will list the
82*4882a593Smuzhiyun          pins it needs, and how they should be configured, with regard to muxer
83*4882a593Smuzhiyun          configuration, pullups, drive strength, input enable/disable and input schmitt.
84*4882a593Smuzhiyun        $ref: "/schemas/pinctrl/pincfg-node.yaml"
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun        properties:
87*4882a593Smuzhiyun          pinmux:
88*4882a593Smuzhiyun            description:
89*4882a593Smuzhiyun              integer array, represents gpio pin number and mux setting.
90*4882a593Smuzhiyun              Supported pin number and mux varies for different SoCs, and are defined
91*4882a593Smuzhiyun              as macros in boot/dts/<soc>-pinfunc.h directly.
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun          bias-disable: true
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun          bias-pull-up: true
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun          bias-pull-down: true
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun          input-enable: true
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun          input-disable: true
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun          output-low: true
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun          output-high: true
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun          input-schmitt-enable: true
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun          input-schmitt-disable: true
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun          mediatek,pull-up-adv:
112*4882a593Smuzhiyun            description: |
113*4882a593Smuzhiyun              Pull up setings for 2 pull resistors, R0 and R1. User can
114*4882a593Smuzhiyun              configure those special pins. Valid arguments are described as below:
115*4882a593Smuzhiyun              0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
116*4882a593Smuzhiyun              1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
117*4882a593Smuzhiyun              2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
118*4882a593Smuzhiyun              3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
119*4882a593Smuzhiyun            $ref: /schemas/types.yaml#/definitions/uint32
120*4882a593Smuzhiyun            enum: [0, 1, 2, 3]
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun          mediatek,pull-down-adv:
123*4882a593Smuzhiyun            description: |
124*4882a593Smuzhiyun              Pull down settings for 2 pull resistors, R0 and R1. User can
125*4882a593Smuzhiyun              configure those special pins. Valid arguments are described as below:
126*4882a593Smuzhiyun              0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
127*4882a593Smuzhiyun              1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
128*4882a593Smuzhiyun              2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
129*4882a593Smuzhiyun              3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
130*4882a593Smuzhiyun            $ref: /schemas/types.yaml#/definitions/uint32
131*4882a593Smuzhiyun            enum: [0, 1, 2, 3]
132*4882a593Smuzhiyun
133*4882a593Smuzhiyun        required:
134*4882a593Smuzhiyun          - pinmux
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun        additionalProperties: false
137*4882a593Smuzhiyun
138*4882a593SmuzhiyunadditionalProperties: false
139*4882a593Smuzhiyun
140*4882a593Smuzhiyunexamples:
141*4882a593Smuzhiyun  - |
142*4882a593Smuzhiyun    #include <dt-bindings/interrupt-controller/irq.h>
143*4882a593Smuzhiyun    #include <dt-bindings/interrupt-controller/arm-gic.h>
144*4882a593Smuzhiyun    #include <dt-bindings/pinctrl/mt6779-pinfunc.h>
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun    soc {
147*4882a593Smuzhiyun        #address-cells = <2>;
148*4882a593Smuzhiyun        #size-cells = <2>;
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun        pio: pinctrl@10005000 {
151*4882a593Smuzhiyun            compatible = "mediatek,mt6779-pinctrl";
152*4882a593Smuzhiyun            reg = <0 0x10005000 0 0x1000>,
153*4882a593Smuzhiyun                <0 0x11c20000 0 0x1000>,
154*4882a593Smuzhiyun                <0 0x11d10000 0 0x1000>,
155*4882a593Smuzhiyun                <0 0x11e20000 0 0x1000>,
156*4882a593Smuzhiyun                <0 0x11e70000 0 0x1000>,
157*4882a593Smuzhiyun                <0 0x11ea0000 0 0x1000>,
158*4882a593Smuzhiyun                <0 0x11f20000 0 0x1000>,
159*4882a593Smuzhiyun                <0 0x11f30000 0 0x1000>,
160*4882a593Smuzhiyun                <0 0x1000b000 0 0x1000>;
161*4882a593Smuzhiyun            reg-names = "gpio", "iocfg_rm",
162*4882a593Smuzhiyun              "iocfg_br", "iocfg_lm",
163*4882a593Smuzhiyun              "iocfg_lb", "iocfg_rt",
164*4882a593Smuzhiyun              "iocfg_lt", "iocfg_tl",
165*4882a593Smuzhiyun              "eint";
166*4882a593Smuzhiyun            gpio-controller;
167*4882a593Smuzhiyun            #gpio-cells = <2>;
168*4882a593Smuzhiyun            gpio-ranges = <&pio 0 0 210>;
169*4882a593Smuzhiyun            interrupt-controller;
170*4882a593Smuzhiyun            #interrupt-cells = <2>;
171*4882a593Smuzhiyun            interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>;
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun            mmc0_pins_default: mmc0-0 {
174*4882a593Smuzhiyun                cmd-dat-pins {
175*4882a593Smuzhiyun                    pinmux = <PINMUX_GPIO168__FUNC_MSDC0_DAT0>,
176*4882a593Smuzhiyun                        <PINMUX_GPIO172__FUNC_MSDC0_DAT1>,
177*4882a593Smuzhiyun                        <PINMUX_GPIO169__FUNC_MSDC0_DAT2>,
178*4882a593Smuzhiyun                        <PINMUX_GPIO177__FUNC_MSDC0_DAT3>,
179*4882a593Smuzhiyun                        <PINMUX_GPIO170__FUNC_MSDC0_DAT4>,
180*4882a593Smuzhiyun                        <PINMUX_GPIO173__FUNC_MSDC0_DAT5>,
181*4882a593Smuzhiyun                        <PINMUX_GPIO171__FUNC_MSDC0_DAT6>,
182*4882a593Smuzhiyun                        <PINMUX_GPIO174__FUNC_MSDC0_DAT7>,
183*4882a593Smuzhiyun                        <PINMUX_GPIO167__FUNC_MSDC0_CMD>;
184*4882a593Smuzhiyun                    input-enable;
185*4882a593Smuzhiyun                    mediatek,pull-up-adv = <1>;
186*4882a593Smuzhiyun                };
187*4882a593Smuzhiyun                clk-pins {
188*4882a593Smuzhiyun                    pinmux = <PINMUX_GPIO176__FUNC_MSDC0_CLK>;
189*4882a593Smuzhiyun                    mediatek,pull-down-adv = <2>;
190*4882a593Smuzhiyun                };
191*4882a593Smuzhiyun                rst-pins {
192*4882a593Smuzhiyun                    pinmux = <PINMUX_GPIO178__FUNC_MSDC0_RSTB>;
193*4882a593Smuzhiyun                    mediatek,pull-up-adv = <0>;
194*4882a593Smuzhiyun                };
195*4882a593Smuzhiyun            };
196*4882a593Smuzhiyun        };
197*4882a593Smuzhiyun
198*4882a593Smuzhiyun        mmc0 {
199*4882a593Smuzhiyun           pinctrl-0 = <&mmc0_pins_default>;
200*4882a593Smuzhiyun           pinctrl-names = "default";
201*4882a593Smuzhiyun        };
202*4882a593Smuzhiyun    };
203