1cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2cb7aa33aSEmmanuel Vadot%YAML 1.2 3cb7aa33aSEmmanuel Vadot--- 4cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/mediatek,mt8365-pinctrl.yaml# 5cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6cb7aa33aSEmmanuel Vadot 7fac71e4eSEmmanuel Vadottitle: MediaTek MT8365 Pin Controller 8cb7aa33aSEmmanuel Vadot 9cb7aa33aSEmmanuel Vadotmaintainers: 10cb7aa33aSEmmanuel Vadot - Zhiyong Tao <zhiyong.tao@mediatek.com> 11cb7aa33aSEmmanuel Vadot - Bernhard Rosenkränzer <bero@baylibre.com> 12cb7aa33aSEmmanuel Vadot 13fac71e4eSEmmanuel Vadotdescription: 14cb7aa33aSEmmanuel Vadot The MediaTek's MT8365 Pin controller is used to control SoC pins. 15cb7aa33aSEmmanuel Vadot 16cb7aa33aSEmmanuel Vadotproperties: 17cb7aa33aSEmmanuel Vadot compatible: 18cb7aa33aSEmmanuel Vadot const: mediatek,mt8365-pinctrl 19cb7aa33aSEmmanuel Vadot 20cb7aa33aSEmmanuel Vadot reg: 21cb7aa33aSEmmanuel Vadot maxItems: 1 22cb7aa33aSEmmanuel Vadot 23cb7aa33aSEmmanuel Vadot mediatek,pctl-regmap: 24cb7aa33aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 25cb7aa33aSEmmanuel Vadot items: 26cb7aa33aSEmmanuel Vadot maxItems: 1 27cb7aa33aSEmmanuel Vadot minItems: 1 28cb7aa33aSEmmanuel Vadot maxItems: 2 29fac71e4eSEmmanuel Vadot description: 30cb7aa33aSEmmanuel Vadot Should be phandles of the syscfg node. 31cb7aa33aSEmmanuel Vadot 32cb7aa33aSEmmanuel Vadot gpio-controller: true 33cb7aa33aSEmmanuel Vadot 34cb7aa33aSEmmanuel Vadot "#gpio-cells": 35cb7aa33aSEmmanuel Vadot const: 2 36fac71e4eSEmmanuel Vadot description: 37fac71e4eSEmmanuel Vadot Number of cells in GPIO specifier. Since the generic GPIO binding is used, 38fac71e4eSEmmanuel Vadot the amount of cells must be specified as 2. See the below mentioned gpio 39fac71e4eSEmmanuel Vadot binding representation for description of particular cells. 40cb7aa33aSEmmanuel Vadot 41cb7aa33aSEmmanuel Vadot interrupt-controller: true 42cb7aa33aSEmmanuel Vadot 43cb7aa33aSEmmanuel Vadot interrupts: 44cb7aa33aSEmmanuel Vadot maxItems: 1 45cb7aa33aSEmmanuel Vadot 46cb7aa33aSEmmanuel Vadot "#interrupt-cells": 47cb7aa33aSEmmanuel Vadot const: 2 48cb7aa33aSEmmanuel Vadot 49cb7aa33aSEmmanuel VadotpatternProperties: 50cb7aa33aSEmmanuel Vadot "-pins$": 51cb7aa33aSEmmanuel Vadot type: object 52cb7aa33aSEmmanuel Vadot additionalProperties: false 53cb7aa33aSEmmanuel Vadot patternProperties: 54cb7aa33aSEmmanuel Vadot "pins$": 55cb7aa33aSEmmanuel Vadot type: object 56cb7aa33aSEmmanuel Vadot additionalProperties: false 57fac71e4eSEmmanuel Vadot description: 58cb7aa33aSEmmanuel Vadot A pinctrl node should contain at least one subnode representing the 59cb7aa33aSEmmanuel Vadot pinctrl groups available on the machine. Each subnode will list the 60cb7aa33aSEmmanuel Vadot pins it needs, and how they should be configured, with regard to muxer 61cb7aa33aSEmmanuel Vadot configuration, pullups, drive strength, input enable/disable and input 62cb7aa33aSEmmanuel Vadot schmitt. 63cb7aa33aSEmmanuel Vadot $ref: /schemas/pinctrl/pincfg-node.yaml 64cb7aa33aSEmmanuel Vadot 65cb7aa33aSEmmanuel Vadot properties: 66cb7aa33aSEmmanuel Vadot pinmux: 67cb7aa33aSEmmanuel Vadot description: 68fac71e4eSEmmanuel Vadot Integer array, represents gpio pin number and mux setting. 69cb7aa33aSEmmanuel Vadot Supported pin number and mux varies for different SoCs, and are 70cb7aa33aSEmmanuel Vadot defined as macros in <soc>-pinfunc.h directly. 71cb7aa33aSEmmanuel Vadot 72cb7aa33aSEmmanuel Vadot bias-disable: true 73cb7aa33aSEmmanuel Vadot 74cb7aa33aSEmmanuel Vadot bias-pull-up: 75fac71e4eSEmmanuel Vadot oneOf: 76fac71e4eSEmmanuel Vadot - type: boolean 77fac71e4eSEmmanuel Vadot - enum: [100, 101, 102, 103] 78fac71e4eSEmmanuel Vadot description: Pull up R1/R0 type define value. 79cb7aa33aSEmmanuel Vadot description: | 80fac71e4eSEmmanuel Vadot For pull up type is normal, it don't need add R1/R0 define. 81fac71e4eSEmmanuel Vadot For pull up type is R1/R0 type, it can add value to set different 82fac71e4eSEmmanuel Vadot resistance. Valid arguments are described as below: 83fac71e4eSEmmanuel Vadot 100: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 84fac71e4eSEmmanuel Vadot 101: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 85fac71e4eSEmmanuel Vadot 102: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 86fac71e4eSEmmanuel Vadot 103: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 87cb7aa33aSEmmanuel Vadot 88fac71e4eSEmmanuel Vadot bias-pull-down: 89fac71e4eSEmmanuel Vadot oneOf: 90fac71e4eSEmmanuel Vadot - type: boolean 91fac71e4eSEmmanuel Vadot - enum: [100, 101, 102, 103] 92fac71e4eSEmmanuel Vadot description: Pull down R1/R0 type define value. 93fac71e4eSEmmanuel Vadot description: | 94fac71e4eSEmmanuel Vadot For pull down type is normal, it don't need add R1/R0 define. 95fac71e4eSEmmanuel Vadot For pull down type is R1/R0 type, it can add value to set 96fac71e4eSEmmanuel Vadot different resistance. Valid arguments are described as below: 97fac71e4eSEmmanuel Vadot 100: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 98fac71e4eSEmmanuel Vadot 101: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 99fac71e4eSEmmanuel Vadot 102: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 100fac71e4eSEmmanuel Vadot 103: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 101fac71e4eSEmmanuel Vadot 102fac71e4eSEmmanuel Vadot drive-strength: 103fac71e4eSEmmanuel Vadot enum: [2, 4, 6, 8, 10, 12, 14, 16] 104cb7aa33aSEmmanuel Vadot 105cb7aa33aSEmmanuel Vadot input-enable: true 106cb7aa33aSEmmanuel Vadot 107cb7aa33aSEmmanuel Vadot input-disable: true 108cb7aa33aSEmmanuel Vadot 109cb7aa33aSEmmanuel Vadot output-low: true 110cb7aa33aSEmmanuel Vadot 111cb7aa33aSEmmanuel Vadot output-high: true 112cb7aa33aSEmmanuel Vadot 113cb7aa33aSEmmanuel Vadot input-schmitt-enable: true 114cb7aa33aSEmmanuel Vadot 115cb7aa33aSEmmanuel Vadot input-schmitt-disable: true 116cb7aa33aSEmmanuel Vadot 117fac71e4eSEmmanuel Vadot drive-strength-microamp: 118fac71e4eSEmmanuel Vadot enum: [125, 250, 500, 1000] 119fac71e4eSEmmanuel Vadot 120cb7aa33aSEmmanuel Vadot mediatek,drive-strength-adv: 121fac71e4eSEmmanuel Vadot deprecated: true 122cb7aa33aSEmmanuel Vadot description: | 123fac71e4eSEmmanuel Vadot DEPRECATED: Please use drive-strength-microamp instead. 124cb7aa33aSEmmanuel Vadot Describe the specific driving setup property. 125cb7aa33aSEmmanuel Vadot For I2C pins, the existing generic driving setup can only support 126cb7aa33aSEmmanuel Vadot 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they 127cb7aa33aSEmmanuel Vadot can support 0.125/0.25/0.5/1mA adjustment. If we enable specific 128cb7aa33aSEmmanuel Vadot driving setup, the existing generic setup will be disabled. 129cb7aa33aSEmmanuel Vadot The specific driving setup is controlled by E1E0EN. 130cb7aa33aSEmmanuel Vadot When E1=0/E0=0, the strength is 0.125mA. 131cb7aa33aSEmmanuel Vadot When E1=0/E0=1, the strength is 0.25mA. 132cb7aa33aSEmmanuel Vadot When E1=1/E0=0, the strength is 0.5mA. 133cb7aa33aSEmmanuel Vadot When E1=1/E0=1, the strength is 1mA. 134cb7aa33aSEmmanuel Vadot EN is used to enable or disable the specific driving setup. 135cb7aa33aSEmmanuel Vadot Valid arguments are described as below: 136cb7aa33aSEmmanuel Vadot 0: (E1, E0, EN) = (0, 0, 0) 137cb7aa33aSEmmanuel Vadot 1: (E1, E0, EN) = (0, 0, 1) 138cb7aa33aSEmmanuel Vadot 2: (E1, E0, EN) = (0, 1, 0) 139cb7aa33aSEmmanuel Vadot 3: (E1, E0, EN) = (0, 1, 1) 140cb7aa33aSEmmanuel Vadot 4: (E1, E0, EN) = (1, 0, 0) 141cb7aa33aSEmmanuel Vadot 5: (E1, E0, EN) = (1, 0, 1) 142cb7aa33aSEmmanuel Vadot 6: (E1, E0, EN) = (1, 1, 0) 143cb7aa33aSEmmanuel Vadot 7: (E1, E0, EN) = (1, 1, 1) 144cb7aa33aSEmmanuel Vadot So the valid arguments are from 0 to 7. 145cb7aa33aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 146cb7aa33aSEmmanuel Vadot enum: [0, 1, 2, 3, 4, 5, 6, 7] 147cb7aa33aSEmmanuel Vadot 148cb7aa33aSEmmanuel Vadot mediatek,pull-up-adv: 149fac71e4eSEmmanuel Vadot deprecated: true 150cb7aa33aSEmmanuel Vadot description: | 151fac71e4eSEmmanuel Vadot DEPRECATED: Please use bias-pull-up instead. 152*aa1a8ff2SEmmanuel Vadot Pull up settings for 2 pull resistors, R0 and R1. User can 153fac71e4eSEmmanuel Vadot configure those special pins. Valid arguments are described as 154fac71e4eSEmmanuel Vadot below: 155cb7aa33aSEmmanuel Vadot 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 156cb7aa33aSEmmanuel Vadot 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 157cb7aa33aSEmmanuel Vadot 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 158cb7aa33aSEmmanuel Vadot 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 159cb7aa33aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 160cb7aa33aSEmmanuel Vadot enum: [0, 1, 2, 3] 161cb7aa33aSEmmanuel Vadot 162cb7aa33aSEmmanuel Vadot mediatek,pull-down-adv: 163fac71e4eSEmmanuel Vadot deprecated: true 164cb7aa33aSEmmanuel Vadot description: | 165fac71e4eSEmmanuel Vadot DEPRECATED: Please use bias-pull-down instead. 166cb7aa33aSEmmanuel Vadot Pull down settings for 2 pull resistors, R0 and R1. User can 167fac71e4eSEmmanuel Vadot configure those special pins. Valid arguments are described as 168fac71e4eSEmmanuel Vadot below: 169cb7aa33aSEmmanuel Vadot 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 170cb7aa33aSEmmanuel Vadot 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 171cb7aa33aSEmmanuel Vadot 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 172cb7aa33aSEmmanuel Vadot 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 173cb7aa33aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 174cb7aa33aSEmmanuel Vadot enum: [0, 1, 2, 3] 175cb7aa33aSEmmanuel Vadot 176cb7aa33aSEmmanuel Vadot mediatek,tdsel: 177fac71e4eSEmmanuel Vadot description: 178cb7aa33aSEmmanuel Vadot An integer describing the steps for output level shifter duty 179cb7aa33aSEmmanuel Vadot cycle when asserted (high pulse width adjustment). Valid arguments 180cb7aa33aSEmmanuel Vadot are from 0 to 15. 181cb7aa33aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 182cb7aa33aSEmmanuel Vadot 183cb7aa33aSEmmanuel Vadot mediatek,rdsel: 184fac71e4eSEmmanuel Vadot description: 185cb7aa33aSEmmanuel Vadot An integer describing the steps for input level shifter duty cycle 186cb7aa33aSEmmanuel Vadot when asserted (high pulse width adjustment). Valid arguments are 187cb7aa33aSEmmanuel Vadot from 0 to 63. 188cb7aa33aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 189cb7aa33aSEmmanuel Vadot 190cb7aa33aSEmmanuel Vadot required: 191cb7aa33aSEmmanuel Vadot - pinmux 192cb7aa33aSEmmanuel Vadot 193cb7aa33aSEmmanuel Vadotrequired: 194cb7aa33aSEmmanuel Vadot - compatible 195cb7aa33aSEmmanuel Vadot - reg 196cb7aa33aSEmmanuel Vadot - gpio-controller 197cb7aa33aSEmmanuel Vadot - "#gpio-cells" 198cb7aa33aSEmmanuel Vadot 199cb7aa33aSEmmanuel VadotallOf: 200cb7aa33aSEmmanuel Vadot - $ref: pinctrl.yaml# 201cb7aa33aSEmmanuel Vadot 202cb7aa33aSEmmanuel VadotadditionalProperties: false 203cb7aa33aSEmmanuel Vadot 204cb7aa33aSEmmanuel Vadotexamples: 205cb7aa33aSEmmanuel Vadot - | 206cb7aa33aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 207cb7aa33aSEmmanuel Vadot #include <dt-bindings/pinctrl/mt8365-pinfunc.h> 208cb7aa33aSEmmanuel Vadot soc { 209cb7aa33aSEmmanuel Vadot #address-cells = <2>; 210cb7aa33aSEmmanuel Vadot #size-cells = <2>; 211cb7aa33aSEmmanuel Vadot 212cb7aa33aSEmmanuel Vadot pio: pinctrl@1000b000 { 213cb7aa33aSEmmanuel Vadot compatible = "mediatek,mt8365-pinctrl"; 214cb7aa33aSEmmanuel Vadot reg = <0 0x1000b000 0 0x1000>; 215cb7aa33aSEmmanuel Vadot mediatek,pctl-regmap = <&syscfg_pctl>; 216cb7aa33aSEmmanuel Vadot gpio-controller; 217cb7aa33aSEmmanuel Vadot #gpio-cells = <2>; 218cb7aa33aSEmmanuel Vadot interrupt-controller; 219cb7aa33aSEmmanuel Vadot #interrupt-cells = <2>; 220cb7aa33aSEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>; 221cb7aa33aSEmmanuel Vadot 222cb7aa33aSEmmanuel Vadot pio-pins { 223cb7aa33aSEmmanuel Vadot pins { 224cb7aa33aSEmmanuel Vadot pinmux = <MT8365_PIN_59_SDA1__FUNC_SDA1_0>, <MT8365_PIN_60_SCL1__FUNC_SCL1_0>; 225cb7aa33aSEmmanuel Vadot mediatek,pull-up-adv = <3>; 226cb7aa33aSEmmanuel Vadot bias-pull-up; 227cb7aa33aSEmmanuel Vadot }; 228cb7aa33aSEmmanuel Vadot }; 229cb7aa33aSEmmanuel Vadot }; 230cb7aa33aSEmmanuel Vadot }; 231