Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'pinctrl-v6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
"No core changes this time

New drivers:

- New subdriver for the Qualcomm MSM8917 SoC TLMM

- New subdriver for the Mediatek MT7988 SoC

- New subdriver for the Rockchip RK3562 SoC

- New subdriver for the Renesas RZ/G3E SoC

Improvements:

- Fix some missing pins in the Qualcomm IPQ5424 TLMM

- Fix some missing LVDS pins in the Sunxi A100/A133

- Support Sunxi V853 (simple compatible string)

- Cleanups in the Samsung driver

- Fix some AMD suspend behaviour

- Cleanups"

* tag 'pinctrl-v6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (29 commits)
dt-bindings: pinctrl: sunxi: add compatible for V853
pinctrl: Use str_enable_disable-like helpers
dt-bindings: pinctrl: Correct indentation and style in DTS example
pinctrl: amd: Take suspend type into consideration which pins are non-wake
pinctrl: stm32: Add check for clk_enable()
pinctrl: renesas: rzg2l: Fix PFC_MASK for RZ/V2H and RZ/G3E
pinctrl: sunxi: add missed lvds pins for a100/a133
pinctrl: mediatek: Drop mtk_pinconf_bias_set_pd()
pinctrl: renesas: rzg2l: Add support for RZ/G3E SoC
pinctrl: renesas: rzg2l: Update r9a09g057_variable_pin_cfg table
dt-bindings: pinctrl: renesas: Document RZ/G3E SoC
dt-bindings: pinctrl: renesas: Add alpha-numerical port support for RZ/V2H
pinctrl: rockchip: add rk3562 support
dt-bindings: pinctrl: Add rk3562 pinctrl support
pinctrl: Fix the clean up on pinconf_apply_setting failure
dt-bindings: pinctrl: add binding for MT7988 SoC
pinctrl: mediatek: add MT7988 pinctrl driver
pinctrl: mediatek: add support for MTK_PULL_PD_TYPE
pinctrl: ocelot: Constify some structures
pinctrl: renesas: rzg2l: Add audio clock pins on RZ/G3S
...

+4789 -287
+13
Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
··· 44 44 - allwinner,sun8i-r40-pinctrl 45 45 - allwinner,sun8i-v3-pinctrl 46 46 - allwinner,sun8i-v3s-pinctrl 47 + - allwinner,sun8i-v853-pinctrl 47 48 - allwinner,sun9i-a80-pinctrl 48 49 - allwinner,sun9i-a80-r-pinctrl 49 50 - allwinner,sun20i-d1-pinctrl ··· 179 178 interrupts: 180 179 minItems: 7 181 180 maxItems: 7 181 + 182 + - if: 183 + properties: 184 + compatible: 185 + enum: 186 + - allwinner,sun8i-v853-pinctrl 187 + 188 + then: 189 + properties: 190 + interrupts: 191 + minItems: 8 192 + maxItems: 8 182 193 183 194 - if: 184 195 properties:
+32 -32
Documentation/devicetree/bindings/pinctrl/atmel,at91rm9200-pinctrl.yaml
··· 145 145 146 146 examples: 147 147 - | 148 - #include <dt-bindings/clock/at91.h> 149 - #include <dt-bindings/interrupt-controller/irq.h> 150 - #include <dt-bindings/pinctrl/at91.h> 148 + #include <dt-bindings/clock/at91.h> 149 + #include <dt-bindings/interrupt-controller/irq.h> 150 + #include <dt-bindings/pinctrl/at91.h> 151 151 152 - pinctrl@fffff400 { 153 - #address-cells = <1>; 154 - #size-cells = <1>; 155 - compatible = "atmel,at91rm9200-pinctrl", "simple-mfd"; 156 - ranges = <0xfffff400 0xfffff400 0x600>; 152 + pinctrl@fffff400 { 153 + #address-cells = <1>; 154 + #size-cells = <1>; 155 + compatible = "atmel,at91rm9200-pinctrl", "simple-mfd"; 156 + ranges = <0xfffff400 0xfffff400 0x600>; 157 157 158 - atmel,mux-mask = < 159 - /* A B */ 160 - 0xffffffff 0xffc00c3b /* pioA */ 161 - 0xffffffff 0x7fff3ccf /* pioB */ 162 - 0xffffffff 0x007fffff /* pioC */ 163 - >; 158 + atmel,mux-mask = < 159 + /* A B */ 160 + 0xffffffff 0xffc00c3b /* pioA */ 161 + 0xffffffff 0x7fff3ccf /* pioB */ 162 + 0xffffffff 0x007fffff /* pioC */ 163 + >; 164 164 165 - dbgu { 166 - pinctrl_dbgu: dbgu-0 { 167 - atmel,pins = 168 - <AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP 169 - AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; 170 - }; 171 - }; 165 + dbgu { 166 + dbgu-0 { 167 + atmel,pins = 168 + <AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP 169 + AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; 170 + }; 171 + }; 172 172 173 - pioA: gpio@fffff400 { 174 - compatible = "atmel,at91rm9200-gpio"; 175 - reg = <0xfffff400 0x200>; 176 - interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>; 177 - #gpio-cells = <2>; 178 - gpio-controller; 179 - interrupt-controller; 180 - #interrupt-cells = <2>; 181 - clocks = <&pmc PMC_TYPE_PERIPHERAL 2>; 182 - }; 183 - }; 173 + gpio@fffff400 { 174 + compatible = "atmel,at91rm9200-gpio"; 175 + reg = <0xfffff400 0x200>; 176 + interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>; 177 + #gpio-cells = <2>; 178 + gpio-controller; 179 + interrupt-controller; 180 + #interrupt-cells = <2>; 181 + clocks = <&pmc PMC_TYPE_PERIPHERAL 2>; 182 + }; 183 + }; 184 184 ...
+575
Documentation/devicetree/bindings/pinctrl/mediatek,mt7988-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/mediatek,mt7988-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MediaTek MT7988 Pin Controller 8 + 9 + maintainers: 10 + - Sean Wang <sean.wang@kernel.org> 11 + 12 + description: 13 + The MediaTek's MT7988 Pin controller is used to control SoC pins. 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - mediatek,mt7988-pinctrl 19 + 20 + reg: 21 + minItems: 7 22 + maxItems: 7 23 + 24 + reg-names: 25 + items: 26 + - const: gpio 27 + - const: iocfg_tr 28 + - const: iocfg_br 29 + - const: iocfg_rb 30 + - const: iocfg_lb 31 + - const: iocfg_tl 32 + - const: eint 33 + 34 + gpio-controller: true 35 + 36 + "#gpio-cells": 37 + const: 2 38 + 39 + gpio-ranges: 40 + minItems: 1 41 + maxItems: 5 42 + description: 43 + GPIO valid number range. 44 + 45 + interrupt-controller: true 46 + 47 + interrupts: 48 + maxItems: 1 49 + 50 + "#interrupt-cells": 51 + const: 2 52 + 53 + allOf: 54 + - $ref: pinctrl.yaml# 55 + 56 + required: 57 + - compatible 58 + - reg 59 + - reg-names 60 + - gpio-controller 61 + - "#gpio-cells" 62 + 63 + patternProperties: 64 + '-pins$': 65 + type: object 66 + additionalProperties: false 67 + 68 + properties: 69 + mux: 70 + type: object 71 + additionalProperties: false 72 + $ref: /schemas/pinctrl/pinmux-node.yaml 73 + description: | 74 + pinmux configuration nodes. 75 + 76 + The following table shows the effective values of "group", "function" 77 + properties and chip pinout pins 78 + 79 + groups function pins (in pin#) 80 + --------------------------------------------------------------------- 81 + "tops_jtag0_0" "jtag" 0, 1, 2, 3, 4 82 + "wo0_jtag" "jtag" 50, 51, 52, 53, 54 83 + "wo1_jtag" "jtag" 50, 51, 52, 53, 54 84 + "wo2_jtag" "jtag" 50, 51, 52, 53, 54 85 + "jtag" "jtag" 58, 59, 60, 61, 62 86 + "tops_jtag0_1" "jtag" 58, 59, 60, 61, 62 87 + "int_usxgmii" "int_usxgmii" 2, 3 88 + "pwm0" "pwm" 57 89 + "pwm1" "pwm" 21 90 + "pwm2" "pwm" 80 91 + "pwm2_0" "pwm" 58 92 + "pwm3" "pwm" 81 93 + "pwm3_0" "pwm" 59 94 + "pwm4" "pwm" 82 95 + "pwm4_0" "pwm" 60 96 + "pwm5" "pwm" 83 97 + "pwm5_0" "pwm" 61 98 + "pwm6" "pwm" 69 99 + "pwm6_0" "pwm" 62 100 + "pwm7" "pwm" 70 101 + "pwm7_0" "pwm" 4 102 + "dfd" "dfd" 0, 1, 2, 3, 4 103 + "xfi_phy0_i2c0" "i2c" 0, 1 104 + "xfi_phy1_i2c0" "i2c" 0, 1 105 + "xfi_phy_pll_i2c0" "i2c" 3, 4 106 + "xfi_phy_pll_i2c1" "i2c" 3, 4 107 + "i2c0_0" "i2c" 5, 6 108 + "i2c1_sfp" "i2c" 5, 6 109 + "xfi_pextp_phy0_i2c" "i2c" 5, 6 110 + "xfi_pextp_phy1_i2c" "i2c" 5, 6 111 + "i2c0_1" "i2c" 15, 16 112 + "u30_phy_i2c0" "i2c" 15, 16 113 + "u32_phy_i2c0" "i2c" 15, 16 114 + "xfi_phy0_i2c1" "i2c" 15, 16 115 + "xfi_phy1_i2c1" "i2c" 15, 16 116 + "xfi_phy_pll_i2c2" "i2c" 15, 16 117 + "i2c1_0" "i2c" 17, 18 118 + "u30_phy_i2c1" "i2c" 17, 18 119 + "u32_phy_i2c1" "i2c" 17, 18 120 + "xfi_phy_pll_i2c3" "i2c" 17, 18 121 + "sgmii0_i2c" "i2c" 17, 18 122 + "sgmii1_i2c" "i2c" 17, 18 123 + "i2c1_2" "i2c" 69, 70 124 + "i2c2_0" "i2c" 69, 70 125 + "i2c2_1" "i2c" 71, 72 126 + "mdc_mdio0" "eth" 5, 6 127 + "2p5g_ext_mdio" "eth" 28, 29 128 + "gbe_ext_mdio" "eth" 30, 31 129 + "mdc_mdio1" "eth" 69, 70 130 + "pcie_wake_n0_0" "pcie" 7 131 + "pcie_clk_req_n0_0" "pcie" 8 132 + "pcie_wake_n3_0" "pcie" 9 133 + "pcie_clk_req_n3" "pcie" 10 134 + "pcie_clk_req_n0_1" "pcie" 10 135 + "pcie_p0_phy_i2c" "pcie" 7, 8 136 + "pcie_p1_phy_i2c" "pcie" 7, 8 137 + "pcie_p3_phy_i2c" "pcie" 9, 10 138 + "pcie_p2_phy_i2c" "pcie" 7, 8 139 + "ckm_phy_i2c" "pcie" 9, 10 140 + "pcie_wake_n0_1" "pcie" 13 141 + "pcie_wake_n3_1" "pcie" 14 142 + "pcie_2l_0_pereset" "pcie" 19 143 + "pcie_1l_1_pereset" "pcie" 20 144 + "pcie_clk_req_n2_1" "pcie" 63 145 + "pcie_2l_1_pereset" "pcie" 73 146 + "pcie_1l_0_pereset" "pcie" 74 147 + "pcie_wake_n1_0" "pcie" 75 148 + "pcie_clk_req_n1" "pcie" 76 149 + "pcie_wake_n2_0" "pcie" 77 150 + "pcie_clk_req_n2_0" "pcie" 78 151 + "pcie_wake_n2_1" "pcie" 79 152 + "pmic" "pmic" 11 153 + "watchdog" "watchdog" 12 154 + "spi0_wp_hold" "spi" 22, 23 155 + "spi0" "spi" 24, 25, 26, 27 156 + "spi1" "spi" 28, 29, 30, 31 157 + "spi2" "spi" 32, 33, 34, 35 158 + "spi2_wp_hold" "spi" 36, 37 159 + "snfi" "flash" 22, 23, 24, 25, 26, 27 160 + "emmc_45" "flash" 21, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 161 + "sdcard" "flash" 32, 33, 34, 35, 36, 37 162 + "emmc_51" "flash" 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 163 + "uart2" "uart" 0, 1, 2, 3 164 + "tops_uart0_0" "uart" 22, 23 165 + "uart2_0" "uart" 28, 29, 30, 31 166 + "uart1_0" "uart" 32, 33, 34, 35 167 + "uart2_1" "uart" 32, 33, 34, 35 168 + "net_wo0_uart_txd_0" "uart" 28 169 + "net_wo1_uart_txd_0" "uart" 29 170 + "net_wo2_uart_txd_0" "uart" 30 171 + "tops_uart1_0" "uart" 28, 29 172 + "tops_uart0_1" "uart" 30, 31 173 + "tops_uart1_1" "uart" 36, 37 174 + "uart0" "uart" 55, 56 175 + "tops_uart0_2" "uart" 55, 56 176 + "uart2_2" "uart" 50, 51, 52, 53 177 + "uart1_1" "uart" 58, 59, 60, 61 178 + "uart2_3" "uart" 58, 59, 60, 61 179 + "uart1_2" "uart" 80, 81, 82, 83 180 + "uart1_2_lite" "uart" 80, 81 181 + "tops_uart1_2" "uart" 80, 81 182 + "net_wo0_uart_txd_1" "uart" 80 183 + "net_wo1_uart_txd_1" "uart" 81 184 + "net_wo2_uart_txd_1" "uart" 82 185 + "udi" "udi" 32, 33, 34, 35, 36 186 + "i2s" "audio" 50, 51, 52, 53, 54 187 + "pcm" "audio" 50, 51, 52, 53 188 + "gbe0_led1" "led" 58 189 + "gbe1_led1" "led" 59 190 + "gbe2_led1" "led" 60 191 + "gbe3_led1" "led" 61 192 + "2p5gbe_led1" "led" 62 193 + "gbe0_led0" "led" 64 194 + "gbe1_led0" "led" 65 195 + "gbe2_led0" "led" 66 196 + "gbe3_led0" "led" 67 197 + "2p5gbe_led0" "led" 68 198 + "drv_vbus_p1" "usb" 63 199 + "drv_vbus" "usb" 79 200 + 201 + properties: 202 + function: 203 + description: 204 + A string containing the name of the function to mux to the group. 205 + enum: [audio, dfd, eth, flash, i2c, int_usxgmii, jtag, led, pcie, pmic, pwm, spi, 206 + uart, udi, usb, watchdog] 207 + groups: 208 + description: 209 + An array of strings. Each string contains the name of a group. 210 + 211 + required: 212 + - function 213 + - groups 214 + 215 + allOf: 216 + - if: 217 + properties: 218 + function: 219 + const: audio 220 + then: 221 + properties: 222 + groups: 223 + enum: [i2s, pcm] 224 + - if: 225 + properties: 226 + function: 227 + const: jtag 228 + then: 229 + properties: 230 + groups: 231 + enum: [jtag, tops_jtag0_0, tops_jtag0_1, wo0_jtag, wo1_jtag, wo2_jtag] 232 + - if: 233 + properties: 234 + function: 235 + const: int_usxgmii 236 + then: 237 + properties: 238 + groups: 239 + const: int_usxgmii 240 + - if: 241 + properties: 242 + function: 243 + const: dfd 244 + then: 245 + properties: 246 + groups: 247 + const: dfd 248 + - if: 249 + properties: 250 + function: 251 + const: flash 252 + then: 253 + properties: 254 + groups: 255 + enum: [emmc_45, emmc_51, sdcard, snfi] 256 + - if: 257 + properties: 258 + function: 259 + const: eth 260 + then: 261 + properties: 262 + groups: 263 + enum: [2p5g_ext_mdio, gbe_ext_mdio, mdc_mdio0, mdc_mdio1] 264 + - if: 265 + properties: 266 + function: 267 + const: i2c 268 + then: 269 + properties: 270 + groups: 271 + enum: [xfi_phy0_i2c0, xfi_phy1_i2c0, xfi_phy_pll_i2c0, 272 + xfi_phy_pll_i2c1, i2c0_0, i2c1_sfp, xfi_pextp_phy0_i2c, 273 + xfi_pextp_phy1_i2c, i2c0_1, u30_phy_i2c0, u32_phy_i2c0, 274 + xfi_phy0_i2c1, xfi_phy1_i2c1, xfi_phy_pll_i2c2, i2c1_0, 275 + u30_phy_i2c1, u32_phy_i2c1, xfi_phy_pll_i2c3, sgmii0_i2c, 276 + sgmii1_i2c, i2c1_2, i2c2_0, i2c2_1] 277 + - if: 278 + properties: 279 + function: 280 + const: led 281 + then: 282 + properties: 283 + groups: 284 + enum: [2p5gbe_led0, 2p5gbe_led1, gbe0_led0, gbe0_led1, gbe1_led0, gbe1_led1, 285 + gbe2_led0, gbe2_led1, gbe3_led0, gbe3_led1, wf5g_led0, wf5g_led1] 286 + - if: 287 + properties: 288 + function: 289 + const: pcie 290 + then: 291 + properties: 292 + groups: 293 + items: 294 + enum: [pcie_wake_n0_0, pcie_clk_req_n0_0, pcie_wake_n3_0, 295 + pcie_clk_req_n3, pcie_p0_phy_i2c, pcie_p1_phy_i2c, 296 + pcie_p3_phy_i2c, pcie_p2_phy_i2c, ckm_phy_i2c, 297 + pcie_wake_n0_1, pcie_wake_n3_1, pcie_2l_0_pereset, 298 + pcie_1l_1_pereset, pcie_clk_req_n2_1, pcie_2l_1_pereset, 299 + pcie_1l_0_pereset, pcie_wake_n1_0, pcie_clk_req_n1, 300 + pcie_wake_n2_0, pcie_clk_req_n2_0, pcie_wake_n2_1, 301 + pcie_clk_req_n0_1] 302 + maxItems: 3 303 + - if: 304 + properties: 305 + function: 306 + const: pmic 307 + then: 308 + properties: 309 + groups: 310 + const: pmic 311 + - if: 312 + properties: 313 + function: 314 + const: pwm 315 + then: 316 + properties: 317 + groups: 318 + items: 319 + enum: [pwm0, pwm1, pwm2, pwm2_0, pwm3, pwm3_0, pwm4, pwm4_0, pwm5, pwm5_0, 320 + pwm6, pwm6_0, pwm7, pwm7_0] 321 + maxItems: 2 322 + - if: 323 + properties: 324 + function: 325 + const: spi 326 + then: 327 + properties: 328 + groups: 329 + items: 330 + enum: [spi0, spi0_wp_hold, spi1, spi2, spi2_wp_hold] 331 + maxItems: 2 332 + - if: 333 + properties: 334 + function: 335 + const: uart 336 + then: 337 + properties: 338 + groups: 339 + items: 340 + enum: [net_wo0_uart_txd_0, net_wo0_uart_txd_1, net_wo1_uart_txd_0, 341 + net_wo1_uart_txd_1, net_wo2_uart_txd_0, net_wo2_uart_txd_1, 342 + tops_uart0_0, tops_uart0_1, tops_uart0_2, tops_uart1_0, 343 + tops_uart1_1, tops_uart1_2, uart0, uart1_0, uart1_1, uart1_2, 344 + uart1_2_lite, uart2, uart2_0, uart2_1, uart2_3] 345 + maxItems: 2 346 + - if: 347 + properties: 348 + function: 349 + const: watchdog 350 + then: 351 + properties: 352 + groups: 353 + const: watchdog 354 + - if: 355 + properties: 356 + function: 357 + const: udi 358 + then: 359 + properties: 360 + groups: 361 + const: udi 362 + - if: 363 + properties: 364 + function: 365 + const: usb 366 + then: 367 + properties: 368 + groups: 369 + items: 370 + enum: [drv_vbus, drv_vbus_p1] 371 + maxItems: 1 372 + 373 + patternProperties: 374 + '^conf(-[-a-z]*)?$': 375 + type: object 376 + additionalProperties: false 377 + description: 378 + pinconf configuration nodes. 379 + $ref: /schemas/pinctrl/pincfg-node.yaml 380 + 381 + properties: 382 + pins: 383 + description: 384 + An array of strings. Each string contains the name of a pin. 385 + items: 386 + enum: [UART2_RXD, UART2_TXD, UART2_CTS, UART2_RTS, GPIO_A, SMI_0_MDC, 387 + SMI_0_MDIO, PCIE30_2L_0_WAKE_N, PCIE30_2L_0_CLKREQ_N, 388 + PCIE30_1L_1_WAKE_N, PCIE30_1L_1_CLKREQ_N, GPIO_P, WATCHDOG, 389 + GPIO_RESET, GPIO_WPS, PMIC_I2C_SCL, PMIC_I2C_SDA, I2C_1_SCL, 390 + I2C_1_SDA, PCIE30_2L_0_PRESET_N, PCIE30_1L_1_PRESET_N, PWMD1, 391 + SPI0_WP, SPI0_HOLD, SPI0_CSB, SPI0_MISO, SPI0_MOSI, SPI0_CLK, 392 + SPI1_CSB, SPI1_MISO, SPI1_MOSI, SPI1_CLK, SPI2_CLK, SPI2_MOSI, 393 + SPI2_MISO, SPI2_CSB, SPI2_HOLD, SPI2_WP, EMMC_RSTB, EMMC_DSL, 394 + EMMC_CK, EMMC_CMD, EMMC_DATA_7, EMMC_DATA_6, EMMC_DATA_5, 395 + EMMC_DATA_4, EMMC_DATA_3, EMMC_DATA_2, EMMC_DATA_1, 396 + EMMC_DATA_0, PCM_FS_I2S_LRCK, PCM_CLK_I2S_BCLK, 397 + PCM_DRX_I2S_DIN, PCM_DTX_I2S_DOUT, PCM_MCK_I2S_MCLK, 398 + UART0_RXD, UART0_TXD, PWMD0, JTAG_JTDI, JTAG_JTDO, JTAG_JTMS, 399 + JTAG_JTCLK, JTAG_JTRST_N, USB_DRV_VBUS_P1, LED_A, LED_B, LED_C, 400 + LED_D, LED_E, GPIO_B, GPIO_C, I2C_2_SCL, I2C_2_SDA, 401 + PCIE30_2L_1_PRESET_N, PCIE30_1L_0_PRESET_N, 402 + PCIE30_2L_1_WAKE_N, PCIE30_2L_1_CLKREQ_N, 403 + PCIE30_1L_0_WAKE_N, PCIE30_1L_0_CLKREQ_N, USB_DRV_VBUS_P0, 404 + UART1_RXD, UART1_TXD, UART1_CTS, UART1_RTS] 405 + maxItems: 84 406 + 407 + bias-disable: true 408 + 409 + bias-pull-up: 410 + oneOf: 411 + - type: boolean 412 + description: normal pull up. 413 + - enum: [100, 101, 102, 103] 414 + description: 415 + PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0 defines in 416 + dt-bindings/pinctrl/mt65xx.h. 417 + 418 + bias-pull-down: 419 + oneOf: 420 + - type: boolean 421 + description: normal pull down. 422 + - enum: [100, 101, 102, 103] 423 + description: 424 + PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0 defines in 425 + dt-bindings/pinctrl/mt65xx.h. 426 + 427 + input-enable: true 428 + 429 + input-disable: true 430 + 431 + output-enable: true 432 + 433 + output-low: true 434 + 435 + output-high: true 436 + 437 + input-schmitt-enable: true 438 + 439 + input-schmitt-disable: true 440 + 441 + drive-strength: 442 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 443 + 444 + mediatek,pull-up-adv: 445 + description: | 446 + Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3' 447 + Pull up settings for 2 pull resistors, R0 and R1. Valid arguments 448 + are described as below: 449 + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 450 + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 451 + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 452 + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 453 + $ref: /schemas/types.yaml#/definitions/uint32 454 + enum: [0, 1, 2, 3] 455 + 456 + mediatek,pull-down-adv: 457 + description: | 458 + Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3' 459 + Pull down settings for 2 pull resistors, R0 and R1. Valid arguments 460 + are described as below: 461 + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 462 + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 463 + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 464 + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 465 + $ref: /schemas/types.yaml#/definitions/uint32 466 + enum: [0, 1, 2, 3] 467 + 468 + required: 469 + - pins 470 + 471 + additionalProperties: false 472 + 473 + examples: 474 + - | 475 + #include <dt-bindings/interrupt-controller/irq.h> 476 + #include <dt-bindings/interrupt-controller/arm-gic.h> 477 + #include <dt-bindings/pinctrl/mt65xx.h> 478 + 479 + soc { 480 + #address-cells = <2>; 481 + #size-cells = <2>; 482 + 483 + pio: pinctrl@1001f000 { 484 + compatible = "mediatek,mt7988-pinctrl"; 485 + reg = <0 0x1001f000 0 0x1000>, 486 + <0 0x11c10000 0 0x1000>, 487 + <0 0x11d00000 0 0x1000>, 488 + <0 0x11d20000 0 0x1000>, 489 + <0 0x11e00000 0 0x1000>, 490 + <0 0x11f00000 0 0x1000>, 491 + <0 0x1000b000 0 0x1000>; 492 + reg-names = "gpio", "iocfg_tr", 493 + "iocfg_br", "iocfg_rb", 494 + "iocfg_lb", "iocfg_tl", "eint"; 495 + gpio-controller; 496 + #gpio-cells = <2>; 497 + gpio-ranges = <&pio 0 0 84>; 498 + interrupt-controller; 499 + interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; 500 + interrupt-parent = <&gic>; 501 + #interrupt-cells = <2>; 502 + 503 + i2c0_pins: i2c0-g0-pins { 504 + mux { 505 + function = "i2c"; 506 + groups = "i2c0_1"; 507 + }; 508 + }; 509 + 510 + mdio0_pins: mdio0-pins { 511 + mux { 512 + function = "eth"; 513 + groups = "mdc_mdio0"; 514 + }; 515 + 516 + conf { 517 + pins = "SMI_0_MDC", "SMI_0_MDIO"; 518 + drive-strength = <8>; 519 + }; 520 + }; 521 + 522 + mmc0_pins_emmc_51: mmc0-emmc-51-pins { 523 + mux { 524 + function = "flash"; 525 + groups = "emmc_51"; 526 + }; 527 + }; 528 + 529 + mmc0_pins_sdcard: mmc0-sdcard-pins { 530 + mux { 531 + function = "flash"; 532 + groups = "sdcard"; 533 + }; 534 + }; 535 + 536 + pcie0_pins: pcie0-pins { 537 + mux { 538 + function = "pcie"; 539 + groups = "pcie_2l_0_pereset", "pcie_clk_req_n0_0", 540 + "pcie_wake_n0_0"; 541 + }; 542 + }; 543 + 544 + pcie1_pins: pcie1-pins { 545 + mux { 546 + function = "pcie"; 547 + groups = "pcie_2l_1_pereset", "pcie_clk_req_n1", 548 + "pcie_wake_n1_0"; 549 + }; 550 + }; 551 + 552 + pcie2_pins: pcie2-pins { 553 + mux { 554 + function = "pcie"; 555 + groups = "pcie_1l_0_pereset", "pcie_clk_req_n2_0", 556 + "pcie_wake_n2_0"; 557 + }; 558 + }; 559 + 560 + pcie3_pins: pcie3-pins { 561 + mux { 562 + function = "pcie"; 563 + groups = "pcie_1l_1_pereset", "pcie_clk_req_n3", 564 + "pcie_wake_n3_0"; 565 + }; 566 + }; 567 + 568 + uart0_pins: uart0-pins { 569 + mux { 570 + function = "uart"; 571 + groups = "uart0"; 572 + }; 573 + }; 574 + }; 575 + };
+2 -2
Documentation/devicetree/bindings/pinctrl/qcom,ipq5424-tlmm.yaml
··· 79 79 qdss_cti_trig_out_b0, qdss_cti_trig_in_b1, qdss_cti_trig_out_b1, 80 80 qdss_traceclk_a, qdss_tracectl_a, qdss_tracedata_a, qspi_clk, 81 81 qspi_cs, qspi_data, resout, rx0, rx1, rx2, sdc_clk, sdc_cmd, 82 - sdc_data, spi0, spi1, spi10, spi11, tsens_max, uart0, uart1, 83 - wci_txd, wci_rxd, wsi_clk, wsi_data ] 82 + sdc_data, spi0_cs, spi0_clk, spi0_miso, spi0_mosi, spi1, spi10, 83 + spi11, tsens_max, uart0, uart1, wci_txd, wci_rxd, wsi_clk, wsi_data ] 84 84 85 85 required: 86 86 - pins
+160
Documentation/devicetree/bindings/pinctrl/qcom,msm8917-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/qcom,msm8917-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm MSM8917 TLMM pin controller 8 + 9 + maintainers: 10 + - Barnabas Czeman <barnabas.czeman@mainlining.org> 11 + 12 + description: 13 + Top Level Mode Multiplexer pin controller in Qualcomm MSM8917 SoC. 14 + 15 + properties: 16 + compatible: 17 + const: qcom,msm8917-pinctrl 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + gpio-reserved-ranges: 26 + minItems: 1 27 + maxItems: 66 28 + 29 + gpio-line-names: 30 + maxItems: 134 31 + 32 + patternProperties: 33 + "-state$": 34 + oneOf: 35 + - $ref: "#/$defs/qcom-msm8917-tlmm-state" 36 + - patternProperties: 37 + "-pins$": 38 + $ref: "#/$defs/qcom-msm8917-tlmm-state" 39 + additionalProperties: false 40 + 41 + $defs: 42 + qcom-msm8917-tlmm-state: 43 + type: object 44 + description: 45 + Pinctrl node's client devices use subnodes for desired pin configuration. 46 + Client device subnodes use below standard properties. 47 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 48 + unevaluatedProperties: false 49 + 50 + properties: 51 + pins: 52 + description: 53 + List of gpio pins affected by the properties specified in this 54 + subnode. 55 + items: 56 + oneOf: 57 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-2][0-9]|13[0-3])$" 58 + - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk, sdc2_clk, 59 + sdc2_cmd, sdc2_data, qdsd_clk, qdsd_cmd, qdsd_data0, 60 + qdsd_data1, qdsd_data2, qdsd_data3 ] 61 + minItems: 1 62 + maxItems: 16 63 + 64 + function: 65 + description: 66 + Specify the alternative function to be configured for the specified 67 + pins. 68 + 69 + enum: [ accel_int, adsp_ext, alsp_int, atest_bbrx0, atest_bbrx1, 70 + atest_char, atest_char0, atest_char1, atest_char2, 71 + atest_char3, atest_combodac_to_gpio_native, 72 + atest_gpsadc_dtest0_native, atest_gpsadc_dtest1_native, 73 + atest_tsens, atest_wlan0, atest_wlan1, audio_ref, 74 + audio_reset, bimc_dte0, bimc_dte1, blsp6_spi, blsp8_spi, 75 + blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5, 76 + blsp_i2c6, blsp_i2c7, blsp_i2c8, blsp_spi1, blsp_spi2, 77 + blsp_spi3, blsp_spi4, blsp_spi5, blsp_spi6, blsp_spi7, 78 + blsp_spi8, blsp_uart1, blsp_uart2, blsp_uart3, blsp_uart4, 79 + blsp_uart5, blsp_uart6, blsp_uart7, blsp_uart8, cam0_ldo, 80 + cam1_rst, cam1_standby, cam2_rst, cam2_standby, cam_mclk, 81 + cci_async, cci_i2c, cci_timer0, cci_timer1, cdc_pdm0, 82 + codec_int1, codec_int2, codec_mad, coex_uart, cri_trng, 83 + cri_trng0, cri_trng1, dbg_out, dmic0_clk, dmic0_data, 84 + ebi_cdc, ebi_ch0, ext_lpass, forced_usb, fp_gpio, fp_int, 85 + gcc_gp1_clk_a, gcc_gp1_clk_b, gcc_gp2_clk_a, gcc_gp2_clk_b, 86 + gcc_gp3_clk_a, gcc_gp3_clk_b, gcc_plltest, gcc_tlmm, gpio, 87 + gsm0_tx, key_focus, key_snapshot, key_volp, ldo_en, 88 + ldo_update, lpass_slimbus, lpass_slimbus0, lpass_slimbus1, 89 + m_voc, mag_int, mdp_vsync, mipi_dsi0, modem_tsync, nav_pps, 90 + nav_pps_in_a, nav_pps_in_b, nav_tsync, nfc_pwr, ov_ldo, 91 + pa_indicator, pbs0, pbs1, pbs2, pri_mi2s, pri_mi2s_mclk_a, 92 + pri_mi2s_mclk_b, pri_mi2s_ws, prng_rosc, 93 + pwr_crypto_enabled_a, pwr_crypto_enabled_b, 94 + pwr_modem_enabled_a, pwr_modem_enabled_b, pwr_nav_enabled_a, 95 + pwr_nav_enabled_b, qdss_cti_trig_in_a0, qdss_cti_trig_in_a1, 96 + qdss_cti_trig_in_b0, qdss_cti_trig_in_b1, 97 + qdss_cti_trig_out_a0, qdss_cti_trig_out_a1, 98 + qdss_cti_trig_out_b0, qdss_cti_trig_out_b1, qdss_traceclk_a, 99 + qdss_traceclk_b, qdss_tracectl_a, qdss_tracectl_b, 100 + qdss_tracedata_a, qdss_tracedata_b, sd_write, sdcard_det, 101 + sec_mi2s, sec_mi2s_mclk_a, sec_mi2s_mclk_b, sensor_rst, 102 + smb_int, ssbi_wtr1, ts_resout, ts_sample, uim1_clk, 103 + uim1_data, uim1_present, uim1_reset, uim2_clk, uim2_data, 104 + uim2_present, uim2_reset, uim_batt, us_emitter, us_euro, 105 + wcss_bt, wcss_fm, wcss_wlan, wcss_wlan0, wcss_wlan1, 106 + wcss_wlan2, webcam_rst, webcam_standby, wsa_io, wsa_irq ] 107 + 108 + required: 109 + - pins 110 + 111 + allOf: 112 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 113 + 114 + required: 115 + - compatible 116 + - reg 117 + 118 + unevaluatedProperties: false 119 + 120 + examples: 121 + - | 122 + #include <dt-bindings/interrupt-controller/arm-gic.h> 123 + 124 + tlmm: pinctrl@1000000 { 125 + compatible = "qcom,msm8917-pinctrl"; 126 + reg = <0x01000000 0x300000>; 127 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 128 + gpio-controller; 129 + gpio-ranges = <&tlmm 0 0 134>; 130 + #gpio-cells = <2>; 131 + interrupt-controller; 132 + #interrupt-cells = <2>; 133 + 134 + blsp1-uart2-sleep-state { 135 + pins = "gpio4", "gpio5"; 136 + function = "gpio"; 137 + 138 + drive-strength = <2>; 139 + bias-pull-down; 140 + }; 141 + 142 + spi1-default-state { 143 + spi-pins { 144 + pins = "gpio0", "gpio1", "gpio3"; 145 + function = "blsp_spi1"; 146 + 147 + drive-strength = <12>; 148 + bias-disable; 149 + }; 150 + 151 + cs-pins { 152 + pins = "gpio2"; 153 + function = "gpio"; 154 + 155 + drive-strength = <16>; 156 + bias-disable; 157 + output-high; 158 + }; 159 + }; 160 + };
+25 -25
Documentation/devicetree/bindings/pinctrl/realtek,rtd1315e-pinctrl.yaml
··· 159 159 160 160 examples: 161 161 - | 162 - pinctrl@4e000 { 163 - compatible = "realtek,rtd1315e-pinctrl"; 164 - reg = <0x4e000 0x130>; 162 + pinctrl@4e000 { 163 + compatible = "realtek,rtd1315e-pinctrl"; 164 + reg = <0x4e000 0x130>; 165 165 166 - emmc-hs200-pins { 167 - pins = "emmc_clk", 168 - "emmc_cmd", 169 - "emmc_data_0", 170 - "emmc_data_1", 171 - "emmc_data_2", 172 - "emmc_data_3", 173 - "emmc_data_4", 174 - "emmc_data_5", 175 - "emmc_data_6", 176 - "emmc_data_7"; 177 - function = "emmc"; 178 - realtek,drive-strength-p = <0x2>; 179 - realtek,drive-strength-n = <0x2>; 180 - }; 166 + emmc-hs200-pins { 167 + pins = "emmc_clk", 168 + "emmc_cmd", 169 + "emmc_data_0", 170 + "emmc_data_1", 171 + "emmc_data_2", 172 + "emmc_data_3", 173 + "emmc_data_4", 174 + "emmc_data_5", 175 + "emmc_data_6", 176 + "emmc_data_7"; 177 + function = "emmc"; 178 + realtek,drive-strength-p = <0x2>; 179 + realtek,drive-strength-n = <0x2>; 180 + }; 181 181 182 - i2c-0-pins { 183 - pins = "gpio_12", 184 - "gpio_13"; 185 - function = "i2c0"; 186 - drive-strength = <4>; 187 - }; 188 - }; 182 + i2c-0-pins { 183 + pins = "gpio_12", 184 + "gpio_13"; 185 + function = "i2c0"; 186 + drive-strength = <4>; 187 + }; 188 + };
+25 -25
Documentation/devicetree/bindings/pinctrl/realtek,rtd1319d-pinctrl.yaml
··· 158 158 159 159 examples: 160 160 - | 161 - pinctrl@4e000 { 162 - compatible = "realtek,rtd1319d-pinctrl"; 163 - reg = <0x4e000 0x130>; 161 + pinctrl@4e000 { 162 + compatible = "realtek,rtd1319d-pinctrl"; 163 + reg = <0x4e000 0x130>; 164 164 165 - emmc-hs200-pins { 166 - pins = "emmc_clk", 167 - "emmc_cmd", 168 - "emmc_data_0", 169 - "emmc_data_1", 170 - "emmc_data_2", 171 - "emmc_data_3", 172 - "emmc_data_4", 173 - "emmc_data_5", 174 - "emmc_data_6", 175 - "emmc_data_7"; 176 - function = "emmc"; 177 - realtek,drive-strength-p = <0x2>; 178 - realtek,drive-strength-n = <0x2>; 179 - }; 165 + emmc-hs200-pins { 166 + pins = "emmc_clk", 167 + "emmc_cmd", 168 + "emmc_data_0", 169 + "emmc_data_1", 170 + "emmc_data_2", 171 + "emmc_data_3", 172 + "emmc_data_4", 173 + "emmc_data_5", 174 + "emmc_data_6", 175 + "emmc_data_7"; 176 + function = "emmc"; 177 + realtek,drive-strength-p = <0x2>; 178 + realtek,drive-strength-n = <0x2>; 179 + }; 180 180 181 - i2c-0-pins { 182 - pins = "gpio_12", 183 - "gpio_13"; 184 - function = "i2c0"; 185 - drive-strength = <4>; 186 - }; 187 - }; 181 + i2c-0-pins { 182 + pins = "gpio_12", 183 + "gpio_13"; 184 + function = "i2c0"; 185 + drive-strength = <4>; 186 + }; 187 + };
+25 -25
Documentation/devicetree/bindings/pinctrl/realtek,rtd1619b-pinctrl.yaml
··· 157 157 158 158 examples: 159 159 - | 160 - pinctrl@4e000 { 161 - compatible = "realtek,rtd1619b-pinctrl"; 162 - reg = <0x4e000 0x130>; 160 + pinctrl@4e000 { 161 + compatible = "realtek,rtd1619b-pinctrl"; 162 + reg = <0x4e000 0x130>; 163 163 164 - emmc-hs200-pins { 165 - pins = "emmc_clk", 166 - "emmc_cmd", 167 - "emmc_data_0", 168 - "emmc_data_1", 169 - "emmc_data_2", 170 - "emmc_data_3", 171 - "emmc_data_4", 172 - "emmc_data_5", 173 - "emmc_data_6", 174 - "emmc_data_7"; 175 - function = "emmc"; 176 - realtek,drive-strength-p = <0x2>; 177 - realtek,drive-strength-n = <0x2>; 178 - }; 164 + emmc-hs200-pins { 165 + pins = "emmc_clk", 166 + "emmc_cmd", 167 + "emmc_data_0", 168 + "emmc_data_1", 169 + "emmc_data_2", 170 + "emmc_data_3", 171 + "emmc_data_4", 172 + "emmc_data_5", 173 + "emmc_data_6", 174 + "emmc_data_7"; 175 + function = "emmc"; 176 + realtek,drive-strength-p = <0x2>; 177 + realtek,drive-strength-n = <0x2>; 178 + }; 179 179 180 - i2c-0-pins { 181 - pins = "gpio_12", 182 - "gpio_13"; 183 - function = "i2c0"; 184 - drive-strength = <4>; 185 - }; 186 - }; 180 + i2c-0-pins { 181 + pins = "gpio_12", 182 + "gpio_13"; 183 + function = "i2c0"; 184 + drive-strength = <4>; 185 + }; 186 + };
+5 -2
Documentation/devicetree/bindings/pinctrl/renesas,rzg2l-pinctrl.yaml
··· 26 26 - renesas,r9a07g043-pinctrl # RZ/G2UL{Type-1,Type-2} and RZ/Five 27 27 - renesas,r9a07g044-pinctrl # RZ/G2{L,LC} 28 28 - renesas,r9a08g045-pinctrl # RZ/G3S 29 + - renesas,r9a09g047-pinctrl # RZ/G3E 29 30 - renesas,r9a09g057-pinctrl # RZ/V2H(P) 30 31 31 32 - items: ··· 126 125 drive-push-pull: true 127 126 renesas,output-impedance: 128 127 description: 129 - Output impedance for pins on the RZ/V2H(P) SoC. The value provided by this 128 + Output impedance for pins on the RZ/{G3E,V2H(P)} SoC. The value provided by this 130 129 property corresponds to register bit values that can be set in the PFC_IOLH_mn 131 130 register, which adjusts the drive strength value and is pin-dependent. 132 131 $ref: /schemas/types.yaml#/definitions/uint32 ··· 143 142 properties: 144 143 compatible: 145 144 contains: 146 - const: renesas,r9a09g057-pinctrl 145 + enum: 146 + - renesas,r9a09g047-pinctrl 147 + - renesas,r9a09g057-pinctrl 147 148 then: 148 149 properties: 149 150 resets:
+1
Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
··· 44 44 - rockchip,rk3328-pinctrl 45 45 - rockchip,rk3368-pinctrl 46 46 - rockchip,rk3399-pinctrl 47 + - rockchip,rk3562-pinctrl 47 48 - rockchip,rk3568-pinctrl 48 49 - rockchip,rk3576-pinctrl 49 50 - rockchip,rk3588-pinctrl
+23 -30
Documentation/devicetree/bindings/pinctrl/xlnx,pinctrl-zynq.yaml
··· 180 180 examples: 181 181 - | 182 182 #include <dt-bindings/pinctrl/pinctrl-zynq.h> 183 - pinctrl0: pinctrl@700 { 184 - compatible = "xlnx,pinctrl-zynq"; 185 - reg = <0x700 0x200>; 186 - syscon = <&slcr>; 183 + pinctrl@700 { 184 + compatible = "xlnx,pinctrl-zynq"; 185 + reg = <0x700 0x200>; 186 + syscon = <&slcr>; 187 187 188 - pinctrl_uart1_default: uart1-default { 189 - mux { 190 - groups = "uart1_10_grp"; 191 - function = "uart1"; 192 - }; 188 + uart1-default { 189 + mux { 190 + groups = "uart1_10_grp"; 191 + function = "uart1"; 192 + }; 193 193 194 - conf { 195 - groups = "uart1_10_grp"; 196 - slew-rate = <0>; 197 - power-source = <IO_STANDARD_LVCMOS18>; 198 - }; 194 + conf { 195 + groups = "uart1_10_grp"; 196 + slew-rate = <0>; 197 + power-source = <IO_STANDARD_LVCMOS18>; 198 + }; 199 199 200 - conf-rx { 201 - pins = "MIO49"; 202 - bias-high-impedance; 203 - }; 200 + conf-rx { 201 + pins = "MIO49"; 202 + bias-high-impedance; 203 + }; 204 204 205 - conf-tx { 206 - pins = "MIO48"; 207 - bias-disable; 208 - }; 209 - }; 205 + conf-tx { 206 + pins = "MIO48"; 207 + bias-disable; 208 + }; 209 + }; 210 210 }; 211 - 212 - uart1 { 213 - pinctrl-names = "default"; 214 - pinctrl-0 = <&pinctrl_uart1_default>; 215 - }; 216 - 217 - ...
+2 -1
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
··· 21 21 #include <linux/pinctrl/pinctrl.h> 22 22 #include <linux/platform_device.h> 23 23 #include <linux/slab.h> 24 + #include <linux/string_choices.h> 24 25 25 26 #include "../pinctrl-utils.h" 26 27 ··· 255 254 raw_spin_unlock_irqrestore(&chip->lock, flags); 256 255 257 256 dev_dbg(chip->dev, "gpio:%u level_low:%s falling:%s\n", gpio, 258 - level_low ? "true" : "false", falling ? "true" : "false"); 257 + str_true_false(level_low), str_true_false(falling)); 259 258 return 0; 260 259 } 261 260
+2 -1
drivers/pinctrl/cirrus/pinctrl-lochnagar.c
··· 15 15 #include <linux/of.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/regmap.h> 18 + #include <linux/string_choices.h> 18 19 19 20 #include <linux/pinctrl/consumer.h> 20 21 #include <linux/pinctrl/pinconf-generic.h> ··· 1069 1068 value = !!value; 1070 1069 1071 1070 dev_dbg(priv->dev, "Set GPIO %s to %s\n", 1072 - pin->name, value ? "high" : "low"); 1071 + pin->name, str_high_low(value)); 1073 1072 1074 1073 switch (pin->type) { 1075 1074 case LN_PTYPE_MUX:
+30 -20
drivers/pinctrl/core.c
··· 1256 1256 DL_FLAG_AUTOREMOVE_CONSUMER); 1257 1257 } 1258 1258 1259 + static void pinctrl_cond_disable_mux_setting(struct pinctrl_state *state, 1260 + struct pinctrl_setting *target_setting) 1261 + { 1262 + struct pinctrl_setting *setting; 1263 + 1264 + list_for_each_entry(setting, &state->settings, node) { 1265 + if (target_setting && (&setting->node == &target_setting->node)) 1266 + break; 1267 + 1268 + if (setting->type == PIN_MAP_TYPE_MUX_GROUP) 1269 + pinmux_disable_setting(setting); 1270 + } 1271 + } 1272 + 1259 1273 /** 1260 1274 * pinctrl_commit_state() - select/activate/program a pinctrl state to HW 1261 1275 * @p: the pinctrl handle for the device that requests configuration ··· 1277 1263 */ 1278 1264 static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state) 1279 1265 { 1280 - struct pinctrl_setting *setting, *setting2; 1266 + struct pinctrl_setting *setting; 1281 1267 struct pinctrl_state *old_state = READ_ONCE(p->state); 1282 1268 int ret; 1283 1269 ··· 1288 1274 * still owned by the new state will be re-acquired by the call 1289 1275 * to pinmux_enable_setting() in the loop below. 1290 1276 */ 1291 - list_for_each_entry(setting, &old_state->settings, node) { 1292 - if (setting->type != PIN_MAP_TYPE_MUX_GROUP) 1293 - continue; 1294 - pinmux_disable_setting(setting); 1295 - } 1277 + pinctrl_cond_disable_mux_setting(old_state, NULL); 1296 1278 } 1297 1279 1298 1280 p->state = NULL; ··· 1332 1322 } 1333 1323 1334 1324 if (ret < 0) { 1335 - goto unapply_new_state; 1325 + goto unapply_mux_setting; 1336 1326 } 1337 1327 1338 1328 /* Do not link hogs (circular dependency) */ ··· 1344 1334 1345 1335 return 0; 1346 1336 1337 + unapply_mux_setting: 1338 + pinctrl_cond_disable_mux_setting(state, NULL); 1339 + goto restore_old_state; 1340 + 1347 1341 unapply_new_state: 1348 1342 dev_err(p->dev, "Error applying setting, reverse things back\n"); 1349 1343 1350 - list_for_each_entry(setting2, &state->settings, node) { 1351 - if (&setting2->node == &setting->node) 1352 - break; 1353 - /* 1354 - * All we can do here is pinmux_disable_setting. 1355 - * That means that some pins are muxed differently now 1356 - * than they were before applying the setting (We can't 1357 - * "unmux a pin"!), but it's not a big deal since the pins 1358 - * are free to be muxed by another apply_setting. 1359 - */ 1360 - if (setting2->type == PIN_MAP_TYPE_MUX_GROUP) 1361 - pinmux_disable_setting(setting2); 1362 - } 1344 + /* 1345 + * All we can do here is pinmux_disable_setting. 1346 + * That means that some pins are muxed differently now 1347 + * than they were before applying the setting (We can't 1348 + * "unmux a pin"!), but it's not a big deal since the pins 1349 + * are free to be muxed by another apply_setting. 1350 + */ 1351 + pinctrl_cond_disable_mux_setting(state, setting); 1363 1352 1353 + restore_old_state: 1364 1354 /* There's no infinite recursive loop here because p->state is NULL */ 1365 1355 if (old_state) 1366 1356 pinctrl_select_state(p, old_state);
+7
drivers/pinctrl/mediatek/Kconfig
··· 202 202 default ARM64 && ARCH_MEDIATEK 203 203 select PINCTRL_MTK_MOORE 204 204 205 + config PINCTRL_MT7988 206 + bool "Mediatek MT7988 pin control" 207 + depends on OF 208 + depends on ARM64 || COMPILE_TEST 209 + default ARM64 && ARCH_MEDIATEK 210 + select PINCTRL_MTK_MOORE 211 + 205 212 config PINCTRL_MT8167 206 213 bool "MediaTek MT8167 pin control" 207 214 depends on OF
+1
drivers/pinctrl/mediatek/Makefile
··· 28 28 obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o 29 29 obj-$(CONFIG_PINCTRL_MT7981) += pinctrl-mt7981.o 30 30 obj-$(CONFIG_PINCTRL_MT7986) += pinctrl-mt7986.o 31 + obj-$(CONFIG_PINCTRL_MT7988) += pinctrl-mt7988.o 31 32 obj-$(CONFIG_PINCTRL_MT8167) += pinctrl-mt8167.o 32 33 obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o 33 34 obj-$(CONFIG_PINCTRL_MT8183) += pinctrl-mt8183.o
+1556
drivers/pinctrl/mediatek/pinctrl-mt7988.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * The MT7988 driver based on Linux generic pinctrl binding. 4 + * 5 + * Copyright (C) 2020 MediaTek Inc. 6 + * Author: Sam Shih <sam.shih@mediatek.com> 7 + */ 8 + 9 + #include "pinctrl-moore.h" 10 + 11 + enum mt7988_pinctrl_reg_page { 12 + GPIO_BASE, 13 + IOCFG_TR_BASE, 14 + IOCFG_BR_BASE, 15 + IOCFG_RB_BASE, 16 + IOCFG_LB_BASE, 17 + IOCFG_TL_BASE, 18 + }; 19 + 20 + #define MT7988_PIN(_number, _name) MTK_PIN(_number, _name, 0, _number, DRV_GRP4) 21 + 22 + #define PIN_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \ 23 + _x_bits) \ 24 + PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \ 25 + _x_bits, 32, 0) 26 + 27 + #define PINS_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \ 28 + _x_bits) \ 29 + PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \ 30 + _x_bits, 32, 1) 31 + 32 + static const struct mtk_pin_field_calc mt7988_pin_mode_range[] = { 33 + PIN_FIELD(0, 83, 0x300, 0x10, 0, 4), 34 + }; 35 + 36 + static const struct mtk_pin_field_calc mt7988_pin_dir_range[] = { 37 + PIN_FIELD(0, 83, 0x0, 0x10, 0, 1), 38 + }; 39 + 40 + static const struct mtk_pin_field_calc mt7988_pin_di_range[] = { 41 + PIN_FIELD(0, 83, 0x200, 0x10, 0, 1), 42 + }; 43 + 44 + static const struct mtk_pin_field_calc mt7988_pin_do_range[] = { 45 + PIN_FIELD(0, 83, 0x100, 0x10, 0, 1), 46 + }; 47 + 48 + static const struct mtk_pin_field_calc mt7988_pin_ies_range[] = { 49 + PIN_FIELD_BASE(0, 0, 5, 0x30, 0x10, 13, 1), 50 + PIN_FIELD_BASE(1, 1, 5, 0x30, 0x10, 14, 1), 51 + PIN_FIELD_BASE(2, 2, 5, 0x30, 0x10, 11, 1), 52 + PIN_FIELD_BASE(3, 3, 5, 0x30, 0x10, 12, 1), 53 + PIN_FIELD_BASE(4, 4, 5, 0x30, 0x10, 0, 1), 54 + PIN_FIELD_BASE(5, 5, 5, 0x30, 0x10, 9, 1), 55 + PIN_FIELD_BASE(6, 6, 5, 0x30, 0x10, 10, 1), 56 + 57 + PIN_FIELD_BASE(7, 7, 4, 0x30, 0x10, 8, 1), 58 + PIN_FIELD_BASE(8, 8, 4, 0x30, 0x10, 6, 1), 59 + PIN_FIELD_BASE(9, 9, 4, 0x30, 0x10, 5, 1), 60 + PIN_FIELD_BASE(10, 10, 4, 0x30, 0x10, 3, 1), 61 + 62 + PIN_FIELD_BASE(11, 11, 1, 0x40, 0x10, 0, 1), 63 + PIN_FIELD_BASE(12, 12, 1, 0x40, 0x10, 21, 1), 64 + PIN_FIELD_BASE(13, 13, 1, 0x40, 0x10, 1, 1), 65 + PIN_FIELD_BASE(14, 14, 1, 0x40, 0x10, 2, 1), 66 + 67 + PIN_FIELD_BASE(15, 15, 5, 0x30, 0x10, 7, 1), 68 + PIN_FIELD_BASE(16, 16, 5, 0x30, 0x10, 8, 1), 69 + PIN_FIELD_BASE(17, 17, 5, 0x30, 0x10, 3, 1), 70 + PIN_FIELD_BASE(18, 18, 5, 0x30, 0x10, 4, 1), 71 + 72 + PIN_FIELD_BASE(19, 19, 4, 0x30, 0x10, 7, 1), 73 + PIN_FIELD_BASE(20, 20, 4, 0x30, 0x10, 4, 1), 74 + 75 + PIN_FIELD_BASE(21, 21, 3, 0x50, 0x10, 17, 1), 76 + PIN_FIELD_BASE(22, 22, 3, 0x50, 0x10, 23, 1), 77 + PIN_FIELD_BASE(23, 23, 3, 0x50, 0x10, 20, 1), 78 + PIN_FIELD_BASE(24, 24, 3, 0x50, 0x10, 19, 1), 79 + PIN_FIELD_BASE(25, 25, 3, 0x50, 0x10, 21, 1), 80 + PIN_FIELD_BASE(26, 26, 3, 0x50, 0x10, 22, 1), 81 + PIN_FIELD_BASE(27, 27, 3, 0x50, 0x10, 18, 1), 82 + PIN_FIELD_BASE(28, 28, 3, 0x50, 0x10, 25, 1), 83 + PIN_FIELD_BASE(29, 29, 3, 0x50, 0x10, 26, 1), 84 + PIN_FIELD_BASE(30, 30, 3, 0x50, 0x10, 27, 1), 85 + PIN_FIELD_BASE(31, 31, 3, 0x50, 0x10, 24, 1), 86 + PIN_FIELD_BASE(32, 32, 3, 0x50, 0x10, 28, 1), 87 + PIN_FIELD_BASE(33, 33, 3, 0x60, 0x10, 0, 1), 88 + PIN_FIELD_BASE(34, 34, 3, 0x50, 0x10, 31, 1), 89 + PIN_FIELD_BASE(35, 35, 3, 0x50, 0x10, 29, 1), 90 + PIN_FIELD_BASE(36, 36, 3, 0x50, 0x10, 30, 1), 91 + PIN_FIELD_BASE(37, 37, 3, 0x60, 0x10, 1, 1), 92 + PIN_FIELD_BASE(38, 38, 3, 0x50, 0x10, 11, 1), 93 + PIN_FIELD_BASE(39, 39, 3, 0x50, 0x10, 10, 1), 94 + PIN_FIELD_BASE(40, 40, 3, 0x50, 0x10, 0, 1), 95 + PIN_FIELD_BASE(41, 41, 3, 0x50, 0x10, 1, 1), 96 + PIN_FIELD_BASE(42, 42, 3, 0x50, 0x10, 9, 1), 97 + PIN_FIELD_BASE(43, 43, 3, 0x50, 0x10, 8, 1), 98 + PIN_FIELD_BASE(44, 44, 3, 0x50, 0x10, 7, 1), 99 + PIN_FIELD_BASE(45, 45, 3, 0x50, 0x10, 6, 1), 100 + PIN_FIELD_BASE(46, 46, 3, 0x50, 0x10, 5, 1), 101 + PIN_FIELD_BASE(47, 47, 3, 0x50, 0x10, 4, 1), 102 + PIN_FIELD_BASE(48, 48, 3, 0x50, 0x10, 3, 1), 103 + PIN_FIELD_BASE(49, 49, 3, 0x50, 0x10, 2, 1), 104 + PIN_FIELD_BASE(50, 50, 3, 0x50, 0x10, 15, 1), 105 + PIN_FIELD_BASE(51, 51, 3, 0x50, 0x10, 12, 1), 106 + PIN_FIELD_BASE(52, 52, 3, 0x50, 0x10, 13, 1), 107 + PIN_FIELD_BASE(53, 53, 3, 0x50, 0x10, 14, 1), 108 + PIN_FIELD_BASE(54, 54, 3, 0x50, 0x10, 16, 1), 109 + 110 + PIN_FIELD_BASE(55, 55, 1, 0x40, 0x10, 14, 1), 111 + PIN_FIELD_BASE(56, 56, 1, 0x40, 0x10, 15, 1), 112 + PIN_FIELD_BASE(57, 57, 1, 0x40, 0x10, 13, 1), 113 + PIN_FIELD_BASE(58, 58, 1, 0x40, 0x10, 4, 1), 114 + PIN_FIELD_BASE(59, 59, 1, 0x40, 0x10, 5, 1), 115 + PIN_FIELD_BASE(60, 60, 1, 0x40, 0x10, 6, 1), 116 + PIN_FIELD_BASE(61, 61, 1, 0x40, 0x10, 3, 1), 117 + PIN_FIELD_BASE(62, 62, 1, 0x40, 0x10, 7, 1), 118 + PIN_FIELD_BASE(63, 63, 1, 0x40, 0x10, 20, 1), 119 + PIN_FIELD_BASE(64, 64, 1, 0x40, 0x10, 8, 1), 120 + PIN_FIELD_BASE(65, 65, 1, 0x40, 0x10, 9, 1), 121 + PIN_FIELD_BASE(66, 66, 1, 0x40, 0x10, 10, 1), 122 + PIN_FIELD_BASE(67, 67, 1, 0x40, 0x10, 11, 1), 123 + PIN_FIELD_BASE(68, 68, 1, 0x40, 0x10, 12, 1), 124 + 125 + PIN_FIELD_BASE(69, 69, 5, 0x30, 0x10, 1, 1), 126 + PIN_FIELD_BASE(70, 70, 5, 0x30, 0x10, 2, 1), 127 + PIN_FIELD_BASE(71, 71, 5, 0x30, 0x10, 5, 1), 128 + PIN_FIELD_BASE(72, 72, 5, 0x30, 0x10, 6, 1), 129 + 130 + PIN_FIELD_BASE(73, 73, 4, 0x30, 0x10, 10, 1), 131 + PIN_FIELD_BASE(74, 74, 4, 0x30, 0x10, 1, 1), 132 + PIN_FIELD_BASE(75, 75, 4, 0x30, 0x10, 11, 1), 133 + PIN_FIELD_BASE(76, 76, 4, 0x30, 0x10, 9, 1), 134 + PIN_FIELD_BASE(77, 77, 4, 0x30, 0x10, 2, 1), 135 + PIN_FIELD_BASE(78, 78, 4, 0x30, 0x10, 0, 1), 136 + PIN_FIELD_BASE(79, 79, 4, 0x30, 0x10, 12, 1), 137 + 138 + PIN_FIELD_BASE(80, 80, 1, 0x40, 0x10, 18, 1), 139 + PIN_FIELD_BASE(81, 81, 1, 0x40, 0x10, 19, 1), 140 + PIN_FIELD_BASE(82, 82, 1, 0x40, 0x10, 16, 1), 141 + PIN_FIELD_BASE(83, 83, 1, 0x40, 0x10, 17, 1), 142 + }; 143 + 144 + static const struct mtk_pin_field_calc mt7988_pin_smt_range[] = { 145 + PIN_FIELD_BASE(0, 0, 5, 0xc0, 0x10, 13, 1), 146 + PIN_FIELD_BASE(1, 1, 5, 0xc0, 0x10, 14, 1), 147 + PIN_FIELD_BASE(2, 2, 5, 0xc0, 0x10, 11, 1), 148 + PIN_FIELD_BASE(3, 3, 5, 0xc0, 0x10, 12, 1), 149 + PIN_FIELD_BASE(4, 4, 5, 0xc0, 0x10, 0, 1), 150 + PIN_FIELD_BASE(5, 5, 5, 0xc0, 0x10, 9, 1), 151 + PIN_FIELD_BASE(6, 6, 5, 0xc0, 0x10, 10, 1), 152 + 153 + PIN_FIELD_BASE(7, 7, 4, 0xb0, 0x10, 8, 1), 154 + PIN_FIELD_BASE(8, 8, 4, 0xb0, 0x10, 6, 1), 155 + PIN_FIELD_BASE(9, 9, 4, 0xb0, 0x10, 5, 1), 156 + PIN_FIELD_BASE(10, 10, 4, 0xb0, 0x10, 3, 1), 157 + 158 + PIN_FIELD_BASE(11, 11, 1, 0xe0, 0x10, 0, 1), 159 + PIN_FIELD_BASE(12, 12, 1, 0xe0, 0x10, 21, 1), 160 + PIN_FIELD_BASE(13, 13, 1, 0xe0, 0x10, 1, 1), 161 + PIN_FIELD_BASE(14, 14, 1, 0xe0, 0x10, 2, 1), 162 + 163 + PIN_FIELD_BASE(15, 15, 5, 0xc0, 0x10, 7, 1), 164 + PIN_FIELD_BASE(16, 16, 5, 0xc0, 0x10, 8, 1), 165 + PIN_FIELD_BASE(17, 17, 5, 0xc0, 0x10, 3, 1), 166 + PIN_FIELD_BASE(18, 18, 5, 0xc0, 0x10, 4, 1), 167 + 168 + PIN_FIELD_BASE(19, 19, 4, 0xb0, 0x10, 7, 1), 169 + PIN_FIELD_BASE(20, 20, 4, 0xb0, 0x10, 4, 1), 170 + 171 + PIN_FIELD_BASE(21, 21, 3, 0x140, 0x10, 17, 1), 172 + PIN_FIELD_BASE(22, 22, 3, 0x140, 0x10, 23, 1), 173 + PIN_FIELD_BASE(23, 23, 3, 0x140, 0x10, 20, 1), 174 + PIN_FIELD_BASE(24, 24, 3, 0x140, 0x10, 19, 1), 175 + PIN_FIELD_BASE(25, 25, 3, 0x140, 0x10, 21, 1), 176 + PIN_FIELD_BASE(26, 26, 3, 0x140, 0x10, 22, 1), 177 + PIN_FIELD_BASE(27, 27, 3, 0x140, 0x10, 18, 1), 178 + PIN_FIELD_BASE(28, 28, 3, 0x140, 0x10, 25, 1), 179 + PIN_FIELD_BASE(29, 29, 3, 0x140, 0x10, 26, 1), 180 + PIN_FIELD_BASE(30, 30, 3, 0x140, 0x10, 27, 1), 181 + PIN_FIELD_BASE(31, 31, 3, 0x140, 0x10, 24, 1), 182 + PIN_FIELD_BASE(32, 32, 3, 0x140, 0x10, 28, 1), 183 + PIN_FIELD_BASE(33, 33, 3, 0x150, 0x10, 0, 1), 184 + PIN_FIELD_BASE(34, 34, 3, 0x140, 0x10, 31, 1), 185 + PIN_FIELD_BASE(35, 35, 3, 0x140, 0x10, 29, 1), 186 + PIN_FIELD_BASE(36, 36, 3, 0x140, 0x10, 30, 1), 187 + PIN_FIELD_BASE(37, 37, 3, 0x150, 0x10, 1, 1), 188 + PIN_FIELD_BASE(38, 38, 3, 0x140, 0x10, 11, 1), 189 + PIN_FIELD_BASE(39, 39, 3, 0x140, 0x10, 10, 1), 190 + PIN_FIELD_BASE(40, 40, 3, 0x140, 0x10, 0, 1), 191 + PIN_FIELD_BASE(41, 41, 3, 0x140, 0x10, 1, 1), 192 + PIN_FIELD_BASE(42, 42, 3, 0x140, 0x10, 9, 1), 193 + PIN_FIELD_BASE(43, 43, 3, 0x140, 0x10, 8, 1), 194 + PIN_FIELD_BASE(44, 44, 3, 0x140, 0x10, 7, 1), 195 + PIN_FIELD_BASE(45, 45, 3, 0x140, 0x10, 6, 1), 196 + PIN_FIELD_BASE(46, 46, 3, 0x140, 0x10, 5, 1), 197 + PIN_FIELD_BASE(47, 47, 3, 0x140, 0x10, 4, 1), 198 + PIN_FIELD_BASE(48, 48, 3, 0x140, 0x10, 3, 1), 199 + PIN_FIELD_BASE(49, 49, 3, 0x140, 0x10, 2, 1), 200 + PIN_FIELD_BASE(50, 50, 3, 0x140, 0x10, 15, 1), 201 + PIN_FIELD_BASE(51, 51, 3, 0x140, 0x10, 12, 1), 202 + PIN_FIELD_BASE(52, 52, 3, 0x140, 0x10, 13, 1), 203 + PIN_FIELD_BASE(53, 53, 3, 0x140, 0x10, 14, 1), 204 + PIN_FIELD_BASE(54, 54, 3, 0x140, 0x10, 16, 1), 205 + 206 + PIN_FIELD_BASE(55, 55, 1, 0xe0, 0x10, 14, 1), 207 + PIN_FIELD_BASE(56, 56, 1, 0xe0, 0x10, 15, 1), 208 + PIN_FIELD_BASE(57, 57, 1, 0xe0, 0x10, 13, 1), 209 + PIN_FIELD_BASE(58, 58, 1, 0xe0, 0x10, 4, 1), 210 + PIN_FIELD_BASE(59, 59, 1, 0xe0, 0x10, 5, 1), 211 + PIN_FIELD_BASE(60, 60, 1, 0xe0, 0x10, 6, 1), 212 + PIN_FIELD_BASE(61, 61, 1, 0xe0, 0x10, 3, 1), 213 + PIN_FIELD_BASE(62, 62, 1, 0xe0, 0x10, 7, 1), 214 + PIN_FIELD_BASE(63, 63, 1, 0xe0, 0x10, 20, 1), 215 + PIN_FIELD_BASE(64, 64, 1, 0xe0, 0x10, 8, 1), 216 + PIN_FIELD_BASE(65, 65, 1, 0xe0, 0x10, 9, 1), 217 + PIN_FIELD_BASE(66, 66, 1, 0xe0, 0x10, 10, 1), 218 + PIN_FIELD_BASE(67, 67, 1, 0xe0, 0x10, 11, 1), 219 + PIN_FIELD_BASE(68, 68, 1, 0xe0, 0x10, 12, 1), 220 + 221 + PIN_FIELD_BASE(69, 69, 5, 0xc0, 0x10, 1, 1), 222 + PIN_FIELD_BASE(70, 70, 5, 0xc0, 0x10, 2, 1), 223 + PIN_FIELD_BASE(71, 71, 5, 0xc0, 0x10, 5, 1), 224 + PIN_FIELD_BASE(72, 72, 5, 0xc0, 0x10, 6, 1), 225 + 226 + PIN_FIELD_BASE(73, 73, 4, 0xb0, 0x10, 10, 1), 227 + PIN_FIELD_BASE(74, 74, 4, 0xb0, 0x10, 1, 1), 228 + PIN_FIELD_BASE(75, 75, 4, 0xb0, 0x10, 11, 1), 229 + PIN_FIELD_BASE(76, 76, 4, 0xb0, 0x10, 9, 1), 230 + PIN_FIELD_BASE(77, 77, 4, 0xb0, 0x10, 2, 1), 231 + PIN_FIELD_BASE(78, 78, 4, 0xb0, 0x10, 0, 1), 232 + PIN_FIELD_BASE(79, 79, 4, 0xb0, 0x10, 12, 1), 233 + 234 + PIN_FIELD_BASE(80, 80, 1, 0xe0, 0x10, 18, 1), 235 + PIN_FIELD_BASE(81, 81, 1, 0xe0, 0x10, 19, 1), 236 + PIN_FIELD_BASE(82, 82, 1, 0xe0, 0x10, 16, 1), 237 + PIN_FIELD_BASE(83, 83, 1, 0xe0, 0x10, 17, 1), 238 + }; 239 + 240 + static const struct mtk_pin_field_calc mt7988_pin_pu_range[] = { 241 + PIN_FIELD_BASE(7, 7, 4, 0x60, 0x10, 5, 1), 242 + PIN_FIELD_BASE(8, 8, 4, 0x60, 0x10, 4, 1), 243 + PIN_FIELD_BASE(9, 9, 4, 0x60, 0x10, 3, 1), 244 + PIN_FIELD_BASE(10, 10, 4, 0x60, 0x10, 2, 1), 245 + 246 + PIN_FIELD_BASE(13, 13, 1, 0x70, 0x10, 0, 1), 247 + PIN_FIELD_BASE(14, 14, 1, 0x70, 0x10, 1, 1), 248 + PIN_FIELD_BASE(63, 63, 1, 0x70, 0x10, 2, 1), 249 + 250 + PIN_FIELD_BASE(75, 75, 4, 0x60, 0x10, 7, 1), 251 + PIN_FIELD_BASE(76, 76, 4, 0x60, 0x10, 6, 1), 252 + PIN_FIELD_BASE(77, 77, 4, 0x60, 0x10, 1, 1), 253 + PIN_FIELD_BASE(78, 78, 4, 0x60, 0x10, 0, 1), 254 + PIN_FIELD_BASE(79, 79, 4, 0x60, 0x10, 8, 1), 255 + }; 256 + 257 + static const struct mtk_pin_field_calc mt7988_pin_pd_range[] = { 258 + PIN_FIELD_BASE(7, 7, 4, 0x40, 0x10, 5, 1), 259 + PIN_FIELD_BASE(8, 8, 4, 0x40, 0x10, 4, 1), 260 + PIN_FIELD_BASE(9, 9, 4, 0x40, 0x10, 3, 1), 261 + PIN_FIELD_BASE(10, 10, 4, 0x40, 0x10, 2, 1), 262 + 263 + PIN_FIELD_BASE(13, 13, 1, 0x50, 0x10, 0, 1), 264 + PIN_FIELD_BASE(14, 14, 1, 0x50, 0x10, 1, 1), 265 + 266 + PIN_FIELD_BASE(15, 15, 5, 0x40, 0x10, 4, 1), 267 + PIN_FIELD_BASE(16, 16, 5, 0x40, 0x10, 5, 1), 268 + PIN_FIELD_BASE(17, 17, 5, 0x40, 0x10, 0, 1), 269 + PIN_FIELD_BASE(18, 18, 5, 0x40, 0x10, 1, 1), 270 + 271 + PIN_FIELD_BASE(63, 63, 1, 0x50, 0x10, 2, 1), 272 + PIN_FIELD_BASE(71, 71, 5, 0x40, 0x10, 2, 1), 273 + PIN_FIELD_BASE(72, 72, 5, 0x40, 0x10, 3, 1), 274 + 275 + PIN_FIELD_BASE(75, 75, 4, 0x40, 0x10, 7, 1), 276 + PIN_FIELD_BASE(76, 76, 4, 0x40, 0x10, 6, 1), 277 + PIN_FIELD_BASE(77, 77, 4, 0x40, 0x10, 1, 1), 278 + PIN_FIELD_BASE(78, 78, 4, 0x40, 0x10, 0, 1), 279 + PIN_FIELD_BASE(79, 79, 4, 0x40, 0x10, 8, 1), 280 + }; 281 + 282 + static const struct mtk_pin_field_calc mt7988_pin_drv_range[] = { 283 + PIN_FIELD_BASE(0, 0, 5, 0x00, 0x10, 21, 3), 284 + PIN_FIELD_BASE(1, 1, 5, 0x00, 0x10, 24, 3), 285 + PIN_FIELD_BASE(2, 2, 5, 0x00, 0x10, 15, 3), 286 + PIN_FIELD_BASE(3, 3, 5, 0x00, 0x10, 18, 3), 287 + PIN_FIELD_BASE(4, 4, 5, 0x00, 0x10, 0, 3), 288 + PIN_FIELD_BASE(5, 5, 5, 0x00, 0x10, 9, 3), 289 + PIN_FIELD_BASE(6, 6, 5, 0x00, 0x10, 12, 3), 290 + 291 + PIN_FIELD_BASE(7, 7, 4, 0x00, 0x10, 24, 3), 292 + PIN_FIELD_BASE(8, 8, 4, 0x00, 0x10, 28, 3), 293 + PIN_FIELD_BASE(9, 9, 4, 0x00, 0x10, 15, 3), 294 + PIN_FIELD_BASE(10, 10, 4, 0x00, 0x10, 9, 3), 295 + 296 + PIN_FIELD_BASE(11, 11, 1, 0x00, 0x10, 0, 3), 297 + PIN_FIELD_BASE(12, 12, 1, 0x20, 0x10, 3, 3), 298 + PIN_FIELD_BASE(13, 13, 1, 0x00, 0x10, 3, 3), 299 + PIN_FIELD_BASE(14, 14, 1, 0x00, 0x10, 6, 3), 300 + 301 + PIN_FIELD_BASE(19, 19, 4, 0x00, 0x10, 21, 3), 302 + PIN_FIELD_BASE(20, 20, 4, 0x00, 0x10, 12, 3), 303 + 304 + PIN_FIELD_BASE(21, 21, 3, 0x10, 0x10, 21, 3), 305 + PIN_FIELD_BASE(22, 22, 3, 0x20, 0x10, 9, 3), 306 + PIN_FIELD_BASE(23, 23, 3, 0x20, 0x10, 0, 3), 307 + PIN_FIELD_BASE(24, 24, 3, 0x10, 0x10, 27, 3), 308 + PIN_FIELD_BASE(25, 25, 3, 0x20, 0x10, 3, 3), 309 + PIN_FIELD_BASE(26, 26, 3, 0x20, 0x10, 6, 3), 310 + PIN_FIELD_BASE(27, 27, 3, 0x10, 0x10, 24, 3), 311 + PIN_FIELD_BASE(28, 28, 3, 0x20, 0x10, 15, 3), 312 + PIN_FIELD_BASE(29, 29, 3, 0x20, 0x10, 18, 3), 313 + PIN_FIELD_BASE(30, 30, 3, 0x20, 0x10, 21, 3), 314 + PIN_FIELD_BASE(31, 31, 3, 0x20, 0x10, 12, 3), 315 + PIN_FIELD_BASE(32, 32, 3, 0x20, 0x10, 24, 3), 316 + PIN_FIELD_BASE(33, 33, 3, 0x30, 0x10, 6, 3), 317 + PIN_FIELD_BASE(34, 34, 3, 0x30, 0x10, 3, 3), 318 + PIN_FIELD_BASE(35, 35, 3, 0x20, 0x10, 27, 3), 319 + PIN_FIELD_BASE(36, 36, 3, 0x30, 0x10, 0, 3), 320 + PIN_FIELD_BASE(37, 37, 3, 0x30, 0x10, 9, 3), 321 + PIN_FIELD_BASE(38, 38, 3, 0x10, 0x10, 3, 3), 322 + PIN_FIELD_BASE(39, 39, 3, 0x10, 0x10, 0, 3), 323 + PIN_FIELD_BASE(40, 40, 3, 0x00, 0x10, 0, 3), 324 + PIN_FIELD_BASE(41, 41, 3, 0x00, 0x10, 3, 3), 325 + PIN_FIELD_BASE(42, 42, 3, 0x00, 0x10, 27, 3), 326 + PIN_FIELD_BASE(43, 43, 3, 0x00, 0x10, 24, 3), 327 + PIN_FIELD_BASE(44, 44, 3, 0x00, 0x10, 21, 3), 328 + PIN_FIELD_BASE(45, 45, 3, 0x00, 0x10, 18, 3), 329 + PIN_FIELD_BASE(46, 46, 3, 0x00, 0x10, 15, 3), 330 + PIN_FIELD_BASE(47, 47, 3, 0x00, 0x10, 12, 3), 331 + PIN_FIELD_BASE(48, 48, 3, 0x00, 0x10, 9, 3), 332 + PIN_FIELD_BASE(49, 49, 3, 0x00, 0x10, 6, 3), 333 + PIN_FIELD_BASE(50, 50, 3, 0x10, 0x10, 15, 3), 334 + PIN_FIELD_BASE(51, 51, 3, 0x10, 0x10, 6, 3), 335 + PIN_FIELD_BASE(52, 52, 3, 0x10, 0x10, 9, 3), 336 + PIN_FIELD_BASE(53, 53, 3, 0x10, 0x10, 12, 3), 337 + PIN_FIELD_BASE(54, 54, 3, 0x10, 0x10, 18, 3), 338 + 339 + PIN_FIELD_BASE(55, 55, 1, 0x10, 0x10, 12, 3), 340 + PIN_FIELD_BASE(56, 56, 1, 0x10, 0x10, 15, 3), 341 + PIN_FIELD_BASE(57, 57, 1, 0x10, 0x10, 9, 3), 342 + PIN_FIELD_BASE(58, 58, 1, 0x00, 0x10, 12, 3), 343 + PIN_FIELD_BASE(59, 59, 1, 0x00, 0x10, 15, 3), 344 + PIN_FIELD_BASE(60, 60, 1, 0x00, 0x10, 18, 3), 345 + PIN_FIELD_BASE(61, 61, 1, 0x00, 0x10, 9, 3), 346 + PIN_FIELD_BASE(62, 62, 1, 0x00, 0x10, 21, 3), 347 + PIN_FIELD_BASE(63, 63, 1, 0x20, 0x10, 0, 3), 348 + PIN_FIELD_BASE(64, 64, 1, 0x00, 0x10, 24, 3), 349 + PIN_FIELD_BASE(65, 65, 1, 0x00, 0x10, 27, 3), 350 + PIN_FIELD_BASE(66, 66, 1, 0x10, 0x10, 0, 3), 351 + PIN_FIELD_BASE(67, 67, 1, 0x10, 0x10, 3, 3), 352 + PIN_FIELD_BASE(68, 68, 1, 0x10, 0x10, 6, 3), 353 + 354 + PIN_FIELD_BASE(69, 69, 5, 0x00, 0x10, 3, 3), 355 + PIN_FIELD_BASE(70, 70, 5, 0x00, 0x10, 6, 3), 356 + 357 + PIN_FIELD_BASE(73, 73, 4, 0x10, 0x10, 0, 3), 358 + PIN_FIELD_BASE(74, 74, 4, 0x00, 0x10, 3, 3), 359 + PIN_FIELD_BASE(75, 75, 4, 0x10, 0x10, 3, 3), 360 + PIN_FIELD_BASE(76, 76, 4, 0x00, 0x10, 27, 3), 361 + PIN_FIELD_BASE(77, 77, 4, 0x00, 0x10, 6, 3), 362 + PIN_FIELD_BASE(78, 78, 4, 0x00, 0x10, 0, 3), 363 + PIN_FIELD_BASE(79, 79, 4, 0x10, 0x10, 6, 3), 364 + 365 + PIN_FIELD_BASE(80, 80, 1, 0x10, 0x10, 24, 3), 366 + PIN_FIELD_BASE(81, 81, 1, 0x10, 0x10, 27, 3), 367 + PIN_FIELD_BASE(82, 82, 1, 0x10, 0x10, 18, 3), 368 + PIN_FIELD_BASE(83, 83, 1, 0x10, 0x10, 21, 3), 369 + }; 370 + 371 + static const struct mtk_pin_field_calc mt7988_pin_pupd_range[] = { 372 + PIN_FIELD_BASE(0, 0, 5, 0x50, 0x10, 7, 1), 373 + PIN_FIELD_BASE(1, 1, 5, 0x50, 0x10, 8, 1), 374 + PIN_FIELD_BASE(2, 2, 5, 0x50, 0x10, 5, 1), 375 + PIN_FIELD_BASE(3, 3, 5, 0x50, 0x10, 6, 1), 376 + PIN_FIELD_BASE(4, 4, 5, 0x50, 0x10, 0, 1), 377 + PIN_FIELD_BASE(5, 5, 5, 0x50, 0x10, 3, 1), 378 + PIN_FIELD_BASE(6, 6, 5, 0x50, 0x10, 4, 1), 379 + 380 + PIN_FIELD_BASE(11, 11, 1, 0x60, 0x10, 0, 1), 381 + PIN_FIELD_BASE(12, 12, 1, 0x60, 0x10, 18, 1), 382 + 383 + PIN_FIELD_BASE(19, 19, 4, 0x50, 0x10, 2, 1), 384 + PIN_FIELD_BASE(20, 20, 4, 0x50, 0x10, 1, 1), 385 + 386 + PIN_FIELD_BASE(21, 21, 3, 0x70, 0x10, 17, 1), 387 + PIN_FIELD_BASE(22, 22, 3, 0x70, 0x10, 23, 1), 388 + PIN_FIELD_BASE(23, 23, 3, 0x70, 0x10, 20, 1), 389 + PIN_FIELD_BASE(24, 24, 3, 0x70, 0x10, 19, 1), 390 + PIN_FIELD_BASE(25, 25, 3, 0x70, 0x10, 21, 1), 391 + PIN_FIELD_BASE(26, 26, 3, 0x70, 0x10, 22, 1), 392 + PIN_FIELD_BASE(27, 27, 3, 0x70, 0x10, 18, 1), 393 + PIN_FIELD_BASE(28, 28, 3, 0x70, 0x10, 25, 1), 394 + PIN_FIELD_BASE(29, 29, 3, 0x70, 0x10, 26, 1), 395 + PIN_FIELD_BASE(30, 30, 3, 0x70, 0x10, 27, 1), 396 + PIN_FIELD_BASE(31, 31, 3, 0x70, 0x10, 24, 1), 397 + PIN_FIELD_BASE(32, 32, 3, 0x70, 0x10, 28, 1), 398 + PIN_FIELD_BASE(33, 33, 3, 0x80, 0x10, 0, 1), 399 + PIN_FIELD_BASE(34, 34, 3, 0x70, 0x10, 31, 1), 400 + PIN_FIELD_BASE(35, 35, 3, 0x70, 0x10, 29, 1), 401 + PIN_FIELD_BASE(36, 36, 3, 0x70, 0x10, 30, 1), 402 + PIN_FIELD_BASE(37, 37, 3, 0x80, 0x10, 1, 1), 403 + PIN_FIELD_BASE(38, 38, 3, 0x70, 0x10, 11, 1), 404 + PIN_FIELD_BASE(39, 39, 3, 0x70, 0x10, 10, 1), 405 + PIN_FIELD_BASE(40, 40, 3, 0x70, 0x10, 0, 1), 406 + PIN_FIELD_BASE(41, 41, 3, 0x70, 0x10, 1, 1), 407 + PIN_FIELD_BASE(42, 42, 3, 0x70, 0x10, 9, 1), 408 + PIN_FIELD_BASE(43, 43, 3, 0x70, 0x10, 8, 1), 409 + PIN_FIELD_BASE(44, 44, 3, 0x70, 0x10, 7, 1), 410 + PIN_FIELD_BASE(45, 45, 3, 0x70, 0x10, 6, 1), 411 + PIN_FIELD_BASE(46, 46, 3, 0x70, 0x10, 5, 1), 412 + PIN_FIELD_BASE(47, 47, 3, 0x70, 0x10, 4, 1), 413 + PIN_FIELD_BASE(48, 48, 3, 0x70, 0x10, 3, 1), 414 + PIN_FIELD_BASE(49, 49, 3, 0x70, 0x10, 2, 1), 415 + PIN_FIELD_BASE(50, 50, 3, 0x70, 0x10, 15, 1), 416 + PIN_FIELD_BASE(51, 51, 3, 0x70, 0x10, 12, 1), 417 + PIN_FIELD_BASE(52, 52, 3, 0x70, 0x10, 13, 1), 418 + PIN_FIELD_BASE(53, 53, 3, 0x70, 0x10, 14, 1), 419 + PIN_FIELD_BASE(54, 54, 3, 0x70, 0x10, 16, 1), 420 + 421 + PIN_FIELD_BASE(55, 55, 1, 0x60, 0x10, 12, 1), 422 + PIN_FIELD_BASE(56, 56, 1, 0x60, 0x10, 13, 1), 423 + PIN_FIELD_BASE(57, 57, 1, 0x60, 0x10, 11, 1), 424 + PIN_FIELD_BASE(58, 58, 1, 0x60, 0x10, 2, 1), 425 + PIN_FIELD_BASE(59, 59, 1, 0x60, 0x10, 3, 1), 426 + PIN_FIELD_BASE(60, 60, 1, 0x60, 0x10, 4, 1), 427 + PIN_FIELD_BASE(61, 61, 1, 0x60, 0x10, 1, 1), 428 + PIN_FIELD_BASE(62, 62, 1, 0x60, 0x10, 5, 1), 429 + PIN_FIELD_BASE(64, 64, 1, 0x60, 0x10, 6, 1), 430 + PIN_FIELD_BASE(65, 65, 1, 0x60, 0x10, 7, 1), 431 + PIN_FIELD_BASE(66, 66, 1, 0x60, 0x10, 8, 1), 432 + PIN_FIELD_BASE(67, 67, 1, 0x60, 0x10, 9, 1), 433 + PIN_FIELD_BASE(68, 68, 1, 0x60, 0x10, 10, 1), 434 + 435 + PIN_FIELD_BASE(69, 69, 5, 0x50, 0x10, 1, 1), 436 + PIN_FIELD_BASE(70, 70, 5, 0x50, 0x10, 2, 1), 437 + 438 + PIN_FIELD_BASE(73, 73, 4, 0x50, 0x10, 3, 1), 439 + PIN_FIELD_BASE(74, 74, 4, 0x50, 0x10, 0, 1), 440 + 441 + PIN_FIELD_BASE(80, 80, 1, 0x60, 0x10, 16, 1), 442 + PIN_FIELD_BASE(81, 81, 1, 0x60, 0x10, 17, 1), 443 + PIN_FIELD_BASE(82, 82, 1, 0x60, 0x10, 14, 1), 444 + PIN_FIELD_BASE(83, 83, 1, 0x60, 0x10, 15, 1), 445 + }; 446 + 447 + static const struct mtk_pin_field_calc mt7988_pin_r0_range[] = { 448 + PIN_FIELD_BASE(0, 0, 5, 0x60, 0x10, 7, 1), 449 + PIN_FIELD_BASE(1, 1, 5, 0x60, 0x10, 8, 1), 450 + PIN_FIELD_BASE(2, 2, 5, 0x60, 0x10, 5, 1), 451 + PIN_FIELD_BASE(3, 3, 5, 0x60, 0x10, 6, 1), 452 + PIN_FIELD_BASE(4, 4, 5, 0x60, 0x10, 0, 1), 453 + PIN_FIELD_BASE(5, 5, 5, 0x60, 0x10, 3, 1), 454 + PIN_FIELD_BASE(6, 6, 5, 0x60, 0x10, 4, 1), 455 + 456 + PIN_FIELD_BASE(11, 11, 1, 0x80, 0x10, 0, 1), 457 + PIN_FIELD_BASE(12, 12, 1, 0x80, 0x10, 18, 1), 458 + 459 + PIN_FIELD_BASE(19, 19, 4, 0x70, 0x10, 2, 1), 460 + PIN_FIELD_BASE(20, 20, 4, 0x70, 0x10, 1, 1), 461 + 462 + PIN_FIELD_BASE(21, 21, 3, 0x90, 0x10, 17, 1), 463 + PIN_FIELD_BASE(22, 22, 3, 0x90, 0x10, 23, 1), 464 + PIN_FIELD_BASE(23, 23, 3, 0x90, 0x10, 20, 1), 465 + PIN_FIELD_BASE(24, 24, 3, 0x90, 0x10, 19, 1), 466 + PIN_FIELD_BASE(25, 25, 3, 0x90, 0x10, 21, 1), 467 + PIN_FIELD_BASE(26, 26, 3, 0x90, 0x10, 22, 1), 468 + PIN_FIELD_BASE(27, 27, 3, 0x90, 0x10, 18, 1), 469 + PIN_FIELD_BASE(28, 28, 3, 0x90, 0x10, 25, 1), 470 + PIN_FIELD_BASE(29, 29, 3, 0x90, 0x10, 26, 1), 471 + PIN_FIELD_BASE(30, 30, 3, 0x90, 0x10, 27, 1), 472 + PIN_FIELD_BASE(31, 31, 3, 0x90, 0x10, 24, 1), 473 + PIN_FIELD_BASE(32, 32, 3, 0x90, 0x10, 28, 1), 474 + PIN_FIELD_BASE(33, 33, 3, 0xa0, 0x10, 0, 1), 475 + PIN_FIELD_BASE(34, 34, 3, 0x90, 0x10, 31, 1), 476 + PIN_FIELD_BASE(35, 35, 3, 0x90, 0x10, 29, 1), 477 + PIN_FIELD_BASE(36, 36, 3, 0x90, 0x10, 30, 1), 478 + PIN_FIELD_BASE(37, 37, 3, 0xa0, 0x10, 1, 1), 479 + PIN_FIELD_BASE(38, 38, 3, 0x90, 0x10, 11, 1), 480 + PIN_FIELD_BASE(39, 39, 3, 0x90, 0x10, 10, 1), 481 + PIN_FIELD_BASE(40, 40, 3, 0x90, 0x10, 0, 1), 482 + PIN_FIELD_BASE(41, 41, 3, 0x90, 0x10, 1, 1), 483 + PIN_FIELD_BASE(42, 42, 3, 0x90, 0x10, 9, 1), 484 + PIN_FIELD_BASE(43, 43, 3, 0x90, 0x10, 8, 1), 485 + PIN_FIELD_BASE(44, 44, 3, 0x90, 0x10, 7, 1), 486 + PIN_FIELD_BASE(45, 45, 3, 0x90, 0x10, 6, 1), 487 + PIN_FIELD_BASE(46, 46, 3, 0x90, 0x10, 5, 1), 488 + PIN_FIELD_BASE(47, 47, 3, 0x90, 0x10, 4, 1), 489 + PIN_FIELD_BASE(48, 48, 3, 0x90, 0x10, 3, 1), 490 + PIN_FIELD_BASE(49, 49, 3, 0x90, 0x10, 2, 1), 491 + PIN_FIELD_BASE(50, 50, 3, 0x90, 0x10, 15, 1), 492 + PIN_FIELD_BASE(51, 51, 3, 0x90, 0x10, 12, 1), 493 + PIN_FIELD_BASE(52, 52, 3, 0x90, 0x10, 13, 1), 494 + PIN_FIELD_BASE(53, 53, 3, 0x90, 0x10, 14, 1), 495 + PIN_FIELD_BASE(54, 54, 3, 0x90, 0x10, 16, 1), 496 + 497 + PIN_FIELD_BASE(55, 55, 1, 0x80, 0x10, 12, 1), 498 + PIN_FIELD_BASE(56, 56, 1, 0x80, 0x10, 13, 1), 499 + PIN_FIELD_BASE(57, 57, 1, 0x80, 0x10, 11, 1), 500 + PIN_FIELD_BASE(58, 58, 1, 0x80, 0x10, 2, 1), 501 + PIN_FIELD_BASE(59, 59, 1, 0x80, 0x10, 3, 1), 502 + PIN_FIELD_BASE(60, 60, 1, 0x80, 0x10, 4, 1), 503 + PIN_FIELD_BASE(61, 61, 1, 0x80, 0x10, 1, 1), 504 + PIN_FIELD_BASE(62, 62, 1, 0x80, 0x10, 5, 1), 505 + PIN_FIELD_BASE(64, 64, 1, 0x80, 0x10, 6, 1), 506 + PIN_FIELD_BASE(65, 65, 1, 0x80, 0x10, 7, 1), 507 + PIN_FIELD_BASE(66, 66, 1, 0x80, 0x10, 8, 1), 508 + PIN_FIELD_BASE(67, 67, 1, 0x80, 0x10, 9, 1), 509 + PIN_FIELD_BASE(68, 68, 1, 0x80, 0x10, 10, 1), 510 + 511 + PIN_FIELD_BASE(69, 69, 5, 0x60, 0x10, 1, 1), 512 + PIN_FIELD_BASE(70, 70, 5, 0x60, 0x10, 2, 1), 513 + 514 + PIN_FIELD_BASE(73, 73, 4, 0x70, 0x10, 3, 1), 515 + PIN_FIELD_BASE(74, 74, 4, 0x70, 0x10, 0, 1), 516 + 517 + PIN_FIELD_BASE(80, 80, 1, 0x80, 0x10, 16, 1), 518 + PIN_FIELD_BASE(81, 81, 1, 0x80, 0x10, 17, 1), 519 + PIN_FIELD_BASE(82, 82, 1, 0x80, 0x10, 14, 1), 520 + PIN_FIELD_BASE(83, 83, 1, 0x80, 0x10, 15, 1), 521 + }; 522 + 523 + static const struct mtk_pin_field_calc mt7988_pin_r1_range[] = { 524 + PIN_FIELD_BASE(0, 0, 5, 0x70, 0x10, 7, 1), 525 + PIN_FIELD_BASE(1, 1, 5, 0x70, 0x10, 8, 1), 526 + PIN_FIELD_BASE(2, 2, 5, 0x70, 0x10, 5, 1), 527 + PIN_FIELD_BASE(3, 3, 5, 0x70, 0x10, 6, 1), 528 + PIN_FIELD_BASE(4, 4, 5, 0x70, 0x10, 0, 1), 529 + PIN_FIELD_BASE(5, 5, 5, 0x70, 0x10, 3, 1), 530 + PIN_FIELD_BASE(6, 6, 5, 0x70, 0x10, 4, 1), 531 + 532 + PIN_FIELD_BASE(11, 11, 1, 0x90, 0x10, 0, 1), 533 + PIN_FIELD_BASE(12, 12, 1, 0x90, 0x10, 18, 1), 534 + 535 + PIN_FIELD_BASE(19, 19, 4, 0x80, 0x10, 2, 1), 536 + PIN_FIELD_BASE(20, 20, 4, 0x80, 0x10, 1, 1), 537 + 538 + PIN_FIELD_BASE(21, 21, 3, 0xb0, 0x10, 17, 1), 539 + PIN_FIELD_BASE(22, 22, 3, 0xb0, 0x10, 23, 1), 540 + PIN_FIELD_BASE(23, 23, 3, 0xb0, 0x10, 20, 1), 541 + PIN_FIELD_BASE(24, 24, 3, 0xb0, 0x10, 19, 1), 542 + PIN_FIELD_BASE(25, 25, 3, 0xb0, 0x10, 21, 1), 543 + PIN_FIELD_BASE(26, 26, 3, 0xb0, 0x10, 22, 1), 544 + PIN_FIELD_BASE(27, 27, 3, 0xb0, 0x10, 18, 1), 545 + PIN_FIELD_BASE(28, 28, 3, 0xb0, 0x10, 25, 1), 546 + PIN_FIELD_BASE(29, 29, 3, 0xb0, 0x10, 26, 1), 547 + PIN_FIELD_BASE(30, 30, 3, 0xb0, 0x10, 27, 1), 548 + PIN_FIELD_BASE(31, 31, 3, 0xb0, 0x10, 24, 1), 549 + PIN_FIELD_BASE(32, 32, 3, 0xb0, 0x10, 28, 1), 550 + PIN_FIELD_BASE(33, 33, 3, 0xc0, 0x10, 0, 1), 551 + PIN_FIELD_BASE(34, 34, 3, 0xb0, 0x10, 31, 1), 552 + PIN_FIELD_BASE(35, 35, 3, 0xb0, 0x10, 29, 1), 553 + PIN_FIELD_BASE(36, 36, 3, 0xb0, 0x10, 30, 1), 554 + PIN_FIELD_BASE(37, 37, 3, 0xc0, 0x10, 1, 1), 555 + PIN_FIELD_BASE(38, 38, 3, 0xb0, 0x10, 11, 1), 556 + PIN_FIELD_BASE(39, 39, 3, 0xb0, 0x10, 10, 1), 557 + PIN_FIELD_BASE(40, 40, 3, 0xb0, 0x10, 0, 1), 558 + PIN_FIELD_BASE(41, 41, 3, 0xb0, 0x10, 1, 1), 559 + PIN_FIELD_BASE(42, 42, 3, 0xb0, 0x10, 9, 1), 560 + PIN_FIELD_BASE(43, 43, 3, 0xb0, 0x10, 8, 1), 561 + PIN_FIELD_BASE(44, 44, 3, 0xb0, 0x10, 7, 1), 562 + PIN_FIELD_BASE(45, 45, 3, 0xb0, 0x10, 6, 1), 563 + PIN_FIELD_BASE(46, 46, 3, 0xb0, 0x10, 5, 1), 564 + PIN_FIELD_BASE(47, 47, 3, 0xb0, 0x10, 4, 1), 565 + PIN_FIELD_BASE(48, 48, 3, 0xb0, 0x10, 3, 1), 566 + PIN_FIELD_BASE(49, 49, 3, 0xb0, 0x10, 2, 1), 567 + PIN_FIELD_BASE(50, 50, 3, 0xb0, 0x10, 15, 1), 568 + PIN_FIELD_BASE(51, 51, 3, 0xb0, 0x10, 12, 1), 569 + PIN_FIELD_BASE(52, 52, 3, 0xb0, 0x10, 13, 1), 570 + PIN_FIELD_BASE(53, 53, 3, 0xb0, 0x10, 14, 1), 571 + PIN_FIELD_BASE(54, 54, 3, 0xb0, 0x10, 16, 1), 572 + 573 + PIN_FIELD_BASE(55, 55, 1, 0x90, 0x10, 12, 1), 574 + PIN_FIELD_BASE(56, 56, 1, 0x90, 0x10, 13, 1), 575 + PIN_FIELD_BASE(57, 57, 1, 0x90, 0x10, 11, 1), 576 + PIN_FIELD_BASE(58, 58, 1, 0x90, 0x10, 2, 1), 577 + PIN_FIELD_BASE(59, 59, 1, 0x90, 0x10, 3, 1), 578 + PIN_FIELD_BASE(60, 60, 1, 0x90, 0x10, 4, 1), 579 + PIN_FIELD_BASE(61, 61, 1, 0x90, 0x10, 1, 1), 580 + PIN_FIELD_BASE(62, 62, 1, 0x90, 0x10, 5, 1), 581 + PIN_FIELD_BASE(64, 64, 1, 0x90, 0x10, 6, 1), 582 + PIN_FIELD_BASE(65, 65, 1, 0x90, 0x10, 7, 1), 583 + PIN_FIELD_BASE(66, 66, 1, 0x90, 0x10, 8, 1), 584 + PIN_FIELD_BASE(67, 67, 1, 0x90, 0x10, 9, 1), 585 + PIN_FIELD_BASE(68, 68, 1, 0x90, 0x10, 10, 1), 586 + 587 + PIN_FIELD_BASE(69, 69, 5, 0x70, 0x10, 1, 1), 588 + PIN_FIELD_BASE(70, 70, 5, 0x70, 0x10, 2, 1), 589 + 590 + PIN_FIELD_BASE(73, 73, 4, 0x80, 0x10, 3, 1), 591 + PIN_FIELD_BASE(74, 74, 4, 0x80, 0x10, 0, 1), 592 + 593 + PIN_FIELD_BASE(80, 80, 1, 0x90, 0x10, 16, 1), 594 + PIN_FIELD_BASE(81, 81, 1, 0x90, 0x10, 17, 1), 595 + PIN_FIELD_BASE(82, 82, 1, 0x90, 0x10, 14, 1), 596 + PIN_FIELD_BASE(83, 83, 1, 0x90, 0x10, 15, 1), 597 + }; 598 + 599 + static const unsigned int mt7988_pull_type[] = { 600 + MTK_PULL_PUPD_R1R0_TYPE,/*0*/ MTK_PULL_PUPD_R1R0_TYPE,/*1*/ 601 + MTK_PULL_PUPD_R1R0_TYPE,/*2*/ MTK_PULL_PUPD_R1R0_TYPE,/*3*/ 602 + MTK_PULL_PUPD_R1R0_TYPE,/*4*/ MTK_PULL_PUPD_R1R0_TYPE,/*5*/ 603 + MTK_PULL_PUPD_R1R0_TYPE,/*6*/ MTK_PULL_PU_PD_TYPE, /*7*/ 604 + MTK_PULL_PU_PD_TYPE, /*8*/ MTK_PULL_PU_PD_TYPE, /*9*/ 605 + MTK_PULL_PU_PD_TYPE, /*10*/ MTK_PULL_PUPD_R1R0_TYPE,/*11*/ 606 + MTK_PULL_PUPD_R1R0_TYPE,/*12*/ MTK_PULL_PU_PD_TYPE, /*13*/ 607 + MTK_PULL_PU_PD_TYPE, /*14*/ MTK_PULL_PD_TYPE, /*15*/ 608 + MTK_PULL_PD_TYPE, /*16*/ MTK_PULL_PD_TYPE, /*17*/ 609 + MTK_PULL_PD_TYPE, /*18*/ MTK_PULL_PUPD_R1R0_TYPE,/*19*/ 610 + MTK_PULL_PUPD_R1R0_TYPE,/*20*/ MTK_PULL_PUPD_R1R0_TYPE,/*21*/ 611 + MTK_PULL_PUPD_R1R0_TYPE,/*22*/ MTK_PULL_PUPD_R1R0_TYPE,/*23*/ 612 + MTK_PULL_PUPD_R1R0_TYPE,/*24*/ MTK_PULL_PUPD_R1R0_TYPE,/*25*/ 613 + MTK_PULL_PUPD_R1R0_TYPE,/*26*/ MTK_PULL_PUPD_R1R0_TYPE,/*27*/ 614 + MTK_PULL_PUPD_R1R0_TYPE,/*28*/ MTK_PULL_PUPD_R1R0_TYPE,/*29*/ 615 + MTK_PULL_PUPD_R1R0_TYPE,/*30*/ MTK_PULL_PUPD_R1R0_TYPE,/*31*/ 616 + MTK_PULL_PUPD_R1R0_TYPE,/*32*/ MTK_PULL_PUPD_R1R0_TYPE,/*33*/ 617 + MTK_PULL_PUPD_R1R0_TYPE,/*34*/ MTK_PULL_PUPD_R1R0_TYPE,/*35*/ 618 + MTK_PULL_PUPD_R1R0_TYPE,/*36*/ MTK_PULL_PUPD_R1R0_TYPE,/*37*/ 619 + MTK_PULL_PUPD_R1R0_TYPE,/*38*/ MTK_PULL_PUPD_R1R0_TYPE,/*39*/ 620 + MTK_PULL_PUPD_R1R0_TYPE,/*40*/ MTK_PULL_PUPD_R1R0_TYPE,/*41*/ 621 + MTK_PULL_PUPD_R1R0_TYPE,/*42*/ MTK_PULL_PUPD_R1R0_TYPE,/*43*/ 622 + MTK_PULL_PUPD_R1R0_TYPE,/*44*/ MTK_PULL_PUPD_R1R0_TYPE,/*45*/ 623 + MTK_PULL_PUPD_R1R0_TYPE,/*46*/ MTK_PULL_PUPD_R1R0_TYPE,/*47*/ 624 + MTK_PULL_PUPD_R1R0_TYPE,/*48*/ MTK_PULL_PUPD_R1R0_TYPE,/*49*/ 625 + MTK_PULL_PUPD_R1R0_TYPE,/*50*/ MTK_PULL_PUPD_R1R0_TYPE,/*51*/ 626 + MTK_PULL_PUPD_R1R0_TYPE,/*52*/ MTK_PULL_PUPD_R1R0_TYPE,/*53*/ 627 + MTK_PULL_PUPD_R1R0_TYPE,/*54*/ MTK_PULL_PUPD_R1R0_TYPE,/*55*/ 628 + MTK_PULL_PUPD_R1R0_TYPE,/*56*/ MTK_PULL_PUPD_R1R0_TYPE,/*57*/ 629 + MTK_PULL_PUPD_R1R0_TYPE,/*58*/ MTK_PULL_PUPD_R1R0_TYPE,/*59*/ 630 + MTK_PULL_PUPD_R1R0_TYPE,/*60*/ MTK_PULL_PUPD_R1R0_TYPE,/*61*/ 631 + MTK_PULL_PUPD_R1R0_TYPE,/*62*/ MTK_PULL_PU_PD_TYPE, /*63*/ 632 + MTK_PULL_PUPD_R1R0_TYPE,/*64*/ MTK_PULL_PUPD_R1R0_TYPE,/*65*/ 633 + MTK_PULL_PUPD_R1R0_TYPE,/*66*/ MTK_PULL_PUPD_R1R0_TYPE,/*67*/ 634 + MTK_PULL_PUPD_R1R0_TYPE,/*68*/ MTK_PULL_PUPD_R1R0_TYPE,/*69*/ 635 + MTK_PULL_PUPD_R1R0_TYPE,/*70*/ MTK_PULL_PD_TYPE, /*71*/ 636 + MTK_PULL_PD_TYPE, /*72*/ MTK_PULL_PUPD_R1R0_TYPE,/*73*/ 637 + MTK_PULL_PUPD_R1R0_TYPE,/*74*/ MTK_PULL_PU_PD_TYPE, /*75*/ 638 + MTK_PULL_PU_PD_TYPE, /*76*/ MTK_PULL_PU_PD_TYPE, /*77*/ 639 + MTK_PULL_PU_PD_TYPE, /*78*/ MTK_PULL_PU_PD_TYPE, /*79*/ 640 + MTK_PULL_PUPD_R1R0_TYPE,/*80*/ MTK_PULL_PUPD_R1R0_TYPE,/*81*/ 641 + MTK_PULL_PUPD_R1R0_TYPE,/*82*/ MTK_PULL_PUPD_R1R0_TYPE,/*83*/ 642 + }; 643 + 644 + static const struct mtk_pin_reg_calc mt7988_reg_cals[] = { 645 + [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7988_pin_mode_range), 646 + [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7988_pin_dir_range), 647 + [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt7988_pin_di_range), 648 + [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt7988_pin_do_range), 649 + [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt7988_pin_smt_range), 650 + [PINCTRL_PIN_REG_IES] = MTK_RANGE(mt7988_pin_ies_range), 651 + [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt7988_pin_pu_range), 652 + [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt7988_pin_pd_range), 653 + [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt7988_pin_drv_range), 654 + [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt7988_pin_pupd_range), 655 + [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt7988_pin_r0_range), 656 + [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt7988_pin_r1_range), 657 + }; 658 + 659 + static const struct mtk_pin_desc mt7988_pins[] = { 660 + MT7988_PIN(0, "UART2_RXD"), 661 + MT7988_PIN(1, "UART2_TXD"), 662 + MT7988_PIN(2, "UART2_CTS"), 663 + MT7988_PIN(3, "UART2_RTS"), 664 + MT7988_PIN(4, "GPIO_A"), 665 + MT7988_PIN(5, "SMI_0_MDC"), 666 + MT7988_PIN(6, "SMI_0_MDIO"), 667 + MT7988_PIN(7, "PCIE30_2L_0_WAKE_N"), 668 + MT7988_PIN(8, "PCIE30_2L_0_CLKREQ_N"), 669 + MT7988_PIN(9, "PCIE30_1L_1_WAKE_N"), 670 + MT7988_PIN(10, "PCIE30_1L_1_CLKREQ_N"), 671 + MT7988_PIN(11, "GPIO_P"), 672 + MT7988_PIN(12, "WATCHDOG"), 673 + MT7988_PIN(13, "GPIO_RESET"), 674 + MT7988_PIN(14, "GPIO_WPS"), 675 + MT7988_PIN(15, "PMIC_I2C_SCL"), 676 + MT7988_PIN(16, "PMIC_I2C_SDA"), 677 + MT7988_PIN(17, "I2C_1_SCL"), 678 + MT7988_PIN(18, "I2C_1_SDA"), 679 + MT7988_PIN(19, "PCIE30_2L_0_PRESET_N"), 680 + MT7988_PIN(20, "PCIE30_1L_1_PRESET_N"), 681 + MT7988_PIN(21, "PWMD1"), 682 + MT7988_PIN(22, "SPI0_WP"), 683 + MT7988_PIN(23, "SPI0_HOLD"), 684 + MT7988_PIN(24, "SPI0_CSB"), 685 + MT7988_PIN(25, "SPI0_MISO"), 686 + MT7988_PIN(26, "SPI0_MOSI"), 687 + MT7988_PIN(27, "SPI0_CLK"), 688 + MT7988_PIN(28, "SPI1_CSB"), 689 + MT7988_PIN(29, "SPI1_MISO"), 690 + MT7988_PIN(30, "SPI1_MOSI"), 691 + MT7988_PIN(31, "SPI1_CLK"), 692 + MT7988_PIN(32, "SPI2_CLK"), 693 + MT7988_PIN(33, "SPI2_MOSI"), 694 + MT7988_PIN(34, "SPI2_MISO"), 695 + MT7988_PIN(35, "SPI2_CSB"), 696 + MT7988_PIN(36, "SPI2_HOLD"), 697 + MT7988_PIN(37, "SPI2_WP"), 698 + MT7988_PIN(38, "EMMC_RSTB"), 699 + MT7988_PIN(39, "EMMC_DSL"), 700 + MT7988_PIN(40, "EMMC_CK"), 701 + MT7988_PIN(41, "EMMC_CMD"), 702 + MT7988_PIN(42, "EMMC_DATA_7"), 703 + MT7988_PIN(43, "EMMC_DATA_6"), 704 + MT7988_PIN(44, "EMMC_DATA_5"), 705 + MT7988_PIN(45, "EMMC_DATA_4"), 706 + MT7988_PIN(46, "EMMC_DATA_3"), 707 + MT7988_PIN(47, "EMMC_DATA_2"), 708 + MT7988_PIN(48, "EMMC_DATA_1"), 709 + MT7988_PIN(49, "EMMC_DATA_0"), 710 + MT7988_PIN(50, "PCM_FS_I2S_LRCK"), 711 + MT7988_PIN(51, "PCM_CLK_I2S_BCLK"), 712 + MT7988_PIN(52, "PCM_DRX_I2S_DIN"), 713 + MT7988_PIN(53, "PCM_DTX_I2S_DOUT"), 714 + MT7988_PIN(54, "PCM_MCK_I2S_MCLK"), 715 + MT7988_PIN(55, "UART0_RXD"), 716 + MT7988_PIN(56, "UART0_TXD"), 717 + MT7988_PIN(57, "PWMD0"), 718 + MT7988_PIN(58, "JTAG_JTDI"), 719 + MT7988_PIN(59, "JTAG_JTDO"), 720 + MT7988_PIN(60, "JTAG_JTMS"), 721 + MT7988_PIN(61, "JTAG_JTCLK"), 722 + MT7988_PIN(62, "JTAG_JTRST_N"), 723 + MT7988_PIN(63, "USB_DRV_VBUS_P1"), 724 + MT7988_PIN(64, "LED_A"), 725 + MT7988_PIN(65, "LED_B"), 726 + MT7988_PIN(66, "LED_C"), 727 + MT7988_PIN(67, "LED_D"), 728 + MT7988_PIN(68, "LED_E"), 729 + MT7988_PIN(69, "GPIO_B"), 730 + MT7988_PIN(70, "GPIO_C"), 731 + MT7988_PIN(71, "I2C_2_SCL"), 732 + MT7988_PIN(72, "I2C_2_SDA"), 733 + MT7988_PIN(73, "PCIE30_2L_1_PRESET_N"), 734 + MT7988_PIN(74, "PCIE30_1L_0_PRESET_N"), 735 + MT7988_PIN(75, "PCIE30_2L_1_WAKE_N"), 736 + MT7988_PIN(76, "PCIE30_2L_1_CLKREQ_N"), 737 + MT7988_PIN(77, "PCIE30_1L_0_WAKE_N"), 738 + MT7988_PIN(78, "PCIE30_1L_0_CLKREQ_N"), 739 + MT7988_PIN(79, "USB_DRV_VBUS_P0"), 740 + MT7988_PIN(80, "UART1_RXD"), 741 + MT7988_PIN(81, "UART1_TXD"), 742 + MT7988_PIN(82, "UART1_CTS"), 743 + MT7988_PIN(83, "UART1_RTS"), 744 + }; 745 + 746 + /* jtag */ 747 + static const int mt7988_tops_jtag0_0_pins[] = { 0, 1, 2, 3, 4 }; 748 + static int mt7988_tops_jtag0_0_funcs[] = { 2, 2, 2, 2, 2 }; 749 + 750 + static const int mt7988_wo0_jtag_pins[] = { 50, 51, 52, 53, 54 }; 751 + static int mt7988_wo0_jtag_funcs[] = { 3, 3, 3, 3, 3 }; 752 + 753 + static const int mt7988_wo1_jtag_pins[] = { 50, 51, 52, 53, 54 }; 754 + static int mt7988_wo1_jtag_funcs[] = { 4, 4, 4, 4, 4 }; 755 + 756 + static const int mt7988_wo2_jtag_pins[] = { 50, 51, 52, 53, 54 }; 757 + static int mt7988_wo2_jtag_funcs[] = { 5, 5, 5, 5, 5 }; 758 + 759 + static const int mt7988_jtag_pins[] = { 58, 59, 60, 61, 62 }; 760 + static int mt7988_jtag_funcs[] = { 1, 1, 1, 1, 1 }; 761 + 762 + static const int mt7988_tops_jtag0_1_pins[] = { 58, 59, 60, 61, 62 }; 763 + static int mt7988_tops_jtag0_1_funcs[] = { 4, 4, 4, 4, 4 }; 764 + 765 + /* int_usxgmii */ 766 + static const int mt7988_int_usxgmii_pins[] = { 2, 3 }; 767 + static int mt7988_int_usxgmii_funcs[] = { 3, 3 }; 768 + 769 + /* pwm */ 770 + static const int mt7988_pwm0_pins[] = { 57 }; 771 + static int mt7988_pwm0_funcs[] = { 1 }; 772 + 773 + static const int mt7988_pwm1_pins[] = { 21 }; 774 + static int mt7988_pwm1_funcs[] = { 1 }; 775 + 776 + static const int mt7988_pwm2_pins[] = { 80 }; 777 + static int mt7988_pwm2_funcs[] = { 2 }; 778 + 779 + static const int mt7988_pwm2_0_pins[] = { 58 }; 780 + static int mt7988_pwm2_0_funcs[] = { 5 }; 781 + 782 + static const int mt7988_pwm3_pins[] = { 81 }; 783 + static int mt7988_pwm3_funcs[] = { 2 }; 784 + 785 + static const int mt7988_pwm3_0_pins[] = { 59 }; 786 + static int mt7988_pwm3_0_funcs[] = { 5 }; 787 + 788 + static const int mt7988_pwm4_pins[] = { 82 }; 789 + static int mt7988_pwm4_funcs[] = { 2 }; 790 + 791 + static const int mt7988_pwm4_0_pins[] = { 60 }; 792 + static int mt7988_pwm4_0_funcs[] = { 5 }; 793 + 794 + static const int mt7988_pwm5_pins[] = { 83 }; 795 + static int mt7988_pwm5_funcs[] = { 2 }; 796 + 797 + static const int mt7988_pwm5_0_pins[] = { 61 }; 798 + static int mt7988_pwm5_0_funcs[] = { 5 }; 799 + 800 + static const int mt7988_pwm6_pins[] = { 69 }; 801 + static int mt7988_pwm6_funcs[] = { 3 }; 802 + 803 + static const int mt7988_pwm6_0_pins[] = { 62 }; 804 + static int mt7988_pwm6_0_funcs[] = { 5 }; 805 + 806 + static const int mt7988_pwm7_pins[] = { 70 }; 807 + static int mt7988_pwm7_funcs[] = { 3 }; 808 + 809 + static const int mt7988_pwm7_0_pins[] = { 4 }; 810 + static int mt7988_pwm7_0_funcs[] = { 3 }; 811 + 812 + /* dfd */ 813 + static const int mt7988_dfd_pins[] = { 0, 1, 2, 3, 4 }; 814 + static int mt7988_dfd_funcs[] = { 4, 4, 4, 4, 4 }; 815 + 816 + /* i2c */ 817 + static const int mt7988_xfi_phy0_i2c0_pins[] = { 0, 1 }; 818 + static int mt7988_xfi_phy0_i2c0_funcs[] = { 5, 5 }; 819 + 820 + static const int mt7988_xfi_phy1_i2c0_pins[] = { 0, 1 }; 821 + static int mt7988_xfi_phy1_i2c0_funcs[] = { 6, 6 }; 822 + 823 + static const int mt7988_xfi_phy_pll_i2c0_pins[] = { 3, 4 }; 824 + static int mt7988_xfi_phy_pll_i2c0_funcs[] = { 5, 5 }; 825 + 826 + static const int mt7988_xfi_phy_pll_i2c1_pins[] = { 3, 4 }; 827 + static int mt7988_xfi_phy_pll_i2c1_funcs[] = { 6, 6 }; 828 + 829 + static const int mt7988_i2c0_0_pins[] = { 5, 6 }; 830 + static int mt7988_i2c0_0_funcs[] = { 2, 2 }; 831 + 832 + static const int mt7988_i2c1_sfp_pins[] = { 5, 6 }; 833 + static int mt7988_i2c1_sfp_funcs[] = { 4, 4 }; 834 + 835 + static const int mt7988_xfi_pextp_phy0_i2c_pins[] = { 5, 6 }; 836 + static int mt7988_xfi_pextp_phy0_i2c_funcs[] = { 5, 5 }; 837 + 838 + static const int mt7988_xfi_pextp_phy1_i2c_pins[] = { 5, 6 }; 839 + static int mt7988_xfi_pextp_phy1_i2c_funcs[] = { 6, 6 }; 840 + 841 + static const int mt7988_i2c0_1_pins[] = { 15, 16 }; 842 + static int mt7988_i2c0_1_funcs[] = { 1, 1 }; 843 + 844 + static const int mt7988_u30_phy_i2c0_pins[] = { 15, 16 }; 845 + static int mt7988_u30_phy_i2c0_funcs[] = { 2, 2 }; 846 + 847 + static const int mt7988_u32_phy_i2c0_pins[] = { 15, 16 }; 848 + static int mt7988_u32_phy_i2c0_funcs[] = { 3, 3 }; 849 + 850 + static const int mt7988_xfi_phy0_i2c1_pins[] = { 15, 16 }; 851 + static int mt7988_xfi_phy0_i2c1_funcs[] = { 5, 5 }; 852 + 853 + static const int mt7988_xfi_phy1_i2c1_pins[] = { 15, 16 }; 854 + static int mt7988_xfi_phy1_i2c1_funcs[] = { 6, 6 }; 855 + 856 + static const int mt7988_xfi_phy_pll_i2c2_pins[] = { 15, 16 }; 857 + static int mt7988_xfi_phy_pll_i2c2_funcs[] = { 7, 7 }; 858 + 859 + static const int mt7988_i2c1_0_pins[] = { 17, 18 }; 860 + static int mt7988_i2c1_0_funcs[] = { 1, 1 }; 861 + 862 + static const int mt7988_u30_phy_i2c1_pins[] = { 17, 18 }; 863 + static int mt7988_u30_phy_i2c1_funcs[] = { 2, 2 }; 864 + 865 + static const int mt7988_u32_phy_i2c1_pins[] = { 17, 18 }; 866 + static int mt7988_u32_phy_i2c1_funcs[] = { 3, 3 }; 867 + 868 + static const int mt7988_xfi_phy_pll_i2c3_pins[] = { 17, 18 }; 869 + static int mt7988_xfi_phy_pll_i2c3_funcs[] = { 4, 4 }; 870 + 871 + static const int mt7988_sgmii0_i2c_pins[] = { 17, 18 }; 872 + static int mt7988_sgmii0_i2c_funcs[] = { 5, 5 }; 873 + 874 + static const int mt7988_sgmii1_i2c_pins[] = { 17, 18 }; 875 + static int mt7988_sgmii1_i2c_funcs[] = { 6, 6 }; 876 + 877 + static const int mt7988_i2c1_2_pins[] = { 69, 70 }; 878 + static int mt7988_i2c1_2_funcs[] = { 2, 2 }; 879 + 880 + static const int mt7988_i2c2_0_pins[] = { 69, 70 }; 881 + static int mt7988_i2c2_0_funcs[] = { 4, 4 }; 882 + 883 + static const int mt7988_i2c2_1_pins[] = { 71, 72 }; 884 + static int mt7988_i2c2_1_funcs[] = { 1, 1 }; 885 + 886 + /* eth */ 887 + static const int mt7988_mdc_mdio0_pins[] = { 5, 6 }; 888 + static int mt7988_mdc_mdio0_funcs[] = { 1, 1 }; 889 + 890 + static const int mt7988_2p5g_ext_mdio_pins[] = { 28, 29 }; 891 + static int mt7988_2p5g_ext_mdio_funcs[] = { 6, 6 }; 892 + 893 + static const int mt7988_gbe_ext_mdio_pins[] = { 30, 31 }; 894 + static int mt7988_gbe_ext_mdio_funcs[] = { 6, 6 }; 895 + 896 + static const int mt7988_mdc_mdio1_pins[] = { 69, 70 }; 897 + static int mt7988_mdc_mdio1_funcs[] = { 1, 1 }; 898 + 899 + /* pcie */ 900 + static const int mt7988_pcie_wake_n0_0_pins[] = { 7 }; 901 + static int mt7988_pcie_wake_n0_0_funcs[] = { 1 }; 902 + 903 + static const int mt7988_pcie_clk_req_n0_0_pins[] = { 8 }; 904 + static int mt7988_pcie_clk_req_n0_0_funcs[] = { 1 }; 905 + 906 + static const int mt7988_pcie_wake_n3_0_pins[] = { 9 }; 907 + static int mt7988_pcie_wake_n3_0_funcs[] = { 1 }; 908 + 909 + static const int mt7988_pcie_clk_req_n3_pins[] = { 10 }; 910 + static int mt7988_pcie_clk_req_n3_funcs[] = { 1 }; 911 + 912 + static const int mt7988_pcie_clk_req_n0_1_pins[] = { 10 }; 913 + static int mt7988_pcie_clk_req_n0_1_funcs[] = { 2 }; 914 + 915 + static const int mt7988_pcie_p0_phy_i2c_pins[] = { 7, 8 }; 916 + static int mt7988_pcie_p0_phy_i2c_funcs[] = { 3, 3 }; 917 + 918 + static const int mt7988_pcie_p1_phy_i2c_pins[] = { 7, 8 }; 919 + static int mt7988_pcie_p1_phy_i2c_funcs[] = { 4, 4 }; 920 + 921 + static const int mt7988_pcie_p3_phy_i2c_pins[] = { 9, 10 }; 922 + static int mt7988_pcie_p3_phy_i2c_funcs[] = { 4, 4 }; 923 + 924 + static const int mt7988_pcie_p2_phy_i2c_pins[] = { 7, 8 }; 925 + static int mt7988_pcie_p2_phy_i2c_funcs[] = { 5, 5 }; 926 + 927 + static const int mt7988_ckm_phy_i2c_pins[] = { 9, 10 }; 928 + static int mt7988_ckm_phy_i2c_funcs[] = { 5, 5 }; 929 + 930 + static const int mt7988_pcie_wake_n0_1_pins[] = { 13 }; 931 + static int mt7988_pcie_wake_n0_1_funcs[] = { 2 }; 932 + 933 + static const int mt7988_pcie_wake_n3_1_pins[] = { 14 }; 934 + static int mt7988_pcie_wake_n3_1_funcs[] = { 2 }; 935 + 936 + static const int mt7988_pcie_2l_0_pereset_pins[] = { 19 }; 937 + static int mt7988_pcie_2l_0_pereset_funcs[] = { 1 }; 938 + 939 + static const int mt7988_pcie_1l_1_pereset_pins[] = { 20 }; 940 + static int mt7988_pcie_1l_1_pereset_funcs[] = { 1 }; 941 + 942 + static const int mt7988_pcie_clk_req_n2_1_pins[] = { 63 }; 943 + static int mt7988_pcie_clk_req_n2_1_funcs[] = { 2 }; 944 + 945 + static const int mt7988_pcie_2l_1_pereset_pins[] = { 73 }; 946 + static int mt7988_pcie_2l_1_pereset_funcs[] = { 1 }; 947 + 948 + static const int mt7988_pcie_1l_0_pereset_pins[] = { 74 }; 949 + static int mt7988_pcie_1l_0_pereset_funcs[] = { 1 }; 950 + 951 + static const int mt7988_pcie_wake_n1_0_pins[] = { 75 }; 952 + static int mt7988_pcie_wake_n1_0_funcs[] = { 1 }; 953 + 954 + static const int mt7988_pcie_clk_req_n1_pins[] = { 76 }; 955 + static int mt7988_pcie_clk_req_n1_funcs[] = { 1 }; 956 + 957 + static const int mt7988_pcie_wake_n2_0_pins[] = { 77 }; 958 + static int mt7988_pcie_wake_n2_0_funcs[] = { 1 }; 959 + 960 + static const int mt7988_pcie_clk_req_n2_0_pins[] = { 78 }; 961 + static int mt7988_pcie_clk_req_n2_0_funcs[] = { 1 }; 962 + 963 + static const int mt7988_pcie_wake_n2_1_pins[] = { 79 }; 964 + static int mt7988_pcie_wake_n2_1_funcs[] = { 2 }; 965 + 966 + /* pmic */ 967 + static const int mt7988_pmic_pins[] = { 11 }; 968 + static int mt7988_pmic_funcs[] = { 1 }; 969 + 970 + /* watchdog */ 971 + static const int mt7988_watchdog_pins[] = { 12 }; 972 + static int mt7988_watchdog_funcs[] = { 1 }; 973 + 974 + /* spi */ 975 + static const int mt7988_spi0_wp_hold_pins[] = { 22, 23 }; 976 + static int mt7988_spi0_wp_hold_funcs[] = { 1, 1 }; 977 + 978 + static const int mt7988_spi0_pins[] = { 24, 25, 26, 27 }; 979 + static int mt7988_spi0_funcs[] = { 1, 1, 1, 1 }; 980 + 981 + static const int mt7988_spi1_pins[] = { 28, 29, 30, 31 }; 982 + static int mt7988_spi1_funcs[] = { 1, 1, 1, 1 }; 983 + 984 + static const int mt7988_spi2_pins[] = { 32, 33, 34, 35 }; 985 + static int mt7988_spi2_funcs[] = { 1, 1, 1, 1 }; 986 + 987 + static const int mt7988_spi2_wp_hold_pins[] = { 36, 37 }; 988 + static int mt7988_spi2_wp_hold_funcs[] = { 1, 1 }; 989 + 990 + /* flash */ 991 + static const int mt7988_snfi_pins[] = { 22, 23, 24, 25, 26, 27 }; 992 + static int mt7988_snfi_funcs[] = { 2, 2, 2, 2, 2, 2 }; 993 + 994 + static const int mt7988_emmc_45_pins[] = { 995 + 21, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 996 + }; 997 + static int mt7988_emmc_45_funcs[] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }; 998 + 999 + static const int mt7988_sdcard_pins[] = { 32, 33, 34, 35, 36, 37 }; 1000 + static int mt7988_sdcard_funcs[] = { 5, 5, 5, 5, 5, 5 }; 1001 + 1002 + static const int mt7988_emmc_51_pins[] = { 38, 39, 40, 41, 42, 43, 1003 + 44, 45, 46, 47, 48, 49 }; 1004 + static int mt7988_emmc_51_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 1005 + 1006 + /* uart */ 1007 + static const int mt7988_uart2_pins[] = { 0, 1, 2, 3 }; 1008 + static int mt7988_uart2_funcs[] = { 1, 1, 1, 1 }; 1009 + 1010 + static const int mt7988_tops_uart0_0_pins[] = { 22, 23 }; 1011 + static int mt7988_tops_uart0_0_funcs[] = { 3, 3 }; 1012 + 1013 + static const int mt7988_uart2_0_pins[] = { 28, 29, 30, 31 }; 1014 + static int mt7988_uart2_0_funcs[] = { 2, 2, 2, 2 }; 1015 + 1016 + static const int mt7988_uart1_0_pins[] = { 32, 33, 34, 35 }; 1017 + static int mt7988_uart1_0_funcs[] = { 2, 2, 2, 2 }; 1018 + 1019 + static const int mt7988_uart2_1_pins[] = { 32, 33, 34, 35 }; 1020 + static int mt7988_uart2_1_funcs[] = { 3, 3, 3, 3 }; 1021 + 1022 + static const int mt7988_net_wo0_uart_txd_0_pins[] = { 28 }; 1023 + static int mt7988_net_wo0_uart_txd_0_funcs[] = { 3 }; 1024 + 1025 + static const int mt7988_net_wo1_uart_txd_0_pins[] = { 29 }; 1026 + static int mt7988_net_wo1_uart_txd_0_funcs[] = { 3 }; 1027 + 1028 + static const int mt7988_net_wo2_uart_txd_0_pins[] = { 30 }; 1029 + static int mt7988_net_wo2_uart_txd_0_funcs[] = { 3 }; 1030 + 1031 + static const int mt7988_tops_uart1_0_pins[] = { 28, 29 }; 1032 + static int mt7988_tops_uart1_0_funcs[] = { 4, 4 }; 1033 + 1034 + static const int mt7988_tops_uart0_1_pins[] = { 30, 31 }; 1035 + static int mt7988_tops_uart0_1_funcs[] = { 4, 4 }; 1036 + 1037 + static const int mt7988_tops_uart1_1_pins[] = { 36, 37 }; 1038 + static int mt7988_tops_uart1_1_funcs[] = { 3, 3 }; 1039 + 1040 + static const int mt7988_uart0_pins[] = { 55, 56 }; 1041 + static int mt7988_uart0_funcs[] = { 1, 1 }; 1042 + 1043 + static const int mt7988_tops_uart0_2_pins[] = { 55, 56 }; 1044 + static int mt7988_tops_uart0_2_funcs[] = { 2, 2 }; 1045 + 1046 + static const int mt7988_uart2_2_pins[] = { 50, 51, 52, 53 }; 1047 + static int mt7988_uart2_2_funcs[] = { 2, 2, 2, 2 }; 1048 + 1049 + static const int mt7988_uart1_1_pins[] = { 58, 59, 60, 61 }; 1050 + static int mt7988_uart1_1_funcs[] = { 2, 2, 2, 2 }; 1051 + 1052 + static const int mt7988_uart2_3_pins[] = { 58, 59, 60, 61 }; 1053 + static int mt7988_uart2_3_funcs[] = { 3, 3, 3, 3 }; 1054 + 1055 + static const int mt7988_uart1_2_pins[] = { 80, 81, 82, 83 }; 1056 + static int mt7988_uart1_2_funcs[] = { 1, 1, 1, 1 }; 1057 + 1058 + static const int mt7988_uart1_2_lite_pins[] = { 80, 81 }; 1059 + static int mt7988_uart1_2_lite_funcs[] = { 1, 1 }; 1060 + 1061 + static const int mt7988_tops_uart1_2_pins[] = { 80, 81 }; 1062 + static int mt7988_tops_uart1_2_funcs[] = { 4, 4, }; 1063 + 1064 + static const int mt7988_net_wo0_uart_txd_1_pins[] = { 80 }; 1065 + static int mt7988_net_wo0_uart_txd_1_funcs[] = { 3 }; 1066 + 1067 + static const int mt7988_net_wo1_uart_txd_1_pins[] = { 81 }; 1068 + static int mt7988_net_wo1_uart_txd_1_funcs[] = { 3 }; 1069 + 1070 + static const int mt7988_net_wo2_uart_txd_1_pins[] = { 82 }; 1071 + static int mt7988_net_wo2_uart_txd_1_funcs[] = { 3 }; 1072 + 1073 + /* udi */ 1074 + static const int mt7988_udi_pins[] = { 32, 33, 34, 35, 36 }; 1075 + static int mt7988_udi_funcs[] = { 4, 4, 4, 4, 4 }; 1076 + 1077 + /* i2s */ 1078 + static const int mt7988_i2s_pins[] = { 50, 51, 52, 53, 54 }; 1079 + static int mt7988_i2s_funcs[] = { 1, 1, 1, 1, 1 }; 1080 + 1081 + /* pcm */ 1082 + static const int mt7988_pcm_pins[] = { 50, 51, 52, 53 }; 1083 + static int mt7988_pcm_funcs[] = { 1, 1, 1, 1 }; 1084 + 1085 + /* led */ 1086 + static const int mt7988_gbe0_led1_pins[] = { 58 }; 1087 + static int mt7988_gbe0_led1_funcs[] = { 6 }; 1088 + static const int mt7988_gbe1_led1_pins[] = { 59 }; 1089 + static int mt7988_gbe1_led1_funcs[] = { 6 }; 1090 + static const int mt7988_gbe2_led1_pins[] = { 60 }; 1091 + static int mt7988_gbe2_led1_funcs[] = { 6 }; 1092 + static const int mt7988_gbe3_led1_pins[] = { 61 }; 1093 + static int mt7988_gbe3_led1_funcs[] = { 6 }; 1094 + 1095 + static const int mt7988_2p5gbe_led1_pins[] = { 62 }; 1096 + static int mt7988_2p5gbe_led1_funcs[] = { 6 }; 1097 + 1098 + static const int mt7988_gbe0_led0_pins[] = { 64 }; 1099 + static int mt7988_gbe0_led0_funcs[] = { 1 }; 1100 + static const int mt7988_gbe1_led0_pins[] = { 65 }; 1101 + static int mt7988_gbe1_led0_funcs[] = { 1 }; 1102 + static const int mt7988_gbe2_led0_pins[] = { 66 }; 1103 + static int mt7988_gbe2_led0_funcs[] = { 1 }; 1104 + static const int mt7988_gbe3_led0_pins[] = { 67 }; 1105 + static int mt7988_gbe3_led0_funcs[] = { 1 }; 1106 + 1107 + static const int mt7988_2p5gbe_led0_pins[] = { 68 }; 1108 + static int mt7988_2p5gbe_led0_funcs[] = { 1 }; 1109 + 1110 + /* usb */ 1111 + static const int mt7988_drv_vbus_p1_pins[] = { 63 }; 1112 + static int mt7988_drv_vbus_p1_funcs[] = { 1 }; 1113 + 1114 + static const int mt7988_drv_vbus_pins[] = { 79 }; 1115 + static int mt7988_drv_vbus_funcs[] = { 1 }; 1116 + 1117 + static const struct group_desc mt7988_groups[] = { 1118 + /* @GPIO(0,1,2,3): uart2 */ 1119 + PINCTRL_PIN_GROUP("uart2", mt7988_uart2), 1120 + /* @GPIO(0,1,2,3,4): tops_jtag0_0 */ 1121 + PINCTRL_PIN_GROUP("tops_jtag0_0", mt7988_tops_jtag0_0), 1122 + /* @GPIO(2,3): int_usxgmii */ 1123 + PINCTRL_PIN_GROUP("int_usxgmii", mt7988_int_usxgmii), 1124 + /* @GPIO(0,1,2,3,4): dfd */ 1125 + PINCTRL_PIN_GROUP("dfd", mt7988_dfd), 1126 + /* @GPIO(0,1): xfi_phy0_i2c0 */ 1127 + PINCTRL_PIN_GROUP("xfi_phy0_i2c0", mt7988_xfi_phy0_i2c0), 1128 + /* @GPIO(0,1): xfi_phy1_i2c0 */ 1129 + PINCTRL_PIN_GROUP("xfi_phy1_i2c0", mt7988_xfi_phy1_i2c0), 1130 + /* @GPIO(3,4): xfi_phy_pll_i2c0 */ 1131 + PINCTRL_PIN_GROUP("xfi_phy_pll_i2c0", mt7988_xfi_phy_pll_i2c0), 1132 + /* @GPIO(3,4): xfi_phy_pll_i2c1 */ 1133 + PINCTRL_PIN_GROUP("xfi_phy_pll_i2c1", mt7988_xfi_phy_pll_i2c1), 1134 + /* @GPIO(4): pwm7 */ 1135 + PINCTRL_PIN_GROUP("pwm7_0", mt7988_pwm7_0), 1136 + /* @GPIO(5,6) i2c0_0 */ 1137 + PINCTRL_PIN_GROUP("i2c0_0", mt7988_i2c0_0), 1138 + /* @GPIO(5,6) i2c1_sfp */ 1139 + PINCTRL_PIN_GROUP("i2c1_sfp", mt7988_i2c1_sfp), 1140 + /* @GPIO(5,6) xfi_pextp_phy0_i2c */ 1141 + PINCTRL_PIN_GROUP("xfi_pextp_phy0_i2c", mt7988_xfi_pextp_phy0_i2c), 1142 + /* @GPIO(5,6) xfi_pextp_phy1_i2c */ 1143 + PINCTRL_PIN_GROUP("xfi_pextp_phy1_i2c", mt7988_xfi_pextp_phy1_i2c), 1144 + /* @GPIO(5,6) mdc_mdio0 */ 1145 + PINCTRL_PIN_GROUP("mdc_mdio0", mt7988_mdc_mdio0), 1146 + /* @GPIO(7): pcie_wake_n0_0 */ 1147 + PINCTRL_PIN_GROUP("pcie_wake_n0_0", mt7988_pcie_wake_n0_0), 1148 + /* @GPIO(8): pcie_clk_req_n0_0 */ 1149 + PINCTRL_PIN_GROUP("pcie_clk_req_n0_0", mt7988_pcie_clk_req_n0_0), 1150 + /* @GPIO(9): pcie_wake_n3_0 */ 1151 + PINCTRL_PIN_GROUP("pcie_wake_n3_0", mt7988_pcie_wake_n3_0), 1152 + /* @GPIO(10): pcie_clk_req_n3 */ 1153 + PINCTRL_PIN_GROUP("pcie_clk_req_n3", mt7988_pcie_clk_req_n3), 1154 + /* @GPIO(10): pcie_clk_req_n0_1 */ 1155 + PINCTRL_PIN_GROUP("pcie_clk_req_n0_1", mt7988_pcie_clk_req_n0_1), 1156 + /* @GPIO(7,8) pcie_p0_phy_i2c */ 1157 + PINCTRL_PIN_GROUP("pcie_p0_phy_i2c", mt7988_pcie_p0_phy_i2c), 1158 + /* @GPIO(7,8) pcie_p1_phy_i2c */ 1159 + PINCTRL_PIN_GROUP("pcie_p1_phy_i2c", mt7988_pcie_p1_phy_i2c), 1160 + /* @GPIO(7,8) pcie_p2_phy_i2c */ 1161 + PINCTRL_PIN_GROUP("pcie_p2_phy_i2c", mt7988_pcie_p2_phy_i2c), 1162 + /* @GPIO(9,10) pcie_p3_phy_i2c */ 1163 + PINCTRL_PIN_GROUP("pcie_p3_phy_i2c", mt7988_pcie_p3_phy_i2c), 1164 + /* @GPIO(9,10) ckm_phy_i2c */ 1165 + PINCTRL_PIN_GROUP("ckm_phy_i2c", mt7988_ckm_phy_i2c), 1166 + /* @GPIO(11): pmic */ 1167 + PINCTRL_PIN_GROUP("pcie_pmic", mt7988_pmic), 1168 + /* @GPIO(12): watchdog */ 1169 + PINCTRL_PIN_GROUP("watchdog", mt7988_watchdog), 1170 + /* @GPIO(13): pcie_wake_n0_1 */ 1171 + PINCTRL_PIN_GROUP("pcie_wake_n0_1", mt7988_pcie_wake_n0_1), 1172 + /* @GPIO(14): pcie_wake_n3_1 */ 1173 + PINCTRL_PIN_GROUP("pcie_wake_n3_1", mt7988_pcie_wake_n3_1), 1174 + /* @GPIO(15,16) i2c0_1 */ 1175 + PINCTRL_PIN_GROUP("i2c0_1", mt7988_i2c0_1), 1176 + /* @GPIO(15,16) u30_phy_i2c0 */ 1177 + PINCTRL_PIN_GROUP("u30_phy_i2c0", mt7988_u30_phy_i2c0), 1178 + /* @GPIO(15,16) u32_phy_i2c0 */ 1179 + PINCTRL_PIN_GROUP("u32_phy_i2c0", mt7988_u32_phy_i2c0), 1180 + /* @GPIO(15,16) xfi_phy0_i2c1 */ 1181 + PINCTRL_PIN_GROUP("xfi_phy0_i2c1", mt7988_xfi_phy0_i2c1), 1182 + /* @GPIO(15,16) xfi_phy1_i2c1 */ 1183 + PINCTRL_PIN_GROUP("xfi_phy1_i2c1", mt7988_xfi_phy1_i2c1), 1184 + /* @GPIO(15,16) xfi_phy_pll_i2c2 */ 1185 + PINCTRL_PIN_GROUP("xfi_phy_pll_i2c2", mt7988_xfi_phy_pll_i2c2), 1186 + /* @GPIO(17,18) i2c1_0 */ 1187 + PINCTRL_PIN_GROUP("i2c1_0", mt7988_i2c1_0), 1188 + /* @GPIO(17,18) u30_phy_i2c1 */ 1189 + PINCTRL_PIN_GROUP("u30_phy_i2c1", mt7988_u30_phy_i2c1), 1190 + /* @GPIO(17,18) u32_phy_i2c1 */ 1191 + PINCTRL_PIN_GROUP("u32_phy_i2c1", mt7988_u32_phy_i2c1), 1192 + /* @GPIO(17,18) xfi_phy_pll_i2c3 */ 1193 + PINCTRL_PIN_GROUP("xfi_phy_pll_i2c3", mt7988_xfi_phy_pll_i2c3), 1194 + /* @GPIO(17,18) sgmii0_i2c */ 1195 + PINCTRL_PIN_GROUP("sgmii0_i2c", mt7988_sgmii0_i2c), 1196 + /* @GPIO(17,18) sgmii1_i2c */ 1197 + PINCTRL_PIN_GROUP("sgmii1_i2c", mt7988_sgmii1_i2c), 1198 + /* @GPIO(19): pcie_2l_0_pereset */ 1199 + PINCTRL_PIN_GROUP("pcie_2l_0_pereset", mt7988_pcie_2l_0_pereset), 1200 + /* @GPIO(20): pcie_1l_1_pereset */ 1201 + PINCTRL_PIN_GROUP("pcie_1l_1_pereset", mt7988_pcie_1l_1_pereset), 1202 + /* @GPIO(21): pwm1 */ 1203 + PINCTRL_PIN_GROUP("pwm1", mt7988_pwm1), 1204 + /* @GPIO(22,23) spi0_wp_hold */ 1205 + PINCTRL_PIN_GROUP("spi0_wp_hold", mt7988_spi0_wp_hold), 1206 + /* @GPIO(24,25,26,27) spi0 */ 1207 + PINCTRL_PIN_GROUP("spi0", mt7988_spi0), 1208 + /* @GPIO(28,29,30,31) spi1 */ 1209 + PINCTRL_PIN_GROUP("spi1", mt7988_spi1), 1210 + /* @GPIO(32,33,34,35) spi2 */ 1211 + PINCTRL_PIN_GROUP("spi2", mt7988_spi2), 1212 + /* @GPIO(36,37) spi2_wp_hold */ 1213 + PINCTRL_PIN_GROUP("spi2_wp_hold", mt7988_spi2_wp_hold), 1214 + /* @GPIO(22,23,24,25,26,27) snfi */ 1215 + PINCTRL_PIN_GROUP("snfi", mt7988_snfi), 1216 + /* @GPIO(22,23) tops_uart0_0 */ 1217 + PINCTRL_PIN_GROUP("tops_uart0_0", mt7988_tops_uart0_0), 1218 + /* @GPIO(28,29,30,31) uart2_0 */ 1219 + PINCTRL_PIN_GROUP("uart2_0", mt7988_uart2_0), 1220 + /* @GPIO(32,33,34,35) uart1_0 */ 1221 + PINCTRL_PIN_GROUP("uart1_0", mt7988_uart1_0), 1222 + /* @GPIO(32,33,34,35) uart2_1 */ 1223 + PINCTRL_PIN_GROUP("uart2_1", mt7988_uart2_1), 1224 + /* @GPIO(28) net_wo0_uart_txd_0 */ 1225 + PINCTRL_PIN_GROUP("net_wo0_uart_txd_0", mt7988_net_wo0_uart_txd_0), 1226 + /* @GPIO(29) net_wo1_uart_txd_0 */ 1227 + PINCTRL_PIN_GROUP("net_wo1_uart_txd_0", mt7988_net_wo1_uart_txd_0), 1228 + /* @GPIO(30) net_wo2_uart_txd_0 */ 1229 + PINCTRL_PIN_GROUP("net_wo2_uart_txd_0", mt7988_net_wo2_uart_txd_0), 1230 + /* @GPIO(28,29) tops_uart1_0 */ 1231 + PINCTRL_PIN_GROUP("tops_uart0_0", mt7988_tops_uart1_0), 1232 + /* @GPIO(30,31) tops_uart0_1 */ 1233 + PINCTRL_PIN_GROUP("tops_uart0_1", mt7988_tops_uart0_1), 1234 + /* @GPIO(36,37) tops_uart1_1 */ 1235 + PINCTRL_PIN_GROUP("tops_uart1_1", mt7988_tops_uart1_1), 1236 + /* @GPIO(32,33,34,35,36) udi */ 1237 + PINCTRL_PIN_GROUP("udi", mt7988_udi), 1238 + /* @GPIO(21,28,29,30,31,32,33,34,35,36,37) emmc_45 */ 1239 + PINCTRL_PIN_GROUP("emmc_45", mt7988_emmc_45), 1240 + /* @GPIO(32,33,34,35,36,37) sdcard */ 1241 + PINCTRL_PIN_GROUP("sdcard", mt7988_sdcard), 1242 + /* @GPIO(38,39,40,41,42,43,44,45,46,47,48,49) emmc_51 */ 1243 + PINCTRL_PIN_GROUP("emmc_51", mt7988_emmc_51), 1244 + /* @GPIO(28,29) 2p5g_ext_mdio */ 1245 + PINCTRL_PIN_GROUP("2p5g_ext_mdio", mt7988_2p5g_ext_mdio), 1246 + /* @GPIO(30,31) gbe_ext_mdio */ 1247 + PINCTRL_PIN_GROUP("gbe_ext_mdio", mt7988_gbe_ext_mdio), 1248 + /* @GPIO(50,51,52,53,54) i2s */ 1249 + PINCTRL_PIN_GROUP("i2s", mt7988_i2s), 1250 + /* @GPIO(50,51,52,53) pcm */ 1251 + PINCTRL_PIN_GROUP("pcm", mt7988_pcm), 1252 + /* @GPIO(55,56) uart0 */ 1253 + PINCTRL_PIN_GROUP("uart0", mt7988_uart0), 1254 + /* @GPIO(55,56) tops_uart0_2 */ 1255 + PINCTRL_PIN_GROUP("tops_uart0_2", mt7988_tops_uart0_2), 1256 + /* @GPIO(50,51,52,53) uart2_2 */ 1257 + PINCTRL_PIN_GROUP("uart2_2", mt7988_uart2_2), 1258 + /* @GPIO(50,51,52,53,54) wo0_jtag */ 1259 + PINCTRL_PIN_GROUP("wo0_jtag", mt7988_wo0_jtag), 1260 + /* @GPIO(50,51,52,53,54) wo1-wo1_jtag */ 1261 + PINCTRL_PIN_GROUP("wo1_jtag", mt7988_wo1_jtag), 1262 + /* @GPIO(50,51,52,53,54) wo2_jtag */ 1263 + PINCTRL_PIN_GROUP("wo2_jtag", mt7988_wo2_jtag), 1264 + /* @GPIO(57) pwm0 */ 1265 + PINCTRL_PIN_GROUP("pwm0", mt7988_pwm0), 1266 + /* @GPIO(58) pwm2_0 */ 1267 + PINCTRL_PIN_GROUP("pwm2_0", mt7988_pwm2_0), 1268 + /* @GPIO(59) pwm3_0 */ 1269 + PINCTRL_PIN_GROUP("pwm3_0", mt7988_pwm3_0), 1270 + /* @GPIO(60) pwm4_0 */ 1271 + PINCTRL_PIN_GROUP("pwm4_0", mt7988_pwm4_0), 1272 + /* @GPIO(61) pwm5_0 */ 1273 + PINCTRL_PIN_GROUP("pwm5_0", mt7988_pwm5_0), 1274 + /* @GPIO(58,59,60,61,62) jtag */ 1275 + PINCTRL_PIN_GROUP("jtag", mt7988_jtag), 1276 + /* @GPIO(58,59,60,61,62) tops_jtag0_1 */ 1277 + PINCTRL_PIN_GROUP("tops_jtag0_1", mt7988_tops_jtag0_1), 1278 + /* @GPIO(58,59,60,61) uart2_3 */ 1279 + PINCTRL_PIN_GROUP("uart2_3", mt7988_uart2_3), 1280 + /* @GPIO(58,59,60,61) uart1_1 */ 1281 + PINCTRL_PIN_GROUP("uart1_1", mt7988_uart1_1), 1282 + /* @GPIO(58,59,60,61) gbe_led1 */ 1283 + PINCTRL_PIN_GROUP("gbe0_led1", mt7988_gbe0_led1), 1284 + PINCTRL_PIN_GROUP("gbe1_led1", mt7988_gbe1_led1), 1285 + PINCTRL_PIN_GROUP("gbe2_led1", mt7988_gbe2_led1), 1286 + PINCTRL_PIN_GROUP("gbe3_led1", mt7988_gbe3_led1), 1287 + /* @GPIO(62) pwm6_0 */ 1288 + PINCTRL_PIN_GROUP("pwm6_0", mt7988_pwm6_0), 1289 + /* @GPIO(62) 2p5gbe_led1 */ 1290 + PINCTRL_PIN_GROUP("2p5gbe_led1", mt7988_2p5gbe_led1), 1291 + /* @GPIO(64,65,66,67) gbe_led0 */ 1292 + PINCTRL_PIN_GROUP("gbe0_led0", mt7988_gbe0_led0), 1293 + PINCTRL_PIN_GROUP("gbe1_led0", mt7988_gbe1_led0), 1294 + PINCTRL_PIN_GROUP("gbe2_led0", mt7988_gbe2_led0), 1295 + PINCTRL_PIN_GROUP("gbe3_led0", mt7988_gbe3_led0), 1296 + /* @GPIO(68) 2p5gbe_led0 */ 1297 + PINCTRL_PIN_GROUP("2p5gbe_led0", mt7988_2p5gbe_led0), 1298 + /* @GPIO(63) drv_vbus_p1 */ 1299 + PINCTRL_PIN_GROUP("drv_vbus_p1", mt7988_drv_vbus_p1), 1300 + /* @GPIO(63) pcie_clk_req_n2_1 */ 1301 + PINCTRL_PIN_GROUP("pcie_clk_req_n2_1", mt7988_pcie_clk_req_n2_1), 1302 + /* @GPIO(69, 70) mdc_mdio1 */ 1303 + PINCTRL_PIN_GROUP("mdc_mdio1", mt7988_mdc_mdio1), 1304 + /* @GPIO(69, 70) i2c1_2 */ 1305 + PINCTRL_PIN_GROUP("i2c1_2", mt7988_i2c1_2), 1306 + /* @GPIO(69) pwm6 */ 1307 + PINCTRL_PIN_GROUP("pwm6", mt7988_pwm6), 1308 + /* @GPIO(70) pwm7 */ 1309 + PINCTRL_PIN_GROUP("pwm7", mt7988_pwm7), 1310 + /* @GPIO(69,70) i2c2_0 */ 1311 + PINCTRL_PIN_GROUP("i2c2_0", mt7988_i2c2_0), 1312 + /* @GPIO(71,72) i2c2_1 */ 1313 + PINCTRL_PIN_GROUP("i2c2_1", mt7988_i2c2_1), 1314 + /* @GPIO(73) pcie_2l_1_pereset */ 1315 + PINCTRL_PIN_GROUP("pcie_2l_1_pereset", mt7988_pcie_2l_1_pereset), 1316 + /* @GPIO(74) pcie_1l_0_pereset */ 1317 + PINCTRL_PIN_GROUP("pcie_1l_0_pereset", mt7988_pcie_1l_0_pereset), 1318 + /* @GPIO(75) pcie_wake_n1_0 */ 1319 + PINCTRL_PIN_GROUP("pcie_wake_n1_0", mt7988_pcie_wake_n1_0), 1320 + /* @GPIO(76) pcie_clk_req_n1 */ 1321 + PINCTRL_PIN_GROUP("pcie_clk_req_n1", mt7988_pcie_clk_req_n1), 1322 + /* @GPIO(77) pcie_wake_n2_0 */ 1323 + PINCTRL_PIN_GROUP("pcie_wake_n2_0", mt7988_pcie_wake_n2_0), 1324 + /* @GPIO(78) pcie_clk_req_n2_0 */ 1325 + PINCTRL_PIN_GROUP("pcie_clk_req_n2_0", mt7988_pcie_clk_req_n2_0), 1326 + /* @GPIO(79) drv_vbus */ 1327 + PINCTRL_PIN_GROUP("drv_vbus", mt7988_drv_vbus), 1328 + /* @GPIO(79) pcie_wake_n2_1 */ 1329 + PINCTRL_PIN_GROUP("pcie_wake_n2_1", mt7988_pcie_wake_n2_1), 1330 + /* @GPIO(80,81,82,83) uart1_2 */ 1331 + PINCTRL_PIN_GROUP("uart1_2", mt7988_uart1_2), 1332 + /* @GPIO(80,81) uart1_2_lite */ 1333 + PINCTRL_PIN_GROUP("uart1_2_lite", mt7988_uart1_2_lite), 1334 + /* @GPIO(80) pwm2 */ 1335 + PINCTRL_PIN_GROUP("pwm2", mt7988_pwm2), 1336 + /* @GPIO(81) pwm3 */ 1337 + PINCTRL_PIN_GROUP("pwm3", mt7988_pwm3), 1338 + /* @GPIO(82) pwm4 */ 1339 + PINCTRL_PIN_GROUP("pwm4", mt7988_pwm4), 1340 + /* @GPIO(83) pwm5 */ 1341 + PINCTRL_PIN_GROUP("pwm5", mt7988_pwm5), 1342 + /* @GPIO(80) net_wo0_uart_txd_0 */ 1343 + PINCTRL_PIN_GROUP("net_wo0_uart_txd_0", mt7988_net_wo0_uart_txd_0), 1344 + /* @GPIO(81) net_wo1_uart_txd_0 */ 1345 + PINCTRL_PIN_GROUP("net_wo1_uart_txd_0", mt7988_net_wo1_uart_txd_0), 1346 + /* @GPIO(82) net_wo2_uart_txd_0 */ 1347 + PINCTRL_PIN_GROUP("net_wo2_uart_txd_0", mt7988_net_wo2_uart_txd_0), 1348 + /* @GPIO(80,81) tops_uart1_2 */ 1349 + PINCTRL_PIN_GROUP("tops_uart1_2", mt7988_tops_uart1_2), 1350 + /* @GPIO(80) net_wo0_uart_txd_1 */ 1351 + PINCTRL_PIN_GROUP("net_wo0_uart_txd_1", mt7988_net_wo0_uart_txd_1), 1352 + /* @GPIO(81) net_wo1_uart_txd_1 */ 1353 + PINCTRL_PIN_GROUP("net_wo1_uart_txd_1", mt7988_net_wo1_uart_txd_1), 1354 + /* @GPIO(82) net_wo2_uart_txd_1 */ 1355 + PINCTRL_PIN_GROUP("net_wo2_uart_txd_1", mt7988_net_wo2_uart_txd_1), 1356 + }; 1357 + 1358 + /* Joint those groups owning the same capability in user point of view which 1359 + * allows that people tend to use through the device tree. 1360 + */ 1361 + static const char * const mt7988_jtag_groups[] = { 1362 + "tops_jtag0_0", "wo0_jtag", "wo1_jtag", 1363 + "wo2_jtag", "jtag", "tops_jtag0_1", 1364 + }; 1365 + static const char * const mt7988_int_usxgmii_groups[] = { 1366 + "int_usxgmii", 1367 + }; 1368 + static const char * const mt7988_pwm_groups[] = { 1369 + "pwm0", "pwm1", "pwm2", "pwm2_0", "pwm3", "pwm3_0", "pwm4", "pwm4_0", 1370 + "pwm5", "pwm5_0", "pwm6", "pwm6_0", "pwm7", "pwm7_0", 1371 + 1372 + }; 1373 + static const char * const mt7988_dfd_groups[] = { 1374 + "dfd", 1375 + }; 1376 + static const char * const mt7988_i2c_groups[] = { 1377 + "xfi_phy0_i2c0", 1378 + "xfi_phy1_i2c0", 1379 + "xfi_phy_pll_i2c0", 1380 + "xfi_phy_pll_i2c1", 1381 + "i2c0_0", 1382 + "i2c1_sfp", 1383 + "xfi_pextp_phy0_i2c", 1384 + "xfi_pextp_phy1_i2c", 1385 + "i2c0_1", 1386 + "u30_phy_i2c0", 1387 + "u32_phy_i2c0", 1388 + "xfi_phy0_i2c1", 1389 + "xfi_phy1_i2c1", 1390 + "xfi_phy_pll_i2c2", 1391 + "i2c1_0", 1392 + "u30_phy_i2c1", 1393 + "u32_phy_i2c1", 1394 + "xfi_phy_pll_i2c3", 1395 + "sgmii0_i2c", 1396 + "sgmii1_i2c", 1397 + "i2c1_2", 1398 + "i2c2_0", 1399 + "i2c2_1", 1400 + }; 1401 + static const char * const mt7988_ethernet_groups[] = { 1402 + "mdc_mdio0", 1403 + "2p5g_ext_mdio", 1404 + "gbe_ext_mdio", 1405 + "mdc_mdio1", 1406 + }; 1407 + static const char * const mt7988_pcie_groups[] = { 1408 + "pcie_wake_n0_0", "pcie_clk_req_n0_0", "pcie_wake_n3_0", 1409 + "pcie_clk_req_n3", "pcie_p0_phy_i2c", "pcie_p1_phy_i2c", 1410 + "pcie_p3_phy_i2c", "pcie_p2_phy_i2c", "ckm_phy_i2c", 1411 + "pcie_wake_n0_1", "pcie_wake_n3_1", "pcie_2l_0_pereset", 1412 + "pcie_1l_1_pereset", "pcie_clk_req_n2_1", "pcie_2l_1_pereset", 1413 + "pcie_1l_0_pereset", "pcie_wake_n1_0", "pcie_clk_req_n1", 1414 + "pcie_wake_n2_0", "pcie_clk_req_n2_0", "pcie_wake_n2_1", 1415 + "pcie_clk_req_n0_1" 1416 + }; 1417 + static const char * const mt7988_pmic_groups[] = { 1418 + "pmic", 1419 + }; 1420 + static const char * const mt7988_wdt_groups[] = { 1421 + "watchdog", 1422 + }; 1423 + static const char * const mt7988_spi_groups[] = { 1424 + "spi0", "spi0_wp_hold", "spi1", "spi2", "spi2_wp_hold", 1425 + }; 1426 + static const char * const mt7988_flash_groups[] = { "emmc_45", "sdcard", "snfi", 1427 + "emmc_51" }; 1428 + static const char * const mt7988_uart_groups[] = { 1429 + "uart2", 1430 + "tops_uart0_0", 1431 + "uart2_0", 1432 + "uart1_0", 1433 + "uart2_1", 1434 + "net_wo0_uart_txd_0", 1435 + "net_wo1_uart_txd_0", 1436 + "net_wo2_uart_txd_0", 1437 + "tops_uart1_0", 1438 + "ops_uart0_1", 1439 + "ops_uart1_1", 1440 + "uart0", 1441 + "tops_uart0_2", 1442 + "uart1_1", 1443 + "uart2_3", 1444 + "uart1_2", 1445 + "uart1_2_lite", 1446 + "tops_uart1_2", 1447 + "net_wo0_uart_txd_1", 1448 + "net_wo1_uart_txd_1", 1449 + "net_wo2_uart_txd_1", 1450 + }; 1451 + static const char * const mt7988_udi_groups[] = { 1452 + "udi", 1453 + }; 1454 + static const char * const mt7988_audio_groups[] = { 1455 + "i2s", "pcm", 1456 + }; 1457 + static const char * const mt7988_led_groups[] = { 1458 + "gbe0_led1", "gbe1_led1", "gbe2_led1", "gbe3_led1", "2p5gbe_led1", 1459 + "gbe0_led0", "gbe1_led0", "gbe2_led0", "gbe3_led0", "2p5gbe_led0", 1460 + "wf5g_led0", "wf5g_led1", 1461 + }; 1462 + static const char * const mt7988_usb_groups[] = { 1463 + "drv_vbus", 1464 + "drv_vbus_p1", 1465 + }; 1466 + 1467 + static const struct function_desc mt7988_functions[] = { 1468 + { { "audio", mt7988_audio_groups, ARRAY_SIZE(mt7988_audio_groups) }, 1469 + NULL }, 1470 + { { "jtag", mt7988_jtag_groups, ARRAY_SIZE(mt7988_jtag_groups) }, 1471 + NULL }, 1472 + { { "int_usxgmii", mt7988_int_usxgmii_groups, 1473 + ARRAY_SIZE(mt7988_int_usxgmii_groups) }, 1474 + NULL }, 1475 + { { "pwm", mt7988_pwm_groups, ARRAY_SIZE(mt7988_pwm_groups) }, NULL }, 1476 + { { "dfd", mt7988_dfd_groups, ARRAY_SIZE(mt7988_dfd_groups) }, NULL }, 1477 + { { "i2c", mt7988_i2c_groups, ARRAY_SIZE(mt7988_i2c_groups) }, NULL }, 1478 + { { "eth", mt7988_ethernet_groups, ARRAY_SIZE(mt7988_ethernet_groups) }, 1479 + NULL }, 1480 + { { "pcie", mt7988_pcie_groups, ARRAY_SIZE(mt7988_pcie_groups) }, 1481 + NULL }, 1482 + { { "pmic", mt7988_pmic_groups, ARRAY_SIZE(mt7988_pmic_groups) }, 1483 + NULL }, 1484 + { { "watchdog", mt7988_wdt_groups, ARRAY_SIZE(mt7988_wdt_groups) }, 1485 + NULL }, 1486 + { { "spi", mt7988_spi_groups, ARRAY_SIZE(mt7988_spi_groups) }, NULL }, 1487 + { { "flash", mt7988_flash_groups, ARRAY_SIZE(mt7988_flash_groups) }, 1488 + NULL }, 1489 + { { "uart", mt7988_uart_groups, ARRAY_SIZE(mt7988_uart_groups) }, 1490 + NULL }, 1491 + { { "udi", mt7988_udi_groups, ARRAY_SIZE(mt7988_udi_groups) }, NULL }, 1492 + { { "usb", mt7988_usb_groups, ARRAY_SIZE(mt7988_usb_groups) }, NULL }, 1493 + { { "led", mt7988_led_groups, ARRAY_SIZE(mt7988_led_groups) }, NULL }, 1494 + }; 1495 + 1496 + static const struct mtk_eint_hw mt7988_eint_hw = { 1497 + .port_mask = 7, 1498 + .ports = 7, 1499 + .ap_num = ARRAY_SIZE(mt7988_pins), 1500 + .db_cnt = 16, 1501 + }; 1502 + 1503 + static const char * const mt7988_pinctrl_register_base_names[] = { 1504 + "gpio", "iocfg_tr", "iocfg_br", 1505 + "iocfg_rb", "iocfg_lb", "iocfg_tl", 1506 + }; 1507 + 1508 + static const struct mtk_pin_soc mt7988_data = { 1509 + .reg_cal = mt7988_reg_cals, 1510 + .pins = mt7988_pins, 1511 + .npins = ARRAY_SIZE(mt7988_pins), 1512 + .grps = mt7988_groups, 1513 + .ngrps = ARRAY_SIZE(mt7988_groups), 1514 + .funcs = mt7988_functions, 1515 + .nfuncs = ARRAY_SIZE(mt7988_functions), 1516 + .eint_hw = &mt7988_eint_hw, 1517 + .gpio_m = 0, 1518 + .ies_present = false, 1519 + .base_names = mt7988_pinctrl_register_base_names, 1520 + .nbase_names = ARRAY_SIZE(mt7988_pinctrl_register_base_names), 1521 + .bias_disable_set = mtk_pinconf_bias_disable_set, 1522 + .bias_disable_get = mtk_pinconf_bias_disable_get, 1523 + .bias_set = mtk_pinconf_bias_set, 1524 + .bias_get = mtk_pinconf_bias_get, 1525 + .pull_type = mt7988_pull_type, 1526 + .bias_set_combo = mtk_pinconf_bias_set_combo, 1527 + .bias_get_combo = mtk_pinconf_bias_get_combo, 1528 + .drive_set = mtk_pinconf_drive_set_rev1, 1529 + .drive_get = mtk_pinconf_drive_get_rev1, 1530 + .adv_pull_get = mtk_pinconf_adv_pull_get, 1531 + .adv_pull_set = mtk_pinconf_adv_pull_set, 1532 + }; 1533 + 1534 + static const struct of_device_id mt7988_pinctrl_of_match[] = { 1535 + { .compatible = "mediatek,mt7988-pinctrl" }, 1536 + {} 1537 + }; 1538 + 1539 + static int mt7988_pinctrl_probe(struct platform_device *pdev) 1540 + { 1541 + return mtk_moore_pinctrl_probe(pdev, &mt7988_data); 1542 + } 1543 + 1544 + static struct platform_driver mt7988_pinctrl_driver = { 1545 + .driver = { 1546 + .name = "mt7988-pinctrl", 1547 + .of_match_table = mt7988_pinctrl_of_match, 1548 + }, 1549 + .probe = mt7988_pinctrl_probe, 1550 + }; 1551 + 1552 + static int __init mt7988_pinctrl_init(void) 1553 + { 1554 + return platform_driver_register(&mt7988_pinctrl_driver); 1555 + } 1556 + arch_initcall(mt7988_pinctrl_init);
+45 -12
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
··· 573 573 */ 574 574 static int mtk_pinconf_bias_set_pu_pd(struct mtk_pinctrl *hw, 575 575 const struct mtk_pin_desc *desc, 576 - u32 pullup, u32 arg) 576 + u32 pullup, u32 arg, bool pd_only) 577 577 { 578 578 int err, pu, pd; 579 579 ··· 587 587 pu = 0; 588 588 pd = 1; 589 589 } else { 590 - err = -EINVAL; 591 - goto out; 590 + return -EINVAL; 592 591 } 593 592 594 - err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, pu); 595 - if (err) 596 - goto out; 593 + if (!pd_only) { 594 + err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, pu); 595 + if (err) 596 + return err; 597 + } 597 598 598 - err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd); 599 - 600 - out: 601 - return err; 599 + return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd); 602 600 } 603 601 604 602 static int mtk_pinconf_bias_set_pullsel_pullen(struct mtk_pinctrl *hw, ··· 735 737 return err; 736 738 } 737 739 738 - return mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, enable); 740 + return mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, enable, false); 739 741 } 740 742 741 743 int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw, ··· 756 758 return 0; 757 759 } 758 760 761 + if (try_all_type & MTK_PULL_PD_TYPE) { 762 + err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg, true); 763 + if (!err) 764 + return err; 765 + } 766 + 759 767 if (try_all_type & MTK_PULL_PU_PD_TYPE) { 760 - err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg); 768 + err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg, false); 761 769 if (!err) 762 770 return 0; 763 771 } ··· 882 878 return err; 883 879 } 884 880 881 + static int mtk_pinconf_bias_get_pd(struct mtk_pinctrl *hw, 882 + const struct mtk_pin_desc *desc, 883 + u32 *pullup, u32 *enable) 884 + { 885 + int err, pd; 886 + 887 + err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); 888 + if (err) 889 + goto out; 890 + 891 + if (pd == 0) { 892 + *pullup = 0; 893 + *enable = MTK_DISABLE; 894 + } else if (pd == 1) { 895 + *pullup = 0; 896 + *enable = MTK_ENABLE; 897 + } else 898 + err = -EINVAL; 899 + 900 + out: 901 + return err; 902 + } 903 + 885 904 static int mtk_pinconf_bias_get_pullsel_pullen(struct mtk_pinctrl *hw, 886 905 const struct mtk_pin_desc *desc, 887 906 u32 *pullup, u32 *enable) ··· 972 945 err = mtk_pinconf_bias_get_pu_pd_rsel(hw, desc, pullup, enable); 973 946 if (!err) 974 947 return 0; 948 + } 949 + 950 + if (try_all_type & MTK_PULL_PD_TYPE) { 951 + err = mtk_pinconf_bias_get_pd(hw, desc, pullup, enable); 952 + if (!err) 953 + return err; 975 954 } 976 955 977 956 if (try_all_type & MTK_PULL_PU_PD_TYPE) {
+1
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
··· 24 24 * turned on/off itself. But it can't be selected pull up/down 25 25 */ 26 26 #define MTK_PULL_RSEL_TYPE BIT(3) 27 + #define MTK_PULL_PD_TYPE BIT(4) 27 28 /* MTK_PULL_PU_PD_RSEL_TYPE is a type which is controlled by 28 29 * MTK_PULL_PU_PD_TYPE and MTK_PULL_RSEL_TYPE. 29 30 */
+3 -2
drivers/pinctrl/nomadik/pinctrl-abx500.c
··· 22 22 #include <linux/property.h> 23 23 #include <linux/seq_file.h> 24 24 #include <linux/slab.h> 25 + #include <linux/string_choices.h> 25 26 #include <linux/types.h> 26 27 27 28 #include <linux/mfd/abx500.h> ··· 497 496 498 497 seq_printf(s, " %-9s", pull_up_down[pd]); 499 498 } else 500 - seq_printf(s, " %-9s", chip->get(chip, offset) ? "hi" : "lo"); 499 + seq_printf(s, " %-9s", str_hi_lo(chip->get(chip, offset))); 501 500 502 501 mode = abx500_get_mode(pctldev, chip, offset); 503 502 ··· 866 865 pin, configs[i], 867 866 (param == PIN_CONFIG_OUTPUT) ? "output " : "input", 868 867 (param == PIN_CONFIG_OUTPUT) ? 869 - (argument ? "high" : "low") : 868 + str_high_low(argument) : 870 869 (argument ? "pull up" : "pull down")); 871 870 872 871 /* on ABx500, there is no GPIO0, so adjust the offset */
+32 -10
drivers/pinctrl/nomadik/pinctrl-nomadik.c
··· 28 28 #include <linux/seq_file.h> 29 29 #include <linux/slab.h> 30 30 #include <linux/spinlock.h> 31 + #include <linux/string_choices.h> 31 32 #include <linux/types.h> 32 33 33 34 /* Since we request GPIOs from ourself */ ··· 439 438 * - Any spurious wake up event during switch sequence to be ignored and 440 439 * cleared 441 440 */ 442 - static void nmk_gpio_glitch_slpm_init(unsigned int *slpm) 441 + static int nmk_gpio_glitch_slpm_init(unsigned int *slpm) 443 442 { 444 - int i; 443 + int i, j, ret; 445 444 446 445 for (i = 0; i < NMK_MAX_BANKS; i++) { 447 446 struct nmk_gpio_chip *chip = nmk_gpio_chips[i]; ··· 450 449 if (!chip) 451 450 break; 452 451 453 - clk_enable(chip->clk); 452 + ret = clk_enable(chip->clk); 453 + if (ret) { 454 + for (j = 0; j < i; j++) { 455 + chip = nmk_gpio_chips[j]; 456 + clk_disable(chip->clk); 457 + } 458 + 459 + return ret; 460 + } 454 461 455 462 slpm[i] = readl(chip->addr + NMK_GPIO_SLPC); 456 463 writel(temp, chip->addr + NMK_GPIO_SLPC); 457 464 } 465 + 466 + return 0; 458 467 } 459 468 460 469 static void nmk_gpio_glitch_slpm_restore(unsigned int *slpm) ··· 934 923 935 924 slpm[nmk_chip->bank] &= ~BIT(bit); 936 925 } 937 - nmk_gpio_glitch_slpm_init(slpm); 926 + ret = nmk_gpio_glitch_slpm_init(slpm); 927 + if (ret) 928 + goto out_pre_slpm_init; 938 929 } 939 930 940 931 for (i = 0; i < g->grp.npins; i++) { ··· 953 940 dev_dbg(npct->dev, "setting pin %d to altsetting %d\n", 954 941 g->grp.pins[i], g->altsetting); 955 942 956 - clk_enable(nmk_chip->clk); 943 + ret = clk_enable(nmk_chip->clk); 944 + if (ret) 945 + goto out_glitch; 946 + 957 947 /* 958 948 * If the pin is switching to altfunc, and there was an 959 949 * interrupt installed on it which has been lazy disabled, ··· 1004 988 struct nmk_gpio_chip *nmk_chip; 1005 989 struct gpio_chip *chip; 1006 990 unsigned int bit; 991 + int ret; 1007 992 1008 993 if (!range) { 1009 994 dev_err(npct->dev, "invalid range\n"); ··· 1021 1004 1022 1005 find_nmk_gpio_from_pin(pin, &bit); 1023 1006 1024 - clk_enable(nmk_chip->clk); 1007 + ret = clk_enable(nmk_chip->clk); 1008 + if (ret) 1009 + return ret; 1025 1010 /* There is no glitch when converting any pin to GPIO */ 1026 1011 __nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO); 1027 1012 clk_disable(nmk_chip->clk); ··· 1077 1058 unsigned long cfg; 1078 1059 int pull, slpm, output, val, i; 1079 1060 bool lowemi, gpiomode, sleep; 1061 + int ret; 1080 1062 1081 1063 nmk_chip = find_nmk_gpio_from_pin(pin, &bit); 1082 1064 if (!nmk_chip) { ··· 1126 1106 slpm_pull ? pullnames[pull] : "same", 1127 1107 slpm_output ? (output ? "output" : "input") 1128 1108 : "same", 1129 - slpm_val ? (val ? "high" : "low") : "same"); 1109 + slpm_val ? str_high_low(val) : "same"); 1130 1110 } 1131 1111 1132 1112 dev_dbg(nmk_chip->chip.parent, 1133 1113 "pin %d [%#lx]: pull %s, slpm %s (%s%s), lowemi %s\n", 1134 1114 pin, cfg, pullnames[pull], slpmnames[slpm], 1135 1115 output ? "output " : "input", 1136 - output ? (val ? "high" : "low") : "", 1137 - lowemi ? "on" : "off"); 1116 + output ? str_high_low(val) : "", 1117 + str_on_off(lowemi)); 1138 1118 1139 - clk_enable(nmk_chip->clk); 1119 + ret = clk_enable(nmk_chip->clk); 1120 + if (ret) 1121 + return ret; 1140 1122 if (gpiomode) 1141 1123 /* No glitch when going to GPIO mode */ 1142 1124 __nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO);
+23 -7
drivers/pinctrl/pinctrl-amd.c
··· 30 30 #include <linux/pinctrl/pinconf.h> 31 31 #include <linux/pinctrl/pinconf-generic.h> 32 32 #include <linux/pinctrl/pinmux.h> 33 + #include <linux/string_choices.h> 33 34 #include <linux/suspend.h> 34 35 35 36 #include "core.h" ··· 459 458 460 459 if (err) 461 460 dev_err(&gpio_dev->pdev->dev, "failed to %s wake-up interrupt\n", 462 - on ? "enable" : "disable"); 461 + str_enable_disable(on)); 463 462 464 463 return 0; 465 464 } ··· 909 908 return false; 910 909 } 911 910 912 - static int amd_gpio_suspend(struct device *dev) 911 + static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend) 913 912 { 914 913 struct amd_gpio *gpio_dev = dev_get_drvdata(dev); 915 914 struct pinctrl_desc *desc = gpio_dev->pctrl->desc; 916 915 unsigned long flags; 917 916 int i; 917 + u32 wake_mask = is_suspend ? WAKE_SOURCE_SUSPEND : WAKE_SOURCE_HIBERNATE; 918 918 919 919 for (i = 0; i < desc->npins; i++) { 920 920 int pin = desc->pins[i].number; ··· 927 925 gpio_dev->saved_regs[i] = readl(gpio_dev->base + pin * 4) & ~PIN_IRQ_PENDING; 928 926 929 927 /* mask any interrupts not intended to be a wake source */ 930 - if (!(gpio_dev->saved_regs[i] & WAKE_SOURCE)) { 928 + if (!(gpio_dev->saved_regs[i] & wake_mask)) { 931 929 writel(gpio_dev->saved_regs[i] & ~BIT(INTERRUPT_MASK_OFF), 932 930 gpio_dev->base + pin * 4); 933 - pm_pr_dbg("Disabling GPIO #%d interrupt for suspend.\n", 934 - pin); 931 + pm_pr_dbg("Disabling GPIO #%d interrupt for %s.\n", 932 + pin, is_suspend ? "suspend" : "hibernate"); 935 933 } 936 934 937 935 raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); 938 936 } 939 937 940 938 return 0; 939 + } 940 + 941 + static int amd_gpio_suspend(struct device *dev) 942 + { 943 + return amd_gpio_suspend_hibernate_common(dev, true); 944 + } 945 + 946 + static int amd_gpio_hibernate(struct device *dev) 947 + { 948 + return amd_gpio_suspend_hibernate_common(dev, false); 941 949 } 942 950 943 951 static int amd_gpio_resume(struct device *dev) ··· 973 961 } 974 962 975 963 static const struct dev_pm_ops amd_gpio_pm_ops = { 976 - SET_LATE_SYSTEM_SLEEP_PM_OPS(amd_gpio_suspend, 977 - amd_gpio_resume) 964 + .suspend_late = amd_gpio_suspend, 965 + .resume_early = amd_gpio_resume, 966 + .freeze_late = amd_gpio_hibernate, 967 + .thaw_early = amd_gpio_resume, 968 + .poweroff_late = amd_gpio_hibernate, 969 + .restore_early = amd_gpio_resume, 978 970 }; 979 971 #endif 980 972
+3 -4
drivers/pinctrl/pinctrl-amd.h
··· 80 80 #define FUNCTION_MASK GENMASK(1, 0) 81 81 #define FUNCTION_INVALID GENMASK(7, 0) 82 82 83 - #define WAKE_SOURCE (BIT(WAKE_CNTRL_OFF_S0I3) | \ 84 - BIT(WAKE_CNTRL_OFF_S3) | \ 85 - BIT(WAKE_CNTRL_OFF_S4) | \ 86 - BIT(WAKECNTRL_Z_OFF)) 83 + #define WAKE_SOURCE_SUSPEND (BIT(WAKE_CNTRL_OFF_S0I3) | \ 84 + BIT(WAKE_CNTRL_OFF_S3)) 85 + #define WAKE_SOURCE_HIBERNATE BIT(WAKE_CNTRL_OFF_S4) 87 86 88 87 struct amd_function { 89 88 const char *name;
+6 -5
drivers/pinctrl/pinctrl-gemini.c
··· 14 14 #include <linux/regmap.h> 15 15 #include <linux/seq_file.h> 16 16 #include <linux/slab.h> 17 + #include <linux/string_choices.h> 17 18 18 19 #include <linux/pinctrl/machine.h> 19 20 #include <linux/pinctrl/pinconf-generic.h> ··· 2238 2237 "pin group %s could not be %s: " 2239 2238 "probably a hardware limitation\n", 2240 2239 gemini_padgroups[i], 2241 - enabled ? "enabled" : "disabled"); 2240 + str_enabled_disabled(enabled)); 2242 2241 dev_err(pmx->dev, 2243 2242 "GLOBAL MISC CTRL before: %08x, after %08x, expected %08x\n", 2244 2243 before, after, expected); ··· 2246 2245 dev_dbg(pmx->dev, 2247 2246 "padgroup %s %s\n", 2248 2247 gemini_padgroups[i], 2249 - enabled ? "enabled" : "disabled"); 2248 + str_enabled_disabled(enabled)); 2250 2249 } 2251 2250 } 2252 2251 ··· 2260 2259 "pin group %s could not be %s: " 2261 2260 "probably a hardware limitation\n", 2262 2261 gemini_padgroups[i], 2263 - enabled ? "enabled" : "disabled"); 2262 + str_enabled_disabled(enabled)); 2264 2263 dev_err(pmx->dev, 2265 2264 "GLOBAL MISC CTRL before: %08x, after %08x, expected %08x\n", 2266 2265 before, after, expected); ··· 2268 2267 dev_dbg(pmx->dev, 2269 2268 "padgroup %s %s\n", 2270 2269 gemini_padgroups[i], 2271 - enabled ? "enabled" : "disabled"); 2270 + str_enabled_disabled(enabled)); 2272 2271 } 2273 2272 } 2274 2273 ··· 2589 2588 tmp = val; 2590 2589 for_each_set_bit(i, &tmp, PADS_MAXBIT) { 2591 2590 dev_dbg(dev, "pad group %s %s\n", gemini_padgroups[i], 2592 - (val & BIT(i)) ? "enabled" : "disabled"); 2591 + str_enabled_disabled(val & BIT(i))); 2593 2592 } 2594 2593 2595 2594 /* Check if flash pin is set */
+1 -1
drivers/pinctrl/pinctrl-ingenic.c
··· 3699 3699 { 3700 3700 struct gpio_chip *gpio_chip = irq_data_get_irq_chip_data(data); 3701 3701 3702 - seq_printf(p, "%s", gpio_chip->label); 3702 + seq_puts(p, gpio_chip->label); 3703 3703 } 3704 3704 3705 3705 static const struct irq_chip ingenic_gpio_irqchip = {
+10 -10
drivers/pinctrl/pinctrl-ocelot.c
··· 1777 1777 .dt_free_map = pinconf_generic_dt_free_map, 1778 1778 }; 1779 1779 1780 - static struct ocelot_match_data luton_desc = { 1780 + static const struct ocelot_match_data luton_desc = { 1781 1781 .desc = { 1782 1782 .name = "luton-pinctrl", 1783 1783 .pins = luton_pins, ··· 1788 1788 }, 1789 1789 }; 1790 1790 1791 - static struct ocelot_match_data serval_desc = { 1791 + static const struct ocelot_match_data serval_desc = { 1792 1792 .desc = { 1793 1793 .name = "serval-pinctrl", 1794 1794 .pins = serval_pins, ··· 1799 1799 }, 1800 1800 }; 1801 1801 1802 - static struct ocelot_match_data ocelot_desc = { 1802 + static const struct ocelot_match_data ocelot_desc = { 1803 1803 .desc = { 1804 1804 .name = "ocelot-pinctrl", 1805 1805 .pins = ocelot_pins, ··· 1810 1810 }, 1811 1811 }; 1812 1812 1813 - static struct ocelot_match_data jaguar2_desc = { 1813 + static const struct ocelot_match_data jaguar2_desc = { 1814 1814 .desc = { 1815 1815 .name = "jaguar2-pinctrl", 1816 1816 .pins = jaguar2_pins, ··· 1821 1821 }, 1822 1822 }; 1823 1823 1824 - static struct ocelot_match_data servalt_desc = { 1824 + static const struct ocelot_match_data servalt_desc = { 1825 1825 .desc = { 1826 1826 .name = "servalt-pinctrl", 1827 1827 .pins = servalt_pins, ··· 1832 1832 }, 1833 1833 }; 1834 1834 1835 - static struct ocelot_match_data sparx5_desc = { 1835 + static const struct ocelot_match_data sparx5_desc = { 1836 1836 .desc = { 1837 1837 .name = "sparx5-pinctrl", 1838 1838 .pins = sparx5_pins, ··· 1850 1850 }, 1851 1851 }; 1852 1852 1853 - static struct ocelot_match_data lan966x_desc = { 1853 + static const struct ocelot_match_data lan966x_desc = { 1854 1854 .desc = { 1855 1855 .name = "lan966x-pinctrl", 1856 1856 .pins = lan966x_pins, ··· 1867 1867 }, 1868 1868 }; 1869 1869 1870 - static struct ocelot_match_data lan969x_desc = { 1870 + static const struct ocelot_match_data lan969x_desc = { 1871 1871 .desc = { 1872 1872 .name = "lan969x-pinctrl", 1873 1873 .pins = lan969x_pins, ··· 2116 2116 2117 2117 static int ocelot_irq_set_type(struct irq_data *data, unsigned int type); 2118 2118 2119 - static struct irq_chip ocelot_level_irqchip = { 2119 + static const struct irq_chip ocelot_level_irqchip = { 2120 2120 .name = "gpio", 2121 2121 .irq_mask = ocelot_irq_mask, 2122 2122 .irq_ack = ocelot_irq_ack, ··· 2126 2126 GPIOCHIP_IRQ_RESOURCE_HELPERS 2127 2127 }; 2128 2128 2129 - static struct irq_chip ocelot_irqchip = { 2129 + static const struct irq_chip ocelot_irqchip = { 2130 2130 .name = "gpio", 2131 2131 .irq_mask = ocelot_irq_mask, 2132 2132 .irq_ack = ocelot_irq_ack,
+198 -2
drivers/pinctrl/pinctrl-rockchip.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Pinctrl driver for Rockchip SoCs 4 - * 4 + * Copyright (c) 2020-2024 Rockchip Electronics Co., Ltd. 5 5 * Copyright (c) 2013 MundoReader S.L. 6 6 * Author: Heiko Stuebner <heiko@sntech.de> 7 7 * ··· 2003 2003 return 0; 2004 2004 } 2005 2005 2006 + #define RK3562_DRV_BITS_PER_PIN 8 2007 + #define RK3562_DRV_PINS_PER_REG 2 2008 + #define RK3562_DRV_GPIO0_OFFSET 0x20070 2009 + #define RK3562_DRV_GPIO1_OFFSET 0x200 2010 + #define RK3562_DRV_GPIO2_OFFSET 0x240 2011 + #define RK3562_DRV_GPIO3_OFFSET 0x10280 2012 + #define RK3562_DRV_GPIO4_OFFSET 0x102C0 2013 + 2014 + static int rk3562_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, 2015 + int pin_num, struct regmap **regmap, 2016 + int *reg, u8 *bit) 2017 + { 2018 + struct rockchip_pinctrl *info = bank->drvdata; 2019 + 2020 + *regmap = info->regmap_base; 2021 + switch (bank->bank_num) { 2022 + case 0: 2023 + *reg = RK3562_DRV_GPIO0_OFFSET; 2024 + break; 2025 + 2026 + case 1: 2027 + *reg = RK3562_DRV_GPIO1_OFFSET; 2028 + break; 2029 + 2030 + case 2: 2031 + *reg = RK3562_DRV_GPIO2_OFFSET; 2032 + break; 2033 + 2034 + case 3: 2035 + *reg = RK3562_DRV_GPIO3_OFFSET; 2036 + break; 2037 + 2038 + case 4: 2039 + *reg = RK3562_DRV_GPIO4_OFFSET; 2040 + break; 2041 + 2042 + default: 2043 + dev_err(info->dev, "unsupported bank_num %d\n", bank->bank_num); 2044 + break; 2045 + } 2046 + 2047 + *reg += ((pin_num / RK3562_DRV_PINS_PER_REG) * 4); 2048 + *bit = pin_num % RK3562_DRV_PINS_PER_REG; 2049 + *bit *= RK3562_DRV_BITS_PER_PIN; 2050 + 2051 + return 0; 2052 + } 2053 + 2054 + #define RK3562_PULL_BITS_PER_PIN 2 2055 + #define RK3562_PULL_PINS_PER_REG 8 2056 + #define RK3562_PULL_GPIO0_OFFSET 0x20020 2057 + #define RK3562_PULL_GPIO1_OFFSET 0x80 2058 + #define RK3562_PULL_GPIO2_OFFSET 0x90 2059 + #define RK3562_PULL_GPIO3_OFFSET 0x100A0 2060 + #define RK3562_PULL_GPIO4_OFFSET 0x100B0 2061 + 2062 + static int rk3562_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, 2063 + int pin_num, struct regmap **regmap, 2064 + int *reg, u8 *bit) 2065 + { 2066 + struct rockchip_pinctrl *info = bank->drvdata; 2067 + 2068 + *regmap = info->regmap_base; 2069 + switch (bank->bank_num) { 2070 + case 0: 2071 + *reg = RK3562_PULL_GPIO0_OFFSET; 2072 + break; 2073 + 2074 + case 1: 2075 + *reg = RK3562_PULL_GPIO1_OFFSET; 2076 + break; 2077 + 2078 + case 2: 2079 + *reg = RK3562_PULL_GPIO2_OFFSET; 2080 + break; 2081 + 2082 + case 3: 2083 + *reg = RK3562_PULL_GPIO3_OFFSET; 2084 + break; 2085 + 2086 + case 4: 2087 + *reg = RK3562_PULL_GPIO4_OFFSET; 2088 + break; 2089 + 2090 + default: 2091 + dev_err(info->dev, "unsupported bank_num %d\n", bank->bank_num); 2092 + break; 2093 + } 2094 + 2095 + *reg += ((pin_num / RK3562_PULL_PINS_PER_REG) * 4); 2096 + *bit = pin_num % RK3562_PULL_PINS_PER_REG; 2097 + *bit *= RK3562_PULL_BITS_PER_PIN; 2098 + 2099 + return 0; 2100 + } 2101 + 2102 + #define RK3562_SMT_BITS_PER_PIN 2 2103 + #define RK3562_SMT_PINS_PER_REG 8 2104 + #define RK3562_SMT_GPIO0_OFFSET 0x20030 2105 + #define RK3562_SMT_GPIO1_OFFSET 0xC0 2106 + #define RK3562_SMT_GPIO2_OFFSET 0xD0 2107 + #define RK3562_SMT_GPIO3_OFFSET 0x100E0 2108 + #define RK3562_SMT_GPIO4_OFFSET 0x100F0 2109 + 2110 + static int rk3562_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, 2111 + int pin_num, 2112 + struct regmap **regmap, 2113 + int *reg, u8 *bit) 2114 + { 2115 + struct rockchip_pinctrl *info = bank->drvdata; 2116 + 2117 + *regmap = info->regmap_base; 2118 + switch (bank->bank_num) { 2119 + case 0: 2120 + *reg = RK3562_SMT_GPIO0_OFFSET; 2121 + break; 2122 + 2123 + case 1: 2124 + *reg = RK3562_SMT_GPIO1_OFFSET; 2125 + break; 2126 + 2127 + case 2: 2128 + *reg = RK3562_SMT_GPIO2_OFFSET; 2129 + break; 2130 + 2131 + case 3: 2132 + *reg = RK3562_SMT_GPIO3_OFFSET; 2133 + break; 2134 + 2135 + case 4: 2136 + *reg = RK3562_SMT_GPIO4_OFFSET; 2137 + break; 2138 + 2139 + default: 2140 + dev_err(info->dev, "unsupported bank_num %d\n", bank->bank_num); 2141 + break; 2142 + } 2143 + 2144 + *reg += ((pin_num / RK3562_SMT_PINS_PER_REG) * 4); 2145 + *bit = pin_num % RK3562_SMT_PINS_PER_REG; 2146 + *bit *= RK3562_SMT_BITS_PER_PIN; 2147 + 2148 + return 0; 2149 + } 2150 + 2006 2151 #define RK3568_PULL_PMU_OFFSET 0x20 2007 2152 #define RK3568_PULL_GRF_OFFSET 0x80 2008 2153 #define RK3568_PULL_BITS_PER_PIN 2 ··· 2640 2495 rmask_bits = RK3588_DRV_BITS_PER_PIN; 2641 2496 ret = strength; 2642 2497 goto config; 2643 - } else if (ctrl->type == RK3568) { 2498 + } else if (ctrl->type == RK3562 || 2499 + ctrl->type == RK3568) { 2644 2500 rmask_bits = RK3568_DRV_BITS_PER_PIN; 2645 2501 ret = (1 << (strength + 1)) - 1; 2646 2502 goto config; ··· 2785 2639 case RK3328: 2786 2640 case RK3368: 2787 2641 case RK3399: 2642 + case RK3562: 2788 2643 case RK3568: 2789 2644 case RK3576: 2790 2645 case RK3588: ··· 2846 2699 case RK3328: 2847 2700 case RK3368: 2848 2701 case RK3399: 2702 + case RK3562: 2849 2703 case RK3568: 2850 2704 case RK3576: 2851 2705 case RK3588: ··· 2958 2810 2959 2811 data >>= bit; 2960 2812 switch (ctrl->type) { 2813 + case RK3562: 2961 2814 case RK3568: 2962 2815 return data & ((1 << RK3568_SCHMITT_BITS_PER_PIN) - 1); 2963 2816 default: ··· 2988 2839 2989 2840 /* enable the write to the equivalent lower bits */ 2990 2841 switch (ctrl->type) { 2842 + case RK3562: 2991 2843 case RK3568: 2992 2844 data = ((1 << RK3568_SCHMITT_BITS_PER_PIN) - 1) << (bit + 16); 2993 2845 rmask = data | (data >> 16); ··· 3115 2965 case RK3328: 3116 2966 case RK3368: 3117 2967 case RK3399: 2968 + case RK3562: 3118 2969 case RK3568: 3119 2970 case RK3576: 3120 2971 case RK3588: ··· 4237 4086 .drv_calc_reg = rk3399_calc_drv_reg_and_bit, 4238 4087 }; 4239 4088 4089 + static struct rockchip_pin_bank rk3562_pin_banks[] = { 4090 + PIN_BANK_IOMUX_FLAGS_OFFSET(0, 32, "gpio0", 4091 + IOMUX_WIDTH_4BIT, 4092 + IOMUX_WIDTH_4BIT, 4093 + IOMUX_WIDTH_4BIT, 4094 + IOMUX_WIDTH_4BIT, 4095 + 0x20000, 0x20008, 0x20010, 0x20018), 4096 + PIN_BANK_IOMUX_FLAGS_OFFSET(1, 32, "gpio1", 4097 + IOMUX_WIDTH_4BIT, 4098 + IOMUX_WIDTH_4BIT, 4099 + IOMUX_WIDTH_4BIT, 4100 + IOMUX_WIDTH_4BIT, 4101 + 0, 0x08, 0x10, 0x18), 4102 + PIN_BANK_IOMUX_FLAGS_OFFSET(2, 32, "gpio2", 4103 + IOMUX_WIDTH_4BIT, 4104 + IOMUX_WIDTH_4BIT, 4105 + IOMUX_WIDTH_4BIT, 4106 + IOMUX_WIDTH_4BIT, 4107 + 0x20, 0, 0, 0), 4108 + PIN_BANK_IOMUX_FLAGS_OFFSET(3, 32, "gpio3", 4109 + IOMUX_WIDTH_4BIT, 4110 + IOMUX_WIDTH_4BIT, 4111 + IOMUX_WIDTH_4BIT, 4112 + IOMUX_WIDTH_4BIT, 4113 + 0x10040, 0x10048, 0x10050, 0x10058), 4114 + PIN_BANK_IOMUX_FLAGS_OFFSET(4, 16, "gpio4", 4115 + IOMUX_WIDTH_4BIT, 4116 + IOMUX_WIDTH_4BIT, 4117 + 0, 4118 + 0, 4119 + 0x10060, 0x10068, 0, 0), 4120 + }; 4121 + 4122 + static struct rockchip_pin_ctrl rk3562_pin_ctrl __maybe_unused = { 4123 + .pin_banks = rk3562_pin_banks, 4124 + .nr_banks = ARRAY_SIZE(rk3562_pin_banks), 4125 + .label = "RK3562-GPIO", 4126 + .type = RK3562, 4127 + .pull_calc_reg = rk3562_calc_pull_reg_and_bit, 4128 + .drv_calc_reg = rk3562_calc_drv_reg_and_bit, 4129 + .schmitt_calc_reg = rk3562_calc_schmitt_reg_and_bit, 4130 + }; 4131 + 4240 4132 static struct rockchip_pin_bank rk3568_pin_banks[] = { 4241 4133 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU | IOMUX_WIDTH_4BIT, 4242 4134 IOMUX_SOURCE_PMU | IOMUX_WIDTH_4BIT, ··· 4404 4210 .data = &rk3368_pin_ctrl }, 4405 4211 { .compatible = "rockchip,rk3399-pinctrl", 4406 4212 .data = &rk3399_pin_ctrl }, 4213 + { .compatible = "rockchip,rk3562-pinctrl", 4214 + .data = &rk3562_pin_ctrl }, 4407 4215 { .compatible = "rockchip,rk3568-pinctrl", 4408 4216 .data = &rk3568_pin_ctrl }, 4409 4217 { .compatible = "rockchip,rk3576-pinctrl",
+2 -1
drivers/pinctrl/pinctrl-rockchip.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 /* 3 - * Copyright (c) 2020-2021 Rockchip Electronics Co. Ltd. 3 + * Copyright (c) 2020-2024 Rockchip Electronics Co., Ltd. 4 4 * 5 5 * Copyright (c) 2013 MundoReader S.L. 6 6 * Author: Heiko Stuebner <heiko@sntech.de> ··· 196 196 RK3328, 197 197 RK3368, 198 198 RK3399, 199 + RK3562, 199 200 RK3568, 200 201 RK3576, 201 202 RK3588,
+1 -1
drivers/pinctrl/pinctrl-stmfx.c
··· 380 380 seq_printf(s, "input %s ", str_high_low(val)); 381 381 if (type) 382 382 seq_printf(s, "with internal pull-%s ", 383 - pupd ? "up" : "down"); 383 + str_up_down(pupd)); 384 384 else 385 385 seq_printf(s, "%s ", pupd ? "floating" : "analog"); 386 386 }
+6
drivers/pinctrl/qcom/Kconfig.msm
··· 137 137 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 138 138 Qualcomm TLMM block found on the Qualcomm 8916 platform. 139 139 140 + config PINCTRL_MSM8917 141 + tristate "Qualcomm 8917 pin controller driver" 142 + help 143 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 144 + Qualcomm TLMM block found on the Qualcomm MSM8917 platform. 145 + 140 146 config PINCTRL_MSM8953 141 147 tristate "Qualcomm 8953 pin controller driver" 142 148 depends on ARM64 || COMPILE_TEST
+1
drivers/pinctrl/qcom/Makefile
··· 17 17 obj-$(CONFIG_PINCTRL_MSM8X74) += pinctrl-msm8x74.o 18 18 obj-$(CONFIG_PINCTRL_MSM8909) += pinctrl-msm8909.o 19 19 obj-$(CONFIG_PINCTRL_MSM8916) += pinctrl-msm8916.o 20 + obj-$(CONFIG_PINCTRL_MSM8917) += pinctrl-msm8917.o 20 21 obj-$(CONFIG_PINCTRL_MSM8953) += pinctrl-msm8953.o 21 22 obj-$(CONFIG_PINCTRL_MSM8976) += pinctrl-msm8976.o 22 23 obj-$(CONFIG_PINCTRL_MSM8994) += pinctrl-msm8994.o
+26 -8
drivers/pinctrl/qcom/pinctrl-ipq5424.c
··· 233 233 msm_mux_sdc_clk, 234 234 msm_mux_sdc_cmd, 235 235 msm_mux_sdc_data, 236 - msm_mux_spi0, 236 + msm_mux_spi0_clk, 237 + msm_mux_spi0_cs, 238 + msm_mux_spi0_miso, 239 + msm_mux_spi0_mosi, 237 240 msm_mux_spi1, 238 241 msm_mux_spi10, 239 242 msm_mux_spi11, ··· 300 297 "gpio5", 301 298 }; 302 299 303 - static const char * const spi0_groups[] = { 304 - "gpio6", "gpio7", "gpio8", "gpio9", 300 + static const char * const spi0_clk_groups[] = { 301 + "gpio6", 305 302 }; 306 303 307 304 static const char * const pwm1_groups[] = { ··· 318 315 "gpio38", "gpio39", 319 316 }; 320 317 318 + static const char * const spi0_cs_groups[] = { 319 + "gpio7", 320 + }; 321 + 321 322 static const char * const cri_trng1_groups[] = { 322 323 "gpio7", 323 324 }; 324 325 326 + static const char * const spi0_miso_groups[] = { 327 + "gpio8", 328 + }; 329 + 325 330 static const char * const cri_trng2_groups[] = { 326 331 "gpio8", 332 + }; 333 + 334 + static const char * const spi0_mosi_groups[] = { 335 + "gpio9", 327 336 }; 328 337 329 338 static const char * const cri_trng3_groups[] = { ··· 695 680 MSM_PIN_FUNCTION(sdc_clk), 696 681 MSM_PIN_FUNCTION(sdc_cmd), 697 682 MSM_PIN_FUNCTION(sdc_data), 698 - MSM_PIN_FUNCTION(spi0), 683 + MSM_PIN_FUNCTION(spi0_clk), 684 + MSM_PIN_FUNCTION(spi0_cs), 685 + MSM_PIN_FUNCTION(spi0_miso), 686 + MSM_PIN_FUNCTION(spi0_mosi), 699 687 MSM_PIN_FUNCTION(spi1), 700 688 MSM_PIN_FUNCTION(spi10), 701 689 MSM_PIN_FUNCTION(spi11), ··· 718 700 PINGROUP(3, sdc_data, qspi_data, pwm2, _, _, _, _, _, _), 719 701 PINGROUP(4, sdc_cmd, qspi_cs, _, _, _, _, _, _, _), 720 702 PINGROUP(5, sdc_clk, qspi_clk, _, _, _, _, _, _, _), 721 - PINGROUP(6, spi0, pwm1, _, cri_trng0, qdss_tracedata_a, _, _, _, _), 722 - PINGROUP(7, spi0, pwm1, _, cri_trng1, qdss_tracedata_a, _, _, _, _), 723 - PINGROUP(8, spi0, pwm1, wci_txd, wci_rxd, _, cri_trng2, qdss_tracedata_a, _, _), 724 - PINGROUP(9, spi0, pwm1, _, cri_trng3, qdss_tracedata_a, _, _, _, _), 703 + PINGROUP(6, spi0_clk, pwm1, _, cri_trng0, qdss_tracedata_a, _, _, _, _), 704 + PINGROUP(7, spi0_cs, pwm1, _, cri_trng1, qdss_tracedata_a, _, _, _, _), 705 + PINGROUP(8, spi0_miso, pwm1, wci_txd, wci_rxd, _, cri_trng2, qdss_tracedata_a, _, _), 706 + PINGROUP(9, spi0_mosi, pwm1, _, cri_trng3, qdss_tracedata_a, _, _, _, _), 725 707 PINGROUP(10, uart0, pwm0, spi11, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _), 726 708 PINGROUP(11, uart0, pwm0, spi1, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _), 727 709 PINGROUP(12, uart0, pwm0, spi11, _, prng_rosc0, qdss_tracedata_a, _, _, _),
+2 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 19 19 #include <linux/seq_file.h> 20 20 #include <linux/slab.h> 21 21 #include <linux/spinlock.h> 22 + #include <linux/string_choices.h> 22 23 23 24 #include <linux/pinctrl/machine.h> 24 25 #include <linux/pinctrl/pinconf-generic.h> ··· 715 714 } 716 715 717 716 seq_printf(s, " %-8s: %-3s", g->grp.name, is_out ? "out" : "in"); 718 - seq_printf(s, " %-4s func%d", val ? "high" : "low", func); 717 + seq_printf(s, " %-4s func%d", str_high_low(val), func); 719 718 seq_printf(s, " %dmA", msm_regval_to_drive(drive)); 720 719 if (pctrl->soc->pull_no_keeper) 721 720 seq_printf(s, " %s", pulls_no_keeper[pull]);
+1620
drivers/pinctrl/qcom/pinctrl-msm8917.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, The Linux Foundation. All rights reserved. 4 + */ 5 + 6 + #include <linux/module.h> 7 + #include <linux/of.h> 8 + #include <linux/platform_device.h> 9 + 10 + #include "pinctrl-msm.h" 11 + 12 + static const struct pinctrl_pin_desc msm8917_pins[] = { 13 + PINCTRL_PIN(0, "GPIO_0"), 14 + PINCTRL_PIN(1, "GPIO_1"), 15 + PINCTRL_PIN(2, "GPIO_2"), 16 + PINCTRL_PIN(3, "GPIO_3"), 17 + PINCTRL_PIN(4, "GPIO_4"), 18 + PINCTRL_PIN(5, "GPIO_5"), 19 + PINCTRL_PIN(6, "GPIO_6"), 20 + PINCTRL_PIN(7, "GPIO_7"), 21 + PINCTRL_PIN(8, "GPIO_8"), 22 + PINCTRL_PIN(9, "GPIO_9"), 23 + PINCTRL_PIN(10, "GPIO_10"), 24 + PINCTRL_PIN(11, "GPIO_11"), 25 + PINCTRL_PIN(12, "GPIO_12"), 26 + PINCTRL_PIN(13, "GPIO_13"), 27 + PINCTRL_PIN(14, "GPIO_14"), 28 + PINCTRL_PIN(15, "GPIO_15"), 29 + PINCTRL_PIN(16, "GPIO_16"), 30 + PINCTRL_PIN(17, "GPIO_17"), 31 + PINCTRL_PIN(18, "GPIO_18"), 32 + PINCTRL_PIN(19, "GPIO_19"), 33 + PINCTRL_PIN(20, "GPIO_20"), 34 + PINCTRL_PIN(21, "GPIO_21"), 35 + PINCTRL_PIN(22, "GPIO_22"), 36 + PINCTRL_PIN(23, "GPIO_23"), 37 + PINCTRL_PIN(24, "GPIO_24"), 38 + PINCTRL_PIN(25, "GPIO_25"), 39 + PINCTRL_PIN(26, "GPIO_26"), 40 + PINCTRL_PIN(27, "GPIO_27"), 41 + PINCTRL_PIN(28, "GPIO_28"), 42 + PINCTRL_PIN(29, "GPIO_29"), 43 + PINCTRL_PIN(30, "GPIO_30"), 44 + PINCTRL_PIN(31, "GPIO_31"), 45 + PINCTRL_PIN(32, "GPIO_32"), 46 + PINCTRL_PIN(33, "GPIO_33"), 47 + PINCTRL_PIN(34, "GPIO_34"), 48 + PINCTRL_PIN(35, "GPIO_35"), 49 + PINCTRL_PIN(36, "GPIO_36"), 50 + PINCTRL_PIN(37, "GPIO_37"), 51 + PINCTRL_PIN(38, "GPIO_38"), 52 + PINCTRL_PIN(39, "GPIO_39"), 53 + PINCTRL_PIN(40, "GPIO_40"), 54 + PINCTRL_PIN(41, "GPIO_41"), 55 + PINCTRL_PIN(42, "GPIO_42"), 56 + PINCTRL_PIN(43, "GPIO_43"), 57 + PINCTRL_PIN(44, "GPIO_44"), 58 + PINCTRL_PIN(45, "GPIO_45"), 59 + PINCTRL_PIN(46, "GPIO_46"), 60 + PINCTRL_PIN(47, "GPIO_47"), 61 + PINCTRL_PIN(48, "GPIO_48"), 62 + PINCTRL_PIN(49, "GPIO_49"), 63 + PINCTRL_PIN(50, "GPIO_50"), 64 + PINCTRL_PIN(51, "GPIO_51"), 65 + PINCTRL_PIN(52, "GPIO_52"), 66 + PINCTRL_PIN(53, "GPIO_53"), 67 + PINCTRL_PIN(54, "GPIO_54"), 68 + PINCTRL_PIN(55, "GPIO_55"), 69 + PINCTRL_PIN(56, "GPIO_56"), 70 + PINCTRL_PIN(57, "GPIO_57"), 71 + PINCTRL_PIN(58, "GPIO_58"), 72 + PINCTRL_PIN(59, "GPIO_59"), 73 + PINCTRL_PIN(60, "GPIO_60"), 74 + PINCTRL_PIN(61, "GPIO_61"), 75 + PINCTRL_PIN(62, "GPIO_62"), 76 + PINCTRL_PIN(63, "GPIO_63"), 77 + PINCTRL_PIN(64, "GPIO_64"), 78 + PINCTRL_PIN(65, "GPIO_65"), 79 + PINCTRL_PIN(66, "GPIO_66"), 80 + PINCTRL_PIN(67, "GPIO_67"), 81 + PINCTRL_PIN(68, "GPIO_68"), 82 + PINCTRL_PIN(69, "GPIO_69"), 83 + PINCTRL_PIN(70, "GPIO_70"), 84 + PINCTRL_PIN(71, "GPIO_71"), 85 + PINCTRL_PIN(72, "GPIO_72"), 86 + PINCTRL_PIN(73, "GPIO_73"), 87 + PINCTRL_PIN(74, "GPIO_74"), 88 + PINCTRL_PIN(75, "GPIO_75"), 89 + PINCTRL_PIN(76, "GPIO_76"), 90 + PINCTRL_PIN(77, "GPIO_77"), 91 + PINCTRL_PIN(78, "GPIO_78"), 92 + PINCTRL_PIN(79, "GPIO_79"), 93 + PINCTRL_PIN(80, "GPIO_80"), 94 + PINCTRL_PIN(81, "GPIO_81"), 95 + PINCTRL_PIN(82, "GPIO_82"), 96 + PINCTRL_PIN(83, "GPIO_83"), 97 + PINCTRL_PIN(84, "GPIO_84"), 98 + PINCTRL_PIN(85, "GPIO_85"), 99 + PINCTRL_PIN(86, "GPIO_86"), 100 + PINCTRL_PIN(87, "GPIO_87"), 101 + PINCTRL_PIN(88, "GPIO_88"), 102 + PINCTRL_PIN(89, "GPIO_89"), 103 + PINCTRL_PIN(90, "GPIO_90"), 104 + PINCTRL_PIN(91, "GPIO_91"), 105 + PINCTRL_PIN(92, "GPIO_92"), 106 + PINCTRL_PIN(93, "GPIO_93"), 107 + PINCTRL_PIN(94, "GPIO_94"), 108 + PINCTRL_PIN(95, "GPIO_95"), 109 + PINCTRL_PIN(96, "GPIO_96"), 110 + PINCTRL_PIN(97, "GPIO_97"), 111 + PINCTRL_PIN(98, "GPIO_98"), 112 + PINCTRL_PIN(99, "GPIO_99"), 113 + PINCTRL_PIN(100, "GPIO_100"), 114 + PINCTRL_PIN(101, "GPIO_101"), 115 + PINCTRL_PIN(102, "GPIO_102"), 116 + PINCTRL_PIN(103, "GPIO_103"), 117 + PINCTRL_PIN(104, "GPIO_104"), 118 + PINCTRL_PIN(105, "GPIO_105"), 119 + PINCTRL_PIN(106, "GPIO_106"), 120 + PINCTRL_PIN(107, "GPIO_107"), 121 + PINCTRL_PIN(108, "GPIO_108"), 122 + PINCTRL_PIN(109, "GPIO_109"), 123 + PINCTRL_PIN(110, "GPIO_110"), 124 + PINCTRL_PIN(111, "GPIO_111"), 125 + PINCTRL_PIN(112, "GPIO_112"), 126 + PINCTRL_PIN(113, "GPIO_113"), 127 + PINCTRL_PIN(114, "GPIO_114"), 128 + PINCTRL_PIN(115, "GPIO_115"), 129 + PINCTRL_PIN(116, "GPIO_116"), 130 + PINCTRL_PIN(117, "GPIO_117"), 131 + PINCTRL_PIN(118, "GPIO_118"), 132 + PINCTRL_PIN(119, "GPIO_119"), 133 + PINCTRL_PIN(120, "GPIO_120"), 134 + PINCTRL_PIN(121, "GPIO_121"), 135 + PINCTRL_PIN(122, "GPIO_122"), 136 + PINCTRL_PIN(123, "GPIO_123"), 137 + PINCTRL_PIN(124, "GPIO_124"), 138 + PINCTRL_PIN(125, "GPIO_125"), 139 + PINCTRL_PIN(126, "GPIO_126"), 140 + PINCTRL_PIN(127, "GPIO_127"), 141 + PINCTRL_PIN(128, "GPIO_128"), 142 + PINCTRL_PIN(129, "GPIO_129"), 143 + PINCTRL_PIN(130, "GPIO_130"), 144 + PINCTRL_PIN(131, "GPIO_131"), 145 + PINCTRL_PIN(132, "GPIO_132"), 146 + PINCTRL_PIN(133, "GPIO_133"), 147 + PINCTRL_PIN(134, "SDC1_CLK"), 148 + PINCTRL_PIN(135, "SDC1_CMD"), 149 + PINCTRL_PIN(136, "SDC1_DATA"), 150 + PINCTRL_PIN(137, "SDC1_RCLK"), 151 + PINCTRL_PIN(138, "SDC2_CLK"), 152 + PINCTRL_PIN(139, "SDC2_CMD"), 153 + PINCTRL_PIN(140, "SDC2_DATA"), 154 + PINCTRL_PIN(141, "QDSD_CLK"), 155 + PINCTRL_PIN(142, "QDSD_CMD"), 156 + PINCTRL_PIN(143, "QDSD_DATA0"), 157 + PINCTRL_PIN(144, "QDSD_DATA1"), 158 + PINCTRL_PIN(145, "QDSD_DATA2"), 159 + PINCTRL_PIN(146, "QDSD_DATA3"), 160 + }; 161 + 162 + #define DECLARE_MSM_GPIO_PINS(pin) \ 163 + static const unsigned int gpio##pin##_pins[] = { pin } 164 + 165 + DECLARE_MSM_GPIO_PINS(0); 166 + DECLARE_MSM_GPIO_PINS(1); 167 + DECLARE_MSM_GPIO_PINS(2); 168 + DECLARE_MSM_GPIO_PINS(3); 169 + DECLARE_MSM_GPIO_PINS(4); 170 + DECLARE_MSM_GPIO_PINS(5); 171 + DECLARE_MSM_GPIO_PINS(6); 172 + DECLARE_MSM_GPIO_PINS(7); 173 + DECLARE_MSM_GPIO_PINS(8); 174 + DECLARE_MSM_GPIO_PINS(9); 175 + DECLARE_MSM_GPIO_PINS(10); 176 + DECLARE_MSM_GPIO_PINS(11); 177 + DECLARE_MSM_GPIO_PINS(12); 178 + DECLARE_MSM_GPIO_PINS(13); 179 + DECLARE_MSM_GPIO_PINS(14); 180 + DECLARE_MSM_GPIO_PINS(15); 181 + DECLARE_MSM_GPIO_PINS(16); 182 + DECLARE_MSM_GPIO_PINS(17); 183 + DECLARE_MSM_GPIO_PINS(18); 184 + DECLARE_MSM_GPIO_PINS(19); 185 + DECLARE_MSM_GPIO_PINS(20); 186 + DECLARE_MSM_GPIO_PINS(21); 187 + DECLARE_MSM_GPIO_PINS(22); 188 + DECLARE_MSM_GPIO_PINS(23); 189 + DECLARE_MSM_GPIO_PINS(24); 190 + DECLARE_MSM_GPIO_PINS(25); 191 + DECLARE_MSM_GPIO_PINS(26); 192 + DECLARE_MSM_GPIO_PINS(27); 193 + DECLARE_MSM_GPIO_PINS(28); 194 + DECLARE_MSM_GPIO_PINS(29); 195 + DECLARE_MSM_GPIO_PINS(30); 196 + DECLARE_MSM_GPIO_PINS(31); 197 + DECLARE_MSM_GPIO_PINS(32); 198 + DECLARE_MSM_GPIO_PINS(33); 199 + DECLARE_MSM_GPIO_PINS(34); 200 + DECLARE_MSM_GPIO_PINS(35); 201 + DECLARE_MSM_GPIO_PINS(36); 202 + DECLARE_MSM_GPIO_PINS(37); 203 + DECLARE_MSM_GPIO_PINS(38); 204 + DECLARE_MSM_GPIO_PINS(39); 205 + DECLARE_MSM_GPIO_PINS(40); 206 + DECLARE_MSM_GPIO_PINS(41); 207 + DECLARE_MSM_GPIO_PINS(42); 208 + DECLARE_MSM_GPIO_PINS(43); 209 + DECLARE_MSM_GPIO_PINS(44); 210 + DECLARE_MSM_GPIO_PINS(45); 211 + DECLARE_MSM_GPIO_PINS(46); 212 + DECLARE_MSM_GPIO_PINS(47); 213 + DECLARE_MSM_GPIO_PINS(48); 214 + DECLARE_MSM_GPIO_PINS(49); 215 + DECLARE_MSM_GPIO_PINS(50); 216 + DECLARE_MSM_GPIO_PINS(51); 217 + DECLARE_MSM_GPIO_PINS(52); 218 + DECLARE_MSM_GPIO_PINS(53); 219 + DECLARE_MSM_GPIO_PINS(54); 220 + DECLARE_MSM_GPIO_PINS(55); 221 + DECLARE_MSM_GPIO_PINS(56); 222 + DECLARE_MSM_GPIO_PINS(57); 223 + DECLARE_MSM_GPIO_PINS(58); 224 + DECLARE_MSM_GPIO_PINS(59); 225 + DECLARE_MSM_GPIO_PINS(60); 226 + DECLARE_MSM_GPIO_PINS(61); 227 + DECLARE_MSM_GPIO_PINS(62); 228 + DECLARE_MSM_GPIO_PINS(63); 229 + DECLARE_MSM_GPIO_PINS(64); 230 + DECLARE_MSM_GPIO_PINS(65); 231 + DECLARE_MSM_GPIO_PINS(66); 232 + DECLARE_MSM_GPIO_PINS(67); 233 + DECLARE_MSM_GPIO_PINS(68); 234 + DECLARE_MSM_GPIO_PINS(69); 235 + DECLARE_MSM_GPIO_PINS(70); 236 + DECLARE_MSM_GPIO_PINS(71); 237 + DECLARE_MSM_GPIO_PINS(72); 238 + DECLARE_MSM_GPIO_PINS(73); 239 + DECLARE_MSM_GPIO_PINS(74); 240 + DECLARE_MSM_GPIO_PINS(75); 241 + DECLARE_MSM_GPIO_PINS(76); 242 + DECLARE_MSM_GPIO_PINS(77); 243 + DECLARE_MSM_GPIO_PINS(78); 244 + DECLARE_MSM_GPIO_PINS(79); 245 + DECLARE_MSM_GPIO_PINS(80); 246 + DECLARE_MSM_GPIO_PINS(81); 247 + DECLARE_MSM_GPIO_PINS(82); 248 + DECLARE_MSM_GPIO_PINS(83); 249 + DECLARE_MSM_GPIO_PINS(84); 250 + DECLARE_MSM_GPIO_PINS(85); 251 + DECLARE_MSM_GPIO_PINS(86); 252 + DECLARE_MSM_GPIO_PINS(87); 253 + DECLARE_MSM_GPIO_PINS(88); 254 + DECLARE_MSM_GPIO_PINS(89); 255 + DECLARE_MSM_GPIO_PINS(90); 256 + DECLARE_MSM_GPIO_PINS(91); 257 + DECLARE_MSM_GPIO_PINS(92); 258 + DECLARE_MSM_GPIO_PINS(93); 259 + DECLARE_MSM_GPIO_PINS(94); 260 + DECLARE_MSM_GPIO_PINS(95); 261 + DECLARE_MSM_GPIO_PINS(96); 262 + DECLARE_MSM_GPIO_PINS(97); 263 + DECLARE_MSM_GPIO_PINS(98); 264 + DECLARE_MSM_GPIO_PINS(99); 265 + DECLARE_MSM_GPIO_PINS(100); 266 + DECLARE_MSM_GPIO_PINS(101); 267 + DECLARE_MSM_GPIO_PINS(102); 268 + DECLARE_MSM_GPIO_PINS(103); 269 + DECLARE_MSM_GPIO_PINS(104); 270 + DECLARE_MSM_GPIO_PINS(105); 271 + DECLARE_MSM_GPIO_PINS(106); 272 + DECLARE_MSM_GPIO_PINS(107); 273 + DECLARE_MSM_GPIO_PINS(108); 274 + DECLARE_MSM_GPIO_PINS(109); 275 + DECLARE_MSM_GPIO_PINS(110); 276 + DECLARE_MSM_GPIO_PINS(111); 277 + DECLARE_MSM_GPIO_PINS(112); 278 + DECLARE_MSM_GPIO_PINS(113); 279 + DECLARE_MSM_GPIO_PINS(114); 280 + DECLARE_MSM_GPIO_PINS(115); 281 + DECLARE_MSM_GPIO_PINS(116); 282 + DECLARE_MSM_GPIO_PINS(117); 283 + DECLARE_MSM_GPIO_PINS(118); 284 + DECLARE_MSM_GPIO_PINS(119); 285 + DECLARE_MSM_GPIO_PINS(120); 286 + DECLARE_MSM_GPIO_PINS(121); 287 + DECLARE_MSM_GPIO_PINS(122); 288 + DECLARE_MSM_GPIO_PINS(123); 289 + DECLARE_MSM_GPIO_PINS(124); 290 + DECLARE_MSM_GPIO_PINS(125); 291 + DECLARE_MSM_GPIO_PINS(126); 292 + DECLARE_MSM_GPIO_PINS(127); 293 + DECLARE_MSM_GPIO_PINS(128); 294 + DECLARE_MSM_GPIO_PINS(129); 295 + DECLARE_MSM_GPIO_PINS(130); 296 + DECLARE_MSM_GPIO_PINS(131); 297 + DECLARE_MSM_GPIO_PINS(132); 298 + DECLARE_MSM_GPIO_PINS(133); 299 + 300 + static const unsigned int sdc1_clk_pins[] = { 134 }; 301 + static const unsigned int sdc1_cmd_pins[] = { 135 }; 302 + static const unsigned int sdc1_data_pins[] = { 136 }; 303 + static const unsigned int sdc1_rclk_pins[] = { 137 }; 304 + static const unsigned int sdc2_clk_pins[] = { 138 }; 305 + static const unsigned int sdc2_cmd_pins[] = { 139 }; 306 + static const unsigned int sdc2_data_pins[] = { 140 }; 307 + static const unsigned int qdsd_clk_pins[] = { 141 }; 308 + static const unsigned int qdsd_cmd_pins[] = { 142 }; 309 + static const unsigned int qdsd_data0_pins[] = { 143 }; 310 + static const unsigned int qdsd_data1_pins[] = { 144 }; 311 + static const unsigned int qdsd_data2_pins[] = { 145 }; 312 + static const unsigned int qdsd_data3_pins[] = { 146 }; 313 + 314 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 315 + { \ 316 + .grp = PINCTRL_PINGROUP("gpio" #id, \ 317 + gpio##id##_pins, \ 318 + ARRAY_SIZE(gpio##id##_pins)), \ 319 + .funcs = (int[]){ \ 320 + msm_mux_gpio, \ 321 + msm_mux_##f1, \ 322 + msm_mux_##f2, \ 323 + msm_mux_##f3, \ 324 + msm_mux_##f4, \ 325 + msm_mux_##f5, \ 326 + msm_mux_##f6, \ 327 + msm_mux_##f7, \ 328 + msm_mux_##f8, \ 329 + msm_mux_##f9 \ 330 + }, \ 331 + .nfuncs = 10, \ 332 + .ctl_reg = 0x1000 * id, \ 333 + .io_reg = 0x4 + 0x1000 * id, \ 334 + .intr_cfg_reg = 0x8 + 0x1000 * id, \ 335 + .intr_status_reg = 0xc + 0x1000 * id, \ 336 + .intr_target_reg = 0x8 + 0x1000 * id, \ 337 + .mux_bit = 2, \ 338 + .pull_bit = 0, \ 339 + .drv_bit = 6, \ 340 + .oe_bit = 9, \ 341 + .in_bit = 0, \ 342 + .out_bit = 1, \ 343 + .intr_enable_bit = 0, \ 344 + .intr_status_bit = 0, \ 345 + .intr_target_bit = 5, \ 346 + .intr_target_kpss_val = 4, \ 347 + .intr_raw_status_bit = 4, \ 348 + .intr_polarity_bit = 1, \ 349 + .intr_detection_bit = 2, \ 350 + .intr_detection_width = 2, \ 351 + } 352 + 353 + #define SDC_PINGROUP(pg_name, ctl, pull, drv) \ 354 + { \ 355 + .grp = PINCTRL_PINGROUP(#pg_name, \ 356 + pg_name##_pins, \ 357 + ARRAY_SIZE(pg_name##_pins)), \ 358 + .ctl_reg = ctl, \ 359 + .io_reg = 0, \ 360 + .intr_cfg_reg = 0, \ 361 + .intr_status_reg = 0, \ 362 + .intr_target_reg = 0, \ 363 + .mux_bit = -1, \ 364 + .pull_bit = pull, \ 365 + .drv_bit = drv, \ 366 + .oe_bit = -1, \ 367 + .in_bit = -1, \ 368 + .out_bit = -1, \ 369 + .intr_enable_bit = -1, \ 370 + .intr_status_bit = -1, \ 371 + .intr_target_bit = -1, \ 372 + .intr_target_kpss_val = -1, \ 373 + .intr_raw_status_bit = -1, \ 374 + .intr_polarity_bit = -1, \ 375 + .intr_detection_bit = -1, \ 376 + .intr_detection_width = -1, \ 377 + } 378 + 379 + enum msm8917_functions { 380 + msm_mux_accel_int, 381 + msm_mux_adsp_ext, 382 + msm_mux_alsp_int, 383 + msm_mux_atest_bbrx0, 384 + msm_mux_atest_bbrx1, 385 + msm_mux_atest_char, 386 + msm_mux_atest_char0, 387 + msm_mux_atest_char1, 388 + msm_mux_atest_char2, 389 + msm_mux_atest_char3, 390 + msm_mux_atest_combodac_to_gpio_native, 391 + msm_mux_atest_gpsadc_dtest0_native, 392 + msm_mux_atest_gpsadc_dtest1_native, 393 + msm_mux_atest_tsens, 394 + msm_mux_atest_wlan0, 395 + msm_mux_atest_wlan1, 396 + msm_mux_audio_ref, 397 + msm_mux_audio_reset, 398 + msm_mux_bimc_dte0, 399 + msm_mux_bimc_dte1, 400 + msm_mux_blsp6_spi, 401 + msm_mux_blsp8_spi, 402 + msm_mux_blsp_i2c1, 403 + msm_mux_blsp_i2c2, 404 + msm_mux_blsp_i2c3, 405 + msm_mux_blsp_i2c4, 406 + msm_mux_blsp_i2c5, 407 + msm_mux_blsp_i2c6, 408 + msm_mux_blsp_i2c7, 409 + msm_mux_blsp_i2c8, 410 + msm_mux_blsp_spi1, 411 + msm_mux_blsp_spi2, 412 + msm_mux_blsp_spi3, 413 + msm_mux_blsp_spi4, 414 + msm_mux_blsp_spi5, 415 + msm_mux_blsp_spi6, 416 + msm_mux_blsp_spi7, 417 + msm_mux_blsp_spi8, 418 + msm_mux_blsp_uart1, 419 + msm_mux_blsp_uart2, 420 + msm_mux_blsp_uart3, 421 + msm_mux_blsp_uart4, 422 + msm_mux_blsp_uart5, 423 + msm_mux_blsp_uart6, 424 + msm_mux_blsp_uart7, 425 + msm_mux_blsp_uart8, 426 + msm_mux_cam0_ldo, 427 + msm_mux_cam1_rst, 428 + msm_mux_cam1_standby, 429 + msm_mux_cam2_rst, 430 + msm_mux_cam2_standby, 431 + msm_mux_cam_mclk, 432 + msm_mux_cci_async, 433 + msm_mux_cci_i2c, 434 + msm_mux_cci_timer0, 435 + msm_mux_cci_timer1, 436 + msm_mux_cdc_pdm0, 437 + msm_mux_codec_int1, 438 + msm_mux_codec_int2, 439 + msm_mux_codec_mad, 440 + msm_mux_coex_uart, 441 + msm_mux_cri_trng, 442 + msm_mux_cri_trng0, 443 + msm_mux_cri_trng1, 444 + msm_mux_dbg_out, 445 + msm_mux_dmic0_clk, 446 + msm_mux_dmic0_data, 447 + msm_mux_ebi_cdc, 448 + msm_mux_ebi_ch0, 449 + msm_mux_ext_lpass, 450 + msm_mux_forced_usb, 451 + msm_mux_fp_gpio, 452 + msm_mux_fp_int, 453 + msm_mux_gcc_gp1_clk_a, 454 + msm_mux_gcc_gp1_clk_b, 455 + msm_mux_gcc_gp2_clk_a, 456 + msm_mux_gcc_gp2_clk_b, 457 + msm_mux_gcc_gp3_clk_a, 458 + msm_mux_gcc_gp3_clk_b, 459 + msm_mux_gcc_plltest, 460 + msm_mux_gcc_tlmm, 461 + msm_mux_gpio, 462 + msm_mux_gsm0_tx, 463 + msm_mux_key_focus, 464 + msm_mux_key_snapshot, 465 + msm_mux_key_volp, 466 + msm_mux_ldo_en, 467 + msm_mux_ldo_update, 468 + msm_mux_lpass_slimbus, 469 + msm_mux_lpass_slimbus0, 470 + msm_mux_lpass_slimbus1, 471 + msm_mux_m_voc, 472 + msm_mux_mag_int, 473 + msm_mux_mdp_vsync, 474 + msm_mux_mipi_dsi0, 475 + msm_mux_modem_tsync, 476 + msm_mux_nav_pps, 477 + msm_mux_nav_pps_in_a, 478 + msm_mux_nav_pps_in_b, 479 + msm_mux_nav_tsync, 480 + msm_mux_nfc_pwr, 481 + msm_mux_ov_ldo, 482 + msm_mux_pa_indicator, 483 + msm_mux_pbs0, 484 + msm_mux_pbs1, 485 + msm_mux_pbs2, 486 + msm_mux_pri_mi2s, 487 + msm_mux_pri_mi2s_mclk_a, 488 + msm_mux_pri_mi2s_mclk_b, 489 + msm_mux_pri_mi2s_ws, 490 + msm_mux_prng_rosc, 491 + msm_mux_pwr_crypto_enabled_a, 492 + msm_mux_pwr_crypto_enabled_b, 493 + msm_mux_pwr_modem_enabled_a, 494 + msm_mux_pwr_modem_enabled_b, 495 + msm_mux_pwr_nav_enabled_a, 496 + msm_mux_pwr_nav_enabled_b, 497 + msm_mux_qdss_cti_trig_in_a0, 498 + msm_mux_qdss_cti_trig_in_a1, 499 + msm_mux_qdss_cti_trig_in_b0, 500 + msm_mux_qdss_cti_trig_in_b1, 501 + msm_mux_qdss_cti_trig_out_a0, 502 + msm_mux_qdss_cti_trig_out_a1, 503 + msm_mux_qdss_cti_trig_out_b0, 504 + msm_mux_qdss_cti_trig_out_b1, 505 + msm_mux_qdss_traceclk_a, 506 + msm_mux_qdss_traceclk_b, 507 + msm_mux_qdss_tracectl_a, 508 + msm_mux_qdss_tracectl_b, 509 + msm_mux_qdss_tracedata_a, 510 + msm_mux_qdss_tracedata_b, 511 + msm_mux_sd_write, 512 + msm_mux_sdcard_det, 513 + msm_mux_sec_mi2s, 514 + msm_mux_sec_mi2s_mclk_a, 515 + msm_mux_sec_mi2s_mclk_b, 516 + msm_mux_sensor_rst, 517 + msm_mux_smb_int, 518 + msm_mux_ssbi_wtr1, 519 + msm_mux_ts_resout, 520 + msm_mux_ts_sample, 521 + msm_mux_uim1_clk, 522 + msm_mux_uim1_data, 523 + msm_mux_uim1_present, 524 + msm_mux_uim1_reset, 525 + msm_mux_uim2_clk, 526 + msm_mux_uim2_data, 527 + msm_mux_uim2_present, 528 + msm_mux_uim2_reset, 529 + msm_mux_uim_batt, 530 + msm_mux_us_emitter, 531 + msm_mux_us_euro, 532 + msm_mux_wcss_bt, 533 + msm_mux_wcss_fm, 534 + msm_mux_wcss_wlan, 535 + msm_mux_wcss_wlan0, 536 + msm_mux_wcss_wlan1, 537 + msm_mux_wcss_wlan2, 538 + msm_mux_webcam_rst, 539 + msm_mux_webcam_standby, 540 + msm_mux_wsa_io, 541 + msm_mux_wsa_irq, 542 + msm_mux__, 543 + }; 544 + 545 + static const char * const qdss_tracedata_b_groups[] = { 546 + "gpio0", "gpio1", "gpio6", "gpio7", "gpio12", "gpio13", "gpio23", 547 + "gpio42", "gpio43", "gpio44", "gpio47", "gpio66", "gpio86", "gpio87", 548 + "gpio88", "gpio92", 549 + }; 550 + 551 + static const char * const blsp_uart1_groups[] = { 552 + "gpio0", "gpio1", "gpio2", "gpio3", 553 + }; 554 + 555 + static const char * const gpio_groups[] = { 556 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 557 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 558 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 559 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 560 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 561 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 562 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 563 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 564 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 565 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 566 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 567 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 568 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 569 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 570 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 571 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 572 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 573 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 574 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 575 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", 576 + }; 577 + 578 + static const char * const blsp_spi1_groups[] = { 579 + "gpio0", "gpio1", "gpio2", "gpio3", 580 + }; 581 + 582 + static const char * const adsp_ext_groups[] = { 583 + "gpio1", 584 + }; 585 + 586 + static const char * const blsp_i2c1_groups[] = { 587 + "gpio2", "gpio3", 588 + }; 589 + 590 + static const char * const prng_rosc_groups[] = { 591 + "gpio2", 592 + }; 593 + 594 + static const char * const qdss_cti_trig_out_b0_groups[] = { 595 + "gpio2", 596 + }; 597 + 598 + static const char * const blsp_spi2_groups[] = { 599 + "gpio4", "gpio5", "gpio6", "gpio7", 600 + }; 601 + 602 + static const char * const blsp_uart2_groups[] = { 603 + "gpio4", "gpio5", "gpio6", "gpio7", 604 + }; 605 + 606 + static const char * const blsp_uart3_groups[] = { 607 + "gpio8", "gpio9", "gpio10", "gpio11", 608 + }; 609 + 610 + static const char * const pbs0_groups[] = { 611 + "gpio8", 612 + }; 613 + 614 + static const char * const pbs1_groups[] = { 615 + "gpio9", 616 + }; 617 + 618 + static const char * const pwr_modem_enabled_b_groups[] = { 619 + "gpio9", 620 + }; 621 + 622 + static const char * const blsp_i2c3_groups[] = { 623 + "gpio10", "gpio11", 624 + }; 625 + 626 + static const char * const gcc_gp2_clk_b_groups[] = { 627 + "gpio10", 628 + }; 629 + 630 + static const char * const ldo_update_groups[] = { 631 + "gpio4", 632 + }; 633 + 634 + static const char * const atest_combodac_to_gpio_native_groups[] = { 635 + "gpio4", "gpio12", "gpio13", "gpio20", "gpio21", "gpio28", "gpio29", 636 + "gpio30", "gpio39", "gpio40", "gpio41", "gpio42", "gpio43", "gpio44", 637 + "gpio45", "gpio46", "gpio47", "gpio48", "gpio67", "gpio115", 638 + }; 639 + 640 + static const char * const ldo_en_groups[] = { 641 + "gpio5", 642 + }; 643 + 644 + static const char * const blsp_i2c2_groups[] = { 645 + "gpio6", "gpio7", 646 + }; 647 + 648 + static const char * const gcc_gp1_clk_b_groups[] = { 649 + "gpio6", 650 + }; 651 + 652 + static const char * const pbs2_groups[] = { 653 + "gpio7", 654 + }; 655 + 656 + static const char * const atest_gpsadc_dtest0_native_groups[] = { 657 + "gpio7", 658 + }; 659 + 660 + static const char * const blsp_spi3_groups[] = { 661 + "gpio8", "gpio9", "gpio10", "gpio11", 662 + }; 663 + 664 + static const char * const gcc_gp3_clk_b_groups[] = { 665 + "gpio11", 666 + }; 667 + 668 + static const char * const blsp_spi4_groups[] = { 669 + "gpio12", "gpio13", "gpio14", "gpio15", 670 + }; 671 + 672 + static const char * const blsp_uart4_groups[] = { 673 + "gpio12", "gpio13", "gpio14", "gpio15", 674 + }; 675 + 676 + static const char * const sec_mi2s_groups[] = { 677 + "gpio12", "gpio13", "gpio94", "gpio95", 678 + }; 679 + 680 + static const char * const pwr_nav_enabled_b_groups[] = { 681 + "gpio12", 682 + }; 683 + 684 + static const char * const codec_mad_groups[] = { 685 + "gpio13", 686 + }; 687 + 688 + static const char * const pwr_crypto_enabled_b_groups[] = { 689 + "gpio13", 690 + }; 691 + 692 + static const char * const blsp_i2c4_groups[] = { 693 + "gpio14", "gpio15", 694 + }; 695 + 696 + static const char * const blsp_spi5_groups[] = { 697 + "gpio16", "gpio17", "gpio18", "gpio19", 698 + }; 699 + 700 + static const char * const blsp_uart5_groups[] = { 701 + "gpio16", "gpio17", "gpio18", "gpio19", 702 + }; 703 + 704 + static const char * const qdss_traceclk_a_groups[] = { 705 + "gpio16", 706 + }; 707 + 708 + static const char * const atest_bbrx1_groups[] = { 709 + "gpio16", 710 + }; 711 + 712 + static const char * const m_voc_groups[] = { 713 + "gpio17", "gpio21", 714 + }; 715 + 716 + static const char * const qdss_cti_trig_in_a0_groups[] = { 717 + "gpio17", 718 + }; 719 + 720 + static const char * const qdss_cti_trig_in_b0_groups[] = { 721 + "gpio21", 722 + }; 723 + 724 + static const char * const blsp_i2c6_groups[] = { 725 + "gpio22", "gpio23", 726 + }; 727 + 728 + static const char * const qdss_traceclk_b_groups[] = { 729 + "gpio22", 730 + }; 731 + 732 + static const char * const atest_wlan0_groups[] = { 733 + "gpio22", 734 + }; 735 + 736 + static const char * const atest_bbrx0_groups[] = { 737 + "gpio17", 738 + }; 739 + 740 + static const char * const blsp_i2c5_groups[] = { 741 + "gpio18", "gpio19", 742 + }; 743 + 744 + static const char * const qdss_tracectl_a_groups[] = { 745 + "gpio18", 746 + }; 747 + 748 + static const char * const atest_gpsadc_dtest1_native_groups[] = { 749 + "gpio18", 750 + }; 751 + 752 + static const char * const qdss_tracedata_a_groups[] = { 753 + "gpio19", "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", 754 + "gpio32", "gpio33", "gpio34", "gpio35", "gpio36", "gpio38", "gpio39", 755 + "gpio40", "gpio50", 756 + }; 757 + 758 + static const char * const blsp_spi6_groups[] = { 759 + "gpio20", "gpio21", "gpio22", "gpio23", 760 + }; 761 + 762 + static const char * const blsp_uart6_groups[] = { 763 + "gpio20", "gpio21", "gpio22", "gpio23", 764 + }; 765 + 766 + static const char * const qdss_tracectl_b_groups[] = { 767 + "gpio20", 768 + }; 769 + 770 + static const char * const atest_wlan1_groups[] = { 771 + "gpio23", 772 + }; 773 + 774 + static const char * const mdp_vsync_groups[] = { 775 + "gpio24", "gpio25", 776 + }; 777 + 778 + static const char * const pri_mi2s_mclk_a_groups[] = { 779 + "gpio25", 780 + }; 781 + 782 + static const char * const sec_mi2s_mclk_a_groups[] = { 783 + "gpio25", 784 + }; 785 + 786 + static const char * const cam_mclk_groups[] = { 787 + "gpio26", "gpio27", "gpio28", 788 + }; 789 + 790 + static const char * const cci_i2c_groups[] = { 791 + "gpio29", "gpio30", "gpio31", "gpio32", 792 + }; 793 + 794 + static const char * const pwr_modem_enabled_a_groups[] = { 795 + "gpio29", 796 + }; 797 + 798 + static const char * const cci_timer0_groups[] = { 799 + "gpio33", 800 + }; 801 + 802 + static const char * const cci_timer1_groups[] = { 803 + "gpio34", 804 + }; 805 + 806 + static const char * const cam1_standby_groups[] = { 807 + "gpio35", 808 + }; 809 + 810 + static const char * const pwr_nav_enabled_a_groups[] = { 811 + "gpio35", 812 + }; 813 + 814 + static const char * const cam1_rst_groups[] = { 815 + "gpio36", 816 + }; 817 + 818 + static const char * const pwr_crypto_enabled_a_groups[] = { 819 + "gpio36", 820 + }; 821 + 822 + static const char * const forced_usb_groups[] = { 823 + "gpio37", 824 + }; 825 + 826 + static const char * const qdss_cti_trig_out_b1_groups[] = { 827 + "gpio37", 828 + }; 829 + 830 + static const char * const cam2_rst_groups[] = { 831 + "gpio38", 832 + }; 833 + 834 + static const char * const webcam_standby_groups[] = { 835 + "gpio39", 836 + }; 837 + 838 + static const char * const cci_async_groups[] = { 839 + "gpio39", 840 + }; 841 + 842 + static const char * const webcam_rst_groups[] = { 843 + "gpio40", 844 + }; 845 + 846 + static const char * const ov_ldo_groups[] = { 847 + "gpio41", 848 + }; 849 + 850 + static const char * const sd_write_groups[] = { 851 + "gpio41", 852 + }; 853 + 854 + static const char * const accel_int_groups[] = { 855 + "gpio42", 856 + }; 857 + 858 + static const char * const gcc_gp1_clk_a_groups[] = { 859 + "gpio42", 860 + }; 861 + 862 + static const char * const alsp_int_groups[] = { 863 + "gpio43", 864 + }; 865 + 866 + static const char * const gcc_gp2_clk_a_groups[] = { 867 + "gpio43", 868 + }; 869 + 870 + static const char * const mag_int_groups[] = { 871 + "gpio44", 872 + }; 873 + 874 + static const char * const gcc_gp3_clk_a_groups[] = { 875 + "gpio44", 876 + }; 877 + 878 + static const char * const blsp6_spi_groups[] = { 879 + "gpio47", 880 + }; 881 + 882 + static const char * const fp_int_groups[] = { 883 + "gpio48", 884 + }; 885 + 886 + static const char * const qdss_cti_trig_in_b1_groups[] = { 887 + "gpio48", 888 + }; 889 + 890 + static const char * const uim_batt_groups[] = { 891 + "gpio49", 892 + }; 893 + 894 + static const char * const cam2_standby_groups[] = { 895 + "gpio50", 896 + }; 897 + 898 + static const char * const uim1_data_groups[] = { 899 + "gpio51", 900 + }; 901 + 902 + static const char * const uim1_clk_groups[] = { 903 + "gpio52", 904 + }; 905 + 906 + static const char * const uim1_reset_groups[] = { 907 + "gpio53", 908 + }; 909 + 910 + static const char * const uim1_present_groups[] = { 911 + "gpio54", 912 + }; 913 + 914 + static const char * const uim2_data_groups[] = { 915 + "gpio55", 916 + }; 917 + 918 + static const char * const uim2_clk_groups[] = { 919 + "gpio56", 920 + }; 921 + 922 + static const char * const uim2_reset_groups[] = { 923 + "gpio57", 924 + }; 925 + 926 + static const char * const uim2_present_groups[] = { 927 + "gpio58", 928 + }; 929 + 930 + static const char * const sensor_rst_groups[] = { 931 + "gpio59", 932 + }; 933 + 934 + static const char * const mipi_dsi0_groups[] = { 935 + "gpio60", 936 + }; 937 + 938 + static const char * const smb_int_groups[] = { 939 + "gpio61", 940 + }; 941 + 942 + static const char * const cam0_ldo_groups[] = { 943 + "gpio62", 944 + }; 945 + 946 + static const char * const us_euro_groups[] = { 947 + "gpio63", 948 + }; 949 + 950 + static const char * const atest_char3_groups[] = { 951 + "gpio63", 952 + }; 953 + 954 + static const char * const dbg_out_groups[] = { 955 + "gpio63", 956 + }; 957 + 958 + static const char * const bimc_dte0_groups[] = { 959 + "gpio63", "gpio65", 960 + }; 961 + 962 + static const char * const ts_resout_groups[] = { 963 + "gpio64", 964 + }; 965 + 966 + static const char * const ts_sample_groups[] = { 967 + "gpio65", 968 + }; 969 + 970 + static const char * const sec_mi2s_mclk_b_groups[] = { 971 + "gpio66", 972 + }; 973 + 974 + static const char * const pri_mi2s_groups[] = { 975 + "gpio66", "gpio85", "gpio86", "gpio88", "gpio94", "gpio95", 976 + }; 977 + 978 + static const char * const sdcard_det_groups[] = { 979 + "gpio67", 980 + }; 981 + 982 + static const char * const atest_char1_groups[] = { 983 + "gpio67", 984 + }; 985 + 986 + static const char * const ebi_cdc_groups[] = { 987 + "gpio67", "gpio69", "gpio118", "gpio119", "gpio120", "gpio123", 988 + }; 989 + 990 + static const char * const audio_reset_groups[] = { 991 + "gpio68", 992 + }; 993 + 994 + static const char * const atest_char0_groups[] = { 995 + "gpio68", 996 + }; 997 + 998 + static const char * const audio_ref_groups[] = { 999 + "gpio69", 1000 + }; 1001 + 1002 + static const char * const cdc_pdm0_groups[] = { 1003 + "gpio69", "gpio70", "gpio71", "gpio72", "gpio73", "gpio74", 1004 + }; 1005 + 1006 + static const char * const pri_mi2s_mclk_b_groups[] = { 1007 + "gpio69", 1008 + }; 1009 + 1010 + static const char * const lpass_slimbus_groups[] = { 1011 + "gpio70", 1012 + }; 1013 + 1014 + static const char * const lpass_slimbus0_groups[] = { 1015 + "gpio71", 1016 + }; 1017 + 1018 + static const char * const lpass_slimbus1_groups[] = { 1019 + "gpio72", 1020 + }; 1021 + 1022 + static const char * const codec_int1_groups[] = { 1023 + "gpio73", 1024 + }; 1025 + 1026 + static const char * const codec_int2_groups[] = { 1027 + "gpio74", 1028 + }; 1029 + 1030 + static const char * const wcss_bt_groups[] = { 1031 + "gpio75", "gpio83", "gpio84", 1032 + }; 1033 + 1034 + static const char * const atest_char2_groups[] = { 1035 + "gpio75", 1036 + }; 1037 + 1038 + static const char * const ebi_ch0_groups[] = { 1039 + "gpio75", 1040 + }; 1041 + 1042 + static const char * const wcss_wlan2_groups[] = { 1043 + "gpio76", 1044 + }; 1045 + 1046 + static const char * const wcss_wlan1_groups[] = { 1047 + "gpio77", 1048 + }; 1049 + 1050 + static const char * const wcss_wlan0_groups[] = { 1051 + "gpio78", 1052 + }; 1053 + 1054 + static const char * const wcss_wlan_groups[] = { 1055 + "gpio79", "gpio80", 1056 + }; 1057 + 1058 + static const char * const wcss_fm_groups[] = { 1059 + "gpio81", "gpio82", 1060 + }; 1061 + 1062 + static const char * const ext_lpass_groups[] = { 1063 + "gpio81", 1064 + }; 1065 + 1066 + static const char * const cri_trng_groups[] = { 1067 + "gpio82", 1068 + }; 1069 + 1070 + static const char * const cri_trng1_groups[] = { 1071 + "gpio83", 1072 + }; 1073 + 1074 + static const char * const cri_trng0_groups[] = { 1075 + "gpio84", 1076 + }; 1077 + 1078 + static const char * const blsp_spi7_groups[] = { 1079 + "gpio85", "gpio86", "gpio87", "gpio88", 1080 + }; 1081 + 1082 + static const char * const blsp_uart7_groups[] = { 1083 + "gpio85", "gpio86", "gpio87", "gpio88", 1084 + }; 1085 + 1086 + static const char * const pri_mi2s_ws_groups[] = { 1087 + "gpio87", 1088 + }; 1089 + 1090 + static const char * const blsp_i2c7_groups[] = { 1091 + "gpio87", "gpio88", 1092 + }; 1093 + 1094 + static const char * const gcc_tlmm_groups[] = { 1095 + "gpio87", 1096 + }; 1097 + 1098 + static const char * const dmic0_clk_groups[] = { 1099 + "gpio89", 1100 + }; 1101 + 1102 + static const char * const dmic0_data_groups[] = { 1103 + "gpio90", 1104 + }; 1105 + 1106 + static const char * const key_volp_groups[] = { 1107 + "gpio91", 1108 + }; 1109 + 1110 + static const char * const qdss_cti_trig_in_a1_groups[] = { 1111 + "gpio91", 1112 + }; 1113 + 1114 + static const char * const us_emitter_groups[] = { 1115 + "gpio92", 1116 + }; 1117 + 1118 + static const char * const wsa_irq_groups[] = { 1119 + "gpio93", 1120 + }; 1121 + 1122 + static const char * const wsa_io_groups[] = { 1123 + "gpio94", "gpio95", 1124 + }; 1125 + 1126 + static const char * const blsp_spi8_groups[] = { 1127 + "gpio96", "gpio97", "gpio98", "gpio99", 1128 + }; 1129 + 1130 + static const char * const blsp_uart8_groups[] = { 1131 + "gpio96", "gpio97", "gpio98", "gpio99", 1132 + }; 1133 + 1134 + static const char * const blsp_i2c8_groups[] = { 1135 + "gpio98", "gpio99", 1136 + }; 1137 + 1138 + static const char * const gcc_plltest_groups[] = { 1139 + "gpio98", "gpio99", 1140 + }; 1141 + 1142 + static const char * const nav_pps_in_a_groups[] = { 1143 + "gpio115", 1144 + }; 1145 + 1146 + static const char * const pa_indicator_groups[] = { 1147 + "gpio116", 1148 + }; 1149 + 1150 + static const char * const modem_tsync_groups[] = { 1151 + "gpio117", 1152 + }; 1153 + 1154 + static const char * const nav_tsync_groups[] = { 1155 + "gpio117", 1156 + }; 1157 + 1158 + static const char * const nav_pps_in_b_groups[] = { 1159 + "gpio117", 1160 + }; 1161 + 1162 + static const char * const nav_pps_groups[] = { 1163 + "gpio117", 1164 + }; 1165 + 1166 + static const char * const gsm0_tx_groups[] = { 1167 + "gpio119", 1168 + }; 1169 + 1170 + static const char * const atest_char_groups[] = { 1171 + "gpio120", 1172 + }; 1173 + 1174 + static const char * const atest_tsens_groups[] = { 1175 + "gpio120", 1176 + }; 1177 + 1178 + static const char * const bimc_dte1_groups[] = { 1179 + "gpio121", "gpio122", 1180 + }; 1181 + 1182 + static const char * const ssbi_wtr1_groups[] = { 1183 + "gpio122", "gpio123", 1184 + }; 1185 + 1186 + static const char * const fp_gpio_groups[] = { 1187 + "gpio124", 1188 + }; 1189 + 1190 + static const char * const coex_uart_groups[] = { 1191 + "gpio124", "gpio127", 1192 + }; 1193 + 1194 + static const char * const key_snapshot_groups[] = { 1195 + "gpio127", 1196 + }; 1197 + 1198 + static const char * const key_focus_groups[] = { 1199 + "gpio128", 1200 + }; 1201 + 1202 + static const char * const nfc_pwr_groups[] = { 1203 + "gpio129", 1204 + }; 1205 + 1206 + static const char * const blsp8_spi_groups[] = { 1207 + "gpio130", 1208 + }; 1209 + 1210 + static const char * const qdss_cti_trig_out_a0_groups[] = { 1211 + "gpio132", 1212 + }; 1213 + 1214 + static const char * const qdss_cti_trig_out_a1_groups[] = { 1215 + "gpio133", 1216 + }; 1217 + 1218 + static const struct pinfunction msm8917_functions[] = { 1219 + MSM_PIN_FUNCTION(accel_int), 1220 + MSM_PIN_FUNCTION(adsp_ext), 1221 + MSM_PIN_FUNCTION(alsp_int), 1222 + MSM_PIN_FUNCTION(atest_bbrx0), 1223 + MSM_PIN_FUNCTION(atest_bbrx1), 1224 + MSM_PIN_FUNCTION(atest_char), 1225 + MSM_PIN_FUNCTION(atest_char0), 1226 + MSM_PIN_FUNCTION(atest_char1), 1227 + MSM_PIN_FUNCTION(atest_char2), 1228 + MSM_PIN_FUNCTION(atest_char3), 1229 + MSM_PIN_FUNCTION(atest_combodac_to_gpio_native), 1230 + MSM_PIN_FUNCTION(atest_gpsadc_dtest0_native), 1231 + MSM_PIN_FUNCTION(atest_gpsadc_dtest1_native), 1232 + MSM_PIN_FUNCTION(atest_tsens), 1233 + MSM_PIN_FUNCTION(atest_wlan0), 1234 + MSM_PIN_FUNCTION(atest_wlan1), 1235 + MSM_PIN_FUNCTION(audio_ref), 1236 + MSM_PIN_FUNCTION(audio_reset), 1237 + MSM_PIN_FUNCTION(bimc_dte0), 1238 + MSM_PIN_FUNCTION(bimc_dte1), 1239 + MSM_PIN_FUNCTION(blsp6_spi), 1240 + MSM_PIN_FUNCTION(blsp8_spi), 1241 + MSM_PIN_FUNCTION(blsp_i2c1), 1242 + MSM_PIN_FUNCTION(blsp_i2c2), 1243 + MSM_PIN_FUNCTION(blsp_i2c3), 1244 + MSM_PIN_FUNCTION(blsp_i2c4), 1245 + MSM_PIN_FUNCTION(blsp_i2c5), 1246 + MSM_PIN_FUNCTION(blsp_i2c6), 1247 + MSM_PIN_FUNCTION(blsp_i2c7), 1248 + MSM_PIN_FUNCTION(blsp_i2c8), 1249 + MSM_PIN_FUNCTION(blsp_spi1), 1250 + MSM_PIN_FUNCTION(blsp_spi2), 1251 + MSM_PIN_FUNCTION(blsp_spi3), 1252 + MSM_PIN_FUNCTION(blsp_spi4), 1253 + MSM_PIN_FUNCTION(blsp_spi5), 1254 + MSM_PIN_FUNCTION(blsp_spi6), 1255 + MSM_PIN_FUNCTION(blsp_spi7), 1256 + MSM_PIN_FUNCTION(blsp_spi8), 1257 + MSM_PIN_FUNCTION(blsp_uart1), 1258 + MSM_PIN_FUNCTION(blsp_uart2), 1259 + MSM_PIN_FUNCTION(blsp_uart3), 1260 + MSM_PIN_FUNCTION(blsp_uart4), 1261 + MSM_PIN_FUNCTION(blsp_uart5), 1262 + MSM_PIN_FUNCTION(blsp_uart6), 1263 + MSM_PIN_FUNCTION(blsp_uart7), 1264 + MSM_PIN_FUNCTION(blsp_uart8), 1265 + MSM_PIN_FUNCTION(cam0_ldo), 1266 + MSM_PIN_FUNCTION(cam1_rst), 1267 + MSM_PIN_FUNCTION(cam1_standby), 1268 + MSM_PIN_FUNCTION(cam2_rst), 1269 + MSM_PIN_FUNCTION(cam2_standby), 1270 + MSM_PIN_FUNCTION(cam_mclk), 1271 + MSM_PIN_FUNCTION(cci_async), 1272 + MSM_PIN_FUNCTION(cci_i2c), 1273 + MSM_PIN_FUNCTION(cci_timer0), 1274 + MSM_PIN_FUNCTION(cci_timer1), 1275 + MSM_PIN_FUNCTION(cdc_pdm0), 1276 + MSM_PIN_FUNCTION(codec_int1), 1277 + MSM_PIN_FUNCTION(codec_int2), 1278 + MSM_PIN_FUNCTION(codec_mad), 1279 + MSM_PIN_FUNCTION(coex_uart), 1280 + MSM_PIN_FUNCTION(cri_trng), 1281 + MSM_PIN_FUNCTION(cri_trng0), 1282 + MSM_PIN_FUNCTION(cri_trng1), 1283 + MSM_PIN_FUNCTION(dbg_out), 1284 + MSM_PIN_FUNCTION(dmic0_clk), 1285 + MSM_PIN_FUNCTION(dmic0_data), 1286 + MSM_PIN_FUNCTION(ebi_cdc), 1287 + MSM_PIN_FUNCTION(ebi_ch0), 1288 + MSM_PIN_FUNCTION(ext_lpass), 1289 + MSM_PIN_FUNCTION(forced_usb), 1290 + MSM_PIN_FUNCTION(fp_gpio), 1291 + MSM_PIN_FUNCTION(fp_int), 1292 + MSM_PIN_FUNCTION(gcc_gp1_clk_a), 1293 + MSM_PIN_FUNCTION(gcc_gp1_clk_b), 1294 + MSM_PIN_FUNCTION(gcc_gp2_clk_a), 1295 + MSM_PIN_FUNCTION(gcc_gp2_clk_b), 1296 + MSM_PIN_FUNCTION(gcc_gp3_clk_a), 1297 + MSM_PIN_FUNCTION(gcc_gp3_clk_b), 1298 + MSM_PIN_FUNCTION(gcc_plltest), 1299 + MSM_PIN_FUNCTION(gcc_tlmm), 1300 + MSM_PIN_FUNCTION(gpio), 1301 + MSM_PIN_FUNCTION(gsm0_tx), 1302 + MSM_PIN_FUNCTION(key_focus), 1303 + MSM_PIN_FUNCTION(key_snapshot), 1304 + MSM_PIN_FUNCTION(key_volp), 1305 + MSM_PIN_FUNCTION(ldo_en), 1306 + MSM_PIN_FUNCTION(ldo_update), 1307 + MSM_PIN_FUNCTION(lpass_slimbus), 1308 + MSM_PIN_FUNCTION(lpass_slimbus0), 1309 + MSM_PIN_FUNCTION(lpass_slimbus1), 1310 + MSM_PIN_FUNCTION(m_voc), 1311 + MSM_PIN_FUNCTION(mag_int), 1312 + MSM_PIN_FUNCTION(mdp_vsync), 1313 + MSM_PIN_FUNCTION(mipi_dsi0), 1314 + MSM_PIN_FUNCTION(modem_tsync), 1315 + MSM_PIN_FUNCTION(nav_pps), 1316 + MSM_PIN_FUNCTION(nav_pps_in_a), 1317 + MSM_PIN_FUNCTION(nav_pps_in_b), 1318 + MSM_PIN_FUNCTION(nav_tsync), 1319 + MSM_PIN_FUNCTION(nfc_pwr), 1320 + MSM_PIN_FUNCTION(ov_ldo), 1321 + MSM_PIN_FUNCTION(pa_indicator), 1322 + MSM_PIN_FUNCTION(pbs0), 1323 + MSM_PIN_FUNCTION(pbs1), 1324 + MSM_PIN_FUNCTION(pbs2), 1325 + MSM_PIN_FUNCTION(pri_mi2s), 1326 + MSM_PIN_FUNCTION(pri_mi2s_mclk_a), 1327 + MSM_PIN_FUNCTION(pri_mi2s_mclk_b), 1328 + MSM_PIN_FUNCTION(pri_mi2s_ws), 1329 + MSM_PIN_FUNCTION(prng_rosc), 1330 + MSM_PIN_FUNCTION(pwr_crypto_enabled_a), 1331 + MSM_PIN_FUNCTION(pwr_crypto_enabled_b), 1332 + MSM_PIN_FUNCTION(pwr_modem_enabled_a), 1333 + MSM_PIN_FUNCTION(pwr_modem_enabled_b), 1334 + MSM_PIN_FUNCTION(pwr_nav_enabled_a), 1335 + MSM_PIN_FUNCTION(pwr_nav_enabled_b), 1336 + MSM_PIN_FUNCTION(qdss_cti_trig_in_a0), 1337 + MSM_PIN_FUNCTION(qdss_cti_trig_in_a1), 1338 + MSM_PIN_FUNCTION(qdss_cti_trig_in_b0), 1339 + MSM_PIN_FUNCTION(qdss_cti_trig_in_b1), 1340 + MSM_PIN_FUNCTION(qdss_cti_trig_out_a0), 1341 + MSM_PIN_FUNCTION(qdss_cti_trig_out_a1), 1342 + MSM_PIN_FUNCTION(qdss_cti_trig_out_b0), 1343 + MSM_PIN_FUNCTION(qdss_cti_trig_out_b1), 1344 + MSM_PIN_FUNCTION(qdss_traceclk_a), 1345 + MSM_PIN_FUNCTION(qdss_traceclk_b), 1346 + MSM_PIN_FUNCTION(qdss_tracectl_a), 1347 + MSM_PIN_FUNCTION(qdss_tracectl_b), 1348 + MSM_PIN_FUNCTION(qdss_tracedata_a), 1349 + MSM_PIN_FUNCTION(qdss_tracedata_b), 1350 + MSM_PIN_FUNCTION(sd_write), 1351 + MSM_PIN_FUNCTION(sdcard_det), 1352 + MSM_PIN_FUNCTION(sec_mi2s), 1353 + MSM_PIN_FUNCTION(sec_mi2s_mclk_a), 1354 + MSM_PIN_FUNCTION(sec_mi2s_mclk_b), 1355 + MSM_PIN_FUNCTION(sensor_rst), 1356 + MSM_PIN_FUNCTION(smb_int), 1357 + MSM_PIN_FUNCTION(ssbi_wtr1), 1358 + MSM_PIN_FUNCTION(ts_resout), 1359 + MSM_PIN_FUNCTION(ts_sample), 1360 + MSM_PIN_FUNCTION(uim1_clk), 1361 + MSM_PIN_FUNCTION(uim1_data), 1362 + MSM_PIN_FUNCTION(uim1_present), 1363 + MSM_PIN_FUNCTION(uim1_reset), 1364 + MSM_PIN_FUNCTION(uim2_clk), 1365 + MSM_PIN_FUNCTION(uim2_data), 1366 + MSM_PIN_FUNCTION(uim2_present), 1367 + MSM_PIN_FUNCTION(uim2_reset), 1368 + MSM_PIN_FUNCTION(uim_batt), 1369 + MSM_PIN_FUNCTION(us_emitter), 1370 + MSM_PIN_FUNCTION(us_euro), 1371 + MSM_PIN_FUNCTION(wcss_bt), 1372 + MSM_PIN_FUNCTION(wcss_fm), 1373 + MSM_PIN_FUNCTION(wcss_wlan), 1374 + MSM_PIN_FUNCTION(wcss_wlan0), 1375 + MSM_PIN_FUNCTION(wcss_wlan1), 1376 + MSM_PIN_FUNCTION(wcss_wlan2), 1377 + MSM_PIN_FUNCTION(webcam_rst), 1378 + MSM_PIN_FUNCTION(webcam_standby), 1379 + MSM_PIN_FUNCTION(wsa_io), 1380 + MSM_PIN_FUNCTION(wsa_irq), 1381 + }; 1382 + 1383 + static const struct msm_pingroup msm8917_groups[] = { 1384 + PINGROUP(0, blsp_spi1, blsp_uart1, qdss_tracedata_b, _, _, _, _, 1385 + _, _), 1386 + PINGROUP(1, blsp_spi1, blsp_uart1, adsp_ext, _, _, _, _, _, 1387 + qdss_tracedata_b), 1388 + PINGROUP(2, blsp_spi1, blsp_uart1, blsp_i2c1, prng_rosc, _, _, _, 1389 + _, _), 1390 + PINGROUP(3, blsp_spi1, blsp_uart1, blsp_i2c1, _, _, _, _, _, _), 1391 + PINGROUP(4, blsp_spi2, blsp_uart2, ldo_update, _, 1392 + atest_combodac_to_gpio_native, _, _, _, _), 1393 + PINGROUP(5, blsp_spi2, blsp_uart2, ldo_en, _, _, _, _, _, _), 1394 + PINGROUP(6, blsp_spi2, blsp_uart2, blsp_i2c2, gcc_gp1_clk_b, 1395 + qdss_tracedata_b, _, _, _, _), 1396 + PINGROUP(7, blsp_spi2, blsp_uart2, blsp_i2c2, pbs2, _, 1397 + qdss_tracedata_b, _, atest_gpsadc_dtest0_native, _), 1398 + PINGROUP(8, blsp_spi3, blsp_uart3, pbs0, _, _, _, _, _, _), 1399 + PINGROUP(9, blsp_spi3, blsp_uart3, pbs1, pwr_modem_enabled_b, _, _, 1400 + _, _, _), 1401 + PINGROUP(10, blsp_spi3, blsp_uart3, blsp_i2c3, gcc_gp2_clk_b, _, _, 1402 + _, _, _), 1403 + PINGROUP(11, blsp_spi3, blsp_uart3, blsp_i2c3, gcc_gp3_clk_b, _, _, 1404 + _, _, _), 1405 + PINGROUP(12, blsp_spi4, blsp_uart4, sec_mi2s, pwr_nav_enabled_b, _, 1406 + _, _, _, _), 1407 + PINGROUP(13, blsp_spi4, blsp_uart4, sec_mi2s, pwr_crypto_enabled_b, _, 1408 + _, _, _, _), 1409 + PINGROUP(14, blsp_spi4, blsp_uart4, blsp_i2c4, _, _, _, _, _, _), 1410 + PINGROUP(15, blsp_spi4, blsp_uart4, blsp_i2c4, _, _, _, _, _, _), 1411 + PINGROUP(16, blsp_spi5, blsp_uart5, _, _, _, _, qdss_traceclk_a, 1412 + _, atest_bbrx1), 1413 + PINGROUP(17, blsp_spi5, blsp_uart5, m_voc, qdss_cti_trig_in_a0, _, 1414 + atest_bbrx0, _, _, _), 1415 + PINGROUP(18, blsp_spi5, blsp_uart5, blsp_i2c5, qdss_tracectl_a, _, 1416 + atest_gpsadc_dtest1_native, _, _, _), 1417 + PINGROUP(19, blsp_spi5, blsp_uart5, blsp_i2c5, qdss_tracedata_a, _, 1418 + _, _, _, _), 1419 + PINGROUP(20, blsp_spi6, blsp_uart6, _, _, _, _, _, _, 1420 + qdss_tracectl_b), 1421 + PINGROUP(21, blsp_spi6, blsp_uart6, m_voc, _, _, _, _, _, 1422 + qdss_cti_trig_in_b0), 1423 + PINGROUP(22, blsp_spi6, blsp_uart6, blsp_i2c6, qdss_traceclk_b, _, 1424 + atest_wlan0, _, _, _), 1425 + PINGROUP(23, blsp_spi6, blsp_uart6, blsp_i2c6, qdss_tracedata_b, _, 1426 + atest_wlan1, _, _, _), 1427 + PINGROUP(24, mdp_vsync, _, _, _, _, _, _, _, _), 1428 + PINGROUP(25, mdp_vsync, pri_mi2s_mclk_a, sec_mi2s_mclk_a, _, _, _, 1429 + _, _, _), 1430 + PINGROUP(26, cam_mclk, _, _, _, _, _, qdss_tracedata_a, _, _), 1431 + PINGROUP(27, cam_mclk, _, _, _, _, _, _, _, qdss_tracedata_a), 1432 + PINGROUP(28, cam_mclk, _, _, _, _, _, qdss_tracedata_a, _, 1433 + atest_combodac_to_gpio_native), 1434 + PINGROUP(29, cci_i2c, pwr_modem_enabled_a, _, _, _, _, _, 1435 + qdss_tracedata_a, _), 1436 + PINGROUP(30, cci_i2c, _, _, _, _, _, _, _, qdss_tracedata_a), 1437 + PINGROUP(31, cci_i2c, _, _, _, _, _, _, _, qdss_tracedata_a), 1438 + PINGROUP(32, cci_i2c, _, _, _, _, _, _, _, qdss_tracedata_a), 1439 + PINGROUP(33, cci_timer0, _, _, _, _, _, _, _, qdss_tracedata_a), 1440 + PINGROUP(34, cci_timer1, _, _, _, _, _, _, _, qdss_tracedata_a), 1441 + PINGROUP(35, pwr_nav_enabled_a, _, _, _, _, _, _, _, 1442 + qdss_tracedata_a), 1443 + PINGROUP(36, pwr_crypto_enabled_a, _, _, _, _, _, _, _, 1444 + qdss_tracedata_a), 1445 + PINGROUP(37, _, _, _, _, _, qdss_cti_trig_out_b1, _, _, _), 1446 + PINGROUP(38, _, qdss_tracedata_a, _, _, _, _, _, _, _), 1447 + PINGROUP(39, cci_async, _, _, _, _, _, qdss_tracedata_a, _, 1448 + atest_combodac_to_gpio_native), 1449 + PINGROUP(40, _, _, _, _, qdss_tracedata_a, _, 1450 + atest_combodac_to_gpio_native, _, _), 1451 + PINGROUP(41, sd_write, _, _, _, _, _, _, _, 1452 + atest_combodac_to_gpio_native), 1453 + PINGROUP(42, gcc_gp1_clk_a, qdss_tracedata_b, _, 1454 + atest_combodac_to_gpio_native, _, _, _, _, _), 1455 + PINGROUP(43, gcc_gp2_clk_a, qdss_tracedata_b, _, 1456 + atest_combodac_to_gpio_native, _, _, _, _, _), 1457 + PINGROUP(44, gcc_gp3_clk_a, qdss_tracedata_b, _, 1458 + atest_combodac_to_gpio_native, _, _, _, _, _), 1459 + PINGROUP(45, _, _, atest_combodac_to_gpio_native, _, _, _, _, _, 1460 + _), 1461 + PINGROUP(46, _, _, atest_combodac_to_gpio_native, _, _, _, _, _, 1462 + _), 1463 + PINGROUP(47, blsp6_spi, _, qdss_tracedata_b, _, 1464 + atest_combodac_to_gpio_native, _, _, _, _), 1465 + PINGROUP(48, _, qdss_cti_trig_in_b1, _, 1466 + atest_combodac_to_gpio_native, _, _, _, _, _), 1467 + PINGROUP(49, uim_batt, _, _, _, _, _, _, _, _), 1468 + PINGROUP(50, qdss_tracedata_a, _, _, _, _, _, _, _, _), 1469 + PINGROUP(51, uim1_data, _, _, _, _, _, _, _, _), 1470 + PINGROUP(52, uim1_clk, _, _, _, _, _, _, _, _), 1471 + PINGROUP(53, uim1_reset, _, _, _, _, _, _, _, _), 1472 + PINGROUP(54, uim1_present, _, _, _, _, _, _, _, _), 1473 + PINGROUP(55, uim2_data, _, _, _, _, _, _, _, _), 1474 + PINGROUP(56, uim2_clk, _, _, _, _, _, _, _, _), 1475 + PINGROUP(57, uim2_reset, _, _, _, _, _, _, _, _), 1476 + PINGROUP(58, uim2_present, _, _, _, _, _, _, _, _), 1477 + PINGROUP(59, _, _, _, _, _, _, _, _, _), 1478 + PINGROUP(60, _, _, _, _, _, _, _, _, _), 1479 + PINGROUP(61, _, _, _, _, _, _, _, _, _), 1480 + PINGROUP(62, _, _, _, _, _, _, _, _, _), 1481 + PINGROUP(63, atest_char3, dbg_out, bimc_dte0, _, _, _, _, _, _), 1482 + PINGROUP(64, _, _, _, _, _, _, _, _, _), 1483 + PINGROUP(65, bimc_dte0, _, _, _, _, _, _, _, _), 1484 + PINGROUP(66, sec_mi2s_mclk_b, pri_mi2s, _, qdss_tracedata_b, _, _, 1485 + _, _, _), 1486 + PINGROUP(67, atest_char1, ebi_cdc, _, atest_combodac_to_gpio_native, 1487 + _, _, _, _, _), 1488 + PINGROUP(68, atest_char0, _, _, _, _, _, _, _, _), 1489 + PINGROUP(69, audio_ref, cdc_pdm0, pri_mi2s_mclk_b, ebi_cdc, _, _, _, 1490 + _, _), 1491 + PINGROUP(70, lpass_slimbus, cdc_pdm0, _, _, _, _, _, _, _), 1492 + PINGROUP(71, lpass_slimbus0, cdc_pdm0, _, _, _, _, _, _, _), 1493 + PINGROUP(72, lpass_slimbus1, cdc_pdm0, _, _, _, _, _, _, _), 1494 + PINGROUP(73, cdc_pdm0, _, _, _, _, _, _, _, _), 1495 + PINGROUP(74, cdc_pdm0, _, _, _, _, _, _, _, _), 1496 + PINGROUP(75, wcss_bt, atest_char2, _, ebi_ch0, _, _, _, _, _), 1497 + PINGROUP(76, wcss_wlan2, _, _, _, _, _, _, _, _), 1498 + PINGROUP(77, wcss_wlan1, _, _, _, _, _, _, _, _), 1499 + PINGROUP(78, wcss_wlan0, _, _, _, _, _, _, _, _), 1500 + PINGROUP(79, wcss_wlan, _, _, _, _, _, _, _, _), 1501 + PINGROUP(80, wcss_wlan, _, _, _, _, _, _, _, _), 1502 + PINGROUP(81, wcss_fm, ext_lpass, _, _, _, _, _, _, _), 1503 + PINGROUP(82, wcss_fm, cri_trng, _, _, _, _, _, _, _), 1504 + PINGROUP(83, wcss_bt, cri_trng1, _, _, _, _, _, _, _), 1505 + PINGROUP(84, wcss_bt, cri_trng0, _, _, _, _, _, _, _), 1506 + PINGROUP(85, pri_mi2s, blsp_spi7, blsp_uart7, _, _, _, _, _, _), 1507 + PINGROUP(86, pri_mi2s, blsp_spi7, blsp_uart7, qdss_tracedata_b, _, _, 1508 + _, _, _), 1509 + PINGROUP(87, pri_mi2s_ws, blsp_spi7, blsp_uart7, blsp_i2c7, 1510 + qdss_tracedata_b, gcc_tlmm, _, _, _), 1511 + PINGROUP(88, pri_mi2s, blsp_spi7, blsp_uart7, blsp_i2c7, _, _, _, 1512 + _, _), 1513 + PINGROUP(89, dmic0_clk, _, _, _, _, _, _, _, _), 1514 + PINGROUP(90, dmic0_data, _, _, _, _, _, _, _, _), 1515 + PINGROUP(91, _, _, _, _, _, qdss_cti_trig_in_a1, _, _, _), 1516 + PINGROUP(92, _, _, _, _, _, qdss_tracedata_b, _, _, _), 1517 + PINGROUP(93, _, _, _, _, _, _, _, _, _), 1518 + PINGROUP(94, wsa_io, sec_mi2s, pri_mi2s, _, _, _, _, _, _), 1519 + PINGROUP(95, wsa_io, sec_mi2s, pri_mi2s, _, _, _, _, _, _), 1520 + PINGROUP(96, blsp_spi8, blsp_uart8, _, _, _, _, _, _, _), 1521 + PINGROUP(97, blsp_spi8, blsp_uart8, _, _, _, _, _, _, _), 1522 + PINGROUP(98, blsp_spi8, blsp_uart8, blsp_i2c8, gcc_plltest, _, _, _, 1523 + _, _), 1524 + PINGROUP(99, blsp_spi8, blsp_uart8, blsp_i2c8, gcc_plltest, _, _, _, 1525 + _, _), 1526 + PINGROUP(100, _, _, _, _, _, _, _, _, _), 1527 + PINGROUP(101, _, _, _, _, _, _, _, _, _), 1528 + PINGROUP(102, _, _, _, _, _, _, _, _, _), 1529 + PINGROUP(103, _, _, _, _, _, _, _, _, _), 1530 + PINGROUP(104, _, _, _, _, _, _, _, _, _), 1531 + PINGROUP(105, _, _, _, _, _, _, _, _, _), 1532 + PINGROUP(106, _, _, _, _, _, _, _, _, _), 1533 + PINGROUP(107, _, _, _, _, _, _, _, _, _), 1534 + PINGROUP(108, _, _, _, _, _, _, _, _, _), 1535 + PINGROUP(109, _, _, _, _, _, _, _, _, _), 1536 + PINGROUP(110, _, _, _, _, _, _, _, _, _), 1537 + PINGROUP(111, _, _, _, _, _, _, _, _, _), 1538 + PINGROUP(112, _, _, _, _, _, _, _, _, _), 1539 + PINGROUP(113, _, _, _, _, _, _, _, _, _), 1540 + PINGROUP(114, _, _, _, _, _, _, _, _, _), 1541 + PINGROUP(115, _, _, nav_pps_in_a, _, atest_combodac_to_gpio_native, 1542 + _, _, _, _), 1543 + PINGROUP(116, _, pa_indicator, _, _, _, _, _, _, _), 1544 + PINGROUP(117, _, modem_tsync, nav_tsync, nav_pps_in_b, nav_pps, _, 1545 + _, _, _), 1546 + PINGROUP(118, _, ebi_cdc, _, _, _, _, _, _, _), 1547 + PINGROUP(119, gsm0_tx, _, ebi_cdc, _, _, _, _, _, _), 1548 + PINGROUP(120, _, atest_char, ebi_cdc, _, atest_tsens, _, _, _, _), 1549 + PINGROUP(121, _, _, _, bimc_dte1, _, _, _, _, _), 1550 + PINGROUP(122, _, ssbi_wtr1, _, _, bimc_dte1, _, _, _, _), 1551 + PINGROUP(123, _, ssbi_wtr1, ebi_cdc, _, _, _, _, _, _), 1552 + PINGROUP(124, coex_uart, _, _, _, _, _, _, _, _), 1553 + PINGROUP(125, _, _, _, _, _, _, _, _, _), 1554 + PINGROUP(126, _, _, _, _, _, _, _, _, _), 1555 + PINGROUP(127, coex_uart, _, _, _, _, _, _, _, _), 1556 + PINGROUP(128, _, _, _, _, _, _, _, _, _), 1557 + PINGROUP(129, _, _, _, _, _, _, _, _, _), 1558 + PINGROUP(130, blsp8_spi, _, _, _, _, _, _, _, _), 1559 + PINGROUP(131, _, _, _, _, _, _, _, _, _), 1560 + PINGROUP(132, qdss_cti_trig_out_a0, _, _, _, _, _, _, _, _), 1561 + PINGROUP(133, qdss_cti_trig_out_a1, _, _, _, _, _, _, _, _), 1562 + SDC_PINGROUP(sdc1_clk, 0x10a000, 13, 6), 1563 + SDC_PINGROUP(sdc1_cmd, 0x10a000, 11, 3), 1564 + SDC_PINGROUP(sdc1_data, 0x10a000, 9, 0), 1565 + SDC_PINGROUP(sdc1_rclk, 0x10a000, 15, 0), 1566 + SDC_PINGROUP(sdc2_clk, 0x109000, 14, 6), 1567 + SDC_PINGROUP(sdc2_cmd, 0x109000, 11, 3), 1568 + SDC_PINGROUP(sdc2_data, 0x109000, 9, 0), 1569 + SDC_PINGROUP(qdsd_clk, 0x19c000, 3, 0), 1570 + SDC_PINGROUP(qdsd_cmd, 0x19c000, 8, 5), 1571 + SDC_PINGROUP(qdsd_data0, 0x19c000, 13, 10), 1572 + SDC_PINGROUP(qdsd_data1, 0x19c000, 18, 15), 1573 + SDC_PINGROUP(qdsd_data2, 0x19c000, 23, 20), 1574 + SDC_PINGROUP(qdsd_data3, 0x19c000, 28, 25), 1575 + }; 1576 + 1577 + static const struct msm_pinctrl_soc_data msm8917_pinctrl = { 1578 + .pins = msm8917_pins, 1579 + .npins = ARRAY_SIZE(msm8917_pins), 1580 + .functions = msm8917_functions, 1581 + .nfunctions = ARRAY_SIZE(msm8917_functions), 1582 + .groups = msm8917_groups, 1583 + .ngroups = ARRAY_SIZE(msm8917_groups), 1584 + .ngpios = 134, 1585 + }; 1586 + 1587 + static int msm8917_pinctrl_probe(struct platform_device *pdev) 1588 + { 1589 + return msm_pinctrl_probe(pdev, &msm8917_pinctrl); 1590 + } 1591 + 1592 + static const struct of_device_id msm8917_pinctrl_of_match[] = { 1593 + { .compatible = "qcom,msm8917-pinctrl", }, 1594 + { }, 1595 + }; 1596 + MODULE_DEVICE_TABLE(of, msm8917_pinctrl_of_match); 1597 + 1598 + static struct platform_driver msm8917_pinctrl_driver = { 1599 + .driver = { 1600 + .name = "msm8917-pinctrl", 1601 + .of_match_table = msm8917_pinctrl_of_match, 1602 + }, 1603 + .probe = msm8917_pinctrl_probe, 1604 + .remove = msm_pinctrl_remove, 1605 + }; 1606 + 1607 + static int __init msm8917_pinctrl_init(void) 1608 + { 1609 + return platform_driver_register(&msm8917_pinctrl_driver); 1610 + } 1611 + arch_initcall(msm8917_pinctrl_init); 1612 + 1613 + static void __exit msm8917_pinctrl_exit(void) 1614 + { 1615 + platform_driver_unregister(&msm8917_pinctrl_driver); 1616 + } 1617 + module_exit(msm8917_pinctrl_exit); 1618 + 1619 + MODULE_DESCRIPTION("Qualcomm msm8917 pinctrl driver"); 1620 + MODULE_LICENSE("GPL");
+2 -1
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 14 14 #include <linux/seq_file.h> 15 15 #include <linux/slab.h> 16 16 #include <linux/spmi.h> 17 + #include <linux/string_choices.h> 17 18 #include <linux/types.h> 18 19 19 20 #include <linux/pinctrl/pinconf-generic.h> ··· 703 702 else 704 703 seq_printf(s, " %-4s", 705 704 pad->output_enabled ? "out" : "in"); 706 - seq_printf(s, " %-4s", pad->out_value ? "high" : "low"); 705 + seq_printf(s, " %-4s", str_high_low(pad->out_value)); 707 706 seq_printf(s, " %-7s", pmic_gpio_functions[function]); 708 707 seq_printf(s, " vin-%d", pad->power_source); 709 708 seq_printf(s, " %-27s", biases[pad->pullup]);
+2 -1
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
··· 11 11 #include <linux/regmap.h> 12 12 #include <linux/seq_file.h> 13 13 #include <linux/slab.h> 14 + #include <linux/string_choices.h> 14 15 #include <linux/types.h> 15 16 16 17 #include <linux/pinctrl/pinconf-generic.h> ··· 545 544 seq_printf(s, " %d", pad->aout_level); 546 545 if (pad->has_pullup) 547 546 seq_printf(s, " %-8s", biases[pad->pullup]); 548 - seq_printf(s, " %-4s", pad->out_value ? "high" : "low"); 547 + seq_printf(s, " %-4s", str_high_low(pad->out_value)); 549 548 if (pad->dtest) 550 549 seq_printf(s, " dtest%d", pad->dtest); 551 550 if (pad->paired)
+2 -1
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 13 13 #include <linux/regmap.h> 14 14 #include <linux/seq_file.h> 15 15 #include <linux/slab.h> 16 + #include <linux/string_choices.h> 16 17 17 18 #include <linux/pinctrl/pinconf-generic.h> 18 19 #include <linux/pinctrl/pinconf.h> ··· 570 569 seq_printf(s, " VIN%d", pin->power_source); 571 570 seq_printf(s, " %-27s", biases[pin->bias]); 572 571 seq_printf(s, " %-10s", buffer_types[pin->open_drain]); 573 - seq_printf(s, " %-4s", pin->output_value ? "high" : "low"); 572 + seq_printf(s, " %-4s", str_high_low(pin->output_value)); 574 573 seq_printf(s, " %-7s", strengths[pin->output_strength]); 575 574 if (pin->inverted) 576 575 seq_puts(s, " inverted");
+4 -6
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 13 13 #include <linux/regmap.h> 14 14 #include <linux/seq_file.h> 15 15 #include <linux/slab.h> 16 + #include <linux/string_choices.h> 16 17 17 18 #include <linux/pinctrl/pinconf-generic.h> 18 19 #include <linux/pinctrl/pinconf.h> ··· 577 576 seq_puts(s, "out "); 578 577 579 578 if (!pin->paired) { 580 - seq_puts(s, pin->output_value ? 581 - "high" : "low"); 579 + seq_puts(s, str_high_low(pin->output_value)); 582 580 } else { 583 581 seq_puts(s, pin->output_value ? 584 582 "inverted" : "follow"); ··· 589 589 if (pin->output) { 590 590 seq_printf(s, "out %s ", aout_lvls[pin->aout_level]); 591 591 if (!pin->paired) { 592 - seq_puts(s, pin->output_value ? 593 - "high" : "low"); 592 + seq_puts(s, str_high_low(pin->output_value)); 594 593 } else { 595 594 seq_puts(s, pin->output_value ? 596 595 "inverted" : "follow"); ··· 604 605 seq_printf(s, "dtest%d", pin->dtest); 605 606 } else { 606 607 if (!pin->paired) { 607 - seq_puts(s, pin->output_value ? 608 - "high" : "low"); 608 + seq_puts(s, str_high_low(pin->output_value)); 609 609 } else { 610 610 seq_puts(s, pin->output_value ? 611 611 "inverted" : "follow");
+1
drivers/pinctrl/renesas/Kconfig
··· 41 41 select PINCTRL_PFC_R8A779H0 if ARCH_R8A779H0 42 42 select PINCTRL_RZG2L if ARCH_RZG2L 43 43 select PINCTRL_RZV2M if ARCH_R9A09G011 44 + select PINCTRL_RZG2L if ARCH_R9A09G047 44 45 select PINCTRL_RZG2L if ARCH_R9A09G057 45 46 select PINCTRL_PFC_SH7203 if CPU_SUBTYPE_SH7203 46 47 select PINCTRL_PFC_SH7264 if CPU_SUBTYPE_SH7264
+183 -7
drivers/pinctrl/renesas/pinctrl-rzg2l.c
··· 26 26 #include <linux/pinctrl/pinctrl.h> 27 27 #include <linux/pinctrl/pinmux.h> 28 28 29 + #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h> 30 + #include <dt-bindings/pinctrl/renesas,r9a09g057-pinctrl.h> 29 31 #include <dt-bindings/pinctrl/rzg2l-pinctrl.h> 30 32 31 33 #include "../core.h" ··· 159 157 #define PWPR_REGWE_B BIT(5) /* OEN Register Write Enable, known only in RZ/V2H(P) */ 160 158 161 159 #define PM_MASK 0x03 162 - #define PFC_MASK 0x07 160 + #define PFC_MASK 0x0f 163 161 #define IEN_MASK 0x01 164 162 #define IOLH_MASK 0x03 165 163 #define SR_MASK 0x01 ··· 383 381 return 0; 384 382 } 385 383 384 + static const u64 r9a09g047_variable_pin_cfg[] = { 385 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 0, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 386 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 1, RZV2H_MPXED_PIN_FUNCS), 387 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 2, RZV2H_MPXED_PIN_FUNCS), 388 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 3, RZV2H_MPXED_PIN_FUNCS), 389 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 4, RZV2H_MPXED_PIN_FUNCS), 390 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 5, RZV2H_MPXED_PIN_FUNCS), 391 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 6, RZV2H_MPXED_PIN_FUNCS), 392 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PA, 7, RZV2H_MPXED_PIN_FUNCS), 393 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 0, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 394 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 1, RZV2H_MPXED_PIN_FUNCS), 395 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 2, RZV2H_MPXED_PIN_FUNCS), 396 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 3, RZV2H_MPXED_PIN_FUNCS), 397 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 4, RZV2H_MPXED_PIN_FUNCS), 398 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 5, RZV2H_MPXED_PIN_FUNCS), 399 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 6, RZV2H_MPXED_PIN_FUNCS), 400 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PD, 7, RZV2H_MPXED_PIN_FUNCS), 401 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 0, RZV2H_MPXED_PIN_FUNCS), 402 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 1, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 403 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 2, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 404 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 3, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 405 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 4, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 406 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 5, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 407 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 6, RZV2H_MPXED_PIN_FUNCS), 408 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PG, 7, RZV2H_MPXED_PIN_FUNCS), 409 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PH, 0, RZV2H_MPXED_PIN_FUNCS), 410 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PH, 1, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 411 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PH, 2, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 412 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PH, 3, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 413 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PH, 4, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 414 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PH, 5, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 415 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PJ, 0, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 416 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PJ, 1, RZV2H_MPXED_PIN_FUNCS), 417 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PJ, 2, RZV2H_MPXED_PIN_FUNCS), 418 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PJ, 3, RZV2H_MPXED_PIN_FUNCS), 419 + RZG2L_VARIABLE_PIN_CFG_PACK(RZG3E_PJ, 4, RZV2H_MPXED_PIN_FUNCS), 420 + }; 421 + 386 422 static const u64 r9a09g057_variable_pin_cfg[] = { 387 - RZG2L_VARIABLE_PIN_CFG_PACK(11, 0, RZV2H_MPXED_PIN_FUNCS), 388 - RZG2L_VARIABLE_PIN_CFG_PACK(11, 1, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 389 - RZG2L_VARIABLE_PIN_CFG_PACK(11, 2, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 390 - RZG2L_VARIABLE_PIN_CFG_PACK(11, 3, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 391 - RZG2L_VARIABLE_PIN_CFG_PACK(11, 4, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 392 - RZG2L_VARIABLE_PIN_CFG_PACK(11, 5, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 423 + RZG2L_VARIABLE_PIN_CFG_PACK(RZV2H_PB, 0, RZV2H_MPXED_PIN_FUNCS), 424 + RZG2L_VARIABLE_PIN_CFG_PACK(RZV2H_PB, 1, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 425 + RZG2L_VARIABLE_PIN_CFG_PACK(RZV2H_PB, 2, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 426 + RZG2L_VARIABLE_PIN_CFG_PACK(RZV2H_PB, 3, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 427 + RZG2L_VARIABLE_PIN_CFG_PACK(RZV2H_PB, 4, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 428 + RZG2L_VARIABLE_PIN_CFG_PACK(RZV2H_PB, 5, RZV2H_MPXED_PIN_FUNCS | PIN_CFG_IEN), 393 429 }; 394 430 395 431 #ifdef CONFIG_RISCV ··· 2002 1962 RZG2L_GPIO_PORT_PACK(6, 0x2a, RZG3S_MPXED_PIN_FUNCS(A)), /* P18 */ 2003 1963 }; 2004 1964 1965 + static const char * const rzg3e_gpio_names[] = { 1966 + "P00", "P01", "P02", "P03", "P04", "P05", "P06", "P07", 1967 + "P10", "P11", "P12", "P13", "P14", "P15", "P16", "P17", 1968 + "P20", "P21", "P22", "P23", "P24", "P25", "P26", "P27", 1969 + "P30", "P31", "P32", "P33", "P34", "P35", "P36", "P37", 1970 + "P40", "P41", "P42", "P43", "P44", "P45", "P46", "P47", 1971 + "P50", "P51", "P52", "P53", "P54", "P55", "P56", "P57", 1972 + "P60", "P61", "P62", "P63", "P64", "P65", "P66", "P67", 1973 + "P70", "P71", "P72", "P73", "P74", "P75", "P76", "P77", 1974 + "P80", "P81", "P82", "P83", "P84", "P85", "P86", "P87", 1975 + "", "", "", "", "", "", "", "", 1976 + "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", 1977 + "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", 1978 + "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", 1979 + "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", 1980 + "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", 1981 + "PF0", "PF1", "PF2", "PF3", "PF4", "PF5", "PF6", "PF7", 1982 + "PG0", "PG1", "PG2", "PG3", "PG4", "PG5", "PG6", "PG7", 1983 + "PH0", "PH1", "PH2", "PH3", "PH4", "PH5", "PH6", "PH7", 1984 + "", "", "", "", "", "", "", "", 1985 + "PJ0", "PJ1", "PJ2", "PJ3", "PJ4", "PJ5", "PJ6", "PJ7", 1986 + "PK0", "PK1", "PK2", "PK3", "PK4", "PK5", "PK6", "PK7", 1987 + "PL0", "PL1", "PL2", "PL3", "PL4", "PL5", "PL6", "PL7", 1988 + "PM0", "PM1", "PM2", "PM3", "PM4", "PM5", "PM6", "PM7", 1989 + "", "", "", "", "", "", "", "", 1990 + "", "", "", "", "", "", "", "", 1991 + "", "", "", "", "", "", "", "", 1992 + "", "", "", "", "", "", "", "", 1993 + "", "", "", "", "", "", "", "", 1994 + "PS0", "PS1", "PS2", "PS3", "PS4", "PS5", "PS6", "PS7", 1995 + }; 1996 + 1997 + static const u64 r9a09g047_gpio_configs[] = { 1998 + RZG2L_GPIO_PORT_PACK(8, 0x20, RZV2H_MPXED_PIN_FUNCS), /* P0 */ 1999 + RZG2L_GPIO_PORT_PACK(8, 0x21, RZV2H_MPXED_PIN_FUNCS | 2000 + PIN_CFG_ELC), /* P1 */ 2001 + RZG2L_GPIO_PORT_PACK(2, 0x22, RZG2L_MPXED_COMMON_PIN_FUNCS(RZV2H) | 2002 + PIN_CFG_NOD), /* P2 */ 2003 + RZG2L_GPIO_PORT_PACK(8, 0x23, RZV2H_MPXED_PIN_FUNCS), /* P3 */ 2004 + RZG2L_GPIO_PORT_PACK(6, 0x24, RZV2H_MPXED_PIN_FUNCS), /* P4 */ 2005 + RZG2L_GPIO_PORT_PACK(7, 0x25, RZV2H_MPXED_PIN_FUNCS), /* P5 */ 2006 + RZG2L_GPIO_PORT_PACK(7, 0x26, RZV2H_MPXED_PIN_FUNCS), /* P6 */ 2007 + RZG2L_GPIO_PORT_PACK(8, 0x27, RZV2H_MPXED_PIN_FUNCS | 2008 + PIN_CFG_ELC), /* P7 */ 2009 + RZG2L_GPIO_PORT_PACK(6, 0x28, RZV2H_MPXED_PIN_FUNCS), /* P8 */ 2010 + 0x0, 2011 + RZG2L_GPIO_PORT_PACK_VARIABLE(8, 0x2a), /* PA */ 2012 + RZG2L_GPIO_PORT_PACK(8, 0x2b, RZV2H_MPXED_PIN_FUNCS), /* PB */ 2013 + RZG2L_GPIO_PORT_PACK(3, 0x2c, RZV2H_MPXED_PIN_FUNCS), /* PC */ 2014 + RZG2L_GPIO_PORT_PACK_VARIABLE(8, 0x2d), /* PD */ 2015 + RZG2L_GPIO_PORT_PACK(8, 0x2e, RZV2H_MPXED_PIN_FUNCS), /* PE */ 2016 + RZG2L_GPIO_PORT_PACK(3, 0x2f, RZV2H_MPXED_PIN_FUNCS), /* PF */ 2017 + RZG2L_GPIO_PORT_PACK_VARIABLE(8, 0x30), /* PG */ 2018 + RZG2L_GPIO_PORT_PACK_VARIABLE(6, 0x31), /* PH */ 2019 + 0x0, 2020 + RZG2L_GPIO_PORT_PACK_VARIABLE(5, 0x33), /* PJ */ 2021 + RZG2L_GPIO_PORT_PACK(4, 0x34, RZV2H_MPXED_PIN_FUNCS), /* PK */ 2022 + RZG2L_GPIO_PORT_PACK(8, 0x35, RZV2H_MPXED_PIN_FUNCS), /* PL */ 2023 + RZG2L_GPIO_PORT_PACK(8, 0x36, RZV2H_MPXED_PIN_FUNCS), /* PM */ 2024 + 0x0, 2025 + 0x0, 2026 + 0x0, 2027 + 0x0, 2028 + 0x0, 2029 + RZG2L_GPIO_PORT_PACK(4, 0x3c, RZV2H_MPXED_PIN_FUNCS), /* PS */ 2030 + }; 2031 + 2005 2032 static const char * const rzv2h_gpio_names[] = { 2006 2033 "P00", "P01", "P02", "P03", "P04", "P05", "P06", "P07", 2007 2034 "P10", "P11", "P12", "P13", "P14", "P15", "P16", "P17", ··· 2192 2085 { "TMS/SWDIO", RZG2L_SINGLE_PIN_PACK(0x1, 0, (PIN_CFG_IOLH_A | PIN_CFG_IEN | 2193 2086 PIN_CFG_SOFT_PS)) }, 2194 2087 { "TDO", RZG2L_SINGLE_PIN_PACK(0x1, 1, (PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS)) }, 2088 + { "AUDIO_CLK1", RZG2L_SINGLE_PIN_PACK(0x2, 0, PIN_CFG_IEN) }, 2089 + { "AUDIO_CLK2", RZG2L_SINGLE_PIN_PACK(0x2, 1, PIN_CFG_IEN) }, 2195 2090 { "WDTOVF_PERROUT#", RZG2L_SINGLE_PIN_PACK(0x6, 0, PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS) }, 2196 2091 { "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x10, 0, (PIN_CFG_IOLH_B | PIN_CFG_IO_VMC_SD0)) }, 2197 2092 { "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x10, 1, (PIN_CFG_IOLH_B | PIN_CFG_IEN | ··· 2357 2248 { "ET1_RXD1", RZG2L_SINGLE_PIN_PACK(0x14, 5, (PIN_CFG_PUPD)) }, 2358 2249 { "ET1_RXD2", RZG2L_SINGLE_PIN_PACK(0x14, 6, (PIN_CFG_PUPD)) }, 2359 2250 { "ET1_RXD3", RZG2L_SINGLE_PIN_PACK(0x14, 7, (PIN_CFG_PUPD)) }, 2251 + }; 2252 + 2253 + static struct rzg2l_dedicated_configs rzg3e_dedicated_pins[] = { 2254 + { "WDTUDFCA", RZG2L_SINGLE_PIN_PACK(0x5, 0, 2255 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_PUPD | PIN_CFG_NOD)) }, 2256 + { "WDTUDFCM", RZG2L_SINGLE_PIN_PACK(0x5, 1, 2257 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_PUPD | PIN_CFG_NOD)) }, 2258 + { "SCIF_RXD", RZG2L_SINGLE_PIN_PACK(0x6, 0, 2259 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_PUPD)) }, 2260 + { "SCIF_TXD", RZG2L_SINGLE_PIN_PACK(0x6, 1, 2261 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_PUPD)) }, 2262 + { "SD0CLK", RZG2L_SINGLE_PIN_PACK(0x9, 0, 2263 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR)) }, 2264 + { "SD0CMD", RZG2L_SINGLE_PIN_PACK(0x9, 1, 2265 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2266 + { "SD0RSTN", RZG2L_SINGLE_PIN_PACK(0x9, 2, 2267 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR)) }, 2268 + { "SD0PWEN", RZG2L_SINGLE_PIN_PACK(0x9, 3, 2269 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR)) }, 2270 + { "SD0IOVS", RZG2L_SINGLE_PIN_PACK(0x9, 4, 2271 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR)) }, 2272 + { "SD0DAT0", RZG2L_SINGLE_PIN_PACK(0xa, 0, 2273 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2274 + { "SD0DAT1", RZG2L_SINGLE_PIN_PACK(0xa, 1, 2275 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2276 + { "SD0DAT2", RZG2L_SINGLE_PIN_PACK(0xa, 2, 2277 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2278 + { "SD0DAT3", RZG2L_SINGLE_PIN_PACK(0xa, 3, 2279 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2280 + { "SD0DAT4", RZG2L_SINGLE_PIN_PACK(0xa, 4, 2281 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2282 + { "SD0DAT5", RZG2L_SINGLE_PIN_PACK(0xa, 5, 2283 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2284 + { "SD0DAT6", RZG2L_SINGLE_PIN_PACK(0xa, 6, 2285 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2286 + { "SD0DAT7", RZG2L_SINGLE_PIN_PACK(0xa, 7, 2287 + (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_PUPD)) }, 2360 2288 }; 2361 2289 2362 2290 static int rzg2l_gpio_get_gpioint(unsigned int virq, struct rzg2l_pinctrl *pctrl) ··· 2906 2760 BUILD_BUG_ON(ARRAY_SIZE(r9a08g045_gpio_configs) * RZG2L_PINS_PER_PORT > 2907 2761 ARRAY_SIZE(rzg2l_gpio_names)); 2908 2762 2763 + BUILD_BUG_ON(ARRAY_SIZE(r9a09g047_gpio_configs) * RZG2L_PINS_PER_PORT > 2764 + ARRAY_SIZE(rzg3e_gpio_names)); 2765 + 2909 2766 BUILD_BUG_ON(ARRAY_SIZE(r9a09g057_gpio_configs) * RZG2L_PINS_PER_PORT > 2910 2767 ARRAY_SIZE(rzv2h_gpio_names)); 2911 2768 ··· 3307 3158 .bias_param_to_hw = &rzg2l_bias_param_to_hw, 3308 3159 }; 3309 3160 3161 + static struct rzg2l_pinctrl_data r9a09g047_data = { 3162 + .port_pins = rzg3e_gpio_names, 3163 + .port_pin_configs = r9a09g047_gpio_configs, 3164 + .n_ports = ARRAY_SIZE(r9a09g047_gpio_configs), 3165 + .dedicated_pins = rzg3e_dedicated_pins, 3166 + .n_port_pins = ARRAY_SIZE(r9a09g047_gpio_configs) * RZG2L_PINS_PER_PORT, 3167 + .n_dedicated_pins = ARRAY_SIZE(rzg3e_dedicated_pins), 3168 + .hwcfg = &rzv2h_hwcfg, 3169 + .variable_pin_cfg = r9a09g047_variable_pin_cfg, 3170 + .n_variable_pin_cfg = ARRAY_SIZE(r9a09g047_variable_pin_cfg), 3171 + .num_custom_params = ARRAY_SIZE(renesas_rzv2h_custom_bindings), 3172 + .custom_params = renesas_rzv2h_custom_bindings, 3173 + #ifdef CONFIG_DEBUG_FS 3174 + .custom_conf_items = renesas_rzv2h_conf_items, 3175 + #endif 3176 + .pwpr_pfc_lock_unlock = &rzv2h_pwpr_pfc_lock_unlock, 3177 + .pmc_writeb = &rzv2h_pmc_writeb, 3178 + .oen_read = &rzv2h_oen_read, 3179 + .oen_write = &rzv2h_oen_write, 3180 + .hw_to_bias_param = &rzv2h_hw_to_bias_param, 3181 + .bias_param_to_hw = &rzv2h_bias_param_to_hw, 3182 + }; 3183 + 3310 3184 static struct rzg2l_pinctrl_data r9a09g057_data = { 3311 3185 .port_pins = rzv2h_gpio_names, 3312 3186 .port_pin_configs = r9a09g057_gpio_configs, ··· 3365 3193 { 3366 3194 .compatible = "renesas,r9a08g045-pinctrl", 3367 3195 .data = &r9a08g045_data, 3196 + }, 3197 + { 3198 + .compatible = "renesas,r9a09g047-pinctrl", 3199 + .data = &r9a09g047_data, 3368 3200 }, 3369 3201 { 3370 3202 .compatible = "renesas,r9a09g057-pinctrl",
+4 -2
drivers/pinctrl/samsung/pinctrl-exynos.c
··· 23 23 #include <linux/of_irq.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/spinlock.h> 26 + #include <linux/string_choices.h> 26 27 #include <linux/regmap.h> 27 28 #include <linux/err.h> 28 29 #include <linux/soc/samsung/exynos-pmu.h> ··· 443 442 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 444 443 unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq); 445 444 446 - pr_info("wake %s for irq %u (%s-%lu)\n", on ? "enabled" : "disabled", 445 + pr_info("wake %s for irq %u (%s-%lu)\n", str_enabled_disabled(on), 447 446 irqd->irq, bank->name, irqd->hwirq); 448 447 449 448 if (!on) ··· 637 636 if (clk_enable(b->drvdata->pclk)) { 638 637 dev_err(b->gpio_chip.parent, 639 638 "unable to enable clock for pending IRQs\n"); 640 - return; 639 + goto out; 641 640 } 642 641 } 643 642 ··· 653 652 if (eintd->nr_banks) 654 653 clk_disable(eintd->banks[0]->drvdata->pclk); 655 654 655 + out: 656 656 chained_irq_exit(chip, desc); 657 657 } 658 658
+2 -2
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 1172 1172 else 1173 1173 dev_warn(dev, "Missing node for bank %s - invalid DTB\n", 1174 1174 bank->name); 1175 - /* child reference dropped in samsung_drop_banks_of_node() */ 1175 + /* child reference dropped in samsung_banks_node_put() */ 1176 1176 } 1177 1177 } 1178 1178 ··· 1272 1272 1273 1273 ret = platform_get_irq_optional(pdev, 0); 1274 1274 if (ret < 0 && ret != -ENXIO) 1275 - return ret; 1275 + goto err_put_banks; 1276 1276 if (ret > 0) 1277 1277 drvdata->irq = ret; 1278 1278
+41 -40
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 22 22 #include <linux/reset.h> 23 23 #include <linux/seq_file.h> 24 24 #include <linux/slab.h> 25 + #include <linux/string_choices.h> 25 26 26 27 #include <linux/pinctrl/consumer.h> 27 28 #include <linux/pinctrl/machine.h> ··· 87 86 88 87 struct stm32_gpio_bank { 89 88 void __iomem *base; 90 - struct clk *clk; 91 89 struct reset_control *rstc; 92 90 spinlock_t lock; 93 91 struct gpio_chip gpio_chip; ··· 108 108 unsigned ngroups; 109 109 const char **grp_names; 110 110 struct stm32_gpio_bank *banks; 111 + struct clk_bulk_data *clks; 111 112 unsigned nbanks; 112 113 const struct stm32_pinctrl_match_data *match_data; 113 114 struct irq_domain *domain; ··· 1218 1217 case 0: 1219 1218 val = stm32_pconf_get(bank, offset, true); 1220 1219 seq_printf(s, "- %s - %s", 1221 - val ? "high" : "low", 1220 + str_high_low(val), 1222 1221 biasing[bias]); 1223 1222 break; 1224 1223 ··· 1228 1227 speed = stm32_pconf_get_speed(bank, offset); 1229 1228 val = stm32_pconf_get(bank, offset, false); 1230 1229 seq_printf(s, "- %s - %s - %s - %s %s", 1231 - val ? "high" : "low", 1230 + str_high_low(val), 1232 1231 drive ? "open drain" : "push pull", 1233 1232 biasing[bias], 1234 1233 speeds[speed], "speed"); ··· 1309 1308 if (IS_ERR(bank->base)) 1310 1309 return PTR_ERR(bank->base); 1311 1310 1312 - err = clk_prepare_enable(bank->clk); 1313 - if (err) { 1314 - dev_err(dev, "failed to prepare_enable clk (%d)\n", err); 1315 - return err; 1316 - } 1317 - 1318 1311 bank->gpio_chip = stm32_gpio_template; 1319 1312 1320 1313 fwnode_property_read_string(fwnode, "st,bank-name", &bank->gpio_chip.label); ··· 1355 1360 bank->fwnode, &stm32_gpio_domain_ops, 1356 1361 bank); 1357 1362 1358 - if (!bank->domain) { 1359 - err = -ENODEV; 1360 - goto err_clk; 1361 - } 1363 + if (!bank->domain) 1364 + return -ENODEV; 1362 1365 } 1363 1366 1364 1367 names = devm_kcalloc(dev, npins, sizeof(char *), GFP_KERNEL); 1365 - if (!names) { 1366 - err = -ENOMEM; 1367 - goto err_clk; 1368 - } 1368 + if (!names) 1369 + return -ENOMEM; 1369 1370 1370 1371 for (i = 0; i < npins; i++) { 1371 1372 stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i); 1372 1373 if (stm32_pin && stm32_pin->pin.name) { 1373 1374 names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s", stm32_pin->pin.name); 1374 - if (!names[i]) { 1375 - err = -ENOMEM; 1376 - goto err_clk; 1377 - } 1375 + if (!names[i]) 1376 + return -ENOMEM; 1378 1377 } else { 1379 1378 names[i] = NULL; 1380 1379 } ··· 1379 1390 err = gpiochip_add_data(&bank->gpio_chip, bank); 1380 1391 if (err) { 1381 1392 dev_err(dev, "Failed to add gpiochip(%d)!\n", bank_nr); 1382 - goto err_clk; 1393 + return err; 1383 1394 } 1384 1395 1385 1396 dev_info(dev, "%s bank added\n", bank->gpio_chip.label); 1386 1397 return 0; 1387 - 1388 - err_clk: 1389 - clk_disable_unprepare(bank->clk); 1390 - return err; 1391 1398 } 1392 1399 1393 1400 static struct irq_domain *stm32_pctrl_get_irq_domain(struct platform_device *pdev) ··· 1606 1621 if (!pctl->banks) 1607 1622 return -ENOMEM; 1608 1623 1624 + pctl->clks = devm_kcalloc(dev, banks, sizeof(*pctl->clks), 1625 + GFP_KERNEL); 1626 + if (!pctl->clks) 1627 + return -ENOMEM; 1628 + 1609 1629 i = 0; 1610 1630 for_each_gpiochip_node(dev, child) { 1611 1631 struct stm32_gpio_bank *bank = &pctl->banks[i]; ··· 1622 1632 return -EPROBE_DEFER; 1623 1633 } 1624 1634 1625 - bank->clk = of_clk_get_by_name(np, NULL); 1626 - if (IS_ERR(bank->clk)) { 1635 + pctl->clks[i].clk = of_clk_get_by_name(np, NULL); 1636 + if (IS_ERR(pctl->clks[i].clk)) { 1627 1637 fwnode_handle_put(child); 1628 - return dev_err_probe(dev, PTR_ERR(bank->clk), 1638 + return dev_err_probe(dev, PTR_ERR(pctl->clks[i].clk), 1629 1639 "failed to get clk\n"); 1630 1640 } 1641 + pctl->clks[i].id = "pctl"; 1631 1642 i++; 1643 + } 1644 + 1645 + ret = clk_bulk_prepare_enable(banks, pctl->clks); 1646 + if (ret) { 1647 + dev_err(dev, "failed to prepare_enable clk (%d)\n", ret); 1648 + return ret; 1632 1649 } 1633 1650 1634 1651 for_each_gpiochip_node(dev, child) { 1635 1652 ret = stm32_gpiolib_register_bank(pctl, child); 1636 1653 if (ret) { 1637 1654 fwnode_handle_put(child); 1638 - 1639 - for (i = 0; i < pctl->nbanks; i++) 1640 - clk_disable_unprepare(pctl->banks[i].clk); 1641 - 1642 - return ret; 1655 + goto err_register; 1643 1656 } 1644 1657 1645 1658 pctl->nbanks++; ··· 1651 1658 dev_info(dev, "Pinctrl STM32 initialized\n"); 1652 1659 1653 1660 return 0; 1661 + err_register: 1662 + for (i = 0; i < pctl->nbanks; i++) { 1663 + struct stm32_gpio_bank *bank = &pctl->banks[i]; 1664 + 1665 + gpiochip_remove(&bank->gpio_chip); 1666 + } 1667 + 1668 + clk_bulk_disable_unprepare(banks, pctl->clks); 1669 + return ret; 1654 1670 } 1655 1671 1656 1672 static int __maybe_unused stm32_pinctrl_restore_gpio_regs( ··· 1728 1726 int __maybe_unused stm32_pinctrl_suspend(struct device *dev) 1729 1727 { 1730 1728 struct stm32_pinctrl *pctl = dev_get_drvdata(dev); 1731 - int i; 1732 1729 1733 - for (i = 0; i < pctl->nbanks; i++) 1734 - clk_disable(pctl->banks[i].clk); 1730 + clk_bulk_disable(pctl->nbanks, pctl->clks); 1735 1731 1736 1732 return 0; 1737 1733 } ··· 1738 1738 { 1739 1739 struct stm32_pinctrl *pctl = dev_get_drvdata(dev); 1740 1740 struct stm32_pinctrl_group *g = pctl->groups; 1741 - int i; 1741 + int i, ret; 1742 1742 1743 - for (i = 0; i < pctl->nbanks; i++) 1744 - clk_enable(pctl->banks[i].clk); 1743 + ret = clk_bulk_enable(pctl->nbanks, pctl->clks); 1744 + if (ret) 1745 + return ret; 1745 1746 1746 1747 for (i = 0; i < pctl->ngroups; i++, g++) 1747 1748 stm32_pinctrl_restore_gpio_regs(pctl, g->pin);
+12
drivers/pinctrl/sunxi/pinctrl-sun50i-a100.c
··· 256 256 SUNXI_FUNCTION(0x0, "gpio_in"), 257 257 SUNXI_FUNCTION(0x1, "gpio_out"), 258 258 SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */ 259 + SUNXI_FUNCTION(0x3, "lvds0"), /* D3P */ 259 260 SUNXI_FUNCTION(0x4, "dsi0"), /* DP3 */ 260 261 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), 261 262 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9), 262 263 SUNXI_FUNCTION(0x0, "gpio_in"), 263 264 SUNXI_FUNCTION(0x1, "gpio_out"), 264 265 SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */ 266 + SUNXI_FUNCTION(0x3, "lvds0"), /* D3N */ 265 267 SUNXI_FUNCTION(0x4, "dsi0"), /* DM3 */ 266 268 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), 267 269 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10), 268 270 SUNXI_FUNCTION(0x0, "gpio_in"), 269 271 SUNXI_FUNCTION(0x1, "gpio_out"), 270 272 SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */ 273 + SUNXI_FUNCTION(0x3, "lvds1"), /* D0P */ 271 274 SUNXI_FUNCTION(0x4, "spi1"), /* CS */ 272 275 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), 273 276 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11), 274 277 SUNXI_FUNCTION(0x0, "gpio_in"), 275 278 SUNXI_FUNCTION(0x1, "gpio_out"), 276 279 SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */ 280 + SUNXI_FUNCTION(0x3, "lvds1"), /* D0N */ 277 281 SUNXI_FUNCTION(0x4, "spi1"), /* CLK */ 278 282 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), 279 283 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12), 280 284 SUNXI_FUNCTION(0x0, "gpio_in"), 281 285 SUNXI_FUNCTION(0x1, "gpio_out"), 282 286 SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */ 287 + SUNXI_FUNCTION(0x3, "lvds1"), /* D1P */ 283 288 SUNXI_FUNCTION(0x4, "spi1"), /* MOSI */ 284 289 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)), 285 290 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13), 286 291 SUNXI_FUNCTION(0x0, "gpio_in"), 287 292 SUNXI_FUNCTION(0x1, "gpio_out"), 288 293 SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */ 294 + SUNXI_FUNCTION(0x3, "lvds1"), /* D1N */ 289 295 SUNXI_FUNCTION(0x4, "spi1"), /* MISO */ 290 296 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), 291 297 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14), 292 298 SUNXI_FUNCTION(0x0, "gpio_in"), 293 299 SUNXI_FUNCTION(0x1, "gpio_out"), 294 300 SUNXI_FUNCTION(0x2, "lcd0"), /* D20 */ 301 + SUNXI_FUNCTION(0x3, "lvds1"), /* D2P */ 295 302 SUNXI_FUNCTION(0x4, "uart3"), /* TX */ 296 303 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 14)), 297 304 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15), 298 305 SUNXI_FUNCTION(0x0, "gpio_in"), 299 306 SUNXI_FUNCTION(0x1, "gpio_out"), 300 307 SUNXI_FUNCTION(0x2, "lcd0"), /* D21 */ 308 + SUNXI_FUNCTION(0x3, "lvds1"), /* D2N */ 301 309 SUNXI_FUNCTION(0x4, "uart3"), /* RX */ 302 310 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 15)), 303 311 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16), 304 312 SUNXI_FUNCTION(0x0, "gpio_in"), 305 313 SUNXI_FUNCTION(0x1, "gpio_out"), 306 314 SUNXI_FUNCTION(0x2, "lcd0"), /* D22 */ 315 + SUNXI_FUNCTION(0x3, "lvds1"), /* CKP */ 307 316 SUNXI_FUNCTION(0x4, "uart3"), /* RTS */ 308 317 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 16)), 309 318 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17), 310 319 SUNXI_FUNCTION(0x0, "gpio_in"), 311 320 SUNXI_FUNCTION(0x1, "gpio_out"), 312 321 SUNXI_FUNCTION(0x2, "lcd0"), /* D23 */ 322 + SUNXI_FUNCTION(0x3, "lvds1"), /* CKN */ 313 323 SUNXI_FUNCTION(0x4, "uart3"), /* CTS */ 314 324 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 17)), 315 325 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18), 316 326 SUNXI_FUNCTION(0x0, "gpio_in"), 317 327 SUNXI_FUNCTION(0x1, "gpio_out"), 318 328 SUNXI_FUNCTION(0x2, "lcd0"), /* CLK */ 329 + SUNXI_FUNCTION(0x3, "lvds1"), /* D3P */ 319 330 SUNXI_FUNCTION(0x4, "uart4"), /* TX */ 320 331 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 18)), 321 332 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19), 322 333 SUNXI_FUNCTION(0x0, "gpio_in"), 323 334 SUNXI_FUNCTION(0x1, "gpio_out"), 324 335 SUNXI_FUNCTION(0x2, "lcd0"), /* DE */ 336 + SUNXI_FUNCTION(0x3, "lvds1"), /* D3N */ 325 337 SUNXI_FUNCTION(0x4, "uart4"), /* RX */ 326 338 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 19)), 327 339 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
+41
include/dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * This header provides constants for Renesas RZ/G3E family pinctrl bindings. 4 + * 5 + * Copyright (C) 2024 Renesas Electronics Corp. 6 + * 7 + */ 8 + 9 + #ifndef __DT_BINDINGS_PINCTRL_RENESAS_R9A09G047_PINCTRL_H__ 10 + #define __DT_BINDINGS_PINCTRL_RENESAS_R9A09G047_PINCTRL_H__ 11 + 12 + #include <dt-bindings/pinctrl/rzg2l-pinctrl.h> 13 + 14 + /* RZG3E_Px = Offset address of PFC_P_mn - 0x20 */ 15 + #define RZG3E_P0 0 16 + #define RZG3E_P1 1 17 + #define RZG3E_P2 2 18 + #define RZG3E_P3 3 19 + #define RZG3E_P4 4 20 + #define RZG3E_P5 5 21 + #define RZG3E_P6 6 22 + #define RZG3E_P7 7 23 + #define RZG3E_P8 8 24 + #define RZG3E_PA 10 25 + #define RZG3E_PB 11 26 + #define RZG3E_PC 12 27 + #define RZG3E_PD 13 28 + #define RZG3E_PE 14 29 + #define RZG3E_PF 15 30 + #define RZG3E_PG 16 31 + #define RZG3E_PH 17 32 + #define RZG3E_PJ 19 33 + #define RZG3E_PK 20 34 + #define RZG3E_PL 21 35 + #define RZG3E_PM 22 36 + #define RZG3E_PS 28 37 + 38 + #define RZG3E_PORT_PINMUX(b, p, f) RZG2L_PORT_PINMUX(RZG3E_P##b, p, f) 39 + #define RZG3E_GPIO(port, pin) RZG2L_GPIO(RZG3E_P##port, pin) 40 + 41 + #endif /* __DT_BINDINGS_PINCTRL_RENESAS_R9A09G047_PINCTRL_H__ */
+31
include/dt-bindings/pinctrl/renesas,r9a09g057-pinctrl.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * This header provides constants for Renesas RZ/V2H family pinctrl bindings. 4 + * 5 + * Copyright (C) 2024 Renesas Electronics Corp. 6 + * 7 + */ 8 + 9 + #ifndef __DT_BINDINGS_PINCTRL_RENESAS_R9A09G057_PINCTRL_H__ 10 + #define __DT_BINDINGS_PINCTRL_RENESAS_R9A09G057_PINCTRL_H__ 11 + 12 + #include <dt-bindings/pinctrl/rzg2l-pinctrl.h> 13 + 14 + /* RZV2H_Px = Offset address of PFC_P_mn - 0x20 */ 15 + #define RZV2H_P0 0 16 + #define RZV2H_P1 1 17 + #define RZV2H_P2 2 18 + #define RZV2H_P3 3 19 + #define RZV2H_P4 4 20 + #define RZV2H_P5 5 21 + #define RZV2H_P6 6 22 + #define RZV2H_P7 7 23 + #define RZV2H_P8 8 24 + #define RZV2H_P9 9 25 + #define RZV2H_PA 10 26 + #define RZV2H_PB 11 27 + 28 + #define RZV2H_PORT_PINMUX(b, p, f) RZG2L_PORT_PINMUX(RZV2H_P##b, p, f) 29 + #define RZV2H_GPIO(port, pin) RZG2L_GPIO(RZV2H_P##port, pin) 30 + 31 + #endif /* __DT_BINDINGS_PINCTRL_RENESAS_R9A09G057_PINCTRL_H__ */