1354d7675SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2354d7675SEmmanuel Vadot%YAML 1.2 3354d7675SEmmanuel Vadot--- 4354d7675SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/mediatek,mt65xx-pinctrl.yaml# 5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6354d7675SEmmanuel Vadot 7*fac71e4eSEmmanuel Vadottitle: MediaTek MT65xx Pin Controller 8354d7675SEmmanuel Vadot 9354d7675SEmmanuel Vadotmaintainers: 10354d7675SEmmanuel Vadot - Sean Wang <sean.wang@kernel.org> 11354d7675SEmmanuel Vadot 12*fac71e4eSEmmanuel Vadotdescription: 13*fac71e4eSEmmanuel Vadot The MediaTek's MT65xx Pin controller is used to control SoC pins. 14354d7675SEmmanuel Vadot 15354d7675SEmmanuel Vadotproperties: 16354d7675SEmmanuel Vadot compatible: 17354d7675SEmmanuel Vadot enum: 18354d7675SEmmanuel Vadot - mediatek,mt2701-pinctrl 19354d7675SEmmanuel Vadot - mediatek,mt2712-pinctrl 20354d7675SEmmanuel Vadot - mediatek,mt6397-pinctrl 21354d7675SEmmanuel Vadot - mediatek,mt7623-pinctrl 22354d7675SEmmanuel Vadot - mediatek,mt8127-pinctrl 23354d7675SEmmanuel Vadot - mediatek,mt8135-pinctrl 24354d7675SEmmanuel Vadot - mediatek,mt8167-pinctrl 25354d7675SEmmanuel Vadot - mediatek,mt8173-pinctrl 26354d7675SEmmanuel Vadot - mediatek,mt8516-pinctrl 27354d7675SEmmanuel Vadot 28354d7675SEmmanuel Vadot reg: 29354d7675SEmmanuel Vadot maxItems: 1 30354d7675SEmmanuel Vadot 31354d7675SEmmanuel Vadot pins-are-numbered: 32354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 33*fac71e4eSEmmanuel Vadot description: 348bab661aSEmmanuel Vadot Specify the subnodes are using numbered pinmux to specify pins. (UNUSED) 358bab661aSEmmanuel Vadot deprecated: true 36354d7675SEmmanuel Vadot 37354d7675SEmmanuel Vadot gpio-controller: true 38354d7675SEmmanuel Vadot 39354d7675SEmmanuel Vadot "#gpio-cells": 40354d7675SEmmanuel Vadot const: 2 41*fac71e4eSEmmanuel Vadot description: 42*fac71e4eSEmmanuel Vadot Number of cells in GPIO specifier. Since the generic GPIO binding is used, 43*fac71e4eSEmmanuel Vadot the amount of cells must be specified as 2. See the below mentioned gpio 44*fac71e4eSEmmanuel Vadot binding representation for description of particular cells. 45354d7675SEmmanuel Vadot 46354d7675SEmmanuel Vadot mediatek,pctl-regmap: 47354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 48c9ccf3a3SEmmanuel Vadot items: 49c9ccf3a3SEmmanuel Vadot maxItems: 1 50354d7675SEmmanuel Vadot minItems: 1 51354d7675SEmmanuel Vadot maxItems: 2 52*fac71e4eSEmmanuel Vadot description: 53354d7675SEmmanuel Vadot Should be phandles of the syscfg node. 54354d7675SEmmanuel Vadot 55354d7675SEmmanuel Vadot interrupt-controller: true 56354d7675SEmmanuel Vadot 57354d7675SEmmanuel Vadot interrupts: 58354d7675SEmmanuel Vadot minItems: 1 59354d7675SEmmanuel Vadot maxItems: 3 60354d7675SEmmanuel Vadot 61354d7675SEmmanuel Vadot "#interrupt-cells": 62354d7675SEmmanuel Vadot const: 2 63354d7675SEmmanuel Vadot 64354d7675SEmmanuel Vadotrequired: 65354d7675SEmmanuel Vadot - compatible 66354d7675SEmmanuel Vadot - gpio-controller 67354d7675SEmmanuel Vadot - "#gpio-cells" 68354d7675SEmmanuel Vadot 69e67e8565SEmmanuel VadotallOf: 70*fac71e4eSEmmanuel Vadot - $ref: pinctrl.yaml# 71e67e8565SEmmanuel Vadot 72354d7675SEmmanuel VadotpatternProperties: 73cb7aa33aSEmmanuel Vadot 'pins$': 74354d7675SEmmanuel Vadot type: object 75354d7675SEmmanuel Vadot additionalProperties: false 76354d7675SEmmanuel Vadot patternProperties: 77cb7aa33aSEmmanuel Vadot '(^pins|pins?$)': 78354d7675SEmmanuel Vadot type: object 79354d7675SEmmanuel Vadot additionalProperties: false 80*fac71e4eSEmmanuel Vadot description: 81354d7675SEmmanuel Vadot A pinctrl node should contain at least one subnodes representing the 82354d7675SEmmanuel Vadot pinctrl groups available on the machine. Each subnode will list the 83354d7675SEmmanuel Vadot pins it needs, and how they should be configured, with regard to muxer 84354d7675SEmmanuel Vadot configuration, pullups, drive strength, input enable/disable and input 85354d7675SEmmanuel Vadot schmitt. 86*fac71e4eSEmmanuel Vadot $ref: /schemas/pinctrl/pincfg-node.yaml 87354d7675SEmmanuel Vadot 88354d7675SEmmanuel Vadot properties: 89354d7675SEmmanuel Vadot pinmux: 90354d7675SEmmanuel Vadot description: 91*fac71e4eSEmmanuel Vadot Integer array, represents gpio pin number and mux setting. 92354d7675SEmmanuel Vadot Supported pin number and mux varies for different SoCs, and are 93*fac71e4eSEmmanuel Vadot defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 94354d7675SEmmanuel Vadot 95354d7675SEmmanuel Vadot bias-disable: true 96354d7675SEmmanuel Vadot 97354d7675SEmmanuel Vadot bias-pull-up: 98*fac71e4eSEmmanuel Vadot description: 99354d7675SEmmanuel Vadot Besides generic pinconfig options, it can be used as the pull up 100354d7675SEmmanuel Vadot settings for 2 pull resistors, R0 and R1. User can configure those 101354d7675SEmmanuel Vadot special pins. Some macros have been defined for this usage, such 102354d7675SEmmanuel Vadot as MTK_PUPD_SET_R1R0_00. See dt-bindings/pinctrl/mt65xx.h for 103354d7675SEmmanuel Vadot valid arguments. 104354d7675SEmmanuel Vadot 105354d7675SEmmanuel Vadot bias-pull-down: true 106354d7675SEmmanuel Vadot 107354d7675SEmmanuel Vadot input-enable: true 108354d7675SEmmanuel Vadot 109354d7675SEmmanuel Vadot input-disable: true 110354d7675SEmmanuel Vadot 111354d7675SEmmanuel Vadot output-low: true 112354d7675SEmmanuel Vadot 113354d7675SEmmanuel Vadot output-high: true 114354d7675SEmmanuel Vadot 115354d7675SEmmanuel Vadot input-schmitt-enable: true 116354d7675SEmmanuel Vadot 117354d7675SEmmanuel Vadot input-schmitt-disable: true 118354d7675SEmmanuel Vadot 119354d7675SEmmanuel Vadot drive-strength: 120*fac71e4eSEmmanuel Vadot description: 121354d7675SEmmanuel Vadot Can support some arguments, such as MTK_DRIVE_4mA, MTK_DRIVE_6mA, 122354d7675SEmmanuel Vadot etc. See dt-bindings/pinctrl/mt65xx.h for valid arguments. 123354d7675SEmmanuel Vadot 124354d7675SEmmanuel Vadot required: 125354d7675SEmmanuel Vadot - pinmux 126354d7675SEmmanuel Vadot 127354d7675SEmmanuel VadotadditionalProperties: false 128354d7675SEmmanuel Vadot 129354d7675SEmmanuel Vadotexamples: 130354d7675SEmmanuel Vadot - | 131354d7675SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 132354d7675SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 133354d7675SEmmanuel Vadot #include <dt-bindings/pinctrl/mt8135-pinfunc.h> 134354d7675SEmmanuel Vadot 135354d7675SEmmanuel Vadot soc { 136354d7675SEmmanuel Vadot #address-cells = <2>; 137354d7675SEmmanuel Vadot #size-cells = <2>; 138354d7675SEmmanuel Vadot 139354d7675SEmmanuel Vadot syscfg_pctl_a: syscfg-pctl-a@10005000 { 140354d7675SEmmanuel Vadot compatible = "mediatek,mt8135-pctl-a-syscfg", "syscon"; 141354d7675SEmmanuel Vadot reg = <0 0x10005000 0 0x1000>; 142354d7675SEmmanuel Vadot }; 143354d7675SEmmanuel Vadot 144354d7675SEmmanuel Vadot syscfg_pctl_b: syscfg-pctl-b@1020c020 { 145354d7675SEmmanuel Vadot compatible = "mediatek,mt8135-pctl-b-syscfg", "syscon"; 146354d7675SEmmanuel Vadot reg = <0 0x1020C020 0 0x1000>; 147354d7675SEmmanuel Vadot }; 148354d7675SEmmanuel Vadot 149354d7675SEmmanuel Vadot pinctrl@1c20800 { 150354d7675SEmmanuel Vadot compatible = "mediatek,mt8135-pinctrl"; 151354d7675SEmmanuel Vadot reg = <0 0x1000B000 0 0x1000>; 152354d7675SEmmanuel Vadot mediatek,pctl-regmap = <&syscfg_pctl_a>, <&syscfg_pctl_b>; 153354d7675SEmmanuel Vadot gpio-controller; 154354d7675SEmmanuel Vadot #gpio-cells = <2>; 155354d7675SEmmanuel Vadot interrupt-controller; 156354d7675SEmmanuel Vadot #interrupt-cells = <2>; 157354d7675SEmmanuel Vadot interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>, 158354d7675SEmmanuel Vadot <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>, 159354d7675SEmmanuel Vadot <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>; 160354d7675SEmmanuel Vadot 161cb7aa33aSEmmanuel Vadot i2c0_pins_a: i2c0-pins { 162354d7675SEmmanuel Vadot pins1 { 163354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_100_SDA0__FUNC_SDA0>, 164354d7675SEmmanuel Vadot <MT8135_PIN_101_SCL0__FUNC_SCL0>; 165354d7675SEmmanuel Vadot bias-disable; 166354d7675SEmmanuel Vadot }; 167354d7675SEmmanuel Vadot }; 168354d7675SEmmanuel Vadot 169cb7aa33aSEmmanuel Vadot i2c1_pins_a: i2c1-pins { 170354d7675SEmmanuel Vadot pins { 171354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_195_SDA1__FUNC_SDA1>, 172354d7675SEmmanuel Vadot <MT8135_PIN_196_SCL1__FUNC_SCL1>; 173354d7675SEmmanuel Vadot bias-pull-up = <MTK_PUPD_SET_R1R0_01>; 174354d7675SEmmanuel Vadot }; 175354d7675SEmmanuel Vadot }; 176354d7675SEmmanuel Vadot 177cb7aa33aSEmmanuel Vadot i2c2_pins_a: i2c2-pins { 178354d7675SEmmanuel Vadot pins1 { 179354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_193_SDA2__FUNC_SDA2>; 180354d7675SEmmanuel Vadot bias-pull-down; 181354d7675SEmmanuel Vadot }; 182354d7675SEmmanuel Vadot 183354d7675SEmmanuel Vadot pins2 { 184354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_49_WATCHDOG__FUNC_GPIO49>; 185354d7675SEmmanuel Vadot bias-pull-up; 186354d7675SEmmanuel Vadot }; 187354d7675SEmmanuel Vadot }; 188354d7675SEmmanuel Vadot 189cb7aa33aSEmmanuel Vadot i2c3_pins_a: i2c3-pins { 190354d7675SEmmanuel Vadot pins1 { 191354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_40_DAC_CLK__FUNC_GPIO40>, 192354d7675SEmmanuel Vadot <MT8135_PIN_41_DAC_WS__FUNC_GPIO41>; 193354d7675SEmmanuel Vadot bias-pull-up = <MTK_PUPD_SET_R1R0_01>; 194354d7675SEmmanuel Vadot }; 195354d7675SEmmanuel Vadot 196354d7675SEmmanuel Vadot pins2 { 197354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_35_SCL3__FUNC_SCL3>, 198354d7675SEmmanuel Vadot <MT8135_PIN_36_SDA3__FUNC_SDA3>; 199354d7675SEmmanuel Vadot output-low; 200354d7675SEmmanuel Vadot bias-pull-up = <MTK_PUPD_SET_R1R0_01>; 201354d7675SEmmanuel Vadot }; 202354d7675SEmmanuel Vadot 203354d7675SEmmanuel Vadot pins3 { 204354d7675SEmmanuel Vadot pinmux = <MT8135_PIN_57_JTCK__FUNC_GPIO57>, 205354d7675SEmmanuel Vadot <MT8135_PIN_60_JTDI__FUNC_JTDI>; 206354d7675SEmmanuel Vadot drive-strength = <32>; 207354d7675SEmmanuel Vadot }; 208354d7675SEmmanuel Vadot }; 209354d7675SEmmanuel Vadot }; 210354d7675SEmmanuel Vadot }; 211