1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2%YAML 1.2 3--- 4$id: http://devicetree.org/schemas/pinctrl/pinctrl-mt8195.yaml# 5$schema: http://devicetree.org/meta-schemas/core.yaml# 6 7title: Mediatek MT8195 Pin Controller 8 9maintainers: 10 - Sean Wang <sean.wang@mediatek.com> 11 12description: | 13 The Mediatek's Pin controller is used to control SoC pins. 14 15properties: 16 compatible: 17 const: mediatek,mt8195-pinctrl 18 19 gpio-controller: true 20 21 '#gpio-cells': 22 description: | 23 Number of cells in GPIO specifier. Since the generic GPIO binding is used, 24 the amount of cells must be specified as 2. See the below 25 mentioned gpio binding representation for description of particular cells. 26 const: 2 27 28 gpio-ranges: 29 description: gpio valid number range. 30 maxItems: 1 31 32 reg: 33 description: | 34 Physical address base for gpio base registers. There are 8 GPIO 35 physical address base in mt8195. 36 maxItems: 8 37 38 reg-names: 39 description: | 40 Gpio base register names. 41 maxItems: 8 42 43 interrupt-controller: true 44 45 '#interrupt-cells': 46 const: 2 47 48 interrupts: 49 description: The interrupt outputs to sysirq. 50 maxItems: 1 51 52 mediatek,rsel_resistance_in_si_unit: 53 type: boolean 54 description: | 55 Identifying i2c pins pull up/down type which is RSEL. It can support 56 RSEL define or si unit value(ohm) to set different resistance. 57 58#PIN CONFIGURATION NODES 59patternProperties: 60 '-pins$': 61 type: object 62 description: | 63 A pinctrl node should contain at least one subnodes representing the 64 pinctrl groups available on the machine. Each subnode will list the 65 pins it needs, and how they should be configured, with regard to muxer 66 configuration, pullups, drive strength, input enable/disable and 67 input schmitt. 68 An example of using macro: 69 pincontroller { 70 /* GPIO0 set as multifunction GPIO0 */ 71 gpio_pin { 72 pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 73 }; 74 /* GPIO8 set as multifunction SDA0 */ 75 i2c0_pin { 76 pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 77 }; 78 }; 79 $ref: "pinmux-node.yaml" 80 81 properties: 82 pinmux: 83 description: | 84 Integer array, represents gpio pin number and mux setting. 85 Supported pin number and mux varies for different SoCs, and are defined 86 as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 87 88 drive-strength: 89 enum: [2, 4, 6, 8, 10, 12, 14, 16] 90 91 bias-pull-down: 92 description: | 93 For pull down type is normal, it don't need add RSEL & R1R0 define 94 and resistance value. 95 For pull down type is PUPD/R0/R1 type, it can add R1R0 define to 96 set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 97 "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & "MTK_PUPD_SET_R1R0_11" 98 define in mt8195. 99 For pull down type is RSEL, it can add RSEL define & resistance value(ohm) 100 to set different resistance by identifying property "mediatek,rsel_resistance_in_si_unit". 101 It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 102 & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & "MTK_PULL_SET_RSEL_100" 103 & "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 104 define in mt8195. It can also support resistance value(ohm) "75000" & "5000" in mt8195. 105 oneOf: 106 - enum: [100, 101, 102, 103] 107 - description: mt8195 pull down PUPD/R0/R1 type define value. 108 - enum: [200, 201, 202, 203, 204, 205, 206, 207] 109 - description: mt8195 pull down RSEL type define value. 110 - enum: [75000, 5000] 111 - description: mt8195 pull down RSEL type si unit value(ohm). 112 113 An example of using RSEL define: 114 pincontroller { 115 i2c0_pin { 116 pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 117 bias-pull-down = <MTK_PULL_SET_RSEL_001>; 118 }; 119 }; 120 An example of using si unit resistance value(ohm): 121 &pio { 122 mediatek,rsel_resistance_in_si_unit; 123 } 124 pincontroller { 125 i2c0_pin { 126 pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 127 bias-pull-down = <75000>; 128 }; 129 }; 130 131 bias-pull-up: 132 description: | 133 For pull up type is normal, it don't need add RSEL & R1R0 define 134 and resistance value. 135 For pull up type is PUPD/R0/R1 type, it can add R1R0 define to 136 set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 137 "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & "MTK_PUPD_SET_R1R0_11" 138 define in mt8195. 139 For pull up type is RSEL, it can add RSEL define & resistance value(ohm) 140 to set different resistance by identifying property "mediatek,rsel_resistance_in_si_unit". 141 It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 142 & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & "MTK_PULL_SET_RSEL_100" 143 & "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 144 define in mt8195. It can also support resistance value(ohm) 145 "1000" & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" & "75000" in mt8195. 146 oneOf: 147 - enum: [100, 101, 102, 103] 148 - description: mt8195 pull up PUPD/R0/R1 type define value. 149 - enum: [200, 201, 202, 203, 204, 205, 206, 207] 150 - description: mt8195 pull up RSEL type define value. 151 - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000] 152 - description: mt8195 pull up RSEL type si unit value(ohm). 153 An example of using RSEL define: 154 pincontroller { 155 i2c0_pin { 156 pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 157 bias-pull-up = <MTK_PULL_SET_RSEL_001>; 158 }; 159 }; 160 An example of using si unit resistance value(ohm): 161 &pio { 162 mediatek,rsel_resistance_in_si_unit; 163 } 164 pincontroller { 165 i2c0_pin { 166 pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 167 bias-pull-up = <1000>; 168 }; 169 }; 170 171 bias-disable: true 172 173 output-high: true 174 175 output-low: true 176 177 input-enable: true 178 179 input-disable: true 180 181 input-schmitt-enable: true 182 183 input-schmitt-disable: true 184 185 required: 186 - pinmux 187 188 additionalProperties: false 189 190required: 191 - compatible 192 - reg 193 - interrupts 194 - interrupt-controller 195 - '#interrupt-cells' 196 - gpio-controller 197 - '#gpio-cells' 198 - gpio-ranges 199 200additionalProperties: false 201 202examples: 203 - | 204 #include <dt-bindings/pinctrl/mt8195-pinfunc.h> 205 #include <dt-bindings/interrupt-controller/arm-gic.h> 206 pio: pinctrl@10005000 { 207 compatible = "mediatek,mt8195-pinctrl"; 208 reg = <0x10005000 0x1000>, 209 <0x11d10000 0x1000>, 210 <0x11d30000 0x1000>, 211 <0x11d40000 0x1000>, 212 <0x11e20000 0x1000>, 213 <0x11eb0000 0x1000>, 214 <0x11f40000 0x1000>, 215 <0x1000b000 0x1000>; 216 reg-names = "iocfg0", "iocfg_bm", "iocfg_bl", 217 "iocfg_br", "iocfg_lm", "iocfg_rb", 218 "iocfg_tl", "eint"; 219 gpio-controller; 220 #gpio-cells = <2>; 221 gpio-ranges = <&pio 0 0 144>; 222 interrupt-controller; 223 interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>; 224 #interrupt-cells = <2>; 225 226 pio-pins { 227 pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 228 output-low; 229 }; 230 }; 231