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,mt6797-pinctrl.yaml# 5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6354d7675SEmmanuel Vadot 7*7ef62cebSEmmanuel Vadottitle: Mediatek MT6797 Pin Controller 8354d7675SEmmanuel Vadot 9354d7675SEmmanuel Vadotmaintainers: 10354d7675SEmmanuel Vadot - Sean Wang <sean.wang@kernel.org> 11354d7675SEmmanuel Vadot 12354d7675SEmmanuel Vadotdescription: |+ 13354d7675SEmmanuel Vadot The MediaTek's MT6797 Pin controller is used to control SoC pins. 14354d7675SEmmanuel Vadot 15354d7675SEmmanuel Vadotproperties: 16354d7675SEmmanuel Vadot compatible: 17354d7675SEmmanuel Vadot const: mediatek,mt6797-pinctrl 18354d7675SEmmanuel Vadot 19354d7675SEmmanuel Vadot reg: 20354d7675SEmmanuel Vadot minItems: 5 21354d7675SEmmanuel Vadot maxItems: 5 22354d7675SEmmanuel Vadot 23354d7675SEmmanuel Vadot reg-names: 24354d7675SEmmanuel Vadot items: 25354d7675SEmmanuel Vadot - const: gpio 26354d7675SEmmanuel Vadot - const: iocfgl 27354d7675SEmmanuel Vadot - const: iocfgb 28354d7675SEmmanuel Vadot - const: iocfgr 29354d7675SEmmanuel Vadot - const: iocfgt 30354d7675SEmmanuel Vadot 31354d7675SEmmanuel Vadot gpio-controller: true 32354d7675SEmmanuel Vadot 33354d7675SEmmanuel Vadot "#gpio-cells": 34354d7675SEmmanuel Vadot const: 2 35354d7675SEmmanuel Vadot description: | 36354d7675SEmmanuel Vadot Number of cells in GPIO specifier. Since the generic GPIO 37354d7675SEmmanuel Vadot binding is used, the amount of cells must be specified as 2. See the below 38354d7675SEmmanuel Vadot mentioned gpio binding representation for description of particular cells. 39354d7675SEmmanuel Vadot 40354d7675SEmmanuel Vadot interrupt-controller: true 41354d7675SEmmanuel Vadot 42354d7675SEmmanuel Vadot interrupts: 43354d7675SEmmanuel Vadot maxItems: 1 44354d7675SEmmanuel Vadot 45354d7675SEmmanuel Vadot "#interrupt-cells": 46354d7675SEmmanuel Vadot const: 2 47354d7675SEmmanuel Vadot 48e67e8565SEmmanuel VadotallOf: 49e67e8565SEmmanuel Vadot - $ref: "pinctrl.yaml#" 50e67e8565SEmmanuel Vadot 51354d7675SEmmanuel Vadotrequired: 52354d7675SEmmanuel Vadot - compatible 53354d7675SEmmanuel Vadot - reg 54354d7675SEmmanuel Vadot - reg-names 55354d7675SEmmanuel Vadot - gpio-controller 56354d7675SEmmanuel Vadot - "#gpio-cells" 57354d7675SEmmanuel Vadot 58354d7675SEmmanuel VadotpatternProperties: 59354d7675SEmmanuel Vadot '-[0-9]+$': 60354d7675SEmmanuel Vadot type: object 61354d7675SEmmanuel Vadot additionalProperties: false 62354d7675SEmmanuel Vadot patternProperties: 63354d7675SEmmanuel Vadot 'pins': 64354d7675SEmmanuel Vadot type: object 65354d7675SEmmanuel Vadot additionalProperties: false 66354d7675SEmmanuel Vadot description: | 67354d7675SEmmanuel Vadot A pinctrl node should contain at least one subnodes representing the 68354d7675SEmmanuel Vadot pinctrl groups available on the machine. Each subnode will list the 69354d7675SEmmanuel Vadot pins it needs, and how they should be configured, with regard to muxer 70354d7675SEmmanuel Vadot configuration, pullups, drive strength, input enable/disable and input 71354d7675SEmmanuel Vadot schmitt. 72354d7675SEmmanuel Vadot $ref: "/schemas/pinctrl/pincfg-node.yaml" 73354d7675SEmmanuel Vadot 74354d7675SEmmanuel Vadot properties: 75354d7675SEmmanuel Vadot pinmux: 76354d7675SEmmanuel Vadot description: 77354d7675SEmmanuel Vadot integer array, represents gpio pin number and mux setting. 78354d7675SEmmanuel Vadot Supported pin number and mux varies for different SoCs, and are 79354d7675SEmmanuel Vadot defined as macros in <soc>-pinfunc.h directly. 80354d7675SEmmanuel Vadot 81354d7675SEmmanuel Vadot bias-disable: true 82354d7675SEmmanuel Vadot 83354d7675SEmmanuel Vadot bias-pull-up: true 84354d7675SEmmanuel Vadot 85354d7675SEmmanuel Vadot bias-pull-down: true 86354d7675SEmmanuel Vadot 87354d7675SEmmanuel Vadot input-enable: true 88354d7675SEmmanuel Vadot 89354d7675SEmmanuel Vadot input-disable: true 90354d7675SEmmanuel Vadot 91354d7675SEmmanuel Vadot output-enable: true 92354d7675SEmmanuel Vadot 93354d7675SEmmanuel Vadot output-low: true 94354d7675SEmmanuel Vadot 95354d7675SEmmanuel Vadot output-high: true 96354d7675SEmmanuel Vadot 97354d7675SEmmanuel Vadot input-schmitt-enable: true 98354d7675SEmmanuel Vadot 99354d7675SEmmanuel Vadot input-schmitt-disable: true 100354d7675SEmmanuel Vadot 101354d7675SEmmanuel Vadot drive-strength: 102354d7675SEmmanuel Vadot enum: [2, 4, 8, 12, 16] 103354d7675SEmmanuel Vadot 104354d7675SEmmanuel Vadot slew-rate: 105354d7675SEmmanuel Vadot enum: [0, 1] 106354d7675SEmmanuel Vadot 107354d7675SEmmanuel Vadot mediatek,pull-up-adv: 108354d7675SEmmanuel Vadot description: | 109354d7675SEmmanuel Vadot Pull up setings for 2 pull resistors, R0 and R1. User can 110354d7675SEmmanuel Vadot configure those special pins. Valid arguments are described as below: 111354d7675SEmmanuel Vadot 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 112354d7675SEmmanuel Vadot 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 113354d7675SEmmanuel Vadot 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 114354d7675SEmmanuel Vadot 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 115354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 116354d7675SEmmanuel Vadot enum: [0, 1, 2, 3] 117354d7675SEmmanuel Vadot 118354d7675SEmmanuel Vadot mediatek,pull-down-adv: 119354d7675SEmmanuel Vadot description: | 120354d7675SEmmanuel Vadot Pull down settings for 2 pull resistors, R0 and R1. User can 121354d7675SEmmanuel Vadot configure those special pins. Valid arguments are described as below: 122354d7675SEmmanuel Vadot 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 123354d7675SEmmanuel Vadot 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 124354d7675SEmmanuel Vadot 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 125354d7675SEmmanuel Vadot 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 126354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 127354d7675SEmmanuel Vadot enum: [0, 1, 2, 3] 128354d7675SEmmanuel Vadot 129354d7675SEmmanuel Vadot mediatek,tdsel: 130354d7675SEmmanuel Vadot description: | 131354d7675SEmmanuel Vadot An integer describing the steps for output level shifter duty 132354d7675SEmmanuel Vadot cycle when asserted (high pulse width adjustment). Valid arguments 133354d7675SEmmanuel Vadot are from 0 to 15. 134354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 135354d7675SEmmanuel Vadot 136354d7675SEmmanuel Vadot mediatek,rdsel: 137354d7675SEmmanuel Vadot description: | 138354d7675SEmmanuel Vadot An integer describing the steps for input level shifter duty cycle 139354d7675SEmmanuel Vadot when asserted (high pulse width adjustment). Valid arguments are 140354d7675SEmmanuel Vadot from 0 to 63. 141354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 142354d7675SEmmanuel Vadot 143354d7675SEmmanuel Vadot required: 144354d7675SEmmanuel Vadot - pinmux 145354d7675SEmmanuel Vadot 146354d7675SEmmanuel VadotadditionalProperties: false 147354d7675SEmmanuel Vadot 148354d7675SEmmanuel Vadotexamples: 149354d7675SEmmanuel Vadot - | 150354d7675SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 151354d7675SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 152354d7675SEmmanuel Vadot #include <dt-bindings/pinctrl/mt6797-pinfunc.h> 153354d7675SEmmanuel Vadot 154354d7675SEmmanuel Vadot soc { 155354d7675SEmmanuel Vadot #address-cells = <2>; 156354d7675SEmmanuel Vadot #size-cells = <2>; 157354d7675SEmmanuel Vadot 158354d7675SEmmanuel Vadot pio: pinctrl@10005000 { 159354d7675SEmmanuel Vadot compatible = "mediatek,mt6797-pinctrl"; 160354d7675SEmmanuel Vadot reg = <0 0x10005000 0 0x1000>, 161354d7675SEmmanuel Vadot <0 0x10002000 0 0x400>, 162354d7675SEmmanuel Vadot <0 0x10002400 0 0x400>, 163354d7675SEmmanuel Vadot <0 0x10002800 0 0x400>, 164354d7675SEmmanuel Vadot <0 0x10002C00 0 0x400>; 165354d7675SEmmanuel Vadot reg-names = "gpio", "iocfgl", "iocfgb", "iocfgr", "iocfgt"; 166354d7675SEmmanuel Vadot gpio-controller; 167354d7675SEmmanuel Vadot #gpio-cells = <2>; 168354d7675SEmmanuel Vadot 169354d7675SEmmanuel Vadot uart_pins_a: uart-0 { 170354d7675SEmmanuel Vadot pins1 { 171354d7675SEmmanuel Vadot pinmux = <MT6797_GPIO232__FUNC_URXD1>, 172354d7675SEmmanuel Vadot <MT6797_GPIO233__FUNC_UTXD1>; 173354d7675SEmmanuel Vadot }; 174354d7675SEmmanuel Vadot }; 175354d7675SEmmanuel Vadot }; 176354d7675SEmmanuel Vadot }; 177