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

Merge tag 'pinctrl-v6.13-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:

- Xlinix Versal pin control driver

- Ocelot LAN969x pin control driver

- T-Head TH1520 RISC-V SoC pin control driver

- Qualcomm SM8750, IPQ5424, QCS8300, SAR2130P and QCS615 SoC pin
control drivers

- Qualcomm SM8750 LPASS (low power audio subsystem) pin control
driver

- Qualcomm PM8937 mixsig IC pin control support, GPIO and MPP
(multi-purpose-pin)

- Samsung Exynos8895 and Exynos9810 SoC pin control driver

- SpacemiT K1 SoC pin control driver

- Airhoa EN7581 IC pin control driver

Improvements:

- The Renesas subdriver now supports schmitt-trigger and open drain
pin configurations if the hardware supports it

- Support GPIOF and GPIOG banks in the Aspeed G6 SoC

- Support the DSW community in the Intel Elkhartlake SoC"

* tag 'pinctrl-v6.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (105 commits)
pinctrl: airoha: Use unsigned long for bit search
pinctrl: k210: Undef K210_PC_DEFAULT
pinctrl: qcom: spmi: fix debugfs drive strength
pinctrl: qcom: Add sm8750 pinctrl driver
dt-bindings: pinctrl: qcom: Add sm8750 pinctrl
pinctrl: cy8c95x0: remove unneeded goto labels
pinctrl: cy8c95x0: embed iterator to the for-loop
pinctrl: cy8c95x0: Use temporary variable for struct device
pinctrl: cy8c95x0: use flexible sleeping in reset function
pinctrl: cy8c95x0: switch to using devm_regulator_get_enable()
pinctrl: cy8c95x0: Use 2-argument strscpy()
dt-bindings: pinctrl: sx150xq: allow gpio line naming
pinctrl: single: add marvell,pxa1908-padconf compatible
dt-bindings: pinctrl: pinctrl-single: add marvell,pxa1908-padconf compatible
dt-bindings: pinctrl: correct typo of description for cv1800
pinctrl: qcom: spmi-mpp: Add PM8937 compatible
dt-bindings: pinctrl: qcom,pmic-mpp: Document PM8937 compatible
pinctrl: qcom-pmic-gpio: add support for PM8937
dt-bindings: pinctrl: qcom,pmic-gpio: add PM8937
pinctrl: Use of_property_present() for non-boolean properties
...

+16008 -1276
+42
Documentation/devicetree/bindings/arm/airoha,en7581-chip-scu.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/airoha,en7581-chip-scu.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Airoha Chip SCU Controller for EN7581 SoC 8 + 9 + maintainers: 10 + - Lorenzo Bianconi <lorenzo@kernel.org> 11 + 12 + description: 13 + The airoha chip-scu block provides a configuration interface for clock, 14 + io-muxing and other functionalities used by multiple controllers (e.g. clock, 15 + pinctrl, ecc) on EN7581 SoC. 16 + 17 + properties: 18 + compatible: 19 + items: 20 + - enum: 21 + - airoha,en7581-chip-scu 22 + - const: syscon 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + required: 28 + - compatible 29 + - reg 30 + 31 + additionalProperties: false 32 + 33 + examples: 34 + - | 35 + soc { 36 + #address-cells = <2>; 37 + #size-cells = <2>; 38 + syscon@1fa20000 { 39 + compatible = "airoha,en7581-chip-scu", "syscon"; 40 + reg = <0x0 0x1fa20000 0x0 0x388>; 41 + }; 42 + };
+90
Documentation/devicetree/bindings/mfd/airoha,en7581-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/airoha,en7581-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Airoha EN7581 GPIO System Controller 8 + 9 + maintainers: 10 + - Christian Marangi <ansuelsmth@gmail.com> 11 + - Lorenzo Bianconi <lorenzo@kernel.org> 12 + 13 + description: 14 + Airoha EN7581 SoC GPIO system controller which provided a register map 15 + for controlling the GPIO, pins and PWM of the SoC. 16 + 17 + properties: 18 + compatible: 19 + items: 20 + - const: airoha,en7581-gpio-sysctl 21 + - const: syscon 22 + - const: simple-mfd 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + pinctrl: 28 + type: object 29 + $ref: /schemas/pinctrl/airoha,en7581-pinctrl.yaml 30 + description: 31 + Child node definition for EN7581 Pin controller 32 + 33 + pwm: 34 + type: object 35 + $ref: /schemas/pwm/airoha,en7581-pwm.yaml 36 + description: 37 + Child node definition for EN7581 PWM controller 38 + 39 + required: 40 + - compatible 41 + - reg 42 + 43 + additionalProperties: false 44 + 45 + examples: 46 + - | 47 + #include <dt-bindings/interrupt-controller/arm-gic.h> 48 + 49 + system-controller@1fbf0200 { 50 + compatible = "airoha,en7581-gpio-sysctl", "syscon", "simple-mfd"; 51 + reg = <0x1fbf0200 0xc0>; 52 + 53 + pinctrl { 54 + compatible = "airoha,en7581-pinctrl"; 55 + 56 + interrupt-parent = <&gic>; 57 + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; 58 + 59 + gpio-controller; 60 + #gpio-cells = <2>; 61 + 62 + interrupt-controller; 63 + #interrupt-cells = <2>; 64 + 65 + mmc-pins { 66 + mux { 67 + function = "emmc"; 68 + groups = "emmc"; 69 + }; 70 + }; 71 + 72 + mdio-pins { 73 + mux { 74 + function = "mdio"; 75 + groups = "mdio"; 76 + }; 77 + 78 + conf { 79 + pins = "gpio2"; 80 + output-enable; 81 + }; 82 + }; 83 + }; 84 + 85 + pwm { 86 + compatible = "airoha,en7581-pwm"; 87 + 88 + #pwm-cells = <3>; 89 + }; 90 + };
+400
Documentation/devicetree/bindings/pinctrl/airoha,en7581-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/airoha,en7581-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Airoha EN7581 Pin Controller 8 + 9 + maintainers: 10 + - Lorenzo Bianconi <lorenzo@kernel.org> 11 + 12 + description: 13 + The Airoha's EN7581 Pin controller is used to control SoC pins. 14 + 15 + properties: 16 + compatible: 17 + const: airoha,en7581-pinctrl 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + gpio-controller: true 23 + 24 + '#gpio-cells': 25 + const: 2 26 + 27 + interrupt-controller: true 28 + 29 + '#interrupt-cells': 30 + const: 2 31 + 32 + allOf: 33 + - $ref: pinctrl.yaml# 34 + 35 + required: 36 + - compatible 37 + - interrupts 38 + - gpio-controller 39 + - "#gpio-cells" 40 + - interrupt-controller 41 + - "#interrupt-cells" 42 + 43 + patternProperties: 44 + '-pins$': 45 + type: object 46 + 47 + patternProperties: 48 + '^mux(-|$)': 49 + type: object 50 + 51 + description: 52 + pinmux configuration nodes. 53 + 54 + $ref: /schemas/pinctrl/pinmux-node.yaml 55 + 56 + properties: 57 + function: 58 + description: 59 + A string containing the name of the function to mux to the group. 60 + enum: [pon, tod_1pps, sipo, mdio, uart, i2c, jtag, pcm, spi, 61 + pcm_spi, i2s, emmc, pnand, pcie_reset, pwm, phy1_led0, 62 + phy2_led0, phy3_led0, phy4_led0, phy1_led1, phy2_led1, 63 + phy3_led1, phy4_led1] 64 + 65 + groups: 66 + description: 67 + An array of strings. Each string contains the name of a group. 68 + 69 + required: 70 + - function 71 + - groups 72 + 73 + allOf: 74 + - if: 75 + properties: 76 + function: 77 + const: pon 78 + then: 79 + properties: 80 + groups: 81 + enum: [pon] 82 + - if: 83 + properties: 84 + function: 85 + const: tod_1pps 86 + then: 87 + properties: 88 + groups: 89 + enum: [pon_tod_1pps, gsw_tod_1pps] 90 + - if: 91 + properties: 92 + function: 93 + const: sipo 94 + then: 95 + properties: 96 + groups: 97 + enum: [sipo, sipo_rclk] 98 + - if: 99 + properties: 100 + function: 101 + const: mdio 102 + then: 103 + properties: 104 + groups: 105 + enum: [mdio] 106 + - if: 107 + properties: 108 + function: 109 + const: uart 110 + then: 111 + properties: 112 + groups: 113 + items: 114 + enum: [uart2, uart2_cts_rts, hsuart, hsuart_cts_rts, 115 + uart4, uart5] 116 + maxItems: 2 117 + - if: 118 + properties: 119 + function: 120 + const: i2c 121 + then: 122 + properties: 123 + groups: 124 + enum: [i2c1] 125 + - if: 126 + properties: 127 + function: 128 + const: jtag 129 + then: 130 + properties: 131 + groups: 132 + enum: [jtag_udi, jtag_dfd] 133 + - if: 134 + properties: 135 + function: 136 + const: pcm 137 + then: 138 + properties: 139 + groups: 140 + enum: [pcm1, pcm2] 141 + - if: 142 + properties: 143 + function: 144 + const: spi 145 + then: 146 + properties: 147 + groups: 148 + items: 149 + enum: [spi_quad, spi_cs1] 150 + maxItems: 2 151 + - if: 152 + properties: 153 + function: 154 + const: pcm_spi 155 + then: 156 + properties: 157 + groups: 158 + items: 159 + enum: [pcm_spi, pcm_spi_int, pcm_spi_rst, pcm_spi_cs1, 160 + pcm_spi_cs2_p156, pcm_spi_cs2_p128, pcm_spi_cs3, 161 + pcm_spi_cs4] 162 + maxItems: 7 163 + - if: 164 + properties: 165 + function: 166 + const: i2c 167 + then: 168 + properties: 169 + groups: 170 + enum: [i2s] 171 + - if: 172 + properties: 173 + function: 174 + const: emmc 175 + then: 176 + properties: 177 + groups: 178 + enum: [emmc] 179 + - if: 180 + properties: 181 + function: 182 + const: pnand 183 + then: 184 + properties: 185 + groups: 186 + enum: [pnand] 187 + - if: 188 + properties: 189 + function: 190 + const: pcie_reset 191 + then: 192 + properties: 193 + groups: 194 + enum: [pcie_reset0, pcie_reset1, pcie_reset2] 195 + - if: 196 + properties: 197 + function: 198 + const: pwm 199 + then: 200 + properties: 201 + groups: 202 + enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, 203 + gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, 204 + gpio14, gpio15, gpio16, gpio17, gpio18, gpio19, 205 + gpio20, gpio21, gpio22, gpio23, gpio24, gpio25, 206 + gpio26, gpio27, gpio28, gpio29, gpio30, gpio31, 207 + gpio36, gpio37, gpio38, gpio39, gpio40, gpio41, 208 + gpio42, gpio43, gpio44, gpio45, gpio46, gpio47] 209 + - if: 210 + properties: 211 + function: 212 + const: phy1_led0 213 + then: 214 + properties: 215 + groups: 216 + enum: [gpio33, gpio34, gpio35, gpio42] 217 + - if: 218 + properties: 219 + function: 220 + const: phy2_led0 221 + then: 222 + properties: 223 + groups: 224 + enum: [gpio33, gpio34, gpio35, gpio42] 225 + - if: 226 + properties: 227 + function: 228 + const: phy3_led0 229 + then: 230 + properties: 231 + groups: 232 + enum: [gpio33, gpio34, gpio35, gpio42] 233 + - if: 234 + properties: 235 + function: 236 + const: phy4_led0 237 + then: 238 + properties: 239 + groups: 240 + enum: [gpio33, gpio34, gpio35, gpio42] 241 + - if: 242 + properties: 243 + function: 244 + const: phy1_led1 245 + then: 246 + properties: 247 + groups: 248 + enum: [gpio43, gpio44, gpio45, gpio46] 249 + - if: 250 + properties: 251 + function: 252 + const: phy2_led1 253 + then: 254 + properties: 255 + groups: 256 + enum: [gpio43, gpio44, gpio45, gpio46] 257 + - if: 258 + properties: 259 + function: 260 + const: phy3_led1 261 + then: 262 + properties: 263 + groups: 264 + enum: [gpio43, gpio44, gpio45, gpio46] 265 + - if: 266 + properties: 267 + function: 268 + const: phy4_led1 269 + then: 270 + properties: 271 + groups: 272 + enum: [gpio43, gpio44, gpio45, gpio46] 273 + 274 + additionalProperties: false 275 + 276 + '^conf(-|$)': 277 + type: object 278 + 279 + description: 280 + pinconf configuration nodes. 281 + 282 + $ref: /schemas/pinctrl/pincfg-node.yaml 283 + 284 + properties: 285 + pins: 286 + description: 287 + An array of strings. Each string contains the name of a pin. 288 + items: 289 + enum: [uart1_txd, uart1_rxd, i2c_scl, i2c_sda, spi_cs0, spi_clk, 290 + spi_mosi, spi_miso, gpio0, gpio1, gpio2, gpio3, gpio4, 291 + gpio5, gpio6, gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, 292 + gpio13, gpio14, gpio15, gpio16, gpio17, gpio18, gpio19, 293 + gpio20, gpio21, gpio22, gpio23, gpio24, gpio25, gpio26, 294 + gpio27, gpio28, gpio29, gpio30, gpio31, gpio32, gpio33, 295 + gpio34, gpio35, gpio36, gpio37, gpio38, gpio39, gpio40, 296 + gpio41, gpio42, gpio43, gpio44, gpio45, gpio46, 297 + pcie_reset0, pcie_reset1, pcie_reset2] 298 + minItems: 1 299 + maxItems: 58 300 + 301 + bias-disable: true 302 + 303 + bias-pull-up: true 304 + 305 + bias-pull-down: true 306 + 307 + input-enable: true 308 + 309 + output-enable: true 310 + 311 + output-low: true 312 + 313 + output-high: true 314 + 315 + drive-open-drain: true 316 + 317 + drive-strength: 318 + description: 319 + Selects the drive strength for MIO pins, in mA. 320 + enum: [2, 4, 6, 8] 321 + 322 + required: 323 + - pins 324 + 325 + additionalProperties: false 326 + 327 + additionalProperties: false 328 + 329 + additionalProperties: false 330 + 331 + examples: 332 + - | 333 + #include <dt-bindings/interrupt-controller/arm-gic.h> 334 + 335 + pinctrl { 336 + compatible = "airoha,en7581-pinctrl"; 337 + 338 + interrupt-parent = <&gic>; 339 + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; 340 + 341 + gpio-controller; 342 + #gpio-cells = <2>; 343 + 344 + interrupt-controller; 345 + #interrupt-cells = <2>; 346 + 347 + pcie1-rst-pins { 348 + conf { 349 + pins = "pcie_reset1"; 350 + drive-open-drain = <1>; 351 + }; 352 + }; 353 + 354 + pwm-pins { 355 + mux { 356 + function = "pwm"; 357 + groups = "gpio18"; 358 + }; 359 + }; 360 + 361 + spi-pins { 362 + mux { 363 + function = "spi"; 364 + groups = "spi_quad", "spi_cs1"; 365 + }; 366 + }; 367 + 368 + uart2-pins { 369 + mux { 370 + function = "uart"; 371 + groups = "uart2", "uart2_cts_rts"; 372 + }; 373 + }; 374 + 375 + uar5-pins { 376 + mux { 377 + function = "uart"; 378 + groups = "uart5"; 379 + }; 380 + }; 381 + 382 + mmc-pins { 383 + mux { 384 + function = "emmc"; 385 + groups = "emmc"; 386 + }; 387 + }; 388 + 389 + mdio-pins { 390 + mux { 391 + function = "mdio"; 392 + groups = "mdio"; 393 + }; 394 + 395 + conf { 396 + pins = "gpio2"; 397 + output-enable; 398 + }; 399 + }; 400 + };
+1 -1
Documentation/devicetree/bindings/pinctrl/amlogic,meson8-pinctrl-cbus.yaml
··· 46 46 - const: gpio 47 47 48 48 gpio-line-names: 49 - minItems: 86 # AXG 49 + minItems: 83 # Meson8b 50 50 maxItems: 120 # Meson8 51 51 52 52 unevaluatedProperties:
+127
Documentation/devicetree/bindings/pinctrl/canaan,k230-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/canaan,k230-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Canaan Kendryte K230 Pin Controller 8 + 9 + maintainers: 10 + - Ze Huang <18771902331@163.com> 11 + 12 + description: 13 + The Canaan Kendryte K230 platform includes 64 IO pins, each capable of 14 + multiplexing up to 5 different functions. Pin function configuration is 15 + performed on a per-pin basis. 16 + 17 + properties: 18 + compatible: 19 + const: canaan,k230-pinctrl 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + patternProperties: 25 + '-pins$': 26 + type: object 27 + additionalProperties: false 28 + description: 29 + A pinctrl node should contain at least one subnode representing the 30 + pinctrl groups available on the machine. 31 + 32 + patternProperties: 33 + '-cfg$': 34 + type: object 35 + allOf: 36 + - $ref: /schemas/pinctrl/pincfg-node.yaml 37 + - $ref: /schemas/pinctrl/pinmux-node.yaml 38 + additionalProperties: false 39 + description: 40 + Each subnode will list the pins it needs, and how they should 41 + be configured, with regard to muxer configuration, bias, input 42 + enable/disable, input schmitt trigger, slew-rate enable/disable, 43 + slew-rate, drive strength. 44 + 45 + properties: 46 + pinmux: 47 + description: 48 + The list of GPIOs and their mux settings that properties in 49 + the node apply to. This should be set with the macro 50 + 'K230_PINMUX(pin, mode)' 51 + 52 + bias-disable: true 53 + 54 + bias-pull-up: true 55 + 56 + bias-pull-down: true 57 + 58 + drive-strength: 59 + minimum: 0 60 + maximum: 15 61 + 62 + input-enable: true 63 + 64 + output-enable: true 65 + 66 + input-schmitt-enable: true 67 + 68 + slew-rate: 69 + description: | 70 + slew rate control enable 71 + 0: disable 72 + 1: enable 73 + 74 + enum: [0, 1] 75 + 76 + power-source: 77 + description: | 78 + Specifies the power source voltage for the IO bank that the 79 + pin belongs to. Each bank of IO pins operate at a specific, 80 + fixed voltage levels. Incorrect voltage configuration can 81 + damage the chip. The defined constants represent the 82 + possible voltage configurations: 83 + 84 + - K230_MSC_3V3 (value 0): 3.3V power supply 85 + - K230_MSC_1V8 (value 1): 1.8V power supply 86 + 87 + The following banks have the corresponding voltage 88 + configurations: 89 + 90 + - bank IO0 to IO1: Fixed at 1.8V 91 + - bank IO2 to IO13: Fixed at 1.8V 92 + - bank IO14 to IO25: Fixed at 1.8V 93 + - bank IO26 to IO37: Fixed at 1.8V 94 + - bank IO38 to IO49: Fixed at 1.8V 95 + - bank IO50 to IO61: Fixed at 3.3V 96 + - bank IO62 to IO63: Fixed at 1.8V 97 + 98 + enum: [0, 1] 99 + 100 + required: 101 + - pinmux 102 + 103 + required: 104 + - compatible 105 + - reg 106 + 107 + additionalProperties: false 108 + 109 + examples: 110 + - | 111 + pinctrl@91105000 { 112 + compatible = "canaan,k230-pinctrl"; 113 + reg = <0x91105000 0x100>; 114 + 115 + uart2-pins { 116 + uart2-pins-cfg { 117 + pinmux = <0x503>, /* uart2 txd */ 118 + <0x603>; /* uart2 rxd */ 119 + slew-rate = <0>; 120 + drive-strength = <4>; 121 + power-source = <1>; 122 + input-enable; 123 + output-enable; 124 + bias-disable; 125 + }; 126 + }; 127 + };
-33
Documentation/devicetree/bindings/pinctrl/fsl,imx35-pinctrl.txt
··· 1 - * Freescale IMX35 IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx35-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx35 datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_DRIVE_VOLAGAGE_18 (1 << 13) 16 - PAD_CTL_DRIVE_VOLAGAGE_33 (0 << 13) 17 - PAD_CTL_HYS (1 << 8) 18 - PAD_CTL_PKE (1 << 7) 19 - PAD_CTL_PUE (1 << 6) 20 - PAD_CTL_PUS_100K_DOWN (0 << 4) 21 - PAD_CTL_PUS_47K_UP (1 << 4) 22 - PAD_CTL_PUS_100K_UP (2 << 4) 23 - PAD_CTL_PUS_22K_UP (3 << 4) 24 - PAD_CTL_ODE_CMOS (0 << 3) 25 - PAD_CTL_ODE_OPENDRAIN (1 << 3) 26 - PAD_CTL_DSE_NOMINAL (0 << 1) 27 - PAD_CTL_DSE_HIGH (1 << 1) 28 - PAD_CTL_DSE_MAX (2 << 1) 29 - PAD_CTL_SRE_FAST (1 << 0) 30 - PAD_CTL_SRE_SLOW (0 << 0) 31 - 32 - Refer to imx35-pinfunc.h in device tree source folder for all available 33 - imx35 PIN_FUNC_ID.
+184
Documentation/devicetree/bindings/pinctrl/fsl,imx35-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/fsl,imx35-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Freescale IMX35/IMX5x/IMX6 IOMUX Controller 8 + 9 + maintainers: 10 + - Dong Aisheng <aisheng.dong@nxp.com> 11 + 12 + description: 13 + Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory 14 + for common binding part and usage. 15 + 16 + allOf: 17 + - $ref: pinctrl.yaml# 18 + 19 + properties: 20 + compatible: 21 + oneOf: 22 + - enum: 23 + - fsl,imx35-iomuxc 24 + - fsl,imx51-iomuxc 25 + - fsl,imx53-iomuxc 26 + - fsl,imx6dl-iomuxc 27 + - fsl,imx6q-iomuxc 28 + - fsl,imx6sl-iomuxc 29 + - fsl,imx6sll-iomuxc 30 + - fsl,imx6sx-iomuxc 31 + - fsl,imx6ul-iomuxc 32 + - fsl,imx6ull-iomuxc-snvs 33 + - items: 34 + - const: fsl,imx50-iomuxc 35 + - const: fsl,imx53-iomuxc 36 + 37 + reg: 38 + maxItems: 1 39 + 40 + # Client device subnode's properties 41 + patternProperties: 42 + 'grp$': 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 + 48 + properties: 49 + fsl,pins: 50 + description: 51 + each entry consists of 6 integers and represents the mux and config 52 + setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 53 + mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 54 + be found in <arch/arm/boot/dts/nxp/imx/imx*-pinfunc.h>. The last integer 55 + CONFIG is the pad setting value like pull-up on this pin. Please 56 + refer to matching i.MX Reference Manual for detailed CONFIG settings. 57 + $ref: /schemas/types.yaml#/definitions/uint32-matrix 58 + items: 59 + items: 60 + - description: | 61 + "mux_reg" indicates the offset of mux register. 62 + - description: | 63 + "conf_reg" indicates the offset of pad configuration register. 64 + - description: | 65 + "input_reg" indicates the offset of select input register. 66 + - description: | 67 + "mux_val" indicates the mux value to be applied. 68 + - description: | 69 + "input_val" indicates the select input value to be applied. 70 + - description: | 71 + "pad_setting" indicates the pad configuration value to be applied. 72 + Common i.MX35 73 + PAD_CTL_DRIVE_VOLAGAGE_18 (1 << 13) 74 + PAD_CTL_DRIVE_VOLAGAGE_33 (0 << 13) 75 + PAD_CTL_HYS (1 << 8) 76 + PAD_CTL_PKE (1 << 7) 77 + PAD_CTL_PUE (1 << 6) 78 + PAD_CTL_PUS_100K_DOWN (0 << 4) 79 + PAD_CTL_PUS_47K_UP (1 << 4) 80 + PAD_CTL_PUS_100K_UP (2 << 4) 81 + PAD_CTL_PUS_22K_UP (3 << 4) 82 + PAD_CTL_ODE_CMOS (0 << 3) 83 + PAD_CTL_ODE_OPENDRAIN (1 << 3) 84 + PAD_CTL_DSE_NOMINAL (0 << 1) 85 + PAD_CTL_DSE_HIGH (1 << 1) 86 + PAD_CTL_DSE_MAX (2 << 1) 87 + PAD_CTL_SRE_FAST (1 << 0) 88 + PAD_CTL_SRE_SLOW (0 << 0) 89 + Common i.MX50/i.MX51/i.MX53 bits 90 + PAD_CTL_HVE (1 << 13) 91 + PAD_CTL_HYS (1 << 8) 92 + PAD_CTL_PKE (1 << 7) 93 + PAD_CTL_PUE (1 << 6) 94 + PAD_CTL_PUS_100K_DOWN (0 << 4) 95 + PAD_CTL_PUS_47K_UP (1 << 4) 96 + PAD_CTL_PUS_100K_UP (2 << 4) 97 + PAD_CTL_PUS_22K_UP (3 << 4) 98 + PAD_CTL_ODE (1 << 3) 99 + PAD_CTL_DSE_LOW (0 << 1) 100 + PAD_CTL_DSE_MED (1 << 1) 101 + PAD_CTL_DSE_HIGH (2 << 1) 102 + PAD_CTL_DSE_MAX (3 << 1) 103 + PAD_CTL_SRE_FAST (1 << 0) 104 + PAD_CTL_SRE_SLOW (0 << 0) 105 + Common i.MX6 bits 106 + PAD_CTL_HYS (1 << 16) 107 + PAD_CTL_PUS_100K_DOWN (0 << 14) 108 + PAD_CTL_PUS_47K_UP (1 << 14) 109 + PAD_CTL_PUS_100K_UP (2 << 14) 110 + PAD_CTL_PUS_22K_UP (3 << 14) 111 + PAD_CTL_PUE (1 << 13) 112 + PAD_CTL_PKE (1 << 12) 113 + PAD_CTL_ODE (1 << 11) 114 + PAD_CTL_SPEED_LOW (0 << 6) 115 + PAD_CTL_SPEED_MED (1 << 6) 116 + PAD_CTL_SPEED_HIGH (3 << 6) 117 + PAD_CTL_DSE_DISABLE (0 << 3) 118 + PAD_CTL_SRE_FAST (1 << 0) 119 + PAD_CTL_SRE_SLOW (0 << 0) 120 + i.MX6SL/MX6SLL specific bits 121 + PAD_CTL_LVE (1 << 22) (MX6SL/SLL only) 122 + i.MX6SLL/i.MX6SX/i.MX6UL/i.MX6ULL specific bits 123 + PAD_CTL_DSE_260ohm (1 << 3) 124 + PAD_CTL_DSE_130ohm (2 << 3) 125 + PAD_CTL_DSE_87ohm (3 << 3) 126 + PAD_CTL_DSE_65ohm (4 << 3) 127 + PAD_CTL_DSE_52ohm (5 << 3) 128 + PAD_CTL_DSE_43ohm (6 << 3) 129 + PAD_CTL_DSE_37ohm (7 << 3) 130 + i.MX6DL/i.MX6Q/i.MX6SL specific bits 131 + PAD_CTL_DSE_240ohm (1 << 3) 132 + PAD_CTL_DSE_120ohm (2 << 3) 133 + PAD_CTL_DSE_80ohm (3 << 3) 134 + PAD_CTL_DSE_60ohm (4 << 3) 135 + PAD_CTL_DSE_48ohm (5 << 3) 136 + PAD_CTL_DSE_40ohm (6 << 3) 137 + PAD_CTL_DSE_34ohm (7 << 3) 138 + 139 + required: 140 + - fsl,pins 141 + 142 + additionalProperties: false 143 + 144 + required: 145 + - compatible 146 + - reg 147 + 148 + additionalProperties: false 149 + 150 + examples: 151 + - | 152 + iomuxc: pinctrl@20e0000 { 153 + compatible = "fsl,imx6ul-iomuxc"; 154 + reg = <0x020e0000 0x4000>; 155 + 156 + mux_uart: uartgrp { 157 + fsl,pins = < 158 + 0x0084 0x0310 0x0000 0 0 0x1b0b1 159 + 0x0088 0x0314 0x0624 0 3 0x1b0b1 160 + >; 161 + }; 162 + }; 163 + - | 164 + iomuxc_snvs: pinctrl@2290000 { 165 + compatible = "fsl,imx6ull-iomuxc-snvs"; 166 + reg = <0x02290000 0x4000>; 167 + 168 + pinctrl_snvs_usbc_det: snvsusbcdetgrp { 169 + fsl,pins = < 170 + 0x0010 0x0054 0x0000 0x5 0x0 0x130b0 171 + >; 172 + }; 173 + }; 174 + - | 175 + iomuxc_mx6q: pinctrl@20e0000 { 176 + compatible = "fsl,imx6q-iomuxc"; 177 + reg = <0x20e0000 0x4000>; 178 + 179 + pinctrl_uart4: uart4grp { 180 + fsl,pins = 181 + <0x288 0x658 0x000 0x3 0x0 0x140>, 182 + <0x28c 0x65c 0x938 0x3 0x3 0x140>; 183 + }; 184 + };
-32
Documentation/devicetree/bindings/pinctrl/fsl,imx50-pinctrl.txt
··· 1 - * Freescale IMX50 IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx50-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx50 datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_HVE (1 << 13) 16 - PAD_CTL_HYS (1 << 8) 17 - PAD_CTL_PKE (1 << 7) 18 - PAD_CTL_PUE (1 << 6) 19 - PAD_CTL_PUS_100K_DOWN (0 << 4) 20 - PAD_CTL_PUS_47K_UP (1 << 4) 21 - PAD_CTL_PUS_100K_UP (2 << 4) 22 - PAD_CTL_PUS_22K_UP (3 << 4) 23 - PAD_CTL_ODE (1 << 3) 24 - PAD_CTL_DSE_LOW (0 << 1) 25 - PAD_CTL_DSE_MED (1 << 1) 26 - PAD_CTL_DSE_HIGH (2 << 1) 27 - PAD_CTL_DSE_MAX (3 << 1) 28 - PAD_CTL_SRE_FAST (1 << 0) 29 - PAD_CTL_SRE_SLOW (0 << 0) 30 - 31 - Refer to imx50-pinfunc.h in device tree source folder for all available 32 - imx50 PIN_FUNC_ID.
-32
Documentation/devicetree/bindings/pinctrl/fsl,imx51-pinctrl.txt
··· 1 - * Freescale IMX51 IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx51-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx51 datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_HVE (1 << 13) 16 - PAD_CTL_HYS (1 << 8) 17 - PAD_CTL_PKE (1 << 7) 18 - PAD_CTL_PUE (1 << 6) 19 - PAD_CTL_PUS_100K_DOWN (0 << 4) 20 - PAD_CTL_PUS_47K_UP (1 << 4) 21 - PAD_CTL_PUS_100K_UP (2 << 4) 22 - PAD_CTL_PUS_22K_UP (3 << 4) 23 - PAD_CTL_ODE (1 << 3) 24 - PAD_CTL_DSE_LOW (0 << 1) 25 - PAD_CTL_DSE_MED (1 << 1) 26 - PAD_CTL_DSE_HIGH (2 << 1) 27 - PAD_CTL_DSE_MAX (3 << 1) 28 - PAD_CTL_SRE_FAST (1 << 0) 29 - PAD_CTL_SRE_SLOW (0 << 0) 30 - 31 - Refer to imx51-pinfunc.h in device tree source folder for all available 32 - imx51 PIN_FUNC_ID.
-32
Documentation/devicetree/bindings/pinctrl/fsl,imx53-pinctrl.txt
··· 1 - * Freescale IMX53 IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx53-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx53 datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_HVE (1 << 13) 16 - PAD_CTL_HYS (1 << 8) 17 - PAD_CTL_PKE (1 << 7) 18 - PAD_CTL_PUE (1 << 6) 19 - PAD_CTL_PUS_100K_DOWN (0 << 4) 20 - PAD_CTL_PUS_47K_UP (1 << 4) 21 - PAD_CTL_PUS_100K_UP (2 << 4) 22 - PAD_CTL_PUS_22K_UP (3 << 4) 23 - PAD_CTL_ODE (1 << 3) 24 - PAD_CTL_DSE_LOW (0 << 1) 25 - PAD_CTL_DSE_MED (1 << 1) 26 - PAD_CTL_DSE_HIGH (2 << 1) 27 - PAD_CTL_DSE_MAX (3 << 1) 28 - PAD_CTL_SRE_FAST (1 << 0) 29 - PAD_CTL_SRE_SLOW (0 << 0) 30 - 31 - Refer to imx53-pinfunc.h in device tree source folder for all available 32 - imx53 PIN_FUNC_ID.
-38
Documentation/devicetree/bindings/pinctrl/fsl,imx6dl-pinctrl.txt
··· 1 - * Freescale IMX6 DualLite/Solo IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx6dl-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx6dl datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_HYS (1 << 16) 16 - PAD_CTL_PUS_100K_DOWN (0 << 14) 17 - PAD_CTL_PUS_47K_UP (1 << 14) 18 - PAD_CTL_PUS_100K_UP (2 << 14) 19 - PAD_CTL_PUS_22K_UP (3 << 14) 20 - PAD_CTL_PUE (1 << 13) 21 - PAD_CTL_PKE (1 << 12) 22 - PAD_CTL_ODE (1 << 11) 23 - PAD_CTL_SPEED_LOW (1 << 6) 24 - PAD_CTL_SPEED_MED (2 << 6) 25 - PAD_CTL_SPEED_HIGH (3 << 6) 26 - PAD_CTL_DSE_DISABLE (0 << 3) 27 - PAD_CTL_DSE_240ohm (1 << 3) 28 - PAD_CTL_DSE_120ohm (2 << 3) 29 - PAD_CTL_DSE_80ohm (3 << 3) 30 - PAD_CTL_DSE_60ohm (4 << 3) 31 - PAD_CTL_DSE_48ohm (5 << 3) 32 - PAD_CTL_DSE_40ohm (6 << 3) 33 - PAD_CTL_DSE_34ohm (7 << 3) 34 - PAD_CTL_SRE_FAST (1 << 0) 35 - PAD_CTL_SRE_SLOW (0 << 0) 36 - 37 - Refer to imx6dl-pinfunc.h in device tree source folder for all available 38 - imx6dl PIN_FUNC_ID.
-38
Documentation/devicetree/bindings/pinctrl/fsl,imx6q-pinctrl.txt
··· 1 - * Freescale IMX6Q IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx6q-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx6q datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_HYS (1 << 16) 16 - PAD_CTL_PUS_100K_DOWN (0 << 14) 17 - PAD_CTL_PUS_47K_UP (1 << 14) 18 - PAD_CTL_PUS_100K_UP (2 << 14) 19 - PAD_CTL_PUS_22K_UP (3 << 14) 20 - PAD_CTL_PUE (1 << 13) 21 - PAD_CTL_PKE (1 << 12) 22 - PAD_CTL_ODE (1 << 11) 23 - PAD_CTL_SPEED_LOW (1 << 6) 24 - PAD_CTL_SPEED_MED (2 << 6) 25 - PAD_CTL_SPEED_HIGH (3 << 6) 26 - PAD_CTL_DSE_DISABLE (0 << 3) 27 - PAD_CTL_DSE_240ohm (1 << 3) 28 - PAD_CTL_DSE_120ohm (2 << 3) 29 - PAD_CTL_DSE_80ohm (3 << 3) 30 - PAD_CTL_DSE_60ohm (4 << 3) 31 - PAD_CTL_DSE_48ohm (5 << 3) 32 - PAD_CTL_DSE_40ohm (6 << 3) 33 - PAD_CTL_DSE_34ohm (7 << 3) 34 - PAD_CTL_SRE_FAST (1 << 0) 35 - PAD_CTL_SRE_SLOW (0 << 0) 36 - 37 - Refer to imx6q-pinfunc.h in device tree source folder for all available 38 - imx6q PIN_FUNC_ID.
-39
Documentation/devicetree/bindings/pinctrl/fsl,imx6sl-pinctrl.txt
··· 1 - * Freescale IMX6 SoloLite IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx6sl-iomuxc" 8 - - fsl,pins: two integers array, represents a group of pins mux and config 9 - setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a 10 - pin working on a specific function, CONFIG is the pad setting value like 11 - pull-up for this pin. Please refer to imx6sl datasheet for the valid pad 12 - config settings. 13 - 14 - CONFIG bits definition: 15 - PAD_CTL_LVE (1 << 22) 16 - PAD_CTL_HYS (1 << 16) 17 - PAD_CTL_PUS_100K_DOWN (0 << 14) 18 - PAD_CTL_PUS_47K_UP (1 << 14) 19 - PAD_CTL_PUS_100K_UP (2 << 14) 20 - PAD_CTL_PUS_22K_UP (3 << 14) 21 - PAD_CTL_PUE (1 << 13) 22 - PAD_CTL_PKE (1 << 12) 23 - PAD_CTL_ODE (1 << 11) 24 - PAD_CTL_SPEED_LOW (1 << 6) 25 - PAD_CTL_SPEED_MED (2 << 6) 26 - PAD_CTL_SPEED_HIGH (3 << 6) 27 - PAD_CTL_DSE_DISABLE (0 << 3) 28 - PAD_CTL_DSE_240ohm (1 << 3) 29 - PAD_CTL_DSE_120ohm (2 << 3) 30 - PAD_CTL_DSE_80ohm (3 << 3) 31 - PAD_CTL_DSE_60ohm (4 << 3) 32 - PAD_CTL_DSE_48ohm (5 << 3) 33 - PAD_CTL_DSE_40ohm (6 << 3) 34 - PAD_CTL_DSE_34ohm (7 << 3) 35 - PAD_CTL_SRE_FAST (1 << 0) 36 - PAD_CTL_SRE_SLOW (0 << 0) 37 - 38 - Refer to imx6sl-pinfunc.h in device tree source folder for all available 39 - imx6sl PIN_FUNC_ID.
-40
Documentation/devicetree/bindings/pinctrl/fsl,imx6sll-pinctrl.txt
··· 1 - * Freescale i.MX6 SLL IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx6sll-iomuxc" 8 - - fsl,pins: each entry consists of 6 integers and represents the mux and config 9 - setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val 10 - input_val> are specified using a PIN_FUNC_ID macro, which can be found in 11 - imx6sll-pinfunc.h under device tree source folder. The last integer CONFIG is 12 - the pad setting value like pull-up on this pin. Please refer to i.MX6SLL 13 - Reference Manual for detailed CONFIG settings. 14 - 15 - CONFIG bits definition: 16 - PAD_CTL_LVE (1 << 22) 17 - PAD_CTL_HYS (1 << 16) 18 - PAD_CTL_PUS_100K_DOWN (0 << 14) 19 - PAD_CTL_PUS_47K_UP (1 << 14) 20 - PAD_CTL_PUS_100K_UP (2 << 14) 21 - PAD_CTL_PUS_22K_UP (3 << 14) 22 - PAD_CTL_PUE (1 << 13) 23 - PAD_CTL_PKE (1 << 12) 24 - PAD_CTL_ODE (1 << 11) 25 - PAD_CTL_SPEED_LOW (0 << 6) 26 - PAD_CTL_SPEED_MED (1 << 6) 27 - PAD_CTL_SPEED_HIGH (3 << 6) 28 - PAD_CTL_DSE_DISABLE (0 << 3) 29 - PAD_CTL_DSE_260ohm (1 << 3) 30 - PAD_CTL_DSE_130ohm (2 << 3) 31 - PAD_CTL_DSE_87ohm (3 << 3) 32 - PAD_CTL_DSE_65ohm (4 << 3) 33 - PAD_CTL_DSE_52ohm (5 << 3) 34 - PAD_CTL_DSE_43ohm (6 << 3) 35 - PAD_CTL_DSE_37ohm (7 << 3) 36 - PAD_CTL_SRE_FAST (1 << 0) 37 - PAD_CTL_SRE_SLOW (0 << 0) 38 - 39 - Refer to imx6sll-pinfunc.h in device tree source folder for all available 40 - imx6sll PIN_FUNC_ID.
-36
Documentation/devicetree/bindings/pinctrl/fsl,imx6sx-pinctrl.txt
··· 1 - * Freescale i.MX6 SoloX IOMUX Controller 2 - 3 - Please refer to fsl,imx-pinctrl.txt in this directory for common binding part 4 - and usage. 5 - 6 - Required properties: 7 - - compatible: "fsl,imx6sx-iomuxc" 8 - - fsl,pins: each entry consists of 6 integers and represents the mux and config 9 - setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val 10 - input_val> are specified using a PIN_FUNC_ID macro, which can be found in 11 - imx6sx-pinfunc.h under device tree source folder. The last integer CONFIG is 12 - the pad setting value like pull-up on this pin. Please refer to i.MX6 SoloX 13 - Reference Manual for detailed CONFIG settings. 14 - 15 - CONFIG bits definition: 16 - PAD_CTL_HYS (1 << 16) 17 - PAD_CTL_PUS_100K_DOWN (0 << 14) 18 - PAD_CTL_PUS_47K_UP (1 << 14) 19 - PAD_CTL_PUS_100K_UP (2 << 14) 20 - PAD_CTL_PUS_22K_UP (3 << 14) 21 - PAD_CTL_PUE (1 << 13) 22 - PAD_CTL_PKE (1 << 12) 23 - PAD_CTL_ODE (1 << 11) 24 - PAD_CTL_SPEED_LOW (0 << 6) 25 - PAD_CTL_SPEED_MED (1 << 6) 26 - PAD_CTL_SPEED_HIGH (3 << 6) 27 - PAD_CTL_DSE_DISABLE (0 << 3) 28 - PAD_CTL_DSE_260ohm (1 << 3) 29 - PAD_CTL_DSE_130ohm (2 << 3) 30 - PAD_CTL_DSE_87ohm (3 << 3) 31 - PAD_CTL_DSE_65ohm (4 << 3) 32 - PAD_CTL_DSE_52ohm (5 << 3) 33 - PAD_CTL_DSE_43ohm (6 << 3) 34 - PAD_CTL_DSE_37ohm (7 << 3) 35 - PAD_CTL_SRE_FAST (1 << 0) 36 - PAD_CTL_SRE_SLOW (0 << 0)
-116
Documentation/devicetree/bindings/pinctrl/fsl,imx6ul-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/fsl,imx6ul-pinctrl.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Freescale IMX6UL IOMUX Controller 8 - 9 - maintainers: 10 - - Dong Aisheng <aisheng.dong@nxp.com> 11 - 12 - description: 13 - Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory 14 - for common binding part and usage. 15 - 16 - allOf: 17 - - $ref: pinctrl.yaml# 18 - 19 - properties: 20 - compatible: 21 - enum: 22 - - fsl,imx6ul-iomuxc 23 - - fsl,imx6ull-iomuxc-snvs 24 - 25 - reg: 26 - maxItems: 1 27 - 28 - # Client device subnode's properties 29 - patternProperties: 30 - 'grp$': 31 - type: object 32 - description: 33 - Pinctrl node's client devices use subnodes for desired pin configuration. 34 - Client device subnodes use below standard properties. 35 - 36 - properties: 37 - fsl,pins: 38 - description: 39 - each entry consists of 6 integers and represents the mux and config 40 - setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 41 - mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 42 - be found in <arch/arm/boot/dts/imx6ul-pinfunc.h>. The last integer 43 - CONFIG is the pad setting value like pull-up on this pin. Please 44 - refer to i.MX6UL Reference Manual for detailed CONFIG settings. 45 - $ref: /schemas/types.yaml#/definitions/uint32-matrix 46 - items: 47 - items: 48 - - description: | 49 - "mux_reg" indicates the offset of mux register. 50 - - description: | 51 - "conf_reg" indicates the offset of pad configuration register. 52 - - description: | 53 - "input_reg" indicates the offset of select input register. 54 - - description: | 55 - "mux_val" indicates the mux value to be applied. 56 - - description: | 57 - "input_val" indicates the select input value to be applied. 58 - - description: | 59 - "pad_setting" indicates the pad configuration value to be applied: 60 - PAD_CTL_HYS (1 << 16) 61 - PAD_CTL_PUS_100K_DOWN (0 << 14) 62 - PAD_CTL_PUS_47K_UP (1 << 14) 63 - PAD_CTL_PUS_100K_UP (2 << 14) 64 - PAD_CTL_PUS_22K_UP (3 << 14) 65 - PAD_CTL_PUE (1 << 13) 66 - PAD_CTL_PKE (1 << 12) 67 - PAD_CTL_ODE (1 << 11) 68 - PAD_CTL_SPEED_LOW (0 << 6) 69 - PAD_CTL_SPEED_MED (1 << 6) 70 - PAD_CTL_SPEED_HIGH (3 << 6) 71 - PAD_CTL_DSE_DISABLE (0 << 3) 72 - PAD_CTL_DSE_260ohm (1 << 3) 73 - PAD_CTL_DSE_130ohm (2 << 3) 74 - PAD_CTL_DSE_87ohm (3 << 3) 75 - PAD_CTL_DSE_65ohm (4 << 3) 76 - PAD_CTL_DSE_52ohm (5 << 3) 77 - PAD_CTL_DSE_43ohm (6 << 3) 78 - PAD_CTL_DSE_37ohm (7 << 3) 79 - PAD_CTL_SRE_FAST (1 << 0) 80 - PAD_CTL_SRE_SLOW (0 << 0) 81 - 82 - required: 83 - - fsl,pins 84 - 85 - additionalProperties: false 86 - 87 - required: 88 - - compatible 89 - - reg 90 - 91 - additionalProperties: false 92 - 93 - examples: 94 - - | 95 - iomuxc: pinctrl@20e0000 { 96 - compatible = "fsl,imx6ul-iomuxc"; 97 - reg = <0x020e0000 0x4000>; 98 - 99 - mux_uart: uartgrp { 100 - fsl,pins = < 101 - 0x0084 0x0310 0x0000 0 0 0x1b0b1 102 - 0x0088 0x0314 0x0624 0 3 0x1b0b1 103 - >; 104 - }; 105 - }; 106 - - | 107 - iomuxc_snvs: pinctrl@2290000 { 108 - compatible = "fsl,imx6ull-iomuxc-snvs"; 109 - reg = <0x02290000 0x4000>; 110 - 111 - pinctrl_snvs_usbc_det: snvsusbcdetgrp { 112 - fsl,pins = < 113 - 0x0010 0x0054 0x0000 0x5 0x0 0x130b0 114 - >; 115 - }; 116 - };
+161
Documentation/devicetree/bindings/pinctrl/microchip,mcp23s08.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/microchip,mcp23s08.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Microchip I/O expander with serial interface (I2C/SPI) 8 + 9 + maintainers: 10 + - Himanshu Bhavani <himanshu.bhavani@siliconsignals.io> 11 + 12 + description: 13 + Microchip MCP23008, MCP23017, MCP23S08, MCP23S17, MCP23S18 GPIO expander 14 + chips.These chips provide 8 or 16 GPIO pins with either I2C or SPI interface. 15 + 16 + allOf: 17 + - $ref: /schemas/spi/spi-peripheral-props.yaml# 18 + 19 + properties: 20 + compatible: 21 + enum: 22 + - microchip,mcp23s08 23 + - microchip,mcp23s17 24 + - microchip,mcp23s18 25 + - microchip,mcp23008 26 + - microchip,mcp23017 27 + - microchip,mcp23018 28 + 29 + reg: 30 + maxItems: 1 31 + 32 + gpio-controller: true 33 + 34 + '#gpio-cells': 35 + const: 2 36 + 37 + interrupt-controller: true 38 + 39 + '#interrupt-cells': 40 + const: 2 41 + 42 + interrupts: 43 + maxItems: 1 44 + 45 + reset-gpios: 46 + description: GPIO specifier for active-low reset pin. 47 + maxItems: 1 48 + 49 + microchip,spi-present-mask: 50 + description: 51 + Multiple SPI chips can share the same SPI chipselect. Set a bit in 52 + bit0-7 in this mask to 1 if there is a chip connected with the 53 + corresponding spi address set. For example if you have a chip with 54 + address 3 connected, you have to set bit3 to 1, which is 0x08. mcp23s08 55 + chip variant only supports bits 0-3. It is not possible to mix mcp23s08 56 + and mcp23s17 on the same chipselect. Set at least one bit to 1 for SPI 57 + chips. 58 + $ref: /schemas/types.yaml#/definitions/uint8 59 + 60 + microchip,irq-mirror: 61 + type: boolean 62 + description: 63 + Sets the mirror flag in the IOCON register. Devices with two interrupt 64 + outputs (these are the devices ending with 17 and those that have 16 IOs) 65 + have two IO banks IO 0-7 form bank 1 and IO 8-15 are bank 2. These chips 66 + have two different interrupt outputs One for bank 1 and another for 67 + bank 2. If irq-mirror is set, both interrupts are generated regardless of 68 + the bank that an input change occurred on. If it is not set,the interrupt 69 + are only generated for the bank they belong to. 70 + 71 + microchip,irq-active-high: 72 + type: boolean 73 + description: 74 + Sets the INTPOL flag in the IOCON register.This configures the IRQ output 75 + polarity as active high. 76 + 77 + drive-open-drain: 78 + type: boolean 79 + description: 80 + Sets the ODR flag in the IOCON register. This configures the IRQ output as 81 + open drain active low. 82 + 83 + pinmux: 84 + type: object 85 + properties: 86 + pins: 87 + description: 88 + The list of GPIO pins controlled by this node. Each pin name 89 + corresponds to a physical pin on the GPIO expander. 90 + items: 91 + pattern: '^gpio([0-9]|[1][0-5])$' 92 + maxItems: 16 93 + 94 + bias-pull-up: 95 + type: boolean 96 + description: 97 + Configures pull-up resistors for the GPIO pins. Absence of this 98 + property will leave the configuration in its default state. 99 + 100 + required: 101 + - pins 102 + 103 + additionalProperties: false 104 + 105 + required: 106 + - compatible 107 + - reg 108 + - gpio-controller 109 + - '#gpio-cells' 110 + 111 + unevaluatedProperties: false 112 + 113 + examples: 114 + - | 115 + #include <dt-bindings/interrupt-controller/irq.h> 116 + #include <dt-bindings/gpio/gpio.h> 117 + 118 + i2c { 119 + #address-cells = <1>; 120 + #size-cells = <0>; 121 + 122 + gpio@21 { 123 + compatible = "microchip,mcp23017"; 124 + reg = <0x21>; 125 + gpio-controller; 126 + #gpio-cells = <2>; 127 + 128 + interrupt-parent = <&gpio1>; 129 + interrupts = <17 IRQ_TYPE_LEVEL_LOW>; 130 + interrupt-controller; 131 + #interrupt-cells = <2>; 132 + 133 + microchip,irq-mirror; 134 + pinctrl-names = "default"; 135 + pinctrl-0 = <&pinctrl_i2c_gpio0>, <&gpiopullups>; 136 + reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>; 137 + 138 + gpiopullups: pinmux { 139 + pins = "gpio0", "gpio1", "gpio2", "gpio3", 140 + "gpio4", "gpio5", "gpio6", "gpio7", 141 + "gpio8", "gpio9", "gpio10", "gpio11", 142 + "gpio12", "gpio13", "gpio14", "gpio15"; 143 + bias-pull-up; 144 + }; 145 + }; 146 + }; 147 + 148 + - | 149 + spi { 150 + #address-cells = <1>; 151 + #size-cells = <0>; 152 + 153 + gpio@0 { 154 + compatible = "microchip,mcp23s17"; 155 + reg = <0>; 156 + gpio-controller; 157 + #gpio-cells = <2>; 158 + spi-max-frequency = <1000000>; 159 + microchip,spi-present-mask = /bits/ 8 <0x01>; 160 + }; 161 + };
+19 -8
Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml
··· 12 12 13 13 properties: 14 14 compatible: 15 - enum: 16 - - microchip,lan966x-pinctrl 17 - - microchip,sparx5-pinctrl 18 - - mscc,jaguar2-pinctrl 19 - - mscc,luton-pinctrl 20 - - mscc,ocelot-pinctrl 21 - - mscc,serval-pinctrl 22 - - mscc,servalt-pinctrl 15 + oneOf: 16 + - enum: 17 + - microchip,lan966x-pinctrl 18 + - microchip,lan9691-pinctrl 19 + - microchip,sparx5-pinctrl 20 + - mscc,jaguar2-pinctrl 21 + - mscc,luton-pinctrl 22 + - mscc,ocelot-pinctrl 23 + - mscc,serval-pinctrl 24 + - mscc,servalt-pinctrl 25 + - items: 26 + - enum: 27 + - microchip,lan9698-pinctrl 28 + - microchip,lan9696-pinctrl 29 + - microchip,lan9694-pinctrl 30 + - microchip,lan9693-pinctrl 31 + - microchip,lan9692-pinctrl 32 + - const: microchip,lan9691-pinctrl 23 33 24 34 reg: 25 35 items: ··· 95 85 contains: 96 86 enum: 97 87 - microchip,lan966x-pinctrl 88 + - microchip,lan9691-pinctrl 98 89 - microchip,sparx5-pinctrl 99 90 then: 100 91 properties:
-148
Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt
··· 1 - Microchip MCP2308/MCP23S08/MCP23017/MCP23S17 driver for 2 - 8-/16-bit I/O expander with serial interface (I2C/SPI) 3 - 4 - Required properties: 5 - - compatible : Should be 6 - - "mcp,mcp23s08" (DEPRECATED) for 8 GPIO SPI version 7 - - "mcp,mcp23s17" (DEPRECATED) for 16 GPIO SPI version 8 - - "mcp,mcp23008" (DEPRECATED) for 8 GPIO I2C version or 9 - - "mcp,mcp23017" (DEPRECATED) for 16 GPIO I2C version of the chip 10 - 11 - - "microchip,mcp23s08" for 8 GPIO SPI version 12 - - "microchip,mcp23s17" for 16 GPIO SPI version 13 - - "microchip,mcp23s18" for 16 GPIO SPI version 14 - - "microchip,mcp23008" for 8 GPIO I2C version or 15 - - "microchip,mcp23017" for 16 GPIO I2C version of the chip 16 - - "microchip,mcp23018" for 16 GPIO I2C version 17 - NOTE: Do not use the old mcp prefix any more. It is deprecated and will be 18 - removed. 19 - - #gpio-cells : Should be two. 20 - - first cell is the pin number 21 - - second cell is used to specify flags as described in 22 - 'Documentation/devicetree/bindings/gpio/gpio.txt'. Allowed values defined by 23 - 'include/dt-bindings/gpio/gpio.h' (e.g. GPIO_ACTIVE_LOW). 24 - - gpio-controller : Marks the device node as a GPIO controller. 25 - - reg : For an address on its bus. I2C uses this a the I2C address of the chip. 26 - SPI uses this to specify the chipselect line which the chip is 27 - connected to. The driver and the SPI variant of the chip support 28 - multiple chips on the same chipselect. Have a look at 29 - microchip,spi-present-mask below. 30 - 31 - Required device specific properties (only for SPI chips): 32 - - mcp,spi-present-mask (DEPRECATED) 33 - - microchip,spi-present-mask : This is a present flag, that makes only sense for SPI 34 - chips - as the name suggests. Multiple SPI chips can share the same 35 - SPI chipselect. Set a bit in bit0-7 in this mask to 1 if there is a 36 - chip connected with the corresponding spi address set. For example if 37 - you have a chip with address 3 connected, you have to set bit3 to 1, 38 - which is 0x08. mcp23s08 chip variant only supports bits 0-3. It is not 39 - possible to mix mcp23s08 and mcp23s17 on the same chipselect. Set at 40 - least one bit to 1 for SPI chips. 41 - NOTE: Do not use the old mcp prefix any more. It is deprecated and will be 42 - removed. 43 - - spi-max-frequency = The maximum frequency this chip is able to handle 44 - 45 - Optional properties: 46 - - #interrupt-cells : Should be two. 47 - - first cell is the pin number 48 - - second cell is used to specify flags. 49 - - interrupt-controller: Marks the device node as a interrupt controller. 50 - - drive-open-drain: Sets the ODR flag in the IOCON register. This configures 51 - the IRQ output as open drain active low. 52 - - reset-gpios: Corresponds to the active-low RESET# pin for the chip 53 - 54 - Optional device specific properties: 55 - - microchip,irq-mirror: Sets the mirror flag in the IOCON register. Devices 56 - with two interrupt outputs (these are the devices ending with 17 and 57 - those that have 16 IOs) have two IO banks: IO 0-7 form bank 1 and 58 - IO 8-15 are bank 2. These chips have two different interrupt outputs: 59 - One for bank 1 and another for bank 2. If irq-mirror is set, both 60 - interrupts are generated regardless of the bank that an input change 61 - occurred on. If it is not set, the interrupt are only generated for the 62 - bank they belong to. 63 - On devices with only one interrupt output this property is useless. 64 - - microchip,irq-active-high: Sets the INTPOL flag in the IOCON register. This 65 - configures the IRQ output polarity as active high. 66 - 67 - Example I2C (with interrupt): 68 - gpiom1: gpio@20 { 69 - compatible = "microchip,mcp23017"; 70 - gpio-controller; 71 - #gpio-cells = <2>; 72 - reg = <0x20>; 73 - 74 - interrupt-parent = <&gpio1>; 75 - interrupts = <17 IRQ_TYPE_LEVEL_LOW>; 76 - interrupt-controller; 77 - #interrupt-cells=<2>; 78 - microchip,irq-mirror; 79 - }; 80 - 81 - Example SPI: 82 - gpiom1: gpio@0 { 83 - compatible = "microchip,mcp23s17"; 84 - gpio-controller; 85 - #gpio-cells = <2>; 86 - microchip,spi-present-mask = <0x01>; 87 - reg = <0>; 88 - spi-max-frequency = <1000000>; 89 - }; 90 - 91 - Pull-up configuration 92 - ===================== 93 - 94 - If pins are used as output, they can also be configured with pull-ups. This is 95 - done with pinctrl. 96 - 97 - Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt> 98 - for details of the common pinctrl bindings used by client devices, 99 - including the meaning of the phrase "pin configuration node". 100 - 101 - Optional Pinmux properties: 102 - -------------------------- 103 - Following properties are required if default setting of pins are required 104 - at boot. 105 - - pinctrl-names: A pinctrl state named per <pinctrl-bindings.txt>. 106 - - pinctrl[0...n]: Properties to contain the phandle for pinctrl states per 107 - <pinctrl-bindings.txt>. 108 - 109 - The pin configurations are defined as child of the pinctrl states node. Each 110 - sub-node have following properties: 111 - 112 - Required properties: 113 - ------------------ 114 - - pins: List of pins. Valid values of pins properties are: 115 - gpio0 ... gpio7 for the devices with 8 GPIO pins and 116 - gpio0 ... gpio15 for the devices with 16 GPIO pins. 117 - 118 - Optional properties: 119 - ------------------- 120 - The following optional property is defined in the pinmux DT binding document 121 - <pinctrl-bindings.txt>. Absence of this property will leave the configuration 122 - in its default state. 123 - bias-pull-up 124 - 125 - Example with pinctrl to pull-up output pins: 126 - gpio21: gpio@21 { 127 - compatible = "microchip,mcp23017"; 128 - gpio-controller; 129 - #gpio-cells = <0x2>; 130 - reg = <0x21>; 131 - interrupt-parent = <&socgpio>; 132 - interrupts = <0x17 0x8>; 133 - interrupt-names = "mcp23017@21 irq"; 134 - interrupt-controller; 135 - #interrupt-cells = <0x2>; 136 - microchip,irq-mirror; 137 - pinctrl-names = "default"; 138 - pinctrl-0 = <&i2cgpio0irq>, <&gpio21pullups>; 139 - reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>; 140 - 141 - gpio21pullups: pinmux { 142 - pins = "gpio0", "gpio1", "gpio2", "gpio3", 143 - "gpio4", "gpio5", "gpio6", "gpio7", 144 - "gpio8", "gpio9", "gpio10", "gpio11", 145 - "gpio12", "gpio13", "gpio14", "gpio15"; 146 - bias-pull-up; 147 - }; 148 - };
+4
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml
··· 33 33 - ti,omap5-padconf 34 34 - ti,j7200-padconf 35 35 - const: pinctrl-single 36 + - items: 37 + - enum: 38 + - marvell,pxa1908-padconf 39 + - const: pinconf-single 36 40 37 41 reg: 38 42 maxItems: 1
+114
Documentation/devicetree/bindings/pinctrl/qcom,ipq5424-tlmm.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,ipq5424-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm IPQ5424 TLMM pin controller 8 + 9 + maintainers: 10 + - Bjorn Andersson <andersson@kernel.org> 11 + 12 + description: 13 + Top Level Mode Multiplexer pin controller in Qualcomm IPQ5424 SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,ipq5424-tlmm 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + gpio-reserved-ranges: 29 + minItems: 1 30 + maxItems: 25 31 + 32 + gpio-line-names: 33 + maxItems: 50 34 + 35 + patternProperties: 36 + "-state$": 37 + oneOf: 38 + - $ref: "#/$defs/qcom-ipq5424-tlmm-state" 39 + - patternProperties: 40 + "-pins$": 41 + $ref: "#/$defs/qcom-ipq5424-tlmm-state" 42 + additionalProperties: false 43 + 44 + $defs: 45 + qcom-ipq5424-tlmm-state: 46 + type: object 47 + description: 48 + Pinctrl node's client devices use subnodes for desired pin configuration. 49 + Client device subnodes use below standard properties. 50 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 51 + unevaluatedProperties: false 52 + 53 + properties: 54 + pins: 55 + description: 56 + List of gpio pins affected by the properties specified in this 57 + subnode. 58 + items: 59 + pattern: "^gpio([0-9]|[1-4][0-9])$" 60 + minItems: 1 61 + maxItems: 50 62 + 63 + function: 64 + description: 65 + Specify the alternative function to be configured for the specified 66 + pins. 67 + 68 + enum: [ atest_char, atest_char0, atest_char1, atest_char2, atest_char3, 69 + atest_tic, audio_pri, audio_pri0, audio_pri1, audio_sec, 70 + audio_sec0, audio_sec1, core_voltage, cri_trng0, cri_trng1, 71 + cri_trng2, cri_trng3, cxc_clk, cxc_data, dbg_out, gcc_plltest, 72 + gcc_tlmm, gpio, i2c0_scl, i2c0_sda, i2c1_scl, i2c1_sda, i2c11, 73 + mac0, mac1, mdc_mst, mdc_slv, mdio_mst, mdio_slv, pcie0_clk, 74 + pcie0_wake, pcie1_clk, pcie1_wake, pcie2_clk, pcie2_wake, 75 + pcie3_clk, pcie3_wake, pll_test, prng_rosc0, prng_rosc1, 76 + prng_rosc2, prng_rosc3, PTA0_0, PTA0_1, PTA0_2, PTA10, PTA11, 77 + pwm0, pwm1, pwm2, qdss_cti_trig_in_a0, qdss_cti_trig_out_a0, 78 + qdss_cti_trig_in_a1, qdss_cti_trig_out_a1, qdss_cti_trig_in_b0, 79 + qdss_cti_trig_out_b0, qdss_cti_trig_in_b1, qdss_cti_trig_out_b1, 80 + qdss_traceclk_a, qdss_tracectl_a, qdss_tracedata_a, qspi_clk, 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 ] 84 + 85 + required: 86 + - pins 87 + 88 + required: 89 + - compatible 90 + - reg 91 + 92 + unevaluatedProperties: false 93 + 94 + examples: 95 + - | 96 + #include <dt-bindings/interrupt-controller/arm-gic.h> 97 + 98 + tlmm: pinctrl@1000000 { 99 + compatible = "qcom,ipq5424-tlmm"; 100 + reg = <0x01000000 0x300000>; 101 + gpio-controller; 102 + #gpio-cells = <0x2>; 103 + gpio-ranges = <&tlmm 0 0 50>; 104 + interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; 105 + interrupt-controller; 106 + #interrupt-cells = <0x2>; 107 + 108 + uart1_pins: uart1-state { 109 + pins = "gpio43", "gpio44"; 110 + function = "uart1"; 111 + drive-strength = <8>; 112 + bias-pull-up; 113 + }; 114 + };
+3
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
··· 48 48 - qcom,pm8916-gpio 49 49 - qcom,pm8917-gpio 50 50 - qcom,pm8921-gpio 51 + - qcom,pm8937-gpio 51 52 - qcom,pm8941-gpio 52 53 - qcom,pm8950-gpio 53 54 - qcom,pm8953-gpio ··· 185 184 - qcom,pm8226-gpio 186 185 - qcom,pm8350b-gpio 187 186 - qcom,pm8550ve-gpio 187 + - qcom,pm8937-gpio 188 188 - qcom,pm8950-gpio 189 189 - qcom,pm8953-gpio 190 190 - qcom,pmi632-gpio ··· 470 468 - gpio1-gpio6 for pm8550vs 471 469 - gpio1-gpio38 for pm8917 472 470 - gpio1-gpio44 for pm8921 471 + - gpio1-gpio8 for pm8937 (hole on gpio3, gpio4 and gpio6) 473 472 - gpio1-gpio36 for pm8941 474 473 - gpio1-gpio8 for pm8950 (hole on gpio3) 475 474 - gpio1-gpio8 for pm8953 (hole on gpio3 and gpio6)
+2
Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml
··· 22 22 - qcom,pm8226-mpp 23 23 - qcom,pm8841-mpp 24 24 - qcom,pm8916-mpp 25 + - qcom,pm8937-mpp 25 26 - qcom,pm8941-mpp 26 27 - qcom,pm8950-mpp 27 28 - qcom,pmi8950-mpp ··· 93 92 this subnode. Valid pins are 94 93 - mpp1-mpp4 for pm8841 95 94 - mpp1-mpp4 for pm8916 95 + - mpp1-mpp4 for pm8937 96 96 - mpp1-mpp8 for pm8941 97 97 - mpp1-mpp4 for pm8950 98 98 - mpp1-mpp4 for pmi8950
+124
Documentation/devicetree/bindings/pinctrl/qcom,qcs615-tlmm.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,qcs615-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. QCS615 TLMM block 8 + 9 + maintainers: 10 + - Lijuan Gao <quic_lijuang@quicinc.com> 11 + 12 + description: 13 + Top Level Mode Multiplexer pin controller in Qualcomm QCS615 SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,qcs615-tlmm 21 + 22 + reg: 23 + maxItems: 3 24 + 25 + reg-names: 26 + items: 27 + - const: east 28 + - const: west 29 + - const: south 30 + 31 + interrupts: 32 + maxItems: 1 33 + 34 + gpio-reserved-ranges: 35 + minItems: 1 36 + maxItems: 62 37 + 38 + gpio-line-names: 39 + maxItems: 123 40 + 41 + patternProperties: 42 + "-state$": 43 + oneOf: 44 + - $ref: "#/$defs/qcom-qcs615-tlmm-state" 45 + - type: object 46 + patternProperties: 47 + "-pins$": 48 + $ref: "#/$defs/qcom-qcs615-tlmm-state" 49 + additionalProperties: false 50 + 51 + $defs: 52 + qcom-qcs615-tlmm-state: 53 + type: object 54 + description: 55 + Pinctrl node's client devices use subnodes for desired pin configuration. 56 + Client device subnodes use below standard properties. 57 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 58 + unevaluatedProperties: false 59 + 60 + properties: 61 + pins: 62 + description: 63 + List of gpio pins affected by the properties specified in this 64 + subnode. 65 + items: 66 + oneOf: 67 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-2])$" 68 + - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk, 69 + sdc2_clk, sdc2_cmd, sdc2_data, ufs_reset ] 70 + minItems: 1 71 + maxItems: 36 72 + 73 + function: 74 + description: 75 + Specify the alternative function to be configured for the specified 76 + pins. 77 + enum: [ gpio, adsp_ext, agera_pll, aoss_cti, atest_char, atest_tsens, 78 + atest_usb, cam_mclk, cci_async, cci_i2c, cci_timer, copy_gp, 79 + copy_phase, cri_trng, dbg_out_clk, ddr_bist, ddr_pxi, dp_hot, 80 + edp_hot, edp_lcd, emac_gcc, emac_phy_intr, forced_usb, gcc_gp, 81 + gp_pdm, gps_tx, hs0_mi2s, hs1_mi2s, jitter_bist, ldo_en, 82 + ldo_update, m_voc, mclk1, mclk2, mdp_vsync, mdp_vsync0_out, 83 + mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, mdp_vsync4_out, 84 + mdp_vsync5_out, mi2s_1, mss_lte, nav_pps_in, nav_pps_out, 85 + pa_indicator_or, pcie_clk_req, pcie_ep_rst, phase_flag, pll_bist, 86 + pll_bypassnl, pll_reset_n, prng_rosc, qdss_cti, qdss_gpio, 87 + qlink_enable, qlink_request, qspi, qup0, qup1, rgmii, 88 + sd_write_protect, sp_cmu, ter_mi2s, tgu_ch, uim1, uim2, usb0_hs, 89 + usb1_hs, usb_phy_ps, vfr_1, vsense_trigger_mirnat, wlan, wsa_clk, 90 + wsa_data ] 91 + 92 + required: 93 + - pins 94 + 95 + required: 96 + - compatible 97 + - reg 98 + - reg-names 99 + 100 + unevaluatedProperties: false 101 + 102 + examples: 103 + - | 104 + #include <dt-bindings/interrupt-controller/arm-gic.h> 105 + 106 + tlmm: pinctrl@3000000 { 107 + compatible = "qcom,qcs615-tlmm"; 108 + reg = <0x03100000 0x300000>, 109 + <0x03500000 0x300000>, 110 + <0x03c00000 0x300000>; 111 + reg-names = "east", "west", "south"; 112 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 113 + gpio-ranges = <&tlmm 0 0 123>; 114 + gpio-controller; 115 + #gpio-cells = <2>; 116 + interrupt-controller; 117 + #interrupt-cells = <2>; 118 + 119 + qup3-uart2-state { 120 + pins ="gpio16", "gpio17"; 121 + function = "qup0"; 122 + }; 123 + }; 124 + ...
+118
Documentation/devicetree/bindings/pinctrl/qcom,qcs8300-tlmm.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,qcs8300-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. QCS8300 TLMM block 8 + 9 + maintainers: 10 + - Jingyi Wang <quic_jingyw@quicinc.com> 11 + 12 + description: | 13 + Top Level Mode Multiplexer pin controller in Qualcomm QCS8300 SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,qcs8300-tlmm 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + gpio-reserved-ranges: 29 + minItems: 1 30 + maxItems: 67 31 + 32 + gpio-line-names: 33 + maxItems: 133 34 + 35 + patternProperties: 36 + "-state$": 37 + oneOf: 38 + - $ref: "#/$defs/qcom-qcs8300-tlmm-state" 39 + - patternProperties: 40 + "-pins$": 41 + $ref: "#/$defs/qcom-qcs8300-tlmm-state" 42 + additionalProperties: false 43 + 44 + $defs: 45 + qcom-qcs8300-tlmm-state: 46 + type: object 47 + description: 48 + Pinctrl node's client devices use subnodes for desired pin configuration. 49 + Client device subnodes use below standard properties. 50 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 51 + unevaluatedProperties: false 52 + 53 + properties: 54 + pins: 55 + description: 56 + List of gpio pins affected by the properties specified in this 57 + subnode. 58 + items: 59 + oneOf: 60 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-2][0-9]|13[0-2])$" 61 + - enum: [ ufs_reset, sdc1_rclk, sdc1_clk, sdc1_cmd, sdc1_data ] 62 + minItems: 1 63 + maxItems: 36 64 + 65 + function: 66 + description: 67 + Specify the alternative function to be configured for the specified 68 + pins. 69 + 70 + enum: [ aoss_cti, atest_char, atest_usb2, audio_ref, cam_mclk, 71 + cci_async, cci_i2c_scl, cci_i2c_sda, cci_timer, cri_trng, 72 + dbg_out, ddr_bist, ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3, 73 + edp0_hot, edp0_lcd, edp1_lcd, egpio, emac0_mcg0, emac0_mcg1, 74 + emac0_mcg2, emac0_mcg3, emac0_mdc, emac0_mdio, emac0_ptp_aux, 75 + emac0_ptp_pps, gcc_gp1, gcc_gp2, gcc_gp3, gcc_gp4, gcc_gp5, 76 + gpio, hs0_mi2s, hs1_mi2s, hs2_mi2s, ibi_i3c, jitter_bist, 77 + mdp0_vsync0, mdp0_vsync1, mdp0_vsync3, mdp0_vsync6, mdp0_vsync7, 78 + mdp_vsync, mi2s1_data0, mi2s1_data1, mi2s1_sck, mi2s1_ws, 79 + mi2s2_data0, mi2s2_data1, mi2s2_sck, mi2s2_ws, mi2s_mclk0, 80 + mi2s_mclk1, pcie0_clkreq, pcie1_clkreq, phase_flag, pll_bist, 81 + pll_clk, prng_rosc0, prng_rosc1, prng_rosc2, prng_rosc3, 82 + qdss_cti, qdss_gpio, qup0_se0, qup0_se1, qup0_se2, qup0_se3, 83 + qup0_se4, qup0_se5, qup0_se6, qup0_se7, qup1_se0, qup1_se1, 84 + qup1_se2, qup1_se3, qup1_se4, qup1_se5, qup1_se6, qup1_se7, 85 + qup2_se0, sailss_emac0, sailss_ospi, sail_top, sgmii_phy, 86 + tb_trig, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, tsense_pwm1, 87 + tsense_pwm2, tsense_pwm3, tsense_pwm4, usb2phy_ac, 88 + vsense_trigger ] 89 + 90 + required: 91 + - pins 92 + 93 + required: 94 + - compatible 95 + - reg 96 + 97 + unevaluatedProperties: false 98 + 99 + examples: 100 + - | 101 + #include <dt-bindings/interrupt-controller/arm-gic.h> 102 + 103 + tlmm: pinctrl@f100000 { 104 + compatible = "qcom,qcs8300-tlmm"; 105 + reg = <0x0f100000 0x300000>; 106 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 107 + gpio-controller; 108 + #gpio-cells = <2>; 109 + gpio-ranges = <&tlmm 0 0 133>; 110 + interrupt-controller; 111 + #interrupt-cells = <2>; 112 + 113 + qup-uart7-state { 114 + pins = "gpio43", "gpio44"; 115 + function = "qup0_se7"; 116 + }; 117 + }; 118 + ...
+7 -1
Documentation/devicetree/bindings/pinctrl/qcom,sa8775p-tlmm.yaml
··· 17 17 18 18 properties: 19 19 compatible: 20 - const: qcom,sa8775p-tlmm 20 + oneOf: 21 + - items: 22 + - enum: 23 + - qcom,sa8255p-tlmm 24 + - const: qcom,sa8775p-tlmm 25 + - items: 26 + - const: qcom,sa8775p-tlmm 21 27 22 28 reg: 23 29 maxItems: 1
+138
Documentation/devicetree/bindings/pinctrl/qcom,sar2130p-tlmm.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,sar2130p-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. SAR2130P TLMM block 8 + 9 + maintainers: 10 + - Dmitry Baryshkov <dmitry.baryshkov@linaro.org> 11 + 12 + description: 13 + Top Level Mode Multiplexer pin controller in Qualcomm SAR2130P SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,sar2130p-tlmm 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + gpio-reserved-ranges: 29 + minItems: 1 30 + maxItems: 78 31 + 32 + gpio-line-names: 33 + maxItems: 156 34 + 35 + patternProperties: 36 + "-state$": 37 + oneOf: 38 + - $ref: "#/$defs/qcom-sar2130p-tlmm-state" 39 + - patternProperties: 40 + "-pins$": 41 + $ref: "#/$defs/qcom-sar2130p-tlmm-state" 42 + additionalProperties: false 43 + 44 + $defs: 45 + qcom-sar2130p-tlmm-state: 46 + type: object 47 + description: 48 + Pinctrl node's client devices use subnodes for desired pin configuration. 49 + Client device subnodes use below standard properties. 50 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 51 + unevaluatedProperties: false 52 + 53 + properties: 54 + pins: 55 + description: 56 + List of gpio pins affected by the properties specified in this 57 + subnode. 58 + items: 59 + oneOf: 60 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-5])$" 61 + - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk ] 62 + minItems: 1 63 + maxItems: 36 64 + 65 + function: 66 + description: 67 + Specify the alternative function to be configured for the specified 68 + pins. 69 + enum: [ aoss_cti, atest_char, atest_char0, atest_char1, atest_char2, 70 + atest_char3, atest_usb0, atest_usb00, atest_usb01, atest_usb02, 71 + atest_usb03, audio_ref, cam_mclk, cci_async, cci_i2c, 72 + cci_timer0, cci_timer1, cci_timer2, cci_timer3, cci_timer4, 73 + cri_trng, cri_trng0, cri_trng1, dbg_out, ddr_bist, ddr_pxi0, 74 + ddr_pxi1, ddr_pxi2, ddr_pxi3, dp0_hot, ext_mclk0, ext_mclk1, 75 + gcc_gp1, gcc_gp2, gcc_gp3, gpio, host2wlan_sol, i2s0_data0, 76 + i2s0_data1, i2s0_sck, i2s0_ws, ibi_i3c, jitter_bist, mdp_vsync, 77 + mdp_vsync0, mdp_vsync1, mdp_vsync2, mdp_vsync3, pcie0_clkreqn, 78 + pcie1_clkreqn, phase_flag0, phase_flag1, phase_flag10, 79 + phase_flag11, phase_flag12, phase_flag13, phase_flag14, 80 + phase_flag15, phase_flag16, phase_flag17, phase_flag18, 81 + phase_flag19, phase_flag2, phase_flag20, phase_flag21, 82 + phase_flag22, phase_flag23, phase_flag24, phase_flag25, 83 + phase_flag26, phase_flag27, phase_flag28, phase_flag29, 84 + phase_flag3, phase_flag30, phase_flag31, phase_flag4, 85 + phase_flag5, phase_flag6, phase_flag7, phase_flag8, 86 + phase_flag9, pll_bist, pll_clk, prng_rosc0, prng_rosc1, 87 + prng_rosc2, prng_rosc3, qdss_cti, qdss_gpio, qdss_gpio0, 88 + qdss_gpio1, qdss_gpio10, qdss_gpio11, qdss_gpio12, qdss_gpio13, 89 + qdss_gpio14, qdss_gpio15, qdss_gpio2, qdss_gpio3, qdss_gpio4, 90 + qdss_gpio5, qdss_gpio6, qdss_gpio7, qdss_gpio8, qdss_gpio9, 91 + qspi0, qspi1, qspi2, qspi3, qspi_clk, qspi_cs0, qspi_cs1, qup0, 92 + qup1, qup2, qup3, qup4, qup5, qup6, qup7, qup8, qup9, qup10, 93 + qup11, tb_trig, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, 94 + tmess_prng0, tmess_prng1, tmess_prng2, tmess_prng3, 95 + tsense_pwm1, tsense_pwm2, usb0_phy, vsense_trigger ] 96 + 97 + required: 98 + - pins 99 + 100 + required: 101 + - compatible 102 + - reg 103 + 104 + unevaluatedProperties: false 105 + 106 + examples: 107 + - | 108 + #include <dt-bindings/interrupt-controller/arm-gic.h> 109 + pinctrl@f100000 { 110 + compatible = "qcom,sar2130p-tlmm"; 111 + reg = <0x0f100000 0x300000>; 112 + gpio-controller; 113 + #gpio-cells = <2>; 114 + gpio-ranges = <&tlmm 0 0 156>; 115 + interrupt-controller; 116 + #interrupt-cells = <2>; 117 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 118 + 119 + gpio-wo-state { 120 + pins = "gpio1"; 121 + function = "gpio"; 122 + }; 123 + 124 + uart-w-state { 125 + rx-pins { 126 + pins = "gpio26"; 127 + function = "qup7"; 128 + bias-pull-up; 129 + }; 130 + 131 + tx-pins { 132 + pins = "gpio27"; 133 + function = "qup7"; 134 + bias-disable; 135 + }; 136 + }; 137 + }; 138 + ...
+5 -1
Documentation/devicetree/bindings/pinctrl/qcom,sm8650-lpass-lpi-pinctrl.yaml
··· 16 16 17 17 properties: 18 18 compatible: 19 - const: qcom,sm8650-lpass-lpi-pinctrl 19 + oneOf: 20 + - const: qcom,sm8650-lpass-lpi-pinctrl 21 + - items: 22 + - const: qcom,sm8750-lpass-lpi-pinctrl 23 + - const: qcom,sm8650-lpass-lpi-pinctrl 20 24 21 25 reg: 22 26 items:
+138
Documentation/devicetree/bindings/pinctrl/qcom,sm8750-tlmm.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,sm8750-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. SM8750 TLMM block 8 + 9 + maintainers: 10 + - Melody Olvera <quic_molvera@quicinc.com> 11 + 12 + description: 13 + Top Level Mode Multiplexer pin controller in Qualcomm SM8750 SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,sm8750-tlmm 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + gpio-reserved-ranges: 29 + minItems: 1 30 + maxItems: 108 31 + 32 + gpio-line-names: 33 + maxItems: 215 34 + 35 + patternProperties: 36 + "-state$": 37 + oneOf: 38 + - $ref: "#/$defs/qcom-sm8750-tlmm-state" 39 + - patternProperties: 40 + "-pins$": 41 + $ref: "#/$defs/qcom-sm8750-tlmm-state" 42 + additionalProperties: false 43 + 44 + $defs: 45 + qcom-sm8750-tlmm-state: 46 + type: object 47 + description: 48 + Pinctrl node's client devices use subnodes for desired pin configuration. 49 + Client device subnodes use below standard properties. 50 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 51 + unevaluatedProperties: false 52 + 53 + properties: 54 + pins: 55 + description: 56 + List of gpio pins affected by the properties specified in this 57 + subnode. 58 + items: 59 + oneOf: 60 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-4])$" 61 + - enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ] 62 + minItems: 1 63 + maxItems: 36 64 + 65 + function: 66 + description: 67 + Specify the alternative function to be configured for the specified 68 + pins. 69 + enum: [ gpio, aoss_cti, atest_char, atest_usb, audio_ext_mclk0, 70 + audio_ext_mclk1, audio_ref_clk, cam_aon_mclk2, cam_aon_mclk4, 71 + cam_mclk, cci_async_in, cci_i2c_scl, cci_i2c_sda, cci_timer, 72 + cmu_rng, coex_uart1_rx, coex_uart1_tx, coex_uart2_rx, 73 + coex_uart2_tx, dbg_out_clk, ddr_bist_complete, ddr_bist_fail, 74 + ddr_bist_start, ddr_bist_stop, ddr_pxi0, ddr_pxi1, ddr_pxi2, 75 + ddr_pxi3, dp_hot, egpio, gcc_gp1, gcc_gp2, gcc_gp3, gnss_adc0, 76 + gnss_adc1, i2chub0_se0, i2chub0_se1, i2chub0_se2, i2chub0_se3, 77 + i2chub0_se4, i2chub0_se5, i2chub0_se6, i2chub0_se7, i2chub0_se8, 78 + i2chub0_se9, i2s0_data0, i2s0_data1, i2s0_sck, i2s0_ws, 79 + i2s1_data0, i2s1_data1, i2s1_sck, i2s1_ws, ibi_i3c, jitter_bist, 80 + mdp_esync0_out, mdp_esync1_out, mdp_vsync, mdp_vsync0_out, 81 + mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, mdp_vsync5_out, 82 + mdp_vsync_e, nav_gpio0, nav_gpio1, nav_gpio2, nav_gpio3, 83 + pcie0_clk_req_n, phase_flag, pll_bist_sync, pll_clk_aux, 84 + prng_rosc0, prng_rosc1, prng_rosc2, prng_rosc3, qdss_cti, 85 + qlink_big_enable, qlink_big_request, qlink_little_enable, 86 + qlink_little_request, qlink_wmss, qspi0, qspi1, qspi2, qspi3, 87 + qspi_clk, qspi_cs, qup1_se0, qup1_se1, qup1_se2, qup1_se3, 88 + qup1_se4, qup1_se5, qup1_se6, qup1_se7, qup2_se0, qup2_se1, 89 + qup2_se2, qup2_se3, qup2_se4, qup2_se5, qup2_se6, qup2_se7, 90 + sd_write_protect, sdc40, sdc41, sdc42, sdc43, sdc4_clk, 91 + sdc4_cmd, tb_trig_sdc2, tb_trig_sdc4, tmess_prng0, tmess_prng1, 92 + tmess_prng2, tmess_prng3, tsense_pwm1, tsense_pwm2, tsense_pwm3, 93 + tsense_pwm4, uim0_clk, uim0_data, uim0_present, uim0_reset, 94 + uim1_clk, uim1_data, uim1_present, uim1_reset, usb1_hs, usb_phy, 95 + vfr_0, vfr_1, vsense_trigger_mirnat, wcn_sw, wcn_sw_ctrl ] 96 + 97 + required: 98 + - pins 99 + 100 + required: 101 + - compatible 102 + - reg 103 + 104 + unevaluatedProperties: false 105 + 106 + examples: 107 + - | 108 + #include <dt-bindings/interrupt-controller/arm-gic.h> 109 + tlmm: pinctrl@f100000 { 110 + compatible = "qcom,sm8750-tlmm"; 111 + reg = <0x0f100000 0x300000>; 112 + gpio-controller; 113 + #gpio-cells = <2>; 114 + gpio-ranges = <&tlmm 0 0 216>; 115 + interrupt-controller; 116 + #interrupt-cells = <2>; 117 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 118 + 119 + gpio-wo-state { 120 + pins = "gpio1"; 121 + function = "gpio"; 122 + }; 123 + 124 + uart-w-state { 125 + rx-pins { 126 + pins = "gpio60"; 127 + function = "qup1_se7"; 128 + bias-pull-up; 129 + }; 130 + 131 + tx-pins { 132 + pins = "gpio61"; 133 + function = "qup1_se7"; 134 + bias-disable; 135 + }; 136 + }; 137 + }; 138 + ...
+4
Documentation/devicetree/bindings/pinctrl/renesas,rzg2l-pinctrl.yaml
··· 119 119 bias-disable: true 120 120 bias-pull-down: true 121 121 bias-pull-up: true 122 + input-schmitt-enable: true 123 + input-schmitt-disable: true 124 + drive-open-drain: true 125 + drive-push-pull: true 122 126 renesas,output-impedance: 123 127 description: 124 128 Output impedance for pins on the RZ/V2H(P) SoC. The value provided by this
+15 -8
Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-wakeup-interrupt.yaml
··· 42 42 - samsung,exynos5433-wakeup-eint 43 43 - samsung,exynos7885-wakeup-eint 44 44 - samsung,exynos850-wakeup-eint 45 + - samsung,exynos8895-wakeup-eint 45 46 - const: samsung,exynos7-wakeup-eint 46 47 - items: 47 48 - enum: 48 49 - google,gs101-wakeup-eint 50 + - samsung,exynos9810-wakeup-eint 51 + - samsung,exynos990-wakeup-eint 49 52 - samsung,exynosautov9-wakeup-eint 50 53 - const: samsung,exynos850-wakeup-eint 51 54 - const: samsung,exynos7-wakeup-eint ··· 94 91 - if: 95 92 properties: 96 93 compatible: 97 - # Match without "contains", to skip newer variants which are still 98 - # compatible with samsung,exynos7-wakeup-eint 99 - enum: 100 - - samsung,s5pv210-wakeup-eint 101 - - samsung,exynos4210-wakeup-eint 102 - - samsung,exynos5433-wakeup-eint 103 - - samsung,exynos7-wakeup-eint 104 - - samsung,exynos7885-wakeup-eint 94 + oneOf: 95 + # Match without "contains", to skip newer variants which are still 96 + # compatible with samsung,exynos7-wakeup-eint 97 + - enum: 98 + - samsung,exynos4210-wakeup-eint 99 + - samsung,exynos7-wakeup-eint 100 + - samsung,s5pv210-wakeup-eint 101 + - contains: 102 + enum: 103 + - samsung,exynos5433-wakeup-eint 104 + - samsung,exynos7885-wakeup-eint 105 + - samsung,exynos8895-wakeup-eint 105 106 then: 106 107 properties: 107 108 interrupts:
+3
Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
··· 53 53 - samsung,exynos7-pinctrl 54 54 - samsung,exynos7885-pinctrl 55 55 - samsung,exynos850-pinctrl 56 + - samsung,exynos8895-pinctrl 57 + - samsung,exynos9810-pinctrl 58 + - samsung,exynos990-pinctrl 56 59 - samsung,exynosautov9-pinctrl 57 60 - samsung,exynosautov920-pinctrl 58 61 - tesla,fsd-pinctrl
+43
Documentation/devicetree/bindings/pinctrl/semtech,sx1501q.yaml
··· 26 26 reg: 27 27 maxItems: 1 28 28 29 + gpio-line-names: 30 + minItems: 5 31 + maxItems: 17 32 + 29 33 interrupts: 30 34 maxItems: 1 31 35 ··· 91 87 92 88 allOf: 93 89 - $ref: pinctrl.yaml# 90 + - if: 91 + properties: 92 + compatible: 93 + contains: 94 + enum: 95 + - semtech,sx1501q 96 + - semtech,sx1504q 97 + - semtech,sx1507q 98 + then: 99 + properties: 100 + gpio-line-names: 101 + minItems: 5 102 + maxItems: 5 103 + - if: 104 + properties: 105 + compatible: 106 + contains: 107 + enum: 108 + - semtech,sx1502q 109 + - semtech,sx1505q 110 + - semtech,sx1508q 111 + then: 112 + properties: 113 + gpio-line-names: 114 + minItems: 9 115 + maxItems: 9 116 + - if: 117 + properties: 118 + compatible: 119 + contains: 120 + enum: 121 + - semtech,sx1503q 122 + - semtech,sx1506q 123 + - semtech,sx1509q 124 + then: 125 + properties: 126 + gpio-line-names: 127 + minItems: 17 128 + maxItems: 17 94 129 - if: 95 130 not: 96 131 properties:
+1 -1
Documentation/devicetree/bindings/pinctrl/sophgo,cv1800-pinctrl.yaml
··· 58 58 pinmux: 59 59 description: | 60 60 The list of GPIOs and their mux settings that properties in the 61 - node apply to. This should be set using the GPIOMUX or GPIOMUX2 61 + node apply to. This should be set using the PINMUX or PINMUX2 62 62 macro. 63 63 64 64 bias-pull-up:
+124
Documentation/devicetree/bindings/pinctrl/spacemit,k1-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/spacemit,k1-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: SpacemiT K1 SoC Pin Controller 8 + 9 + maintainers: 10 + - Yixun Lan <dlan@gentoo.org> 11 + 12 + properties: 13 + compatible: 14 + const: spacemit,k1-pinctrl 15 + 16 + reg: 17 + items: 18 + - description: pinctrl io memory base 19 + 20 + patternProperties: 21 + '-cfg$': 22 + type: object 23 + additionalProperties: false 24 + 25 + description: 26 + A pinctrl node should contain at least one subnode representing the 27 + pinctrl groups available on the machine. 28 + 29 + patternProperties: 30 + '-pins$': 31 + type: object 32 + additionalProperties: false 33 + 34 + description: 35 + Each subnode will list the pins it needs, and how they should 36 + be configured, with regard to muxer configuration, bias pull, 37 + drive strength, input schmitt trigger, slew rate, power source. 38 + 39 + allOf: 40 + - $ref: pincfg-node.yaml# 41 + - $ref: pinmux-node.yaml# 42 + 43 + properties: 44 + pinmux: 45 + description: 46 + The list of GPIOs and their mux settings that properties in the 47 + node apply to. This should be set using the K1_PADCONF macro to 48 + construct the value. 49 + 50 + bias-disable: true 51 + 52 + bias-pull-down: true 53 + 54 + bias-pull-up: 55 + description: | 56 + typical value for selecting bias pull up or strong pull up. 57 + 0: normal bias pull up 58 + 1: strong bias pull up 59 + enum: [ 0, 1 ] 60 + 61 + drive-strength: 62 + description: | 63 + typical current when output high level. 64 + 1.8V output: 11, 21, 32, 42 (mA) 65 + 3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA) 66 + 67 + input-schmitt: 68 + description: | 69 + typical threshold for schmitt trigger. 70 + 0: buffer mode 71 + 1: trigger mode 72 + 2, 3: trigger mode 73 + $ref: /schemas/types.yaml#/definitions/uint32 74 + enum: [ 0, 1, 2, 3 ] 75 + 76 + power-source: 77 + description: external power supplies at 1.8v or 3.3v. 78 + enum: [ 1800, 3300 ] 79 + 80 + slew-rate: 81 + description: | 82 + slew rate for output buffer. 83 + 0: disable it 84 + 1: enable it (via bundled value from drive strength) 85 + 2: slow speed 0 86 + 3: slow speed 1 87 + 4: medium speed 88 + 5: fast speed 89 + enum: [ 0, 1, 2, 3, 4, 5 ] 90 + 91 + required: 92 + - pinmux 93 + 94 + required: 95 + - compatible 96 + - reg 97 + 98 + additionalProperties: false 99 + 100 + examples: 101 + - | 102 + #define K1_PADCONF(pin, func) (((pin) << 16) | (func)) 103 + 104 + soc { 105 + #address-cells = <2>; 106 + #size-cells = <2>; 107 + 108 + pinctrl@d401e000 { 109 + compatible = "spacemit,k1-pinctrl"; 110 + reg = <0x0 0xd401e000 0x0 0x400>; 111 + 112 + uart0_2_cfg: uart0-2-cfg { 113 + uart0-2-pins { 114 + pinmux = <K1_PADCONF(68, 2)>, 115 + <K1_PADCONF(69, 2)>; 116 + 117 + bias-pull-up = <0>; 118 + drive-strength = <32>; 119 + }; 120 + }; 121 + }; 122 + }; 123 + 124 + ...
+176
Documentation/devicetree/bindings/pinctrl/thead,th1520-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/thead,th1520-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: T-Head TH1520 SoC pin controller 8 + 9 + maintainers: 10 + - Emil Renner Berthing <emil.renner.berthing@canonical.com> 11 + 12 + description: | 13 + Pinmux and pinconf controller in the T-Head TH1520 RISC-V SoC. 14 + 15 + The TH1520 has 3 groups of pads each controlled from different memory ranges. 16 + Confusingly the memory ranges are named 17 + PADCTRL_AOSYS -> PAD Group 1 18 + PADCTRL1_APSYS -> PAD Group 2 19 + PADCTRL0_APSYS -> PAD Group 3 20 + 21 + Each pad can be muxed individually to up to 6 different functions. For most 22 + pads only a few of those 6 configurations are valid though, and a few pads in 23 + group 1 does not support muxing at all. 24 + 25 + Pinconf is fairly regular except for a few pads in group 1 that either can't 26 + be configured or has some special functions. The rest have configurable drive 27 + strength, input enable, schmitt trigger, slew rate, pull-up and pull-down in 28 + addition to a special strong pull up. 29 + 30 + Certain pads in group 1 can be muxed to AUDIO_PA0 - AUDIO_PA30 functions and 31 + are then meant to be used by the audio co-processor. Each such pad can then 32 + be further muxed to either audio GPIO or one of 4 functions such as UART, I2C 33 + and I2S. If the audio pad is muxed to one of the 4 functions then pinconf is 34 + also configured in different registers. All of this is done from a different 35 + AUDIO_IOCTRL memory range and is left to the audio co-processor for now. 36 + 37 + properties: 38 + compatible: 39 + enum: 40 + - thead,th1520-pinctrl 41 + reg: 42 + maxItems: 1 43 + 44 + clocks: 45 + maxItems: 1 46 + 47 + thead,pad-group: 48 + description: | 49 + Select the pad group that is associated with the pin controller instance. 50 + 51 + Base Address Name Group 52 + 0xFF_FFF4_A000 PADCTRL_AOSYS 1 53 + 0xFF_E7F3_C000 PADCTRL1_APSYS 2 54 + 0xFF_EC00_7000 PADCTRL0_APSYS 3 55 + 56 + $ref: /schemas/types.yaml#/definitions/uint32 57 + enum: [1, 2, 3] 58 + 59 + required: 60 + - compatible 61 + - reg 62 + - clocks 63 + 64 + patternProperties: 65 + '-[0-9]+$': 66 + type: object 67 + additionalProperties: false 68 + 69 + patternProperties: 70 + '-pins$': 71 + type: object 72 + allOf: 73 + - $ref: /schemas/pinctrl/pincfg-node.yaml# 74 + - $ref: /schemas/pinctrl/pinmux-node.yaml# 75 + 76 + additionalProperties: false 77 + 78 + description: 79 + A pinctrl node should contain at least one subnode describing one 80 + or more pads and their associated pinmux and pinconf settings. 81 + 82 + properties: 83 + pins: 84 + description: List of pads that properties in the node apply to. 85 + 86 + function: 87 + enum: [ gpio, pwm, uart, ir, i2c, spi, qspi, sdio, audio, i2s, 88 + gmac0, gmac1, dpu0, dpu1, isp, hdmi, bootsel, debug, 89 + clock, jtag, iso7816, efuse, reset ] 90 + description: The mux function to select for the given pins. 91 + 92 + bias-disable: true 93 + 94 + bias-pull-up: 95 + oneOf: 96 + - type: boolean 97 + description: Enable the regular 48kOhm pull-up 98 + - enum: [ 2100, 48000 ] 99 + description: Enable the strong 2.1kOhm pull-up or regular 48kOhm pull-up 100 + 101 + bias-pull-down: 102 + oneOf: 103 + - type: boolean 104 + - const: 44000 105 + description: Enable the regular 44kOhm pull-down 106 + 107 + drive-strength: 108 + enum: [ 1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 25 ] 109 + description: Drive strength in mA 110 + 111 + input-enable: true 112 + 113 + input-disable: true 114 + 115 + input-schmitt-enable: true 116 + 117 + input-schmitt-disable: true 118 + 119 + slew-rate: 120 + maximum: 1 121 + 122 + required: 123 + - pins 124 + 125 + additionalProperties: false 126 + 127 + examples: 128 + - | 129 + padctrl0_apsys: pinctrl@ec007000 { 130 + compatible = "thead,th1520-pinctrl"; 131 + reg = <0xec007000 0x1000>; 132 + clocks = <&apb_clk>; 133 + thead,pad-group = <3>; 134 + 135 + uart0_pins: uart0-0 { 136 + tx-pins { 137 + pins = "UART0_TXD"; 138 + function = "uart"; 139 + bias-disable; 140 + drive-strength = <3>; 141 + input-disable; 142 + input-schmitt-disable; 143 + slew-rate = <0>; 144 + }; 145 + 146 + rx-pins { 147 + pins = "UART0_RXD"; 148 + function = "uart"; 149 + bias-disable; 150 + drive-strength = <1>; 151 + input-enable; 152 + input-schmitt-enable; 153 + slew-rate = <0>; 154 + }; 155 + }; 156 + }; 157 + 158 + padctrl1_apsys: pinctrl@e7f3c000 { 159 + compatible = "thead,th1520-pinctrl"; 160 + reg = <0xe7f3c000 0x1000>; 161 + clocks = <&apb_clk>; 162 + thead,pad-group = <2>; 163 + 164 + i2c5_pins: i2c5-0 { 165 + i2c-pins { 166 + pins = "QSPI1_CSN0", /* I2C5_SCL */ 167 + "QSPI1_D0_MOSI"; /* I2C5_SDA */ 168 + function = "i2c"; 169 + bias-pull-up = <2100>; 170 + drive-strength = <7>; 171 + input-enable; 172 + input-schmitt-enable; 173 + slew-rate = <0>; 174 + }; 175 + }; 176 + };
+278
Documentation/devicetree/bindings/pinctrl/xlnx,versal-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/xlnx,versal-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Xilinx Versal Pinctrl 8 + 9 + maintainers: 10 + - Sai Krishna Potthuri <sai.krishna.potthuri@amd.com> 11 + 12 + description: | 13 + Please refer to pinctrl-bindings.txt in this directory for details of the 14 + common pinctrl bindings used by client devices, including the meaning of the 15 + phrase "pin configuration node". 16 + 17 + Versal's pin configuration nodes act as a container for an arbitrary number of 18 + subnodes. Each of these subnodes represents some desired configuration for a 19 + pin, a group, or a list of pins or groups. This configuration can include the 20 + mux function to select on those pin(s)/group(s), and various pin configuration 21 + parameters, such as pull-up, slew rate, etc. 22 + 23 + Each configuration node can consist of multiple nodes describing the pinmux and 24 + pinconf options. Those nodes can be pinmux nodes or pinconf nodes. 25 + 26 + properties: 27 + compatible: 28 + const: xlnx,versal-pinctrl 29 + 30 + patternProperties: 31 + '^(.*-)?(default|gpio-grp)$': 32 + type: object 33 + patternProperties: 34 + '^mux': 35 + type: object 36 + description: 37 + Pinctrl node's client devices use subnodes for pin muxes, 38 + which in turn use below standard properties. 39 + $ref: pinmux-node.yaml# 40 + 41 + properties: 42 + pins: 43 + description: 44 + List of pins to select (either this or "groups" must be specified) 45 + $ref: "#/$defs/pins/properties/pins" 46 + 47 + groups: 48 + description: 49 + List of groups to select (either this or "pins" must be 50 + specified), available groups for this subnode. 51 + anyOf: 52 + - pattern: '^((LPD|PMC)_)MIO([0-9]|[1-6][0-9]|7[0-7])$' 53 + - $ref: "#/$defs/pins/properties/groups" 54 + 55 + function: 56 + description: 57 + Specify the alternative function to be configured for the 58 + given pin groups. 59 + enum: [spi0, spi0_ss, spi1, spi1_ss, can0, can1, i2c0, i2c1, i2c_pmc, ttc0_clk, 60 + ttc0_wav, ttc1_clk, ttc1_wav, ttc2_clk, ttc2_wav, ttc3_clk, ttc3_wav, wwdt0, 61 + wwdt1, sysmon_i2c0, sysmon_i2c0_alrt, uart0, uart0_ctrl, uart1, uart1_ctrl, 62 + gpio0, gpio1, gpio2, emio0, gem0, gem1, trace0, trace0_clk, mdio0, mdio1, gem_tsu0, 63 + pcie0, smap0, usb0, sd0, sd0_pc, sd0_cd, sd0_wp, sd1, sd1_pc, sd1_wp, sd1_cd, 64 + ospi0, ospi0_ss, qspi0, qspi0_fbclk, qspi0_ss, test_clk, test_scan, tamper_trigger] 65 + 66 + required: 67 + - function 68 + 69 + oneOf: 70 + - required: [ groups ] 71 + - required: [ pins ] 72 + 73 + additionalProperties: false 74 + 75 + '^conf': 76 + type: object 77 + description: 78 + Pinctrl node's client devices use subnodes for pin configurations, 79 + which in turn use the standard properties below. 80 + allOf: 81 + - $ref: pincfg-node.yaml# 82 + - $ref: "#/$defs/pins" 83 + 84 + additionalProperties: false 85 + 86 + allOf: 87 + - $ref: pinctrl.yaml# 88 + 89 + required: 90 + - compatible 91 + 92 + additionalProperties: false 93 + 94 + $defs: 95 + pins: 96 + properties: 97 + groups: 98 + description: 99 + List of pin groups to select in this subnode. 100 + items: 101 + enum: [spi0_0_grp, spi0_1_grp, spi0_2_grp, spi0_3_grp, spi0_4_grp, spi0_5_grp, 102 + spi0_ss_0_grp, spi0_ss_1_grp, spi0_ss_2_grp, spi0_ss_3_grp, spi0_ss_4_grp, 103 + spi0_ss_5_grp, spi0_ss_6_grp, spi0_ss_7_grp, spi0_ss_8_grp, spi0_ss_9_grp, 104 + spi0_ss_10_grp, spi0_ss_11_grp, spi0_ss_12_grp, spi0_ss_13_grp, spi0_ss_14_grp, 105 + spi0_ss_15_grp, spi0_ss_16_grp, spi0_ss_17_grp, spi1_0_grp, spi1_1_grp, 106 + spi1_2_grp, spi1_3_grp, spi1_4_grp, spi1_5_grp, spi1_ss_0_grp, spi1_ss_1_grp, 107 + spi1_ss_2_grp, spi1_ss_3_grp, spi1_ss_4_grp, spi1_ss_5_grp, spi1_ss_6_grp, 108 + spi1_ss_7_grp, spi1_ss_8_grp, spi1_ss_9_grp, spi1_ss_10_grp, spi1_ss_11_grp, 109 + spi1_ss_12_grp, spi1_ss_13_grp, spi1_ss_14_grp, spi1_ss_15_grp, spi1_ss_16_grp 110 + spi1_ss_17_grp, can0_0_grp, can0_1_grp, can0_2_grp, can0_3_grp, can0_4_grp, 111 + can0_5_grp, can0_6_grp, can0_7_grp, can0_8_grp, can0_9_grp, can0_10_grp, 112 + can0_11_grp, can0_12_grp, can0_13_grp, can0_14_grp, can0_15_grp, can0_16_grp, 113 + can0_17_grp, can1_0_grp, can1_1_grp, can1_2_grp, can1_3_grp, can1_4_grp, 114 + can1_5_grp, can1_6_grp, can1_7_grp, can1_8_grp, can1_9_grp, can1_10_grp, 115 + can1_11_grp, can1_12_grp, can1_13_grp, can1_14_grp, can1_15_grp, can1_16_grp, 116 + can1_17_grp, can1_18_grp, i2c0_0_grp, i2c0_1_grp, i2c0_2_grp, i2c0_3_grp, 117 + i2c0_4_grp, i2c0_5_grp, i2c0_6_grp, i2c0_7_grp, i2c0_8_grp, i2c0_9_grp, 118 + i2c0_10_grp, i2c0_11_grp, i2c0_12_grp, i2c0_13_grp, i2c0_14_grp, i2c0_15_grp, 119 + i2c0_16_grp, i2c0_17_grp, i2c1_0_grp, i2c1_1_grp, i2c1_2_grp, i2c1_3_grp, 120 + i2c1_4_grp, i2c1_5_grp, i2c1_6_grp, i2c1_7_grp, i2c1_8_grp, i2c1_9_grp, 121 + i2c1_10_grp, i2c1_11_grp, i2c1_12_grp, i2c1_13_grp, i2c1_14_grp, i2c1_15_grp, 122 + i2c1_16_grp, i2c1_17_grp, i2c1_18_grp, i2c_pmc_0_grp, i2c_pmc_1_grp, 123 + i2c_pmc_2_grp, i2c_pmc_3_grp, i2c_pmc_4_grp, i2c_pmc_5_grp, i2c_pmc_6_grp, 124 + i2c_pmc_7_grp, i2c_pmc_8_grp, i2c_pmc_9_grp, i2c_pmc_10_grp, i2c_pmc_11_grp, 125 + i2c_pmc_12_grp, ttc0_clk_0_grp, ttc0_clk_1_grp, ttc0_clk_2_grp, ttc0_clk_3_grp, 126 + ttc0_clk_4_grp, ttc0_clk_5_grp, ttc0_clk_6_grp, ttc0_clk_7_grp, ttc0_clk_8_grp, 127 + ttc0_wav_0_grp, ttc0_wav_1_grp, ttc0_wav_2_grp, ttc0_wav_3_grp, ttc0_wav_4_grp, 128 + ttc0_wav_5_grp, ttc0_wav_6_grp, ttc0_wav_7_grp, ttc0_wav_8_grp, ttc1_clk_0_grp, 129 + ttc1_clk_1_grp, ttc1_clk_2_grp, ttc1_clk_3_grp, ttc1_clk_4_grp, ttc1_clk_5_grp, 130 + ttc1_clk_6_grp, ttc1_clk_7_grp, ttc1_clk_8_grp, ttc1_wav_0_grp, ttc1_wav_1_grp, 131 + ttc1_wav_2_grp, ttc1_wav_3_grp, ttc1_wav_4_grp, ttc1_wav_5_grp, ttc1_wav_6_grp, 132 + ttc1_wav_7_grp, ttc1_wav_8_grp, ttc2_clk_0_grp, ttc2_clk_1_grp, ttc2_clk_2_grp, 133 + ttc2_clk_3_grp, ttc2_clk_4_grp, ttc2_clk_5_grp, ttc2_clk_6_grp, ttc2_clk_7_grp, 134 + ttc2_clk_8_grp, ttc2_wav_0_grp, ttc2_wav_1_grp, ttc2_wav_2_grp, ttc2_wav_3_grp, 135 + ttc2_wav_4_grp, ttc2_wav_5_grp, ttc2_wav_6_grp, ttc2_wav_7_grp, ttc2_wav_8_grp, 136 + ttc3_clk_0_grp, ttc3_clk_1_grp, ttc3_clk_2_grp, ttc3_clk_3_grp, ttc3_clk_4_grp, 137 + ttc3_clk_5_grp, ttc3_clk_6_grp, ttc3_clk_7_grp, ttc3_clk_8_grp, ttc3_wav_0_grp, 138 + ttc3_wav_1_grp, ttc3_wav_2_grp, ttc3_wav_3_grp, ttc3_wav_4_grp, ttc3_wav_5_grp, 139 + ttc3_wav_6_grp, ttc3_wav_7_grp, ttc3_wav_8_grp, wwdt0_0_grp, wwdt0_1_grp, 140 + wwdt0_2_grp, wwdt0_3_grp, wwdt0_4_grp, wwdt0_5_grp, wwdt1_0_grp, wwdt1_1_grp, 141 + wwdt1_2_grp, wwdt1_3_grp, wwdt1_4_grp, wwdt1_5_grp, sysmon_i2c0_0_grp, 142 + sysmon_i2c0_1_grp, sysmon_i2c0_2_grp, sysmon_i2c0_3_grp, sysmon_i2c0_4_grp, 143 + sysmon_i2c0_5_grp, sysmon_i2c0_6_grp, sysmon_i2c0_7_grp, sysmon_i2c0_8_grp, 144 + sysmon_i2c0_9_grp, sysmon_i2c0_10_grp, sysmon_i2c0_11_grp, sysmon_i2c0_12_grp, 145 + sysmon_i2c0_13_grp, sysmon_i2c0_14_grp, sysmon_i2c0_15_grp, 146 + sysmon_i2c0_16_grp, sysmon_i2c0_17_grp, sysmon_i2c0_alrt_0_grp, 147 + sysmon_i2c0_alrt_1_grp, sysmon_i2c0_alrt_2_grp, sysmon_i2c0_alrt_3_grp, 148 + sysmon_i2c0_alrt_4_grp, sysmon_i2c0_alrt_5_grp, sysmon_i2c0_alrt_6_grp, 149 + sysmon_i2c0_alrt_7_grp, sysmon_i2c0_alrt_8_grp, sysmon_i2c0_alrt_9_grp, 150 + sysmon_i2c0_alrt_10_grp, sysmon_i2c0_alrt_11_grp, sysmon_i2c0_alrt_12_grp, 151 + sysmon_i2c0_alrt_13_grp, sysmon_i2c0_alrt_14_grp, sysmon_i2c0_alrt_15_grp, 152 + sysmon_i2c0_alrt_16_grp, sysmon_i2c0_alrt_17_grp, uart0_0_grp, uart0_1_grp, 153 + uart0_2_grp, uart0_3_grp, uart0_4_grp, uart0_5_grp, uart0_6_grp, uart0_7_grp, 154 + uart0_8_grp, uart0_ctrl_0_grp, uart0_ctrl_1_grp, uart0_ctrl_2_grp, 155 + uart0_ctrl_3_grp, uart0_ctrl_4_grp, uart0_ctrl_5_grp, uart0_ctrl_6_grp, 156 + uart0_ctrl_7_grp, uart0_ctrl_8_grp, uart1_0_grp, uart1_1_grp, uart1_2_grp, 157 + uart1_3_grp, uart1_4_grp, uart1_5_grp, uart1_6_grp, uart1_7_grp, uart1_8_grp, 158 + uart1_ctrl_0_grp, uart1_ctrl_1_grp, uart1_ctrl_2_grp, uart1_ctrl_3_grp, 159 + uart1_ctrl_4_grp, uart1_ctrl_5_grp, uart1_ctrl_6_grp, uart1_ctrl_7_grp, 160 + uart1_ctrl_8_grp, gpio0_0_grp, gpio0_1_grp, gpio0_2_grp, gpio0_3_grp, 161 + gpio0_4_grp, gpio0_5_grp, gpio0_6_grp, gpio0_7_grp, gpio0_8_grp, gpio0_9_grp, 162 + gpio0_10_grp, gpio0_11_grp, gpio0_12_grp, gpio0_13_grp, gpio0_14_grp, 163 + gpio0_15_grp, gpio0_16_grp, gpio0_17_grp, gpio0_18_grp, gpio0_19_grp, 164 + gpio0_20_grp, gpio0_21_grp, gpio0_22_grp, gpio0_23_grp, gpio0_24_grp, 165 + gpio0_25_grp, gpio1_0_grp, gpio1_1_grp, gpio1_2_grp, gpio1_3_grp, gpio1_4_grp, 166 + gpio1_5_grp, gpio1_6_grp, gpio1_7_grp, gpio1_8_grp, gpio1_9_grp, 167 + gpio1_10_grp, gpio1_11_grp, gpio1_12_grp, gpio1_13_grp, gpio1_14_grp, 168 + gpio1_15_grp, gpio1_16_grp, gpio1_17_grp, gpio1_18_grp, gpio1_19_grp, 169 + gpio1_20_grp, gpio1_21_grp, gpio1_22_grp, gpio1_23_grp, gpio1_24_grp, 170 + gpio1_25_grp, gpio2_0_grp, gpio2_1_grp, gpio2_2_grp, gpio2_3_grp, gpio2_4_grp, 171 + gpio2_5_grp, gpio2_6_grp, gpio2_7_grp, gpio2_8_grp, gpio2_9_grp, gpio2_10_grp, 172 + gpio2_11_grp, gpio2_12_grp, gpio2_13_grp, gpio2_14_grp, gpio2_15_grp, 173 + gpio2_16_grp, gpio2_17_grp, gpio2_18_grp, gpio2_19_grp, gpio2_20_grp, 174 + gpio2_21_grp, gpio2_22_grp, gpio2_23_grp, gpio2_24_grp, gpio2_25_grp, 175 + emio0_0_grp, emio0_1_grp, emio0_2_grp, emio0_3_grp, emio0_4_grp, emio0_5_grp, 176 + emio0_6_grp, emio0_7_grp, emio0_8_grp, emio0_9_grp, emio0_10_grp, 177 + emio0_11_grp, emio0_12_grp, emio0_13_grp, emio0_14_grp, emio0_15_grp, 178 + emio0_16_grp, emio0_17_grp, emio0_18_grp, emio0_19_grp, emio0_20_grp, 179 + emio0_21_grp, emio0_22_grp, emio0_23_grp, emio0_24_grp, emio0_25_grp, 180 + emio0_26_grp, emio0_27_grp, emio0_28_grp, emio0_29_grp, emio0_30_grp, 181 + emio0_31_grp, emio0_32_grp, emio0_33_grp, emio0_34_grp, emio0_35_grp, 182 + emio0_36_grp, emio0_37_grp, emio0_38_grp, emio0_39_grp, emio0_40_grp, 183 + emio0_41_grp, emio0_42_grp, emio0_43_grp, emio0_44_grp, emio0_45_grp, 184 + emio0_46_grp, emio0_47_grp, emio0_48_grp, emio0_49_grp, emio0_50_grp, 185 + emio0_51_grp, emio0_52_grp, emio0_53_grp, emio0_54_grp, emio0_55_grp, 186 + emio0_56_grp, emio0_57_grp, emio0_58_grp, emio0_59_grp, emio0_60_grp, 187 + emio0_61_grp, emio0_62_grp, emio0_63_grp, emio0_64_grp, emio0_65_grp, 188 + emio0_66_grp, emio0_67_grp, emio0_68_grp, emio0_69_grp, emio0_70_grp, 189 + emio0_71_grp, emio0_72_grp, emio0_73_grp, emio0_74_grp, emio0_75_grp, 190 + emio0_76_grp, emio0_77_grp, gem0_0_grp, gem0_1_grp, gem1_0_grp, gem1_1_grp, 191 + trace0_0_grp, trace0_1_grp, trace0_2_grp, trace0_clk_0_grp, trace0_clk_1_grp, 192 + trace0_clk_2_grp, mdio0_0_grp, mdio0_1_grp, mdio1_0_grp, mdio1_1_grp, 193 + gem_tsu0_0_grp, gem_tsu0_1_grp, gem_tsu0_2_grp, gem_tsu0_3_grp, pcie0_0_grp, 194 + pcie0_1_grp, pcie0_2_grp, smap0_0_grp, usb0_0_grp, sd0_0_grp, sd0_1_grp, 195 + sd0_2_grp, sd0_3_grp, sd0_4_grp, sd0_5_grp, sd0_6_grp, sd0_7_grp, sd0_8_grp, 196 + sd0_9_grp, sd0_10_grp, sd0_11_grp, sd0_12_grp, sd0_13_grp, sd0_14_grp, 197 + sd0_15_grp, sd0_16_grp, sd0_17_grp, sd0_18_grp, sd0_19_grp, sd0_20_grp, 198 + sd0_21_grp, sd0_pc_0_grp, sd0_pc_1_grp, sd0_cd_0_grp, sd0_cd_1_grp, 199 + sd0_wp_0_grp, sd0_wp_1_grp, sd1_0_grp, sd1_1_grp, sd1_2_grp, sd1_3_grp, 200 + sd1_4_grp, sd1_5_grp, sd1_6_grp, sd1_7_grp, sd1_8_grp, sd1_9_grp, sd1_10_grp, 201 + sd1_11_grp, sd1_12_grp, sd1_13_grp, sd1_14_grp, sd1_15_grp, sd1_16_grp, 202 + sd1_17_grp, sd1_18_grp, sd1_19_grp, sd1_20_grp, sd1_21_grp, sd1_pc_0_grp, 203 + sd1_pc_1_grp, sd1_cd_0_grp, sd1_cd_1_grp, sd1_wp_0_grp, sd1_wp_1_grp, 204 + ospi0_0_grp, ospi0_ss_0_grp, qspi0_0_grp, qspi0_fbclk_0_grp, qspi0_ss_0_grp, 205 + test_clk_0_grp, test_scan_0_grp, tamper_trigger_0_grp] 206 + minItems: 1 207 + maxItems: 78 208 + 209 + pins: 210 + description: 211 + List of pin names to select in this subnode. 212 + items: 213 + pattern: '^((LPD|PMC)_)MIO([0-9]|[1-6][0-9]|7[0-7])$' 214 + minItems: 1 215 + maxItems: 78 216 + 217 + bias-pull-up: true 218 + bias-pull-down: true 219 + bias-disable: true 220 + input-schmitt-enable: true 221 + input-schmitt-disable: true 222 + bias-high-impedance: true 223 + low-power-enable: true 224 + low-power-disable: true 225 + 226 + slew-rate: 227 + enum: [0, 1] 228 + 229 + output-enable: 230 + description: 231 + This will internally disable the tri-state for MIO pins. 232 + 233 + drive-strength: 234 + description: 235 + Selects the drive strength for MIO pins, in mA. 236 + enum: [2, 4, 8, 12] 237 + 238 + power-source: 239 + enum: [0, 1] 240 + 241 + oneOf: 242 + - required: [ groups ] 243 + - required: [ pins ] 244 + 245 + additionalProperties: false 246 + 247 + examples: 248 + - | 249 + #include <dt-bindings/pinctrl/pinctrl-zynqmp.h> 250 + pinctrl { 251 + compatible = "xlnx,versal-pinctrl"; 252 + 253 + uart0-default { 254 + mux { 255 + groups = "uart0_4_grp", "uart0_5_grp"; 256 + function = "uart0"; 257 + }; 258 + 259 + conf { 260 + groups = "uart0_4_grp"; 261 + slew-rate = <SLEW_RATE_SLOW>; 262 + power-source = <IO_STANDARD_LVCMOS18>; 263 + }; 264 + 265 + conf-rx { 266 + pins = "PMC_MIO42"; 267 + bias-pull-up; 268 + }; 269 + 270 + conf-tx { 271 + pins = "PMC_MIO43"; 272 + bias-disable; 273 + input-schmitt-disable; 274 + }; 275 + }; 276 + }; 277 + 278 + ...
+34
Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pwm/airoha,en7581-pwm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Airoha EN7581 PWM Controller 8 + 9 + maintainers: 10 + - Lorenzo Bianconi <lorenzo@kernel.org> 11 + 12 + allOf: 13 + - $ref: pwm.yaml# 14 + 15 + properties: 16 + compatible: 17 + const: airoha,en7581-pwm 18 + 19 + "#pwm-cells": 20 + const: 3 21 + 22 + required: 23 + - compatible 24 + - "#pwm-cells" 25 + 26 + additionalProperties: false 27 + 28 + examples: 29 + - | 30 + pwm { 31 + compatible = "airoha,en7581-pwm"; 32 + 33 + #pwm-cells = <3>; 34 + };
+9
MAINTAINERS
··· 18315 18315 F: include/dt-bindings/pinctrl/ 18316 18316 F: include/linux/pinctrl/ 18317 18317 18318 + PIN CONTROLLER - AIROHA 18319 + M: Lorenzo Bianconi <lorenzo@kernel.org> 18320 + L: linux-mediatek@lists.infradead.org (moderated for non-subscribers) 18321 + S: Maintained 18322 + F: Documentation/devicetree/bindings/pinctrl/airoha,en7581-pinctrl.yaml 18323 + F: drivers/pinctrl/mediatek/pinctrl-airoha.c 18324 + 18318 18325 PIN CONTROLLER - AMD 18319 18326 M: Basavaraj Natikar <Basavaraj.Natikar@amd.com> 18320 18327 M: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> ··· 20080 20073 T: git https://github.com/pdp7/linux.git 20081 20074 F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml 20082 20075 F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml 20076 + F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml 20083 20077 F: arch/riscv/boot/dts/thead/ 20084 20078 F: drivers/clk/thead/clk-th1520-ap.c 20085 20079 F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c 20080 + F: drivers/pinctrl/pinctrl-th1520.c 20086 20081 F: include/dt-bindings/clock/thead,th1520-clk-ap.h 20087 20082 20088 20083 RNBD BLOCK DRIVERS
-16
arch/arm/mach-imx/Kconfig
··· 6 6 select CLKSRC_IMX_GPT 7 7 select GENERIC_IRQ_CHIP 8 8 select GPIOLIB 9 - select PINCTRL 10 9 select PM_OPP if PM 11 10 select SOC_BUS 12 11 select SRAM ··· 48 49 config SOC_IMX35 49 50 bool "i.MX35 support" 50 51 select MXC_AVIC 51 - select PINCTRL_IMX35 52 52 help 53 53 This enables support for Freescale i.MX35 processor 54 54 ··· 59 61 bool "i.MX1 support" 60 62 select CPU_ARM920T 61 63 select MXC_AVIC 62 - select PINCTRL_IMX1 63 64 help 64 65 This enables support for Freescale i.MX1 processor 65 66 ··· 70 73 bool "i.MX25 support" 71 74 select CPU_ARM926T 72 75 select MXC_AVIC 73 - select PINCTRL_IMX25 74 76 help 75 77 This enables support for Freescale i.MX25 processor 76 78 ··· 77 81 bool "i.MX27 support" 78 82 select CPU_ARM926T 79 83 select MXC_AVIC 80 - select PINCTRL_IMX27 81 84 help 82 85 This enables support for Freescale i.MX27 processor 83 86 ··· 93 98 94 99 config SOC_IMX50 95 100 bool "i.MX50 support" 96 - select PINCTRL_IMX50 97 101 select SOC_IMX5 98 102 99 103 help ··· 100 106 101 107 config SOC_IMX51 102 108 bool "i.MX51 support" 103 - select PINCTRL_IMX51 104 109 select SOC_IMX5 105 110 help 106 111 This enables support for Freescale i.MX51 processor 107 112 108 113 config SOC_IMX53 109 114 bool "i.MX53 support" 110 - select PINCTRL_IMX53 111 115 select SOC_IMX5 112 116 113 117 help ··· 129 137 select ARM_ERRATA_775420 130 138 select HAVE_ARM_SCU if SMP 131 139 select HAVE_ARM_TWD 132 - select PINCTRL_IMX6Q 133 140 select SOC_IMX6 134 141 135 142 help ··· 138 147 bool "i.MX6 SoloLite support" 139 148 select ARM_ERRATA_754322 140 149 select ARM_ERRATA_775420 141 - select PINCTRL_IMX6SL 142 150 select SOC_IMX6 143 151 144 152 help ··· 147 157 bool "i.MX6 SoloLiteLite support" 148 158 select ARM_ERRATA_754322 149 159 select ARM_ERRATA_775420 150 - select PINCTRL_IMX6SLL 151 160 select SOC_IMX6 152 161 153 162 help ··· 156 167 bool "i.MX6 SoloX support" 157 168 select ARM_ERRATA_754322 158 169 select ARM_ERRATA_775420 159 - select PINCTRL_IMX6SX 160 170 select SOC_IMX6 161 171 162 172 help ··· 163 175 164 176 config SOC_IMX6UL 165 177 bool "i.MX6 UltraLite support" 166 - select PINCTRL_IMX6UL 167 178 select SOC_IMX6 168 179 select ARM_ERRATA_814220 169 180 ··· 198 211 199 212 config SOC_IMX7D 200 213 bool "i.MX7 Dual support" 201 - select PINCTRL_IMX7D 202 214 select SOC_IMX7D_CA7 if ARCH_MULTI_V7 203 215 select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M 204 216 select ARM_ERRATA_814220 if ARCH_MULTI_V7 ··· 207 221 config SOC_IMX7ULP 208 222 bool "i.MX7ULP support" 209 223 select CLKSRC_IMX_TPM 210 - select PINCTRL_IMX7ULP 211 224 select SOC_IMX7D_CA7 if ARCH_MULTI_V7 212 225 select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M 213 226 help ··· 222 237 config SOC_VF610 223 238 bool "Vybrid Family VF610 support" 224 239 select ARM_GIC if ARCH_MULTI_V7 225 - select PINCTRL_VF610 226 240 227 241 help 228 242 This enables support for Freescale Vybrid VF610 processor.
+26
drivers/pinctrl/Kconfig
··· 268 268 Add support for the Canaan Kendryte K210 RISC-V SOC Field 269 269 Programmable IO Array (FPIOA) controller. 270 270 271 + config PINCTRL_K230 272 + bool "Pinctrl driver for the Canaan Kendryte K230 SoC" 273 + depends on OF 274 + depends on ARCH_CANAAN || COMPILE_TEST 275 + select GENERIC_PINCTRL_GROUPS 276 + select GENERIC_PINMUX_FUNCTIONS 277 + select GENERIC_PINCONF 278 + select REGMAP_MMIO 279 + help 280 + Add support for the Canaan Kendryte K230 RISC-V SOC pin controller. 281 + 271 282 config PINCTRL_KEEMBAY 272 283 tristate "Pinctrl driver for Intel Keem Bay SoC" 273 284 depends on ARCH_KEEMBAY || (ARM64 && COMPILE_TEST) ··· 562 551 This driver can also be built as a module 563 552 called tps6594-pinctrl. 564 553 554 + config PINCTRL_TH1520 555 + tristate "Pinctrl driver for the T-Head TH1520 SoC" 556 + depends on ARCH_THEAD || COMPILE_TEST 557 + depends on OF 558 + select GENERIC_PINMUX_FUNCTIONS 559 + select GENERIC_PINCONF 560 + select PINMUX 561 + help 562 + This is the driver for the pin controller blocks on the 563 + T-Head TH1520 SoC. 564 + 565 + This driver is needed for RISC-V development boards like 566 + the BeagleV Ahead and the LicheePi 4A. 567 + 565 568 config PINCTRL_ZYNQ 566 569 bool "Pinctrl driver for Xilinx Zynq" 567 570 depends on ARCH_ZYNQ ··· 631 606 source "drivers/pinctrl/renesas/Kconfig" 632 607 source "drivers/pinctrl/samsung/Kconfig" 633 608 source "drivers/pinctrl/sophgo/Kconfig" 609 + source "drivers/pinctrl/spacemit/Kconfig" 634 610 source "drivers/pinctrl/spear/Kconfig" 635 611 source "drivers/pinctrl/sprd/Kconfig" 636 612 source "drivers/pinctrl/starfive/Kconfig"
+3
drivers/pinctrl/Makefile
··· 28 28 obj-$(CONFIG_PINCTRL_GEMINI) += pinctrl-gemini.o 29 29 obj-$(CONFIG_PINCTRL_INGENIC) += pinctrl-ingenic.o 30 30 obj-$(CONFIG_PINCTRL_K210) += pinctrl-k210.o 31 + obj-$(CONFIG_PINCTRL_K230) += pinctrl-k230.o 31 32 obj-$(CONFIG_PINCTRL_KEEMBAY) += pinctrl-keembay.o 32 33 obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o 33 34 obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o ··· 55 54 obj-$(CONFIG_PINCTRL_SX150X) += pinctrl-sx150x.o 56 55 obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o 57 56 obj-$(CONFIG_PINCTRL_TPS6594) += pinctrl-tps6594.o 57 + obj-$(CONFIG_PINCTRL_TH1520) += pinctrl-th1520.o 58 58 obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o 59 59 obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o 60 60 ··· 78 76 obj-$(CONFIG_PINCTRL_RENESAS) += renesas/ 79 77 obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/ 80 78 obj-y += sophgo/ 79 + obj-y += spacemit/ 81 80 obj-$(CONFIG_PINCTRL_SPEAR) += spear/ 82 81 obj-y += sprd/ 83 82 obj-$(CONFIG_SOC_STARFIVE) += starfive/
+4
drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
··· 2607 2607 { PIN_CONFIG_DRIVE_STRENGTH, { AB8, AB8 }, SCU454, GENMASK(27, 26)}, 2608 2608 /* LAD0 */ 2609 2609 { PIN_CONFIG_DRIVE_STRENGTH, { AB7, AB7 }, SCU454, GENMASK(25, 24)}, 2610 + /* GPIOF */ 2611 + { PIN_CONFIG_DRIVE_STRENGTH, { D22, A23 }, SCU458, GENMASK(9, 8)}, 2612 + /* GPIOG */ 2613 + { PIN_CONFIG_DRIVE_STRENGTH, { E21, B21 }, SCU458, GENMASK(11, 10)}, 2610 2614 2611 2615 /* MAC3 */ 2612 2616 { PIN_CONFIG_POWER_SOURCE, { H24, E26 }, SCU458, BIT_MASK(4)},
+1 -1
drivers/pinctrl/cirrus/pinctrl-madera-core.c
··· 1091 1091 1092 1092 static struct platform_driver madera_pin_driver = { 1093 1093 .probe = madera_pin_probe, 1094 - .remove_new = madera_pin_remove, 1094 + .remove = madera_pin_remove, 1095 1095 .driver = { 1096 1096 .name = "madera-pinctrl", 1097 1097 },
+3
drivers/pinctrl/core.c
··· 220 220 221 221 /* Set owner */ 222 222 pindesc->pctldev = pctldev; 223 + #ifdef CONFIG_PINMUX 224 + mutex_init(&pindesc->mux_lock); 225 + #endif 223 226 224 227 /* Copy basic pin info */ 225 228 if (pin->name) {
+1
drivers/pinctrl/core.h
··· 177 177 const char *mux_owner; 178 178 const struct pinctrl_setting_mux *mux_setting; 179 179 const char *gpio_owner; 180 + struct mutex mux_lock; 180 181 #endif 181 182 }; 182 183
+65 -28
drivers/pinctrl/freescale/Kconfig
··· 9 9 10 10 config PINCTRL_IMX_SCMI 11 11 tristate "i.MX95 pinctrl driver using SCMI protocol interface" 12 - depends on ARM_SCMI_PROTOCOL && OF || COMPILE_TEST 12 + depends on ARM_SCMI_PROTOCOL && OF 13 13 select PINMUX 14 14 select GENERIC_PINCONF 15 15 select GENERIC_PINCTRL_GROUPS ··· 20 20 21 21 config PINCTRL_IMX_SCU 22 22 tristate 23 - depends on IMX_SCU 23 + depends on IMX_SCU || COMPILE_TEST 24 24 select PINCTRL_IMX 25 25 26 26 config PINCTRL_IMX1_CORE ··· 30 30 31 31 config PINCTRL_IMX1 32 32 bool "IMX1 pinctrl driver" 33 - depends on SOC_IMX1 33 + depends on OF 34 + depends on SOC_IMX1 || COMPILE_TEST 35 + default SOC_IMX1 34 36 select PINCTRL_IMX1_CORE 35 37 help 36 38 Say Y here to enable the imx1 pinctrl driver 37 39 38 40 config PINCTRL_IMX27 39 41 bool "IMX27 pinctrl driver" 40 - depends on SOC_IMX27 42 + depends on OF 43 + depends on SOC_IMX27 || COMPILE_TEST 44 + default SOC_IMX27 41 45 select PINCTRL_IMX1_CORE 42 46 help 43 47 Say Y here to enable the imx27 pinctrl driver ··· 50 46 config PINCTRL_IMX25 51 47 bool "IMX25 pinctrl driver" 52 48 depends on OF 53 - depends on SOC_IMX25 49 + depends on SOC_IMX25 || COMPILE_TEST 50 + default SOC_IMX25 54 51 select PINCTRL_IMX 55 52 help 56 53 Say Y here to enable the imx25 pinctrl driver 57 54 58 55 config PINCTRL_IMX35 59 56 bool "IMX35 pinctrl driver" 60 - depends on SOC_IMX35 57 + depends on OF 58 + depends on SOC_IMX35 || COMPILE_TEST 59 + default SOC_IMX35 61 60 select PINCTRL_IMX 62 61 help 63 62 Say Y here to enable the imx35 pinctrl driver 64 63 65 64 config PINCTRL_IMX50 66 65 bool "IMX50 pinctrl driver" 67 - depends on SOC_IMX50 66 + depends on OF 67 + depends on SOC_IMX50 || COMPILE_TEST 68 + default SOC_IMX50 68 69 select PINCTRL_IMX 69 70 help 70 71 Say Y here to enable the imx50 pinctrl driver 71 72 72 73 config PINCTRL_IMX51 73 74 bool "IMX51 pinctrl driver" 74 - depends on SOC_IMX51 75 + depends on OF 76 + depends on SOC_IMX51 || COMPILE_TEST 77 + default SOC_IMX51 75 78 select PINCTRL_IMX 76 79 help 77 80 Say Y here to enable the imx51 pinctrl driver 78 81 79 82 config PINCTRL_IMX53 80 83 bool "IMX53 pinctrl driver" 81 - depends on SOC_IMX53 84 + depends on OF 85 + depends on SOC_IMX53 || COMPILE_TEST 86 + default SOC_IMX53 82 87 select PINCTRL_IMX 83 88 help 84 89 Say Y here to enable the imx53 pinctrl driver 85 90 86 91 config PINCTRL_IMX6Q 87 92 bool "IMX6Q/DL pinctrl driver" 88 - depends on SOC_IMX6Q 93 + depends on OF 94 + depends on SOC_IMX6Q || COMPILE_TEST 95 + default SOC_IMX6Q 89 96 select PINCTRL_IMX 90 97 help 91 98 Say Y here to enable the imx6q/dl pinctrl driver 92 99 93 100 config PINCTRL_IMX6SL 94 101 bool "IMX6SL pinctrl driver" 95 - depends on SOC_IMX6SL 102 + depends on OF 103 + depends on SOC_IMX6SL || COMPILE_TEST 104 + default SOC_IMX6SL 96 105 select PINCTRL_IMX 97 106 help 98 107 Say Y here to enable the imx6sl pinctrl driver 99 108 100 109 config PINCTRL_IMX6SLL 101 110 bool "IMX6SLL pinctrl driver" 102 - depends on SOC_IMX6SLL 111 + depends on OF 112 + depends on SOC_IMX6SLL || COMPILE_TEST 113 + default SOC_IMX6SLL 103 114 select PINCTRL_IMX 104 115 help 105 116 Say Y here to enable the imx6sll pinctrl driver 106 117 107 118 config PINCTRL_IMX6SX 108 119 bool "IMX6SX pinctrl driver" 109 - depends on SOC_IMX6SX 120 + depends on OF 121 + depends on SOC_IMX6SX || COMPILE_TEST 122 + default SOC_IMX6SX 110 123 select PINCTRL_IMX 111 124 help 112 125 Say Y here to enable the imx6sx pinctrl driver 113 126 114 127 config PINCTRL_IMX6UL 115 128 bool "IMX6UL pinctrl driver" 116 - depends on SOC_IMX6UL 129 + depends on OF 130 + depends on SOC_IMX6UL || COMPILE_TEST 131 + default SOC_IMX6UL 117 132 select PINCTRL_IMX 118 133 help 119 134 Say Y here to enable the imx6ul pinctrl driver 120 135 121 136 config PINCTRL_IMX7D 122 137 bool "IMX7D pinctrl driver" 123 - depends on SOC_IMX7D 138 + depends on OF 139 + depends on SOC_IMX7D || COMPILE_TEST 140 + default SOC_IMX7D 124 141 select PINCTRL_IMX 125 142 help 126 143 Say Y here to enable the imx7d pinctrl driver 127 144 128 145 config PINCTRL_IMX7ULP 129 146 bool "IMX7ULP pinctrl driver" 130 - depends on SOC_IMX7ULP 147 + depends on OF 148 + depends on SOC_IMX7ULP || COMPILE_TEST 149 + default SOC_IMX7ULP 131 150 select PINCTRL_IMX 132 151 help 133 152 Say Y here to enable the imx7ulp pinctrl driver ··· 158 131 config PINCTRL_IMX8MM 159 132 tristate "IMX8MM pinctrl driver" 160 133 depends on OF 161 - depends on SOC_IMX8M 134 + depends on SOC_IMX8M || COMPILE_TEST 162 135 select PINCTRL_IMX 163 136 help 164 137 Say Y here to enable the imx8mm pinctrl driver ··· 166 139 config PINCTRL_IMX8MN 167 140 tristate "IMX8MN pinctrl driver" 168 141 depends on OF 169 - depends on SOC_IMX8M 142 + depends on SOC_IMX8M || COMPILE_TEST 170 143 select PINCTRL_IMX 171 144 help 172 145 Say Y here to enable the imx8mn pinctrl driver ··· 174 147 config PINCTRL_IMX8MP 175 148 tristate "IMX8MP pinctrl driver" 176 149 depends on OF 177 - depends on SOC_IMX8M 150 + depends on SOC_IMX8M || COMPILE_TEST 178 151 select PINCTRL_IMX 179 152 help 180 153 Say Y here to enable the imx8mp pinctrl driver ··· 182 155 config PINCTRL_IMX8MQ 183 156 tristate "IMX8MQ pinctrl driver" 184 157 depends on OF 185 - depends on SOC_IMX8M 158 + depends on SOC_IMX8M || COMPILE_TEST 186 159 select PINCTRL_IMX 187 160 help 188 161 Say Y here to enable the imx8mq pinctrl driver 189 162 190 163 config PINCTRL_IMX8QM 191 164 tristate "IMX8QM pinctrl driver" 192 - depends on IMX_SCU && ARCH_MXC && ARM64 165 + depends on OF 166 + depends on (IMX_SCU && ARCH_MXC && ARM64) || COMPILE_TEST 193 167 select PINCTRL_IMX_SCU 194 168 help 195 169 Say Y here to enable the imx8qm pinctrl driver 196 170 197 171 config PINCTRL_IMX8QXP 198 172 tristate "IMX8QXP pinctrl driver" 199 - depends on IMX_SCU && ARCH_MXC && ARM64 173 + depends on OF 174 + depends on (IMX_SCU && ARCH_MXC && ARM64) || COMPILE_TEST 200 175 select PINCTRL_IMX_SCU 201 176 help 202 177 Say Y here to enable the imx8qxp pinctrl driver 203 178 204 179 config PINCTRL_IMX8DXL 205 180 tristate "IMX8DXL pinctrl driver" 206 - depends on IMX_SCU && ARCH_MXC && ARM64 181 + depends on OF 182 + depends on (IMX_SCU && ARCH_MXC && ARM64) || COMPILE_TEST 207 183 select PINCTRL_IMX_SCU 208 184 help 209 185 Say Y here to enable the imx8dxl pinctrl driver 210 186 211 187 config PINCTRL_IMX8ULP 212 188 tristate "IMX8ULP pinctrl driver" 213 - depends on ARCH_MXC 189 + depends on OF 190 + depends on ARCH_MXC || COMPILE_TEST 214 191 select PINCTRL_IMX 215 192 help 216 193 Say Y here to enable the imx8ulp pinctrl driver 217 194 218 195 config PINCTRL_IMXRT1050 219 196 bool "IMXRT1050 pinctrl driver" 220 - depends on ARCH_MXC 197 + depends on OF 198 + depends on SOC_IMXRT || COMPILE_TEST 199 + default SOC_IMXRT 221 200 select PINCTRL_IMX 222 201 help 223 202 Say Y here to enable the imxrt1050 pinctrl driver ··· 237 204 238 205 config PINCTRL_IMX93 239 206 tristate "IMX93 pinctrl driver" 240 - depends on ARCH_MXC 207 + depends on OF 208 + depends on ARCH_MXC || COMPILE_TEST 241 209 select PINCTRL_IMX 242 210 help 243 211 Say Y here to enable the imx93 pinctrl driver 244 212 245 213 config PINCTRL_VF610 246 214 bool "Freescale Vybrid VF610 pinctrl driver" 247 - depends on SOC_VF610 215 + depends on OF 216 + depends on SOC_VF610 || COMPILE_TEST 217 + default SOC_VF610 248 218 select PINCTRL_IMX 249 219 help 250 220 Say Y here to enable the Freescale Vybrid VF610 pinctrl driver ··· 267 231 268 232 config PINCTRL_IMXRT1170 269 233 bool "IMXRT1170 pinctrl driver" 270 - depends on ARCH_MXC 234 + depends on OF 235 + depends on SOC_IMXRT || COMPILE_TEST 271 236 select PINCTRL_IMX 272 237 help 273 238 Say Y here to enable the imxrt1170 pinctrl driver
+3 -3
drivers/pinctrl/freescale/pinctrl-imx.c
··· 633 633 static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np) 634 634 { 635 635 for_each_child_of_node_scoped(np, function_np) { 636 - if (of_property_read_bool(function_np, "fsl,pins")) 636 + if (of_property_present(function_np, "fsl,pins")) 637 637 return true; 638 638 639 639 for_each_child_of_node_scoped(function_np, pinctrl_np) { 640 - if (of_property_read_bool(pinctrl_np, "fsl,pins")) 640 + if (of_property_present(pinctrl_np, "fsl,pins")) 641 641 return false; 642 642 } 643 643 } ··· 746 746 if (IS_ERR(ipctl->base)) 747 747 return PTR_ERR(ipctl->base); 748 748 749 - if (of_property_read_bool(dev_np, "fsl,input-sel")) { 749 + if (of_property_present(dev_np, "fsl,input-sel")) { 750 750 np = of_parse_phandle(dev_np, "fsl,input-sel", 0); 751 751 if (!np) { 752 752 dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n");
+114 -114
drivers/pinctrl/freescale/pinctrl-imx1.c
··· 12 12 #include "pinctrl-imx1.h" 13 13 14 14 #define PAD_ID(port, pin) ((port) * 32 + (pin)) 15 - #define PA 0 16 - #define PB 1 17 - #define PC 2 18 - #define PD 3 15 + #define IMX1_PA 0 16 + #define IMX1_PB 1 17 + #define IMX1_PC 2 18 + #define IMX1_PD 3 19 19 20 20 enum imx1_pads { 21 - MX1_PAD_A24 = PAD_ID(PA, 0), 22 - MX1_PAD_TIN = PAD_ID(PA, 1), 23 - MX1_PAD_PWMO = PAD_ID(PA, 2), 24 - MX1_PAD_CSI_MCLK = PAD_ID(PA, 3), 25 - MX1_PAD_CSI_D0 = PAD_ID(PA, 4), 26 - MX1_PAD_CSI_D1 = PAD_ID(PA, 5), 27 - MX1_PAD_CSI_D2 = PAD_ID(PA, 6), 28 - MX1_PAD_CSI_D3 = PAD_ID(PA, 7), 29 - MX1_PAD_CSI_D4 = PAD_ID(PA, 8), 30 - MX1_PAD_CSI_D5 = PAD_ID(PA, 9), 31 - MX1_PAD_CSI_D6 = PAD_ID(PA, 10), 32 - MX1_PAD_CSI_D7 = PAD_ID(PA, 11), 33 - MX1_PAD_CSI_VSYNC = PAD_ID(PA, 12), 34 - MX1_PAD_CSI_HSYNC = PAD_ID(PA, 13), 35 - MX1_PAD_CSI_PIXCLK = PAD_ID(PA, 14), 36 - MX1_PAD_I2C_SDA = PAD_ID(PA, 15), 37 - MX1_PAD_I2C_SCL = PAD_ID(PA, 16), 38 - MX1_PAD_DTACK = PAD_ID(PA, 17), 39 - MX1_PAD_BCLK = PAD_ID(PA, 18), 40 - MX1_PAD_LBA = PAD_ID(PA, 19), 41 - MX1_PAD_ECB = PAD_ID(PA, 20), 42 - MX1_PAD_A0 = PAD_ID(PA, 21), 43 - MX1_PAD_CS4 = PAD_ID(PA, 22), 44 - MX1_PAD_CS5 = PAD_ID(PA, 23), 45 - MX1_PAD_A16 = PAD_ID(PA, 24), 46 - MX1_PAD_A17 = PAD_ID(PA, 25), 47 - MX1_PAD_A18 = PAD_ID(PA, 26), 48 - MX1_PAD_A19 = PAD_ID(PA, 27), 49 - MX1_PAD_A20 = PAD_ID(PA, 28), 50 - MX1_PAD_A21 = PAD_ID(PA, 29), 51 - MX1_PAD_A22 = PAD_ID(PA, 30), 52 - MX1_PAD_A23 = PAD_ID(PA, 31), 53 - MX1_PAD_SD_DAT0 = PAD_ID(PB, 8), 54 - MX1_PAD_SD_DAT1 = PAD_ID(PB, 9), 55 - MX1_PAD_SD_DAT2 = PAD_ID(PB, 10), 56 - MX1_PAD_SD_DAT3 = PAD_ID(PB, 11), 57 - MX1_PAD_SD_SCLK = PAD_ID(PB, 12), 58 - MX1_PAD_SD_CMD = PAD_ID(PB, 13), 59 - MX1_PAD_SIM_SVEN = PAD_ID(PB, 14), 60 - MX1_PAD_SIM_PD = PAD_ID(PB, 15), 61 - MX1_PAD_SIM_TX = PAD_ID(PB, 16), 62 - MX1_PAD_SIM_RX = PAD_ID(PB, 17), 63 - MX1_PAD_SIM_RST = PAD_ID(PB, 18), 64 - MX1_PAD_SIM_CLK = PAD_ID(PB, 19), 65 - MX1_PAD_USBD_AFE = PAD_ID(PB, 20), 66 - MX1_PAD_USBD_OE = PAD_ID(PB, 21), 67 - MX1_PAD_USBD_RCV = PAD_ID(PB, 22), 68 - MX1_PAD_USBD_SUSPND = PAD_ID(PB, 23), 69 - MX1_PAD_USBD_VP = PAD_ID(PB, 24), 70 - MX1_PAD_USBD_VM = PAD_ID(PB, 25), 71 - MX1_PAD_USBD_VPO = PAD_ID(PB, 26), 72 - MX1_PAD_USBD_VMO = PAD_ID(PB, 27), 73 - MX1_PAD_UART2_CTS = PAD_ID(PB, 28), 74 - MX1_PAD_UART2_RTS = PAD_ID(PB, 29), 75 - MX1_PAD_UART2_TXD = PAD_ID(PB, 30), 76 - MX1_PAD_UART2_RXD = PAD_ID(PB, 31), 77 - MX1_PAD_SSI_RXFS = PAD_ID(PC, 3), 78 - MX1_PAD_SSI_RXCLK = PAD_ID(PC, 4), 79 - MX1_PAD_SSI_RXDAT = PAD_ID(PC, 5), 80 - MX1_PAD_SSI_TXDAT = PAD_ID(PC, 6), 81 - MX1_PAD_SSI_TXFS = PAD_ID(PC, 7), 82 - MX1_PAD_SSI_TXCLK = PAD_ID(PC, 8), 83 - MX1_PAD_UART1_CTS = PAD_ID(PC, 9), 84 - MX1_PAD_UART1_RTS = PAD_ID(PC, 10), 85 - MX1_PAD_UART1_TXD = PAD_ID(PC, 11), 86 - MX1_PAD_UART1_RXD = PAD_ID(PC, 12), 87 - MX1_PAD_SPI1_RDY = PAD_ID(PC, 13), 88 - MX1_PAD_SPI1_SCLK = PAD_ID(PC, 14), 89 - MX1_PAD_SPI1_SS = PAD_ID(PC, 15), 90 - MX1_PAD_SPI1_MISO = PAD_ID(PC, 16), 91 - MX1_PAD_SPI1_MOSI = PAD_ID(PC, 17), 92 - MX1_PAD_BT13 = PAD_ID(PC, 19), 93 - MX1_PAD_BT12 = PAD_ID(PC, 20), 94 - MX1_PAD_BT11 = PAD_ID(PC, 21), 95 - MX1_PAD_BT10 = PAD_ID(PC, 22), 96 - MX1_PAD_BT9 = PAD_ID(PC, 23), 97 - MX1_PAD_BT8 = PAD_ID(PC, 24), 98 - MX1_PAD_BT7 = PAD_ID(PC, 25), 99 - MX1_PAD_BT6 = PAD_ID(PC, 26), 100 - MX1_PAD_BT5 = PAD_ID(PC, 27), 101 - MX1_PAD_BT4 = PAD_ID(PC, 28), 102 - MX1_PAD_BT3 = PAD_ID(PC, 29), 103 - MX1_PAD_BT2 = PAD_ID(PC, 30), 104 - MX1_PAD_BT1 = PAD_ID(PC, 31), 105 - MX1_PAD_LSCLK = PAD_ID(PD, 6), 106 - MX1_PAD_REV = PAD_ID(PD, 7), 107 - MX1_PAD_CLS = PAD_ID(PD, 8), 108 - MX1_PAD_PS = PAD_ID(PD, 9), 109 - MX1_PAD_SPL_SPR = PAD_ID(PD, 10), 110 - MX1_PAD_CONTRAST = PAD_ID(PD, 11), 111 - MX1_PAD_ACD_OE = PAD_ID(PD, 12), 112 - MX1_PAD_LP_HSYNC = PAD_ID(PD, 13), 113 - MX1_PAD_FLM_VSYNC = PAD_ID(PD, 14), 114 - MX1_PAD_LD0 = PAD_ID(PD, 15), 115 - MX1_PAD_LD1 = PAD_ID(PD, 16), 116 - MX1_PAD_LD2 = PAD_ID(PD, 17), 117 - MX1_PAD_LD3 = PAD_ID(PD, 18), 118 - MX1_PAD_LD4 = PAD_ID(PD, 19), 119 - MX1_PAD_LD5 = PAD_ID(PD, 20), 120 - MX1_PAD_LD6 = PAD_ID(PD, 21), 121 - MX1_PAD_LD7 = PAD_ID(PD, 22), 122 - MX1_PAD_LD8 = PAD_ID(PD, 23), 123 - MX1_PAD_LD9 = PAD_ID(PD, 24), 124 - MX1_PAD_LD10 = PAD_ID(PD, 25), 125 - MX1_PAD_LD11 = PAD_ID(PD, 26), 126 - MX1_PAD_LD12 = PAD_ID(PD, 27), 127 - MX1_PAD_LD13 = PAD_ID(PD, 28), 128 - MX1_PAD_LD14 = PAD_ID(PD, 29), 129 - MX1_PAD_LD15 = PAD_ID(PD, 30), 130 - MX1_PAD_TMR2OUT = PAD_ID(PD, 31), 21 + MX1_PAD_A24 = PAD_ID(IMX1_PA, 0), 22 + MX1_PAD_TIN = PAD_ID(IMX1_PA, 1), 23 + MX1_PAD_PWMO = PAD_ID(IMX1_PA, 2), 24 + MX1_PAD_CSI_MCLK = PAD_ID(IMX1_PA, 3), 25 + MX1_PAD_CSI_D0 = PAD_ID(IMX1_PA, 4), 26 + MX1_PAD_CSI_D1 = PAD_ID(IMX1_PA, 5), 27 + MX1_PAD_CSI_D2 = PAD_ID(IMX1_PA, 6), 28 + MX1_PAD_CSI_D3 = PAD_ID(IMX1_PA, 7), 29 + MX1_PAD_CSI_D4 = PAD_ID(IMX1_PA, 8), 30 + MX1_PAD_CSI_D5 = PAD_ID(IMX1_PA, 9), 31 + MX1_PAD_CSI_D6 = PAD_ID(IMX1_PA, 10), 32 + MX1_PAD_CSI_D7 = PAD_ID(IMX1_PA, 11), 33 + MX1_PAD_CSI_VSYNC = PAD_ID(IMX1_PA, 12), 34 + MX1_PAD_CSI_HSYNC = PAD_ID(IMX1_PA, 13), 35 + MX1_PAD_CSI_PIXCLK = PAD_ID(IMX1_PA, 14), 36 + MX1_PAD_I2C_SDA = PAD_ID(IMX1_PA, 15), 37 + MX1_PAD_I2C_SCL = PAD_ID(IMX1_PA, 16), 38 + MX1_PAD_DTACK = PAD_ID(IMX1_PA, 17), 39 + MX1_PAD_BCLK = PAD_ID(IMX1_PA, 18), 40 + MX1_PAD_LBA = PAD_ID(IMX1_PA, 19), 41 + MX1_PAD_ECB = PAD_ID(IMX1_PA, 20), 42 + MX1_PAD_A0 = PAD_ID(IMX1_PA, 21), 43 + MX1_PAD_CS4 = PAD_ID(IMX1_PA, 22), 44 + MX1_PAD_CS5 = PAD_ID(IMX1_PA, 23), 45 + MX1_PAD_A16 = PAD_ID(IMX1_PA, 24), 46 + MX1_PAD_A17 = PAD_ID(IMX1_PA, 25), 47 + MX1_PAD_A18 = PAD_ID(IMX1_PA, 26), 48 + MX1_PAD_A19 = PAD_ID(IMX1_PA, 27), 49 + MX1_PAD_A20 = PAD_ID(IMX1_PA, 28), 50 + MX1_PAD_A21 = PAD_ID(IMX1_PA, 29), 51 + MX1_PAD_A22 = PAD_ID(IMX1_PA, 30), 52 + MX1_PAD_A23 = PAD_ID(IMX1_PA, 31), 53 + MX1_PAD_SD_DAT0 = PAD_ID(IMX1_PB, 8), 54 + MX1_PAD_SD_DAT1 = PAD_ID(IMX1_PB, 9), 55 + MX1_PAD_SD_DAT2 = PAD_ID(IMX1_PB, 10), 56 + MX1_PAD_SD_DAT3 = PAD_ID(IMX1_PB, 11), 57 + MX1_PAD_SD_SCLK = PAD_ID(IMX1_PB, 12), 58 + MX1_PAD_SD_CMD = PAD_ID(IMX1_PB, 13), 59 + MX1_PAD_SIM_SVEN = PAD_ID(IMX1_PB, 14), 60 + MX1_PAD_SIM_PD = PAD_ID(IMX1_PB, 15), 61 + MX1_PAD_SIM_TX = PAD_ID(IMX1_PB, 16), 62 + MX1_PAD_SIM_RX = PAD_ID(IMX1_PB, 17), 63 + MX1_PAD_SIM_RST = PAD_ID(IMX1_PB, 18), 64 + MX1_PAD_SIM_CLK = PAD_ID(IMX1_PB, 19), 65 + MX1_PAD_USBD_AFE = PAD_ID(IMX1_PB, 20), 66 + MX1_PAD_USBD_OE = PAD_ID(IMX1_PB, 21), 67 + MX1_PAD_USBD_RCV = PAD_ID(IMX1_PB, 22), 68 + MX1_PAD_USBD_SUSPND = PAD_ID(IMX1_PB, 23), 69 + MX1_PAD_USBD_VP = PAD_ID(IMX1_PB, 24), 70 + MX1_PAD_USBD_VM = PAD_ID(IMX1_PB, 25), 71 + MX1_PAD_USBD_VPO = PAD_ID(IMX1_PB, 26), 72 + MX1_PAD_USBD_VMO = PAD_ID(IMX1_PB, 27), 73 + MX1_PAD_UART2_CTS = PAD_ID(IMX1_PB, 28), 74 + MX1_PAD_UART2_RTS = PAD_ID(IMX1_PB, 29), 75 + MX1_PAD_UART2_TXD = PAD_ID(IMX1_PB, 30), 76 + MX1_PAD_UART2_RXD = PAD_ID(IMX1_PB, 31), 77 + MX1_PAD_SSI_RXFS = PAD_ID(IMX1_PC, 3), 78 + MX1_PAD_SSI_RXCLK = PAD_ID(IMX1_PC, 4), 79 + MX1_PAD_SSI_RXDAT = PAD_ID(IMX1_PC, 5), 80 + MX1_PAD_SSI_TXDAT = PAD_ID(IMX1_PC, 6), 81 + MX1_PAD_SSI_TXFS = PAD_ID(IMX1_PC, 7), 82 + MX1_PAD_SSI_TXCLK = PAD_ID(IMX1_PC, 8), 83 + MX1_PAD_UART1_CTS = PAD_ID(IMX1_PC, 9), 84 + MX1_PAD_UART1_RTS = PAD_ID(IMX1_PC, 10), 85 + MX1_PAD_UART1_TXD = PAD_ID(IMX1_PC, 11), 86 + MX1_PAD_UART1_RXD = PAD_ID(IMX1_PC, 12), 87 + MX1_PAD_SPI1_RDY = PAD_ID(IMX1_PC, 13), 88 + MX1_PAD_SPI1_SCLK = PAD_ID(IMX1_PC, 14), 89 + MX1_PAD_SPI1_SS = PAD_ID(IMX1_PC, 15), 90 + MX1_PAD_SPI1_MISO = PAD_ID(IMX1_PC, 16), 91 + MX1_PAD_SPI1_MOSI = PAD_ID(IMX1_PC, 17), 92 + MX1_PAD_BT13 = PAD_ID(IMX1_PC, 19), 93 + MX1_PAD_BT12 = PAD_ID(IMX1_PC, 20), 94 + MX1_PAD_BT11 = PAD_ID(IMX1_PC, 21), 95 + MX1_PAD_BT10 = PAD_ID(IMX1_PC, 22), 96 + MX1_PAD_BT9 = PAD_ID(IMX1_PC, 23), 97 + MX1_PAD_BT8 = PAD_ID(IMX1_PC, 24), 98 + MX1_PAD_BT7 = PAD_ID(IMX1_PC, 25), 99 + MX1_PAD_BT6 = PAD_ID(IMX1_PC, 26), 100 + MX1_PAD_BT5 = PAD_ID(IMX1_PC, 27), 101 + MX1_PAD_BT4 = PAD_ID(IMX1_PC, 28), 102 + MX1_PAD_BT3 = PAD_ID(IMX1_PC, 29), 103 + MX1_PAD_BT2 = PAD_ID(IMX1_PC, 30), 104 + MX1_PAD_BT1 = PAD_ID(IMX1_PC, 31), 105 + MX1_PAD_LSCLK = PAD_ID(IMX1_PD, 6), 106 + MX1_PAD_REV = PAD_ID(IMX1_PD, 7), 107 + MX1_PAD_CLS = PAD_ID(IMX1_PD, 8), 108 + MX1_PAD_PS = PAD_ID(IMX1_PD, 9), 109 + MX1_PAD_SPL_SPR = PAD_ID(IMX1_PD, 10), 110 + MX1_PAD_CONTRAST = PAD_ID(IMX1_PD, 11), 111 + MX1_PAD_ACD_OE = PAD_ID(IMX1_PD, 12), 112 + MX1_PAD_LP_HSYNC = PAD_ID(IMX1_PD, 13), 113 + MX1_PAD_FLM_VSYNC = PAD_ID(IMX1_PD, 14), 114 + MX1_PAD_LD0 = PAD_ID(IMX1_PD, 15), 115 + MX1_PAD_LD1 = PAD_ID(IMX1_PD, 16), 116 + MX1_PAD_LD2 = PAD_ID(IMX1_PD, 17), 117 + MX1_PAD_LD3 = PAD_ID(IMX1_PD, 18), 118 + MX1_PAD_LD4 = PAD_ID(IMX1_PD, 19), 119 + MX1_PAD_LD5 = PAD_ID(IMX1_PD, 20), 120 + MX1_PAD_LD6 = PAD_ID(IMX1_PD, 21), 121 + MX1_PAD_LD7 = PAD_ID(IMX1_PD, 22), 122 + MX1_PAD_LD8 = PAD_ID(IMX1_PD, 23), 123 + MX1_PAD_LD9 = PAD_ID(IMX1_PD, 24), 124 + MX1_PAD_LD10 = PAD_ID(IMX1_PD, 25), 125 + MX1_PAD_LD11 = PAD_ID(IMX1_PD, 26), 126 + MX1_PAD_LD12 = PAD_ID(IMX1_PD, 27), 127 + MX1_PAD_LD13 = PAD_ID(IMX1_PD, 28), 128 + MX1_PAD_LD14 = PAD_ID(IMX1_PD, 29), 129 + MX1_PAD_LD15 = PAD_ID(IMX1_PD, 30), 130 + MX1_PAD_TMR2OUT = PAD_ID(IMX1_PD, 31), 131 131 }; 132 132 133 133 /* Pad names for the pinmux subsystem */
+175 -175
drivers/pinctrl/freescale/pinctrl-imx27.c
··· 16 16 #include "pinctrl-imx1.h" 17 17 18 18 #define PAD_ID(port, pin) (port*32 + pin) 19 - #define PA 0 20 - #define PB 1 21 - #define PC 2 22 - #define PD 3 23 - #define PE 4 24 - #define PF 5 19 + #define MX27_PA 0 20 + #define MX27_PB 1 21 + #define MX27_PC 2 22 + #define MX27_PD 3 23 + #define MX27_PE 4 24 + #define MX27_PF 5 25 25 26 26 enum imx27_pads { 27 - MX27_PAD_USBH2_CLK = PAD_ID(PA, 0), 28 - MX27_PAD_USBH2_DIR = PAD_ID(PA, 1), 29 - MX27_PAD_USBH2_DATA7 = PAD_ID(PA, 2), 30 - MX27_PAD_USBH2_NXT = PAD_ID(PA, 3), 31 - MX27_PAD_USBH2_STP = PAD_ID(PA, 4), 32 - MX27_PAD_LSCLK = PAD_ID(PA, 5), 33 - MX27_PAD_LD0 = PAD_ID(PA, 6), 34 - MX27_PAD_LD1 = PAD_ID(PA, 7), 35 - MX27_PAD_LD2 = PAD_ID(PA, 8), 36 - MX27_PAD_LD3 = PAD_ID(PA, 9), 37 - MX27_PAD_LD4 = PAD_ID(PA, 10), 38 - MX27_PAD_LD5 = PAD_ID(PA, 11), 39 - MX27_PAD_LD6 = PAD_ID(PA, 12), 40 - MX27_PAD_LD7 = PAD_ID(PA, 13), 41 - MX27_PAD_LD8 = PAD_ID(PA, 14), 42 - MX27_PAD_LD9 = PAD_ID(PA, 15), 43 - MX27_PAD_LD10 = PAD_ID(PA, 16), 44 - MX27_PAD_LD11 = PAD_ID(PA, 17), 45 - MX27_PAD_LD12 = PAD_ID(PA, 18), 46 - MX27_PAD_LD13 = PAD_ID(PA, 19), 47 - MX27_PAD_LD14 = PAD_ID(PA, 20), 48 - MX27_PAD_LD15 = PAD_ID(PA, 21), 49 - MX27_PAD_LD16 = PAD_ID(PA, 22), 50 - MX27_PAD_LD17 = PAD_ID(PA, 23), 51 - MX27_PAD_REV = PAD_ID(PA, 24), 52 - MX27_PAD_CLS = PAD_ID(PA, 25), 53 - MX27_PAD_PS = PAD_ID(PA, 26), 54 - MX27_PAD_SPL_SPR = PAD_ID(PA, 27), 55 - MX27_PAD_HSYNC = PAD_ID(PA, 28), 56 - MX27_PAD_VSYNC = PAD_ID(PA, 29), 57 - MX27_PAD_CONTRAST = PAD_ID(PA, 30), 58 - MX27_PAD_OE_ACD = PAD_ID(PA, 31), 27 + MX27_PAD_USBH2_CLK = PAD_ID(MX27_PA, 0), 28 + MX27_PAD_USBH2_DIR = PAD_ID(MX27_PA, 1), 29 + MX27_PAD_USBH2_DATA7 = PAD_ID(MX27_PA, 2), 30 + MX27_PAD_USBH2_NXT = PAD_ID(MX27_PA, 3), 31 + MX27_PAD_USBH2_STP = PAD_ID(MX27_PA, 4), 32 + MX27_PAD_LSCLK = PAD_ID(MX27_PA, 5), 33 + MX27_PAD_LD0 = PAD_ID(MX27_PA, 6), 34 + MX27_PAD_LD1 = PAD_ID(MX27_PA, 7), 35 + MX27_PAD_LD2 = PAD_ID(MX27_PA, 8), 36 + MX27_PAD_LD3 = PAD_ID(MX27_PA, 9), 37 + MX27_PAD_LD4 = PAD_ID(MX27_PA, 10), 38 + MX27_PAD_LD5 = PAD_ID(MX27_PA, 11), 39 + MX27_PAD_LD6 = PAD_ID(MX27_PA, 12), 40 + MX27_PAD_LD7 = PAD_ID(MX27_PA, 13), 41 + MX27_PAD_LD8 = PAD_ID(MX27_PA, 14), 42 + MX27_PAD_LD9 = PAD_ID(MX27_PA, 15), 43 + MX27_PAD_LD10 = PAD_ID(MX27_PA, 16), 44 + MX27_PAD_LD11 = PAD_ID(MX27_PA, 17), 45 + MX27_PAD_LD12 = PAD_ID(MX27_PA, 18), 46 + MX27_PAD_LD13 = PAD_ID(MX27_PA, 19), 47 + MX27_PAD_LD14 = PAD_ID(MX27_PA, 20), 48 + MX27_PAD_LD15 = PAD_ID(MX27_PA, 21), 49 + MX27_PAD_LD16 = PAD_ID(MX27_PA, 22), 50 + MX27_PAD_LD17 = PAD_ID(MX27_PA, 23), 51 + MX27_PAD_REV = PAD_ID(MX27_PA, 24), 52 + MX27_PAD_CLS = PAD_ID(MX27_PA, 25), 53 + MX27_PAD_PS = PAD_ID(MX27_PA, 26), 54 + MX27_PAD_SPL_SPR = PAD_ID(MX27_PA, 27), 55 + MX27_PAD_HSYNC = PAD_ID(MX27_PA, 28), 56 + MX27_PAD_VSYNC = PAD_ID(MX27_PA, 29), 57 + MX27_PAD_CONTRAST = PAD_ID(MX27_PA, 30), 58 + MX27_PAD_OE_ACD = PAD_ID(MX27_PA, 31), 59 59 60 - MX27_PAD_SD2_D0 = PAD_ID(PB, 4), 61 - MX27_PAD_SD2_D1 = PAD_ID(PB, 5), 62 - MX27_PAD_SD2_D2 = PAD_ID(PB, 6), 63 - MX27_PAD_SD2_D3 = PAD_ID(PB, 7), 64 - MX27_PAD_SD2_CMD = PAD_ID(PB, 8), 65 - MX27_PAD_SD2_CLK = PAD_ID(PB, 9), 66 - MX27_PAD_CSI_D0 = PAD_ID(PB, 10), 67 - MX27_PAD_CSI_D1 = PAD_ID(PB, 11), 68 - MX27_PAD_CSI_D2 = PAD_ID(PB, 12), 69 - MX27_PAD_CSI_D3 = PAD_ID(PB, 13), 70 - MX27_PAD_CSI_D4 = PAD_ID(PB, 14), 71 - MX27_PAD_CSI_MCLK = PAD_ID(PB, 15), 72 - MX27_PAD_CSI_PIXCLK = PAD_ID(PB, 16), 73 - MX27_PAD_CSI_D5 = PAD_ID(PB, 17), 74 - MX27_PAD_CSI_D6 = PAD_ID(PB, 18), 75 - MX27_PAD_CSI_D7 = PAD_ID(PB, 19), 76 - MX27_PAD_CSI_VSYNC = PAD_ID(PB, 20), 77 - MX27_PAD_CSI_HSYNC = PAD_ID(PB, 21), 78 - MX27_PAD_USBH1_SUSP = PAD_ID(PB, 22), 79 - MX27_PAD_USB_PWR = PAD_ID(PB, 23), 80 - MX27_PAD_USB_OC_B = PAD_ID(PB, 24), 81 - MX27_PAD_USBH1_RCV = PAD_ID(PB, 25), 82 - MX27_PAD_USBH1_FS = PAD_ID(PB, 26), 83 - MX27_PAD_USBH1_OE_B = PAD_ID(PB, 27), 84 - MX27_PAD_USBH1_TXDM = PAD_ID(PB, 28), 85 - MX27_PAD_USBH1_TXDP = PAD_ID(PB, 29), 86 - MX27_PAD_USBH1_RXDM = PAD_ID(PB, 30), 87 - MX27_PAD_USBH1_RXDP = PAD_ID(PB, 31), 60 + MX27_PAD_SD2_D0 = PAD_ID(MX27_PB, 4), 61 + MX27_PAD_SD2_D1 = PAD_ID(MX27_PB, 5), 62 + MX27_PAD_SD2_D2 = PAD_ID(MX27_PB, 6), 63 + MX27_PAD_SD2_D3 = PAD_ID(MX27_PB, 7), 64 + MX27_PAD_SD2_CMD = PAD_ID(MX27_PB, 8), 65 + MX27_PAD_SD2_CLK = PAD_ID(MX27_PB, 9), 66 + MX27_PAD_CSI_D0 = PAD_ID(MX27_PB, 10), 67 + MX27_PAD_CSI_D1 = PAD_ID(MX27_PB, 11), 68 + MX27_PAD_CSI_D2 = PAD_ID(MX27_PB, 12), 69 + MX27_PAD_CSI_D3 = PAD_ID(MX27_PB, 13), 70 + MX27_PAD_CSI_D4 = PAD_ID(MX27_PB, 14), 71 + MX27_PAD_CSI_MCLK = PAD_ID(MX27_PB, 15), 72 + MX27_PAD_CSI_PIXCLK = PAD_ID(MX27_PB, 16), 73 + MX27_PAD_CSI_D5 = PAD_ID(MX27_PB, 17), 74 + MX27_PAD_CSI_D6 = PAD_ID(MX27_PB, 18), 75 + MX27_PAD_CSI_D7 = PAD_ID(MX27_PB, 19), 76 + MX27_PAD_CSI_VSYNC = PAD_ID(MX27_PB, 20), 77 + MX27_PAD_CSI_HSYNC = PAD_ID(MX27_PB, 21), 78 + MX27_PAD_USBH1_SUSP = PAD_ID(MX27_PB, 22), 79 + MX27_PAD_USB_PWR = PAD_ID(MX27_PB, 23), 80 + MX27_PAD_USB_OC_B = PAD_ID(MX27_PB, 24), 81 + MX27_PAD_USBH1_RCV = PAD_ID(MX27_PB, 25), 82 + MX27_PAD_USBH1_FS = PAD_ID(MX27_PB, 26), 83 + MX27_PAD_USBH1_OE_B = PAD_ID(MX27_PB, 27), 84 + MX27_PAD_USBH1_TXDM = PAD_ID(MX27_PB, 28), 85 + MX27_PAD_USBH1_TXDP = PAD_ID(MX27_PB, 29), 86 + MX27_PAD_USBH1_RXDM = PAD_ID(MX27_PB, 30), 87 + MX27_PAD_USBH1_RXDP = PAD_ID(MX27_PB, 31), 88 88 89 - MX27_PAD_I2C2_SDA = PAD_ID(PC, 5), 90 - MX27_PAD_I2C2_SCL = PAD_ID(PC, 6), 91 - MX27_PAD_USBOTG_DATA5 = PAD_ID(PC, 7), 92 - MX27_PAD_USBOTG_DATA6 = PAD_ID(PC, 8), 93 - MX27_PAD_USBOTG_DATA0 = PAD_ID(PC, 9), 94 - MX27_PAD_USBOTG_DATA2 = PAD_ID(PC, 10), 95 - MX27_PAD_USBOTG_DATA1 = PAD_ID(PC, 11), 96 - MX27_PAD_USBOTG_DATA4 = PAD_ID(PC, 12), 97 - MX27_PAD_USBOTG_DATA3 = PAD_ID(PC, 13), 98 - MX27_PAD_TOUT = PAD_ID(PC, 14), 99 - MX27_PAD_TIN = PAD_ID(PC, 15), 100 - MX27_PAD_SSI4_FS = PAD_ID(PC, 16), 101 - MX27_PAD_SSI4_RXDAT = PAD_ID(PC, 17), 102 - MX27_PAD_SSI4_TXDAT = PAD_ID(PC, 18), 103 - MX27_PAD_SSI4_CLK = PAD_ID(PC, 19), 104 - MX27_PAD_SSI1_FS = PAD_ID(PC, 20), 105 - MX27_PAD_SSI1_RXDAT = PAD_ID(PC, 21), 106 - MX27_PAD_SSI1_TXDAT = PAD_ID(PC, 22), 107 - MX27_PAD_SSI1_CLK = PAD_ID(PC, 23), 108 - MX27_PAD_SSI2_FS = PAD_ID(PC, 24), 109 - MX27_PAD_SSI2_RXDAT = PAD_ID(PC, 25), 110 - MX27_PAD_SSI2_TXDAT = PAD_ID(PC, 26), 111 - MX27_PAD_SSI2_CLK = PAD_ID(PC, 27), 112 - MX27_PAD_SSI3_FS = PAD_ID(PC, 28), 113 - MX27_PAD_SSI3_RXDAT = PAD_ID(PC, 29), 114 - MX27_PAD_SSI3_TXDAT = PAD_ID(PC, 30), 115 - MX27_PAD_SSI3_CLK = PAD_ID(PC, 31), 89 + MX27_PAD_I2C2_SDA = PAD_ID(MX27_PC, 5), 90 + MX27_PAD_I2C2_SCL = PAD_ID(MX27_PC, 6), 91 + MX27_PAD_USBOTG_DATA5 = PAD_ID(MX27_PC, 7), 92 + MX27_PAD_USBOTG_DATA6 = PAD_ID(MX27_PC, 8), 93 + MX27_PAD_USBOTG_DATA0 = PAD_ID(MX27_PC, 9), 94 + MX27_PAD_USBOTG_DATA2 = PAD_ID(MX27_PC, 10), 95 + MX27_PAD_USBOTG_DATA1 = PAD_ID(MX27_PC, 11), 96 + MX27_PAD_USBOTG_DATA4 = PAD_ID(MX27_PC, 12), 97 + MX27_PAD_USBOTG_DATA3 = PAD_ID(MX27_PC, 13), 98 + MX27_PAD_TOUT = PAD_ID(MX27_PC, 14), 99 + MX27_PAD_TIN = PAD_ID(MX27_PC, 15), 100 + MX27_PAD_SSI4_FS = PAD_ID(MX27_PC, 16), 101 + MX27_PAD_SSI4_RXDAT = PAD_ID(MX27_PC, 17), 102 + MX27_PAD_SSI4_TXDAT = PAD_ID(MX27_PC, 18), 103 + MX27_PAD_SSI4_CLK = PAD_ID(MX27_PC, 19), 104 + MX27_PAD_SSI1_FS = PAD_ID(MX27_PC, 20), 105 + MX27_PAD_SSI1_RXDAT = PAD_ID(MX27_PC, 21), 106 + MX27_PAD_SSI1_TXDAT = PAD_ID(MX27_PC, 22), 107 + MX27_PAD_SSI1_CLK = PAD_ID(MX27_PC, 23), 108 + MX27_PAD_SSI2_FS = PAD_ID(MX27_PC, 24), 109 + MX27_PAD_SSI2_RXDAT = PAD_ID(MX27_PC, 25), 110 + MX27_PAD_SSI2_TXDAT = PAD_ID(MX27_PC, 26), 111 + MX27_PAD_SSI2_CLK = PAD_ID(MX27_PC, 27), 112 + MX27_PAD_SSI3_FS = PAD_ID(MX27_PC, 28), 113 + MX27_PAD_SSI3_RXDAT = PAD_ID(MX27_PC, 29), 114 + MX27_PAD_SSI3_TXDAT = PAD_ID(MX27_PC, 30), 115 + MX27_PAD_SSI3_CLK = PAD_ID(MX27_PC, 31), 116 116 117 - MX27_PAD_SD3_CMD = PAD_ID(PD, 0), 118 - MX27_PAD_SD3_CLK = PAD_ID(PD, 1), 119 - MX27_PAD_ATA_DATA0 = PAD_ID(PD, 2), 120 - MX27_PAD_ATA_DATA1 = PAD_ID(PD, 3), 121 - MX27_PAD_ATA_DATA2 = PAD_ID(PD, 4), 122 - MX27_PAD_ATA_DATA3 = PAD_ID(PD, 5), 123 - MX27_PAD_ATA_DATA4 = PAD_ID(PD, 6), 124 - MX27_PAD_ATA_DATA5 = PAD_ID(PD, 7), 125 - MX27_PAD_ATA_DATA6 = PAD_ID(PD, 8), 126 - MX27_PAD_ATA_DATA7 = PAD_ID(PD, 9), 127 - MX27_PAD_ATA_DATA8 = PAD_ID(PD, 10), 128 - MX27_PAD_ATA_DATA9 = PAD_ID(PD, 11), 129 - MX27_PAD_ATA_DATA10 = PAD_ID(PD, 12), 130 - MX27_PAD_ATA_DATA11 = PAD_ID(PD, 13), 131 - MX27_PAD_ATA_DATA12 = PAD_ID(PD, 14), 132 - MX27_PAD_ATA_DATA13 = PAD_ID(PD, 15), 133 - MX27_PAD_ATA_DATA14 = PAD_ID(PD, 16), 134 - MX27_PAD_I2C_DATA = PAD_ID(PD, 17), 135 - MX27_PAD_I2C_CLK = PAD_ID(PD, 18), 136 - MX27_PAD_CSPI2_SS2 = PAD_ID(PD, 19), 137 - MX27_PAD_CSPI2_SS1 = PAD_ID(PD, 20), 138 - MX27_PAD_CSPI2_SS0 = PAD_ID(PD, 21), 139 - MX27_PAD_CSPI2_SCLK = PAD_ID(PD, 22), 140 - MX27_PAD_CSPI2_MISO = PAD_ID(PD, 23), 141 - MX27_PAD_CSPI2_MOSI = PAD_ID(PD, 24), 142 - MX27_PAD_CSPI1_RDY = PAD_ID(PD, 25), 143 - MX27_PAD_CSPI1_SS2 = PAD_ID(PD, 26), 144 - MX27_PAD_CSPI1_SS1 = PAD_ID(PD, 27), 145 - MX27_PAD_CSPI1_SS0 = PAD_ID(PD, 28), 146 - MX27_PAD_CSPI1_SCLK = PAD_ID(PD, 29), 147 - MX27_PAD_CSPI1_MISO = PAD_ID(PD, 30), 148 - MX27_PAD_CSPI1_MOSI = PAD_ID(PD, 31), 117 + MX27_PAD_SD3_CMD = PAD_ID(MX27_PD, 0), 118 + MX27_PAD_SD3_CLK = PAD_ID(MX27_PD, 1), 119 + MX27_PAD_ATA_DATA0 = PAD_ID(MX27_PD, 2), 120 + MX27_PAD_ATA_DATA1 = PAD_ID(MX27_PD, 3), 121 + MX27_PAD_ATA_DATA2 = PAD_ID(MX27_PD, 4), 122 + MX27_PAD_ATA_DATA3 = PAD_ID(MX27_PD, 5), 123 + MX27_PAD_ATA_DATA4 = PAD_ID(MX27_PD, 6), 124 + MX27_PAD_ATA_DATA5 = PAD_ID(MX27_PD, 7), 125 + MX27_PAD_ATA_DATA6 = PAD_ID(MX27_PD, 8), 126 + MX27_PAD_ATA_DATA7 = PAD_ID(MX27_PD, 9), 127 + MX27_PAD_ATA_DATA8 = PAD_ID(MX27_PD, 10), 128 + MX27_PAD_ATA_DATA9 = PAD_ID(MX27_PD, 11), 129 + MX27_PAD_ATA_DATA10 = PAD_ID(MX27_PD, 12), 130 + MX27_PAD_ATA_DATA11 = PAD_ID(MX27_PD, 13), 131 + MX27_PAD_ATA_DATA12 = PAD_ID(MX27_PD, 14), 132 + MX27_PAD_ATA_DATA13 = PAD_ID(MX27_PD, 15), 133 + MX27_PAD_ATA_DATA14 = PAD_ID(MX27_PD, 16), 134 + MX27_PAD_I2C_DATA = PAD_ID(MX27_PD, 17), 135 + MX27_PAD_I2C_CLK = PAD_ID(MX27_PD, 18), 136 + MX27_PAD_CSPI2_SS2 = PAD_ID(MX27_PD, 19), 137 + MX27_PAD_CSPI2_SS1 = PAD_ID(MX27_PD, 20), 138 + MX27_PAD_CSPI2_SS0 = PAD_ID(MX27_PD, 21), 139 + MX27_PAD_CSPI2_SCLK = PAD_ID(MX27_PD, 22), 140 + MX27_PAD_CSPI2_MISO = PAD_ID(MX27_PD, 23), 141 + MX27_PAD_CSPI2_MOSI = PAD_ID(MX27_PD, 24), 142 + MX27_PAD_CSPI1_RDY = PAD_ID(MX27_PD, 25), 143 + MX27_PAD_CSPI1_SS2 = PAD_ID(MX27_PD, 26), 144 + MX27_PAD_CSPI1_SS1 = PAD_ID(MX27_PD, 27), 145 + MX27_PAD_CSPI1_SS0 = PAD_ID(MX27_PD, 28), 146 + MX27_PAD_CSPI1_SCLK = PAD_ID(MX27_PD, 29), 147 + MX27_PAD_CSPI1_MISO = PAD_ID(MX27_PD, 30), 148 + MX27_PAD_CSPI1_MOSI = PAD_ID(MX27_PD, 31), 149 149 150 - MX27_PAD_USBOTG_NXT = PAD_ID(PE, 0), 151 - MX27_PAD_USBOTG_STP = PAD_ID(PE, 1), 152 - MX27_PAD_USBOTG_DIR = PAD_ID(PE, 2), 153 - MX27_PAD_UART2_CTS = PAD_ID(PE, 3), 154 - MX27_PAD_UART2_RTS = PAD_ID(PE, 4), 155 - MX27_PAD_PWMO = PAD_ID(PE, 5), 156 - MX27_PAD_UART2_TXD = PAD_ID(PE, 6), 157 - MX27_PAD_UART2_RXD = PAD_ID(PE, 7), 158 - MX27_PAD_UART3_TXD = PAD_ID(PE, 8), 159 - MX27_PAD_UART3_RXD = PAD_ID(PE, 9), 160 - MX27_PAD_UART3_CTS = PAD_ID(PE, 10), 161 - MX27_PAD_UART3_RTS = PAD_ID(PE, 11), 162 - MX27_PAD_UART1_TXD = PAD_ID(PE, 12), 163 - MX27_PAD_UART1_RXD = PAD_ID(PE, 13), 164 - MX27_PAD_UART1_CTS = PAD_ID(PE, 14), 165 - MX27_PAD_UART1_RTS = PAD_ID(PE, 15), 166 - MX27_PAD_RTCK = PAD_ID(PE, 16), 167 - MX27_PAD_RESET_OUT_B = PAD_ID(PE, 17), 168 - MX27_PAD_SD1_D0 = PAD_ID(PE, 18), 169 - MX27_PAD_SD1_D1 = PAD_ID(PE, 19), 170 - MX27_PAD_SD1_D2 = PAD_ID(PE, 20), 171 - MX27_PAD_SD1_D3 = PAD_ID(PE, 21), 172 - MX27_PAD_SD1_CMD = PAD_ID(PE, 22), 173 - MX27_PAD_SD1_CLK = PAD_ID(PE, 23), 174 - MX27_PAD_USBOTG_CLK = PAD_ID(PE, 24), 175 - MX27_PAD_USBOTG_DATA7 = PAD_ID(PE, 25), 150 + MX27_PAD_USBOTG_NXT = PAD_ID(MX27_PE, 0), 151 + MX27_PAD_USBOTG_STP = PAD_ID(MX27_PE, 1), 152 + MX27_PAD_USBOTG_DIR = PAD_ID(MX27_PE, 2), 153 + MX27_PAD_UART2_CTS = PAD_ID(MX27_PE, 3), 154 + MX27_PAD_UART2_RTS = PAD_ID(MX27_PE, 4), 155 + MX27_PAD_PWMO = PAD_ID(MX27_PE, 5), 156 + MX27_PAD_UART2_TXD = PAD_ID(MX27_PE, 6), 157 + MX27_PAD_UART2_RXD = PAD_ID(MX27_PE, 7), 158 + MX27_PAD_UART3_TXD = PAD_ID(MX27_PE, 8), 159 + MX27_PAD_UART3_RXD = PAD_ID(MX27_PE, 9), 160 + MX27_PAD_UART3_CTS = PAD_ID(MX27_PE, 10), 161 + MX27_PAD_UART3_RTS = PAD_ID(MX27_PE, 11), 162 + MX27_PAD_UART1_TXD = PAD_ID(MX27_PE, 12), 163 + MX27_PAD_UART1_RXD = PAD_ID(MX27_PE, 13), 164 + MX27_PAD_UART1_CTS = PAD_ID(MX27_PE, 14), 165 + MX27_PAD_UART1_RTS = PAD_ID(MX27_PE, 15), 166 + MX27_PAD_RTCK = PAD_ID(MX27_PE, 16), 167 + MX27_PAD_RESET_OUT_B = PAD_ID(MX27_PE, 17), 168 + MX27_PAD_SD1_D0 = PAD_ID(MX27_PE, 18), 169 + MX27_PAD_SD1_D1 = PAD_ID(MX27_PE, 19), 170 + MX27_PAD_SD1_D2 = PAD_ID(MX27_PE, 20), 171 + MX27_PAD_SD1_D3 = PAD_ID(MX27_PE, 21), 172 + MX27_PAD_SD1_CMD = PAD_ID(MX27_PE, 22), 173 + MX27_PAD_SD1_CLK = PAD_ID(MX27_PE, 23), 174 + MX27_PAD_USBOTG_CLK = PAD_ID(MX27_PE, 24), 175 + MX27_PAD_USBOTG_DATA7 = PAD_ID(MX27_PE, 25), 176 176 177 - MX27_PAD_NFRB = PAD_ID(PF, 0), 178 - MX27_PAD_NFCLE = PAD_ID(PF, 1), 179 - MX27_PAD_NFWP_B = PAD_ID(PF, 2), 180 - MX27_PAD_NFCE_B = PAD_ID(PF, 3), 181 - MX27_PAD_NFALE = PAD_ID(PF, 4), 182 - MX27_PAD_NFRE_B = PAD_ID(PF, 5), 183 - MX27_PAD_NFWE_B = PAD_ID(PF, 6), 184 - MX27_PAD_PC_POE = PAD_ID(PF, 7), 185 - MX27_PAD_PC_RW_B = PAD_ID(PF, 8), 186 - MX27_PAD_IOIS16 = PAD_ID(PF, 9), 187 - MX27_PAD_PC_RST = PAD_ID(PF, 10), 188 - MX27_PAD_PC_BVD2 = PAD_ID(PF, 11), 189 - MX27_PAD_PC_BVD1 = PAD_ID(PF, 12), 190 - MX27_PAD_PC_VS2 = PAD_ID(PF, 13), 191 - MX27_PAD_PC_VS1 = PAD_ID(PF, 14), 192 - MX27_PAD_CLKO = PAD_ID(PF, 15), 193 - MX27_PAD_PC_PWRON = PAD_ID(PF, 16), 194 - MX27_PAD_PC_READY = PAD_ID(PF, 17), 195 - MX27_PAD_PC_WAIT_B = PAD_ID(PF, 18), 196 - MX27_PAD_PC_CD2_B = PAD_ID(PF, 19), 197 - MX27_PAD_PC_CD1_B = PAD_ID(PF, 20), 198 - MX27_PAD_CS4_B = PAD_ID(PF, 21), 199 - MX27_PAD_CS5_B = PAD_ID(PF, 22), 200 - MX27_PAD_ATA_DATA15 = PAD_ID(PF, 23), 177 + MX27_PAD_NFRB = PAD_ID(MX27_PF, 0), 178 + MX27_PAD_NFCLE = PAD_ID(MX27_PF, 1), 179 + MX27_PAD_NFWP_B = PAD_ID(MX27_PF, 2), 180 + MX27_PAD_NFCE_B = PAD_ID(MX27_PF, 3), 181 + MX27_PAD_NFALE = PAD_ID(MX27_PF, 4), 182 + MX27_PAD_NFRE_B = PAD_ID(MX27_PF, 5), 183 + MX27_PAD_NFWE_B = PAD_ID(MX27_PF, 6), 184 + MX27_PAD_PC_POE = PAD_ID(MX27_PF, 7), 185 + MX27_PAD_PC_RW_B = PAD_ID(MX27_PF, 8), 186 + MX27_PAD_IOIS16 = PAD_ID(MX27_PF, 9), 187 + MX27_PAD_PC_RST = PAD_ID(MX27_PF, 10), 188 + MX27_PAD_PC_BVD2 = PAD_ID(MX27_PF, 11), 189 + MX27_PAD_PC_BVD1 = PAD_ID(MX27_PF, 12), 190 + MX27_PAD_PC_VS2 = PAD_ID(MX27_PF, 13), 191 + MX27_PAD_PC_VS1 = PAD_ID(MX27_PF, 14), 192 + MX27_PAD_CLKO = PAD_ID(MX27_PF, 15), 193 + MX27_PAD_PC_PWRON = PAD_ID(MX27_PF, 16), 194 + MX27_PAD_PC_READY = PAD_ID(MX27_PF, 17), 195 + MX27_PAD_PC_WAIT_B = PAD_ID(MX27_PF, 18), 196 + MX27_PAD_PC_CD2_B = PAD_ID(MX27_PF, 19), 197 + MX27_PAD_PC_CD1_B = PAD_ID(MX27_PF, 20), 198 + MX27_PAD_CS4_B = PAD_ID(MX27_PF, 21), 199 + MX27_PAD_CS5_B = PAD_ID(MX27_PF, 22), 200 + MX27_PAD_ATA_DATA15 = PAD_ID(MX27_PF, 23), 201 201 }; 202 202 203 203 /* Pad names for the pinmux subsystem */
+1 -1
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 1792 1792 1793 1793 static struct platform_driver chv_pinctrl_driver = { 1794 1794 .probe = chv_pinctrl_probe, 1795 - .remove_new = chv_pinctrl_remove, 1795 + .remove = chv_pinctrl_remove, 1796 1796 .driver = { 1797 1797 .name = "cherryview-pinctrl", 1798 1798 .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops),
+38
drivers/pinctrl/intel/pinctrl-elkhartlake.c
··· 264 264 .ncommunities = ARRAY_SIZE(ehl_community1), 265 265 }; 266 266 267 + static const struct pinctrl_pin_desc ehl_community2_pins[] = { 268 + /* DSW */ 269 + PINCTRL_PIN(0, "BATLOWB"), 270 + PINCTRL_PIN(1, "ACPRESENT"), 271 + PINCTRL_PIN(2, "LAN_WAKEB"), 272 + PINCTRL_PIN(3, "PWRBTNB"), 273 + PINCTRL_PIN(4, "SLP_S3B"), 274 + PINCTRL_PIN(5, "SLP_S4B"), 275 + PINCTRL_PIN(6, "SLP_AB"), 276 + PINCTRL_PIN(7, "GPD_7"), 277 + PINCTRL_PIN(8, "SUSCLK"), 278 + PINCTRL_PIN(9, "SLP_WLANB"), 279 + PINCTRL_PIN(10, "SLP_S5B"), 280 + PINCTRL_PIN(11, "LANPHYPC"), 281 + PINCTRL_PIN(12, "INPUT3VSEL"), 282 + PINCTRL_PIN(13, "SLP_LANB"), 283 + PINCTRL_PIN(14, "SLP_SUSB"), 284 + PINCTRL_PIN(15, "WAKEB"), 285 + PINCTRL_PIN(16, "DRAM_RESETB"), 286 + }; 287 + 288 + static const struct intel_padgroup ehl_community2_gpps[] = { 289 + EHL_GPP(0, 0, 16), /* DSW */ 290 + }; 291 + 292 + static const struct intel_community ehl_community2[] = { 293 + EHL_COMMUNITY(0, 0, 16, ehl_community2_gpps), 294 + }; 295 + 296 + static const struct intel_pinctrl_soc_data ehl_community2_soc_data = { 297 + .uid = "2", 298 + .pins = ehl_community2_pins, 299 + .npins = ARRAY_SIZE(ehl_community2_pins), 300 + .communities = ehl_community2, 301 + .ncommunities = ARRAY_SIZE(ehl_community2), 302 + }; 303 + 267 304 static const struct pinctrl_pin_desc ehl_community3_pins[] = { 268 305 /* CPU */ 269 306 PINCTRL_PIN(0, "HDACPU_SDI"), ··· 511 474 static const struct intel_pinctrl_soc_data *ehl_soc_data_array[] = { 512 475 &ehl_community0_soc_data, 513 476 &ehl_community1_soc_data, 477 + &ehl_community2_soc_data, 514 478 &ehl_community3_soc_data, 515 479 &ehl_community4_soc_data, 516 480 &ehl_community5_soc_data,
+12
drivers/pinctrl/intel/pinctrl-intel.c
··· 85 85 #define PADCFG1_TERM_UP BIT(13) 86 86 #define PADCFG1_TERM_SHIFT 10 87 87 #define PADCFG1_TERM_MASK GENMASK(12, 10) 88 + /* 89 + * Bit 0 Bit 1 Bit 2 Value, Ohms 90 + * 91 + * 0 0 0 - 92 + * 0 0 1 20000 93 + * 0 1 0 5000 94 + * 0 1 1 ~4000 95 + * 1 0 0 1000 (if supported) 96 + * 1 0 1 ~952 (if supported) 97 + * 1 1 0 ~833 (if supported) 98 + * 1 1 1 ~800 (if supported) 99 + */ 88 100 #define PADCFG1_TERM_20K BIT(2) 89 101 #define PADCFG1_TERM_5K BIT(1) 90 102 #define PADCFG1_TERM_4K (BIT(2) | BIT(1))
+16 -1
drivers/pinctrl/mediatek/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 menu "MediaTek pinctrl drivers" 3 - depends on ARCH_MEDIATEK || RALINK || COMPILE_TEST 3 + depends on ARCH_MEDIATEK || ARCH_AIROHA || RALINK || COMPILE_TEST 4 4 5 5 config EINT_MTK 6 6 tristate "MediaTek External Interrupt Support" ··· 126 126 select PINCTRL_MTK 127 127 128 128 # For ARMv8 SoCs 129 + config PINCTRL_AIROHA 130 + tristate "Airoha EN7581 pin control" 131 + depends on OF 132 + depends on ARM64 || COMPILE_TEST 133 + select PINMUX 134 + select GENERIC_PINCONF 135 + select GENERIC_PINCTRL_GROUPS 136 + select GENERIC_PINMUX_FUNCTIONS 137 + select GPIOLIB 138 + select GPIOLIB_IRQCHIP 139 + select REGMAP_MMIO 140 + help 141 + Say yes here to support pin controller and gpio driver 142 + on Airoha EN7581 SoC. 143 + 129 144 config PINCTRL_MT2712 130 145 bool "MediaTek MT2712 pin control" 131 146 depends on OF
+1
drivers/pinctrl/mediatek/Makefile
··· 8 8 obj-$(CONFIG_PINCTRL_MTK_PARIS) += pinctrl-paris.o 9 9 10 10 # SoC Drivers 11 + obj-$(CONFIG_PINCTRL_AIROHA) += pinctrl-airoha.o 11 12 obj-$(CONFIG_PINCTRL_MT7620) += pinctrl-mt7620.o 12 13 obj-$(CONFIG_PINCTRL_MT7621) += pinctrl-mt7621.o 13 14 obj-$(CONFIG_PINCTRL_MT76X8) += pinctrl-mt76x8.o
+2971
drivers/pinctrl/mediatek/pinctrl-airoha.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Author: Lorenzo Bianconi <lorenzo@kernel.org> 4 + * Author: Benjamin Larsson <benjamin.larsson@genexis.eu> 5 + * Author: Markus Gothe <markus.gothe@genexis.eu> 6 + */ 7 + 8 + #include <dt-bindings/pinctrl/mt65xx.h> 9 + #include <linux/bits.h> 10 + #include <linux/cleanup.h> 11 + #include <linux/gpio/driver.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/io.h> 14 + #include <linux/irq.h> 15 + #include <linux/irqdomain.h> 16 + #include <linux/mfd/syscon.h> 17 + #include <linux/of.h> 18 + #include <linux/of_irq.h> 19 + #include <linux/of_platform.h> 20 + #include <linux/pinctrl/consumer.h> 21 + #include <linux/pinctrl/pinctrl.h> 22 + #include <linux/pinctrl/pinconf.h> 23 + #include <linux/pinctrl/pinconf-generic.h> 24 + #include <linux/pinctrl/pinmux.h> 25 + #include <linux/platform_device.h> 26 + #include <linux/regmap.h> 27 + 28 + #include "../core.h" 29 + #include "../pinconf.h" 30 + #include "../pinmux.h" 31 + 32 + #define PINCTRL_PIN_GROUP(id) \ 33 + PINCTRL_PINGROUP(#id, id##_pins, ARRAY_SIZE(id##_pins)) 34 + 35 + #define PINCTRL_FUNC_DESC(id) \ 36 + { \ 37 + .desc = { \ 38 + .func = { \ 39 + .name = #id, \ 40 + .groups = id##_groups, \ 41 + .ngroups = ARRAY_SIZE(id##_groups), \ 42 + } \ 43 + }, \ 44 + .groups = id##_func_group, \ 45 + .group_size = ARRAY_SIZE(id##_func_group), \ 46 + } 47 + 48 + #define PINCTRL_CONF_DESC(p, offset, mask) \ 49 + { \ 50 + .pin = p, \ 51 + .reg = { offset, mask }, \ 52 + } 53 + 54 + /* MUX */ 55 + #define REG_GPIO_2ND_I2C_MODE 0x0214 56 + #define GPIO_MDC_IO_MASTER_MODE_MODE BIT(14) 57 + #define GPIO_I2C_MASTER_MODE_MODE BIT(13) 58 + #define GPIO_I2S_MODE_MASK BIT(12) 59 + #define GPIO_I2C_SLAVE_MODE_MODE BIT(11) 60 + #define GPIO_LAN3_LED1_MODE_MASK BIT(10) 61 + #define GPIO_LAN3_LED0_MODE_MASK BIT(9) 62 + #define GPIO_LAN2_LED1_MODE_MASK BIT(8) 63 + #define GPIO_LAN2_LED0_MODE_MASK BIT(7) 64 + #define GPIO_LAN1_LED1_MODE_MASK BIT(6) 65 + #define GPIO_LAN1_LED0_MODE_MASK BIT(5) 66 + #define GPIO_LAN0_LED1_MODE_MASK BIT(4) 67 + #define GPIO_LAN0_LED0_MODE_MASK BIT(3) 68 + #define PON_TOD_1PPS_MODE_MASK BIT(2) 69 + #define GSW_TOD_1PPS_MODE_MASK BIT(1) 70 + #define GPIO_2ND_I2C_MODE_MASK BIT(0) 71 + 72 + #define REG_GPIO_SPI_CS1_MODE 0x0218 73 + #define GPIO_PCM_SPI_CS4_MODE_MASK BIT(21) 74 + #define GPIO_PCM_SPI_CS3_MODE_MASK BIT(20) 75 + #define GPIO_PCM_SPI_CS2_MODE_P156_MASK BIT(19) 76 + #define GPIO_PCM_SPI_CS2_MODE_P128_MASK BIT(18) 77 + #define GPIO_PCM_SPI_CS1_MODE_MASK BIT(17) 78 + #define GPIO_PCM_SPI_MODE_MASK BIT(16) 79 + #define GPIO_PCM2_MODE_MASK BIT(13) 80 + #define GPIO_PCM1_MODE_MASK BIT(12) 81 + #define GPIO_PCM_INT_MODE_MASK BIT(9) 82 + #define GPIO_PCM_RESET_MODE_MASK BIT(8) 83 + #define GPIO_SPI_QUAD_MODE_MASK BIT(4) 84 + #define GPIO_SPI_CS4_MODE_MASK BIT(3) 85 + #define GPIO_SPI_CS3_MODE_MASK BIT(2) 86 + #define GPIO_SPI_CS2_MODE_MASK BIT(1) 87 + #define GPIO_SPI_CS1_MODE_MASK BIT(0) 88 + 89 + #define REG_GPIO_PON_MODE 0x021c 90 + #define GPIO_PARALLEL_NAND_MODE_MASK BIT(14) 91 + #define GPIO_SGMII_MDIO_MODE_MASK BIT(13) 92 + #define GPIO_PCIE_RESET2_MASK BIT(12) 93 + #define SIPO_RCLK_MODE_MASK BIT(11) 94 + #define GPIO_PCIE_RESET1_MASK BIT(10) 95 + #define GPIO_PCIE_RESET0_MASK BIT(9) 96 + #define GPIO_UART5_MODE_MASK BIT(8) 97 + #define GPIO_UART4_MODE_MASK BIT(7) 98 + #define GPIO_HSUART_CTS_RTS_MODE_MASK BIT(6) 99 + #define GPIO_HSUART_MODE_MASK BIT(5) 100 + #define GPIO_UART2_CTS_RTS_MODE_MASK BIT(4) 101 + #define GPIO_UART2_MODE_MASK BIT(3) 102 + #define GPIO_SIPO_MODE_MASK BIT(2) 103 + #define GPIO_EMMC_MODE_MASK BIT(1) 104 + #define GPIO_PON_MODE_MASK BIT(0) 105 + 106 + #define REG_NPU_UART_EN 0x0224 107 + #define JTAG_UDI_EN_MASK BIT(4) 108 + #define JTAG_DFD_EN_MASK BIT(3) 109 + 110 + /* LED MAP */ 111 + #define REG_LAN_LED0_MAPPING 0x027c 112 + #define REG_LAN_LED1_MAPPING 0x0280 113 + 114 + #define LAN4_LED_MAPPING_MASK GENMASK(18, 16) 115 + #define LAN4_PHY4_LED_MAP BIT(18) 116 + #define LAN4_PHY2_LED_MAP BIT(17) 117 + #define LAN4_PHY1_LED_MAP BIT(16) 118 + #define LAN4_PHY0_LED_MAP 0 119 + #define LAN4_PHY3_LED_MAP GENMASK(17, 16) 120 + 121 + #define LAN3_LED_MAPPING_MASK GENMASK(14, 12) 122 + #define LAN3_PHY4_LED_MAP BIT(14) 123 + #define LAN3_PHY2_LED_MAP BIT(13) 124 + #define LAN3_PHY1_LED_MAP BIT(12) 125 + #define LAN3_PHY0_LED_MAP 0 126 + #define LAN3_PHY3_LED_MAP GENMASK(13, 12) 127 + 128 + #define LAN2_LED_MAPPING_MASK GENMASK(10, 8) 129 + #define LAN2_PHY4_LED_MAP BIT(12) 130 + #define LAN2_PHY2_LED_MAP BIT(11) 131 + #define LAN2_PHY1_LED_MAP BIT(10) 132 + #define LAN2_PHY0_LED_MAP 0 133 + #define LAN2_PHY3_LED_MAP GENMASK(11, 10) 134 + 135 + #define LAN1_LED_MAPPING_MASK GENMASK(6, 4) 136 + #define LAN1_PHY4_LED_MAP BIT(6) 137 + #define LAN1_PHY2_LED_MAP BIT(5) 138 + #define LAN1_PHY1_LED_MAP BIT(4) 139 + #define LAN1_PHY0_LED_MAP 0 140 + #define LAN1_PHY3_LED_MAP GENMASK(5, 4) 141 + 142 + #define LAN0_LED_MAPPING_MASK GENMASK(2, 0) 143 + #define LAN0_PHY4_LED_MAP BIT(3) 144 + #define LAN0_PHY2_LED_MAP BIT(2) 145 + #define LAN0_PHY1_LED_MAP BIT(1) 146 + #define LAN0_PHY0_LED_MAP 0 147 + #define LAN0_PHY3_LED_MAP GENMASK(2, 1) 148 + 149 + /* CONF */ 150 + #define REG_I2C_SDA_E2 0x001c 151 + #define SPI_MISO_E2_MASK BIT(14) 152 + #define SPI_MOSI_E2_MASK BIT(13) 153 + #define SPI_CLK_E2_MASK BIT(12) 154 + #define SPI_CS0_E2_MASK BIT(11) 155 + #define PCIE2_RESET_E2_MASK BIT(10) 156 + #define PCIE1_RESET_E2_MASK BIT(9) 157 + #define PCIE0_RESET_E2_MASK BIT(8) 158 + #define UART1_RXD_E2_MASK BIT(3) 159 + #define UART1_TXD_E2_MASK BIT(2) 160 + #define I2C_SCL_E2_MASK BIT(1) 161 + #define I2C_SDA_E2_MASK BIT(0) 162 + 163 + #define REG_I2C_SDA_E4 0x0020 164 + #define SPI_MISO_E4_MASK BIT(14) 165 + #define SPI_MOSI_E4_MASK BIT(13) 166 + #define SPI_CLK_E4_MASK BIT(12) 167 + #define SPI_CS0_E4_MASK BIT(11) 168 + #define PCIE2_RESET_E4_MASK BIT(10) 169 + #define PCIE1_RESET_E4_MASK BIT(9) 170 + #define PCIE0_RESET_E4_MASK BIT(8) 171 + #define UART1_RXD_E4_MASK BIT(3) 172 + #define UART1_TXD_E4_MASK BIT(2) 173 + #define I2C_SCL_E4_MASK BIT(1) 174 + #define I2C_SDA_E4_MASK BIT(0) 175 + 176 + #define REG_GPIO_L_E2 0x0024 177 + #define REG_GPIO_L_E4 0x0028 178 + #define REG_GPIO_H_E2 0x002c 179 + #define REG_GPIO_H_E4 0x0030 180 + 181 + #define REG_I2C_SDA_PU 0x0044 182 + #define SPI_MISO_PU_MASK BIT(14) 183 + #define SPI_MOSI_PU_MASK BIT(13) 184 + #define SPI_CLK_PU_MASK BIT(12) 185 + #define SPI_CS0_PU_MASK BIT(11) 186 + #define PCIE2_RESET_PU_MASK BIT(10) 187 + #define PCIE1_RESET_PU_MASK BIT(9) 188 + #define PCIE0_RESET_PU_MASK BIT(8) 189 + #define UART1_RXD_PU_MASK BIT(3) 190 + #define UART1_TXD_PU_MASK BIT(2) 191 + #define I2C_SCL_PU_MASK BIT(1) 192 + #define I2C_SDA_PU_MASK BIT(0) 193 + 194 + #define REG_I2C_SDA_PD 0x0048 195 + #define SPI_MISO_PD_MASK BIT(14) 196 + #define SPI_MOSI_PD_MASK BIT(13) 197 + #define SPI_CLK_PD_MASK BIT(12) 198 + #define SPI_CS0_PD_MASK BIT(11) 199 + #define PCIE2_RESET_PD_MASK BIT(10) 200 + #define PCIE1_RESET_PD_MASK BIT(9) 201 + #define PCIE0_RESET_PD_MASK BIT(8) 202 + #define UART1_RXD_PD_MASK BIT(3) 203 + #define UART1_TXD_PD_MASK BIT(2) 204 + #define I2C_SCL_PD_MASK BIT(1) 205 + #define I2C_SDA_PD_MASK BIT(0) 206 + 207 + #define REG_GPIO_L_PU 0x004c 208 + #define REG_GPIO_L_PD 0x0050 209 + #define REG_GPIO_H_PU 0x0054 210 + #define REG_GPIO_H_PD 0x0058 211 + 212 + #define REG_PCIE_RESET_OD 0x018c 213 + #define PCIE2_RESET_OD_MASK BIT(2) 214 + #define PCIE1_RESET_OD_MASK BIT(1) 215 + #define PCIE0_RESET_OD_MASK BIT(0) 216 + 217 + /* GPIOs */ 218 + #define REG_GPIO_CTRL 0x0000 219 + #define REG_GPIO_DATA 0x0004 220 + #define REG_GPIO_INT 0x0008 221 + #define REG_GPIO_INT_EDGE 0x000c 222 + #define REG_GPIO_INT_LEVEL 0x0010 223 + #define REG_GPIO_OE 0x0014 224 + #define REG_GPIO_CTRL1 0x0020 225 + 226 + /* PWM MODE CONF */ 227 + #define REG_GPIO_FLASH_MODE_CFG 0x0034 228 + #define GPIO15_FLASH_MODE_CFG BIT(15) 229 + #define GPIO14_FLASH_MODE_CFG BIT(14) 230 + #define GPIO13_FLASH_MODE_CFG BIT(13) 231 + #define GPIO12_FLASH_MODE_CFG BIT(12) 232 + #define GPIO11_FLASH_MODE_CFG BIT(11) 233 + #define GPIO10_FLASH_MODE_CFG BIT(10) 234 + #define GPIO9_FLASH_MODE_CFG BIT(9) 235 + #define GPIO8_FLASH_MODE_CFG BIT(8) 236 + #define GPIO7_FLASH_MODE_CFG BIT(7) 237 + #define GPIO6_FLASH_MODE_CFG BIT(6) 238 + #define GPIO5_FLASH_MODE_CFG BIT(5) 239 + #define GPIO4_FLASH_MODE_CFG BIT(4) 240 + #define GPIO3_FLASH_MODE_CFG BIT(3) 241 + #define GPIO2_FLASH_MODE_CFG BIT(2) 242 + #define GPIO1_FLASH_MODE_CFG BIT(1) 243 + #define GPIO0_FLASH_MODE_CFG BIT(0) 244 + 245 + #define REG_GPIO_CTRL2 0x0060 246 + #define REG_GPIO_CTRL3 0x0064 247 + 248 + /* PWM MODE CONF EXT */ 249 + #define REG_GPIO_FLASH_MODE_CFG_EXT 0x0068 250 + #define GPIO51_FLASH_MODE_CFG BIT(31) 251 + #define GPIO50_FLASH_MODE_CFG BIT(30) 252 + #define GPIO49_FLASH_MODE_CFG BIT(29) 253 + #define GPIO48_FLASH_MODE_CFG BIT(28) 254 + #define GPIO47_FLASH_MODE_CFG BIT(27) 255 + #define GPIO46_FLASH_MODE_CFG BIT(26) 256 + #define GPIO45_FLASH_MODE_CFG BIT(25) 257 + #define GPIO44_FLASH_MODE_CFG BIT(24) 258 + #define GPIO43_FLASH_MODE_CFG BIT(23) 259 + #define GPIO42_FLASH_MODE_CFG BIT(22) 260 + #define GPIO41_FLASH_MODE_CFG BIT(21) 261 + #define GPIO40_FLASH_MODE_CFG BIT(20) 262 + #define GPIO39_FLASH_MODE_CFG BIT(19) 263 + #define GPIO38_FLASH_MODE_CFG BIT(18) 264 + #define GPIO37_FLASH_MODE_CFG BIT(17) 265 + #define GPIO36_FLASH_MODE_CFG BIT(16) 266 + #define GPIO31_FLASH_MODE_CFG BIT(15) 267 + #define GPIO30_FLASH_MODE_CFG BIT(14) 268 + #define GPIO29_FLASH_MODE_CFG BIT(13) 269 + #define GPIO28_FLASH_MODE_CFG BIT(12) 270 + #define GPIO27_FLASH_MODE_CFG BIT(11) 271 + #define GPIO26_FLASH_MODE_CFG BIT(10) 272 + #define GPIO25_FLASH_MODE_CFG BIT(9) 273 + #define GPIO24_FLASH_MODE_CFG BIT(8) 274 + #define GPIO23_FLASH_MODE_CFG BIT(7) 275 + #define GPIO22_FLASH_MODE_CFG BIT(6) 276 + #define GPIO21_FLASH_MODE_CFG BIT(5) 277 + #define GPIO20_FLASH_MODE_CFG BIT(4) 278 + #define GPIO19_FLASH_MODE_CFG BIT(3) 279 + #define GPIO18_FLASH_MODE_CFG BIT(2) 280 + #define GPIO17_FLASH_MODE_CFG BIT(1) 281 + #define GPIO16_FLASH_MODE_CFG BIT(0) 282 + 283 + #define REG_GPIO_DATA1 0x0070 284 + #define REG_GPIO_OE1 0x0078 285 + #define REG_GPIO_INT1 0x007c 286 + #define REG_GPIO_INT_EDGE1 0x0080 287 + #define REG_GPIO_INT_EDGE2 0x0084 288 + #define REG_GPIO_INT_EDGE3 0x0088 289 + #define REG_GPIO_INT_LEVEL1 0x008c 290 + #define REG_GPIO_INT_LEVEL2 0x0090 291 + #define REG_GPIO_INT_LEVEL3 0x0094 292 + 293 + #define AIROHA_NUM_PINS 64 294 + #define AIROHA_PIN_BANK_SIZE (AIROHA_NUM_PINS / 2) 295 + #define AIROHA_REG_GPIOCTRL_NUM_PIN (AIROHA_NUM_PINS / 4) 296 + 297 + static const u32 gpio_data_regs[] = { 298 + REG_GPIO_DATA, 299 + REG_GPIO_DATA1 300 + }; 301 + 302 + static const u32 gpio_out_regs[] = { 303 + REG_GPIO_OE, 304 + REG_GPIO_OE1 305 + }; 306 + 307 + static const u32 gpio_dir_regs[] = { 308 + REG_GPIO_CTRL, 309 + REG_GPIO_CTRL1, 310 + REG_GPIO_CTRL2, 311 + REG_GPIO_CTRL3 312 + }; 313 + 314 + static const u32 irq_status_regs[] = { 315 + REG_GPIO_INT, 316 + REG_GPIO_INT1 317 + }; 318 + 319 + static const u32 irq_level_regs[] = { 320 + REG_GPIO_INT_LEVEL, 321 + REG_GPIO_INT_LEVEL1, 322 + REG_GPIO_INT_LEVEL2, 323 + REG_GPIO_INT_LEVEL3 324 + }; 325 + 326 + static const u32 irq_edge_regs[] = { 327 + REG_GPIO_INT_EDGE, 328 + REG_GPIO_INT_EDGE1, 329 + REG_GPIO_INT_EDGE2, 330 + REG_GPIO_INT_EDGE3 331 + }; 332 + 333 + struct airoha_pinctrl_reg { 334 + u32 offset; 335 + u32 mask; 336 + }; 337 + 338 + enum airoha_pinctrl_mux_func { 339 + AIROHA_FUNC_MUX, 340 + AIROHA_FUNC_PWM_MUX, 341 + AIROHA_FUNC_PWM_EXT_MUX, 342 + }; 343 + 344 + struct airoha_pinctrl_func_group { 345 + const char *name; 346 + struct { 347 + enum airoha_pinctrl_mux_func mux; 348 + u32 offset; 349 + u32 mask; 350 + u32 val; 351 + } regmap[2]; 352 + int regmap_size; 353 + }; 354 + 355 + struct airoha_pinctrl_func { 356 + const struct function_desc desc; 357 + const struct airoha_pinctrl_func_group *groups; 358 + u8 group_size; 359 + }; 360 + 361 + struct airoha_pinctrl_conf { 362 + u32 pin; 363 + struct airoha_pinctrl_reg reg; 364 + }; 365 + 366 + struct airoha_pinctrl_gpiochip { 367 + struct gpio_chip chip; 368 + 369 + /* gpio */ 370 + const u32 *data; 371 + const u32 *dir; 372 + const u32 *out; 373 + /* irq */ 374 + const u32 *status; 375 + const u32 *level; 376 + const u32 *edge; 377 + 378 + u32 irq_type[AIROHA_NUM_PINS]; 379 + }; 380 + 381 + struct airoha_pinctrl { 382 + struct pinctrl_dev *ctrl; 383 + 384 + struct regmap *chip_scu; 385 + struct regmap *regmap; 386 + 387 + struct airoha_pinctrl_gpiochip gpiochip; 388 + }; 389 + 390 + static struct pinctrl_pin_desc airoha_pinctrl_pins[] = { 391 + PINCTRL_PIN(0, "uart1_txd"), 392 + PINCTRL_PIN(1, "uart1_rxd"), 393 + PINCTRL_PIN(2, "i2c_scl"), 394 + PINCTRL_PIN(3, "i2c_sda"), 395 + PINCTRL_PIN(4, "spi_cs0"), 396 + PINCTRL_PIN(5, "spi_clk"), 397 + PINCTRL_PIN(6, "spi_mosi"), 398 + PINCTRL_PIN(7, "spi_miso"), 399 + PINCTRL_PIN(13, "gpio0"), 400 + PINCTRL_PIN(14, "gpio1"), 401 + PINCTRL_PIN(15, "gpio2"), 402 + PINCTRL_PIN(16, "gpio3"), 403 + PINCTRL_PIN(17, "gpio4"), 404 + PINCTRL_PIN(18, "gpio5"), 405 + PINCTRL_PIN(19, "gpio6"), 406 + PINCTRL_PIN(20, "gpio7"), 407 + PINCTRL_PIN(21, "gpio8"), 408 + PINCTRL_PIN(22, "gpio9"), 409 + PINCTRL_PIN(23, "gpio10"), 410 + PINCTRL_PIN(24, "gpio11"), 411 + PINCTRL_PIN(25, "gpio12"), 412 + PINCTRL_PIN(26, "gpio13"), 413 + PINCTRL_PIN(27, "gpio14"), 414 + PINCTRL_PIN(28, "gpio15"), 415 + PINCTRL_PIN(29, "gpio16"), 416 + PINCTRL_PIN(30, "gpio17"), 417 + PINCTRL_PIN(31, "gpio18"), 418 + PINCTRL_PIN(32, "gpio19"), 419 + PINCTRL_PIN(33, "gpio20"), 420 + PINCTRL_PIN(34, "gpio21"), 421 + PINCTRL_PIN(35, "gpio22"), 422 + PINCTRL_PIN(36, "gpio23"), 423 + PINCTRL_PIN(37, "gpio24"), 424 + PINCTRL_PIN(38, "gpio25"), 425 + PINCTRL_PIN(39, "gpio26"), 426 + PINCTRL_PIN(40, "gpio27"), 427 + PINCTRL_PIN(41, "gpio28"), 428 + PINCTRL_PIN(42, "gpio29"), 429 + PINCTRL_PIN(43, "gpio30"), 430 + PINCTRL_PIN(44, "gpio31"), 431 + PINCTRL_PIN(45, "gpio32"), 432 + PINCTRL_PIN(46, "gpio33"), 433 + PINCTRL_PIN(47, "gpio34"), 434 + PINCTRL_PIN(48, "gpio35"), 435 + PINCTRL_PIN(49, "gpio36"), 436 + PINCTRL_PIN(50, "gpio37"), 437 + PINCTRL_PIN(51, "gpio38"), 438 + PINCTRL_PIN(52, "gpio39"), 439 + PINCTRL_PIN(53, "gpio40"), 440 + PINCTRL_PIN(54, "gpio41"), 441 + PINCTRL_PIN(55, "gpio42"), 442 + PINCTRL_PIN(56, "gpio43"), 443 + PINCTRL_PIN(57, "gpio44"), 444 + PINCTRL_PIN(58, "gpio45"), 445 + PINCTRL_PIN(59, "gpio46"), 446 + PINCTRL_PIN(61, "pcie_reset0"), 447 + PINCTRL_PIN(62, "pcie_reset1"), 448 + PINCTRL_PIN(63, "pcie_reset2"), 449 + }; 450 + 451 + static const int pon_pins[] = { 49, 50, 51, 52, 53, 54 }; 452 + static const int pon_tod_1pps_pins[] = { 46 }; 453 + static const int gsw_tod_1pps_pins[] = { 46 }; 454 + static const int sipo_pins[] = { 16, 17 }; 455 + static const int sipo_rclk_pins[] = { 16, 17, 43 }; 456 + static const int mdio_pins[] = { 14, 15 }; 457 + static const int uart2_pins[] = { 48, 55 }; 458 + static const int uart2_cts_rts_pins[] = { 46, 47 }; 459 + static const int hsuart_pins[] = { 28, 29 }; 460 + static const int hsuart_cts_rts_pins[] = { 26, 27 }; 461 + static const int uart4_pins[] = { 38, 39 }; 462 + static const int uart5_pins[] = { 18, 19 }; 463 + static const int i2c0_pins[] = { 2, 3 }; 464 + static const int i2c1_pins[] = { 14, 15 }; 465 + static const int jtag_udi_pins[] = { 16, 17, 18, 19, 20 }; 466 + static const int jtag_dfd_pins[] = { 16, 17, 18, 19, 20 }; 467 + static const int i2s_pins[] = { 26, 27, 28, 29 }; 468 + static const int pcm1_pins[] = { 22, 23, 24, 25 }; 469 + static const int pcm2_pins[] = { 18, 19, 20, 21 }; 470 + static const int spi_quad_pins[] = { 32, 33 }; 471 + static const int spi_pins[] = { 4, 5, 6, 7 }; 472 + static const int spi_cs1_pins[] = { 34 }; 473 + static const int pcm_spi_pins[] = { 18, 19, 20, 21, 22, 23, 24, 25 }; 474 + static const int pcm_spi_int_pins[] = { 14 }; 475 + static const int pcm_spi_rst_pins[] = { 15 }; 476 + static const int pcm_spi_cs1_pins[] = { 43 }; 477 + static const int pcm_spi_cs2_pins[] = { 40 }; 478 + static const int pcm_spi_cs2_p128_pins[] = { 40 }; 479 + static const int pcm_spi_cs2_p156_pins[] = { 40 }; 480 + static const int pcm_spi_cs3_pins[] = { 41 }; 481 + static const int pcm_spi_cs4_pins[] = { 42 }; 482 + static const int emmc_pins[] = { 4, 5, 6, 30, 31, 32, 33, 34, 35, 36, 37 }; 483 + static const int pnand_pins[] = { 4, 5, 6, 7, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 }; 484 + static const int gpio0_pins[] = { 13 }; 485 + static const int gpio1_pins[] = { 14 }; 486 + static const int gpio2_pins[] = { 15 }; 487 + static const int gpio3_pins[] = { 16 }; 488 + static const int gpio4_pins[] = { 17 }; 489 + static const int gpio5_pins[] = { 18 }; 490 + static const int gpio6_pins[] = { 19 }; 491 + static const int gpio7_pins[] = { 20 }; 492 + static const int gpio8_pins[] = { 21 }; 493 + static const int gpio9_pins[] = { 22 }; 494 + static const int gpio10_pins[] = { 23 }; 495 + static const int gpio11_pins[] = { 24 }; 496 + static const int gpio12_pins[] = { 25 }; 497 + static const int gpio13_pins[] = { 26 }; 498 + static const int gpio14_pins[] = { 27 }; 499 + static const int gpio15_pins[] = { 28 }; 500 + static const int gpio16_pins[] = { 29 }; 501 + static const int gpio17_pins[] = { 30 }; 502 + static const int gpio18_pins[] = { 31 }; 503 + static const int gpio19_pins[] = { 32 }; 504 + static const int gpio20_pins[] = { 33 }; 505 + static const int gpio21_pins[] = { 34 }; 506 + static const int gpio22_pins[] = { 35 }; 507 + static const int gpio23_pins[] = { 36 }; 508 + static const int gpio24_pins[] = { 37 }; 509 + static const int gpio25_pins[] = { 38 }; 510 + static const int gpio26_pins[] = { 39 }; 511 + static const int gpio27_pins[] = { 40 }; 512 + static const int gpio28_pins[] = { 41 }; 513 + static const int gpio29_pins[] = { 42 }; 514 + static const int gpio30_pins[] = { 43 }; 515 + static const int gpio31_pins[] = { 44 }; 516 + static const int gpio33_pins[] = { 46 }; 517 + static const int gpio34_pins[] = { 47 }; 518 + static const int gpio35_pins[] = { 48 }; 519 + static const int gpio36_pins[] = { 49 }; 520 + static const int gpio37_pins[] = { 50 }; 521 + static const int gpio38_pins[] = { 51 }; 522 + static const int gpio39_pins[] = { 52 }; 523 + static const int gpio40_pins[] = { 53 }; 524 + static const int gpio41_pins[] = { 54 }; 525 + static const int gpio42_pins[] = { 55 }; 526 + static const int gpio43_pins[] = { 56 }; 527 + static const int gpio44_pins[] = { 57 }; 528 + static const int gpio45_pins[] = { 58 }; 529 + static const int gpio46_pins[] = { 59 }; 530 + static const int pcie_reset0_pins[] = { 61 }; 531 + static const int pcie_reset1_pins[] = { 62 }; 532 + static const int pcie_reset2_pins[] = { 63 }; 533 + 534 + static const struct pingroup airoha_pinctrl_groups[] = { 535 + PINCTRL_PIN_GROUP(pon), 536 + PINCTRL_PIN_GROUP(pon_tod_1pps), 537 + PINCTRL_PIN_GROUP(gsw_tod_1pps), 538 + PINCTRL_PIN_GROUP(sipo), 539 + PINCTRL_PIN_GROUP(sipo_rclk), 540 + PINCTRL_PIN_GROUP(mdio), 541 + PINCTRL_PIN_GROUP(uart2), 542 + PINCTRL_PIN_GROUP(uart2_cts_rts), 543 + PINCTRL_PIN_GROUP(hsuart), 544 + PINCTRL_PIN_GROUP(hsuart_cts_rts), 545 + PINCTRL_PIN_GROUP(uart4), 546 + PINCTRL_PIN_GROUP(uart5), 547 + PINCTRL_PIN_GROUP(i2c0), 548 + PINCTRL_PIN_GROUP(i2c1), 549 + PINCTRL_PIN_GROUP(jtag_udi), 550 + PINCTRL_PIN_GROUP(jtag_dfd), 551 + PINCTRL_PIN_GROUP(i2s), 552 + PINCTRL_PIN_GROUP(pcm1), 553 + PINCTRL_PIN_GROUP(pcm2), 554 + PINCTRL_PIN_GROUP(spi), 555 + PINCTRL_PIN_GROUP(spi_quad), 556 + PINCTRL_PIN_GROUP(spi_cs1), 557 + PINCTRL_PIN_GROUP(pcm_spi), 558 + PINCTRL_PIN_GROUP(pcm_spi_int), 559 + PINCTRL_PIN_GROUP(pcm_spi_rst), 560 + PINCTRL_PIN_GROUP(pcm_spi_cs1), 561 + PINCTRL_PIN_GROUP(pcm_spi_cs2_p128), 562 + PINCTRL_PIN_GROUP(pcm_spi_cs2_p156), 563 + PINCTRL_PIN_GROUP(pcm_spi_cs2), 564 + PINCTRL_PIN_GROUP(pcm_spi_cs3), 565 + PINCTRL_PIN_GROUP(pcm_spi_cs4), 566 + PINCTRL_PIN_GROUP(emmc), 567 + PINCTRL_PIN_GROUP(pnand), 568 + PINCTRL_PIN_GROUP(gpio0), 569 + PINCTRL_PIN_GROUP(gpio1), 570 + PINCTRL_PIN_GROUP(gpio2), 571 + PINCTRL_PIN_GROUP(gpio3), 572 + PINCTRL_PIN_GROUP(gpio4), 573 + PINCTRL_PIN_GROUP(gpio5), 574 + PINCTRL_PIN_GROUP(gpio6), 575 + PINCTRL_PIN_GROUP(gpio7), 576 + PINCTRL_PIN_GROUP(gpio8), 577 + PINCTRL_PIN_GROUP(gpio9), 578 + PINCTRL_PIN_GROUP(gpio10), 579 + PINCTRL_PIN_GROUP(gpio11), 580 + PINCTRL_PIN_GROUP(gpio12), 581 + PINCTRL_PIN_GROUP(gpio13), 582 + PINCTRL_PIN_GROUP(gpio14), 583 + PINCTRL_PIN_GROUP(gpio15), 584 + PINCTRL_PIN_GROUP(gpio16), 585 + PINCTRL_PIN_GROUP(gpio17), 586 + PINCTRL_PIN_GROUP(gpio18), 587 + PINCTRL_PIN_GROUP(gpio19), 588 + PINCTRL_PIN_GROUP(gpio20), 589 + PINCTRL_PIN_GROUP(gpio21), 590 + PINCTRL_PIN_GROUP(gpio22), 591 + PINCTRL_PIN_GROUP(gpio23), 592 + PINCTRL_PIN_GROUP(gpio24), 593 + PINCTRL_PIN_GROUP(gpio25), 594 + PINCTRL_PIN_GROUP(gpio26), 595 + PINCTRL_PIN_GROUP(gpio27), 596 + PINCTRL_PIN_GROUP(gpio28), 597 + PINCTRL_PIN_GROUP(gpio29), 598 + PINCTRL_PIN_GROUP(gpio30), 599 + PINCTRL_PIN_GROUP(gpio31), 600 + PINCTRL_PIN_GROUP(gpio33), 601 + PINCTRL_PIN_GROUP(gpio34), 602 + PINCTRL_PIN_GROUP(gpio35), 603 + PINCTRL_PIN_GROUP(gpio36), 604 + PINCTRL_PIN_GROUP(gpio37), 605 + PINCTRL_PIN_GROUP(gpio38), 606 + PINCTRL_PIN_GROUP(gpio39), 607 + PINCTRL_PIN_GROUP(gpio40), 608 + PINCTRL_PIN_GROUP(gpio41), 609 + PINCTRL_PIN_GROUP(gpio42), 610 + PINCTRL_PIN_GROUP(gpio43), 611 + PINCTRL_PIN_GROUP(gpio44), 612 + PINCTRL_PIN_GROUP(gpio45), 613 + PINCTRL_PIN_GROUP(gpio46), 614 + PINCTRL_PIN_GROUP(pcie_reset0), 615 + PINCTRL_PIN_GROUP(pcie_reset1), 616 + PINCTRL_PIN_GROUP(pcie_reset2), 617 + }; 618 + 619 + static const char *const pon_groups[] = { "pon" }; 620 + static const char *const tod_1pps_groups[] = { "pon_tod_1pps", "gsw_tod_1pps" }; 621 + static const char *const sipo_groups[] = { "sipo", "sipo_rclk" }; 622 + static const char *const mdio_groups[] = { "mdio" }; 623 + static const char *const uart_groups[] = { "uart2", "uart2_cts_rts", "hsuart", 624 + "hsuart_cts_rts", "uart4", 625 + "uart5" }; 626 + static const char *const i2c_groups[] = { "i2c1" }; 627 + static const char *const jtag_groups[] = { "jtag_udi", "jtag_dfd" }; 628 + static const char *const pcm_groups[] = { "pcm1", "pcm2" }; 629 + static const char *const spi_groups[] = { "spi_quad", "spi_cs1" }; 630 + static const char *const pcm_spi_groups[] = { "pcm_spi", "pcm_spi_int", 631 + "pcm_spi_rst", "pcm_spi_cs1", 632 + "pcm_spi_cs2_p156", 633 + "pcm_spi_cs2_p128", 634 + "pcm_spi_cs3", "pcm_spi_cs4" }; 635 + static const char *const i2s_groups[] = { "i2s" }; 636 + static const char *const emmc_groups[] = { "emmc" }; 637 + static const char *const pnand_groups[] = { "pnand" }; 638 + static const char *const pcie_reset_groups[] = { "pcie_reset0", "pcie_reset1", 639 + "pcie_reset2" }; 640 + static const char *const pwm_groups[] = { "gpio0", "gpio1", 641 + "gpio2", "gpio3", 642 + "gpio4", "gpio5", 643 + "gpio6", "gpio7", 644 + "gpio8", "gpio9", 645 + "gpio10", "gpio11", 646 + "gpio12", "gpio13", 647 + "gpio14", "gpio15", 648 + "gpio16", "gpio17", 649 + "gpio18", "gpio19", 650 + "gpio20", "gpio21", 651 + "gpio22", "gpio23", 652 + "gpio24", "gpio25", 653 + "gpio26", "gpio27", 654 + "gpio28", "gpio29", 655 + "gpio30", "gpio31", 656 + "gpio36", "gpio37", 657 + "gpio38", "gpio39", 658 + "gpio40", "gpio41", 659 + "gpio42", "gpio43", 660 + "gpio44", "gpio45", 661 + "gpio46", "gpio47" }; 662 + static const char *const phy1_led0_groups[] = { "gpio33", "gpio34", 663 + "gpio35", "gpio42" }; 664 + static const char *const phy2_led0_groups[] = { "gpio33", "gpio34", 665 + "gpio35", "gpio42" }; 666 + static const char *const phy3_led0_groups[] = { "gpio33", "gpio34", 667 + "gpio35", "gpio42" }; 668 + static const char *const phy4_led0_groups[] = { "gpio33", "gpio34", 669 + "gpio35", "gpio42" }; 670 + static const char *const phy1_led1_groups[] = { "gpio43", "gpio44", 671 + "gpio45", "gpio46" }; 672 + static const char *const phy2_led1_groups[] = { "gpio43", "gpio44", 673 + "gpio45", "gpio46" }; 674 + static const char *const phy3_led1_groups[] = { "gpio43", "gpio44", 675 + "gpio45", "gpio46" }; 676 + static const char *const phy4_led1_groups[] = { "gpio43", "gpio44", 677 + "gpio45", "gpio46" }; 678 + 679 + static const struct airoha_pinctrl_func_group pon_func_group[] = { 680 + { 681 + .name = "pon", 682 + .regmap[0] = { 683 + AIROHA_FUNC_MUX, 684 + REG_GPIO_PON_MODE, 685 + GPIO_PON_MODE_MASK, 686 + GPIO_PON_MODE_MASK 687 + }, 688 + .regmap_size = 1, 689 + }, 690 + }; 691 + 692 + static const struct airoha_pinctrl_func_group tod_1pps_func_group[] = { 693 + { 694 + .name = "pon_tod_1pps", 695 + .regmap[0] = { 696 + AIROHA_FUNC_MUX, 697 + REG_GPIO_2ND_I2C_MODE, 698 + PON_TOD_1PPS_MODE_MASK, 699 + PON_TOD_1PPS_MODE_MASK 700 + }, 701 + .regmap_size = 1, 702 + }, { 703 + .name = "gsw_tod_1pps", 704 + .regmap[0] = { 705 + AIROHA_FUNC_MUX, 706 + REG_GPIO_2ND_I2C_MODE, 707 + GSW_TOD_1PPS_MODE_MASK, 708 + GSW_TOD_1PPS_MODE_MASK 709 + }, 710 + .regmap_size = 1, 711 + }, 712 + }; 713 + 714 + static const struct airoha_pinctrl_func_group sipo_func_group[] = { 715 + { 716 + .name = "sipo", 717 + .regmap[0] = { 718 + AIROHA_FUNC_MUX, 719 + REG_GPIO_PON_MODE, 720 + GPIO_SIPO_MODE_MASK | SIPO_RCLK_MODE_MASK, 721 + GPIO_SIPO_MODE_MASK 722 + }, 723 + .regmap_size = 1, 724 + }, { 725 + .name = "sipo_rclk", 726 + .regmap[0] = { 727 + AIROHA_FUNC_MUX, 728 + REG_GPIO_PON_MODE, 729 + GPIO_SIPO_MODE_MASK | SIPO_RCLK_MODE_MASK, 730 + GPIO_SIPO_MODE_MASK | SIPO_RCLK_MODE_MASK 731 + }, 732 + .regmap_size = 1, 733 + }, 734 + }; 735 + 736 + static const struct airoha_pinctrl_func_group mdio_func_group[] = { 737 + { 738 + .name = "mdio", 739 + .regmap[0] = { 740 + AIROHA_FUNC_MUX, 741 + REG_GPIO_PON_MODE, 742 + GPIO_SGMII_MDIO_MODE_MASK, 743 + GPIO_SGMII_MDIO_MODE_MASK 744 + }, 745 + .regmap[1] = { 746 + AIROHA_FUNC_MUX, 747 + REG_GPIO_2ND_I2C_MODE, 748 + GPIO_MDC_IO_MASTER_MODE_MODE, 749 + GPIO_MDC_IO_MASTER_MODE_MODE 750 + }, 751 + .regmap_size = 2, 752 + }, 753 + }; 754 + 755 + static const struct airoha_pinctrl_func_group uart_func_group[] = { 756 + { 757 + .name = "uart2", 758 + .regmap[0] = { 759 + AIROHA_FUNC_MUX, 760 + REG_GPIO_PON_MODE, 761 + GPIO_UART2_MODE_MASK, 762 + GPIO_UART2_MODE_MASK 763 + }, 764 + .regmap_size = 1, 765 + }, { 766 + .name = "uart2_cts_rts", 767 + .regmap[0] = { 768 + AIROHA_FUNC_MUX, 769 + REG_GPIO_PON_MODE, 770 + GPIO_UART2_MODE_MASK | GPIO_UART2_CTS_RTS_MODE_MASK, 771 + GPIO_UART2_MODE_MASK | GPIO_UART2_CTS_RTS_MODE_MASK 772 + }, 773 + .regmap_size = 1, 774 + }, { 775 + .name = "hsuart", 776 + .regmap[0] = { 777 + AIROHA_FUNC_MUX, 778 + REG_GPIO_PON_MODE, 779 + GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK, 780 + GPIO_HSUART_MODE_MASK 781 + }, 782 + .regmap_size = 1, 783 + }, 784 + { 785 + .name = "hsuart_cts_rts", 786 + .regmap[0] = { 787 + AIROHA_FUNC_MUX, 788 + REG_GPIO_PON_MODE, 789 + GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK, 790 + GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK 791 + }, 792 + .regmap_size = 1, 793 + }, { 794 + .name = "uart4", 795 + .regmap[0] = { 796 + AIROHA_FUNC_MUX, 797 + REG_GPIO_PON_MODE, 798 + GPIO_UART4_MODE_MASK, 799 + GPIO_UART4_MODE_MASK 800 + }, 801 + .regmap_size = 1, 802 + }, { 803 + .name = "uart5", 804 + .regmap[0] = { 805 + AIROHA_FUNC_MUX, 806 + REG_GPIO_PON_MODE, 807 + GPIO_UART5_MODE_MASK, 808 + GPIO_UART5_MODE_MASK 809 + }, 810 + .regmap_size = 1, 811 + }, 812 + }; 813 + 814 + static const struct airoha_pinctrl_func_group i2c_func_group[] = { 815 + { 816 + .name = "i2c1", 817 + .regmap[0] = { 818 + AIROHA_FUNC_MUX, 819 + REG_GPIO_2ND_I2C_MODE, 820 + GPIO_2ND_I2C_MODE_MASK, 821 + GPIO_2ND_I2C_MODE_MASK 822 + }, 823 + .regmap_size = 1, 824 + }, 825 + }; 826 + 827 + static const struct airoha_pinctrl_func_group jtag_func_group[] = { 828 + { 829 + .name = "jtag_udi", 830 + .regmap[0] = { 831 + AIROHA_FUNC_MUX, 832 + REG_NPU_UART_EN, 833 + JTAG_UDI_EN_MASK, 834 + JTAG_UDI_EN_MASK 835 + }, 836 + .regmap_size = 1, 837 + }, { 838 + .name = "jtag_dfd", 839 + .regmap[0] = { 840 + AIROHA_FUNC_MUX, 841 + REG_NPU_UART_EN, 842 + JTAG_DFD_EN_MASK, 843 + JTAG_DFD_EN_MASK 844 + }, 845 + .regmap_size = 1, 846 + }, 847 + }; 848 + 849 + static const struct airoha_pinctrl_func_group pcm_func_group[] = { 850 + { 851 + .name = "pcm1", 852 + .regmap[0] = { 853 + AIROHA_FUNC_MUX, 854 + REG_GPIO_SPI_CS1_MODE, 855 + GPIO_PCM1_MODE_MASK, 856 + GPIO_PCM1_MODE_MASK 857 + }, 858 + .regmap_size = 1, 859 + }, { 860 + .name = "pcm2", 861 + .regmap[0] = { 862 + AIROHA_FUNC_MUX, 863 + REG_GPIO_SPI_CS1_MODE, 864 + GPIO_PCM2_MODE_MASK, 865 + GPIO_PCM2_MODE_MASK 866 + }, 867 + .regmap_size = 1, 868 + }, 869 + }; 870 + 871 + static const struct airoha_pinctrl_func_group spi_func_group[] = { 872 + { 873 + .name = "spi_quad", 874 + .regmap[0] = { 875 + AIROHA_FUNC_MUX, 876 + REG_GPIO_SPI_CS1_MODE, 877 + GPIO_SPI_QUAD_MODE_MASK, 878 + GPIO_SPI_QUAD_MODE_MASK 879 + }, 880 + .regmap_size = 1, 881 + }, { 882 + .name = "spi_cs1", 883 + .regmap[0] = { 884 + AIROHA_FUNC_MUX, 885 + REG_GPIO_SPI_CS1_MODE, 886 + GPIO_SPI_CS1_MODE_MASK, 887 + GPIO_SPI_CS1_MODE_MASK 888 + }, 889 + .regmap_size = 1, 890 + }, { 891 + .name = "spi_cs2", 892 + .regmap[0] = { 893 + AIROHA_FUNC_MUX, 894 + REG_GPIO_SPI_CS1_MODE, 895 + GPIO_SPI_CS2_MODE_MASK, 896 + GPIO_SPI_CS2_MODE_MASK 897 + }, 898 + .regmap_size = 1, 899 + }, { 900 + .name = "spi_cs3", 901 + .regmap[0] = { 902 + AIROHA_FUNC_MUX, 903 + REG_GPIO_SPI_CS1_MODE, 904 + GPIO_SPI_CS3_MODE_MASK, 905 + GPIO_SPI_CS3_MODE_MASK 906 + }, 907 + .regmap_size = 1, 908 + }, { 909 + .name = "spi_cs4", 910 + .regmap[0] = { 911 + AIROHA_FUNC_MUX, 912 + REG_GPIO_SPI_CS1_MODE, 913 + GPIO_SPI_CS4_MODE_MASK, 914 + GPIO_SPI_CS4_MODE_MASK 915 + }, 916 + .regmap_size = 1, 917 + }, 918 + }; 919 + 920 + static const struct airoha_pinctrl_func_group pcm_spi_func_group[] = { 921 + { 922 + .name = "pcm_spi", 923 + .regmap[0] = { 924 + AIROHA_FUNC_MUX, 925 + REG_GPIO_SPI_CS1_MODE, 926 + GPIO_PCM_SPI_MODE_MASK, 927 + GPIO_PCM_SPI_MODE_MASK 928 + }, 929 + .regmap_size = 1, 930 + }, { 931 + .name = "pcm_spi_int", 932 + .regmap[0] = { 933 + AIROHA_FUNC_MUX, 934 + REG_GPIO_SPI_CS1_MODE, 935 + GPIO_PCM_INT_MODE_MASK, 936 + GPIO_PCM_INT_MODE_MASK 937 + }, 938 + .regmap_size = 1, 939 + }, { 940 + .name = "pcm_spi_rst", 941 + .regmap[0] = { 942 + AIROHA_FUNC_MUX, 943 + REG_GPIO_SPI_CS1_MODE, 944 + GPIO_PCM_RESET_MODE_MASK, 945 + GPIO_PCM_RESET_MODE_MASK 946 + }, 947 + .regmap_size = 1, 948 + }, { 949 + .name = "pcm_spi_cs1", 950 + .regmap[0] = { 951 + AIROHA_FUNC_MUX, 952 + REG_GPIO_SPI_CS1_MODE, 953 + GPIO_PCM_SPI_CS1_MODE_MASK, 954 + GPIO_PCM_SPI_CS1_MODE_MASK 955 + }, 956 + .regmap_size = 1, 957 + }, { 958 + .name = "pcm_spi_cs2_p128", 959 + .regmap[0] = { 960 + AIROHA_FUNC_MUX, 961 + REG_GPIO_SPI_CS1_MODE, 962 + GPIO_PCM_SPI_CS2_MODE_P128_MASK, 963 + GPIO_PCM_SPI_CS2_MODE_P128_MASK 964 + }, 965 + .regmap_size = 1, 966 + }, { 967 + .name = "pcm_spi_cs2_p156", 968 + .regmap[0] = { 969 + AIROHA_FUNC_MUX, 970 + REG_GPIO_SPI_CS1_MODE, 971 + GPIO_PCM_SPI_CS2_MODE_P156_MASK, 972 + GPIO_PCM_SPI_CS2_MODE_P156_MASK 973 + }, 974 + .regmap_size = 1, 975 + }, { 976 + .name = "pcm_spi_cs3", 977 + .regmap[0] = { 978 + AIROHA_FUNC_MUX, 979 + REG_GPIO_SPI_CS1_MODE, 980 + GPIO_PCM_SPI_CS3_MODE_MASK, 981 + GPIO_PCM_SPI_CS3_MODE_MASK 982 + }, 983 + .regmap_size = 1, 984 + }, { 985 + .name = "pcm_spi_cs4", 986 + .regmap[0] = { 987 + AIROHA_FUNC_MUX, 988 + REG_GPIO_SPI_CS1_MODE, 989 + GPIO_PCM_SPI_CS4_MODE_MASK, 990 + GPIO_PCM_SPI_CS4_MODE_MASK 991 + }, 992 + .regmap_size = 1, 993 + }, 994 + }; 995 + 996 + static const struct airoha_pinctrl_func_group i2s_func_group[] = { 997 + { 998 + .name = "i2s", 999 + .regmap[0] = { 1000 + AIROHA_FUNC_MUX, 1001 + REG_GPIO_2ND_I2C_MODE, 1002 + GPIO_I2S_MODE_MASK, 1003 + GPIO_I2S_MODE_MASK 1004 + }, 1005 + .regmap_size = 1, 1006 + }, 1007 + }; 1008 + 1009 + static const struct airoha_pinctrl_func_group emmc_func_group[] = { 1010 + { 1011 + .name = "emmc", 1012 + .regmap[0] = { 1013 + AIROHA_FUNC_MUX, 1014 + REG_GPIO_PON_MODE, 1015 + GPIO_EMMC_MODE_MASK, 1016 + GPIO_EMMC_MODE_MASK 1017 + }, 1018 + .regmap_size = 1, 1019 + }, 1020 + }; 1021 + 1022 + static const struct airoha_pinctrl_func_group pnand_func_group[] = { 1023 + { 1024 + .name = "pnand", 1025 + .regmap[0] = { 1026 + AIROHA_FUNC_MUX, 1027 + REG_GPIO_PON_MODE, 1028 + GPIO_PARALLEL_NAND_MODE_MASK, 1029 + GPIO_PARALLEL_NAND_MODE_MASK 1030 + }, 1031 + .regmap_size = 1, 1032 + }, 1033 + }; 1034 + 1035 + static const struct airoha_pinctrl_func_group pcie_reset_func_group[] = { 1036 + { 1037 + .name = "pcie_reset0", 1038 + .regmap[0] = { 1039 + AIROHA_FUNC_MUX, 1040 + REG_GPIO_PON_MODE, 1041 + GPIO_PCIE_RESET0_MASK, 1042 + GPIO_PCIE_RESET0_MASK 1043 + }, 1044 + .regmap_size = 1, 1045 + }, { 1046 + .name = "pcie_reset1", 1047 + .regmap[0] = { 1048 + AIROHA_FUNC_MUX, 1049 + REG_GPIO_PON_MODE, 1050 + GPIO_PCIE_RESET1_MASK, 1051 + GPIO_PCIE_RESET1_MASK 1052 + }, 1053 + .regmap_size = 1, 1054 + }, { 1055 + .name = "pcie_reset2", 1056 + .regmap[0] = { 1057 + AIROHA_FUNC_MUX, 1058 + REG_GPIO_PON_MODE, 1059 + GPIO_PCIE_RESET2_MASK, 1060 + GPIO_PCIE_RESET2_MASK 1061 + }, 1062 + .regmap_size = 1, 1063 + }, 1064 + }; 1065 + 1066 + /* PWM */ 1067 + static const struct airoha_pinctrl_func_group pwm_func_group[] = { 1068 + { 1069 + .name = "gpio0", 1070 + .regmap[0] = { 1071 + AIROHA_FUNC_PWM_MUX, 1072 + REG_GPIO_FLASH_MODE_CFG, 1073 + GPIO0_FLASH_MODE_CFG, 1074 + GPIO0_FLASH_MODE_CFG 1075 + }, 1076 + .regmap_size = 1, 1077 + }, { 1078 + .name = "gpio1", 1079 + .regmap[0] = { 1080 + AIROHA_FUNC_PWM_MUX, 1081 + REG_GPIO_FLASH_MODE_CFG, 1082 + GPIO1_FLASH_MODE_CFG, 1083 + GPIO1_FLASH_MODE_CFG 1084 + }, 1085 + .regmap_size = 1, 1086 + }, { 1087 + .name = "gpio2", 1088 + .regmap[0] = { 1089 + AIROHA_FUNC_PWM_MUX, 1090 + REG_GPIO_FLASH_MODE_CFG, 1091 + GPIO2_FLASH_MODE_CFG, 1092 + GPIO2_FLASH_MODE_CFG 1093 + }, 1094 + .regmap_size = 1, 1095 + }, { 1096 + .name = "gpio3", 1097 + .regmap[0] = { 1098 + AIROHA_FUNC_PWM_MUX, 1099 + REG_GPIO_FLASH_MODE_CFG, 1100 + GPIO3_FLASH_MODE_CFG, 1101 + GPIO3_FLASH_MODE_CFG 1102 + }, 1103 + .regmap_size = 1, 1104 + }, { 1105 + .name = "gpio4", 1106 + .regmap[0] = { 1107 + AIROHA_FUNC_PWM_MUX, 1108 + REG_GPIO_FLASH_MODE_CFG, 1109 + GPIO4_FLASH_MODE_CFG, 1110 + GPIO4_FLASH_MODE_CFG 1111 + }, 1112 + .regmap_size = 1, 1113 + }, { 1114 + .name = "gpio5", 1115 + .regmap[0] = { 1116 + AIROHA_FUNC_PWM_MUX, 1117 + REG_GPIO_FLASH_MODE_CFG, 1118 + GPIO5_FLASH_MODE_CFG, 1119 + GPIO5_FLASH_MODE_CFG 1120 + }, 1121 + .regmap_size = 1, 1122 + }, { 1123 + .name = "gpio6", 1124 + .regmap[0] = { 1125 + AIROHA_FUNC_PWM_MUX, 1126 + REG_GPIO_FLASH_MODE_CFG, 1127 + GPIO6_FLASH_MODE_CFG, 1128 + GPIO6_FLASH_MODE_CFG 1129 + }, 1130 + .regmap_size = 1, 1131 + }, { 1132 + .name = "gpio7", 1133 + .regmap[0] = { 1134 + AIROHA_FUNC_PWM_MUX, 1135 + REG_GPIO_FLASH_MODE_CFG, 1136 + GPIO7_FLASH_MODE_CFG, 1137 + GPIO7_FLASH_MODE_CFG 1138 + }, 1139 + .regmap_size = 1, 1140 + }, { 1141 + .name = "gpio8", 1142 + .regmap[0] = { 1143 + AIROHA_FUNC_PWM_MUX, 1144 + REG_GPIO_FLASH_MODE_CFG, 1145 + GPIO8_FLASH_MODE_CFG, 1146 + GPIO8_FLASH_MODE_CFG 1147 + }, 1148 + .regmap_size = 1, 1149 + }, { 1150 + .name = "gpio9", 1151 + .regmap[0] = { 1152 + AIROHA_FUNC_PWM_MUX, 1153 + REG_GPIO_FLASH_MODE_CFG, 1154 + GPIO9_FLASH_MODE_CFG, 1155 + GPIO9_FLASH_MODE_CFG 1156 + }, 1157 + .regmap_size = 1, 1158 + }, { 1159 + .name = "gpio10", 1160 + .regmap[0] = { 1161 + AIROHA_FUNC_PWM_MUX, 1162 + REG_GPIO_FLASH_MODE_CFG, 1163 + GPIO10_FLASH_MODE_CFG, 1164 + GPIO10_FLASH_MODE_CFG 1165 + }, 1166 + .regmap_size = 1, 1167 + }, { 1168 + .name = "gpio11", 1169 + .regmap[0] = { 1170 + AIROHA_FUNC_PWM_MUX, 1171 + REG_GPIO_FLASH_MODE_CFG, 1172 + GPIO11_FLASH_MODE_CFG, 1173 + GPIO11_FLASH_MODE_CFG 1174 + }, 1175 + .regmap_size = 1, 1176 + }, { 1177 + .name = "gpio12", 1178 + .regmap[0] = { 1179 + AIROHA_FUNC_PWM_MUX, 1180 + REG_GPIO_FLASH_MODE_CFG, 1181 + GPIO12_FLASH_MODE_CFG, 1182 + GPIO12_FLASH_MODE_CFG 1183 + }, 1184 + .regmap_size = 1, 1185 + }, { 1186 + .name = "gpio13", 1187 + .regmap[0] = { 1188 + AIROHA_FUNC_PWM_MUX, 1189 + REG_GPIO_FLASH_MODE_CFG, 1190 + GPIO13_FLASH_MODE_CFG, 1191 + GPIO13_FLASH_MODE_CFG 1192 + }, 1193 + .regmap_size = 1, 1194 + }, { 1195 + .name = "gpio14", 1196 + .regmap[0] = { 1197 + AIROHA_FUNC_PWM_MUX, 1198 + REG_GPIO_FLASH_MODE_CFG, 1199 + GPIO14_FLASH_MODE_CFG, 1200 + GPIO14_FLASH_MODE_CFG 1201 + }, 1202 + .regmap_size = 1, 1203 + }, { 1204 + .name = "gpio15", 1205 + .regmap[0] = { 1206 + AIROHA_FUNC_PWM_MUX, 1207 + REG_GPIO_FLASH_MODE_CFG, 1208 + GPIO15_FLASH_MODE_CFG, 1209 + GPIO15_FLASH_MODE_CFG 1210 + }, 1211 + .regmap_size = 1, 1212 + }, { 1213 + .name = "gpio16", 1214 + .regmap[0] = { 1215 + AIROHA_FUNC_PWM_EXT_MUX, 1216 + REG_GPIO_FLASH_MODE_CFG_EXT, 1217 + GPIO16_FLASH_MODE_CFG, 1218 + GPIO16_FLASH_MODE_CFG 1219 + }, 1220 + .regmap_size = 1, 1221 + }, { 1222 + .name = "gpio17", 1223 + .regmap[0] = { 1224 + AIROHA_FUNC_PWM_EXT_MUX, 1225 + REG_GPIO_FLASH_MODE_CFG_EXT, 1226 + GPIO17_FLASH_MODE_CFG, 1227 + GPIO17_FLASH_MODE_CFG 1228 + }, 1229 + .regmap_size = 1, 1230 + }, { 1231 + .name = "gpio18", 1232 + .regmap[0] = { 1233 + AIROHA_FUNC_PWM_EXT_MUX, 1234 + REG_GPIO_FLASH_MODE_CFG_EXT, 1235 + GPIO18_FLASH_MODE_CFG, 1236 + GPIO18_FLASH_MODE_CFG 1237 + }, 1238 + .regmap_size = 1, 1239 + }, { 1240 + .name = "gpio19", 1241 + .regmap[0] = { 1242 + AIROHA_FUNC_PWM_EXT_MUX, 1243 + REG_GPIO_FLASH_MODE_CFG_EXT, 1244 + GPIO19_FLASH_MODE_CFG, 1245 + GPIO19_FLASH_MODE_CFG 1246 + }, 1247 + .regmap_size = 1, 1248 + }, { 1249 + .name = "gpio20", 1250 + .regmap[0] = { 1251 + AIROHA_FUNC_PWM_EXT_MUX, 1252 + REG_GPIO_FLASH_MODE_CFG_EXT, 1253 + GPIO20_FLASH_MODE_CFG, 1254 + GPIO20_FLASH_MODE_CFG 1255 + }, 1256 + .regmap_size = 1, 1257 + }, { 1258 + .name = "gpio21", 1259 + .regmap[0] = { 1260 + AIROHA_FUNC_PWM_EXT_MUX, 1261 + REG_GPIO_FLASH_MODE_CFG_EXT, 1262 + GPIO21_FLASH_MODE_CFG, 1263 + GPIO21_FLASH_MODE_CFG 1264 + }, 1265 + .regmap_size = 1, 1266 + }, { 1267 + .name = "gpio22", 1268 + .regmap[0] = { 1269 + AIROHA_FUNC_PWM_EXT_MUX, 1270 + REG_GPIO_FLASH_MODE_CFG_EXT, 1271 + GPIO22_FLASH_MODE_CFG, 1272 + GPIO22_FLASH_MODE_CFG 1273 + }, 1274 + .regmap_size = 1, 1275 + }, { 1276 + .name = "gpio23", 1277 + .regmap[0] = { 1278 + AIROHA_FUNC_PWM_EXT_MUX, 1279 + REG_GPIO_FLASH_MODE_CFG_EXT, 1280 + GPIO23_FLASH_MODE_CFG, 1281 + GPIO23_FLASH_MODE_CFG 1282 + }, 1283 + .regmap_size = 1, 1284 + }, { 1285 + .name = "gpio24", 1286 + .regmap[0] = { 1287 + AIROHA_FUNC_PWM_EXT_MUX, 1288 + REG_GPIO_FLASH_MODE_CFG_EXT, 1289 + GPIO24_FLASH_MODE_CFG, 1290 + GPIO24_FLASH_MODE_CFG 1291 + }, 1292 + .regmap_size = 1, 1293 + }, { 1294 + .name = "gpio25", 1295 + .regmap[0] = { 1296 + AIROHA_FUNC_PWM_EXT_MUX, 1297 + REG_GPIO_FLASH_MODE_CFG_EXT, 1298 + GPIO25_FLASH_MODE_CFG, 1299 + GPIO25_FLASH_MODE_CFG 1300 + }, 1301 + .regmap_size = 1, 1302 + }, { 1303 + .name = "gpio26", 1304 + .regmap[0] = { 1305 + AIROHA_FUNC_PWM_EXT_MUX, 1306 + REG_GPIO_FLASH_MODE_CFG_EXT, 1307 + GPIO26_FLASH_MODE_CFG, 1308 + GPIO26_FLASH_MODE_CFG 1309 + }, 1310 + .regmap_size = 1, 1311 + }, { 1312 + .name = "gpio27", 1313 + .regmap[0] = { 1314 + AIROHA_FUNC_PWM_EXT_MUX, 1315 + REG_GPIO_FLASH_MODE_CFG_EXT, 1316 + GPIO27_FLASH_MODE_CFG, 1317 + GPIO27_FLASH_MODE_CFG 1318 + }, 1319 + .regmap_size = 1, 1320 + }, { 1321 + .name = "gpio28", 1322 + .regmap[0] = { 1323 + AIROHA_FUNC_PWM_EXT_MUX, 1324 + REG_GPIO_FLASH_MODE_CFG_EXT, 1325 + GPIO28_FLASH_MODE_CFG, 1326 + GPIO28_FLASH_MODE_CFG 1327 + }, 1328 + .regmap_size = 1, 1329 + }, { 1330 + .name = "gpio29", 1331 + .regmap[0] = { 1332 + AIROHA_FUNC_PWM_EXT_MUX, 1333 + REG_GPIO_FLASH_MODE_CFG_EXT, 1334 + GPIO29_FLASH_MODE_CFG, 1335 + GPIO29_FLASH_MODE_CFG 1336 + }, 1337 + .regmap_size = 1, 1338 + }, { 1339 + .name = "gpio30", 1340 + .regmap[0] = { 1341 + AIROHA_FUNC_PWM_EXT_MUX, 1342 + REG_GPIO_FLASH_MODE_CFG_EXT, 1343 + GPIO30_FLASH_MODE_CFG, 1344 + GPIO30_FLASH_MODE_CFG 1345 + }, 1346 + .regmap_size = 1, 1347 + }, { 1348 + .name = "gpio31", 1349 + .regmap[0] = { 1350 + AIROHA_FUNC_PWM_EXT_MUX, 1351 + REG_GPIO_FLASH_MODE_CFG_EXT, 1352 + GPIO31_FLASH_MODE_CFG, 1353 + GPIO31_FLASH_MODE_CFG 1354 + }, 1355 + .regmap_size = 1, 1356 + }, { 1357 + .name = "gpio36", 1358 + .regmap[0] = { 1359 + AIROHA_FUNC_PWM_EXT_MUX, 1360 + REG_GPIO_FLASH_MODE_CFG_EXT, 1361 + GPIO36_FLASH_MODE_CFG, 1362 + GPIO36_FLASH_MODE_CFG 1363 + }, 1364 + .regmap_size = 1, 1365 + }, { 1366 + .name = "gpio37", 1367 + .regmap[0] = { 1368 + AIROHA_FUNC_PWM_EXT_MUX, 1369 + REG_GPIO_FLASH_MODE_CFG_EXT, 1370 + GPIO37_FLASH_MODE_CFG, 1371 + GPIO37_FLASH_MODE_CFG 1372 + }, 1373 + .regmap_size = 1, 1374 + }, { 1375 + .name = "gpio38", 1376 + .regmap[0] = { 1377 + AIROHA_FUNC_PWM_EXT_MUX, 1378 + REG_GPIO_FLASH_MODE_CFG_EXT, 1379 + GPIO38_FLASH_MODE_CFG, 1380 + GPIO38_FLASH_MODE_CFG 1381 + }, 1382 + .regmap_size = 1, 1383 + }, { 1384 + .name = "gpio39", 1385 + .regmap[0] = { 1386 + AIROHA_FUNC_PWM_EXT_MUX, 1387 + REG_GPIO_FLASH_MODE_CFG_EXT, 1388 + GPIO39_FLASH_MODE_CFG, 1389 + GPIO39_FLASH_MODE_CFG 1390 + }, 1391 + .regmap_size = 1, 1392 + }, { 1393 + .name = "gpio40", 1394 + .regmap[0] = { 1395 + AIROHA_FUNC_PWM_EXT_MUX, 1396 + REG_GPIO_FLASH_MODE_CFG_EXT, 1397 + GPIO40_FLASH_MODE_CFG, 1398 + GPIO40_FLASH_MODE_CFG 1399 + }, 1400 + .regmap_size = 1, 1401 + }, { 1402 + .name = "gpio41", 1403 + .regmap[0] = { 1404 + AIROHA_FUNC_PWM_EXT_MUX, 1405 + REG_GPIO_FLASH_MODE_CFG_EXT, 1406 + GPIO41_FLASH_MODE_CFG, 1407 + GPIO41_FLASH_MODE_CFG 1408 + }, 1409 + .regmap_size = 1, 1410 + }, { 1411 + .name = "gpio42", 1412 + .regmap[0] = { 1413 + AIROHA_FUNC_PWM_EXT_MUX, 1414 + REG_GPIO_FLASH_MODE_CFG_EXT, 1415 + GPIO42_FLASH_MODE_CFG, 1416 + GPIO42_FLASH_MODE_CFG 1417 + }, 1418 + .regmap_size = 1, 1419 + }, { 1420 + .name = "gpio43", 1421 + .regmap[0] = { 1422 + AIROHA_FUNC_PWM_EXT_MUX, 1423 + REG_GPIO_FLASH_MODE_CFG_EXT, 1424 + GPIO43_FLASH_MODE_CFG, 1425 + GPIO43_FLASH_MODE_CFG 1426 + }, 1427 + .regmap_size = 1, 1428 + }, { 1429 + .name = "gpio44", 1430 + .regmap[0] = { 1431 + AIROHA_FUNC_PWM_EXT_MUX, 1432 + REG_GPIO_FLASH_MODE_CFG_EXT, 1433 + GPIO44_FLASH_MODE_CFG, 1434 + GPIO44_FLASH_MODE_CFG 1435 + }, 1436 + .regmap_size = 1, 1437 + }, { 1438 + .name = "gpio45", 1439 + .regmap[0] = { 1440 + AIROHA_FUNC_PWM_EXT_MUX, 1441 + REG_GPIO_FLASH_MODE_CFG_EXT, 1442 + GPIO45_FLASH_MODE_CFG, 1443 + GPIO45_FLASH_MODE_CFG 1444 + }, 1445 + .regmap_size = 1, 1446 + }, { 1447 + .name = "gpio46", 1448 + .regmap[0] = { 1449 + AIROHA_FUNC_PWM_EXT_MUX, 1450 + REG_GPIO_FLASH_MODE_CFG_EXT, 1451 + GPIO46_FLASH_MODE_CFG, 1452 + GPIO46_FLASH_MODE_CFG 1453 + }, 1454 + .regmap_size = 1, 1455 + }, { 1456 + .name = "gpio47", 1457 + .regmap[0] = { 1458 + AIROHA_FUNC_PWM_EXT_MUX, 1459 + REG_GPIO_FLASH_MODE_CFG_EXT, 1460 + GPIO47_FLASH_MODE_CFG, 1461 + GPIO47_FLASH_MODE_CFG 1462 + }, 1463 + .regmap_size = 1, 1464 + }, 1465 + }; 1466 + 1467 + static const struct airoha_pinctrl_func_group phy1_led0_func_group[] = { 1468 + { 1469 + .name = "gpio33", 1470 + .regmap[0] = { 1471 + AIROHA_FUNC_MUX, 1472 + REG_GPIO_2ND_I2C_MODE, 1473 + GPIO_LAN0_LED0_MODE_MASK, 1474 + GPIO_LAN0_LED0_MODE_MASK 1475 + }, 1476 + .regmap[1] = { 1477 + AIROHA_FUNC_MUX, 1478 + REG_LAN_LED0_MAPPING, 1479 + LAN1_LED_MAPPING_MASK, 1480 + LAN1_PHY1_LED_MAP 1481 + }, 1482 + .regmap_size = 2, 1483 + }, { 1484 + .name = "gpio34", 1485 + .regmap[0] = { 1486 + AIROHA_FUNC_MUX, 1487 + REG_GPIO_2ND_I2C_MODE, 1488 + GPIO_LAN1_LED0_MODE_MASK, 1489 + GPIO_LAN1_LED0_MODE_MASK 1490 + }, 1491 + .regmap[1] = { 1492 + AIROHA_FUNC_MUX, 1493 + REG_LAN_LED0_MAPPING, 1494 + LAN2_LED_MAPPING_MASK, 1495 + LAN2_PHY1_LED_MAP 1496 + }, 1497 + .regmap_size = 2, 1498 + }, { 1499 + .name = "gpio35", 1500 + .regmap[0] = { 1501 + AIROHA_FUNC_MUX, 1502 + REG_GPIO_2ND_I2C_MODE, 1503 + GPIO_LAN2_LED0_MODE_MASK, 1504 + GPIO_LAN2_LED0_MODE_MASK 1505 + }, 1506 + .regmap[1] = { 1507 + AIROHA_FUNC_MUX, 1508 + REG_LAN_LED0_MAPPING, 1509 + LAN3_LED_MAPPING_MASK, 1510 + LAN3_PHY1_LED_MAP 1511 + }, 1512 + .regmap_size = 2, 1513 + }, { 1514 + .name = "gpio42", 1515 + .regmap[0] = { 1516 + AIROHA_FUNC_MUX, 1517 + REG_GPIO_2ND_I2C_MODE, 1518 + GPIO_LAN3_LED0_MODE_MASK, 1519 + GPIO_LAN3_LED0_MODE_MASK 1520 + }, 1521 + .regmap[1] = { 1522 + AIROHA_FUNC_MUX, 1523 + REG_LAN_LED0_MAPPING, 1524 + LAN4_LED_MAPPING_MASK, 1525 + LAN4_PHY1_LED_MAP 1526 + }, 1527 + .regmap_size = 2, 1528 + }, 1529 + }; 1530 + 1531 + static const struct airoha_pinctrl_func_group phy2_led0_func_group[] = { 1532 + { 1533 + .name = "gpio33", 1534 + .regmap[0] = { 1535 + AIROHA_FUNC_MUX, 1536 + REG_GPIO_2ND_I2C_MODE, 1537 + GPIO_LAN0_LED0_MODE_MASK, 1538 + GPIO_LAN0_LED0_MODE_MASK 1539 + }, 1540 + .regmap[1] = { 1541 + AIROHA_FUNC_MUX, 1542 + REG_LAN_LED0_MAPPING, 1543 + LAN1_LED_MAPPING_MASK, 1544 + LAN1_PHY2_LED_MAP 1545 + }, 1546 + .regmap_size = 2, 1547 + }, { 1548 + .name = "gpio34", 1549 + .regmap[0] = { 1550 + AIROHA_FUNC_MUX, 1551 + REG_GPIO_2ND_I2C_MODE, 1552 + GPIO_LAN1_LED0_MODE_MASK, 1553 + GPIO_LAN1_LED0_MODE_MASK 1554 + }, 1555 + .regmap[1] = { 1556 + AIROHA_FUNC_MUX, 1557 + REG_LAN_LED0_MAPPING, 1558 + LAN2_LED_MAPPING_MASK, 1559 + LAN2_PHY2_LED_MAP 1560 + }, 1561 + .regmap_size = 2, 1562 + }, { 1563 + .name = "gpio35", 1564 + .regmap[0] = { 1565 + AIROHA_FUNC_MUX, 1566 + REG_GPIO_2ND_I2C_MODE, 1567 + GPIO_LAN2_LED0_MODE_MASK, 1568 + GPIO_LAN2_LED0_MODE_MASK 1569 + }, 1570 + .regmap[1] = { 1571 + AIROHA_FUNC_MUX, 1572 + REG_LAN_LED0_MAPPING, 1573 + LAN3_LED_MAPPING_MASK, 1574 + LAN3_PHY2_LED_MAP 1575 + }, 1576 + .regmap_size = 2, 1577 + }, { 1578 + .name = "gpio42", 1579 + .regmap[0] = { 1580 + AIROHA_FUNC_MUX, 1581 + REG_GPIO_2ND_I2C_MODE, 1582 + GPIO_LAN3_LED0_MODE_MASK, 1583 + GPIO_LAN3_LED0_MODE_MASK 1584 + }, 1585 + .regmap[1] = { 1586 + AIROHA_FUNC_MUX, 1587 + REG_LAN_LED0_MAPPING, 1588 + LAN4_LED_MAPPING_MASK, 1589 + LAN4_PHY2_LED_MAP 1590 + }, 1591 + .regmap_size = 2, 1592 + }, 1593 + }; 1594 + 1595 + static const struct airoha_pinctrl_func_group phy3_led0_func_group[] = { 1596 + { 1597 + .name = "gpio33", 1598 + .regmap[0] = { 1599 + AIROHA_FUNC_MUX, 1600 + REG_GPIO_2ND_I2C_MODE, 1601 + GPIO_LAN0_LED0_MODE_MASK, 1602 + GPIO_LAN0_LED0_MODE_MASK 1603 + }, 1604 + .regmap[1] = { 1605 + AIROHA_FUNC_MUX, 1606 + REG_LAN_LED0_MAPPING, 1607 + LAN1_LED_MAPPING_MASK, 1608 + LAN1_PHY3_LED_MAP 1609 + }, 1610 + .regmap_size = 2, 1611 + }, { 1612 + .name = "gpio34", 1613 + .regmap[0] = { 1614 + AIROHA_FUNC_MUX, 1615 + REG_GPIO_2ND_I2C_MODE, 1616 + GPIO_LAN1_LED0_MODE_MASK, 1617 + GPIO_LAN1_LED0_MODE_MASK 1618 + }, 1619 + .regmap[1] = { 1620 + AIROHA_FUNC_MUX, 1621 + REG_LAN_LED0_MAPPING, 1622 + LAN2_LED_MAPPING_MASK, 1623 + LAN2_PHY3_LED_MAP 1624 + }, 1625 + .regmap_size = 2, 1626 + }, { 1627 + .name = "gpio35", 1628 + .regmap[0] = { 1629 + AIROHA_FUNC_MUX, 1630 + REG_GPIO_2ND_I2C_MODE, 1631 + GPIO_LAN2_LED0_MODE_MASK, 1632 + GPIO_LAN2_LED0_MODE_MASK 1633 + }, 1634 + .regmap[1] = { 1635 + AIROHA_FUNC_MUX, 1636 + REG_LAN_LED0_MAPPING, 1637 + LAN3_LED_MAPPING_MASK, 1638 + LAN3_PHY3_LED_MAP 1639 + }, 1640 + .regmap_size = 2, 1641 + }, { 1642 + .name = "gpio42", 1643 + .regmap[0] = { 1644 + AIROHA_FUNC_MUX, 1645 + REG_GPIO_2ND_I2C_MODE, 1646 + GPIO_LAN3_LED0_MODE_MASK, 1647 + GPIO_LAN3_LED0_MODE_MASK 1648 + }, 1649 + .regmap[1] = { 1650 + AIROHA_FUNC_MUX, 1651 + REG_LAN_LED0_MAPPING, 1652 + LAN4_LED_MAPPING_MASK, 1653 + LAN4_PHY3_LED_MAP 1654 + }, 1655 + .regmap_size = 2, 1656 + }, 1657 + }; 1658 + 1659 + static const struct airoha_pinctrl_func_group phy4_led0_func_group[] = { 1660 + { 1661 + .name = "gpio33", 1662 + .regmap[0] = { 1663 + AIROHA_FUNC_MUX, 1664 + REG_GPIO_2ND_I2C_MODE, 1665 + GPIO_LAN0_LED0_MODE_MASK, 1666 + GPIO_LAN0_LED0_MODE_MASK 1667 + }, 1668 + .regmap[1] = { 1669 + AIROHA_FUNC_MUX, 1670 + REG_LAN_LED0_MAPPING, 1671 + LAN1_LED_MAPPING_MASK, 1672 + LAN1_PHY4_LED_MAP 1673 + }, 1674 + .regmap_size = 2, 1675 + }, { 1676 + .name = "gpio34", 1677 + .regmap[0] = { 1678 + AIROHA_FUNC_MUX, 1679 + REG_GPIO_2ND_I2C_MODE, 1680 + GPIO_LAN1_LED0_MODE_MASK, 1681 + GPIO_LAN1_LED0_MODE_MASK 1682 + }, 1683 + .regmap[1] = { 1684 + AIROHA_FUNC_MUX, 1685 + REG_LAN_LED0_MAPPING, 1686 + LAN2_LED_MAPPING_MASK, 1687 + LAN2_PHY4_LED_MAP 1688 + }, 1689 + .regmap_size = 2, 1690 + }, { 1691 + .name = "gpio35", 1692 + .regmap[0] = { 1693 + AIROHA_FUNC_MUX, 1694 + REG_GPIO_2ND_I2C_MODE, 1695 + GPIO_LAN2_LED0_MODE_MASK, 1696 + GPIO_LAN2_LED0_MODE_MASK 1697 + }, 1698 + .regmap[1] = { 1699 + AIROHA_FUNC_MUX, 1700 + REG_LAN_LED0_MAPPING, 1701 + LAN3_LED_MAPPING_MASK, 1702 + LAN3_PHY4_LED_MAP 1703 + }, 1704 + .regmap_size = 2, 1705 + }, { 1706 + .name = "gpio42", 1707 + .regmap[0] = { 1708 + AIROHA_FUNC_MUX, 1709 + REG_GPIO_2ND_I2C_MODE, 1710 + GPIO_LAN3_LED0_MODE_MASK, 1711 + GPIO_LAN3_LED0_MODE_MASK 1712 + }, 1713 + .regmap[1] = { 1714 + AIROHA_FUNC_MUX, 1715 + REG_LAN_LED0_MAPPING, 1716 + LAN4_LED_MAPPING_MASK, 1717 + LAN4_PHY4_LED_MAP 1718 + }, 1719 + .regmap_size = 2, 1720 + }, 1721 + }; 1722 + 1723 + static const struct airoha_pinctrl_func_group phy1_led1_func_group[] = { 1724 + { 1725 + .name = "gpio43", 1726 + .regmap[0] = { 1727 + AIROHA_FUNC_MUX, 1728 + REG_GPIO_2ND_I2C_MODE, 1729 + GPIO_LAN0_LED1_MODE_MASK, 1730 + GPIO_LAN0_LED1_MODE_MASK 1731 + }, 1732 + .regmap[1] = { 1733 + AIROHA_FUNC_MUX, 1734 + REG_LAN_LED1_MAPPING, 1735 + LAN1_LED_MAPPING_MASK, 1736 + LAN1_PHY1_LED_MAP 1737 + }, 1738 + .regmap_size = 2, 1739 + }, { 1740 + .name = "gpio44", 1741 + .regmap[0] = { 1742 + AIROHA_FUNC_MUX, 1743 + REG_GPIO_2ND_I2C_MODE, 1744 + GPIO_LAN1_LED1_MODE_MASK, 1745 + GPIO_LAN1_LED1_MODE_MASK 1746 + }, 1747 + .regmap[1] = { 1748 + AIROHA_FUNC_MUX, 1749 + REG_LAN_LED1_MAPPING, 1750 + LAN2_LED_MAPPING_MASK, 1751 + LAN2_PHY1_LED_MAP 1752 + }, 1753 + .regmap_size = 2, 1754 + }, { 1755 + .name = "gpio45", 1756 + .regmap[0] = { 1757 + AIROHA_FUNC_MUX, 1758 + REG_GPIO_2ND_I2C_MODE, 1759 + GPIO_LAN2_LED1_MODE_MASK, 1760 + GPIO_LAN2_LED1_MODE_MASK 1761 + }, 1762 + .regmap[1] = { 1763 + AIROHA_FUNC_MUX, 1764 + REG_LAN_LED1_MAPPING, 1765 + LAN3_LED_MAPPING_MASK, 1766 + LAN3_PHY1_LED_MAP 1767 + }, 1768 + .regmap_size = 2, 1769 + }, { 1770 + .name = "gpio46", 1771 + .regmap[0] = { 1772 + AIROHA_FUNC_MUX, 1773 + REG_GPIO_2ND_I2C_MODE, 1774 + GPIO_LAN3_LED0_MODE_MASK, 1775 + GPIO_LAN3_LED0_MODE_MASK 1776 + }, 1777 + .regmap[1] = { 1778 + AIROHA_FUNC_MUX, 1779 + REG_LAN_LED1_MAPPING, 1780 + LAN4_LED_MAPPING_MASK, 1781 + LAN4_PHY1_LED_MAP 1782 + }, 1783 + .regmap_size = 2, 1784 + }, 1785 + }; 1786 + 1787 + static const struct airoha_pinctrl_func_group phy2_led1_func_group[] = { 1788 + { 1789 + .name = "gpio43", 1790 + .regmap[0] = { 1791 + AIROHA_FUNC_MUX, 1792 + REG_GPIO_2ND_I2C_MODE, 1793 + GPIO_LAN0_LED1_MODE_MASK, 1794 + GPIO_LAN0_LED1_MODE_MASK 1795 + }, 1796 + .regmap[1] = { 1797 + AIROHA_FUNC_MUX, 1798 + REG_LAN_LED1_MAPPING, 1799 + LAN1_LED_MAPPING_MASK, 1800 + LAN1_PHY2_LED_MAP 1801 + }, 1802 + .regmap_size = 2, 1803 + }, { 1804 + .name = "gpio44", 1805 + .regmap[0] = { 1806 + AIROHA_FUNC_MUX, 1807 + REG_GPIO_2ND_I2C_MODE, 1808 + GPIO_LAN1_LED1_MODE_MASK, 1809 + GPIO_LAN1_LED1_MODE_MASK 1810 + }, 1811 + .regmap[1] = { 1812 + AIROHA_FUNC_MUX, 1813 + REG_LAN_LED1_MAPPING, 1814 + LAN2_LED_MAPPING_MASK, 1815 + LAN2_PHY2_LED_MAP 1816 + }, 1817 + .regmap_size = 2, 1818 + }, { 1819 + .name = "gpio45", 1820 + .regmap[0] = { 1821 + AIROHA_FUNC_MUX, 1822 + REG_GPIO_2ND_I2C_MODE, 1823 + GPIO_LAN2_LED1_MODE_MASK, 1824 + GPIO_LAN2_LED1_MODE_MASK 1825 + }, 1826 + .regmap[1] = { 1827 + AIROHA_FUNC_MUX, 1828 + REG_LAN_LED1_MAPPING, 1829 + LAN3_LED_MAPPING_MASK, 1830 + LAN3_PHY2_LED_MAP 1831 + }, 1832 + .regmap_size = 2, 1833 + }, { 1834 + .name = "gpio46", 1835 + .regmap[0] = { 1836 + AIROHA_FUNC_MUX, 1837 + REG_GPIO_2ND_I2C_MODE, 1838 + GPIO_LAN3_LED0_MODE_MASK, 1839 + GPIO_LAN3_LED0_MODE_MASK 1840 + }, 1841 + .regmap[1] = { 1842 + AIROHA_FUNC_MUX, 1843 + REG_LAN_LED1_MAPPING, 1844 + LAN4_LED_MAPPING_MASK, 1845 + LAN4_PHY2_LED_MAP 1846 + }, 1847 + .regmap_size = 2, 1848 + }, 1849 + }; 1850 + 1851 + static const struct airoha_pinctrl_func_group phy3_led1_func_group[] = { 1852 + { 1853 + .name = "gpio43", 1854 + .regmap[0] = { 1855 + AIROHA_FUNC_MUX, 1856 + REG_GPIO_2ND_I2C_MODE, 1857 + GPIO_LAN0_LED1_MODE_MASK, 1858 + GPIO_LAN0_LED1_MODE_MASK 1859 + }, 1860 + .regmap[1] = { 1861 + AIROHA_FUNC_MUX, 1862 + REG_LAN_LED1_MAPPING, 1863 + LAN1_LED_MAPPING_MASK, 1864 + LAN1_PHY3_LED_MAP 1865 + }, 1866 + .regmap_size = 2, 1867 + }, { 1868 + .name = "gpio44", 1869 + .regmap[0] = { 1870 + AIROHA_FUNC_MUX, 1871 + REG_GPIO_2ND_I2C_MODE, 1872 + GPIO_LAN1_LED1_MODE_MASK, 1873 + GPIO_LAN1_LED1_MODE_MASK 1874 + }, 1875 + .regmap[1] = { 1876 + AIROHA_FUNC_MUX, 1877 + REG_LAN_LED1_MAPPING, 1878 + LAN2_LED_MAPPING_MASK, 1879 + LAN2_PHY3_LED_MAP 1880 + }, 1881 + .regmap_size = 2, 1882 + }, { 1883 + .name = "gpio45", 1884 + .regmap[0] = { 1885 + AIROHA_FUNC_MUX, 1886 + REG_GPIO_2ND_I2C_MODE, 1887 + GPIO_LAN2_LED1_MODE_MASK, 1888 + GPIO_LAN2_LED1_MODE_MASK 1889 + }, 1890 + .regmap[1] = { 1891 + AIROHA_FUNC_MUX, 1892 + REG_LAN_LED1_MAPPING, 1893 + LAN3_LED_MAPPING_MASK, 1894 + LAN3_PHY3_LED_MAP 1895 + }, 1896 + .regmap_size = 2, 1897 + }, { 1898 + .name = "gpio46", 1899 + .regmap[0] = { 1900 + AIROHA_FUNC_MUX, 1901 + REG_GPIO_2ND_I2C_MODE, 1902 + GPIO_LAN3_LED0_MODE_MASK, 1903 + GPIO_LAN3_LED0_MODE_MASK 1904 + }, 1905 + .regmap[1] = { 1906 + AIROHA_FUNC_MUX, 1907 + REG_LAN_LED1_MAPPING, 1908 + LAN4_LED_MAPPING_MASK, 1909 + LAN4_PHY3_LED_MAP 1910 + }, 1911 + .regmap_size = 2, 1912 + }, 1913 + }; 1914 + 1915 + static const struct airoha_pinctrl_func_group phy4_led1_func_group[] = { 1916 + { 1917 + .name = "gpio43", 1918 + .regmap[0] = { 1919 + AIROHA_FUNC_MUX, 1920 + REG_GPIO_2ND_I2C_MODE, 1921 + GPIO_LAN0_LED1_MODE_MASK, 1922 + GPIO_LAN0_LED1_MODE_MASK 1923 + }, 1924 + .regmap[1] = { 1925 + AIROHA_FUNC_MUX, 1926 + REG_LAN_LED1_MAPPING, 1927 + LAN1_LED_MAPPING_MASK, 1928 + LAN1_PHY4_LED_MAP 1929 + }, 1930 + .regmap_size = 2, 1931 + }, { 1932 + .name = "gpio44", 1933 + .regmap[0] = { 1934 + AIROHA_FUNC_MUX, 1935 + REG_GPIO_2ND_I2C_MODE, 1936 + GPIO_LAN1_LED1_MODE_MASK, 1937 + GPIO_LAN1_LED1_MODE_MASK 1938 + }, 1939 + .regmap[1] = { 1940 + AIROHA_FUNC_MUX, 1941 + REG_LAN_LED1_MAPPING, 1942 + LAN2_LED_MAPPING_MASK, 1943 + LAN2_PHY4_LED_MAP 1944 + }, 1945 + .regmap_size = 2, 1946 + }, { 1947 + .name = "gpio45", 1948 + .regmap[0] = { 1949 + AIROHA_FUNC_MUX, 1950 + REG_GPIO_2ND_I2C_MODE, 1951 + GPIO_LAN2_LED1_MODE_MASK, 1952 + GPIO_LAN2_LED1_MODE_MASK 1953 + }, 1954 + .regmap[1] = { 1955 + AIROHA_FUNC_MUX, 1956 + REG_LAN_LED1_MAPPING, 1957 + LAN3_LED_MAPPING_MASK, 1958 + LAN3_PHY4_LED_MAP 1959 + }, 1960 + .regmap_size = 2, 1961 + }, { 1962 + .name = "gpio46", 1963 + .regmap[0] = { 1964 + AIROHA_FUNC_MUX, 1965 + REG_GPIO_2ND_I2C_MODE, 1966 + GPIO_LAN3_LED0_MODE_MASK, 1967 + GPIO_LAN3_LED0_MODE_MASK 1968 + }, 1969 + .regmap[1] = { 1970 + AIROHA_FUNC_MUX, 1971 + REG_LAN_LED1_MAPPING, 1972 + LAN4_LED_MAPPING_MASK, 1973 + LAN4_PHY4_LED_MAP 1974 + }, 1975 + .regmap_size = 2, 1976 + }, 1977 + }; 1978 + 1979 + static const struct airoha_pinctrl_func airoha_pinctrl_funcs[] = { 1980 + PINCTRL_FUNC_DESC(pon), 1981 + PINCTRL_FUNC_DESC(tod_1pps), 1982 + PINCTRL_FUNC_DESC(sipo), 1983 + PINCTRL_FUNC_DESC(mdio), 1984 + PINCTRL_FUNC_DESC(uart), 1985 + PINCTRL_FUNC_DESC(i2c), 1986 + PINCTRL_FUNC_DESC(jtag), 1987 + PINCTRL_FUNC_DESC(pcm), 1988 + PINCTRL_FUNC_DESC(spi), 1989 + PINCTRL_FUNC_DESC(pcm_spi), 1990 + PINCTRL_FUNC_DESC(i2s), 1991 + PINCTRL_FUNC_DESC(emmc), 1992 + PINCTRL_FUNC_DESC(pnand), 1993 + PINCTRL_FUNC_DESC(pcie_reset), 1994 + PINCTRL_FUNC_DESC(pwm), 1995 + PINCTRL_FUNC_DESC(phy1_led0), 1996 + PINCTRL_FUNC_DESC(phy2_led0), 1997 + PINCTRL_FUNC_DESC(phy3_led0), 1998 + PINCTRL_FUNC_DESC(phy4_led0), 1999 + PINCTRL_FUNC_DESC(phy1_led1), 2000 + PINCTRL_FUNC_DESC(phy2_led1), 2001 + PINCTRL_FUNC_DESC(phy3_led1), 2002 + PINCTRL_FUNC_DESC(phy4_led1), 2003 + }; 2004 + 2005 + static const struct airoha_pinctrl_conf airoha_pinctrl_pullup_conf[] = { 2006 + PINCTRL_CONF_DESC(0, REG_I2C_SDA_PU, UART1_TXD_PU_MASK), 2007 + PINCTRL_CONF_DESC(1, REG_I2C_SDA_PU, UART1_RXD_PU_MASK), 2008 + PINCTRL_CONF_DESC(2, REG_I2C_SDA_PU, I2C_SDA_PU_MASK), 2009 + PINCTRL_CONF_DESC(3, REG_I2C_SDA_PU, I2C_SCL_PU_MASK), 2010 + PINCTRL_CONF_DESC(4, REG_I2C_SDA_PU, SPI_CS0_PU_MASK), 2011 + PINCTRL_CONF_DESC(5, REG_I2C_SDA_PU, SPI_CLK_PU_MASK), 2012 + PINCTRL_CONF_DESC(6, REG_I2C_SDA_PU, SPI_MOSI_PU_MASK), 2013 + PINCTRL_CONF_DESC(7, REG_I2C_SDA_PU, SPI_MISO_PU_MASK), 2014 + PINCTRL_CONF_DESC(13, REG_GPIO_L_PU, BIT(0)), 2015 + PINCTRL_CONF_DESC(14, REG_GPIO_L_PU, BIT(1)), 2016 + PINCTRL_CONF_DESC(15, REG_GPIO_L_PU, BIT(2)), 2017 + PINCTRL_CONF_DESC(16, REG_GPIO_L_PU, BIT(3)), 2018 + PINCTRL_CONF_DESC(17, REG_GPIO_L_PU, BIT(4)), 2019 + PINCTRL_CONF_DESC(18, REG_GPIO_L_PU, BIT(5)), 2020 + PINCTRL_CONF_DESC(19, REG_GPIO_L_PU, BIT(6)), 2021 + PINCTRL_CONF_DESC(20, REG_GPIO_L_PU, BIT(7)), 2022 + PINCTRL_CONF_DESC(21, REG_GPIO_L_PU, BIT(8)), 2023 + PINCTRL_CONF_DESC(22, REG_GPIO_L_PU, BIT(9)), 2024 + PINCTRL_CONF_DESC(23, REG_GPIO_L_PU, BIT(10)), 2025 + PINCTRL_CONF_DESC(24, REG_GPIO_L_PU, BIT(11)), 2026 + PINCTRL_CONF_DESC(25, REG_GPIO_L_PU, BIT(12)), 2027 + PINCTRL_CONF_DESC(26, REG_GPIO_L_PU, BIT(13)), 2028 + PINCTRL_CONF_DESC(27, REG_GPIO_L_PU, BIT(14)), 2029 + PINCTRL_CONF_DESC(28, REG_GPIO_L_PU, BIT(15)), 2030 + PINCTRL_CONF_DESC(29, REG_GPIO_L_PU, BIT(16)), 2031 + PINCTRL_CONF_DESC(30, REG_GPIO_L_PU, BIT(17)), 2032 + PINCTRL_CONF_DESC(31, REG_GPIO_L_PU, BIT(18)), 2033 + PINCTRL_CONF_DESC(32, REG_GPIO_L_PU, BIT(18)), 2034 + PINCTRL_CONF_DESC(33, REG_GPIO_L_PU, BIT(20)), 2035 + PINCTRL_CONF_DESC(34, REG_GPIO_L_PU, BIT(21)), 2036 + PINCTRL_CONF_DESC(35, REG_GPIO_L_PU, BIT(22)), 2037 + PINCTRL_CONF_DESC(36, REG_GPIO_L_PU, BIT(23)), 2038 + PINCTRL_CONF_DESC(37, REG_GPIO_L_PU, BIT(24)), 2039 + PINCTRL_CONF_DESC(38, REG_GPIO_L_PU, BIT(25)), 2040 + PINCTRL_CONF_DESC(39, REG_GPIO_L_PU, BIT(26)), 2041 + PINCTRL_CONF_DESC(40, REG_GPIO_L_PU, BIT(27)), 2042 + PINCTRL_CONF_DESC(41, REG_GPIO_L_PU, BIT(28)), 2043 + PINCTRL_CONF_DESC(42, REG_GPIO_L_PU, BIT(29)), 2044 + PINCTRL_CONF_DESC(43, REG_GPIO_L_PU, BIT(30)), 2045 + PINCTRL_CONF_DESC(44, REG_GPIO_L_PU, BIT(31)), 2046 + PINCTRL_CONF_DESC(45, REG_GPIO_H_PU, BIT(0)), 2047 + PINCTRL_CONF_DESC(46, REG_GPIO_H_PU, BIT(1)), 2048 + PINCTRL_CONF_DESC(47, REG_GPIO_H_PU, BIT(2)), 2049 + PINCTRL_CONF_DESC(48, REG_GPIO_H_PU, BIT(3)), 2050 + PINCTRL_CONF_DESC(49, REG_GPIO_H_PU, BIT(4)), 2051 + PINCTRL_CONF_DESC(50, REG_GPIO_H_PU, BIT(5)), 2052 + PINCTRL_CONF_DESC(51, REG_GPIO_H_PU, BIT(6)), 2053 + PINCTRL_CONF_DESC(52, REG_GPIO_H_PU, BIT(7)), 2054 + PINCTRL_CONF_DESC(53, REG_GPIO_H_PU, BIT(8)), 2055 + PINCTRL_CONF_DESC(54, REG_GPIO_H_PU, BIT(9)), 2056 + PINCTRL_CONF_DESC(55, REG_GPIO_H_PU, BIT(10)), 2057 + PINCTRL_CONF_DESC(56, REG_GPIO_H_PU, BIT(11)), 2058 + PINCTRL_CONF_DESC(57, REG_GPIO_H_PU, BIT(12)), 2059 + PINCTRL_CONF_DESC(58, REG_GPIO_H_PU, BIT(13)), 2060 + PINCTRL_CONF_DESC(59, REG_GPIO_H_PU, BIT(14)), 2061 + PINCTRL_CONF_DESC(61, REG_I2C_SDA_PU, PCIE0_RESET_PU_MASK), 2062 + PINCTRL_CONF_DESC(62, REG_I2C_SDA_PU, PCIE1_RESET_PU_MASK), 2063 + PINCTRL_CONF_DESC(63, REG_I2C_SDA_PU, PCIE2_RESET_PU_MASK), 2064 + }; 2065 + 2066 + static const struct airoha_pinctrl_conf airoha_pinctrl_pulldown_conf[] = { 2067 + PINCTRL_CONF_DESC(0, REG_I2C_SDA_PD, UART1_TXD_PD_MASK), 2068 + PINCTRL_CONF_DESC(1, REG_I2C_SDA_PD, UART1_RXD_PD_MASK), 2069 + PINCTRL_CONF_DESC(2, REG_I2C_SDA_PD, I2C_SDA_PD_MASK), 2070 + PINCTRL_CONF_DESC(3, REG_I2C_SDA_PD, I2C_SCL_PD_MASK), 2071 + PINCTRL_CONF_DESC(4, REG_I2C_SDA_PD, SPI_CS0_PD_MASK), 2072 + PINCTRL_CONF_DESC(5, REG_I2C_SDA_PD, SPI_CLK_PD_MASK), 2073 + PINCTRL_CONF_DESC(6, REG_I2C_SDA_PD, SPI_MOSI_PD_MASK), 2074 + PINCTRL_CONF_DESC(7, REG_I2C_SDA_PD, SPI_MISO_PD_MASK), 2075 + PINCTRL_CONF_DESC(13, REG_GPIO_L_PD, BIT(0)), 2076 + PINCTRL_CONF_DESC(14, REG_GPIO_L_PD, BIT(1)), 2077 + PINCTRL_CONF_DESC(15, REG_GPIO_L_PD, BIT(2)), 2078 + PINCTRL_CONF_DESC(16, REG_GPIO_L_PD, BIT(3)), 2079 + PINCTRL_CONF_DESC(17, REG_GPIO_L_PD, BIT(4)), 2080 + PINCTRL_CONF_DESC(18, REG_GPIO_L_PD, BIT(5)), 2081 + PINCTRL_CONF_DESC(19, REG_GPIO_L_PD, BIT(6)), 2082 + PINCTRL_CONF_DESC(20, REG_GPIO_L_PD, BIT(7)), 2083 + PINCTRL_CONF_DESC(21, REG_GPIO_L_PD, BIT(8)), 2084 + PINCTRL_CONF_DESC(22, REG_GPIO_L_PD, BIT(9)), 2085 + PINCTRL_CONF_DESC(23, REG_GPIO_L_PD, BIT(10)), 2086 + PINCTRL_CONF_DESC(24, REG_GPIO_L_PD, BIT(11)), 2087 + PINCTRL_CONF_DESC(25, REG_GPIO_L_PD, BIT(12)), 2088 + PINCTRL_CONF_DESC(26, REG_GPIO_L_PD, BIT(13)), 2089 + PINCTRL_CONF_DESC(27, REG_GPIO_L_PD, BIT(14)), 2090 + PINCTRL_CONF_DESC(28, REG_GPIO_L_PD, BIT(15)), 2091 + PINCTRL_CONF_DESC(29, REG_GPIO_L_PD, BIT(16)), 2092 + PINCTRL_CONF_DESC(30, REG_GPIO_L_PD, BIT(17)), 2093 + PINCTRL_CONF_DESC(31, REG_GPIO_L_PD, BIT(18)), 2094 + PINCTRL_CONF_DESC(32, REG_GPIO_L_PD, BIT(18)), 2095 + PINCTRL_CONF_DESC(33, REG_GPIO_L_PD, BIT(20)), 2096 + PINCTRL_CONF_DESC(34, REG_GPIO_L_PD, BIT(21)), 2097 + PINCTRL_CONF_DESC(35, REG_GPIO_L_PD, BIT(22)), 2098 + PINCTRL_CONF_DESC(36, REG_GPIO_L_PD, BIT(23)), 2099 + PINCTRL_CONF_DESC(37, REG_GPIO_L_PD, BIT(24)), 2100 + PINCTRL_CONF_DESC(38, REG_GPIO_L_PD, BIT(25)), 2101 + PINCTRL_CONF_DESC(39, REG_GPIO_L_PD, BIT(26)), 2102 + PINCTRL_CONF_DESC(40, REG_GPIO_L_PD, BIT(27)), 2103 + PINCTRL_CONF_DESC(41, REG_GPIO_L_PD, BIT(28)), 2104 + PINCTRL_CONF_DESC(42, REG_GPIO_L_PD, BIT(29)), 2105 + PINCTRL_CONF_DESC(43, REG_GPIO_L_PD, BIT(30)), 2106 + PINCTRL_CONF_DESC(44, REG_GPIO_L_PD, BIT(31)), 2107 + PINCTRL_CONF_DESC(45, REG_GPIO_H_PD, BIT(0)), 2108 + PINCTRL_CONF_DESC(46, REG_GPIO_H_PD, BIT(1)), 2109 + PINCTRL_CONF_DESC(47, REG_GPIO_H_PD, BIT(2)), 2110 + PINCTRL_CONF_DESC(48, REG_GPIO_H_PD, BIT(3)), 2111 + PINCTRL_CONF_DESC(49, REG_GPIO_H_PD, BIT(4)), 2112 + PINCTRL_CONF_DESC(50, REG_GPIO_H_PD, BIT(5)), 2113 + PINCTRL_CONF_DESC(51, REG_GPIO_H_PD, BIT(6)), 2114 + PINCTRL_CONF_DESC(52, REG_GPIO_H_PD, BIT(7)), 2115 + PINCTRL_CONF_DESC(53, REG_GPIO_H_PD, BIT(8)), 2116 + PINCTRL_CONF_DESC(54, REG_GPIO_H_PD, BIT(9)), 2117 + PINCTRL_CONF_DESC(55, REG_GPIO_H_PD, BIT(10)), 2118 + PINCTRL_CONF_DESC(56, REG_GPIO_H_PD, BIT(11)), 2119 + PINCTRL_CONF_DESC(57, REG_GPIO_H_PD, BIT(12)), 2120 + PINCTRL_CONF_DESC(58, REG_GPIO_H_PD, BIT(13)), 2121 + PINCTRL_CONF_DESC(59, REG_GPIO_H_PD, BIT(14)), 2122 + PINCTRL_CONF_DESC(61, REG_I2C_SDA_PD, PCIE0_RESET_PD_MASK), 2123 + PINCTRL_CONF_DESC(62, REG_I2C_SDA_PD, PCIE1_RESET_PD_MASK), 2124 + PINCTRL_CONF_DESC(63, REG_I2C_SDA_PD, PCIE2_RESET_PD_MASK), 2125 + }; 2126 + 2127 + static const struct airoha_pinctrl_conf airoha_pinctrl_drive_e2_conf[] = { 2128 + PINCTRL_CONF_DESC(0, REG_I2C_SDA_E2, UART1_TXD_E2_MASK), 2129 + PINCTRL_CONF_DESC(1, REG_I2C_SDA_E2, UART1_RXD_E2_MASK), 2130 + PINCTRL_CONF_DESC(2, REG_I2C_SDA_E2, I2C_SDA_E2_MASK), 2131 + PINCTRL_CONF_DESC(3, REG_I2C_SDA_E2, I2C_SCL_E2_MASK), 2132 + PINCTRL_CONF_DESC(4, REG_I2C_SDA_E2, SPI_CS0_E2_MASK), 2133 + PINCTRL_CONF_DESC(5, REG_I2C_SDA_E2, SPI_CLK_E2_MASK), 2134 + PINCTRL_CONF_DESC(6, REG_I2C_SDA_E2, SPI_MOSI_E2_MASK), 2135 + PINCTRL_CONF_DESC(7, REG_I2C_SDA_E2, SPI_MISO_E2_MASK), 2136 + PINCTRL_CONF_DESC(13, REG_GPIO_L_E2, BIT(0)), 2137 + PINCTRL_CONF_DESC(14, REG_GPIO_L_E2, BIT(1)), 2138 + PINCTRL_CONF_DESC(15, REG_GPIO_L_E2, BIT(2)), 2139 + PINCTRL_CONF_DESC(16, REG_GPIO_L_E2, BIT(3)), 2140 + PINCTRL_CONF_DESC(17, REG_GPIO_L_E2, BIT(4)), 2141 + PINCTRL_CONF_DESC(18, REG_GPIO_L_E2, BIT(5)), 2142 + PINCTRL_CONF_DESC(19, REG_GPIO_L_E2, BIT(6)), 2143 + PINCTRL_CONF_DESC(20, REG_GPIO_L_E2, BIT(7)), 2144 + PINCTRL_CONF_DESC(21, REG_GPIO_L_E2, BIT(8)), 2145 + PINCTRL_CONF_DESC(22, REG_GPIO_L_E2, BIT(9)), 2146 + PINCTRL_CONF_DESC(23, REG_GPIO_L_E2, BIT(10)), 2147 + PINCTRL_CONF_DESC(24, REG_GPIO_L_E2, BIT(11)), 2148 + PINCTRL_CONF_DESC(25, REG_GPIO_L_E2, BIT(12)), 2149 + PINCTRL_CONF_DESC(26, REG_GPIO_L_E2, BIT(13)), 2150 + PINCTRL_CONF_DESC(27, REG_GPIO_L_E2, BIT(14)), 2151 + PINCTRL_CONF_DESC(28, REG_GPIO_L_E2, BIT(15)), 2152 + PINCTRL_CONF_DESC(29, REG_GPIO_L_E2, BIT(16)), 2153 + PINCTRL_CONF_DESC(30, REG_GPIO_L_E2, BIT(17)), 2154 + PINCTRL_CONF_DESC(31, REG_GPIO_L_E2, BIT(18)), 2155 + PINCTRL_CONF_DESC(32, REG_GPIO_L_E2, BIT(18)), 2156 + PINCTRL_CONF_DESC(33, REG_GPIO_L_E2, BIT(20)), 2157 + PINCTRL_CONF_DESC(34, REG_GPIO_L_E2, BIT(21)), 2158 + PINCTRL_CONF_DESC(35, REG_GPIO_L_E2, BIT(22)), 2159 + PINCTRL_CONF_DESC(36, REG_GPIO_L_E2, BIT(23)), 2160 + PINCTRL_CONF_DESC(37, REG_GPIO_L_E2, BIT(24)), 2161 + PINCTRL_CONF_DESC(38, REG_GPIO_L_E2, BIT(25)), 2162 + PINCTRL_CONF_DESC(39, REG_GPIO_L_E2, BIT(26)), 2163 + PINCTRL_CONF_DESC(40, REG_GPIO_L_E2, BIT(27)), 2164 + PINCTRL_CONF_DESC(41, REG_GPIO_L_E2, BIT(28)), 2165 + PINCTRL_CONF_DESC(42, REG_GPIO_L_E2, BIT(29)), 2166 + PINCTRL_CONF_DESC(43, REG_GPIO_L_E2, BIT(30)), 2167 + PINCTRL_CONF_DESC(44, REG_GPIO_L_E2, BIT(31)), 2168 + PINCTRL_CONF_DESC(45, REG_GPIO_H_E2, BIT(0)), 2169 + PINCTRL_CONF_DESC(46, REG_GPIO_H_E2, BIT(1)), 2170 + PINCTRL_CONF_DESC(47, REG_GPIO_H_E2, BIT(2)), 2171 + PINCTRL_CONF_DESC(48, REG_GPIO_H_E2, BIT(3)), 2172 + PINCTRL_CONF_DESC(49, REG_GPIO_H_E2, BIT(4)), 2173 + PINCTRL_CONF_DESC(50, REG_GPIO_H_E2, BIT(5)), 2174 + PINCTRL_CONF_DESC(51, REG_GPIO_H_E2, BIT(6)), 2175 + PINCTRL_CONF_DESC(52, REG_GPIO_H_E2, BIT(7)), 2176 + PINCTRL_CONF_DESC(53, REG_GPIO_H_E2, BIT(8)), 2177 + PINCTRL_CONF_DESC(54, REG_GPIO_H_E2, BIT(9)), 2178 + PINCTRL_CONF_DESC(55, REG_GPIO_H_E2, BIT(10)), 2179 + PINCTRL_CONF_DESC(56, REG_GPIO_H_E2, BIT(11)), 2180 + PINCTRL_CONF_DESC(57, REG_GPIO_H_E2, BIT(12)), 2181 + PINCTRL_CONF_DESC(58, REG_GPIO_H_E2, BIT(13)), 2182 + PINCTRL_CONF_DESC(59, REG_GPIO_H_E2, BIT(14)), 2183 + PINCTRL_CONF_DESC(61, REG_I2C_SDA_E2, PCIE0_RESET_E2_MASK), 2184 + PINCTRL_CONF_DESC(62, REG_I2C_SDA_E2, PCIE1_RESET_E2_MASK), 2185 + PINCTRL_CONF_DESC(63, REG_I2C_SDA_E2, PCIE2_RESET_E2_MASK), 2186 + }; 2187 + 2188 + static const struct airoha_pinctrl_conf airoha_pinctrl_drive_e4_conf[] = { 2189 + PINCTRL_CONF_DESC(0, REG_I2C_SDA_E4, UART1_TXD_E4_MASK), 2190 + PINCTRL_CONF_DESC(1, REG_I2C_SDA_E4, UART1_RXD_E4_MASK), 2191 + PINCTRL_CONF_DESC(2, REG_I2C_SDA_E4, I2C_SDA_E4_MASK), 2192 + PINCTRL_CONF_DESC(3, REG_I2C_SDA_E4, I2C_SCL_E4_MASK), 2193 + PINCTRL_CONF_DESC(4, REG_I2C_SDA_E4, SPI_CS0_E4_MASK), 2194 + PINCTRL_CONF_DESC(5, REG_I2C_SDA_E4, SPI_CLK_E4_MASK), 2195 + PINCTRL_CONF_DESC(6, REG_I2C_SDA_E4, SPI_MOSI_E4_MASK), 2196 + PINCTRL_CONF_DESC(7, REG_I2C_SDA_E4, SPI_MISO_E4_MASK), 2197 + PINCTRL_CONF_DESC(13, REG_GPIO_L_E4, BIT(0)), 2198 + PINCTRL_CONF_DESC(14, REG_GPIO_L_E4, BIT(1)), 2199 + PINCTRL_CONF_DESC(15, REG_GPIO_L_E4, BIT(2)), 2200 + PINCTRL_CONF_DESC(16, REG_GPIO_L_E4, BIT(3)), 2201 + PINCTRL_CONF_DESC(17, REG_GPIO_L_E4, BIT(4)), 2202 + PINCTRL_CONF_DESC(18, REG_GPIO_L_E4, BIT(5)), 2203 + PINCTRL_CONF_DESC(19, REG_GPIO_L_E4, BIT(6)), 2204 + PINCTRL_CONF_DESC(20, REG_GPIO_L_E4, BIT(7)), 2205 + PINCTRL_CONF_DESC(21, REG_GPIO_L_E4, BIT(8)), 2206 + PINCTRL_CONF_DESC(22, REG_GPIO_L_E4, BIT(9)), 2207 + PINCTRL_CONF_DESC(23, REG_GPIO_L_E4, BIT(10)), 2208 + PINCTRL_CONF_DESC(24, REG_GPIO_L_E4, BIT(11)), 2209 + PINCTRL_CONF_DESC(25, REG_GPIO_L_E4, BIT(12)), 2210 + PINCTRL_CONF_DESC(26, REG_GPIO_L_E4, BIT(13)), 2211 + PINCTRL_CONF_DESC(27, REG_GPIO_L_E4, BIT(14)), 2212 + PINCTRL_CONF_DESC(28, REG_GPIO_L_E4, BIT(15)), 2213 + PINCTRL_CONF_DESC(29, REG_GPIO_L_E4, BIT(16)), 2214 + PINCTRL_CONF_DESC(30, REG_GPIO_L_E4, BIT(17)), 2215 + PINCTRL_CONF_DESC(31, REG_GPIO_L_E4, BIT(18)), 2216 + PINCTRL_CONF_DESC(32, REG_GPIO_L_E4, BIT(18)), 2217 + PINCTRL_CONF_DESC(33, REG_GPIO_L_E4, BIT(20)), 2218 + PINCTRL_CONF_DESC(34, REG_GPIO_L_E4, BIT(21)), 2219 + PINCTRL_CONF_DESC(35, REG_GPIO_L_E4, BIT(22)), 2220 + PINCTRL_CONF_DESC(36, REG_GPIO_L_E4, BIT(23)), 2221 + PINCTRL_CONF_DESC(37, REG_GPIO_L_E4, BIT(24)), 2222 + PINCTRL_CONF_DESC(38, REG_GPIO_L_E4, BIT(25)), 2223 + PINCTRL_CONF_DESC(39, REG_GPIO_L_E4, BIT(26)), 2224 + PINCTRL_CONF_DESC(40, REG_GPIO_L_E4, BIT(27)), 2225 + PINCTRL_CONF_DESC(41, REG_GPIO_L_E4, BIT(28)), 2226 + PINCTRL_CONF_DESC(42, REG_GPIO_L_E4, BIT(29)), 2227 + PINCTRL_CONF_DESC(43, REG_GPIO_L_E4, BIT(30)), 2228 + PINCTRL_CONF_DESC(44, REG_GPIO_L_E4, BIT(31)), 2229 + PINCTRL_CONF_DESC(45, REG_GPIO_H_E4, BIT(0)), 2230 + PINCTRL_CONF_DESC(46, REG_GPIO_H_E4, BIT(1)), 2231 + PINCTRL_CONF_DESC(47, REG_GPIO_H_E4, BIT(2)), 2232 + PINCTRL_CONF_DESC(48, REG_GPIO_H_E4, BIT(3)), 2233 + PINCTRL_CONF_DESC(49, REG_GPIO_H_E4, BIT(4)), 2234 + PINCTRL_CONF_DESC(50, REG_GPIO_H_E4, BIT(5)), 2235 + PINCTRL_CONF_DESC(51, REG_GPIO_H_E4, BIT(6)), 2236 + PINCTRL_CONF_DESC(52, REG_GPIO_H_E4, BIT(7)), 2237 + PINCTRL_CONF_DESC(53, REG_GPIO_H_E4, BIT(8)), 2238 + PINCTRL_CONF_DESC(54, REG_GPIO_H_E4, BIT(9)), 2239 + PINCTRL_CONF_DESC(55, REG_GPIO_H_E4, BIT(10)), 2240 + PINCTRL_CONF_DESC(56, REG_GPIO_H_E4, BIT(11)), 2241 + PINCTRL_CONF_DESC(57, REG_GPIO_H_E4, BIT(12)), 2242 + PINCTRL_CONF_DESC(58, REG_GPIO_H_E4, BIT(13)), 2243 + PINCTRL_CONF_DESC(59, REG_GPIO_H_E4, BIT(14)), 2244 + PINCTRL_CONF_DESC(61, REG_I2C_SDA_E4, PCIE0_RESET_E4_MASK), 2245 + PINCTRL_CONF_DESC(62, REG_I2C_SDA_E4, PCIE1_RESET_E4_MASK), 2246 + PINCTRL_CONF_DESC(63, REG_I2C_SDA_E4, PCIE2_RESET_E4_MASK), 2247 + }; 2248 + 2249 + static const struct airoha_pinctrl_conf airoha_pinctrl_pcie_rst_od_conf[] = { 2250 + PINCTRL_CONF_DESC(61, REG_PCIE_RESET_OD, PCIE0_RESET_OD_MASK), 2251 + PINCTRL_CONF_DESC(62, REG_PCIE_RESET_OD, PCIE1_RESET_OD_MASK), 2252 + PINCTRL_CONF_DESC(63, REG_PCIE_RESET_OD, PCIE2_RESET_OD_MASK), 2253 + }; 2254 + 2255 + static int airoha_convert_pin_to_reg_offset(struct pinctrl_dev *pctrl_dev, 2256 + struct pinctrl_gpio_range *range, 2257 + int pin) 2258 + { 2259 + if (!range) 2260 + range = pinctrl_find_gpio_range_from_pin_nolock(pctrl_dev, 2261 + pin); 2262 + if (!range) 2263 + return -EINVAL; 2264 + 2265 + return pin - range->pin_base; 2266 + } 2267 + 2268 + /* gpio callbacks */ 2269 + static void airoha_gpio_set(struct gpio_chip *chip, unsigned int gpio, 2270 + int value) 2271 + { 2272 + struct airoha_pinctrl *pinctrl = gpiochip_get_data(chip); 2273 + u32 offset = gpio % AIROHA_PIN_BANK_SIZE; 2274 + u8 index = gpio / AIROHA_PIN_BANK_SIZE; 2275 + 2276 + regmap_update_bits(pinctrl->regmap, pinctrl->gpiochip.data[index], 2277 + BIT(offset), value ? BIT(offset) : 0); 2278 + } 2279 + 2280 + static int airoha_gpio_get(struct gpio_chip *chip, unsigned int gpio) 2281 + { 2282 + struct airoha_pinctrl *pinctrl = gpiochip_get_data(chip); 2283 + u32 val, pin = gpio % AIROHA_PIN_BANK_SIZE; 2284 + u8 index = gpio / AIROHA_PIN_BANK_SIZE; 2285 + int err; 2286 + 2287 + err = regmap_read(pinctrl->regmap, 2288 + pinctrl->gpiochip.data[index], &val); 2289 + 2290 + return err ? err : !!(val & BIT(pin)); 2291 + } 2292 + 2293 + static int airoha_gpio_direction_output(struct gpio_chip *chip, 2294 + unsigned int gpio, int value) 2295 + { 2296 + int err; 2297 + 2298 + err = pinctrl_gpio_direction_output(chip, gpio); 2299 + if (err) 2300 + return err; 2301 + 2302 + airoha_gpio_set(chip, gpio, value); 2303 + 2304 + return 0; 2305 + } 2306 + 2307 + /* irq callbacks */ 2308 + static void airoha_irq_unmask(struct irq_data *data) 2309 + { 2310 + u8 offset = data->hwirq % AIROHA_REG_GPIOCTRL_NUM_PIN; 2311 + u8 index = data->hwirq / AIROHA_REG_GPIOCTRL_NUM_PIN; 2312 + u32 mask = GENMASK(2 * offset + 1, 2 * offset); 2313 + struct airoha_pinctrl_gpiochip *gpiochip; 2314 + struct airoha_pinctrl *pinctrl; 2315 + u32 val = BIT(2 * offset); 2316 + 2317 + gpiochip = irq_data_get_irq_chip_data(data); 2318 + if (WARN_ON_ONCE(data->hwirq >= ARRAY_SIZE(gpiochip->irq_type))) 2319 + return; 2320 + 2321 + pinctrl = container_of(gpiochip, struct airoha_pinctrl, gpiochip); 2322 + switch (gpiochip->irq_type[data->hwirq]) { 2323 + case IRQ_TYPE_LEVEL_LOW: 2324 + val = val << 1; 2325 + fallthrough; 2326 + case IRQ_TYPE_LEVEL_HIGH: 2327 + regmap_update_bits(pinctrl->regmap, gpiochip->level[index], 2328 + mask, val); 2329 + break; 2330 + case IRQ_TYPE_EDGE_FALLING: 2331 + val = val << 1; 2332 + fallthrough; 2333 + case IRQ_TYPE_EDGE_RISING: 2334 + regmap_update_bits(pinctrl->regmap, gpiochip->edge[index], 2335 + mask, val); 2336 + break; 2337 + case IRQ_TYPE_EDGE_BOTH: 2338 + regmap_set_bits(pinctrl->regmap, gpiochip->edge[index], mask); 2339 + break; 2340 + default: 2341 + break; 2342 + } 2343 + } 2344 + 2345 + static void airoha_irq_mask(struct irq_data *data) 2346 + { 2347 + u8 offset = data->hwirq % AIROHA_REG_GPIOCTRL_NUM_PIN; 2348 + u8 index = data->hwirq / AIROHA_REG_GPIOCTRL_NUM_PIN; 2349 + u32 mask = GENMASK(2 * offset + 1, 2 * offset); 2350 + struct airoha_pinctrl_gpiochip *gpiochip; 2351 + struct airoha_pinctrl *pinctrl; 2352 + 2353 + gpiochip = irq_data_get_irq_chip_data(data); 2354 + pinctrl = container_of(gpiochip, struct airoha_pinctrl, gpiochip); 2355 + 2356 + regmap_clear_bits(pinctrl->regmap, gpiochip->level[index], mask); 2357 + regmap_clear_bits(pinctrl->regmap, gpiochip->edge[index], mask); 2358 + } 2359 + 2360 + static int airoha_irq_type(struct irq_data *data, unsigned int type) 2361 + { 2362 + struct airoha_pinctrl_gpiochip *gpiochip; 2363 + 2364 + gpiochip = irq_data_get_irq_chip_data(data); 2365 + if (data->hwirq >= ARRAY_SIZE(gpiochip->irq_type)) 2366 + return -EINVAL; 2367 + 2368 + if (type == IRQ_TYPE_PROBE) { 2369 + if (gpiochip->irq_type[data->hwirq]) 2370 + return 0; 2371 + 2372 + type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; 2373 + } 2374 + gpiochip->irq_type[data->hwirq] = type & IRQ_TYPE_SENSE_MASK; 2375 + 2376 + return 0; 2377 + } 2378 + 2379 + static irqreturn_t airoha_irq_handler(int irq, void *data) 2380 + { 2381 + struct airoha_pinctrl *pinctrl = data; 2382 + bool handled = false; 2383 + int i; 2384 + 2385 + for (i = 0; i < ARRAY_SIZE(irq_status_regs); i++) { 2386 + struct gpio_irq_chip *girq = &pinctrl->gpiochip.chip.irq; 2387 + u32 regmap; 2388 + unsigned long status; 2389 + int irq; 2390 + 2391 + if (regmap_read(pinctrl->regmap, pinctrl->gpiochip.status[i], 2392 + &regmap)) 2393 + continue; 2394 + 2395 + status = regmap; 2396 + for_each_set_bit(irq, &status, AIROHA_PIN_BANK_SIZE) { 2397 + u32 offset = irq + i * AIROHA_PIN_BANK_SIZE; 2398 + 2399 + generic_handle_irq(irq_find_mapping(girq->domain, 2400 + offset)); 2401 + regmap_write(pinctrl->regmap, 2402 + pinctrl->gpiochip.status[i], BIT(irq)); 2403 + } 2404 + handled |= !!status; 2405 + } 2406 + 2407 + return handled ? IRQ_HANDLED : IRQ_NONE; 2408 + } 2409 + 2410 + static const struct irq_chip airoha_gpio_irq_chip = { 2411 + .name = "airoha-gpio-irq", 2412 + .irq_unmask = airoha_irq_unmask, 2413 + .irq_mask = airoha_irq_mask, 2414 + .irq_mask_ack = airoha_irq_mask, 2415 + .irq_set_type = airoha_irq_type, 2416 + .flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_IMMUTABLE, 2417 + }; 2418 + 2419 + static int airoha_pinctrl_add_gpiochip(struct airoha_pinctrl *pinctrl, 2420 + struct platform_device *pdev) 2421 + { 2422 + struct airoha_pinctrl_gpiochip *chip = &pinctrl->gpiochip; 2423 + struct gpio_chip *gc = &chip->chip; 2424 + struct gpio_irq_chip *girq = &gc->irq; 2425 + struct device *dev = &pdev->dev; 2426 + int irq, err; 2427 + 2428 + chip->data = gpio_data_regs; 2429 + chip->dir = gpio_dir_regs; 2430 + chip->out = gpio_out_regs; 2431 + chip->status = irq_status_regs; 2432 + chip->level = irq_level_regs; 2433 + chip->edge = irq_edge_regs; 2434 + 2435 + gc->parent = dev; 2436 + gc->label = dev_name(dev); 2437 + gc->request = gpiochip_generic_request; 2438 + gc->free = gpiochip_generic_free; 2439 + gc->direction_input = pinctrl_gpio_direction_input; 2440 + gc->direction_output = airoha_gpio_direction_output; 2441 + gc->set = airoha_gpio_set; 2442 + gc->get = airoha_gpio_get; 2443 + gc->base = -1; 2444 + gc->ngpio = AIROHA_NUM_PINS; 2445 + 2446 + girq->default_type = IRQ_TYPE_NONE; 2447 + girq->handler = handle_simple_irq; 2448 + gpio_irq_chip_set_chip(girq, &airoha_gpio_irq_chip); 2449 + 2450 + irq = platform_get_irq(pdev, 0); 2451 + if (irq < 0) 2452 + return irq; 2453 + 2454 + err = devm_request_irq(dev, irq, airoha_irq_handler, IRQF_SHARED, 2455 + dev_name(dev), pinctrl); 2456 + if (err) { 2457 + dev_err(dev, "error requesting irq %d: %d\n", irq, err); 2458 + return err; 2459 + } 2460 + 2461 + return devm_gpiochip_add_data(dev, gc, pinctrl); 2462 + } 2463 + 2464 + /* pinmux callbacks */ 2465 + static int airoha_pinmux_set_mux(struct pinctrl_dev *pctrl_dev, 2466 + unsigned int selector, 2467 + unsigned int group) 2468 + { 2469 + struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 2470 + const struct airoha_pinctrl_func *func; 2471 + struct function_desc *desc; 2472 + struct group_desc *grp; 2473 + int i; 2474 + 2475 + desc = pinmux_generic_get_function(pctrl_dev, selector); 2476 + if (!desc) 2477 + return -EINVAL; 2478 + 2479 + grp = pinctrl_generic_get_group(pctrl_dev, group); 2480 + if (!grp) 2481 + return -EINVAL; 2482 + 2483 + dev_dbg(pctrl_dev->dev, "enable function %s group %s\n", 2484 + desc->func.name, grp->grp.name); 2485 + 2486 + func = desc->data; 2487 + for (i = 0; i < func->group_size; i++) { 2488 + const struct airoha_pinctrl_func_group *group; 2489 + int j; 2490 + 2491 + group = &func->groups[i]; 2492 + if (strcmp(group->name, grp->grp.name)) 2493 + continue; 2494 + 2495 + for (j = 0; j < group->regmap_size; j++) { 2496 + switch (group->regmap[j].mux) { 2497 + case AIROHA_FUNC_PWM_EXT_MUX: 2498 + case AIROHA_FUNC_PWM_MUX: 2499 + regmap_update_bits(pinctrl->regmap, 2500 + group->regmap[j].offset, 2501 + group->regmap[j].mask, 2502 + group->regmap[j].val); 2503 + break; 2504 + default: 2505 + regmap_update_bits(pinctrl->chip_scu, 2506 + group->regmap[j].offset, 2507 + group->regmap[j].mask, 2508 + group->regmap[j].val); 2509 + break; 2510 + } 2511 + } 2512 + return 0; 2513 + } 2514 + 2515 + return -EINVAL; 2516 + } 2517 + 2518 + static int airoha_pinmux_set_direction(struct pinctrl_dev *pctrl_dev, 2519 + struct pinctrl_gpio_range *range, 2520 + unsigned int p, bool input) 2521 + { 2522 + struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 2523 + u32 mask, index; 2524 + int err, pin; 2525 + 2526 + pin = airoha_convert_pin_to_reg_offset(pctrl_dev, range, p); 2527 + if (pin < 0) 2528 + return pin; 2529 + 2530 + /* set output enable */ 2531 + mask = BIT(pin % AIROHA_PIN_BANK_SIZE); 2532 + index = pin / AIROHA_PIN_BANK_SIZE; 2533 + err = regmap_update_bits(pinctrl->regmap, pinctrl->gpiochip.out[index], 2534 + mask, !input ? mask : 0); 2535 + if (err) 2536 + return err; 2537 + 2538 + /* set direction */ 2539 + mask = BIT(2 * (pin % AIROHA_REG_GPIOCTRL_NUM_PIN)); 2540 + index = pin / AIROHA_REG_GPIOCTRL_NUM_PIN; 2541 + return regmap_update_bits(pinctrl->regmap, 2542 + pinctrl->gpiochip.dir[index], mask, 2543 + !input ? mask : 0); 2544 + } 2545 + 2546 + static const struct pinmux_ops airoha_pmxops = { 2547 + .get_functions_count = pinmux_generic_get_function_count, 2548 + .get_function_name = pinmux_generic_get_function_name, 2549 + .get_function_groups = pinmux_generic_get_function_groups, 2550 + .gpio_set_direction = airoha_pinmux_set_direction, 2551 + .set_mux = airoha_pinmux_set_mux, 2552 + .strict = true, 2553 + }; 2554 + 2555 + /* pinconf callbacks */ 2556 + static const struct airoha_pinctrl_reg * 2557 + airoha_pinctrl_get_conf_reg(const struct airoha_pinctrl_conf *conf, 2558 + int conf_size, int pin) 2559 + { 2560 + int i; 2561 + 2562 + for (i = 0; i < conf_size; i++) { 2563 + if (conf[i].pin == pin) 2564 + return &conf[i].reg; 2565 + } 2566 + 2567 + return NULL; 2568 + } 2569 + 2570 + static int airoha_pinctrl_get_conf(struct airoha_pinctrl *pinctrl, 2571 + const struct airoha_pinctrl_conf *conf, 2572 + int conf_size, int pin, u32 *val) 2573 + { 2574 + const struct airoha_pinctrl_reg *reg; 2575 + 2576 + reg = airoha_pinctrl_get_conf_reg(conf, conf_size, pin); 2577 + if (!reg) 2578 + return -EINVAL; 2579 + 2580 + if (regmap_read(pinctrl->chip_scu, reg->offset, val)) 2581 + return -EINVAL; 2582 + 2583 + *val = (*val & reg->mask) >> __ffs(reg->mask); 2584 + 2585 + return 0; 2586 + } 2587 + 2588 + static int airoha_pinctrl_set_conf(struct airoha_pinctrl *pinctrl, 2589 + const struct airoha_pinctrl_conf *conf, 2590 + int conf_size, int pin, u32 val) 2591 + { 2592 + const struct airoha_pinctrl_reg *reg = NULL; 2593 + 2594 + reg = airoha_pinctrl_get_conf_reg(conf, conf_size, pin); 2595 + if (!reg) 2596 + return -EINVAL; 2597 + 2598 + 2599 + if (regmap_update_bits(pinctrl->chip_scu, reg->offset, reg->mask, 2600 + val << __ffs(reg->mask))) 2601 + return -EINVAL; 2602 + 2603 + return 0; 2604 + } 2605 + 2606 + #define airoha_pinctrl_get_pullup_conf(pinctrl, pin, val) \ 2607 + airoha_pinctrl_get_conf((pinctrl), airoha_pinctrl_pullup_conf, \ 2608 + ARRAY_SIZE(airoha_pinctrl_pullup_conf), \ 2609 + (pin), (val)) 2610 + #define airoha_pinctrl_get_pulldown_conf(pinctrl, pin, val) \ 2611 + airoha_pinctrl_get_conf((pinctrl), airoha_pinctrl_pulldown_conf, \ 2612 + ARRAY_SIZE(airoha_pinctrl_pulldown_conf), \ 2613 + (pin), (val)) 2614 + #define airoha_pinctrl_get_drive_e2_conf(pinctrl, pin, val) \ 2615 + airoha_pinctrl_get_conf((pinctrl), airoha_pinctrl_drive_e2_conf, \ 2616 + ARRAY_SIZE(airoha_pinctrl_drive_e2_conf), \ 2617 + (pin), (val)) 2618 + #define airoha_pinctrl_get_drive_e4_conf(pinctrl, pin, val) \ 2619 + airoha_pinctrl_get_conf((pinctrl), airoha_pinctrl_drive_e4_conf, \ 2620 + ARRAY_SIZE(airoha_pinctrl_drive_e4_conf), \ 2621 + (pin), (val)) 2622 + #define airoha_pinctrl_get_pcie_rst_od_conf(pinctrl, pin, val) \ 2623 + airoha_pinctrl_get_conf((pinctrl), airoha_pinctrl_pcie_rst_od_conf, \ 2624 + ARRAY_SIZE(airoha_pinctrl_pcie_rst_od_conf), \ 2625 + (pin), (val)) 2626 + #define airoha_pinctrl_set_pullup_conf(pinctrl, pin, val) \ 2627 + airoha_pinctrl_set_conf((pinctrl), airoha_pinctrl_pullup_conf, \ 2628 + ARRAY_SIZE(airoha_pinctrl_pullup_conf), \ 2629 + (pin), (val)) 2630 + #define airoha_pinctrl_set_pulldown_conf(pinctrl, pin, val) \ 2631 + airoha_pinctrl_set_conf((pinctrl), airoha_pinctrl_pulldown_conf, \ 2632 + ARRAY_SIZE(airoha_pinctrl_pulldown_conf), \ 2633 + (pin), (val)) 2634 + #define airoha_pinctrl_set_drive_e2_conf(pinctrl, pin, val) \ 2635 + airoha_pinctrl_set_conf((pinctrl), airoha_pinctrl_drive_e2_conf, \ 2636 + ARRAY_SIZE(airoha_pinctrl_drive_e2_conf), \ 2637 + (pin), (val)) 2638 + #define airoha_pinctrl_set_drive_e4_conf(pinctrl, pin, val) \ 2639 + airoha_pinctrl_set_conf((pinctrl), airoha_pinctrl_drive_e4_conf, \ 2640 + ARRAY_SIZE(airoha_pinctrl_drive_e4_conf), \ 2641 + (pin), (val)) 2642 + #define airoha_pinctrl_set_pcie_rst_od_conf(pinctrl, pin, val) \ 2643 + airoha_pinctrl_set_conf((pinctrl), airoha_pinctrl_pcie_rst_od_conf, \ 2644 + ARRAY_SIZE(airoha_pinctrl_pcie_rst_od_conf), \ 2645 + (pin), (val)) 2646 + 2647 + static int airoha_pinconf_get_direction(struct pinctrl_dev *pctrl_dev, u32 p) 2648 + { 2649 + struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 2650 + u32 val, mask; 2651 + int err, pin; 2652 + u8 index; 2653 + 2654 + pin = airoha_convert_pin_to_reg_offset(pctrl_dev, NULL, p); 2655 + if (pin < 0) 2656 + return pin; 2657 + 2658 + index = pin / AIROHA_REG_GPIOCTRL_NUM_PIN; 2659 + err = regmap_read(pinctrl->regmap, pinctrl->gpiochip.dir[index], &val); 2660 + if (err) 2661 + return err; 2662 + 2663 + mask = BIT(2 * (pin % AIROHA_REG_GPIOCTRL_NUM_PIN)); 2664 + return val & mask ? PIN_CONFIG_OUTPUT_ENABLE : PIN_CONFIG_INPUT_ENABLE; 2665 + } 2666 + 2667 + static int airoha_pinconf_get(struct pinctrl_dev *pctrl_dev, 2668 + unsigned int pin, unsigned long *config) 2669 + { 2670 + struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 2671 + enum pin_config_param param = pinconf_to_config_param(*config); 2672 + u32 arg; 2673 + 2674 + switch (param) { 2675 + case PIN_CONFIG_BIAS_PULL_DOWN: 2676 + case PIN_CONFIG_BIAS_DISABLE: 2677 + case PIN_CONFIG_BIAS_PULL_UP: { 2678 + u32 pull_up, pull_down; 2679 + 2680 + if (airoha_pinctrl_get_pullup_conf(pinctrl, pin, &pull_up) || 2681 + airoha_pinctrl_get_pulldown_conf(pinctrl, pin, &pull_down)) 2682 + return -EINVAL; 2683 + 2684 + if (param == PIN_CONFIG_BIAS_PULL_UP && 2685 + !(pull_up && !pull_down)) 2686 + return -EINVAL; 2687 + else if (param == PIN_CONFIG_BIAS_PULL_DOWN && 2688 + !(pull_down && !pull_up)) 2689 + return -EINVAL; 2690 + else if (pull_up || pull_down) 2691 + return -EINVAL; 2692 + 2693 + arg = 1; 2694 + break; 2695 + } 2696 + case PIN_CONFIG_DRIVE_STRENGTH: { 2697 + u32 e2, e4; 2698 + 2699 + if (airoha_pinctrl_get_drive_e2_conf(pinctrl, pin, &e2) || 2700 + airoha_pinctrl_get_drive_e4_conf(pinctrl, pin, &e4)) 2701 + return -EINVAL; 2702 + 2703 + arg = e4 << 1 | e2; 2704 + break; 2705 + } 2706 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 2707 + if (airoha_pinctrl_get_pcie_rst_od_conf(pinctrl, pin, &arg)) 2708 + return -EINVAL; 2709 + break; 2710 + case PIN_CONFIG_OUTPUT_ENABLE: 2711 + case PIN_CONFIG_INPUT_ENABLE: 2712 + arg = airoha_pinconf_get_direction(pctrl_dev, pin); 2713 + if (arg != param) 2714 + return -EINVAL; 2715 + 2716 + arg = 1; 2717 + break; 2718 + default: 2719 + return -EOPNOTSUPP; 2720 + } 2721 + 2722 + *config = pinconf_to_config_packed(param, arg); 2723 + 2724 + return 0; 2725 + } 2726 + 2727 + static int airoha_pinconf_set_pin_value(struct pinctrl_dev *pctrl_dev, 2728 + unsigned int p, bool value) 2729 + { 2730 + struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 2731 + int pin; 2732 + 2733 + pin = airoha_convert_pin_to_reg_offset(pctrl_dev, NULL, p); 2734 + if (pin < 0) 2735 + return pin; 2736 + 2737 + airoha_gpio_set(&pinctrl->gpiochip.chip, pin, value); 2738 + 2739 + return 0; 2740 + } 2741 + 2742 + static int airoha_pinconf_set(struct pinctrl_dev *pctrl_dev, 2743 + unsigned int pin, unsigned long *configs, 2744 + unsigned int num_configs) 2745 + { 2746 + struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 2747 + int i; 2748 + 2749 + for (i = 0; i < num_configs; i++) { 2750 + u32 param = pinconf_to_config_param(configs[i]); 2751 + u32 arg = pinconf_to_config_argument(configs[i]); 2752 + 2753 + switch (param) { 2754 + case PIN_CONFIG_BIAS_DISABLE: 2755 + airoha_pinctrl_set_pulldown_conf(pinctrl, pin, 0); 2756 + airoha_pinctrl_set_pullup_conf(pinctrl, pin, 0); 2757 + break; 2758 + case PIN_CONFIG_BIAS_PULL_UP: 2759 + airoha_pinctrl_set_pulldown_conf(pinctrl, pin, 0); 2760 + airoha_pinctrl_set_pullup_conf(pinctrl, pin, 1); 2761 + break; 2762 + case PIN_CONFIG_BIAS_PULL_DOWN: 2763 + airoha_pinctrl_set_pulldown_conf(pinctrl, pin, 1); 2764 + airoha_pinctrl_set_pullup_conf(pinctrl, pin, 0); 2765 + break; 2766 + case PIN_CONFIG_DRIVE_STRENGTH: { 2767 + u32 e2 = 0, e4 = 0; 2768 + 2769 + switch (arg) { 2770 + case MTK_DRIVE_2mA: 2771 + break; 2772 + case MTK_DRIVE_4mA: 2773 + e2 = 1; 2774 + break; 2775 + case MTK_DRIVE_6mA: 2776 + e4 = 1; 2777 + break; 2778 + case MTK_DRIVE_8mA: 2779 + e2 = 1; 2780 + e4 = 1; 2781 + break; 2782 + default: 2783 + return -EINVAL; 2784 + } 2785 + 2786 + airoha_pinctrl_set_drive_e2_conf(pinctrl, pin, e2); 2787 + airoha_pinctrl_set_drive_e4_conf(pinctrl, pin, e4); 2788 + break; 2789 + } 2790 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 2791 + airoha_pinctrl_set_pcie_rst_od_conf(pinctrl, pin, !!arg); 2792 + break; 2793 + case PIN_CONFIG_OUTPUT_ENABLE: 2794 + case PIN_CONFIG_INPUT_ENABLE: 2795 + case PIN_CONFIG_OUTPUT: { 2796 + bool input = param == PIN_CONFIG_INPUT_ENABLE; 2797 + int err; 2798 + 2799 + err = airoha_pinmux_set_direction(pctrl_dev, NULL, pin, 2800 + input); 2801 + if (err) 2802 + return err; 2803 + 2804 + if (param == PIN_CONFIG_OUTPUT) { 2805 + err = airoha_pinconf_set_pin_value(pctrl_dev, 2806 + pin, !!arg); 2807 + if (err) 2808 + return err; 2809 + } 2810 + break; 2811 + } 2812 + default: 2813 + return -EOPNOTSUPP; 2814 + } 2815 + } 2816 + 2817 + return 0; 2818 + } 2819 + 2820 + static int airoha_pinconf_group_get(struct pinctrl_dev *pctrl_dev, 2821 + unsigned int group, unsigned long *config) 2822 + { 2823 + u32 cur_config = 0; 2824 + int i; 2825 + 2826 + for (i = 0; i < airoha_pinctrl_groups[group].npins; i++) { 2827 + if (airoha_pinconf_get(pctrl_dev, 2828 + airoha_pinctrl_groups[group].pins[i], 2829 + config)) 2830 + return -EOPNOTSUPP; 2831 + 2832 + if (i && cur_config != *config) 2833 + return -EOPNOTSUPP; 2834 + 2835 + cur_config = *config; 2836 + } 2837 + 2838 + return 0; 2839 + } 2840 + 2841 + static int airoha_pinconf_group_set(struct pinctrl_dev *pctrl_dev, 2842 + unsigned int group, unsigned long *configs, 2843 + unsigned int num_configs) 2844 + { 2845 + int i; 2846 + 2847 + for (i = 0; i < airoha_pinctrl_groups[group].npins; i++) { 2848 + int err; 2849 + 2850 + err = airoha_pinconf_set(pctrl_dev, 2851 + airoha_pinctrl_groups[group].pins[i], 2852 + configs, num_configs); 2853 + if (err) 2854 + return err; 2855 + } 2856 + 2857 + return 0; 2858 + } 2859 + 2860 + static const struct pinconf_ops airoha_confops = { 2861 + .is_generic = true, 2862 + .pin_config_get = airoha_pinconf_get, 2863 + .pin_config_set = airoha_pinconf_set, 2864 + .pin_config_group_get = airoha_pinconf_group_get, 2865 + .pin_config_group_set = airoha_pinconf_group_set, 2866 + .pin_config_config_dbg_show = pinconf_generic_dump_config, 2867 + }; 2868 + 2869 + static const struct pinctrl_ops airoha_pctlops = { 2870 + .get_groups_count = pinctrl_generic_get_group_count, 2871 + .get_group_name = pinctrl_generic_get_group_name, 2872 + .get_group_pins = pinctrl_generic_get_group_pins, 2873 + .dt_node_to_map = pinconf_generic_dt_node_to_map_all, 2874 + .dt_free_map = pinconf_generic_dt_free_map, 2875 + }; 2876 + 2877 + static struct pinctrl_desc airoha_pinctrl_desc = { 2878 + .name = KBUILD_MODNAME, 2879 + .owner = THIS_MODULE, 2880 + .pctlops = &airoha_pctlops, 2881 + .pmxops = &airoha_pmxops, 2882 + .confops = &airoha_confops, 2883 + .pins = airoha_pinctrl_pins, 2884 + .npins = ARRAY_SIZE(airoha_pinctrl_pins), 2885 + }; 2886 + 2887 + static int airoha_pinctrl_probe(struct platform_device *pdev) 2888 + { 2889 + struct device *dev = &pdev->dev; 2890 + struct airoha_pinctrl *pinctrl; 2891 + struct regmap *map; 2892 + int err, i; 2893 + 2894 + pinctrl = devm_kzalloc(dev, sizeof(*pinctrl), GFP_KERNEL); 2895 + if (!pinctrl) 2896 + return -ENOMEM; 2897 + 2898 + pinctrl->regmap = device_node_to_regmap(dev->parent->of_node); 2899 + if (IS_ERR(pinctrl->regmap)) 2900 + return PTR_ERR(pinctrl->regmap); 2901 + 2902 + map = syscon_regmap_lookup_by_compatible("airoha,en7581-chip-scu"); 2903 + if (IS_ERR(map)) 2904 + return PTR_ERR(map); 2905 + 2906 + pinctrl->chip_scu = map; 2907 + 2908 + err = devm_pinctrl_register_and_init(dev, &airoha_pinctrl_desc, 2909 + pinctrl, &pinctrl->ctrl); 2910 + if (err) 2911 + return err; 2912 + 2913 + /* build pin groups */ 2914 + for (i = 0; i < ARRAY_SIZE(airoha_pinctrl_groups); i++) { 2915 + const struct pingroup *grp = &airoha_pinctrl_groups[i]; 2916 + 2917 + err = pinctrl_generic_add_group(pinctrl->ctrl, grp->name, 2918 + grp->pins, grp->npins, 2919 + (void *)grp); 2920 + if (err < 0) { 2921 + dev_err(&pdev->dev, "Failed to register group %s\n", 2922 + grp->name); 2923 + return err; 2924 + } 2925 + } 2926 + 2927 + /* build functions */ 2928 + for (i = 0; i < ARRAY_SIZE(airoha_pinctrl_funcs); i++) { 2929 + const struct airoha_pinctrl_func *func; 2930 + 2931 + func = &airoha_pinctrl_funcs[i]; 2932 + err = pinmux_generic_add_function(pinctrl->ctrl, 2933 + func->desc.func.name, 2934 + func->desc.func.groups, 2935 + func->desc.func.ngroups, 2936 + (void *)func); 2937 + if (err < 0) { 2938 + dev_err(dev, "Failed to register function %s\n", 2939 + func->desc.func.name); 2940 + return err; 2941 + } 2942 + } 2943 + 2944 + err = pinctrl_enable(pinctrl->ctrl); 2945 + if (err) 2946 + return err; 2947 + 2948 + /* build gpio-chip */ 2949 + return airoha_pinctrl_add_gpiochip(pinctrl, pdev); 2950 + } 2951 + 2952 + static const struct of_device_id airoha_pinctrl_of_match[] = { 2953 + { .compatible = "airoha,en7581-pinctrl" }, 2954 + { /* sentinel */ } 2955 + }; 2956 + MODULE_DEVICE_TABLE(of, airoha_pinctrl_of_match); 2957 + 2958 + static struct platform_driver airoha_pinctrl_driver = { 2959 + .probe = airoha_pinctrl_probe, 2960 + .driver = { 2961 + .name = "pinctrl-airoha", 2962 + .of_match_table = airoha_pinctrl_of_match, 2963 + }, 2964 + }; 2965 + module_platform_driver(airoha_pinctrl_driver); 2966 + 2967 + MODULE_LICENSE("GPL"); 2968 + MODULE_AUTHOR("Lorenzo Bianconi <lorenzo@kernel.org>"); 2969 + MODULE_AUTHOR("Benjamin Larsson <benjamin.larsson@genexis.eu>"); 2970 + MODULE_AUTHOR("Markus Gothe <markus.gothe@genexis.eu>"); 2971 + MODULE_DESCRIPTION("Pinctrl driver for Airoha SoC");
+1 -1
drivers/pinctrl/nomadik/pinctrl-abx500.c
··· 1089 1089 .of_match_table = abx500_gpio_match, 1090 1090 }, 1091 1091 .probe = abx500_gpio_probe, 1092 - .remove_new = abx500_gpio_remove, 1092 + .remove = abx500_gpio_remove, 1093 1093 }; 1094 1094 1095 1095 static int __init abx500_gpio_init(void)
+52
drivers/pinctrl/nxp/pinctrl-s32g2.c
··· 216 216 S32G_IMCR_CAN1_RXD = 631, 217 217 S32G_IMCR_CAN2_RXD = 632, 218 218 S32G_IMCR_CAN3_RXD = 633, 219 + 220 + /* JTAG IMCRs */ 221 + S32G_IMCR_JTAG_TMS = 562, 222 + S32G_IMCR_JTAG_TCK = 572, 223 + S32G_IMCR_JTAG_TDI = 573, 224 + 219 225 /* GMAC0 */ 220 226 S32G_IMCR_Ethernet_MDIO = 527, 221 227 S32G_IMCR_Ethernet_CRS = 526, ··· 235 229 S32G_IMCR_Ethernet_RX_DV = 530, 236 230 S32G_IMCR_Ethernet_TX_CLK = 538, 237 231 S32G_IMCR_Ethernet_REF_CLK = 535, 232 + 238 233 /* PFE EMAC 0 MII */ 234 + S32G_IMCR_PFE_EMAC_0_MDIO = 837, 235 + S32G_IMCR_PFE_EMAC_0_CRS = 836, 236 + S32G_IMCR_PFE_EMAC_0_COL = 835, 237 + S32G_IMCR_PFE_EMAC_0_RX_D0 = 841, 238 + S32G_IMCR_PFE_EMAC_0_RX_D1 = 842, 239 + S32G_IMCR_PFE_EMAC_0_RX_D2 = 843, 240 + S32G_IMCR_PFE_EMAC_0_RX_D3 = 844, 241 + S32G_IMCR_PFE_EMAC_0_RX_ER = 840, 242 + S32G_IMCR_PFE_EMAC_0_RX_CLK = 839, 243 + S32G_IMCR_PFE_EMAC_0_RX_DV = 845, 244 + S32G_IMCR_PFE_EMAC_0_TX_CLK = 846, 245 + S32G_IMCR_PFE_EMAC_0_REF_CLK = 838, 246 + 239 247 /* PFE EMAC 1 MII */ 240 248 S32G_IMCR_PFE_EMAC_1_MDIO = 857, 241 249 S32G_IMCR_PFE_EMAC_1_CRS = 856, ··· 337 317 S32G_IMCR_LLCE_CAN13_RXD = 758, 338 318 S32G_IMCR_LLCE_CAN14_RXD = 759, 339 319 S32G_IMCR_LLCE_CAN15_RXD = 760, 320 + S32G_IMCR_LLCE_UART0_RXD = 790, 321 + S32G_IMCR_LLCE_UART1_RXD = 791, 322 + S32G_IMCR_LLCE_UART2_RXD = 792, 323 + S32G_IMCR_LLCE_UART3_RXD = 793, 324 + S32G_IMCR_LLCE_LPSPI2_PCS0 = 811, 325 + S32G_IMCR_LLCE_LPSPI2_SCK = 816, 326 + S32G_IMCR_LLCE_LPSPI2_SIN = 817, 340 327 S32G_IMCR_USB_CLK = 895, 341 328 S32G_IMCR_USB_DATA0 = 896, 342 329 S32G_IMCR_USB_DATA1 = 897, ··· 530 503 S32_PINCTRL_PIN(S32G_IMCR_USDHC_DAT7), 531 504 S32_PINCTRL_PIN(S32G_IMCR_USDHC_DQS), 532 505 S32_PINCTRL_PIN(S32G_IMCR_CAN0_RXD), 506 + 507 + /* JTAG IMCRs */ 508 + S32_PINCTRL_PIN(S32G_IMCR_JTAG_TMS), 509 + S32_PINCTRL_PIN(S32G_IMCR_JTAG_TCK), 510 + S32_PINCTRL_PIN(S32G_IMCR_JTAG_TDI), 511 + 533 512 /* GMAC0 */ 534 513 S32_PINCTRL_PIN(S32G_IMCR_Ethernet_MDIO), 535 514 S32_PINCTRL_PIN(S32G_IMCR_Ethernet_CRS), ··· 671 638 S32_PINCTRL_PIN(S32G_IMCR_LLCE_CAN13_RXD), 672 639 S32_PINCTRL_PIN(S32G_IMCR_LLCE_CAN14_RXD), 673 640 S32_PINCTRL_PIN(S32G_IMCR_LLCE_CAN15_RXD), 641 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART0_RXD), 642 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART1_RXD), 643 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART2_RXD), 644 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART3_RXD), 645 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_LPSPI2_PCS0), 646 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_LPSPI2_SCK), 647 + S32_PINCTRL_PIN(S32G_IMCR_LLCE_LPSPI2_SIN), 674 648 S32_PINCTRL_PIN(S32G_IMCR_CAN1_RXD), 675 649 S32_PINCTRL_PIN(S32G_IMCR_CAN2_RXD), 676 650 S32_PINCTRL_PIN(S32G_IMCR_CAN3_RXD), ··· 692 652 S32_PINCTRL_PIN(S32G_IMCR_USB_DATA7), 693 653 S32_PINCTRL_PIN(S32G_IMCR_USB_DIR), 694 654 S32_PINCTRL_PIN(S32G_IMCR_USB_NXT), 655 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_MDIO), 656 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_CRS), 657 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_COL), 658 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D0), 659 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D1), 660 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D2), 661 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D3), 662 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_ER), 663 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_CLK), 664 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_DV), 665 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_TX_CLK), 666 + S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_REF_CLK), 695 667 S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_1_MDIO), 696 668 S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_1_CRS), 697 669 S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_1_COL),
+2 -2
drivers/pinctrl/pinctrl-amd.c
··· 506 506 case IRQ_TYPE_EDGE_BOTH: 507 507 pin_reg &= ~BIT(LEVEL_TRIG_OFF); 508 508 pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF); 509 - pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF; 509 + pin_reg |= BOTH_EDGES << ACTIVE_LEVEL_OFF; 510 510 irq_set_handler_locked(d, handle_edge_irq); 511 511 break; 512 512 ··· 1204 1204 #endif 1205 1205 }, 1206 1206 .probe = amd_gpio_probe, 1207 - .remove_new = amd_gpio_remove, 1207 + .remove = amd_gpio_remove, 1208 1208 }; 1209 1209 1210 1210 module_platform_driver(amd_gpio_driver);
+2 -2
drivers/pinctrl/pinctrl-amd.h
··· 60 60 #define DB_TYPE_PRESERVE_HIGH_GLITCH 0x2UL 61 61 #define DB_TYPE_REMOVE_GLITCH 0x3UL 62 62 63 - #define EDGE_TRAGGER 0x0UL 63 + #define EDGE_TRIGGER 0x0UL 64 64 #define LEVEL_TRIGGER 0x1UL 65 65 66 66 #define ACTIVE_HIGH 0x0UL 67 67 #define ACTIVE_LOW 0x1UL 68 - #define BOTH_EADGE 0x2UL 68 + #define BOTH_EDGES 0x2UL 69 69 70 70 #define ENABLE_INTERRUPT 0x1UL 71 71 #define DISABLE_INTERRUPT 0x0UL
+1 -1
drivers/pinctrl/pinctrl-artpec6.c
··· 988 988 .of_match_table = artpec6_pinctrl_match, 989 989 }, 990 990 .probe = artpec6_pmx_probe, 991 - .remove_new = artpec6_pmx_remove, 991 + .remove = artpec6_pmx_remove, 992 992 }; 993 993 994 994 static int __init artpec6_pmx_init(void)
+21 -42
drivers/pinctrl/pinctrl-aw9523.c
··· 80 80 struct regmap *regmap; 81 81 struct mutex i2c_lock; 82 82 struct gpio_desc *reset_gpio; 83 - struct regulator *vio_vreg; 83 + int vio_vreg; 84 84 struct pinctrl_dev *pctl; 85 85 struct gpio_chip gpio; 86 86 struct aw9523_irq *irq; ··· 550 550 551 551 /** 552 552 * _aw9523_gpio_get_multiple - Get I/O state for an entire port 553 - * @regmap: Regmap structure 554 - * @pin: gpiolib pin number 553 + * @awi: Controller data 555 554 * @regbit: hw pin index, used to retrieve port number 556 555 * @state: returned port I/O state 556 + * @mask: lines to read values for 557 557 * 558 558 * Return: Zero for success or negative number for error 559 559 */ ··· 972 972 if (IS_ERR(awi->regmap)) 973 973 return PTR_ERR(awi->regmap); 974 974 975 - awi->vio_vreg = devm_regulator_get_optional(dev, "vio"); 976 - if (IS_ERR(awi->vio_vreg)) { 977 - if (PTR_ERR(awi->vio_vreg) == -EPROBE_DEFER) 978 - return -EPROBE_DEFER; 979 - awi->vio_vreg = NULL; 980 - } else { 981 - ret = regulator_enable(awi->vio_vreg); 982 - if (ret) 983 - return ret; 984 - } 975 + awi->vio_vreg = devm_regulator_get_enable_optional(dev, "vio"); 976 + if (awi->vio_vreg && awi->vio_vreg != -ENODEV) 977 + return awi->vio_vreg; 985 978 986 - mutex_init(&awi->i2c_lock); 979 + ret = devm_mutex_init(dev, &awi->i2c_lock); 980 + if (ret) 981 + return ret; 982 + 987 983 lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter)); 988 984 989 985 pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL); 990 - if (!pdesc) { 991 - ret = -ENOMEM; 992 - goto err_disable_vregs; 993 - } 986 + if (!pdesc) 987 + return -ENOMEM; 994 988 995 989 ret = aw9523_hw_init(awi); 996 990 if (ret) 997 - goto err_disable_vregs; 991 + return ret; 998 992 999 993 pdesc->name = dev_name(dev); 1000 994 pdesc->owner = THIS_MODULE; ··· 1000 1006 1001 1007 ret = aw9523_init_gpiochip(awi, pdesc->npins); 1002 1008 if (ret) 1003 - goto err_disable_vregs; 1009 + return ret; 1004 1010 1005 1011 if (client->irq) { 1006 1012 ret = aw9523_init_irq(awi, client->irq); 1007 1013 if (ret) 1008 - goto err_disable_vregs; 1014 + return ret; 1009 1015 } 1010 1016 1011 1017 awi->pctl = devm_pinctrl_register(dev, pdesc, awi); 1012 - if (IS_ERR(awi->pctl)) { 1013 - ret = dev_err_probe(dev, PTR_ERR(awi->pctl), "Cannot register pinctrl"); 1014 - goto err_disable_vregs; 1015 - } 1018 + if (IS_ERR(awi->pctl)) 1019 + return dev_err_probe(dev, PTR_ERR(awi->pctl), 1020 + "Cannot register pinctrl"); 1016 1021 1017 - ret = devm_gpiochip_add_data(dev, &awi->gpio, awi); 1018 - if (ret) 1019 - goto err_disable_vregs; 1020 - 1021 - return ret; 1022 - 1023 - err_disable_vregs: 1024 - if (awi->vio_vreg) 1025 - regulator_disable(awi->vio_vreg); 1026 - mutex_destroy(&awi->i2c_lock); 1027 - return ret; 1022 + return devm_gpiochip_add_data(dev, &awi->gpio, awi); 1028 1023 } 1029 1024 1030 1025 static void aw9523_remove(struct i2c_client *client) ··· 1026 1043 * set the pins to hardware defaults before removing the driver 1027 1044 * to leave it in a clean, safe and predictable state. 1028 1045 */ 1029 - if (awi->vio_vreg) { 1030 - regulator_disable(awi->vio_vreg); 1031 - } else { 1046 + if (awi->vio_vreg == -ENODEV) { 1032 1047 mutex_lock(&awi->i2c_lock); 1033 1048 aw9523_hw_init(awi); 1034 1049 mutex_unlock(&awi->i2c_lock); 1035 1050 } 1036 - 1037 - mutex_destroy(&awi->i2c_lock); 1038 1051 } 1039 1052 1040 1053 static const struct i2c_device_id aw9523_i2c_id_table[] = { 1041 - { "aw9523_i2c", 0 }, 1054 + { "aw9523_i2c" }, 1042 1055 { } 1043 1056 }; 1044 1057 MODULE_DEVICE_TABLE(i2c, aw9523_i2c_id_table);
+45 -97
drivers/pinctrl/pinctrl-cy8c95x0.c
··· 141 141 * @nport: Number of Gports in this chip 142 142 * @gpio_chip: gpiolib chip 143 143 * @driver_data: private driver data 144 - * @regulator: Pointer to the regulator for the IC 145 144 * @dev: struct device 146 145 * @pctldev: pin controller device 147 146 * @pinctrl_desc: pin controller description ··· 159 160 DECLARE_BITMAP(irq_trig_high, MAX_LINE); 160 161 DECLARE_BITMAP(push_pull, MAX_LINE); 161 162 DECLARE_BITMAP(shiftmask, MAX_LINE); 162 - int nport; 163 + unsigned int nport; 163 164 struct gpio_chip gpio_chip; 164 165 unsigned long driver_data; 165 - struct regulator *regulator; 166 166 struct device *dev; 167 167 struct pinctrl_dev *pctldev; 168 168 struct pinctrl_desc pinctrl_desc; ··· 610 612 DECLARE_BITMAP(tmask, MAX_LINE); 611 613 DECLARE_BITMAP(tval, MAX_LINE); 612 614 int write_val; 613 - int ret = 0; 614 - int i; 615 615 u8 bits; 616 + int ret; 616 617 617 618 /* Add the 4 bit gap of Gport2 */ 618 619 bitmap_andnot(tmask, mask, chip->shiftmask, MAX_LINE); ··· 622 625 bitmap_shift_left(tval, tval, 4, MAX_LINE); 623 626 bitmap_replace(tval, tval, val, chip->shiftmask, BANK_SZ * 3); 624 627 625 - for (i = 0; i < chip->nport; i++) { 628 + for (unsigned int i = 0; i < chip->nport; i++) { 626 629 /* Skip over unused banks */ 627 630 bits = bitmap_get_value8(tmask, i * BANK_SZ); 628 631 if (!bits) ··· 631 634 write_val = bitmap_get_value8(tval, i * BANK_SZ); 632 635 633 636 ret = cy8c95x0_regmap_update_bits(chip, reg, i, bits, write_val); 634 - if (ret < 0) 635 - goto out; 637 + if (ret < 0) { 638 + dev_err(chip->dev, "failed writing register %d, port %u: err %d\n", reg, i, ret); 639 + return ret; 640 + } 636 641 } 637 - out: 638 642 639 - if (ret < 0) 640 - dev_err(chip->dev, "failed writing register %d, port %d: err %d\n", reg, i, ret); 641 - 642 - return ret; 643 + return 0; 643 644 } 644 645 645 646 static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg, ··· 647 652 DECLARE_BITMAP(tval, MAX_LINE); 648 653 DECLARE_BITMAP(tmp, MAX_LINE); 649 654 int read_val; 650 - int ret = 0; 651 - int i; 652 655 u8 bits; 656 + int ret; 653 657 654 658 /* Add the 4 bit gap of Gport2 */ 655 659 bitmap_andnot(tmask, mask, chip->shiftmask, MAX_LINE); ··· 659 665 bitmap_shift_left(tval, tval, 4, MAX_LINE); 660 666 bitmap_replace(tval, tval, val, chip->shiftmask, BANK_SZ * 3); 661 667 662 - for (i = 0; i < chip->nport; i++) { 668 + for (unsigned int i = 0; i < chip->nport; i++) { 663 669 /* Skip over unused banks */ 664 670 bits = bitmap_get_value8(tmask, i * BANK_SZ); 665 671 if (!bits) 666 672 continue; 667 673 668 674 ret = cy8c95x0_regmap_read(chip, reg, i, &read_val); 669 - if (ret < 0) 670 - goto out; 675 + if (ret < 0) { 676 + dev_err(chip->dev, "failed reading register %d, port %u: err %d\n", reg, i, ret); 677 + return ret; 678 + } 671 679 672 680 read_val &= bits; 673 681 read_val |= bitmap_get_value8(tval, i * BANK_SZ) & ~bits; ··· 680 684 bitmap_shift_right(tmp, tval, 4, MAX_LINE); 681 685 bitmap_replace(val, tmp, tval, chip->shiftmask, MAX_LINE); 682 686 683 - out: 684 - if (ret < 0) 685 - dev_err(chip->dev, "failed reading register %d, port %d: err %d\n", reg, i, ret); 686 - 687 - return ret; 687 + return 0; 688 688 } 689 689 690 690 static int cy8c95x0_gpio_direction_input(struct gpio_chip *gc, unsigned int off) ··· 746 754 747 755 ret = cy8c95x0_regmap_read(chip, CY8C95X0_DIRECTION, port, &reg_val); 748 756 if (ret < 0) 749 - goto out; 757 + return ret; 750 758 751 759 if (reg_val & bit) 752 760 return GPIO_LINE_DIRECTION_IN; 753 761 754 762 return GPIO_LINE_DIRECTION_OUT; 755 - out: 756 - return ret; 757 763 } 758 764 759 765 static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip, ··· 813 823 case PIN_CONFIG_SLEEP_HARDWARE_STATE: 814 824 case PIN_CONFIG_SLEW_RATE: 815 825 default: 816 - ret = -ENOTSUPP; 817 - goto out; 826 + return -ENOTSUPP; 818 827 } 819 828 /* 820 829 * Writing 1 to one of the drive mode registers will automatically ··· 821 832 */ 822 833 ret = cy8c95x0_regmap_read(chip, reg, port, &reg_val); 823 834 if (ret < 0) 824 - goto out; 835 + return ret; 825 836 826 837 if (reg_val & bit) 827 838 arg = 1; ··· 829 840 arg = !arg; 830 841 831 842 *config = pinconf_to_config_packed(param, (u16)arg); 832 - out: 833 - return ret; 843 + return 0; 834 844 } 835 845 836 846 static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip, ··· 841 853 unsigned long param = pinconf_to_config_param(config); 842 854 unsigned long arg = pinconf_to_config_argument(config); 843 855 unsigned int reg; 844 - int ret; 845 856 846 857 switch (param) { 847 858 case PIN_CONFIG_BIAS_PULL_UP: ··· 871 884 reg = CY8C95X0_PWMSEL; 872 885 break; 873 886 case PIN_CONFIG_OUTPUT_ENABLE: 874 - ret = cy8c95x0_pinmux_direction(chip, off, !arg); 875 - goto out; 887 + return cy8c95x0_pinmux_direction(chip, off, !arg); 876 888 case PIN_CONFIG_INPUT_ENABLE: 877 - ret = cy8c95x0_pinmux_direction(chip, off, arg); 878 - goto out; 889 + return cy8c95x0_pinmux_direction(chip, off, arg); 879 890 default: 880 - ret = -ENOTSUPP; 881 - goto out; 891 + return -ENOTSUPP; 882 892 } 883 893 /* 884 894 * Writing 1 to one of the drive mode registers will automatically 885 895 * clear conflicting set bits in the other drive mode registers. 886 896 */ 887 - ret = cy8c95x0_regmap_write_bits(chip, reg, port, bit, bit); 888 - out: 889 - return ret; 897 + return cy8c95x0_regmap_write_bits(chip, reg, port, bit, bit); 890 898 } 891 899 892 900 static int cy8c95x0_gpio_get_multiple(struct gpio_chip *gc, ··· 1406 1424 } 1407 1425 1408 1426 dev_info(&client->dev, "Found a %s chip at 0x%02x.\n", name, client->addr); 1409 - strscpy(info->type, name, I2C_NAME_SIZE); 1427 + strscpy(info->type, name); 1410 1428 1411 1429 return 0; 1412 1430 } 1413 1431 1414 1432 static int cy8c95x0_probe(struct i2c_client *client) 1415 1433 { 1434 + struct device *dev = &client->dev; 1416 1435 struct cy8c95x0_pinctrl *chip; 1417 1436 struct regmap_config regmap_conf; 1418 1437 struct regmap_range_cfg regmap_range_conf; 1419 - struct regulator *reg; 1420 1438 int ret; 1421 1439 1422 - chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 1440 + chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); 1423 1441 if (!chip) 1424 1442 return -ENOMEM; 1425 1443 1426 - chip->dev = &client->dev; 1444 + chip->dev = dev; 1427 1445 1428 1446 /* Set the device type */ 1429 1447 chip->driver_data = (uintptr_t)i2c_get_match_data(client); 1430 1448 if (!chip->driver_data) 1431 1449 return -ENODEV; 1432 - 1433 - i2c_set_clientdata(client, chip); 1434 1450 1435 1451 chip->tpin = chip->driver_data & CY8C95X0_GPIO_MASK; 1436 1452 chip->nport = DIV_ROUND_UP(CY8C95X0_PIN_TO_OFFSET(chip->tpin), BANK_SZ); ··· 1437 1457 1438 1458 switch (chip->tpin) { 1439 1459 case 20: 1440 - strscpy(chip->name, cy8c95x0_id[0].name, I2C_NAME_SIZE); 1460 + strscpy(chip->name, cy8c95x0_id[0].name); 1441 1461 regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 3 * MUXED_STRIDE; 1442 1462 break; 1443 1463 case 40: 1444 - strscpy(chip->name, cy8c95x0_id[1].name, I2C_NAME_SIZE); 1464 + strscpy(chip->name, cy8c95x0_id[1].name); 1445 1465 regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 6 * MUXED_STRIDE; 1446 1466 break; 1447 1467 case 60: 1448 - strscpy(chip->name, cy8c95x0_id[2].name, I2C_NAME_SIZE); 1468 + strscpy(chip->name, cy8c95x0_id[2].name); 1449 1469 regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 8 * MUXED_STRIDE; 1450 1470 break; 1451 1471 default: 1452 1472 return -ENODEV; 1453 1473 } 1454 1474 1455 - reg = devm_regulator_get(&client->dev, "vdd"); 1456 - if (IS_ERR(reg)) { 1457 - if (PTR_ERR(reg) == -EPROBE_DEFER) 1458 - return -EPROBE_DEFER; 1459 - } else { 1460 - ret = regulator_enable(reg); 1461 - if (ret) { 1462 - dev_err(&client->dev, "failed to enable regulator vdd: %d\n", ret); 1463 - return ret; 1464 - } 1465 - chip->regulator = reg; 1466 - } 1475 + ret = devm_regulator_get_enable(dev, "vdd"); 1476 + if (ret) 1477 + return dev_err_probe(dev, ret, "failed to enable regulator vdd\n"); 1467 1478 1468 1479 /* bring the chip out of reset if reset pin is provided */ 1469 - chip->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); 1470 - if (IS_ERR(chip->gpio_reset)) { 1471 - ret = dev_err_probe(chip->dev, PTR_ERR(chip->gpio_reset), 1472 - "Failed to get GPIO 'reset'\n"); 1473 - goto err_exit; 1474 - } else if (chip->gpio_reset) { 1475 - usleep_range(1000, 2000); 1480 + chip->gpio_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); 1481 + if (IS_ERR(chip->gpio_reset)) 1482 + return dev_err_probe(dev, PTR_ERR(chip->gpio_reset), "Failed to get GPIO 'reset'\n"); 1483 + gpiod_set_consumer_name(chip->gpio_reset, "CY8C95X0 RESET"); 1484 + if (chip->gpio_reset) { 1485 + fsleep(1000); 1476 1486 gpiod_set_value_cansleep(chip->gpio_reset, 0); 1477 - usleep_range(250000, 300000); 1478 - 1479 - gpiod_set_consumer_name(chip->gpio_reset, "CY8C95X0 RESET"); 1487 + fsleep(250000); 1480 1488 } 1481 1489 1482 1490 /* Regmap for direct and paged registers */ ··· 1474 1506 regmap_conf.num_reg_defaults_raw = regmap_range_conf.range_max; 1475 1507 1476 1508 chip->regmap = devm_regmap_init_i2c(client, &regmap_conf); 1477 - if (IS_ERR(chip->regmap)) { 1478 - ret = PTR_ERR(chip->regmap); 1479 - goto err_exit; 1480 - } 1509 + if (IS_ERR(chip->regmap)) 1510 + return PTR_ERR(chip->regmap); 1481 1511 1482 1512 bitmap_zero(chip->push_pull, MAX_LINE); 1483 1513 bitmap_zero(chip->shiftmask, MAX_LINE); ··· 1491 1525 if (client->irq) { 1492 1526 ret = cy8c95x0_irq_setup(chip, client->irq); 1493 1527 if (ret) 1494 - goto err_exit; 1528 + return ret; 1495 1529 } 1496 1530 1497 1531 ret = cy8c95x0_setup_pinctrl(chip); 1498 1532 if (ret) 1499 - goto err_exit; 1533 + return ret; 1500 1534 1501 - ret = cy8c95x0_setup_gpiochip(chip); 1502 - if (ret) 1503 - goto err_exit; 1504 - 1505 - return 0; 1506 - 1507 - err_exit: 1508 - if (!IS_ERR_OR_NULL(chip->regulator)) 1509 - regulator_disable(chip->regulator); 1510 - return ret; 1511 - } 1512 - 1513 - static void cy8c95x0_remove(struct i2c_client *client) 1514 - { 1515 - struct cy8c95x0_pinctrl *chip = i2c_get_clientdata(client); 1516 - 1517 - if (!IS_ERR_OR_NULL(chip->regulator)) 1518 - regulator_disable(chip->regulator); 1535 + return cy8c95x0_setup_gpiochip(chip); 1519 1536 } 1520 1537 1521 1538 static const struct acpi_device_id cy8c95x0_acpi_ids[] = { ··· 1514 1565 .acpi_match_table = cy8c95x0_acpi_ids, 1515 1566 }, 1516 1567 .probe = cy8c95x0_probe, 1517 - .remove = cy8c95x0_remove, 1518 1568 .id_table = cy8c95x0_id, 1519 1569 .detect = cy8c95x0_detect, 1520 1570 };
+8 -9
drivers/pinctrl/pinctrl-k210.c
··· 96 96 struct k210_fpioa __iomem *fpioa; 97 97 struct regmap *sysctl_map; 98 98 u32 power_offset; 99 - struct clk *clk; 100 - struct clk *pclk; 101 99 }; 102 100 103 101 #define K210_PIN_NAME(i) ("IO_" #i) ··· 181 183 [K210_PC_DEFAULT_INT13] = K210_PC_MODE_IN | K210_PC_PU, 182 184 }; 183 185 184 - #undef DEFAULT 186 + #undef K210_PC_DEFAULT 185 187 186 188 /* 187 189 * Pin functions configuration information. ··· 923 925 struct device *dev = &pdev->dev; 924 926 struct device_node *np = dev->of_node; 925 927 struct k210_fpioa_data *pdata; 928 + struct clk *clk, *pclk; 926 929 927 930 dev_info(dev, "K210 FPIOA pin controller\n"); 928 931 ··· 938 939 if (IS_ERR(pdata->fpioa)) 939 940 return PTR_ERR(pdata->fpioa); 940 941 941 - pdata->clk = devm_clk_get_enabled(dev, "ref"); 942 - if (IS_ERR(pdata->clk)) 943 - return PTR_ERR(pdata->clk); 942 + clk = devm_clk_get_enabled(dev, "ref"); 943 + if (IS_ERR(clk)) 944 + return PTR_ERR(clk); 944 945 945 - pdata->pclk = devm_clk_get_optional_enabled(dev, "pclk"); 946 - if (IS_ERR(pdata->pclk)) 947 - return PTR_ERR(pdata->pclk); 946 + pclk = devm_clk_get_optional_enabled(dev, "pclk"); 947 + if (IS_ERR(pclk)) 948 + return PTR_ERR(pclk); 948 949 949 950 pdata->sysctl_map = 950 951 syscon_regmap_lookup_by_phandle_args(np,
+641
drivers/pinctrl/pinctrl-k230.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + /* 3 + * Copyright (C) 2024 Canaan Bright Sight Co. Ltd 4 + * Copyright (C) 2024 Ze Huang <18771902331@163.com> 5 + */ 6 + #include <linux/module.h> 7 + #include <linux/device.h> 8 + #include <linux/of.h> 9 + #include <linux/of_address.h> 10 + #include <linux/of_device.h> 11 + #include <linux/platform_device.h> 12 + #include <linux/pinctrl/pinctrl.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/pinctrl/pinconf.h> 15 + #include <linux/pinctrl/pinconf-generic.h> 16 + #include <linux/regmap.h> 17 + #include <linux/seq_file.h> 18 + 19 + #include "core.h" 20 + #include "pinconf.h" 21 + 22 + #define K230_NPINS 64 23 + 24 + #define K230_SHIFT_ST (0) 25 + #define K230_SHIFT_DS (1) 26 + #define K230_SHIFT_BIAS (5) 27 + #define K230_SHIFT_PD (5) 28 + #define K230_SHIFT_PU (6) 29 + #define K230_SHIFT_OE (7) 30 + #define K230_SHIFT_IE (8) 31 + #define K230_SHIFT_MSC (9) 32 + #define K230_SHIFT_SL (10) 33 + #define K230_SHIFT_SEL (11) 34 + 35 + #define K230_PC_ST BIT(0) 36 + #define K230_PC_DS GENMASK(4, 1) 37 + #define K230_PC_PD BIT(5) 38 + #define K230_PC_PU BIT(6) 39 + #define K230_PC_BIAS GENMASK(6, 5) 40 + #define K230_PC_OE BIT(7) 41 + #define K230_PC_IE BIT(8) 42 + #define K230_PC_MSC BIT(9) 43 + #define K230_PC_SL BIT(10) 44 + #define K230_PC_SEL GENMASK(13, 11) 45 + 46 + struct k230_pin_conf { 47 + unsigned int func; 48 + unsigned long *configs; 49 + unsigned int nconfigs; 50 + }; 51 + 52 + struct k230_pin_group { 53 + const char *name; 54 + unsigned int *pins; 55 + unsigned int num_pins; 56 + 57 + struct k230_pin_conf *data; 58 + }; 59 + 60 + struct k230_pmx_func { 61 + const char *name; 62 + const char **groups; 63 + unsigned int *group_idx; 64 + unsigned int ngroups; 65 + }; 66 + 67 + struct k230_pinctrl { 68 + struct pinctrl_desc pctl; 69 + struct pinctrl_dev *pctl_dev; 70 + struct regmap *regmap_base; 71 + void __iomem *base; 72 + struct k230_pin_group *groups; 73 + unsigned int ngroups; 74 + struct k230_pmx_func *functions; 75 + unsigned int nfunctions; 76 + }; 77 + 78 + static const struct regmap_config k230_regmap_config = { 79 + .name = "canaan,pinctrl", 80 + .reg_bits = 32, 81 + .val_bits = 32, 82 + .max_register = 0x100, 83 + .reg_stride = 4, 84 + }; 85 + 86 + static int k230_get_groups_count(struct pinctrl_dev *pctldev) 87 + { 88 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 89 + 90 + return info->ngroups; 91 + } 92 + 93 + static const char *k230_get_group_name(struct pinctrl_dev *pctldev, 94 + unsigned int selector) 95 + { 96 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 97 + 98 + return info->groups[selector].name; 99 + } 100 + 101 + static int k230_get_group_pins(struct pinctrl_dev *pctldev, 102 + unsigned int selector, 103 + const unsigned int **pins, 104 + unsigned int *num_pins) 105 + { 106 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 107 + 108 + if (selector >= info->ngroups) 109 + return -EINVAL; 110 + 111 + *pins = info->groups[selector].pins; 112 + *num_pins = info->groups[selector].num_pins; 113 + 114 + return 0; 115 + } 116 + 117 + static inline const struct k230_pmx_func *k230_name_to_funtion( 118 + const struct k230_pinctrl *info, const char *name) 119 + { 120 + unsigned int i; 121 + 122 + for (i = 0; i < info->nfunctions; i++) { 123 + if (!strcmp(info->functions[i].name, name)) 124 + return &info->functions[i]; 125 + } 126 + 127 + return NULL; 128 + } 129 + 130 + static struct pinctrl_pin_desc k230_pins[] = { 131 + PINCTRL_PIN(0, "IO0"), PINCTRL_PIN(1, "IO1"), PINCTRL_PIN(2, "IO2"), 132 + PINCTRL_PIN(3, "IO3"), PINCTRL_PIN(4, "IO4"), PINCTRL_PIN(5, "IO5"), 133 + PINCTRL_PIN(6, "IO6"), PINCTRL_PIN(7, "IO7"), PINCTRL_PIN(8, "IO8"), 134 + PINCTRL_PIN(9, "IO9"), PINCTRL_PIN(10, "IO10"), PINCTRL_PIN(11, "IO11"), 135 + PINCTRL_PIN(12, "IO12"), PINCTRL_PIN(13, "IO13"), PINCTRL_PIN(14, "IO14"), 136 + PINCTRL_PIN(15, "IO15"), PINCTRL_PIN(16, "IO16"), PINCTRL_PIN(17, "IO17"), 137 + PINCTRL_PIN(18, "IO18"), PINCTRL_PIN(19, "IO19"), PINCTRL_PIN(20, "IO20"), 138 + PINCTRL_PIN(21, "IO21"), PINCTRL_PIN(22, "IO22"), PINCTRL_PIN(23, "IO23"), 139 + PINCTRL_PIN(24, "IO24"), PINCTRL_PIN(25, "IO25"), PINCTRL_PIN(26, "IO26"), 140 + PINCTRL_PIN(27, "IO27"), PINCTRL_PIN(28, "IO28"), PINCTRL_PIN(29, "IO29"), 141 + PINCTRL_PIN(30, "IO30"), PINCTRL_PIN(31, "IO31"), PINCTRL_PIN(32, "IO32"), 142 + PINCTRL_PIN(33, "IO33"), PINCTRL_PIN(34, "IO34"), PINCTRL_PIN(35, "IO35"), 143 + PINCTRL_PIN(36, "IO36"), PINCTRL_PIN(37, "IO37"), PINCTRL_PIN(38, "IO38"), 144 + PINCTRL_PIN(39, "IO39"), PINCTRL_PIN(40, "IO40"), PINCTRL_PIN(41, "IO41"), 145 + PINCTRL_PIN(42, "IO42"), PINCTRL_PIN(43, "IO43"), PINCTRL_PIN(44, "IO44"), 146 + PINCTRL_PIN(45, "IO45"), PINCTRL_PIN(46, "IO46"), PINCTRL_PIN(47, "IO47"), 147 + PINCTRL_PIN(48, "IO48"), PINCTRL_PIN(49, "IO49"), PINCTRL_PIN(50, "IO50"), 148 + PINCTRL_PIN(51, "IO51"), PINCTRL_PIN(52, "IO52"), PINCTRL_PIN(53, "IO53"), 149 + PINCTRL_PIN(54, "IO54"), PINCTRL_PIN(55, "IO55"), PINCTRL_PIN(56, "IO56"), 150 + PINCTRL_PIN(57, "IO57"), PINCTRL_PIN(58, "IO58"), PINCTRL_PIN(59, "IO59"), 151 + PINCTRL_PIN(60, "IO60"), PINCTRL_PIN(61, "IO61"), PINCTRL_PIN(62, "IO62"), 152 + PINCTRL_PIN(63, "IO63") 153 + }; 154 + 155 + static void k230_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev, 156 + struct seq_file *s, unsigned int offset) 157 + { 158 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 159 + u32 val, bias, drive, input, slew, schmitt, power; 160 + struct k230_pin_group *grp = k230_pins[offset].drv_data; 161 + static const char * const biasing[] = { 162 + "pull none", "pull down", "pull up", "" }; 163 + static const char * const enable[] = { 164 + "disable", "enable" }; 165 + static const char * const power_source[] = { 166 + "3V3", "1V8" }; 167 + 168 + regmap_read(info->regmap_base, offset * 4, &val); 169 + 170 + drive = (val & K230_PC_DS) >> K230_SHIFT_DS; 171 + bias = (val & K230_PC_BIAS) >> K230_SHIFT_BIAS; 172 + input = (val & K230_PC_IE) >> K230_SHIFT_IE; 173 + slew = (val & K230_PC_SL) >> K230_SHIFT_SL; 174 + schmitt = (val & K230_PC_ST) >> K230_SHIFT_ST; 175 + power = (val & K230_PC_MSC) >> K230_SHIFT_MSC; 176 + 177 + seq_printf(s, "%s - strength %d - %s - %s - slewrate %s - schmitt %s - %s", 178 + grp ? grp->name : "unknown", 179 + drive, 180 + biasing[bias], 181 + input ? "input" : "output", 182 + enable[slew], 183 + enable[schmitt], 184 + power_source[power]); 185 + } 186 + 187 + static int k230_dt_node_to_map(struct pinctrl_dev *pctldev, 188 + struct device_node *np_config, 189 + struct pinctrl_map **map, 190 + unsigned int *num_maps) 191 + { 192 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 193 + struct device *dev = info->pctl_dev->dev; 194 + const struct k230_pmx_func *func; 195 + const struct k230_pin_group *grp; 196 + struct pinctrl_map *new_map; 197 + int map_num, i, j, idx; 198 + unsigned int grp_id; 199 + 200 + func = k230_name_to_funtion(info, np_config->name); 201 + if (!func) { 202 + dev_err(dev, "function %s not found\n", np_config->name); 203 + return -EINVAL; 204 + } 205 + 206 + map_num = 0; 207 + for (i = 0; i < func->ngroups; ++i) { 208 + grp_id = func->group_idx[i]; 209 + /* npins of config map plus a mux map */ 210 + map_num += info->groups[grp_id].num_pins + 1; 211 + } 212 + 213 + new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL); 214 + if (!new_map) 215 + return -ENOMEM; 216 + *map = new_map; 217 + *num_maps = map_num; 218 + 219 + idx = 0; 220 + for (i = 0; i < func->ngroups; ++i) { 221 + grp_id = func->group_idx[i]; 222 + grp = &info->groups[grp_id]; 223 + new_map[idx].type = PIN_MAP_TYPE_MUX_GROUP; 224 + new_map[idx].data.mux.group = grp->name; 225 + new_map[idx].data.mux.function = np_config->name; 226 + idx++; 227 + 228 + for (j = 0; j < grp->num_pins; ++j) { 229 + new_map[idx].type = PIN_MAP_TYPE_CONFIGS_PIN; 230 + new_map[idx].data.configs.group_or_pin = 231 + pin_get_name(pctldev, grp->pins[j]); 232 + new_map[idx].data.configs.configs = 233 + grp->data[j].configs; 234 + new_map[idx].data.configs.num_configs = 235 + grp->data[j].nconfigs; 236 + idx++; 237 + } 238 + } 239 + 240 + return 0; 241 + } 242 + 243 + static void k230_dt_free_map(struct pinctrl_dev *pctldev, 244 + struct pinctrl_map *map, unsigned int num_maps) 245 + { 246 + kfree(map); 247 + } 248 + 249 + static const struct pinctrl_ops k230_pctrl_ops = { 250 + .get_groups_count = k230_get_groups_count, 251 + .get_group_name = k230_get_group_name, 252 + .get_group_pins = k230_get_group_pins, 253 + .pin_dbg_show = k230_pinctrl_pin_dbg_show, 254 + .dt_node_to_map = k230_dt_node_to_map, 255 + .dt_free_map = k230_dt_free_map, 256 + }; 257 + 258 + static int k230_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, 259 + unsigned long *config) 260 + { 261 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 262 + enum pin_config_param param = pinconf_to_config_param(*config); 263 + unsigned int val, arg; 264 + 265 + regmap_read(info->regmap_base, pin * 4, &val); 266 + 267 + switch (param) { 268 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 269 + arg = (val & K230_PC_ST) ? 1 : 0; 270 + break; 271 + case PIN_CONFIG_DRIVE_STRENGTH: 272 + arg = (val & K230_PC_DS) >> K230_SHIFT_DS; 273 + break; 274 + case PIN_CONFIG_BIAS_DISABLE: 275 + arg = (val & K230_PC_BIAS) ? 0 : 1; 276 + break; 277 + case PIN_CONFIG_BIAS_PULL_DOWN: 278 + arg = (val & K230_PC_PD) ? 1 : 0; 279 + break; 280 + case PIN_CONFIG_BIAS_PULL_UP: 281 + arg = (val & K230_PC_PU) ? 1 : 0; 282 + break; 283 + case PIN_CONFIG_OUTPUT_ENABLE: 284 + arg = (val & K230_PC_OE) ? 1 : 0; 285 + break; 286 + case PIN_CONFIG_INPUT_ENABLE: 287 + arg = (val & K230_PC_IE) ? 1 : 0; 288 + break; 289 + case PIN_CONFIG_POWER_SOURCE: 290 + arg = (val & K230_PC_MSC) ? 1 : 0; 291 + break; 292 + case PIN_CONFIG_SLEW_RATE: 293 + arg = (val & K230_PC_SL) ? 1 : 0; 294 + break; 295 + default: 296 + return -EINVAL; 297 + } 298 + 299 + *config = pinconf_to_config_packed(param, arg); 300 + 301 + return 0; 302 + } 303 + 304 + static int k230_pinconf_set_param(struct pinctrl_dev *pctldev, unsigned int pin, 305 + enum pin_config_param param, unsigned int arg) 306 + { 307 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 308 + unsigned int val; 309 + 310 + regmap_read(info->regmap_base, pin * 4, &val); 311 + 312 + switch (param) { 313 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 314 + if (arg) 315 + val |= K230_PC_ST; 316 + else 317 + val &= ~K230_PC_ST; 318 + break; 319 + case PIN_CONFIG_DRIVE_STRENGTH: 320 + val &= ~K230_PC_DS; 321 + val |= (arg << K230_SHIFT_DS) & K230_PC_DS; 322 + break; 323 + case PIN_CONFIG_BIAS_DISABLE: 324 + val &= ~K230_PC_BIAS; 325 + break; 326 + case PIN_CONFIG_BIAS_PULL_DOWN: 327 + if (!arg) 328 + return -EINVAL; 329 + val |= K230_PC_PD; 330 + break; 331 + case PIN_CONFIG_BIAS_PULL_UP: 332 + if (!arg) 333 + return -EINVAL; 334 + val |= K230_PC_PU; 335 + break; 336 + case PIN_CONFIG_OUTPUT_ENABLE: 337 + if (!arg) 338 + return -EINVAL; 339 + val |= K230_PC_OE; 340 + break; 341 + case PIN_CONFIG_INPUT_ENABLE: 342 + if (!arg) 343 + return -EINVAL; 344 + val |= K230_PC_IE; 345 + break; 346 + case PIN_CONFIG_POWER_SOURCE: 347 + if (arg) 348 + val |= K230_PC_MSC; 349 + else 350 + val &= ~K230_PC_MSC; 351 + break; 352 + case PIN_CONFIG_SLEW_RATE: 353 + if (arg) 354 + val |= K230_PC_SL; 355 + else 356 + val &= ~K230_PC_SL; 357 + break; 358 + default: 359 + return -EINVAL; 360 + } 361 + 362 + regmap_write(info->regmap_base, pin * 4, val); 363 + 364 + return 0; 365 + } 366 + 367 + static int k230_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, 368 + unsigned long *configs, unsigned int num_configs) 369 + { 370 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 371 + struct device *dev = info->pctl_dev->dev; 372 + enum pin_config_param param; 373 + unsigned int arg, i; 374 + int ret; 375 + 376 + if (pin >= K230_NPINS) { 377 + dev_err(dev, "pin number out of range\n"); 378 + return -EINVAL; 379 + } 380 + 381 + for (i = 0; i < num_configs; i++) { 382 + param = pinconf_to_config_param(configs[i]); 383 + arg = pinconf_to_config_argument(configs[i]); 384 + ret = k230_pinconf_set_param(pctldev, pin, param, arg); 385 + if (ret) 386 + return ret; 387 + } 388 + 389 + return 0; 390 + } 391 + 392 + static void k230_pconf_dbg_show(struct pinctrl_dev *pctldev, 393 + struct seq_file *s, unsigned int pin) 394 + { 395 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 396 + unsigned int val; 397 + 398 + regmap_read(info->regmap_base, pin * 4, &val); 399 + 400 + seq_printf(s, " 0x%08x", val); 401 + } 402 + 403 + static const struct pinconf_ops k230_pinconf_ops = { 404 + .is_generic = true, 405 + .pin_config_get = k230_pinconf_get, 406 + .pin_config_set = k230_pinconf_set, 407 + .pin_config_dbg_show = k230_pconf_dbg_show, 408 + }; 409 + 410 + static int k230_get_functions_count(struct pinctrl_dev *pctldev) 411 + { 412 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 413 + 414 + return info->nfunctions; 415 + } 416 + 417 + static const char *k230_get_fname(struct pinctrl_dev *pctldev, 418 + unsigned int selector) 419 + { 420 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 421 + 422 + return info->functions[selector].name; 423 + } 424 + 425 + static int k230_get_groups(struct pinctrl_dev *pctldev, unsigned int selector, 426 + const char * const **groups, unsigned int *num_groups) 427 + { 428 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 429 + 430 + *groups = info->functions[selector].groups; 431 + *num_groups = info->functions[selector].ngroups; 432 + 433 + return 0; 434 + } 435 + 436 + static int k230_set_mux(struct pinctrl_dev *pctldev, unsigned int selector, 437 + unsigned int group) 438 + { 439 + struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 440 + const struct k230_pin_conf *data = info->groups[group].data; 441 + struct k230_pin_group *grp = &info->groups[group]; 442 + const unsigned int *pins = grp->pins; 443 + struct regmap *regmap; 444 + unsigned int value, mask; 445 + int cnt, reg; 446 + 447 + regmap = info->regmap_base; 448 + 449 + for (cnt = 0; cnt < grp->num_pins; cnt++) { 450 + reg = pins[cnt] * 4; 451 + value = data[cnt].func << K230_SHIFT_SEL; 452 + mask = K230_PC_SEL; 453 + regmap_update_bits(regmap, reg, mask, value); 454 + k230_pins[pins[cnt]].drv_data = grp; 455 + } 456 + 457 + return 0; 458 + } 459 + 460 + static const struct pinmux_ops k230_pmxops = { 461 + .get_functions_count = k230_get_functions_count, 462 + .get_function_name = k230_get_fname, 463 + .get_function_groups = k230_get_groups, 464 + .set_mux = k230_set_mux, 465 + .strict = true, 466 + }; 467 + 468 + static int k230_pinctrl_parse_groups(struct device_node *np, 469 + struct k230_pin_group *grp, 470 + struct k230_pinctrl *info, 471 + unsigned int index) 472 + { 473 + struct device *dev = info->pctl_dev->dev; 474 + const __be32 *list; 475 + int size, i, ret; 476 + 477 + grp->name = np->name; 478 + 479 + list = of_get_property(np, "pinmux", &size); 480 + size /= sizeof(*list); 481 + 482 + grp->num_pins = size; 483 + grp->pins = devm_kcalloc(dev, grp->num_pins, sizeof(*grp->pins), 484 + GFP_KERNEL); 485 + grp->data = devm_kcalloc(dev, grp->num_pins, sizeof(*grp->data), 486 + GFP_KERNEL); 487 + if (!grp->pins || !grp->data) 488 + return -ENOMEM; 489 + 490 + for (i = 0; i < size; i++) { 491 + unsigned int mux_data = be32_to_cpu(*list++); 492 + 493 + grp->pins[i] = (mux_data >> 8); 494 + grp->data[i].func = (mux_data & 0xff); 495 + 496 + ret = pinconf_generic_parse_dt_config(np, NULL, 497 + &grp->data[i].configs, 498 + &grp->data[i].nconfigs); 499 + if (ret) 500 + return ret; 501 + } 502 + 503 + return 0; 504 + } 505 + 506 + static int k230_pinctrl_parse_functions(struct device_node *np, 507 + struct k230_pinctrl *info, 508 + unsigned int index) 509 + { 510 + struct device *dev = info->pctl_dev->dev; 511 + struct k230_pmx_func *func; 512 + struct k230_pin_group *grp; 513 + static unsigned int idx, i; 514 + int ret; 515 + 516 + func = &info->functions[index]; 517 + 518 + func->name = np->name; 519 + func->ngroups = of_get_child_count(np); 520 + if (func->ngroups <= 0) 521 + return 0; 522 + 523 + func->groups = devm_kcalloc(dev, func->ngroups, 524 + sizeof(*func->groups), GFP_KERNEL); 525 + func->group_idx = devm_kcalloc(dev, func->ngroups, 526 + sizeof(*func->group_idx), GFP_KERNEL); 527 + if (!func->groups || !func->group_idx) 528 + return -ENOMEM; 529 + 530 + i = 0; 531 + 532 + for_each_child_of_node_scoped(np, child) { 533 + func->groups[i] = child->name; 534 + func->group_idx[i] = idx; 535 + grp = &info->groups[idx]; 536 + idx++; 537 + ret = k230_pinctrl_parse_groups(child, grp, info, i++); 538 + if (ret) 539 + return ret; 540 + } 541 + 542 + return 0; 543 + } 544 + 545 + static void k230_pinctrl_child_count(struct k230_pinctrl *info, 546 + struct device_node *np) 547 + { 548 + for_each_child_of_node_scoped(np, child) { 549 + info->nfunctions++; 550 + info->ngroups += of_get_child_count(child); 551 + } 552 + } 553 + 554 + static int k230_pinctrl_parse_dt(struct platform_device *pdev, 555 + struct k230_pinctrl *info) 556 + { 557 + struct device *dev = &pdev->dev; 558 + struct device_node *np = dev->of_node; 559 + unsigned int i; 560 + int ret; 561 + 562 + k230_pinctrl_child_count(info, np); 563 + 564 + info->functions = devm_kcalloc(dev, info->nfunctions, 565 + sizeof(*info->functions), GFP_KERNEL); 566 + info->groups = devm_kcalloc(dev, info->ngroups, 567 + sizeof(*info->groups), GFP_KERNEL); 568 + if (!info->functions || !info->groups) 569 + return -ENOMEM; 570 + 571 + i = 0; 572 + 573 + for_each_child_of_node_scoped(np, child) { 574 + ret = k230_pinctrl_parse_functions(child, info, i++); 575 + if (ret) { 576 + dev_err(dev, "failed to parse function\n"); 577 + return ret; 578 + } 579 + } 580 + 581 + return 0; 582 + } 583 + 584 + static int k230_pinctrl_probe(struct platform_device *pdev) 585 + { 586 + struct device *dev = &pdev->dev; 587 + struct k230_pinctrl *info; 588 + struct pinctrl_desc *pctl; 589 + 590 + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); 591 + if (!info) 592 + return -ENOMEM; 593 + 594 + pctl = &info->pctl; 595 + 596 + pctl->name = "k230-pinctrl"; 597 + pctl->owner = THIS_MODULE; 598 + pctl->pins = k230_pins; 599 + pctl->npins = ARRAY_SIZE(k230_pins); 600 + pctl->pctlops = &k230_pctrl_ops; 601 + pctl->pmxops = &k230_pmxops; 602 + pctl->confops = &k230_pinconf_ops; 603 + 604 + info->base = devm_platform_ioremap_resource(pdev, 0); 605 + if (IS_ERR(info->base)) 606 + return PTR_ERR(info->base); 607 + 608 + info->regmap_base = devm_regmap_init_mmio(dev, info->base, 609 + &k230_regmap_config); 610 + if (IS_ERR(info->regmap_base)) 611 + return dev_err_probe(dev, PTR_ERR(info->regmap_base), 612 + "failed to init regmap\n"); 613 + 614 + info->pctl_dev = devm_pinctrl_register(dev, pctl, info); 615 + if (IS_ERR(info->pctl_dev)) 616 + return dev_err_probe(dev, PTR_ERR(info->pctl_dev), 617 + "devm_pinctrl_register failed\n"); 618 + 619 + k230_pinctrl_parse_dt(pdev, info); 620 + 621 + return 0; 622 + } 623 + 624 + static const struct of_device_id k230_dt_ids[] = { 625 + { .compatible = "canaan,k230-pinctrl", }, 626 + { /* sintenel */ } 627 + }; 628 + MODULE_DEVICE_TABLE(of, k230_dt_ids); 629 + 630 + static struct platform_driver k230_pinctrl_driver = { 631 + .probe = k230_pinctrl_probe, 632 + .driver = { 633 + .name = "k230-pinctrl", 634 + .of_match_table = k230_dt_ids, 635 + }, 636 + }; 637 + module_platform_driver(k230_pinctrl_driver); 638 + 639 + MODULE_LICENSE("GPL"); 640 + MODULE_AUTHOR("Ze Huang <18771902331@163.com>"); 641 + MODULE_DESCRIPTION("Canaan K230 pinctrl driver");
+203
drivers/pinctrl/pinctrl-ocelot.c
··· 57 57 FUNC_CAN1, 58 58 FUNC_CLKMON, 59 59 FUNC_NONE, 60 + FUNC_FAN, 61 + FUNC_FC, 60 62 FUNC_FC0_a, 61 63 FUNC_FC0_b, 62 64 FUNC_FC0_c, ··· 73 71 FUNC_FC4_a, 74 72 FUNC_FC4_b, 75 73 FUNC_FC4_c, 74 + FUNC_FC_SHRD, 76 75 FUNC_FC_SHRD0, 77 76 FUNC_FC_SHRD1, 78 77 FUNC_FC_SHRD2, ··· 95 92 FUNC_FC_SHRD18, 96 93 FUNC_FC_SHRD19, 97 94 FUNC_FC_SHRD20, 95 + FUNC_FUSA, 98 96 FUNC_GPIO, 99 97 FUNC_IB_TRG_a, 100 98 FUNC_IB_TRG_b, ··· 112 108 FUNC_IRQ1, 113 109 FUNC_IRQ1_IN, 114 110 FUNC_IRQ1_OUT, 111 + FUNC_IRQ3, 112 + FUNC_IRQ4, 115 113 FUNC_EXT_IRQ, 116 114 FUNC_MIIM, 117 115 FUNC_MIIM_a, ··· 121 115 FUNC_MIIM_c, 122 116 FUNC_MIIM_Sa, 123 117 FUNC_MIIM_Sb, 118 + FUNC_MIIM_IRQ, 124 119 FUNC_OB_TRG, 125 120 FUNC_OB_TRG_a, 126 121 FUNC_OB_TRG_b, 127 122 FUNC_PHY_LED, 128 123 FUNC_PCI_WAKE, 129 124 FUNC_MD, 125 + FUNC_PCIE_PERST, 130 126 FUNC_PTP0, 131 127 FUNC_PTP1, 132 128 FUNC_PTP2, ··· 160 152 FUNC_SGPIO_b, 161 153 FUNC_SI, 162 154 FUNC_SI2, 155 + FUNC_SYNCE, 163 156 FUNC_TACHO, 164 157 FUNC_TACHO_a, 165 158 FUNC_TACHO_b, ··· 179 170 FUNC_USB_S_a, 180 171 FUNC_USB_S_b, 181 172 FUNC_USB_S_c, 173 + FUNC_USB_POWER, 174 + FUNC_USB2PHY_RST, 175 + FUNC_USB_OVER_DETECT, 176 + FUNC_USB_ULPI, 182 177 FUNC_PLL_STAT, 183 178 FUNC_EMMC, 184 179 FUNC_EMMC_SD, ··· 197 184 [FUNC_CAN1] = "can1", 198 185 [FUNC_CLKMON] = "clkmon", 199 186 [FUNC_NONE] = "none", 187 + [FUNC_FAN] = "fan", 188 + [FUNC_FC] = "fc", 200 189 [FUNC_FC0_a] = "fc0_a", 201 190 [FUNC_FC0_b] = "fc0_b", 202 191 [FUNC_FC0_c] = "fc0_c", ··· 213 198 [FUNC_FC4_a] = "fc4_a", 214 199 [FUNC_FC4_b] = "fc4_b", 215 200 [FUNC_FC4_c] = "fc4_c", 201 + [FUNC_FC_SHRD] = "fc_shrd", 216 202 [FUNC_FC_SHRD0] = "fc_shrd0", 217 203 [FUNC_FC_SHRD1] = "fc_shrd1", 218 204 [FUNC_FC_SHRD2] = "fc_shrd2", ··· 235 219 [FUNC_FC_SHRD18] = "fc_shrd18", 236 220 [FUNC_FC_SHRD19] = "fc_shrd19", 237 221 [FUNC_FC_SHRD20] = "fc_shrd20", 222 + [FUNC_FUSA] = "fusa", 238 223 [FUNC_GPIO] = "gpio", 239 224 [FUNC_IB_TRG_a] = "ib_trig_a", 240 225 [FUNC_IB_TRG_b] = "ib_trig_b", ··· 252 235 [FUNC_IRQ1] = "irq1", 253 236 [FUNC_IRQ1_IN] = "irq1_in", 254 237 [FUNC_IRQ1_OUT] = "irq1_out", 238 + [FUNC_IRQ3] = "irq3", 239 + [FUNC_IRQ4] = "irq4", 255 240 [FUNC_EXT_IRQ] = "ext_irq", 256 241 [FUNC_MIIM] = "miim", 257 242 [FUNC_MIIM_a] = "miim_a", ··· 261 242 [FUNC_MIIM_c] = "miim_c", 262 243 [FUNC_MIIM_Sa] = "miim_slave_a", 263 244 [FUNC_MIIM_Sb] = "miim_slave_b", 245 + [FUNC_MIIM_IRQ] = "miim_irq", 264 246 [FUNC_PHY_LED] = "phy_led", 265 247 [FUNC_PCI_WAKE] = "pci_wake", 248 + [FUNC_PCIE_PERST] = "pcie_perst", 266 249 [FUNC_MD] = "md", 267 250 [FUNC_OB_TRG] = "ob_trig", 268 251 [FUNC_OB_TRG_a] = "ob_trig_a", ··· 300 279 [FUNC_SGPIO_b] = "sgpio_b", 301 280 [FUNC_SI] = "si", 302 281 [FUNC_SI2] = "si2", 282 + [FUNC_SYNCE] = "synce", 303 283 [FUNC_TACHO] = "tacho", 304 284 [FUNC_TACHO_a] = "tacho_a", 305 285 [FUNC_TACHO_b] = "tacho_b", ··· 316 294 [FUNC_USB_S_a] = "usb_slave_a", 317 295 [FUNC_USB_S_b] = "usb_slave_b", 318 296 [FUNC_USB_S_c] = "usb_slave_c", 297 + [FUNC_USB_POWER] = "usb_power", 298 + [FUNC_USB2PHY_RST] = "usb2phy_rst", 299 + [FUNC_USB_OVER_DETECT] = "usb_over_detect", 300 + [FUNC_USB_ULPI] = "usb_ulpi", 319 301 [FUNC_UART] = "uart", 320 302 [FUNC_UART2] = "uart2", 321 303 [FUNC_UART3] = "uart3", ··· 1162 1136 LAN966X_PIN(77), 1163 1137 }; 1164 1138 1139 + #define LAN969X_P(p, f0, f1, f2, f3, f4, f5, f6, f7) \ 1140 + static struct ocelot_pin_caps lan969x_pin_##p = { \ 1141 + .pin = p, \ 1142 + .functions = { \ 1143 + FUNC_##f0, FUNC_##f1, FUNC_##f2, \ 1144 + FUNC_##f3 \ 1145 + }, \ 1146 + .a_functions = { \ 1147 + FUNC_##f4, FUNC_##f5, FUNC_##f6, \ 1148 + FUNC_##f7 \ 1149 + }, \ 1150 + } 1151 + 1152 + /* Pinmuxing table taken from data sheet */ 1153 + /* Pin FUNC0 FUNC1 FUNC2 FUNC3 FUNC4 FUNC5 FUNC6 FUNC7 */ 1154 + LAN969X_P(0, GPIO, IRQ0, FC_SHRD, PCIE_PERST, NONE, NONE, NONE, R); 1155 + LAN969X_P(1, GPIO, IRQ1, FC_SHRD, USB_POWER, NONE, NONE, NONE, R); 1156 + LAN969X_P(2, GPIO, FC, NONE, NONE, NONE, NONE, NONE, R); 1157 + LAN969X_P(3, GPIO, FC, NONE, NONE, NONE, NONE, NONE, R); 1158 + LAN969X_P(4, GPIO, FC, NONE, NONE, NONE, NONE, NONE, R); 1159 + LAN969X_P(5, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R); 1160 + LAN969X_P(6, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R); 1161 + LAN969X_P(7, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R); 1162 + LAN969X_P(8, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R); 1163 + LAN969X_P(9, GPIO, MIIM, MIIM_Sa, CLKMON, NONE, NONE, NONE, R); 1164 + LAN969X_P(10, GPIO, MIIM, MIIM_Sa, CLKMON, NONE, NONE, NONE, R); 1165 + LAN969X_P(11, GPIO, MIIM_IRQ, MIIM_Sa, CLKMON, NONE, NONE, NONE, R); 1166 + LAN969X_P(12, GPIO, IRQ3, FC_SHRD, USB2PHY_RST, NONE, NONE, NONE, R); 1167 + LAN969X_P(13, GPIO, IRQ4, FC_SHRD, USB_OVER_DETECT, NONE, NONE, NONE, R); 1168 + LAN969X_P(14, GPIO, EMMC_SD, QSPI1, FC, NONE, NONE, NONE, R); 1169 + LAN969X_P(15, GPIO, EMMC_SD, QSPI1, FC, NONE, NONE, NONE, R); 1170 + LAN969X_P(16, GPIO, EMMC_SD, QSPI1, FC, NONE, NONE, NONE, R); 1171 + LAN969X_P(17, GPIO, EMMC_SD, QSPI1, PTPSYNC_0, USB_POWER, NONE, NONE, R); 1172 + LAN969X_P(18, GPIO, EMMC_SD, QSPI1, PTPSYNC_1, USB2PHY_RST, NONE, NONE, R); 1173 + LAN969X_P(19, GPIO, EMMC_SD, QSPI1, PTPSYNC_2, USB_OVER_DETECT, NONE, NONE, R); 1174 + LAN969X_P(20, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R); 1175 + LAN969X_P(21, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R); 1176 + LAN969X_P(22, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R); 1177 + LAN969X_P(23, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R); 1178 + LAN969X_P(24, GPIO, EMMC_SD, NONE, NONE, NONE, NONE, NONE, R); 1179 + LAN969X_P(25, GPIO, FAN, FUSA, CAN0_a, QSPI1, NONE, NONE, R); 1180 + LAN969X_P(26, GPIO, FAN, FUSA, CAN0_a, QSPI1, NONE, NONE, R); 1181 + LAN969X_P(27, GPIO, SYNCE, FC, MIIM, QSPI1, NONE, NONE, R); 1182 + LAN969X_P(28, GPIO, SYNCE, FC, MIIM, QSPI1, NONE, NONE, R); 1183 + LAN969X_P(29, GPIO, SYNCE, FC, MIIM_IRQ, QSPI1, NONE, NONE, R); 1184 + LAN969X_P(30, GPIO, PTPSYNC_0, USB_ULPI, FC_SHRD, QSPI1, NONE, NONE, R); 1185 + LAN969X_P(31, GPIO, PTPSYNC_1, USB_ULPI, FC_SHRD, NONE, NONE, NONE, R); 1186 + LAN969X_P(32, GPIO, PTPSYNC_2, USB_ULPI, FC_SHRD, NONE, NONE, NONE, R); 1187 + LAN969X_P(33, GPIO, SD, USB_ULPI, FC_SHRD, NONE, NONE, NONE, R); 1188 + LAN969X_P(34, GPIO, SD, USB_ULPI, CAN1, FC_SHRD, NONE, NONE, R); 1189 + LAN969X_P(35, GPIO, SD, USB_ULPI, CAN1, FC_SHRD, NONE, NONE, R); 1190 + LAN969X_P(36, GPIO, SD, USB_ULPI, PCIE_PERST, FC_SHRD, NONE, NONE, R); 1191 + LAN969X_P(37, GPIO, SD, USB_ULPI, CAN0_b, NONE, NONE, NONE, R); 1192 + LAN969X_P(38, GPIO, SD, USB_ULPI, CAN0_b, NONE, NONE, NONE, R); 1193 + LAN969X_P(39, GPIO, SD, USB_ULPI, MIIM, NONE, NONE, NONE, R); 1194 + LAN969X_P(40, GPIO, SD, USB_ULPI, MIIM, NONE, NONE, NONE, R); 1195 + LAN969X_P(41, GPIO, SD, USB_ULPI, MIIM_IRQ, NONE, NONE, NONE, R); 1196 + LAN969X_P(42, GPIO, PTPSYNC_3, CAN1, NONE, NONE, NONE, NONE, R); 1197 + LAN969X_P(43, GPIO, PTPSYNC_4, CAN1, NONE, NONE, NONE, NONE, R); 1198 + LAN969X_P(44, GPIO, PTPSYNC_5, SFP_SD, NONE, NONE, NONE, NONE, R); 1199 + LAN969X_P(45, GPIO, PTPSYNC_6, SFP_SD, NONE, NONE, NONE, NONE, R); 1200 + LAN969X_P(46, GPIO, PTPSYNC_7, SFP_SD, NONE, NONE, NONE, NONE, R); 1201 + LAN969X_P(47, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R); 1202 + LAN969X_P(48, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R); 1203 + LAN969X_P(49, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R); 1204 + LAN969X_P(50, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R); 1205 + LAN969X_P(51, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R); 1206 + LAN969X_P(52, GPIO, FAN, SFP_SD, NONE, NONE, NONE, NONE, R); 1207 + LAN969X_P(53, GPIO, FAN, SFP_SD, NONE, NONE, NONE, NONE, R); 1208 + LAN969X_P(54, GPIO, SYNCE, FC, NONE, NONE, NONE, NONE, R); 1209 + LAN969X_P(55, GPIO, SYNCE, FC, NONE, NONE, NONE, NONE, R); 1210 + LAN969X_P(56, GPIO, SYNCE, FC, NONE, NONE, NONE, NONE, R); 1211 + LAN969X_P(57, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_3, NONE, NONE, R); 1212 + LAN969X_P(58, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_4, NONE, NONE, R); 1213 + LAN969X_P(59, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_5, NONE, NONE, R); 1214 + LAN969X_P(60, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_6, NONE, NONE, R); 1215 + LAN969X_P(61, GPIO, MIIM, FC_SHRD, TWI, NONE, NONE, NONE, R); 1216 + LAN969X_P(62, GPIO, MIIM, FC_SHRD, TWI, NONE, NONE, NONE, R); 1217 + LAN969X_P(63, GPIO, MIIM_IRQ, FC_SHRD, TWI, NONE, NONE, NONE, R); 1218 + LAN969X_P(64, GPIO, FC, FC_SHRD, TWI, NONE, NONE, NONE, R); 1219 + LAN969X_P(65, GPIO, FC, FC_SHRD, TWI, NONE, NONE, NONE, R); 1220 + LAN969X_P(66, GPIO, FC, FC_SHRD, TWI, NONE, NONE, NONE, R); 1221 + 1222 + #define LAN969X_PIN(n) { \ 1223 + .number = n, \ 1224 + .name = "GPIO_"#n, \ 1225 + .drv_data = &lan969x_pin_##n \ 1226 + } 1227 + 1228 + static const struct pinctrl_pin_desc lan969x_pins[] = { 1229 + LAN969X_PIN(0), 1230 + LAN969X_PIN(1), 1231 + LAN969X_PIN(2), 1232 + LAN969X_PIN(3), 1233 + LAN969X_PIN(4), 1234 + LAN969X_PIN(5), 1235 + LAN969X_PIN(6), 1236 + LAN969X_PIN(7), 1237 + LAN969X_PIN(8), 1238 + LAN969X_PIN(9), 1239 + LAN969X_PIN(10), 1240 + LAN969X_PIN(11), 1241 + LAN969X_PIN(12), 1242 + LAN969X_PIN(13), 1243 + LAN969X_PIN(14), 1244 + LAN969X_PIN(15), 1245 + LAN969X_PIN(16), 1246 + LAN969X_PIN(17), 1247 + LAN969X_PIN(18), 1248 + LAN969X_PIN(19), 1249 + LAN969X_PIN(20), 1250 + LAN969X_PIN(21), 1251 + LAN969X_PIN(22), 1252 + LAN969X_PIN(23), 1253 + LAN969X_PIN(24), 1254 + LAN969X_PIN(25), 1255 + LAN969X_PIN(26), 1256 + LAN969X_PIN(27), 1257 + LAN969X_PIN(28), 1258 + LAN969X_PIN(29), 1259 + LAN969X_PIN(30), 1260 + LAN969X_PIN(31), 1261 + LAN969X_PIN(32), 1262 + LAN969X_PIN(33), 1263 + LAN969X_PIN(34), 1264 + LAN969X_PIN(35), 1265 + LAN969X_PIN(36), 1266 + LAN969X_PIN(37), 1267 + LAN969X_PIN(38), 1268 + LAN969X_PIN(39), 1269 + LAN969X_PIN(40), 1270 + LAN969X_PIN(41), 1271 + LAN969X_PIN(42), 1272 + LAN969X_PIN(43), 1273 + LAN969X_PIN(44), 1274 + LAN969X_PIN(45), 1275 + LAN969X_PIN(46), 1276 + LAN969X_PIN(47), 1277 + LAN969X_PIN(48), 1278 + LAN969X_PIN(49), 1279 + LAN969X_PIN(50), 1280 + LAN969X_PIN(51), 1281 + LAN969X_PIN(52), 1282 + LAN969X_PIN(53), 1283 + LAN969X_PIN(54), 1284 + LAN969X_PIN(55), 1285 + LAN969X_PIN(56), 1286 + LAN969X_PIN(57), 1287 + LAN969X_PIN(58), 1288 + LAN969X_PIN(59), 1289 + LAN969X_PIN(60), 1290 + LAN969X_PIN(61), 1291 + LAN969X_PIN(62), 1292 + LAN969X_PIN(63), 1293 + LAN969X_PIN(64), 1294 + LAN969X_PIN(65), 1295 + LAN969X_PIN(66), 1296 + }; 1297 + 1165 1298 static int ocelot_get_functions_count(struct pinctrl_dev *pctldev) 1166 1299 { 1167 1300 return ARRAY_SIZE(ocelot_function_names); ··· 1867 1682 }, 1868 1683 }; 1869 1684 1685 + static struct ocelot_match_data lan969x_desc = { 1686 + .desc = { 1687 + .name = "lan969x-pinctrl", 1688 + .pins = lan969x_pins, 1689 + .npins = ARRAY_SIZE(lan969x_pins), 1690 + .pctlops = &ocelot_pctl_ops, 1691 + .pmxops = &lan966x_pmx_ops, 1692 + .confops = &ocelot_confops, 1693 + .owner = THIS_MODULE, 1694 + }, 1695 + .pincfg_data = { 1696 + .pd_bit = BIT(3), 1697 + .pu_bit = BIT(2), 1698 + .drive_bits = GENMASK(1, 0), 1699 + }, 1700 + }; 1701 + 1870 1702 static int ocelot_create_group_func_map(struct device *dev, 1871 1703 struct ocelot_pinctrl *info) 1872 1704 { ··· 2216 2014 { .compatible = "mscc,servalt-pinctrl", .data = &servalt_desc }, 2217 2015 { .compatible = "microchip,sparx5-pinctrl", .data = &sparx5_desc }, 2218 2016 { .compatible = "microchip,lan966x-pinctrl", .data = &lan966x_desc }, 2017 + { .compatible = "microchip,lan9691-pinctrl", .data = &lan969x_desc }, 2219 2018 {}, 2220 2019 }; 2221 2020 MODULE_DEVICE_TABLE(of, ocelot_pinctrl_of_match);
+4 -2
drivers/pinctrl/pinctrl-rockchip.c
··· 3227 3227 /* we do not check return since it's safe node passed down */ 3228 3228 size /= sizeof(*list); 3229 3229 if (!size || size % 4) 3230 - return dev_err_probe(dev, -EINVAL, "wrong pins number or pins and configs should be by 4\n"); 3230 + return dev_err_probe(dev, -EINVAL, 3231 + "%pOF: rockchip,pins: expected one or more of <bank pin mux CONFIG>, got %d args instead\n", 3232 + np, size); 3231 3233 3232 3234 grp->npins = size / 4; 3233 3235 ··· 4221 4219 4222 4220 static struct platform_driver rockchip_pinctrl_driver = { 4223 4221 .probe = rockchip_pinctrl_probe, 4224 - .remove_new = rockchip_pinctrl_remove, 4222 + .remove = rockchip_pinctrl_remove, 4225 4223 .driver = { 4226 4224 .name = "rockchip-pinctrl", 4227 4225 .pm = &rockchip_pinctrl_dev_pm_ops,
+2 -1
drivers/pinctrl/pinctrl-single.c
··· 1966 1966 }; 1967 1967 1968 1968 static const struct of_device_id pcs_of_match[] = { 1969 + { .compatible = "marvell,pxa1908-padconf", .data = &pinconf_single }, 1969 1970 { .compatible = "ti,am437-padconf", .data = &pinctrl_single_am437x }, 1970 1971 { .compatible = "ti,am654-padconf", .data = &pinctrl_single_am654 }, 1971 1972 { .compatible = "ti,dra7-padconf", .data = &pinctrl_single_dra7 }, ··· 1982 1981 1983 1982 static struct platform_driver pcs_driver = { 1984 1983 .probe = pcs_probe, 1985 - .remove_new = pcs_remove, 1984 + .remove = pcs_remove, 1986 1985 .driver = { 1987 1986 .name = DRIVER_NAME, 1988 1987 .of_match_table = pcs_of_match,
+1 -1
drivers/pinctrl/pinctrl-stmfx.c
··· 855 855 .pm = &stmfx_pinctrl_dev_pm_ops, 856 856 }, 857 857 .probe = stmfx_pinctrl_probe, 858 - .remove_new = stmfx_pinctrl_remove, 858 + .remove = stmfx_pinctrl_remove, 859 859 }; 860 860 module_platform_driver(stmfx_pinctrl_driver); 861 861
+1 -1
drivers/pinctrl/pinctrl-sx150x.c
··· 1105 1105 .reg_bits = 8, 1106 1106 .val_bits = 32, 1107 1107 1108 - .cache_type = REGCACHE_RBTREE, 1108 + .cache_type = REGCACHE_MAPLE, 1109 1109 1110 1110 .reg_read = sx150x_regmap_reg_read, 1111 1111 .reg_write = sx150x_regmap_reg_write,
+1 -1
drivers/pinctrl/pinctrl-tb10x.c
··· 820 820 821 821 static struct platform_driver tb10x_pinctrl_pdrv = { 822 822 .probe = tb10x_pinctrl_probe, 823 - .remove_new = tb10x_pinctrl_remove, 823 + .remove = tb10x_pinctrl_remove, 824 824 .driver = { 825 825 .name = "tb10x_pinctrl", 826 826 .of_match_table = of_match_ptr(tb10x_pinctrl_dt_ids),
+918
drivers/pinctrl/pinctrl-th1520.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Pinctrl driver for the T-Head TH1520 SoC 4 + * 5 + * Copyright (C) 2023 Emil Renner Berthing <emil.renner.berthing@canonical.com> 6 + */ 7 + 8 + #include <linux/array_size.h> 9 + #include <linux/bits.h> 10 + #include <linux/cleanup.h> 11 + #include <linux/clk.h> 12 + #include <linux/device.h> 13 + #include <linux/io.h> 14 + #include <linux/mod_devicetable.h> 15 + #include <linux/module.h> 16 + #include <linux/mutex.h> 17 + #include <linux/of.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/seq_file.h> 20 + #include <linux/spinlock.h> 21 + 22 + #include <linux/of_address.h> 23 + #include <linux/of_device.h> 24 + 25 + #include <linux/pinctrl/pinconf.h> 26 + #include <linux/pinctrl/pinconf-generic.h> 27 + #include <linux/pinctrl/pinctrl.h> 28 + #include <linux/pinctrl/pinmux.h> 29 + 30 + #include "core.h" 31 + #include "pinmux.h" 32 + #include "pinconf.h" 33 + 34 + #define TH1520_PADCFG_IE BIT(9) 35 + #define TH1520_PADCFG_SL BIT(8) 36 + #define TH1520_PADCFG_ST BIT(7) 37 + #define TH1520_PADCFG_SPU BIT(6) 38 + #define TH1520_PADCFG_PS BIT(5) 39 + #define TH1520_PADCFG_PE BIT(4) 40 + #define TH1520_PADCFG_BIAS (TH1520_PADCFG_SPU | TH1520_PADCFG_PS | TH1520_PADCFG_PE) 41 + #define TH1520_PADCFG_DS GENMASK(3, 0) 42 + 43 + #define TH1520_PULL_DOWN_OHM 44000 /* typ. 44kOhm */ 44 + #define TH1520_PULL_UP_OHM 48000 /* typ. 48kOhm */ 45 + #define TH1520_PULL_STRONG_OHM 2100 /* typ. 2.1kOhm */ 46 + 47 + #define TH1520_PAD_NO_PADCFG BIT(30) 48 + #define TH1520_PAD_MUXDATA GENMASK(29, 0) 49 + 50 + struct th1520_pad_group { 51 + const char *name; 52 + const struct pinctrl_pin_desc *pins; 53 + unsigned int npins; 54 + }; 55 + 56 + struct th1520_pinctrl { 57 + struct pinctrl_desc desc; 58 + struct mutex mutex; /* serialize adding functions */ 59 + raw_spinlock_t lock; /* serialize register access */ 60 + void __iomem *base; 61 + struct pinctrl_dev *pctl; 62 + }; 63 + 64 + static void __iomem *th1520_padcfg(struct th1520_pinctrl *thp, 65 + unsigned int pin) 66 + { 67 + return thp->base + 4 * (pin / 2); 68 + } 69 + 70 + static unsigned int th1520_padcfg_shift(unsigned int pin) 71 + { 72 + return 16 * (pin & BIT(0)); 73 + } 74 + 75 + static void __iomem *th1520_muxcfg(struct th1520_pinctrl *thp, 76 + unsigned int pin) 77 + { 78 + return thp->base + 0x400 + 4 * (pin / 8); 79 + } 80 + 81 + static unsigned int th1520_muxcfg_shift(unsigned int pin) 82 + { 83 + return 4 * (pin & GENMASK(2, 0)); 84 + } 85 + 86 + enum th1520_muxtype { 87 + TH1520_MUX_____, 88 + TH1520_MUX_GPIO, 89 + TH1520_MUX_PWM, 90 + TH1520_MUX_UART, 91 + TH1520_MUX_IR, 92 + TH1520_MUX_I2C, 93 + TH1520_MUX_SPI, 94 + TH1520_MUX_QSPI, 95 + TH1520_MUX_SDIO, 96 + TH1520_MUX_AUD, 97 + TH1520_MUX_I2S, 98 + TH1520_MUX_MAC0, 99 + TH1520_MUX_MAC1, 100 + TH1520_MUX_DPU0, 101 + TH1520_MUX_DPU1, 102 + TH1520_MUX_ISP, 103 + TH1520_MUX_HDMI, 104 + TH1520_MUX_BSEL, 105 + TH1520_MUX_DBG, 106 + TH1520_MUX_CLK, 107 + TH1520_MUX_JTAG, 108 + TH1520_MUX_ISO, 109 + TH1520_MUX_FUSE, 110 + TH1520_MUX_RST, 111 + }; 112 + 113 + static const char *const th1520_muxtype_string[] = { 114 + [TH1520_MUX_GPIO] = "gpio", 115 + [TH1520_MUX_PWM] = "pwm", 116 + [TH1520_MUX_UART] = "uart", 117 + [TH1520_MUX_IR] = "ir", 118 + [TH1520_MUX_I2C] = "i2c", 119 + [TH1520_MUX_SPI] = "spi", 120 + [TH1520_MUX_QSPI] = "qspi", 121 + [TH1520_MUX_SDIO] = "sdio", 122 + [TH1520_MUX_AUD] = "audio", 123 + [TH1520_MUX_I2S] = "i2s", 124 + [TH1520_MUX_MAC0] = "gmac0", 125 + [TH1520_MUX_MAC1] = "gmac1", 126 + [TH1520_MUX_DPU0] = "dpu0", 127 + [TH1520_MUX_DPU1] = "dpu1", 128 + [TH1520_MUX_ISP] = "isp", 129 + [TH1520_MUX_HDMI] = "hdmi", 130 + [TH1520_MUX_BSEL] = "bootsel", 131 + [TH1520_MUX_DBG] = "debug", 132 + [TH1520_MUX_CLK] = "clock", 133 + [TH1520_MUX_JTAG] = "jtag", 134 + [TH1520_MUX_ISO] = "iso7816", 135 + [TH1520_MUX_FUSE] = "efuse", 136 + [TH1520_MUX_RST] = "reset", 137 + }; 138 + 139 + static enum th1520_muxtype th1520_muxtype_get(const char *str) 140 + { 141 + enum th1520_muxtype mt; 142 + 143 + for (mt = TH1520_MUX_GPIO; mt < ARRAY_SIZE(th1520_muxtype_string); mt++) { 144 + if (!strcmp(str, th1520_muxtype_string[mt])) 145 + return mt; 146 + } 147 + return TH1520_MUX_____; 148 + } 149 + 150 + #define TH1520_PAD(_nr, _name, m0, m1, m2, m3, m4, m5, _flags) \ 151 + { .number = _nr, .name = #_name, .drv_data = (void *)((_flags) | \ 152 + (TH1520_MUX_##m0 << 0) | (TH1520_MUX_##m1 << 5) | (TH1520_MUX_##m2 << 10) | \ 153 + (TH1520_MUX_##m3 << 15) | (TH1520_MUX_##m4 << 20) | (TH1520_MUX_##m5 << 25)) } 154 + 155 + static unsigned long th1520_pad_muxdata(void *drv_data) 156 + { 157 + return (uintptr_t)drv_data & TH1520_PAD_MUXDATA; 158 + } 159 + 160 + static bool th1520_pad_no_padcfg(void *drv_data) 161 + { 162 + return (uintptr_t)drv_data & TH1520_PAD_NO_PADCFG; 163 + } 164 + 165 + static const struct pinctrl_pin_desc th1520_group1_pins[] = { 166 + TH1520_PAD(0, OSC_CLK_IN, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 167 + TH1520_PAD(1, OSC_CLK_OUT, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 168 + TH1520_PAD(2, SYS_RST_N, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 169 + TH1520_PAD(3, RTC_CLK_IN, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 170 + TH1520_PAD(4, RTC_CLK_OUT, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 171 + /* skip number 5 so we can calculate register offsets and shifts from the pin number */ 172 + TH1520_PAD(6, TEST_MODE, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 173 + TH1520_PAD(7, DEBUG_MODE, DBG, ____, ____, GPIO, ____, ____, TH1520_PAD_NO_PADCFG), 174 + TH1520_PAD(8, POR_SEL, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG), 175 + TH1520_PAD(9, I2C_AON_SCL, I2C, ____, ____, GPIO, ____, ____, 0), 176 + TH1520_PAD(10, I2C_AON_SDA, I2C, ____, ____, GPIO, ____, ____, 0), 177 + TH1520_PAD(11, CPU_JTG_TCLK, JTAG, ____, ____, GPIO, ____, ____, 0), 178 + TH1520_PAD(12, CPU_JTG_TMS, JTAG, ____, ____, GPIO, ____, ____, 0), 179 + TH1520_PAD(13, CPU_JTG_TDI, JTAG, ____, ____, GPIO, ____, ____, 0), 180 + TH1520_PAD(14, CPU_JTG_TDO, JTAG, ____, ____, GPIO, ____, ____, 0), 181 + TH1520_PAD(15, CPU_JTG_TRST, JTAG, ____, ____, GPIO, ____, ____, 0), 182 + TH1520_PAD(16, AOGPIO_7, CLK, AUD, ____, GPIO, ____, ____, 0), 183 + TH1520_PAD(17, AOGPIO_8, UART, AUD, IR, GPIO, ____, ____, 0), 184 + TH1520_PAD(18, AOGPIO_9, UART, AUD, IR, GPIO, ____, ____, 0), 185 + TH1520_PAD(19, AOGPIO_10, CLK, AUD, ____, GPIO, ____, ____, 0), 186 + TH1520_PAD(20, AOGPIO_11, GPIO, AUD, ____, ____, ____, ____, 0), 187 + TH1520_PAD(21, AOGPIO_12, GPIO, AUD, ____, ____, ____, ____, 0), 188 + TH1520_PAD(22, AOGPIO_13, GPIO, AUD, ____, ____, ____, ____, 0), 189 + TH1520_PAD(23, AOGPIO_14, GPIO, AUD, ____, ____, ____, ____, 0), 190 + TH1520_PAD(24, AOGPIO_15, GPIO, AUD, ____, ____, ____, ____, 0), 191 + TH1520_PAD(25, AUDIO_PA0, AUD, ____, ____, GPIO, ____, ____, 0), 192 + TH1520_PAD(26, AUDIO_PA1, AUD, ____, ____, GPIO, ____, ____, 0), 193 + TH1520_PAD(27, AUDIO_PA2, AUD, ____, ____, GPIO, ____, ____, 0), 194 + TH1520_PAD(28, AUDIO_PA3, AUD, ____, ____, GPIO, ____, ____, 0), 195 + TH1520_PAD(29, AUDIO_PA4, AUD, ____, ____, GPIO, ____, ____, 0), 196 + TH1520_PAD(30, AUDIO_PA5, AUD, ____, ____, GPIO, ____, ____, 0), 197 + TH1520_PAD(31, AUDIO_PA6, AUD, ____, ____, GPIO, ____, ____, 0), 198 + TH1520_PAD(32, AUDIO_PA7, AUD, ____, ____, GPIO, ____, ____, 0), 199 + TH1520_PAD(33, AUDIO_PA8, AUD, ____, ____, GPIO, ____, ____, 0), 200 + TH1520_PAD(34, AUDIO_PA9, AUD, ____, ____, GPIO, ____, ____, 0), 201 + TH1520_PAD(35, AUDIO_PA10, AUD, ____, ____, GPIO, ____, ____, 0), 202 + TH1520_PAD(36, AUDIO_PA11, AUD, ____, ____, GPIO, ____, ____, 0), 203 + TH1520_PAD(37, AUDIO_PA12, AUD, ____, ____, GPIO, ____, ____, 0), 204 + TH1520_PAD(38, AUDIO_PA13, AUD, ____, ____, GPIO, ____, ____, 0), 205 + TH1520_PAD(39, AUDIO_PA14, AUD, ____, ____, GPIO, ____, ____, 0), 206 + TH1520_PAD(40, AUDIO_PA15, AUD, ____, ____, GPIO, ____, ____, 0), 207 + TH1520_PAD(41, AUDIO_PA16, AUD, ____, ____, GPIO, ____, ____, 0), 208 + TH1520_PAD(42, AUDIO_PA17, AUD, ____, ____, GPIO, ____, ____, 0), 209 + TH1520_PAD(43, AUDIO_PA27, AUD, ____, ____, GPIO, ____, ____, 0), 210 + TH1520_PAD(44, AUDIO_PA28, AUD, ____, ____, GPIO, ____, ____, 0), 211 + TH1520_PAD(45, AUDIO_PA29, AUD, ____, ____, GPIO, ____, ____, 0), 212 + TH1520_PAD(46, AUDIO_PA30, AUD, RST, ____, GPIO, ____, ____, 0), 213 + }; 214 + 215 + static const struct pinctrl_pin_desc th1520_group2_pins[] = { 216 + TH1520_PAD(0, QSPI1_SCLK, QSPI, ISO, ____, GPIO, FUSE, ____, 0), 217 + TH1520_PAD(1, QSPI1_CSN0, QSPI, ____, I2C, GPIO, FUSE, ____, 0), 218 + TH1520_PAD(2, QSPI1_D0_MOSI, QSPI, ISO, I2C, GPIO, FUSE, ____, 0), 219 + TH1520_PAD(3, QSPI1_D1_MISO, QSPI, ISO, ____, GPIO, FUSE, ____, 0), 220 + TH1520_PAD(4, QSPI1_D2_WP, QSPI, ISO, UART, GPIO, FUSE, ____, 0), 221 + TH1520_PAD(5, QSPI1_D3_HOLD, QSPI, ISO, UART, GPIO, ____, ____, 0), 222 + TH1520_PAD(6, I2C0_SCL, I2C, ____, ____, GPIO, ____, ____, 0), 223 + TH1520_PAD(7, I2C0_SDA, I2C, ____, ____, GPIO, ____, ____, 0), 224 + TH1520_PAD(8, I2C1_SCL, I2C, ____, ____, GPIO, ____, ____, 0), 225 + TH1520_PAD(9, I2C1_SDA, I2C, ____, ____, GPIO, ____, ____, 0), 226 + TH1520_PAD(10, UART1_TXD, UART, ____, ____, GPIO, ____, ____, 0), 227 + TH1520_PAD(11, UART1_RXD, UART, ____, ____, GPIO, ____, ____, 0), 228 + TH1520_PAD(12, UART4_TXD, UART, ____, ____, GPIO, ____, ____, 0), 229 + TH1520_PAD(13, UART4_RXD, UART, ____, ____, GPIO, ____, ____, 0), 230 + TH1520_PAD(14, UART4_CTSN, UART, ____, ____, GPIO, ____, ____, 0), 231 + TH1520_PAD(15, UART4_RTSN, UART, ____, ____, GPIO, ____, ____, 0), 232 + TH1520_PAD(16, UART3_TXD, DBG, UART, ____, GPIO, ____, ____, 0), 233 + TH1520_PAD(17, UART3_RXD, DBG, UART, ____, GPIO, ____, ____, 0), 234 + TH1520_PAD(18, GPIO0_18, GPIO, I2C, ____, ____, DPU0, DPU1, 0), 235 + TH1520_PAD(19, GPIO0_19, GPIO, I2C, ____, ____, DPU0, DPU1, 0), 236 + TH1520_PAD(20, GPIO0_20, GPIO, UART, IR, ____, DPU0, DPU1, 0), 237 + TH1520_PAD(21, GPIO0_21, GPIO, UART, IR, ____, DPU0, DPU1, 0), 238 + TH1520_PAD(22, GPIO0_22, GPIO, JTAG, I2C, ____, DPU0, DPU1, 0), 239 + TH1520_PAD(23, GPIO0_23, GPIO, JTAG, I2C, ____, DPU0, DPU1, 0), 240 + TH1520_PAD(24, GPIO0_24, GPIO, JTAG, QSPI, ____, DPU0, DPU1, 0), 241 + TH1520_PAD(25, GPIO0_25, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 242 + TH1520_PAD(26, GPIO0_26, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 243 + TH1520_PAD(27, GPIO0_27, GPIO, ____, I2C, ____, DPU0, DPU1, 0), 244 + TH1520_PAD(28, GPIO0_28, GPIO, ____, I2C, ____, DPU0, DPU1, 0), 245 + TH1520_PAD(29, GPIO0_29, GPIO, ____, ____, ____, DPU0, DPU1, 0), 246 + TH1520_PAD(30, GPIO0_30, GPIO, ____, ____, ____, DPU0, DPU1, 0), 247 + TH1520_PAD(31, GPIO0_31, GPIO, ____, ____, ____, DPU0, DPU1, 0), 248 + TH1520_PAD(32, GPIO1_0, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 249 + TH1520_PAD(33, GPIO1_1, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 250 + TH1520_PAD(34, GPIO1_2, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 251 + TH1520_PAD(35, GPIO1_3, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 252 + TH1520_PAD(36, GPIO1_4, GPIO, JTAG, ____, ____, DPU0, DPU1, 0), 253 + TH1520_PAD(37, GPIO1_5, GPIO, ____, ____, ____, DPU0, DPU1, 0), 254 + TH1520_PAD(38, GPIO1_6, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 255 + TH1520_PAD(39, GPIO1_7, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 256 + TH1520_PAD(40, GPIO1_8, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 257 + TH1520_PAD(41, GPIO1_9, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 258 + TH1520_PAD(42, GPIO1_10, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 259 + TH1520_PAD(43, GPIO1_11, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 260 + TH1520_PAD(44, GPIO1_12, GPIO, QSPI, ____, ____, DPU0, DPU1, 0), 261 + TH1520_PAD(45, GPIO1_13, GPIO, UART, ____, ____, DPU0, DPU1, 0), 262 + TH1520_PAD(46, GPIO1_14, GPIO, UART, ____, ____, DPU0, DPU1, 0), 263 + TH1520_PAD(47, GPIO1_15, GPIO, UART, ____, ____, DPU0, DPU1, 0), 264 + TH1520_PAD(48, GPIO1_16, GPIO, UART, ____, ____, DPU0, DPU1, 0), 265 + TH1520_PAD(49, CLK_OUT_0, BSEL, CLK, ____, GPIO, ____, ____, 0), 266 + TH1520_PAD(50, CLK_OUT_1, BSEL, CLK, ____, GPIO, ____, ____, 0), 267 + TH1520_PAD(51, CLK_OUT_2, BSEL, CLK, ____, GPIO, ____, ____, 0), 268 + TH1520_PAD(52, CLK_OUT_3, BSEL, CLK, ____, GPIO, ____, ____, 0), 269 + TH1520_PAD(53, GPIO1_21, JTAG, ____, ISP, GPIO, ____, ____, 0), 270 + TH1520_PAD(54, GPIO1_22, JTAG, ____, ISP, GPIO, ____, ____, 0), 271 + TH1520_PAD(55, GPIO1_23, JTAG, ____, ISP, GPIO, ____, ____, 0), 272 + TH1520_PAD(56, GPIO1_24, JTAG, ____, ISP, GPIO, ____, ____, 0), 273 + TH1520_PAD(57, GPIO1_25, JTAG, ____, ISP, GPIO, ____, ____, 0), 274 + TH1520_PAD(58, GPIO1_26, GPIO, ____, ISP, ____, ____, ____, 0), 275 + TH1520_PAD(59, GPIO1_27, GPIO, ____, ISP, ____, ____, ____, 0), 276 + TH1520_PAD(60, GPIO1_28, GPIO, ____, ISP, ____, ____, ____, 0), 277 + TH1520_PAD(61, GPIO1_29, GPIO, ____, ISP, ____, ____, ____, 0), 278 + TH1520_PAD(62, GPIO1_30, GPIO, ____, ISP, ____, ____, ____, 0), 279 + }; 280 + 281 + static const struct pinctrl_pin_desc th1520_group3_pins[] = { 282 + TH1520_PAD(0, UART0_TXD, UART, ____, ____, GPIO, ____, ____, 0), 283 + TH1520_PAD(1, UART0_RXD, UART, ____, ____, GPIO, ____, ____, 0), 284 + TH1520_PAD(2, QSPI0_SCLK, QSPI, PWM, I2S, GPIO, ____, ____, 0), 285 + TH1520_PAD(3, QSPI0_CSN0, QSPI, PWM, I2S, GPIO, ____, ____, 0), 286 + TH1520_PAD(4, QSPI0_CSN1, QSPI, PWM, I2S, GPIO, ____, ____, 0), 287 + TH1520_PAD(5, QSPI0_D0_MOSI, QSPI, PWM, I2S, GPIO, ____, ____, 0), 288 + TH1520_PAD(6, QSPI0_D1_MISO, QSPI, PWM, I2S, GPIO, ____, ____, 0), 289 + TH1520_PAD(7, QSPI0_D2_WP, QSPI, PWM, I2S, GPIO, ____, ____, 0), 290 + TH1520_PAD(8, QSPI1_D3_HOLD, QSPI, ____, I2S, GPIO, ____, ____, 0), 291 + TH1520_PAD(9, I2C2_SCL, I2C, UART, ____, GPIO, ____, ____, 0), 292 + TH1520_PAD(10, I2C2_SDA, I2C, UART, ____, GPIO, ____, ____, 0), 293 + TH1520_PAD(11, I2C3_SCL, I2C, ____, ____, GPIO, ____, ____, 0), 294 + TH1520_PAD(12, I2C3_SDA, I2C, ____, ____, GPIO, ____, ____, 0), 295 + TH1520_PAD(13, GPIO2_13, GPIO, SPI, ____, ____, ____, ____, 0), 296 + TH1520_PAD(14, SPI_SCLK, SPI, UART, IR, GPIO, ____, ____, 0), 297 + TH1520_PAD(15, SPI_CSN, SPI, UART, IR, GPIO, ____, ____, 0), 298 + TH1520_PAD(16, SPI_MOSI, SPI, ____, ____, GPIO, ____, ____, 0), 299 + TH1520_PAD(17, SPI_MISO, SPI, ____, ____, GPIO, ____, ____, 0), 300 + TH1520_PAD(18, GPIO2_18, GPIO, MAC1, ____, ____, ____, ____, 0), 301 + TH1520_PAD(19, GPIO2_19, GPIO, MAC1, ____, ____, ____, ____, 0), 302 + TH1520_PAD(20, GPIO2_20, GPIO, MAC1, ____, ____, ____, ____, 0), 303 + TH1520_PAD(21, GPIO2_21, GPIO, MAC1, ____, ____, ____, ____, 0), 304 + TH1520_PAD(22, GPIO2_22, GPIO, MAC1, ____, ____, ____, ____, 0), 305 + TH1520_PAD(23, GPIO2_23, GPIO, MAC1, ____, ____, ____, ____, 0), 306 + TH1520_PAD(24, GPIO2_24, GPIO, MAC1, ____, ____, ____, ____, 0), 307 + TH1520_PAD(25, GPIO2_25, GPIO, MAC1, ____, ____, ____, ____, 0), 308 + TH1520_PAD(26, SDIO0_WPRTN, SDIO, ____, ____, GPIO, ____, ____, 0), 309 + TH1520_PAD(27, SDIO0_DETN, SDIO, ____, ____, GPIO, ____, ____, 0), 310 + TH1520_PAD(28, SDIO1_WPRTN, SDIO, ____, ____, GPIO, ____, ____, 0), 311 + TH1520_PAD(29, SDIO1_DETN, SDIO, ____, ____, GPIO, ____, ____, 0), 312 + TH1520_PAD(30, GPIO2_30, GPIO, MAC1, ____, ____, ____, ____, 0), 313 + TH1520_PAD(31, GPIO2_31, GPIO, MAC1, ____, ____, ____, ____, 0), 314 + TH1520_PAD(32, GPIO3_0, GPIO, MAC1, ____, ____, ____, ____, 0), 315 + TH1520_PAD(33, GPIO3_1, GPIO, MAC1, ____, ____, ____, ____, 0), 316 + TH1520_PAD(34, GPIO3_2, GPIO, PWM, ____, ____, ____, ____, 0), 317 + TH1520_PAD(35, GPIO3_3, GPIO, PWM, ____, ____, ____, ____, 0), 318 + TH1520_PAD(36, HDMI_SCL, HDMI, PWM, ____, GPIO, ____, ____, 0), 319 + TH1520_PAD(37, HDMI_SDA, HDMI, PWM, ____, GPIO, ____, ____, 0), 320 + TH1520_PAD(38, HDMI_CEC, HDMI, ____, ____, GPIO, ____, ____, 0), 321 + TH1520_PAD(39, GMAC0_TX_CLK, MAC0, ____, ____, GPIO, ____, ____, 0), 322 + TH1520_PAD(40, GMAC0_RX_CLK, MAC0, ____, ____, GPIO, ____, ____, 0), 323 + TH1520_PAD(41, GMAC0_TXEN, MAC0, UART, ____, GPIO, ____, ____, 0), 324 + TH1520_PAD(42, GMAC0_TXD0, MAC0, UART, ____, GPIO, ____, ____, 0), 325 + TH1520_PAD(43, GMAC0_TXD1, MAC0, UART, ____, GPIO, ____, ____, 0), 326 + TH1520_PAD(44, GMAC0_TXD2, MAC0, UART, ____, GPIO, ____, ____, 0), 327 + TH1520_PAD(45, GMAC0_TXD3, MAC0, I2C, ____, GPIO, ____, ____, 0), 328 + TH1520_PAD(46, GMAC0_RXDV, MAC0, I2C, ____, GPIO, ____, ____, 0), 329 + TH1520_PAD(47, GMAC0_RXD0, MAC0, I2C, ____, GPIO, ____, ____, 0), 330 + TH1520_PAD(48, GMAC0_RXD1, MAC0, I2C, ____, GPIO, ____, ____, 0), 331 + TH1520_PAD(49, GMAC0_RXD2, MAC0, SPI, ____, GPIO, ____, ____, 0), 332 + TH1520_PAD(50, GMAC0_RXD3, MAC0, SPI, ____, GPIO, ____, ____, 0), 333 + TH1520_PAD(51, GMAC0_MDC, MAC0, SPI, MAC1, GPIO, ____, ____, 0), 334 + TH1520_PAD(52, GMAC0_MDIO, MAC0, SPI, MAC1, GPIO, ____, ____, 0), 335 + TH1520_PAD(53, GMAC0_COL, MAC0, PWM, ____, GPIO, ____, ____, 0), 336 + TH1520_PAD(54, GMAC0_CRS, MAC0, PWM, ____, GPIO, ____, ____, 0), 337 + }; 338 + 339 + static const struct th1520_pad_group th1520_group1 = { 340 + .name = "th1520-group1", 341 + .pins = th1520_group1_pins, 342 + .npins = ARRAY_SIZE(th1520_group1_pins), 343 + }; 344 + 345 + static const struct th1520_pad_group th1520_group2 = { 346 + .name = "th1520-group2", 347 + .pins = th1520_group2_pins, 348 + .npins = ARRAY_SIZE(th1520_group2_pins), 349 + }; 350 + 351 + static const struct th1520_pad_group th1520_group3 = { 352 + .name = "th1520-group3", 353 + .pins = th1520_group3_pins, 354 + .npins = ARRAY_SIZE(th1520_group3_pins), 355 + }; 356 + 357 + static int th1520_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) 358 + { 359 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 360 + 361 + return thp->desc.npins; 362 + } 363 + 364 + static const char *th1520_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 365 + unsigned int gsel) 366 + { 367 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 368 + 369 + return thp->desc.pins[gsel].name; 370 + } 371 + 372 + static int th1520_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 373 + unsigned int gsel, 374 + const unsigned int **pins, 375 + unsigned int *npins) 376 + { 377 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 378 + 379 + *pins = &thp->desc.pins[gsel].number; 380 + *npins = 1; 381 + return 0; 382 + } 383 + 384 + #ifdef CONFIG_DEBUG_FS 385 + static void th1520_pin_dbg_show(struct pinctrl_dev *pctldev, 386 + struct seq_file *s, unsigned int pin) 387 + { 388 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 389 + void __iomem *padcfg = th1520_padcfg(thp, pin); 390 + void __iomem *muxcfg = th1520_muxcfg(thp, pin); 391 + u32 pad; 392 + u32 mux; 393 + 394 + scoped_guard(raw_spinlock_irqsave, &thp->lock) { 395 + pad = readl_relaxed(padcfg); 396 + mux = readl_relaxed(muxcfg); 397 + } 398 + 399 + seq_printf(s, "[PADCFG_%03u:0x%x=0x%07x MUXCFG_%03u:0x%x=0x%08x]", 400 + 1 + pin / 2, 0x000 + 4 * (pin / 2), pad, 401 + 1 + pin / 8, 0x400 + 4 * (pin / 8), mux); 402 + } 403 + #else 404 + #define th1520_pin_dbg_show NULL 405 + #endif 406 + 407 + static void th1520_pinctrl_dt_free_map(struct pinctrl_dev *pctldev, 408 + struct pinctrl_map *map, unsigned int nmaps) 409 + { 410 + unsigned long *seen = NULL; 411 + unsigned int i; 412 + 413 + for (i = 0; i < nmaps; i++) { 414 + if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN && 415 + map[i].data.configs.configs != seen) { 416 + seen = map[i].data.configs.configs; 417 + kfree(seen); 418 + } 419 + } 420 + 421 + kfree(map); 422 + } 423 + 424 + static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, 425 + struct device_node *np, 426 + struct pinctrl_map **maps, 427 + unsigned int *num_maps) 428 + { 429 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 430 + struct pinctrl_map *map; 431 + unsigned long *configs; 432 + unsigned int nconfigs; 433 + unsigned int nmaps; 434 + int ret; 435 + 436 + nmaps = 0; 437 + for_each_available_child_of_node_scoped(np, child) { 438 + int npins = of_property_count_strings(child, "pins"); 439 + 440 + if (npins <= 0) { 441 + dev_err(thp->pctl->dev, "no pins selected for %pOFn.%pOFn\n", 442 + np, child); 443 + return -EINVAL; 444 + } 445 + nmaps += npins; 446 + if (of_property_present(child, "function")) 447 + nmaps += npins; 448 + } 449 + 450 + map = kcalloc(nmaps, sizeof(*map), GFP_KERNEL); 451 + if (!map) 452 + return -ENOMEM; 453 + 454 + nmaps = 0; 455 + guard(mutex)(&thp->mutex); 456 + for_each_available_child_of_node_scoped(np, child) { 457 + unsigned int rollback = nmaps; 458 + enum th1520_muxtype muxtype; 459 + struct property *prop; 460 + const char *funcname; 461 + const char **pgnames; 462 + const char *pinname; 463 + int npins; 464 + 465 + ret = pinconf_generic_parse_dt_config(child, pctldev, &configs, &nconfigs); 466 + if (ret) { 467 + dev_err(thp->pctl->dev, "%pOFn.%pOFn: error parsing pin config\n", 468 + np, child); 469 + goto free_map; 470 + } 471 + 472 + if (!of_property_read_string(child, "function", &funcname)) { 473 + muxtype = th1520_muxtype_get(funcname); 474 + if (!muxtype) { 475 + dev_err(thp->pctl->dev, "%pOFn.%pOFn: unknown function '%s'\n", 476 + np, child, funcname); 477 + ret = -EINVAL; 478 + goto free_configs; 479 + } 480 + 481 + funcname = devm_kasprintf(thp->pctl->dev, GFP_KERNEL, "%pOFn.%pOFn", 482 + np, child); 483 + if (!funcname) { 484 + ret = -ENOMEM; 485 + goto free_configs; 486 + } 487 + 488 + npins = of_property_count_strings(child, "pins"); 489 + pgnames = devm_kcalloc(thp->pctl->dev, npins, sizeof(*pgnames), GFP_KERNEL); 490 + if (!pgnames) { 491 + ret = -ENOMEM; 492 + goto free_configs; 493 + } 494 + } else { 495 + funcname = NULL; 496 + } 497 + 498 + npins = 0; 499 + of_property_for_each_string(child, "pins", prop, pinname) { 500 + unsigned int i; 501 + 502 + for (i = 0; i < thp->desc.npins; i++) { 503 + if (!strcmp(pinname, thp->desc.pins[i].name)) 504 + break; 505 + } 506 + if (i == thp->desc.npins) { 507 + nmaps = rollback; 508 + dev_err(thp->pctl->dev, "%pOFn.%pOFn: unknown pin '%s'\n", 509 + np, child, pinname); 510 + ret = -EINVAL; 511 + goto free_configs; 512 + } 513 + 514 + if (nconfigs) { 515 + map[nmaps].type = PIN_MAP_TYPE_CONFIGS_PIN; 516 + map[nmaps].data.configs.group_or_pin = thp->desc.pins[i].name; 517 + map[nmaps].data.configs.configs = configs; 518 + map[nmaps].data.configs.num_configs = nconfigs; 519 + nmaps += 1; 520 + } 521 + if (funcname) { 522 + pgnames[npins++] = thp->desc.pins[i].name; 523 + map[nmaps].type = PIN_MAP_TYPE_MUX_GROUP; 524 + map[nmaps].data.mux.function = funcname; 525 + map[nmaps].data.mux.group = thp->desc.pins[i].name; 526 + nmaps += 1; 527 + } 528 + } 529 + 530 + if (funcname) { 531 + ret = pinmux_generic_add_function(pctldev, funcname, pgnames, 532 + npins, (void *)muxtype); 533 + if (ret < 0) { 534 + dev_err(thp->pctl->dev, "error adding function %s\n", funcname); 535 + goto free_map; 536 + } 537 + } 538 + } 539 + 540 + *maps = map; 541 + *num_maps = nmaps; 542 + return 0; 543 + 544 + free_configs: 545 + kfree(configs); 546 + free_map: 547 + th1520_pinctrl_dt_free_map(pctldev, map, nmaps); 548 + return ret; 549 + } 550 + 551 + static const struct pinctrl_ops th1520_pinctrl_ops = { 552 + .get_groups_count = th1520_pinctrl_get_groups_count, 553 + .get_group_name = th1520_pinctrl_get_group_name, 554 + .get_group_pins = th1520_pinctrl_get_group_pins, 555 + .pin_dbg_show = th1520_pin_dbg_show, 556 + .dt_node_to_map = th1520_pinctrl_dt_node_to_map, 557 + .dt_free_map = th1520_pinctrl_dt_free_map, 558 + }; 559 + 560 + static const u8 th1520_drive_strength_in_ma[16] = { 561 + 1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 25, 562 + }; 563 + 564 + static u16 th1520_drive_strength_from_ma(u32 arg) 565 + { 566 + u16 ds; 567 + 568 + for (ds = 0; ds < TH1520_PADCFG_DS; ds++) { 569 + if (arg <= th1520_drive_strength_in_ma[ds]) 570 + return ds; 571 + } 572 + return TH1520_PADCFG_DS; 573 + } 574 + 575 + static int th1520_padcfg_rmw(struct th1520_pinctrl *thp, unsigned int pin, 576 + u32 mask, u32 value) 577 + { 578 + void __iomem *padcfg = th1520_padcfg(thp, pin); 579 + unsigned int shift = th1520_padcfg_shift(pin); 580 + u32 tmp; 581 + 582 + mask <<= shift; 583 + value <<= shift; 584 + 585 + scoped_guard(raw_spinlock_irqsave, &thp->lock) { 586 + tmp = readl_relaxed(padcfg); 587 + tmp = (tmp & ~mask) | value; 588 + writel_relaxed(tmp, padcfg); 589 + } 590 + return 0; 591 + } 592 + 593 + static int th1520_pinconf_get(struct pinctrl_dev *pctldev, 594 + unsigned int pin, unsigned long *config) 595 + { 596 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 597 + const struct pin_desc *desc = pin_desc_get(pctldev, pin); 598 + bool enabled; 599 + int param; 600 + u32 value; 601 + u32 arg; 602 + 603 + if (th1520_pad_no_padcfg(desc->drv_data)) 604 + return -ENOTSUPP; 605 + 606 + value = readl_relaxed(th1520_padcfg(thp, pin)); 607 + value = (value >> th1520_padcfg_shift(pin)) & GENMASK(9, 0); 608 + 609 + param = pinconf_to_config_param(*config); 610 + switch (param) { 611 + case PIN_CONFIG_BIAS_DISABLE: 612 + enabled = !(value & (TH1520_PADCFG_SPU | TH1520_PADCFG_PE)); 613 + arg = 0; 614 + break; 615 + case PIN_CONFIG_BIAS_PULL_DOWN: 616 + enabled = (value & TH1520_PADCFG_BIAS) == TH1520_PADCFG_PE; 617 + arg = enabled ? TH1520_PULL_DOWN_OHM : 0; 618 + break; 619 + case PIN_CONFIG_BIAS_PULL_UP: 620 + if (value & TH1520_PADCFG_SPU) { 621 + enabled = true; 622 + arg = TH1520_PULL_STRONG_OHM; 623 + } else if ((value & (TH1520_PADCFG_PE | TH1520_PADCFG_PS)) == 624 + (TH1520_PADCFG_PE | TH1520_PADCFG_PS)) { 625 + enabled = true; 626 + arg = TH1520_PULL_UP_OHM; 627 + } else { 628 + enabled = false; 629 + arg = 0; 630 + } 631 + break; 632 + case PIN_CONFIG_DRIVE_STRENGTH: 633 + enabled = true; 634 + arg = th1520_drive_strength_in_ma[value & TH1520_PADCFG_DS]; 635 + break; 636 + case PIN_CONFIG_INPUT_ENABLE: 637 + enabled = value & TH1520_PADCFG_IE; 638 + arg = enabled ? 1 : 0; 639 + break; 640 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 641 + enabled = value & TH1520_PADCFG_ST; 642 + arg = enabled ? 1 : 0; 643 + break; 644 + case PIN_CONFIG_SLEW_RATE: 645 + enabled = value & TH1520_PADCFG_SL; 646 + arg = enabled ? 1 : 0; 647 + break; 648 + default: 649 + return -ENOTSUPP; 650 + } 651 + 652 + *config = pinconf_to_config_packed(param, arg); 653 + return enabled ? 0 : -EINVAL; 654 + } 655 + 656 + static int th1520_pinconf_group_get(struct pinctrl_dev *pctldev, 657 + unsigned int gsel, unsigned long *config) 658 + { 659 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 660 + unsigned int pin = thp->desc.pins[gsel].number; 661 + 662 + return th1520_pinconf_get(pctldev, pin, config); 663 + } 664 + 665 + static int th1520_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, 666 + unsigned long *configs, unsigned int num_configs) 667 + { 668 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 669 + const struct pin_desc *desc = pin_desc_get(pctldev, pin); 670 + unsigned int i; 671 + u16 mask, value; 672 + 673 + if (th1520_pad_no_padcfg(desc->drv_data)) 674 + return -ENOTSUPP; 675 + 676 + mask = 0; 677 + value = 0; 678 + for (i = 0; i < num_configs; i++) { 679 + int param = pinconf_to_config_param(configs[i]); 680 + u32 arg = pinconf_to_config_argument(configs[i]); 681 + 682 + switch (param) { 683 + case PIN_CONFIG_BIAS_DISABLE: 684 + mask |= TH1520_PADCFG_BIAS; 685 + value &= ~TH1520_PADCFG_BIAS; 686 + break; 687 + case PIN_CONFIG_BIAS_PULL_DOWN: 688 + if (arg == 0) 689 + return -ENOTSUPP; 690 + mask |= TH1520_PADCFG_BIAS; 691 + value &= ~TH1520_PADCFG_BIAS; 692 + value |= TH1520_PADCFG_PE; 693 + break; 694 + case PIN_CONFIG_BIAS_PULL_UP: 695 + if (arg == 0) 696 + return -ENOTSUPP; 697 + mask |= TH1520_PADCFG_BIAS; 698 + value &= ~TH1520_PADCFG_BIAS; 699 + if (arg == TH1520_PULL_STRONG_OHM) 700 + value |= TH1520_PADCFG_SPU; 701 + else 702 + value |= TH1520_PADCFG_PE | TH1520_PADCFG_PS; 703 + break; 704 + case PIN_CONFIG_DRIVE_STRENGTH: 705 + mask |= TH1520_PADCFG_DS; 706 + value &= ~TH1520_PADCFG_DS; 707 + value |= th1520_drive_strength_from_ma(arg); 708 + break; 709 + case PIN_CONFIG_INPUT_ENABLE: 710 + mask |= TH1520_PADCFG_IE; 711 + if (arg) 712 + value |= TH1520_PADCFG_IE; 713 + else 714 + value &= ~TH1520_PADCFG_IE; 715 + break; 716 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 717 + mask |= TH1520_PADCFG_ST; 718 + if (arg) 719 + value |= TH1520_PADCFG_ST; 720 + else 721 + value &= ~TH1520_PADCFG_ST; 722 + break; 723 + case PIN_CONFIG_SLEW_RATE: 724 + mask |= TH1520_PADCFG_SL; 725 + if (arg) 726 + value |= TH1520_PADCFG_SL; 727 + else 728 + value &= ~TH1520_PADCFG_SL; 729 + break; 730 + default: 731 + return -ENOTSUPP; 732 + } 733 + } 734 + 735 + return th1520_padcfg_rmw(thp, pin, mask, value); 736 + } 737 + 738 + static int th1520_pinconf_group_set(struct pinctrl_dev *pctldev, 739 + unsigned int gsel, 740 + unsigned long *configs, 741 + unsigned int num_configs) 742 + { 743 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 744 + unsigned int pin = thp->desc.pins[gsel].number; 745 + 746 + return th1520_pinconf_set(pctldev, pin, configs, num_configs); 747 + } 748 + 749 + #ifdef CONFIG_DEBUG_FS 750 + static void th1520_pinconf_dbg_show(struct pinctrl_dev *pctldev, 751 + struct seq_file *s, unsigned int pin) 752 + { 753 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 754 + u32 value = readl_relaxed(th1520_padcfg(thp, pin)); 755 + 756 + value = (value >> th1520_padcfg_shift(pin)) & GENMASK(9, 0); 757 + 758 + seq_printf(s, " [0x%03x]", value); 759 + } 760 + #else 761 + #define th1520_pinconf_dbg_show NULL 762 + #endif 763 + 764 + static const struct pinconf_ops th1520_pinconf_ops = { 765 + .pin_config_get = th1520_pinconf_get, 766 + .pin_config_group_get = th1520_pinconf_group_get, 767 + .pin_config_set = th1520_pinconf_set, 768 + .pin_config_group_set = th1520_pinconf_group_set, 769 + .pin_config_dbg_show = th1520_pinconf_dbg_show, 770 + .is_generic = true, 771 + }; 772 + 773 + static int th1520_pinmux_set(struct th1520_pinctrl *thp, unsigned int pin, 774 + unsigned long muxdata, enum th1520_muxtype muxtype) 775 + { 776 + void __iomem *muxcfg = th1520_muxcfg(thp, pin); 777 + unsigned int shift = th1520_muxcfg_shift(pin); 778 + u32 mask, value, tmp; 779 + 780 + for (value = 0; muxdata; muxdata >>= 5, value++) { 781 + if ((muxdata & GENMASK(4, 0)) == muxtype) 782 + break; 783 + } 784 + if (!muxdata) { 785 + dev_err(thp->pctl->dev, "invalid mux %s for pin %s\n", 786 + th1520_muxtype_string[muxtype], pin_get_name(thp->pctl, pin)); 787 + return -EINVAL; 788 + } 789 + 790 + mask = GENMASK(3, 0) << shift; 791 + value = value << shift; 792 + 793 + scoped_guard(raw_spinlock_irqsave, &thp->lock) { 794 + tmp = readl_relaxed(muxcfg); 795 + tmp = (tmp & ~mask) | value; 796 + writel_relaxed(tmp, muxcfg); 797 + } 798 + return 0; 799 + } 800 + 801 + static int th1520_pinmux_set_mux(struct pinctrl_dev *pctldev, 802 + unsigned int fsel, unsigned int gsel) 803 + { 804 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 805 + const struct function_desc *func = pinmux_generic_get_function(pctldev, fsel); 806 + enum th1520_muxtype muxtype; 807 + 808 + if (!func) 809 + return -EINVAL; 810 + 811 + muxtype = (uintptr_t)func->data; 812 + return th1520_pinmux_set(thp, thp->desc.pins[gsel].number, 813 + th1520_pad_muxdata(thp->desc.pins[gsel].drv_data), 814 + muxtype); 815 + } 816 + 817 + static int th1520_gpio_request_enable(struct pinctrl_dev *pctldev, 818 + struct pinctrl_gpio_range *range, 819 + unsigned int offset) 820 + { 821 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 822 + const struct pin_desc *desc = pin_desc_get(pctldev, offset); 823 + 824 + return th1520_pinmux_set(thp, offset, 825 + th1520_pad_muxdata(desc->drv_data), 826 + TH1520_MUX_GPIO); 827 + } 828 + 829 + static int th1520_gpio_set_direction(struct pinctrl_dev *pctldev, 830 + struct pinctrl_gpio_range *range, 831 + unsigned int offset, bool input) 832 + { 833 + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev); 834 + 835 + return th1520_padcfg_rmw(thp, offset, TH1520_PADCFG_IE, 836 + input ? TH1520_PADCFG_IE : 0); 837 + } 838 + 839 + static const struct pinmux_ops th1520_pinmux_ops = { 840 + .get_functions_count = pinmux_generic_get_function_count, 841 + .get_function_name = pinmux_generic_get_function_name, 842 + .get_function_groups = pinmux_generic_get_function_groups, 843 + .set_mux = th1520_pinmux_set_mux, 844 + .gpio_request_enable = th1520_gpio_request_enable, 845 + .gpio_set_direction = th1520_gpio_set_direction, 846 + .strict = true, 847 + }; 848 + 849 + static int th1520_pinctrl_probe(struct platform_device *pdev) 850 + { 851 + struct device *dev = &pdev->dev; 852 + const struct th1520_pad_group *group; 853 + struct device_node *np = dev->of_node; 854 + struct th1520_pinctrl *thp; 855 + struct clk *clk; 856 + u32 pin_group; 857 + int ret; 858 + 859 + thp = devm_kzalloc(dev, sizeof(*thp), GFP_KERNEL); 860 + if (!thp) 861 + return -ENOMEM; 862 + 863 + thp->base = devm_platform_ioremap_resource(pdev, 0); 864 + if (IS_ERR(thp->base)) 865 + return PTR_ERR(thp->base); 866 + 867 + clk = devm_clk_get_enabled(dev, NULL); 868 + if (IS_ERR(clk)) 869 + return dev_err_probe(dev, PTR_ERR(clk), "error getting clock\n"); 870 + 871 + ret = of_property_read_u32(np, "thead,pad-group", &pin_group); 872 + if (ret) 873 + return dev_err_probe(dev, ret, "failed to read the thead,pad-group property\n"); 874 + 875 + if (pin_group == 1) 876 + group = &th1520_group1; 877 + else if (pin_group == 2) 878 + group = &th1520_group2; 879 + else if (pin_group == 3) 880 + group = &th1520_group3; 881 + else 882 + return dev_err_probe(dev, -EINVAL, "unit address did not match any pad group\n"); 883 + 884 + thp->desc.name = group->name; 885 + thp->desc.pins = group->pins; 886 + thp->desc.npins = group->npins; 887 + thp->desc.pctlops = &th1520_pinctrl_ops; 888 + thp->desc.pmxops = &th1520_pinmux_ops; 889 + thp->desc.confops = &th1520_pinconf_ops; 890 + thp->desc.owner = THIS_MODULE; 891 + mutex_init(&thp->mutex); 892 + raw_spin_lock_init(&thp->lock); 893 + 894 + ret = devm_pinctrl_register_and_init(dev, &thp->desc, thp, &thp->pctl); 895 + if (ret) 896 + return dev_err_probe(dev, ret, "could not register pinctrl driver\n"); 897 + 898 + return pinctrl_enable(thp->pctl); 899 + } 900 + 901 + static const struct of_device_id th1520_pinctrl_of_match[] = { 902 + { .compatible = "thead,th1520-pinctrl"}, 903 + { /* sentinel */ } 904 + }; 905 + MODULE_DEVICE_TABLE(of, th1520_pinctrl_of_match); 906 + 907 + static struct platform_driver th1520_pinctrl_driver = { 908 + .probe = th1520_pinctrl_probe, 909 + .driver = { 910 + .name = "pinctrl-th1520", 911 + .of_match_table = th1520_pinctrl_of_match, 912 + }, 913 + }; 914 + module_platform_driver(th1520_pinctrl_driver); 915 + 916 + MODULE_DESCRIPTION("Pinctrl driver for the T-Head TH1520 SoC"); 917 + MODULE_AUTHOR("Emil Renner Berthing <emil.renner.berthing@canonical.com>"); 918 + MODULE_LICENSE("GPL");
+1 -1
drivers/pinctrl/pinctrl-xway.c
··· 1524 1524 * files which don't set the "gpio-ranges" property or systems that 1525 1525 * utilize ACPI the driver has to call gpiochip_add_pin_range(). 1526 1526 */ 1527 - if (!of_property_read_bool(pdev->dev.of_node, "gpio-ranges")) { 1527 + if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) { 1528 1528 /* finish with registering the gpio range in pinctrl */ 1529 1529 xway_gpio_range.npins = xway_chip.ngpio; 1530 1530 xway_gpio_range.base = xway_chip.base;
+92 -6
drivers/pinctrl/pinctrl-zynqmp.c
··· 10 10 11 11 #include <dt-bindings/pinctrl/pinctrl-zynqmp.h> 12 12 13 + #include <linux/bitfield.h> 13 14 #include <linux/bitmap.h> 14 15 #include <linux/init.h> 15 16 #include <linux/module.h> ··· 45 44 #define DRIVE_STRENGTH_8MA 8 46 45 #define DRIVE_STRENGTH_12MA 12 47 46 47 + #define VERSAL_LPD_PIN_PREFIX "LPD_MIO" 48 + #define VERSAL_PMC_PIN_PREFIX "PMC_MIO" 49 + 50 + #define VERSAL_PINCTRL_ATTR_NODETYPE_MASK GENMASK(19, 14) 51 + #define VERSAL_PINCTRL_NODETYPE_LPD_MIO BIT(0) 52 + 48 53 /** 49 54 * struct zynqmp_pmux_function - a pinmux function 50 55 * @name: Name of the pin mux function 51 56 * @groups: List of pin groups for this function 52 57 * @ngroups: Number of entries in @groups 53 - * @node: Firmware node matching with the function 54 58 * 55 59 * This structure holds information about pin control function 56 60 * and function group names supporting that function. ··· 99 93 }; 100 94 101 95 static struct pinctrl_desc zynqmp_desc; 96 + static u32 family_code; 97 + static u32 sub_family_code; 102 98 103 99 static int zynqmp_pctrl_get_groups_count(struct pinctrl_dev *pctldev) 104 100 { ··· 604 596 if (!groups[resp[i]].name) 605 597 return -ENOMEM; 606 598 607 - for (pin = 0; pin < groups[resp[i]].npins; pin++) 608 - __set_bit(groups[resp[i]].pins[pin], used_pins); 599 + for (pin = 0; pin < groups[resp[i]].npins; pin++) { 600 + if (family_code == ZYNQMP_FAMILY_CODE) 601 + __set_bit(groups[resp[i]].pins[pin], used_pins); 602 + else 603 + __set_bit((u8)groups[resp[i]].pins[pin] - 1, used_pins); 604 + } 609 605 } 610 606 } 611 607 done: ··· 885 873 return 0; 886 874 } 887 875 876 + static int versal_pinctrl_get_attributes(u32 pin_idx, u32 *response) 877 + { 878 + struct zynqmp_pm_query_data qdata = {0}; 879 + u32 payload[PAYLOAD_ARG_CNT]; 880 + int ret; 881 + 882 + qdata.qid = PM_QID_PINCTRL_GET_ATTRIBUTES; 883 + qdata.arg1 = pin_idx; 884 + 885 + ret = zynqmp_pm_query_data(qdata, payload); 886 + if (ret) 887 + return ret; 888 + 889 + memcpy(response, &payload[1], sizeof(*response)); 890 + 891 + return 0; 892 + } 893 + 894 + static int versal_pinctrl_prepare_pin_desc(struct device *dev, 895 + const struct pinctrl_pin_desc **zynqmp_pins, 896 + unsigned int *npins) 897 + { 898 + u32 lpd_mio_pins = 0, attr, nodetype; 899 + struct pinctrl_pin_desc *pins, *pin; 900 + int ret, i; 901 + 902 + ret = zynqmp_pm_is_function_supported(PM_QUERY_DATA, PM_QID_PINCTRL_GET_ATTRIBUTES); 903 + if (ret) 904 + return ret; 905 + 906 + ret = zynqmp_pinctrl_get_num_pins(npins); 907 + if (ret) 908 + return ret; 909 + 910 + pins = devm_kzalloc(dev, sizeof(*pins) * *npins, GFP_KERNEL); 911 + if (!pins) 912 + return -ENOMEM; 913 + 914 + for (i = 0; i < *npins; i++) { 915 + ret = versal_pinctrl_get_attributes(i, &attr); 916 + if (ret) 917 + return ret; 918 + 919 + pin = &pins[i]; 920 + pin->number = attr; 921 + nodetype = FIELD_GET(VERSAL_PINCTRL_ATTR_NODETYPE_MASK, attr); 922 + if (nodetype == VERSAL_PINCTRL_NODETYPE_LPD_MIO) { 923 + pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", 924 + VERSAL_LPD_PIN_PREFIX, i); 925 + lpd_mio_pins++; 926 + } else { 927 + pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", 928 + VERSAL_PMC_PIN_PREFIX, i - lpd_mio_pins); 929 + } 930 + 931 + if (!pin->name) 932 + return -ENOMEM; 933 + } 934 + 935 + *zynqmp_pins = pins; 936 + 937 + return 0; 938 + } 939 + 888 940 static int zynqmp_pinctrl_probe(struct platform_device *pdev) 889 941 { 890 942 struct zynqmp_pinctrl *pctrl; ··· 958 882 if (!pctrl) 959 883 return -ENOMEM; 960 884 961 - ret = zynqmp_pinctrl_prepare_pin_desc(&pdev->dev, 962 - &zynqmp_desc.pins, 963 - &zynqmp_desc.npins); 885 + ret = zynqmp_pm_get_family_info(&family_code, &sub_family_code); 886 + if (ret < 0) 887 + return ret; 888 + 889 + if (family_code == ZYNQMP_FAMILY_CODE) { 890 + ret = zynqmp_pinctrl_prepare_pin_desc(&pdev->dev, &zynqmp_desc.pins, 891 + &zynqmp_desc.npins); 892 + } else { 893 + ret = versal_pinctrl_prepare_pin_desc(&pdev->dev, &zynqmp_desc.pins, 894 + &zynqmp_desc.npins); 895 + } 896 + 964 897 if (ret) { 965 898 dev_err(&pdev->dev, "pin desc prepare fail with %d\n", ret); 966 899 return ret; ··· 992 907 993 908 static const struct of_device_id zynqmp_pinctrl_of_match[] = { 994 909 { .compatible = "xlnx,zynqmp-pinctrl" }, 910 + { .compatible = "xlnx,versal-pinctrl" }, 995 911 { } 996 912 }; 997 913 MODULE_DEVICE_TABLE(of, zynqmp_pinctrl_of_match);
+96 -77
drivers/pinctrl/pinmux.c
··· 14 14 15 15 #include <linux/array_size.h> 16 16 #include <linux/ctype.h> 17 + #include <linux/cleanup.h> 17 18 #include <linux/debugfs.h> 18 19 #include <linux/device.h> 19 20 #include <linux/err.h> ··· 94 93 if (!desc || !ops) 95 94 return true; 96 95 96 + guard(mutex)(&desc->mux_lock); 97 97 if (ops->strict && desc->mux_usecount) 98 98 return false; 99 99 ··· 129 127 dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n", 130 128 pin, desc->name, owner); 131 129 132 - if ((!gpio_range || ops->strict) && 133 - desc->mux_usecount && strcmp(desc->mux_owner, owner)) { 134 - dev_err(pctldev->dev, 135 - "pin %s already requested by %s; cannot claim for %s\n", 136 - desc->name, desc->mux_owner, owner); 137 - goto out; 138 - } 130 + scoped_guard(mutex, &desc->mux_lock) { 131 + if ((!gpio_range || ops->strict) && 132 + desc->mux_usecount && strcmp(desc->mux_owner, owner)) { 133 + dev_err(pctldev->dev, 134 + "pin %s already requested by %s; cannot claim for %s\n", 135 + desc->name, desc->mux_owner, owner); 136 + goto out; 137 + } 139 138 140 - if ((gpio_range || ops->strict) && desc->gpio_owner) { 141 - dev_err(pctldev->dev, 142 - "pin %s already requested by %s; cannot claim for %s\n", 143 - desc->name, desc->gpio_owner, owner); 144 - goto out; 145 - } 139 + if ((gpio_range || ops->strict) && desc->gpio_owner) { 140 + dev_err(pctldev->dev, 141 + "pin %s already requested by %s; cannot claim for %s\n", 142 + desc->name, desc->gpio_owner, owner); 143 + goto out; 144 + } 146 145 147 - if (gpio_range) { 148 - desc->gpio_owner = owner; 149 - } else { 150 - desc->mux_usecount++; 151 - if (desc->mux_usecount > 1) 152 - return 0; 146 + if (gpio_range) { 147 + desc->gpio_owner = owner; 148 + } else { 149 + desc->mux_usecount++; 150 + if (desc->mux_usecount > 1) 151 + return 0; 153 152 154 - desc->mux_owner = owner; 153 + desc->mux_owner = owner; 154 + } 155 155 } 156 156 157 157 /* Let each pin increase references to this module */ ··· 182 178 183 179 out_free_pin: 184 180 if (status) { 185 - if (gpio_range) { 186 - desc->gpio_owner = NULL; 187 - } else { 188 - desc->mux_usecount--; 189 - if (!desc->mux_usecount) 190 - desc->mux_owner = NULL; 181 + scoped_guard(mutex, &desc->mux_lock) { 182 + if (gpio_range) { 183 + desc->gpio_owner = NULL; 184 + } else { 185 + desc->mux_usecount--; 186 + if (!desc->mux_usecount) 187 + desc->mux_owner = NULL; 188 + } 191 189 } 192 190 } 193 191 out: ··· 225 219 return NULL; 226 220 } 227 221 228 - if (!gpio_range) { 229 - /* 230 - * A pin should not be freed more times than allocated. 231 - */ 232 - if (WARN_ON(!desc->mux_usecount)) 233 - return NULL; 234 - desc->mux_usecount--; 235 - if (desc->mux_usecount) 236 - return NULL; 222 + scoped_guard(mutex, &desc->mux_lock) { 223 + if (!gpio_range) { 224 + /* 225 + * A pin should not be freed more times than allocated. 226 + */ 227 + if (WARN_ON(!desc->mux_usecount)) 228 + return NULL; 229 + desc->mux_usecount--; 230 + if (desc->mux_usecount) 231 + return NULL; 232 + } 237 233 } 238 234 239 235 /* ··· 247 239 else if (ops->free) 248 240 ops->free(pctldev, pin); 249 241 250 - if (gpio_range) { 251 - owner = desc->gpio_owner; 252 - desc->gpio_owner = NULL; 253 - } else { 254 - owner = desc->mux_owner; 255 - desc->mux_owner = NULL; 256 - desc->mux_setting = NULL; 242 + scoped_guard(mutex, &desc->mux_lock) { 243 + if (gpio_range) { 244 + owner = desc->gpio_owner; 245 + desc->gpio_owner = NULL; 246 + } else { 247 + owner = desc->mux_owner; 248 + desc->mux_owner = NULL; 249 + desc->mux_setting = NULL; 250 + } 257 251 } 258 252 259 253 module_put(pctldev->owner); ··· 468 458 pins[i]); 469 459 continue; 470 460 } 471 - desc->mux_setting = &(setting->data.mux); 461 + scoped_guard(mutex, &desc->mux_lock) 462 + desc->mux_setting = &(setting->data.mux); 472 463 } 473 464 474 465 ret = ops->set_mux(pctldev, setting->data.mux.func, ··· 483 472 err_set_mux: 484 473 for (i = 0; i < num_pins; i++) { 485 474 desc = pin_desc_get(pctldev, pins[i]); 486 - if (desc) 487 - desc->mux_setting = NULL; 475 + if (desc) { 476 + scoped_guard(mutex, &desc->mux_lock) 477 + desc->mux_setting = NULL; 478 + } 488 479 } 489 480 err_pin_request: 490 481 /* On error release all taken pins */ ··· 505 492 unsigned int num_pins = 0; 506 493 int i; 507 494 struct pin_desc *desc; 495 + bool is_equal; 508 496 509 497 if (pctlops->get_group_pins) 510 498 ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, ··· 531 517 pins[i]); 532 518 continue; 533 519 } 534 - if (desc->mux_setting == &(setting->data.mux)) { 520 + scoped_guard(mutex, &desc->mux_lock) 521 + is_equal = (desc->mux_setting == &(setting->data.mux)); 522 + 523 + if (is_equal) { 535 524 pin_free(pctldev, pins[i], NULL); 536 525 } else { 537 526 const char *gname; ··· 625 608 if (desc == NULL) 626 609 continue; 627 610 628 - if (desc->mux_owner && 629 - !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) 630 - is_hog = true; 611 + scoped_guard(mutex, &desc->mux_lock) { 612 + if (desc->mux_owner && 613 + !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) 614 + is_hog = true; 631 615 632 - if (pmxops->strict) { 633 - if (desc->mux_owner) 634 - seq_printf(s, "pin %d (%s): device %s%s", 635 - pin, desc->name, desc->mux_owner, 616 + if (pmxops->strict) { 617 + if (desc->mux_owner) 618 + seq_printf(s, "pin %d (%s): device %s%s", 619 + pin, desc->name, desc->mux_owner, 620 + is_hog ? " (HOG)" : ""); 621 + else if (desc->gpio_owner) 622 + seq_printf(s, "pin %d (%s): GPIO %s", 623 + pin, desc->name, desc->gpio_owner); 624 + else 625 + seq_printf(s, "pin %d (%s): UNCLAIMED", 626 + pin, desc->name); 627 + } else { 628 + /* For non-strict controllers */ 629 + seq_printf(s, "pin %d (%s): %s %s%s", pin, desc->name, 630 + desc->mux_owner ? desc->mux_owner 631 + : "(MUX UNCLAIMED)", 632 + desc->gpio_owner ? desc->gpio_owner 633 + : "(GPIO UNCLAIMED)", 636 634 is_hog ? " (HOG)" : ""); 637 - else if (desc->gpio_owner) 638 - seq_printf(s, "pin %d (%s): GPIO %s", 639 - pin, desc->name, desc->gpio_owner); 640 - else 641 - seq_printf(s, "pin %d (%s): UNCLAIMED", 642 - pin, desc->name); 643 - } else { 644 - /* For non-strict controllers */ 645 - seq_printf(s, "pin %d (%s): %s %s%s", pin, desc->name, 646 - desc->mux_owner ? desc->mux_owner 647 - : "(MUX UNCLAIMED)", 648 - desc->gpio_owner ? desc->gpio_owner 649 - : "(GPIO UNCLAIMED)", 650 - is_hog ? " (HOG)" : ""); 651 - } 635 + } 652 636 653 - /* If mux: print function+group claiming the pin */ 654 - if (desc->mux_setting) 655 - seq_printf(s, " function %s group %s\n", 656 - pmxops->get_function_name(pctldev, 657 - desc->mux_setting->func), 658 - pctlops->get_group_name(pctldev, 659 - desc->mux_setting->group)); 660 - else 661 - seq_putc(s, '\n'); 637 + /* If mux: print function+group claiming the pin */ 638 + if (desc->mux_setting) 639 + seq_printf(s, " function %s group %s\n", 640 + pmxops->get_function_name(pctldev, 641 + desc->mux_setting->func), 642 + pctlops->get_group_name(pctldev, 643 + desc->mux_setting->group)); 644 + else 645 + seq_putc(s, '\n'); 646 + } 662 647 } 663 648 664 649 mutex_unlock(&pctldev->mutex);
+39
drivers/pinctrl/qcom/Kconfig.msm
··· 46 46 Qualcomm Technologies Inc TLMM block found on the Qualcomm 47 47 Technologies Inc IPQ5332 platform. 48 48 49 + config PINCTRL_IPQ5424 50 + tristate "Qualcomm Technologies, Inc. IPQ5424 pin controller driver" 51 + depends on ARM64 || COMPILE_TEST 52 + help 53 + This is the pinctrl, pinmux, pinconf and gpiolib driver for 54 + the Qualcomm Technologies Inc. TLMM block found on the 55 + Qualcomm Technologies Inc. IPQ5424 platform. Select this for 56 + IPQ5424. 57 + 49 58 config PINCTRL_IPQ8074 50 59 tristate "Qualcomm Technologies, Inc. IPQ8074 pin controller driver" 51 60 depends on ARM64 || COMPILE_TEST ··· 191 182 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 192 183 TLMM block found in the Qualcomm QCS404 platform. 193 184 185 + config PINCTRL_QCS615 186 + tristate "Qualcomm Technologies QCS615 pin controller driver" 187 + depends on ARM64 || COMPILE_TEST 188 + help 189 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 190 + TLMM block found on the Qualcomm QCS615 platform. 191 + 192 + config PINCTRL_QCS8300 193 + tristate "Qualcomm Technologies QCS8300 pin controller driver" 194 + depends on ARM64 || COMPILE_TEST 195 + help 196 + This is the pinctrl, pinmux and pinconf driver for the Qualcomm 197 + TLMM block found on the Qualcomm QCS8300 platform. 198 + 194 199 config PINCTRL_QDF2XXX 195 200 tristate "Qualcomm Technologies QDF2xxx pin controller driver" 196 201 depends on ACPI ··· 226 203 help 227 204 This is the pinctrl, pinmux and pinconf driver for the Qualcomm 228 205 TLMM block found on the Qualcomm SA8775P platforms. 206 + 207 + config PINCTRL_SAR2130P 208 + tristate "Qualcomm Technologies Inc SAR2130P pin controller driver" 209 + depends on ARM64 || COMPILE_TEST 210 + help 211 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 212 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 213 + Technologies Inc SAR2130P platform. 229 214 230 215 config PINCTRL_SC7180 231 216 tristate "Qualcomm Technologies Inc SC7180 pin controller driver" ··· 412 381 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 413 382 Qualcomm Technologies Inc TLMM block found on the Qualcomm 414 383 Technologies Inc SM8650 platform. 384 + 385 + config PINCTRL_SM8750 386 + tristate "Qualcomm Technologies Inc SM8750 pin controller driver" 387 + depends on ARM64 || COMPILE_TEST 388 + help 389 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 390 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 391 + Technologies Inc SM8750 platform. 415 392 416 393 config PINCTRL_X1E80100 417 394 tristate "Qualcomm Technologies Inc X1E80100 pin controller driver"
+5
drivers/pinctrl/qcom/Makefile
··· 7 7 obj-$(CONFIG_PINCTRL_IPQ5018) += pinctrl-ipq5018.o 8 8 obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o 9 9 obj-$(CONFIG_PINCTRL_IPQ5332) += pinctrl-ipq5332.o 10 + obj-$(CONFIG_PINCTRL_IPQ5424) += pinctrl-ipq5424.o 10 11 obj-$(CONFIG_PINCTRL_IPQ8074) += pinctrl-ipq8074.o 11 12 obj-$(CONFIG_PINCTRL_IPQ6018) += pinctrl-ipq6018.o 12 13 obj-$(CONFIG_PINCTRL_IPQ9574) += pinctrl-ipq9574.o ··· 24 23 obj-$(CONFIG_PINCTRL_MSM8998) += pinctrl-msm8998.o 25 24 obj-$(CONFIG_PINCTRL_QCM2290) += pinctrl-qcm2290.o 26 25 obj-$(CONFIG_PINCTRL_QCS404) += pinctrl-qcs404.o 26 + obj-$(CONFIG_PINCTRL_QCS615) += pinctrl-qcs615.o 27 + obj-$(CONFIG_PINCTRL_QCS8300) += pinctrl-qcs8300.o 27 28 obj-$(CONFIG_PINCTRL_QDF2XXX) += pinctrl-qdf2xxx.o 28 29 obj-$(CONFIG_PINCTRL_MDM9607) += pinctrl-mdm9607.o 29 30 obj-$(CONFIG_PINCTRL_MDM9615) += pinctrl-mdm9615.o ··· 35 32 obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-mpp.o 36 33 obj-$(CONFIG_PINCTRL_QDU1000) += pinctrl-qdu1000.o 37 34 obj-$(CONFIG_PINCTRL_SA8775P) += pinctrl-sa8775p.o 35 + obj-$(CONFIG_PINCTRL_SAR2130P) += pinctrl-sar2130p.o 38 36 obj-$(CONFIG_PINCTRL_SC7180) += pinctrl-sc7180.o 39 37 obj-$(CONFIG_PINCTRL_SC7280) += pinctrl-sc7280.o 40 38 obj-$(CONFIG_PINCTRL_SC7280_LPASS_LPI) += pinctrl-sc7280-lpass-lpi.o ··· 66 62 obj-$(CONFIG_PINCTRL_SM8550_LPASS_LPI) += pinctrl-sm8550-lpass-lpi.o 67 63 obj-$(CONFIG_PINCTRL_SM8650) += pinctrl-sm8650.o 68 64 obj-$(CONFIG_PINCTRL_SM8650_LPASS_LPI) += pinctrl-sm8650-lpass-lpi.o 65 + obj-$(CONFIG_PINCTRL_SM8750) += pinctrl-sm8750.o 69 66 obj-$(CONFIG_PINCTRL_SC8280XP_LPASS_LPI) += pinctrl-sc8280xp-lpass-lpi.o 70 67 obj-$(CONFIG_PINCTRL_LPASS_LPI) += pinctrl-lpass-lpi.o 71 68 obj-$(CONFIG_PINCTRL_X1E80100) += pinctrl-x1e80100.o
+1 -1
drivers/pinctrl/qcom/pinctrl-apq8064.c
··· 629 629 .of_match_table = apq8064_pinctrl_of_match, 630 630 }, 631 631 .probe = apq8064_pinctrl_probe, 632 - .remove_new = msm_pinctrl_remove, 632 + .remove = msm_pinctrl_remove, 633 633 }; 634 634 635 635 static int __init apq8064_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-apq8084.c
··· 1207 1207 .of_match_table = apq8084_pinctrl_of_match, 1208 1208 }, 1209 1209 .probe = apq8084_pinctrl_probe, 1210 - .remove_new = msm_pinctrl_remove, 1210 + .remove = msm_pinctrl_remove, 1211 1211 }; 1212 1212 1213 1213 static int __init apq8084_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq4019.c
··· 710 710 .of_match_table = ipq4019_pinctrl_of_match, 711 711 }, 712 712 .probe = ipq4019_pinctrl_probe, 713 - .remove_new = msm_pinctrl_remove, 713 + .remove = msm_pinctrl_remove, 714 714 }; 715 715 716 716 static int __init ipq4019_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq5018.c
··· 754 754 .of_match_table = ipq5018_pinctrl_of_match, 755 755 }, 756 756 .probe = ipq5018_pinctrl_probe, 757 - .remove_new = msm_pinctrl_remove, 757 + .remove = msm_pinctrl_remove, 758 758 }; 759 759 760 760 static int __init ipq5018_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq5332.c
··· 834 834 .of_match_table = ipq5332_pinctrl_of_match, 835 835 }, 836 836 .probe = ipq5332_pinctrl_probe, 837 - .remove_new = msm_pinctrl_remove, 837 + .remove = msm_pinctrl_remove, 838 838 }; 839 839 840 840 static int __init ipq5332_pinctrl_init(void)
+792
drivers/pinctrl/qcom/pinctrl-ipq5424.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2016-2018,2020 The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. 5 + */ 6 + 7 + #include <linux/module.h> 8 + #include <linux/of.h> 9 + #include <linux/platform_device.h> 10 + 11 + #include "pinctrl-msm.h" 12 + 13 + #define REG_SIZE 0x1000 14 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 15 + { \ 16 + .grp = PINCTRL_PINGROUP("gpio" #id, \ 17 + gpio##id##_pins, \ 18 + ARRAY_SIZE(gpio##id##_pins)), \ 19 + .funcs = (int[]){ \ 20 + msm_mux_gpio, /* gpio mode */ \ 21 + msm_mux_##f1, \ 22 + msm_mux_##f2, \ 23 + msm_mux_##f3, \ 24 + msm_mux_##f4, \ 25 + msm_mux_##f5, \ 26 + msm_mux_##f6, \ 27 + msm_mux_##f7, \ 28 + msm_mux_##f8, \ 29 + msm_mux_##f9 \ 30 + }, \ 31 + .nfuncs = 10, \ 32 + .ctl_reg = REG_SIZE * id, \ 33 + .io_reg = 0x4 + REG_SIZE * id, \ 34 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 35 + .intr_status_reg = 0xc + REG_SIZE * id, \ 36 + .intr_target_reg = 0x8 + REG_SIZE * id, \ 37 + .mux_bit = 2, \ 38 + .pull_bit = 0, \ 39 + .drv_bit = 6, \ 40 + .oe_bit = 9, \ 41 + .in_bit = 0, \ 42 + .out_bit = 1, \ 43 + .intr_enable_bit = 0, \ 44 + .intr_status_bit = 0, \ 45 + .intr_target_bit = 5, \ 46 + .intr_target_kpss_val = 3, \ 47 + .intr_raw_status_bit = 4, \ 48 + .intr_polarity_bit = 1, \ 49 + .intr_detection_bit = 2, \ 50 + .intr_detection_width = 2, \ 51 + } 52 + 53 + static const struct pinctrl_pin_desc ipq5424_pins[] = { 54 + PINCTRL_PIN(0, "GPIO_0"), 55 + PINCTRL_PIN(1, "GPIO_1"), 56 + PINCTRL_PIN(2, "GPIO_2"), 57 + PINCTRL_PIN(3, "GPIO_3"), 58 + PINCTRL_PIN(4, "GPIO_4"), 59 + PINCTRL_PIN(5, "GPIO_5"), 60 + PINCTRL_PIN(6, "GPIO_6"), 61 + PINCTRL_PIN(7, "GPIO_7"), 62 + PINCTRL_PIN(8, "GPIO_8"), 63 + PINCTRL_PIN(9, "GPIO_9"), 64 + PINCTRL_PIN(10, "GPIO_10"), 65 + PINCTRL_PIN(11, "GPIO_11"), 66 + PINCTRL_PIN(12, "GPIO_12"), 67 + PINCTRL_PIN(13, "GPIO_13"), 68 + PINCTRL_PIN(14, "GPIO_14"), 69 + PINCTRL_PIN(15, "GPIO_15"), 70 + PINCTRL_PIN(16, "GPIO_16"), 71 + PINCTRL_PIN(17, "GPIO_17"), 72 + PINCTRL_PIN(18, "GPIO_18"), 73 + PINCTRL_PIN(19, "GPIO_19"), 74 + PINCTRL_PIN(20, "GPIO_20"), 75 + PINCTRL_PIN(21, "GPIO_21"), 76 + PINCTRL_PIN(22, "GPIO_22"), 77 + PINCTRL_PIN(23, "GPIO_23"), 78 + PINCTRL_PIN(24, "GPIO_24"), 79 + PINCTRL_PIN(25, "GPIO_25"), 80 + PINCTRL_PIN(26, "GPIO_26"), 81 + PINCTRL_PIN(27, "GPIO_27"), 82 + PINCTRL_PIN(28, "GPIO_28"), 83 + PINCTRL_PIN(29, "GPIO_29"), 84 + PINCTRL_PIN(30, "GPIO_30"), 85 + PINCTRL_PIN(31, "GPIO_31"), 86 + PINCTRL_PIN(32, "GPIO_32"), 87 + PINCTRL_PIN(33, "GPIO_33"), 88 + PINCTRL_PIN(34, "GPIO_34"), 89 + PINCTRL_PIN(35, "GPIO_35"), 90 + PINCTRL_PIN(36, "GPIO_36"), 91 + PINCTRL_PIN(37, "GPIO_37"), 92 + PINCTRL_PIN(38, "GPIO_38"), 93 + PINCTRL_PIN(39, "GPIO_39"), 94 + PINCTRL_PIN(40, "GPIO_40"), 95 + PINCTRL_PIN(41, "GPIO_41"), 96 + PINCTRL_PIN(42, "GPIO_42"), 97 + PINCTRL_PIN(43, "GPIO_43"), 98 + PINCTRL_PIN(44, "GPIO_44"), 99 + PINCTRL_PIN(45, "GPIO_45"), 100 + PINCTRL_PIN(46, "GPIO_46"), 101 + PINCTRL_PIN(47, "GPIO_47"), 102 + PINCTRL_PIN(48, "GPIO_48"), 103 + PINCTRL_PIN(49, "GPIO_49"), 104 + }; 105 + 106 + #define DECLARE_MSM_GPIO_PINS(pin) \ 107 + static const unsigned int gpio##pin##_pins[] = { pin } 108 + DECLARE_MSM_GPIO_PINS(0); 109 + DECLARE_MSM_GPIO_PINS(1); 110 + DECLARE_MSM_GPIO_PINS(2); 111 + DECLARE_MSM_GPIO_PINS(3); 112 + DECLARE_MSM_GPIO_PINS(4); 113 + DECLARE_MSM_GPIO_PINS(5); 114 + DECLARE_MSM_GPIO_PINS(6); 115 + DECLARE_MSM_GPIO_PINS(7); 116 + DECLARE_MSM_GPIO_PINS(8); 117 + DECLARE_MSM_GPIO_PINS(9); 118 + DECLARE_MSM_GPIO_PINS(10); 119 + DECLARE_MSM_GPIO_PINS(11); 120 + DECLARE_MSM_GPIO_PINS(12); 121 + DECLARE_MSM_GPIO_PINS(13); 122 + DECLARE_MSM_GPIO_PINS(14); 123 + DECLARE_MSM_GPIO_PINS(15); 124 + DECLARE_MSM_GPIO_PINS(16); 125 + DECLARE_MSM_GPIO_PINS(17); 126 + DECLARE_MSM_GPIO_PINS(18); 127 + DECLARE_MSM_GPIO_PINS(19); 128 + DECLARE_MSM_GPIO_PINS(20); 129 + DECLARE_MSM_GPIO_PINS(21); 130 + DECLARE_MSM_GPIO_PINS(22); 131 + DECLARE_MSM_GPIO_PINS(23); 132 + DECLARE_MSM_GPIO_PINS(24); 133 + DECLARE_MSM_GPIO_PINS(25); 134 + DECLARE_MSM_GPIO_PINS(26); 135 + DECLARE_MSM_GPIO_PINS(27); 136 + DECLARE_MSM_GPIO_PINS(28); 137 + DECLARE_MSM_GPIO_PINS(29); 138 + DECLARE_MSM_GPIO_PINS(30); 139 + DECLARE_MSM_GPIO_PINS(31); 140 + DECLARE_MSM_GPIO_PINS(32); 141 + DECLARE_MSM_GPIO_PINS(33); 142 + DECLARE_MSM_GPIO_PINS(34); 143 + DECLARE_MSM_GPIO_PINS(35); 144 + DECLARE_MSM_GPIO_PINS(36); 145 + DECLARE_MSM_GPIO_PINS(37); 146 + DECLARE_MSM_GPIO_PINS(38); 147 + DECLARE_MSM_GPIO_PINS(39); 148 + DECLARE_MSM_GPIO_PINS(40); 149 + DECLARE_MSM_GPIO_PINS(41); 150 + DECLARE_MSM_GPIO_PINS(42); 151 + DECLARE_MSM_GPIO_PINS(43); 152 + DECLARE_MSM_GPIO_PINS(44); 153 + DECLARE_MSM_GPIO_PINS(45); 154 + DECLARE_MSM_GPIO_PINS(46); 155 + DECLARE_MSM_GPIO_PINS(47); 156 + DECLARE_MSM_GPIO_PINS(48); 157 + DECLARE_MSM_GPIO_PINS(49); 158 + 159 + enum ipq5424_functions { 160 + msm_mux_atest_char, 161 + msm_mux_atest_char0, 162 + msm_mux_atest_char1, 163 + msm_mux_atest_char2, 164 + msm_mux_atest_char3, 165 + msm_mux_atest_tic, 166 + msm_mux_audio_pri, 167 + msm_mux_audio_pri0, 168 + msm_mux_audio_pri1, 169 + msm_mux_audio_sec, 170 + msm_mux_audio_sec0, 171 + msm_mux_audio_sec1, 172 + msm_mux_core_voltage, 173 + msm_mux_cri_trng0, 174 + msm_mux_cri_trng1, 175 + msm_mux_cri_trng2, 176 + msm_mux_cri_trng3, 177 + msm_mux_cxc_clk, 178 + msm_mux_cxc_data, 179 + msm_mux_dbg_out, 180 + msm_mux_gcc_plltest, 181 + msm_mux_gcc_tlmm, 182 + msm_mux_gpio, 183 + msm_mux_i2c0_scl, 184 + msm_mux_i2c0_sda, 185 + msm_mux_i2c1_scl, 186 + msm_mux_i2c1_sda, 187 + msm_mux_i2c11, 188 + msm_mux_mac0, 189 + msm_mux_mac1, 190 + msm_mux_mdc_mst, 191 + msm_mux_mdc_slv, 192 + msm_mux_mdio_mst, 193 + msm_mux_mdio_slv, 194 + msm_mux_pcie0_clk, 195 + msm_mux_pcie0_wake, 196 + msm_mux_pcie1_clk, 197 + msm_mux_pcie1_wake, 198 + msm_mux_pcie2_clk, 199 + msm_mux_pcie2_wake, 200 + msm_mux_pcie3_clk, 201 + msm_mux_pcie3_wake, 202 + msm_mux_pll_test, 203 + msm_mux_prng_rosc0, 204 + msm_mux_prng_rosc1, 205 + msm_mux_prng_rosc2, 206 + msm_mux_prng_rosc3, 207 + msm_mux_PTA0_0, 208 + msm_mux_PTA0_1, 209 + msm_mux_PTA0_2, 210 + msm_mux_PTA10, 211 + msm_mux_PTA11, 212 + msm_mux_pwm0, 213 + msm_mux_pwm1, 214 + msm_mux_pwm2, 215 + msm_mux_qdss_cti_trig_in_a0, 216 + msm_mux_qdss_cti_trig_out_a0, 217 + msm_mux_qdss_cti_trig_in_a1, 218 + msm_mux_qdss_cti_trig_out_a1, 219 + msm_mux_qdss_cti_trig_in_b0, 220 + msm_mux_qdss_cti_trig_out_b0, 221 + msm_mux_qdss_cti_trig_in_b1, 222 + msm_mux_qdss_cti_trig_out_b1, 223 + msm_mux_qdss_traceclk_a, 224 + msm_mux_qdss_tracectl_a, 225 + msm_mux_qdss_tracedata_a, 226 + msm_mux_qspi_clk, 227 + msm_mux_qspi_cs, 228 + msm_mux_qspi_data, 229 + msm_mux_resout, 230 + msm_mux_rx0, 231 + msm_mux_rx1, 232 + msm_mux_rx2, 233 + msm_mux_sdc_clk, 234 + msm_mux_sdc_cmd, 235 + msm_mux_sdc_data, 236 + msm_mux_spi0, 237 + msm_mux_spi1, 238 + msm_mux_spi10, 239 + msm_mux_spi11, 240 + msm_mux_tsens_max, 241 + msm_mux_uart0, 242 + msm_mux_uart1, 243 + msm_mux_wci_txd, 244 + msm_mux_wci_rxd, 245 + msm_mux_wsi_clk, 246 + msm_mux_wsi_data, 247 + msm_mux__, 248 + }; 249 + 250 + static const char * const gpio_groups[] = { 251 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 252 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 253 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 254 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 255 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 256 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 257 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 258 + }; 259 + 260 + static const char * const sdc_data_groups[] = { 261 + "gpio0", "gpio1", "gpio2", "gpio3", 262 + }; 263 + 264 + static const char * const qspi_data_groups[] = { 265 + "gpio0", "gpio1", "gpio2", "gpio3", 266 + }; 267 + 268 + static const char * const pwm2_groups[] = { 269 + "gpio0", "gpio1", "gpio2", "gpio3", 270 + }; 271 + 272 + static const char * const wci_txd_groups[] = { 273 + "gpio0", "gpio1", "gpio8", "gpio10", "gpio11", "gpio40", "gpio41", 274 + }; 275 + 276 + static const char * const wci_rxd_groups[] = { 277 + "gpio0", "gpio1", "gpio8", "gpio10", "gpio11", "gpio40", "gpio41", 278 + }; 279 + 280 + static const char * const sdc_cmd_groups[] = { 281 + "gpio4", 282 + }; 283 + 284 + static const char * const qspi_cs_groups[] = { 285 + "gpio4", 286 + }; 287 + 288 + static const char * const qdss_cti_trig_out_a1_groups[] = { 289 + "gpio27", 290 + }; 291 + 292 + static const char * const sdc_clk_groups[] = { 293 + "gpio5", 294 + }; 295 + 296 + static const char * const qspi_clk_groups[] = { 297 + "gpio5", 298 + }; 299 + 300 + static const char * const spi0_groups[] = { 301 + "gpio6", "gpio7", "gpio8", "gpio9", 302 + }; 303 + 304 + static const char * const pwm1_groups[] = { 305 + "gpio6", "gpio7", "gpio8", "gpio9", 306 + }; 307 + 308 + static const char * const cri_trng0_groups[] = { 309 + "gpio6", 310 + }; 311 + 312 + static const char * const qdss_tracedata_a_groups[] = { 313 + "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", 314 + "gpio13", "gpio14", "gpio15", "gpio20", "gpio21", "gpio36", "gpio37", 315 + "gpio38", "gpio39", 316 + }; 317 + 318 + static const char * const cri_trng1_groups[] = { 319 + "gpio7", 320 + }; 321 + 322 + static const char * const cri_trng2_groups[] = { 323 + "gpio8", 324 + }; 325 + 326 + static const char * const cri_trng3_groups[] = { 327 + "gpio9", 328 + }; 329 + 330 + static const char * const uart0_groups[] = { 331 + "gpio10", "gpio11", "gpio12", "gpio13", 332 + }; 333 + 334 + static const char * const pwm0_groups[] = { 335 + "gpio10", "gpio11", "gpio12", "gpio13", 336 + }; 337 + 338 + static const char * const prng_rosc0_groups[] = { 339 + "gpio12", 340 + }; 341 + 342 + static const char * const prng_rosc1_groups[] = { 343 + "gpio13", 344 + }; 345 + 346 + static const char * const i2c0_scl_groups[] = { 347 + "gpio14", 348 + }; 349 + 350 + static const char * const tsens_max_groups[] = { 351 + "gpio14", 352 + }; 353 + 354 + static const char * const prng_rosc2_groups[] = { 355 + "gpio14", 356 + }; 357 + 358 + static const char * const i2c0_sda_groups[] = { 359 + "gpio15", 360 + }; 361 + 362 + static const char * const prng_rosc3_groups[] = { 363 + "gpio15", 364 + }; 365 + 366 + static const char * const core_voltage_groups[] = { 367 + "gpio16", "gpio17", 368 + }; 369 + 370 + static const char * const i2c1_scl_groups[] = { 371 + "gpio16", 372 + }; 373 + 374 + static const char * const i2c1_sda_groups[] = { 375 + "gpio17", 376 + }; 377 + 378 + static const char * const mdc_slv_groups[] = { 379 + "gpio20", 380 + }; 381 + 382 + static const char * const atest_char0_groups[] = { 383 + "gpio20", 384 + }; 385 + 386 + static const char * const mdio_slv_groups[] = { 387 + "gpio21", 388 + }; 389 + 390 + static const char * const atest_char1_groups[] = { 391 + "gpio21", 392 + }; 393 + 394 + static const char * const mdc_mst_groups[] = { 395 + "gpio22", 396 + }; 397 + 398 + static const char * const atest_char2_groups[] = { 399 + "gpio22", 400 + }; 401 + 402 + static const char * const mdio_mst_groups[] = { 403 + "gpio23", 404 + }; 405 + 406 + static const char * const atest_char3_groups[] = { 407 + "gpio23", 408 + }; 409 + 410 + static const char * const pcie0_clk_groups[] = { 411 + "gpio24", 412 + }; 413 + 414 + static const char * const PTA10_groups[] = { 415 + "gpio24", "gpio26", "gpio27", 416 + }; 417 + 418 + static const char * const mac0_groups[] = { 419 + "gpio24", "gpio26", 420 + }; 421 + 422 + static const char * const atest_char_groups[] = { 423 + "gpio24", 424 + }; 425 + 426 + static const char * const pcie0_wake_groups[] = { 427 + "gpio26", 428 + }; 429 + 430 + static const char * const pcie1_clk_groups[] = { 431 + "gpio27", 432 + }; 433 + 434 + static const char * const i2c11_groups[] = { 435 + "gpio27", "gpio29", 436 + }; 437 + 438 + static const char * const pcie1_wake_groups[] = { 439 + "gpio29", 440 + }; 441 + 442 + static const char * const pcie2_clk_groups[] = { 443 + "gpio30", 444 + }; 445 + 446 + static const char * const mac1_groups[] = { 447 + "gpio30", "gpio32", 448 + }; 449 + 450 + static const char * const pcie2_wake_groups[] = { 451 + "gpio32", 452 + }; 453 + 454 + static const char * const PTA11_groups[] = { 455 + "gpio30", "gpio32", "gpio33", 456 + }; 457 + 458 + static const char * const audio_pri0_groups[] = { 459 + "gpio32", "gpio32", 460 + }; 461 + 462 + static const char * const pcie3_clk_groups[] = { 463 + "gpio33", 464 + }; 465 + 466 + static const char * const audio_pri1_groups[] = { 467 + "gpio33", "gpio33", 468 + }; 469 + 470 + static const char * const pcie3_wake_groups[] = { 471 + "gpio35", 472 + }; 473 + 474 + static const char * const audio_sec1_groups[] = { 475 + "gpio35", "gpio35", 476 + }; 477 + 478 + static const char * const audio_pri_groups[] = { 479 + "gpio36", "gpio37", "gpio38", "gpio39", 480 + }; 481 + 482 + static const char * const spi1_groups[] = { 483 + "gpio11", "gpio36", "gpio37", "gpio38", "gpio46", 484 + }; 485 + 486 + static const char * const audio_sec0_groups[] = { 487 + "gpio36", "gpio36", 488 + }; 489 + 490 + static const char * const rx1_groups[] = { 491 + "gpio38", "gpio46", 492 + }; 493 + 494 + static const char * const pll_test_groups[] = { 495 + "gpio38", 496 + }; 497 + 498 + static const char * const dbg_out_groups[] = { 499 + "gpio46", 500 + }; 501 + 502 + static const char * const PTA0_0_groups[] = { 503 + "gpio40", 504 + }; 505 + 506 + static const char * const atest_tic_groups[] = { 507 + "gpio40", 508 + }; 509 + 510 + static const char * const PTA0_1_groups[] = { 511 + "gpio41", 512 + }; 513 + 514 + static const char * const cxc_data_groups[] = { 515 + "gpio41", 516 + }; 517 + 518 + static const char * const PTA0_2_groups[] = { 519 + "gpio42", 520 + }; 521 + 522 + static const char * const cxc_clk_groups[] = { 523 + "gpio42", 524 + }; 525 + 526 + static const char * const uart1_groups[] = { 527 + "gpio43", "gpio44", 528 + }; 529 + 530 + static const char * const audio_sec_groups[] = { 531 + "gpio45", "gpio46", "gpio47", "gpio48", 532 + }; 533 + 534 + static const char * const gcc_plltest_groups[] = { 535 + "gpio43", "gpio45", 536 + }; 537 + 538 + static const char * const gcc_tlmm_groups[] = { 539 + "gpio44", 540 + }; 541 + 542 + static const char * const qdss_cti_trig_out_b1_groups[] = { 543 + "gpio33", 544 + }; 545 + 546 + static const char * const rx0_groups[] = { 547 + "gpio39", "gpio47", 548 + }; 549 + 550 + static const char * const qdss_traceclk_a_groups[] = { 551 + "gpio45", 552 + }; 553 + 554 + static const char * const qdss_tracectl_a_groups[] = { 555 + "gpio46", 556 + }; 557 + 558 + static const char * const qdss_cti_trig_out_a0_groups[] = { 559 + "gpio24", 560 + }; 561 + 562 + static const char * const qdss_cti_trig_in_a0_groups[] = { 563 + "gpio26", 564 + }; 565 + 566 + static const char * const resout_groups[] = { 567 + "gpio49", 568 + }; 569 + 570 + static const char * const qdss_cti_trig_in_a1_groups[] = { 571 + "gpio29", 572 + }; 573 + 574 + static const char * const qdss_cti_trig_out_b0_groups[] = { 575 + "gpio30", 576 + }; 577 + 578 + static const char * const qdss_cti_trig_in_b0_groups[] = { 579 + "gpio32", 580 + }; 581 + 582 + static const char * const qdss_cti_trig_in_b1_groups[] = { 583 + "gpio35", 584 + }; 585 + 586 + static const char * const spi10_groups[] = { 587 + "gpio45", "gpio47", "gpio48", 588 + }; 589 + 590 + static const char * const spi11_groups[] = { 591 + "gpio10", "gpio12", "gpio13", 592 + }; 593 + 594 + static const char * const wsi_clk_groups[] = { 595 + "gpio24", "gpio27", 596 + }; 597 + 598 + static const char * const wsi_data_groups[] = { 599 + "gpio26", "gpio29", 600 + }; 601 + 602 + static const char * const rx2_groups[] = { 603 + "gpio37", "gpio45", 604 + }; 605 + 606 + static const struct pinfunction ipq5424_functions[] = { 607 + MSM_PIN_FUNCTION(atest_char), 608 + MSM_PIN_FUNCTION(atest_char0), 609 + MSM_PIN_FUNCTION(atest_char1), 610 + MSM_PIN_FUNCTION(atest_char2), 611 + MSM_PIN_FUNCTION(atest_char3), 612 + MSM_PIN_FUNCTION(atest_tic), 613 + MSM_PIN_FUNCTION(audio_pri), 614 + MSM_PIN_FUNCTION(audio_pri0), 615 + MSM_PIN_FUNCTION(audio_pri1), 616 + MSM_PIN_FUNCTION(audio_sec), 617 + MSM_PIN_FUNCTION(audio_sec0), 618 + MSM_PIN_FUNCTION(audio_sec1), 619 + MSM_PIN_FUNCTION(core_voltage), 620 + MSM_PIN_FUNCTION(cri_trng0), 621 + MSM_PIN_FUNCTION(cri_trng1), 622 + MSM_PIN_FUNCTION(cri_trng2), 623 + MSM_PIN_FUNCTION(cri_trng3), 624 + MSM_PIN_FUNCTION(cxc_clk), 625 + MSM_PIN_FUNCTION(cxc_data), 626 + MSM_PIN_FUNCTION(dbg_out), 627 + MSM_PIN_FUNCTION(gcc_plltest), 628 + MSM_PIN_FUNCTION(gcc_tlmm), 629 + MSM_PIN_FUNCTION(gpio), 630 + MSM_PIN_FUNCTION(i2c0_scl), 631 + MSM_PIN_FUNCTION(i2c0_sda), 632 + MSM_PIN_FUNCTION(i2c1_scl), 633 + MSM_PIN_FUNCTION(i2c1_sda), 634 + MSM_PIN_FUNCTION(i2c11), 635 + MSM_PIN_FUNCTION(mac0), 636 + MSM_PIN_FUNCTION(mac1), 637 + MSM_PIN_FUNCTION(mdc_mst), 638 + MSM_PIN_FUNCTION(mdc_slv), 639 + MSM_PIN_FUNCTION(mdio_mst), 640 + MSM_PIN_FUNCTION(mdio_slv), 641 + MSM_PIN_FUNCTION(pcie0_clk), 642 + MSM_PIN_FUNCTION(pcie0_wake), 643 + MSM_PIN_FUNCTION(pcie1_clk), 644 + MSM_PIN_FUNCTION(pcie1_wake), 645 + MSM_PIN_FUNCTION(pcie2_clk), 646 + MSM_PIN_FUNCTION(pcie2_wake), 647 + MSM_PIN_FUNCTION(pcie3_clk), 648 + MSM_PIN_FUNCTION(pcie3_wake), 649 + MSM_PIN_FUNCTION(pll_test), 650 + MSM_PIN_FUNCTION(prng_rosc0), 651 + MSM_PIN_FUNCTION(prng_rosc1), 652 + MSM_PIN_FUNCTION(prng_rosc2), 653 + MSM_PIN_FUNCTION(prng_rosc3), 654 + MSM_PIN_FUNCTION(PTA0_0), 655 + MSM_PIN_FUNCTION(PTA0_1), 656 + MSM_PIN_FUNCTION(PTA0_2), 657 + MSM_PIN_FUNCTION(PTA10), 658 + MSM_PIN_FUNCTION(PTA11), 659 + MSM_PIN_FUNCTION(pwm0), 660 + MSM_PIN_FUNCTION(pwm1), 661 + MSM_PIN_FUNCTION(pwm2), 662 + MSM_PIN_FUNCTION(qdss_cti_trig_in_a0), 663 + MSM_PIN_FUNCTION(qdss_cti_trig_out_a0), 664 + MSM_PIN_FUNCTION(qdss_cti_trig_in_a1), 665 + MSM_PIN_FUNCTION(qdss_cti_trig_out_a1), 666 + MSM_PIN_FUNCTION(qdss_cti_trig_in_b0), 667 + MSM_PIN_FUNCTION(qdss_cti_trig_out_b0), 668 + MSM_PIN_FUNCTION(qdss_cti_trig_in_b1), 669 + MSM_PIN_FUNCTION(qdss_cti_trig_out_b1), 670 + MSM_PIN_FUNCTION(qdss_traceclk_a), 671 + MSM_PIN_FUNCTION(qdss_tracectl_a), 672 + MSM_PIN_FUNCTION(qdss_tracedata_a), 673 + MSM_PIN_FUNCTION(qspi_clk), 674 + MSM_PIN_FUNCTION(qspi_cs), 675 + MSM_PIN_FUNCTION(qspi_data), 676 + MSM_PIN_FUNCTION(resout), 677 + MSM_PIN_FUNCTION(rx0), 678 + MSM_PIN_FUNCTION(rx1), 679 + MSM_PIN_FUNCTION(rx2), 680 + MSM_PIN_FUNCTION(sdc_clk), 681 + MSM_PIN_FUNCTION(sdc_cmd), 682 + MSM_PIN_FUNCTION(sdc_data), 683 + MSM_PIN_FUNCTION(spi0), 684 + MSM_PIN_FUNCTION(spi1), 685 + MSM_PIN_FUNCTION(spi10), 686 + MSM_PIN_FUNCTION(spi11), 687 + MSM_PIN_FUNCTION(tsens_max), 688 + MSM_PIN_FUNCTION(uart0), 689 + MSM_PIN_FUNCTION(uart1), 690 + MSM_PIN_FUNCTION(wci_txd), 691 + MSM_PIN_FUNCTION(wci_rxd), 692 + MSM_PIN_FUNCTION(wsi_clk), 693 + MSM_PIN_FUNCTION(wsi_data), 694 + }; 695 + 696 + static const struct msm_pingroup ipq5424_groups[] = { 697 + PINGROUP(0, sdc_data, qspi_data, pwm2, wci_txd, wci_rxd, _, _, _, _), 698 + PINGROUP(1, sdc_data, qspi_data, pwm2, wci_txd, wci_rxd, _, _, _, _), 699 + PINGROUP(2, sdc_data, qspi_data, pwm2, _, _, _, _, _, _), 700 + PINGROUP(3, sdc_data, qspi_data, pwm2, _, _, _, _, _, _), 701 + PINGROUP(4, sdc_cmd, qspi_cs, _, _, _, _, _, _, _), 702 + PINGROUP(5, sdc_clk, qspi_clk, _, _, _, _, _, _, _), 703 + PINGROUP(6, spi0, pwm1, _, cri_trng0, qdss_tracedata_a, _, _, _, _), 704 + PINGROUP(7, spi0, pwm1, _, cri_trng1, qdss_tracedata_a, _, _, _, _), 705 + PINGROUP(8, spi0, pwm1, wci_txd, wci_rxd, _, cri_trng2, qdss_tracedata_a, _, _), 706 + PINGROUP(9, spi0, pwm1, _, cri_trng3, qdss_tracedata_a, _, _, _, _), 707 + PINGROUP(10, uart0, pwm0, spi11, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _), 708 + PINGROUP(11, uart0, pwm0, spi1, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _), 709 + PINGROUP(12, uart0, pwm0, spi11, _, prng_rosc0, qdss_tracedata_a, _, _, _), 710 + PINGROUP(13, uart0, pwm0, spi11, _, prng_rosc1, qdss_tracedata_a, _, _, _), 711 + PINGROUP(14, i2c0_scl, tsens_max, _, prng_rosc2, qdss_tracedata_a, _, _, _, _), 712 + PINGROUP(15, i2c0_sda, _, prng_rosc3, qdss_tracedata_a, _, _, _, _, _), 713 + PINGROUP(16, core_voltage, i2c1_scl, _, _, _, _, _, _, _), 714 + PINGROUP(17, core_voltage, i2c1_sda, _, _, _, _, _, _, _), 715 + PINGROUP(18, _, _, _, _, _, _, _, _, _), 716 + PINGROUP(19, _, _, _, _, _, _, _, _, _), 717 + PINGROUP(20, mdc_slv, atest_char0, _, qdss_tracedata_a, _, _, _, _, _), 718 + PINGROUP(21, mdio_slv, atest_char1, _, qdss_tracedata_a, _, _, _, _, _), 719 + PINGROUP(22, mdc_mst, atest_char2, _, _, _, _, _, _, _), 720 + PINGROUP(23, mdio_mst, atest_char3, _, _, _, _, _, _, _), 721 + PINGROUP(24, pcie0_clk, PTA10, mac0, _, wsi_clk, _, atest_char, qdss_cti_trig_out_a0, _), 722 + PINGROUP(25, _, _, _, _, _, _, _, _, _), 723 + PINGROUP(26, pcie0_wake, PTA10, mac0, _, wsi_data, _, qdss_cti_trig_in_a0, _, _), 724 + PINGROUP(27, pcie1_clk, i2c11, PTA10, wsi_clk, qdss_cti_trig_out_a1, _, _, _, _), 725 + PINGROUP(28, _, _, _, _, _, _, _, _, _), 726 + PINGROUP(29, pcie1_wake, i2c11, wsi_data, qdss_cti_trig_in_a1, _, _, _, _, _), 727 + PINGROUP(30, pcie2_clk, PTA11, mac1, qdss_cti_trig_out_b0, _, _, _, _, _), 728 + PINGROUP(31, _, _, _, _, _, _, _, _, _), 729 + PINGROUP(32, pcie2_wake, PTA11, mac1, audio_pri0, audio_pri0, qdss_cti_trig_in_b0, _, _, _), 730 + PINGROUP(33, pcie3_clk, PTA11, audio_pri1, audio_pri1, qdss_cti_trig_out_b1, _, _, _, _), 731 + PINGROUP(34, _, _, _, _, _, _, _, _, _), 732 + PINGROUP(35, pcie3_wake, audio_sec1, audio_sec1, qdss_cti_trig_in_b1, _, _, _, _, _), 733 + PINGROUP(36, audio_pri, spi1, audio_sec0, audio_sec0, qdss_tracedata_a, _, _, _, _), 734 + PINGROUP(37, audio_pri, spi1, rx2, qdss_tracedata_a, _, _, _, _, _), 735 + PINGROUP(38, audio_pri, spi1, pll_test, rx1, qdss_tracedata_a, _, _, _, _), 736 + PINGROUP(39, audio_pri, rx0, _, qdss_tracedata_a, _, _, _, _, _), 737 + PINGROUP(40, PTA0_0, wci_txd, wci_rxd, _, atest_tic, _, _, _, _), 738 + PINGROUP(41, PTA0_1, wci_txd, wci_rxd, cxc_data, _, _, _, _, _), 739 + PINGROUP(42, PTA0_2, cxc_clk, _, _, _, _, _, _, _), 740 + PINGROUP(43, uart1, gcc_plltest, _, _, _, _, _, _, _), 741 + PINGROUP(44, uart1, gcc_tlmm, _, _, _, _, _, _, _), 742 + PINGROUP(45, spi10, rx2, audio_sec, gcc_plltest, _, qdss_traceclk_a, _, _, _), 743 + PINGROUP(46, spi1, rx1, audio_sec, dbg_out, qdss_tracectl_a, _, _, _, _), 744 + PINGROUP(47, spi10, rx0, audio_sec, _, _, _, _, _, _), 745 + PINGROUP(48, spi10, audio_sec, _, _, _, _, _, _, _), 746 + PINGROUP(49, resout, _, _, _, _, _, _, _, _), 747 + }; 748 + 749 + static const struct msm_pinctrl_soc_data ipq5424_pinctrl = { 750 + .pins = ipq5424_pins, 751 + .npins = ARRAY_SIZE(ipq5424_pins), 752 + .functions = ipq5424_functions, 753 + .nfunctions = ARRAY_SIZE(ipq5424_functions), 754 + .groups = ipq5424_groups, 755 + .ngroups = ARRAY_SIZE(ipq5424_groups), 756 + .ngpios = 50, 757 + }; 758 + 759 + static int ipq5424_pinctrl_probe(struct platform_device *pdev) 760 + { 761 + return msm_pinctrl_probe(pdev, &ipq5424_pinctrl); 762 + } 763 + 764 + static const struct of_device_id ipq5424_pinctrl_of_match[] = { 765 + { .compatible = "qcom,ipq5424-tlmm", }, 766 + { }, 767 + }; 768 + MODULE_DEVICE_TABLE(of, ipq5424_pinctrl_of_match); 769 + 770 + static struct platform_driver ipq5424_pinctrl_driver = { 771 + .driver = { 772 + .name = "ipq5424-tlmm", 773 + .of_match_table = ipq5424_pinctrl_of_match, 774 + }, 775 + .probe = ipq5424_pinctrl_probe, 776 + .remove = msm_pinctrl_remove, 777 + }; 778 + 779 + static int __init ipq5424_pinctrl_init(void) 780 + { 781 + return platform_driver_register(&ipq5424_pinctrl_driver); 782 + } 783 + arch_initcall(ipq5424_pinctrl_init); 784 + 785 + static void __exit ipq5424_pinctrl_exit(void) 786 + { 787 + platform_driver_unregister(&ipq5424_pinctrl_driver); 788 + } 789 + module_exit(ipq5424_pinctrl_exit); 790 + 791 + MODULE_DESCRIPTION("QTI IPQ5424 TLMM driver"); 792 + MODULE_LICENSE("GPL");
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq6018.c
··· 1080 1080 .of_match_table = ipq6018_pinctrl_of_match, 1081 1081 }, 1082 1082 .probe = ipq6018_pinctrl_probe, 1083 - .remove_new = msm_pinctrl_remove, 1083 + .remove = msm_pinctrl_remove, 1084 1084 }; 1085 1085 1086 1086 static int __init ipq6018_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq8064.c
··· 631 631 .of_match_table = ipq8064_pinctrl_of_match, 632 632 }, 633 633 .probe = ipq8064_pinctrl_probe, 634 - .remove_new = msm_pinctrl_remove, 634 + .remove = msm_pinctrl_remove, 635 635 }; 636 636 637 637 static int __init ipq8064_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq8074.c
··· 1041 1041 .of_match_table = ipq8074_pinctrl_of_match, 1042 1042 }, 1043 1043 .probe = ipq8074_pinctrl_probe, 1044 - .remove_new = msm_pinctrl_remove, 1044 + .remove = msm_pinctrl_remove, 1045 1045 }; 1046 1046 1047 1047 static int __init ipq8074_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-ipq9574.c
··· 799 799 .of_match_table = ipq9574_pinctrl_of_match, 800 800 }, 801 801 .probe = ipq9574_pinctrl_probe, 802 - .remove_new = msm_pinctrl_remove, 802 + .remove = msm_pinctrl_remove, 803 803 }; 804 804 805 805 static int __init ipq9574_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-mdm9607.c
··· 1059 1059 .of_match_table = mdm9607_pinctrl_of_match, 1060 1060 }, 1061 1061 .probe = mdm9607_pinctrl_probe, 1062 - .remove_new = msm_pinctrl_remove, 1062 + .remove = msm_pinctrl_remove, 1063 1063 }; 1064 1064 1065 1065 static int __init mdm9607_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-mdm9615.c
··· 446 446 .of_match_table = mdm9615_pinctrl_of_match, 447 447 }, 448 448 .probe = mdm9615_pinctrl_probe, 449 - .remove_new = msm_pinctrl_remove, 449 + .remove = msm_pinctrl_remove, 450 450 }; 451 451 452 452 static int __init mdm9615_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 1457 1457 * files which don't set the "gpio-ranges" property or systems that 1458 1458 * utilize ACPI the driver has to call gpiochip_add_pin_range(). 1459 1459 */ 1460 - if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) { 1460 + if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) { 1461 1461 ret = gpiochip_add_pin_range(&pctrl->chip, 1462 1462 dev_name(pctrl->dev), 0, 0, chip->ngpio); 1463 1463 if (ret) {
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8226.c
··· 654 654 .of_match_table = msm8226_pinctrl_of_match, 655 655 }, 656 656 .probe = msm8226_pinctrl_probe, 657 - .remove_new = msm_pinctrl_remove, 657 + .remove = msm_pinctrl_remove, 658 658 }; 659 659 660 660 static int __init msm8226_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8660.c
··· 981 981 .of_match_table = msm8660_pinctrl_of_match, 982 982 }, 983 983 .probe = msm8660_pinctrl_probe, 984 - .remove_new = msm_pinctrl_remove, 984 + .remove = msm_pinctrl_remove, 985 985 }; 986 986 987 987 static int __init msm8660_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8909.c
··· 929 929 .of_match_table = msm8909_pinctrl_of_match, 930 930 }, 931 931 .probe = msm8909_pinctrl_probe, 932 - .remove_new = msm_pinctrl_remove, 932 + .remove = msm_pinctrl_remove, 933 933 }; 934 934 935 935 static int __init msm8909_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8916.c
··· 969 969 .of_match_table = msm8916_pinctrl_of_match, 970 970 }, 971 971 .probe = msm8916_pinctrl_probe, 972 - .remove_new = msm_pinctrl_remove, 972 + .remove = msm_pinctrl_remove, 973 973 }; 974 974 975 975 static int __init msm8916_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8953.c
··· 1816 1816 .of_match_table = msm8953_pinctrl_of_match, 1817 1817 }, 1818 1818 .probe = msm8953_pinctrl_probe, 1819 - .remove_new = msm_pinctrl_remove, 1819 + .remove = msm_pinctrl_remove, 1820 1820 }; 1821 1821 1822 1822 static int __init msm8953_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8960.c
··· 1246 1246 .of_match_table = msm8960_pinctrl_of_match, 1247 1247 }, 1248 1248 .probe = msm8960_pinctrl_probe, 1249 - .remove_new = msm_pinctrl_remove, 1249 + .remove = msm_pinctrl_remove, 1250 1250 }; 1251 1251 1252 1252 static int __init msm8960_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8976.c
··· 1096 1096 .of_match_table = msm8976_pinctrl_of_match, 1097 1097 }, 1098 1098 .probe = msm8976_pinctrl_probe, 1099 - .remove_new = msm_pinctrl_remove, 1099 + .remove = msm_pinctrl_remove, 1100 1100 }; 1101 1101 1102 1102 static int __init msm8976_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8994.c
··· 1343 1343 .of_match_table = msm8994_pinctrl_of_match, 1344 1344 }, 1345 1345 .probe = msm8994_pinctrl_probe, 1346 - .remove_new = msm_pinctrl_remove, 1346 + .remove = msm_pinctrl_remove, 1347 1347 }; 1348 1348 1349 1349 static int __init msm8994_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8996.c
··· 1920 1920 .of_match_table = msm8996_pinctrl_of_match, 1921 1921 }, 1922 1922 .probe = msm8996_pinctrl_probe, 1923 - .remove_new = msm_pinctrl_remove, 1923 + .remove = msm_pinctrl_remove, 1924 1924 }; 1925 1925 1926 1926 static int __init msm8996_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8998.c
··· 1535 1535 .of_match_table = msm8998_pinctrl_of_match, 1536 1536 }, 1537 1537 .probe = msm8998_pinctrl_probe, 1538 - .remove_new = msm_pinctrl_remove, 1538 + .remove = msm_pinctrl_remove, 1539 1539 }; 1540 1540 1541 1541 static int __init msm8998_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8x74.c
··· 1083 1083 .of_match_table = msm8x74_pinctrl_of_match, 1084 1084 }, 1085 1085 .probe = msm8x74_pinctrl_probe, 1086 - .remove_new = msm_pinctrl_remove, 1086 + .remove = msm_pinctrl_remove, 1087 1087 }; 1088 1088 1089 1089 static int __init msm8x74_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-qcm2290.c
··· 1113 1113 .of_match_table = qcm2290_pinctrl_of_match, 1114 1114 }, 1115 1115 .probe = qcm2290_pinctrl_probe, 1116 - .remove_new = msm_pinctrl_remove, 1116 + .remove = msm_pinctrl_remove, 1117 1117 }; 1118 1118 1119 1119 static int __init qcm2290_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-qcs404.c
··· 1644 1644 .of_match_table = qcs404_pinctrl_of_match, 1645 1645 }, 1646 1646 .probe = qcs404_pinctrl_probe, 1647 - .remove_new = msm_pinctrl_remove, 1647 + .remove = msm_pinctrl_remove, 1648 1648 }; 1649 1649 1650 1650 static int __init qcs404_pinctrl_init(void)
+1107
drivers/pinctrl/qcom/pinctrl-qcs615.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. 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 + enum { 13 + SOUTH, 14 + EAST, 15 + WEST 16 + }; 17 + 18 + static const char * const qcs615_tiles[] = { 19 + [SOUTH] = "south", 20 + [EAST] = "east", 21 + [WEST] = "west" 22 + }; 23 + 24 + #define PINGROUP(id, _tile, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 25 + { \ 26 + .grp = PINCTRL_PINGROUP("gpio" #id, \ 27 + gpio##id##_pins, \ 28 + ARRAY_SIZE(gpio##id##_pins)), \ 29 + .funcs = (int[]){ \ 30 + msm_mux_gpio, /* gpio mode */ \ 31 + msm_mux_##f1, \ 32 + msm_mux_##f2, \ 33 + msm_mux_##f3, \ 34 + msm_mux_##f4, \ 35 + msm_mux_##f5, \ 36 + msm_mux_##f6, \ 37 + msm_mux_##f7, \ 38 + msm_mux_##f8, \ 39 + msm_mux_##f9 \ 40 + }, \ 41 + .nfuncs = 10, \ 42 + .ctl_reg = 0x1000 * id, \ 43 + .io_reg = 0x1000 * id + 0x4, \ 44 + .intr_cfg_reg = 0x1000 * id + 0x8, \ 45 + .intr_status_reg = 0x1000 * id + 0xc, \ 46 + .intr_target_reg = 0x1000 * id + 0x8, \ 47 + .tile = _tile, \ 48 + .mux_bit = 2, \ 49 + .pull_bit = 0, \ 50 + .drv_bit = 6, \ 51 + .oe_bit = 9, \ 52 + .in_bit = 0, \ 53 + .out_bit = 1, \ 54 + .intr_enable_bit = 0, \ 55 + .intr_status_bit = 0, \ 56 + .intr_target_bit = 5, \ 57 + .intr_target_kpss_val = 3, \ 58 + .intr_raw_status_bit = 4, \ 59 + .intr_polarity_bit = 1, \ 60 + .intr_detection_bit = 2, \ 61 + .intr_detection_width = 2, \ 62 + } 63 + 64 + #define SDC_QDSD_PINGROUP(pg_name, _tile, ctl, pull, drv) \ 65 + { \ 66 + .grp = PINCTRL_PINGROUP(#pg_name, \ 67 + pg_name##_pins, \ 68 + ARRAY_SIZE(pg_name##_pins)), \ 69 + .ctl_reg = ctl, \ 70 + .io_reg = 0, \ 71 + .intr_cfg_reg = 0, \ 72 + .intr_status_reg = 0, \ 73 + .intr_target_reg = 0, \ 74 + .tile = _tile, \ 75 + .mux_bit = -1, \ 76 + .pull_bit = pull, \ 77 + .drv_bit = drv, \ 78 + .oe_bit = -1, \ 79 + .in_bit = -1, \ 80 + .out_bit = -1, \ 81 + .intr_enable_bit = -1, \ 82 + .intr_status_bit = -1, \ 83 + .intr_target_bit = -1, \ 84 + .intr_raw_status_bit = -1, \ 85 + .intr_polarity_bit = -1, \ 86 + .intr_detection_bit = -1, \ 87 + .intr_detection_width = -1, \ 88 + } 89 + 90 + #define UFS_RESET(pg_name, offset) \ 91 + { \ 92 + .grp = PINCTRL_PINGROUP(#pg_name, \ 93 + pg_name##_pins, \ 94 + ARRAY_SIZE(pg_name##_pins)), \ 95 + .ctl_reg = offset, \ 96 + .io_reg = offset + 0x4, \ 97 + .intr_cfg_reg = 0, \ 98 + .intr_status_reg = 0, \ 99 + .intr_target_reg = 0, \ 100 + .tile = WEST, \ 101 + .mux_bit = -1, \ 102 + .pull_bit = 3, \ 103 + .drv_bit = 0, \ 104 + .oe_bit = -1, \ 105 + .in_bit = -1, \ 106 + .out_bit = 0, \ 107 + .intr_enable_bit = -1, \ 108 + .intr_status_bit = -1, \ 109 + .intr_target_bit = -1, \ 110 + .intr_raw_status_bit = -1, \ 111 + .intr_polarity_bit = -1, \ 112 + .intr_detection_bit = -1, \ 113 + .intr_detection_width = -1, \ 114 + } 115 + 116 + static const struct pinctrl_pin_desc qcs615_pins[] = { 117 + PINCTRL_PIN(0, "GPIO_0"), 118 + PINCTRL_PIN(1, "GPIO_1"), 119 + PINCTRL_PIN(2, "GPIO_2"), 120 + PINCTRL_PIN(3, "GPIO_3"), 121 + PINCTRL_PIN(4, "GPIO_4"), 122 + PINCTRL_PIN(5, "GPIO_5"), 123 + PINCTRL_PIN(6, "GPIO_6"), 124 + PINCTRL_PIN(7, "GPIO_7"), 125 + PINCTRL_PIN(8, "GPIO_8"), 126 + PINCTRL_PIN(9, "GPIO_9"), 127 + PINCTRL_PIN(10, "GPIO_10"), 128 + PINCTRL_PIN(11, "GPIO_11"), 129 + PINCTRL_PIN(12, "GPIO_12"), 130 + PINCTRL_PIN(13, "GPIO_13"), 131 + PINCTRL_PIN(14, "GPIO_14"), 132 + PINCTRL_PIN(15, "GPIO_15"), 133 + PINCTRL_PIN(16, "GPIO_16"), 134 + PINCTRL_PIN(17, "GPIO_17"), 135 + PINCTRL_PIN(18, "GPIO_18"), 136 + PINCTRL_PIN(19, "GPIO_19"), 137 + PINCTRL_PIN(20, "GPIO_20"), 138 + PINCTRL_PIN(21, "GPIO_21"), 139 + PINCTRL_PIN(22, "GPIO_22"), 140 + PINCTRL_PIN(23, "GPIO_23"), 141 + PINCTRL_PIN(24, "GPIO_24"), 142 + PINCTRL_PIN(25, "GPIO_25"), 143 + PINCTRL_PIN(26, "GPIO_26"), 144 + PINCTRL_PIN(27, "GPIO_27"), 145 + PINCTRL_PIN(28, "GPIO_28"), 146 + PINCTRL_PIN(29, "GPIO_29"), 147 + PINCTRL_PIN(30, "GPIO_30"), 148 + PINCTRL_PIN(31, "GPIO_31"), 149 + PINCTRL_PIN(32, "GPIO_32"), 150 + PINCTRL_PIN(33, "GPIO_33"), 151 + PINCTRL_PIN(34, "GPIO_34"), 152 + PINCTRL_PIN(35, "GPIO_35"), 153 + PINCTRL_PIN(36, "GPIO_36"), 154 + PINCTRL_PIN(37, "GPIO_37"), 155 + PINCTRL_PIN(38, "GPIO_38"), 156 + PINCTRL_PIN(39, "GPIO_39"), 157 + PINCTRL_PIN(40, "GPIO_40"), 158 + PINCTRL_PIN(41, "GPIO_41"), 159 + PINCTRL_PIN(42, "GPIO_42"), 160 + PINCTRL_PIN(43, "GPIO_43"), 161 + PINCTRL_PIN(44, "GPIO_44"), 162 + PINCTRL_PIN(45, "GPIO_45"), 163 + PINCTRL_PIN(46, "GPIO_46"), 164 + PINCTRL_PIN(47, "GPIO_47"), 165 + PINCTRL_PIN(48, "GPIO_48"), 166 + PINCTRL_PIN(49, "GPIO_49"), 167 + PINCTRL_PIN(50, "GPIO_50"), 168 + PINCTRL_PIN(51, "GPIO_51"), 169 + PINCTRL_PIN(52, "GPIO_52"), 170 + PINCTRL_PIN(53, "GPIO_53"), 171 + PINCTRL_PIN(54, "GPIO_54"), 172 + PINCTRL_PIN(55, "GPIO_55"), 173 + PINCTRL_PIN(56, "GPIO_56"), 174 + PINCTRL_PIN(57, "GPIO_57"), 175 + PINCTRL_PIN(58, "GPIO_58"), 176 + PINCTRL_PIN(59, "GPIO_59"), 177 + PINCTRL_PIN(60, "GPIO_60"), 178 + PINCTRL_PIN(61, "GPIO_61"), 179 + PINCTRL_PIN(62, "GPIO_62"), 180 + PINCTRL_PIN(63, "GPIO_63"), 181 + PINCTRL_PIN(64, "GPIO_64"), 182 + PINCTRL_PIN(65, "GPIO_65"), 183 + PINCTRL_PIN(66, "GPIO_66"), 184 + PINCTRL_PIN(67, "GPIO_67"), 185 + PINCTRL_PIN(68, "GPIO_68"), 186 + PINCTRL_PIN(69, "GPIO_69"), 187 + PINCTRL_PIN(70, "GPIO_70"), 188 + PINCTRL_PIN(71, "GPIO_71"), 189 + PINCTRL_PIN(72, "GPIO_72"), 190 + PINCTRL_PIN(73, "GPIO_73"), 191 + PINCTRL_PIN(74, "GPIO_74"), 192 + PINCTRL_PIN(75, "GPIO_75"), 193 + PINCTRL_PIN(76, "GPIO_76"), 194 + PINCTRL_PIN(77, "GPIO_77"), 195 + PINCTRL_PIN(78, "GPIO_78"), 196 + PINCTRL_PIN(79, "GPIO_79"), 197 + PINCTRL_PIN(80, "GPIO_80"), 198 + PINCTRL_PIN(81, "GPIO_81"), 199 + PINCTRL_PIN(82, "GPIO_82"), 200 + PINCTRL_PIN(83, "GPIO_83"), 201 + PINCTRL_PIN(84, "GPIO_84"), 202 + PINCTRL_PIN(85, "GPIO_85"), 203 + PINCTRL_PIN(86, "GPIO_86"), 204 + PINCTRL_PIN(87, "GPIO_87"), 205 + PINCTRL_PIN(88, "GPIO_88"), 206 + PINCTRL_PIN(89, "GPIO_89"), 207 + PINCTRL_PIN(90, "GPIO_90"), 208 + PINCTRL_PIN(91, "GPIO_91"), 209 + PINCTRL_PIN(92, "GPIO_92"), 210 + PINCTRL_PIN(93, "GPIO_93"), 211 + PINCTRL_PIN(94, "GPIO_94"), 212 + PINCTRL_PIN(95, "GPIO_95"), 213 + PINCTRL_PIN(96, "GPIO_96"), 214 + PINCTRL_PIN(97, "GPIO_97"), 215 + PINCTRL_PIN(98, "GPIO_98"), 216 + PINCTRL_PIN(99, "GPIO_99"), 217 + PINCTRL_PIN(100, "GPIO_100"), 218 + PINCTRL_PIN(101, "GPIO_101"), 219 + PINCTRL_PIN(102, "GPIO_102"), 220 + PINCTRL_PIN(103, "GPIO_103"), 221 + PINCTRL_PIN(104, "GPIO_104"), 222 + PINCTRL_PIN(105, "GPIO_105"), 223 + PINCTRL_PIN(106, "GPIO_106"), 224 + PINCTRL_PIN(107, "GPIO_107"), 225 + PINCTRL_PIN(108, "GPIO_108"), 226 + PINCTRL_PIN(109, "GPIO_109"), 227 + PINCTRL_PIN(110, "GPIO_110"), 228 + PINCTRL_PIN(111, "GPIO_111"), 229 + PINCTRL_PIN(112, "GPIO_112"), 230 + PINCTRL_PIN(113, "GPIO_113"), 231 + PINCTRL_PIN(114, "GPIO_114"), 232 + PINCTRL_PIN(115, "GPIO_115"), 233 + PINCTRL_PIN(116, "GPIO_116"), 234 + PINCTRL_PIN(117, "GPIO_117"), 235 + PINCTRL_PIN(118, "GPIO_118"), 236 + PINCTRL_PIN(119, "GPIO_119"), 237 + PINCTRL_PIN(120, "GPIO_120"), 238 + PINCTRL_PIN(121, "GPIO_121"), 239 + PINCTRL_PIN(122, "GPIO_122"), 240 + PINCTRL_PIN(123, "UFS_RESET"), 241 + PINCTRL_PIN(124, "SDC1_RCLK"), 242 + PINCTRL_PIN(125, "SDC1_CLK"), 243 + PINCTRL_PIN(126, "SDC1_CMD"), 244 + PINCTRL_PIN(127, "SDC1_DATA"), 245 + PINCTRL_PIN(128, "SDC2_CLK"), 246 + PINCTRL_PIN(129, "SDC2_CMD"), 247 + PINCTRL_PIN(130, "SDC2_DATA"), 248 + }; 249 + 250 + #define DECLARE_MSM_GPIO_PINS(pin) \ 251 + static const unsigned int gpio##pin##_pins[] = { pin } 252 + DECLARE_MSM_GPIO_PINS(0); 253 + DECLARE_MSM_GPIO_PINS(1); 254 + DECLARE_MSM_GPIO_PINS(2); 255 + DECLARE_MSM_GPIO_PINS(3); 256 + DECLARE_MSM_GPIO_PINS(4); 257 + DECLARE_MSM_GPIO_PINS(5); 258 + DECLARE_MSM_GPIO_PINS(6); 259 + DECLARE_MSM_GPIO_PINS(7); 260 + DECLARE_MSM_GPIO_PINS(8); 261 + DECLARE_MSM_GPIO_PINS(9); 262 + DECLARE_MSM_GPIO_PINS(10); 263 + DECLARE_MSM_GPIO_PINS(11); 264 + DECLARE_MSM_GPIO_PINS(12); 265 + DECLARE_MSM_GPIO_PINS(13); 266 + DECLARE_MSM_GPIO_PINS(14); 267 + DECLARE_MSM_GPIO_PINS(15); 268 + DECLARE_MSM_GPIO_PINS(16); 269 + DECLARE_MSM_GPIO_PINS(17); 270 + DECLARE_MSM_GPIO_PINS(18); 271 + DECLARE_MSM_GPIO_PINS(19); 272 + DECLARE_MSM_GPIO_PINS(20); 273 + DECLARE_MSM_GPIO_PINS(21); 274 + DECLARE_MSM_GPIO_PINS(22); 275 + DECLARE_MSM_GPIO_PINS(23); 276 + DECLARE_MSM_GPIO_PINS(24); 277 + DECLARE_MSM_GPIO_PINS(25); 278 + DECLARE_MSM_GPIO_PINS(26); 279 + DECLARE_MSM_GPIO_PINS(27); 280 + DECLARE_MSM_GPIO_PINS(28); 281 + DECLARE_MSM_GPIO_PINS(29); 282 + DECLARE_MSM_GPIO_PINS(30); 283 + DECLARE_MSM_GPIO_PINS(31); 284 + DECLARE_MSM_GPIO_PINS(32); 285 + DECLARE_MSM_GPIO_PINS(33); 286 + DECLARE_MSM_GPIO_PINS(34); 287 + DECLARE_MSM_GPIO_PINS(35); 288 + DECLARE_MSM_GPIO_PINS(36); 289 + DECLARE_MSM_GPIO_PINS(37); 290 + DECLARE_MSM_GPIO_PINS(38); 291 + DECLARE_MSM_GPIO_PINS(39); 292 + DECLARE_MSM_GPIO_PINS(40); 293 + DECLARE_MSM_GPIO_PINS(41); 294 + DECLARE_MSM_GPIO_PINS(42); 295 + DECLARE_MSM_GPIO_PINS(43); 296 + DECLARE_MSM_GPIO_PINS(44); 297 + DECLARE_MSM_GPIO_PINS(45); 298 + DECLARE_MSM_GPIO_PINS(46); 299 + DECLARE_MSM_GPIO_PINS(47); 300 + DECLARE_MSM_GPIO_PINS(48); 301 + DECLARE_MSM_GPIO_PINS(49); 302 + DECLARE_MSM_GPIO_PINS(50); 303 + DECLARE_MSM_GPIO_PINS(51); 304 + DECLARE_MSM_GPIO_PINS(52); 305 + DECLARE_MSM_GPIO_PINS(53); 306 + DECLARE_MSM_GPIO_PINS(54); 307 + DECLARE_MSM_GPIO_PINS(55); 308 + DECLARE_MSM_GPIO_PINS(56); 309 + DECLARE_MSM_GPIO_PINS(57); 310 + DECLARE_MSM_GPIO_PINS(58); 311 + DECLARE_MSM_GPIO_PINS(59); 312 + DECLARE_MSM_GPIO_PINS(60); 313 + DECLARE_MSM_GPIO_PINS(61); 314 + DECLARE_MSM_GPIO_PINS(62); 315 + DECLARE_MSM_GPIO_PINS(63); 316 + DECLARE_MSM_GPIO_PINS(64); 317 + DECLARE_MSM_GPIO_PINS(65); 318 + DECLARE_MSM_GPIO_PINS(66); 319 + DECLARE_MSM_GPIO_PINS(67); 320 + DECLARE_MSM_GPIO_PINS(68); 321 + DECLARE_MSM_GPIO_PINS(69); 322 + DECLARE_MSM_GPIO_PINS(70); 323 + DECLARE_MSM_GPIO_PINS(71); 324 + DECLARE_MSM_GPIO_PINS(72); 325 + DECLARE_MSM_GPIO_PINS(73); 326 + DECLARE_MSM_GPIO_PINS(74); 327 + DECLARE_MSM_GPIO_PINS(75); 328 + DECLARE_MSM_GPIO_PINS(76); 329 + DECLARE_MSM_GPIO_PINS(77); 330 + DECLARE_MSM_GPIO_PINS(78); 331 + DECLARE_MSM_GPIO_PINS(79); 332 + DECLARE_MSM_GPIO_PINS(80); 333 + DECLARE_MSM_GPIO_PINS(81); 334 + DECLARE_MSM_GPIO_PINS(82); 335 + DECLARE_MSM_GPIO_PINS(83); 336 + DECLARE_MSM_GPIO_PINS(84); 337 + DECLARE_MSM_GPIO_PINS(85); 338 + DECLARE_MSM_GPIO_PINS(86); 339 + DECLARE_MSM_GPIO_PINS(87); 340 + DECLARE_MSM_GPIO_PINS(88); 341 + DECLARE_MSM_GPIO_PINS(89); 342 + DECLARE_MSM_GPIO_PINS(90); 343 + DECLARE_MSM_GPIO_PINS(91); 344 + DECLARE_MSM_GPIO_PINS(92); 345 + DECLARE_MSM_GPIO_PINS(93); 346 + DECLARE_MSM_GPIO_PINS(94); 347 + DECLARE_MSM_GPIO_PINS(95); 348 + DECLARE_MSM_GPIO_PINS(96); 349 + DECLARE_MSM_GPIO_PINS(97); 350 + DECLARE_MSM_GPIO_PINS(98); 351 + DECLARE_MSM_GPIO_PINS(99); 352 + DECLARE_MSM_GPIO_PINS(100); 353 + DECLARE_MSM_GPIO_PINS(101); 354 + DECLARE_MSM_GPIO_PINS(102); 355 + DECLARE_MSM_GPIO_PINS(103); 356 + DECLARE_MSM_GPIO_PINS(104); 357 + DECLARE_MSM_GPIO_PINS(105); 358 + DECLARE_MSM_GPIO_PINS(106); 359 + DECLARE_MSM_GPIO_PINS(107); 360 + DECLARE_MSM_GPIO_PINS(108); 361 + DECLARE_MSM_GPIO_PINS(109); 362 + DECLARE_MSM_GPIO_PINS(110); 363 + DECLARE_MSM_GPIO_PINS(111); 364 + DECLARE_MSM_GPIO_PINS(112); 365 + DECLARE_MSM_GPIO_PINS(113); 366 + DECLARE_MSM_GPIO_PINS(114); 367 + DECLARE_MSM_GPIO_PINS(115); 368 + DECLARE_MSM_GPIO_PINS(116); 369 + DECLARE_MSM_GPIO_PINS(117); 370 + DECLARE_MSM_GPIO_PINS(118); 371 + DECLARE_MSM_GPIO_PINS(119); 372 + DECLARE_MSM_GPIO_PINS(120); 373 + DECLARE_MSM_GPIO_PINS(121); 374 + DECLARE_MSM_GPIO_PINS(122); 375 + 376 + static const unsigned int ufs_reset_pins[] = { 123 }; 377 + static const unsigned int sdc1_rclk_pins[] = { 124 }; 378 + static const unsigned int sdc1_clk_pins[] = { 125 }; 379 + static const unsigned int sdc1_cmd_pins[] = { 126 }; 380 + static const unsigned int sdc1_data_pins[] = { 127 }; 381 + static const unsigned int sdc2_clk_pins[] = { 128 }; 382 + static const unsigned int sdc2_cmd_pins[] = { 129 }; 383 + static const unsigned int sdc2_data_pins[] = { 130 }; 384 + 385 + enum qcs615_functions { 386 + msm_mux_gpio, 387 + msm_mux_adsp_ext, 388 + msm_mux_agera_pll, 389 + msm_mux_aoss_cti, 390 + msm_mux_atest_char, 391 + msm_mux_atest_tsens, 392 + msm_mux_atest_usb, 393 + msm_mux_cam_mclk, 394 + msm_mux_cci_async, 395 + msm_mux_cci_i2c, 396 + msm_mux_cci_timer, 397 + msm_mux_copy_gp, 398 + msm_mux_copy_phase, 399 + msm_mux_cri_trng, 400 + msm_mux_dbg_out_clk, 401 + msm_mux_ddr_bist, 402 + msm_mux_ddr_pxi, 403 + msm_mux_dp_hot, 404 + msm_mux_edp_hot, 405 + msm_mux_edp_lcd, 406 + msm_mux_emac_gcc, 407 + msm_mux_emac_phy_intr, 408 + msm_mux_forced_usb, 409 + msm_mux_gcc_gp, 410 + msm_mux_gp_pdm, 411 + msm_mux_gps_tx, 412 + msm_mux_hs0_mi2s, 413 + msm_mux_hs1_mi2s, 414 + msm_mux_jitter_bist, 415 + msm_mux_ldo_en, 416 + msm_mux_ldo_update, 417 + msm_mux_m_voc, 418 + msm_mux_mclk1, 419 + msm_mux_mclk2, 420 + msm_mux_mdp_vsync, 421 + msm_mux_mdp_vsync0_out, 422 + msm_mux_mdp_vsync1_out, 423 + msm_mux_mdp_vsync2_out, 424 + msm_mux_mdp_vsync3_out, 425 + msm_mux_mdp_vsync4_out, 426 + msm_mux_mdp_vsync5_out, 427 + msm_mux_mi2s_1, 428 + msm_mux_mss_lte, 429 + msm_mux_nav_pps_in, 430 + msm_mux_nav_pps_out, 431 + msm_mux_pa_indicator_or, 432 + msm_mux_pcie_clk_req, 433 + msm_mux_pcie_ep_rst, 434 + msm_mux_phase_flag, 435 + msm_mux_pll_bist, 436 + msm_mux_pll_bypassnl, 437 + msm_mux_pll_reset_n, 438 + msm_mux_prng_rosc, 439 + msm_mux_qdss_cti, 440 + msm_mux_qdss_gpio, 441 + msm_mux_qlink_enable, 442 + msm_mux_qlink_request, 443 + msm_mux_qspi, 444 + msm_mux_qup0, 445 + msm_mux_qup1, 446 + msm_mux_rgmii, 447 + msm_mux_sd_write_protect, 448 + msm_mux_sp_cmu, 449 + msm_mux_ter_mi2s, 450 + msm_mux_tgu_ch, 451 + msm_mux_uim1, 452 + msm_mux_uim2, 453 + msm_mux_usb0_hs, 454 + msm_mux_usb1_hs, 455 + msm_mux_usb_phy_ps, 456 + msm_mux_vfr_1, 457 + msm_mux_vsense_trigger_mirnat, 458 + msm_mux_wlan, 459 + msm_mux_wsa_clk, 460 + msm_mux_wsa_data, 461 + msm_mux__, 462 + }; 463 + 464 + static const char *const gpio_groups[] = { 465 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", 466 + "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", 467 + "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", 468 + "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", 469 + "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", 470 + "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 471 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", 472 + "gpio42", "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", 473 + "gpio48", "gpio49", "gpio50", "gpio51", "gpio52", "gpio53", 474 + "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", "gpio59", 475 + "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65", 476 + "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", "gpio71", 477 + "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 478 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", 479 + "gpio84", "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", 480 + "gpio90", "gpio91", "gpio92", "gpio93", "gpio94", "gpio95", 481 + "gpio96", "gpio97", "gpio98", "gpio99", "gpio100", "gpio101", 482 + "gpio102", "gpio103", "gpio104", "gpio105", "gpio106", "gpio107", 483 + "gpio108", "gpio109", "gpio110", "gpio111", "gpio112", "gpio113", 484 + "gpio114", "gpio115", "gpio116", "gpio117", "gpio118", "gpio119", 485 + "gpio120", "gpio121", "gpio122", 486 + }; 487 + 488 + static const char *const adsp_ext_groups[] = { 489 + "gpio118", 490 + }; 491 + 492 + static const char *const agera_pll_groups[] = { 493 + "gpio28", 494 + }; 495 + 496 + static const char *const aoss_cti_groups[] = { 497 + "gpio76", 498 + }; 499 + 500 + static const char *const atest_char_groups[] = { 501 + "gpio84", "gpio85", "gpio86", "gpio87", 502 + "gpio115", "gpio117", "gpio118", "gpio119", 503 + "gpio120", "gpio121", 504 + }; 505 + 506 + static const char *const atest_tsens_groups[] = { 507 + "gpio7", "gpio29", 508 + }; 509 + 510 + static const char *const atest_usb_groups[] = { 511 + "gpio7", "gpio10", "gpio11", "gpio54", 512 + "gpio55", "gpio67", "gpio68", "gpio76", 513 + "gpio75", "gpio77", 514 + }; 515 + 516 + static const char *const cam_mclk_groups[] = { 517 + "gpio28", "gpio29", "gpio30", "gpio31", 518 + }; 519 + 520 + static const char *const cci_async_groups[] = { 521 + "gpio26", "gpio41", "gpio42", 522 + }; 523 + 524 + static const char *const cci_i2c_groups[] = { 525 + "gpio32", "gpio33", "gpio34", "gpio35", 526 + }; 527 + 528 + static const char *const cci_timer_groups[] = { 529 + "gpio37", "gpio38", "gpio39", "gpio41", 530 + "gpio42", 531 + }; 532 + 533 + static const char *const copy_gp_groups[] = { 534 + "gpio86", 535 + }; 536 + 537 + static const char *const copy_phase_groups[] = { 538 + "gpio103", 539 + }; 540 + 541 + static const char *const cri_trng_groups[] = { 542 + "gpio60", "gpio61", "gpio62", 543 + }; 544 + 545 + static const char *const dbg_out_clk_groups[] = { 546 + "gpio11", 547 + }; 548 + 549 + static const char *const ddr_bist_groups[] = { 550 + "gpio7", "gpio8", "gpio9", "gpio10", 551 + }; 552 + 553 + static const char *const ddr_pxi_groups[] = { 554 + "gpio6", "gpio7", "gpio10", "gpio11", 555 + "gpio12", "gpio13", "gpio54", "gpio55", 556 + }; 557 + 558 + static const char *const dp_hot_groups[] = { 559 + "gpio102", "gpio103", "gpio104", 560 + }; 561 + 562 + static const char *const edp_hot_groups[] = { 563 + "gpio113", 564 + }; 565 + 566 + static const char *const edp_lcd_groups[] = { 567 + "gpio119", 568 + }; 569 + 570 + static const char *const emac_gcc_groups[] = { 571 + "gpio101", "gpio102", 572 + }; 573 + 574 + static const char *const emac_phy_intr_groups[] = { 575 + "gpio89", 576 + }; 577 + 578 + static const char *const forced_usb_groups[] = { 579 + "gpio43", 580 + }; 581 + 582 + static const char *const gcc_gp_groups[] = { 583 + "gpio21", "gpio22", "gpio57", "gpio58", 584 + "gpio59", "gpio78", 585 + }; 586 + 587 + static const char *const gp_pdm_groups[] = { 588 + "gpio8", "gpio54", "gpio63", "gpio66", 589 + "gpio79", "gpio95", 590 + }; 591 + 592 + static const char *const gps_tx_groups[] = { 593 + "gpio53", "gpio54", "gpio56", "gpio57", 594 + "gpio59", "gpio60", 595 + }; 596 + 597 + static const char *const hs0_mi2s_groups[] = { 598 + "gpio36", "gpio37", "gpio38", "gpio39", 599 + }; 600 + 601 + static const char *const hs1_mi2s_groups[] = { 602 + "gpio24", "gpio25", "gpio26", "gpio27", 603 + }; 604 + 605 + static const char *const jitter_bist_groups[] = { 606 + "gpio12", "gpio26", 607 + }; 608 + 609 + static const char *const ldo_en_groups[] = { 610 + "gpio97", 611 + }; 612 + 613 + static const char *const ldo_update_groups[] = { 614 + "gpio98", 615 + }; 616 + 617 + static const char *const m_voc_groups[] = { 618 + "gpio120", 619 + }; 620 + 621 + static const char *const mclk1_groups[] = { 622 + "gpio121", 623 + }; 624 + 625 + static const char *const mclk2_groups[] = { 626 + "gpio122", 627 + }; 628 + 629 + static const char *const mdp_vsync_groups[] = { 630 + "gpio81", "gpio82", "gpio83", "gpio90", 631 + "gpio97", "gpio98", 632 + }; 633 + 634 + static const char *const mdp_vsync0_out_groups[] = { 635 + "gpio90", 636 + }; 637 + 638 + static const char *const mdp_vsync1_out_groups[] = { 639 + "gpio90", 640 + }; 641 + 642 + static const char *const mdp_vsync2_out_groups[] = { 643 + "gpio90", 644 + }; 645 + 646 + static const char *const mdp_vsync3_out_groups[] = { 647 + "gpio90", 648 + }; 649 + 650 + static const char *const mdp_vsync4_out_groups[] = { 651 + "gpio90", 652 + }; 653 + 654 + static const char *const mdp_vsync5_out_groups[] = { 655 + "gpio90", 656 + }; 657 + 658 + static const char *const mi2s_1_groups[] = { 659 + "gpio108", "gpio109", "gpio110", "gpio111", 660 + }; 661 + 662 + static const char *const mss_lte_groups[] = { 663 + "gpio106", "gpio107", 664 + }; 665 + 666 + static const char *const nav_pps_in_groups[] = { 667 + "gpio53", "gpio56", "gpio57", "gpio59", 668 + "gpio60", 669 + }; 670 + 671 + static const char *const nav_pps_out_groups[] = { 672 + "gpio53", "gpio56", "gpio57", "gpio59", 673 + "gpio60", 674 + }; 675 + 676 + static const char *const pa_indicator_or_groups[] = { 677 + "gpio53", 678 + }; 679 + 680 + static const char *const pcie_clk_req_groups[] = { 681 + "gpio90", 682 + }; 683 + 684 + static const char *const pcie_ep_rst_groups[] = { 685 + "gpio89", 686 + }; 687 + 688 + static const char *const phase_flag_groups[] = { 689 + "gpio10", "gpio18", "gpio19", "gpio20", 690 + "gpio23", "gpio24", "gpio25", "gpio38", 691 + "gpio40", "gpio41", "gpio42", "gpio43", 692 + "gpio44", "gpio45", "gpio53", "gpio54", 693 + "gpio55", "gpio67", "gpio68", "gpio75", 694 + "gpio76", "gpio77", "gpio78", "gpio79", 695 + "gpio80", "gpio82", "gpio84", "gpio92", 696 + "gpio116", "gpio117", "gpio118", "gpio119", 697 + }; 698 + 699 + static const char *const pll_bist_groups[] = { 700 + "gpio27", 701 + }; 702 + 703 + static const char *const pll_bypassnl_groups[] = { 704 + "gpio13", 705 + }; 706 + 707 + static const char *const pll_reset_n_groups[] = { 708 + "gpio14", 709 + }; 710 + 711 + static const char *const prng_rosc_groups[] = { 712 + "gpio99", "gpio102", 713 + }; 714 + 715 + static const char *const qdss_cti_groups[] = { 716 + "gpio83", "gpio96", "gpio97", "gpio98", 717 + "gpio103", "gpio104", "gpio112", "gpio113", 718 + }; 719 + 720 + static const char *const qdss_gpio_groups[] = { 721 + "gpio0", "gpio1", "gpio2", "gpio3", 722 + "gpio6", "gpio7", "gpio8", "gpio9", 723 + "gpio14", "gpio15", "gpio20", "gpio21", 724 + "gpio28", "gpio29", "gpio30", "gpio31", 725 + "gpio32", "gpio33", "gpio34", "gpio35", 726 + "gpio44", "gpio45", "gpio46", "gpio47", 727 + "gpio81", "gpio82", "gpio92", "gpio93", 728 + "gpio94", "gpio95", "gpio108", "gpio109", 729 + "gpio117", "gpio118", "gpio119", "gpio120", 730 + }; 731 + 732 + static const char *const qlink_enable_groups[] = { 733 + "gpio52", 734 + }; 735 + 736 + static const char *const qlink_request_groups[] = { 737 + "gpio51", 738 + }; 739 + 740 + static const char *const qspi_groups[] = { 741 + "gpio44", "gpio45", "gpio46", "gpio47", 742 + "gpio48", "gpio49", "gpio50", 743 + }; 744 + 745 + static const char *const qup0_groups[] = { 746 + "gpio0", "gpio1", "gpio2", "gpio3", 747 + "gpio4", "gpio5", "gpio16", "gpio17", 748 + "gpio18", "gpio19", 749 + }; 750 + 751 + static const char *const qup1_groups[] = { 752 + "gpio6", "gpio7", "gpio8", "gpio9", 753 + "gpio10", "gpio11", "gpio12", "gpio13", 754 + "gpio14", "gpio15", "gpio20", "gpio21", 755 + "gpio22", "gpio23", 756 + }; 757 + 758 + static const char *const rgmii_groups[] = { 759 + "gpio81", "gpio82", "gpio83", "gpio91", 760 + "gpio92", "gpio93", "gpio94", "gpio95", 761 + "gpio96", "gpio97", "gpio102", "gpio103", 762 + "gpio112", "gpio113", "gpio114", 763 + }; 764 + 765 + static const char *const sd_write_protect_groups[] = { 766 + "gpio24", 767 + }; 768 + 769 + static const char *const sp_cmu_groups[] = { 770 + "gpio64", 771 + }; 772 + 773 + static const char *const ter_mi2s_groups[] = { 774 + "gpio115", "gpio116", "gpio117", "gpio118", 775 + }; 776 + 777 + static const char *const tgu_ch_groups[] = { 778 + "gpio89", "gpio90", "gpio91", "gpio92", 779 + }; 780 + 781 + static const char *const uim1_groups[] = { 782 + "gpio77", "gpio78", "gpio79", "gpio80", 783 + }; 784 + 785 + static const char *const uim2_groups[] = { 786 + "gpio73", "gpio74", "gpio75", "gpio76", 787 + }; 788 + 789 + static const char *const usb0_hs_groups[] = { 790 + "gpio88", 791 + }; 792 + 793 + static const char *const usb1_hs_groups[] = { 794 + "gpio89", 795 + }; 796 + 797 + static const char *const usb_phy_ps_groups[] = { 798 + "gpio104", 799 + }; 800 + 801 + static const char *const vfr_1_groups[] = { 802 + "gpio92", 803 + }; 804 + 805 + static const char *const vsense_trigger_mirnat_groups[] = { 806 + "gpio7", 807 + }; 808 + 809 + static const char *const wlan_groups[] = { 810 + "gpio16", "gpio17", "gpio47", "gpio48", 811 + }; 812 + 813 + static const char *const wsa_clk_groups[] = { 814 + "gpio111", 815 + }; 816 + 817 + static const char *const wsa_data_groups[] = { 818 + "gpio110", 819 + }; 820 + 821 + static const struct pinfunction qcs615_functions[] = { 822 + MSM_PIN_FUNCTION(gpio), 823 + MSM_PIN_FUNCTION(adsp_ext), 824 + MSM_PIN_FUNCTION(agera_pll), 825 + MSM_PIN_FUNCTION(aoss_cti), 826 + MSM_PIN_FUNCTION(atest_char), 827 + MSM_PIN_FUNCTION(atest_tsens), 828 + MSM_PIN_FUNCTION(atest_usb), 829 + MSM_PIN_FUNCTION(cam_mclk), 830 + MSM_PIN_FUNCTION(cci_async), 831 + MSM_PIN_FUNCTION(cci_i2c), 832 + MSM_PIN_FUNCTION(cci_timer), 833 + MSM_PIN_FUNCTION(copy_gp), 834 + MSM_PIN_FUNCTION(copy_phase), 835 + MSM_PIN_FUNCTION(cri_trng), 836 + MSM_PIN_FUNCTION(dbg_out_clk), 837 + MSM_PIN_FUNCTION(ddr_bist), 838 + MSM_PIN_FUNCTION(ddr_pxi), 839 + MSM_PIN_FUNCTION(dp_hot), 840 + MSM_PIN_FUNCTION(edp_hot), 841 + MSM_PIN_FUNCTION(edp_lcd), 842 + MSM_PIN_FUNCTION(emac_gcc), 843 + MSM_PIN_FUNCTION(emac_phy_intr), 844 + MSM_PIN_FUNCTION(forced_usb), 845 + MSM_PIN_FUNCTION(gcc_gp), 846 + MSM_PIN_FUNCTION(gp_pdm), 847 + MSM_PIN_FUNCTION(gps_tx), 848 + MSM_PIN_FUNCTION(hs0_mi2s), 849 + MSM_PIN_FUNCTION(hs1_mi2s), 850 + MSM_PIN_FUNCTION(jitter_bist), 851 + MSM_PIN_FUNCTION(ldo_en), 852 + MSM_PIN_FUNCTION(ldo_update), 853 + MSM_PIN_FUNCTION(m_voc), 854 + MSM_PIN_FUNCTION(mclk1), 855 + MSM_PIN_FUNCTION(mclk2), 856 + MSM_PIN_FUNCTION(mdp_vsync), 857 + MSM_PIN_FUNCTION(mdp_vsync0_out), 858 + MSM_PIN_FUNCTION(mdp_vsync1_out), 859 + MSM_PIN_FUNCTION(mdp_vsync2_out), 860 + MSM_PIN_FUNCTION(mdp_vsync3_out), 861 + MSM_PIN_FUNCTION(mdp_vsync4_out), 862 + MSM_PIN_FUNCTION(mdp_vsync5_out), 863 + MSM_PIN_FUNCTION(mi2s_1), 864 + MSM_PIN_FUNCTION(mss_lte), 865 + MSM_PIN_FUNCTION(nav_pps_in), 866 + MSM_PIN_FUNCTION(nav_pps_out), 867 + MSM_PIN_FUNCTION(pa_indicator_or), 868 + MSM_PIN_FUNCTION(pcie_clk_req), 869 + MSM_PIN_FUNCTION(pcie_ep_rst), 870 + MSM_PIN_FUNCTION(phase_flag), 871 + MSM_PIN_FUNCTION(pll_bist), 872 + MSM_PIN_FUNCTION(pll_bypassnl), 873 + MSM_PIN_FUNCTION(pll_reset_n), 874 + MSM_PIN_FUNCTION(prng_rosc), 875 + MSM_PIN_FUNCTION(qdss_cti), 876 + MSM_PIN_FUNCTION(qdss_gpio), 877 + MSM_PIN_FUNCTION(qlink_enable), 878 + MSM_PIN_FUNCTION(qlink_request), 879 + MSM_PIN_FUNCTION(qspi), 880 + MSM_PIN_FUNCTION(qup0), 881 + MSM_PIN_FUNCTION(qup1), 882 + MSM_PIN_FUNCTION(rgmii), 883 + MSM_PIN_FUNCTION(sd_write_protect), 884 + MSM_PIN_FUNCTION(sp_cmu), 885 + MSM_PIN_FUNCTION(ter_mi2s), 886 + MSM_PIN_FUNCTION(tgu_ch), 887 + MSM_PIN_FUNCTION(uim1), 888 + MSM_PIN_FUNCTION(uim2), 889 + MSM_PIN_FUNCTION(usb0_hs), 890 + MSM_PIN_FUNCTION(usb1_hs), 891 + MSM_PIN_FUNCTION(usb_phy_ps), 892 + MSM_PIN_FUNCTION(vfr_1), 893 + MSM_PIN_FUNCTION(vsense_trigger_mirnat), 894 + MSM_PIN_FUNCTION(wlan), 895 + MSM_PIN_FUNCTION(wsa_clk), 896 + MSM_PIN_FUNCTION(wsa_data), 897 + }; 898 + 899 + /* Every pin is maintained as a single group, and missing or non-existing pin 900 + * would be maintained as dummy group to synchronize pin group index with 901 + * pin descriptor registered with pinctrl core. 902 + * Clients would not be able to request these dummy pin groups. 903 + */ 904 + static const struct msm_pingroup qcs615_groups[] = { 905 + [0] = PINGROUP(0, WEST, qup0, _, qdss_gpio, _, _, _, _, _, _), 906 + [1] = PINGROUP(1, WEST, qup0, _, qdss_gpio, _, _, _, _, _, _), 907 + [2] = PINGROUP(2, WEST, qup0, _, qdss_gpio, _, _, _, _, _, _), 908 + [3] = PINGROUP(3, WEST, qup0, _, qdss_gpio, _, _, _, _, _, _), 909 + [4] = PINGROUP(4, WEST, qup0, _, _, _, _, _, _, _, _), 910 + [5] = PINGROUP(5, WEST, qup0, _, _, _, _, _, _, _, _), 911 + [6] = PINGROUP(6, EAST, qup1, qdss_gpio, ddr_pxi, _, _, _, _, _, _), 912 + [7] = PINGROUP(7, EAST, qup1, ddr_bist, qdss_gpio, atest_tsens, 913 + vsense_trigger_mirnat, atest_usb, ddr_pxi, _, _), 914 + [8] = PINGROUP(8, EAST, qup1, gp_pdm, ddr_bist, qdss_gpio, _, _, _, _, _), 915 + [9] = PINGROUP(9, EAST, qup1, ddr_bist, qdss_gpio, _, _, _, _, _, _), 916 + [10] = PINGROUP(10, EAST, qup1, ddr_bist, _, phase_flag, atest_usb, ddr_pxi, _, _, _), 917 + [11] = PINGROUP(11, EAST, qup1, dbg_out_clk, atest_usb, ddr_pxi, _, _, _, _, _), 918 + [12] = PINGROUP(12, EAST, qup1, jitter_bist, ddr_pxi, _, _, _, _, _, _), 919 + [13] = PINGROUP(13, EAST, qup1, pll_bypassnl, _, ddr_pxi, _, _, _, _, _), 920 + [14] = PINGROUP(14, EAST, qup1, pll_reset_n, _, qdss_gpio, _, _, _, _, _), 921 + [15] = PINGROUP(15, EAST, qup1, qdss_gpio, _, _, _, _, _, _, _), 922 + [16] = PINGROUP(16, WEST, qup0, _, wlan, _, _, _, _, _, _), 923 + [17] = PINGROUP(17, WEST, qup0, _, wlan, _, _, _, _, _, _), 924 + [18] = PINGROUP(18, WEST, qup0, _, phase_flag, _, _, _, _, _, _), 925 + [19] = PINGROUP(19, WEST, qup0, _, phase_flag, _, _, _, _, _, _), 926 + [20] = PINGROUP(20, SOUTH, qup1, _, phase_flag, qdss_gpio, _, _, _, _, _), 927 + [21] = PINGROUP(21, SOUTH, qup1, gcc_gp, _, qdss_gpio, _, _, _, _, _), 928 + [22] = PINGROUP(22, SOUTH, qup1, gcc_gp, _, _, _, _, _, _, _), 929 + [23] = PINGROUP(23, SOUTH, qup1, _, phase_flag, _, _, _, _, _, _), 930 + [24] = PINGROUP(24, EAST, hs1_mi2s, sd_write_protect, _, phase_flag, _, _, _, _, _), 931 + [25] = PINGROUP(25, EAST, hs1_mi2s, _, phase_flag, _, _, _, _, _, _), 932 + [26] = PINGROUP(26, EAST, cci_async, hs1_mi2s, jitter_bist, _, _, _, _, _, _), 933 + [27] = PINGROUP(27, EAST, hs1_mi2s, pll_bist, _, _, _, _, _, _, _), 934 + [28] = PINGROUP(28, EAST, cam_mclk, agera_pll, qdss_gpio, _, _, _, _, _, _), 935 + [29] = PINGROUP(29, EAST, cam_mclk, _, qdss_gpio, atest_tsens, _, _, _, _, _), 936 + [30] = PINGROUP(30, EAST, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 937 + [31] = PINGROUP(31, EAST, cam_mclk, _, qdss_gpio, _, _, _, _, _, _), 938 + [32] = PINGROUP(32, EAST, cci_i2c, _, qdss_gpio, _, _, _, _, _, _), 939 + [33] = PINGROUP(33, EAST, cci_i2c, _, qdss_gpio, _, _, _, _, _, _), 940 + [34] = PINGROUP(34, EAST, cci_i2c, _, qdss_gpio, _, _, _, _, _, _), 941 + [35] = PINGROUP(35, EAST, cci_i2c, _, qdss_gpio, _, _, _, _, _, _), 942 + [36] = PINGROUP(36, EAST, hs0_mi2s, _, _, _, _, _, _, _, _), 943 + [37] = PINGROUP(37, EAST, cci_timer, hs0_mi2s, _, _, _, _, _, _, _), 944 + [38] = PINGROUP(38, EAST, cci_timer, hs0_mi2s, _, phase_flag, _, _, _, _, _), 945 + [39] = PINGROUP(39, EAST, cci_timer, hs0_mi2s, _, _, _, _, _, _, _), 946 + [40] = PINGROUP(40, EAST, _, phase_flag, _, _, _, _, _, _, _), 947 + [41] = PINGROUP(41, EAST, cci_async, cci_timer, _, phase_flag, _, _, _, _, _), 948 + [42] = PINGROUP(42, EAST, cci_async, cci_timer, _, phase_flag, _, _, _, _, _), 949 + [43] = PINGROUP(43, SOUTH, _, phase_flag, forced_usb, _, _, _, _, _, _), 950 + [44] = PINGROUP(44, EAST, qspi, _, phase_flag, qdss_gpio, _, _, _, _, _), 951 + [45] = PINGROUP(45, EAST, qspi, _, phase_flag, qdss_gpio, _, _, _, _, _), 952 + [46] = PINGROUP(46, EAST, qspi, _, qdss_gpio, _, _, _, _, _, _), 953 + [47] = PINGROUP(47, EAST, qspi, _, qdss_gpio, wlan, _, _, _, _, _), 954 + [48] = PINGROUP(48, EAST, qspi, _, wlan, _, _, _, _, _, _), 955 + [49] = PINGROUP(49, EAST, qspi, _, _, _, _, _, _, _, _), 956 + [50] = PINGROUP(50, EAST, qspi, _, _, _, _, _, _, _, _), 957 + [51] = PINGROUP(51, SOUTH, qlink_request, _, _, _, _, _, _, _, _), 958 + [52] = PINGROUP(52, SOUTH, qlink_enable, _, _, _, _, _, _, _, _), 959 + [53] = PINGROUP(53, SOUTH, pa_indicator_or, nav_pps_in, nav_pps_out, gps_tx, _, 960 + phase_flag, _, _, _), 961 + [54] = PINGROUP(54, SOUTH, _, gps_tx, gp_pdm, _, phase_flag, atest_usb, ddr_pxi, _, _), 962 + [55] = PINGROUP(55, SOUTH, _, _, phase_flag, atest_usb, ddr_pxi, _, _, _, _), 963 + [56] = PINGROUP(56, SOUTH, _, nav_pps_in, nav_pps_out, gps_tx, _, _, _, _, _), 964 + [57] = PINGROUP(57, SOUTH, _, nav_pps_in, gps_tx, nav_pps_out, gcc_gp, _, _, _, _), 965 + [58] = PINGROUP(58, SOUTH, _, gcc_gp, _, _, _, _, _, _, _), 966 + [59] = PINGROUP(59, SOUTH, _, nav_pps_in, nav_pps_out, gps_tx, gcc_gp, _, _, _, _), 967 + [60] = PINGROUP(60, SOUTH, _, nav_pps_in, nav_pps_out, gps_tx, cri_trng, _, _, _, _), 968 + [61] = PINGROUP(61, SOUTH, _, cri_trng, _, _, _, _, _, _, _), 969 + [62] = PINGROUP(62, SOUTH, _, cri_trng, _, _, _, _, _, _, _), 970 + [63] = PINGROUP(63, SOUTH, _, _, gp_pdm, _, _, _, _, _, _), 971 + [64] = PINGROUP(64, SOUTH, _, sp_cmu, _, _, _, _, _, _, _), 972 + [65] = PINGROUP(65, SOUTH, _, _, _, _, _, _, _, _, _), 973 + [66] = PINGROUP(66, SOUTH, _, gp_pdm, _, _, _, _, _, _, _), 974 + [67] = PINGROUP(67, SOUTH, _, _, _, phase_flag, atest_usb, _, _, _, _), 975 + [68] = PINGROUP(68, SOUTH, _, _, _, phase_flag, atest_usb, _, _, _, _), 976 + [69] = PINGROUP(69, SOUTH, _, _, _, _, _, _, _, _, _), 977 + [70] = PINGROUP(70, SOUTH, _, _, _, _, _, _, _, _, _), 978 + [71] = PINGROUP(71, SOUTH, _, _, _, _, _, _, _, _, _), 979 + [72] = PINGROUP(72, SOUTH, _, _, _, _, _, _, _, _, _), 980 + [73] = PINGROUP(73, SOUTH, uim2, _, _, _, _, _, _, _, _), 981 + [74] = PINGROUP(74, SOUTH, uim2, _, _, _, _, _, _, _, _), 982 + [75] = PINGROUP(75, SOUTH, uim2, _, phase_flag, atest_usb, _, _, _, _, _), 983 + [76] = PINGROUP(76, SOUTH, uim2, _, phase_flag, atest_usb, aoss_cti, _, _, _, _), 984 + [77] = PINGROUP(77, SOUTH, uim1, _, phase_flag, atest_usb, _, _, _, _, _), 985 + [78] = PINGROUP(78, SOUTH, uim1, gcc_gp, _, phase_flag, _, _, _, _, _), 986 + [79] = PINGROUP(79, SOUTH, uim1, gp_pdm, _, phase_flag, _, _, _, _, _), 987 + [80] = PINGROUP(80, SOUTH, uim1, _, phase_flag, _, _, _, _, _, _), 988 + [81] = PINGROUP(81, WEST, rgmii, mdp_vsync, _, qdss_gpio, _, _, _, _, _), 989 + [82] = PINGROUP(82, WEST, rgmii, mdp_vsync, _, phase_flag, qdss_gpio, _, _, _, _), 990 + [83] = PINGROUP(83, WEST, rgmii, mdp_vsync, _, qdss_cti, _, _, _, _, _), 991 + [84] = PINGROUP(84, SOUTH, _, phase_flag, atest_char, _, _, _, _, _, _), 992 + [85] = PINGROUP(85, SOUTH, _, atest_char, _, _, _, _, _, _, _), 993 + [86] = PINGROUP(86, SOUTH, copy_gp, _, atest_char, _, _, _, _, _, _), 994 + [87] = PINGROUP(87, SOUTH, _, atest_char, _, _, _, _, _, _, _), 995 + [88] = PINGROUP(88, WEST, _, usb0_hs, _, _, _, _, _, _, _), 996 + [89] = PINGROUP(89, WEST, emac_phy_intr, pcie_ep_rst, tgu_ch, usb1_hs, _, _, _, _, _), 997 + [90] = PINGROUP(90, WEST, mdp_vsync, mdp_vsync0_out, mdp_vsync1_out, 998 + mdp_vsync2_out, mdp_vsync3_out, mdp_vsync4_out, mdp_vsync5_out, 999 + pcie_clk_req, tgu_ch), 1000 + [91] = PINGROUP(91, WEST, rgmii, tgu_ch, _, _, _, _, _, _, _), 1001 + [92] = PINGROUP(92, WEST, rgmii, vfr_1, tgu_ch, _, phase_flag, qdss_gpio, _, _, _), 1002 + [93] = PINGROUP(93, WEST, rgmii, qdss_gpio, _, _, _, _, _, _, _), 1003 + [94] = PINGROUP(94, WEST, rgmii, qdss_gpio, _, _, _, _, _, _, _), 1004 + [95] = PINGROUP(95, WEST, rgmii, gp_pdm, qdss_gpio, _, _, _, _, _, _), 1005 + [96] = PINGROUP(96, WEST, rgmii, qdss_cti, _, _, _, _, _, _, _), 1006 + [97] = PINGROUP(97, WEST, rgmii, mdp_vsync, ldo_en, qdss_cti, _, _, _, _, _), 1007 + [98] = PINGROUP(98, WEST, mdp_vsync, ldo_update, qdss_cti, _, _, _, _, _, _), 1008 + [99] = PINGROUP(99, EAST, prng_rosc, _, _, _, _, _, _, _, _), 1009 + [100] = PINGROUP(100, WEST, _, _, _, _, _, _, _, _, _), 1010 + [101] = PINGROUP(101, WEST, emac_gcc, _, _, _, _, _, _, _, _), 1011 + [102] = PINGROUP(102, WEST, rgmii, dp_hot, emac_gcc, prng_rosc, _, _, _, _, _), 1012 + [103] = PINGROUP(103, WEST, rgmii, dp_hot, copy_phase, qdss_cti, _, _, _, _, _), 1013 + [104] = PINGROUP(104, WEST, usb_phy_ps, _, qdss_cti, dp_hot, _, _, _, _, _), 1014 + [105] = PINGROUP(105, SOUTH, _, _, _, _, _, _, _, _, _), 1015 + [106] = PINGROUP(106, EAST, mss_lte, _, _, _, _, _, _, _, _), 1016 + [107] = PINGROUP(107, EAST, mss_lte, _, _, _, _, _, _, _, _), 1017 + [108] = PINGROUP(108, SOUTH, mi2s_1, _, qdss_gpio, _, _, _, _, _, _), 1018 + [109] = PINGROUP(109, SOUTH, mi2s_1, _, qdss_gpio, _, _, _, _, _, _), 1019 + [110] = PINGROUP(110, SOUTH, wsa_data, mi2s_1, _, _, _, _, _, _, _), 1020 + [111] = PINGROUP(111, SOUTH, wsa_clk, mi2s_1, _, _, _, _, _, _, _), 1021 + [112] = PINGROUP(112, WEST, rgmii, _, qdss_cti, _, _, _, _, _, _), 1022 + [113] = PINGROUP(113, WEST, rgmii, edp_hot, _, qdss_cti, _, _, _, _, _), 1023 + [114] = PINGROUP(114, WEST, rgmii, _, _, _, _, _, _, _, _), 1024 + [115] = PINGROUP(115, SOUTH, ter_mi2s, atest_char, _, _, _, _, _, _, _), 1025 + [116] = PINGROUP(116, SOUTH, ter_mi2s, _, phase_flag, _, _, _, _, _, _), 1026 + [117] = PINGROUP(117, SOUTH, ter_mi2s, _, phase_flag, qdss_gpio, atest_char, _, _, _, _), 1027 + [118] = PINGROUP(118, SOUTH, ter_mi2s, adsp_ext, _, phase_flag, qdss_gpio, atest_char, 1028 + _, _, _), 1029 + [119] = PINGROUP(119, SOUTH, edp_lcd, _, phase_flag, qdss_gpio, atest_char, _, _, _, _), 1030 + [120] = PINGROUP(120, SOUTH, m_voc, qdss_gpio, atest_char, _, _, _, _, _, _), 1031 + [121] = PINGROUP(121, SOUTH, mclk1, atest_char, _, _, _, _, _, _, _), 1032 + [122] = PINGROUP(122, SOUTH, mclk2, _, _, _, _, _, _, _, _), 1033 + [123] = UFS_RESET(ufs_reset, 0x9f000), 1034 + [124] = SDC_QDSD_PINGROUP(sdc1_rclk, WEST, 0x9a000, 15, 0), 1035 + [125] = SDC_QDSD_PINGROUP(sdc1_clk, WEST, 0x9a000, 13, 6), 1036 + [126] = SDC_QDSD_PINGROUP(sdc1_cmd, WEST, 0x9a000, 11, 3), 1037 + [127] = SDC_QDSD_PINGROUP(sdc1_data, WEST, 0x9a000, 9, 0), 1038 + [128] = SDC_QDSD_PINGROUP(sdc2_clk, SOUTH, 0x98000, 14, 6), 1039 + [129] = SDC_QDSD_PINGROUP(sdc2_cmd, SOUTH, 0x98000, 11, 3), 1040 + [130] = SDC_QDSD_PINGROUP(sdc2_data, SOUTH, 0x98000, 9, 0), 1041 + }; 1042 + 1043 + static const struct msm_gpio_wakeirq_map qcs615_pdc_map[] = { 1044 + { 1, 45 }, { 3, 31 }, { 7, 55 }, { 9, 110 }, { 11, 34 }, 1045 + { 13, 33 }, { 14, 35 }, { 17, 46 }, { 19, 48 }, { 21, 83 }, 1046 + { 22, 36 }, { 26, 38 }, { 35, 37 }, { 39, 125 }, { 41, 47 }, 1047 + { 47, 49 }, { 48, 51 }, { 50, 52 }, { 51, 123 }, { 55, 56 }, 1048 + { 56, 57 }, { 57, 58 }, { 60, 60 }, { 71, 54 }, { 80, 73 }, 1049 + { 81, 64 }, { 82, 50 }, { 83, 65 }, { 84, 92 }, { 85, 99 }, 1050 + { 86, 67 }, { 87, 84 }, { 88, 124 }, { 89, 122 }, { 90, 69 }, 1051 + { 92, 88 }, { 93, 75 }, { 94, 91 }, { 95, 72 }, { 96, 82 }, 1052 + { 97, 74 }, { 98, 95 }, { 99, 94 }, { 100, 100 }, { 101, 40 }, 1053 + { 102, 93 }, { 103, 77 }, { 104, 78 }, { 105, 96 }, { 107, 97 }, 1054 + { 108, 111 }, { 112, 112 }, { 113, 113 }, { 117, 85 }, { 118, 102 }, 1055 + { 119, 87 }, { 120, 114 }, { 121, 89 }, { 122, 90 }, 1056 + }; 1057 + 1058 + static const struct msm_pinctrl_soc_data qcs615_tlmm = { 1059 + .pins = qcs615_pins, 1060 + .npins = ARRAY_SIZE(qcs615_pins), 1061 + .functions = qcs615_functions, 1062 + .nfunctions = ARRAY_SIZE(qcs615_functions), 1063 + .groups = qcs615_groups, 1064 + .ngroups = ARRAY_SIZE(qcs615_groups), 1065 + .ngpios = 123, 1066 + .tiles = qcs615_tiles, 1067 + .ntiles = ARRAY_SIZE(qcs615_tiles), 1068 + .wakeirq_map = qcs615_pdc_map, 1069 + .nwakeirq_map = ARRAY_SIZE(qcs615_pdc_map), 1070 + }; 1071 + 1072 + static const struct of_device_id qcs615_tlmm_of_match[] = { 1073 + { 1074 + .compatible = "qcom,qcs615-tlmm", 1075 + }, 1076 + {}, 1077 + }; 1078 + 1079 + static int qcs615_tlmm_probe(struct platform_device *pdev) 1080 + { 1081 + return msm_pinctrl_probe(pdev, &qcs615_tlmm); 1082 + } 1083 + 1084 + static struct platform_driver qcs615_tlmm_driver = { 1085 + .driver = { 1086 + .name = "qcs615-tlmm", 1087 + .of_match_table = qcs615_tlmm_of_match, 1088 + }, 1089 + .probe = qcs615_tlmm_probe, 1090 + .remove = msm_pinctrl_remove, 1091 + }; 1092 + 1093 + static int __init qcs615_tlmm_init(void) 1094 + { 1095 + return platform_driver_register(&qcs615_tlmm_driver); 1096 + } 1097 + arch_initcall(qcs615_tlmm_init); 1098 + 1099 + static void __exit qcs615_tlmm_exit(void) 1100 + { 1101 + platform_driver_unregister(&qcs615_tlmm_driver); 1102 + } 1103 + module_exit(qcs615_tlmm_exit); 1104 + 1105 + MODULE_DESCRIPTION("QTI QCS615 TLMM driver"); 1106 + MODULE_LICENSE("GPL"); 1107 + MODULE_DEVICE_TABLE(of, qcs615_tlmm_of_match);
+1246
drivers/pinctrl/qcom/pinctrl-qcs8300.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. 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 + #define REG_SIZE 0x1000 13 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11)\ 14 + { \ 15 + .grp = PINCTRL_PINGROUP("gpio" #id, \ 16 + gpio##id##_pins, \ 17 + ARRAY_SIZE(gpio##id##_pins)), \ 18 + .funcs = (int[]){ \ 19 + msm_mux_gpio, /* gpio mode */ \ 20 + msm_mux_##f1, \ 21 + msm_mux_##f2, \ 22 + msm_mux_##f3, \ 23 + msm_mux_##f4, \ 24 + msm_mux_##f5, \ 25 + msm_mux_##f6, \ 26 + msm_mux_##f7, \ 27 + msm_mux_##f8, \ 28 + msm_mux_##f9, \ 29 + msm_mux_##f10, \ 30 + msm_mux_##f11 /* egpio mode */ \ 31 + }, \ 32 + .nfuncs = 12, \ 33 + .ctl_reg = REG_SIZE * id, \ 34 + .io_reg = 0x4 + REG_SIZE * id, \ 35 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 36 + .intr_status_reg = 0xc + REG_SIZE * id, \ 37 + .intr_target_reg = 0x8 + REG_SIZE * id, \ 38 + .mux_bit = 2, \ 39 + .pull_bit = 0, \ 40 + .drv_bit = 6, \ 41 + .egpio_enable = 12, \ 42 + .egpio_present = 11, \ 43 + .oe_bit = 9, \ 44 + .in_bit = 0, \ 45 + .out_bit = 1, \ 46 + .intr_enable_bit = 0, \ 47 + .intr_status_bit = 0, \ 48 + .intr_target_bit = 5, \ 49 + .intr_target_kpss_val = 3, \ 50 + .intr_raw_status_bit = 4, \ 51 + .intr_polarity_bit = 1, \ 52 + .intr_detection_bit = 2, \ 53 + .intr_detection_width = 2, \ 54 + } 55 + 56 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 57 + { \ 58 + .grp = PINCTRL_PINGROUP(#pg_name, \ 59 + pg_name##_pins, \ 60 + ARRAY_SIZE(pg_name##_pins)), \ 61 + .ctl_reg = ctl, \ 62 + .io_reg = 0, \ 63 + .intr_cfg_reg = 0, \ 64 + .intr_status_reg = 0, \ 65 + .intr_target_reg = 0, \ 66 + .mux_bit = -1, \ 67 + .pull_bit = pull, \ 68 + .drv_bit = drv, \ 69 + .oe_bit = -1, \ 70 + .in_bit = -1, \ 71 + .out_bit = -1, \ 72 + .intr_enable_bit = -1, \ 73 + .intr_status_bit = -1, \ 74 + .intr_target_bit = -1, \ 75 + .intr_raw_status_bit = -1, \ 76 + .intr_polarity_bit = -1, \ 77 + .intr_detection_bit = -1, \ 78 + .intr_detection_width = -1, \ 79 + } 80 + 81 + #define UFS_RESET(pg_name, offset) \ 82 + { \ 83 + .grp = PINCTRL_PINGROUP(#pg_name, \ 84 + pg_name##_pins, \ 85 + ARRAY_SIZE(pg_name##_pins)), \ 86 + .ctl_reg = offset, \ 87 + .io_reg = offset + 0x4, \ 88 + .intr_cfg_reg = 0, \ 89 + .intr_status_reg = 0, \ 90 + .intr_target_reg = 0, \ 91 + .mux_bit = -1, \ 92 + .pull_bit = 3, \ 93 + .drv_bit = 0, \ 94 + .oe_bit = -1, \ 95 + .in_bit = -1, \ 96 + .out_bit = 0, \ 97 + .intr_enable_bit = -1, \ 98 + .intr_status_bit = -1, \ 99 + .intr_target_bit = -1, \ 100 + .intr_raw_status_bit = -1, \ 101 + .intr_polarity_bit = -1, \ 102 + .intr_detection_bit = -1, \ 103 + .intr_detection_width = -1, \ 104 + } 105 + 106 + #define QUP_I3C(qup_mode, qup_offset) \ 107 + { \ 108 + .mode = qup_mode, \ 109 + .offset = qup_offset, \ 110 + } 111 + 112 + #define QUP_I3C_6_MODE_OFFSET 0xaf000 113 + #define QUP_I3C_7_MODE_OFFSET 0xb0000 114 + #define QUP_I3C_13_MODE_OFFSET 0xb1000 115 + #define QUP_I3C_14_MODE_OFFSET 0xb2000 116 + 117 + static const struct pinctrl_pin_desc qcs8300_pins[] = { 118 + PINCTRL_PIN(0, "GPIO_0"), 119 + PINCTRL_PIN(1, "GPIO_1"), 120 + PINCTRL_PIN(2, "GPIO_2"), 121 + PINCTRL_PIN(3, "GPIO_3"), 122 + PINCTRL_PIN(4, "GPIO_4"), 123 + PINCTRL_PIN(5, "GPIO_5"), 124 + PINCTRL_PIN(6, "GPIO_6"), 125 + PINCTRL_PIN(7, "GPIO_7"), 126 + PINCTRL_PIN(8, "GPIO_8"), 127 + PINCTRL_PIN(9, "GPIO_9"), 128 + PINCTRL_PIN(10, "GPIO_10"), 129 + PINCTRL_PIN(11, "GPIO_11"), 130 + PINCTRL_PIN(12, "GPIO_12"), 131 + PINCTRL_PIN(13, "GPIO_13"), 132 + PINCTRL_PIN(14, "GPIO_14"), 133 + PINCTRL_PIN(15, "GPIO_15"), 134 + PINCTRL_PIN(16, "GPIO_16"), 135 + PINCTRL_PIN(17, "GPIO_17"), 136 + PINCTRL_PIN(18, "GPIO_18"), 137 + PINCTRL_PIN(19, "GPIO_19"), 138 + PINCTRL_PIN(20, "GPIO_20"), 139 + PINCTRL_PIN(21, "GPIO_21"), 140 + PINCTRL_PIN(22, "GPIO_22"), 141 + PINCTRL_PIN(23, "GPIO_23"), 142 + PINCTRL_PIN(24, "GPIO_24"), 143 + PINCTRL_PIN(25, "GPIO_25"), 144 + PINCTRL_PIN(26, "GPIO_26"), 145 + PINCTRL_PIN(27, "GPIO_27"), 146 + PINCTRL_PIN(28, "GPIO_28"), 147 + PINCTRL_PIN(29, "GPIO_29"), 148 + PINCTRL_PIN(30, "GPIO_30"), 149 + PINCTRL_PIN(31, "GPIO_31"), 150 + PINCTRL_PIN(32, "GPIO_32"), 151 + PINCTRL_PIN(33, "GPIO_33"), 152 + PINCTRL_PIN(34, "GPIO_34"), 153 + PINCTRL_PIN(35, "GPIO_35"), 154 + PINCTRL_PIN(36, "GPIO_36"), 155 + PINCTRL_PIN(37, "GPIO_37"), 156 + PINCTRL_PIN(38, "GPIO_38"), 157 + PINCTRL_PIN(39, "GPIO_39"), 158 + PINCTRL_PIN(40, "GPIO_40"), 159 + PINCTRL_PIN(41, "GPIO_41"), 160 + PINCTRL_PIN(42, "GPIO_42"), 161 + PINCTRL_PIN(43, "GPIO_43"), 162 + PINCTRL_PIN(44, "GPIO_44"), 163 + PINCTRL_PIN(45, "GPIO_45"), 164 + PINCTRL_PIN(46, "GPIO_46"), 165 + PINCTRL_PIN(47, "GPIO_47"), 166 + PINCTRL_PIN(48, "GPIO_48"), 167 + PINCTRL_PIN(49, "GPIO_49"), 168 + PINCTRL_PIN(50, "GPIO_50"), 169 + PINCTRL_PIN(51, "GPIO_51"), 170 + PINCTRL_PIN(52, "GPIO_52"), 171 + PINCTRL_PIN(53, "GPIO_53"), 172 + PINCTRL_PIN(54, "GPIO_54"), 173 + PINCTRL_PIN(55, "GPIO_55"), 174 + PINCTRL_PIN(56, "GPIO_56"), 175 + PINCTRL_PIN(57, "GPIO_57"), 176 + PINCTRL_PIN(58, "GPIO_58"), 177 + PINCTRL_PIN(59, "GPIO_59"), 178 + PINCTRL_PIN(60, "GPIO_60"), 179 + PINCTRL_PIN(61, "GPIO_61"), 180 + PINCTRL_PIN(62, "GPIO_62"), 181 + PINCTRL_PIN(63, "GPIO_63"), 182 + PINCTRL_PIN(64, "GPIO_64"), 183 + PINCTRL_PIN(65, "GPIO_65"), 184 + PINCTRL_PIN(66, "GPIO_66"), 185 + PINCTRL_PIN(67, "GPIO_67"), 186 + PINCTRL_PIN(68, "GPIO_68"), 187 + PINCTRL_PIN(69, "GPIO_69"), 188 + PINCTRL_PIN(70, "GPIO_70"), 189 + PINCTRL_PIN(71, "GPIO_71"), 190 + PINCTRL_PIN(72, "GPIO_72"), 191 + PINCTRL_PIN(73, "GPIO_73"), 192 + PINCTRL_PIN(74, "GPIO_74"), 193 + PINCTRL_PIN(75, "GPIO_75"), 194 + PINCTRL_PIN(76, "GPIO_76"), 195 + PINCTRL_PIN(77, "GPIO_77"), 196 + PINCTRL_PIN(78, "GPIO_78"), 197 + PINCTRL_PIN(79, "GPIO_79"), 198 + PINCTRL_PIN(80, "GPIO_80"), 199 + PINCTRL_PIN(81, "GPIO_81"), 200 + PINCTRL_PIN(82, "GPIO_82"), 201 + PINCTRL_PIN(83, "GPIO_83"), 202 + PINCTRL_PIN(84, "GPIO_84"), 203 + PINCTRL_PIN(85, "GPIO_85"), 204 + PINCTRL_PIN(86, "GPIO_86"), 205 + PINCTRL_PIN(87, "GPIO_87"), 206 + PINCTRL_PIN(88, "GPIO_88"), 207 + PINCTRL_PIN(89, "GPIO_89"), 208 + PINCTRL_PIN(90, "GPIO_90"), 209 + PINCTRL_PIN(91, "GPIO_91"), 210 + PINCTRL_PIN(92, "GPIO_92"), 211 + PINCTRL_PIN(93, "GPIO_93"), 212 + PINCTRL_PIN(94, "GPIO_94"), 213 + PINCTRL_PIN(95, "GPIO_95"), 214 + PINCTRL_PIN(96, "GPIO_96"), 215 + PINCTRL_PIN(97, "GPIO_97"), 216 + PINCTRL_PIN(98, "GPIO_98"), 217 + PINCTRL_PIN(99, "GPIO_99"), 218 + PINCTRL_PIN(100, "GPIO_100"), 219 + PINCTRL_PIN(101, "GPIO_101"), 220 + PINCTRL_PIN(102, "GPIO_102"), 221 + PINCTRL_PIN(103, "GPIO_103"), 222 + PINCTRL_PIN(104, "GPIO_104"), 223 + PINCTRL_PIN(105, "GPIO_105"), 224 + PINCTRL_PIN(106, "GPIO_106"), 225 + PINCTRL_PIN(107, "GPIO_107"), 226 + PINCTRL_PIN(108, "GPIO_108"), 227 + PINCTRL_PIN(109, "GPIO_109"), 228 + PINCTRL_PIN(110, "GPIO_110"), 229 + PINCTRL_PIN(111, "GPIO_111"), 230 + PINCTRL_PIN(112, "GPIO_112"), 231 + PINCTRL_PIN(113, "GPIO_113"), 232 + PINCTRL_PIN(114, "GPIO_114"), 233 + PINCTRL_PIN(115, "GPIO_115"), 234 + PINCTRL_PIN(116, "GPIO_116"), 235 + PINCTRL_PIN(117, "GPIO_117"), 236 + PINCTRL_PIN(118, "GPIO_118"), 237 + PINCTRL_PIN(119, "GPIO_119"), 238 + PINCTRL_PIN(120, "GPIO_120"), 239 + PINCTRL_PIN(121, "GPIO_121"), 240 + PINCTRL_PIN(122, "GPIO_122"), 241 + PINCTRL_PIN(123, "GPIO_123"), 242 + PINCTRL_PIN(124, "GPIO_124"), 243 + PINCTRL_PIN(125, "GPIO_125"), 244 + PINCTRL_PIN(126, "GPIO_126"), 245 + PINCTRL_PIN(127, "GPIO_127"), 246 + PINCTRL_PIN(128, "GPIO_128"), 247 + PINCTRL_PIN(129, "GPIO_129"), 248 + PINCTRL_PIN(130, "GPIO_130"), 249 + PINCTRL_PIN(131, "GPIO_131"), 250 + PINCTRL_PIN(132, "GPIO_132"), 251 + PINCTRL_PIN(133, "UFS_RESET"), 252 + PINCTRL_PIN(134, "SDC1_RCLK"), 253 + PINCTRL_PIN(135, "SDC1_CLK"), 254 + PINCTRL_PIN(136, "SDC1_CMD"), 255 + PINCTRL_PIN(137, "SDC1_DATA"), 256 + }; 257 + 258 + #define DECLARE_MSM_GPIO_PINS(pin) \ 259 + static const unsigned int gpio##pin##_pins[] = { pin } 260 + DECLARE_MSM_GPIO_PINS(0); 261 + DECLARE_MSM_GPIO_PINS(1); 262 + DECLARE_MSM_GPIO_PINS(2); 263 + DECLARE_MSM_GPIO_PINS(3); 264 + DECLARE_MSM_GPIO_PINS(4); 265 + DECLARE_MSM_GPIO_PINS(5); 266 + DECLARE_MSM_GPIO_PINS(6); 267 + DECLARE_MSM_GPIO_PINS(7); 268 + DECLARE_MSM_GPIO_PINS(8); 269 + DECLARE_MSM_GPIO_PINS(9); 270 + DECLARE_MSM_GPIO_PINS(10); 271 + DECLARE_MSM_GPIO_PINS(11); 272 + DECLARE_MSM_GPIO_PINS(12); 273 + DECLARE_MSM_GPIO_PINS(13); 274 + DECLARE_MSM_GPIO_PINS(14); 275 + DECLARE_MSM_GPIO_PINS(15); 276 + DECLARE_MSM_GPIO_PINS(16); 277 + DECLARE_MSM_GPIO_PINS(17); 278 + DECLARE_MSM_GPIO_PINS(18); 279 + DECLARE_MSM_GPIO_PINS(19); 280 + DECLARE_MSM_GPIO_PINS(20); 281 + DECLARE_MSM_GPIO_PINS(21); 282 + DECLARE_MSM_GPIO_PINS(22); 283 + DECLARE_MSM_GPIO_PINS(23); 284 + DECLARE_MSM_GPIO_PINS(24); 285 + DECLARE_MSM_GPIO_PINS(25); 286 + DECLARE_MSM_GPIO_PINS(26); 287 + DECLARE_MSM_GPIO_PINS(27); 288 + DECLARE_MSM_GPIO_PINS(28); 289 + DECLARE_MSM_GPIO_PINS(29); 290 + DECLARE_MSM_GPIO_PINS(30); 291 + DECLARE_MSM_GPIO_PINS(31); 292 + DECLARE_MSM_GPIO_PINS(32); 293 + DECLARE_MSM_GPIO_PINS(33); 294 + DECLARE_MSM_GPIO_PINS(34); 295 + DECLARE_MSM_GPIO_PINS(35); 296 + DECLARE_MSM_GPIO_PINS(36); 297 + DECLARE_MSM_GPIO_PINS(37); 298 + DECLARE_MSM_GPIO_PINS(38); 299 + DECLARE_MSM_GPIO_PINS(39); 300 + DECLARE_MSM_GPIO_PINS(40); 301 + DECLARE_MSM_GPIO_PINS(41); 302 + DECLARE_MSM_GPIO_PINS(42); 303 + DECLARE_MSM_GPIO_PINS(43); 304 + DECLARE_MSM_GPIO_PINS(44); 305 + DECLARE_MSM_GPIO_PINS(45); 306 + DECLARE_MSM_GPIO_PINS(46); 307 + DECLARE_MSM_GPIO_PINS(47); 308 + DECLARE_MSM_GPIO_PINS(48); 309 + DECLARE_MSM_GPIO_PINS(49); 310 + DECLARE_MSM_GPIO_PINS(50); 311 + DECLARE_MSM_GPIO_PINS(51); 312 + DECLARE_MSM_GPIO_PINS(52); 313 + DECLARE_MSM_GPIO_PINS(53); 314 + DECLARE_MSM_GPIO_PINS(54); 315 + DECLARE_MSM_GPIO_PINS(55); 316 + DECLARE_MSM_GPIO_PINS(56); 317 + DECLARE_MSM_GPIO_PINS(57); 318 + DECLARE_MSM_GPIO_PINS(58); 319 + DECLARE_MSM_GPIO_PINS(59); 320 + DECLARE_MSM_GPIO_PINS(60); 321 + DECLARE_MSM_GPIO_PINS(61); 322 + DECLARE_MSM_GPIO_PINS(62); 323 + DECLARE_MSM_GPIO_PINS(63); 324 + DECLARE_MSM_GPIO_PINS(64); 325 + DECLARE_MSM_GPIO_PINS(65); 326 + DECLARE_MSM_GPIO_PINS(66); 327 + DECLARE_MSM_GPIO_PINS(67); 328 + DECLARE_MSM_GPIO_PINS(68); 329 + DECLARE_MSM_GPIO_PINS(69); 330 + DECLARE_MSM_GPIO_PINS(70); 331 + DECLARE_MSM_GPIO_PINS(71); 332 + DECLARE_MSM_GPIO_PINS(72); 333 + DECLARE_MSM_GPIO_PINS(73); 334 + DECLARE_MSM_GPIO_PINS(74); 335 + DECLARE_MSM_GPIO_PINS(75); 336 + DECLARE_MSM_GPIO_PINS(76); 337 + DECLARE_MSM_GPIO_PINS(77); 338 + DECLARE_MSM_GPIO_PINS(78); 339 + DECLARE_MSM_GPIO_PINS(79); 340 + DECLARE_MSM_GPIO_PINS(80); 341 + DECLARE_MSM_GPIO_PINS(81); 342 + DECLARE_MSM_GPIO_PINS(82); 343 + DECLARE_MSM_GPIO_PINS(83); 344 + DECLARE_MSM_GPIO_PINS(84); 345 + DECLARE_MSM_GPIO_PINS(85); 346 + DECLARE_MSM_GPIO_PINS(86); 347 + DECLARE_MSM_GPIO_PINS(87); 348 + DECLARE_MSM_GPIO_PINS(88); 349 + DECLARE_MSM_GPIO_PINS(89); 350 + DECLARE_MSM_GPIO_PINS(90); 351 + DECLARE_MSM_GPIO_PINS(91); 352 + DECLARE_MSM_GPIO_PINS(92); 353 + DECLARE_MSM_GPIO_PINS(93); 354 + DECLARE_MSM_GPIO_PINS(94); 355 + DECLARE_MSM_GPIO_PINS(95); 356 + DECLARE_MSM_GPIO_PINS(96); 357 + DECLARE_MSM_GPIO_PINS(97); 358 + DECLARE_MSM_GPIO_PINS(98); 359 + DECLARE_MSM_GPIO_PINS(99); 360 + DECLARE_MSM_GPIO_PINS(100); 361 + DECLARE_MSM_GPIO_PINS(101); 362 + DECLARE_MSM_GPIO_PINS(102); 363 + DECLARE_MSM_GPIO_PINS(103); 364 + DECLARE_MSM_GPIO_PINS(104); 365 + DECLARE_MSM_GPIO_PINS(105); 366 + DECLARE_MSM_GPIO_PINS(106); 367 + DECLARE_MSM_GPIO_PINS(107); 368 + DECLARE_MSM_GPIO_PINS(108); 369 + DECLARE_MSM_GPIO_PINS(109); 370 + DECLARE_MSM_GPIO_PINS(110); 371 + DECLARE_MSM_GPIO_PINS(111); 372 + DECLARE_MSM_GPIO_PINS(112); 373 + DECLARE_MSM_GPIO_PINS(113); 374 + DECLARE_MSM_GPIO_PINS(114); 375 + DECLARE_MSM_GPIO_PINS(115); 376 + DECLARE_MSM_GPIO_PINS(116); 377 + DECLARE_MSM_GPIO_PINS(117); 378 + DECLARE_MSM_GPIO_PINS(118); 379 + DECLARE_MSM_GPIO_PINS(119); 380 + DECLARE_MSM_GPIO_PINS(120); 381 + DECLARE_MSM_GPIO_PINS(121); 382 + DECLARE_MSM_GPIO_PINS(122); 383 + DECLARE_MSM_GPIO_PINS(123); 384 + DECLARE_MSM_GPIO_PINS(124); 385 + DECLARE_MSM_GPIO_PINS(125); 386 + DECLARE_MSM_GPIO_PINS(126); 387 + DECLARE_MSM_GPIO_PINS(127); 388 + DECLARE_MSM_GPIO_PINS(128); 389 + DECLARE_MSM_GPIO_PINS(129); 390 + DECLARE_MSM_GPIO_PINS(130); 391 + DECLARE_MSM_GPIO_PINS(131); 392 + DECLARE_MSM_GPIO_PINS(132); 393 + 394 + static const unsigned int ufs_reset_pins[] = { 133 }; 395 + static const unsigned int sdc1_rclk_pins[] = { 134 }; 396 + static const unsigned int sdc1_clk_pins[] = { 135 }; 397 + static const unsigned int sdc1_cmd_pins[] = { 136 }; 398 + static const unsigned int sdc1_data_pins[] = { 137 }; 399 + 400 + enum qcs8300_functions { 401 + msm_mux_gpio, 402 + msm_mux_aoss_cti, 403 + msm_mux_atest_char, 404 + msm_mux_atest_usb2, 405 + msm_mux_audio_ref, 406 + msm_mux_cam_mclk, 407 + msm_mux_cci_async, 408 + msm_mux_cci_i2c_scl, 409 + msm_mux_cci_i2c_sda, 410 + msm_mux_cci_timer, 411 + msm_mux_cri_trng, 412 + msm_mux_dbg_out, 413 + msm_mux_ddr_bist, 414 + msm_mux_ddr_pxi0, 415 + msm_mux_ddr_pxi1, 416 + msm_mux_ddr_pxi2, 417 + msm_mux_ddr_pxi3, 418 + msm_mux_edp0_hot, 419 + msm_mux_edp0_lcd, 420 + msm_mux_edp1_lcd, 421 + msm_mux_egpio, 422 + msm_mux_emac0_mcg0, 423 + msm_mux_emac0_mcg1, 424 + msm_mux_emac0_mcg2, 425 + msm_mux_emac0_mcg3, 426 + msm_mux_emac0_mdc, 427 + msm_mux_emac0_mdio, 428 + msm_mux_emac0_ptp_aux, 429 + msm_mux_emac0_ptp_pps, 430 + msm_mux_gcc_gp1, 431 + msm_mux_gcc_gp2, 432 + msm_mux_gcc_gp3, 433 + msm_mux_gcc_gp4, 434 + msm_mux_gcc_gp5, 435 + msm_mux_hs0_mi2s, 436 + msm_mux_hs1_mi2s, 437 + msm_mux_hs2_mi2s, 438 + msm_mux_ibi_i3c, 439 + msm_mux_jitter_bist, 440 + msm_mux_mdp0_vsync0, 441 + msm_mux_mdp0_vsync1, 442 + msm_mux_mdp0_vsync3, 443 + msm_mux_mdp0_vsync6, 444 + msm_mux_mdp0_vsync7, 445 + msm_mux_mdp_vsync, 446 + msm_mux_mi2s1_data0, 447 + msm_mux_mi2s1_data1, 448 + msm_mux_mi2s1_sck, 449 + msm_mux_mi2s1_ws, 450 + msm_mux_mi2s2_data0, 451 + msm_mux_mi2s2_data1, 452 + msm_mux_mi2s2_sck, 453 + msm_mux_mi2s2_ws, 454 + msm_mux_mi2s_mclk0, 455 + msm_mux_mi2s_mclk1, 456 + msm_mux_pcie0_clkreq, 457 + msm_mux_pcie1_clkreq, 458 + msm_mux_phase_flag, 459 + msm_mux_pll_bist, 460 + msm_mux_pll_clk, 461 + msm_mux_prng_rosc0, 462 + msm_mux_prng_rosc1, 463 + msm_mux_prng_rosc2, 464 + msm_mux_prng_rosc3, 465 + msm_mux_qdss_cti, 466 + msm_mux_qdss_gpio, 467 + msm_mux_qup0_se0, 468 + msm_mux_qup0_se1, 469 + msm_mux_qup0_se2, 470 + msm_mux_qup0_se3, 471 + msm_mux_qup0_se4, 472 + msm_mux_qup0_se5, 473 + msm_mux_qup0_se6, 474 + msm_mux_qup0_se7, 475 + msm_mux_qup1_se0, 476 + msm_mux_qup1_se1, 477 + msm_mux_qup1_se2, 478 + msm_mux_qup1_se3, 479 + msm_mux_qup1_se4, 480 + msm_mux_qup1_se5, 481 + msm_mux_qup1_se6, 482 + msm_mux_qup1_se7, 483 + msm_mux_qup2_se0, 484 + msm_mux_sailss_emac0, 485 + msm_mux_sailss_ospi, 486 + msm_mux_sgmii_phy, 487 + msm_mux_tb_trig, 488 + msm_mux_tgu_ch0, 489 + msm_mux_tgu_ch1, 490 + msm_mux_tgu_ch2, 491 + msm_mux_tgu_ch3, 492 + msm_mux_tsense_pwm1, 493 + msm_mux_tsense_pwm2, 494 + msm_mux_tsense_pwm3, 495 + msm_mux_tsense_pwm4, 496 + msm_mux_usb2phy_ac, 497 + msm_mux_vsense_trigger, 498 + msm_mux__, 499 + }; 500 + 501 + static const char * const gpio_groups[] = { 502 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 503 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 504 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 505 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 506 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 507 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 508 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 509 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 510 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 511 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 512 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 513 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 514 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 515 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 516 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 517 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 518 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 519 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 520 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 521 + "gpio129", "gpio130", "gpio131", "gpio132", 522 + }; 523 + 524 + static const char *const aoss_cti_groups[] = { 525 + "gpio37", "gpio38", "gpio39", "gpio40", 526 + }; 527 + 528 + static const char * const atest_char_groups[] = { 529 + "gpio66", "gpio70", "gpio71", "gpio72", "gpio93", 530 + }; 531 + 532 + static const char * const atest_usb2_groups[] = { 533 + "gpio63", "gpio83", "gpio92", "gpio74", "gpio84", "gpio87", "gpio67", 534 + "gpio75", "gpio85", "gpio65", "gpio68", "gpio80", "gpio64", "gpio69", 535 + "gpio81", 536 + }; 537 + 538 + static const char * const audio_ref_groups[] = { 539 + "gpio105", 540 + }; 541 + 542 + static const char * const cam_mclk_groups[] = { 543 + "gpio67", "gpio68", "gpio69", 544 + }; 545 + 546 + static const char * const cci_async_groups[] = { 547 + "gpio63", "gpio64", "gpio65", "gpio29", "gpio30", "gpio31", 548 + }; 549 + 550 + static const char * const cci_i2c_scl_groups[] = { 551 + "gpio58", "gpio30", "gpio60", "gpio32", "gpio62", "gpio55", 552 + }; 553 + 554 + static const char * const cci_i2c_sda_groups[] = { 555 + "gpio57", "gpio29", "gpio59", "gpio31", "gpio61", "gpio54", 556 + }; 557 + 558 + static const char *const cci_timer_groups[] = { 559 + "gpio63", "gpio64", "gpio65", "gpio49", "gpio50", "gpio19", 560 + "gpio20", "gpio21", "gpio22", "gpio23", 561 + }; 562 + 563 + static const char *const cri_trng_groups[] = { 564 + "gpio92", "gpio90", "gpio91", 565 + }; 566 + 567 + static const char *const dbg_out_groups[] = { 568 + "gpio75", 569 + }; 570 + 571 + static const char * const ddr_bist_groups[] = { 572 + "gpio53", "gpio54", "gpio55", "gpio56", 573 + }; 574 + 575 + static const char *const ddr_pxi0_groups[] = { 576 + "gpio68", "gpio69", 577 + }; 578 + 579 + static const char *const ddr_pxi1_groups[] = { 580 + "gpio49", "gpio50", 581 + }; 582 + 583 + static const char *const ddr_pxi2_groups[] = { 584 + "gpio52", "gpio83", 585 + }; 586 + 587 + static const char *const ddr_pxi3_groups[] = { 588 + "gpio80", "gpio81", 589 + }; 590 + 591 + static const char *const edp0_hot_groups[] = { 592 + "gpio94", 593 + }; 594 + 595 + static const char *const edp0_lcd_groups[] = { 596 + "gpio48", 597 + }; 598 + 599 + static const char *const edp1_lcd_groups[] = { 600 + "gpio49", 601 + }; 602 + 603 + static const char *const egpio_groups[] = { 604 + "gpio110", "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", 605 + "gpio116", "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", 606 + "gpio122", "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", 607 + "gpio128", "gpio129", "gpio130", "gpio131", "gpio132", 608 + }; 609 + 610 + static const char *const emac0_mcg0_groups[] = { 611 + "gpio10", 612 + }; 613 + 614 + static const char *const emac0_mcg1_groups[] = { 615 + "gpio11", 616 + }; 617 + 618 + static const char *const emac0_mcg2_groups[] = { 619 + "gpio24", 620 + }; 621 + 622 + static const char *const emac0_mcg3_groups[] = { 623 + "gpio79", 624 + }; 625 + 626 + static const char *const emac0_mdc_groups[] = { 627 + "gpio5", 628 + }; 629 + 630 + static const char *const emac0_mdio_groups[] = { 631 + "gpio6", 632 + }; 633 + 634 + static const char * const emac0_ptp_aux_groups[] = { 635 + "gpio24", "gpio31", "gpio32", "gpio79", 636 + }; 637 + 638 + static const char * const emac0_ptp_pps_groups[] = { 639 + "gpio24", "gpio29", "gpio30", "gpio79", 640 + }; 641 + 642 + static const char *const gcc_gp1_groups[] = { 643 + "gpio35", "gpio84", 644 + }; 645 + 646 + static const char *const gcc_gp2_groups[] = { 647 + "gpio36", "gpio81", 648 + }; 649 + 650 + static const char *const gcc_gp3_groups[] = { 651 + "gpio69", "gpio82", 652 + }; 653 + 654 + static const char *const gcc_gp4_groups[] = { 655 + "gpio68", "gpio83", 656 + }; 657 + 658 + static const char *const gcc_gp5_groups[] = { 659 + "gpio76", "gpio77", 660 + }; 661 + 662 + static const char * const hs0_mi2s_groups[] = { 663 + "gpio106", "gpio107", "gpio108", "gpio109", 664 + }; 665 + 666 + static const char * const hs1_mi2s_groups[] = { 667 + "gpio45", "gpio46", "gpio47", "gpio48", 668 + }; 669 + 670 + static const char * const hs2_mi2s_groups[] = { 671 + "gpio49", "gpio50", "gpio51", "gpio52", 672 + }; 673 + 674 + static const char * const ibi_i3c_groups[] = { 675 + "gpio17", "gpio18", "gpio19", "gpio20", "gpio37", "gpio38", 676 + "gpio39", "gpio40", 677 + }; 678 + 679 + static const char *const jitter_bist_groups[] = { 680 + "gpio97", 681 + }; 682 + 683 + static const char *const mdp0_vsync0_groups[] = { 684 + "gpio89", 685 + }; 686 + 687 + static const char *const mdp0_vsync1_groups[] = { 688 + "gpio90", 689 + }; 690 + 691 + static const char *const mdp0_vsync3_groups[] = { 692 + "gpio91", 693 + }; 694 + 695 + static const char *const mdp0_vsync6_groups[] = { 696 + "gpio80", 697 + }; 698 + 699 + static const char *const mdp0_vsync7_groups[] = { 700 + "gpio81", 701 + }; 702 + 703 + static const char *const mdp_vsync_groups[] = { 704 + "gpio42", "gpio52", "gpio32", 705 + }; 706 + 707 + static const char *const mi2s1_data0_groups[] = { 708 + "gpio100", 709 + }; 710 + 711 + static const char *const mi2s1_data1_groups[] = { 712 + "gpio101", 713 + }; 714 + 715 + static const char *const mi2s1_sck_groups[] = { 716 + "gpio98", 717 + }; 718 + 719 + static const char *const mi2s1_ws_groups[] = { 720 + "gpio99", 721 + }; 722 + 723 + static const char *const mi2s2_data0_groups[] = { 724 + "gpio104", 725 + }; 726 + 727 + static const char *const mi2s2_data1_groups[] = { 728 + "gpio105", 729 + }; 730 + 731 + static const char *const mi2s2_sck_groups[] = { 732 + "gpio102", 733 + }; 734 + 735 + static const char *const mi2s2_ws_groups[] = { 736 + "gpio103", 737 + }; 738 + 739 + static const char *const mi2s_mclk0_groups[] = { 740 + "gpio97", 741 + }; 742 + 743 + static const char *const mi2s_mclk1_groups[] = { 744 + "gpio109", 745 + }; 746 + 747 + static const char *const pcie0_clkreq_groups[] = { 748 + "gpio1", 749 + }; 750 + 751 + static const char *const pcie1_clkreq_groups[] = { 752 + "gpio22", 753 + }; 754 + 755 + static const char *const phase_flag_groups[] = { 756 + "gpio66", "gpio56", "gpio118", "gpio117", "gpio116", 757 + "gpio3", "gpio114", "gpio113", "gpio112", "gpio111", 758 + "gpio110", "gpio28", "gpio55", "gpio108", "gpio107", 759 + "gpio106", "gpio105", "gpio104", "gpio103", "gpio102", 760 + "gpio101", "gpio100", "gpio99", "gpio125", "gpio98", 761 + "gpio54", "gpio25", "gpio26", "gpio122", "gpio121", 762 + "gpio120", "gpio9", 763 + }; 764 + 765 + static const char *const pll_bist_groups[] = { 766 + "gpio107", 767 + }; 768 + 769 + static const char *const pll_clk_groups[] = { 770 + "gpio74", 771 + }; 772 + 773 + static const char *const prng_rosc0_groups[] = { 774 + "gpio57", 775 + }; 776 + 777 + static const char *const prng_rosc1_groups[] = { 778 + "gpio58", 779 + }; 780 + 781 + static const char *const prng_rosc2_groups[] = { 782 + "gpio59", 783 + }; 784 + 785 + static const char *const prng_rosc3_groups[] = { 786 + "gpio60", 787 + }; 788 + 789 + static const char *const qdss_cti_groups[] = { 790 + "gpio4", "gpio5", "gpio23", "gpio24", "gpio49", "gpio50", 791 + "gpio51", "gpio52", 792 + }; 793 + 794 + static const char *const qdss_gpio_groups[] = { 795 + "gpio57", "gpio58", "gpio97", "gpio106", 796 + "gpio59", "gpio107", "gpio60", "gpio108", 797 + "gpio36", "gpio100", "gpio61", "gpio101", 798 + "gpio62", "gpio102", "gpio33", "gpio103", 799 + "gpio34", "gpio104", "gpio75", "gpio105", 800 + "gpio72", "gpio109", "gpio71", "gpio110", 801 + "gpio70", "gpio111", "gpio63", "gpio112", 802 + "gpio64", "gpio113", "gpio65", "gpio114", 803 + "gpio73", "gpio98", "gpio74", "gpio99", 804 + }; 805 + 806 + static const char *const qup0_se0_groups[] = { 807 + "gpio17", "gpio18", "gpio19", "gpio20", 808 + }; 809 + 810 + static const char *const qup0_se1_groups[] = { 811 + "gpio19", "gpio20", "gpio17", "gpio18", 812 + }; 813 + 814 + static const char *const qup0_se2_groups[] = { 815 + "gpio33", "gpio34", "gpio35", "gpio36", 816 + }; 817 + 818 + static const char *const qup0_se3_groups[] = { 819 + "gpio25", "gpio26", "gpio27", "gpio28", 820 + }; 821 + 822 + static const char *const qup0_se4_groups[] = { 823 + "gpio29", "gpio30", "gpio31", "gpio32", 824 + }; 825 + 826 + static const char *const qup0_se5_groups[] = { 827 + "gpio21", "gpio22", "gpio23", "gpio24", 828 + }; 829 + 830 + static const char *const qup0_se6_groups[] = { 831 + "gpio80", "gpio81", "gpio82", "gpio83", 832 + }; 833 + 834 + static const char *const qup0_se7_groups[] = { 835 + "gpio43", "gpio44", "gpio43", "gpio44", 836 + }; 837 + 838 + static const char *const qup1_se0_groups[] = { 839 + "gpio37", "gpio38", "gpio39", "gpio40", 840 + }; 841 + 842 + static const char *const qup1_se1_groups[] = { 843 + "gpio39", "gpio40", "gpio37", "gpio38", 844 + }; 845 + 846 + static const char *const qup1_se2_groups[] = { 847 + "gpio84", "gpio85", "gpio86", "gpio87", "gpio88", 848 + }; 849 + 850 + static const char *const qup1_se3_groups[] = { 851 + "gpio41", "gpio42", "gpio41", "gpio42", 852 + }; 853 + 854 + static const char *const qup1_se4_groups[] = { 855 + "gpio45", "gpio46", "gpio47", "gpio48", 856 + }; 857 + 858 + static const char *const qup1_se5_groups[] = { 859 + "gpio49", "gpio50", "gpio51", "gpio52", 860 + }; 861 + 862 + static const char *const qup1_se6_groups[] = { 863 + "gpio89", "gpio90", "gpio91", "gpio92", 864 + }; 865 + 866 + static const char *const qup1_se7_groups[] = { 867 + "gpio91", "gpio92", "gpio89", "gpio90", 868 + }; 869 + 870 + static const char *const qup2_se0_groups[] = { 871 + "gpio10", "gpio11", "gpio12", "gpio13", 872 + "gpio14", "gpio15", "gpio16", 873 + }; 874 + 875 + static const char *const sailss_emac0_groups[] = { 876 + "gpio15", "gpio16", 877 + }; 878 + 879 + static const char *const sailss_ospi_groups[] = { 880 + "gpio15", "gpio16", 881 + }; 882 + 883 + static const char *const sgmii_phy_groups[] = { 884 + "gpio4", 885 + }; 886 + 887 + static const char *const tb_trig_groups[] = { 888 + "gpio14", 889 + }; 890 + 891 + static const char *const tgu_ch0_groups[] = { 892 + "gpio43", 893 + }; 894 + 895 + static const char *const tgu_ch1_groups[] = { 896 + "gpio44", 897 + }; 898 + 899 + static const char *const tgu_ch2_groups[] = { 900 + "gpio29", 901 + }; 902 + 903 + static const char *const tgu_ch3_groups[] = { 904 + "gpio30", 905 + }; 906 + 907 + static const char *const tsense_pwm1_groups[] = { 908 + "gpio79", 909 + }; 910 + 911 + static const char *const tsense_pwm2_groups[] = { 912 + "gpio78", 913 + }; 914 + 915 + static const char *const tsense_pwm3_groups[] = { 916 + "gpio77", 917 + }; 918 + 919 + static const char *const tsense_pwm4_groups[] = { 920 + "gpio76", 921 + }; 922 + 923 + static const char *const usb2phy_ac_groups[] = { 924 + "gpio7", "gpio8", 925 + }; 926 + 927 + static const char *const vsense_trigger_groups[] = { 928 + "gpio67", 929 + }; 930 + 931 + static const struct pinfunction qcs8300_functions[] = { 932 + MSM_PIN_FUNCTION(gpio), 933 + MSM_PIN_FUNCTION(aoss_cti), 934 + MSM_PIN_FUNCTION(atest_char), 935 + MSM_PIN_FUNCTION(atest_usb2), 936 + MSM_PIN_FUNCTION(audio_ref), 937 + MSM_PIN_FUNCTION(cam_mclk), 938 + MSM_PIN_FUNCTION(cci_async), 939 + MSM_PIN_FUNCTION(cci_i2c_scl), 940 + MSM_PIN_FUNCTION(cci_i2c_sda), 941 + MSM_PIN_FUNCTION(cci_timer), 942 + MSM_PIN_FUNCTION(cri_trng), 943 + MSM_PIN_FUNCTION(dbg_out), 944 + MSM_PIN_FUNCTION(ddr_bist), 945 + MSM_PIN_FUNCTION(ddr_pxi0), 946 + MSM_PIN_FUNCTION(ddr_pxi1), 947 + MSM_PIN_FUNCTION(ddr_pxi2), 948 + MSM_PIN_FUNCTION(ddr_pxi3), 949 + MSM_PIN_FUNCTION(edp0_hot), 950 + MSM_PIN_FUNCTION(edp0_lcd), 951 + MSM_PIN_FUNCTION(edp1_lcd), 952 + MSM_PIN_FUNCTION(egpio), 953 + MSM_PIN_FUNCTION(emac0_mcg0), 954 + MSM_PIN_FUNCTION(emac0_mcg1), 955 + MSM_PIN_FUNCTION(emac0_mcg2), 956 + MSM_PIN_FUNCTION(emac0_mcg3), 957 + MSM_PIN_FUNCTION(emac0_mdc), 958 + MSM_PIN_FUNCTION(emac0_mdio), 959 + MSM_PIN_FUNCTION(emac0_ptp_aux), 960 + MSM_PIN_FUNCTION(emac0_ptp_pps), 961 + MSM_PIN_FUNCTION(gcc_gp1), 962 + MSM_PIN_FUNCTION(gcc_gp2), 963 + MSM_PIN_FUNCTION(gcc_gp3), 964 + MSM_PIN_FUNCTION(gcc_gp4), 965 + MSM_PIN_FUNCTION(gcc_gp5), 966 + MSM_PIN_FUNCTION(hs0_mi2s), 967 + MSM_PIN_FUNCTION(hs1_mi2s), 968 + MSM_PIN_FUNCTION(hs2_mi2s), 969 + MSM_PIN_FUNCTION(ibi_i3c), 970 + MSM_PIN_FUNCTION(jitter_bist), 971 + MSM_PIN_FUNCTION(mdp0_vsync0), 972 + MSM_PIN_FUNCTION(mdp0_vsync1), 973 + MSM_PIN_FUNCTION(mdp0_vsync3), 974 + MSM_PIN_FUNCTION(mdp0_vsync6), 975 + MSM_PIN_FUNCTION(mdp0_vsync7), 976 + MSM_PIN_FUNCTION(mdp_vsync), 977 + MSM_PIN_FUNCTION(mi2s1_data0), 978 + MSM_PIN_FUNCTION(mi2s1_data1), 979 + MSM_PIN_FUNCTION(mi2s1_sck), 980 + MSM_PIN_FUNCTION(mi2s1_ws), 981 + MSM_PIN_FUNCTION(mi2s2_data0), 982 + MSM_PIN_FUNCTION(mi2s2_data1), 983 + MSM_PIN_FUNCTION(mi2s2_sck), 984 + MSM_PIN_FUNCTION(mi2s2_ws), 985 + MSM_PIN_FUNCTION(mi2s_mclk0), 986 + MSM_PIN_FUNCTION(mi2s_mclk1), 987 + MSM_PIN_FUNCTION(pcie0_clkreq), 988 + MSM_PIN_FUNCTION(pcie1_clkreq), 989 + MSM_PIN_FUNCTION(phase_flag), 990 + MSM_PIN_FUNCTION(pll_bist), 991 + MSM_PIN_FUNCTION(pll_clk), 992 + MSM_PIN_FUNCTION(prng_rosc0), 993 + MSM_PIN_FUNCTION(prng_rosc1), 994 + MSM_PIN_FUNCTION(prng_rosc2), 995 + MSM_PIN_FUNCTION(prng_rosc3), 996 + MSM_PIN_FUNCTION(qdss_cti), 997 + MSM_PIN_FUNCTION(qdss_gpio), 998 + MSM_PIN_FUNCTION(qup0_se0), 999 + MSM_PIN_FUNCTION(qup0_se1), 1000 + MSM_PIN_FUNCTION(qup0_se2), 1001 + MSM_PIN_FUNCTION(qup0_se3), 1002 + MSM_PIN_FUNCTION(qup0_se4), 1003 + MSM_PIN_FUNCTION(qup0_se5), 1004 + MSM_PIN_FUNCTION(qup0_se6), 1005 + MSM_PIN_FUNCTION(qup0_se7), 1006 + MSM_PIN_FUNCTION(qup1_se0), 1007 + MSM_PIN_FUNCTION(qup1_se1), 1008 + MSM_PIN_FUNCTION(qup1_se2), 1009 + MSM_PIN_FUNCTION(qup1_se3), 1010 + MSM_PIN_FUNCTION(qup1_se4), 1011 + MSM_PIN_FUNCTION(qup1_se5), 1012 + MSM_PIN_FUNCTION(qup1_se6), 1013 + MSM_PIN_FUNCTION(qup1_se7), 1014 + MSM_PIN_FUNCTION(qup2_se0), 1015 + MSM_PIN_FUNCTION(sailss_emac0), 1016 + MSM_PIN_FUNCTION(sailss_ospi), 1017 + MSM_PIN_FUNCTION(sgmii_phy), 1018 + MSM_PIN_FUNCTION(tb_trig), 1019 + MSM_PIN_FUNCTION(tgu_ch0), 1020 + MSM_PIN_FUNCTION(tgu_ch1), 1021 + MSM_PIN_FUNCTION(tgu_ch2), 1022 + MSM_PIN_FUNCTION(tgu_ch3), 1023 + MSM_PIN_FUNCTION(tsense_pwm1), 1024 + MSM_PIN_FUNCTION(tsense_pwm2), 1025 + MSM_PIN_FUNCTION(tsense_pwm3), 1026 + MSM_PIN_FUNCTION(tsense_pwm4), 1027 + MSM_PIN_FUNCTION(usb2phy_ac), 1028 + MSM_PIN_FUNCTION(vsense_trigger), 1029 + }; 1030 + 1031 + /* 1032 + * Every pin is maintained as a single group, and missing or non-existing pin 1033 + * would be maintained as dummy group to synchronize pin group index with 1034 + * pin descriptor registered with pinctrl core. 1035 + * Clients would not be able to request these dummy pin groups. 1036 + */ 1037 + static const struct msm_pingroup qcs8300_groups[] = { 1038 + [0] = PINGROUP(0, _, _, _, _, _, _, _, _, _, _, _), 1039 + [1] = PINGROUP(1, pcie0_clkreq, _, _, _, _, _, _, _, _, _, _), 1040 + [2] = PINGROUP(2, _, _, _, _, _, _, _, _, _, _, _), 1041 + [3] = PINGROUP(3, phase_flag, _, _, _, _, _, _, _, _, _, _), 1042 + [4] = PINGROUP(4, sgmii_phy, qdss_cti, _, _, _, _, _, _, _, _, _), 1043 + [5] = PINGROUP(5, emac0_mdc, qdss_cti, _, _, _, _, _, _, _, _, _), 1044 + [6] = PINGROUP(6, emac0_mdio, _, _, _, _, _, _, _, _, _, _), 1045 + [7] = PINGROUP(7, usb2phy_ac, _, _, _, _, _, _, _, _, _, _), 1046 + [8] = PINGROUP(8, usb2phy_ac, _, _, _, _, _, _, _, _, _, _), 1047 + [9] = PINGROUP(9, phase_flag, _, _, _, _, _, _, _, _, _, _), 1048 + [10] = PINGROUP(10, qup2_se0, emac0_mcg0, _, _, _, _, _, _, _, _, _), 1049 + [11] = PINGROUP(11, qup2_se0, emac0_mcg1, _, _, _, _, _, _, _, _, _), 1050 + [12] = PINGROUP(12, qup2_se0, _, _, _, _, _, _, _, _, _, _), 1051 + [13] = PINGROUP(13, qup2_se0, _, _, _, _, _, _, _, _, _, _), 1052 + [14] = PINGROUP(14, qup2_se0, tb_trig, _, _, _, _, _, _, _, _, _), 1053 + [15] = PINGROUP(15, qup2_se0, _, sailss_ospi, sailss_emac0, _, _, _, _, _, _, _), 1054 + [16] = PINGROUP(16, qup2_se0, _, _, sailss_ospi, sailss_emac0, _, _, _, _, _, _), 1055 + [17] = PINGROUP(17, qup0_se0, qup0_se1, ibi_i3c, _, _, _, _, _, _, _, _), 1056 + [18] = PINGROUP(18, qup0_se0, qup0_se1, ibi_i3c, _, _, _, _, _, _, _, _), 1057 + [19] = PINGROUP(19, qup0_se1, qup0_se0, cci_timer, ibi_i3c, _, _, _, _, _, _, _), 1058 + [20] = PINGROUP(20, qup0_se1, qup0_se0, cci_timer, ibi_i3c, _, _, _, _, _, _, _), 1059 + [21] = PINGROUP(21, qup0_se5, cci_timer, _, _, _, _, _, _, _, _, _), 1060 + [22] = PINGROUP(22, pcie1_clkreq, qup0_se5, cci_timer, _, _, _, _, _, _, _, _), 1061 + [23] = PINGROUP(23, qup0_se5, cci_timer, qdss_cti, _, _, _, _, _, _, _, _), 1062 + [24] = PINGROUP(24, qup0_se5, emac0_ptp_aux, emac0_ptp_pps, qdss_cti, 1063 + emac0_mcg2, _, _, _, _, _, _), 1064 + [25] = PINGROUP(25, qup0_se3, phase_flag, _, _, _, _, _, _, _, _, _), 1065 + [26] = PINGROUP(26, qup0_se3, phase_flag, _, _, _, _, _, _, _, _, _), 1066 + [27] = PINGROUP(27, qup0_se3, _, _, _, _, _, _, _, _, _, _), 1067 + [28] = PINGROUP(28, qup0_se3, phase_flag, _, _, _, _, _, _, _, _, _), 1068 + [29] = PINGROUP(29, qup0_se4, cci_i2c_sda, cci_async, emac0_ptp_pps, 1069 + tgu_ch2, _, _, _, _, _, _), 1070 + [30] = PINGROUP(30, qup0_se4, cci_i2c_scl, cci_async, emac0_ptp_pps, 1071 + tgu_ch3, _, _, _, _, _, _), 1072 + [31] = PINGROUP(31, qup0_se4, cci_i2c_sda, cci_async, emac0_ptp_aux, _, _, _, _, _, _, _), 1073 + [32] = PINGROUP(32, qup0_se4, cci_i2c_scl, emac0_ptp_aux, mdp_vsync, _, _, _, _, _, _, _), 1074 + [33] = PINGROUP(33, qup0_se2, qdss_gpio, _, _, _, _, _, _, _, _, _), 1075 + [34] = PINGROUP(34, qup0_se2, qdss_gpio, _, _, _, _, _, _, _, _, _), 1076 + [35] = PINGROUP(35, qup0_se2, gcc_gp1, _, _, _, _, _, _, _, _, _), 1077 + [36] = PINGROUP(36, qup0_se2, gcc_gp2, qdss_gpio, _, _, _, _, _, _, _, _), 1078 + [37] = PINGROUP(37, qup1_se0, ibi_i3c, qup1_se1, aoss_cti, _, _, _, _, _, _, _), 1079 + [38] = PINGROUP(38, qup1_se0, ibi_i3c, qup1_se1, aoss_cti, _, _, _, _, _, _, _), 1080 + [39] = PINGROUP(39, qup1_se1, ibi_i3c, qup1_se0, aoss_cti, _, _, _, _, _, _, _), 1081 + [40] = PINGROUP(40, qup1_se1, ibi_i3c, qup1_se0, aoss_cti, _, _, _, _, _, _, _), 1082 + [41] = PINGROUP(41, qup1_se3, _, _, _, _, _, _, _, _, _, _), 1083 + [42] = PINGROUP(42, qup1_se3, _, mdp_vsync, _, _, _, _, _, _, _, _), 1084 + [43] = PINGROUP(43, qup0_se7, _, tgu_ch0, _, _, _, _, _, _, _, _), 1085 + [44] = PINGROUP(44, qup0_se7, _, tgu_ch1, _, _, _, _, _, _, _, _), 1086 + [45] = PINGROUP(45, qup1_se4, hs1_mi2s, _, _, _, _, _, _, _, _, _), 1087 + [46] = PINGROUP(46, qup1_se4, hs1_mi2s, _, _, _, _, _, _, _, _, _), 1088 + [47] = PINGROUP(47, qup1_se4, hs1_mi2s, _, _, _, _, _, _, _, _, _), 1089 + [48] = PINGROUP(48, qup1_se4, hs1_mi2s, edp0_lcd, _, _, _, _, _, _, _, _), 1090 + [49] = PINGROUP(49, qup1_se5, hs2_mi2s, cci_timer, qdss_cti, edp1_lcd, 1091 + ddr_pxi1, _, _, _, _, _), 1092 + [50] = PINGROUP(50, qup1_se5, hs2_mi2s, cci_timer, qdss_cti, _, ddr_pxi1, _, _, _, _, _), 1093 + [51] = PINGROUP(51, qup1_se5, hs2_mi2s, qdss_cti, _, _, _, _, _, _, _, _), 1094 + [52] = PINGROUP(52, qup1_se5, hs2_mi2s, qdss_cti, mdp_vsync, ddr_pxi2, _, _, _, _, _, _), 1095 + [53] = PINGROUP(53, ddr_bist, _, _, _, _, _, _, _, _, _, _), 1096 + [54] = PINGROUP(54, cci_i2c_sda, phase_flag, ddr_bist, _, _, _, _, _, _, _, _), 1097 + [55] = PINGROUP(55, cci_i2c_scl, phase_flag, ddr_bist, _, _, _, _, _, _, _, _), 1098 + [56] = PINGROUP(56, phase_flag, ddr_bist, _, _, _, _, _, _, _, _, _), 1099 + [57] = PINGROUP(57, cci_i2c_sda, prng_rosc0, qdss_gpio, _, _, _, _, _, _, _, _), 1100 + [58] = PINGROUP(58, cci_i2c_scl, prng_rosc1, qdss_gpio, _, _, _, _, _, _, _, _), 1101 + [59] = PINGROUP(59, cci_i2c_sda, prng_rosc2, qdss_gpio, _, _, _, _, _, _, _, _), 1102 + [60] = PINGROUP(60, cci_i2c_scl, prng_rosc3, qdss_gpio, _, _, _, _, _, _, _, _), 1103 + [61] = PINGROUP(61, cci_i2c_sda, qdss_gpio, _, _, _, _, _, _, _, _, _), 1104 + [62] = PINGROUP(62, cci_i2c_scl, qdss_gpio, _, _, _, _, _, _, _, _, _), 1105 + [63] = PINGROUP(63, cci_timer, cci_async, qdss_gpio, atest_usb2, _, _, _, _, _, _, _), 1106 + [64] = PINGROUP(64, cci_timer, cci_async, qdss_gpio, atest_usb2, _, _, _, _, _, _, _), 1107 + [65] = PINGROUP(65, cci_timer, cci_async, qdss_gpio, atest_usb2, _, _, _, _, _, _, _), 1108 + [66] = PINGROUP(66, phase_flag, _, atest_char, _, _, _, _, _, _, _, _), 1109 + [67] = PINGROUP(67, cam_mclk, vsense_trigger, atest_usb2, _, _, _, _, _, _, _, _), 1110 + [68] = PINGROUP(68, cam_mclk, gcc_gp4, atest_usb2, ddr_pxi0, _, _, _, _, _, _, _), 1111 + [69] = PINGROUP(69, cam_mclk, gcc_gp3, atest_usb2, ddr_pxi0, _, _, _, _, _, _, _), 1112 + [70] = PINGROUP(70, qdss_gpio, atest_char, _, _, _, _, _, _, _, _, _), 1113 + [71] = PINGROUP(71, qdss_gpio, atest_char, _, _, _, _, _, _, _, _, _), 1114 + [72] = PINGROUP(72, qdss_gpio, atest_char, _, _, _, _, _, _, _, _, _), 1115 + [73] = PINGROUP(73, _, qdss_gpio, _, _, _, _, _, _, _, _, _), 1116 + [74] = PINGROUP(74, pll_clk, qdss_gpio, atest_usb2, _, _, _, _, _, _, _, _), 1117 + [75] = PINGROUP(75, _, dbg_out, qdss_gpio, atest_usb2, _, _, _, _, _, _, _), 1118 + [76] = PINGROUP(76, gcc_gp5, tsense_pwm4, _, _, _, _, _, _, _, _, _), 1119 + [77] = PINGROUP(77, gcc_gp5, tsense_pwm3, _, _, _, _, _, _, _, _, _), 1120 + [78] = PINGROUP(78, tsense_pwm2, _, _, _, _, _, _, _, _, _, _), 1121 + [79] = PINGROUP(79, emac0_ptp_aux, emac0_ptp_pps, emac0_mcg3, _, 1122 + tsense_pwm1, _, _, _, _, _, _), 1123 + [80] = PINGROUP(80, qup0_se6, mdp0_vsync6, _, atest_usb2, ddr_pxi3, _, _, _, _, _, _), 1124 + [81] = PINGROUP(81, qup0_se6, mdp0_vsync7, gcc_gp2, _, atest_usb2, ddr_pxi3, _, _, _, _, _), 1125 + [82] = PINGROUP(82, qup0_se6, gcc_gp3, _, _, _, _, _, _, _, _, _), 1126 + [83] = PINGROUP(83, qup0_se6, gcc_gp4, _, atest_usb2, ddr_pxi2, _, _, _, _, _, _), 1127 + [84] = PINGROUP(84, qup1_se2, gcc_gp1, _, atest_usb2, _, _, _, _, _, _, _), 1128 + [85] = PINGROUP(85, qup1_se2, _, atest_usb2, _, _, _, _, _, _, _, _), 1129 + [86] = PINGROUP(86, qup1_se2, _, _, _, _, _, _, _, _, _, _), 1130 + [87] = PINGROUP(87, qup1_se2, _, atest_usb2, _, _, _, _, _, _, _, _), 1131 + [88] = PINGROUP(88, qup1_se2, _, _, _, _, _, _, _, _, _, _), 1132 + [89] = PINGROUP(89, qup1_se6, qup1_se7, mdp0_vsync0, _, _, _, _, _, _, _, _), 1133 + [90] = PINGROUP(90, qup1_se6, qup1_se7, mdp0_vsync1, cri_trng, _, _, _, _, _, _, _), 1134 + [91] = PINGROUP(91, qup1_se7, qup1_se6, mdp0_vsync3, cri_trng, _, _, _, _, _, _, _), 1135 + [92] = PINGROUP(92, qup1_se7, qup1_se6, cri_trng, _, atest_usb2, _, _, _, _, _, _), 1136 + [93] = PINGROUP(93, atest_char, _, _, _, _, _, _, _, _, _, _), 1137 + [94] = PINGROUP(94, edp0_hot, _, _, _, _, _, _, _, _, _, _), 1138 + [95] = PINGROUP(95, _, _, _, _, _, _, _, _, _, _, _), 1139 + [96] = PINGROUP(96, _, _, _, _, _, _, _, _, _, _, _), 1140 + [97] = PINGROUP(97, mi2s_mclk0, jitter_bist, qdss_gpio, _, _, _, _, _, _, _, _), 1141 + [98] = PINGROUP(98, mi2s1_sck, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1142 + [99] = PINGROUP(99, mi2s1_ws, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1143 + [100] = PINGROUP(100, mi2s1_data0, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1144 + [101] = PINGROUP(101, mi2s1_data1, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1145 + [102] = PINGROUP(102, mi2s2_sck, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1146 + [103] = PINGROUP(103, mi2s2_ws, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1147 + [104] = PINGROUP(104, mi2s2_data0, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1148 + [105] = PINGROUP(105, mi2s2_data1, audio_ref, phase_flag, _, qdss_gpio, _, _, _, _, _, _), 1149 + [106] = PINGROUP(106, hs0_mi2s, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1150 + [107] = PINGROUP(107, hs0_mi2s, pll_bist, phase_flag, _, qdss_gpio, _, _, _, _, _, _), 1151 + [108] = PINGROUP(108, hs0_mi2s, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _), 1152 + [109] = PINGROUP(109, hs0_mi2s, mi2s_mclk1, qdss_gpio, _, _, _, _, _, _, _, _), 1153 + [110] = PINGROUP(110, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _, egpio), 1154 + [111] = PINGROUP(111, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _, egpio), 1155 + [112] = PINGROUP(112, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _, egpio), 1156 + [113] = PINGROUP(113, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _, egpio), 1157 + [114] = PINGROUP(114, phase_flag, _, qdss_gpio, _, _, _, _, _, _, _, egpio), 1158 + [115] = PINGROUP(115, _, _, _, _, _, _, _, _, _, _, egpio), 1159 + [116] = PINGROUP(116, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1160 + [117] = PINGROUP(117, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1161 + [118] = PINGROUP(118, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1162 + [119] = PINGROUP(119, _, _, _, _, _, _, _, _, _, _, egpio), 1163 + [120] = PINGROUP(120, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1164 + [121] = PINGROUP(121, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1165 + [122] = PINGROUP(122, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1166 + [123] = PINGROUP(123, _, _, _, _, _, _, _, _, _, _, egpio), 1167 + [124] = PINGROUP(124, _, _, _, _, _, _, _, _, _, _, egpio), 1168 + [125] = PINGROUP(125, phase_flag, _, _, _, _, _, _, _, _, _, egpio), 1169 + [126] = PINGROUP(126, _, _, _, _, _, _, _, _, _, _, egpio), 1170 + [127] = PINGROUP(127, _, _, _, _, _, _, _, _, _, _, egpio), 1171 + [128] = PINGROUP(128, _, _, _, _, _, _, _, _, _, _, egpio), 1172 + [129] = PINGROUP(129, _, _, _, _, _, _, _, _, _, _, egpio), 1173 + [130] = PINGROUP(130, _, _, _, _, _, _, _, _, _, _, egpio), 1174 + [131] = PINGROUP(131, _, _, _, _, _, _, _, _, _, _, egpio), 1175 + [132] = PINGROUP(132, _, _, _, _, _, _, _, _, _, _, egpio), 1176 + [133] = UFS_RESET(ufs_reset, 0x92000), 1177 + [134] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x89000, 15, 0), 1178 + [135] = SDC_QDSD_PINGROUP(sdc1_clk, 0x89000, 13, 6), 1179 + [136] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x89000, 11, 3), 1180 + [137] = SDC_QDSD_PINGROUP(sdc1_data, 0x89000, 9, 0), 1181 + }; 1182 + 1183 + static const struct msm_gpio_wakeirq_map qcs8300_pdc_map[] = { 1184 + { 0, 169 }, { 1, 174 }, { 2, 221 }, { 3, 176 }, { 4, 171 }, 1185 + { 9, 198 }, { 10, 187 }, { 11, 188 }, { 13, 211 }, { 16, 203 }, 1186 + { 17, 213 }, { 18, 209 }, { 19, 201 }, { 20, 230 }, { 21, 231 }, 1187 + { 22, 175 }, { 23, 170 }, { 24, 232 }, { 28, 235 }, { 29, 216 }, 1188 + { 31, 208 }, { 32, 200 }, { 36, 212 }, { 37, 177 }, { 38, 178 }, 1189 + { 39, 184 }, { 40, 185 }, { 42, 186 }, { 44, 194 }, { 45, 173 }, 1190 + { 48, 195 }, { 51, 215 }, { 52, 197 }, { 53, 192 }, { 56, 193 }, 1191 + { 66, 238 }, { 67, 172 }, { 68, 182 }, { 69, 179 }, { 70, 181 }, 1192 + { 71, 202 }, { 72, 183 }, { 73, 189 }, { 74, 196 }, { 75, 190 }, 1193 + { 76, 191 }, { 77, 204 }, { 78, 206 }, { 79, 207 }, { 83, 214 }, 1194 + { 84, 205 }, { 87, 237 }, { 89, 225 }, { 90, 217 }, { 91, 218 }, 1195 + { 92, 226 }, { 93, 227 }, { 94, 228 }, { 95, 236 }, { 97, 199 }, 1196 + { 98, 229 }, { 99, 180 }, { 100, 220 }, { 101, 239 }, { 102, 219 }, 1197 + { 103, 233 }, { 104, 234 }, { 105, 223 }, { 129, 210 }, { 130, 222 }, 1198 + }; 1199 + 1200 + static const struct msm_pinctrl_soc_data qcs8300_pinctrl = { 1201 + .pins = qcs8300_pins, 1202 + .npins = ARRAY_SIZE(qcs8300_pins), 1203 + .functions = qcs8300_functions, 1204 + .nfunctions = ARRAY_SIZE(qcs8300_functions), 1205 + .groups = qcs8300_groups, 1206 + .ngroups = ARRAY_SIZE(qcs8300_groups), 1207 + .ngpios = 133, 1208 + .wakeirq_map = qcs8300_pdc_map, 1209 + .nwakeirq_map = ARRAY_SIZE(qcs8300_pdc_map), 1210 + .egpio_func = 11, 1211 + }; 1212 + 1213 + static int qcs8300_pinctrl_probe(struct platform_device *pdev) 1214 + { 1215 + return msm_pinctrl_probe(pdev, &qcs8300_pinctrl); 1216 + } 1217 + 1218 + static const struct of_device_id qcs8300_pinctrl_of_match[] = { 1219 + { .compatible = "qcom,qcs8300-tlmm", }, 1220 + { }, 1221 + }; 1222 + MODULE_DEVICE_TABLE(of, qcs8300_pinctrl_of_match); 1223 + 1224 + static struct platform_driver qcs8300_pinctrl_driver = { 1225 + .driver = { 1226 + .name = "qcs8300-tlmm", 1227 + .of_match_table = qcs8300_pinctrl_of_match, 1228 + }, 1229 + .probe = qcs8300_pinctrl_probe, 1230 + .remove = msm_pinctrl_remove, 1231 + }; 1232 + 1233 + static int __init qcs8300_pinctrl_init(void) 1234 + { 1235 + return platform_driver_register(&qcs8300_pinctrl_driver); 1236 + } 1237 + arch_initcall(qcs8300_pinctrl_init); 1238 + 1239 + static void __exit qcs8300_pinctrl_exit(void) 1240 + { 1241 + platform_driver_unregister(&qcs8300_pinctrl_driver); 1242 + } 1243 + module_exit(qcs8300_pinctrl_exit); 1244 + 1245 + MODULE_DESCRIPTION("QTI QCS8300 pinctrl driver"); 1246 + MODULE_LICENSE("GPL");
+1 -1
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
··· 145 145 .acpi_match_table = qdf2xxx_acpi_ids, 146 146 }, 147 147 .probe = qdf2xxx_pinctrl_probe, 148 - .remove_new = msm_pinctrl_remove, 148 + .remove = msm_pinctrl_remove, 149 149 }; 150 150 151 151 static int __init qdf2xxx_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-qdu1000.c
··· 1248 1248 .of_match_table = qdu1000_tlmm_of_match, 1249 1249 }, 1250 1250 .probe = qdu1000_tlmm_probe, 1251 - .remove_new = msm_pinctrl_remove, 1251 + .remove = msm_pinctrl_remove, 1252 1252 }; 1253 1253 1254 1254 static int __init qdu1000_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sa8775p.c
··· 1530 1530 .of_match_table = sa8775p_pinctrl_of_match, 1531 1531 }, 1532 1532 .probe = sa8775p_pinctrl_probe, 1533 - .remove_new = msm_pinctrl_remove, 1533 + .remove = msm_pinctrl_remove, 1534 1534 }; 1535 1535 1536 1536 static int __init sa8775p_pinctrl_init(void)
+1505
drivers/pinctrl/qcom/pinctrl-sar2130p.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2021, Linaro Limited 5 + */ 6 + 7 + #include <linux/module.h> 8 + #include <linux/of.h> 9 + #include <linux/platform_device.h> 10 + 11 + #include "pinctrl-msm.h" 12 + 13 + #define REG_SIZE 0x1000 14 + 15 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 16 + { \ 17 + .grp = PINCTRL_PINGROUP("gpio" #id, \ 18 + gpio##id##_pins, \ 19 + ARRAY_SIZE(gpio##id##_pins)), \ 20 + .funcs = (int[]){ \ 21 + msm_mux_gpio, /* gpio mode */ \ 22 + msm_mux_##f1, \ 23 + msm_mux_##f2, \ 24 + msm_mux_##f3, \ 25 + msm_mux_##f4, \ 26 + msm_mux_##f5, \ 27 + msm_mux_##f6, \ 28 + msm_mux_##f7, \ 29 + msm_mux_##f8, \ 30 + msm_mux_##f9 \ 31 + }, \ 32 + .nfuncs = 10, \ 33 + .ctl_reg = REG_SIZE * id, \ 34 + .io_reg = 0x4 + REG_SIZE * id, \ 35 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 36 + .intr_status_reg = 0xc + REG_SIZE * id, \ 37 + .intr_target_reg = 0x8 + REG_SIZE * id, \ 38 + .mux_bit = 2, \ 39 + .pull_bit = 0, \ 40 + .drv_bit = 6, \ 41 + .egpio_enable = 12, \ 42 + .egpio_present = 11, \ 43 + .oe_bit = 9, \ 44 + .in_bit = 0, \ 45 + .out_bit = 1, \ 46 + .intr_enable_bit = 0, \ 47 + .intr_status_bit = 0, \ 48 + .intr_target_bit = 5, \ 49 + .intr_target_kpss_val = 4, \ 50 + .intr_raw_status_bit = 4, \ 51 + .intr_polarity_bit = 1, \ 52 + .intr_detection_bit = 2, \ 53 + .intr_detection_width = 2, \ 54 + } 55 + 56 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 57 + { \ 58 + .grp = PINCTRL_PINGROUP(#pg_name, \ 59 + pg_name##_pins, \ 60 + ARRAY_SIZE(pg_name##_pins)), \ 61 + .ctl_reg = ctl, \ 62 + .io_reg = 0, \ 63 + .intr_cfg_reg = 0, \ 64 + .intr_status_reg = 0, \ 65 + .intr_target_reg = 0, \ 66 + .mux_bit = -1, \ 67 + .pull_bit = pull, \ 68 + .drv_bit = drv, \ 69 + .oe_bit = -1, \ 70 + .in_bit = -1, \ 71 + .out_bit = -1, \ 72 + .intr_enable_bit = -1, \ 73 + .intr_status_bit = -1, \ 74 + .intr_target_bit = -1, \ 75 + .intr_raw_status_bit = -1, \ 76 + .intr_polarity_bit = -1, \ 77 + .intr_detection_bit = -1, \ 78 + .intr_detection_width = -1, \ 79 + } 80 + 81 + static const struct pinctrl_pin_desc sar2130p_pins[] = { 82 + PINCTRL_PIN(0, "GPIO_0"), 83 + PINCTRL_PIN(1, "GPIO_1"), 84 + PINCTRL_PIN(2, "GPIO_2"), 85 + PINCTRL_PIN(3, "GPIO_3"), 86 + PINCTRL_PIN(4, "GPIO_4"), 87 + PINCTRL_PIN(5, "GPIO_5"), 88 + PINCTRL_PIN(6, "GPIO_6"), 89 + PINCTRL_PIN(7, "GPIO_7"), 90 + PINCTRL_PIN(8, "GPIO_8"), 91 + PINCTRL_PIN(9, "GPIO_9"), 92 + PINCTRL_PIN(10, "GPIO_10"), 93 + PINCTRL_PIN(11, "GPIO_11"), 94 + PINCTRL_PIN(12, "GPIO_12"), 95 + PINCTRL_PIN(13, "GPIO_13"), 96 + PINCTRL_PIN(14, "GPIO_14"), 97 + PINCTRL_PIN(15, "GPIO_15"), 98 + PINCTRL_PIN(16, "GPIO_16"), 99 + PINCTRL_PIN(17, "GPIO_17"), 100 + PINCTRL_PIN(18, "GPIO_18"), 101 + PINCTRL_PIN(19, "GPIO_19"), 102 + PINCTRL_PIN(20, "GPIO_20"), 103 + PINCTRL_PIN(21, "GPIO_21"), 104 + PINCTRL_PIN(22, "GPIO_22"), 105 + PINCTRL_PIN(23, "GPIO_23"), 106 + PINCTRL_PIN(24, "GPIO_24"), 107 + PINCTRL_PIN(25, "GPIO_25"), 108 + PINCTRL_PIN(26, "GPIO_26"), 109 + PINCTRL_PIN(27, "GPIO_27"), 110 + PINCTRL_PIN(28, "GPIO_28"), 111 + PINCTRL_PIN(29, "GPIO_29"), 112 + PINCTRL_PIN(30, "GPIO_30"), 113 + PINCTRL_PIN(31, "GPIO_31"), 114 + PINCTRL_PIN(32, "GPIO_32"), 115 + PINCTRL_PIN(33, "GPIO_33"), 116 + PINCTRL_PIN(34, "GPIO_34"), 117 + PINCTRL_PIN(35, "GPIO_35"), 118 + PINCTRL_PIN(36, "GPIO_36"), 119 + PINCTRL_PIN(37, "GPIO_37"), 120 + PINCTRL_PIN(38, "GPIO_38"), 121 + PINCTRL_PIN(39, "GPIO_39"), 122 + PINCTRL_PIN(40, "GPIO_40"), 123 + PINCTRL_PIN(41, "GPIO_41"), 124 + PINCTRL_PIN(42, "GPIO_42"), 125 + PINCTRL_PIN(43, "GPIO_43"), 126 + PINCTRL_PIN(44, "GPIO_44"), 127 + PINCTRL_PIN(45, "GPIO_45"), 128 + PINCTRL_PIN(46, "GPIO_46"), 129 + PINCTRL_PIN(47, "GPIO_47"), 130 + PINCTRL_PIN(48, "GPIO_48"), 131 + PINCTRL_PIN(49, "GPIO_49"), 132 + PINCTRL_PIN(50, "GPIO_50"), 133 + PINCTRL_PIN(51, "GPIO_51"), 134 + PINCTRL_PIN(52, "GPIO_52"), 135 + PINCTRL_PIN(53, "GPIO_53"), 136 + PINCTRL_PIN(54, "GPIO_54"), 137 + PINCTRL_PIN(55, "GPIO_55"), 138 + PINCTRL_PIN(56, "GPIO_56"), 139 + PINCTRL_PIN(57, "GPIO_57"), 140 + PINCTRL_PIN(58, "GPIO_58"), 141 + PINCTRL_PIN(59, "GPIO_59"), 142 + PINCTRL_PIN(60, "GPIO_60"), 143 + PINCTRL_PIN(61, "GPIO_61"), 144 + PINCTRL_PIN(62, "GPIO_62"), 145 + PINCTRL_PIN(63, "GPIO_63"), 146 + PINCTRL_PIN(64, "GPIO_64"), 147 + PINCTRL_PIN(65, "GPIO_65"), 148 + PINCTRL_PIN(66, "GPIO_66"), 149 + PINCTRL_PIN(67, "GPIO_67"), 150 + PINCTRL_PIN(68, "GPIO_68"), 151 + PINCTRL_PIN(69, "GPIO_69"), 152 + PINCTRL_PIN(70, "GPIO_70"), 153 + PINCTRL_PIN(71, "GPIO_71"), 154 + PINCTRL_PIN(72, "GPIO_72"), 155 + PINCTRL_PIN(73, "GPIO_73"), 156 + PINCTRL_PIN(74, "GPIO_74"), 157 + PINCTRL_PIN(75, "GPIO_75"), 158 + PINCTRL_PIN(76, "GPIO_76"), 159 + PINCTRL_PIN(77, "GPIO_77"), 160 + PINCTRL_PIN(78, "GPIO_78"), 161 + PINCTRL_PIN(79, "GPIO_79"), 162 + PINCTRL_PIN(80, "GPIO_80"), 163 + PINCTRL_PIN(81, "GPIO_81"), 164 + PINCTRL_PIN(82, "GPIO_82"), 165 + PINCTRL_PIN(83, "GPIO_83"), 166 + PINCTRL_PIN(84, "GPIO_84"), 167 + PINCTRL_PIN(85, "GPIO_85"), 168 + PINCTRL_PIN(86, "GPIO_86"), 169 + PINCTRL_PIN(87, "GPIO_87"), 170 + PINCTRL_PIN(88, "GPIO_88"), 171 + PINCTRL_PIN(89, "GPIO_89"), 172 + PINCTRL_PIN(90, "GPIO_90"), 173 + PINCTRL_PIN(91, "GPIO_91"), 174 + PINCTRL_PIN(92, "GPIO_92"), 175 + PINCTRL_PIN(93, "GPIO_93"), 176 + PINCTRL_PIN(94, "GPIO_94"), 177 + PINCTRL_PIN(95, "GPIO_95"), 178 + PINCTRL_PIN(96, "GPIO_96"), 179 + PINCTRL_PIN(97, "GPIO_97"), 180 + PINCTRL_PIN(98, "GPIO_98"), 181 + PINCTRL_PIN(99, "GPIO_99"), 182 + PINCTRL_PIN(100, "GPIO_100"), 183 + PINCTRL_PIN(101, "GPIO_101"), 184 + PINCTRL_PIN(102, "GPIO_102"), 185 + PINCTRL_PIN(103, "GPIO_103"), 186 + PINCTRL_PIN(104, "GPIO_104"), 187 + PINCTRL_PIN(105, "GPIO_105"), 188 + PINCTRL_PIN(106, "GPIO_106"), 189 + PINCTRL_PIN(107, "GPIO_107"), 190 + PINCTRL_PIN(108, "GPIO_108"), 191 + PINCTRL_PIN(109, "GPIO_109"), 192 + PINCTRL_PIN(110, "GPIO_110"), 193 + PINCTRL_PIN(111, "GPIO_111"), 194 + PINCTRL_PIN(112, "GPIO_112"), 195 + PINCTRL_PIN(113, "GPIO_113"), 196 + PINCTRL_PIN(114, "GPIO_114"), 197 + PINCTRL_PIN(115, "GPIO_115"), 198 + PINCTRL_PIN(116, "GPIO_116"), 199 + PINCTRL_PIN(117, "GPIO_117"), 200 + PINCTRL_PIN(118, "GPIO_118"), 201 + PINCTRL_PIN(119, "GPIO_119"), 202 + PINCTRL_PIN(120, "GPIO_120"), 203 + PINCTRL_PIN(121, "GPIO_121"), 204 + PINCTRL_PIN(122, "GPIO_122"), 205 + PINCTRL_PIN(123, "GPIO_123"), 206 + PINCTRL_PIN(124, "GPIO_124"), 207 + PINCTRL_PIN(125, "GPIO_125"), 208 + PINCTRL_PIN(126, "GPIO_126"), 209 + PINCTRL_PIN(127, "GPIO_127"), 210 + PINCTRL_PIN(128, "GPIO_128"), 211 + PINCTRL_PIN(129, "GPIO_129"), 212 + PINCTRL_PIN(130, "GPIO_130"), 213 + PINCTRL_PIN(131, "GPIO_131"), 214 + PINCTRL_PIN(132, "GPIO_132"), 215 + PINCTRL_PIN(133, "GPIO_133"), 216 + PINCTRL_PIN(134, "GPIO_134"), 217 + PINCTRL_PIN(135, "GPIO_135"), 218 + PINCTRL_PIN(136, "GPIO_136"), 219 + PINCTRL_PIN(137, "GPIO_137"), 220 + PINCTRL_PIN(138, "GPIO_138"), 221 + PINCTRL_PIN(139, "GPIO_139"), 222 + PINCTRL_PIN(140, "GPIO_140"), 223 + PINCTRL_PIN(141, "GPIO_141"), 224 + PINCTRL_PIN(142, "GPIO_142"), 225 + PINCTRL_PIN(143, "GPIO_143"), 226 + PINCTRL_PIN(144, "GPIO_144"), 227 + PINCTRL_PIN(145, "GPIO_145"), 228 + PINCTRL_PIN(146, "GPIO_146"), 229 + PINCTRL_PIN(147, "GPIO_147"), 230 + PINCTRL_PIN(148, "GPIO_148"), 231 + PINCTRL_PIN(149, "GPIO_149"), 232 + PINCTRL_PIN(150, "GPIO_150"), 233 + PINCTRL_PIN(151, "GPIO_151"), 234 + PINCTRL_PIN(152, "GPIO_152"), 235 + PINCTRL_PIN(153, "GPIO_153"), 236 + PINCTRL_PIN(154, "GPIO_154"), 237 + PINCTRL_PIN(155, "GPIO_155"), 238 + PINCTRL_PIN(156, "SDC1_RCLK"), 239 + PINCTRL_PIN(157, "SDC1_CLK"), 240 + PINCTRL_PIN(158, "SDC1_CMD"), 241 + PINCTRL_PIN(159, "SDC1_DATA"), 242 + }; 243 + 244 + #define DECLARE_MSM_GPIO_PINS(pin) \ 245 + static const unsigned int gpio##pin##_pins[] = { pin } 246 + DECLARE_MSM_GPIO_PINS(0); 247 + DECLARE_MSM_GPIO_PINS(1); 248 + DECLARE_MSM_GPIO_PINS(2); 249 + DECLARE_MSM_GPIO_PINS(3); 250 + DECLARE_MSM_GPIO_PINS(4); 251 + DECLARE_MSM_GPIO_PINS(5); 252 + DECLARE_MSM_GPIO_PINS(6); 253 + DECLARE_MSM_GPIO_PINS(7); 254 + DECLARE_MSM_GPIO_PINS(8); 255 + DECLARE_MSM_GPIO_PINS(9); 256 + DECLARE_MSM_GPIO_PINS(10); 257 + DECLARE_MSM_GPIO_PINS(11); 258 + DECLARE_MSM_GPIO_PINS(12); 259 + DECLARE_MSM_GPIO_PINS(13); 260 + DECLARE_MSM_GPIO_PINS(14); 261 + DECLARE_MSM_GPIO_PINS(15); 262 + DECLARE_MSM_GPIO_PINS(16); 263 + DECLARE_MSM_GPIO_PINS(17); 264 + DECLARE_MSM_GPIO_PINS(18); 265 + DECLARE_MSM_GPIO_PINS(19); 266 + DECLARE_MSM_GPIO_PINS(20); 267 + DECLARE_MSM_GPIO_PINS(21); 268 + DECLARE_MSM_GPIO_PINS(22); 269 + DECLARE_MSM_GPIO_PINS(23); 270 + DECLARE_MSM_GPIO_PINS(24); 271 + DECLARE_MSM_GPIO_PINS(25); 272 + DECLARE_MSM_GPIO_PINS(26); 273 + DECLARE_MSM_GPIO_PINS(27); 274 + DECLARE_MSM_GPIO_PINS(28); 275 + DECLARE_MSM_GPIO_PINS(29); 276 + DECLARE_MSM_GPIO_PINS(30); 277 + DECLARE_MSM_GPIO_PINS(31); 278 + DECLARE_MSM_GPIO_PINS(32); 279 + DECLARE_MSM_GPIO_PINS(33); 280 + DECLARE_MSM_GPIO_PINS(34); 281 + DECLARE_MSM_GPIO_PINS(35); 282 + DECLARE_MSM_GPIO_PINS(36); 283 + DECLARE_MSM_GPIO_PINS(37); 284 + DECLARE_MSM_GPIO_PINS(38); 285 + DECLARE_MSM_GPIO_PINS(39); 286 + DECLARE_MSM_GPIO_PINS(40); 287 + DECLARE_MSM_GPIO_PINS(41); 288 + DECLARE_MSM_GPIO_PINS(42); 289 + DECLARE_MSM_GPIO_PINS(43); 290 + DECLARE_MSM_GPIO_PINS(44); 291 + DECLARE_MSM_GPIO_PINS(45); 292 + DECLARE_MSM_GPIO_PINS(46); 293 + DECLARE_MSM_GPIO_PINS(47); 294 + DECLARE_MSM_GPIO_PINS(48); 295 + DECLARE_MSM_GPIO_PINS(49); 296 + DECLARE_MSM_GPIO_PINS(50); 297 + DECLARE_MSM_GPIO_PINS(51); 298 + DECLARE_MSM_GPIO_PINS(52); 299 + DECLARE_MSM_GPIO_PINS(53); 300 + DECLARE_MSM_GPIO_PINS(54); 301 + DECLARE_MSM_GPIO_PINS(55); 302 + DECLARE_MSM_GPIO_PINS(56); 303 + DECLARE_MSM_GPIO_PINS(57); 304 + DECLARE_MSM_GPIO_PINS(58); 305 + DECLARE_MSM_GPIO_PINS(59); 306 + DECLARE_MSM_GPIO_PINS(60); 307 + DECLARE_MSM_GPIO_PINS(61); 308 + DECLARE_MSM_GPIO_PINS(62); 309 + DECLARE_MSM_GPIO_PINS(63); 310 + DECLARE_MSM_GPIO_PINS(64); 311 + DECLARE_MSM_GPIO_PINS(65); 312 + DECLARE_MSM_GPIO_PINS(66); 313 + DECLARE_MSM_GPIO_PINS(67); 314 + DECLARE_MSM_GPIO_PINS(68); 315 + DECLARE_MSM_GPIO_PINS(69); 316 + DECLARE_MSM_GPIO_PINS(70); 317 + DECLARE_MSM_GPIO_PINS(71); 318 + DECLARE_MSM_GPIO_PINS(72); 319 + DECLARE_MSM_GPIO_PINS(73); 320 + DECLARE_MSM_GPIO_PINS(74); 321 + DECLARE_MSM_GPIO_PINS(75); 322 + DECLARE_MSM_GPIO_PINS(76); 323 + DECLARE_MSM_GPIO_PINS(77); 324 + DECLARE_MSM_GPIO_PINS(78); 325 + DECLARE_MSM_GPIO_PINS(79); 326 + DECLARE_MSM_GPIO_PINS(80); 327 + DECLARE_MSM_GPIO_PINS(81); 328 + DECLARE_MSM_GPIO_PINS(82); 329 + DECLARE_MSM_GPIO_PINS(83); 330 + DECLARE_MSM_GPIO_PINS(84); 331 + DECLARE_MSM_GPIO_PINS(85); 332 + DECLARE_MSM_GPIO_PINS(86); 333 + DECLARE_MSM_GPIO_PINS(87); 334 + DECLARE_MSM_GPIO_PINS(88); 335 + DECLARE_MSM_GPIO_PINS(89); 336 + DECLARE_MSM_GPIO_PINS(90); 337 + DECLARE_MSM_GPIO_PINS(91); 338 + DECLARE_MSM_GPIO_PINS(92); 339 + DECLARE_MSM_GPIO_PINS(93); 340 + DECLARE_MSM_GPIO_PINS(94); 341 + DECLARE_MSM_GPIO_PINS(95); 342 + DECLARE_MSM_GPIO_PINS(96); 343 + DECLARE_MSM_GPIO_PINS(97); 344 + DECLARE_MSM_GPIO_PINS(98); 345 + DECLARE_MSM_GPIO_PINS(99); 346 + DECLARE_MSM_GPIO_PINS(100); 347 + DECLARE_MSM_GPIO_PINS(101); 348 + DECLARE_MSM_GPIO_PINS(102); 349 + DECLARE_MSM_GPIO_PINS(103); 350 + DECLARE_MSM_GPIO_PINS(104); 351 + DECLARE_MSM_GPIO_PINS(105); 352 + DECLARE_MSM_GPIO_PINS(106); 353 + DECLARE_MSM_GPIO_PINS(107); 354 + DECLARE_MSM_GPIO_PINS(108); 355 + DECLARE_MSM_GPIO_PINS(109); 356 + DECLARE_MSM_GPIO_PINS(110); 357 + DECLARE_MSM_GPIO_PINS(111); 358 + DECLARE_MSM_GPIO_PINS(112); 359 + DECLARE_MSM_GPIO_PINS(113); 360 + DECLARE_MSM_GPIO_PINS(114); 361 + DECLARE_MSM_GPIO_PINS(115); 362 + DECLARE_MSM_GPIO_PINS(116); 363 + DECLARE_MSM_GPIO_PINS(117); 364 + DECLARE_MSM_GPIO_PINS(118); 365 + DECLARE_MSM_GPIO_PINS(119); 366 + DECLARE_MSM_GPIO_PINS(120); 367 + DECLARE_MSM_GPIO_PINS(121); 368 + DECLARE_MSM_GPIO_PINS(122); 369 + DECLARE_MSM_GPIO_PINS(123); 370 + DECLARE_MSM_GPIO_PINS(124); 371 + DECLARE_MSM_GPIO_PINS(125); 372 + DECLARE_MSM_GPIO_PINS(126); 373 + DECLARE_MSM_GPIO_PINS(127); 374 + DECLARE_MSM_GPIO_PINS(128); 375 + DECLARE_MSM_GPIO_PINS(129); 376 + DECLARE_MSM_GPIO_PINS(130); 377 + DECLARE_MSM_GPIO_PINS(131); 378 + DECLARE_MSM_GPIO_PINS(132); 379 + DECLARE_MSM_GPIO_PINS(133); 380 + DECLARE_MSM_GPIO_PINS(134); 381 + DECLARE_MSM_GPIO_PINS(135); 382 + DECLARE_MSM_GPIO_PINS(136); 383 + DECLARE_MSM_GPIO_PINS(137); 384 + DECLARE_MSM_GPIO_PINS(138); 385 + DECLARE_MSM_GPIO_PINS(139); 386 + DECLARE_MSM_GPIO_PINS(140); 387 + DECLARE_MSM_GPIO_PINS(141); 388 + DECLARE_MSM_GPIO_PINS(142); 389 + DECLARE_MSM_GPIO_PINS(143); 390 + DECLARE_MSM_GPIO_PINS(144); 391 + DECLARE_MSM_GPIO_PINS(145); 392 + DECLARE_MSM_GPIO_PINS(146); 393 + DECLARE_MSM_GPIO_PINS(147); 394 + DECLARE_MSM_GPIO_PINS(148); 395 + DECLARE_MSM_GPIO_PINS(149); 396 + DECLARE_MSM_GPIO_PINS(150); 397 + DECLARE_MSM_GPIO_PINS(151); 398 + DECLARE_MSM_GPIO_PINS(152); 399 + DECLARE_MSM_GPIO_PINS(153); 400 + DECLARE_MSM_GPIO_PINS(154); 401 + DECLARE_MSM_GPIO_PINS(155); 402 + 403 + static const unsigned int sdc1_rclk_pins[] = { 156 }; 404 + static const unsigned int sdc1_clk_pins[] = { 157 }; 405 + static const unsigned int sdc1_cmd_pins[] = { 158 }; 406 + static const unsigned int sdc1_data_pins[] = { 159 }; 407 + 408 + enum sar2130p_functions { 409 + msm_mux_gpio, 410 + msm_mux_aoss_cti, 411 + msm_mux_atest_char, 412 + msm_mux_atest_char0, 413 + msm_mux_atest_char1, 414 + msm_mux_atest_char2, 415 + msm_mux_atest_char3, 416 + msm_mux_atest_usb0, 417 + msm_mux_atest_usb00, 418 + msm_mux_atest_usb01, 419 + msm_mux_atest_usb02, 420 + msm_mux_atest_usb03, 421 + msm_mux_audio_ref, 422 + msm_mux_cam_mclk, 423 + msm_mux_cci_async, 424 + msm_mux_cci_i2c, 425 + msm_mux_cci_timer0, 426 + msm_mux_cci_timer1, 427 + msm_mux_cci_timer2, 428 + msm_mux_cci_timer3, 429 + msm_mux_cci_timer4, 430 + msm_mux_cri_trng, 431 + msm_mux_cri_trng0, 432 + msm_mux_cri_trng1, 433 + msm_mux_dbg_out, 434 + msm_mux_ddr_bist, 435 + msm_mux_ddr_pxi0, 436 + msm_mux_ddr_pxi1, 437 + msm_mux_ddr_pxi2, 438 + msm_mux_ddr_pxi3, 439 + msm_mux_dp0_hot, 440 + msm_mux_ext_mclk0, 441 + msm_mux_ext_mclk1, 442 + msm_mux_gcc_gp1, 443 + msm_mux_gcc_gp2, 444 + msm_mux_gcc_gp3, 445 + msm_mux_host2wlan_sol, 446 + msm_mux_i2s0_data0, 447 + msm_mux_i2s0_data1, 448 + msm_mux_i2s0_sck, 449 + msm_mux_i2s0_ws, 450 + msm_mux_ibi_i3c, 451 + msm_mux_jitter_bist, 452 + msm_mux_mdp_vsync, 453 + msm_mux_mdp_vsync0, 454 + msm_mux_mdp_vsync1, 455 + msm_mux_mdp_vsync2, 456 + msm_mux_mdp_vsync3, 457 + msm_mux_pcie0_clkreqn, 458 + msm_mux_pcie1_clkreqn, 459 + msm_mux_phase_flag0, 460 + msm_mux_phase_flag1, 461 + msm_mux_phase_flag10, 462 + msm_mux_phase_flag11, 463 + msm_mux_phase_flag12, 464 + msm_mux_phase_flag13, 465 + msm_mux_phase_flag14, 466 + msm_mux_phase_flag15, 467 + msm_mux_phase_flag16, 468 + msm_mux_phase_flag17, 469 + msm_mux_phase_flag18, 470 + msm_mux_phase_flag19, 471 + msm_mux_phase_flag2, 472 + msm_mux_phase_flag20, 473 + msm_mux_phase_flag21, 474 + msm_mux_phase_flag22, 475 + msm_mux_phase_flag23, 476 + msm_mux_phase_flag24, 477 + msm_mux_phase_flag25, 478 + msm_mux_phase_flag26, 479 + msm_mux_phase_flag27, 480 + msm_mux_phase_flag28, 481 + msm_mux_phase_flag29, 482 + msm_mux_phase_flag3, 483 + msm_mux_phase_flag30, 484 + msm_mux_phase_flag31, 485 + msm_mux_phase_flag4, 486 + msm_mux_phase_flag5, 487 + msm_mux_phase_flag6, 488 + msm_mux_phase_flag7, 489 + msm_mux_phase_flag8, 490 + msm_mux_phase_flag9, 491 + msm_mux_pll_bist, 492 + msm_mux_pll_clk, 493 + msm_mux_prng_rosc0, 494 + msm_mux_prng_rosc1, 495 + msm_mux_prng_rosc2, 496 + msm_mux_prng_rosc3, 497 + msm_mux_qdss_cti, 498 + msm_mux_qdss_gpio, 499 + msm_mux_qdss_gpio0, 500 + msm_mux_qdss_gpio1, 501 + msm_mux_qdss_gpio10, 502 + msm_mux_qdss_gpio11, 503 + msm_mux_qdss_gpio12, 504 + msm_mux_qdss_gpio13, 505 + msm_mux_qdss_gpio14, 506 + msm_mux_qdss_gpio15, 507 + msm_mux_qdss_gpio2, 508 + msm_mux_qdss_gpio3, 509 + msm_mux_qdss_gpio4, 510 + msm_mux_qdss_gpio5, 511 + msm_mux_qdss_gpio6, 512 + msm_mux_qdss_gpio7, 513 + msm_mux_qdss_gpio8, 514 + msm_mux_qdss_gpio9, 515 + msm_mux_qspi0, 516 + msm_mux_qspi1, 517 + msm_mux_qspi2, 518 + msm_mux_qspi3, 519 + msm_mux_qspi_clk, 520 + msm_mux_qspi_cs0, 521 + msm_mux_qspi_cs1, 522 + msm_mux_qup0, 523 + msm_mux_qup1, 524 + msm_mux_qup2, 525 + msm_mux_qup3, 526 + msm_mux_qup4, 527 + msm_mux_qup5, 528 + msm_mux_qup6, 529 + msm_mux_qup7, 530 + msm_mux_qup8, 531 + msm_mux_qup9, 532 + msm_mux_qup10, 533 + msm_mux_qup11, 534 + msm_mux_tb_trig, 535 + msm_mux_tgu_ch0, 536 + msm_mux_tgu_ch1, 537 + msm_mux_tgu_ch2, 538 + msm_mux_tgu_ch3, 539 + msm_mux_tmess_prng0, 540 + msm_mux_tmess_prng1, 541 + msm_mux_tmess_prng2, 542 + msm_mux_tmess_prng3, 543 + msm_mux_tsense_pwm1, 544 + msm_mux_tsense_pwm2, 545 + msm_mux_usb0_phy, 546 + msm_mux_vsense_trigger, 547 + msm_mux__, 548 + }; 549 + 550 + static const char * const gpio_groups[] = { 551 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 552 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 553 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 554 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 555 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 556 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 557 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 558 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 559 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 560 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 561 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 562 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 563 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 564 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 565 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 566 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 567 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 568 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 569 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 570 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 571 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 572 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 573 + "gpio147", "gpio148", "gpio149", "gpio150", "gpio151", "gpio152", 574 + "gpio153", "gpio154", "gpio155", 575 + }; 576 + 577 + static const char * const aoss_cti_groups[] = { 578 + "gpio20", "gpio21", "gpio22", "gpio23", 579 + }; 580 + 581 + static const char * const atest_char_groups[] = { 582 + "gpio45", 583 + }; 584 + 585 + static const char * const atest_char0_groups[] = { 586 + "gpio90", 587 + }; 588 + 589 + static const char * const atest_char1_groups[] = { 590 + "gpio89", 591 + }; 592 + 593 + static const char * const atest_char2_groups[] = { 594 + "gpio88", 595 + }; 596 + 597 + static const char * const atest_char3_groups[] = { 598 + "gpio87", 599 + }; 600 + 601 + static const char * const atest_usb0_groups[] = { 602 + "gpio26", 603 + }; 604 + 605 + static const char * const atest_usb00_groups[] = { 606 + "gpio110", 607 + }; 608 + 609 + static const char * const atest_usb01_groups[] = { 610 + "gpio109", 611 + }; 612 + 613 + static const char * const atest_usb02_groups[] = { 614 + "gpio27", 615 + }; 616 + 617 + static const char * const atest_usb03_groups[] = { 618 + "gpio60", 619 + }; 620 + 621 + static const char * const audio_ref_groups[] = { 622 + "gpio103", 623 + }; 624 + 625 + static const char * const cam_mclk_groups[] = { 626 + "gpio69", "gpio70", "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", 627 + "gpio76", 628 + }; 629 + 630 + static const char * const cci_async_groups[] = { 631 + "gpio80", "gpio81", "gpio82", 632 + }; 633 + 634 + static const char * const cci_i2c_groups[] = { 635 + "gpio67", "gpio68", "gpio78", "gpio79", "gpio80", "gpio81", "gpio83", 636 + "gpio84", "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", 637 + "gpio91", "gpio92", 638 + }; 639 + 640 + static const char * const cci_timer0_groups[] = { 641 + "gpio77", 642 + }; 643 + 644 + static const char * const cci_timer1_groups[] = { 645 + "gpio78", 646 + }; 647 + 648 + static const char * const cci_timer2_groups[] = { 649 + "gpio79", 650 + }; 651 + 652 + static const char * const cci_timer3_groups[] = { 653 + "gpio80", 654 + }; 655 + 656 + static const char * const cci_timer4_groups[] = { 657 + "gpio81", 658 + }; 659 + 660 + static const char * const cri_trng_groups[] = { 661 + "gpio60", 662 + }; 663 + 664 + static const char * const cri_trng0_groups[] = { 665 + "gpio70", 666 + }; 667 + 668 + static const char * const cri_trng1_groups[] = { 669 + "gpio71", 670 + }; 671 + 672 + static const char * const dbg_out_groups[] = { 673 + "gpio59", 674 + }; 675 + 676 + static const char * const ddr_bist_groups[] = { 677 + "gpio4", "gpio5", "gpio100", "gpio103", 678 + }; 679 + 680 + static const char * const ddr_pxi0_groups[] = { 681 + "gpio56", "gpio57", 682 + }; 683 + 684 + static const char * const ddr_pxi1_groups[] = { 685 + "gpio41", "gpio45", 686 + }; 687 + 688 + static const char * const ddr_pxi2_groups[] = { 689 + "gpio48", "gpio55", 690 + }; 691 + 692 + static const char * const ddr_pxi3_groups[] = { 693 + "gpio46", "gpio47", 694 + }; 695 + 696 + static const char * const dp0_hot_groups[] = { 697 + "gpio35", "gpio103", 698 + }; 699 + 700 + static const char * const ext_mclk0_groups[] = { 701 + "gpio104", 702 + }; 703 + 704 + static const char * const ext_mclk1_groups[] = { 705 + "gpio103", 706 + }; 707 + 708 + static const char * const gcc_gp1_groups[] = { 709 + "gpio129", "gpio132", 710 + }; 711 + 712 + static const char * const gcc_gp2_groups[] = { 713 + "gpio130", "gpio135", 714 + }; 715 + 716 + static const char * const gcc_gp3_groups[] = { 717 + "gpio131", "gpio136", 718 + }; 719 + 720 + static const char * const host2wlan_sol_groups[] = { 721 + "gpio111", 722 + }; 723 + 724 + static const char * const i2s0_data0_groups[] = { 725 + "gpio106", 726 + }; 727 + 728 + static const char * const i2s0_data1_groups[] = { 729 + "gpio107", 730 + }; 731 + 732 + static const char * const i2s0_sck_groups[] = { 733 + "gpio105", 734 + }; 735 + 736 + static const char * const i2s0_ws_groups[] = { 737 + "gpio108", 738 + }; 739 + 740 + static const char * const ibi_i3c_groups[] = { 741 + "gpio0", "gpio1", "gpio91", "gpio92", 742 + }; 743 + 744 + static const char * const jitter_bist_groups[] = { 745 + "gpio0", 746 + }; 747 + 748 + static const char * const mdp_vsync_groups[] = { 749 + "gpio12", "gpio13", "gpio41", "gpio49", "gpio50", 750 + }; 751 + 752 + static const char * const mdp_vsync0_groups[] = { 753 + "gpio49", 754 + }; 755 + 756 + static const char * const mdp_vsync1_groups[] = { 757 + "gpio49", 758 + }; 759 + 760 + static const char * const mdp_vsync2_groups[] = { 761 + "gpio50", 762 + }; 763 + 764 + static const char * const mdp_vsync3_groups[] = { 765 + "gpio50", 766 + }; 767 + 768 + static const char * const pcie0_clkreqn_groups[] = { 769 + "gpio56", 770 + }; 771 + 772 + static const char * const pcie1_clkreqn_groups[] = { 773 + "gpio59", 774 + }; 775 + 776 + static const char * const phase_flag0_groups[] = { 777 + "gpio133", 778 + }; 779 + 780 + static const char * const phase_flag1_groups[] = { 781 + "gpio128", 782 + }; 783 + 784 + static const char * const phase_flag10_groups[] = { 785 + "gpio94", 786 + }; 787 + 788 + static const char * const phase_flag11_groups[] = { 789 + "gpio93", 790 + }; 791 + 792 + static const char * const phase_flag12_groups[] = { 793 + "gpio134", 794 + }; 795 + 796 + static const char * const phase_flag13_groups[] = { 797 + "gpio139", 798 + }; 799 + 800 + static const char * const phase_flag14_groups[] = { 801 + "gpio138", 802 + }; 803 + 804 + static const char * const phase_flag15_groups[] = { 805 + "gpio137", 806 + }; 807 + 808 + static const char * const phase_flag16_groups[] = { 809 + "gpio62", 810 + }; 811 + 812 + static const char * const phase_flag17_groups[] = { 813 + "gpio61", 814 + }; 815 + 816 + static const char * const phase_flag18_groups[] = { 817 + "gpio41", 818 + }; 819 + 820 + static const char * const phase_flag19_groups[] = { 821 + "gpio23", 822 + }; 823 + 824 + static const char * const phase_flag2_groups[] = { 825 + "gpio127", 826 + }; 827 + 828 + static const char * const phase_flag20_groups[] = { 829 + "gpio22", 830 + }; 831 + 832 + static const char * const phase_flag21_groups[] = { 833 + "gpio21", 834 + }; 835 + 836 + static const char * const phase_flag22_groups[] = { 837 + "gpio19", 838 + }; 839 + 840 + static const char * const phase_flag23_groups[] = { 841 + "gpio18", 842 + }; 843 + 844 + static const char * const phase_flag24_groups[] = { 845 + "gpio17", 846 + }; 847 + 848 + static const char * const phase_flag25_groups[] = { 849 + "gpio16", 850 + }; 851 + 852 + static const char * const phase_flag26_groups[] = { 853 + "gpio13", 854 + }; 855 + 856 + static const char * const phase_flag27_groups[] = { 857 + "gpio12", 858 + }; 859 + 860 + static const char * const phase_flag28_groups[] = { 861 + "gpio3", 862 + }; 863 + 864 + static const char * const phase_flag29_groups[] = { 865 + "gpio2", 866 + }; 867 + 868 + static const char * const phase_flag3_groups[] = { 869 + "gpio126", 870 + }; 871 + 872 + static const char * const phase_flag30_groups[] = { 873 + "gpio149", 874 + }; 875 + 876 + static const char * const phase_flag31_groups[] = { 877 + "gpio148", 878 + }; 879 + 880 + static const char * const phase_flag4_groups[] = { 881 + "gpio151", 882 + }; 883 + 884 + static const char * const phase_flag5_groups[] = { 885 + "gpio150", 886 + }; 887 + 888 + static const char * const phase_flag6_groups[] = { 889 + "gpio98", 890 + }; 891 + 892 + static const char * const phase_flag7_groups[] = { 893 + "gpio97", 894 + }; 895 + 896 + static const char * const phase_flag8_groups[] = { 897 + "gpio96", 898 + }; 899 + 900 + static const char * const phase_flag9_groups[] = { 901 + "gpio95", 902 + }; 903 + 904 + static const char * const pll_bist_groups[] = { 905 + "gpio8", 906 + }; 907 + 908 + static const char * const pll_clk_groups[] = { 909 + "gpio54", 910 + }; 911 + 912 + static const char * const prng_rosc0_groups[] = { 913 + "gpio72", 914 + }; 915 + 916 + static const char * const prng_rosc1_groups[] = { 917 + "gpio73", 918 + }; 919 + 920 + static const char * const prng_rosc2_groups[] = { 921 + "gpio74", 922 + }; 923 + 924 + static const char * const prng_rosc3_groups[] = { 925 + "gpio75", 926 + }; 927 + 928 + static const char * const qdss_cti_groups[] = { 929 + "gpio28", "gpio29", "gpio36", "gpio37", "gpio38", "gpio38", "gpio47", 930 + "gpio48", "gpio53", "gpio53", "gpio105", "gpio106", "gpio154", 931 + "gpio155", 932 + }; 933 + 934 + static const char * const qdss_gpio_groups[] = { 935 + "gpio89", "gpio90", "gpio109", "gpio110", 936 + }; 937 + 938 + static const char * const qdss_gpio0_groups[] = { 939 + "gpio24", "gpio65", 940 + }; 941 + 942 + static const char * const qdss_gpio1_groups[] = { 943 + "gpio25", "gpio66", 944 + }; 945 + 946 + static const char * const qdss_gpio10_groups[] = { 947 + "gpio63", "gpio83", 948 + }; 949 + 950 + static const char * const qdss_gpio11_groups[] = { 951 + "gpio64", "gpio84", 952 + }; 953 + 954 + static const char * const qdss_gpio12_groups[] = { 955 + "gpio39", "gpio85", 956 + }; 957 + 958 + static const char * const qdss_gpio13_groups[] = { 959 + "gpio10", "gpio86", 960 + }; 961 + 962 + static const char * const qdss_gpio14_groups[] = { 963 + "gpio45", "gpio87", 964 + }; 965 + 966 + static const char * const qdss_gpio15_groups[] = { 967 + "gpio11", "gpio88", 968 + }; 969 + 970 + static const char * const qdss_gpio2_groups[] = { 971 + "gpio26", "gpio67", 972 + }; 973 + 974 + static const char * const qdss_gpio3_groups[] = { 975 + "gpio27", "gpio68", 976 + }; 977 + 978 + static const char * const qdss_gpio4_groups[] = { 979 + "gpio30", "gpio77", 980 + }; 981 + 982 + static const char * const qdss_gpio5_groups[] = { 983 + "gpio31", "gpio78", 984 + }; 985 + 986 + static const char * const qdss_gpio6_groups[] = { 987 + "gpio4", "gpio79", 988 + }; 989 + 990 + static const char * const qdss_gpio7_groups[] = { 991 + "gpio5", "gpio80", 992 + }; 993 + 994 + static const char * const qdss_gpio8_groups[] = { 995 + "gpio6", "gpio81", 996 + }; 997 + 998 + static const char * const qdss_gpio9_groups[] = { 999 + "gpio7", "gpio82", 1000 + }; 1001 + 1002 + static const char * const qspi0_groups[] = { 1003 + "gpio32", 1004 + }; 1005 + 1006 + static const char * const qspi1_groups[] = { 1007 + "gpio33", 1008 + }; 1009 + 1010 + static const char * const qspi2_groups[] = { 1011 + "gpio36", 1012 + }; 1013 + 1014 + static const char * const qspi3_groups[] = { 1015 + "gpio37", 1016 + }; 1017 + 1018 + static const char * const qspi_clk_groups[] = { 1019 + "gpio34", 1020 + }; 1021 + 1022 + static const char * const qspi_cs0_groups[] = { 1023 + "gpio35", 1024 + }; 1025 + 1026 + static const char * const qspi_cs1_groups[] = { 1027 + "gpio38", 1028 + }; 1029 + 1030 + static const char * const qup0_groups[] = { 1031 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio93", 1032 + }; 1033 + 1034 + static const char * const qup1_groups[] = { 1035 + "gpio2", "gpio3", "gpio61", "gpio62", 1036 + }; 1037 + 1038 + static const char * const qup2_groups[] = { 1039 + "gpio12", "gpio13", "gpio22", "gpio23", 1040 + }; 1041 + 1042 + static const char * const qup3_groups[] = { 1043 + "gpio16", "gpio17", "gpio18", "gpio19", "gpio41", 1044 + }; 1045 + 1046 + static const char * const qup4_groups[] = { 1047 + "gpio20", "gpio21", "gpio22", "gpio23", "gpio94", 1048 + }; 1049 + 1050 + static const char * const qup5_groups[] = { 1051 + "gpio95", "gpio96", "gpio97", "gpio98", 1052 + }; 1053 + 1054 + static const char * const qup6_groups[] = { 1055 + "gpio63", "gpio64", "gpio91", "gpio92", 1056 + }; 1057 + 1058 + static const char * const qup7_groups[] = { 1059 + "gpio24", "gpio25", "gpio26", "gpio27", 1060 + }; 1061 + 1062 + static const char * const qup8_groups[] = { 1063 + "gpio8", "gpio9", "gpio10", "gpio11", 1064 + }; 1065 + 1066 + static const char * const qup9_groups[] = { 1067 + "gpio34", "gpio35", "gpio109", "gpio110", 1068 + }; 1069 + 1070 + static const char * const qup10_groups[] = { 1071 + "gpio4", "gpio5", "gpio6", "gpio7", 1072 + }; 1073 + 1074 + static const char * const qup11_groups[] = { 1075 + "gpio14", "gpio15", "gpio28", "gpio30", 1076 + }; 1077 + 1078 + static const char * const tb_trig_groups[] = { 1079 + "gpio69", 1080 + }; 1081 + 1082 + static const char * const tgu_ch0_groups[] = { 1083 + "gpio20", 1084 + }; 1085 + 1086 + static const char * const tgu_ch1_groups[] = { 1087 + "gpio21", 1088 + }; 1089 + 1090 + static const char * const tgu_ch2_groups[] = { 1091 + "gpio22", 1092 + }; 1093 + 1094 + static const char * const tgu_ch3_groups[] = { 1095 + "gpio23", 1096 + }; 1097 + 1098 + static const char * const tmess_prng0_groups[] = { 1099 + "gpio80", 1100 + }; 1101 + 1102 + static const char * const tmess_prng1_groups[] = { 1103 + "gpio79", 1104 + }; 1105 + 1106 + static const char * const tmess_prng2_groups[] = { 1107 + "gpio83", 1108 + }; 1109 + 1110 + static const char * const tmess_prng3_groups[] = { 1111 + "gpio81", 1112 + }; 1113 + 1114 + static const char * const tsense_pwm1_groups[] = { 1115 + "gpio86", 1116 + }; 1117 + 1118 + static const char * const tsense_pwm2_groups[] = { 1119 + "gpio86", 1120 + }; 1121 + 1122 + static const char * const usb0_phy_groups[] = { 1123 + "gpio100", 1124 + }; 1125 + 1126 + static const char * const vsense_trigger_groups[] = { 1127 + "gpio36", 1128 + }; 1129 + 1130 + static const struct pinfunction sar2130p_functions[] = { 1131 + MSM_PIN_FUNCTION(gpio), 1132 + MSM_PIN_FUNCTION(qup0), 1133 + MSM_PIN_FUNCTION(ibi_i3c), 1134 + MSM_PIN_FUNCTION(jitter_bist), 1135 + MSM_PIN_FUNCTION(qup1), 1136 + MSM_PIN_FUNCTION(phase_flag29), 1137 + MSM_PIN_FUNCTION(phase_flag28), 1138 + MSM_PIN_FUNCTION(qup10), 1139 + MSM_PIN_FUNCTION(ddr_bist), 1140 + MSM_PIN_FUNCTION(qdss_gpio6), 1141 + MSM_PIN_FUNCTION(qdss_gpio7), 1142 + MSM_PIN_FUNCTION(qdss_gpio8), 1143 + MSM_PIN_FUNCTION(qdss_gpio9), 1144 + MSM_PIN_FUNCTION(qup8), 1145 + MSM_PIN_FUNCTION(pll_bist), 1146 + MSM_PIN_FUNCTION(qdss_gpio13), 1147 + MSM_PIN_FUNCTION(qdss_gpio15), 1148 + MSM_PIN_FUNCTION(qup2), 1149 + MSM_PIN_FUNCTION(mdp_vsync), 1150 + MSM_PIN_FUNCTION(phase_flag27), 1151 + MSM_PIN_FUNCTION(phase_flag26), 1152 + MSM_PIN_FUNCTION(qup11), 1153 + MSM_PIN_FUNCTION(qup3), 1154 + MSM_PIN_FUNCTION(phase_flag25), 1155 + MSM_PIN_FUNCTION(phase_flag24), 1156 + MSM_PIN_FUNCTION(phase_flag23), 1157 + MSM_PIN_FUNCTION(phase_flag22), 1158 + MSM_PIN_FUNCTION(qup4), 1159 + MSM_PIN_FUNCTION(aoss_cti), 1160 + MSM_PIN_FUNCTION(tgu_ch0), 1161 + MSM_PIN_FUNCTION(phase_flag21), 1162 + MSM_PIN_FUNCTION(tgu_ch1), 1163 + MSM_PIN_FUNCTION(phase_flag20), 1164 + MSM_PIN_FUNCTION(tgu_ch2), 1165 + MSM_PIN_FUNCTION(phase_flag19), 1166 + MSM_PIN_FUNCTION(tgu_ch3), 1167 + MSM_PIN_FUNCTION(qup7), 1168 + MSM_PIN_FUNCTION(qdss_gpio0), 1169 + MSM_PIN_FUNCTION(qdss_gpio1), 1170 + MSM_PIN_FUNCTION(qdss_gpio2), 1171 + MSM_PIN_FUNCTION(atest_usb0), 1172 + MSM_PIN_FUNCTION(qdss_gpio3), 1173 + MSM_PIN_FUNCTION(atest_usb02), 1174 + MSM_PIN_FUNCTION(qdss_cti), 1175 + MSM_PIN_FUNCTION(qdss_gpio4), 1176 + MSM_PIN_FUNCTION(qdss_gpio5), 1177 + MSM_PIN_FUNCTION(qspi0), 1178 + MSM_PIN_FUNCTION(qspi1), 1179 + MSM_PIN_FUNCTION(qspi_clk), 1180 + MSM_PIN_FUNCTION(qup9), 1181 + MSM_PIN_FUNCTION(qspi_cs0), 1182 + MSM_PIN_FUNCTION(dp0_hot), 1183 + MSM_PIN_FUNCTION(qspi2), 1184 + MSM_PIN_FUNCTION(vsense_trigger), 1185 + MSM_PIN_FUNCTION(qspi3), 1186 + MSM_PIN_FUNCTION(qspi_cs1), 1187 + MSM_PIN_FUNCTION(qdss_gpio12), 1188 + MSM_PIN_FUNCTION(phase_flag18), 1189 + MSM_PIN_FUNCTION(ddr_pxi1), 1190 + MSM_PIN_FUNCTION(qdss_gpio14), 1191 + MSM_PIN_FUNCTION(atest_char), 1192 + MSM_PIN_FUNCTION(ddr_pxi3), 1193 + MSM_PIN_FUNCTION(ddr_pxi2), 1194 + MSM_PIN_FUNCTION(mdp_vsync0), 1195 + MSM_PIN_FUNCTION(mdp_vsync1), 1196 + MSM_PIN_FUNCTION(mdp_vsync2), 1197 + MSM_PIN_FUNCTION(mdp_vsync3), 1198 + MSM_PIN_FUNCTION(pll_clk), 1199 + MSM_PIN_FUNCTION(pcie0_clkreqn), 1200 + MSM_PIN_FUNCTION(ddr_pxi0), 1201 + MSM_PIN_FUNCTION(pcie1_clkreqn), 1202 + MSM_PIN_FUNCTION(dbg_out), 1203 + MSM_PIN_FUNCTION(cri_trng), 1204 + MSM_PIN_FUNCTION(atest_usb03), 1205 + MSM_PIN_FUNCTION(phase_flag17), 1206 + MSM_PIN_FUNCTION(phase_flag16), 1207 + MSM_PIN_FUNCTION(qup6), 1208 + MSM_PIN_FUNCTION(qdss_gpio10), 1209 + MSM_PIN_FUNCTION(qdss_gpio11), 1210 + MSM_PIN_FUNCTION(cci_i2c), 1211 + MSM_PIN_FUNCTION(cam_mclk), 1212 + MSM_PIN_FUNCTION(tb_trig), 1213 + MSM_PIN_FUNCTION(cri_trng0), 1214 + MSM_PIN_FUNCTION(cri_trng1), 1215 + MSM_PIN_FUNCTION(prng_rosc0), 1216 + MSM_PIN_FUNCTION(prng_rosc1), 1217 + MSM_PIN_FUNCTION(prng_rosc2), 1218 + MSM_PIN_FUNCTION(prng_rosc3), 1219 + MSM_PIN_FUNCTION(cci_timer0), 1220 + MSM_PIN_FUNCTION(cci_timer1), 1221 + MSM_PIN_FUNCTION(cci_timer2), 1222 + MSM_PIN_FUNCTION(tmess_prng1), 1223 + MSM_PIN_FUNCTION(cci_timer3), 1224 + MSM_PIN_FUNCTION(cci_async), 1225 + MSM_PIN_FUNCTION(tmess_prng0), 1226 + MSM_PIN_FUNCTION(cci_timer4), 1227 + MSM_PIN_FUNCTION(tmess_prng3), 1228 + MSM_PIN_FUNCTION(tmess_prng2), 1229 + MSM_PIN_FUNCTION(tsense_pwm1), 1230 + MSM_PIN_FUNCTION(tsense_pwm2), 1231 + MSM_PIN_FUNCTION(atest_char3), 1232 + MSM_PIN_FUNCTION(atest_char2), 1233 + MSM_PIN_FUNCTION(qdss_gpio), 1234 + MSM_PIN_FUNCTION(atest_char1), 1235 + MSM_PIN_FUNCTION(atest_char0), 1236 + MSM_PIN_FUNCTION(phase_flag11), 1237 + MSM_PIN_FUNCTION(phase_flag10), 1238 + MSM_PIN_FUNCTION(qup5), 1239 + MSM_PIN_FUNCTION(phase_flag9), 1240 + MSM_PIN_FUNCTION(phase_flag8), 1241 + MSM_PIN_FUNCTION(phase_flag7), 1242 + MSM_PIN_FUNCTION(phase_flag6), 1243 + MSM_PIN_FUNCTION(usb0_phy), 1244 + MSM_PIN_FUNCTION(ext_mclk1), 1245 + MSM_PIN_FUNCTION(audio_ref), 1246 + MSM_PIN_FUNCTION(ext_mclk0), 1247 + MSM_PIN_FUNCTION(i2s0_sck), 1248 + MSM_PIN_FUNCTION(i2s0_data0), 1249 + MSM_PIN_FUNCTION(i2s0_data1), 1250 + MSM_PIN_FUNCTION(i2s0_ws), 1251 + MSM_PIN_FUNCTION(atest_usb01), 1252 + MSM_PIN_FUNCTION(atest_usb00), 1253 + MSM_PIN_FUNCTION(host2wlan_sol), 1254 + MSM_PIN_FUNCTION(phase_flag3), 1255 + MSM_PIN_FUNCTION(phase_flag2), 1256 + MSM_PIN_FUNCTION(phase_flag1), 1257 + MSM_PIN_FUNCTION(gcc_gp1), 1258 + MSM_PIN_FUNCTION(gcc_gp2), 1259 + MSM_PIN_FUNCTION(gcc_gp3), 1260 + MSM_PIN_FUNCTION(phase_flag0), 1261 + MSM_PIN_FUNCTION(phase_flag12), 1262 + MSM_PIN_FUNCTION(phase_flag15), 1263 + MSM_PIN_FUNCTION(phase_flag14), 1264 + MSM_PIN_FUNCTION(phase_flag13), 1265 + MSM_PIN_FUNCTION(phase_flag31), 1266 + MSM_PIN_FUNCTION(phase_flag30), 1267 + MSM_PIN_FUNCTION(phase_flag5), 1268 + MSM_PIN_FUNCTION(phase_flag4), 1269 + }; 1270 + 1271 + /* Every pin is maintained as a single group, and missing or non-existing pin 1272 + * would be maintained as dummy group to synchronize pin group index with 1273 + * pin descriptor registered with pinctrl core. 1274 + * Clients would not be able to request these dummy pin groups. 1275 + */ 1276 + static const struct msm_pingroup sar2130p_groups[] = { 1277 + [0] = PINGROUP(0, qup0, ibi_i3c, jitter_bist, _, _, _, _, _, _), 1278 + [1] = PINGROUP(1, qup0, ibi_i3c, _, _, _, _, _, _, _), 1279 + [2] = PINGROUP(2, qup0, qup1, phase_flag29, _, _, _, _, _, _), 1280 + [3] = PINGROUP(3, qup0, qup1, phase_flag28, _, _, _, _, _, _), 1281 + [4] = PINGROUP(4, qup10, ddr_bist, qdss_gpio6, _, _, _, _, _, _), 1282 + [5] = PINGROUP(5, qup10, ddr_bist, qdss_gpio7, _, _, _, _, _, _), 1283 + [6] = PINGROUP(6, qup10, qdss_gpio8, _, _, _, _, _, _, _), 1284 + [7] = PINGROUP(7, qup10, qdss_gpio9, _, _, _, _, _, _, _), 1285 + [8] = PINGROUP(8, qup8, pll_bist, _, _, _, _, _, _, _), 1286 + [9] = PINGROUP(9, qup8, _, _, _, _, _, _, _, _), 1287 + [10] = PINGROUP(10, qup8, qdss_gpio13, _, _, _, _, _, _, _), 1288 + [11] = PINGROUP(11, qup8, qdss_gpio15, _, _, _, _, _, _, _), 1289 + [12] = PINGROUP(12, qup2, mdp_vsync, phase_flag27, _, _, _, _, _, _), 1290 + [13] = PINGROUP(13, qup2, mdp_vsync, phase_flag26, _, _, _, _, _, _), 1291 + [14] = PINGROUP(14, qup11, _, _, _, _, _, _, _, _), 1292 + [15] = PINGROUP(15, qup11, _, _, _, _, _, _, _, _), 1293 + [16] = PINGROUP(16, qup3, phase_flag25, _, _, _, _, _, _, _), 1294 + [17] = PINGROUP(17, qup3, phase_flag24, _, _, _, _, _, _, _), 1295 + [18] = PINGROUP(18, qup3, phase_flag23, _, _, _, _, _, _, _), 1296 + [19] = PINGROUP(19, qup3, phase_flag22, _, _, _, _, _, _, _), 1297 + [20] = PINGROUP(20, qup4, aoss_cti, tgu_ch0, _, _, _, _, _, _), 1298 + [21] = PINGROUP(21, qup4, aoss_cti, phase_flag21, tgu_ch1, _, _, _, _, _), 1299 + [22] = PINGROUP(22, qup4, qup2, aoss_cti, phase_flag20, tgu_ch2, _, _, _, _), 1300 + [23] = PINGROUP(23, qup4, qup2, aoss_cti, phase_flag19, tgu_ch3, _, _, _, _), 1301 + [24] = PINGROUP(24, qup7, qdss_gpio0, _, _, _, _, _, _, _), 1302 + [25] = PINGROUP(25, qup7, qdss_gpio1, _, _, _, _, _, _, _), 1303 + [26] = PINGROUP(26, qup7, qdss_gpio2, atest_usb0, _, _, _, _, _, _), 1304 + [27] = PINGROUP(27, qup7, qdss_gpio3, atest_usb02, _, _, _, _, _, _), 1305 + [28] = PINGROUP(28, qup11, qdss_cti, _, _, _, _, _, _, _), 1306 + [29] = PINGROUP(29, qdss_cti, _, _, _, _, _, _, _, _), 1307 + [30] = PINGROUP(30, qup11, qdss_gpio4, _, _, _, _, _, _, _), 1308 + [31] = PINGROUP(31, qdss_gpio5, _, _, _, _, _, _, _, _), 1309 + [32] = PINGROUP(32, qspi0, _, _, _, _, _, _, _, _), 1310 + [33] = PINGROUP(33, qspi1, _, _, _, _, _, _, _, _), 1311 + [34] = PINGROUP(34, qspi_clk, qup9, _, _, _, _, _, _, _), 1312 + [35] = PINGROUP(35, qspi_cs0, qup9, dp0_hot, _, _, _, _, _, _), 1313 + [36] = PINGROUP(36, qspi2, qdss_cti, vsense_trigger, _, _, _, _, _, _), 1314 + [37] = PINGROUP(37, qspi3, qdss_cti, _, _, _, _, _, _, _), 1315 + [38] = PINGROUP(38, qspi_cs1, qdss_cti, qdss_cti, _, _, _, _, _, _), 1316 + [39] = PINGROUP(39, qdss_gpio12, _, _, _, _, _, _, _, _), 1317 + [40] = PINGROUP(40, _, _, _, _, _, _, _, _, _), 1318 + [41] = PINGROUP(41, qup3, mdp_vsync, phase_flag18, _, ddr_pxi1, _, _, _, _), 1319 + [42] = PINGROUP(42, _, _, _, _, _, _, _, _, _), 1320 + [43] = PINGROUP(43, _, _, _, _, _, _, _, _, _), 1321 + [44] = PINGROUP(44, _, _, _, _, _, _, _, _, _), 1322 + [45] = PINGROUP(45, qdss_gpio14, ddr_pxi1, atest_char, _, _, _, _, _, _), 1323 + [46] = PINGROUP(46, ddr_pxi3, _, _, _, _, _, _, _, _), 1324 + [47] = PINGROUP(47, qdss_cti, ddr_pxi3, _, _, _, _, _, _, _), 1325 + [48] = PINGROUP(48, qdss_cti, ddr_pxi2, _, _, _, _, _, _, _), 1326 + [49] = PINGROUP(49, mdp_vsync, mdp_vsync0, mdp_vsync1, _, _, _, _, _, _), 1327 + [50] = PINGROUP(50, mdp_vsync, mdp_vsync2, mdp_vsync3, _, _, _, _, _, _), 1328 + [51] = PINGROUP(51, _, _, _, _, _, _, _, _, _), 1329 + [52] = PINGROUP(52, _, _, _, _, _, _, _, _, _), 1330 + [53] = PINGROUP(53, qdss_cti, qdss_cti, _, _, _, _, _, _, _), 1331 + [54] = PINGROUP(54, pll_clk, _, _, _, _, _, _, _, _), 1332 + [55] = PINGROUP(55, _, ddr_pxi2, _, _, _, _, _, _, _), 1333 + [56] = PINGROUP(56, pcie0_clkreqn, _, ddr_pxi0, _, _, _, _, _, _), 1334 + [57] = PINGROUP(57, ddr_pxi0, _, _, _, _, _, _, _, _), 1335 + [58] = PINGROUP(58, _, _, _, _, _, _, _, _, _), 1336 + [59] = PINGROUP(59, pcie1_clkreqn, dbg_out, _, _, _, _, _, _, _), 1337 + [60] = PINGROUP(60, cri_trng, atest_usb03, _, _, _, _, _, _, _), 1338 + [61] = PINGROUP(61, qup1, phase_flag17, _, _, _, _, _, _, _), 1339 + [62] = PINGROUP(62, qup1, phase_flag16, _, _, _, _, _, _, _), 1340 + [63] = PINGROUP(63, qup6, qdss_gpio10, _, _, _, _, _, _, _), 1341 + [64] = PINGROUP(64, qup6, qdss_gpio11, _, _, _, _, _, _, _), 1342 + [65] = PINGROUP(65, qdss_gpio0, _, _, _, _, _, _, _, _), 1343 + [66] = PINGROUP(66, qdss_gpio1, _, _, _, _, _, _, _, _), 1344 + [67] = PINGROUP(67, cci_i2c, qdss_gpio2, _, _, _, _, _, _, _), 1345 + [68] = PINGROUP(68, cci_i2c, qdss_gpio3, _, _, _, _, _, _, _), 1346 + [69] = PINGROUP(69, cam_mclk, tb_trig, _, _, _, _, _, _, _), 1347 + [70] = PINGROUP(70, cam_mclk, cri_trng0, _, _, _, _, _, _, _), 1348 + [71] = PINGROUP(71, cam_mclk, cri_trng1, _, _, _, _, _, _, _), 1349 + [72] = PINGROUP(72, cam_mclk, prng_rosc0, _, _, _, _, _, _, _), 1350 + [73] = PINGROUP(73, cam_mclk, prng_rosc1, _, _, _, _, _, _, _), 1351 + [74] = PINGROUP(74, cam_mclk, prng_rosc2, _, _, _, _, _, _, _), 1352 + [75] = PINGROUP(75, cam_mclk, prng_rosc3, _, _, _, _, _, _, _), 1353 + [76] = PINGROUP(76, cam_mclk, _, _, _, _, _, _, _, _), 1354 + [77] = PINGROUP(77, cci_timer0, qdss_gpio4, _, _, _, _, _, _, _), 1355 + [78] = PINGROUP(78, cci_timer1, cci_i2c, qdss_gpio5, _, _, _, _, _, _), 1356 + [79] = PINGROUP(79, cci_timer2, cci_i2c, tmess_prng1, qdss_gpio6, _, _, _, _, _), 1357 + [80] = PINGROUP(80, cci_timer3, cci_i2c, cci_async, tmess_prng0, qdss_gpio7, _, _, _, _), 1358 + [81] = PINGROUP(81, cci_timer4, cci_i2c, cci_async, tmess_prng3, qdss_gpio8, _, _, _, _), 1359 + [82] = PINGROUP(82, cci_async, qdss_gpio9, _, _, _, _, _, _, _), 1360 + [83] = PINGROUP(83, cci_i2c, tmess_prng2, qdss_gpio10, _, _, _, _, _, _), 1361 + [84] = PINGROUP(84, cci_i2c, qdss_gpio11, _, _, _, _, _, _, _), 1362 + [85] = PINGROUP(85, cci_i2c, qdss_gpio12, _, _, _, _, _, _, _), 1363 + [86] = PINGROUP(86, cci_i2c, qdss_gpio13, tsense_pwm1, tsense_pwm2, _, _, _, _, _), 1364 + [87] = PINGROUP(87, cci_i2c, qdss_gpio14, atest_char3, _, _, _, _, _, _), 1365 + [88] = PINGROUP(88, cci_i2c, qdss_gpio15, atest_char2, _, _, _, _, _, _), 1366 + [89] = PINGROUP(89, cci_i2c, qdss_gpio, atest_char1, _, _, _, _, _, _), 1367 + [90] = PINGROUP(90, cci_i2c, qdss_gpio, atest_char0, _, _, _, _, _, _), 1368 + [91] = PINGROUP(91, cci_i2c, qup6, ibi_i3c, _, _, _, _, _, _), 1369 + [92] = PINGROUP(92, cci_i2c, qup6, ibi_i3c, _, _, _, _, _, _), 1370 + [93] = PINGROUP(93, qup0, phase_flag11, _, _, _, _, _, _, _), 1371 + [94] = PINGROUP(94, qup4, phase_flag10, _, _, _, _, _, _, _), 1372 + [95] = PINGROUP(95, qup5, phase_flag9, _, _, _, _, _, _, _), 1373 + [96] = PINGROUP(96, qup5, phase_flag8, _, _, _, _, _, _, _), 1374 + [97] = PINGROUP(97, qup5, phase_flag7, _, _, _, _, _, _, _), 1375 + [98] = PINGROUP(98, qup5, phase_flag6, _, _, _, _, _, _, _), 1376 + [99] = PINGROUP(99, _, _, _, _, _, _, _, _, _), 1377 + [100] = PINGROUP(100, usb0_phy, ddr_bist, _, _, _, _, _, _, _), 1378 + [101] = PINGROUP(101, _, _, _, _, _, _, _, _, _), 1379 + [102] = PINGROUP(102, _, _, _, _, _, _, _, _, _), 1380 + [103] = PINGROUP(103, ext_mclk1, audio_ref, dp0_hot, ddr_bist, _, _, _, _, _), 1381 + [104] = PINGROUP(104, ext_mclk0, _, _, _, _, _, _, _, _), 1382 + [105] = PINGROUP(105, i2s0_sck, _, qdss_cti, _, _, _, _, _, _), 1383 + [106] = PINGROUP(106, i2s0_data0, _, qdss_cti, _, _, _, _, _, _), 1384 + [107] = PINGROUP(107, i2s0_data1, _, _, _, _, _, _, _, _), 1385 + [108] = PINGROUP(108, i2s0_ws, _, _, _, _, _, _, _, _), 1386 + [109] = PINGROUP(109, qup9, qdss_gpio, atest_usb01, _, _, _, _, _, _), 1387 + [110] = PINGROUP(110, qup9, qdss_gpio, atest_usb00, _, _, _, _, _, _), 1388 + [111] = PINGROUP(111, host2wlan_sol, _, _, _, _, _, _, _, _), 1389 + [112] = PINGROUP(112, _, _, _, _, _, _, _, _, _), 1390 + [113] = PINGROUP(113, _, _, _, _, _, _, _, _, _), 1391 + [114] = PINGROUP(114, _, _, _, _, _, _, _, _, _), 1392 + [115] = PINGROUP(115, _, _, _, _, _, _, _, _, _), 1393 + [116] = PINGROUP(116, _, _, _, _, _, _, _, _, _), 1394 + [117] = PINGROUP(117, _, _, _, _, _, _, _, _, _), 1395 + [118] = PINGROUP(118, _, _, _, _, _, _, _, _, _), 1396 + [119] = PINGROUP(119, _, _, _, _, _, _, _, _, _), 1397 + [120] = PINGROUP(120, _, _, _, _, _, _, _, _, _), 1398 + [121] = PINGROUP(121, _, _, _, _, _, _, _, _, _), 1399 + [122] = PINGROUP(122, _, _, _, _, _, _, _, _, _), 1400 + [123] = PINGROUP(123, _, _, _, _, _, _, _, _, _), 1401 + [124] = PINGROUP(124, _, _, _, _, _, _, _, _, _), 1402 + [125] = PINGROUP(125, _, _, _, _, _, _, _, _, _), 1403 + [126] = PINGROUP(126, phase_flag3, _, _, _, _, _, _, _, _), 1404 + [127] = PINGROUP(127, phase_flag2, _, _, _, _, _, _, _, _), 1405 + [128] = PINGROUP(128, phase_flag1, _, _, _, _, _, _, _, _), 1406 + [129] = PINGROUP(129, gcc_gp1, _, _, _, _, _, _, _, _), 1407 + [130] = PINGROUP(130, gcc_gp2, _, _, _, _, _, _, _, _), 1408 + [131] = PINGROUP(131, gcc_gp3, _, _, _, _, _, _, _, _), 1409 + [132] = PINGROUP(132, gcc_gp1, _, _, _, _, _, _, _, _), 1410 + [133] = PINGROUP(133, phase_flag0, _, _, _, _, _, _, _, _), 1411 + [134] = PINGROUP(134, phase_flag12, _, _, _, _, _, _, _, _), 1412 + [135] = PINGROUP(135, gcc_gp2, _, _, _, _, _, _, _, _), 1413 + [136] = PINGROUP(136, gcc_gp3, _, _, _, _, _, _, _, _), 1414 + [137] = PINGROUP(137, phase_flag15, _, _, _, _, _, _, _, _), 1415 + [138] = PINGROUP(138, phase_flag14, _, _, _, _, _, _, _, _), 1416 + [139] = PINGROUP(139, phase_flag13, _, _, _, _, _, _, _, _), 1417 + [140] = PINGROUP(140, _, _, _, _, _, _, _, _, _), 1418 + [141] = PINGROUP(141, _, _, _, _, _, _, _, _, _), 1419 + [142] = PINGROUP(142, _, _, _, _, _, _, _, _, _), 1420 + [143] = PINGROUP(143, _, _, _, _, _, _, _, _, _), 1421 + [144] = PINGROUP(144, _, _, _, _, _, _, _, _, _), 1422 + [145] = PINGROUP(145, _, _, _, _, _, _, _, _, _), 1423 + [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _), 1424 + [147] = PINGROUP(147, _, _, _, _, _, _, _, _, _), 1425 + [148] = PINGROUP(148, phase_flag31, _, _, _, _, _, _, _, _), 1426 + [149] = PINGROUP(149, phase_flag30, _, _, _, _, _, _, _, _), 1427 + [150] = PINGROUP(150, phase_flag5, _, _, _, _, _, _, _, _), 1428 + [151] = PINGROUP(151, phase_flag4, _, _, _, _, _, _, _, _), 1429 + [152] = PINGROUP(152, _, _, _, _, _, _, _, _, _), 1430 + [153] = PINGROUP(153, _, _, _, _, _, _, _, _, _), 1431 + [154] = PINGROUP(154, qdss_cti, _, _, _, _, _, _, _, _), 1432 + [155] = PINGROUP(155, qdss_cti, _, _, _, _, _, _, _, _), 1433 + [156] = SDC_QDSD_PINGROUP(sdc1_rclk, 0xa1000, 0, 0), 1434 + [157] = SDC_QDSD_PINGROUP(sdc1_clk, 0xa0000, 13, 6), 1435 + [158] = SDC_QDSD_PINGROUP(sdc1_cmd, 0xa0000, 11, 3), 1436 + [159] = SDC_QDSD_PINGROUP(sdc1_data, 0xa0000, 9, 0), 1437 + }; 1438 + 1439 + static const struct msm_gpio_wakeirq_map sar2130p_pdc_map[] = { 1440 + { 0, 50 }, { 3, 68 }, { 6, 88 }, { 7, 55 }, { 10, 66 }, { 11, 96 }, 1441 + { 12, 48 }, { 13, 49 }, { 15, 62 }, { 18, 57 }, { 19, 59 }, { 23, 51 }, 1442 + { 27, 74 }, { 28, 67 }, { 29, 84 }, { 30, 58 }, { 31, 94 }, { 32, 60 }, 1443 + { 33, 61 }, { 35, 69 }, { 37, 70 }, { 38, 64 }, { 39, 65 }, { 40, 63 }, 1444 + { 41, 92 }, { 42, 82 }, { 44, 83 }, { 45, 43 }, { 46, 72 }, { 47, 45 }, 1445 + { 48, 44 }, { 49, 71 }, { 50, 87 }, { 53, 77 }, { 54, 78 }, 1446 + { 55, 106 }, { 56, 79 }, { 57, 80 }, { 58, 107 }, { 59, 81 }, 1447 + { 60, 89 }, { 61, 54 }, { 62, 73 }, { 63, 93 }, { 64, 86 }, { 65, 75 }, 1448 + { 67, 42 }, { 68, 76 }, { 76, 116 }, { 77, 12 }, { 83, 13 }, 1449 + { 91, 90 }, { 94, 95 }, { 95, 91 }, { 98, 47 }, { 100, 85 }, 1450 + { 101, 52 }, { 102, 53 }, { 103, 97 }, { 104, 98 }, { 105, 99 }, 1451 + { 106, 100 }, { 107, 101 }, { 108, 102 }, { 109, 103 }, { 111, 104 }, 1452 + { 113, 46 }, { 114, 56 }, { 115, 108 }, { 116, 109 }, { 117, 110 }, 1453 + { 118, 111 }, { 121, 112 }, { 122, 113 }, { 124, 114 }, { 127, 115 }, 1454 + { 132, 118 }, { 134, 119 }, { 135, 120 }, { 136, 121 }, { 139, 122 }, 1455 + { 140, 123 }, { 141, 124 }, { 143, 128 }, { 144, 129 }, { 145, 130 }, 1456 + { 146, 131 }, { 148, 132 }, { 150, 133 }, { 151, 134 }, { 153, 135 }, 1457 + { 155, 137 }, 1458 + }; 1459 + 1460 + static const struct msm_pinctrl_soc_data sar2130p_tlmm = { 1461 + .pins = sar2130p_pins, 1462 + .npins = ARRAY_SIZE(sar2130p_pins), 1463 + .functions = sar2130p_functions, 1464 + .nfunctions = ARRAY_SIZE(sar2130p_functions), 1465 + .groups = sar2130p_groups, 1466 + .ngroups = ARRAY_SIZE(sar2130p_groups), 1467 + .ngpios = 156, 1468 + .wakeirq_map = sar2130p_pdc_map, 1469 + .nwakeirq_map = ARRAY_SIZE(sar2130p_pdc_map), 1470 + }; 1471 + 1472 + static int sar2130p_tlmm_probe(struct platform_device *pdev) 1473 + { 1474 + return msm_pinctrl_probe(pdev, &sar2130p_tlmm); 1475 + } 1476 + 1477 + static const struct of_device_id sar2130p_tlmm_of_match[] = { 1478 + { .compatible = "qcom,sar2130p-tlmm", .data = &sar2130p_tlmm}, 1479 + { }, 1480 + }; 1481 + MODULE_DEVICE_TABLE(of, sar2130p_tlmm_of_match); 1482 + 1483 + static struct platform_driver sar2130p_tlmm_driver = { 1484 + .driver = { 1485 + .name = "sar2130p-tlmm", 1486 + .of_match_table = sar2130p_tlmm_of_match, 1487 + }, 1488 + .probe = sar2130p_tlmm_probe, 1489 + .remove = msm_pinctrl_remove, 1490 + }; 1491 + 1492 + static int __init sar2130p_tlmm_init(void) 1493 + { 1494 + return platform_driver_register(&sar2130p_tlmm_driver); 1495 + } 1496 + arch_initcall(sar2130p_tlmm_init); 1497 + 1498 + static void __exit sar2130p_tlmm_exit(void) 1499 + { 1500 + platform_driver_unregister(&sar2130p_tlmm_driver); 1501 + } 1502 + module_exit(sar2130p_tlmm_exit); 1503 + 1504 + MODULE_DESCRIPTION("QTI SAR2130P TLMM driver"); 1505 + MODULE_LICENSE("GPL");
+1 -1
drivers/pinctrl/qcom/pinctrl-sc7180.c
··· 1159 1159 .of_match_table = sc7180_pinctrl_of_match, 1160 1160 }, 1161 1161 .probe = sc7180_pinctrl_probe, 1162 - .remove_new = msm_pinctrl_remove, 1162 + .remove = msm_pinctrl_remove, 1163 1163 }; 1164 1164 1165 1165 static int __init sc7180_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
··· 142 142 .of_match_table = lpi_pinctrl_of_match, 143 143 }, 144 144 .probe = lpi_pinctrl_probe, 145 - .remove_new = lpi_pinctrl_remove, 145 + .remove = lpi_pinctrl_remove, 146 146 }; 147 147 148 148 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sc7280.c
··· 1505 1505 .of_match_table = sc7280_pinctrl_of_match, 1506 1506 }, 1507 1507 .probe = sc7280_pinctrl_probe, 1508 - .remove_new = msm_pinctrl_remove, 1508 + .remove = msm_pinctrl_remove, 1509 1509 }; 1510 1510 1511 1511 static int __init sc7280_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sc8180x.c
··· 1720 1720 .acpi_match_table = sc8180x_pinctrl_acpi_match, 1721 1721 }, 1722 1722 .probe = sc8180x_pinctrl_probe, 1723 - .remove_new = msm_pinctrl_remove, 1723 + .remove = msm_pinctrl_remove, 1724 1724 }; 1725 1725 1726 1726 static int __init sc8180x_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c
··· 179 179 .of_match_table = lpi_pinctrl_of_match, 180 180 }, 181 181 .probe = lpi_pinctrl_probe, 182 - .remove_new = lpi_pinctrl_remove, 182 + .remove = lpi_pinctrl_remove, 183 183 }; 184 184 185 185 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sc8280xp.c
··· 1926 1926 .of_match_table = sc8280xp_pinctrl_of_match, 1927 1927 }, 1928 1928 .probe = sc8280xp_pinctrl_probe, 1929 - .remove_new = msm_pinctrl_remove, 1929 + .remove = msm_pinctrl_remove, 1930 1930 }; 1931 1931 1932 1932 static int __init sc8280xp_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sdm660.c
··· 1442 1442 .of_match_table = sdm660_pinctrl_of_match, 1443 1443 }, 1444 1444 .probe = sdm660_pinctrl_probe, 1445 - .remove_new = msm_pinctrl_remove, 1445 + .remove = msm_pinctrl_remove, 1446 1446 }; 1447 1447 1448 1448 static int __init sdm660_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sdm670.c
··· 1337 1337 .of_match_table = sdm670_pinctrl_of_match, 1338 1338 }, 1339 1339 .probe = sdm670_pinctrl_probe, 1340 - .remove_new = msm_pinctrl_remove, 1340 + .remove = msm_pinctrl_remove, 1341 1341 }; 1342 1342 1343 1343 static int __init sdm670_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sdm845.c
··· 1351 1351 .acpi_match_table = ACPI_PTR(sdm845_pinctrl_acpi_match), 1352 1352 }, 1353 1353 .probe = sdm845_pinctrl_probe, 1354 - .remove_new = msm_pinctrl_remove, 1354 + .remove = msm_pinctrl_remove, 1355 1355 }; 1356 1356 1357 1357 static int __init sdm845_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sdx55.c
··· 990 990 .of_match_table = sdx55_pinctrl_of_match, 991 991 }, 992 992 .probe = sdx55_pinctrl_probe, 993 - .remove_new = msm_pinctrl_remove, 993 + .remove = msm_pinctrl_remove, 994 994 }; 995 995 996 996 static int __init sdx55_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sdx65.c
··· 939 939 .of_match_table = sdx65_pinctrl_of_match, 940 940 }, 941 941 .probe = sdx65_pinctrl_probe, 942 - .remove_new = msm_pinctrl_remove, 942 + .remove = msm_pinctrl_remove, 943 943 }; 944 944 945 945 static int __init sdx65_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sdx75.c
··· 1124 1124 .of_match_table = sdx75_pinctrl_of_match, 1125 1125 }, 1126 1126 .probe = sdx75_pinctrl_probe, 1127 - .remove_new = msm_pinctrl_remove, 1127 + .remove = msm_pinctrl_remove, 1128 1128 }; 1129 1129 1130 1130 static int __init sdx75_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm4250-lpass-lpi.c
··· 227 227 .of_match_table = lpi_pinctrl_of_match, 228 228 }, 229 229 .probe = lpi_pinctrl_probe, 230 - .remove_new = lpi_pinctrl_remove, 230 + .remove = lpi_pinctrl_remove, 231 231 }; 232 232 233 233 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sm4450.c
··· 994 994 .of_match_table = sm4450_tlmm_of_match, 995 995 }, 996 996 .probe = sm4450_tlmm_probe, 997 - .remove_new = msm_pinctrl_remove, 997 + .remove = msm_pinctrl_remove, 998 998 }; 999 999 MODULE_DEVICE_TABLE(of, sm4450_tlmm_of_match); 1000 1000
+1 -1
drivers/pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c
··· 147 147 .of_match_table = lpi_pinctrl_of_match, 148 148 }, 149 149 .probe = lpi_pinctrl_probe, 150 - .remove_new = lpi_pinctrl_remove, 150 + .remove = lpi_pinctrl_remove, 151 151 }; 152 152 153 153 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sm6115.c
··· 907 907 .of_match_table = sm6115_tlmm_of_match, 908 908 }, 909 909 .probe = sm6115_tlmm_probe, 910 - .remove_new = msm_pinctrl_remove, 910 + .remove = msm_pinctrl_remove, 911 911 }; 912 912 913 913 static int __init sm6115_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm6125.c
··· 1266 1266 .of_match_table = sm6125_tlmm_of_match, 1267 1267 }, 1268 1268 .probe = sm6125_tlmm_probe, 1269 - .remove_new = msm_pinctrl_remove, 1269 + .remove = msm_pinctrl_remove, 1270 1270 }; 1271 1271 1272 1272 static int __init sm6125_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm6350.c
··· 1373 1373 .of_match_table = sm6350_tlmm_of_match, 1374 1374 }, 1375 1375 .probe = sm6350_tlmm_probe, 1376 - .remove_new = msm_pinctrl_remove, 1376 + .remove = msm_pinctrl_remove, 1377 1377 }; 1378 1378 1379 1379 static int __init sm6350_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm6375.c
··· 1516 1516 .of_match_table = sm6375_tlmm_of_match, 1517 1517 }, 1518 1518 .probe = sm6375_tlmm_probe, 1519 - .remove_new = msm_pinctrl_remove, 1519 + .remove = msm_pinctrl_remove, 1520 1520 }; 1521 1521 1522 1522 static int __init sm6375_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm7150.c
··· 1255 1255 .of_match_table = sm7150_tlmm_of_match, 1256 1256 }, 1257 1257 .probe = sm7150_tlmm_probe, 1258 - .remove_new = msm_pinctrl_remove, 1258 + .remove = msm_pinctrl_remove, 1259 1259 }; 1260 1260 1261 1261 static int __init sm7150_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8150.c
··· 1542 1542 .of_match_table = sm8150_pinctrl_of_match, 1543 1543 }, 1544 1544 .probe = sm8150_pinctrl_probe, 1545 - .remove_new = msm_pinctrl_remove, 1545 + .remove = msm_pinctrl_remove, 1546 1546 }; 1547 1547 1548 1548 static int __init sm8150_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c
··· 140 140 .of_match_table = lpi_pinctrl_of_match, 141 141 }, 142 142 .probe = lpi_pinctrl_probe, 143 - .remove_new = lpi_pinctrl_remove, 143 + .remove = lpi_pinctrl_remove, 144 144 }; 145 145 146 146 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8250.c
··· 1351 1351 .of_match_table = sm8250_pinctrl_of_match, 1352 1352 }, 1353 1353 .probe = sm8250_pinctrl_probe, 1354 - .remove_new = msm_pinctrl_remove, 1354 + .remove = msm_pinctrl_remove, 1355 1355 }; 1356 1356 1357 1357 static int __init sm8250_pinctrl_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c
··· 142 142 .of_match_table = lpi_pinctrl_of_match, 143 143 }, 144 144 .probe = lpi_pinctrl_probe, 145 - .remove_new = lpi_pinctrl_remove, 145 + .remove = lpi_pinctrl_remove, 146 146 }; 147 147 module_platform_driver(lpi_pinctrl_driver); 148 148
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8350.c
··· 1642 1642 .of_match_table = sm8350_tlmm_of_match, 1643 1643 }, 1644 1644 .probe = sm8350_tlmm_probe, 1645 - .remove_new = msm_pinctrl_remove, 1645 + .remove = msm_pinctrl_remove, 1646 1646 }; 1647 1647 1648 1648 static int __init sm8350_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c
··· 208 208 .of_match_table = lpi_pinctrl_of_match, 209 209 }, 210 210 .probe = lpi_pinctrl_probe, 211 - .remove_new = lpi_pinctrl_remove, 211 + .remove = lpi_pinctrl_remove, 212 212 }; 213 213 214 214 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8450.c
··· 1677 1677 .of_match_table = sm8450_tlmm_of_match, 1678 1678 }, 1679 1679 .probe = sm8450_tlmm_probe, 1680 - .remove_new = msm_pinctrl_remove, 1680 + .remove = msm_pinctrl_remove, 1681 1681 }; 1682 1682 1683 1683 static int __init sm8450_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c
··· 216 216 .of_match_table = lpi_pinctrl_of_match, 217 217 }, 218 218 .probe = lpi_pinctrl_probe, 219 - .remove_new = lpi_pinctrl_remove, 219 + .remove = lpi_pinctrl_remove, 220 220 }; 221 221 222 222 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8550.c
··· 1762 1762 .of_match_table = sm8550_tlmm_of_match, 1763 1763 }, 1764 1764 .probe = sm8550_tlmm_probe, 1765 - .remove_new = msm_pinctrl_remove, 1765 + .remove = msm_pinctrl_remove, 1766 1766 }; 1767 1767 1768 1768 static int __init sm8550_tlmm_init(void)
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c
··· 223 223 .of_match_table = lpi_pinctrl_of_match, 224 224 }, 225 225 .probe = lpi_pinctrl_probe, 226 - .remove_new = lpi_pinctrl_remove, 226 + .remove = lpi_pinctrl_remove, 227 227 }; 228 228 229 229 module_platform_driver(lpi_pinctrl_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8650.c
··· 1742 1742 .of_match_table = sm8650_tlmm_of_match, 1743 1743 }, 1744 1744 .probe = sm8650_tlmm_probe, 1745 - .remove_new = msm_pinctrl_remove, 1745 + .remove = msm_pinctrl_remove, 1746 1746 }; 1747 1747 1748 1748 static int __init sm8650_tlmm_init(void)
+1729
drivers/pinctrl/qcom/pinctrl-sm8750.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. 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 + #define REG_SIZE 0x1000 13 + 14 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11) \ 15 + { \ 16 + .grp = PINCTRL_PINGROUP("gpio" #id, \ 17 + gpio##id##_pins, \ 18 + ARRAY_SIZE(gpio##id##_pins)), \ 19 + .funcs = (int[]){ \ 20 + msm_mux_gpio, /* gpio mode */ \ 21 + msm_mux_##f1, \ 22 + msm_mux_##f2, \ 23 + msm_mux_##f3, \ 24 + msm_mux_##f4, \ 25 + msm_mux_##f5, \ 26 + msm_mux_##f6, \ 27 + msm_mux_##f7, \ 28 + msm_mux_##f8, \ 29 + msm_mux_##f9, \ 30 + msm_mux_##f10, \ 31 + msm_mux_##f11 /* egpio mode */ \ 32 + }, \ 33 + .nfuncs = 12, \ 34 + .ctl_reg = REG_SIZE * id, \ 35 + .io_reg = 0x4 + REG_SIZE * id, \ 36 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 37 + .intr_status_reg = 0xc + REG_SIZE * id, \ 38 + .intr_target_reg = 0x8 + REG_SIZE * id, \ 39 + .mux_bit = 2, \ 40 + .pull_bit = 0, \ 41 + .drv_bit = 6, \ 42 + .egpio_enable = 12, \ 43 + .egpio_present = 11, \ 44 + .oe_bit = 9, \ 45 + .in_bit = 0, \ 46 + .out_bit = 1, \ 47 + .intr_enable_bit = 0, \ 48 + .intr_status_bit = 0, \ 49 + .intr_target_bit = 5, \ 50 + .intr_target_kpss_val = 3, \ 51 + .intr_raw_status_bit = 4, \ 52 + .intr_polarity_bit = 1, \ 53 + .intr_detection_bit = 2, \ 54 + .intr_detection_width = 2, \ 55 + } 56 + 57 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 58 + { \ 59 + .grp = PINCTRL_PINGROUP(#pg_name, \ 60 + pg_name##_pins, \ 61 + ARRAY_SIZE(pg_name##_pins)), \ 62 + .ctl_reg = ctl, \ 63 + .io_reg = 0, \ 64 + .intr_cfg_reg = 0, \ 65 + .intr_status_reg = 0, \ 66 + .intr_target_reg = 0, \ 67 + .mux_bit = -1, \ 68 + .pull_bit = pull, \ 69 + .drv_bit = drv, \ 70 + .oe_bit = -1, \ 71 + .in_bit = -1, \ 72 + .out_bit = -1, \ 73 + .intr_enable_bit = -1, \ 74 + .intr_status_bit = -1, \ 75 + .intr_target_bit = -1, \ 76 + .intr_raw_status_bit = -1, \ 77 + .intr_polarity_bit = -1, \ 78 + .intr_detection_bit = -1, \ 79 + .intr_detection_width = -1, \ 80 + } 81 + 82 + #define UFS_RESET(pg_name, ctl, io) \ 83 + { \ 84 + .grp = PINCTRL_PINGROUP(#pg_name, \ 85 + pg_name##_pins, \ 86 + ARRAY_SIZE(pg_name##_pins)), \ 87 + .ctl_reg = ctl, \ 88 + .io_reg = io, \ 89 + .intr_cfg_reg = 0, \ 90 + .intr_status_reg = 0, \ 91 + .intr_target_reg = 0, \ 92 + .mux_bit = -1, \ 93 + .pull_bit = 3, \ 94 + .drv_bit = 0, \ 95 + .oe_bit = -1, \ 96 + .in_bit = -1, \ 97 + .out_bit = 0, \ 98 + .intr_enable_bit = -1, \ 99 + .intr_status_bit = -1, \ 100 + .intr_target_bit = -1, \ 101 + .intr_raw_status_bit = -1, \ 102 + .intr_polarity_bit = -1, \ 103 + .intr_detection_bit = -1, \ 104 + .intr_detection_width = -1, \ 105 + } 106 + 107 + static const struct pinctrl_pin_desc sm8750_pins[] = { 108 + PINCTRL_PIN(0, "GPIO_0"), 109 + PINCTRL_PIN(1, "GPIO_1"), 110 + PINCTRL_PIN(2, "GPIO_2"), 111 + PINCTRL_PIN(3, "GPIO_3"), 112 + PINCTRL_PIN(4, "GPIO_4"), 113 + PINCTRL_PIN(5, "GPIO_5"), 114 + PINCTRL_PIN(6, "GPIO_6"), 115 + PINCTRL_PIN(7, "GPIO_7"), 116 + PINCTRL_PIN(8, "GPIO_8"), 117 + PINCTRL_PIN(9, "GPIO_9"), 118 + PINCTRL_PIN(10, "GPIO_10"), 119 + PINCTRL_PIN(11, "GPIO_11"), 120 + PINCTRL_PIN(12, "GPIO_12"), 121 + PINCTRL_PIN(13, "GPIO_13"), 122 + PINCTRL_PIN(14, "GPIO_14"), 123 + PINCTRL_PIN(15, "GPIO_15"), 124 + PINCTRL_PIN(16, "GPIO_16"), 125 + PINCTRL_PIN(17, "GPIO_17"), 126 + PINCTRL_PIN(18, "GPIO_18"), 127 + PINCTRL_PIN(19, "GPIO_19"), 128 + PINCTRL_PIN(20, "GPIO_20"), 129 + PINCTRL_PIN(21, "GPIO_21"), 130 + PINCTRL_PIN(22, "GPIO_22"), 131 + PINCTRL_PIN(23, "GPIO_23"), 132 + PINCTRL_PIN(24, "GPIO_24"), 133 + PINCTRL_PIN(25, "GPIO_25"), 134 + PINCTRL_PIN(26, "GPIO_26"), 135 + PINCTRL_PIN(27, "GPIO_27"), 136 + PINCTRL_PIN(28, "GPIO_28"), 137 + PINCTRL_PIN(29, "GPIO_29"), 138 + PINCTRL_PIN(30, "GPIO_30"), 139 + PINCTRL_PIN(31, "GPIO_31"), 140 + PINCTRL_PIN(32, "GPIO_32"), 141 + PINCTRL_PIN(33, "GPIO_33"), 142 + PINCTRL_PIN(34, "GPIO_34"), 143 + PINCTRL_PIN(35, "GPIO_35"), 144 + PINCTRL_PIN(36, "GPIO_36"), 145 + PINCTRL_PIN(37, "GPIO_37"), 146 + PINCTRL_PIN(38, "GPIO_38"), 147 + PINCTRL_PIN(39, "GPIO_39"), 148 + PINCTRL_PIN(40, "GPIO_40"), 149 + PINCTRL_PIN(41, "GPIO_41"), 150 + PINCTRL_PIN(42, "GPIO_42"), 151 + PINCTRL_PIN(43, "GPIO_43"), 152 + PINCTRL_PIN(44, "GPIO_44"), 153 + PINCTRL_PIN(45, "GPIO_45"), 154 + PINCTRL_PIN(46, "GPIO_46"), 155 + PINCTRL_PIN(47, "GPIO_47"), 156 + PINCTRL_PIN(48, "GPIO_48"), 157 + PINCTRL_PIN(49, "GPIO_49"), 158 + PINCTRL_PIN(50, "GPIO_50"), 159 + PINCTRL_PIN(51, "GPIO_51"), 160 + PINCTRL_PIN(52, "GPIO_52"), 161 + PINCTRL_PIN(53, "GPIO_53"), 162 + PINCTRL_PIN(54, "GPIO_54"), 163 + PINCTRL_PIN(55, "GPIO_55"), 164 + PINCTRL_PIN(56, "GPIO_56"), 165 + PINCTRL_PIN(57, "GPIO_57"), 166 + PINCTRL_PIN(58, "GPIO_58"), 167 + PINCTRL_PIN(59, "GPIO_59"), 168 + PINCTRL_PIN(60, "GPIO_60"), 169 + PINCTRL_PIN(61, "GPIO_61"), 170 + PINCTRL_PIN(62, "GPIO_62"), 171 + PINCTRL_PIN(63, "GPIO_63"), 172 + PINCTRL_PIN(64, "GPIO_64"), 173 + PINCTRL_PIN(65, "GPIO_65"), 174 + PINCTRL_PIN(66, "GPIO_66"), 175 + PINCTRL_PIN(67, "GPIO_67"), 176 + PINCTRL_PIN(68, "GPIO_68"), 177 + PINCTRL_PIN(69, "GPIO_69"), 178 + PINCTRL_PIN(70, "GPIO_70"), 179 + PINCTRL_PIN(71, "GPIO_71"), 180 + PINCTRL_PIN(72, "GPIO_72"), 181 + PINCTRL_PIN(73, "GPIO_73"), 182 + PINCTRL_PIN(74, "GPIO_74"), 183 + PINCTRL_PIN(75, "GPIO_75"), 184 + PINCTRL_PIN(76, "GPIO_76"), 185 + PINCTRL_PIN(77, "GPIO_77"), 186 + PINCTRL_PIN(78, "GPIO_78"), 187 + PINCTRL_PIN(79, "GPIO_79"), 188 + PINCTRL_PIN(80, "GPIO_80"), 189 + PINCTRL_PIN(81, "GPIO_81"), 190 + PINCTRL_PIN(82, "GPIO_82"), 191 + PINCTRL_PIN(83, "GPIO_83"), 192 + PINCTRL_PIN(84, "GPIO_84"), 193 + PINCTRL_PIN(85, "GPIO_85"), 194 + PINCTRL_PIN(86, "GPIO_86"), 195 + PINCTRL_PIN(87, "GPIO_87"), 196 + PINCTRL_PIN(88, "GPIO_88"), 197 + PINCTRL_PIN(89, "GPIO_89"), 198 + PINCTRL_PIN(90, "GPIO_90"), 199 + PINCTRL_PIN(91, "GPIO_91"), 200 + PINCTRL_PIN(92, "GPIO_92"), 201 + PINCTRL_PIN(93, "GPIO_93"), 202 + PINCTRL_PIN(94, "GPIO_94"), 203 + PINCTRL_PIN(95, "GPIO_95"), 204 + PINCTRL_PIN(96, "GPIO_96"), 205 + PINCTRL_PIN(97, "GPIO_97"), 206 + PINCTRL_PIN(98, "GPIO_98"), 207 + PINCTRL_PIN(99, "GPIO_99"), 208 + PINCTRL_PIN(100, "GPIO_100"), 209 + PINCTRL_PIN(101, "GPIO_101"), 210 + PINCTRL_PIN(102, "GPIO_102"), 211 + PINCTRL_PIN(103, "GPIO_103"), 212 + PINCTRL_PIN(104, "GPIO_104"), 213 + PINCTRL_PIN(105, "GPIO_105"), 214 + PINCTRL_PIN(106, "GPIO_106"), 215 + PINCTRL_PIN(107, "GPIO_107"), 216 + PINCTRL_PIN(108, "GPIO_108"), 217 + PINCTRL_PIN(109, "GPIO_109"), 218 + PINCTRL_PIN(110, "GPIO_110"), 219 + PINCTRL_PIN(111, "GPIO_111"), 220 + PINCTRL_PIN(112, "GPIO_112"), 221 + PINCTRL_PIN(113, "GPIO_113"), 222 + PINCTRL_PIN(114, "GPIO_114"), 223 + PINCTRL_PIN(115, "GPIO_115"), 224 + PINCTRL_PIN(116, "GPIO_116"), 225 + PINCTRL_PIN(117, "GPIO_117"), 226 + PINCTRL_PIN(118, "GPIO_118"), 227 + PINCTRL_PIN(119, "GPIO_119"), 228 + PINCTRL_PIN(120, "GPIO_120"), 229 + PINCTRL_PIN(121, "GPIO_121"), 230 + PINCTRL_PIN(122, "GPIO_122"), 231 + PINCTRL_PIN(123, "GPIO_123"), 232 + PINCTRL_PIN(124, "GPIO_124"), 233 + PINCTRL_PIN(125, "GPIO_125"), 234 + PINCTRL_PIN(126, "GPIO_126"), 235 + PINCTRL_PIN(127, "GPIO_127"), 236 + PINCTRL_PIN(128, "GPIO_128"), 237 + PINCTRL_PIN(129, "GPIO_129"), 238 + PINCTRL_PIN(130, "GPIO_130"), 239 + PINCTRL_PIN(131, "GPIO_131"), 240 + PINCTRL_PIN(132, "GPIO_132"), 241 + PINCTRL_PIN(133, "GPIO_133"), 242 + PINCTRL_PIN(134, "GPIO_134"), 243 + PINCTRL_PIN(135, "GPIO_135"), 244 + PINCTRL_PIN(136, "GPIO_136"), 245 + PINCTRL_PIN(137, "GPIO_137"), 246 + PINCTRL_PIN(138, "GPIO_138"), 247 + PINCTRL_PIN(139, "GPIO_139"), 248 + PINCTRL_PIN(140, "GPIO_140"), 249 + PINCTRL_PIN(141, "GPIO_141"), 250 + PINCTRL_PIN(142, "GPIO_142"), 251 + PINCTRL_PIN(143, "GPIO_143"), 252 + PINCTRL_PIN(144, "GPIO_144"), 253 + PINCTRL_PIN(145, "GPIO_145"), 254 + PINCTRL_PIN(146, "GPIO_146"), 255 + PINCTRL_PIN(147, "GPIO_147"), 256 + PINCTRL_PIN(148, "GPIO_148"), 257 + PINCTRL_PIN(149, "GPIO_149"), 258 + PINCTRL_PIN(150, "GPIO_150"), 259 + PINCTRL_PIN(151, "GPIO_151"), 260 + PINCTRL_PIN(152, "GPIO_152"), 261 + PINCTRL_PIN(153, "GPIO_153"), 262 + PINCTRL_PIN(154, "GPIO_154"), 263 + PINCTRL_PIN(155, "GPIO_155"), 264 + PINCTRL_PIN(156, "GPIO_156"), 265 + PINCTRL_PIN(157, "GPIO_157"), 266 + PINCTRL_PIN(158, "GPIO_158"), 267 + PINCTRL_PIN(159, "GPIO_159"), 268 + PINCTRL_PIN(160, "GPIO_160"), 269 + PINCTRL_PIN(161, "GPIO_161"), 270 + PINCTRL_PIN(162, "GPIO_162"), 271 + PINCTRL_PIN(163, "GPIO_163"), 272 + PINCTRL_PIN(164, "GPIO_164"), 273 + PINCTRL_PIN(165, "GPIO_165"), 274 + PINCTRL_PIN(166, "GPIO_166"), 275 + PINCTRL_PIN(167, "GPIO_167"), 276 + PINCTRL_PIN(168, "GPIO_168"), 277 + PINCTRL_PIN(169, "GPIO_169"), 278 + PINCTRL_PIN(170, "GPIO_170"), 279 + PINCTRL_PIN(171, "GPIO_171"), 280 + PINCTRL_PIN(172, "GPIO_172"), 281 + PINCTRL_PIN(173, "GPIO_173"), 282 + PINCTRL_PIN(174, "GPIO_174"), 283 + PINCTRL_PIN(175, "GPIO_175"), 284 + PINCTRL_PIN(176, "GPIO_176"), 285 + PINCTRL_PIN(177, "GPIO_177"), 286 + PINCTRL_PIN(178, "GPIO_178"), 287 + PINCTRL_PIN(179, "GPIO_179"), 288 + PINCTRL_PIN(180, "GPIO_180"), 289 + PINCTRL_PIN(181, "GPIO_181"), 290 + PINCTRL_PIN(182, "GPIO_182"), 291 + PINCTRL_PIN(183, "GPIO_183"), 292 + PINCTRL_PIN(184, "GPIO_184"), 293 + PINCTRL_PIN(185, "GPIO_185"), 294 + PINCTRL_PIN(186, "GPIO_186"), 295 + PINCTRL_PIN(187, "GPIO_187"), 296 + PINCTRL_PIN(188, "GPIO_188"), 297 + PINCTRL_PIN(189, "GPIO_189"), 298 + PINCTRL_PIN(190, "GPIO_190"), 299 + PINCTRL_PIN(191, "GPIO_191"), 300 + PINCTRL_PIN(192, "GPIO_192"), 301 + PINCTRL_PIN(193, "GPIO_193"), 302 + PINCTRL_PIN(194, "GPIO_194"), 303 + PINCTRL_PIN(195, "GPIO_195"), 304 + PINCTRL_PIN(196, "GPIO_196"), 305 + PINCTRL_PIN(197, "GPIO_197"), 306 + PINCTRL_PIN(198, "GPIO_198"), 307 + PINCTRL_PIN(199, "GPIO_199"), 308 + PINCTRL_PIN(200, "GPIO_200"), 309 + PINCTRL_PIN(201, "GPIO_201"), 310 + PINCTRL_PIN(202, "GPIO_202"), 311 + PINCTRL_PIN(203, "GPIO_203"), 312 + PINCTRL_PIN(204, "GPIO_204"), 313 + PINCTRL_PIN(205, "GPIO_205"), 314 + PINCTRL_PIN(206, "GPIO_206"), 315 + PINCTRL_PIN(207, "GPIO_207"), 316 + PINCTRL_PIN(208, "GPIO_208"), 317 + PINCTRL_PIN(209, "GPIO_209"), 318 + PINCTRL_PIN(210, "GPIO_210"), 319 + PINCTRL_PIN(211, "GPIO_211"), 320 + PINCTRL_PIN(212, "GPIO_212"), 321 + PINCTRL_PIN(213, "GPIO_213"), 322 + PINCTRL_PIN(214, "GPIO_214"), 323 + PINCTRL_PIN(215, "UFS_RESET"), 324 + PINCTRL_PIN(216, "SDC2_CLK"), 325 + PINCTRL_PIN(217, "SDC2_CMD"), 326 + PINCTRL_PIN(218, "SDC2_DATA"), 327 + }; 328 + 329 + #define DECLARE_MSM_GPIO_PINS(pin) \ 330 + static const unsigned int gpio##pin##_pins[] = { pin } 331 + DECLARE_MSM_GPIO_PINS(0); 332 + DECLARE_MSM_GPIO_PINS(1); 333 + DECLARE_MSM_GPIO_PINS(2); 334 + DECLARE_MSM_GPIO_PINS(3); 335 + DECLARE_MSM_GPIO_PINS(4); 336 + DECLARE_MSM_GPIO_PINS(5); 337 + DECLARE_MSM_GPIO_PINS(6); 338 + DECLARE_MSM_GPIO_PINS(7); 339 + DECLARE_MSM_GPIO_PINS(8); 340 + DECLARE_MSM_GPIO_PINS(9); 341 + DECLARE_MSM_GPIO_PINS(10); 342 + DECLARE_MSM_GPIO_PINS(11); 343 + DECLARE_MSM_GPIO_PINS(12); 344 + DECLARE_MSM_GPIO_PINS(13); 345 + DECLARE_MSM_GPIO_PINS(14); 346 + DECLARE_MSM_GPIO_PINS(15); 347 + DECLARE_MSM_GPIO_PINS(16); 348 + DECLARE_MSM_GPIO_PINS(17); 349 + DECLARE_MSM_GPIO_PINS(18); 350 + DECLARE_MSM_GPIO_PINS(19); 351 + DECLARE_MSM_GPIO_PINS(20); 352 + DECLARE_MSM_GPIO_PINS(21); 353 + DECLARE_MSM_GPIO_PINS(22); 354 + DECLARE_MSM_GPIO_PINS(23); 355 + DECLARE_MSM_GPIO_PINS(24); 356 + DECLARE_MSM_GPIO_PINS(25); 357 + DECLARE_MSM_GPIO_PINS(26); 358 + DECLARE_MSM_GPIO_PINS(27); 359 + DECLARE_MSM_GPIO_PINS(28); 360 + DECLARE_MSM_GPIO_PINS(29); 361 + DECLARE_MSM_GPIO_PINS(30); 362 + DECLARE_MSM_GPIO_PINS(31); 363 + DECLARE_MSM_GPIO_PINS(32); 364 + DECLARE_MSM_GPIO_PINS(33); 365 + DECLARE_MSM_GPIO_PINS(34); 366 + DECLARE_MSM_GPIO_PINS(35); 367 + DECLARE_MSM_GPIO_PINS(36); 368 + DECLARE_MSM_GPIO_PINS(37); 369 + DECLARE_MSM_GPIO_PINS(38); 370 + DECLARE_MSM_GPIO_PINS(39); 371 + DECLARE_MSM_GPIO_PINS(40); 372 + DECLARE_MSM_GPIO_PINS(41); 373 + DECLARE_MSM_GPIO_PINS(42); 374 + DECLARE_MSM_GPIO_PINS(43); 375 + DECLARE_MSM_GPIO_PINS(44); 376 + DECLARE_MSM_GPIO_PINS(45); 377 + DECLARE_MSM_GPIO_PINS(46); 378 + DECLARE_MSM_GPIO_PINS(47); 379 + DECLARE_MSM_GPIO_PINS(48); 380 + DECLARE_MSM_GPIO_PINS(49); 381 + DECLARE_MSM_GPIO_PINS(50); 382 + DECLARE_MSM_GPIO_PINS(51); 383 + DECLARE_MSM_GPIO_PINS(52); 384 + DECLARE_MSM_GPIO_PINS(53); 385 + DECLARE_MSM_GPIO_PINS(54); 386 + DECLARE_MSM_GPIO_PINS(55); 387 + DECLARE_MSM_GPIO_PINS(56); 388 + DECLARE_MSM_GPIO_PINS(57); 389 + DECLARE_MSM_GPIO_PINS(58); 390 + DECLARE_MSM_GPIO_PINS(59); 391 + DECLARE_MSM_GPIO_PINS(60); 392 + DECLARE_MSM_GPIO_PINS(61); 393 + DECLARE_MSM_GPIO_PINS(62); 394 + DECLARE_MSM_GPIO_PINS(63); 395 + DECLARE_MSM_GPIO_PINS(64); 396 + DECLARE_MSM_GPIO_PINS(65); 397 + DECLARE_MSM_GPIO_PINS(66); 398 + DECLARE_MSM_GPIO_PINS(67); 399 + DECLARE_MSM_GPIO_PINS(68); 400 + DECLARE_MSM_GPIO_PINS(69); 401 + DECLARE_MSM_GPIO_PINS(70); 402 + DECLARE_MSM_GPIO_PINS(71); 403 + DECLARE_MSM_GPIO_PINS(72); 404 + DECLARE_MSM_GPIO_PINS(73); 405 + DECLARE_MSM_GPIO_PINS(74); 406 + DECLARE_MSM_GPIO_PINS(75); 407 + DECLARE_MSM_GPIO_PINS(76); 408 + DECLARE_MSM_GPIO_PINS(77); 409 + DECLARE_MSM_GPIO_PINS(78); 410 + DECLARE_MSM_GPIO_PINS(79); 411 + DECLARE_MSM_GPIO_PINS(80); 412 + DECLARE_MSM_GPIO_PINS(81); 413 + DECLARE_MSM_GPIO_PINS(82); 414 + DECLARE_MSM_GPIO_PINS(83); 415 + DECLARE_MSM_GPIO_PINS(84); 416 + DECLARE_MSM_GPIO_PINS(85); 417 + DECLARE_MSM_GPIO_PINS(86); 418 + DECLARE_MSM_GPIO_PINS(87); 419 + DECLARE_MSM_GPIO_PINS(88); 420 + DECLARE_MSM_GPIO_PINS(89); 421 + DECLARE_MSM_GPIO_PINS(90); 422 + DECLARE_MSM_GPIO_PINS(91); 423 + DECLARE_MSM_GPIO_PINS(92); 424 + DECLARE_MSM_GPIO_PINS(93); 425 + DECLARE_MSM_GPIO_PINS(94); 426 + DECLARE_MSM_GPIO_PINS(95); 427 + DECLARE_MSM_GPIO_PINS(96); 428 + DECLARE_MSM_GPIO_PINS(97); 429 + DECLARE_MSM_GPIO_PINS(98); 430 + DECLARE_MSM_GPIO_PINS(99); 431 + DECLARE_MSM_GPIO_PINS(100); 432 + DECLARE_MSM_GPIO_PINS(101); 433 + DECLARE_MSM_GPIO_PINS(102); 434 + DECLARE_MSM_GPIO_PINS(103); 435 + DECLARE_MSM_GPIO_PINS(104); 436 + DECLARE_MSM_GPIO_PINS(105); 437 + DECLARE_MSM_GPIO_PINS(106); 438 + DECLARE_MSM_GPIO_PINS(107); 439 + DECLARE_MSM_GPIO_PINS(108); 440 + DECLARE_MSM_GPIO_PINS(109); 441 + DECLARE_MSM_GPIO_PINS(110); 442 + DECLARE_MSM_GPIO_PINS(111); 443 + DECLARE_MSM_GPIO_PINS(112); 444 + DECLARE_MSM_GPIO_PINS(113); 445 + DECLARE_MSM_GPIO_PINS(114); 446 + DECLARE_MSM_GPIO_PINS(115); 447 + DECLARE_MSM_GPIO_PINS(116); 448 + DECLARE_MSM_GPIO_PINS(117); 449 + DECLARE_MSM_GPIO_PINS(118); 450 + DECLARE_MSM_GPIO_PINS(119); 451 + DECLARE_MSM_GPIO_PINS(120); 452 + DECLARE_MSM_GPIO_PINS(121); 453 + DECLARE_MSM_GPIO_PINS(122); 454 + DECLARE_MSM_GPIO_PINS(123); 455 + DECLARE_MSM_GPIO_PINS(124); 456 + DECLARE_MSM_GPIO_PINS(125); 457 + DECLARE_MSM_GPIO_PINS(126); 458 + DECLARE_MSM_GPIO_PINS(127); 459 + DECLARE_MSM_GPIO_PINS(128); 460 + DECLARE_MSM_GPIO_PINS(129); 461 + DECLARE_MSM_GPIO_PINS(130); 462 + DECLARE_MSM_GPIO_PINS(131); 463 + DECLARE_MSM_GPIO_PINS(132); 464 + DECLARE_MSM_GPIO_PINS(133); 465 + DECLARE_MSM_GPIO_PINS(134); 466 + DECLARE_MSM_GPIO_PINS(135); 467 + DECLARE_MSM_GPIO_PINS(136); 468 + DECLARE_MSM_GPIO_PINS(137); 469 + DECLARE_MSM_GPIO_PINS(138); 470 + DECLARE_MSM_GPIO_PINS(139); 471 + DECLARE_MSM_GPIO_PINS(140); 472 + DECLARE_MSM_GPIO_PINS(141); 473 + DECLARE_MSM_GPIO_PINS(142); 474 + DECLARE_MSM_GPIO_PINS(143); 475 + DECLARE_MSM_GPIO_PINS(144); 476 + DECLARE_MSM_GPIO_PINS(145); 477 + DECLARE_MSM_GPIO_PINS(146); 478 + DECLARE_MSM_GPIO_PINS(147); 479 + DECLARE_MSM_GPIO_PINS(148); 480 + DECLARE_MSM_GPIO_PINS(149); 481 + DECLARE_MSM_GPIO_PINS(150); 482 + DECLARE_MSM_GPIO_PINS(151); 483 + DECLARE_MSM_GPIO_PINS(152); 484 + DECLARE_MSM_GPIO_PINS(153); 485 + DECLARE_MSM_GPIO_PINS(154); 486 + DECLARE_MSM_GPIO_PINS(155); 487 + DECLARE_MSM_GPIO_PINS(156); 488 + DECLARE_MSM_GPIO_PINS(157); 489 + DECLARE_MSM_GPIO_PINS(158); 490 + DECLARE_MSM_GPIO_PINS(159); 491 + DECLARE_MSM_GPIO_PINS(160); 492 + DECLARE_MSM_GPIO_PINS(161); 493 + DECLARE_MSM_GPIO_PINS(162); 494 + DECLARE_MSM_GPIO_PINS(163); 495 + DECLARE_MSM_GPIO_PINS(164); 496 + DECLARE_MSM_GPIO_PINS(165); 497 + DECLARE_MSM_GPIO_PINS(166); 498 + DECLARE_MSM_GPIO_PINS(167); 499 + DECLARE_MSM_GPIO_PINS(168); 500 + DECLARE_MSM_GPIO_PINS(169); 501 + DECLARE_MSM_GPIO_PINS(170); 502 + DECLARE_MSM_GPIO_PINS(171); 503 + DECLARE_MSM_GPIO_PINS(172); 504 + DECLARE_MSM_GPIO_PINS(173); 505 + DECLARE_MSM_GPIO_PINS(174); 506 + DECLARE_MSM_GPIO_PINS(175); 507 + DECLARE_MSM_GPIO_PINS(176); 508 + DECLARE_MSM_GPIO_PINS(177); 509 + DECLARE_MSM_GPIO_PINS(178); 510 + DECLARE_MSM_GPIO_PINS(179); 511 + DECLARE_MSM_GPIO_PINS(180); 512 + DECLARE_MSM_GPIO_PINS(181); 513 + DECLARE_MSM_GPIO_PINS(182); 514 + DECLARE_MSM_GPIO_PINS(183); 515 + DECLARE_MSM_GPIO_PINS(184); 516 + DECLARE_MSM_GPIO_PINS(185); 517 + DECLARE_MSM_GPIO_PINS(186); 518 + DECLARE_MSM_GPIO_PINS(187); 519 + DECLARE_MSM_GPIO_PINS(188); 520 + DECLARE_MSM_GPIO_PINS(189); 521 + DECLARE_MSM_GPIO_PINS(190); 522 + DECLARE_MSM_GPIO_PINS(191); 523 + DECLARE_MSM_GPIO_PINS(192); 524 + DECLARE_MSM_GPIO_PINS(193); 525 + DECLARE_MSM_GPIO_PINS(194); 526 + DECLARE_MSM_GPIO_PINS(195); 527 + DECLARE_MSM_GPIO_PINS(196); 528 + DECLARE_MSM_GPIO_PINS(197); 529 + DECLARE_MSM_GPIO_PINS(198); 530 + DECLARE_MSM_GPIO_PINS(199); 531 + DECLARE_MSM_GPIO_PINS(200); 532 + DECLARE_MSM_GPIO_PINS(201); 533 + DECLARE_MSM_GPIO_PINS(202); 534 + DECLARE_MSM_GPIO_PINS(203); 535 + DECLARE_MSM_GPIO_PINS(204); 536 + DECLARE_MSM_GPIO_PINS(205); 537 + DECLARE_MSM_GPIO_PINS(206); 538 + DECLARE_MSM_GPIO_PINS(207); 539 + DECLARE_MSM_GPIO_PINS(208); 540 + DECLARE_MSM_GPIO_PINS(209); 541 + DECLARE_MSM_GPIO_PINS(210); 542 + DECLARE_MSM_GPIO_PINS(211); 543 + DECLARE_MSM_GPIO_PINS(212); 544 + DECLARE_MSM_GPIO_PINS(213); 545 + DECLARE_MSM_GPIO_PINS(214); 546 + 547 + static const unsigned int ufs_reset_pins[] = { 215 }; 548 + static const unsigned int sdc2_clk_pins[] = { 216 }; 549 + static const unsigned int sdc2_cmd_pins[] = { 217 }; 550 + static const unsigned int sdc2_data_pins[] = { 218 }; 551 + 552 + enum sm8750_functions { 553 + msm_mux_gpio, 554 + msm_mux_aoss_cti, 555 + msm_mux_atest_char, 556 + msm_mux_atest_usb, 557 + msm_mux_audio_ext_mclk0, 558 + msm_mux_audio_ext_mclk1, 559 + msm_mux_audio_ref_clk, 560 + msm_mux_cam_aon_mclk2, 561 + msm_mux_cam_aon_mclk4, 562 + msm_mux_cam_mclk, 563 + msm_mux_cci_async_in, 564 + msm_mux_cci_i2c_scl, 565 + msm_mux_cci_i2c_sda, 566 + msm_mux_cci_timer, 567 + msm_mux_cmu_rng, 568 + msm_mux_coex_uart1_rx, 569 + msm_mux_coex_uart1_tx, 570 + msm_mux_coex_uart2_rx, 571 + msm_mux_coex_uart2_tx, 572 + msm_mux_dbg_out_clk, 573 + msm_mux_ddr_bist_complete, 574 + msm_mux_ddr_bist_fail, 575 + msm_mux_ddr_bist_start, 576 + msm_mux_ddr_bist_stop, 577 + msm_mux_ddr_pxi0, 578 + msm_mux_ddr_pxi1, 579 + msm_mux_ddr_pxi2, 580 + msm_mux_ddr_pxi3, 581 + msm_mux_dp_hot, 582 + msm_mux_egpio, 583 + msm_mux_gcc_gp1, 584 + msm_mux_gcc_gp2, 585 + msm_mux_gcc_gp3, 586 + msm_mux_gnss_adc0, 587 + msm_mux_gnss_adc1, 588 + msm_mux_i2chub0_se0, 589 + msm_mux_i2chub0_se1, 590 + msm_mux_i2chub0_se2, 591 + msm_mux_i2chub0_se3, 592 + msm_mux_i2chub0_se4, 593 + msm_mux_i2chub0_se5, 594 + msm_mux_i2chub0_se6, 595 + msm_mux_i2chub0_se7, 596 + msm_mux_i2chub0_se8, 597 + msm_mux_i2chub0_se9, 598 + msm_mux_i2s0_data0, 599 + msm_mux_i2s0_data1, 600 + msm_mux_i2s0_sck, 601 + msm_mux_i2s0_ws, 602 + msm_mux_i2s1_data0, 603 + msm_mux_i2s1_data1, 604 + msm_mux_i2s1_sck, 605 + msm_mux_i2s1_ws, 606 + msm_mux_ibi_i3c, 607 + msm_mux_jitter_bist, 608 + msm_mux_mdp_esync0_out, 609 + msm_mux_mdp_esync1_out, 610 + msm_mux_mdp_vsync, 611 + msm_mux_mdp_vsync0_out, 612 + msm_mux_mdp_vsync1_out, 613 + msm_mux_mdp_vsync2_out, 614 + msm_mux_mdp_vsync3_out, 615 + msm_mux_mdp_vsync5_out, 616 + msm_mux_mdp_vsync_e, 617 + msm_mux_nav_gpio0, 618 + msm_mux_nav_gpio1, 619 + msm_mux_nav_gpio2, 620 + msm_mux_nav_gpio3, 621 + msm_mux_pcie0_clk_req_n, 622 + msm_mux_phase_flag, 623 + msm_mux_pll_bist_sync, 624 + msm_mux_pll_clk_aux, 625 + msm_mux_prng_rosc0, 626 + msm_mux_prng_rosc1, 627 + msm_mux_prng_rosc2, 628 + msm_mux_prng_rosc3, 629 + msm_mux_qdss_cti, 630 + msm_mux_qlink_big_enable, 631 + msm_mux_qlink_big_request, 632 + msm_mux_qlink_little_enable, 633 + msm_mux_qlink_little_request, 634 + msm_mux_qlink_wmss, 635 + msm_mux_qspi0, 636 + msm_mux_qspi1, 637 + msm_mux_qspi2, 638 + msm_mux_qspi3, 639 + msm_mux_qspi_clk, 640 + msm_mux_qspi_cs, 641 + msm_mux_qup1_se0, 642 + msm_mux_qup1_se1, 643 + msm_mux_qup1_se2, 644 + msm_mux_qup1_se3, 645 + msm_mux_qup1_se4, 646 + msm_mux_qup1_se5, 647 + msm_mux_qup1_se6, 648 + msm_mux_qup1_se7, 649 + msm_mux_qup2_se0, 650 + msm_mux_qup2_se1, 651 + msm_mux_qup2_se2, 652 + msm_mux_qup2_se3, 653 + msm_mux_qup2_se4, 654 + msm_mux_qup2_se5, 655 + msm_mux_qup2_se6, 656 + msm_mux_qup2_se7, 657 + msm_mux_sd_write_protect, 658 + msm_mux_sdc40, 659 + msm_mux_sdc41, 660 + msm_mux_sdc42, 661 + msm_mux_sdc43, 662 + msm_mux_sdc4_clk, 663 + msm_mux_sdc4_cmd, 664 + msm_mux_tb_trig_sdc2, 665 + msm_mux_tb_trig_sdc4, 666 + msm_mux_tmess_prng0, 667 + msm_mux_tmess_prng1, 668 + msm_mux_tmess_prng2, 669 + msm_mux_tmess_prng3, 670 + msm_mux_tsense_pwm1, 671 + msm_mux_tsense_pwm2, 672 + msm_mux_tsense_pwm3, 673 + msm_mux_tsense_pwm4, 674 + msm_mux_uim0_clk, 675 + msm_mux_uim0_data, 676 + msm_mux_uim0_present, 677 + msm_mux_uim0_reset, 678 + msm_mux_uim1_clk, 679 + msm_mux_uim1_data, 680 + msm_mux_uim1_present, 681 + msm_mux_uim1_reset, 682 + msm_mux_usb1_hs, 683 + msm_mux_usb_phy, 684 + msm_mux_vfr_0, 685 + msm_mux_vfr_1, 686 + msm_mux_vsense_trigger_mirnat, 687 + msm_mux_wcn_sw, 688 + msm_mux_wcn_sw_ctrl, 689 + msm_mux__, 690 + }; 691 + 692 + static const char *const gpio_groups[] = { 693 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", 694 + "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", 695 + "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", 696 + "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", 697 + "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", 698 + "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 699 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", 700 + "gpio42", "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", 701 + "gpio48", "gpio49", "gpio50", "gpio51", "gpio52", "gpio53", 702 + "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", "gpio59", 703 + "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65", 704 + "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", "gpio71", 705 + "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 706 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", 707 + "gpio84", "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", 708 + "gpio90", "gpio91", "gpio92", "gpio93", "gpio94", "gpio95", 709 + "gpio96", "gpio97", "gpio98", "gpio99", "gpio100", "gpio101", 710 + "gpio102", "gpio103", "gpio104", "gpio105", "gpio106", "gpio107", 711 + "gpio108", "gpio109", "gpio110", "gpio111", "gpio112", "gpio113", 712 + "gpio114", "gpio115", "gpio116", "gpio117", "gpio118", "gpio119", 713 + "gpio120", "gpio121", "gpio122", "gpio123", "gpio124", "gpio125", 714 + "gpio126", "gpio127", "gpio128", "gpio129", "gpio130", "gpio131", 715 + "gpio132", "gpio133", "gpio134", "gpio135", "gpio136", "gpio137", 716 + "gpio138", "gpio139", "gpio140", "gpio141", "gpio142", "gpio143", 717 + "gpio144", "gpio145", "gpio146", "gpio147", "gpio148", "gpio149", 718 + "gpio150", "gpio151", "gpio152", "gpio153", "gpio154", "gpio155", 719 + "gpio156", "gpio157", "gpio158", "gpio159", "gpio160", "gpio161", 720 + "gpio162", "gpio163", "gpio164", "gpio165", "gpio166", "gpio167", 721 + "gpio168", "gpio169", "gpio170", "gpio171", "gpio172", "gpio173", 722 + "gpio174", "gpio175", "gpio176", "gpio177", "gpio178", "gpio179", 723 + "gpio180", "gpio181", "gpio182", "gpio183", "gpio184", "gpio185", 724 + "gpio186", "gpio187", "gpio188", "gpio189", "gpio190", "gpio191", 725 + "gpio192", "gpio193", "gpio194", "gpio195", "gpio196", "gpio197", 726 + "gpio198", "gpio199", "gpio200", "gpio201", "gpio202", "gpio203", 727 + "gpio204", "gpio205", "gpio206", "gpio207", "gpio208", "gpio209", 728 + "gpio210", "gpio211", "gpio212", "gpio213", "gpio214", 729 + }; 730 + 731 + static const char *const egpio_groups[] = { 732 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", 733 + "gpio6", "gpio7", "gpio32", "gpio33", "gpio34", "gpio35", 734 + "gpio36", "gpio37", "gpio105", "gpio106", "gpio107", "gpio108", 735 + "gpio165", "gpio166", "gpio167", "gpio168", "gpio169", "gpio170", 736 + "gpio171", "gpio172", "gpio173", "gpio174", "gpio175", "gpio176", 737 + "gpio177", "gpio178", "gpio179", "gpio180", "gpio181", "gpio182", 738 + "gpio183", "gpio184", "gpio185", "gpio186", "gpio187", "gpio188", 739 + "gpio189", "gpio190", "gpio191", "gpio192", "gpio193", "gpio194", 740 + "gpio195", "gpio196", "gpio197", "gpio198", "gpio199", "gpio200", 741 + "gpio201", "gpio202", "gpio203", "gpio204", "gpio205", "gpio206", 742 + "gpio207", "gpio208", "gpio209", "gpio210", "gpio211", "gpio212", 743 + "gpio213", "gpio214", 744 + }; 745 + 746 + static const char *const aoss_cti_groups[] = { 747 + "gpio50", "gpio51", "gpio60", "gpio61", 748 + }; 749 + 750 + static const char *const atest_char_groups[] = { 751 + "gpio130", "gpio131", "gpio132", "gpio133", "gpio137", 752 + }; 753 + 754 + static const char *const atest_usb_groups[] = { 755 + "gpio70", "gpio71", "gpio72", "gpio73", "gpio76", 756 + }; 757 + 758 + static const char *const audio_ext_mclk0_groups[] = { 759 + "gpio125", 760 + }; 761 + 762 + static const char *const audio_ext_mclk1_groups[] = { 763 + "gpio124", 764 + }; 765 + 766 + static const char *const audio_ref_clk_groups[] = { 767 + "gpio124", 768 + }; 769 + 770 + static const char *const cam_aon_mclk2_groups[] = { 771 + "gpio91", 772 + }; 773 + 774 + static const char *const cam_aon_mclk4_groups[] = { 775 + "gpio93", 776 + }; 777 + 778 + static const char *const cam_mclk_groups[] = { 779 + "gpio89", "gpio90", "gpio92", "gpio94", "gpio95", "gpio96", 780 + }; 781 + 782 + static const char *const cci_async_in_groups[] = { 783 + "gpio10", "gpio11", "gpio15", 784 + }; 785 + 786 + static const char *const cci_i2c_scl_groups[] = { 787 + "gpio114", "gpio116", "gpio118", "gpio120", "gpio153", "gpio164", 788 + }; 789 + 790 + static const char *const cci_i2c_sda_groups[] = { 791 + "gpio111", "gpio112", "gpio113", "gpio115", "gpio117", "gpio119", 792 + }; 793 + 794 + static const char *const cci_timer_groups[] = { 795 + "gpio109", "gpio110", "gpio111", "gpio163", "gpio164", 796 + }; 797 + 798 + static const char *const cmu_rng_groups[] = { 799 + "gpio40", "gpio41", "gpio41", "gpio43", "gpio148", "gpio149", 800 + "gpio150", "gpio151", 801 + }; 802 + 803 + static const char *const coex_uart1_rx_groups[] = { 804 + "gpio148", 805 + }; 806 + 807 + static const char *const coex_uart1_tx_groups[] = { 808 + "gpio149", 809 + }; 810 + 811 + static const char *const coex_uart2_rx_groups[] = { 812 + "gpio150", 813 + }; 814 + 815 + static const char *const coex_uart2_tx_groups[] = { 816 + "gpio151", 817 + }; 818 + 819 + static const char *const dbg_out_clk_groups[] = { 820 + "gpio78", 821 + }; 822 + 823 + static const char *const ddr_bist_complete_groups[] = { 824 + "gpio44", 825 + }; 826 + 827 + static const char *const ddr_bist_fail_groups[] = { 828 + "gpio40", 829 + }; 830 + 831 + static const char *const ddr_bist_start_groups[] = { 832 + "gpio41", 833 + }; 834 + 835 + static const char *const ddr_bist_stop_groups[] = { 836 + "gpio45", 837 + }; 838 + 839 + static const char *const ddr_pxi0_groups[] = { 840 + "gpio54", "gpio55", 841 + }; 842 + 843 + static const char *const ddr_pxi1_groups[] = { 844 + "gpio44", "gpio45", 845 + }; 846 + 847 + static const char *const ddr_pxi2_groups[] = { 848 + "gpio43", "gpio52", 849 + }; 850 + 851 + static const char *const ddr_pxi3_groups[] = { 852 + "gpio46", "gpio53", 853 + }; 854 + 855 + static const char *const dp_hot_groups[] = { 856 + "gpio47", 857 + }; 858 + 859 + static const char *const gcc_gp1_groups[] = { 860 + "gpio86", "gpio134", 861 + }; 862 + 863 + static const char *const gcc_gp2_groups[] = { 864 + "gpio87", "gpio135", 865 + }; 866 + 867 + static const char *const gcc_gp3_groups[] = { 868 + "gpio88", "gpio136", 869 + }; 870 + 871 + static const char *const gnss_adc0_groups[] = { 872 + "gpio78", "gpio79", 873 + }; 874 + 875 + static const char *const gnss_adc1_groups[] = { 876 + "gpio77", "gpio99", 877 + }; 878 + 879 + static const char *const i2chub0_se0_groups[] = { 880 + "gpio64", "gpio65", 881 + }; 882 + 883 + static const char *const i2chub0_se1_groups[] = { 884 + "gpio66", "gpio67", 885 + }; 886 + 887 + static const char *const i2chub0_se2_groups[] = { 888 + "gpio68", "gpio69", 889 + }; 890 + 891 + static const char *const i2chub0_se3_groups[] = { 892 + "gpio70", "gpio71", 893 + }; 894 + 895 + static const char *const i2chub0_se4_groups[] = { 896 + "gpio72", "gpio73", 897 + }; 898 + 899 + static const char *const i2chub0_se5_groups[] = { 900 + "gpio74", "gpio75", 901 + }; 902 + 903 + static const char *const i2chub0_se6_groups[] = { 904 + "gpio76", "gpio77", 905 + }; 906 + 907 + static const char *const i2chub0_se7_groups[] = { 908 + "gpio82", "gpio83", 909 + }; 910 + 911 + static const char *const i2chub0_se8_groups[] = { 912 + "gpio206", "gpio207", 913 + }; 914 + 915 + static const char *const i2chub0_se9_groups[] = { 916 + "gpio80", "gpio81", 917 + }; 918 + 919 + static const char *const i2s0_data0_groups[] = { 920 + "gpio127", 921 + }; 922 + 923 + static const char *const i2s0_data1_groups[] = { 924 + "gpio128", 925 + }; 926 + 927 + static const char *const i2s0_sck_groups[] = { 928 + "gpio126", 929 + }; 930 + 931 + static const char *const i2s0_ws_groups[] = { 932 + "gpio129", 933 + }; 934 + 935 + static const char *const i2s1_data0_groups[] = { 936 + "gpio122", 937 + }; 938 + 939 + static const char *const i2s1_data1_groups[] = { 940 + "gpio124", 941 + }; 942 + 943 + static const char *const i2s1_sck_groups[] = { 944 + "gpio121", 945 + }; 946 + 947 + static const char *const i2s1_ws_groups[] = { 948 + "gpio123", 949 + }; 950 + 951 + static const char *const ibi_i3c_groups[] = { 952 + "gpio0", "gpio1", "gpio4", "gpio5", "gpio8", "gpio9", 953 + "gpio12", "gpio13", "gpio28", "gpio29", "gpio32", "gpio33", 954 + "gpio36", "gpio37", "gpio48", "gpio49", 955 + }; 956 + 957 + static const char *const jitter_bist_groups[] = { 958 + "gpio73", 959 + }; 960 + 961 + static const char *const mdp_esync0_out_groups[] = { 962 + "gpio88", 963 + }; 964 + 965 + static const char *const mdp_esync1_out_groups[] = { 966 + "gpio100", 967 + }; 968 + 969 + static const char *const mdp_vsync_groups[] = { 970 + "gpio86", "gpio87", "gpio97", "gpio98", 971 + }; 972 + 973 + static const char *const mdp_vsync0_out_groups[] = { 974 + "gpio86", 975 + }; 976 + 977 + static const char *const mdp_vsync1_out_groups[] = { 978 + "gpio86", 979 + }; 980 + 981 + static const char *const mdp_vsync2_out_groups[] = { 982 + "gpio87", 983 + }; 984 + 985 + static const char *const mdp_vsync3_out_groups[] = { 986 + "gpio87", 987 + }; 988 + 989 + static const char *const mdp_vsync5_out_groups[] = { 990 + "gpio87", 991 + }; 992 + 993 + static const char *const mdp_vsync_e_groups[] = { 994 + "gpio88", 995 + }; 996 + 997 + static const char *const nav_gpio0_groups[] = { 998 + "gpio154", 999 + }; 1000 + 1001 + static const char *const nav_gpio1_groups[] = { 1002 + "gpio155", 1003 + }; 1004 + 1005 + static const char *const nav_gpio2_groups[] = { 1006 + "gpio152", 1007 + }; 1008 + 1009 + static const char *const nav_gpio3_groups[] = { 1010 + "gpio154", 1011 + }; 1012 + 1013 + static const char *const pcie0_clk_req_n_groups[] = { 1014 + "gpio103", 1015 + }; 1016 + 1017 + static const char *const phase_flag_groups[] = { 1018 + "gpio10", "gpio11", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", 1019 + "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", 1020 + "gpio26", "gpio27", "gpio28", "gpio29", "gpio31", "gpio64", "gpio65", 1021 + "gpio66", "gpio67", "gpio68", "gpio69", "gpio82", "gpio83", "gpio85", 1022 + "gpio101", "gpio102", "gpio103", "gpio104", 1023 + }; 1024 + 1025 + static const char *const pll_bist_sync_groups[] = { 1026 + "gpio104", 1027 + }; 1028 + 1029 + static const char *const pll_clk_aux_groups[] = { 1030 + "gpio95", 1031 + }; 1032 + 1033 + static const char *const prng_rosc0_groups[] = { 1034 + "gpio85", 1035 + }; 1036 + 1037 + static const char *const prng_rosc1_groups[] = { 1038 + "gpio64", 1039 + }; 1040 + 1041 + static const char *const prng_rosc2_groups[] = { 1042 + "gpio65", 1043 + }; 1044 + 1045 + static const char *const prng_rosc3_groups[] = { 1046 + "gpio66", 1047 + }; 1048 + 1049 + static const char *const qdss_cti_groups[] = { 1050 + "gpio27", "gpio31", "gpio72", "gpio73", "gpio82", "gpio83", "gpio159", 1051 + "gpio162", 1052 + }; 1053 + 1054 + static const char *const qlink_big_enable_groups[] = { 1055 + "gpio160", 1056 + }; 1057 + 1058 + static const char *const qlink_big_request_groups[] = { 1059 + "gpio159", 1060 + }; 1061 + 1062 + static const char *const qlink_little_enable_groups[] = { 1063 + "gpio157", 1064 + }; 1065 + 1066 + static const char *const qlink_little_request_groups[] = { 1067 + "gpio156", 1068 + }; 1069 + 1070 + static const char *const qlink_wmss_groups[] = { 1071 + "gpio158", 1072 + }; 1073 + 1074 + static const char *const qspi0_groups[] = { 1075 + "gpio52", 1076 + }; 1077 + 1078 + static const char *const qspi1_groups[] = { 1079 + "gpio53", 1080 + }; 1081 + 1082 + static const char *const qspi2_groups[] = { 1083 + "gpio55", 1084 + }; 1085 + 1086 + static const char *const qspi3_groups[] = { 1087 + "gpio56", 1088 + }; 1089 + 1090 + static const char *const qspi_clk_groups[] = { 1091 + "gpio54", 1092 + }; 1093 + 1094 + static const char *const qspi_cs_groups[] = { 1095 + "gpio57", "gpio58", 1096 + }; 1097 + 1098 + static const char *const qup1_se0_groups[] = { 1099 + "gpio32", "gpio33", "gpio34", "gpio35", 1100 + }; 1101 + 1102 + static const char *const qup1_se1_groups[] = { 1103 + "gpio36", "gpio37", "gpio38", "gpio39", 1104 + }; 1105 + 1106 + static const char *const qup1_se2_groups[] = { 1107 + "gpio40", "gpio41", "gpio42", "gpio43", "gpio134", "gpio135", "gpio136", 1108 + }; 1109 + 1110 + static const char *const qup1_se3_groups[] = { 1111 + "gpio44", "gpio45", "gpio46", "gpio47", 1112 + }; 1113 + 1114 + static const char *const qup1_se4_groups[] = { 1115 + "gpio48", "gpio49", "gpio50", "gpio51", 1116 + }; 1117 + 1118 + static const char *const qup1_se5_groups[] = { 1119 + "gpio52", "gpio53", "gpio54", "gpio55", 1120 + }; 1121 + 1122 + static const char *const qup1_se6_groups[] = { 1123 + "gpio56", "gpio57", "gpio58", "gpio59", 1124 + }; 1125 + 1126 + static const char *const qup1_se7_groups[] = { 1127 + "gpio60", "gpio61", "gpio62", "gpio63", 1128 + }; 1129 + 1130 + static const char *const qup2_se0_groups[] = { 1131 + "gpio0", "gpio1", "gpio2", "gpio3", 1132 + }; 1133 + 1134 + static const char *const qup2_se1_groups[] = { 1135 + "gpio4", "gpio5", "gpio6", "gpio7", 1136 + }; 1137 + 1138 + static const char *const qup2_se2_groups[] = { 1139 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio15", 1140 + }; 1141 + 1142 + static const char *const qup2_se3_groups[] = { 1143 + "gpio12", "gpio13", "gpio14", "gpio15", 1144 + }; 1145 + 1146 + static const char *const qup2_se4_groups[] = { 1147 + "gpio16", "gpio17", "gpio18", "gpio19", 1148 + }; 1149 + 1150 + static const char *const qup2_se5_groups[] = { 1151 + "gpio20", "gpio21", "gpio22", "gpio23", 1152 + }; 1153 + 1154 + static const char *const qup2_se6_groups[] = { 1155 + "gpio24", "gpio25", "gpio26", "gpio27", 1156 + }; 1157 + 1158 + static const char *const qup2_se7_groups[] = { 1159 + "gpio28", "gpio29", "gpio30", "gpio31", 1160 + }; 1161 + 1162 + static const char *const sd_write_protect_groups[] = { 1163 + "gpio85", 1164 + }; 1165 + 1166 + static const char *const sdc40_groups[] = { 1167 + "gpio36", "gpio49", 1168 + }; 1169 + 1170 + static const char *const sdc41_groups[] = { 1171 + "gpio37", "gpio51", 1172 + }; 1173 + 1174 + static const char *const sdc42_groups[] = { 1175 + "gpio38", "gpio60", 1176 + }; 1177 + 1178 + static const char *const sdc43_groups[] = { 1179 + "gpio39", "gpio61", 1180 + }; 1181 + 1182 + static const char *const sdc4_clk_groups[] = { 1183 + "gpio50", "gpio150", 1184 + }; 1185 + 1186 + static const char *const sdc4_cmd_groups[] = { 1187 + "gpio48", "gpio151", 1188 + }; 1189 + 1190 + static const char *const tb_trig_sdc2_groups[] = { 1191 + "gpio89", 1192 + }; 1193 + 1194 + static const char *const tb_trig_sdc4_groups[] = { 1195 + "gpio147", 1196 + }; 1197 + 1198 + static const char *const tmess_prng0_groups[] = { 1199 + "gpio85", 1200 + }; 1201 + 1202 + static const char *const tmess_prng1_groups[] = { 1203 + "gpio64", 1204 + }; 1205 + 1206 + static const char *const tmess_prng2_groups[] = { 1207 + "gpio65", 1208 + }; 1209 + 1210 + static const char *const tmess_prng3_groups[] = { 1211 + "gpio66", 1212 + }; 1213 + 1214 + static const char *const tsense_pwm1_groups[] = { 1215 + "gpio57", 1216 + }; 1217 + 1218 + static const char *const tsense_pwm2_groups[] = { 1219 + "gpio57", 1220 + }; 1221 + 1222 + static const char *const tsense_pwm3_groups[] = { 1223 + "gpio57", 1224 + }; 1225 + 1226 + static const char *const tsense_pwm4_groups[] = { 1227 + "gpio57", 1228 + }; 1229 + 1230 + static const char *const uim0_clk_groups[] = { 1231 + "gpio131", 1232 + }; 1233 + 1234 + static const char *const uim0_data_groups[] = { 1235 + "gpio130", 1236 + }; 1237 + 1238 + static const char *const uim0_present_groups[] = { 1239 + "gpio133", 1240 + }; 1241 + 1242 + static const char *const uim0_reset_groups[] = { 1243 + "gpio132", 1244 + }; 1245 + 1246 + static const char *const uim1_clk_groups[] = { 1247 + "gpio37", "gpio55", "gpio71", "gpio135", 1248 + }; 1249 + 1250 + static const char *const uim1_data_groups[] = { 1251 + "gpio134", "gpio36", "gpio54", "gpio70", 1252 + }; 1253 + 1254 + static const char *const uim1_present_groups[] = { 1255 + "gpio137", 1256 + }; 1257 + 1258 + static const char *const uim1_reset_groups[] = { 1259 + "gpio39", "gpio56", "gpio72", "gpio136", 1260 + }; 1261 + 1262 + static const char *const usb1_hs_groups[] = { 1263 + "gpio79", 1264 + }; 1265 + 1266 + static const char *const usb_phy_groups[] = { 1267 + "gpio59", "gpio61", 1268 + }; 1269 + 1270 + static const char *const vfr_0_groups[] = { 1271 + "gpio150", 1272 + }; 1273 + 1274 + static const char *const vfr_1_groups[] = { 1275 + "gpio155", 1276 + }; 1277 + 1278 + static const char *const vsense_trigger_mirnat_groups[] = { 1279 + "gpio59", 1280 + }; 1281 + 1282 + static const char *const wcn_sw_groups[] = { 1283 + "gpio19", 1284 + }; 1285 + 1286 + static const char *const wcn_sw_ctrl_groups[] = { 1287 + "gpio18", 1288 + }; 1289 + 1290 + static const struct pinfunction sm8750_functions[] = { 1291 + MSM_PIN_FUNCTION(gpio), 1292 + MSM_PIN_FUNCTION(aoss_cti), 1293 + MSM_PIN_FUNCTION(atest_char), 1294 + MSM_PIN_FUNCTION(atest_usb), 1295 + MSM_PIN_FUNCTION(audio_ext_mclk0), 1296 + MSM_PIN_FUNCTION(audio_ext_mclk1), 1297 + MSM_PIN_FUNCTION(audio_ref_clk), 1298 + MSM_PIN_FUNCTION(cam_aon_mclk2), 1299 + MSM_PIN_FUNCTION(cam_aon_mclk4), 1300 + MSM_PIN_FUNCTION(cam_mclk), 1301 + MSM_PIN_FUNCTION(cci_async_in), 1302 + MSM_PIN_FUNCTION(cci_i2c_scl), 1303 + MSM_PIN_FUNCTION(cci_i2c_sda), 1304 + MSM_PIN_FUNCTION(cci_timer), 1305 + MSM_PIN_FUNCTION(cmu_rng), 1306 + MSM_PIN_FUNCTION(coex_uart1_rx), 1307 + MSM_PIN_FUNCTION(coex_uart1_tx), 1308 + MSM_PIN_FUNCTION(coex_uart2_rx), 1309 + MSM_PIN_FUNCTION(coex_uart2_tx), 1310 + MSM_PIN_FUNCTION(dbg_out_clk), 1311 + MSM_PIN_FUNCTION(ddr_bist_complete), 1312 + MSM_PIN_FUNCTION(ddr_bist_fail), 1313 + MSM_PIN_FUNCTION(ddr_bist_start), 1314 + MSM_PIN_FUNCTION(ddr_bist_stop), 1315 + MSM_PIN_FUNCTION(ddr_pxi0), 1316 + MSM_PIN_FUNCTION(ddr_pxi1), 1317 + MSM_PIN_FUNCTION(ddr_pxi2), 1318 + MSM_PIN_FUNCTION(ddr_pxi3), 1319 + MSM_PIN_FUNCTION(dp_hot), 1320 + MSM_PIN_FUNCTION(egpio), 1321 + MSM_PIN_FUNCTION(gcc_gp1), 1322 + MSM_PIN_FUNCTION(gcc_gp2), 1323 + MSM_PIN_FUNCTION(gcc_gp3), 1324 + MSM_PIN_FUNCTION(gnss_adc0), 1325 + MSM_PIN_FUNCTION(gnss_adc1), 1326 + MSM_PIN_FUNCTION(i2chub0_se0), 1327 + MSM_PIN_FUNCTION(i2chub0_se1), 1328 + MSM_PIN_FUNCTION(i2chub0_se2), 1329 + MSM_PIN_FUNCTION(i2chub0_se3), 1330 + MSM_PIN_FUNCTION(i2chub0_se4), 1331 + MSM_PIN_FUNCTION(i2chub0_se5), 1332 + MSM_PIN_FUNCTION(i2chub0_se6), 1333 + MSM_PIN_FUNCTION(i2chub0_se7), 1334 + MSM_PIN_FUNCTION(i2chub0_se8), 1335 + MSM_PIN_FUNCTION(i2chub0_se9), 1336 + MSM_PIN_FUNCTION(i2s0_data0), 1337 + MSM_PIN_FUNCTION(i2s0_data1), 1338 + MSM_PIN_FUNCTION(i2s0_sck), 1339 + MSM_PIN_FUNCTION(i2s0_ws), 1340 + MSM_PIN_FUNCTION(i2s1_data0), 1341 + MSM_PIN_FUNCTION(i2s1_data1), 1342 + MSM_PIN_FUNCTION(i2s1_sck), 1343 + MSM_PIN_FUNCTION(i2s1_ws), 1344 + MSM_PIN_FUNCTION(ibi_i3c), 1345 + MSM_PIN_FUNCTION(jitter_bist), 1346 + MSM_PIN_FUNCTION(mdp_esync0_out), 1347 + MSM_PIN_FUNCTION(mdp_esync1_out), 1348 + MSM_PIN_FUNCTION(mdp_vsync), 1349 + MSM_PIN_FUNCTION(mdp_vsync0_out), 1350 + MSM_PIN_FUNCTION(mdp_vsync1_out), 1351 + MSM_PIN_FUNCTION(mdp_vsync2_out), 1352 + MSM_PIN_FUNCTION(mdp_vsync3_out), 1353 + MSM_PIN_FUNCTION(mdp_vsync5_out), 1354 + MSM_PIN_FUNCTION(mdp_vsync_e), 1355 + MSM_PIN_FUNCTION(nav_gpio0), 1356 + MSM_PIN_FUNCTION(nav_gpio1), 1357 + MSM_PIN_FUNCTION(nav_gpio2), 1358 + MSM_PIN_FUNCTION(nav_gpio3), 1359 + MSM_PIN_FUNCTION(pcie0_clk_req_n), 1360 + MSM_PIN_FUNCTION(phase_flag), 1361 + MSM_PIN_FUNCTION(pll_bist_sync), 1362 + MSM_PIN_FUNCTION(pll_clk_aux), 1363 + MSM_PIN_FUNCTION(prng_rosc0), 1364 + MSM_PIN_FUNCTION(prng_rosc1), 1365 + MSM_PIN_FUNCTION(prng_rosc2), 1366 + MSM_PIN_FUNCTION(prng_rosc3), 1367 + MSM_PIN_FUNCTION(qdss_cti), 1368 + MSM_PIN_FUNCTION(qlink_big_enable), 1369 + MSM_PIN_FUNCTION(qlink_big_request), 1370 + MSM_PIN_FUNCTION(qlink_little_enable), 1371 + MSM_PIN_FUNCTION(qlink_little_request), 1372 + MSM_PIN_FUNCTION(qlink_wmss), 1373 + MSM_PIN_FUNCTION(qspi0), 1374 + MSM_PIN_FUNCTION(qspi1), 1375 + MSM_PIN_FUNCTION(qspi2), 1376 + MSM_PIN_FUNCTION(qspi3), 1377 + MSM_PIN_FUNCTION(qspi_clk), 1378 + MSM_PIN_FUNCTION(qspi_cs), 1379 + MSM_PIN_FUNCTION(qup1_se0), 1380 + MSM_PIN_FUNCTION(qup1_se1), 1381 + MSM_PIN_FUNCTION(qup1_se2), 1382 + MSM_PIN_FUNCTION(qup1_se3), 1383 + MSM_PIN_FUNCTION(qup1_se4), 1384 + MSM_PIN_FUNCTION(qup1_se5), 1385 + MSM_PIN_FUNCTION(qup1_se6), 1386 + MSM_PIN_FUNCTION(qup1_se7), 1387 + MSM_PIN_FUNCTION(qup2_se0), 1388 + MSM_PIN_FUNCTION(qup2_se1), 1389 + MSM_PIN_FUNCTION(qup2_se2), 1390 + MSM_PIN_FUNCTION(qup2_se3), 1391 + MSM_PIN_FUNCTION(qup2_se4), 1392 + MSM_PIN_FUNCTION(qup2_se5), 1393 + MSM_PIN_FUNCTION(qup2_se6), 1394 + MSM_PIN_FUNCTION(qup2_se7), 1395 + MSM_PIN_FUNCTION(sd_write_protect), 1396 + MSM_PIN_FUNCTION(sdc40), 1397 + MSM_PIN_FUNCTION(sdc41), 1398 + MSM_PIN_FUNCTION(sdc42), 1399 + MSM_PIN_FUNCTION(sdc43), 1400 + MSM_PIN_FUNCTION(sdc4_clk), 1401 + MSM_PIN_FUNCTION(sdc4_cmd), 1402 + MSM_PIN_FUNCTION(tb_trig_sdc2), 1403 + MSM_PIN_FUNCTION(tb_trig_sdc4), 1404 + MSM_PIN_FUNCTION(tmess_prng0), 1405 + MSM_PIN_FUNCTION(tmess_prng1), 1406 + MSM_PIN_FUNCTION(tmess_prng2), 1407 + MSM_PIN_FUNCTION(tmess_prng3), 1408 + MSM_PIN_FUNCTION(tsense_pwm1), 1409 + MSM_PIN_FUNCTION(tsense_pwm2), 1410 + MSM_PIN_FUNCTION(tsense_pwm3), 1411 + MSM_PIN_FUNCTION(tsense_pwm4), 1412 + MSM_PIN_FUNCTION(uim0_clk), 1413 + MSM_PIN_FUNCTION(uim0_data), 1414 + MSM_PIN_FUNCTION(uim0_present), 1415 + MSM_PIN_FUNCTION(uim0_reset), 1416 + MSM_PIN_FUNCTION(uim1_clk), 1417 + MSM_PIN_FUNCTION(uim1_data), 1418 + MSM_PIN_FUNCTION(uim1_present), 1419 + MSM_PIN_FUNCTION(uim1_reset), 1420 + MSM_PIN_FUNCTION(usb1_hs), 1421 + MSM_PIN_FUNCTION(usb_phy), 1422 + MSM_PIN_FUNCTION(vfr_0), 1423 + MSM_PIN_FUNCTION(vfr_1), 1424 + MSM_PIN_FUNCTION(vsense_trigger_mirnat), 1425 + MSM_PIN_FUNCTION(wcn_sw), 1426 + MSM_PIN_FUNCTION(wcn_sw_ctrl), 1427 + }; 1428 + 1429 + /* 1430 + * Every pin is maintained as a single group, and missing or non-existing pin 1431 + * would be maintained as dummy group to synchronize pin group index with 1432 + * pin descriptor registered with pinctrl core. 1433 + * Clients would not be able to request these dummy pin groups. 1434 + */ 1435 + static const struct msm_pingroup sm8750_groups[] = { 1436 + [0] = PINGROUP(0, qup2_se0, ibi_i3c, _, _, _, _, _, _, _, _, egpio), 1437 + [1] = PINGROUP(1, qup2_se0, ibi_i3c, _, _, _, _, _, _, _, _, egpio), 1438 + [2] = PINGROUP(2, qup2_se0, _, _, _, _, _, _, _, _, _, egpio), 1439 + [3] = PINGROUP(3, qup2_se0, _, _, _, _, _, _, _, _, _, egpio), 1440 + [4] = PINGROUP(4, qup2_se1, ibi_i3c, _, _, _, _, _, _, _, _, egpio), 1441 + [5] = PINGROUP(5, qup2_se1, ibi_i3c, _, _, _, _, _, _, _, _, egpio), 1442 + [6] = PINGROUP(6, qup2_se1, _, _, _, _, _, _, _, _, _, egpio), 1443 + [7] = PINGROUP(7, qup2_se1, _, _, _, _, _, _, _, _, _, egpio), 1444 + [8] = PINGROUP(8, qup2_se2, ibi_i3c, _, _, _, _, _, _, _, _, _), 1445 + [9] = PINGROUP(9, qup2_se2, ibi_i3c, _, _, _, _, _, _, _, _, _), 1446 + [10] = PINGROUP(10, qup2_se2, cci_async_in, phase_flag, _, _, _, _, _, _, _, _), 1447 + [11] = PINGROUP(11, qup2_se2, cci_async_in, phase_flag, _, _, _, _, _, _, _, _), 1448 + [12] = PINGROUP(12, qup2_se3, ibi_i3c, qup2_se2, _, _, _, _, _, _, _, _), 1449 + [13] = PINGROUP(13, qup2_se3, ibi_i3c, qup2_se2, _, _, _, _, _, _, _, _), 1450 + [14] = PINGROUP(14, qup2_se3, phase_flag, _, _, _, _, _, _, _, _, _), 1451 + [15] = PINGROUP(15, qup2_se3, cci_async_in, qup2_se2, phase_flag, _, _, _, _, _, _, _), 1452 + [16] = PINGROUP(16, qup2_se4, phase_flag, _, _, _, _, _, _, _, _, _), 1453 + [17] = PINGROUP(17, qup2_se4, phase_flag, _, _, _, _, _, _, _, _, _), 1454 + [18] = PINGROUP(18, wcn_sw_ctrl, qup2_se4, phase_flag, _, _, _, _, _, _, _, _), 1455 + [19] = PINGROUP(19, wcn_sw, qup2_se4, phase_flag, _, _, _, _, _, _, _, _), 1456 + [20] = PINGROUP(20, qup2_se5, phase_flag, _, _, _, _, _, _, _, _, _), 1457 + [21] = PINGROUP(21, qup2_se5, phase_flag, _, _, _, _, _, _, _, _, _), 1458 + [22] = PINGROUP(22, qup2_se5, phase_flag, _, _, _, _, _, _, _, _, _), 1459 + [23] = PINGROUP(23, qup2_se5, qup2_se5, phase_flag, _, _, _, _, _, _, _, _), 1460 + [24] = PINGROUP(24, qup2_se6, phase_flag, _, _, _, _, _, _, _, _, _), 1461 + [25] = PINGROUP(25, qup2_se6, phase_flag, _, _, _, _, _, _, _, _, _), 1462 + [26] = PINGROUP(26, qup2_se6, phase_flag, _, _, _, _, _, _, _, _, _), 1463 + [27] = PINGROUP(27, qup2_se6, qdss_cti, phase_flag, _, _, _, _, _, _, _, _), 1464 + [28] = PINGROUP(28, qup2_se7, ibi_i3c, phase_flag, _, _, _, _, _, _, _, _), 1465 + [29] = PINGROUP(29, qup2_se7, ibi_i3c, phase_flag, _, _, _, _, _, _, _, _), 1466 + [30] = PINGROUP(30, qup2_se7, _, _, _, _, _, _, _, _, _, _), 1467 + [31] = PINGROUP(31, qup2_se7, qdss_cti, phase_flag, _, _, _, _, _, _, _, _), 1468 + [32] = PINGROUP(32, qup1_se0, ibi_i3c, _, _, _, _, _, _, _, _, egpio), 1469 + [33] = PINGROUP(33, qup1_se0, ibi_i3c, _, _, _, _, _, _, _, _, egpio), 1470 + [34] = PINGROUP(34, qup1_se0, _, _, _, _, _, _, _, _, _, egpio), 1471 + [35] = PINGROUP(35, qup1_se0, _, _, _, _, _, _, _, _, _, egpio), 1472 + [36] = PINGROUP(36, qup1_se1, uim1_data, ibi_i3c, sdc40, _, _, _, _, _, _, egpio), 1473 + [37] = PINGROUP(37, qup1_se1, uim1_clk, ibi_i3c, sdc41, _, _, _, _, _, _, egpio), 1474 + [38] = PINGROUP(38, qup1_se1, sdc42, _, _, _, _, _, _, _, _, _), 1475 + [39] = PINGROUP(39, qup1_se1, uim1_reset, sdc43, _, _, _, _, _, _, _, _), 1476 + [40] = PINGROUP(40, qup1_se2, cmu_rng, ddr_bist_fail, _, _, _, _, _, _, _, _), 1477 + [41] = PINGROUP(41, qup1_se2, cmu_rng, ddr_bist_start, _, _, _, _, _, _, _, _), 1478 + [42] = PINGROUP(42, qup1_se2, cmu_rng, _, _, _, _, _, _, _, _, _), 1479 + [43] = PINGROUP(43, qup1_se2, cmu_rng, _, ddr_pxi2, _, _, _, _, _, _, _), 1480 + [44] = PINGROUP(44, qup1_se3, ddr_bist_complete, ddr_pxi1, _, _, _, _, _, _, _, _), 1481 + [45] = PINGROUP(45, qup1_se3, ddr_bist_stop, ddr_pxi1, _, _, _, _, _, _, _, _), 1482 + [46] = PINGROUP(46, qup1_se3, ddr_pxi3, _, _, _, _, _, _, _, _, _), 1483 + [47] = PINGROUP(47, qup1_se3, dp_hot, _, _, _, _, _, _, _, _, _), 1484 + [48] = PINGROUP(48, qup1_se4, ibi_i3c, sdc4_cmd, _, _, _, _, _, _, _, _), 1485 + [49] = PINGROUP(49, qup1_se4, ibi_i3c, sdc40, _, _, _, _, _, _, _, _), 1486 + [50] = PINGROUP(50, qup1_se4, aoss_cti, sdc4_clk, _, _, _, _, _, _, _, _), 1487 + [51] = PINGROUP(51, qup1_se4, aoss_cti, sdc41, _, _, _, _, _, _, _, _), 1488 + [52] = PINGROUP(52, qup1_se5, qspi0, ddr_pxi2, _, _, _, _, _, _, _, _), 1489 + [53] = PINGROUP(53, qup1_se5, qspi1, _, ddr_pxi3, _, _, _, _, _, _, _), 1490 + [54] = PINGROUP(54, qup1_se5, qspi_clk, uim1_data, ddr_pxi0, _, _, _, _, _, _, _), 1491 + [55] = PINGROUP(55, qup1_se5, qspi2, uim1_clk, ddr_pxi0, _, _, _, _, _, _, _), 1492 + [56] = PINGROUP(56, qup1_se6, qspi3, uim1_reset, _, _, _, _, _, _, _, _), 1493 + [57] = PINGROUP(57, qup1_se6, qspi_cs, tsense_pwm1, tsense_pwm2, tsense_pwm3, tsense_pwm4, 1494 + _, _, _, _, _), 1495 + [58] = PINGROUP(58, qup1_se6, qspi_cs, _, _, _, _, _, _, _, _, _), 1496 + [59] = PINGROUP(59, qup1_se6, usb_phy, vsense_trigger_mirnat, _, _, _, _, _, _, _, _), 1497 + [60] = PINGROUP(60, qup1_se7, aoss_cti, sdc42, _, _, _, _, _, _, _, _), 1498 + [61] = PINGROUP(61, qup1_se7, usb_phy, aoss_cti, sdc43, _, _, _, _, _, _, _), 1499 + [62] = PINGROUP(62, qup1_se7, _, _, _, _, _, _, _, _, _, _), 1500 + [63] = PINGROUP(63, qup1_se7, _, _, _, _, _, _, _, _, _, _), 1501 + [64] = PINGROUP(64, i2chub0_se0, prng_rosc1, tmess_prng1, phase_flag, _, _, _, _, _, _, _), 1502 + [65] = PINGROUP(65, i2chub0_se0, prng_rosc2, tmess_prng2, phase_flag, _, _, _, _, _, _, _), 1503 + [66] = PINGROUP(66, i2chub0_se1, prng_rosc3, tmess_prng3, phase_flag, _, _, _, _, _, _, _), 1504 + [67] = PINGROUP(67, i2chub0_se1, phase_flag, _, _, _, _, _, _, _, _, _), 1505 + [68] = PINGROUP(68, i2chub0_se2, phase_flag, _, _, _, _, _, _, _, _, _), 1506 + [69] = PINGROUP(69, i2chub0_se2, phase_flag, _, _, _, _, _, _, _, _, _), 1507 + [70] = PINGROUP(70, i2chub0_se3, uim1_data, _, atest_usb, _, _, _, _, _, _, _), 1508 + [71] = PINGROUP(71, i2chub0_se3, uim1_clk, _, atest_usb, _, _, _, _, _, _, _), 1509 + [72] = PINGROUP(72, i2chub0_se4, uim1_reset, qdss_cti, _, atest_usb, _, _, _, _, _, _), 1510 + [73] = PINGROUP(73, i2chub0_se4, qdss_cti, jitter_bist, atest_usb, _, _, _, _, _, _, _), 1511 + [74] = PINGROUP(74, i2chub0_se5, _, _, _, _, _, _, _, _, _, _), 1512 + [75] = PINGROUP(75, i2chub0_se5, _, _, _, _, _, _, _, _, _, _), 1513 + [76] = PINGROUP(76, i2chub0_se6, atest_usb, _, _, _, _, _, _, _, _, _), 1514 + [77] = PINGROUP(77, i2chub0_se6, gnss_adc1, _, _, _, _, _, _, _, _, _), 1515 + [78] = PINGROUP(78, dbg_out_clk, gnss_adc0, _, _, _, _, _, _, _, _, _), 1516 + [79] = PINGROUP(79, usb1_hs, gnss_adc0, _, _, _, _, _, _, _, _, _), 1517 + [80] = PINGROUP(80, i2chub0_se9, _, _, _, _, _, _, _, _, _, _), 1518 + [81] = PINGROUP(81, i2chub0_se9, _, _, _, _, _, _, _, _, _, _), 1519 + [82] = PINGROUP(82, i2chub0_se7, qdss_cti, phase_flag, _, _, _, _, _, _, _, _), 1520 + [83] = PINGROUP(83, i2chub0_se7, qdss_cti, phase_flag, _, _, _, _, _, _, _, _), 1521 + [84] = PINGROUP(84, _, _, _, _, _, _, _, _, _, _, _), 1522 + [85] = PINGROUP(85, sd_write_protect, prng_rosc0, tmess_prng0, phase_flag, _, _, _, _, _, 1523 + _, _), 1524 + [86] = PINGROUP(86, mdp_vsync, mdp_vsync0_out, mdp_vsync1_out, gcc_gp1, _, _, _, _, _, _, 1525 + _), 1526 + [87] = PINGROUP(87, mdp_vsync, mdp_vsync2_out, mdp_vsync3_out, mdp_vsync5_out, gcc_gp2, _, 1527 + _, _, _, _, _), 1528 + [88] = PINGROUP(88, mdp_vsync_e, mdp_esync0_out, gcc_gp3, _, _, _, _, _, _, _, _), 1529 + [89] = PINGROUP(89, cam_mclk, tb_trig_sdc2, _, _, _, _, _, _, _, _, _), 1530 + [90] = PINGROUP(90, cam_mclk, _, _, _, _, _, _, _, _, _, _), 1531 + [91] = PINGROUP(91, cam_aon_mclk2, _, _, _, _, _, _, _, _, _, _), 1532 + [92] = PINGROUP(92, cam_mclk, _, _, _, _, _, _, _, _, _, _), 1533 + [93] = PINGROUP(93, cam_aon_mclk4, _, _, _, _, _, _, _, _, _, _), 1534 + [94] = PINGROUP(94, cam_mclk, _, _, _, _, _, _, _, _, _, _), 1535 + [95] = PINGROUP(95, cam_mclk, pll_clk_aux, _, _, _, _, _, _, _, _, _), 1536 + [96] = PINGROUP(96, cam_mclk, _, _, _, _, _, _, _, _, _, _), 1537 + [97] = PINGROUP(97, mdp_vsync, _, _, _, _, _, _, _, _, _, _), 1538 + [98] = PINGROUP(98, mdp_vsync, _, _, _, _, _, _, _, _, _, _), 1539 + [99] = PINGROUP(99, gnss_adc1, _, _, _, _, _, _, _, _, _, _), 1540 + [100] = PINGROUP(100, mdp_esync1_out, _, _, _, _, _, _, _, _, _, _), 1541 + [101] = PINGROUP(101, phase_flag, _, _, _, _, _, _, _, _, _, _), 1542 + [102] = PINGROUP(102, phase_flag, _, _, _, _, _, _, _, _, _, _), 1543 + [103] = PINGROUP(103, pcie0_clk_req_n, phase_flag, _, _, _, _, _, _, _, _, _), 1544 + [104] = PINGROUP(104, pll_bist_sync, phase_flag, _, _, _, _, _, _, _, _, _), 1545 + [105] = PINGROUP(105, _, _, _, _, _, _, _, _, _, _, egpio), 1546 + [106] = PINGROUP(106, _, _, _, _, _, _, _, _, _, _, egpio), 1547 + [107] = PINGROUP(107, _, _, _, _, _, _, _, _, _, _, egpio), 1548 + [108] = PINGROUP(108, _, _, _, _, _, _, _, _, _, _, egpio), 1549 + [109] = PINGROUP(109, cci_timer, _, _, _, _, _, _, _, _, _, _), 1550 + [110] = PINGROUP(110, cci_timer, _, _, _, _, _, _, _, _, _, _), 1551 + [111] = PINGROUP(111, cci_timer, cci_i2c_sda, _, _, _, _, _, _, _, _, _), 1552 + [112] = PINGROUP(112, cci_i2c_sda, _, _, _, _, _, _, _, _, _, _), 1553 + [113] = PINGROUP(113, cci_i2c_sda, _, _, _, _, _, _, _, _, _, _), 1554 + [114] = PINGROUP(114, cci_i2c_scl, _, _, _, _, _, _, _, _, _, _), 1555 + [115] = PINGROUP(115, cci_i2c_sda, _, _, _, _, _, _, _, _, _, _), 1556 + [116] = PINGROUP(116, cci_i2c_scl, _, _, _, _, _, _, _, _, _, _), 1557 + [117] = PINGROUP(117, cci_i2c_sda, _, _, _, _, _, _, _, _, _, _), 1558 + [118] = PINGROUP(118, cci_i2c_scl, _, _, _, _, _, _, _, _, _, _), 1559 + [119] = PINGROUP(119, cci_i2c_sda, _, _, _, _, _, _, _, _, _, _), 1560 + [120] = PINGROUP(120, cci_i2c_scl, _, _, _, _, _, _, _, _, _, _), 1561 + [121] = PINGROUP(121, i2s1_sck, _, _, _, _, _, _, _, _, _, _), 1562 + [122] = PINGROUP(122, i2s1_data0, _, _, _, _, _, _, _, _, _, _), 1563 + [123] = PINGROUP(123, i2s1_ws, _, _, _, _, _, _, _, _, _, _), 1564 + [124] = PINGROUP(124, i2s1_data1, audio_ext_mclk1, audio_ref_clk, _, _, _, _, _, _, _, _), 1565 + [125] = PINGROUP(125, audio_ext_mclk0, _, _, _, _, _, _, _, _, _, _), 1566 + [126] = PINGROUP(126, i2s0_sck, _, _, _, _, _, _, _, _, _, _), 1567 + [127] = PINGROUP(127, i2s0_data0, _, _, _, _, _, _, _, _, _, _), 1568 + [128] = PINGROUP(128, i2s0_data1, _, _, _, _, _, _, _, _, _, _), 1569 + [129] = PINGROUP(129, i2s0_ws, _, _, _, _, _, _, _, _, _, _), 1570 + [130] = PINGROUP(130, uim0_data, atest_char, _, _, _, _, _, _, _, _, _), 1571 + [131] = PINGROUP(131, uim0_clk, atest_char, _, _, _, _, _, _, _, _, _), 1572 + [132] = PINGROUP(132, uim0_reset, atest_char, _, _, _, _, _, _, _, _, _), 1573 + [133] = PINGROUP(133, uim0_present, atest_char, _, _, _, _, _, _, _, _, _), 1574 + [134] = PINGROUP(134, uim1_data, qup1_se2, gcc_gp1, _, _, _, _, _, _, _, _), 1575 + [135] = PINGROUP(135, uim1_clk, qup1_se2, gcc_gp2, _, _, _, _, _, _, _, _), 1576 + [136] = PINGROUP(136, uim1_reset, qup1_se2, gcc_gp3, _, _, _, _, _, _, _, _), 1577 + [137] = PINGROUP(137, uim1_present, atest_char, _, _, _, _, _, _, _, _, _), 1578 + [138] = PINGROUP(138, _, _, _, _, _, _, _, _, _, _, _), 1579 + [139] = PINGROUP(139, _, _, _, _, _, _, _, _, _, _, _), 1580 + [140] = PINGROUP(140, _, _, _, _, _, _, _, _, _, _, _), 1581 + [141] = PINGROUP(141, _, _, _, _, _, _, _, _, _, _, _), 1582 + [142] = PINGROUP(142, _, _, _, _, _, _, _, _, _, _, _), 1583 + [143] = PINGROUP(143, _, _, _, _, _, _, _, _, _, _, _), 1584 + [144] = PINGROUP(144, _, _, _, _, _, _, _, _, _, _, _), 1585 + [145] = PINGROUP(145, _, _, _, _, _, _, _, _, _, _, _), 1586 + [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _, _, _), 1587 + [147] = PINGROUP(147, _, tb_trig_sdc4, _, _, _, _, _, _, _, _, _), 1588 + [148] = PINGROUP(148, coex_uart1_rx, cmu_rng, _, _, _, _, _, _, _, _, _), 1589 + [149] = PINGROUP(149, coex_uart1_tx, cmu_rng, _, _, _, _, _, _, _, _, _), 1590 + [150] = PINGROUP(150, _, vfr_0, coex_uart2_rx, cmu_rng, sdc4_clk, _, _, _, _, _, _), 1591 + [151] = PINGROUP(151, _, coex_uart2_tx, cmu_rng, sdc4_cmd, _, _, _, _, _, _, _), 1592 + [152] = PINGROUP(152, nav_gpio2, _, _, _, _, _, _, _, _, _, _), 1593 + [153] = PINGROUP(153, cci_i2c_scl, _, _, _, _, _, _, _, _, _, _), 1594 + [154] = PINGROUP(154, nav_gpio0, nav_gpio3, _, _, _, _, _, _, _, _, _), 1595 + [155] = PINGROUP(155, nav_gpio1, vfr_1, _, _, _, _, _, _, _, _, _), 1596 + [156] = PINGROUP(156, qlink_little_request, _, _, _, _, _, _, _, _, _, _), 1597 + [157] = PINGROUP(157, qlink_little_enable, _, _, _, _, _, _, _, _, _, _), 1598 + [158] = PINGROUP(158, qlink_wmss, _, _, _, _, _, _, _, _, _, _), 1599 + [159] = PINGROUP(159, qlink_big_request, qdss_cti, _, _, _, _, _, _, _, _, _), 1600 + [160] = PINGROUP(160, qlink_big_enable, _, _, _, _, _, _, _, _, _, _), 1601 + [161] = PINGROUP(161, _, _, _, _, _, _, _, _, _, _, _), 1602 + [162] = PINGROUP(162, qdss_cti, _, _, _, _, _, _, _, _, _, _), 1603 + [163] = PINGROUP(163, cci_timer, _, _, _, _, _, _, _, _, _, _), 1604 + [164] = PINGROUP(164, cci_timer, cci_i2c_scl, _, _, _, _, _, _, _, _, _), 1605 + [165] = PINGROUP(165, _, _, _, _, _, _, _, _, _, _, egpio), 1606 + [166] = PINGROUP(166, _, _, _, _, _, _, _, _, _, _, egpio), 1607 + [167] = PINGROUP(167, _, _, _, _, _, _, _, _, _, _, egpio), 1608 + [168] = PINGROUP(168, _, _, _, _, _, _, _, _, _, _, egpio), 1609 + [169] = PINGROUP(169, _, _, _, _, _, _, _, _, _, _, egpio), 1610 + [170] = PINGROUP(170, _, _, _, _, _, _, _, _, _, _, egpio), 1611 + [171] = PINGROUP(171, _, _, _, _, _, _, _, _, _, _, egpio), 1612 + [172] = PINGROUP(172, _, _, _, _, _, _, _, _, _, _, egpio), 1613 + [173] = PINGROUP(173, _, _, _, _, _, _, _, _, _, _, egpio), 1614 + [174] = PINGROUP(174, _, _, _, _, _, _, _, _, _, _, egpio), 1615 + [175] = PINGROUP(175, _, _, _, _, _, _, _, _, _, _, egpio), 1616 + [176] = PINGROUP(176, _, _, _, _, _, _, _, _, _, _, egpio), 1617 + [177] = PINGROUP(177, _, _, _, _, _, _, _, _, _, _, egpio), 1618 + [178] = PINGROUP(178, _, _, _, _, _, _, _, _, _, _, egpio), 1619 + [179] = PINGROUP(179, _, _, _, _, _, _, _, _, _, _, egpio), 1620 + [180] = PINGROUP(180, _, _, _, _, _, _, _, _, _, _, egpio), 1621 + [181] = PINGROUP(181, _, _, _, _, _, _, _, _, _, _, egpio), 1622 + [182] = PINGROUP(182, _, _, _, _, _, _, _, _, _, _, egpio), 1623 + [183] = PINGROUP(183, _, _, _, _, _, _, _, _, _, _, egpio), 1624 + [184] = PINGROUP(184, _, _, _, _, _, _, _, _, _, _, egpio), 1625 + [185] = PINGROUP(185, _, _, _, _, _, _, _, _, _, _, egpio), 1626 + [186] = PINGROUP(186, _, _, _, _, _, _, _, _, _, _, egpio), 1627 + [187] = PINGROUP(187, _, _, _, _, _, _, _, _, _, _, egpio), 1628 + [188] = PINGROUP(188, _, _, _, _, _, _, _, _, _, _, egpio), 1629 + [189] = PINGROUP(189, _, _, _, _, _, _, _, _, _, _, egpio), 1630 + [190] = PINGROUP(190, _, _, _, _, _, _, _, _, _, _, egpio), 1631 + [191] = PINGROUP(191, _, _, _, _, _, _, _, _, _, _, egpio), 1632 + [192] = PINGROUP(192, _, _, _, _, _, _, _, _, _, _, egpio), 1633 + [193] = PINGROUP(193, _, _, _, _, _, _, _, _, _, _, egpio), 1634 + [194] = PINGROUP(194, _, _, _, _, _, _, _, _, _, _, egpio), 1635 + [195] = PINGROUP(195, _, _, _, _, _, _, _, _, _, _, egpio), 1636 + [196] = PINGROUP(196, _, _, _, _, _, _, _, _, _, _, egpio), 1637 + [197] = PINGROUP(197, _, _, _, _, _, _, _, _, _, _, egpio), 1638 + [198] = PINGROUP(198, _, _, _, _, _, _, _, _, _, _, egpio), 1639 + [199] = PINGROUP(199, _, _, _, _, _, _, _, _, _, _, egpio), 1640 + [200] = PINGROUP(200, _, _, _, _, _, _, _, _, _, _, egpio), 1641 + [201] = PINGROUP(201, _, _, _, _, _, _, _, _, _, _, egpio), 1642 + [202] = PINGROUP(202, _, _, _, _, _, _, _, _, _, _, egpio), 1643 + [203] = PINGROUP(203, _, _, _, _, _, _, _, _, _, _, egpio), 1644 + [204] = PINGROUP(204, _, _, _, _, _, _, _, _, _, _, egpio), 1645 + [205] = PINGROUP(205, _, _, _, _, _, _, _, _, _, _, egpio), 1646 + [206] = PINGROUP(206, i2chub0_se8, _, _, _, _, _, _, _, _, _, egpio), 1647 + [207] = PINGROUP(207, i2chub0_se8, _, _, _, _, _, _, _, _, _, egpio), 1648 + [208] = PINGROUP(208, _, _, _, _, _, _, _, _, _, _, egpio), 1649 + [209] = PINGROUP(209, _, _, _, _, _, _, _, _, _, _, egpio), 1650 + [210] = PINGROUP(210, _, _, _, _, _, _, _, _, _, _, egpio), 1651 + [211] = PINGROUP(211, _, _, _, _, _, _, _, _, _, _, egpio), 1652 + [212] = PINGROUP(212, _, _, _, _, _, _, _, _, _, _, egpio), 1653 + [213] = PINGROUP(213, _, _, _, _, _, _, _, _, _, _, egpio), 1654 + [214] = PINGROUP(214, _, _, _, _, _, _, _, _, _, _, egpio), 1655 + [215] = UFS_RESET(ufs_reset, 0xe2004, 0xe3000), 1656 + [216] = SDC_QDSD_PINGROUP(sdc2_clk, 0xdb000, 14, 6), 1657 + [217] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xdb000, 11, 3), 1658 + [218] = SDC_QDSD_PINGROUP(sdc2_data, 0xdb000, 9, 0), 1659 + }; 1660 + 1661 + static const struct msm_gpio_wakeirq_map sm8750_pdc_map[] = { 1662 + { 0, 72 }, { 3, 80 }, { 4, 73 }, { 7, 74 }, { 8, 75 }, 1663 + { 11, 76 }, { 12, 87 }, { 15, 98 }, { 18, 110 }, { 19, 79 }, 1664 + { 23, 82 }, { 24, 83 }, { 27, 84 }, { 28, 85 }, { 31, 86 }, 1665 + { 32, 92 }, { 35, 68 }, { 36, 93 }, { 39, 94 }, { 43, 95 }, 1666 + { 46, 96 }, { 47, 121 }, { 48, 97 }, { 51, 118 }, { 54, 102 }, 1667 + { 55, 71 }, { 56, 103 }, { 57, 104 }, { 59, 105 }, { 61, 81 }, 1668 + { 63, 91 }, { 64, 77 }, { 65, 90 }, { 66, 106 }, { 67, 99 }, 1669 + { 68, 112 }, { 69, 113 }, { 75, 114 }, { 78, 115 }, { 79, 116 }, 1670 + { 80, 122 }, { 81, 123 }, { 84, 101 }, { 85, 124 }, { 86, 125 }, 1671 + { 87, 126 }, { 88, 127 }, { 95, 128 }, { 96, 129 }, { 97, 100 }, 1672 + { 98, 117 }, { 99, 78 }, { 102, 130 }, { 103, 131 }, { 104, 132 }, 1673 + { 108, 133 }, { 133, 134 }, { 137, 67 }, { 148, 135 }, { 150, 136 }, 1674 + { 152, 137 }, { 154, 138 }, { 155, 89 }, { 156, 139 }, { 159, 140 }, 1675 + { 162, 109 }, { 163, 108 }, { 166, 141 }, { 169, 142 }, { 171, 143 }, 1676 + { 172, 144 }, { 174, 145 }, { 176, 146 }, { 177, 120 }, { 181, 147 }, 1677 + { 182, 148 }, { 185, 149 }, { 188, 111 }, { 190, 88 }, { 191, 150 }, 1678 + { 192, 151 }, { 193, 152 }, { 196, 153 }, { 197, 154 }, { 198, 70 }, 1679 + { 199, 119 }, { 200, 69 }, { 201, 155 }, { 202, 156 }, { 203, 157 }, 1680 + { 204, 158 }, { 205, 107 }, { 209, 159 }, 1681 + }; 1682 + 1683 + static const struct msm_pinctrl_soc_data sm8750_tlmm = { 1684 + .pins = sm8750_pins, 1685 + .npins = ARRAY_SIZE(sm8750_pins), 1686 + .functions = sm8750_functions, 1687 + .nfunctions = ARRAY_SIZE(sm8750_functions), 1688 + .groups = sm8750_groups, 1689 + .ngroups = ARRAY_SIZE(sm8750_groups), 1690 + .ngpios = 216, 1691 + .wakeirq_map = sm8750_pdc_map, 1692 + .nwakeirq_map = ARRAY_SIZE(sm8750_pdc_map), 1693 + .egpio_func = 11, 1694 + }; 1695 + 1696 + static int sm8750_tlmm_probe(struct platform_device *pdev) 1697 + { 1698 + return msm_pinctrl_probe(pdev, &sm8750_tlmm); 1699 + } 1700 + 1701 + static const struct of_device_id sm8750_tlmm_of_match[] = { 1702 + { .compatible = "qcom,sm8750-tlmm", }, 1703 + {}, 1704 + }; 1705 + 1706 + static struct platform_driver sm8750_tlmm_driver = { 1707 + .driver = { 1708 + .name = "sm8750-tlmm", 1709 + .of_match_table = sm8750_tlmm_of_match, 1710 + }, 1711 + .probe = sm8750_tlmm_probe, 1712 + .remove = msm_pinctrl_remove, 1713 + }; 1714 + 1715 + static int __init sm8750_tlmm_init(void) 1716 + { 1717 + return platform_driver_register(&sm8750_tlmm_driver); 1718 + } 1719 + arch_initcall(sm8750_tlmm_init); 1720 + 1721 + static void __exit sm8750_tlmm_exit(void) 1722 + { 1723 + platform_driver_unregister(&sm8750_tlmm_driver); 1724 + } 1725 + module_exit(sm8750_tlmm_exit); 1726 + 1727 + MODULE_DESCRIPTION("QTI SM8750 TLMM driver"); 1728 + MODULE_LICENSE("GPL"); 1729 + MODULE_DEVICE_TABLE(of, sm8750_tlmm_of_match);
+5 -3
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 667 667 "push-pull", "open-drain", "open-source" 668 668 }; 669 669 static const char *const strengths[] = { 670 - "no", "high", "medium", "low" 670 + "no", "low", "medium", "high" 671 671 }; 672 672 673 673 pad = pctldev->desc->pins[pin].drv_data; ··· 1169 1169 * files which don't set the "gpio-ranges" property or systems that 1170 1170 * utilize ACPI the driver has to call gpiochip_add_pin_range(). 1171 1171 */ 1172 - if (!of_property_read_bool(dev->of_node, "gpio-ranges")) { 1172 + if (!of_property_present(dev->of_node, "gpio-ranges")) { 1173 1173 ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0, 1174 1174 npins); 1175 1175 if (ret) { ··· 1226 1226 { .compatible = "qcom,pm8550ve-gpio", .data = (void *) 8 }, 1227 1227 { .compatible = "qcom,pm8550vs-gpio", .data = (void *) 6 }, 1228 1228 { .compatible = "qcom,pm8916-gpio", .data = (void *) 4 }, 1229 + /* pm8937 has 8 GPIOs with holes on 3, 4 and 6 */ 1230 + { .compatible = "qcom,pm8937-gpio", .data = (void *) 8 }, 1229 1231 { .compatible = "qcom,pm8941-gpio", .data = (void *) 36 }, 1230 1232 /* pm8950 has 8 GPIOs with holes on 3 */ 1231 1233 { .compatible = "qcom,pm8950-gpio", .data = (void *) 8 }, ··· 1270 1268 .of_match_table = pmic_gpio_of_match, 1271 1269 }, 1272 1270 .probe = pmic_gpio_probe, 1273 - .remove_new = pmic_gpio_remove, 1271 + .remove = pmic_gpio_remove, 1274 1272 }; 1275 1273 1276 1274 module_platform_driver(pmic_gpio_driver);
+2 -1
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
··· 983 983 { .compatible = "qcom,pm8226-mpp", .data = (void *) 8 }, 984 984 { .compatible = "qcom,pm8841-mpp", .data = (void *) 4 }, 985 985 { .compatible = "qcom,pm8916-mpp", .data = (void *) 4 }, 986 + { .compatible = "qcom,pm8937-mpp", .data = (void *) 4 }, 986 987 { .compatible = "qcom,pm8941-mpp", .data = (void *) 8 }, 987 988 { .compatible = "qcom,pm8950-mpp", .data = (void *) 4 }, 988 989 { .compatible = "qcom,pmi8950-mpp", .data = (void *) 4 }, ··· 1001 1000 .of_match_table = pmic_mpp_of_match, 1002 1001 }, 1003 1002 .probe = pmic_mpp_probe, 1004 - .remove_new = pmic_mpp_remove, 1003 + .remove = pmic_mpp_remove, 1005 1004 }; 1006 1005 1007 1006 module_platform_driver(pmic_mpp_driver);
+2 -2
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 832 832 * files which don't set the "gpio-ranges" property or systems that 833 833 * utilize ACPI the driver has to call gpiochip_add_pin_range(). 834 834 */ 835 - if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) { 835 + if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) { 836 836 ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 837 837 0, 0, pctrl->chip.ngpio); 838 838 if (ret) { ··· 866 866 .of_match_table = pm8xxx_gpio_of_match, 867 867 }, 868 868 .probe = pm8xxx_gpio_probe, 869 - .remove_new = pm8xxx_gpio_remove, 869 + .remove = pm8xxx_gpio_remove, 870 870 }; 871 871 872 872 module_platform_driver(pm8xxx_gpio_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 949 949 .of_match_table = pm8xxx_mpp_of_match, 950 950 }, 951 951 .probe = pm8xxx_mpp_probe, 952 - .remove_new = pm8xxx_mpp_remove, 952 + .remove = pm8xxx_mpp_remove, 953 953 }; 954 954 955 955 module_platform_driver(pm8xxx_mpp_driver);
+1 -1
drivers/pinctrl/qcom/pinctrl-x1e80100.c
··· 1861 1861 .of_match_table = x1e80100_pinctrl_of_match, 1862 1862 }, 1863 1863 .probe = x1e80100_pinctrl_probe, 1864 - .remove_new = msm_pinctrl_remove, 1864 + .remove = msm_pinctrl_remove, 1865 1865 }; 1866 1866 1867 1867 static int __init x1e80100_pinctrl_init(void)
+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_R9A09G057 44 45 select PINCTRL_PFC_SH7203 if CPU_SUBTYPE_SH7203 45 46 select PINCTRL_PFC_SH7264 if CPU_SUBTYPE_SH7264 46 47 select PINCTRL_PFC_SH7269 if CPU_SUBTYPE_SH7269
+7
drivers/pinctrl/renesas/pinctrl-rza1.c
··· 19 19 #include <linux/ioport.h> 20 20 #include <linux/module.h> 21 21 #include <linux/of.h> 22 + #include <linux/pinctrl/consumer.h> 22 23 #include <linux/pinctrl/pinconf-generic.h> 23 24 #include <linux/pinctrl/pinctrl.h> 24 25 #include <linux/pinctrl/pinmux.h> ··· 751 750 static int rza1_gpio_request(struct gpio_chip *chip, unsigned int gpio) 752 751 { 753 752 struct rza1_port *port = gpiochip_get_data(chip); 753 + int ret; 754 + 755 + ret = pinctrl_gpio_request(chip, gpio); 756 + if (ret) 757 + return ret; 754 758 755 759 rza1_pin_reset(port, gpio); 756 760 ··· 777 771 struct rza1_port *port = gpiochip_get_data(chip); 778 772 779 773 rza1_pin_reset(port, gpio); 774 + pinctrl_gpio_free(chip, gpio); 780 775 } 781 776 782 777 static int rza1_gpio_get_direction(struct gpio_chip *chip, unsigned int gpio)
+3
drivers/pinctrl/renesas/pinctrl-rza2.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/mutex.h> 18 18 #include <linux/of.h> 19 + #include <linux/pinctrl/consumer.h> 19 20 #include <linux/pinctrl/pinmux.h> 20 21 #include <linux/platform_device.h> 21 22 ··· 230 229 static struct gpio_chip chip = { 231 230 .names = rza2_gpio_names, 232 231 .base = -1, 232 + .request = pinctrl_gpio_request, 233 + .free = pinctrl_gpio_free, 233 234 .get_direction = rza2_chip_get_direction, 234 235 .direction_input = rza2_chip_direction_input, 235 236 .direction_output = rza2_chip_direction_output,
+49 -19
drivers/pinctrl/renesas/pinctrl-rzg2l.c
··· 139 139 #define IEN(off) (0x1800 + (off) * 8) 140 140 #define PUPD(off) (0x1C00 + (off) * 8) 141 141 #define ISEL(off) (0x2C00 + (off) * 8) 142 + #define NOD(off) (0x3000 + (off) * 8) 143 + #define SMT(off) (0x3400 + (off) * 8) 142 144 #define SD_CH(off, ch) ((off) + (ch) * 4) 143 145 #define ETH_POC(off, ch) ((off) + (ch) * 4) 144 146 #define QSPI (0x3008) ··· 162 160 #define IOLH_MASK 0x03 163 161 #define SR_MASK 0x01 164 162 #define PUPD_MASK 0x03 163 + #define NOD_MASK 0x01 164 + #define SMT_MASK 0x01 165 165 166 166 #define PM_INPUT 0x1 167 167 #define PM_OUTPUT 0x2 ··· 172 168 #define RZG2L_PIN_ID_TO_PIN(id) ((id) % RZG2L_PINS_PER_PORT) 173 169 174 170 #define RZG2L_TINT_MAX_INTERRUPT 32 175 - #define RZG2L_TINT_IRQ_START_INDEX 9 176 171 #define RZG2L_PACK_HWIRQ(t, i) (((t) << 16) | (i)) 177 172 178 173 /* Custom pinconf parameters */ ··· 250 247 * @iolh_groupb_ua: IOLH group B uA specific values 251 248 * @iolh_groupc_ua: IOLH group C uA specific values 252 249 * @iolh_groupb_oi: IOLH group B output impedance specific values 250 + * @tint_start_index: the start index for the TINT interrupts 253 251 * @drive_strength_ua: drive strength in uA is supported (otherwise mA is supported) 254 252 * @func_base: base number for port function (see register PFC) 255 253 * @oen_max_pin: the maximum pin number supporting output enable ··· 262 258 u16 iolh_groupb_ua[RZG2L_IOLH_IDX_MAX]; 263 259 u16 iolh_groupc_ua[RZG2L_IOLH_IDX_MAX]; 264 260 u16 iolh_groupb_oi[4]; 261 + u16 tint_start_index; 265 262 bool drive_strength_ua; 266 263 u8 func_base; 267 264 u8 oen_max_pin; ··· 1342 1337 break; 1343 1338 } 1344 1339 1340 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 1341 + case PIN_CONFIG_DRIVE_PUSH_PULL: 1342 + if (!(cfg & PIN_CFG_NOD)) 1343 + return -EINVAL; 1344 + 1345 + arg = rzg2l_read_pin_config(pctrl, NOD(off), bit, NOD_MASK); 1346 + if (!arg && param != PIN_CONFIG_DRIVE_PUSH_PULL) 1347 + return -EINVAL; 1348 + if (arg && param != PIN_CONFIG_DRIVE_OPEN_DRAIN) 1349 + return -EINVAL; 1350 + break; 1351 + 1352 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 1353 + if (!(cfg & PIN_CFG_SMT)) 1354 + return -EINVAL; 1355 + 1356 + arg = rzg2l_read_pin_config(pctrl, SMT(off), bit, SMT_MASK); 1357 + if (!arg) 1358 + return -EINVAL; 1359 + break; 1360 + 1345 1361 case RENESAS_RZV2H_PIN_CONFIG_OUTPUT_IMPEDANCE: 1346 1362 if (!(cfg & PIN_CFG_IOLH_RZV2H)) 1347 1363 return -EINVAL; ··· 1490 1464 return -EINVAL; 1491 1465 1492 1466 rzg2l_rmw_pin_config(pctrl, IOLH(off), bit, IOLH_MASK, index); 1467 + break; 1468 + 1469 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 1470 + case PIN_CONFIG_DRIVE_PUSH_PULL: 1471 + if (!(cfg & PIN_CFG_NOD)) 1472 + return -EINVAL; 1473 + 1474 + rzg2l_rmw_pin_config(pctrl, NOD(off), bit, NOD_MASK, 1475 + param == PIN_CONFIG_DRIVE_OPEN_DRAIN ? 1 : 0); 1476 + break; 1477 + 1478 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 1479 + if (!(cfg & PIN_CFG_SMT)) 1480 + return -EINVAL; 1481 + 1482 + rzg2l_rmw_pin_config(pctrl, SMT(off), bit, SMT_MASK, arg); 1493 1483 break; 1494 1484 1495 1485 case RENESAS_RZV2H_PIN_CONFIG_OUTPUT_IMPEDANCE: ··· 2421 2379 2422 2380 rzg2l_gpio_irq_endisable(pctrl, child, true); 2423 2381 pctrl->hwirq[irq] = child; 2424 - irq += RZG2L_TINT_IRQ_START_INDEX; 2382 + irq += pctrl->data->hwcfg->tint_start_index; 2425 2383 2426 2384 /* All these interrupts are level high in the CPU */ 2427 2385 *parent_type = IRQ_TYPE_LEVEL_HIGH; ··· 2431 2389 err: 2432 2390 rzg2l_gpio_free(gc, child); 2433 2391 return ret; 2434 - } 2435 - 2436 - static int rzg2l_gpio_populate_parent_fwspec(struct gpio_chip *chip, 2437 - union gpio_irq_fwspec *gfwspec, 2438 - unsigned int parent_hwirq, 2439 - unsigned int parent_type) 2440 - { 2441 - struct irq_fwspec *fwspec = &gfwspec->fwspec; 2442 - 2443 - fwspec->fwnode = chip->irq.parent_domain->fwnode; 2444 - fwspec->param_count = 2; 2445 - fwspec->param[0] = parent_hwirq; 2446 - fwspec->param[1] = parent_type; 2447 - 2448 - return 0; 2449 2392 } 2450 2393 2451 2394 static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl) ··· 2634 2607 girq->fwnode = dev_fwnode(pctrl->dev); 2635 2608 girq->parent_domain = parent_domain; 2636 2609 girq->child_to_parent_hwirq = rzg2l_gpio_child_to_parent_hwirq; 2637 - girq->populate_parent_alloc_arg = rzg2l_gpio_populate_parent_fwspec; 2610 + girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_twocell; 2638 2611 girq->child_irq_domain_ops.free = rzg2l_gpio_irq_domain_free; 2639 2612 girq->init_valid_mask = rzg2l_init_irq_valid_mask; 2640 2613 ··· 2737 2710 2738 2711 ret = pinctrl_enable(pctrl->pctl); 2739 2712 if (ret) 2740 - dev_err_probe(pctrl->dev, ret, "pinctrl enable failed\n"); 2713 + return dev_err_probe(pctrl->dev, ret, "pinctrl enable failed\n"); 2741 2714 2742 2715 ret = rzg2l_gpio_register(pctrl); 2743 2716 if (ret) ··· 3061 3034 [RZG2L_IOLH_IDX_3V3] = 2000, 4000, 8000, 12000, 3062 3035 }, 3063 3036 .iolh_groupb_oi = { 100, 66, 50, 33, }, 3037 + .tint_start_index = 9, 3064 3038 .oen_max_pin = 0, 3065 3039 }; 3066 3040 ··· 3091 3063 /* 3v3 power source */ 3092 3064 [RZG2L_IOLH_IDX_3V3] = 4500, 5200, 5700, 6050, 3093 3065 }, 3066 + .tint_start_index = 9, 3094 3067 .drive_strength_ua = true, 3095 3068 .func_base = 1, 3096 3069 .oen_max_pin = 1, /* Pin 1 of P0 and P7 is the maximum OEN pin. */ ··· 3102 3073 .regs = { 3103 3074 .pwpr = 0x3c04, 3104 3075 }, 3076 + .tint_start_index = 17, 3105 3077 }; 3106 3078 3107 3079 static struct rzg2l_pinctrl_data r9a07g043_data = {
+1 -1
drivers/pinctrl/renesas/pinctrl-rzn1.c
··· 925 925 926 926 static struct platform_driver rzn1_pinctrl_driver = { 927 927 .probe = rzn1_pinctrl_probe, 928 - .remove_new = rzn1_pinctrl_remove, 928 + .remove = rzn1_pinctrl_remove, 929 929 .driver = { 930 930 .name = "rzn1-pinctrl", 931 931 .of_match_table = rzn1_pinctrl_match,
+431
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
··· 58 58 .reg_offset = { 0x00, 0x04, 0x08, 0x0c, }, 59 59 }; 60 60 61 + /* 62 + * Bank type for non-alive type. Bit fields: 63 + * CON: 4, DAT: 1, PUD: 2, DRV: 3, CONPDN: 2, PUDPDN: 2 64 + */ 65 + static const struct samsung_pin_bank_type exynos8895_bank_type_off = { 66 + .fld_width = { 4, 1, 2, 3, 2, 2, }, 67 + .reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, }, 68 + }; 69 + 61 70 /* Pad retention control code for accessing PMU regmap */ 62 71 static atomic_t exynos_shared_retention_refcnt; 63 72 ··· 627 618 .num_ctrl = ARRAY_SIZE(exynos850_pin_ctrl), 628 619 }; 629 620 621 + /* pin banks of exynos990 pin-controller 0 (ALIVE) */ 622 + static struct samsung_pin_bank_data exynos990_pin_banks0[] = { 623 + /* Must start with EINTG banks, ordered by EINT group number. */ 624 + EXYNOS850_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), 625 + EXYNOS850_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), 626 + EXYNOS850_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), 627 + EXYNOS850_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c), 628 + EXYNOS850_PIN_BANK_EINTW(2, 0x080, "gpa4", 0x10), 629 + EXYNOS850_PIN_BANK_EINTN(7, 0x0A0, "gpq0"), 630 + }; 631 + 632 + /* pin banks of exynos990 pin-controller 1 (CMGP) */ 633 + static struct samsung_pin_bank_data exynos990_pin_banks1[] = { 634 + /* Must start with EINTG banks, ordered by EINT group number. */ 635 + EXYNOS850_PIN_BANK_EINTN(1, 0x000, "gpm0"), 636 + EXYNOS850_PIN_BANK_EINTN(1, 0x020, "gpm1"), 637 + EXYNOS850_PIN_BANK_EINTN(1, 0x040, "gpm2"), 638 + EXYNOS850_PIN_BANK_EINTN(1, 0x060, "gpm3"), 639 + EXYNOS850_PIN_BANK_EINTW(1, 0x080, "gpm4", 0x00), 640 + EXYNOS850_PIN_BANK_EINTW(1, 0x0A0, "gpm5", 0x04), 641 + EXYNOS850_PIN_BANK_EINTW(1, 0x0C0, "gpm6", 0x08), 642 + EXYNOS850_PIN_BANK_EINTW(1, 0x0E0, "gpm7", 0x0c), 643 + EXYNOS850_PIN_BANK_EINTW(1, 0x100, "gpm8", 0x10), 644 + EXYNOS850_PIN_BANK_EINTW(1, 0x120, "gpm9", 0x14), 645 + EXYNOS850_PIN_BANK_EINTW(1, 0x140, "gpm10", 0x18), 646 + EXYNOS850_PIN_BANK_EINTW(1, 0x160, "gpm11", 0x1c), 647 + EXYNOS850_PIN_BANK_EINTW(1, 0x180, "gpm12", 0x20), 648 + EXYNOS850_PIN_BANK_EINTW(1, 0x1A0, "gpm13", 0x24), 649 + EXYNOS850_PIN_BANK_EINTW(1, 0x1C0, "gpm14", 0x28), 650 + EXYNOS850_PIN_BANK_EINTW(1, 0x1E0, "gpm15", 0x2c), 651 + EXYNOS850_PIN_BANK_EINTW(1, 0x200, "gpm16", 0x30), 652 + EXYNOS850_PIN_BANK_EINTW(1, 0x220, "gpm17", 0x34), 653 + EXYNOS850_PIN_BANK_EINTW(1, 0x240, "gpm18", 0x38), 654 + EXYNOS850_PIN_BANK_EINTW(1, 0x260, "gpm19", 0x3c), 655 + EXYNOS850_PIN_BANK_EINTW(1, 0x280, "gpm20", 0x40), 656 + EXYNOS850_PIN_BANK_EINTW(1, 0x2A0, "gpm21", 0x44), 657 + EXYNOS850_PIN_BANK_EINTW(1, 0x2C0, "gpm22", 0x48), 658 + EXYNOS850_PIN_BANK_EINTW(1, 0x2E0, "gpm23", 0x4c), 659 + EXYNOS850_PIN_BANK_EINTW(1, 0x300, "gpm24", 0x50), 660 + EXYNOS850_PIN_BANK_EINTW(1, 0x320, "gpm25", 0x54), 661 + EXYNOS850_PIN_BANK_EINTW(1, 0x340, "gpm26", 0x58), 662 + EXYNOS850_PIN_BANK_EINTW(1, 0x360, "gpm27", 0x5c), 663 + EXYNOS850_PIN_BANK_EINTW(1, 0x380, "gpm28", 0x60), 664 + EXYNOS850_PIN_BANK_EINTW(1, 0x3A0, "gpm29", 0x64), 665 + EXYNOS850_PIN_BANK_EINTW(1, 0x3C0, "gpm30", 0x68), 666 + EXYNOS850_PIN_BANK_EINTW(1, 0x3E0, "gpm31", 0x6c), 667 + EXYNOS850_PIN_BANK_EINTW(1, 0x400, "gpm32", 0x70), 668 + EXYNOS850_PIN_BANK_EINTW(1, 0x420, "gpm33", 0x74), 669 + 670 + }; 671 + 672 + /* pin banks of exynos990 pin-controller 2 (HSI1) */ 673 + static struct samsung_pin_bank_data exynos990_pin_banks2[] = { 674 + /* Must start with EINTG banks, ordered by EINT group number. */ 675 + EXYNOS850_PIN_BANK_EINTG(4, 0x000, "gpf0", 0x00), 676 + EXYNOS850_PIN_BANK_EINTG(6, 0x020, "gpf1", 0x04), 677 + EXYNOS850_PIN_BANK_EINTG(3, 0x040, "gpf2", 0x08), 678 + }; 679 + 680 + /* pin banks of exynos990 pin-controller 3 (HSI2) */ 681 + static struct samsung_pin_bank_data exynos990_pin_banks3[] = { 682 + /* Must start with EINTG banks, ordered by EINT group number. */ 683 + EXYNOS850_PIN_BANK_EINTG(2, 0x000, "gpf3", 0x00), 684 + }; 685 + 686 + /* pin banks of exynos990 pin-controller 4 (PERIC0) */ 687 + static struct samsung_pin_bank_data exynos990_pin_banks4[] = { 688 + /* Must start with EINTG banks, ordered by EINT group number. */ 689 + EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gpp0", 0x00), 690 + EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpp1", 0x04), 691 + EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpp2", 0x08), 692 + EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpp3", 0x0C), 693 + EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpp4", 0x10), 694 + EXYNOS850_PIN_BANK_EINTG(2, 0x0A0, "gpg0", 0x14), 695 + }; 696 + 697 + /* pin banks of exynos990 pin-controller 5 (PERIC1) */ 698 + static struct samsung_pin_bank_data exynos990_pin_banks5[] = { 699 + /* Must start with EINTG banks, ordered by EINT group number. */ 700 + EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gpp5", 0x00), 701 + EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpp6", 0x04), 702 + EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpp7", 0x08), 703 + EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpp8", 0x0C), 704 + EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpp9", 0x10), 705 + EXYNOS850_PIN_BANK_EINTG(6, 0x0A0, "gpc0", 0x14), 706 + EXYNOS850_PIN_BANK_EINTG(4, 0x0C0, "gpg1", 0x18), 707 + EXYNOS850_PIN_BANK_EINTG(8, 0x0E0, "gpb0", 0x1C), 708 + EXYNOS850_PIN_BANK_EINTG(8, 0x100, "gpb1", 0x20), 709 + EXYNOS850_PIN_BANK_EINTG(8, 0x120, "gpb2", 0x24), 710 + }; 711 + 712 + /* pin banks of exynos990 pin-controller 6 (VTS) */ 713 + static struct samsung_pin_bank_data exynos990_pin_banks6[] = { 714 + /* Must start with EINTG banks, ordered by EINT group number. */ 715 + EXYNOS850_PIN_BANK_EINTG(7, 0x000, "gpv0", 0x00), 716 + }; 717 + 718 + static const struct samsung_pin_ctrl exynos990_pin_ctrl[] __initconst = { 719 + { 720 + /* pin-controller instance 0 ALIVE data */ 721 + .pin_banks = exynos990_pin_banks0, 722 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks0), 723 + .eint_wkup_init = exynos_eint_wkup_init, 724 + }, { 725 + /* pin-controller instance 1 CMGP data */ 726 + .pin_banks = exynos990_pin_banks1, 727 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks1), 728 + .eint_wkup_init = exynos_eint_wkup_init, 729 + }, { 730 + /* pin-controller instance 2 HSI1 data */ 731 + .pin_banks = exynos990_pin_banks2, 732 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks2), 733 + .eint_gpio_init = exynos_eint_gpio_init, 734 + }, { 735 + /* pin-controller instance 3 HSI2 data */ 736 + .pin_banks = exynos990_pin_banks3, 737 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks3), 738 + .eint_gpio_init = exynos_eint_gpio_init, 739 + }, { 740 + /* pin-controller instance 4 PERIC0 data */ 741 + .pin_banks = exynos990_pin_banks4, 742 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks4), 743 + .eint_gpio_init = exynos_eint_gpio_init, 744 + }, { 745 + /* pin-controller instance 5 PERIC1 data */ 746 + .pin_banks = exynos990_pin_banks5, 747 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks5), 748 + .eint_gpio_init = exynos_eint_gpio_init, 749 + }, { 750 + /* pin-controller instance 6 VTS data */ 751 + .pin_banks = exynos990_pin_banks6, 752 + .nr_banks = ARRAY_SIZE(exynos990_pin_banks6), 753 + }, 754 + }; 755 + 756 + const struct samsung_pinctrl_of_match_data exynos990_of_data __initconst = { 757 + .ctrl = exynos990_pin_ctrl, 758 + .num_ctrl = ARRAY_SIZE(exynos990_pin_ctrl), 759 + }; 760 + 761 + /* pin banks of exynos9810 pin-controller 0 (ALIVE) */ 762 + static const struct samsung_pin_bank_data exynos9810_pin_banks0[] __initconst = { 763 + EXYNOS850_PIN_BANK_EINTN(6, 0x000, "etc1"), 764 + EXYNOS850_PIN_BANK_EINTW(8, 0x020, "gpa0", 0x00), 765 + EXYNOS850_PIN_BANK_EINTW(8, 0x040, "gpa1", 0x04), 766 + EXYNOS850_PIN_BANK_EINTW(8, 0x060, "gpa2", 0x08), 767 + EXYNOS850_PIN_BANK_EINTW(8, 0x080, "gpa3", 0x0c), 768 + EXYNOS850_PIN_BANK_EINTN(6, 0x0A0, "gpq0"), 769 + EXYNOS850_PIN_BANK_EINTW(2, 0x0C0, "gpa4", 0x10), 770 + }; 771 + 772 + /* pin banks of exynos9810 pin-controller 1 (AUD) */ 773 + static const struct samsung_pin_bank_data exynos9810_pin_banks1[] __initconst = { 774 + EXYNOS850_PIN_BANK_EINTG(5, 0x000, "gpb0", 0x00), 775 + EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpb1", 0x04), 776 + EXYNOS850_PIN_BANK_EINTG(4, 0x040, "gpb2", 0x08), 777 + }; 778 + 779 + /* pin banks of exynos9810 pin-controller 2 (CHUB) */ 780 + static const struct samsung_pin_bank_data exynos9810_pin_banks2[] __initconst = { 781 + EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gph0", 0x00), 782 + EXYNOS850_PIN_BANK_EINTG(5, 0x020, "gph1", 0x04), 783 + }; 784 + 785 + /* pin banks of exynos9810 pin-controller 3 (CMGP) */ 786 + static const struct samsung_pin_bank_data exynos9810_pin_banks3[] __initconst = { 787 + EXYNOS850_PIN_BANK_EINTW(1, 0x000, "gpm0", 0x00), 788 + EXYNOS850_PIN_BANK_EINTW(1, 0x020, "gpm1", 0x04), 789 + EXYNOS850_PIN_BANK_EINTW(1, 0x040, "gpm2", 0x08), 790 + EXYNOS850_PIN_BANK_EINTW(1, 0x060, "gpm3", 0x0C), 791 + EXYNOS850_PIN_BANK_EINTW(1, 0x080, "gpm4", 0x10), 792 + EXYNOS850_PIN_BANK_EINTW(1, 0x0A0, "gpm5", 0x14), 793 + EXYNOS850_PIN_BANK_EINTW(1, 0x0C0, "gpm6", 0x18), 794 + EXYNOS850_PIN_BANK_EINTW(1, 0x0E0, "gpm7", 0x1C), 795 + EXYNOS850_PIN_BANK_EINTW(1, 0x100, "gpm10", 0x20), 796 + EXYNOS850_PIN_BANK_EINTW(1, 0x120, "gpm11", 0x24), 797 + EXYNOS850_PIN_BANK_EINTW(1, 0x140, "gpm12", 0x28), 798 + EXYNOS850_PIN_BANK_EINTW(1, 0x160, "gpm13", 0x2C), 799 + EXYNOS850_PIN_BANK_EINTW(1, 0x180, "gpm14", 0x30), 800 + EXYNOS850_PIN_BANK_EINTW(1, 0x1A0, "gpm15", 0x34), 801 + EXYNOS850_PIN_BANK_EINTW(1, 0x1C0, "gpm16", 0x38), 802 + EXYNOS850_PIN_BANK_EINTW(1, 0x1E0, "gpm17", 0x3C), 803 + EXYNOS850_PIN_BANK_EINTW(1, 0x200, "gpm40", 0x40), 804 + EXYNOS850_PIN_BANK_EINTW(1, 0x220, "gpm41", 0x44), 805 + EXYNOS850_PIN_BANK_EINTW(1, 0x240, "gpm42", 0x48), 806 + EXYNOS850_PIN_BANK_EINTW(1, 0x260, "gpm43", 0x4C), 807 + }; 808 + 809 + /* pin banks of exynos9810 pin-controller 4 (FSYS0) */ 810 + static const struct samsung_pin_bank_data exynos9810_pin_banks4[] __initconst = { 811 + EXYNOS850_PIN_BANK_EINTG(2, 0x000, "gpf0", 0x00), 812 + }; 813 + 814 + /* pin banks of exynos9810 pin-controller 5 (FSYS1) */ 815 + static const struct samsung_pin_bank_data exynos9810_pin_banks5[] __initconst = { 816 + EXYNOS850_PIN_BANK_EINTG(7, 0x000, "gpf1", 0x00), 817 + EXYNOS850_PIN_BANK_EINTG(6, 0x020, "gpf2", 0x04), 818 + }; 819 + 820 + /* pin banks of exynos9810 pin-controller 6 (PERIC0) */ 821 + static const struct samsung_pin_bank_data exynos9810_pin_banks6[] __initconst = { 822 + EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gpp0", 0x00), 823 + EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpp1", 0x04), 824 + EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpp2", 0x08), 825 + EXYNOS850_PIN_BANK_EINTG(4, 0x060, "gpp3", 0x0C), 826 + EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10), 827 + EXYNOS850_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14), 828 + EXYNOS850_PIN_BANK_EINTG(8, 0x0C0, "gpg2", 0x18), 829 + }; 830 + 831 + /* pin banks of exynos9810 pin-controller 7 (PERIC1) */ 832 + static const struct samsung_pin_bank_data exynos9810_pin_banks7[] __initconst = { 833 + EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gpp4", 0x00), 834 + EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpp5", 0x04), 835 + EXYNOS850_PIN_BANK_EINTG(4, 0x040, "gpp6", 0x08), 836 + EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpc0", 0x0C), 837 + EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpc1", 0x10), 838 + EXYNOS850_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14), 839 + EXYNOS850_PIN_BANK_EINTG(7, 0x0C0, "gpg3", 0x18), 840 + }; 841 + 842 + /* pin banks of exynos9810 pin-controller 8 (VTS) */ 843 + static const struct samsung_pin_bank_data exynos9810_pin_banks8[] __initconst = { 844 + EXYNOS850_PIN_BANK_EINTG(3, 0x000, "gpt0", 0x00), 845 + }; 846 + 847 + static const struct samsung_pin_ctrl exynos9810_pin_ctrl[] __initconst = { 848 + { 849 + /* pin-controller instance 0 ALIVE data */ 850 + .pin_banks = exynos9810_pin_banks0, 851 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks0), 852 + .eint_wkup_init = exynos_eint_wkup_init, 853 + .eint_gpio_init = exynos_eint_gpio_init, 854 + .suspend = exynos_pinctrl_suspend, 855 + .resume = exynos_pinctrl_resume, 856 + }, { 857 + /* pin-controller instance 1 AUD data */ 858 + .pin_banks = exynos9810_pin_banks1, 859 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks1), 860 + }, { 861 + /* pin-controller instance 2 CHUB data */ 862 + .pin_banks = exynos9810_pin_banks2, 863 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks2), 864 + .eint_gpio_init = exynos_eint_gpio_init, 865 + .suspend = exynos_pinctrl_suspend, 866 + .resume = exynos_pinctrl_resume, 867 + }, { 868 + /* pin-controller instance 3 CMGP data */ 869 + .pin_banks = exynos9810_pin_banks3, 870 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks3), 871 + .eint_wkup_init = exynos_eint_wkup_init, 872 + .eint_gpio_init = exynos_eint_gpio_init, 873 + .suspend = exynos_pinctrl_suspend, 874 + .resume = exynos_pinctrl_resume, 875 + }, { 876 + /* pin-controller instance 4 FSYS0 data */ 877 + .pin_banks = exynos9810_pin_banks4, 878 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks4), 879 + .eint_gpio_init = exynos_eint_gpio_init, 880 + .suspend = exynos_pinctrl_suspend, 881 + .resume = exynos_pinctrl_resume, 882 + }, { 883 + /* pin-controller instance 5 FSYS1 data */ 884 + .pin_banks = exynos9810_pin_banks5, 885 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks5), 886 + .eint_gpio_init = exynos_eint_gpio_init, 887 + .suspend = exynos_pinctrl_suspend, 888 + .resume = exynos_pinctrl_resume, 889 + }, { 890 + /* pin-controller instance 6 PERIC0 data */ 891 + .pin_banks = exynos9810_pin_banks6, 892 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks6), 893 + .eint_gpio_init = exynos_eint_gpio_init, 894 + .suspend = exynos_pinctrl_suspend, 895 + .resume = exynos_pinctrl_resume, 896 + }, { 897 + /* pin-controller instance 7 PERIC1 data */ 898 + .pin_banks = exynos9810_pin_banks7, 899 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks7), 900 + .eint_gpio_init = exynos_eint_gpio_init, 901 + .suspend = exynos_pinctrl_suspend, 902 + .resume = exynos_pinctrl_resume, 903 + }, { 904 + /* pin-controller instance 8 VTS data */ 905 + .pin_banks = exynos9810_pin_banks8, 906 + .nr_banks = ARRAY_SIZE(exynos9810_pin_banks8), 907 + }, 908 + }; 909 + 910 + const struct samsung_pinctrl_of_match_data exynos9810_of_data __initconst = { 911 + .ctrl = exynos9810_pin_ctrl, 912 + .num_ctrl = ARRAY_SIZE(exynos9810_pin_ctrl), 913 + }; 914 + 630 915 /* pin banks of exynosautov9 pin-controller 0 (ALIVE) */ 631 916 static const struct samsung_pin_bank_data exynosautov9_pin_banks0[] __initconst = { 632 917 EXYNOS850_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), ··· 1167 864 const struct samsung_pinctrl_of_match_data exynosautov920_of_data __initconst = { 1168 865 .ctrl = exynosautov920_pin_ctrl, 1169 866 .num_ctrl = ARRAY_SIZE(exynosautov920_pin_ctrl), 867 + }; 868 + 869 + /* pin banks of exynos8895 pin-controller 0 (ALIVE) */ 870 + static const struct samsung_pin_bank_data exynos8895_pin_banks0[] __initconst = { 871 + EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa0", 0x00), 872 + EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa1", 0x04), 873 + EXYNOS_PIN_BANK_EINTW(8, 0x060, "gpa2", 0x08), 874 + EXYNOS_PIN_BANK_EINTW(8, 0x080, "gpa3", 0x0c), 875 + EXYNOS_PIN_BANK_EINTW(7, 0x0a0, "gpa4", 0x24), 876 + }; 877 + 878 + /* pin banks of exynos8895 pin-controller 1 (ABOX) */ 879 + static const struct samsung_pin_bank_data exynos8895_pin_banks1[] __initconst = { 880 + EXYNOS_PIN_BANK_EINTG(8, 0x000, "gph0", 0x00), 881 + EXYNOS_PIN_BANK_EINTG(7, 0x020, "gph1", 0x04), 882 + EXYNOS_PIN_BANK_EINTG(4, 0x040, "gph3", 0x08), 883 + }; 884 + 885 + /* pin banks of exynos8895 pin-controller 2 (VTS) */ 886 + static const struct samsung_pin_bank_data exynos8895_pin_banks2[] __initconst = { 887 + EXYNOS_PIN_BANK_EINTG(3, 0x000, "gph2", 0x00), 888 + }; 889 + 890 + /* pin banks of exynos8895 pin-controller 3 (FSYS0) */ 891 + static const struct samsung_pin_bank_data exynos8895_pin_banks3[] __initconst = { 892 + EXYNOS8895_PIN_BANK_EINTG(3, 0x000, "gpi0", 0x00), 893 + EXYNOS8895_PIN_BANK_EINTG(8, 0x020, "gpi1", 0x04), 894 + }; 895 + 896 + /* pin banks of exynos8895 pin-controller 4 (FSYS1) */ 897 + static const struct samsung_pin_bank_data exynos8895_pin_banks4[] __initconst = { 898 + EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj1", 0x00), 899 + EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpj0", 0x04), 900 + }; 901 + 902 + /* pin banks of exynos8895 pin-controller 5 (BUSC) */ 903 + static const struct samsung_pin_bank_data exynos8895_pin_banks5[] __initconst = { 904 + EXYNOS_PIN_BANK_EINTG(2, 0x000, "gpb2", 0x00), 905 + }; 906 + 907 + /* pin banks of exynos8895 pin-controller 6 (PERIC0) */ 908 + static const struct samsung_pin_bank_data exynos8895_pin_banks6[] __initconst = { 909 + EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpd0", 0x00), 910 + EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpd1", 0x04), 911 + EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpd2", 0x08), 912 + EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpd3", 0x0C), 913 + EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpb1", 0x10), 914 + EXYNOS_PIN_BANK_EINTG(8, 0x0a0, "gpe7", 0x14), 915 + EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpf1", 0x18), 916 + }; 917 + 918 + /* pin banks of exynos8895 pin-controller 7 (PERIC1) */ 919 + static const struct samsung_pin_bank_data exynos8895_pin_banks7[] __initconst = { 920 + EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpb0", 0x00), 921 + EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpc0", 0x04), 922 + EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpc1", 0x08), 923 + EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpc2", 0x0C), 924 + EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpc3", 0x10), 925 + EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpk0", 0x14), 926 + EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpe5", 0x18), 927 + EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe6", 0x1C), 928 + EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe2", 0x20), 929 + EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpe3", 0x24), 930 + EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe4", 0x28), 931 + EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpf0", 0x2C), 932 + EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpe1", 0x30), 933 + EXYNOS_PIN_BANK_EINTG(2, 0x1a0, "gpg0", 0x34), 934 + }; 935 + 936 + static const struct samsung_pin_ctrl exynos8895_pin_ctrl[] __initconst = { 937 + { 938 + /* pin-controller instance 0 ALIVE data */ 939 + .pin_banks = exynos8895_pin_banks0, 940 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks0), 941 + .eint_gpio_init = exynos_eint_gpio_init, 942 + .eint_wkup_init = exynos_eint_wkup_init, 943 + .suspend = exynos_pinctrl_suspend, 944 + .resume = exynos_pinctrl_resume, 945 + }, { 946 + /* pin-controller instance 1 ABOX data */ 947 + .pin_banks = exynos8895_pin_banks1, 948 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks1), 949 + }, { 950 + /* pin-controller instance 2 VTS data */ 951 + .pin_banks = exynos8895_pin_banks2, 952 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks2), 953 + .eint_gpio_init = exynos_eint_gpio_init, 954 + }, { 955 + /* pin-controller instance 3 FSYS0 data */ 956 + .pin_banks = exynos8895_pin_banks3, 957 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks3), 958 + .eint_gpio_init = exynos_eint_gpio_init, 959 + .suspend = exynos_pinctrl_suspend, 960 + .resume = exynos_pinctrl_resume, 961 + }, { 962 + /* pin-controller instance 4 FSYS1 data */ 963 + .pin_banks = exynos8895_pin_banks4, 964 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks4), 965 + .eint_gpio_init = exynos_eint_gpio_init, 966 + .suspend = exynos_pinctrl_suspend, 967 + .resume = exynos_pinctrl_resume, 968 + }, { 969 + /* pin-controller instance 5 BUSC data */ 970 + .pin_banks = exynos8895_pin_banks5, 971 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks5), 972 + .eint_gpio_init = exynos_eint_gpio_init, 973 + .suspend = exynos_pinctrl_suspend, 974 + .resume = exynos_pinctrl_resume, 975 + }, { 976 + /* pin-controller instance 6 PERIC0 data */ 977 + .pin_banks = exynos8895_pin_banks6, 978 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks6), 979 + .eint_gpio_init = exynos_eint_gpio_init, 980 + .suspend = exynos_pinctrl_suspend, 981 + .resume = exynos_pinctrl_resume, 982 + }, { 983 + /* pin-controller instance 7 PERIC1 data */ 984 + .pin_banks = exynos8895_pin_banks7, 985 + .nr_banks = ARRAY_SIZE(exynos8895_pin_banks7), 986 + .eint_gpio_init = exynos_eint_gpio_init, 987 + .suspend = exynos_pinctrl_suspend, 988 + .resume = exynos_pinctrl_resume, 989 + }, 990 + }; 991 + 992 + const struct samsung_pinctrl_of_match_data exynos8895_of_data __initconst = { 993 + .ctrl = exynos8895_pin_ctrl, 994 + .num_ctrl = ARRAY_SIZE(exynos8895_pin_ctrl), 1170 995 }; 1171 996 1172 997 /*
+10
drivers/pinctrl/samsung/pinctrl-exynos.h
··· 141 141 .name = id \ 142 142 } 143 143 144 + #define EXYNOS8895_PIN_BANK_EINTG(pins, reg, id, offs) \ 145 + { \ 146 + .type = &exynos8895_bank_type_off, \ 147 + .pctl_offset = reg, \ 148 + .nr_pins = pins, \ 149 + .eint_type = EINT_TYPE_GPIO, \ 150 + .eint_offset = offs, \ 151 + .name = id \ 152 + } 153 + 144 154 #define EXYNOSV920_PIN_BANK_EINTG(pins, reg, id, con_offs, mask_offs, pend_offs) \ 145 155 { \ 146 156 .type = &exynos850_bank_type_off, \
+6
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 1477 1477 .data = &exynos7885_of_data }, 1478 1478 { .compatible = "samsung,exynos850-pinctrl", 1479 1479 .data = &exynos850_of_data }, 1480 + { .compatible = "samsung,exynos8895-pinctrl", 1481 + .data = &exynos8895_of_data }, 1482 + { .compatible = "samsung,exynos9810-pinctrl", 1483 + .data = &exynos9810_of_data }, 1484 + { .compatible = "samsung,exynos990-pinctrl", 1485 + .data = &exynos990_of_data }, 1480 1486 { .compatible = "samsung,exynosautov9-pinctrl", 1481 1487 .data = &exynosautov9_of_data }, 1482 1488 { .compatible = "samsung,exynosautov920-pinctrl",
+3
drivers/pinctrl/samsung/pinctrl-samsung.h
··· 384 384 extern const struct samsung_pinctrl_of_match_data exynos7_of_data; 385 385 extern const struct samsung_pinctrl_of_match_data exynos7885_of_data; 386 386 extern const struct samsung_pinctrl_of_match_data exynos850_of_data; 387 + extern const struct samsung_pinctrl_of_match_data exynos8895_of_data; 388 + extern const struct samsung_pinctrl_of_match_data exynos9810_of_data; 389 + extern const struct samsung_pinctrl_of_match_data exynos990_of_data; 387 390 extern const struct samsung_pinctrl_of_match_data exynosautov9_of_data; 388 391 extern const struct samsung_pinctrl_of_match_data exynosautov920_of_data; 389 392 extern const struct samsung_pinctrl_of_match_data fsd_of_data;
+1 -1
drivers/pinctrl/sophgo/Kconfig
··· 43 43 pinctrl-sg2000. 44 44 45 45 config PINCTRL_SOPHGO_SG2002 46 - tristate "Sophgo SG2000 SoC Pinctrl driver" 46 + tristate "Sophgo SG2002 SoC Pinctrl driver" 47 47 depends on ARCH_SOPHGO || COMPILE_TEST 48 48 depends on OF 49 49 select PINCTRL_SOPHGO_CV18XX
+17
drivers/pinctrl/spacemit/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + # 3 + # Sophgo SoC PINCTRL drivers 4 + # 5 + 6 + config PINCTRL_SPACEMIT_K1 7 + tristate "SpacemiT K1 SoC Pinctrl driver" 8 + depends on ARCH_SPACEMIT || COMPILE_TEST 9 + depends on OF 10 + select GENERIC_PINCTRL_GROUPS 11 + select GENERIC_PINMUX_FUNCTIONS 12 + select GENERIC_PINCONF 13 + help 14 + Say Y to select the pinctrl driver for K1 SoC. 15 + This pin controller allows selecting the mux function for 16 + each pin. This driver can also be built as a module called 17 + pinctrl-k1.
+3
drivers/pinctrl/spacemit/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + obj-$(CONFIG_PINCTRL_SPACEMIT_K1) += pinctrl-k1.o
+1051
drivers/pinctrl/spacemit/pinctrl-k1.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* Copyright (c) 2024 Yixun Lan <dlan@gentoo.org> */ 3 + 4 + #include <linux/bits.h> 5 + #include <linux/cleanup.h> 6 + #include <linux/io.h> 7 + #include <linux/of.h> 8 + #include <linux/platform_device.h> 9 + #include <linux/seq_file.h> 10 + #include <linux/spinlock.h> 11 + #include <linux/module.h> 12 + 13 + #include <linux/pinctrl/pinconf-generic.h> 14 + #include <linux/pinctrl/pinconf.h> 15 + #include <linux/pinctrl/pinctrl.h> 16 + #include <linux/pinctrl/pinmux.h> 17 + 18 + #include "../core.h" 19 + #include "../pinctrl-utils.h" 20 + #include "../pinconf.h" 21 + #include "../pinmux.h" 22 + #include "pinctrl-k1.h" 23 + 24 + /* 25 + * +---------+----------+-----------+--------+--------+----------+--------+ 26 + * | pull | drive | schmitter | slew | edge | strong | mux | 27 + * | up/down | strength | trigger | rate | detect | pull | mode | 28 + * +---------+----------+-----------+--------+--------+----------+--------+ 29 + * 3 bits 3 bits 2 bits 1 bit 3 bits 1 bit 3 bits 30 + */ 31 + 32 + #define PAD_MUX GENMASK(2, 0) 33 + #define PAD_STRONG_PULL BIT(3) 34 + #define PAD_EDGE_RISE BIT(4) 35 + #define PAD_EDGE_FALL BIT(5) 36 + #define PAD_EDGE_CLEAR BIT(6) 37 + #define PAD_SLEW_RATE GENMASK(12, 11) 38 + #define PAD_SLEW_RATE_EN BIT(7) 39 + #define PAD_SCHMITT GENMASK(9, 8) 40 + #define PAD_DRIVE GENMASK(12, 10) 41 + #define PAD_PULLDOWN BIT(13) 42 + #define PAD_PULLUP BIT(14) 43 + #define PAD_PULL_EN BIT(15) 44 + 45 + struct spacemit_pin { 46 + u16 pin; 47 + u16 flags; 48 + u8 gpiofunc; 49 + }; 50 + 51 + struct spacemit_pinctrl { 52 + struct device *dev; 53 + struct pinctrl_dev *pctl_dev; 54 + const struct spacemit_pinctrl_data *data; 55 + struct pinctrl_desc pdesc; 56 + 57 + struct mutex mutex; 58 + raw_spinlock_t lock; 59 + 60 + void __iomem *regs; 61 + }; 62 + 63 + struct spacemit_pinctrl_data { 64 + const struct pinctrl_pin_desc *pins; 65 + const struct spacemit_pin *data; 66 + u16 npins; 67 + }; 68 + 69 + struct spacemit_pin_mux_config { 70 + const struct spacemit_pin *pin; 71 + u32 config; 72 + }; 73 + 74 + struct spacemit_pin_drv_strength { 75 + u8 val; 76 + u32 mA; 77 + }; 78 + 79 + /* map pin id to pinctrl register offset, refer MFPR definition */ 80 + static unsigned int spacemit_pin_to_offset(unsigned int pin) 81 + { 82 + unsigned int offset = 0; 83 + 84 + switch (pin) { 85 + case 0 ... 85: 86 + offset = pin + 1; 87 + break; 88 + case 86 ... 92: 89 + offset = pin + 37; 90 + break; 91 + case 93 ... 97: 92 + offset = pin + 24; 93 + break; 94 + case 98: 95 + offset = 93; 96 + break; 97 + case 99: 98 + offset = 92; 99 + break; 100 + case 100: 101 + offset = 91; 102 + break; 103 + case 101: 104 + offset = 90; 105 + break; 106 + case 102: 107 + offset = 95; 108 + break; 109 + case 103: 110 + offset = 94; 111 + break; 112 + case 104 ... 110: 113 + offset = pin + 6; 114 + break; 115 + case 111 ... 127: 116 + offset = pin + 20; 117 + break; 118 + default: 119 + break; 120 + } 121 + 122 + return offset << 2; 123 + } 124 + 125 + static inline void __iomem *spacemit_pin_to_reg(struct spacemit_pinctrl *pctrl, 126 + unsigned int pin) 127 + { 128 + return pctrl->regs + spacemit_pin_to_offset(pin); 129 + } 130 + 131 + static u16 spacemit_dt_get_pin(u32 value) 132 + { 133 + return value >> 16; 134 + } 135 + 136 + static u16 spacemit_dt_get_pin_mux(u32 value) 137 + { 138 + return value & GENMASK(15, 0); 139 + } 140 + 141 + static const struct spacemit_pin *spacemit_get_pin(struct spacemit_pinctrl *pctrl, 142 + unsigned long pin) 143 + { 144 + const struct spacemit_pin *pdata = pctrl->data->data; 145 + int i; 146 + 147 + for (i = 0; i < pctrl->data->npins; i++) { 148 + if (pin == pdata[i].pin) 149 + return &pdata[i]; 150 + } 151 + 152 + return NULL; 153 + } 154 + 155 + static inline enum spacemit_pin_io_type spacemit_to_pin_io_type( 156 + const struct spacemit_pin *pin) 157 + { 158 + return K1_PIN_GET_IO_TYPE(pin->flags); 159 + } 160 + 161 + /* External: IO voltage via external source, can be 1.8V or 3.3V */ 162 + static const char * const io_type_desc[] = { 163 + "None", 164 + "Fixed/1V8", 165 + "Fixed/3V3", 166 + "External", 167 + }; 168 + 169 + static void spacemit_pctrl_dbg_show(struct pinctrl_dev *pctldev, 170 + struct seq_file *seq, unsigned int pin) 171 + { 172 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 173 + const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin); 174 + enum spacemit_pin_io_type type = spacemit_to_pin_io_type(spin); 175 + void __iomem *reg; 176 + u32 value; 177 + 178 + seq_printf(seq, "offset: 0x%04x ", spacemit_pin_to_offset(pin)); 179 + seq_printf(seq, "type: %s ", io_type_desc[type]); 180 + 181 + reg = spacemit_pin_to_reg(pctrl, pin); 182 + value = readl(reg); 183 + seq_printf(seq, "mux: %ld reg: 0x%04x", (value & PAD_MUX), value); 184 + } 185 + 186 + /* use IO high level output current as the table */ 187 + static struct spacemit_pin_drv_strength spacemit_ds_1v8_tbl[4] = { 188 + { 0, 11 }, 189 + { 2, 21 }, 190 + { 4, 32 }, 191 + { 6, 42 }, 192 + }; 193 + 194 + static struct spacemit_pin_drv_strength spacemit_ds_3v3_tbl[8] = { 195 + { 0, 7 }, 196 + { 2, 10 }, 197 + { 4, 13 }, 198 + { 6, 16 }, 199 + { 1, 19 }, 200 + { 3, 23 }, 201 + { 5, 26 }, 202 + { 7, 29 }, 203 + }; 204 + 205 + static inline u8 spacemit_get_ds_value(struct spacemit_pin_drv_strength *tbl, 206 + u32 num, u32 mA) 207 + { 208 + int i; 209 + 210 + for (i = 0; i < num; i++) 211 + if (mA <= tbl[i].mA) 212 + return tbl[i].val; 213 + 214 + return tbl[num - 1].val; 215 + } 216 + 217 + static inline u32 spacemit_get_ds_mA(struct spacemit_pin_drv_strength *tbl, 218 + u32 num, u32 val) 219 + { 220 + int i; 221 + 222 + for (i = 0; i < num; i++) 223 + if (val == tbl[i].val) 224 + return tbl[i].mA; 225 + 226 + return 0; 227 + } 228 + 229 + static inline u8 spacemit_get_driver_strength(enum spacemit_pin_io_type type, 230 + u32 mA) 231 + { 232 + switch (type) { 233 + case IO_TYPE_1V8: 234 + return spacemit_get_ds_value(spacemit_ds_1v8_tbl, 235 + ARRAY_SIZE(spacemit_ds_1v8_tbl), 236 + mA); 237 + case IO_TYPE_3V3: 238 + return spacemit_get_ds_value(spacemit_ds_3v3_tbl, 239 + ARRAY_SIZE(spacemit_ds_3v3_tbl), 240 + mA); 241 + default: 242 + return 0; 243 + } 244 + } 245 + 246 + static inline u32 spacemit_get_drive_strength_mA(enum spacemit_pin_io_type type, 247 + u32 value) 248 + { 249 + switch (type) { 250 + case IO_TYPE_1V8: 251 + return spacemit_get_ds_mA(spacemit_ds_1v8_tbl, 252 + ARRAY_SIZE(spacemit_ds_1v8_tbl), 253 + value & 0x6); 254 + case IO_TYPE_3V3: 255 + return spacemit_get_ds_mA(spacemit_ds_3v3_tbl, 256 + ARRAY_SIZE(spacemit_ds_3v3_tbl), 257 + value); 258 + default: 259 + return 0; 260 + } 261 + } 262 + 263 + static int spacemit_pctrl_check_power(struct pinctrl_dev *pctldev, 264 + struct device_node *dn, 265 + struct spacemit_pin_mux_config *pinmuxs, 266 + int num_pins, const char *grpname) 267 + { 268 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 269 + struct device *dev = pctrl->dev; 270 + enum spacemit_pin_io_type type; 271 + u32 power = 0, i; 272 + 273 + of_property_read_u32(dn, "power-source", &power); 274 + 275 + for (i = 0; i < num_pins; i++) { 276 + type = spacemit_to_pin_io_type(pinmuxs[i].pin); 277 + 278 + if (type != IO_TYPE_EXTERNAL) 279 + continue; 280 + 281 + switch (power) { 282 + case PIN_POWER_STATE_1V8: 283 + case PIN_POWER_STATE_3V3: 284 + break; 285 + default: 286 + dev_err(dev, "group %s has unsupported power\n", 287 + grpname); 288 + return -ENOTSUPP; 289 + } 290 + } 291 + 292 + return 0; 293 + } 294 + 295 + static int spacemit_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, 296 + struct device_node *np, 297 + struct pinctrl_map **maps, 298 + unsigned int *num_maps) 299 + { 300 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 301 + struct device *dev = pctrl->dev; 302 + struct device_node *child; 303 + struct pinctrl_map *map; 304 + const char **grpnames; 305 + const char *grpname; 306 + int ngroups = 0; 307 + int nmaps = 0; 308 + int ret; 309 + 310 + for_each_available_child_of_node(np, child) 311 + ngroups += 1; 312 + 313 + grpnames = devm_kcalloc(dev, ngroups, sizeof(*grpnames), GFP_KERNEL); 314 + if (!grpnames) 315 + return -ENOMEM; 316 + 317 + map = kcalloc(ngroups * 2, sizeof(*map), GFP_KERNEL); 318 + if (!map) 319 + return -ENOMEM; 320 + 321 + ngroups = 0; 322 + guard(mutex)(&pctrl->mutex); 323 + for_each_available_child_of_node_scoped(np, child) { 324 + struct spacemit_pin_mux_config *pinmuxs; 325 + unsigned int config, *pins; 326 + int i, npins; 327 + 328 + npins = of_property_count_u32_elems(child, "pinmux"); 329 + 330 + if (npins < 1) { 331 + dev_err(dev, "invalid pinctrl group %pOFn.%pOFn\n", 332 + np, child); 333 + return -EINVAL; 334 + } 335 + 336 + grpname = devm_kasprintf(dev, GFP_KERNEL, "%pOFn.%pOFn", 337 + np, child); 338 + if (!grpname) 339 + return -ENOMEM; 340 + 341 + grpnames[ngroups++] = grpname; 342 + 343 + pins = devm_kcalloc(dev, npins, sizeof(*pins), GFP_KERNEL); 344 + if (!pins) 345 + return -ENOMEM; 346 + 347 + pinmuxs = devm_kcalloc(dev, npins, sizeof(*pinmuxs), GFP_KERNEL); 348 + if (!pinmuxs) 349 + return -ENOMEM; 350 + 351 + for (i = 0; i < npins; i++) { 352 + ret = of_property_read_u32_index(child, "pinmux", 353 + i, &config); 354 + 355 + if (ret) 356 + return -EINVAL; 357 + 358 + pins[i] = spacemit_dt_get_pin(config); 359 + pinmuxs[i].config = config; 360 + pinmuxs[i].pin = spacemit_get_pin(pctrl, pins[i]); 361 + 362 + if (!pinmuxs[i].pin) 363 + return dev_err_probe(dev, -ENODEV, "failed to get pin %d\n", pins[i]); 364 + } 365 + 366 + ret = spacemit_pctrl_check_power(pctldev, child, pinmuxs, 367 + npins, grpname); 368 + if (ret < 0) 369 + return ret; 370 + 371 + map[nmaps].type = PIN_MAP_TYPE_MUX_GROUP; 372 + map[nmaps].data.mux.function = np->name; 373 + map[nmaps].data.mux.group = grpname; 374 + nmaps += 1; 375 + 376 + ret = pinctrl_generic_add_group(pctldev, grpname, 377 + pins, npins, pinmuxs); 378 + if (ret < 0) 379 + return dev_err_probe(dev, ret, "failed to add group %s: %d\n", grpname, ret); 380 + 381 + ret = pinconf_generic_parse_dt_config(child, pctldev, 382 + &map[nmaps].data.configs.configs, 383 + &map[nmaps].data.configs.num_configs); 384 + if (ret) 385 + return dev_err_probe(dev, ret, "failed to parse pin config of group %s\n", 386 + grpname); 387 + 388 + if (map[nmaps].data.configs.num_configs == 0) 389 + continue; 390 + 391 + map[nmaps].type = PIN_MAP_TYPE_CONFIGS_GROUP; 392 + map[nmaps].data.configs.group_or_pin = grpname; 393 + nmaps += 1; 394 + } 395 + 396 + ret = pinmux_generic_add_function(pctldev, np->name, 397 + grpnames, ngroups, NULL); 398 + if (ret < 0) { 399 + pinctrl_utils_free_map(pctldev, map, nmaps); 400 + return dev_err_probe(dev, ret, "error adding function %s\n", np->name); 401 + } 402 + 403 + *maps = map; 404 + *num_maps = nmaps; 405 + 406 + return 0; 407 + } 408 + 409 + static const struct pinctrl_ops spacemit_pctrl_ops = { 410 + .get_groups_count = pinctrl_generic_get_group_count, 411 + .get_group_name = pinctrl_generic_get_group_name, 412 + .get_group_pins = pinctrl_generic_get_group_pins, 413 + .pin_dbg_show = spacemit_pctrl_dbg_show, 414 + .dt_node_to_map = spacemit_pctrl_dt_node_to_map, 415 + .dt_free_map = pinctrl_utils_free_map, 416 + }; 417 + 418 + static int spacemit_pmx_set_mux(struct pinctrl_dev *pctldev, 419 + unsigned int fsel, unsigned int gsel) 420 + { 421 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 422 + const struct group_desc *group; 423 + const struct spacemit_pin_mux_config *configs; 424 + unsigned int i, mux; 425 + void __iomem *reg; 426 + 427 + group = pinctrl_generic_get_group(pctldev, gsel); 428 + if (!group) 429 + return -EINVAL; 430 + 431 + configs = group->data; 432 + 433 + for (i = 0; i < group->grp.npins; i++) { 434 + const struct spacemit_pin *spin = configs[i].pin; 435 + u32 value = configs[i].config; 436 + 437 + reg = spacemit_pin_to_reg(pctrl, spin->pin); 438 + mux = spacemit_dt_get_pin_mux(value); 439 + 440 + guard(raw_spinlock_irqsave)(&pctrl->lock); 441 + value = readl_relaxed(reg) & ~PAD_MUX; 442 + writel_relaxed(mux | value, reg); 443 + } 444 + 445 + return 0; 446 + } 447 + 448 + static int spacemit_request_gpio(struct pinctrl_dev *pctldev, 449 + struct pinctrl_gpio_range *range, 450 + unsigned int pin) 451 + { 452 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 453 + const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin); 454 + void __iomem *reg; 455 + 456 + reg = spacemit_pin_to_reg(pctrl, pin); 457 + guard(raw_spinlock_irqsave)(&pctrl->lock); 458 + writel_relaxed(spin->gpiofunc, reg); 459 + 460 + return 0; 461 + } 462 + 463 + static const struct pinmux_ops spacemit_pmx_ops = { 464 + .get_functions_count = pinmux_generic_get_function_count, 465 + .get_function_name = pinmux_generic_get_function_name, 466 + .get_function_groups = pinmux_generic_get_function_groups, 467 + .set_mux = spacemit_pmx_set_mux, 468 + .gpio_request_enable = spacemit_request_gpio, 469 + .strict = true, 470 + }; 471 + 472 + static int spacemit_pinconf_get(struct pinctrl_dev *pctldev, 473 + unsigned int pin, unsigned long *config) 474 + { 475 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 476 + int param = pinconf_to_config_param(*config); 477 + u32 value, arg = 0; 478 + 479 + if (!pin) 480 + return -EINVAL; 481 + 482 + value = readl(spacemit_pin_to_reg(pctrl, pin)); 483 + 484 + switch (param) { 485 + case PIN_CONFIG_SLEW_RATE: 486 + if (FIELD_GET(PAD_SLEW_RATE_EN, value)) 487 + arg = FIELD_GET(PAD_SLEW_RATE, value) + 2; 488 + else 489 + arg = 0; 490 + break; 491 + default: 492 + return -EINVAL; 493 + } 494 + 495 + *config = pinconf_to_config_packed(param, arg); 496 + 497 + return 0; 498 + } 499 + 500 + #define ENABLE_DRV_STRENGTH BIT(1) 501 + #define ENABLE_SLEW_RATE BIT(2) 502 + static int spacemit_pinconf_generate_config(const struct spacemit_pin *spin, 503 + unsigned long *configs, 504 + unsigned int num_configs, 505 + u32 *value) 506 + { 507 + enum spacemit_pin_io_type type; 508 + int i, param; 509 + u32 v = 0, voltage = 0, arg, val; 510 + u32 flag = 0, drv_strength, slew_rate; 511 + 512 + if (!spin) 513 + return -EINVAL; 514 + 515 + for (i = 0; i < num_configs; i++) { 516 + param = pinconf_to_config_param(configs[i]); 517 + arg = pinconf_to_config_argument(configs[i]); 518 + 519 + switch (param) { 520 + case PIN_CONFIG_BIAS_DISABLE: 521 + v &= ~(PAD_PULL_EN | PAD_PULLDOWN | PAD_PULLUP); 522 + v &= ~PAD_STRONG_PULL; 523 + break; 524 + case PIN_CONFIG_BIAS_PULL_DOWN: 525 + v &= ~(PAD_PULLUP | PAD_STRONG_PULL); 526 + v |= (PAD_PULL_EN | PAD_PULLDOWN); 527 + break; 528 + case PIN_CONFIG_BIAS_PULL_UP: 529 + v &= ~PAD_PULLDOWN; 530 + v |= (PAD_PULL_EN | PAD_PULLUP); 531 + 532 + if (arg == 1) 533 + v |= PAD_STRONG_PULL; 534 + break; 535 + case PIN_CONFIG_DRIVE_STRENGTH: 536 + flag |= ENABLE_DRV_STRENGTH; 537 + drv_strength = arg; 538 + break; 539 + case PIN_CONFIG_INPUT_SCHMITT: 540 + v &= ~PAD_SCHMITT; 541 + v |= FIELD_PREP(PAD_SCHMITT, arg); 542 + break; 543 + case PIN_CONFIG_POWER_SOURCE: 544 + voltage = arg; 545 + break; 546 + case PIN_CONFIG_SLEW_RATE: 547 + if (arg) { 548 + flag |= ENABLE_SLEW_RATE; 549 + v |= PAD_SLEW_RATE_EN; 550 + slew_rate = arg; 551 + } else { 552 + v &= ~PAD_SLEW_RATE_EN; 553 + } 554 + break; 555 + default: 556 + return -EINVAL; 557 + } 558 + } 559 + 560 + if (flag & ENABLE_DRV_STRENGTH) { 561 + type = spacemit_to_pin_io_type(spin); 562 + 563 + /* fix external io type */ 564 + if (type == IO_TYPE_EXTERNAL) { 565 + switch (voltage) { 566 + case 1800: 567 + type = IO_TYPE_1V8; 568 + break; 569 + case 3300: 570 + type = IO_TYPE_3V3; 571 + break; 572 + default: 573 + return -EINVAL; 574 + } 575 + } 576 + 577 + val = spacemit_get_driver_strength(type, drv_strength); 578 + 579 + v &= ~PAD_DRIVE; 580 + v |= FIELD_PREP(PAD_DRIVE, val); 581 + } 582 + 583 + if (flag & ENABLE_SLEW_RATE) { 584 + /* check, driver strength & slew rate */ 585 + if (flag & ENABLE_DRV_STRENGTH) { 586 + val = FIELD_GET(PAD_SLEW_RATE, v) + 2; 587 + if (slew_rate > 1 && slew_rate != val) { 588 + pr_err("slew rate conflict with drive strength\n"); 589 + return -EINVAL; 590 + } 591 + } else { 592 + v &= ~PAD_SLEW_RATE; 593 + slew_rate = slew_rate > 1 ? (slew_rate - 2) : 0; 594 + v |= FIELD_PREP(PAD_SLEW_RATE, slew_rate); 595 + } 596 + } 597 + 598 + *value = v; 599 + 600 + return 0; 601 + } 602 + 603 + static int spacemit_pin_set_config(struct spacemit_pinctrl *pctrl, 604 + unsigned int pin, u32 value) 605 + { 606 + const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin); 607 + void __iomem *reg; 608 + unsigned int mux; 609 + 610 + if (!pin) 611 + return -EINVAL; 612 + 613 + reg = spacemit_pin_to_reg(pctrl, spin->pin); 614 + 615 + guard(raw_spinlock_irqsave)(&pctrl->lock); 616 + mux = readl_relaxed(reg) & PAD_MUX; 617 + writel_relaxed(mux | value, reg); 618 + 619 + return 0; 620 + } 621 + 622 + static int spacemit_pinconf_set(struct pinctrl_dev *pctldev, 623 + unsigned int pin, unsigned long *configs, 624 + unsigned int num_configs) 625 + { 626 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 627 + const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin); 628 + u32 value; 629 + 630 + if (spacemit_pinconf_generate_config(spin, configs, num_configs, &value)) 631 + return -EINVAL; 632 + 633 + return spacemit_pin_set_config(pctrl, pin, value); 634 + } 635 + 636 + static int spacemit_pinconf_group_set(struct pinctrl_dev *pctldev, 637 + unsigned int gsel, 638 + unsigned long *configs, 639 + unsigned int num_configs) 640 + { 641 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 642 + const struct spacemit_pin *spin; 643 + const struct group_desc *group; 644 + u32 value; 645 + int i; 646 + 647 + group = pinctrl_generic_get_group(pctldev, gsel); 648 + if (!group) 649 + return -EINVAL; 650 + 651 + spin = spacemit_get_pin(pctrl, group->grp.pins[0]); 652 + if (spacemit_pinconf_generate_config(spin, configs, num_configs, &value)) 653 + return -EINVAL; 654 + 655 + for (i = 0; i < group->grp.npins; i++) 656 + spacemit_pin_set_config(pctrl, group->grp.pins[i], value); 657 + 658 + return 0; 659 + } 660 + 661 + static void spacemit_pinconf_dbg_pull(struct seq_file *seq, unsigned int value) 662 + { 663 + u32 normal, strong; 664 + 665 + if (!FIELD_GET(PAD_PULL_EN, value)) { 666 + seq_puts(seq, ", bias pull disabled"); 667 + return; 668 + } 669 + 670 + if (FIELD_GET(PAD_PULLDOWN, value)) 671 + seq_puts(seq, ", bias pull down"); 672 + 673 + normal = FIELD_GET(PAD_PULLUP, value); 674 + strong = FIELD_GET(PAD_STRONG_PULL, value); 675 + 676 + if (normal && strong) 677 + seq_puts(seq, ", bias strong pull up"); 678 + else if (normal) 679 + seq_puts(seq, ", bias normal pull up"); 680 + } 681 + 682 + static void spacemit_pinconf_dbg_show(struct pinctrl_dev *pctldev, 683 + struct seq_file *seq, unsigned int pin) 684 + { 685 + struct spacemit_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 686 + const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin); 687 + enum spacemit_pin_io_type type = spacemit_to_pin_io_type(spin); 688 + void __iomem *reg = spacemit_pin_to_reg(pctrl, pin); 689 + u32 value, tmp, mA; 690 + 691 + value = readl(reg); 692 + spacemit_pinconf_dbg_pull(seq, value); 693 + 694 + seq_printf(seq, ", io type (%s)", io_type_desc[type]); 695 + 696 + tmp = FIELD_GET(PAD_DRIVE, value); 697 + if (type == IO_TYPE_1V8 || type == IO_TYPE_3V3) { 698 + mA = spacemit_get_drive_strength_mA(type, tmp); 699 + seq_printf(seq, ", drive strength (%d mA)", mA); 700 + } 701 + 702 + /* drive strength depend on power source, so show all values */ 703 + if (type == IO_TYPE_EXTERNAL) 704 + seq_printf(seq, ", drive strength (%d or %d mA)", 705 + spacemit_get_drive_strength_mA(IO_TYPE_1V8, tmp), 706 + spacemit_get_drive_strength_mA(IO_TYPE_3V3, tmp)); 707 + 708 + seq_printf(seq, ", register (0x%04x)\n", value); 709 + } 710 + 711 + static const struct pinconf_ops spacemit_pinconf_ops = { 712 + .pin_config_get = spacemit_pinconf_get, 713 + .pin_config_set = spacemit_pinconf_set, 714 + .pin_config_group_set = spacemit_pinconf_group_set, 715 + .pin_config_dbg_show = spacemit_pinconf_dbg_show, 716 + .is_generic = true, 717 + }; 718 + 719 + static int spacemit_pinctrl_probe(struct platform_device *pdev) 720 + { 721 + struct device *dev = &pdev->dev; 722 + struct spacemit_pinctrl *pctrl; 723 + const struct spacemit_pinctrl_data *pctrl_data; 724 + int ret; 725 + 726 + pctrl_data = device_get_match_data(dev); 727 + if (!pctrl_data) 728 + return -ENODEV; 729 + 730 + if (pctrl_data->npins == 0) 731 + return dev_err_probe(dev, -EINVAL, "invalid pin data\n"); 732 + 733 + pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); 734 + if (!pctrl) 735 + return -ENOMEM; 736 + 737 + pctrl->regs = devm_platform_ioremap_resource(pdev, 0); 738 + if (IS_ERR(pctrl->regs)) 739 + return PTR_ERR(pctrl->regs); 740 + 741 + pctrl->pdesc.name = dev_name(dev); 742 + pctrl->pdesc.pins = pctrl_data->pins; 743 + pctrl->pdesc.npins = pctrl_data->npins; 744 + pctrl->pdesc.pctlops = &spacemit_pctrl_ops; 745 + pctrl->pdesc.pmxops = &spacemit_pmx_ops; 746 + pctrl->pdesc.confops = &spacemit_pinconf_ops; 747 + pctrl->pdesc.owner = THIS_MODULE; 748 + 749 + pctrl->data = pctrl_data; 750 + pctrl->dev = dev; 751 + raw_spin_lock_init(&pctrl->lock); 752 + mutex_init(&pctrl->mutex); 753 + 754 + platform_set_drvdata(pdev, pctrl); 755 + 756 + ret = devm_pinctrl_register_and_init(dev, &pctrl->pdesc, 757 + pctrl, &pctrl->pctl_dev); 758 + if (ret) 759 + return dev_err_probe(dev, ret, 760 + "fail to register pinctrl driver\n"); 761 + 762 + return pinctrl_enable(pctrl->pctl_dev); 763 + } 764 + 765 + static const struct pinctrl_pin_desc k1_pin_desc[] = { 766 + PINCTRL_PIN(0, "GPIO_00"), 767 + PINCTRL_PIN(1, "GPIO_01"), 768 + PINCTRL_PIN(2, "GPIO_02"), 769 + PINCTRL_PIN(3, "GPIO_03"), 770 + PINCTRL_PIN(4, "GPIO_04"), 771 + PINCTRL_PIN(5, "GPIO_05"), 772 + PINCTRL_PIN(6, "GPIO_06"), 773 + PINCTRL_PIN(7, "GPIO_07"), 774 + PINCTRL_PIN(8, "GPIO_08"), 775 + PINCTRL_PIN(9, "GPIO_09"), 776 + PINCTRL_PIN(10, "GPIO_10"), 777 + PINCTRL_PIN(11, "GPIO_11"), 778 + PINCTRL_PIN(12, "GPIO_12"), 779 + PINCTRL_PIN(13, "GPIO_13"), 780 + PINCTRL_PIN(14, "GPIO_14"), 781 + PINCTRL_PIN(15, "GPIO_15"), 782 + PINCTRL_PIN(16, "GPIO_16"), 783 + PINCTRL_PIN(17, "GPIO_17"), 784 + PINCTRL_PIN(18, "GPIO_18"), 785 + PINCTRL_PIN(19, "GPIO_19"), 786 + PINCTRL_PIN(20, "GPIO_20"), 787 + PINCTRL_PIN(21, "GPIO_21"), 788 + PINCTRL_PIN(22, "GPIO_22"), 789 + PINCTRL_PIN(23, "GPIO_23"), 790 + PINCTRL_PIN(24, "GPIO_24"), 791 + PINCTRL_PIN(25, "GPIO_25"), 792 + PINCTRL_PIN(26, "GPIO_26"), 793 + PINCTRL_PIN(27, "GPIO_27"), 794 + PINCTRL_PIN(28, "GPIO_28"), 795 + PINCTRL_PIN(29, "GPIO_29"), 796 + PINCTRL_PIN(30, "GPIO_30"), 797 + PINCTRL_PIN(31, "GPIO_31"), 798 + PINCTRL_PIN(32, "GPIO_32"), 799 + PINCTRL_PIN(33, "GPIO_33"), 800 + PINCTRL_PIN(34, "GPIO_34"), 801 + PINCTRL_PIN(35, "GPIO_35"), 802 + PINCTRL_PIN(36, "GPIO_36"), 803 + PINCTRL_PIN(37, "GPIO_37"), 804 + PINCTRL_PIN(38, "GPIO_38"), 805 + PINCTRL_PIN(39, "GPIO_39"), 806 + PINCTRL_PIN(40, "GPIO_40"), 807 + PINCTRL_PIN(41, "GPIO_41"), 808 + PINCTRL_PIN(42, "GPIO_42"), 809 + PINCTRL_PIN(43, "GPIO_43"), 810 + PINCTRL_PIN(44, "GPIO_44"), 811 + PINCTRL_PIN(45, "GPIO_45"), 812 + PINCTRL_PIN(46, "GPIO_46"), 813 + PINCTRL_PIN(47, "GPIO_47"), 814 + PINCTRL_PIN(48, "GPIO_48"), 815 + PINCTRL_PIN(49, "GPIO_49"), 816 + PINCTRL_PIN(50, "GPIO_50"), 817 + PINCTRL_PIN(51, "GPIO_51"), 818 + PINCTRL_PIN(52, "GPIO_52"), 819 + PINCTRL_PIN(53, "GPIO_53"), 820 + PINCTRL_PIN(54, "GPIO_54"), 821 + PINCTRL_PIN(55, "GPIO_55"), 822 + PINCTRL_PIN(56, "GPIO_56"), 823 + PINCTRL_PIN(57, "GPIO_57"), 824 + PINCTRL_PIN(58, "GPIO_58"), 825 + PINCTRL_PIN(59, "GPIO_59"), 826 + PINCTRL_PIN(60, "GPIO_60"), 827 + PINCTRL_PIN(61, "GPIO_61"), 828 + PINCTRL_PIN(62, "GPIO_62"), 829 + PINCTRL_PIN(63, "GPIO_63"), 830 + PINCTRL_PIN(64, "GPIO_64"), 831 + PINCTRL_PIN(65, "GPIO_65"), 832 + PINCTRL_PIN(66, "GPIO_66"), 833 + PINCTRL_PIN(67, "GPIO_67"), 834 + PINCTRL_PIN(68, "GPIO_68"), 835 + PINCTRL_PIN(69, "GPIO_69"), 836 + PINCTRL_PIN(70, "GPIO_70/PRI_DTI"), 837 + PINCTRL_PIN(71, "GPIO_71/PRI_TMS"), 838 + PINCTRL_PIN(72, "GPIO_72/PRI_TCK"), 839 + PINCTRL_PIN(73, "GPIO_73/PRI_TDO"), 840 + PINCTRL_PIN(74, "GPIO_74"), 841 + PINCTRL_PIN(75, "GPIO_75"), 842 + PINCTRL_PIN(76, "GPIO_76"), 843 + PINCTRL_PIN(77, "GPIO_77"), 844 + PINCTRL_PIN(78, "GPIO_78"), 845 + PINCTRL_PIN(79, "GPIO_79"), 846 + PINCTRL_PIN(80, "GPIO_80"), 847 + PINCTRL_PIN(81, "GPIO_81"), 848 + PINCTRL_PIN(82, "GPIO_82"), 849 + PINCTRL_PIN(83, "GPIO_83"), 850 + PINCTRL_PIN(84, "GPIO_84"), 851 + PINCTRL_PIN(85, "GPIO_85"), 852 + PINCTRL_PIN(86, "GPIO_86"), 853 + PINCTRL_PIN(87, "GPIO_87"), 854 + PINCTRL_PIN(88, "GPIO_88"), 855 + PINCTRL_PIN(89, "GPIO_89"), 856 + PINCTRL_PIN(90, "GPIO_90"), 857 + PINCTRL_PIN(91, "GPIO_91"), 858 + PINCTRL_PIN(92, "GPIO_92"), 859 + PINCTRL_PIN(93, "GPIO_93/PWR_SCL"), 860 + PINCTRL_PIN(94, "GPIO_94/PWR_SDA"), 861 + PINCTRL_PIN(95, "GPIO_95/VCX0_EN"), 862 + PINCTRL_PIN(96, "GPIO_96/DVL0"), 863 + PINCTRL_PIN(97, "GPIO_97/DVL1"), 864 + PINCTRL_PIN(98, "GPIO_98/QSPI_DAT3"), 865 + PINCTRL_PIN(99, "GPIO_99/QSPI_DAT2"), 866 + PINCTRL_PIN(100, "GPIO_100/QSPI_DAT1"), 867 + PINCTRL_PIN(101, "GPIO_101/QSPI_DAT0"), 868 + PINCTRL_PIN(102, "GPIO_102/QSPI_CLK"), 869 + PINCTRL_PIN(103, "GPIO_103/QSPI_CS1"), 870 + PINCTRL_PIN(104, "GPIO_104/MMC1_DAT3"), 871 + PINCTRL_PIN(105, "GPIO_105/MMC1_DAT2"), 872 + PINCTRL_PIN(106, "GPIO_106/MMC1_DAT1"), 873 + PINCTRL_PIN(107, "GPIO_107/MMC1_DAT0"), 874 + PINCTRL_PIN(108, "GPIO_108/MMC1_CMD"), 875 + PINCTRL_PIN(109, "GPIO_109/MMC1_CLK"), 876 + PINCTRL_PIN(110, "GPIO_110"), 877 + PINCTRL_PIN(111, "GPIO_111"), 878 + PINCTRL_PIN(112, "GPIO_112"), 879 + PINCTRL_PIN(113, "GPIO_113"), 880 + PINCTRL_PIN(114, "GPIO_114"), 881 + PINCTRL_PIN(115, "GPIO_115"), 882 + PINCTRL_PIN(116, "GPIO_116"), 883 + PINCTRL_PIN(117, "GPIO_117"), 884 + PINCTRL_PIN(118, "GPIO_118"), 885 + PINCTRL_PIN(119, "GPIO_119"), 886 + PINCTRL_PIN(120, "GPIO_120"), 887 + PINCTRL_PIN(121, "GPIO_121"), 888 + PINCTRL_PIN(122, "GPIO_122"), 889 + PINCTRL_PIN(123, "GPIO_123"), 890 + PINCTRL_PIN(124, "GPIO_124"), 891 + PINCTRL_PIN(125, "GPIO_125"), 892 + PINCTRL_PIN(126, "GPIO_126"), 893 + PINCTRL_PIN(127, "GPIO_127"), 894 + }; 895 + 896 + static const struct spacemit_pin k1_pin_data[ARRAY_SIZE(k1_pin_desc)] = { 897 + K1_FUNC_PIN(0, 0, IO_TYPE_1V8), 898 + K1_FUNC_PIN(1, 0, IO_TYPE_1V8), 899 + K1_FUNC_PIN(2, 0, IO_TYPE_1V8), 900 + K1_FUNC_PIN(3, 0, IO_TYPE_1V8), 901 + K1_FUNC_PIN(4, 0, IO_TYPE_1V8), 902 + K1_FUNC_PIN(5, 0, IO_TYPE_1V8), 903 + K1_FUNC_PIN(6, 0, IO_TYPE_1V8), 904 + K1_FUNC_PIN(7, 0, IO_TYPE_1V8), 905 + K1_FUNC_PIN(8, 0, IO_TYPE_1V8), 906 + K1_FUNC_PIN(9, 0, IO_TYPE_1V8), 907 + K1_FUNC_PIN(10, 0, IO_TYPE_1V8), 908 + K1_FUNC_PIN(11, 0, IO_TYPE_1V8), 909 + K1_FUNC_PIN(12, 0, IO_TYPE_1V8), 910 + K1_FUNC_PIN(13, 0, IO_TYPE_1V8), 911 + K1_FUNC_PIN(14, 0, IO_TYPE_1V8), 912 + K1_FUNC_PIN(15, 0, IO_TYPE_1V8), 913 + K1_FUNC_PIN(16, 0, IO_TYPE_1V8), 914 + K1_FUNC_PIN(17, 0, IO_TYPE_1V8), 915 + K1_FUNC_PIN(18, 0, IO_TYPE_1V8), 916 + K1_FUNC_PIN(19, 0, IO_TYPE_1V8), 917 + K1_FUNC_PIN(20, 0, IO_TYPE_1V8), 918 + K1_FUNC_PIN(21, 0, IO_TYPE_1V8), 919 + K1_FUNC_PIN(22, 0, IO_TYPE_1V8), 920 + K1_FUNC_PIN(23, 0, IO_TYPE_1V8), 921 + K1_FUNC_PIN(24, 0, IO_TYPE_1V8), 922 + K1_FUNC_PIN(25, 0, IO_TYPE_1V8), 923 + K1_FUNC_PIN(26, 0, IO_TYPE_1V8), 924 + K1_FUNC_PIN(27, 0, IO_TYPE_1V8), 925 + K1_FUNC_PIN(28, 0, IO_TYPE_1V8), 926 + K1_FUNC_PIN(29, 0, IO_TYPE_1V8), 927 + K1_FUNC_PIN(30, 0, IO_TYPE_1V8), 928 + K1_FUNC_PIN(31, 0, IO_TYPE_1V8), 929 + K1_FUNC_PIN(32, 0, IO_TYPE_1V8), 930 + K1_FUNC_PIN(33, 0, IO_TYPE_1V8), 931 + K1_FUNC_PIN(34, 0, IO_TYPE_1V8), 932 + K1_FUNC_PIN(35, 0, IO_TYPE_1V8), 933 + K1_FUNC_PIN(36, 0, IO_TYPE_1V8), 934 + K1_FUNC_PIN(37, 0, IO_TYPE_1V8), 935 + K1_FUNC_PIN(38, 0, IO_TYPE_1V8), 936 + K1_FUNC_PIN(39, 0, IO_TYPE_1V8), 937 + K1_FUNC_PIN(40, 0, IO_TYPE_1V8), 938 + K1_FUNC_PIN(41, 0, IO_TYPE_1V8), 939 + K1_FUNC_PIN(42, 0, IO_TYPE_1V8), 940 + K1_FUNC_PIN(43, 0, IO_TYPE_1V8), 941 + K1_FUNC_PIN(44, 0, IO_TYPE_1V8), 942 + K1_FUNC_PIN(45, 0, IO_TYPE_1V8), 943 + K1_FUNC_PIN(46, 0, IO_TYPE_1V8), 944 + K1_FUNC_PIN(47, 0, IO_TYPE_EXTERNAL), 945 + K1_FUNC_PIN(48, 0, IO_TYPE_EXTERNAL), 946 + K1_FUNC_PIN(49, 0, IO_TYPE_EXTERNAL), 947 + K1_FUNC_PIN(50, 0, IO_TYPE_EXTERNAL), 948 + K1_FUNC_PIN(51, 0, IO_TYPE_EXTERNAL), 949 + K1_FUNC_PIN(52, 0, IO_TYPE_EXTERNAL), 950 + K1_FUNC_PIN(53, 0, IO_TYPE_1V8), 951 + K1_FUNC_PIN(54, 0, IO_TYPE_1V8), 952 + K1_FUNC_PIN(55, 0, IO_TYPE_1V8), 953 + K1_FUNC_PIN(56, 0, IO_TYPE_1V8), 954 + K1_FUNC_PIN(57, 0, IO_TYPE_1V8), 955 + K1_FUNC_PIN(58, 0, IO_TYPE_1V8), 956 + K1_FUNC_PIN(59, 0, IO_TYPE_1V8), 957 + K1_FUNC_PIN(60, 0, IO_TYPE_1V8), 958 + K1_FUNC_PIN(61, 0, IO_TYPE_1V8), 959 + K1_FUNC_PIN(62, 0, IO_TYPE_1V8), 960 + K1_FUNC_PIN(63, 0, IO_TYPE_1V8), 961 + K1_FUNC_PIN(64, 0, IO_TYPE_1V8), 962 + K1_FUNC_PIN(65, 0, IO_TYPE_1V8), 963 + K1_FUNC_PIN(66, 0, IO_TYPE_1V8), 964 + K1_FUNC_PIN(67, 0, IO_TYPE_1V8), 965 + K1_FUNC_PIN(68, 0, IO_TYPE_1V8), 966 + K1_FUNC_PIN(69, 0, IO_TYPE_1V8), 967 + K1_FUNC_PIN(70, 1, IO_TYPE_1V8), 968 + K1_FUNC_PIN(71, 1, IO_TYPE_1V8), 969 + K1_FUNC_PIN(72, 1, IO_TYPE_1V8), 970 + K1_FUNC_PIN(73, 1, IO_TYPE_1V8), 971 + K1_FUNC_PIN(74, 0, IO_TYPE_1V8), 972 + K1_FUNC_PIN(75, 0, IO_TYPE_EXTERNAL), 973 + K1_FUNC_PIN(76, 0, IO_TYPE_EXTERNAL), 974 + K1_FUNC_PIN(77, 0, IO_TYPE_EXTERNAL), 975 + K1_FUNC_PIN(78, 0, IO_TYPE_EXTERNAL), 976 + K1_FUNC_PIN(79, 0, IO_TYPE_EXTERNAL), 977 + K1_FUNC_PIN(80, 0, IO_TYPE_EXTERNAL), 978 + K1_FUNC_PIN(81, 0, IO_TYPE_1V8), 979 + K1_FUNC_PIN(82, 0, IO_TYPE_1V8), 980 + K1_FUNC_PIN(83, 0, IO_TYPE_1V8), 981 + K1_FUNC_PIN(84, 0, IO_TYPE_1V8), 982 + K1_FUNC_PIN(85, 0, IO_TYPE_1V8), 983 + K1_FUNC_PIN(86, 0, IO_TYPE_1V8), 984 + K1_FUNC_PIN(87, 0, IO_TYPE_1V8), 985 + K1_FUNC_PIN(88, 0, IO_TYPE_1V8), 986 + K1_FUNC_PIN(89, 0, IO_TYPE_1V8), 987 + K1_FUNC_PIN(90, 0, IO_TYPE_1V8), 988 + K1_FUNC_PIN(91, 0, IO_TYPE_1V8), 989 + K1_FUNC_PIN(92, 0, IO_TYPE_1V8), 990 + K1_FUNC_PIN(93, 1, IO_TYPE_1V8), 991 + K1_FUNC_PIN(94, 1, IO_TYPE_1V8), 992 + K1_FUNC_PIN(95, 1, IO_TYPE_1V8), 993 + K1_FUNC_PIN(96, 1, IO_TYPE_1V8), 994 + K1_FUNC_PIN(97, 1, IO_TYPE_1V8), 995 + K1_FUNC_PIN(98, 1, IO_TYPE_EXTERNAL), 996 + K1_FUNC_PIN(99, 1, IO_TYPE_EXTERNAL), 997 + K1_FUNC_PIN(100, 1, IO_TYPE_EXTERNAL), 998 + K1_FUNC_PIN(101, 1, IO_TYPE_EXTERNAL), 999 + K1_FUNC_PIN(102, 1, IO_TYPE_EXTERNAL), 1000 + K1_FUNC_PIN(103, 1, IO_TYPE_EXTERNAL), 1001 + K1_FUNC_PIN(104, 4, IO_TYPE_EXTERNAL), 1002 + K1_FUNC_PIN(105, 4, IO_TYPE_EXTERNAL), 1003 + K1_FUNC_PIN(106, 4, IO_TYPE_EXTERNAL), 1004 + K1_FUNC_PIN(107, 4, IO_TYPE_EXTERNAL), 1005 + K1_FUNC_PIN(108, 4, IO_TYPE_EXTERNAL), 1006 + K1_FUNC_PIN(109, 4, IO_TYPE_EXTERNAL), 1007 + K1_FUNC_PIN(110, 0, IO_TYPE_1V8), 1008 + K1_FUNC_PIN(111, 0, IO_TYPE_1V8), 1009 + K1_FUNC_PIN(112, 0, IO_TYPE_1V8), 1010 + K1_FUNC_PIN(113, 0, IO_TYPE_1V8), 1011 + K1_FUNC_PIN(114, 0, IO_TYPE_1V8), 1012 + K1_FUNC_PIN(115, 0, IO_TYPE_1V8), 1013 + K1_FUNC_PIN(116, 0, IO_TYPE_1V8), 1014 + K1_FUNC_PIN(117, 0, IO_TYPE_1V8), 1015 + K1_FUNC_PIN(118, 0, IO_TYPE_1V8), 1016 + K1_FUNC_PIN(119, 0, IO_TYPE_1V8), 1017 + K1_FUNC_PIN(120, 0, IO_TYPE_1V8), 1018 + K1_FUNC_PIN(121, 0, IO_TYPE_1V8), 1019 + K1_FUNC_PIN(122, 0, IO_TYPE_1V8), 1020 + K1_FUNC_PIN(123, 0, IO_TYPE_1V8), 1021 + K1_FUNC_PIN(124, 0, IO_TYPE_1V8), 1022 + K1_FUNC_PIN(125, 0, IO_TYPE_1V8), 1023 + K1_FUNC_PIN(126, 0, IO_TYPE_1V8), 1024 + K1_FUNC_PIN(127, 0, IO_TYPE_1V8), 1025 + }; 1026 + 1027 + static const struct spacemit_pinctrl_data k1_pinctrl_data = { 1028 + .pins = k1_pin_desc, 1029 + .data = k1_pin_data, 1030 + .npins = ARRAY_SIZE(k1_pin_desc), 1031 + }; 1032 + 1033 + static const struct of_device_id k1_pinctrl_ids[] = { 1034 + { .compatible = "spacemit,k1-pinctrl", .data = &k1_pinctrl_data }, 1035 + { /* sentinel */ } 1036 + }; 1037 + MODULE_DEVICE_TABLE(of, k1_pinctrl_ids); 1038 + 1039 + static struct platform_driver k1_pinctrl_driver = { 1040 + .probe = spacemit_pinctrl_probe, 1041 + .driver = { 1042 + .name = "k1-pinctrl", 1043 + .suppress_bind_attrs = true, 1044 + .of_match_table = k1_pinctrl_ids, 1045 + }, 1046 + }; 1047 + module_platform_driver(k1_pinctrl_driver); 1048 + 1049 + MODULE_AUTHOR("Yixun Lan <dlan@gentoo.org>"); 1050 + MODULE_DESCRIPTION("Pinctrl driver for the SpacemiT K1 SoC"); 1051 + MODULE_LICENSE("GPL");
+40
drivers/pinctrl/spacemit/pinctrl-k1.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* Copyright (c) 2024 Yixun Lan <dlan@gentoo.org> */ 3 + 4 + #ifndef _PINCTRL_SPACEMIT_K1_H 5 + #define _PINCTRL_SPACEMIT_K1_H 6 + 7 + #include <linux/bits.h> 8 + #include <linux/bitfield.h> 9 + #include <linux/device.h> 10 + #include <linux/mutex.h> 11 + #include <linux/spinlock.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/pinctrl/pinctrl.h> 14 + #include <linux/pinctrl/pinconf.h> 15 + 16 + enum spacemit_pin_io_type { 17 + IO_TYPE_NONE = 0, 18 + IO_TYPE_1V8, 19 + IO_TYPE_3V3, 20 + IO_TYPE_EXTERNAL, 21 + }; 22 + 23 + #define PIN_POWER_STATE_1V8 1800 24 + #define PIN_POWER_STATE_3V3 3300 25 + 26 + #define K1_PIN_IO_TYPE GENMASK(2, 1) 27 + 28 + #define K1_PIN_CAP_IO_TYPE(type) \ 29 + FIELD_PREP_CONST(K1_PIN_IO_TYPE, type) 30 + #define K1_PIN_GET_IO_TYPE(val) \ 31 + FIELD_GET(K1_PIN_IO_TYPE, val) 32 + 33 + #define K1_FUNC_PIN(_id, _gpiofunc, _io) \ 34 + { \ 35 + .pin = (_id), \ 36 + .gpiofunc = (_gpiofunc), \ 37 + .flags = (K1_PIN_CAP_IO_TYPE(_io)), \ 38 + } 39 + 40 + #endif /* _PINCTRL_SPACEMIT_K1_H */
+1 -1
drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
··· 943 943 .of_match_table = sprd_pinctrl_of_match, 944 944 }, 945 945 .probe = sprd_pinctrl_probe, 946 - .remove_new = sprd_pinctrl_remove, 946 + .remove = sprd_pinctrl_remove, 947 947 .shutdown = sprd_pinctrl_shutdown, 948 948 }; 949 949 module_platform_driver(sprd_pinctrl_driver);
+1
include/linux/firmware/xlnx-zynqmp.h
··· 263 263 PM_QID_PINCTRL_GET_PIN_GROUPS = 11, 264 264 PM_QID_CLOCK_GET_NUM_CLOCKS = 12, 265 265 PM_QID_CLOCK_GET_MAX_DIVISOR = 13, 266 + PM_QID_PINCTRL_GET_ATTRIBUTES = 15, 266 267 }; 267 268 268 269 enum rpu_oper_mode {