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

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

Pull pin control updates from Linus Walleij:
"Nothing special, notably a lot of new Qualcomm hardware is supported,
a RISC-V reference SoC and then some cleanups both in code and device
tree bindings.

Core changes:

- Add PINCTRL_PINFUNCTION() macro and use it in several drivers

New drivers:

- New driver for the StarFive JH7110 SoC "sys" and "aon" (always-on)
pin controllers. (RISC-V.)

- New subdriver for the Qualcomm QDU1000/QRU1000 SoC pin controller

- New subdrivers for the Qualcomm SM8550 SoC and LPASS pin
controllers

- New subdriver for the Qualcomm SA8775P SoC pin controller

- New subdriver for the Qualcomm IPQ5332 SoC pin controller

- New (trivial) support for Qualcomm PM8550 and PMR735D PMIC pin
control

- New subdriver for the Mediatek MT7981 SoC pin controller

Improvements:

- Several cleanups and refactorings to the Intel drivers

- Add 4KOhm bias support to the Intel driver

- Use the NOIRQ_SYSTEM_SLEEP_PM_OPS for the AT91 driver

- Support general purpose clocks in the Qualcomm MSM8226 SoC

- Several conversions to use the new I2C .probe_new() call

- Massive clean-up of the Qualcomm Device Tree YAML schemas

- Add VIN[45] pins, groups and functions to the Renesas r8a77950 SoC
driver"

* tag 'pinctrl-v6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (118 commits)
pinctrl: qcom: Add support for i2c specific pull feature
pinctrl: starfive: Add StarFive JH7110 aon controller driver
pinctrl: starfive: Add StarFive JH7110 sys controller driver
dt-bindings: pinctrl: Add StarFive JH7110 aon pinctrl
dt-bindings: pinctrl: Add StarFive JH7110 sys pinctrl
pinctrl: add mt7981 pinctrl driver
dt-bindings: pinctrl: add bindings for MT7981 SoC
dt-bindings: pinctrl: rockchip,pinctrl: mark gpio sub nodes of pinctrl as deprecated
pinctrl: qcom: Introduce IPQ5332 TLMM driver
dt-bindings: pinctrl: qcom: add IPQ5332 pinctrl
dt-bindings: pinctrl: qcom: lpass-lpi: correct GPIO name pattern
pinctrl: qcom: pinctrl-sm8550-lpass-lpi: add SM8550 LPASS
dt-bindings: pinctrl: qcom,sm8550-lpass-lpi-pinctrl: add SM8550 LPASS
pinctrl: at91: use devm_kasprintf() to avoid potential leaks
dt-bindings: pinctrl: qcom: correct gpio-ranges in examples
dt-bindings: pinctrl: qcom,msm8994: correct number of GPIOs
dt-bindings: pinctrl: qcom,sdx55: correct GPIO name pattern
dt-bindings: pinctrl: qcom,msm8953: correct GPIO name pattern
dt-bindings: pinctrl: qcom,sm6375: correct GPIO name pattern and example
dt-bindings: pinctrl: qcom,msm8909: correct GPIO name pattern and example
...

+12973 -1383
-84
Documentation/devicetree/bindings/pinctrl/fsl,imx8mm-pinctrl.yaml
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/pinctrl/fsl,imx8mm-pinctrl.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Freescale IMX8MM IOMUX Controller 8 - 9 - maintainers: 10 - - Anson Huang <Anson.Huang@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 - properties: 17 - compatible: 18 - const: fsl,imx8mm-iomuxc 19 - 20 - reg: 21 - maxItems: 1 22 - 23 - # Client device subnode's properties 24 - patternProperties: 25 - 'grp$': 26 - type: object 27 - description: 28 - Pinctrl node's client devices use subnodes for desired pin configuration. 29 - Client device subnodes use below standard properties. 30 - 31 - properties: 32 - fsl,pins: 33 - description: 34 - each entry consists of 6 integers and represents the mux and config 35 - setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 36 - mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 37 - be found in <arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h>. The last 38 - integer CONFIG is the pad setting value like pull-up on this pin. Please 39 - refer to i.MX8M Mini Reference Manual for detailed CONFIG settings. 40 - $ref: /schemas/types.yaml#/definitions/uint32-matrix 41 - items: 42 - items: 43 - - description: | 44 - "mux_reg" indicates the offset of mux register. 45 - - description: | 46 - "conf_reg" indicates the offset of pad configuration register. 47 - - description: | 48 - "input_reg" indicates the offset of select input register. 49 - - description: | 50 - "mux_val" indicates the mux value to be applied. 51 - - description: | 52 - "input_val" indicates the select input value to be applied. 53 - - description: | 54 - "pad_setting" indicates the pad configuration value to be applied. 55 - 56 - required: 57 - - fsl,pins 58 - 59 - additionalProperties: false 60 - 61 - allOf: 62 - - $ref: "pinctrl.yaml#" 63 - 64 - required: 65 - - compatible 66 - - reg 67 - 68 - additionalProperties: false 69 - 70 - examples: 71 - # Pinmux controller node 72 - - | 73 - iomuxc: pinctrl@30330000 { 74 - compatible = "fsl,imx8mm-iomuxc"; 75 - reg = <0x30330000 0x10000>; 76 - 77 - pinctrl_uart2: uart2grp { 78 - fsl,pins = 79 - <0x23C 0x4A4 0x4FC 0x0 0x0 0x140>, 80 - <0x240 0x4A8 0x000 0x0 0x0 0x140>; 81 - }; 82 - }; 83 - 84 - ...
-84
Documentation/devicetree/bindings/pinctrl/fsl,imx8mn-pinctrl.yaml
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/pinctrl/fsl,imx8mn-pinctrl.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Freescale IMX8MN IOMUX Controller 8 - 9 - maintainers: 10 - - Anson Huang <Anson.Huang@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 - properties: 17 - compatible: 18 - const: fsl,imx8mn-iomuxc 19 - 20 - reg: 21 - maxItems: 1 22 - 23 - # Client device subnode's properties 24 - patternProperties: 25 - 'grp$': 26 - type: object 27 - description: 28 - Pinctrl node's client devices use subnodes for desired pin configuration. 29 - Client device subnodes use below standard properties. 30 - 31 - properties: 32 - fsl,pins: 33 - description: 34 - each entry consists of 6 integers and represents the mux and config 35 - setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 36 - mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 37 - be found in <arch/arm64/boot/dts/freescale/imx8mn-pinfunc.h>. The last 38 - integer CONFIG is the pad setting value like pull-up on this pin. Please 39 - refer to i.MX8M Nano Reference Manual for detailed CONFIG settings. 40 - $ref: /schemas/types.yaml#/definitions/uint32-matrix 41 - items: 42 - items: 43 - - description: | 44 - "mux_reg" indicates the offset of mux register. 45 - - description: | 46 - "conf_reg" indicates the offset of pad configuration register. 47 - - description: | 48 - "input_reg" indicates the offset of select input register. 49 - - description: | 50 - "mux_val" indicates the mux value to be applied. 51 - - description: | 52 - "input_val" indicates the select input value to be applied. 53 - - description: | 54 - "pad_setting" indicates the pad configuration value to be applied. 55 - 56 - required: 57 - - fsl,pins 58 - 59 - additionalProperties: false 60 - 61 - allOf: 62 - - $ref: "pinctrl.yaml#" 63 - 64 - required: 65 - - compatible 66 - - reg 67 - 68 - additionalProperties: false 69 - 70 - examples: 71 - # Pinmux controller node 72 - - | 73 - iomuxc: pinctrl@30330000 { 74 - compatible = "fsl,imx8mn-iomuxc"; 75 - reg = <0x30330000 0x10000>; 76 - 77 - pinctrl_uart2: uart2grp { 78 - fsl,pins = 79 - <0x23C 0x4A4 0x4FC 0x0 0x0 0x140>, 80 - <0x240 0x4A8 0x000 0x0 0x0 0x140>; 81 - }; 82 - }; 83 - 84 - ...
+18 -12
Documentation/devicetree/bindings/pinctrl/fsl,imx8mp-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/fsl,imx8m-pinctrl.yaml
··· 1 - # SPDX-License-Identifier: GPL-2.0 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 2 %YAML 1.2 3 3 --- 4 - $id: http://devicetree.org/schemas/pinctrl/fsl,imx8mp-pinctrl.yaml# 4 + $id: http://devicetree.org/schemas/pinctrl/fsl,imx8m-pinctrl.yaml# 5 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 6 6 7 - title: Freescale IMX8MP IOMUX Controller 7 + title: Freescale IMX8M IOMUX Controller 8 8 9 9 maintainers: 10 - - Anson Huang <Anson.Huang@nxp.com> 10 + - Peng Fan <peng.fan@nxp.com> 11 11 12 12 description: 13 13 Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory ··· 15 15 16 16 properties: 17 17 compatible: 18 - const: fsl,imx8mp-iomuxc 18 + enum: 19 + - fsl,imx8mm-iomuxc 20 + - fsl,imx8mn-iomuxc 21 + - fsl,imx8mp-iomuxc 22 + - fsl,imx8mq-iomuxc 19 23 20 24 reg: 21 25 maxItems: 1 ··· 38 34 each entry consists of 6 integers and represents the mux and config 39 35 setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 40 36 mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 41 - be found in <arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h>. The last 42 - integer CONFIG is the pad setting value like pull-up on this pin. Please 43 - refer to i.MX8M Plus Reference Manual for detailed CONFIG settings. 37 + be found in <arch/arm64/boot/dts/freescale/imx8m[m,n,p,q]-pinfunc.h>. 38 + The last integer CONFIG is the pad setting value like pull-up on this 39 + pin. Please refer to i.MX8M Mini/Nano/Plus/Quad Reference Manual for 40 + detailed CONFIG settings. 44 41 $ref: /schemas/types.yaml#/definitions/uint32-matrix 45 42 items: 46 43 items: ··· 56 51 - description: | 57 52 "input_val" indicates the select input value to be applied. 58 53 - description: | 59 - "pad_setting" indicates the pad configuration value to be applied. 54 + "pad_setting" indicates the pad configuration value to be 55 + applied. 60 56 61 57 required: 62 58 - fsl,pins ··· 77 71 # Pinmux controller node 78 72 - | 79 73 iomuxc: pinctrl@30330000 { 80 - compatible = "fsl,imx8mp-iomuxc"; 74 + compatible = "fsl,imx8mm-iomuxc"; 81 75 reg = <0x30330000 0x10000>; 82 76 83 77 pinctrl_uart2: uart2grp { 84 78 fsl,pins = 85 - <0x228 0x488 0x5F0 0x0 0x6 0x49>, 86 - <0x228 0x488 0x000 0x0 0x0 0x49>; 79 + <0x23C 0x4A4 0x4FC 0x0 0x0 0x140>, 80 + <0x240 0x4A8 0x000 0x0 0x0 0x140>; 87 81 }; 88 82 }; 89 83
-84
Documentation/devicetree/bindings/pinctrl/fsl,imx8mq-pinctrl.yaml
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/pinctrl/fsl,imx8mq-pinctrl.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Freescale IMX8MQ IOMUX Controller 8 - 9 - maintainers: 10 - - Anson Huang <Anson.Huang@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 - properties: 17 - compatible: 18 - const: fsl,imx8mq-iomuxc 19 - 20 - reg: 21 - maxItems: 1 22 - 23 - # Client device subnode's properties 24 - patternProperties: 25 - 'grp$': 26 - type: object 27 - description: 28 - Pinctrl node's client devices use subnodes for desired pin configuration. 29 - Client device subnodes use below standard properties. 30 - 31 - properties: 32 - fsl,pins: 33 - description: 34 - each entry consists of 6 integers and represents the mux and config 35 - setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 36 - mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 37 - be found in <arch/arm64/boot/dts/freescale/imx8mq-pinfunc.h>. The last 38 - integer CONFIG is the pad setting value like pull-up on this pin. Please 39 - refer to i.MX8M Quad Reference Manual for detailed CONFIG settings. 40 - $ref: /schemas/types.yaml#/definitions/uint32-matrix 41 - items: 42 - items: 43 - - description: | 44 - "mux_reg" indicates the offset of mux register. 45 - - description: | 46 - "conf_reg" indicates the offset of pad configuration register. 47 - - description: | 48 - "input_reg" indicates the offset of select input register. 49 - - description: | 50 - "mux_val" indicates the mux value to be applied. 51 - - description: | 52 - "input_val" indicates the select input value to be applied. 53 - - description: | 54 - "pad_setting" indicates the pad configuration value to be applied. 55 - 56 - required: 57 - - fsl,pins 58 - 59 - additionalProperties: false 60 - 61 - allOf: 62 - - $ref: "pinctrl.yaml#" 63 - 64 - required: 65 - - compatible 66 - - reg 67 - 68 - additionalProperties: false 69 - 70 - examples: 71 - # Pinmux controller node 72 - - | 73 - iomuxc: pinctrl@30330000 { 74 - compatible = "fsl,imx8mq-iomuxc"; 75 - reg = <0x30330000 0x10000>; 76 - 77 - pinctrl_uart1: uart1grp { 78 - fsl,pins = 79 - <0x234 0x49C 0x4F4 0x0 0x0 0x49>, 80 - <0x238 0x4A0 0x4F4 0x0 0x0 0x49>; 81 - }; 82 - }; 83 - 84 - ...
+6 -6
Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
··· 70 70 - $ref: "pinctrl.yaml#" 71 71 72 72 patternProperties: 73 - '-[0-9]+$': 73 + 'pins$': 74 74 type: object 75 75 additionalProperties: false 76 76 patternProperties: 77 - 'pins': 77 + '(^pins|pins?$)': 78 78 type: object 79 79 additionalProperties: false 80 80 description: | ··· 158 158 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>, 159 159 <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>; 160 160 161 - i2c0_pins_a: i2c0-0 { 161 + i2c0_pins_a: i2c0-pins { 162 162 pins1 { 163 163 pinmux = <MT8135_PIN_100_SDA0__FUNC_SDA0>, 164 164 <MT8135_PIN_101_SCL0__FUNC_SCL0>; ··· 166 166 }; 167 167 }; 168 168 169 - i2c1_pins_a: i2c1-0 { 169 + i2c1_pins_a: i2c1-pins { 170 170 pins { 171 171 pinmux = <MT8135_PIN_195_SDA1__FUNC_SDA1>, 172 172 <MT8135_PIN_196_SCL1__FUNC_SCL1>; ··· 174 174 }; 175 175 }; 176 176 177 - i2c2_pins_a: i2c2-0 { 177 + i2c2_pins_a: i2c2-pins { 178 178 pins1 { 179 179 pinmux = <MT8135_PIN_193_SDA2__FUNC_SDA2>; 180 180 bias-pull-down; ··· 186 186 }; 187 187 }; 188 188 189 - i2c3_pins_a: i2c3-0 { 189 + i2c3_pins_a: i2c3-pins { 190 190 pins1 { 191 191 pinmux = <MT8135_PIN_40_DAC_CLK__FUNC_GPIO40>, 192 192 <MT8135_PIN_41_DAC_WS__FUNC_GPIO41>;
+4 -4
Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml
··· 61 61 - "#interrupt-cells" 62 62 63 63 patternProperties: 64 - '-[0-9]+$': 64 + '-pins(-[a-z]+)?$': 65 65 type: object 66 66 additionalProperties: false 67 67 patternProperties: 68 - 'mux': 68 + '^mux(-|$)': 69 69 type: object 70 70 additionalProperties: false 71 71 description: | ··· 244 244 groups: 245 245 enum: [wf0_2g, wf0_5g] 246 246 247 - 'conf': 247 + '^conf(-|$)': 248 248 type: object 249 249 additionalProperties: false 250 250 description: | ··· 348 348 gpio-controller; 349 349 #gpio-cells = <2>; 350 350 351 - pinctrl_eth_default: eth-0 { 351 + pinctrl_eth_default: eth-pins { 352 352 mux-mdio { 353 353 groups = "mdc_mdio"; 354 354 function = "eth";
+475
Documentation/devicetree/bindings/pinctrl/mediatek,mt7981-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/mediatek,mt7981-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek MT7981 Pin Controller 8 + 9 + maintainers: 10 + - Daniel Golle <daniel@makrotopia.org> 11 + 12 + description: 13 + The MediaTek's MT7981 Pin controller is used to control SoC pins. 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - mediatek,mt7981-pinctrl 19 + 20 + reg: 21 + minItems: 9 22 + maxItems: 9 23 + 24 + reg-names: 25 + items: 26 + - const: gpio 27 + - const: iocfg_rt 28 + - const: iocfg_rm 29 + - const: iocfg_rb 30 + - const: iocfg_lb 31 + - const: iocfg_bl 32 + - const: iocfg_tm 33 + - const: iocfg_tl 34 + - const: eint 35 + 36 + gpio-controller: true 37 + 38 + "#gpio-cells": 39 + const: 2 40 + description: > 41 + Number of cells in GPIO specifier. Since the generic GPIO binding is used, 42 + the amount of cells must be specified as 2. See the below mentioned gpio 43 + binding representation for description of particular cells. 44 + 45 + gpio-ranges: 46 + minItems: 1 47 + maxItems: 5 48 + description: GPIO valid number range. 49 + 50 + interrupt-controller: true 51 + 52 + interrupts: 53 + maxItems: 1 54 + 55 + "#interrupt-cells": 56 + const: 2 57 + 58 + allOf: 59 + - $ref: pinctrl.yaml# 60 + 61 + required: 62 + - compatible 63 + - reg 64 + - reg-names 65 + - gpio-controller 66 + - "#gpio-cells" 67 + 68 + patternProperties: 69 + '-pins$': 70 + type: object 71 + additionalProperties: false 72 + 73 + patternProperties: 74 + '^.*mux.*$': 75 + type: object 76 + additionalProperties: false 77 + description: | 78 + pinmux configuration nodes. 79 + 80 + The following table shows the effective values of "group", "function" 81 + properties and chip pinout pins 82 + 83 + groups function pins (in pin#) 84 + --------------------------------------------------------------------- 85 + "wa_aice1" "wa_aice" 0, 1 86 + "wa_aice2" "wa_aice" 0, 1 87 + "wm_uart_0" "uart" 0, 1 88 + "dfd" "dfd" 0, 1, 4, 5 89 + "watchdog" "watchdog" 2 90 + "pcie_pereset" "pcie" 3 91 + "jtag" "jtag" 4, 5, 6, 7, 8 92 + "wm_jtag_0" "jtag" 4, 5, 6, 7, 8 93 + "wo0_jtag_0" "jtag" 9, 10, 11, 12, 13 94 + "uart2_0" "uart" 4, 5, 6, 7 95 + "gbe_led0" "led" 8 96 + "pta_ext_0" "pta" 4, 5, 6 97 + "pwm2" "pwm" 7 98 + "net_wo0_uart_txd_0" "uart" 8 99 + "spi1_0" "spi" 4, 5, 6, 7 100 + "i2c0_0" "i2c" 6, 7 101 + "dfd_ntrst" "dfd" 8 102 + "wm_aice1" "wa_aice" 9, 10 103 + "pwm0_0" "pwm" 13 104 + "pwm0_1" "pwm" 15 105 + "pwm1_0" "pwm" 14 106 + "pwm1_1" "pwm" 15 107 + "net_wo0_uart_txd_1" "uart" 14 108 + "net_wo0_uart_txd_2" "uart" 15 109 + "gbe_led1" "led" 13 110 + "pcm" "pcm" 9, 10, 11, 12, 13, 25 111 + "watchdog1" "watchdog" 13 112 + "udi" "udi" 9, 10, 11, 12, 13 113 + "drv_vbus" "usb" 14 114 + "emmc_45" "flash" 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 115 + "snfi" "flash" 16, 17, 18, 19, 20, 21 116 + "spi0" "spi" 16, 17, 18, 19 117 + "spi0_wp_hold" "spi" 20, 21 118 + "spi1_1" "spi" 22, 23, 24, 25 119 + "spi2" "spi" 26, 27, 28, 29 120 + "spi2_wp_hold" "spi" 30, 31 121 + "uart1_0" "uart" 16, 17, 18, 19 122 + "uart1_1" "uart" 26, 27, 28, 29 123 + "uart2_1" "uart" 22, 23, 24, 25 124 + "pta_ext_1" "pta" 22, 23, 24 125 + "wm_aurt_1" "uart" 20, 21 126 + "wm_aurt_2" "uart" 30, 31 127 + "wm_jtag_1" "jtag" 20, 21, 22, 23, 24 128 + "wo0_jtag_1" "jtag" 25, 26, 27, 28, 29 129 + "wa_aice3" "wa_aice" 28, 20 130 + "wm_aice2" "wa_aice" 30, 31 131 + "i2c0_1" "i2c" 30, 31 132 + "u2_phy_i2c" "i2c" 30, 31 133 + "uart0" "uart" 32, 33 134 + "sgmii1_phy_i2c" "i2c" 32, 33 135 + "u3_phy_i2c" "i2c" 32, 33 136 + "sgmii0_phy_i2c" "i2c" 32, 33 137 + "pcie_clk" "pcie" 34 138 + "pcie_wake" "pcie" 35 139 + "i2c0_2" "i2c" 36, 37 140 + "smi_mdc_mdio" "eth" 36, 37 141 + "gbe_ext_mdc_mdio" "eth" 36, 37 142 + "wf0_mode1" "eth" 40, 41, 42, 43, 44, 45, 46, 47, 48, 143 + 49, 50, 51, 52, 53, 54, 55, 56 144 + 145 + "wf0_mode3" "eth" 45, 46, 47, 48, 49, 51 146 + "wf2g_led0" "led" 30 147 + "wf2g_led1" "led" 34 148 + "wf5g_led0" "led" 31 149 + "wf5g_led1" "led" 35 150 + "mt7531_int" "eth" 38 151 + "ant_sel" "ant" 14, 15, 16, 17, 18, 19, 20, 21, 22 152 + 23, 24, 25, 34, 35 153 + 154 + $ref: /schemas/pinctrl/pinmux-node.yaml 155 + properties: 156 + function: 157 + description: 158 + A string containing the name of the function to mux to the group. 159 + enum: [wa_aice, dfd, jtag, pta, pcm, udi, usb, ant, eth, i2c, led, 160 + pwm, spi, uart, watchdog, flash, pcie] 161 + groups: 162 + description: 163 + An array of strings. Each string contains the name of a group. 164 + 165 + required: 166 + - function 167 + - groups 168 + 169 + allOf: 170 + - if: 171 + properties: 172 + function: 173 + const: wa_aice 174 + then: 175 + properties: 176 + groups: 177 + enum: [wa_aice1, wa_aice2, wm_aice1_1, wa_aice3, wm_aice1_2] 178 + - if: 179 + properties: 180 + function: 181 + const: dfd 182 + then: 183 + properties: 184 + groups: 185 + enum: [dfd, dfd_ntrst] 186 + - if: 187 + properties: 188 + function: 189 + const: jtag 190 + then: 191 + properties: 192 + groups: 193 + enum: [jtag, wm_jtag_0, wo0_jtag_0, wo0_jtag_1, wm_jtag_1] 194 + - if: 195 + properties: 196 + function: 197 + const: pta 198 + then: 199 + properties: 200 + groups: 201 + enum: [pta_ext_0, pta_ext_1] 202 + - if: 203 + properties: 204 + function: 205 + const: pcm 206 + then: 207 + properties: 208 + groups: 209 + enum: [pcm] 210 + - if: 211 + properties: 212 + function: 213 + const: udi 214 + then: 215 + properties: 216 + groups: 217 + enum: [udi] 218 + - if: 219 + properties: 220 + function: 221 + const: usb 222 + then: 223 + properties: 224 + groups: 225 + enum: [drv_vbus] 226 + - if: 227 + properties: 228 + function: 229 + const: ant 230 + then: 231 + properties: 232 + groups: 233 + enum: [ant_sel] 234 + - if: 235 + properties: 236 + function: 237 + const: eth 238 + then: 239 + properties: 240 + groups: 241 + enum: [smi_mdc_mdio, gbe_ext_mdc_mdio, wf0_mode1, wf0_mode3, 242 + mt7531_int] 243 + - if: 244 + properties: 245 + function: 246 + const: i2c 247 + then: 248 + properties: 249 + groups: 250 + enum: [i2c0_0, i2c0_1, u2_phy_i2c, sgmii1_phy_i2c, u3_phy_i2c, 251 + sgmii0_phy_i2c, i2c0_2] 252 + - if: 253 + properties: 254 + function: 255 + const: led 256 + then: 257 + properties: 258 + groups: 259 + enum: [gbe_led0, gbe_led1, wf2g_led0, wf2g_led1, wf5g_led0, wf5g_led1] 260 + - if: 261 + properties: 262 + function: 263 + const: pwm 264 + then: 265 + properties: 266 + groups: 267 + items: 268 + enum: [pwm2, pwm0_0, pwm0_1, pwm1_0, pwm1_1] 269 + maxItems: 3 270 + - if: 271 + properties: 272 + function: 273 + const: spi 274 + then: 275 + properties: 276 + groups: 277 + items: 278 + enum: [spi1_0, spi0, spi0_wp_hold, spi1_1, spi2, spi2_wp_hold] 279 + maxItems: 4 280 + - if: 281 + properties: 282 + function: 283 + const: uart 284 + then: 285 + properties: 286 + groups: 287 + items: 288 + enum: [wm_uart_0, uart2_0, net_wo0_uart_txd_0, 289 + net_wo0_uart_txd_1, net_wo0_uart_txd_2, uart1_0, 290 + uart1_1, uart2_1, wm_aurt_1, wm_aurt_2, uart0] 291 + - if: 292 + properties: 293 + function: 294 + const: watchdog 295 + then: 296 + properties: 297 + groups: 298 + enum: [watchdog] 299 + - if: 300 + properties: 301 + function: 302 + const: flash 303 + then: 304 + properties: 305 + groups: 306 + items: 307 + enum: [emmc_45, snfi] 308 + maxItems: 1 309 + - if: 310 + properties: 311 + function: 312 + const: pcie 313 + then: 314 + properties: 315 + groups: 316 + items: 317 + enum: [pcie_clk, pcie_wake, pcie_pereset] 318 + maxItems: 3 319 + 320 + '^.*conf.*$': 321 + type: object 322 + additionalProperties: false 323 + description: pinconf configuration nodes. 324 + $ref: /schemas/pinctrl/pincfg-node.yaml 325 + 326 + properties: 327 + pins: 328 + description: 329 + An array of strings. Each string contains the name of a pin. 330 + items: 331 + enum: [GPIO_WPS, GPIO_RESET, SYS_WATCHDOG, PCIE_PERESET_N, 332 + JTAG_JTDO, JTAG_JTDI, JTAG_JTMS, JTAG_JTCLK, JTAG_JTRST_N, 333 + WO_JTAG_JTDO, WO_JTAG_JTDI, WO_JTAG_JTMS, WO_JTAG_JTCLK, 334 + WO_JTAG_JTRST_N, USB_VBUS, PWM0, SPI0_CLK, SPI0_MOSI, 335 + SPI0_MISO, SPI0_CS, SPI0_HOLD, SPI0_WP, SPI1_CLK, SPI1_MOSI, 336 + SPI1_MISO, SPI1_CS, SPI2_CLK, SPI2_MOSI, SPI2_MISO, SPI2_CS, 337 + SPI2_HOLD, SPI2_WP, UART0_RXD, UART0_TXD, PCIE_CLK_REQ, 338 + PCIE_WAKE_N, SMI_MDC, SMI_MDIO, GBE_INT, GBE_RESET, 339 + WF_DIG_RESETB, WF_CBA_RESETB, WF_XO_REQ, WF_TOP_CLK, 340 + WF_TOP_DATA, WF_HB1, WF_HB2, WF_HB3, WF_HB4, WF_HB0, 341 + WF_HB0_B, WF_HB5, WF_HB6, WF_HB7, WF_HB8, WF_HB9, WF_HB10] 342 + maxItems: 57 343 + 344 + bias-disable: true 345 + 346 + bias-pull-up: 347 + oneOf: 348 + - type: boolean 349 + description: normal pull up. 350 + - enum: [100, 101, 102, 103] 351 + description: > 352 + PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0 defines in 353 + dt-bindings/pinctrl/mt65xx.h. 354 + 355 + bias-pull-down: 356 + oneOf: 357 + - type: boolean 358 + description: normal pull down. 359 + - enum: [100, 101, 102, 103] 360 + description: > 361 + PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0 defines in 362 + dt-bindings/pinctrl/mt65xx.h. 363 + 364 + input-enable: true 365 + 366 + input-disable: true 367 + 368 + output-enable: true 369 + 370 + output-low: true 371 + 372 + output-high: true 373 + 374 + input-schmitt-enable: true 375 + 376 + input-schmitt-disable: true 377 + 378 + drive-strength: 379 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 380 + 381 + mediatek,pull-up-adv: 382 + description: | 383 + Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3' 384 + Pull up setings for 2 pull resistors, R0 and R1. Valid arguments 385 + are described as below: 386 + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 387 + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 388 + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 389 + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 390 + $ref: /schemas/types.yaml#/definitions/uint32 391 + enum: [0, 1, 2, 3] 392 + 393 + mediatek,pull-down-adv: 394 + description: | 395 + Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3' 396 + Pull down setings for 2 pull resistors, R0 and R1. Valid arguments 397 + are described as below: 398 + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 399 + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 400 + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 401 + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 402 + $ref: /schemas/types.yaml#/definitions/uint32 403 + enum: [0, 1, 2, 3] 404 + 405 + required: 406 + - pins 407 + 408 + additionalProperties: false 409 + 410 + examples: 411 + - | 412 + #include <dt-bindings/interrupt-controller/irq.h> 413 + #include <dt-bindings/interrupt-controller/arm-gic.h> 414 + #include <dt-bindings/pinctrl/mt65xx.h> 415 + 416 + soc { 417 + #address-cells = <2>; 418 + #size-cells = <2>; 419 + pio: pinctrl@11d00000 { 420 + compatible = "mediatek,mt7981-pinctrl"; 421 + reg = <0 0x11d00000 0 0x1000>, 422 + <0 0x11c00000 0 0x1000>, 423 + <0 0x11c10000 0 0x1000>, 424 + <0 0x11d20000 0 0x1000>, 425 + <0 0x11e00000 0 0x1000>, 426 + <0 0x11e20000 0 0x1000>, 427 + <0 0x11f00000 0 0x1000>, 428 + <0 0x11f10000 0 0x1000>, 429 + <0 0x1000b000 0 0x1000>; 430 + reg-names = "gpio", "iocfg_rt", "iocfg_rm", 431 + "iocfg_rb", "iocfg_lb", "iocfg_bl", 432 + "iocfg_tm", "iocfg_tl", "eint"; 433 + gpio-controller; 434 + #gpio-cells = <2>; 435 + gpio-ranges = <&pio 0 0 56>; 436 + interrupt-controller; 437 + interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; 438 + interrupt-parent = <&gic>; 439 + #interrupt-cells = <2>; 440 + 441 + mdio_pins: mdio-pins { 442 + mux { 443 + function = "eth"; 444 + groups = "smi_mdc_mdio"; 445 + }; 446 + }; 447 + 448 + spi0_flash_pins: spi0-pins { 449 + mux { 450 + function = "spi"; 451 + groups = "spi0", "spi0_wp_hold"; 452 + }; 453 + 454 + conf-pu { 455 + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; 456 + drive-strength = <MTK_DRIVE_8mA>; 457 + bias-pull-up = <MTK_PUPD_SET_R1R0_11>; 458 + }; 459 + 460 + conf-pd { 461 + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; 462 + drive-strength = <MTK_DRIVE_8mA>; 463 + bias-pull-down = <MTK_PUPD_SET_R1R0_11>; 464 + }; 465 + }; 466 + 467 + pcie_pins: pcie-pins { 468 + mux { 469 + function = "pcie"; 470 + groups = "pcie_clk", "pcie_wake", "pcie_pereset"; 471 + }; 472 + }; 473 + 474 + }; 475 + };
+4 -4
Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml
··· 67 67 - gpio-ranges 68 68 69 69 patternProperties: 70 - '-[0-9]+$': 70 + '-pins(-[a-z]+)?$': 71 71 type: object 72 72 additionalProperties: false 73 73 patternProperties: 74 - 'pins': 74 + '^pins': 75 75 type: object 76 76 additionalProperties: false 77 77 description: | ··· 210 210 interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>; 211 211 #interrupt-cells = <2>; 212 212 213 - i2c0_pins_a: i2c-0 { 213 + i2c0_pins_a: i2c0-pins { 214 214 pins1 { 215 215 pinmux = <PINMUX_GPIO48__FUNC_SCL5>, 216 216 <PINMUX_GPIO49__FUNC_SDA5>; ··· 219 219 }; 220 220 }; 221 221 222 - i2c1_pins_a: i2c-1 { 222 + i2c1_pins_a: i2c1-pins { 223 223 pins { 224 224 pinmux = <PINMUX_GPIO50__FUNC_SCL3>, 225 225 <PINMUX_GPIO51__FUNC_SDA3>;
+197
Documentation/devicetree/bindings/pinctrl/mediatek,mt8365-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/mediatek,mt8365-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek MT8365 Pin Controller 8 + 9 + maintainers: 10 + - Zhiyong Tao <zhiyong.tao@mediatek.com> 11 + - Bernhard Rosenkränzer <bero@baylibre.com> 12 + 13 + description: | 14 + The MediaTek's MT8365 Pin controller is used to control SoC pins. 15 + 16 + properties: 17 + compatible: 18 + const: mediatek,mt8365-pinctrl 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + mediatek,pctl-regmap: 24 + $ref: /schemas/types.yaml#/definitions/phandle-array 25 + items: 26 + maxItems: 1 27 + minItems: 1 28 + maxItems: 2 29 + description: | 30 + Should be phandles of the syscfg node. 31 + 32 + gpio-controller: true 33 + 34 + "#gpio-cells": 35 + const: 2 36 + description: | 37 + Number of cells in GPIO specifier. Since the generic GPIO 38 + binding is used, the amount of cells must be specified as 2. See the below 39 + mentioned gpio binding representation for description of particular cells. 40 + 41 + interrupt-controller: true 42 + 43 + interrupts: 44 + maxItems: 1 45 + 46 + "#interrupt-cells": 47 + const: 2 48 + 49 + patternProperties: 50 + "-pins$": 51 + type: object 52 + additionalProperties: false 53 + patternProperties: 54 + "pins$": 55 + type: object 56 + additionalProperties: false 57 + description: | 58 + A pinctrl node should contain at least one subnode representing the 59 + pinctrl groups available on the machine. Each subnode will list the 60 + pins it needs, and how they should be configured, with regard to muxer 61 + configuration, pullups, drive strength, input enable/disable and input 62 + schmitt. 63 + $ref: /schemas/pinctrl/pincfg-node.yaml 64 + 65 + properties: 66 + pinmux: 67 + description: 68 + integer array, represents gpio pin number and mux setting. 69 + Supported pin number and mux varies for different SoCs, and are 70 + defined as macros in <soc>-pinfunc.h directly. 71 + 72 + bias-disable: true 73 + 74 + bias-pull-up: 75 + description: | 76 + Besides generic pinconfig options, it can be used as the pull up 77 + settings for 2 pull resistors, R0 and R1. User can configure those 78 + special pins. 79 + 80 + bias-pull-down: true 81 + 82 + input-enable: true 83 + 84 + input-disable: true 85 + 86 + output-low: true 87 + 88 + output-high: true 89 + 90 + input-schmitt-enable: true 91 + 92 + input-schmitt-disable: true 93 + 94 + mediatek,drive-strength-adv: 95 + description: | 96 + Describe the specific driving setup property. 97 + For I2C pins, the existing generic driving setup can only support 98 + 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they 99 + can support 0.125/0.25/0.5/1mA adjustment. If we enable specific 100 + driving setup, the existing generic setup will be disabled. 101 + The specific driving setup is controlled by E1E0EN. 102 + When E1=0/E0=0, the strength is 0.125mA. 103 + When E1=0/E0=1, the strength is 0.25mA. 104 + When E1=1/E0=0, the strength is 0.5mA. 105 + When E1=1/E0=1, the strength is 1mA. 106 + EN is used to enable or disable the specific driving setup. 107 + Valid arguments are described as below: 108 + 0: (E1, E0, EN) = (0, 0, 0) 109 + 1: (E1, E0, EN) = (0, 0, 1) 110 + 2: (E1, E0, EN) = (0, 1, 0) 111 + 3: (E1, E0, EN) = (0, 1, 1) 112 + 4: (E1, E0, EN) = (1, 0, 0) 113 + 5: (E1, E0, EN) = (1, 0, 1) 114 + 6: (E1, E0, EN) = (1, 1, 0) 115 + 7: (E1, E0, EN) = (1, 1, 1) 116 + So the valid arguments are from 0 to 7. 117 + $ref: /schemas/types.yaml#/definitions/uint32 118 + enum: [0, 1, 2, 3, 4, 5, 6, 7] 119 + 120 + mediatek,pull-up-adv: 121 + description: | 122 + Pull up setings for 2 pull resistors, R0 and R1. User can 123 + configure those special pins. Valid arguments are described as below: 124 + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 125 + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 126 + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 127 + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 128 + $ref: /schemas/types.yaml#/definitions/uint32 129 + enum: [0, 1, 2, 3] 130 + 131 + mediatek,pull-down-adv: 132 + description: | 133 + Pull down settings for 2 pull resistors, R0 and R1. User can 134 + configure those special pins. Valid arguments are described as below: 135 + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled. 136 + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. 137 + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. 138 + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. 139 + $ref: /schemas/types.yaml#/definitions/uint32 140 + enum: [0, 1, 2, 3] 141 + 142 + mediatek,tdsel: 143 + description: | 144 + An integer describing the steps for output level shifter duty 145 + cycle when asserted (high pulse width adjustment). Valid arguments 146 + are from 0 to 15. 147 + $ref: /schemas/types.yaml#/definitions/uint32 148 + 149 + mediatek,rdsel: 150 + description: | 151 + An integer describing the steps for input level shifter duty cycle 152 + when asserted (high pulse width adjustment). Valid arguments are 153 + from 0 to 63. 154 + $ref: /schemas/types.yaml#/definitions/uint32 155 + 156 + required: 157 + - pinmux 158 + 159 + required: 160 + - compatible 161 + - reg 162 + - gpio-controller 163 + - "#gpio-cells" 164 + 165 + allOf: 166 + - $ref: pinctrl.yaml# 167 + 168 + additionalProperties: false 169 + 170 + examples: 171 + - | 172 + #include <dt-bindings/interrupt-controller/arm-gic.h> 173 + #include <dt-bindings/pinctrl/mt8365-pinfunc.h> 174 + soc { 175 + #address-cells = <2>; 176 + #size-cells = <2>; 177 + 178 + pio: pinctrl@1000b000 { 179 + compatible = "mediatek,mt8365-pinctrl"; 180 + reg = <0 0x1000b000 0 0x1000>; 181 + mediatek,pctl-regmap = <&syscfg_pctl>; 182 + gpio-controller; 183 + #gpio-cells = <2>; 184 + interrupt-controller; 185 + #interrupt-cells = <2>; 186 + interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>; 187 + 188 + pio-pins { 189 + pins { 190 + pinmux = <MT8365_PIN_59_SDA1__FUNC_SDA1_0>, <MT8365_PIN_60_SCL1__FUNC_SCL1_0>; 191 + mediatek,pull-up-adv = <3>; 192 + mediatek,drive-strength-adv = <00>; 193 + bias-pull-up; 194 + }; 195 + }; 196 + }; 197 + };
+134
Documentation/devicetree/bindings/pinctrl/qcom,ipq5332-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,ipq5332-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm IPQ5332 TLMM pin controller 8 + 9 + maintainers: 10 + - Bjorn Andersson <andersson@kernel.org> 11 + - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 12 + 13 + description: | 14 + Top Level Mode Multiplexer pin controller in Qualcomm IPQ5332 SoC. 15 + 16 + allOf: 17 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 + 19 + properties: 20 + compatible: 21 + const: qcom,ipq5332-tlmm 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + interrupt-controller: true 30 + "#interrupt-cells": true 31 + gpio-controller: true 32 + "#gpio-cells": true 33 + gpio-ranges: true 34 + wakeup-parent: true 35 + 36 + gpio-reserved-ranges: 37 + minItems: 1 38 + maxItems: 27 39 + 40 + gpio-line-names: 41 + maxItems: 53 42 + 43 + patternProperties: 44 + "-state$": 45 + oneOf: 46 + - $ref: "#/$defs/qcom-ipq5332-tlmm-state" 47 + - patternProperties: 48 + "-pins$": 49 + $ref: "#/$defs/qcom-ipq5332-tlmm-state" 50 + additionalProperties: false 51 + 52 + $defs: 53 + qcom-ipq5332-tlmm-state: 54 + type: object 55 + description: 56 + Pinctrl node's client devices use subnodes for desired pin configuration. 57 + Client device subnodes use below standard properties. 58 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 59 + 60 + properties: 61 + pins: 62 + description: 63 + List of gpio pins affected by the properties specified in this 64 + subnode. 65 + items: 66 + pattern: "^gpio([0-9]|[1-4][0-9]|5[0-2])$" 67 + minItems: 1 68 + maxItems: 36 69 + 70 + function: 71 + description: 72 + Specify the alternative function to be configured for the specified 73 + pins. 74 + 75 + enum: [ atest_char, atest_char0, atest_char1, atest_char2, atest_char3, 76 + atest_tic, audio_pri, audio_pri0, audio_pri1, audio_sec, 77 + audio_sec0, audio_sec1, blsp0_i2c, blsp0_spi, blsp0_uart0, 78 + blsp0_uart1, blsp1_i2c0, blsp1_i2c1, blsp1_spi0, blsp1_spi1, 79 + blsp1_uart0, blsp1_uart1, blsp1_uart2, blsp2_i2c0, blsp2_i2c1, 80 + blsp2_spi, blsp2_spi0, blsp2_spi1, core_voltage, cri_trng0, 81 + cri_trng1, cri_trng2, cri_trng3, cxc_clk, cxc_data, dbg_out, 82 + gcc_plltest, gcc_tlmm, gpio, lock_det, mac0, mac1, mdc0, mdc1, 83 + mdio0, mdio1, pc, pcie0_clk, pcie0_wake, pcie1_clk, pcie1_wake, 84 + pcie2_clk, pcie2_wake, pll_test, prng_rosc0, prng_rosc1, 85 + prng_rosc2, prng_rosc3, pta, pwm0, pwm1, pwm2, pwm3, 86 + qdss_cti_trig_in_a0, qdss_cti_trig_in_a1, qdss_cti_trig_in_b0, 87 + qdss_cti_trig_in_b1, qdss_cti_trig_out_a0, 88 + qdss_cti_trig_out_a1, qdss_cti_trig_out_b0, 89 + qdss_cti_trig_out_b1, qdss_traceclk_a, qdss_traceclk_b, 90 + qdss_tracectl_a, qdss_tracectl_b, qdss_tracedata_a, 91 + qdss_tracedata_b, qspi_data, qspi_clk, qspi_cs, resout, rx0, 92 + rx1, sdc_data, sdc_clk, sdc_cmd, tsens_max, wci_txd, wci_rxd, 93 + wsi_clk, wsi_clk3, wsi_data, wsi_data3, wsis_reset, xfem ] 94 + 95 + bias-pull-down: true 96 + bias-pull-up: true 97 + bias-disable: true 98 + drive-strength: true 99 + input-enable: true 100 + output-high: true 101 + output-low: true 102 + 103 + required: 104 + - pins 105 + 106 + additionalProperties: false 107 + 108 + required: 109 + - compatible 110 + - reg 111 + 112 + additionalProperties: false 113 + 114 + examples: 115 + - | 116 + #include <dt-bindings/interrupt-controller/arm-gic.h> 117 + 118 + tlmm: pinctrl@1000000 { 119 + compatible = "qcom,ipq5332-tlmm"; 120 + reg = <0x01000000 0x300000>; 121 + gpio-controller; 122 + #gpio-cells = <0x2>; 123 + gpio-ranges = <&tlmm 0 0 53>; 124 + interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>; 125 + interrupt-controller; 126 + #interrupt-cells = <0x2>; 127 + 128 + serial0-state { 129 + pins = "gpio18", "gpio19"; 130 + function = "blsp0_uart0"; 131 + drive-strength = <8>; 132 + bias-pull-up; 133 + }; 134 + };
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,ipq6018-pinctrl.yaml
··· 19 19 reg: 20 20 maxItems: 1 21 21 22 - interrupts: true 22 + interrupts: 23 + maxItems: 1 24 + 23 25 interrupt-controller: true 24 26 "#interrupt-cells": true 25 27 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,ipq8074-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,mdm9607-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,mdm9615-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 '#interrupt-cells': true 26 28 gpio-controller: true
+6 -4
Documentation/devicetree/bindings/pinctrl/qcom,msm8226-pinctrl.yaml
··· 20 20 description: Specifies the base address and size of the TLMM register space 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true ··· 56 54 subnode. 57 55 items: 58 56 oneOf: 59 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-1][0-6])$" 57 + - pattern: "^gpio([0-9]|[1-9][0-9]|10[0-9]|11[0-6])$" 60 58 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data ] 61 59 minItems: 1 62 60 maxItems: 36 ··· 68 66 enum: [ gpio, cci_i2c0, blsp_uim1, blsp_uim2, blsp_uim3, blsp_uim5, 69 67 blsp_i2c1, blsp_i2c2, blsp_i2c3, blsp_i2c4, blsp_i2c5, blsp_spi1, 70 68 blsp_spi2, blsp_spi3, blsp_spi5, blsp_uart1, blsp_uart2, 71 - blsp_uart3, blsp_uart4, blsp_uart5, cam_mclk0, cam_mclk1, sdc3, 72 - wlan ] 69 + blsp_uart3, blsp_uart4, blsp_uart5, cam_mclk0, cam_mclk1, 70 + gp0_clk, gp1_clk, sdc3, wlan ] 73 71 74 72 bias-pull-down: true 75 73 bias-pull-up: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8660-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+5 -3
Documentation/devicetree/bindings/pinctrl/qcom,msm8909-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true ··· 63 61 subnode. 64 62 items: 65 63 oneOf: 66 - - pattern: "^gpio([0-9]|[1-9][0-9]|10[0-9]|11[0-7])$" 64 + - pattern: "^gpio([0-9]|[1-9][0-9]|10[0-9]|11[0-2])$" 67 65 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, 68 66 sdc2_data, qdsd_clk, qdsd_cmd, qdsd_data0, qdsd_data1, 69 67 qdsd_data2, qdsd_data3 ] ··· 127 125 interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 128 126 gpio-controller; 129 127 #gpio-cells = <2>; 130 - gpio-ranges = <&tlmm 0 0 117>; 128 + gpio-ranges = <&tlmm 0 0 113>; 131 129 interrupt-controller; 132 130 #interrupt-cells = <2>; 133 131
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8916-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+4 -2
Documentation/devicetree/bindings/pinctrl/qcom,msm8953-pinctrl.yaml
··· 19 19 reg: 20 20 maxItems: 1 21 21 22 - interrupts: true 22 + interrupts: 23 + maxItems: 1 24 + 23 25 interrupt-controller: true 24 26 "#interrupt-cells": true 25 27 gpio-controller: true ··· 53 51 subnode. 54 52 items: 55 53 oneOf: 56 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-7][0-9])$" 54 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-3][0-9]|14[01])$" 57 55 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk, sdc2_clk, 58 56 sdc2_cmd, sdc2_data, qdsd_clk, qdsd_cmd, qdsd_data0, 59 57 qdsd_data1, qdsd_data2, qdsd_data3 ]
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8976-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+6 -4
Documentation/devicetree/bindings/pinctrl/qcom,msm8994-pinctrl.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true ··· 34 32 35 33 gpio-reserved-ranges: 36 34 minItems: 1 37 - maxItems: 75 35 + maxItems: 73 38 36 39 37 gpio-line-names: 40 - maxItems: 150 38 + maxItems: 146 41 39 42 40 patternProperties: 43 41 "-state$": ··· 63 61 subnode. 64 62 items: 65 63 oneOf: 66 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9])$" 64 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-3][0-9]|14[0-5])$" 67 65 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk, sdc2_clk, 68 66 sdc2_cmd, sdc2_data, sdc3_clk, sdc3_cmd, sdc3_data ] 69 67 minItems: 1
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8996-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,msm8998-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true
+18
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
··· 40 40 - qcom,pm8350b-gpio 41 41 - qcom,pm8350c-gpio 42 42 - qcom,pm8450-gpio 43 + - qcom,pm8550-gpio 44 + - qcom,pm8550b-gpio 45 + - qcom,pm8550ve-gpio 46 + - qcom,pm8550vs-gpio 43 47 - qcom,pm8916-gpio 44 48 - qcom,pm8917-gpio 45 49 - qcom,pm8921-gpio ··· 56 52 - qcom,pmi8994-gpio 57 53 - qcom,pmi8998-gpio 58 54 - qcom,pmk8350-gpio 55 + - qcom,pmk8550-gpio 59 56 - qcom,pmm8155au-gpio 60 57 - qcom,pmp8074-gpio 61 58 - qcom,pmr735a-gpio 62 59 - qcom,pmr735b-gpio 60 + - qcom,pmr735d-gpio 63 61 - qcom,pms405-gpio 64 62 - qcom,pmx55-gpio 65 63 - qcom,pmx65-gpio ··· 117 111 enum: 118 112 - qcom,pm8008-gpio 119 113 - qcom,pmi8950-gpio 114 + - qcom,pmr735d-gpio 120 115 then: 121 116 properties: 122 117 gpio-line-names: ··· 153 146 enum: 154 147 - qcom,pm8018-gpio 155 148 - qcom,pm8019-gpio 149 + - qcom,pm8550vs-gpio 150 + - qcom,pmk8550-gpio 156 151 then: 157 152 properties: 158 153 gpio-line-names: ··· 171 162 enum: 172 163 - qcom,pm8226-gpio 173 164 - qcom,pm8350b-gpio 165 + - qcom,pm8550ve-gpio 174 166 - qcom,pm8950-gpio 175 167 then: 176 168 properties: ··· 246 236 - qcom,pm8038-gpio 247 237 - qcom,pm8150b-gpio 248 238 - qcom,pm8150l-gpio 239 + - qcom,pm8550-gpio 240 + - qcom,pm8550b-gpio 249 241 - qcom,pmc8180c-gpio 250 242 - qcom,pmp8074-gpio 251 243 - qcom,pms405-gpio ··· 423 411 - gpio1-gpio8 for pm8350b 424 412 - gpio1-gpio9 for pm8350c 425 413 - gpio1-gpio4 for pm8450 414 + - gpio1-gpio12 for pm8550 415 + - gpio1-gpio12 for pm8550b 416 + - gpio1-gpio8 for pm8550ve 417 + - gpio1-gpio6 for pm8550vs 426 418 - gpio1-gpio38 for pm8917 427 419 - gpio1-gpio44 for pm8921 428 420 - gpio1-gpio36 for pm8941 ··· 437 421 - gpio1-gpio2 for pmi8950 438 422 - gpio1-gpio10 for pmi8994 439 423 - gpio1-gpio4 for pmk8350 424 + - gpio1-gpio6 for pmk8550 440 425 - gpio1-gpio10 for pmm8155au 441 426 - gpio1-gpio12 for pmp8074 (holes on gpio1 and gpio12) 442 427 - gpio1-gpio4 for pmr735a 443 428 - gpio1-gpio4 for pmr735b 429 + - gpio1-gpio2 for pmr735d 444 430 - gpio1-gpio12 for pms405 (holes on gpio1, gpio9 445 431 and gpio10) 446 432 - gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10
+2 -2
Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.yaml
··· 74 74 oneOf: 75 75 - $ref: "#/$defs/qcom-pmic-mpp-state" 76 76 - patternProperties: 77 - "mpp": 77 + '-pins$': 78 78 $ref: "#/$defs/qcom-pmic-mpp-state" 79 79 additionalProperties: false 80 80 ··· 179 179 }; 180 180 181 181 default-state { 182 - gpio-mpp { 182 + gpio-pins { 183 183 pins = "mpp1", "mpp2", "mpp3", "mpp4"; 184 184 function = "digital"; 185 185 input-enable;
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,qcm2290-tlmm.yaml
··· 19 19 reg: 20 20 maxItems: 1 21 21 22 - interrupts: true 22 + interrupts: 23 + maxItems: 1 24 + 23 25 interrupt-controller: true 24 26 "#interrupt-cells": true 25 27 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,qcs404-pinctrl.yaml
··· 26 26 - const: north 27 27 - const: east 28 28 29 - interrupts: true 29 + interrupts: 30 + maxItems: 1 31 + 30 32 interrupt-controller: true 31 33 "#interrupt-cells": true 32 34 gpio-controller: true
+134
Documentation/devicetree/bindings/pinctrl/qcom,qdu1000-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,qdu1000-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. QDU1000/QRU1000 TLMM block 8 + 9 + maintainers: 10 + - Melody Olvera <quic_molvera@quicinc.com> 11 + 12 + description: | 13 + Top Level Mode Multiplexer pin controller found in the QDU1000 and 14 + QRU1000 SoCs. 15 + 16 + allOf: 17 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 + 19 + properties: 20 + compatible: 21 + const: qcom,qdu1000-tlmm 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: true 27 + interrupt-controller: true 28 + "#interrupt-cells": true 29 + gpio-controller: true 30 + 31 + gpio-reserved-ranges: 32 + minItems: 1 33 + maxItems: 76 34 + 35 + gpio-line-names: 36 + maxItems: 151 37 + 38 + "#gpio-cells": true 39 + gpio-ranges: true 40 + wakeup-parent: true 41 + 42 + patternProperties: 43 + "-state$": 44 + oneOf: 45 + - $ref: "#/$defs/qcom-qdu1000-tlmm-state" 46 + - patternProperties: 47 + "-pins$": 48 + $ref: "#/$defs/qcom-qdu1000-tlmm-state" 49 + additionalProperties: false 50 + 51 + $defs: 52 + qcom-qdu1000-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 + 59 + properties: 60 + pins: 61 + description: 62 + List of gpio pins affected by the properties specified in this 63 + subnode. 64 + items: 65 + oneOf: 66 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|150)$" 67 + - enum: [ sdc1_rclk, sdc1_clk, sdc1_cmd, sdc1_data ] 68 + minItems: 1 69 + maxItems: 36 70 + 71 + function: 72 + description: 73 + Specify the alternative function to be configured for the specified 74 + pins. 75 + enum: [ atest_char, atest_usb, char_exec, CMO_PRI, cmu_rng, 76 + dbg_out_clk, ddr_bist, ddr_pxi1, ddr_pxi2, ddr_pxi3, ddr_pxi4, 77 + ddr_pxi5, ddr_pxi6, ddr_pxi7, eth012_int_n, eth345_int_n, 78 + gcc_gp1, gcc_gp2, gcc_gp3, gpio, gps_pps_in, hardsync_pps_in, 79 + intr_c, jitter_bist_ref, pcie_clkreqn, phase_flag, pll_bist, 80 + pll_clk, prng_rosc, qdss_cti, qdss_gpio, qlink0_enable, 81 + qlink0_request, qlink0_wmss, qlink1_enable, qlink1_request, 82 + qlink1_wmss, qlink2_enable, qlink2_request, qlink2_wmss, 83 + qlink3_enable, qlink3_request, qlink3_wmss, qlink4_enable, 84 + qlink4_request, qlink4_wmss, qlink5_enable, qlink5_request, 85 + qlink5_wmss, qlink6_enable, qlink6_request, qlink6_wmss, 86 + qlink7_enable, qlink7_request, qlink7_wmss, qspi_clk, qspi_cs, 87 + qspi0, qspi1, qspi2, qspi3, qup00, qup01, qup02, qup03, qup04, 88 + qup05, qup06, qup07, qup08, qup10, qup11, qup12, qup13, qup14, 89 + qup15, qup16, qup17, qup20, qup21, qup22, SI5518_INT, smb_alert, 90 + smb_clk, smb_dat, tb_trig, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, 91 + tgu_ch4, tgu_ch5, tgu_ch6, tgu_ch7, tmess_prng0, tmess_prng1, 92 + tmess_prng2, tmess_prng3, tod_pps_in, tsense_pwm1, tsense_pwm2, 93 + usb2phy_ac, usb_con_det, usb_dfp_en, usb_phy, vfr_0, vfr_1, 94 + vsense_trigger ] 95 + 96 + bias-disable: true 97 + bias-pull-down: true 98 + bias-pull-up: true 99 + drive-strength: true 100 + input-enable: true 101 + output-high: true 102 + output-low: true 103 + 104 + required: 105 + - pins 106 + 107 + additionalProperties: false 108 + 109 + required: 110 + - compatible 111 + - reg 112 + 113 + additionalProperties: false 114 + 115 + examples: 116 + - | 117 + #include <dt-bindings/interrupt-controller/arm-gic.h> 118 + 119 + pinctrl@f000000 { 120 + compatible = "qcom,qdu1000-tlmm"; 121 + reg = <0xf000000 0x1000000>; 122 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 123 + gpio-controller; 124 + #gpio-cells = <2>; 125 + interrupt-controller; 126 + #interrupt-cells = <2>; 127 + gpio-ranges = <&tlmm 0 0 151>; 128 + wakeup-parent = <&pdc>; 129 + 130 + uart0-default-state { 131 + pins = "gpio6", "gpio7", "gpio8", "gpio9"; 132 + function = "qup00"; 133 + }; 134 + };
+138
Documentation/devicetree/bindings/pinctrl/qcom,sa8775p-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,sa8775p-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. SA8775P TLMM block 8 + 9 + maintainers: 10 + - Bartosz Golaszewski <bartosz.golaszewski@linaro.org> 11 + 12 + description: | 13 + Top Level Mode Multiplexer pin controller in Qualcomm SA8775P SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,sa8775p-tlmm 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: true 26 + interrupt-controller: true 27 + "#interrupt-cells": true 28 + gpio-controller: true 29 + "#gpio-cells": true 30 + gpio-ranges: true 31 + 32 + gpio-reserved-ranges: 33 + minItems: 1 34 + maxItems: 74 35 + 36 + gpio-line-names: 37 + maxItems: 148 38 + 39 + required: 40 + - compatible 41 + - reg 42 + 43 + additionalProperties: false 44 + 45 + patternProperties: 46 + "-state$": 47 + oneOf: 48 + - $ref: "#/$defs/qcom-sa8775p-tlmm-state" 49 + - patternProperties: 50 + "-pins$": 51 + $ref: "#/$defs/qcom-sa8775p-tlmm-state" 52 + additionalProperties: false 53 + 54 + $defs: 55 + qcom-sa8775p-tlmm-state: 56 + type: object 57 + description: 58 + Pinctrl node's client devices use subnodes for desired pin configuration. 59 + Client device subnodes use below standard properties. 60 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 61 + 62 + properties: 63 + pins: 64 + description: 65 + List of gpio pins affected by the properties specified in this 66 + subnode. 67 + items: 68 + oneOf: 69 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-3][0-9]|14[0-7])$" 70 + - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk, ufs_reset ] 71 + minItems: 1 72 + maxItems: 16 73 + 74 + function: 75 + description: 76 + Specify the alternative function to be configured for the specified 77 + pins. 78 + 79 + enum: [ atest_char, atest_usb2, audio_ref, cam_mclk, cci_async, cci_i2c, 80 + cci_timer0, cci_timer1, cci_timer2, cci_timer3, cci_timer4, 81 + cci_timer5, cci_timer6, cci_timer7, cci_timer8, cci_timer9, 82 + cri_trng, cri_trng0, cri_trng1, dbg_out, ddr_bist, ddr_pxi0, 83 + ddr_pxi1, ddr_pxi2, ddr_pxi3, ddr_pxi4, ddr_pxi5, edp0_hot, 84 + edp0_lcd, edp1_hot, edp1_lcd, edp2_hot, edp2_lcd, edp3_hot, 85 + edp3_lcd, emac0_mcg0, emac0_mcg1, emac0_mcg2, emac0_mcg3, 86 + emac0_mdc, emac0_mdio, emac0_ptp_aux, emac0_ptp_pps, emac1_mcg0, 87 + emac1_mcg1, emac1_mcg2, emac1_mcg3, emac1_mdc, emac1_mdio, 88 + emac1_ptp_aux, emac1_ptp_pps, gcc_gp1, gcc_gp2, gcc_gp3, 89 + gcc_gp4, gcc_gp5, hs0_mi2s, hs1_mi2s, hs2_mi2s, ibi_i3c, 90 + jitter_bist, mdp0_vsync0, mdp0_vsync1, mdp0_vsync2, mdp0_vsync3, 91 + mdp0_vsync4, mdp0_vsync5, mdp0_vsync6, mdp0_vsync7, mdp0_vsync8, 92 + mdp1_vsync0, mdp1_vsync1, mdp1_vsync2, mdp1_vsync3, mdp1_vsync4, 93 + mdp1_vsync5, mdp1_vsync6, mdp1_vsync7, mdp1_vsync8, mdp_vsync, 94 + mi2s1_data0, mi2s1_data1, mi2s1_sck, mi2s1_ws, mi2s2_data0, 95 + mi2s2_data1, mi2s2_sck, mi2s2_ws, mi2s_mclk0, mi2s_mclk1, 96 + pcie0_clkreq, pcie1_clkreq, phase_flag, pll_bist, pll_clk, 97 + prng_rosc0, prng_rosc1, prng_rosc2, prng_rosc3, qdss_cti, 98 + qdss_gpio, qup0_se0, qup0_se1, qup0_se2, qup0_se3, qup0_se4, 99 + qup0_se5, qup1_se0, qup1_se1, qup1_se2, qup1_se3, qup1_se4, 100 + qup1_se5, qup1_se6, qup2_se0, qup2_se1, qup2_se2, qup2_se3, 101 + qup2_se4, qup2_se5, qup2_se6, qup3_se0, sailss_emac0, 102 + sailss_ospi, sail_top, sgmii_phy, tb_trig, tgu_ch0, tgu_ch1, 103 + tgu_ch2, tgu_ch3, tgu_ch4, tgu_ch5, tsense_pwm1, tsense_pwm2, 104 + tsense_pwm3, tsense_pwm4, usb2phy_ac, vsense_trigger ] 105 + 106 + bias-disable: true 107 + bias-pull-down: true 108 + bias-pull-up: true 109 + drive-strength: true 110 + input-enable: true 111 + output-high: true 112 + output-low: true 113 + 114 + required: 115 + - pins 116 + 117 + additionalProperties: false 118 + 119 + examples: 120 + - | 121 + #include <dt-bindings/interrupt-controller/arm-gic.h> 122 + 123 + tlmm: pinctrl@f000000 { 124 + compatible = "qcom,sa8775p-tlmm"; 125 + reg = <0xf000000 0x1000000>; 126 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 127 + gpio-controller; 128 + #gpio-cells = <2>; 129 + interrupt-controller; 130 + #interrupt-cells = <2>; 131 + gpio-ranges = <&tlmm 0 0 148>; 132 + 133 + qup-uart10-state { 134 + pins = "gpio46", "gpio47"; 135 + function = "qup1_se3"; 136 + }; 137 + }; 138 + ...
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sc7180-pinctrl.yaml
··· 26 26 - const: north 27 27 - const: south 28 28 29 - interrupts: true 29 + interrupts: 30 + maxItems: 1 31 + 30 32 interrupt-controller: true 31 33 "#interrupt-cells": true 32 34 gpio-controller: true
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,sc7280-lpass-lpi-pinctrl.yaml
··· 59 59 subnode. 60 60 items: 61 61 oneOf: 62 - - pattern: "^gpio([0-9]|[1-9][0-9])$" 62 + - pattern: "^gpio([0-9]|1[0-4])$" 63 63 minItems: 1 64 64 maxItems: 15 65 65
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sc8180x-tlmm.yaml
··· 28 28 - const: east 29 29 - const: south 30 30 31 - interrupts: true 31 + interrupts: 32 + maxItems: 1 33 + 32 34 interrupt-controller: true 33 35 '#interrupt-cells': true 34 36 gpio-controller: true
+4 -6
Documentation/devicetree/bindings/pinctrl/qcom,sc8280xp-lpass-lpi-pinctrl.yaml
··· 65 65 List of gpio pins affected by the properties specified in this 66 66 subnode. 67 67 items: 68 - pattern: "^gpio([0-1]|1[0-8])$" 68 + pattern: "^gpio([0-9]|1[0-8])$" 69 69 70 70 function: 71 71 enum: [ swr_tx_clk, swr_tx_data, swr_rx_clk, swr_rx_data, ··· 94 94 2: Lower Slew rate (slower edges) 95 95 3: Reserved (No adjustments) 96 96 97 + bias-bus-hold: true 97 98 bias-pull-down: true 98 - 99 99 bias-pull-up: true 100 - 101 100 bias-disable: true 102 - 101 + input-enable: true 103 102 output-high: true 104 - 105 103 output-low: true 106 104 107 105 required: ··· 134 136 clock-names = "core", "audio"; 135 137 gpio-controller; 136 138 #gpio-cells = <2>; 137 - gpio-ranges = <&lpi_tlmm 0 0 18>; 139 + gpio-ranges = <&lpi_tlmm 0 0 19>; 138 140 139 141 dmic01-state { 140 142 dmic01-clk-pins {
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sc8280xp-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sdm630-pinctrl.yaml
··· 31 31 - const: center 32 32 - const: north 33 33 34 - interrupts: true 34 + interrupts: 35 + maxItems: 1 36 + 35 37 interrupt-controller: true 36 38 "#interrupt-cells": true 37 39 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sdm670-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true
+14 -1
Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.yaml
··· 23 23 reg: 24 24 maxItems: 1 25 25 26 - interrupts: true 26 + interrupts: 27 + maxItems: 1 28 + 27 29 interrupt-controller: true 28 30 "#interrupt-cells": true 29 31 gpio-controller: true ··· 49 47 "-pins$": 50 48 $ref: "#/$defs/qcom-sdm845-tlmm-state" 51 49 additionalProperties: false 50 + 51 + "-hog(-[0-9]+)?$": 52 + required: 53 + - gpio-hog 52 54 53 55 $defs: 54 56 qcom-sdm845-tlmm-state: ··· 123 117 124 118 examples: 125 119 - | 120 + #include <dt-bindings/gpio/gpio.h> 126 121 #include <dt-bindings/interrupt-controller/arm-gic.h> 127 122 128 123 pinctrl@3400000 { ··· 136 129 #interrupt-cells = <2>; 137 130 gpio-ranges = <&tlmm 0 0 151>; 138 131 wakeup-parent = <&pdc_intc>; 132 + 133 + ap-suspend-l-hog { 134 + gpio-hog; 135 + gpios = <126 GPIO_ACTIVE_LOW>; 136 + output-low; 137 + }; 139 138 140 139 cci0-default-state { 141 140 pins = "gpio17", "gpio18";
+4 -2
Documentation/devicetree/bindings/pinctrl/qcom,sdx55-pinctrl.yaml
··· 20 20 description: Specifies the base address and size of the TLMM register space 21 21 maxItems: 1 22 22 23 - interrupts: true 23 + interrupts: 24 + maxItems: 1 25 + 24 26 interrupt-controller: true 25 27 "#interrupt-cells": true 26 28 gpio-controller: true ··· 55 53 List of gpio pins affected by the properties specified in this subnode. 56 54 items: 57 55 oneOf: 58 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-1][0-6])$" 56 + - pattern: "^gpio([0-9]|[1-9][0-9]|10[0-7])$" 59 57 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data ] 60 58 minItems: 1 61 59 maxItems: 36
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sdx65-tlmm.yaml
··· 19 19 reg: 20 20 maxItems: 1 21 21 22 - interrupts: true 22 + interrupts: 23 + maxItems: 1 24 + 23 25 interrupt-controller: true 24 26 "#interrupt-cells": true 25 27 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sm6115-tlmm.yaml
··· 26 26 - const: south 27 27 - const: east 28 28 29 - interrupts: true 29 + interrupts: 30 + maxItems: 1 31 + 30 32 interrupt-controller: true 31 33 "#interrupt-cells": true 32 34 gpio-controller: true
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sm6125-tlmm.yaml
··· 27 27 - const: south 28 28 - const: east 29 29 30 - interrupts: true 30 + interrupts: 31 + maxItems: 1 32 + 31 33 interrupt-controller: true 32 34 "#interrupt-cells": true 33 35 gpio-controller: true
+23 -4
Documentation/devicetree/bindings/pinctrl/qcom,sm6350-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + minItems: 9 27 + maxItems: 9 28 + 26 29 interrupt-controller: true 27 30 "#interrupt-cells": true 28 31 gpio-controller: true 29 - gpio-reserved-ranges: true 32 + 33 + gpio-reserved-ranges: 34 + minItems: 1 35 + maxItems: 78 36 + 37 + gpio-line-names: 38 + maxItems: 156 39 + 30 40 "#gpio-cells": true 31 41 gpio-ranges: true 32 42 wakeup-parent: true ··· 71 61 subnode. 72 62 items: 73 63 oneOf: 74 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-7])$" 64 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-5])$" 75 65 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data ] 76 66 minItems: 1 77 67 maxItems: 36 ··· 128 118 pinctrl@f100000 { 129 119 compatible = "qcom,sm6350-tlmm"; 130 120 reg = <0x0f100000 0x300000>; 131 - interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 121 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>, 122 + <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>, 123 + <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>, 124 + <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>, 125 + <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>, 126 + <GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH>, 127 + <GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>, 128 + <GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>, 129 + <GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>; 130 + 132 131 gpio-controller; 133 132 #gpio-cells = <2>; 134 133 interrupt-controller;
+5 -3
Documentation/devicetree/bindings/pinctrl/qcom,sm6375-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true ··· 63 61 subnode. 64 62 items: 65 63 oneOf: 66 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-6])$" 64 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-5])$" 67 65 - enum: [ ufs_reset, sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, 68 66 sdc2_cmd, sdc2_data ] 69 67 minItems: 1 ··· 134 132 #gpio-cells = <2>; 135 133 interrupt-controller; 136 134 #interrupt-cells = <2>; 137 - gpio-ranges = <&tlmm 0 0 157>; 135 + gpio-ranges = <&tlmm 0 0 157>; /* GPIOs + ufs_reset */ 138 136 139 137 gpio-wo-subnode-state { 140 138 pins = "gpio1";
+3 -1
Documentation/devicetree/bindings/pinctrl/qcom,sm8150-pinctrl.yaml
··· 27 27 - const: north 28 28 - const: south 29 29 30 - interrupts: true 30 + interrupts: 31 + maxItems: 1 32 + 31 33 interrupt-controller: true 32 34 "#interrupt-cells": true 33 35 gpio-controller: true
+1 -1
Documentation/devicetree/bindings/pinctrl/qcom,sm8250-lpass-lpi-pinctrl.yaml
··· 64 64 subnode. 65 65 items: 66 66 oneOf: 67 - - pattern: "^gpio([0-9]|[1-9][0-9])$" 67 + - pattern: "^gpio([0-9]|1[0-3])$" 68 68 minItems: 1 69 69 maxItems: 14 70 70
+4 -2
Documentation/devicetree/bindings/pinctrl/qcom,sm8250-pinctrl.yaml
··· 25 25 - const: south 26 26 - const: north 27 27 28 - interrupts: true 28 + interrupts: 29 + maxItems: 1 30 + 29 31 interrupt-controller: true 30 32 "#interrupt-cells": true 31 33 gpio-controller: true ··· 131 129 #gpio-cells = <2>; 132 130 interrupt-controller; 133 131 #interrupt-cells = <2>; 134 - gpio-ranges = <&tlmm 0 0 180>; 132 + gpio-ranges = <&tlmm 0 0 181>; /* GPIOs + ufs_reset */ 135 133 wakeup-parent = <&pdc>; 136 134 };
+14 -4
Documentation/devicetree/bindings/pinctrl/qcom,sm8350-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true 29 - gpio-reserved-ranges: true 31 + 32 + gpio-reserved-ranges: 33 + minItems: 1 34 + maxItems: 102 35 + 36 + gpio-line-names: 37 + maxItems: 203 38 + 30 39 "#gpio-cells": true 31 40 gpio-ranges: true 32 41 wakeup-parent: true ··· 70 61 subnode. 71 62 items: 72 63 oneOf: 73 - - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-3])$" 64 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-2])$" 74 65 - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data ] 75 66 minItems: 1 76 67 maxItems: 36 ··· 109 100 bias-pull-down: true 110 101 bias-pull-up: true 111 102 drive-strength: true 103 + input-disable: true 112 104 input-enable: true 113 105 output-high: true 114 106 output-low: true ··· 130 120 #gpio-cells = <2>; 131 121 interrupt-controller; 132 122 #interrupt-cells = <2>; 133 - gpio-ranges = <&tlmm 0 0 203>; 123 + gpio-ranges = <&tlmm 0 0 204>; /* GPIOs + ufs_reset */ 134 124 135 125 gpio-wo-subnode-state { 136 126 pins = "gpio1";
+3 -5
Documentation/devicetree/bindings/pinctrl/qcom,sm8450-lpass-lpi-pinctrl.yaml
··· 65 65 List of gpio pins affected by the properties specified in this 66 66 subnode. 67 67 items: 68 - pattern: "^gpio([0-9]|[1-2][0-9])$" 68 + pattern: "^gpio([0-9]|1[0-9]|2[0-2])$" 69 69 70 70 function: 71 71 enum: [ swr_tx_clk, swr_tx_data, swr_rx_clk, swr_rx_data, ··· 96 96 2: Lower Slew rate (slower edges) 97 97 3: Reserved (No adjustments) 98 98 99 + bias-bus-hold: true 99 100 bias-pull-down: true 100 - 101 101 bias-pull-up: true 102 - 103 102 bias-disable: true 104 - 103 + input-enable: true 105 104 output-high: true 106 - 107 105 output-low: true 108 106 109 107 required:
+4 -2
Documentation/devicetree/bindings/pinctrl/qcom,sm8450-tlmm.yaml
··· 22 22 reg: 23 23 maxItems: 1 24 24 25 - interrupts: true 25 + interrupts: 26 + maxItems: 1 27 + 26 28 interrupt-controller: true 27 29 "#interrupt-cells": true 28 30 gpio-controller: true ··· 34 32 maxItems: 105 35 33 36 34 gpio-line-names: 37 - maxItems: 209 35 + maxItems: 210 38 36 39 37 "#gpio-cells": true 40 38 gpio-ranges: true
+148
Documentation/devicetree/bindings/pinctrl/qcom,sm8550-lpass-lpi-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/qcom,sm8550-lpass-lpi-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm SM8550 SoC LPASS LPI TLMM 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 11 + - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 12 + 13 + description: 14 + Top Level Mode Multiplexer pin controller in the Low Power Audio SubSystem 15 + (LPASS) Low Power Island (LPI) of Qualcomm SM8550 SoC. 16 + 17 + properties: 18 + compatible: 19 + const: qcom,sm8550-lpass-lpi-pinctrl 20 + 21 + reg: 22 + items: 23 + - description: LPASS LPI TLMM Control and Status registers 24 + - description: LPASS LPI pins SLEW registers 25 + 26 + clocks: 27 + items: 28 + - description: LPASS Core voting clock 29 + - description: LPASS Audio voting clock 30 + 31 + clock-names: 32 + items: 33 + - const: core 34 + - const: audio 35 + 36 + gpio-controller: true 37 + 38 + "#gpio-cells": 39 + description: Specifying the pin number and flags, as defined in 40 + include/dt-bindings/gpio/gpio.h 41 + const: 2 42 + 43 + gpio-ranges: 44 + maxItems: 1 45 + 46 + patternProperties: 47 + "-state$": 48 + oneOf: 49 + - $ref: "#/$defs/qcom-sm8550-lpass-state" 50 + - patternProperties: 51 + "-pins$": 52 + $ref: "#/$defs/qcom-sm8550-lpass-state" 53 + additionalProperties: false 54 + 55 + $defs: 56 + qcom-sm8550-lpass-state: 57 + type: object 58 + description: 59 + Pinctrl node's client devices use subnodes for desired pin configuration. 60 + Client device subnodes use below standard properties. 61 + $ref: /schemas/pinctrl/pincfg-node.yaml 62 + 63 + properties: 64 + pins: 65 + description: 66 + List of gpio pins affected by the properties specified in this 67 + subnode. 68 + items: 69 + pattern: "^gpio([0-9]|1[0-9]|2[0-2])$" 70 + 71 + function: 72 + enum: [ dmic1_clk, dmic1_data, dmic2_clk, dmic2_data, dmic3_clk, 73 + dmic3_data, dmic4_clk, dmic4_data, ext_mclk1_a, ext_mclk1_b, 74 + ext_mclk1_c, ext_mclk1_d, ext_mclk1_e, gpio, i2s0_clk, 75 + i2s0_data, i2s0_ws, i2s1_clk, i2s1_data, i2s1_ws, i2s2_clk, 76 + i2s2_data, i2s2_ws, i2s3_clk, i2s3_data, i2s3_ws, i2s4_clk, 77 + i2s4_data, i2s4_ws, slimbus_clk, slimbus_data, swr_rx_clk, 78 + swr_rx_data, swr_tx_clk, swr_tx_data, wsa_swr_clk, 79 + wsa_swr_data, wsa2_swr_clk, wsa2_swr_data ] 80 + description: 81 + Specify the alternative function to be configured for the specified 82 + pins. 83 + 84 + drive-strength: 85 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 86 + default: 2 87 + description: 88 + Selects the drive strength for the specified pins, in mA. 89 + 90 + slew-rate: 91 + enum: [0, 1, 2, 3] 92 + default: 0 93 + description: | 94 + 0: No adjustments 95 + 1: Higher Slew rate (faster edges) 96 + 2: Lower Slew rate (slower edges) 97 + 3: Reserved (No adjustments) 98 + 99 + bias-pull-down: true 100 + bias-pull-up: true 101 + bias-disable: true 102 + output-high: true 103 + output-low: true 104 + 105 + required: 106 + - pins 107 + - function 108 + 109 + additionalProperties: false 110 + 111 + allOf: 112 + - $ref: pinctrl.yaml# 113 + 114 + required: 115 + - compatible 116 + - reg 117 + - clocks 118 + - clock-names 119 + - gpio-controller 120 + - "#gpio-cells" 121 + - gpio-ranges 122 + 123 + additionalProperties: false 124 + 125 + examples: 126 + - | 127 + #include <dt-bindings/sound/qcom,q6dsp-lpass-ports.h> 128 + 129 + lpass_tlmm: pinctrl@6e80000 { 130 + compatible = "qcom,sm8550-lpass-lpi-pinctrl"; 131 + reg = <0x06e80000 0x20000>, 132 + <0x0725a000 0x10000>; 133 + 134 + clocks = <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, 135 + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>; 136 + clock-names = "core", "audio"; 137 + 138 + gpio-controller; 139 + #gpio-cells = <2>; 140 + gpio-ranges = <&lpass_tlmm 0 0 23>; 141 + 142 + tx-swr-sleep-clk-state { 143 + pins = "gpio0"; 144 + function = "swr_tx_clk"; 145 + drive-strength = <2>; 146 + bias-pull-down; 147 + }; 148 + };
+163
Documentation/devicetree/bindings/pinctrl/qcom,sm8550-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,sm8550-tlmm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. SM8550 TLMM block 8 + 9 + maintainers: 10 + - Abel Vesa <abel.vesa@linaro.org> 11 + 12 + description: 13 + Top Level Mode Multiplexer pin controller in Qualcomm SM8550 SoC. 14 + 15 + allOf: 16 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: qcom,sm8550-tlmm 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: true 26 + interrupt-controller: true 27 + "#interrupt-cells": true 28 + gpio-controller: true 29 + 30 + gpio-reserved-ranges: 31 + minItems: 1 32 + maxItems: 105 33 + 34 + gpio-line-names: 35 + maxItems: 210 36 + 37 + "#gpio-cells": true 38 + gpio-ranges: true 39 + wakeup-parent: true 40 + 41 + patternProperties: 42 + "-state$": 43 + oneOf: 44 + - $ref: "#/$defs/qcom-sm8550-tlmm-state" 45 + - patternProperties: 46 + "-pins$": 47 + $ref: "#/$defs/qcom-sm8550-tlmm-state" 48 + additionalProperties: false 49 + 50 + $defs: 51 + qcom-sm8550-tlmm-state: 52 + type: object 53 + description: 54 + Pinctrl node's client devices use subnodes for desired pin configuration. 55 + Client device subnodes use below standard properties. 56 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 57 + 58 + properties: 59 + pins: 60 + description: 61 + List of gpio pins affected by the properties specified in this 62 + subnode. 63 + items: 64 + oneOf: 65 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-9])$" 66 + - enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ] 67 + minItems: 1 68 + maxItems: 36 69 + 70 + function: 71 + description: 72 + Specify the alternative function to be configured for the specified 73 + pins. 74 + enum: [ aon_cci, aoss_cti, atest_char, atest_usb, 75 + audio_ext_mclk0, audio_ext_mclk1, audio_ref_clk, 76 + cam_aon_mclk4, cam_mclk, cci_async_in, cci_i2c_scl, 77 + cci_i2c_sda, cci_timer, cmu_rng, coex_uart1_rx, 78 + coex_uart1_tx, coex_uart2_rx, coex_uart2_tx, 79 + cri_trng, dbg_out_clk, ddr_bist_complete, 80 + ddr_bist_fail, ddr_bist_start, ddr_bist_stop, 81 + ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3, dp_hot, 82 + gcc_gp1, gcc_gp2, gcc_gp3, gpio, i2chub0_se0, 83 + i2chub0_se1, i2chub0_se2, i2chub0_se3, i2chub0_se4, 84 + i2chub0_se5, i2chub0_se6, i2chub0_se7, i2chub0_se8, 85 + i2chub0_se9, i2s0_data0, i2s0_data1, i2s0_sck, 86 + i2s0_ws, i2s1_data0, i2s1_data1, i2s1_sck, i2s1_ws, 87 + ibi_i3c, jitter_bist, mdp_vsync, mdp_vsync0_out, 88 + mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, 89 + mdp_vsync_e, nav_gpio0, nav_gpio1, nav_gpio2, 90 + pcie0_clk_req_n, pcie1_clk_req_n, phase_flag, 91 + pll_bist_sync, pll_clk_aux, prng_rosc0, prng_rosc1, 92 + prng_rosc2, prng_rosc3, qdss_cti, qdss_gpio, 93 + qlink0_enable, qlink0_request, qlink0_wmss, 94 + qlink1_enable, qlink1_request, qlink1_wmss, 95 + qlink2_enable, qlink2_request, qlink2_wmss, 96 + qspi0, qspi1, qspi2, qspi3, qspi_clk, qspi_cs, 97 + qup1_se0, qup1_se1, qup1_se2, qup1_se3, qup1_se4, 98 + qup1_se5, qup1_se6, qup1_se7, qup2_se0, 99 + qup2_se0_l0_mira, qup2_se0_l0_mirb, qup2_se0_l1_mira, 100 + qup2_se0_l1_mirb, qup2_se0_l2_mira, qup2_se0_l2_mirb, 101 + qup2_se0_l3_mira, qup2_se0_l3_mirb, qup2_se1, 102 + qup2_se2, qup2_se3, qup2_se4, qup2_se5, qup2_se6, 103 + qup2_se7, sd_write_protect, sdc40, sdc41, sdc42, 104 + sdc43, sdc4_clk, sdc4_cmd, tb_trig_sdc2, tb_trig_sdc4, 105 + tgu_ch0_trigout, tgu_ch1_trigout, tgu_ch2_trigout, 106 + tgu_ch3_trigout, tmess_prng0, tmess_prng1, tmess_prng2, 107 + tmess_prng3, tsense_pwm1, tsense_pwm2, tsense_pwm3, 108 + uim0_clk, uim0_data, uim0_present, uim0_reset, 109 + uim1_clk, uim1_data, uim1_present, uim1_reset, 110 + usb1_hs, usb_phy, vfr_0, vfr_1, vsense_trigger_mirnat ] 111 + 112 + bias-disable: true 113 + bias-pull-down: true 114 + bias-pull-up: true 115 + drive-strength: true 116 + input-enable: true 117 + output-high: true 118 + output-low: true 119 + 120 + required: 121 + - pins 122 + 123 + additionalProperties: false 124 + 125 + required: 126 + - compatible 127 + - reg 128 + 129 + additionalProperties: false 130 + 131 + examples: 132 + - | 133 + #include <dt-bindings/interrupt-controller/arm-gic.h> 134 + tlmm: pinctrl@f100000 { 135 + compatible = "qcom,sm8550-tlmm"; 136 + reg = <0x0f100000 0x300000>; 137 + gpio-controller; 138 + #gpio-cells = <2>; 139 + gpio-ranges = <&tlmm 0 0 211>; 140 + interrupt-controller; 141 + #interrupt-cells = <2>; 142 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 143 + 144 + gpio-wo-state { 145 + pins = "gpio1"; 146 + function = "gpio"; 147 + }; 148 + 149 + uart-w-state { 150 + rx-pins { 151 + pins = "gpio26"; 152 + function = "qup2_se7"; 153 + bias-pull-up; 154 + }; 155 + 156 + tx-pins { 157 + pins = "gpio27"; 158 + function = "qup2_se7"; 159 + bias-disable; 160 + }; 161 + }; 162 + }; 163 + ...
+3 -2
Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
··· 16 16 properties: 17 17 interrupts: 18 18 description: 19 - Specifies the TLMM summary IRQ 20 - maxItems: 1 19 + TLMM summary IRQ and dirconn interrupts. 20 + minItems: 1 21 + maxItems: 9 21 22 22 23 interrupt-controller: true 23 24
+595 -34
Documentation/devicetree/bindings/pinctrl/ralink,mt7620-pinctrl.yaml
··· 29 29 $ref: pinmux-node.yaml# 30 30 31 31 properties: 32 - groups: 33 - description: The pin group to select. 34 - enum: [ 35 - # common 36 - i2c, spi, wdt, 37 - 38 - # For MT7620 SoC 39 - ephy, mdio, nd_sd, pa, pcie, rgmii1, rgmii2, spi refclk, 40 - uartf, uartlite, wled, 41 - 42 - # For MT7628 and MT7688 SoCs 43 - gpio, i2s, p0led_an, p0led_kn, p1led_an, p1led_kn, p2led_an, 44 - p2led_kn, p3led_an, p3led_kn, p4led_an, p4led_kn, perst, pwm0, 45 - pwm1, refclk, sdmode, spi cs1, spis, uart0, uart1, uart2, 46 - wled_an, wled_kn, 47 - ] 48 - 49 32 function: 50 - description: The mux function to select. 51 - enum: [ 52 - # common 53 - gpio, i2c, refclk, spi, 33 + description: 34 + A string containing the name of the function to mux to the group. 35 + anyOf: 36 + - description: For MT7620 SoC 37 + enum: [ephy, gpio, gpio i2s, gpio uartf, i2c, i2s uartf, mdio, nand, pa, 38 + pcie refclk, pcie rst, pcm gpio, pcm i2s, pcm uartf, refclk, 39 + rgmii1, rgmii2, sd, spi, spi refclk, uartf, uartlite, wdt refclk, 40 + wdt rst, wled] 54 41 55 - # For MT7620 SoC 56 - ephy, gpio i2s, gpio uartf, i2s uartf, mdio, nand, pa, 57 - pcie refclk, pcie rst, pcm gpio, pcm i2s, pcm uartf, 58 - rgmii1, rgmii2, sd, spi refclk, uartf, uartlite, wdt refclk, 59 - wdt rst, wled, 42 + - description: For MT7628 and MT7688 SoCs 43 + enum: [antenna, debug, gpio, i2c, i2s, jtag, p0led_an, p0led_kn, 44 + p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn, 45 + p4led_an, p4led_kn, pcie, pcm, perst, pwm, pwm0, pwm1, pwm_uart2, 46 + refclk, rsvd, sdxc, sdxc d5 d4, sdxc d6, sdxc d7, spi, spi cs1, 47 + spis, sw_r, uart0, uart1, uart2, utif, wdt, wled_an, wled_kn, -] 60 48 61 - # For MT7628 and MT7688 SoCs 62 - antenna, debug, i2s, jtag, p0led_an, p0led_kn, 63 - p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn, 64 - p4led_an, p4led_kn, pcie, pcm, perst, pwm, pwm0, pwm1, pwm_uart2, 65 - rsvd, sdxc, sdxc d5 d4, sdxc d6, sdxc d7, spi cs1, 66 - spis, sw_r, uart0, uart1, uart2, utif, wdt, wled_an, wled_kn, -, 67 - ] 49 + groups: 50 + description: 51 + An array of strings. Each string contains the name of a group. 52 + maxItems: 1 68 53 69 54 required: 70 55 - groups 71 56 - function 57 + 58 + allOf: 59 + - if: 60 + properties: 61 + function: 62 + const: antenna 63 + then: 64 + properties: 65 + groups: 66 + enum: [i2s] 67 + 68 + - if: 69 + properties: 70 + function: 71 + const: debug 72 + then: 73 + properties: 74 + groups: 75 + enum: [i2c] 76 + 77 + - if: 78 + properties: 79 + function: 80 + const: ephy 81 + then: 82 + properties: 83 + groups: 84 + enum: [ephy] 85 + 86 + - if: 87 + properties: 88 + function: 89 + const: gpio 90 + then: 91 + properties: 92 + groups: 93 + anyOf: 94 + - description: For MT7620 SoC 95 + enum: [ephy, i2c, mdio, nd_sd, pa, pcie, rgmii1, rgmii2, 96 + spi, spi refclk, uartf, uartlite, wdt, wled] 97 + 98 + - description: For MT7628 and MT7688 SoCs 99 + enum: [gpio, i2c, i2s, p0led_an, p0led_kn, p1led_an, 100 + p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn, 101 + p4led_an, p4led_kn, perst, pwm0, pwm1, refclk, 102 + sdmode, spi, spi cs1, spis, uart0, uart1, uart2, 103 + wdt, wled_an, wled_kn] 104 + 105 + - if: 106 + properties: 107 + function: 108 + const: gpio i2s 109 + then: 110 + properties: 111 + groups: 112 + enum: [uartf] 113 + 114 + - if: 115 + properties: 116 + function: 117 + const: gpio uartf 118 + then: 119 + properties: 120 + groups: 121 + enum: [uartf] 122 + 123 + - if: 124 + properties: 125 + function: 126 + const: i2c 127 + then: 128 + properties: 129 + groups: 130 + enum: [i2c] 131 + 132 + - if: 133 + properties: 134 + function: 135 + const: i2s 136 + then: 137 + properties: 138 + groups: 139 + enum: [i2s] 140 + 141 + - if: 142 + properties: 143 + function: 144 + const: i2s uartf 145 + then: 146 + properties: 147 + groups: 148 + enum: [uartf] 149 + 150 + - if: 151 + properties: 152 + function: 153 + const: jtag 154 + then: 155 + properties: 156 + groups: 157 + enum: [p0led_an, p0led_kn, p1led_an, p1led_kn, p2led_an, 158 + p2led_kn, p3led_an, p3led_kn, p4led_an, p4led_kn, 159 + sdmode] 160 + 161 + - if: 162 + properties: 163 + function: 164 + const: mdio 165 + then: 166 + properties: 167 + groups: 168 + enum: [mdio] 169 + 170 + - if: 171 + properties: 172 + function: 173 + const: nand 174 + then: 175 + properties: 176 + groups: 177 + enum: [nd_sd] 178 + 179 + - if: 180 + properties: 181 + function: 182 + const: p0led_an 183 + then: 184 + properties: 185 + groups: 186 + enum: [p0led_an] 187 + 188 + - if: 189 + properties: 190 + function: 191 + const: p0led_kn 192 + then: 193 + properties: 194 + groups: 195 + enum: [p0led_kn] 196 + 197 + - if: 198 + properties: 199 + function: 200 + const: p1led_an 201 + then: 202 + properties: 203 + groups: 204 + enum: [p1led_an] 205 + 206 + - if: 207 + properties: 208 + function: 209 + const: p1led_kn 210 + then: 211 + properties: 212 + groups: 213 + enum: [p1led_kn] 214 + 215 + - if: 216 + properties: 217 + function: 218 + const: p2led_an 219 + then: 220 + properties: 221 + groups: 222 + enum: [p2led_an] 223 + 224 + - if: 225 + properties: 226 + function: 227 + const: p2led_kn 228 + then: 229 + properties: 230 + groups: 231 + enum: [p2led_kn] 232 + 233 + - if: 234 + properties: 235 + function: 236 + const: p3led_an 237 + then: 238 + properties: 239 + groups: 240 + enum: [p3led_an] 241 + 242 + - if: 243 + properties: 244 + function: 245 + const: p3led_kn 246 + then: 247 + properties: 248 + groups: 249 + enum: [p3led_kn] 250 + 251 + - if: 252 + properties: 253 + function: 254 + const: p4led_an 255 + then: 256 + properties: 257 + groups: 258 + enum: [p4led_an] 259 + 260 + - if: 261 + properties: 262 + function: 263 + const: p4led_kn 264 + then: 265 + properties: 266 + groups: 267 + enum: [p4led_kn] 268 + 269 + - if: 270 + properties: 271 + function: 272 + const: pa 273 + then: 274 + properties: 275 + groups: 276 + enum: [pa] 277 + 278 + - if: 279 + properties: 280 + function: 281 + const: pcie 282 + then: 283 + properties: 284 + groups: 285 + enum: [gpio] 286 + 287 + - if: 288 + properties: 289 + function: 290 + const: pcie refclk 291 + then: 292 + properties: 293 + groups: 294 + enum: [pcie] 295 + 296 + - if: 297 + properties: 298 + function: 299 + const: pcie rst 300 + then: 301 + properties: 302 + groups: 303 + enum: [pcie] 304 + 305 + - if: 306 + properties: 307 + function: 308 + const: pcm 309 + then: 310 + properties: 311 + groups: 312 + enum: [i2s] 313 + 314 + - if: 315 + properties: 316 + function: 317 + const: pcm gpio 318 + then: 319 + properties: 320 + groups: 321 + enum: [uartf] 322 + 323 + - if: 324 + properties: 325 + function: 326 + const: pcm i2s 327 + then: 328 + properties: 329 + groups: 330 + enum: [uartf] 331 + 332 + - if: 333 + properties: 334 + function: 335 + const: pcm uartf 336 + then: 337 + properties: 338 + groups: 339 + enum: [uartf] 340 + 341 + - if: 342 + properties: 343 + function: 344 + const: perst 345 + then: 346 + properties: 347 + groups: 348 + enum: [perst] 349 + 350 + - if: 351 + properties: 352 + function: 353 + const: pwm 354 + then: 355 + properties: 356 + groups: 357 + enum: [uart1, uart2] 358 + 359 + - if: 360 + properties: 361 + function: 362 + const: pwm0 363 + then: 364 + properties: 365 + groups: 366 + enum: [pwm0] 367 + 368 + - if: 369 + properties: 370 + function: 371 + const: pwm1 372 + then: 373 + properties: 374 + groups: 375 + enum: [pwm1] 376 + 377 + - if: 378 + properties: 379 + function: 380 + const: pwm_uart2 381 + then: 382 + properties: 383 + groups: 384 + enum: [spis] 385 + 386 + - if: 387 + properties: 388 + function: 389 + const: refclk 390 + then: 391 + properties: 392 + groups: 393 + anyOf: 394 + - description: For MT7620 SoC 395 + enum: [mdio] 396 + 397 + - description: For MT7628 and MT7688 SoCs 398 + enum: [gpio, refclk, spi cs1] 399 + 400 + - if: 401 + properties: 402 + function: 403 + const: rgmii1 404 + then: 405 + properties: 406 + groups: 407 + enum: [rgmii1] 408 + 409 + - if: 410 + properties: 411 + function: 412 + const: rgmii2 413 + then: 414 + properties: 415 + groups: 416 + enum: [rgmii2] 417 + 418 + - if: 419 + properties: 420 + function: 421 + const: rsvd 422 + then: 423 + properties: 424 + groups: 425 + enum: [p0led_an, p0led_kn, wled_an, wled_kn] 426 + 427 + - if: 428 + properties: 429 + function: 430 + const: sd 431 + then: 432 + properties: 433 + groups: 434 + enum: [nd_sd] 435 + 436 + - if: 437 + properties: 438 + function: 439 + const: sdxc 440 + then: 441 + properties: 442 + groups: 443 + enum: [sdmode] 444 + 445 + - if: 446 + properties: 447 + function: 448 + const: sdxc d5 d4 449 + then: 450 + properties: 451 + groups: 452 + enum: [uart2] 453 + 454 + - if: 455 + properties: 456 + function: 457 + const: sdxc d6 458 + then: 459 + properties: 460 + groups: 461 + enum: [pwm1] 462 + 463 + - if: 464 + properties: 465 + function: 466 + const: sdxc d7 467 + then: 468 + properties: 469 + groups: 470 + enum: [pwm0] 471 + 472 + - if: 473 + properties: 474 + function: 475 + const: spi 476 + then: 477 + properties: 478 + groups: 479 + enum: [spi] 480 + 481 + - if: 482 + properties: 483 + function: 484 + const: spi cs1 485 + then: 486 + properties: 487 + groups: 488 + enum: [spi cs1] 489 + 490 + - if: 491 + properties: 492 + function: 493 + const: spi refclk 494 + then: 495 + properties: 496 + groups: 497 + enum: [spi refclk] 498 + 499 + - if: 500 + properties: 501 + function: 502 + const: spis 503 + then: 504 + properties: 505 + groups: 506 + enum: [spis] 507 + 508 + - if: 509 + properties: 510 + function: 511 + const: sw_r 512 + then: 513 + properties: 514 + groups: 515 + enum: [uart1] 516 + 517 + - if: 518 + properties: 519 + function: 520 + const: uart0 521 + then: 522 + properties: 523 + groups: 524 + enum: [uart0] 525 + 526 + - if: 527 + properties: 528 + function: 529 + const: uart1 530 + then: 531 + properties: 532 + groups: 533 + enum: [uart1] 534 + 535 + - if: 536 + properties: 537 + function: 538 + const: uart2 539 + then: 540 + properties: 541 + groups: 542 + enum: [uart2] 543 + 544 + - if: 545 + properties: 546 + function: 547 + const: uartf 548 + then: 549 + properties: 550 + groups: 551 + enum: [uartf] 552 + 553 + - if: 554 + properties: 555 + function: 556 + const: uartlite 557 + then: 558 + properties: 559 + groups: 560 + enum: [uartlite] 561 + 562 + - if: 563 + properties: 564 + function: 565 + const: utif 566 + then: 567 + properties: 568 + groups: 569 + enum: [p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an, 570 + p3led_kn, p4led_an, p4led_kn, pwm0, pwm1, sdmode, spis] 571 + 572 + - if: 573 + properties: 574 + function: 575 + const: wdt 576 + then: 577 + properties: 578 + groups: 579 + enum: [wdt] 580 + 581 + - if: 582 + properties: 583 + function: 584 + const: wdt refclk 585 + then: 586 + properties: 587 + groups: 588 + enum: [wdt] 589 + 590 + - if: 591 + properties: 592 + function: 593 + const: wdt rst 594 + then: 595 + properties: 596 + groups: 597 + enum: [wdt] 598 + 599 + - if: 600 + properties: 601 + function: 602 + const: wled 603 + then: 604 + properties: 605 + groups: 606 + enum: [wled] 607 + 608 + - if: 609 + properties: 610 + function: 611 + const: wled_an 612 + then: 613 + properties: 614 + groups: 615 + enum: [wled_an] 616 + 617 + - if: 618 + properties: 619 + function: 620 + const: wled_kn 621 + then: 622 + properties: 623 + groups: 624 + enum: [wled_kn] 625 + 626 + - if: 627 + properties: 628 + function: 629 + const: "-" 630 + then: 631 + properties: 632 + groups: 633 + enum: [i2c, spi cs1, uart0] 72 634 73 635 additionalProperties: false 74 636 ··· 645 83 additionalProperties: false 646 84 647 85 examples: 648 - # Pinmux controller node 649 86 - | 650 87 pinctrl { 651 88 compatible = "ralink,mt7620-pinctrl";
+198 -7
Documentation/devicetree/bindings/pinctrl/ralink,mt7621-pinctrl.yaml
··· 29 29 $ref: pinmux-node.yaml# 30 30 31 31 properties: 32 - groups: 33 - description: The pin group to select. 34 - enum: [i2c, jtag, mdio, pcie, rgmii1, rgmii2, sdhci, spi, uart1, 35 - uart2, uart3, wdt] 36 - 37 32 function: 38 - description: The mux function to select. 33 + description: 34 + A string containing the name of the function to mux to the group. 39 35 enum: [gpio, i2c, i2s, jtag, mdio, nand1, nand2, pcie refclk, 40 36 pcie rst, pcm, rgmii1, rgmii2, sdhci, spdif2, spdif3, spi, 41 37 uart1, uart2, uart3, wdt refclk, wdt rst] 42 38 39 + groups: 40 + description: 41 + An array of strings. Each string contains the name of a group. 42 + maxItems: 1 43 + 43 44 required: 44 45 - groups 45 46 - function 47 + 48 + allOf: 49 + - if: 50 + properties: 51 + function: 52 + const: gpio 53 + then: 54 + properties: 55 + groups: 56 + enum: [i2c, jtag, mdio, pcie, rgmii1, rgmii2, sdhci, spi, 57 + uart1, uart2, uart3, wdt] 58 + 59 + - if: 60 + properties: 61 + function: 62 + const: i2c 63 + then: 64 + properties: 65 + groups: 66 + enum: [i2c] 67 + 68 + - if: 69 + properties: 70 + function: 71 + const: i2s 72 + then: 73 + properties: 74 + groups: 75 + enum: [uart3] 76 + 77 + - if: 78 + properties: 79 + function: 80 + const: jtag 81 + then: 82 + properties: 83 + groups: 84 + enum: [jtag] 85 + 86 + - if: 87 + properties: 88 + function: 89 + const: mdio 90 + then: 91 + properties: 92 + groups: 93 + enum: [mdio] 94 + 95 + - if: 96 + properties: 97 + function: 98 + const: nand1 99 + then: 100 + properties: 101 + groups: 102 + enum: [spi] 103 + 104 + - if: 105 + properties: 106 + function: 107 + const: nand2 108 + then: 109 + properties: 110 + groups: 111 + enum: [sdhci] 112 + 113 + - if: 114 + properties: 115 + function: 116 + const: pcie refclk 117 + then: 118 + properties: 119 + groups: 120 + enum: [pcie] 121 + 122 + - if: 123 + properties: 124 + function: 125 + const: pcie rst 126 + then: 127 + properties: 128 + groups: 129 + enum: [pcie] 130 + 131 + - if: 132 + properties: 133 + function: 134 + const: pcm 135 + then: 136 + properties: 137 + groups: 138 + enum: [uart2] 139 + 140 + - if: 141 + properties: 142 + function: 143 + const: rgmii1 144 + then: 145 + properties: 146 + groups: 147 + enum: [rgmii1] 148 + 149 + - if: 150 + properties: 151 + function: 152 + const: rgmii2 153 + then: 154 + properties: 155 + groups: 156 + enum: [rgmii2] 157 + 158 + - if: 159 + properties: 160 + function: 161 + const: sdhci 162 + then: 163 + properties: 164 + groups: 165 + enum: [sdhci] 166 + 167 + - if: 168 + properties: 169 + function: 170 + const: spdif2 171 + then: 172 + properties: 173 + groups: 174 + enum: [uart2] 175 + 176 + - if: 177 + properties: 178 + function: 179 + const: spdif3 180 + then: 181 + properties: 182 + groups: 183 + enum: [uart3] 184 + 185 + - if: 186 + properties: 187 + function: 188 + const: spi 189 + then: 190 + properties: 191 + groups: 192 + enum: [spi] 193 + 194 + - if: 195 + properties: 196 + function: 197 + const: uart1 198 + then: 199 + properties: 200 + groups: 201 + enum: [uart1] 202 + 203 + - if: 204 + properties: 205 + function: 206 + const: uart2 207 + then: 208 + properties: 209 + groups: 210 + enum: [uart2] 211 + 212 + - if: 213 + properties: 214 + function: 215 + const: uart3 216 + then: 217 + properties: 218 + groups: 219 + enum: [uart3] 220 + 221 + - if: 222 + properties: 223 + function: 224 + const: wdt refclk 225 + then: 226 + properties: 227 + groups: 228 + enum: [wdt] 229 + 230 + - if: 231 + properties: 232 + function: 233 + const: wdt rst 234 + then: 235 + properties: 236 + groups: 237 + enum: [wdt] 46 238 47 239 additionalProperties: false 48 240 ··· 249 57 additionalProperties: false 250 58 251 59 examples: 252 - # Pinmux controller node 253 60 - | 254 61 pinctrl { 255 62 compatible = "ralink,mt7621-pinctrl";
+80 -6
Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinctrl.yaml
··· 29 29 $ref: pinmux-node.yaml# 30 30 31 31 properties: 32 - groups: 33 - description: The pin group to select. 34 - enum: [i2c, spi, uartlite, jtag, mdio, sdram, pci] 35 - 36 32 function: 37 - description: The mux function to select. 33 + description: 34 + A string containing the name of the function to mux to the group. 38 35 enum: [gpio, i2c, spi, uartlite, jtag, mdio, sdram, pci] 36 + 37 + groups: 38 + description: 39 + An array of strings. Each string contains the name of a group. 40 + maxItems: 1 39 41 40 42 required: 41 43 - groups 42 44 - function 45 + 46 + allOf: 47 + - if: 48 + properties: 49 + function: 50 + const: gpio 51 + then: 52 + properties: 53 + groups: 54 + enum: [i2c, spi, uartlite, jtag, mdio, sdram, pci] 55 + 56 + - if: 57 + properties: 58 + function: 59 + const: i2c 60 + then: 61 + properties: 62 + groups: 63 + enum: [i2c] 64 + 65 + - if: 66 + properties: 67 + function: 68 + const: spi 69 + then: 70 + properties: 71 + groups: 72 + enum: [spi] 73 + 74 + - if: 75 + properties: 76 + function: 77 + const: uartlite 78 + then: 79 + properties: 80 + groups: 81 + enum: [uartlite] 82 + 83 + - if: 84 + properties: 85 + function: 86 + const: jtag 87 + then: 88 + properties: 89 + groups: 90 + enum: [jtag] 91 + 92 + - if: 93 + properties: 94 + function: 95 + const: mdio 96 + then: 97 + properties: 98 + groups: 99 + enum: [mdio] 100 + 101 + - if: 102 + properties: 103 + function: 104 + const: sdram 105 + then: 106 + properties: 107 + groups: 108 + enum: [sdram] 109 + 110 + - if: 111 + properties: 112 + function: 113 + const: pci 114 + then: 115 + properties: 116 + groups: 117 + enum: [pci] 43 118 44 119 additionalProperties: false 45 120 ··· 129 54 additionalProperties: false 130 55 131 56 examples: 132 - # Pinmux controller node 133 57 - | 134 58 pinctrl { 135 59 compatible = "ralink,rt2880-pinctrl";
+211 -25
Documentation/devicetree/bindings/pinctrl/ralink,rt305x-pinctrl.yaml
··· 30 30 $ref: pinmux-node.yaml# 31 31 32 32 properties: 33 - groups: 34 - description: The pin group to select. 35 - enum: [ 36 - # common 37 - i2c, jtag, led, mdio, rgmii, spi, spi_cs1, uartf, uartlite, 38 - 39 - # For RT3050, RT3052 and RT3350 SoCs 40 - sdram, 41 - 42 - # For RT3352 SoC 43 - lna, pa 44 - ] 45 - 46 33 function: 47 - description: The mux function to select. 48 - enum: [ 49 - # common 50 - gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, mdio, 51 - pcm gpio, pcm i2s, pcm uartf, rgmii, spi, spi_cs1, uartf, 52 - uartlite, wdg_cs1, 34 + description: 35 + A string containing the name of the function to mux to the group. 36 + anyOf: 37 + - description: For RT3050, RT3052 and RT3350 SoCs 38 + enum: [gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, mdio, 39 + pcm gpio, pcm i2s, pcm uartf, rgmii, sdram, spi, uartf, 40 + uartlite] 53 41 54 - # For RT3050, RT3052 and RT3350 SoCs 55 - sdram, 42 + - description: For RT3352 SoC 43 + enum: [gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, 44 + lna, mdio, pa, pcm gpio, pcm i2s, pcm uartf, rgmii, spi, 45 + spi_cs1, uartf, uartlite, wdg_cs1] 56 46 57 - # For RT3352 SoC 58 - lna, pa 59 - ] 47 + - description: For RT5350 SoC 48 + enum: [gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, 49 + pcm gpio, pcm i2s, pcm uartf, spi, spi_cs1, uartf, 50 + uartlite, wdg_cs1] 51 + 52 + groups: 53 + description: 54 + An array of strings. Each string contains the name of a group. 55 + maxItems: 1 60 56 61 57 required: 62 58 - groups 63 59 - function 60 + 61 + allOf: 62 + - if: 63 + properties: 64 + function: 65 + const: gpio 66 + then: 67 + properties: 68 + groups: 69 + anyOf: 70 + - description: For RT3050, RT3052 and RT3350 SoCs 71 + enum: [i2c, jtag, mdio, rgmii, sdram, spi, uartf, 72 + uartlite] 73 + 74 + - description: For RT3352 SoC 75 + enum: [i2c, jtag, led, lna, mdio, pa, rgmii, spi, spi_cs1, 76 + uartf, uartlite] 77 + 78 + - description: For RT5350 SoC 79 + enum: [i2c, jtag, led, spi, spi_cs1, uartf, uartlite] 80 + 81 + - if: 82 + properties: 83 + function: 84 + const: gpio i2s 85 + then: 86 + properties: 87 + groups: 88 + enum: [uartf] 89 + 90 + - if: 91 + properties: 92 + function: 93 + const: gpio uartf 94 + then: 95 + properties: 96 + groups: 97 + enum: [uartf] 98 + 99 + - if: 100 + properties: 101 + function: 102 + const: i2c 103 + then: 104 + properties: 105 + groups: 106 + enum: [i2c] 107 + 108 + - if: 109 + properties: 110 + function: 111 + const: i2s uartf 112 + then: 113 + properties: 114 + groups: 115 + enum: [uartf] 116 + 117 + - if: 118 + properties: 119 + function: 120 + const: jtag 121 + then: 122 + properties: 123 + groups: 124 + enum: [jtag] 125 + 126 + - if: 127 + properties: 128 + function: 129 + const: led 130 + then: 131 + properties: 132 + groups: 133 + enum: [led] 134 + 135 + - if: 136 + properties: 137 + function: 138 + const: lna 139 + then: 140 + properties: 141 + groups: 142 + enum: [lna] 143 + 144 + - if: 145 + properties: 146 + function: 147 + const: mdio 148 + then: 149 + properties: 150 + groups: 151 + enum: [mdio] 152 + 153 + - if: 154 + properties: 155 + function: 156 + const: pa 157 + then: 158 + properties: 159 + groups: 160 + enum: [pa] 161 + 162 + - if: 163 + properties: 164 + function: 165 + const: pcm gpio 166 + then: 167 + properties: 168 + groups: 169 + enum: [uartf] 170 + 171 + - if: 172 + properties: 173 + function: 174 + const: pcm i2s 175 + then: 176 + properties: 177 + groups: 178 + enum: [uartf] 179 + 180 + - if: 181 + properties: 182 + function: 183 + const: pcm uartf 184 + then: 185 + properties: 186 + groups: 187 + enum: [uartf] 188 + 189 + - if: 190 + properties: 191 + function: 192 + const: rgmii 193 + then: 194 + properties: 195 + groups: 196 + enum: [rgmii] 197 + 198 + - if: 199 + properties: 200 + function: 201 + const: sdram 202 + then: 203 + properties: 204 + groups: 205 + enum: [sdram] 206 + 207 + - if: 208 + properties: 209 + function: 210 + const: spi 211 + then: 212 + properties: 213 + groups: 214 + enum: [spi] 215 + 216 + - if: 217 + properties: 218 + function: 219 + const: spi_cs1 220 + then: 221 + properties: 222 + groups: 223 + enum: [spi_cs1] 224 + 225 + - if: 226 + properties: 227 + function: 228 + const: uartf 229 + then: 230 + properties: 231 + groups: 232 + enum: [uartf] 233 + 234 + - if: 235 + properties: 236 + function: 237 + const: uartlite 238 + then: 239 + properties: 240 + groups: 241 + enum: [uartlite] 242 + 243 + - if: 244 + properties: 245 + function: 246 + const: wdg_cs1 247 + then: 248 + properties: 249 + groups: 250 + enum: [spi_cs1] 64 251 65 252 additionalProperties: false 66 253 ··· 262 75 additionalProperties: false 263 76 264 77 examples: 265 - # Pinmux controller node 266 78 - | 267 79 pinctrl { 268 80 compatible = "ralink,rt305x-pinctrl";
+198 -7
Documentation/devicetree/bindings/pinctrl/ralink,rt3883-pinctrl.yaml
··· 29 29 $ref: pinmux-node.yaml# 30 30 31 31 properties: 32 - groups: 33 - description: The pin group to select. 34 - enum: [ge1, ge2, i2c, jtag, lna a, lna g, mdio, pci, spi, uartf, 35 - uartlite] 36 - 37 32 function: 38 - description: The mux function to select. 33 + description: 34 + A string containing the name of the function to mux to the group. 39 35 enum: [ge1, ge2, gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, 40 36 lna a, lna g, mdio, pci-dev, pci-fnc, pci-host1, pci-host2, 41 37 pcm gpio, pcm i2s, pcm uartf, spi, uartf, uartlite] 42 38 39 + groups: 40 + description: 41 + An array of strings. Each string contains the name of a group. 42 + maxItems: 1 43 + 43 44 required: 44 45 - groups 45 46 - function 47 + 48 + allOf: 49 + - if: 50 + properties: 51 + function: 52 + const: ge1 53 + then: 54 + properties: 55 + groups: 56 + enum: [ge1] 57 + 58 + - if: 59 + properties: 60 + function: 61 + const: ge2 62 + then: 63 + properties: 64 + groups: 65 + enum: [ge2] 66 + 67 + - if: 68 + properties: 69 + function: 70 + const: gpio 71 + then: 72 + properties: 73 + groups: 74 + enum: [ge1, ge2, i2c, jtag, lna a, lna g, mdio, pci, spi, 75 + uartf, uartlite] 76 + 77 + - if: 78 + properties: 79 + function: 80 + const: gpio i2s 81 + then: 82 + properties: 83 + groups: 84 + enum: [uartf] 85 + 86 + - if: 87 + properties: 88 + function: 89 + const: gpio uartf 90 + then: 91 + properties: 92 + groups: 93 + enum: [uartf] 94 + 95 + - if: 96 + properties: 97 + function: 98 + const: i2c 99 + then: 100 + properties: 101 + groups: 102 + enum: [i2c] 103 + 104 + - if: 105 + properties: 106 + function: 107 + const: i2s uartf 108 + then: 109 + properties: 110 + groups: 111 + enum: [uartf] 112 + 113 + - if: 114 + properties: 115 + function: 116 + const: jtag 117 + then: 118 + properties: 119 + groups: 120 + enum: [jtag] 121 + 122 + - if: 123 + properties: 124 + function: 125 + const: lna a 126 + then: 127 + properties: 128 + groups: 129 + enum: [lna a] 130 + 131 + - if: 132 + properties: 133 + function: 134 + const: lna g 135 + then: 136 + properties: 137 + groups: 138 + enum: [lna g] 139 + 140 + - if: 141 + properties: 142 + function: 143 + const: mdio 144 + then: 145 + properties: 146 + groups: 147 + enum: [mdio] 148 + 149 + - if: 150 + properties: 151 + function: 152 + const: pci-dev 153 + then: 154 + properties: 155 + groups: 156 + enum: [pci] 157 + 158 + - if: 159 + properties: 160 + function: 161 + const: pci-fnc 162 + then: 163 + properties: 164 + groups: 165 + enum: [pci] 166 + 167 + - if: 168 + properties: 169 + function: 170 + const: pci-host1 171 + then: 172 + properties: 173 + groups: 174 + enum: [pci] 175 + 176 + - if: 177 + properties: 178 + function: 179 + const: pci-host2 180 + then: 181 + properties: 182 + groups: 183 + enum: [pci] 184 + 185 + - if: 186 + properties: 187 + function: 188 + const: pcm gpio 189 + then: 190 + properties: 191 + groups: 192 + enum: [uartf] 193 + 194 + - if: 195 + properties: 196 + function: 197 + const: pcm i2s 198 + then: 199 + properties: 200 + groups: 201 + enum: [uartf] 202 + 203 + - if: 204 + properties: 205 + function: 206 + const: pcm uartf 207 + then: 208 + properties: 209 + groups: 210 + enum: [uartf] 211 + 212 + - if: 213 + properties: 214 + function: 215 + const: spi 216 + then: 217 + properties: 218 + groups: 219 + enum: [spi] 220 + 221 + - if: 222 + properties: 223 + function: 224 + const: uartf 225 + then: 226 + properties: 227 + groups: 228 + enum: [uartf] 229 + 230 + - if: 231 + properties: 232 + function: 233 + const: uartlite 234 + then: 235 + properties: 236 + groups: 237 + enum: [uartlite] 46 238 47 239 additionalProperties: false 48 240 ··· 249 57 additionalProperties: false 250 58 251 59 examples: 252 - # Pinmux controller node 253 60 - | 254 61 pinctrl { 255 62 compatible = "ralink,rt3883-pinctrl";
+86
Documentation/devicetree/bindings/pinctrl/renesas,rzg2l-poeg.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/renesas,rzg2l-poeg.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas RZ/G2L Port Output Enable for GPT (POEG) 8 + 9 + maintainers: 10 + - Biju Das <biju.das.jz@bp.renesas.com> 11 + 12 + description: | 13 + The output pins(GTIOCxA and GTIOCxB) of the general PWM timer (GPT) can be 14 + disabled by using the port output enabling function for the GPT (POEG). 15 + Specifically, either of the following ways can be used. 16 + * Input level detection of the GTETRGA to GTETRGD pins. 17 + * Output-disable request from the GPT. 18 + * SSF bit setting(ie, by setting POEGGn.SSF to 1) 19 + 20 + The state of the GTIOCxA and the GTIOCxB pins when the output is disabled, 21 + are controlled by the GPT module. 22 + 23 + properties: 24 + compatible: 25 + items: 26 + - enum: 27 + - renesas,r9a07g044-poeg # RZ/G2{L,LC} 28 + - renesas,r9a07g054-poeg # RZ/V2L 29 + - const: renesas,rzg2l-poeg 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + interrupts: 35 + maxItems: 1 36 + 37 + clocks: 38 + maxItems: 1 39 + 40 + power-domains: 41 + maxItems: 1 42 + 43 + resets: 44 + maxItems: 1 45 + 46 + renesas,gpt: 47 + $ref: /schemas/types.yaml#/definitions/phandle 48 + description: phandle to gpt instance that serves the pwm operation. 49 + 50 + renesas,poeg-id: 51 + $ref: /schemas/types.yaml#/definitions/uint32 52 + enum: [ 0, 1, 2, 3 ] 53 + description: | 54 + POEG group index. Valid values are: 55 + <0> : POEG group A 56 + <1> : POEG group B 57 + <2> : POEG group C 58 + <3> : POEG group D 59 + 60 + required: 61 + - compatible 62 + - reg 63 + - interrupts 64 + - clocks 65 + - power-domains 66 + - resets 67 + - renesas,poeg-id 68 + - renesas,gpt 69 + 70 + additionalProperties: false 71 + 72 + examples: 73 + - | 74 + #include <dt-bindings/clock/r9a07g044-cpg.h> 75 + #include <dt-bindings/interrupt-controller/arm-gic.h> 76 + 77 + poeggd: poeg@10049400 { 78 + compatible = "renesas,r9a07g044-poeg", "renesas,rzg2l-poeg"; 79 + reg = <0x10049400 0x400>; 80 + interrupts = <GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH>; 81 + clocks = <&cpg CPG_MOD R9A07G044_POEG_D_CLKP>; 82 + power-domains = <&cpg>; 83 + resets = <&cpg R9A07G044_POEG_D_RST>; 84 + renesas,poeg-id = <3>; 85 + renesas,gpt = <&gpt>; 86 + };
+1 -3
Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
··· 76 76 required: 77 77 - compatible 78 78 - rockchip,grf 79 - - "#address-cells" 80 - - "#size-cells" 81 - - ranges 82 79 83 80 patternProperties: 84 81 "gpio@[0-9a-f]+$": 85 82 type: object 86 83 87 84 $ref: "/schemas/gpio/rockchip,gpio-bank.yaml#" 85 + deprecated: true 88 86 89 87 unevaluatedProperties: false 90 88
+124
Documentation/devicetree/bindings/pinctrl/starfive,jh7110-aon-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/starfive,jh7110-aon-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: StarFive JH7110 AON Pin Controller 8 + 9 + description: | 10 + Bindings for the JH7110 RISC-V SoC from StarFive Technology Ltd. 11 + 12 + Out of the SoC's many pins only the ones named PAD_RGPIO0 to PAD_RGPIO3 13 + can be multiplexed and have configurable bias, drive strength, 14 + schmitt trigger etc. 15 + Some peripherals such as PWM have their I/O go through the 4 "GPIOs". 16 + 17 + maintainers: 18 + - Jianlong Huang <jianlong.huang@starfivetech.com> 19 + 20 + properties: 21 + compatible: 22 + const: starfive,jh7110-aon-pinctrl 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + resets: 28 + maxItems: 1 29 + 30 + interrupts: 31 + maxItems: 1 32 + 33 + interrupt-controller: true 34 + 35 + '#interrupt-cells': 36 + const: 2 37 + 38 + gpio-controller: true 39 + 40 + '#gpio-cells': 41 + const: 2 42 + 43 + patternProperties: 44 + '-[0-9]+$': 45 + type: object 46 + additionalProperties: false 47 + patternProperties: 48 + '-pins$': 49 + type: object 50 + description: | 51 + A pinctrl node should contain at least one subnode representing the 52 + pinctrl groups available on the machine. Each subnode will list the 53 + pins it needs, and how they should be configured, with regard to 54 + muxer configuration, bias, input enable/disable, input schmitt 55 + trigger enable/disable, slew-rate and drive strength. 56 + allOf: 57 + - $ref: /schemas/pinctrl/pincfg-node.yaml 58 + - $ref: /schemas/pinctrl/pinmux-node.yaml 59 + additionalProperties: false 60 + 61 + properties: 62 + pinmux: 63 + description: | 64 + The list of GPIOs and their mux settings that properties in the 65 + node apply to. This should be set using the GPIOMUX macro. 66 + 67 + bias-disable: true 68 + 69 + bias-pull-up: 70 + type: boolean 71 + 72 + bias-pull-down: 73 + type: boolean 74 + 75 + drive-strength: 76 + enum: [ 2, 4, 8, 12 ] 77 + 78 + input-enable: true 79 + 80 + input-disable: true 81 + 82 + input-schmitt-enable: true 83 + 84 + input-schmitt-disable: true 85 + 86 + slew-rate: 87 + maximum: 1 88 + 89 + required: 90 + - compatible 91 + - reg 92 + - interrupts 93 + - interrupt-controller 94 + - '#interrupt-cells' 95 + - gpio-controller 96 + - '#gpio-cells' 97 + 98 + additionalProperties: false 99 + 100 + examples: 101 + - | 102 + pinctrl@17020000 { 103 + compatible = "starfive,jh7110-aon-pinctrl"; 104 + reg = <0x17020000 0x10000>; 105 + resets = <&aoncrg 2>; 106 + interrupts = <85>; 107 + interrupt-controller; 108 + #interrupt-cells = <2>; 109 + gpio-controller; 110 + #gpio-cells = <2>; 111 + 112 + pwm-0 { 113 + pwm-pins { 114 + pinmux = <0xff030802>; 115 + bias-disable; 116 + drive-strength = <12>; 117 + input-disable; 118 + input-schmitt-disable; 119 + slew-rate = <0>; 120 + }; 121 + }; 122 + }; 123 + 124 + ...
+142
Documentation/devicetree/bindings/pinctrl/starfive,jh7110-sys-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/starfive,jh7110-sys-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: StarFive JH7110 SYS Pin Controller 8 + 9 + description: | 10 + Bindings for the JH7110 RISC-V SoC from StarFive Technology Ltd. 11 + 12 + Out of the SoC's many pins only the ones named PAD_GPIO0 to PAD_GPIO63 13 + can be multiplexed and have configurable bias, drive strength, 14 + schmitt trigger etc. 15 + Some peripherals have their I/O go through the 64 "GPIOs". This also 16 + includes a number of other UARTs, I2Cs, SPIs, PWMs etc. 17 + All these peripherals are connected to all 64 GPIOs such that 18 + any GPIO can be set up to be controlled by any of the peripherals. 19 + 20 + maintainers: 21 + - Jianlong Huang <jianlong.huang@starfivetech.com> 22 + 23 + properties: 24 + compatible: 25 + const: starfive,jh7110-sys-pinctrl 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + clocks: 31 + maxItems: 1 32 + 33 + resets: 34 + maxItems: 1 35 + 36 + interrupts: 37 + maxItems: 1 38 + 39 + interrupt-controller: true 40 + 41 + '#interrupt-cells': 42 + const: 2 43 + 44 + gpio-controller: true 45 + 46 + '#gpio-cells': 47 + const: 2 48 + 49 + patternProperties: 50 + '-[0-9]+$': 51 + type: object 52 + additionalProperties: false 53 + patternProperties: 54 + '-pins$': 55 + type: object 56 + description: | 57 + A pinctrl node should contain at least one subnode representing the 58 + pinctrl groups available on the machine. Each subnode will list the 59 + pins it needs, and how they should be configured, with regard to 60 + muxer configuration, bias, input enable/disable, input schmitt 61 + trigger enable/disable, slew-rate and drive strength. 62 + allOf: 63 + - $ref: /schemas/pinctrl/pincfg-node.yaml 64 + - $ref: /schemas/pinctrl/pinmux-node.yaml 65 + additionalProperties: false 66 + 67 + properties: 68 + pinmux: 69 + description: | 70 + The list of GPIOs and their mux settings that properties in the 71 + node apply to. This should be set using the GPIOMUX or PINMUX 72 + macros. 73 + 74 + bias-disable: true 75 + 76 + bias-pull-up: 77 + type: boolean 78 + 79 + bias-pull-down: 80 + type: boolean 81 + 82 + drive-strength: 83 + enum: [ 2, 4, 8, 12 ] 84 + 85 + input-enable: true 86 + 87 + input-disable: true 88 + 89 + input-schmitt-enable: true 90 + 91 + input-schmitt-disable: true 92 + 93 + slew-rate: 94 + maximum: 1 95 + 96 + required: 97 + - compatible 98 + - reg 99 + - clocks 100 + - interrupts 101 + - interrupt-controller 102 + - '#interrupt-cells' 103 + - gpio-controller 104 + - '#gpio-cells' 105 + 106 + additionalProperties: false 107 + 108 + examples: 109 + - | 110 + pinctrl@13040000 { 111 + compatible = "starfive,jh7110-sys-pinctrl"; 112 + reg = <0x13040000 0x10000>; 113 + clocks = <&syscrg 112>; 114 + resets = <&syscrg 2>; 115 + interrupts = <86>; 116 + interrupt-controller; 117 + #interrupt-cells = <2>; 118 + gpio-controller; 119 + #gpio-cells = <2>; 120 + 121 + uart0-0 { 122 + tx-pins { 123 + pinmux = <0xff140005>; 124 + bias-disable; 125 + drive-strength = <12>; 126 + input-disable; 127 + input-schmitt-disable; 128 + slew-rate = <0>; 129 + }; 130 + 131 + rx-pins { 132 + pinmux = <0x0E000406>; 133 + bias-pull-up; 134 + drive-strength = <2>; 135 + input-enable; 136 + input-schmitt-enable; 137 + slew-rate = <0>; 138 + }; 139 + }; 140 + }; 141 + 142 + ...
+243 -255
Documentation/driver-api/pin-control.rst
··· 11 11 - Multiplexing of pins, pads, fingers (etc) see below for details 12 12 13 13 - Configuration of pins, pads, fingers (etc), such as software-controlled 14 - biasing and driving mode specific pins, such as pull-up/down, open drain, 14 + biasing and driving mode specific pins, such as pull-up, pull-down, open drain, 15 15 load capacitance etc. 16 16 17 17 Top-level interface 18 18 =================== 19 19 20 - Definition of PIN CONTROLLER: 20 + Definitions: 21 21 22 - - A pin controller is a piece of hardware, usually a set of registers, that 22 + - A PIN CONTROLLER is a piece of hardware, usually a set of registers, that 23 23 can control PINs. It may be able to multiplex, bias, set load capacitance, 24 24 set drive strength, etc. for individual pins or groups of pins. 25 - 26 - Definition of PIN: 27 25 28 26 - PINS are equal to pads, fingers, balls or whatever packaging input or 29 27 output line you want to control and these are denoted by unsigned integers ··· 55 57 1 o o o o o o o o 56 58 57 59 To register a pin controller and name all the pins on this package we can do 58 - this in our driver:: 60 + this in our driver: 61 + 62 + .. code-block:: c 59 63 60 64 #include <linux/pinctrl/pinctrl.h> 61 65 ··· 78 78 .owner = THIS_MODULE, 79 79 }; 80 80 81 - int __init foo_probe(void) 81 + int __init foo_init(void) 82 82 { 83 83 int error; 84 84 85 85 struct pinctrl_dev *pctl; 86 86 87 - error = pinctrl_register_and_init(&foo_desc, <PARENT>, 88 - NULL, &pctl); 87 + error = pinctrl_register_and_init(&foo_desc, <PARENT>, NULL, &pctl); 89 88 if (error) 90 89 return error; 91 90 ··· 94 95 To enable the pinctrl subsystem and the subgroups for PINMUX and PINCONF and 95 96 selected drivers, you need to select them from your machine's Kconfig entry, 96 97 since these are so tightly integrated with the machines they are used on. 97 - See for example arch/arm/mach-ux500/Kconfig for an example. 98 + See ``arch/arm/mach-ux500/Kconfig`` for an example. 98 99 99 100 Pins usually have fancier names than this. You can find these in the datasheet 100 101 for your chip. Notice that the core pinctrl.h file provides a fancy macro 101 - called PINCTRL_PIN() to create the struct entries. As you can see I enumerated 102 - the pins from 0 in the upper left corner to 63 in the lower right corner. 102 + called ``PINCTRL_PIN()`` to create the struct entries. As you can see the pins are 103 + enumerated from 0 in the upper left corner to 63 in the lower right corner. 103 104 This enumeration was arbitrarily chosen, in practice you need to think 104 105 through your numbering system so that it matches the layout of registers 105 106 and such things in your driver, or the code may become complicated. You must 106 107 also consider matching of offsets to the GPIO ranges that may be handled by 107 108 the pin controller. 108 109 109 - For a padring with 467 pads, as opposed to actual pins, I used an enumeration 110 - like this, walking around the edge of the chip, which seems to be industry 110 + For a padding with 467 pads, as opposed to actual pins, the enumeration will 111 + be like this, walking around the edge of the chip, which seems to be industry 111 112 standard too (all these pads had names, too):: 112 113 113 114 ··· 131 132 on { 24, 25 }. 132 133 133 134 These two groups are presented to the pin control subsystem by implementing 134 - some generic pinctrl_ops like this:: 135 + some generic ``pinctrl_ops`` like this: 136 + 137 + .. code-block:: c 135 138 136 139 #include <linux/pinctrl/pinctrl.h> 137 - 138 - struct foo_group { 139 - const char *name; 140 - const unsigned int *pins; 141 - const unsigned num_pins; 142 - }; 143 140 144 141 static const unsigned int spi0_pins[] = { 0, 8, 16, 24 }; 145 142 static const unsigned int i2c0_pins[] = { 24, 25 }; 146 143 147 - static const struct foo_group foo_groups[] = { 148 - { 149 - .name = "spi0_grp", 150 - .pins = spi0_pins, 151 - .num_pins = ARRAY_SIZE(spi0_pins), 152 - }, 153 - { 154 - .name = "i2c0_grp", 155 - .pins = i2c0_pins, 156 - .num_pins = ARRAY_SIZE(i2c0_pins), 157 - }, 144 + static const struct pingroup foo_groups[] = { 145 + PINCTRL_PINGROUP("spi0_grp", spi0_pins, ARRAY_SIZE(spi0_pins)), 146 + PINCTRL_PINGROUP("i2c0_grp", i2c0_pins, ARRAY_SIZE(i2c0_pins)), 158 147 }; 159 - 160 148 161 149 static int foo_get_groups_count(struct pinctrl_dev *pctldev) 162 150 { ··· 151 165 } 152 166 153 167 static const char *foo_get_group_name(struct pinctrl_dev *pctldev, 154 - unsigned selector) 168 + unsigned int selector) 155 169 { 156 170 return foo_groups[selector].name; 157 171 } 158 172 159 - static int foo_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, 160 - const unsigned **pins, 161 - unsigned *num_pins) 173 + static int foo_get_group_pins(struct pinctrl_dev *pctldev, 174 + unsigned int selector, 175 + const unsigned int **pins, 176 + unsigned int *npins) 162 177 { 163 - *pins = (unsigned *) foo_groups[selector].pins; 164 - *num_pins = foo_groups[selector].num_pins; 178 + *pins = foo_groups[selector].pins; 179 + *npins = foo_groups[selector].npins; 165 180 return 0; 166 181 } 167 182 ··· 172 185 .get_group_pins = foo_get_group_pins, 173 186 }; 174 187 175 - 176 188 static struct pinctrl_desc foo_desc = { 177 - ... 178 - .pctlops = &foo_pctrl_ops, 189 + ... 190 + .pctlops = &foo_pctrl_ops, 179 191 }; 180 192 181 - The pin control subsystem will call the .get_groups_count() function to 193 + The pin control subsystem will call the ``.get_groups_count()`` function to 182 194 determine the total number of legal selectors, then it will call the other functions 183 195 to retrieve the name and pins of the group. Maintaining the data structure of 184 196 the groups is up to the driver, this is just a simple example - in practice you ··· 190 204 191 205 Pins can sometimes be software-configured in various ways, mostly related 192 206 to their electronic properties when used as inputs or outputs. For example you 193 - may be able to make an output pin high impedance, or "tristate" meaning it is 207 + may be able to make an output pin high impedance (Hi-Z), or "tristate" meaning it is 194 208 effectively disconnected. You may be able to connect an input pin to VDD or GND 195 209 using a certain resistor value - pull up and pull down - so that the pin has a 196 210 stable value when nothing is driving the rail it is connected to, or when it's 197 211 unconnected. 198 212 199 213 Pin configuration can be programmed by adding configuration entries into the 200 - mapping table; see section "Board/machine configuration" below. 214 + mapping table; see section `Board/machine configuration`_ below. 201 215 202 216 The format and meaning of the configuration parameter, PLATFORM_X_PULL_UP 203 217 above, is entirely defined by the pin controller driver. 204 218 205 219 The pin configuration driver implements callbacks for changing pin 206 - configuration in the pin controller ops like this:: 220 + configuration in the pin controller ops like this: 207 221 208 - #include <linux/pinctrl/pinctrl.h> 222 + .. code-block:: c 223 + 209 224 #include <linux/pinctrl/pinconf.h> 225 + #include <linux/pinctrl/pinctrl.h> 226 + 210 227 #include "platform_x_pindefs.h" 211 228 212 229 static int foo_pin_config_get(struct pinctrl_dev *pctldev, 213 - unsigned offset, 214 - unsigned long *config) 230 + unsigned int offset, 231 + unsigned long *config) 215 232 { 216 233 struct my_conftype conf; 217 234 218 - ... Find setting for pin @ offset ... 235 + /* ... Find setting for pin @ offset ... */ 219 236 220 237 *config = (unsigned long) conf; 221 238 } 222 239 223 240 static int foo_pin_config_set(struct pinctrl_dev *pctldev, 224 - unsigned offset, 225 - unsigned long config) 241 + unsigned int offset, 242 + unsigned long config) 226 243 { 227 244 struct my_conftype *conf = (struct my_conftype *) config; 228 245 229 246 switch (conf) { 230 247 case PLATFORM_X_PULL_UP: 231 248 ... 232 - } 249 + break; 233 250 } 234 251 } 235 252 236 - static int foo_pin_config_group_get (struct pinctrl_dev *pctldev, 237 - unsigned selector, 238 - unsigned long *config) 253 + static int foo_pin_config_group_get(struct pinctrl_dev *pctldev, 254 + unsigned selector, 255 + unsigned long *config) 239 256 { 240 257 ... 241 258 } 242 259 243 - static int foo_pin_config_group_set (struct pinctrl_dev *pctldev, 244 - unsigned selector, 245 - unsigned long config) 260 + static int foo_pin_config_group_set(struct pinctrl_dev *pctldev, 261 + unsigned selector, 262 + unsigned long config) 246 263 { 247 264 ... 248 265 } ··· 270 281 physical pins that are also registered as pin controller pins. 271 282 272 283 First and foremost, the two subsystems can be used as completely orthogonal, 273 - see the section named "pin control requests from drivers" and 274 - "drivers needing both pin control and GPIOs" below for details. But in some 284 + see the section named `Pin control requests from drivers`_ and 285 + `Drivers needing both pin control and GPIOs`_ below for details. But in some 275 286 situations a cross-subsystem mapping between pins and GPIOs is needed. 276 287 277 288 Since the pin controller subsystem has its pinspace local to the pin controller ··· 280 291 may be muxing several GPIO ranges (typically SoCs that have one set of pins, 281 292 but internally several GPIO silicon blocks, each modelled as a struct 282 293 gpio_chip) any number of GPIO ranges can be added to a pin controller instance 283 - like this:: 294 + like this: 295 + 296 + .. code-block:: c 297 + 298 + #include <linux/gpio/driver.h> 299 + 300 + #include <linux/pinctrl/pinctrl.h> 284 301 285 302 struct gpio_chip chip_a; 286 303 struct gpio_chip chip_b; ··· 297 302 .base = 32, 298 303 .pin_base = 32, 299 304 .npins = 16, 300 - .gc = &chip_a; 305 + .gc = &chip_a, 301 306 }; 302 307 303 308 static struct pinctrl_gpio_range gpio_range_b = { ··· 309 314 .gc = &chip_b; 310 315 }; 311 316 317 + int __init foo_init(void) 312 318 { 313 319 struct pinctrl_dev *pctl; 314 320 ... 315 321 pinctrl_add_gpio_range(pctl, &gpio_range_a); 316 322 pinctrl_add_gpio_range(pctl, &gpio_range_b); 323 + ... 317 324 } 318 325 319 326 So this complex system has one pin controller handling two different 320 327 GPIO chips. "chip a" has 16 pins and "chip b" has 8 pins. The "chip a" and 321 - "chip b" have different .pin_base, which means a start pin number of the 328 + "chip b" have different ``pin_base``, which means a start pin number of the 322 329 GPIO range. 323 330 324 331 The GPIO range of "chip a" starts from the GPIO base of 32 and actual ··· 328 331 offset for the GPIO range and pin range. The GPIO range of "chip b" starts 329 332 from GPIO number 48, while the pin range of "chip b" starts from 64. 330 333 331 - We can convert a gpio number to actual pin number using this "pin_base". 334 + We can convert a gpio number to actual pin number using this ``pin_base``. 332 335 They are mapped in the global GPIO pin space at: 333 336 334 337 chip a: ··· 340 343 341 344 The above examples assume the mapping between the GPIOs and pins is 342 345 linear. If the mapping is sparse or haphazard, an array of arbitrary pin 343 - numbers can be encoded in the range like this:: 346 + numbers can be encoded in the range like this: 344 347 345 - static const unsigned range_pins[] = { 14, 1, 22, 17, 10, 8, 6, 2 }; 348 + .. code-block:: c 349 + 350 + static const unsigned int range_pins[] = { 14, 1, 22, 17, 10, 8, 6, 2 }; 346 351 347 352 static struct pinctrl_gpio_range gpio_range = { 348 353 .name = "chip", ··· 352 353 .base = 32, 353 354 .pins = &range_pins, 354 355 .npins = ARRAY_SIZE(range_pins), 355 - .gc = &chip; 356 + .gc = &chip, 356 357 }; 357 358 358 - In this case the pin_base property will be ignored. If the name of a pin 359 + In this case the ``pin_base`` property will be ignored. If the name of a pin 359 360 group is known, the pins and npins elements of the above structure can be 360 - initialised using the function pinctrl_get_group_pins(), e.g. for pin 361 - group "foo":: 361 + initialised using the function ``pinctrl_get_group_pins()``, e.g. for pin 362 + group "foo": 362 363 363 - pinctrl_get_group_pins(pctl, "foo", &gpio_range.pins, 364 - &gpio_range.npins); 364 + .. code-block:: c 365 + 366 + pinctrl_get_group_pins(pctl, "foo", &gpio_range.pins, &gpio_range.npins); 365 367 366 368 When GPIO-specific functions in the pin control subsystem are called, these 367 369 ranges will be used to look up the appropriate pin controller by inspecting ··· 378 378 the range ID value, so that the pin controller knows which range it should 379 379 deal with. 380 380 381 - Calling pinctrl_add_gpio_range from pinctrl driver is DEPRECATED. Please see 382 - section 2.1 of Documentation/devicetree/bindings/gpio/gpio.txt on how to bind 381 + Calling ``pinctrl_add_gpio_range()`` from pinctrl driver is DEPRECATED. Please see 382 + section 2.1 of ``Documentation/devicetree/bindings/gpio/gpio.txt`` on how to bind 383 383 pinctrl and gpio drivers. 384 384 385 385 ··· 466 466 subsystems, so devices will request their mux setting, but it's also possible 467 467 to request a single pin for e.g. GPIO. 468 468 469 - Definitions: 469 + The conventions are: 470 470 471 471 - FUNCTIONS can be switched in and out by a driver residing with the pin 472 - control subsystem in the drivers/pinctrl/* directory of the kernel. The 472 + control subsystem in the ``drivers/pinctrl`` directory of the kernel. The 473 473 pin control driver knows the possible functions. In the example above you can 474 474 identify three pinmux functions, one for spi, one for i2c and one for mmc. 475 475 ··· 515 515 In the example case we can define that this particular machine shall 516 516 use device spi0 with pinmux function fspi0 group gspi0 and i2c0 on function 517 517 fi2c0 group gi2c0, on the primary pin controller, we get mappings 518 - like these:: 518 + like these: 519 + 520 + .. code-block:: c 519 521 520 522 { 521 523 {"map-spi0", spi0, pinctrl0, fspi0, gspi0}, 522 - {"map-i2c0", i2c0, pinctrl0, fi2c0, gi2c0} 524 + {"map-i2c0", i2c0, pinctrl0, fi2c0, gi2c0}, 523 525 } 524 526 525 527 Every map must be assigned a state name, pin controller, device and ··· 571 569 this happens. 572 570 573 571 Pinmux drivers are required to supply a few callback functions, some are 574 - optional. Usually the set_mux() function is implemented, writing values into 572 + optional. Usually the ``.set_mux()`` function is implemented, writing values into 575 573 some certain registers to activate a certain mux setting for a certain pin. 576 574 577 - A simple driver for the above example will work by setting bits 0, 1, 2, 3 or 4 575 + A simple driver for the above example will work by setting bits 0, 1, 2, 3, 4, or 5 578 576 into some register named MUX to select a certain function with a certain 579 - group of pins would work something like this:: 577 + group of pins would work something like this: 578 + 579 + .. code-block:: c 580 580 581 581 #include <linux/pinctrl/pinctrl.h> 582 582 #include <linux/pinctrl/pinmux.h> 583 583 584 - struct foo_group { 585 - const char *name; 586 - const unsigned int *pins; 587 - const unsigned num_pins; 584 + static const unsigned int spi0_0_pins[] = { 0, 8, 16, 24 }; 585 + static const unsigned int spi0_1_pins[] = { 38, 46, 54, 62 }; 586 + static const unsigned int i2c0_pins[] = { 24, 25 }; 587 + static const unsigned int mmc0_1_pins[] = { 56, 57 }; 588 + static const unsigned int mmc0_2_pins[] = { 58, 59 }; 589 + static const unsigned int mmc0_3_pins[] = { 60, 61, 62, 63 }; 590 + 591 + static const struct pingroup foo_groups[] = { 592 + PINCTRL_PINGROUP("spi0_0_grp", spi0_0_pins, ARRAY_SIZE(spi0_0_pins)), 593 + PINCTRL_PINGROUP("spi0_1_grp", spi0_1_pins, ARRAY_SIZE(spi0_1_pins)), 594 + PINCTRL_PINGROUP("i2c0_grp", i2c0_pins, ARRAY_SIZE(i2c0_pins)), 595 + PINCTRL_PINGROUP("mmc0_1_grp", mmc0_1_pins, ARRAY_SIZE(mmc0_1_pins)), 596 + PINCTRL_PINGROUP("mmc0_2_grp", mmc0_2_pins, ARRAY_SIZE(mmc0_2_pins)), 597 + PINCTRL_PINGROUP("mmc0_3_grp", mmc0_3_pins, ARRAY_SIZE(mmc0_3_pins)), 588 598 }; 589 - 590 - static const unsigned spi0_0_pins[] = { 0, 8, 16, 24 }; 591 - static const unsigned spi0_1_pins[] = { 38, 46, 54, 62 }; 592 - static const unsigned i2c0_pins[] = { 24, 25 }; 593 - static const unsigned mmc0_1_pins[] = { 56, 57 }; 594 - static const unsigned mmc0_2_pins[] = { 58, 59 }; 595 - static const unsigned mmc0_3_pins[] = { 60, 61, 62, 63 }; 596 - 597 - static const struct foo_group foo_groups[] = { 598 - { 599 - .name = "spi0_0_grp", 600 - .pins = spi0_0_pins, 601 - .num_pins = ARRAY_SIZE(spi0_0_pins), 602 - }, 603 - { 604 - .name = "spi0_1_grp", 605 - .pins = spi0_1_pins, 606 - .num_pins = ARRAY_SIZE(spi0_1_pins), 607 - }, 608 - { 609 - .name = "i2c0_grp", 610 - .pins = i2c0_pins, 611 - .num_pins = ARRAY_SIZE(i2c0_pins), 612 - }, 613 - { 614 - .name = "mmc0_1_grp", 615 - .pins = mmc0_1_pins, 616 - .num_pins = ARRAY_SIZE(mmc0_1_pins), 617 - }, 618 - { 619 - .name = "mmc0_2_grp", 620 - .pins = mmc0_2_pins, 621 - .num_pins = ARRAY_SIZE(mmc0_2_pins), 622 - }, 623 - { 624 - .name = "mmc0_3_grp", 625 - .pins = mmc0_3_pins, 626 - .num_pins = ARRAY_SIZE(mmc0_3_pins), 627 - }, 628 - }; 629 - 630 599 631 600 static int foo_get_groups_count(struct pinctrl_dev *pctldev) 632 601 { ··· 605 632 } 606 633 607 634 static const char *foo_get_group_name(struct pinctrl_dev *pctldev, 608 - unsigned selector) 635 + unsigned int selector) 609 636 { 610 637 return foo_groups[selector].name; 611 638 } 612 639 613 - static int foo_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, 614 - const unsigned ** pins, 615 - unsigned * num_pins) 640 + static int foo_get_group_pins(struct pinctrl_dev *pctldev, unsigned int selector, 641 + const unsigned int **pins, 642 + unsigned int *npins) 616 643 { 617 - *pins = (unsigned *) foo_groups[selector].pins; 618 - *num_pins = foo_groups[selector].num_pins; 644 + *pins = foo_groups[selector].pins; 645 + *npins = foo_groups[selector].npins; 619 646 return 0; 620 647 } 621 648 ··· 625 652 .get_group_pins = foo_get_group_pins, 626 653 }; 627 654 628 - struct foo_pmx_func { 629 - const char *name; 630 - const char * const *groups; 631 - const unsigned num_groups; 632 - }; 633 - 634 655 static const char * const spi0_groups[] = { "spi0_0_grp", "spi0_1_grp" }; 635 656 static const char * const i2c0_groups[] = { "i2c0_grp" }; 636 - static const char * const mmc0_groups[] = { "mmc0_1_grp", "mmc0_2_grp", 637 - "mmc0_3_grp" }; 657 + static const char * const mmc0_groups[] = { "mmc0_1_grp", "mmc0_2_grp", "mmc0_3_grp" }; 638 658 639 - static const struct foo_pmx_func foo_functions[] = { 640 - { 641 - .name = "spi0", 642 - .groups = spi0_groups, 643 - .num_groups = ARRAY_SIZE(spi0_groups), 644 - }, 645 - { 646 - .name = "i2c0", 647 - .groups = i2c0_groups, 648 - .num_groups = ARRAY_SIZE(i2c0_groups), 649 - }, 650 - { 651 - .name = "mmc0", 652 - .groups = mmc0_groups, 653 - .num_groups = ARRAY_SIZE(mmc0_groups), 654 - }, 659 + static const struct pinfunction foo_functions[] = { 660 + PINCTRL_PINFUNCTION("spi0", spi0_groups, ARRAY_SIZE(spi0_groups)), 661 + PINCTRL_PINFUNCTION("i2c0", i2c0_groups, ARRAY_SIZE(i2c0_groups)), 662 + PINCTRL_PINFUNCTION("mmc0", mmc0_groups, ARRAY_SIZE(mmc0_groups)), 655 663 }; 656 664 657 665 static int foo_get_functions_count(struct pinctrl_dev *pctldev) ··· 640 686 return ARRAY_SIZE(foo_functions); 641 687 } 642 688 643 - static const char *foo_get_fname(struct pinctrl_dev *pctldev, unsigned selector) 689 + static const char *foo_get_fname(struct pinctrl_dev *pctldev, unsigned int selector) 644 690 { 645 691 return foo_functions[selector].name; 646 692 } 647 693 648 - static int foo_get_groups(struct pinctrl_dev *pctldev, unsigned selector, 649 - const char * const **groups, 650 - unsigned * const num_groups) 694 + static int foo_get_groups(struct pinctrl_dev *pctldev, unsigned int selector, 695 + const char * const **groups, 696 + unsigned int * const ngroups) 651 697 { 652 698 *groups = foo_functions[selector].groups; 653 - *num_groups = foo_functions[selector].num_groups; 699 + *ngroups = foo_functions[selector].ngroups; 654 700 return 0; 655 701 } 656 702 657 - static int foo_set_mux(struct pinctrl_dev *pctldev, unsigned selector, 658 - unsigned group) 703 + static int foo_set_mux(struct pinctrl_dev *pctldev, unsigned int selector, 704 + unsigned int group) 659 705 { 660 - u8 regbit = (1 << selector + group); 706 + u8 regbit = BIT(group); 661 707 662 - writeb((readb(MUX)|regbit), MUX); 708 + writeb((readb(MUX) | regbit), MUX); 663 709 return 0; 664 710 } 665 711 ··· 678 724 .pmxops = &foo_pmxops, 679 725 }; 680 726 681 - In the example activating muxing 0 and 1 at the same time setting bits 682 - 0 and 1, uses one pin in common so they would collide. 727 + In the example activating muxing 0 and 2 at the same time setting bits 728 + 0 and 2, uses pin 24 in common so they would collide. All the same for 729 + the muxes 1 and 5, which have pin 62 in common. 683 730 684 731 The beauty of the pinmux subsystem is that since it keeps track of all 685 732 pins and who is using them, it will already have denied an impossible 686 733 request like that, so the driver does not need to worry about such 687 734 things - when it gets a selector passed in, the pinmux subsystem makes 688 735 sure no other device or GPIO assignment is already using the selected 689 - pins. Thus bits 0 and 1 in the control register will never be set at the 690 - same time. 736 + pins. Thus bits 0 and 2, or 1 and 5 in the control register will never 737 + be set at the same time. 691 738 692 739 All the above functions are mandatory to implement for a pinmux driver. 693 740 ··· 697 742 =============================================== 698 743 699 744 Note that the following implies that the use case is to use a certain pin 700 - from the Linux kernel using the API in <linux/gpio.h> with gpio_request() 745 + from the Linux kernel using the API in ``<linux/gpio/consumer.h>`` with gpiod_get() 701 746 and similar functions. There are cases where you may be using something 702 747 that your datasheet calls "GPIO mode", but actually is just an electrical 703 748 configuration for a certain device. See the section below named 704 - "GPIO mode pitfalls" for more details on this scenario. 749 + `GPIO mode pitfalls`_ for more details on this scenario. 705 750 706 - The public pinmux API contains two functions named pinctrl_gpio_request() 707 - and pinctrl_gpio_free(). These two functions shall *ONLY* be called from 708 - gpiolib-based drivers as part of their gpio_request() and 709 - gpio_free() semantics. Likewise the pinctrl_gpio_direction_[input|output] 710 - shall only be called from within respective gpio_direction_[input|output] 711 - gpiolib implementation. 751 + The public pinmux API contains two functions named ``pinctrl_gpio_request()`` 752 + and ``pinctrl_gpio_free()``. These two functions shall *ONLY* be called from 753 + gpiolib-based drivers as part of their ``.request()`` and ``.free()`` semantics. 754 + Likewise the ``pinctrl_gpio_direction_input()`` / ``pinctrl_gpio_direction_output()`` 755 + shall only be called from within respective ``.direction_input()`` / 756 + ``.direction_output()`` gpiolib implementation. 712 757 713 758 NOTE that platforms and individual drivers shall *NOT* request GPIO pins to be 714 759 controlled e.g. muxed in. Instead, implement a proper gpiolib driver and have ··· 722 767 setting and then the device functions. 723 768 724 769 For this reason there are two functions a pin control driver can implement 725 - to enable only GPIO on an individual pin: .gpio_request_enable() and 726 - .gpio_disable_free(). 770 + to enable only GPIO on an individual pin: ``.gpio_request_enable()`` and 771 + ``.gpio_disable_free()``. 727 772 728 773 This function will pass in the affected GPIO range identified by the pin 729 774 controller core, so you know which GPIO pins are being affected by the request ··· 731 776 732 777 If your driver needs to have an indication from the framework of whether the 733 778 GPIO pin shall be used for input or output you can implement the 734 - .gpio_set_direction() function. As described this shall be called from the 779 + ``.gpio_set_direction()`` function. As described this shall be called from the 735 780 gpiolib driver and the affected GPIO range, pin offset and desired direction 736 781 will be passed along to this function. 737 782 738 783 Alternatively to using these special functions, it is fully allowed to use 739 - named functions for each GPIO pin, the pinctrl_gpio_request() will attempt to 784 + named functions for each GPIO pin, the ``pinctrl_gpio_request()`` will attempt to 740 785 obtain the function "gpioN" where "N" is the global GPIO pin number if no 741 786 special GPIO-handler is registered. 742 787 ··· 749 794 may be confused by a datasheet talking about a pin being possible to set 750 795 into "GPIO mode". It appears that what hardware engineers mean with 751 796 "GPIO mode" is not necessarily the use case that is implied in the kernel 752 - interface <linux/gpio.h>: a pin that you grab from kernel code and then 797 + interface ``<linux/gpio/consumer.h>``: a pin that you grab from kernel code and then 753 798 either listen for input or drive high/low to assert/deassert some 754 799 external line. 755 800 ··· 760 805 761 806 The GPIO portions of a pin and its relation to a certain pin controller 762 807 configuration and muxing logic can be constructed in several ways. Here 763 - are two examples:: 808 + are two examples. 764 809 765 - (A) 810 + Example **(A)**:: 811 + 766 812 pin config 767 813 logic regs 768 814 | +- SPI ··· 792 836 consumers on hardware of this type. The pinctrl driver should set this flag 793 837 accordingly. 794 838 795 - :: 796 - 797 - (B) 839 + Example **(B)**:: 798 840 799 841 pin config 800 842 logic regs ··· 853 899 to think that you need to come up with something really complex, that the 854 900 pin shall be used for UART TX and GPIO at the same time, that you will grab 855 901 a pin control handle and set it to a certain state to enable UART TX to be 856 - muxed in, then twist it over to GPIO mode and use gpio_direction_output() 902 + muxed in, then twist it over to GPIO mode and use gpiod_direction_output() 857 903 to drive it low during sleep, then mux it over to UART TX again when you 858 - wake up and maybe even gpio_request/gpio_free as part of this cycle. This 904 + wake up and maybe even gpiod_get() / gpiod_put() as part of this cycle. This 859 905 all gets very complicated. 860 906 861 907 The solution is to not think that what the datasheet calls "GPIO mode" 862 - has to be handled by the <linux/gpio.h> interface. Instead view this as 863 - a certain pin config setting. Look in e.g. <linux/pinctrl/pinconf-generic.h> 908 + has to be handled by the ``<linux/gpio/consumer.h>`` interface. Instead view this as 909 + a certain pin config setting. Look in e.g. ``<linux/pinctrl/pinconf-generic.h>`` 864 910 and you find this in the documentation: 865 911 866 912 PIN_CONFIG_OUTPUT: ··· 869 915 870 916 So it is perfectly possible to push a pin into "GPIO mode" and drive the 871 917 line low as part of the usual pin control map. So for example your UART 872 - driver may look like this:: 918 + driver may look like this: 919 + 920 + .. code-block:: c 873 921 874 922 #include <linux/pinctrl/consumer.h> 875 923 ··· 884 928 885 929 /* Normal mode */ 886 930 retval = pinctrl_select_state(pinctrl, pins_default); 931 + 887 932 /* Sleep mode */ 888 933 retval = pinctrl_select_state(pinctrl, pins_sleep); 889 934 890 935 And your machine configuration may look like this: 891 - -------------------------------------------------- 892 936 893 - :: 937 + .. code-block:: c 894 938 895 939 static unsigned long uart_default_mode[] = { 896 940 PIN_CONF_PACKED(PIN_CONFIG_DRIVE_PUSH_PULL, 0), ··· 902 946 903 947 static struct pinctrl_map pinmap[] __initdata = { 904 948 PIN_MAP_MUX_GROUP("uart", PINCTRL_STATE_DEFAULT, "pinctrl-foo", 905 - "u0_group", "u0"), 949 + "u0_group", "u0"), 906 950 PIN_MAP_CONFIGS_PIN("uart", PINCTRL_STATE_DEFAULT, "pinctrl-foo", 907 - "UART_TX_PIN", uart_default_mode), 951 + "UART_TX_PIN", uart_default_mode), 908 952 PIN_MAP_MUX_GROUP("uart", PINCTRL_STATE_SLEEP, "pinctrl-foo", 909 - "u0_group", "gpio-mode"), 953 + "u0_group", "gpio-mode"), 910 954 PIN_MAP_CONFIGS_PIN("uart", PINCTRL_STATE_SLEEP, "pinctrl-foo", 911 - "UART_TX_PIN", uart_sleep_mode), 955 + "UART_TX_PIN", uart_sleep_mode), 912 956 }; 913 957 914 - foo_init(void) { 958 + foo_init(void) 959 + { 915 960 pinctrl_register_mappings(pinmap, ARRAY_SIZE(pinmap)); 916 961 } 917 962 ··· 952 995 953 996 A pin controller configuration for a machine looks pretty much like a simple 954 997 regulator configuration, so for the example array above we want to enable i2c 955 - and spi on the second function mapping:: 998 + and spi on the second function mapping: 999 + 1000 + .. code-block:: c 956 1001 957 1002 #include <linux/pinctrl/machine.h> 958 1003 ··· 989 1030 As you can see we may have several pin controllers on the system and thus 990 1031 we need to specify which one of them contains the functions we wish to map. 991 1032 992 - You register this pinmux mapping to the pinmux subsystem by simply:: 1033 + You register this pinmux mapping to the pinmux subsystem by simply: 1034 + 1035 + .. code-block:: c 993 1036 994 1037 ret = pinctrl_register_mappings(mapping, ARRAY_SIZE(mapping)); 995 1038 996 1039 Since the above construct is pretty common there is a helper macro to make 997 1040 it even more compact which assumes you want to use pinctrl-foo and position 998 - 0 for mapping, for example:: 1041 + 0 for mapping, for example: 1042 + 1043 + .. code-block:: c 999 1044 1000 1045 static struct pinctrl_map mapping[] __initdata = { 1001 1046 PIN_MAP_MUX_GROUP("foo-i2c.o", PINCTRL_STATE_DEFAULT, ··· 1009 1046 The mapping table may also contain pin configuration entries. It's common for 1010 1047 each pin/group to have a number of configuration entries that affect it, so 1011 1048 the table entries for configuration reference an array of config parameters 1012 - and values. An example using the convenience macros is shown below:: 1049 + and values. An example using the convenience macros is shown below: 1050 + 1051 + .. code-block:: c 1013 1052 1014 1053 static unsigned long i2c_grp_configs[] = { 1015 1054 FOO_PIN_DRIVEN, ··· 1038 1073 named states. When running on hardware that doesn't need any pin controller 1039 1074 configuration, the mapping table must still contain those named states, in 1040 1075 order to explicitly indicate that the states were provided and intended to 1041 - be empty. Table entry macro PIN_MAP_DUMMY_STATE serves the purpose of defining 1042 - a named state without causing any pin controller to be programmed:: 1076 + be empty. Table entry macro ``PIN_MAP_DUMMY_STATE()`` serves the purpose of defining 1077 + a named state without causing any pin controller to be programmed: 1078 + 1079 + .. code-block:: c 1043 1080 1044 1081 static struct pinctrl_map mapping[] __initdata = { 1045 1082 PIN_MAP_DUMMY_STATE("foo-i2c.0", PINCTRL_STATE_DEFAULT), ··· 1052 1085 ================ 1053 1086 1054 1087 As it is possible to map a function to different groups of pins an optional 1055 - .group can be specified like this:: 1088 + .group can be specified like this: 1089 + 1090 + .. code-block:: c 1056 1091 1057 1092 ... 1058 1093 { ··· 1076 1107 ... 1077 1108 1078 1109 This example mapping is used to switch between two positions for spi0 at 1079 - runtime, as described further below under the heading "Runtime pinmuxing". 1110 + runtime, as described further below under the heading `Runtime pinmuxing`_. 1080 1111 1081 1112 Further it is possible for one named state to affect the muxing of several 1082 1113 groups of pins, say for example in the mmc0 example above, where you can 1083 1114 additively expand the mmc0 bus from 2 to 4 to 8 pins. If we want to use all 1084 - three groups for a total of 2+2+4 = 8 pins (for an 8-bit MMC bus as is the 1085 - case), we define a mapping like this:: 1115 + three groups for a total of 2 + 2 + 4 = 8 pins (for an 8-bit MMC bus as is the 1116 + case), we define a mapping like this: 1117 + 1118 + .. code-block:: c 1086 1119 1087 1120 ... 1088 1121 { ··· 1138 1167 ... 1139 1168 1140 1169 The result of grabbing this mapping from the device with something like 1141 - this (see next paragraph):: 1170 + this (see next paragraph): 1171 + 1172 + .. code-block:: c 1142 1173 1143 1174 p = devm_pinctrl_get(dev); 1144 1175 s = pinctrl_lookup_state(p, "8bit"); 1145 1176 ret = pinctrl_select_state(p, s); 1146 1177 1147 - or more simply:: 1178 + or more simply: 1179 + 1180 + .. code-block:: c 1148 1181 1149 1182 p = devm_pinctrl_get_select(dev, "8bit"); 1150 1183 ··· 1163 1188 ================================= 1164 1189 1165 1190 When a device driver is about to probe the device core will automatically 1166 - attempt to issue pinctrl_get_select_default() on these devices. 1191 + attempt to issue ``pinctrl_get_select_default()`` on these devices. 1167 1192 This way driver writers do not need to add any of the boilerplate code 1168 1193 of the type found below. However when doing fine-grained state selection 1169 1194 and not using the "default" state, you may have to do some device driver ··· 1181 1206 at runtime this is not possible. 1182 1207 1183 1208 A typical case is if a driver needs to switch bias of pins from normal 1184 - operation and going to sleep, moving from the PINCTRL_STATE_DEFAULT to 1185 - PINCTRL_STATE_SLEEP at runtime, re-biasing or even re-muxing pins to save 1209 + operation and going to sleep, moving from the ``PINCTRL_STATE_DEFAULT`` to 1210 + ``PINCTRL_STATE_SLEEP`` at runtime, re-biasing or even re-muxing pins to save 1186 1211 current in sleep mode. 1187 1212 1188 1213 A driver may request a certain control state to be activated, usually just the 1189 - default state like this:: 1214 + default state like this: 1215 + 1216 + .. code-block:: c 1190 1217 1191 1218 #include <linux/pinctrl/consumer.h> 1192 1219 ··· 1228 1251 1229 1252 The semantics of the pinctrl APIs are: 1230 1253 1231 - - pinctrl_get() is called in process context to obtain a handle to all pinctrl 1254 + - ``pinctrl_get()`` is called in process context to obtain a handle to all pinctrl 1232 1255 information for a given client device. It will allocate a struct from the 1233 1256 kernel memory to hold the pinmux state. All mapping table parsing or similar 1234 1257 slow operations take place within this API. 1235 1258 1236 - - devm_pinctrl_get() is a variant of pinctrl_get() that causes pinctrl_put() 1259 + - ``devm_pinctrl_get()`` is a variant of pinctrl_get() that causes ``pinctrl_put()`` 1237 1260 to be called automatically on the retrieved pointer when the associated 1238 1261 device is removed. It is recommended to use this function over plain 1239 - pinctrl_get(). 1262 + ``pinctrl_get()``. 1240 1263 1241 - - pinctrl_lookup_state() is called in process context to obtain a handle to a 1264 + - ``pinctrl_lookup_state()`` is called in process context to obtain a handle to a 1242 1265 specific state for a client device. This operation may be slow, too. 1243 1266 1244 - - pinctrl_select_state() programs pin controller hardware according to the 1267 + - ``pinctrl_select_state()`` programs pin controller hardware according to the 1245 1268 definition of the state as given by the mapping table. In theory, this is a 1246 1269 fast-path operation, since it only involved blasting some register settings 1247 1270 into hardware. However, note that some pin controllers may have their 1248 1271 registers on a slow/IRQ-based bus, so client devices should not assume they 1249 - can call pinctrl_select_state() from non-blocking contexts. 1272 + can call ``pinctrl_select_state()`` from non-blocking contexts. 1250 1273 1251 - - pinctrl_put() frees all information associated with a pinctrl handle. 1274 + - ``pinctrl_put()`` frees all information associated with a pinctrl handle. 1252 1275 1253 - - devm_pinctrl_put() is a variant of pinctrl_put() that may be used to 1254 - explicitly destroy a pinctrl object returned by devm_pinctrl_get(). 1276 + - ``devm_pinctrl_put()`` is a variant of ``pinctrl_put()`` that may be used to 1277 + explicitly destroy a pinctrl object returned by ``devm_pinctrl_get()``. 1255 1278 However, use of this function will be rare, due to the automatic cleanup 1256 1279 that will occur even without calling it. 1257 1280 1258 - pinctrl_get() must be paired with a plain pinctrl_put(). 1259 - pinctrl_get() may not be paired with devm_pinctrl_put(). 1260 - devm_pinctrl_get() can optionally be paired with devm_pinctrl_put(). 1261 - devm_pinctrl_get() may not be paired with plain pinctrl_put(). 1281 + ``pinctrl_get()`` must be paired with a plain ``pinctrl_put()``. 1282 + ``pinctrl_get()`` may not be paired with ``devm_pinctrl_put()``. 1283 + ``devm_pinctrl_get()`` can optionally be paired with ``devm_pinctrl_put()``. 1284 + ``devm_pinctrl_get()`` may not be paired with plain ``pinctrl_put()``. 1262 1285 1263 1286 Usually the pin control core handled the get/put pair and call out to the 1264 1287 device drivers bookkeeping operations, like checking available functions and 1265 - the associated pins, whereas select_state pass on to the pin controller 1288 + the associated pins, whereas ``pinctrl_select_state()`` pass on to the pin controller 1266 1289 driver which takes care of activating and/or deactivating the mux setting by 1267 1290 quickly poking some registers. 1268 1291 1269 - The pins are allocated for your device when you issue the devm_pinctrl_get() 1292 + The pins are allocated for your device when you issue the ``devm_pinctrl_get()`` 1270 1293 call, after this you should be able to see this in the debugfs listing of all 1271 1294 pins. 1272 1295 1273 - NOTE: the pinctrl system will return -EPROBE_DEFER if it cannot find the 1296 + NOTE: the pinctrl system will return ``-EPROBE_DEFER`` if it cannot find the 1274 1297 requested pinctrl handles, for example if the pinctrl driver has not yet 1275 1298 registered. Thus make sure that the error path in your driver gracefully 1276 1299 cleans up and is ready to retry the probing later in the startup process. ··· 1282 1305 Again, it is discouraged to let drivers lookup and select pin control states 1283 1306 themselves, but again sometimes this is unavoidable. 1284 1307 1285 - So say that your driver is fetching its resources like this:: 1308 + So say that your driver is fetching its resources like this: 1309 + 1310 + .. code-block:: c 1286 1311 1287 1312 #include <linux/pinctrl/consumer.h> 1288 - #include <linux/gpio.h> 1313 + #include <linux/gpio/consumer.h> 1289 1314 1290 1315 struct pinctrl *pinctrl; 1291 - int gpio; 1316 + struct gpio_desc *gpio; 1292 1317 1293 1318 pinctrl = devm_pinctrl_get_select_default(&dev); 1294 - gpio = devm_gpio_request(&dev, 14, "foo"); 1319 + gpio = devm_gpiod_get(&dev, "foo"); 1295 1320 1296 - Here we first request a certain pin state and then request GPIO 14 to be 1321 + Here we first request a certain pin state and then request GPIO "foo" to be 1297 1322 used. If you're using the subsystems orthogonally like this, you should 1298 1323 nominally always get your pinctrl handle and select the desired pinctrl 1299 1324 state BEFORE requesting the GPIO. This is a semantic convention to avoid ··· 1310 1331 But there are also situations where it makes sense for the GPIO subsystem 1311 1332 to communicate directly with the pinctrl subsystem, using the latter as a 1312 1333 back-end. This is when the GPIO driver may call out to the functions 1313 - described in the section "Pin control interaction with the GPIO subsystem" 1334 + described in the section `Pin control interaction with the GPIO subsystem`_ 1314 1335 above. This only involves per-pin multiplexing, and will be completely 1315 - hidden behind the gpio_*() function namespace. In this case, the driver 1336 + hidden behind the gpiod_*() function namespace. In this case, the driver 1316 1337 need not interact with the pin control subsystem at all. 1317 1338 1318 1339 If a pin control driver and a GPIO driver is dealing with the same pins ··· 1327 1348 ========================== 1328 1349 1329 1350 Pin control map entries can be hogged by the core when the pin controller 1330 - is registered. This means that the core will attempt to call pinctrl_get(), 1331 - lookup_state() and select_state() on it immediately after the pin control 1332 - device has been registered. 1351 + is registered. This means that the core will attempt to call ``pinctrl_get()``, 1352 + ``pinctrl_lookup_state()`` and ``pinctrl_select_state()`` on it immediately after 1353 + the pin control device has been registered. 1333 1354 1334 1355 This occurs for mapping table entries where the client device name is equal 1335 - to the pin controller device name, and the state name is PINCTRL_STATE_DEFAULT:: 1356 + to the pin controller device name, and the state name is ``PINCTRL_STATE_DEFAULT``: 1357 + 1358 + .. code-block:: c 1336 1359 1337 1360 { 1338 1361 .dev_name = "pinctrl-foo", ··· 1346 1365 1347 1366 Since it may be common to request the core to hog a few always-applicable 1348 1367 mux settings on the primary pin controller, there is a convenience macro for 1349 - this:: 1368 + this: 1369 + 1370 + .. code-block:: c 1350 1371 1351 1372 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-foo", NULL /* group */, 1352 1373 "power_func") ··· 1368 1385 1369 1386 This snippet first initializes a state object for both groups (in foo_probe()), 1370 1387 then muxes the function in the pins defined by group A, and finally muxes it in 1371 - on the pins defined by group B:: 1388 + on the pins defined by group B: 1389 + 1390 + .. code-block:: c 1372 1391 1373 1392 #include <linux/pinctrl/consumer.h> 1374 1393 ··· 1398 1413 /* Enable on position A */ 1399 1414 ret = pinctrl_select_state(p, s1); 1400 1415 if (ret < 0) 1401 - ... 1416 + ... 1402 1417 1403 1418 ... 1404 1419 1405 1420 /* Enable on position B */ 1406 1421 ret = pinctrl_select_state(p, s2); 1407 1422 if (ret < 0) 1408 - ... 1423 + ... 1409 1424 1410 1425 ... 1411 1426 } ··· 1417 1432 1418 1433 Debugfs files 1419 1434 ============= 1435 + 1420 1436 These files are created in ``/sys/kernel/debug/pinctrl``: 1421 1437 1422 1438 - ``pinctrl-devices``: prints each pin controller device along with columns to ··· 1426 1440 - ``pinctrl-handles``: prints each configured pin controller handle and the 1427 1441 corresponding pinmux maps 1428 1442 1429 - - ``pinctrl-maps``: print all pinctrl maps 1443 + - ``pinctrl-maps``: prints all pinctrl maps 1430 1444 1431 1445 A sub-directory is created inside of ``/sys/kernel/debug/pinctrl`` for each pin 1432 1446 controller device containing these files: ··· 1434 1448 - ``pins``: prints a line for each pin registered on the pin controller. The 1435 1449 pinctrl driver may add additional information such as register contents. 1436 1450 1437 - - ``gpio-ranges``: print ranges that map gpio lines to pins on the controller 1451 + - ``gpio-ranges``: prints ranges that map gpio lines to pins on the controller 1438 1452 1439 - - ``pingroups``: print all pin groups registered on the pin controller 1453 + - ``pingroups``: prints all pin groups registered on the pin controller 1440 1454 1441 - - ``pinconf-pins``: print pin config settings for each pin 1455 + - ``pinconf-pins``: prints pin config settings for each pin 1442 1456 1443 - - ``pinconf-groups``: print pin config settings per pin group 1457 + - ``pinconf-groups``: prints pin config settings per pin group 1444 1458 1445 - - ``pinmux-functions``: print each pin function along with the pin groups that 1459 + - ``pinmux-functions``: prints each pin function along with the pin groups that 1446 1460 map to the pin function 1447 1461 1448 - - ``pinmux-pins``: iterate through all pins and print mux owner, gpio owner 1462 + - ``pinmux-pins``: iterates through all pins and prints mux owner, gpio owner 1449 1463 and if the pin is a hog 1450 1464 1451 - - ``pinmux-select``: write to this file to activate a pin function for a group:: 1465 + - ``pinmux-select``: write to this file to activate a pin function for a group: 1466 + 1467 + .. code-block:: sh 1452 1468 1453 1469 echo "<group-name function-name>" > pinmux-select
+5 -3
MAINTAINERS
··· 19824 19824 F: drivers/clk/starfive/clk-starfive-jh7100* 19825 19825 F: include/dt-bindings/clock/starfive-jh7100*.h 19826 19826 19827 - STARFIVE JH7100 PINCTRL DRIVER 19827 + STARFIVE JH71X0 PINCTRL DRIVERS 19828 19828 M: Emil Renner Berthing <kernel@esmil.dk> 19829 + M: Jianlong Huang <jianlong.huang@starfivetech.com> 19829 19830 L: linux-gpio@vger.kernel.org 19830 19831 S: Maintained 19831 - F: Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml 19832 - F: drivers/pinctrl/starfive/ 19832 + F: Documentation/devicetree/bindings/pinctrl/starfive,jh71*.yaml 19833 + F: drivers/pinctrl/starfive/pinctrl-starfive-jh71* 19833 19834 F: include/dt-bindings/pinctrl/pinctrl-starfive-jh7100.h 19835 + F: include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h 19834 19836 19835 19837 STARFIVE JH7100 RESET CONTROLLER DRIVER 19836 19838 M: Emil Renner Berthing <kernel@esmil.dk>
-5
drivers/gpio/gpiolib-of.c
··· 980 980 if (!np) 981 981 return 0; 982 982 983 - if (!of_property_read_bool(np, "gpio-ranges") && 984 - chip->of_gpio_ranges_fallback) { 985 - return chip->of_gpio_ranges_fallback(chip, np); 986 - } 987 - 988 983 group_names = of_find_property(np, group_names_propname, NULL); 989 984 990 985 for (;; index++) {
+8
drivers/gpio/gpiolib.c
··· 532 532 533 533 static int gpiochip_add_pin_ranges(struct gpio_chip *gc) 534 534 { 535 + /* 536 + * Device Tree platforms are supposed to use "gpio-ranges" 537 + * property. This check ensures that the ->add_pin_ranges() 538 + * won't be called for them. 539 + */ 540 + if (device_property_present(&gc->gpiodev->dev, "gpio-ranges")) 541 + return 0; 542 + 535 543 if (gc->add_pin_ranges) 536 544 return gc->add_pin_ranges(gc); 537 545
+1 -1
drivers/pinctrl/Kconfig
··· 172 172 173 173 config PINCTRL_DIGICOLOR 174 174 bool 175 - depends on OF && (ARCH_DIGICOLOR || COMPILE_TEST) 175 + depends on ARCH_DIGICOLOR || COMPILE_TEST 176 176 select PINMUX 177 177 select GENERIC_PINCONF 178 178
+4 -6
drivers/pinctrl/bcm/pinctrl-bcm2835.c
··· 358 358 return 0; 359 359 } 360 360 361 - static int bcm2835_of_gpio_ranges_fallback(struct gpio_chip *gc, 362 - struct device_node *np) 361 + static int bcm2835_add_pin_ranges_fallback(struct gpio_chip *gc) 363 362 { 363 + struct device_node *np = dev_of_node(gc->parent); 364 364 struct pinctrl_dev *pctldev = of_pinctrl_get(np); 365 - 366 - of_node_put(np); 367 365 368 366 if (!pctldev) 369 367 return 0; ··· 386 388 .base = -1, 387 389 .ngpio = BCM2835_NUM_GPIOS, 388 390 .can_sleep = false, 389 - .of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, 391 + .add_pin_ranges = bcm2835_add_pin_ranges_fallback, 390 392 }; 391 393 392 394 static const struct gpio_chip bcm2711_gpio_chip = { ··· 403 405 .base = -1, 404 406 .ngpio = BCM2711_NUM_GPIOS, 405 407 .can_sleep = false, 406 - .of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, 408 + .add_pin_ranges = bcm2835_add_pin_ranges_fallback, 407 409 }; 408 410 409 411 static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,
+3 -3
drivers/pinctrl/freescale/pinctrl-mxs.c
··· 269 269 for (n = 0; n < num_configs; n++) { 270 270 config = configs[n]; 271 271 272 - ma = CONFIG_TO_MA(config); 273 - vol = CONFIG_TO_VOL(config); 274 - pull = CONFIG_TO_PULL(config); 272 + ma = PIN_CONFIG_TO_MA(config); 273 + vol = PIN_CONFIG_TO_VOL(config); 274 + pull = PIN_CONFIG_TO_PULL(config); 275 275 276 276 for (i = 0; i < g->npins; i++) { 277 277 bank = PINID_TO_BANK(g->pins[i]);
+3 -3
drivers/pinctrl/freescale/pinctrl-mxs.h
··· 44 44 #define VOL_SHIFT 3 45 45 #define MA_PRESENT (1 << 2) 46 46 #define MA_SHIFT 0 47 - #define CONFIG_TO_PULL(c) ((c) >> PULL_SHIFT & 0x1) 48 - #define CONFIG_TO_VOL(c) ((c) >> VOL_SHIFT & 0x1) 49 - #define CONFIG_TO_MA(c) ((c) >> MA_SHIFT & 0x3) 47 + #define PIN_CONFIG_TO_PULL(c) ((c) >> PULL_SHIFT & 0x1) 48 + #define PIN_CONFIG_TO_VOL(c) ((c) >> VOL_SHIFT & 0x1) 49 + #define PIN_CONFIG_TO_MA(c) ((c) >> MA_SHIFT & 0x3) 50 50 51 51 struct mxs_function { 52 52 const char *name;
+2 -16
drivers/pinctrl/intel/pinctrl-alderlake.c
··· 34 34 .gpio_base = (g), \ 35 35 } 36 36 37 - #define ADL_COMMUNITY(b, s, e, g, v) \ 38 - { \ 39 - .barno = (b), \ 40 - .padown_offset = ADL_##v##_PAD_OWN, \ 41 - .padcfglock_offset = ADL_##v##_PADCFGLOCK, \ 42 - .hostown_offset = ADL_##v##_HOSTSW_OWN, \ 43 - .is_offset = ADL_##v##_GPI_IS, \ 44 - .ie_offset = ADL_##v##_GPI_IE, \ 45 - .pin_base = (s), \ 46 - .npins = ((e) - (s) + 1), \ 47 - .gpps = (g), \ 48 - .ngpps = ARRAY_SIZE(g), \ 49 - } 50 - 51 37 #define ADL_N_COMMUNITY(b, s, e, g) \ 52 - ADL_COMMUNITY(b, s, e, g, N) 38 + INTEL_COMMUNITY_GPPS(b, s, e, g, ADL_N) 53 39 54 40 #define ADL_S_COMMUNITY(b, s, e, g) \ 55 - ADL_COMMUNITY(b, s, e, g, S) 41 + INTEL_COMMUNITY_GPPS(b, s, e, g, ADL_S) 56 42 57 43 /* Alder Lake-N */ 58 44 static const struct pinctrl_pin_desc adln_pins[] = {
+5 -5
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 637 637 { 638 638 struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 639 639 640 - return vg->soc->functions[selector].name; 640 + return vg->soc->functions[selector].func.name; 641 641 } 642 642 643 643 static int byt_get_function_groups(struct pinctrl_dev *pctldev, 644 644 unsigned int selector, 645 645 const char * const **groups, 646 - unsigned int *num_groups) 646 + unsigned int *ngroups) 647 647 { 648 648 struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 649 649 650 - *groups = vg->soc->functions[selector].groups; 651 - *num_groups = vg->soc->functions[selector].ngroups; 650 + *groups = vg->soc->functions[selector].func.groups; 651 + *ngroups = vg->soc->functions[selector].func.ngroups; 652 652 653 653 return 0; 654 654 } ··· 722 722 723 723 if (group.modes) 724 724 byt_set_group_mixed_mux(vg, group, group.modes); 725 - else if (!strcmp(func.name, "gpio")) 725 + else if (!strcmp(func.func.name, "gpio")) 726 726 byt_set_group_simple_mux(vg, group, BYT_DEFAULT_GPIO_MUX); 727 727 else 728 728 byt_set_group_simple_mux(vg, group, group.mode);
+11 -20
drivers/pinctrl/intel/pinctrl-broxton.c
··· 20 20 #define BXT_GPI_IS 0x100 21 21 #define BXT_GPI_IE 0x110 22 22 23 - #define BXT_COMMUNITY(s, e) \ 24 - { \ 25 - .padown_offset = BXT_PAD_OWN, \ 26 - .padcfglock_offset = BXT_PADCFGLOCK, \ 27 - .hostown_offset = BXT_HOSTSW_OWN, \ 28 - .is_offset = BXT_GPI_IS, \ 29 - .ie_offset = BXT_GPI_IE, \ 30 - .gpp_size = 32, \ 31 - .pin_base = (s), \ 32 - .npins = ((e) - (s) + 1), \ 33 - } 23 + #define BXT_COMMUNITY(b, s, e) \ 24 + INTEL_COMMUNITY_SIZE(b, s, e, 32, 4, BXT) 34 25 35 26 /* BXT */ 36 27 static const struct pinctrl_pin_desc bxt_north_pins[] = { ··· 163 172 }; 164 173 165 174 static const struct intel_community bxt_north_communities[] = { 166 - BXT_COMMUNITY(0, 82), 175 + BXT_COMMUNITY(0, 0, 82), 167 176 }; 168 177 169 178 static const struct intel_pinctrl_soc_data bxt_north_soc_data = { ··· 280 289 }; 281 290 282 291 static const struct intel_community bxt_northwest_communities[] = { 283 - BXT_COMMUNITY(0, 71), 292 + BXT_COMMUNITY(0, 0, 71), 284 293 }; 285 294 286 295 static const struct intel_pinctrl_soc_data bxt_northwest_soc_data = { ··· 387 396 }; 388 397 389 398 static const struct intel_community bxt_west_communities[] = { 390 - BXT_COMMUNITY(0, 41), 399 + BXT_COMMUNITY(0, 0, 41), 391 400 }; 392 401 393 402 static const struct intel_pinctrl_soc_data bxt_west_soc_data = { ··· 463 472 }; 464 473 465 474 static const struct intel_community bxt_southwest_communities[] = { 466 - BXT_COMMUNITY(0, 30), 475 + BXT_COMMUNITY(0, 0, 30), 467 476 }; 468 477 469 478 static const struct intel_pinctrl_soc_data bxt_southwest_soc_data = { ··· 502 511 }; 503 512 504 513 static const struct intel_community bxt_south_communities[] = { 505 - BXT_COMMUNITY(0, 19), 514 + BXT_COMMUNITY(0, 0, 19), 506 515 }; 507 516 508 517 static const struct intel_pinctrl_soc_data bxt_south_soc_data = { ··· 641 650 }; 642 651 643 652 static const struct intel_community apl_north_communities[] = { 644 - BXT_COMMUNITY(0, 77), 653 + BXT_COMMUNITY(0, 0, 77), 645 654 }; 646 655 647 656 static const struct intel_pinctrl_soc_data apl_north_soc_data = { ··· 761 770 }; 762 771 763 772 static const struct intel_community apl_northwest_communities[] = { 764 - BXT_COMMUNITY(0, 76), 773 + BXT_COMMUNITY(0, 0, 76), 765 774 }; 766 775 767 776 static const struct intel_pinctrl_soc_data apl_northwest_soc_data = { ··· 871 880 }; 872 881 873 882 static const struct intel_community apl_west_communities[] = { 874 - BXT_COMMUNITY(0, 46), 883 + BXT_COMMUNITY(0, 0, 46), 875 884 }; 876 885 877 886 static const struct intel_pinctrl_soc_data apl_west_soc_data = { ··· 963 972 }; 964 973 965 974 static const struct intel_community apl_southwest_communities[] = { 966 - BXT_COMMUNITY(0, 42), 975 + BXT_COMMUNITY(0, 0, 42), 967 976 }; 968 977 969 978 static const struct intel_pinctrl_soc_data apl_southwest_soc_data = {
+11 -20
drivers/pinctrl/intel/pinctrl-cannonlake.c
··· 15 15 16 16 #include "pinctrl-intel.h" 17 17 18 - #define CNL_PAD_OWN 0x020 19 - #define CNL_PADCFGLOCK 0x080 18 + #define CNL_LP_PAD_OWN 0x020 19 + #define CNL_LP_PADCFGLOCK 0x080 20 20 #define CNL_LP_HOSTSW_OWN 0x0b0 21 + #define CNL_LP_GPI_IS 0x100 22 + #define CNL_LP_GPI_IE 0x120 23 + 24 + #define CNL_H_PAD_OWN 0x020 25 + #define CNL_H_PADCFGLOCK 0x080 21 26 #define CNL_H_HOSTSW_OWN 0x0c0 22 - #define CNL_GPI_IS 0x100 23 - #define CNL_GPI_IE 0x120 27 + #define CNL_H_GPI_IS 0x100 28 + #define CNL_H_GPI_IE 0x120 24 29 25 30 #define CNL_GPP(r, s, e, g) \ 26 31 { \ ··· 35 30 .gpio_base = (g), \ 36 31 } 37 32 38 - #define CNL_COMMUNITY(b, s, e, g, v) \ 39 - { \ 40 - .barno = (b), \ 41 - .padown_offset = CNL_PAD_OWN, \ 42 - .padcfglock_offset = CNL_PADCFGLOCK, \ 43 - .hostown_offset = CNL_##v##_HOSTSW_OWN, \ 44 - .is_offset = CNL_GPI_IS, \ 45 - .ie_offset = CNL_GPI_IE, \ 46 - .pin_base = (s), \ 47 - .npins = ((e) - (s) + 1), \ 48 - .gpps = (g), \ 49 - .ngpps = ARRAY_SIZE(g), \ 50 - } 51 - 52 33 #define CNL_LP_COMMUNITY(b, s, e, g) \ 53 - CNL_COMMUNITY(b, s, e, g, LP) 34 + INTEL_COMMUNITY_GPPS(b, s, e, g, CNL_LP) 54 35 55 36 #define CNL_H_COMMUNITY(b, s, e, g) \ 56 - CNL_COMMUNITY(b, s, e, g, H) 37 + INTEL_COMMUNITY_GPPS(b, s, e, g, CNL_H) 57 38 58 39 /* Cannon Lake-H */ 59 40 static const struct pinctrl_pin_desc cnlh_pins[] = {
+1 -12
drivers/pinctrl/intel/pinctrl-cedarfork.c
··· 28 28 } 29 29 30 30 #define CDF_COMMUNITY(b, s, e, g) \ 31 - { \ 32 - .barno = (b), \ 33 - .padown_offset = CDF_PAD_OWN, \ 34 - .padcfglock_offset = CDF_PADCFGLOCK, \ 35 - .hostown_offset = CDF_HOSTSW_OWN, \ 36 - .is_offset = CDF_GPI_IS, \ 37 - .ie_offset = CDF_GPI_IE, \ 38 - .pin_base = (s), \ 39 - .npins = ((e) - (s) + 1), \ 40 - .gpps = (g), \ 41 - .ngpps = ARRAY_SIZE(g), \ 42 - } 31 + INTEL_COMMUNITY_GPPS(b, s, e, g, CDF) 43 32 44 33 /* Cedar Fork PCH */ 45 34 static const struct pinctrl_pin_desc cdf_pins[] = {
+3 -3
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 694 694 { 695 695 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 696 696 697 - return pctrl->soc->functions[function].name; 697 + return pctrl->soc->functions[function].func.name; 698 698 } 699 699 700 700 static int chv_get_function_groups(struct pinctrl_dev *pctldev, ··· 704 704 { 705 705 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 706 706 707 - *groups = pctrl->soc->functions[function].groups; 708 - *ngroups = pctrl->soc->functions[function].ngroups; 707 + *groups = pctrl->soc->functions[function].func.groups; 708 + *ngroups = pctrl->soc->functions[function].func.ngroups; 709 709 return 0; 710 710 } 711 711
+1 -12
drivers/pinctrl/intel/pinctrl-denverton.c
··· 28 28 } 29 29 30 30 #define DNV_COMMUNITY(b, s, e, g) \ 31 - { \ 32 - .barno = (b), \ 33 - .padown_offset = DNV_PAD_OWN, \ 34 - .padcfglock_offset = DNV_PADCFGLOCK, \ 35 - .hostown_offset = DNV_HOSTSW_OWN, \ 36 - .is_offset = DNV_GPI_IS, \ 37 - .ie_offset = DNV_GPI_IE, \ 38 - .pin_base = (s), \ 39 - .npins = ((e) - (s) + 1), \ 40 - .gpps = (g), \ 41 - .ngpps = ARRAY_SIZE(g), \ 42 - } 31 + INTEL_COMMUNITY_GPPS(b, s, e, g, DNV) 43 32 44 33 /* Denverton */ 45 34 static const struct pinctrl_pin_desc dnv_pins[] = {
+7 -17
drivers/pinctrl/intel/pinctrl-elkhartlake.c
··· 27 27 .size = ((e) - (s) + 1), \ 28 28 } 29 29 30 - #define EHL_COMMUNITY(s, e, g) \ 31 - { \ 32 - .padown_offset = EHL_PAD_OWN, \ 33 - .padcfglock_offset = EHL_PADCFGLOCK, \ 34 - .hostown_offset = EHL_HOSTSW_OWN, \ 35 - .is_offset = EHL_GPI_IS, \ 36 - .ie_offset = EHL_GPI_IE, \ 37 - .pin_base = (s), \ 38 - .npins = ((e) - (s) + 1), \ 39 - .gpps = (g), \ 40 - .ngpps = ARRAY_SIZE(g), \ 41 - } 30 + #define EHL_COMMUNITY(b, s, e, g) \ 31 + INTEL_COMMUNITY_GPPS(b, s, e, g, EHL) 42 32 43 33 /* Elkhart Lake */ 44 34 static const struct pinctrl_pin_desc ehl_community0_pins[] = { ··· 111 121 }; 112 122 113 123 static const struct intel_community ehl_community0[] = { 114 - EHL_COMMUNITY(0, 66, ehl_community0_gpps), 124 + EHL_COMMUNITY(0, 0, 66, ehl_community0_gpps), 115 125 }; 116 126 117 127 static const struct intel_pinctrl_soc_data ehl_community0_soc_data = { ··· 252 262 }; 253 263 254 264 static const struct intel_community ehl_community1[] = { 255 - EHL_COMMUNITY(0, 112, ehl_community1_gpps), 265 + EHL_COMMUNITY(0, 0, 112, ehl_community1_gpps), 256 266 }; 257 267 258 268 static const struct intel_pinctrl_soc_data ehl_community1_soc_data = { ··· 325 335 }; 326 336 327 337 static const struct intel_community ehl_community3[] = { 328 - EHL_COMMUNITY(0, 46, ehl_community3_gpps), 338 + EHL_COMMUNITY(0, 0, 46, ehl_community3_gpps), 329 339 }; 330 340 331 341 static const struct intel_pinctrl_soc_data ehl_community3_soc_data = { ··· 431 441 }; 432 442 433 443 static const struct intel_community ehl_community4[] = { 434 - EHL_COMMUNITY(0, 79, ehl_community4_gpps), 444 + EHL_COMMUNITY(0, 0, 79, ehl_community4_gpps), 435 445 }; 436 446 437 447 static const struct intel_pinctrl_soc_data ehl_community4_soc_data = { ··· 459 469 }; 460 470 461 471 static const struct intel_community ehl_community5[] = { 462 - EHL_COMMUNITY(0, 7, ehl_community5_gpps), 472 + EHL_COMMUNITY(0, 0, 7, ehl_community5_gpps), 463 473 }; 464 474 465 475 static const struct intel_pinctrl_soc_data ehl_community5_soc_data = {
+1 -12
drivers/pinctrl/intel/pinctrl-emmitsburg.c
··· 28 28 } 29 29 30 30 #define EBG_COMMUNITY(b, s, e, g) \ 31 - { \ 32 - .barno = (b), \ 33 - .padown_offset = EBG_PAD_OWN, \ 34 - .padcfglock_offset = EBG_PADCFGLOCK, \ 35 - .hostown_offset = EBG_HOSTSW_OWN, \ 36 - .is_offset = EBG_GPI_IS, \ 37 - .ie_offset = EBG_GPI_IE, \ 38 - .pin_base = (s), \ 39 - .npins = ((e) - (s) + 1), \ 40 - .gpps = (g), \ 41 - .ngpps = ARRAY_SIZE(g), \ 42 - } 31 + INTEL_COMMUNITY_GPPS(b, s, e, g, EBG) 43 32 44 33 /* Emmitsburg */ 45 34 static const struct pinctrl_pin_desc ebg_pins[] = {
+6 -15
drivers/pinctrl/intel/pinctrl-geminilake.c
··· 20 20 #define GLK_GPI_IS 0x100 21 21 #define GLK_GPI_IE 0x110 22 22 23 - #define GLK_COMMUNITY(s, e) \ 24 - { \ 25 - .padown_offset = GLK_PAD_OWN, \ 26 - .padcfglock_offset = GLK_PADCFGLOCK, \ 27 - .hostown_offset = GLK_HOSTSW_OWN, \ 28 - .is_offset = GLK_GPI_IS, \ 29 - .ie_offset = GLK_GPI_IE, \ 30 - .gpp_size = 32, \ 31 - .pin_base = (s), \ 32 - .npins = ((e) - (s) + 1), \ 33 - } 23 + #define GLK_COMMUNITY(b, s, e) \ 24 + INTEL_COMMUNITY_SIZE(b, s, e, 32, 4, GLK) 34 25 35 26 /* GLK */ 36 27 static const struct pinctrl_pin_desc glk_northwest_pins[] = { ··· 164 173 }; 165 174 166 175 static const struct intel_community glk_northwest_communities[] = { 167 - GLK_COMMUNITY(0, 79), 176 + GLK_COMMUNITY(0, 0, 79), 168 177 }; 169 178 170 179 static const struct intel_pinctrl_soc_data glk_northwest_soc_data = { ··· 297 306 }; 298 307 299 308 static const struct intel_community glk_north_communities[] = { 300 - GLK_COMMUNITY(0, 79), 309 + GLK_COMMUNITY(0, 0, 79), 301 310 }; 302 311 303 312 static const struct intel_pinctrl_soc_data glk_north_soc_data = { ··· 336 345 }; 337 346 338 347 static const struct intel_community glk_audio_communities[] = { 339 - GLK_COMMUNITY(0, 19), 348 + GLK_COMMUNITY(0, 0, 19), 340 349 }; 341 350 342 351 static const struct intel_pinctrl_soc_data glk_audio_soc_data = { ··· 418 427 }; 419 428 420 429 static const struct intel_community glk_scc_communities[] = { 421 - GLK_COMMUNITY(0, 34), 430 + GLK_COMMUNITY(0, 0, 34), 422 431 }; 423 432 424 433 static const struct intel_pinctrl_soc_data glk_scc_soc_data = {
+13 -22
drivers/pinctrl/intel/pinctrl-icelake.c
··· 15 15 16 16 #include "pinctrl-intel.h" 17 17 18 - #define ICL_PAD_OWN 0x020 19 - #define ICL_PADCFGLOCK 0x080 20 - #define ICL_HOSTSW_OWN 0x0b0 21 - #define ICL_GPI_IS 0x100 22 - #define ICL_LP_GPI_IE 0x110 23 - #define ICL_N_GPI_IE 0x120 18 + #define ICL_LP_PAD_OWN 0x020 19 + #define ICL_LP_PADCFGLOCK 0x080 20 + #define ICL_LP_HOSTSW_OWN 0x0b0 21 + #define ICL_LP_GPI_IS 0x100 22 + #define ICL_LP_GPI_IE 0x110 23 + 24 + #define ICL_N_PAD_OWN 0x020 25 + #define ICL_N_PADCFGLOCK 0x080 26 + #define ICL_N_HOSTSW_OWN 0x0b0 27 + #define ICL_N_GPI_IS 0x100 28 + #define ICL_N_GPI_IE 0x120 24 29 25 30 #define ICL_GPP(r, s, e, g) \ 26 31 { \ ··· 35 30 .gpio_base = (g), \ 36 31 } 37 32 38 - #define ICL_COMMUNITY(b, s, e, g, v) \ 39 - { \ 40 - .barno = (b), \ 41 - .padown_offset = ICL_PAD_OWN, \ 42 - .padcfglock_offset = ICL_PADCFGLOCK, \ 43 - .hostown_offset = ICL_HOSTSW_OWN, \ 44 - .is_offset = ICL_GPI_IS, \ 45 - .ie_offset = ICL_##v##_GPI_IE, \ 46 - .pin_base = (s), \ 47 - .npins = ((e) - (s) + 1), \ 48 - .gpps = (g), \ 49 - .ngpps = ARRAY_SIZE(g), \ 50 - } 51 - 52 33 #define ICL_LP_COMMUNITY(b, s, e, g) \ 53 - ICL_COMMUNITY(b, s, e, g, LP) 34 + INTEL_COMMUNITY_GPPS(b, s, e, g, ICL_LP) 54 35 55 36 #define ICL_N_COMMUNITY(b, s, e, g) \ 56 - ICL_COMMUNITY(b, s, e, g, N) 37 + INTEL_COMMUNITY_GPPS(b, s, e, g, ICL_N) 57 38 58 39 /* Ice Lake-LP */ 59 40 static const struct pinctrl_pin_desc icllp_pins[] = {
+63 -63
drivers/pinctrl/intel/pinctrl-intel.c
··· 81 81 #define PADCFG1_TERM_MASK GENMASK(12, 10) 82 82 #define PADCFG1_TERM_20K BIT(2) 83 83 #define PADCFG1_TERM_5K BIT(1) 84 + #define PADCFG1_TERM_4K (BIT(2) | BIT(1)) 84 85 #define PADCFG1_TERM_1K BIT(0) 86 + #define PADCFG1_TERM_952 (BIT(2) | BIT(0)) 85 87 #define PADCFG1_TERM_833 (BIT(1) | BIT(0)) 88 + #define PADCFG1_TERM_800 (BIT(2) | BIT(1) | BIT(0)) 86 89 87 90 #define PADCFG2 0x008 88 - #define PADCFG2_DEBEN BIT(0) 89 91 #define PADCFG2_DEBOUNCE_SHIFT 1 90 92 #define PADCFG2_DEBOUNCE_MASK GENMASK(4, 1) 93 + #define PADCFG2_DEBEN BIT(0) 91 94 92 95 #define DEBOUNCE_PERIOD_NSEC 31250 93 96 ··· 372 369 { 373 370 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 374 371 375 - return pctrl->soc->functions[function].name; 372 + return pctrl->soc->functions[function].func.name; 376 373 } 377 374 378 375 static int intel_get_function_groups(struct pinctrl_dev *pctldev, ··· 382 379 { 383 380 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 384 381 385 - *groups = pctrl->soc->functions[function].groups; 386 - *ngroups = pctrl->soc->functions[function].ngroups; 382 + *groups = pctrl->soc->functions[function].func.groups; 383 + *ngroups = pctrl->soc->functions[function].func.ngroups; 387 384 return 0; 388 385 } 389 386 ··· 577 574 case PADCFG1_TERM_1K: 578 575 *arg = 1000; 579 576 break; 577 + case PADCFG1_TERM_4K: 578 + *arg = 4000; 579 + break; 580 580 case PADCFG1_TERM_5K: 581 581 *arg = 5000; 582 582 break; ··· 604 598 if (!(community->features & PINCTRL_FEATURE_1K_PD)) 605 599 return -EINVAL; 606 600 *arg = 1000; 601 + break; 602 + case PADCFG1_TERM_4K: 603 + *arg = 4000; 607 604 break; 608 605 case PADCFG1_TERM_5K: 609 606 *arg = 5000; ··· 700 691 raw_spin_lock_irqsave(&pctrl->lock, flags); 701 692 702 693 value = readl(padcfg1); 694 + value &= ~(PADCFG1_TERM_MASK | PADCFG1_TERM_UP); 695 + 696 + /* Set default strength value in case none is given */ 697 + if (arg == 1) 698 + arg = 5000; 703 699 704 700 switch (param) { 705 701 case PIN_CONFIG_BIAS_DISABLE: 706 - value &= ~(PADCFG1_TERM_MASK | PADCFG1_TERM_UP); 707 702 break; 708 703 709 704 case PIN_CONFIG_BIAS_PULL_UP: 710 - value &= ~PADCFG1_TERM_MASK; 711 - 712 - value |= PADCFG1_TERM_UP; 713 - 714 - /* Set default strength value in case none is given */ 715 - if (arg == 1) 716 - arg = 5000; 717 - 718 705 switch (arg) { 719 706 case 20000: 720 707 value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; 721 708 break; 722 709 case 5000: 723 710 value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT; 711 + break; 712 + case 4000: 713 + value |= PADCFG1_TERM_4K << PADCFG1_TERM_SHIFT; 724 714 break; 725 715 case 1000: 726 716 value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; ··· 729 721 break; 730 722 default: 731 723 ret = -EINVAL; 724 + break; 725 + } 726 + 727 + value |= PADCFG1_TERM_UP; 728 + break; 729 + 730 + case PIN_CONFIG_BIAS_PULL_DOWN: 731 + switch (arg) { 732 + case 20000: 733 + value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; 734 + break; 735 + case 5000: 736 + value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT; 737 + break; 738 + case 4000: 739 + value |= PADCFG1_TERM_4K << PADCFG1_TERM_SHIFT; 740 + break; 741 + case 1000: 742 + if (!(community->features & PINCTRL_FEATURE_1K_PD)) { 743 + ret = -EINVAL; 744 + break; 745 + } 746 + value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; 747 + break; 748 + case 833: 749 + if (!(community->features & PINCTRL_FEATURE_1K_PD)) { 750 + ret = -EINVAL; 751 + break; 752 + } 753 + value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT; 754 + break; 755 + default: 756 + ret = -EINVAL; 757 + break; 732 758 } 733 759 734 760 break; 735 761 736 - case PIN_CONFIG_BIAS_PULL_DOWN: 737 - value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK); 738 - 739 - /* Set default strength value in case none is given */ 740 - if (arg == 1) 741 - arg = 5000; 742 - 743 - switch (arg) { 744 - case 20000: 745 - value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; 746 - break; 747 - case 5000: 748 - value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT; 749 - break; 750 - case 1000: 751 - if (!(community->features & PINCTRL_FEATURE_1K_PD)) { 752 - ret = -EINVAL; 753 - break; 754 - } 755 - value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; 756 - break; 757 - case 833: 758 - if (!(community->features & PINCTRL_FEATURE_1K_PD)) { 759 - ret = -EINVAL; 760 - break; 761 - } 762 - value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT; 763 - break; 764 - default: 765 - ret = -EINVAL; 766 - } 767 - 762 + default: 763 + ret = -EINVAL; 768 764 break; 769 765 } 770 766 ··· 1227 1215 /* Only interrupts that are enabled */ 1228 1216 pending &= enabled; 1229 1217 1230 - for_each_set_bit(gpp_offset, &pending, padgrp->size) { 1231 - unsigned int irq; 1232 - 1233 - irq = irq_find_mapping(gc->irq.domain, 1234 - padgrp->gpio_base + gpp_offset); 1235 - generic_handle_irq(irq); 1236 - } 1218 + for_each_set_bit(gpp_offset, &pending, padgrp->size) 1219 + generic_handle_domain_irq(gc->irq.domain, padgrp->gpio_base + gpp_offset); 1237 1220 1238 1221 ret += pending ? 1 : 0; 1239 1222 } ··· 1406 1399 for (i = 0; i < ngpps; i++) { 1407 1400 gpps[i] = community->gpps[i]; 1408 1401 1409 - if (gpps[i].size > 32) 1402 + if (gpps[i].size > INTEL_PINCTRL_MAX_GPP_SIZE) 1410 1403 return -EINVAL; 1411 1404 1412 1405 /* Special treatment for GPIO base */ ··· 1424 1417 } 1425 1418 1426 1419 gpps[i].padown_num = padown_num; 1427 - padown_num += DIV_ROUND_UP(gpps[i].size * 4, 32); 1420 + padown_num += DIV_ROUND_UP(gpps[i].size * 4, INTEL_PINCTRL_MAX_GPP_SIZE); 1428 1421 } 1429 1422 1430 1423 community->gpps = gpps; ··· 1440 1433 unsigned int padown_num = 0; 1441 1434 size_t i, ngpps = DIV_ROUND_UP(npins, community->gpp_size); 1442 1435 1443 - if (community->gpp_size > 32) 1436 + if (community->gpp_size > INTEL_PINCTRL_MAX_GPP_SIZE) 1444 1437 return -EINVAL; 1445 1438 1446 1439 gpps = devm_kcalloc(pctrl->dev, ngpps, sizeof(*gpps), GFP_KERNEL); ··· 1458 1451 gpps[i].gpio_base = gpps[i].base; 1459 1452 gpps[i].padown_num = padown_num; 1460 1453 1461 - /* 1462 - * In older hardware the number of padown registers per 1463 - * group is fixed regardless of the group size. 1464 - */ 1465 - if (community->gpp_num_padown_regs) 1466 - padown_num += community->gpp_num_padown_regs; 1467 - else 1468 - padown_num += DIV_ROUND_UP(gpps[i].size * 4, 32); 1454 + padown_num += community->gpp_num_padown_regs; 1469 1455 } 1470 1456 1471 1457 community->ngpps = ngpps;
+37 -18
drivers/pinctrl/intel/pinctrl-intel.h
··· 36 36 37 37 /** 38 38 * struct intel_function - Description about a function 39 - * @name: Name of the function 40 - * @groups: An array of groups for this function 41 - * @ngroups: Number of groups in @groups 39 + * @func: Generic data of the pin function (name and groups of pins) 42 40 */ 43 41 struct intel_function { 44 - const char *name; 45 - const char * const *groups; 46 - size_t ngroups; 42 + struct pinfunction func; 47 43 }; 44 + 45 + #define INTEL_PINCTRL_MAX_GPP_SIZE 32 48 46 49 47 /** 50 48 * struct intel_padgroup - Hardware pad group information 51 49 * @reg_num: GPI_IS register number 52 50 * @base: Starting pin of this group 53 - * @size: Size of this group (maximum is 32). 51 + * @size: Size of this group (maximum is %INTEL_PINCTRL_MAX_GPP_SIZE). 54 52 * @gpio_base: Starting GPIO base of this group 55 53 * @padown_num: PAD_OWN register number (assigned by the core driver) 56 54 * ··· 94 96 * @gpp_size: Maximum number of pads in each group, such as PADCFGLOCK, 95 97 * HOSTSW_OWN, GPI_IS, GPI_IE. Used when @gpps is %NULL. 96 98 * @gpp_num_padown_regs: Number of pad registers each pad group consumes at 97 - * minimum. Use %0 if the number of registers can be 98 - * determined by the size of the group. 99 + * minimum. Used when @gpps is %NULL. 99 100 * @gpps: Pad groups if the controller has variable size pad groups 100 101 * @ngpps: Number of pad groups in this community 101 102 * @pad_map: Optional non-linear mapping of the pads ··· 103 106 * @regs: Community specific common registers (reserved for core driver) 104 107 * @pad_regs: Community specific pad registers (reserved for core driver) 105 108 * 106 - * In some of Intel GPIO host controllers this driver supports each pad group 109 + * In older Intel GPIO host controllers, this driver supports, each pad group 107 110 * is of equal size (except the last one). In that case the driver can just 108 - * fill in @gpp_size field and let the core driver to handle the rest. If 109 - * the controller has pad groups of variable size the client driver can 110 - * pass custom @gpps and @ngpps instead. 111 + * fill in @gpp_size and @gpp_num_padown_regs fields and let the core driver 112 + * to handle the rest. 113 + * 114 + * In newer Intel GPIO host controllers each pad group is of variable size, 115 + * so the client driver can pass custom @gpps and @ngpps instead. 111 116 */ 112 117 struct intel_community { 113 118 unsigned int barno; ··· 142 143 #define PINCTRL_FEATURE_BLINK BIT(4) 143 144 #define PINCTRL_FEATURE_EXP BIT(5) 144 145 146 + #define __INTEL_COMMUNITY(b, s, e, g, n, gs, gn, soc) \ 147 + { \ 148 + .barno = (b), \ 149 + .padown_offset = soc ## _PAD_OWN, \ 150 + .padcfglock_offset = soc ## _PADCFGLOCK, \ 151 + .hostown_offset = soc ## _HOSTSW_OWN, \ 152 + .is_offset = soc ## _GPI_IS, \ 153 + .ie_offset = soc ## _GPI_IE, \ 154 + .gpp_size = (gs), \ 155 + .gpp_num_padown_regs = (gn), \ 156 + .pin_base = (s), \ 157 + .npins = ((e) - (s) + 1), \ 158 + .gpps = (g), \ 159 + .ngpps = (n), \ 160 + } 161 + 162 + #define INTEL_COMMUNITY_GPPS(b, s, e, g, soc) \ 163 + __INTEL_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), 0, 0, soc) 164 + 165 + #define INTEL_COMMUNITY_SIZE(b, s, e, gs, gn, soc) \ 166 + __INTEL_COMMUNITY(b, s, e, NULL, 0, gs, gn, soc) 167 + 145 168 /** 146 169 * PIN_GROUP - Declare a pin group 147 170 * @n: Name of the group ··· 179 158 .modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \ 180 159 } 181 160 182 - #define FUNCTION(n, g) \ 183 - { \ 184 - .name = (n), \ 185 - .groups = (g), \ 186 - .ngroups = ARRAY_SIZE((g)), \ 161 + #define FUNCTION(n, g) \ 162 + { \ 163 + .func = PINCTRL_PINFUNCTION((n), (g), ARRAY_SIZE(g)), \ 187 164 } 188 165 189 166 /**
+1 -12
drivers/pinctrl/intel/pinctrl-jasperlake.c
··· 29 29 } 30 30 31 31 #define JSL_COMMUNITY(b, s, e, g) \ 32 - { \ 33 - .barno = (b), \ 34 - .padown_offset = JSL_PAD_OWN, \ 35 - .padcfglock_offset = JSL_PADCFGLOCK, \ 36 - .hostown_offset = JSL_HOSTSW_OWN, \ 37 - .is_offset = JSL_GPI_IS, \ 38 - .ie_offset = JSL_GPI_IE, \ 39 - .pin_base = (s), \ 40 - .npins = ((e) - (s) + 1), \ 41 - .gpps = (g), \ 42 - .ngpps = ARRAY_SIZE(g), \ 43 - } 32 + INTEL_COMMUNITY_GPPS(b, s, e, g, JSL) 44 33 45 34 /* Jasper Lake */ 46 35 static const struct pinctrl_pin_desc jsl_pins[] = {
+1 -12
drivers/pinctrl/intel/pinctrl-lakefield.c
··· 29 29 } 30 30 31 31 #define LKF_COMMUNITY(b, s, e, g) \ 32 - { \ 33 - .barno = (b), \ 34 - .padown_offset = LKF_PAD_OWN, \ 35 - .padcfglock_offset = LKF_PADCFGLOCK, \ 36 - .hostown_offset = LKF_HOSTSW_OWN, \ 37 - .is_offset = LKF_GPI_IS, \ 38 - .ie_offset = LKF_GPI_IE, \ 39 - .pin_base = (s), \ 40 - .npins = ((e) - (s) + 1), \ 41 - .gpps = (g), \ 42 - .ngpps = ARRAY_SIZE(g), \ 43 - } 32 + INTEL_COMMUNITY_GPPS(b, s, e, g, LKF) 44 33 45 34 /* Lakefield */ 46 35 static const struct pinctrl_pin_desc lkf_pins[] = {
+1 -11
drivers/pinctrl/intel/pinctrl-lewisburg.c
··· 21 21 #define LBG_GPI_IE 0x110 22 22 23 23 #define LBG_COMMUNITY(b, s, e) \ 24 - { \ 25 - .barno = (b), \ 26 - .padown_offset = LBG_PAD_OWN, \ 27 - .padcfglock_offset = LBG_PADCFGLOCK, \ 28 - .hostown_offset = LBG_HOSTSW_OWN, \ 29 - .is_offset = LBG_GPI_IS, \ 30 - .ie_offset = LBG_GPI_IE, \ 31 - .gpp_size = 24, \ 32 - .pin_base = (s), \ 33 - .npins = ((e) - (s) + 1), \ 34 - } 24 + INTEL_COMMUNITY_SIZE(b, s, e, 24, 3, LBG) 35 25 36 26 /* Lewisburg */ 37 27 static const struct pinctrl_pin_desc lbg_pins[] = {
+4 -4
drivers/pinctrl/intel/pinctrl-lynxpoint.c
··· 341 341 { 342 342 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 343 343 344 - return lg->soc->functions[selector].name; 344 + return lg->soc->functions[selector].func.name; 345 345 } 346 346 347 347 static int lp_get_function_groups(struct pinctrl_dev *pctldev, 348 348 unsigned int selector, 349 349 const char * const **groups, 350 - unsigned int *num_groups) 350 + unsigned int *ngroups) 351 351 { 352 352 struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 353 353 354 - *groups = lg->soc->functions[selector].groups; 355 - *num_groups = lg->soc->functions[selector].ngroups; 354 + *groups = lg->soc->functions[selector].func.groups; 355 + *ngroups = lg->soc->functions[selector].func.ngroups; 356 356 357 357 return 0; 358 358 }
+3 -3
drivers/pinctrl/intel/pinctrl-merrifield.c
··· 576 576 { 577 577 struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 578 578 579 - return mp->functions[function].name; 579 + return mp->functions[function].func.name; 580 580 } 581 581 582 582 static int mrfld_get_function_groups(struct pinctrl_dev *pctldev, ··· 586 586 { 587 587 struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 588 588 589 - *groups = mp->functions[function].groups; 590 - *ngroups = mp->functions[function].ngroups; 589 + *groups = mp->functions[function].func.groups; 590 + *ngroups = mp->functions[function].func.ngroups; 591 591 return 0; 592 592 } 593 593
+6 -17
drivers/pinctrl/intel/pinctrl-meteorlake.c
··· 14 14 15 15 #include "pinctrl-intel.h" 16 16 17 - #define MTL_PAD_OWN 0x0b0 18 - #define MTL_PADCFGLOCK 0x110 19 - #define MTL_HOSTSW_OWN 0x140 20 - #define MTL_GPI_IS 0x200 21 - #define MTL_GPI_IE 0x210 17 + #define MTL_P_PAD_OWN 0x0b0 18 + #define MTL_P_PADCFGLOCK 0x110 19 + #define MTL_P_HOSTSW_OWN 0x140 20 + #define MTL_P_GPI_IS 0x200 21 + #define MTL_P_GPI_IE 0x210 22 22 23 23 #define MTL_GPP(r, s, e, g) \ 24 24 { \ ··· 29 29 } 30 30 31 31 #define MTL_COMMUNITY(b, s, e, g) \ 32 - { \ 33 - .barno = (b), \ 34 - .padown_offset = MTL_PAD_OWN, \ 35 - .padcfglock_offset = MTL_PADCFGLOCK, \ 36 - .hostown_offset = MTL_HOSTSW_OWN, \ 37 - .is_offset = MTL_GPI_IS, \ 38 - .ie_offset = MTL_GPI_IE, \ 39 - .pin_base = (s), \ 40 - .npins = ((e) - (s) + 1), \ 41 - .gpps = (g), \ 42 - .ngpps = ARRAY_SIZE(g), \ 43 - } 32 + INTEL_COMMUNITY_GPPS(b, s, e, g, MTL_P) 44 33 45 34 /* Meteor Lake-P */ 46 35 static const struct pinctrl_pin_desc mtlp_pins[] = {
+3 -3
drivers/pinctrl/intel/pinctrl-moorefield.c
··· 530 530 { 531 531 struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 532 532 533 - return mp->functions[function].name; 533 + return mp->functions[function].func.name; 534 534 } 535 535 536 536 static int mofld_get_function_groups(struct pinctrl_dev *pctldev, unsigned int function, ··· 538 538 { 539 539 struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); 540 540 541 - *groups = mp->functions[function].groups; 542 - *ngroups = mp->functions[function].ngroups; 541 + *groups = mp->functions[function].func.groups; 542 + *ngroups = mp->functions[function].func.ngroups; 543 543 return 0; 544 544 } 545 545
+13 -24
drivers/pinctrl/intel/pinctrl-sunrisepoint.c
··· 15 15 16 16 #include "pinctrl-intel.h" 17 17 18 - #define SPT_PAD_OWN 0x020 18 + #define SPT_H_PAD_OWN 0x020 19 19 #define SPT_H_PADCFGLOCK 0x090 20 + #define SPT_H_HOSTSW_OWN 0x0d0 21 + #define SPT_H_GPI_IS 0x100 22 + #define SPT_H_GPI_IE 0x120 23 + 24 + #define SPT_LP_PAD_OWN 0x020 20 25 #define SPT_LP_PADCFGLOCK 0x0a0 21 - #define SPT_HOSTSW_OWN 0x0d0 22 - #define SPT_GPI_IS 0x100 23 - #define SPT_GPI_IE 0x120 24 - 25 - #define SPT_COMMUNITY(b, s, e, g, n, v, gs, gn) \ 26 - { \ 27 - .barno = (b), \ 28 - .padown_offset = SPT_PAD_OWN, \ 29 - .padcfglock_offset = SPT_##v##_PADCFGLOCK, \ 30 - .hostown_offset = SPT_HOSTSW_OWN, \ 31 - .is_offset = SPT_GPI_IS, \ 32 - .ie_offset = SPT_GPI_IE, \ 33 - .gpp_size = (gs), \ 34 - .gpp_num_padown_regs = (gn), \ 35 - .pin_base = (s), \ 36 - .npins = ((e) - (s) + 1), \ 37 - .gpps = (g), \ 38 - .ngpps = (n), \ 39 - } 40 - 41 - #define SPT_LP_COMMUNITY(b, s, e) \ 42 - SPT_COMMUNITY(b, s, e, NULL, 0, LP, 24, 4) 26 + #define SPT_LP_HOSTSW_OWN 0x0d0 27 + #define SPT_LP_GPI_IS 0x100 28 + #define SPT_LP_GPI_IE 0x120 43 29 44 30 #define SPT_H_GPP(r, s, e, g) \ 45 31 { \ ··· 36 50 } 37 51 38 52 #define SPT_H_COMMUNITY(b, s, e, g) \ 39 - SPT_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), H, 0, 0) 53 + INTEL_COMMUNITY_GPPS(b, s, e, g, SPT_H) 54 + 55 + #define SPT_LP_COMMUNITY(b, s, e) \ 56 + INTEL_COMMUNITY_SIZE(b, s, e, 24, 4, SPT_LP) 40 57 41 58 /* Sunrisepoint-LP */ 42 59 static const struct pinctrl_pin_desc sptlp_pins[] = {
+10 -20
drivers/pinctrl/intel/pinctrl-tigerlake.c
··· 15 15 16 16 #include "pinctrl-intel.h" 17 17 18 - #define TGL_PAD_OWN 0x020 18 + #define TGL_LP_PAD_OWN 0x020 19 19 #define TGL_LP_PADCFGLOCK 0x080 20 - #define TGL_H_PADCFGLOCK 0x090 21 20 #define TGL_LP_HOSTSW_OWN 0x0b0 21 + #define TGL_LP_GPI_IS 0x100 22 + #define TGL_LP_GPI_IE 0x120 23 + 24 + #define TGL_H_PAD_OWN 0x020 25 + #define TGL_H_PADCFGLOCK 0x090 22 26 #define TGL_H_HOSTSW_OWN 0x0c0 23 - #define TGL_GPI_IS 0x100 24 - #define TGL_GPI_IE 0x120 27 + #define TGL_H_GPI_IS 0x100 28 + #define TGL_H_GPI_IE 0x120 25 29 26 30 #define TGL_GPP(r, s, e, g) \ 27 31 { \ ··· 35 31 .gpio_base = (g), \ 36 32 } 37 33 38 - #define TGL_COMMUNITY(b, s, e, g, v) \ 39 - { \ 40 - .barno = (b), \ 41 - .padown_offset = TGL_PAD_OWN, \ 42 - .padcfglock_offset = TGL_##v##_PADCFGLOCK, \ 43 - .hostown_offset = TGL_##v##_HOSTSW_OWN, \ 44 - .is_offset = TGL_GPI_IS, \ 45 - .ie_offset = TGL_GPI_IE, \ 46 - .pin_base = (s), \ 47 - .npins = ((e) - (s) + 1), \ 48 - .gpps = (g), \ 49 - .ngpps = ARRAY_SIZE(g), \ 50 - } 51 - 52 34 #define TGL_LP_COMMUNITY(b, s, e, g) \ 53 - TGL_COMMUNITY(b, s, e, g, LP) 35 + INTEL_COMMUNITY_GPPS(b, s, e, g, TGL_LP) 54 36 55 37 #define TGL_H_COMMUNITY(b, s, e, g) \ 56 - TGL_COMMUNITY(b, s, e, g, H) 38 + INTEL_COMMUNITY_GPPS(b, s, e, g, TGL_H) 57 39 58 40 /* Tiger Lake-LP */ 59 41 static const struct pinctrl_pin_desc tgllp_pins[] = {
+5
drivers/pinctrl/mediatek/Kconfig
··· 127 127 default ARM64 && ARCH_MEDIATEK 128 128 select PINCTRL_MTK_MOORE 129 129 130 + config PINCTRL_MT7981 131 + bool "Mediatek MT7981 pin control" 132 + depends on OF 133 + select PINCTRL_MTK_MOORE 134 + 130 135 config PINCTRL_MT7986 131 136 bool "Mediatek MT7986 pin control" 132 137 depends on OF
+1
drivers/pinctrl/mediatek/Makefile
··· 18 18 obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o 19 19 obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o 20 20 obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o 21 + obj-$(CONFIG_PINCTRL_MT7981) += pinctrl-mt7981.o 21 22 obj-$(CONFIG_PINCTRL_MT7986) += pinctrl-mt7986.o 22 23 obj-$(CONFIG_PINCTRL_MT8167) += pinctrl-mt8167.o 23 24 obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o
-1
drivers/pinctrl/mediatek/pinctrl-moore.c
··· 574 574 chip->set_config = mtk_gpio_set_config; 575 575 chip->base = -1; 576 576 chip->ngpio = hw->soc->npins; 577 - chip->of_gpio_n_cells = 2; 578 577 579 578 ret = gpiochip_add_data(chip, hw); 580 579 if (ret < 0)
+1048
drivers/pinctrl/mediatek/pinctrl-mt7981.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * The MT7981 driver based on Linux generic pinctrl binding. 4 + * 5 + * Copyright (C) 2020 MediaTek Inc. 6 + * Author: Sam Shih <sam.shih@mediatek.com> 7 + */ 8 + 9 + #include "pinctrl-moore.h" 10 + 11 + #define MT7981_PIN(_number, _name) \ 12 + MTK_PIN(_number, _name, 0, _number, DRV_GRP4) 13 + 14 + #define PIN_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, _x_bits) \ 15 + PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \ 16 + _x_bits, 32, 0) 17 + 18 + #define PINS_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, _x_bits) \ 19 + PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \ 20 + _x_bits, 32, 1) 21 + 22 + static const struct mtk_pin_field_calc mt7981_pin_mode_range[] = { 23 + PIN_FIELD(0, 56, 0x300, 0x10, 0, 4), 24 + }; 25 + 26 + static const struct mtk_pin_field_calc mt7981_pin_dir_range[] = { 27 + PIN_FIELD(0, 56, 0x0, 0x10, 0, 1), 28 + }; 29 + 30 + static const struct mtk_pin_field_calc mt7981_pin_di_range[] = { 31 + PIN_FIELD(0, 56, 0x200, 0x10, 0, 1), 32 + }; 33 + 34 + static const struct mtk_pin_field_calc mt7981_pin_do_range[] = { 35 + PIN_FIELD(0, 56, 0x100, 0x10, 0, 1), 36 + }; 37 + 38 + static const struct mtk_pin_field_calc mt7981_pin_ies_range[] = { 39 + PIN_FIELD_BASE(0, 0, 1, 0x10, 0x10, 1, 1), 40 + PIN_FIELD_BASE(1, 1, 1, 0x10, 0x10, 0, 1), 41 + PIN_FIELD_BASE(2, 2, 5, 0x20, 0x10, 6, 1), 42 + PIN_FIELD_BASE(3, 3, 4, 0x20, 0x10, 6, 1), 43 + PIN_FIELD_BASE(4, 4, 4, 0x20, 0x10, 2, 1), 44 + PIN_FIELD_BASE(5, 5, 4, 0x20, 0x10, 1, 1), 45 + PIN_FIELD_BASE(6, 6, 4, 0x20, 0x10, 3, 1), 46 + PIN_FIELD_BASE(7, 7, 4, 0x20, 0x10, 0, 1), 47 + PIN_FIELD_BASE(8, 8, 4, 0x20, 0x10, 4, 1), 48 + 49 + PIN_FIELD_BASE(9, 9, 5, 0x20, 0x10, 9, 1), 50 + PIN_FIELD_BASE(10, 10, 5, 0x20, 0x10, 8, 1), 51 + PIN_FIELD_BASE(11, 11, 5, 0x40, 0x10, 10, 1), 52 + PIN_FIELD_BASE(12, 12, 5, 0x20, 0x10, 7, 1), 53 + PIN_FIELD_BASE(13, 13, 5, 0x20, 0x10, 11, 1), 54 + 55 + PIN_FIELD_BASE(14, 14, 4, 0x20, 0x10, 8, 1), 56 + 57 + PIN_FIELD_BASE(15, 15, 2, 0x20, 0x10, 0, 1), 58 + PIN_FIELD_BASE(16, 16, 2, 0x20, 0x10, 1, 1), 59 + PIN_FIELD_BASE(17, 17, 2, 0x20, 0x10, 5, 1), 60 + PIN_FIELD_BASE(18, 18, 2, 0x20, 0x10, 4, 1), 61 + PIN_FIELD_BASE(19, 19, 2, 0x20, 0x10, 2, 1), 62 + PIN_FIELD_BASE(20, 20, 2, 0x20, 0x10, 3, 1), 63 + PIN_FIELD_BASE(21, 21, 2, 0x20, 0x10, 6, 1), 64 + PIN_FIELD_BASE(22, 22, 2, 0x20, 0x10, 7, 1), 65 + PIN_FIELD_BASE(23, 23, 2, 0x20, 0x10, 10, 1), 66 + PIN_FIELD_BASE(24, 24, 2, 0x20, 0x10, 9, 1), 67 + PIN_FIELD_BASE(25, 25, 2, 0x20, 0x10, 8, 1), 68 + 69 + PIN_FIELD_BASE(26, 26, 5, 0x20, 0x10, 0, 1), 70 + PIN_FIELD_BASE(27, 27, 5, 0x20, 0x10, 4, 1), 71 + PIN_FIELD_BASE(28, 28, 5, 0x20, 0x10, 3, 1), 72 + PIN_FIELD_BASE(29, 29, 5, 0x20, 0x10, 1, 1), 73 + PIN_FIELD_BASE(30, 30, 5, 0x20, 0x10, 2, 1), 74 + PIN_FIELD_BASE(31, 31, 5, 0x20, 0x10, 5, 1), 75 + 76 + PIN_FIELD_BASE(32, 32, 1, 0x10, 0x10, 2, 1), 77 + PIN_FIELD_BASE(33, 33, 1, 0x10, 0x10, 3, 1), 78 + 79 + PIN_FIELD_BASE(34, 34, 4, 0x20, 0x10, 5, 1), 80 + PIN_FIELD_BASE(35, 35, 4, 0x20, 0x10, 7, 1), 81 + 82 + PIN_FIELD_BASE(36, 36, 3, 0x10, 0x10, 2, 1), 83 + PIN_FIELD_BASE(37, 37, 3, 0x10, 0x10, 3, 1), 84 + PIN_FIELD_BASE(38, 38, 3, 0x10, 0x10, 0, 1), 85 + PIN_FIELD_BASE(39, 39, 3, 0x10, 0x10, 1, 1), 86 + 87 + PIN_FIELD_BASE(40, 40, 7, 0x30, 0x10, 1, 1), 88 + PIN_FIELD_BASE(41, 41, 7, 0x30, 0x10, 0, 1), 89 + PIN_FIELD_BASE(42, 42, 7, 0x30, 0x10, 9, 1), 90 + PIN_FIELD_BASE(43, 43, 7, 0x30, 0x10, 7, 1), 91 + PIN_FIELD_BASE(44, 44, 7, 0x30, 0x10, 8, 1), 92 + PIN_FIELD_BASE(45, 45, 7, 0x30, 0x10, 3, 1), 93 + PIN_FIELD_BASE(46, 46, 7, 0x30, 0x10, 4, 1), 94 + PIN_FIELD_BASE(47, 47, 7, 0x30, 0x10, 5, 1), 95 + PIN_FIELD_BASE(48, 48, 7, 0x30, 0x10, 6, 1), 96 + PIN_FIELD_BASE(49, 49, 7, 0x30, 0x10, 2, 1), 97 + 98 + PIN_FIELD_BASE(50, 50, 6, 0x10, 0x10, 0, 1), 99 + PIN_FIELD_BASE(51, 51, 6, 0x10, 0x10, 2, 1), 100 + PIN_FIELD_BASE(52, 52, 6, 0x10, 0x10, 3, 1), 101 + PIN_FIELD_BASE(53, 53, 6, 0x10, 0x10, 4, 1), 102 + PIN_FIELD_BASE(54, 54, 6, 0x10, 0x10, 5, 1), 103 + PIN_FIELD_BASE(55, 55, 6, 0x10, 0x10, 6, 1), 104 + PIN_FIELD_BASE(56, 56, 6, 0x10, 0x10, 1, 1), 105 + }; 106 + 107 + static const struct mtk_pin_field_calc mt7981_pin_smt_range[] = { 108 + PIN_FIELD_BASE(0, 0, 1, 0x60, 0x10, 1, 1), 109 + PIN_FIELD_BASE(1, 1, 1, 0x60, 0x10, 0, 1), 110 + PIN_FIELD_BASE(2, 2, 5, 0x90, 0x10, 6, 1), 111 + PIN_FIELD_BASE(3, 3, 4, 0x80, 0x10, 6, 1), 112 + PIN_FIELD_BASE(4, 4, 4, 0x80, 0x10, 2, 1), 113 + PIN_FIELD_BASE(5, 5, 4, 0x80, 0x10, 1, 1), 114 + PIN_FIELD_BASE(6, 6, 4, 0x80, 0x10, 3, 1), 115 + PIN_FIELD_BASE(7, 7, 4, 0x80, 0x10, 0, 1), 116 + PIN_FIELD_BASE(8, 8, 4, 0x80, 0x10, 4, 1), 117 + 118 + PIN_FIELD_BASE(9, 9, 5, 0x90, 0x10, 9, 1), 119 + PIN_FIELD_BASE(10, 10, 5, 0x90, 0x10, 8, 1), 120 + PIN_FIELD_BASE(11, 11, 5, 0x90, 0x10, 10, 1), 121 + PIN_FIELD_BASE(12, 12, 5, 0x90, 0x10, 7, 1), 122 + PIN_FIELD_BASE(13, 13, 5, 0x90, 0x10, 11, 1), 123 + 124 + PIN_FIELD_BASE(14, 14, 4, 0x80, 0x10, 8, 1), 125 + 126 + PIN_FIELD_BASE(15, 15, 2, 0x90, 0x10, 0, 1), 127 + PIN_FIELD_BASE(16, 16, 2, 0x90, 0x10, 1, 1), 128 + PIN_FIELD_BASE(17, 17, 2, 0x90, 0x10, 5, 1), 129 + PIN_FIELD_BASE(18, 18, 2, 0x90, 0x10, 4, 1), 130 + PIN_FIELD_BASE(19, 19, 2, 0x90, 0x10, 2, 1), 131 + PIN_FIELD_BASE(20, 20, 2, 0x90, 0x10, 3, 1), 132 + PIN_FIELD_BASE(21, 21, 2, 0x90, 0x10, 6, 1), 133 + PIN_FIELD_BASE(22, 22, 2, 0x90, 0x10, 7, 1), 134 + PIN_FIELD_BASE(23, 23, 2, 0x90, 0x10, 10, 1), 135 + PIN_FIELD_BASE(24, 24, 2, 0x90, 0x10, 9, 1), 136 + PIN_FIELD_BASE(25, 25, 2, 0x90, 0x10, 8, 1), 137 + 138 + PIN_FIELD_BASE(26, 26, 5, 0x90, 0x10, 0, 1), 139 + PIN_FIELD_BASE(27, 27, 5, 0x90, 0x10, 4, 1), 140 + PIN_FIELD_BASE(28, 28, 5, 0x90, 0x10, 3, 1), 141 + PIN_FIELD_BASE(29, 29, 5, 0x90, 0x10, 1, 1), 142 + PIN_FIELD_BASE(30, 30, 5, 0x90, 0x10, 2, 1), 143 + PIN_FIELD_BASE(31, 31, 5, 0x90, 0x10, 5, 1), 144 + 145 + PIN_FIELD_BASE(32, 32, 1, 0x60, 0x10, 2, 1), 146 + PIN_FIELD_BASE(33, 33, 1, 0x60, 0x10, 3, 1), 147 + 148 + PIN_FIELD_BASE(34, 34, 4, 0x80, 0x10, 5, 1), 149 + PIN_FIELD_BASE(35, 35, 4, 0x80, 0x10, 7, 1), 150 + 151 + PIN_FIELD_BASE(36, 36, 3, 0x60, 0x10, 2, 1), 152 + PIN_FIELD_BASE(37, 37, 3, 0x60, 0x10, 3, 1), 153 + PIN_FIELD_BASE(38, 38, 3, 0x60, 0x10, 0, 1), 154 + PIN_FIELD_BASE(39, 39, 3, 0x60, 0x10, 1, 1), 155 + 156 + PIN_FIELD_BASE(40, 40, 7, 0x70, 0x10, 1, 1), 157 + PIN_FIELD_BASE(41, 41, 7, 0x70, 0x10, 0, 1), 158 + PIN_FIELD_BASE(42, 42, 7, 0x70, 0x10, 9, 1), 159 + PIN_FIELD_BASE(43, 43, 7, 0x70, 0x10, 7, 1), 160 + PIN_FIELD_BASE(44, 44, 7, 0x30, 0x10, 8, 1), 161 + PIN_FIELD_BASE(45, 45, 7, 0x70, 0x10, 3, 1), 162 + PIN_FIELD_BASE(46, 46, 7, 0x70, 0x10, 4, 1), 163 + PIN_FIELD_BASE(47, 47, 7, 0x70, 0x10, 5, 1), 164 + PIN_FIELD_BASE(48, 48, 7, 0x70, 0x10, 6, 1), 165 + PIN_FIELD_BASE(49, 49, 7, 0x70, 0x10, 2, 1), 166 + 167 + PIN_FIELD_BASE(50, 50, 6, 0x50, 0x10, 0, 1), 168 + PIN_FIELD_BASE(51, 51, 6, 0x50, 0x10, 2, 1), 169 + PIN_FIELD_BASE(52, 52, 6, 0x50, 0x10, 3, 1), 170 + PIN_FIELD_BASE(53, 53, 6, 0x50, 0x10, 4, 1), 171 + PIN_FIELD_BASE(54, 54, 6, 0x50, 0x10, 5, 1), 172 + PIN_FIELD_BASE(55, 55, 6, 0x50, 0x10, 6, 1), 173 + PIN_FIELD_BASE(56, 56, 6, 0x50, 0x10, 1, 1), 174 + }; 175 + 176 + static const struct mtk_pin_field_calc mt7981_pin_pu_range[] = { 177 + PIN_FIELD_BASE(40, 40, 7, 0x50, 0x10, 1, 1), 178 + PIN_FIELD_BASE(41, 41, 7, 0x50, 0x10, 0, 1), 179 + PIN_FIELD_BASE(42, 42, 7, 0x50, 0x10, 9, 1), 180 + PIN_FIELD_BASE(43, 43, 7, 0x50, 0x10, 7, 1), 181 + PIN_FIELD_BASE(44, 44, 7, 0x50, 0x10, 8, 1), 182 + PIN_FIELD_BASE(45, 45, 7, 0x50, 0x10, 3, 1), 183 + PIN_FIELD_BASE(46, 46, 7, 0x50, 0x10, 4, 1), 184 + PIN_FIELD_BASE(47, 47, 7, 0x50, 0x10, 5, 1), 185 + PIN_FIELD_BASE(48, 48, 7, 0x50, 0x10, 6, 1), 186 + PIN_FIELD_BASE(49, 49, 7, 0x50, 0x10, 2, 1), 187 + 188 + PIN_FIELD_BASE(50, 50, 6, 0x30, 0x10, 0, 1), 189 + PIN_FIELD_BASE(51, 51, 6, 0x30, 0x10, 2, 1), 190 + PIN_FIELD_BASE(52, 52, 6, 0x30, 0x10, 3, 1), 191 + PIN_FIELD_BASE(53, 53, 6, 0x30, 0x10, 4, 1), 192 + PIN_FIELD_BASE(54, 54, 6, 0x30, 0x10, 5, 1), 193 + PIN_FIELD_BASE(55, 55, 6, 0x30, 0x10, 6, 1), 194 + PIN_FIELD_BASE(56, 56, 6, 0x30, 0x10, 1, 1), 195 + }; 196 + 197 + static const struct mtk_pin_field_calc mt7981_pin_pd_range[] = { 198 + PIN_FIELD_BASE(40, 40, 7, 0x40, 0x10, 1, 1), 199 + PIN_FIELD_BASE(41, 41, 7, 0x40, 0x10, 0, 1), 200 + PIN_FIELD_BASE(42, 42, 7, 0x40, 0x10, 9, 1), 201 + PIN_FIELD_BASE(43, 43, 7, 0x40, 0x10, 7, 1), 202 + PIN_FIELD_BASE(44, 44, 7, 0x40, 0x10, 8, 1), 203 + PIN_FIELD_BASE(45, 45, 7, 0x40, 0x10, 3, 1), 204 + PIN_FIELD_BASE(46, 46, 7, 0x40, 0x10, 4, 1), 205 + PIN_FIELD_BASE(47, 47, 7, 0x40, 0x10, 5, 1), 206 + PIN_FIELD_BASE(48, 48, 7, 0x40, 0x10, 6, 1), 207 + PIN_FIELD_BASE(49, 49, 7, 0x40, 0x10, 2, 1), 208 + 209 + PIN_FIELD_BASE(50, 50, 6, 0x20, 0x10, 0, 1), 210 + PIN_FIELD_BASE(51, 51, 6, 0x20, 0x10, 2, 1), 211 + PIN_FIELD_BASE(52, 52, 6, 0x20, 0x10, 3, 1), 212 + PIN_FIELD_BASE(53, 53, 6, 0x20, 0x10, 4, 1), 213 + PIN_FIELD_BASE(54, 54, 6, 0x20, 0x10, 5, 1), 214 + PIN_FIELD_BASE(55, 55, 6, 0x20, 0x10, 6, 1), 215 + PIN_FIELD_BASE(56, 56, 6, 0x20, 0x10, 1, 1), 216 + }; 217 + 218 + static const struct mtk_pin_field_calc mt7981_pin_drv_range[] = { 219 + PIN_FIELD_BASE(0, 0, 1, 0x00, 0x10, 3, 3), 220 + PIN_FIELD_BASE(1, 1, 1, 0x00, 0x10, 0, 3), 221 + 222 + PIN_FIELD_BASE(2, 2, 5, 0x00, 0x10, 18, 3), 223 + 224 + PIN_FIELD_BASE(3, 3, 4, 0x00, 0x10, 18, 1), 225 + PIN_FIELD_BASE(4, 4, 4, 0x00, 0x10, 6, 1), 226 + PIN_FIELD_BASE(5, 5, 4, 0x00, 0x10, 3, 3), 227 + PIN_FIELD_BASE(6, 6, 4, 0x00, 0x10, 9, 3), 228 + PIN_FIELD_BASE(7, 7, 4, 0x00, 0x10, 0, 3), 229 + PIN_FIELD_BASE(8, 8, 4, 0x00, 0x10, 12, 3), 230 + 231 + PIN_FIELD_BASE(9, 9, 5, 0x00, 0x10, 27, 3), 232 + PIN_FIELD_BASE(10, 10, 5, 0x00, 0x10, 24, 3), 233 + PIN_FIELD_BASE(11, 11, 5, 0x00, 0x10, 0, 3), 234 + PIN_FIELD_BASE(12, 12, 5, 0x00, 0x10, 21, 3), 235 + PIN_FIELD_BASE(13, 13, 5, 0x00, 0x10, 3, 3), 236 + 237 + PIN_FIELD_BASE(14, 14, 4, 0x00, 0x10, 27, 3), 238 + 239 + PIN_FIELD_BASE(15, 15, 2, 0x00, 0x10, 0, 3), 240 + PIN_FIELD_BASE(16, 16, 2, 0x00, 0x10, 3, 3), 241 + PIN_FIELD_BASE(17, 17, 2, 0x00, 0x10, 15, 3), 242 + PIN_FIELD_BASE(18, 18, 2, 0x00, 0x10, 12, 3), 243 + PIN_FIELD_BASE(19, 19, 2, 0x00, 0x10, 6, 3), 244 + PIN_FIELD_BASE(20, 20, 2, 0x00, 0x10, 9, 3), 245 + PIN_FIELD_BASE(21, 21, 2, 0x00, 0x10, 18, 3), 246 + PIN_FIELD_BASE(22, 22, 2, 0x00, 0x10, 21, 3), 247 + PIN_FIELD_BASE(23, 23, 2, 0x00, 0x10, 0, 3), 248 + PIN_FIELD_BASE(24, 24, 2, 0x00, 0x10, 27, 3), 249 + PIN_FIELD_BASE(25, 25, 2, 0x00, 0x10, 24, 3), 250 + 251 + PIN_FIELD_BASE(26, 26, 5, 0x00, 0x10, 0, 3), 252 + PIN_FIELD_BASE(27, 27, 5, 0x00, 0x10, 12, 3), 253 + PIN_FIELD_BASE(28, 28, 5, 0x00, 0x10, 9, 3), 254 + PIN_FIELD_BASE(29, 29, 5, 0x00, 0x10, 3, 3), 255 + PIN_FIELD_BASE(30, 30, 5, 0x00, 0x10, 6, 3), 256 + PIN_FIELD_BASE(31, 31, 5, 0x00, 0x10, 15, 3), 257 + 258 + PIN_FIELD_BASE(32, 32, 1, 0x00, 0x10, 9, 3), 259 + PIN_FIELD_BASE(33, 33, 1, 0x00, 0x10, 12, 3), 260 + 261 + PIN_FIELD_BASE(34, 34, 4, 0x00, 0x10, 15, 3), 262 + PIN_FIELD_BASE(35, 35, 4, 0x00, 0x10, 21, 3), 263 + 264 + PIN_FIELD_BASE(36, 36, 3, 0x00, 0x10, 6, 3), 265 + PIN_FIELD_BASE(37, 37, 3, 0x00, 0x10, 9, 3), 266 + PIN_FIELD_BASE(38, 38, 3, 0x00, 0x10, 0, 3), 267 + PIN_FIELD_BASE(39, 39, 3, 0x00, 0x10, 3, 3), 268 + 269 + PIN_FIELD_BASE(40, 40, 7, 0x00, 0x10, 3, 3), 270 + PIN_FIELD_BASE(41, 41, 7, 0x00, 0x10, 0, 3), 271 + PIN_FIELD_BASE(42, 42, 7, 0x00, 0x10, 27, 3), 272 + PIN_FIELD_BASE(43, 43, 7, 0x00, 0x10, 21, 3), 273 + PIN_FIELD_BASE(44, 44, 7, 0x00, 0x10, 24, 3), 274 + PIN_FIELD_BASE(45, 45, 7, 0x00, 0x10, 9, 3), 275 + PIN_FIELD_BASE(46, 46, 7, 0x00, 0x10, 12, 3), 276 + PIN_FIELD_BASE(47, 47, 7, 0x00, 0x10, 15, 3), 277 + PIN_FIELD_BASE(48, 48, 7, 0x00, 0x10, 18, 3), 278 + PIN_FIELD_BASE(49, 49, 7, 0x00, 0x10, 6, 3), 279 + 280 + PIN_FIELD_BASE(50, 50, 6, 0x00, 0x10, 0, 3), 281 + PIN_FIELD_BASE(51, 51, 6, 0x00, 0x10, 6, 3), 282 + PIN_FIELD_BASE(52, 52, 6, 0x00, 0x10, 9, 3), 283 + PIN_FIELD_BASE(53, 53, 6, 0x00, 0x10, 12, 3), 284 + PIN_FIELD_BASE(54, 54, 6, 0x00, 0x10, 15, 3), 285 + PIN_FIELD_BASE(55, 55, 6, 0x00, 0x10, 18, 3), 286 + PIN_FIELD_BASE(56, 56, 6, 0x00, 0x10, 3, 3), 287 + }; 288 + 289 + static const struct mtk_pin_field_calc mt7981_pin_pupd_range[] = { 290 + PIN_FIELD_BASE(0, 0, 1, 0x20, 0x10, 1, 1), 291 + PIN_FIELD_BASE(1, 1, 1, 0x20, 0x10, 0, 1), 292 + PIN_FIELD_BASE(2, 2, 5, 0x30, 0x10, 6, 1), 293 + PIN_FIELD_BASE(3, 3, 4, 0x30, 0x10, 6, 1), 294 + PIN_FIELD_BASE(4, 4, 4, 0x30, 0x10, 2, 1), 295 + PIN_FIELD_BASE(5, 5, 4, 0x30, 0x10, 1, 1), 296 + PIN_FIELD_BASE(6, 6, 4, 0x30, 0x10, 3, 1), 297 + PIN_FIELD_BASE(7, 7, 4, 0x30, 0x10, 0, 1), 298 + PIN_FIELD_BASE(8, 8, 4, 0x30, 0x10, 4, 1), 299 + 300 + PIN_FIELD_BASE(9, 9, 5, 0x30, 0x10, 9, 1), 301 + PIN_FIELD_BASE(10, 10, 5, 0x30, 0x10, 8, 1), 302 + PIN_FIELD_BASE(11, 11, 5, 0x30, 0x10, 10, 1), 303 + PIN_FIELD_BASE(12, 12, 5, 0x30, 0x10, 7, 1), 304 + PIN_FIELD_BASE(13, 13, 5, 0x30, 0x10, 11, 1), 305 + 306 + PIN_FIELD_BASE(14, 14, 4, 0x30, 0x10, 8, 1), 307 + 308 + PIN_FIELD_BASE(15, 15, 2, 0x30, 0x10, 0, 1), 309 + PIN_FIELD_BASE(16, 16, 2, 0x30, 0x10, 1, 1), 310 + PIN_FIELD_BASE(17, 17, 2, 0x30, 0x10, 5, 1), 311 + PIN_FIELD_BASE(18, 18, 2, 0x30, 0x10, 4, 1), 312 + PIN_FIELD_BASE(19, 19, 2, 0x30, 0x10, 2, 1), 313 + PIN_FIELD_BASE(20, 20, 2, 0x90, 0x10, 3, 1), 314 + PIN_FIELD_BASE(21, 21, 2, 0x30, 0x10, 6, 1), 315 + PIN_FIELD_BASE(22, 22, 2, 0x30, 0x10, 7, 1), 316 + PIN_FIELD_BASE(23, 23, 2, 0x30, 0x10, 10, 1), 317 + PIN_FIELD_BASE(24, 24, 2, 0x30, 0x10, 9, 1), 318 + PIN_FIELD_BASE(25, 25, 2, 0x30, 0x10, 8, 1), 319 + 320 + PIN_FIELD_BASE(26, 26, 5, 0x30, 0x10, 0, 1), 321 + PIN_FIELD_BASE(27, 27, 5, 0x30, 0x10, 4, 1), 322 + PIN_FIELD_BASE(28, 28, 5, 0x30, 0x10, 3, 1), 323 + PIN_FIELD_BASE(29, 29, 5, 0x30, 0x10, 1, 1), 324 + PIN_FIELD_BASE(30, 30, 5, 0x30, 0x10, 2, 1), 325 + PIN_FIELD_BASE(31, 31, 5, 0x30, 0x10, 5, 1), 326 + 327 + PIN_FIELD_BASE(32, 32, 1, 0x20, 0x10, 2, 1), 328 + PIN_FIELD_BASE(33, 33, 1, 0x20, 0x10, 3, 1), 329 + 330 + PIN_FIELD_BASE(34, 34, 4, 0x30, 0x10, 5, 1), 331 + PIN_FIELD_BASE(35, 35, 4, 0x30, 0x10, 7, 1), 332 + 333 + PIN_FIELD_BASE(36, 36, 3, 0x20, 0x10, 2, 1), 334 + PIN_FIELD_BASE(37, 37, 3, 0x20, 0x10, 3, 1), 335 + PIN_FIELD_BASE(38, 38, 3, 0x20, 0x10, 0, 1), 336 + PIN_FIELD_BASE(39, 39, 3, 0x20, 0x10, 1, 1), 337 + }; 338 + 339 + static const struct mtk_pin_field_calc mt7981_pin_r0_range[] = { 340 + PIN_FIELD_BASE(0, 0, 1, 0x30, 0x10, 1, 1), 341 + PIN_FIELD_BASE(1, 1, 1, 0x30, 0x10, 0, 1), 342 + PIN_FIELD_BASE(2, 2, 5, 0x40, 0x10, 6, 1), 343 + PIN_FIELD_BASE(3, 3, 4, 0x40, 0x10, 6, 1), 344 + PIN_FIELD_BASE(4, 4, 4, 0x40, 0x10, 2, 1), 345 + PIN_FIELD_BASE(5, 5, 4, 0x40, 0x10, 1, 1), 346 + PIN_FIELD_BASE(6, 6, 4, 0x40, 0x10, 3, 1), 347 + PIN_FIELD_BASE(7, 7, 4, 0x40, 0x10, 0, 1), 348 + PIN_FIELD_BASE(8, 8, 4, 0x40, 0x10, 4, 1), 349 + 350 + PIN_FIELD_BASE(9, 9, 5, 0x40, 0x10, 9, 1), 351 + PIN_FIELD_BASE(10, 10, 5, 0x40, 0x10, 8, 1), 352 + PIN_FIELD_BASE(11, 11, 5, 0x40, 0x10, 10, 1), 353 + PIN_FIELD_BASE(12, 12, 5, 0x40, 0x10, 7, 1), 354 + PIN_FIELD_BASE(13, 13, 5, 0x40, 0x10, 11, 1), 355 + 356 + PIN_FIELD_BASE(14, 14, 4, 0x40, 0x10, 8, 1), 357 + 358 + PIN_FIELD_BASE(15, 15, 2, 0x40, 0x10, 0, 1), 359 + PIN_FIELD_BASE(16, 16, 2, 0x40, 0x10, 1, 1), 360 + PIN_FIELD_BASE(17, 17, 2, 0x40, 0x10, 5, 1), 361 + PIN_FIELD_BASE(18, 18, 2, 0x40, 0x10, 4, 1), 362 + PIN_FIELD_BASE(19, 19, 2, 0x40, 0x10, 2, 1), 363 + PIN_FIELD_BASE(20, 20, 2, 0x40, 0x10, 3, 1), 364 + PIN_FIELD_BASE(21, 21, 2, 0x40, 0x10, 6, 1), 365 + PIN_FIELD_BASE(22, 22, 2, 0x40, 0x10, 7, 1), 366 + PIN_FIELD_BASE(23, 23, 2, 0x40, 0x10, 10, 1), 367 + PIN_FIELD_BASE(24, 24, 2, 0x40, 0x10, 9, 1), 368 + PIN_FIELD_BASE(25, 25, 2, 0x40, 0x10, 8, 1), 369 + 370 + PIN_FIELD_BASE(26, 26, 5, 0x40, 0x10, 0, 1), 371 + PIN_FIELD_BASE(27, 27, 5, 0x40, 0x10, 4, 1), 372 + PIN_FIELD_BASE(28, 28, 5, 0x40, 0x10, 3, 1), 373 + PIN_FIELD_BASE(29, 29, 5, 0x40, 0x10, 1, 1), 374 + PIN_FIELD_BASE(30, 30, 5, 0x40, 0x10, 2, 1), 375 + PIN_FIELD_BASE(31, 31, 5, 0x40, 0x10, 5, 1), 376 + 377 + PIN_FIELD_BASE(32, 32, 1, 0x30, 0x10, 2, 1), 378 + PIN_FIELD_BASE(33, 33, 1, 0x30, 0x10, 3, 1), 379 + 380 + PIN_FIELD_BASE(34, 34, 4, 0x40, 0x10, 5, 1), 381 + PIN_FIELD_BASE(35, 35, 4, 0x40, 0x10, 7, 1), 382 + 383 + PIN_FIELD_BASE(36, 36, 3, 0x30, 0x10, 2, 1), 384 + PIN_FIELD_BASE(37, 37, 3, 0x30, 0x10, 3, 1), 385 + PIN_FIELD_BASE(38, 38, 3, 0x30, 0x10, 0, 1), 386 + PIN_FIELD_BASE(39, 39, 3, 0x30, 0x10, 1, 1), 387 + }; 388 + 389 + static const struct mtk_pin_field_calc mt7981_pin_r1_range[] = { 390 + PIN_FIELD_BASE(0, 0, 1, 0x40, 0x10, 1, 1), 391 + PIN_FIELD_BASE(1, 1, 1, 0x40, 0x10, 0, 1), 392 + PIN_FIELD_BASE(2, 2, 5, 0x50, 0x10, 6, 1), 393 + PIN_FIELD_BASE(3, 3, 4, 0x50, 0x10, 6, 1), 394 + PIN_FIELD_BASE(4, 4, 4, 0x50, 0x10, 2, 1), 395 + PIN_FIELD_BASE(5, 5, 4, 0x50, 0x10, 1, 1), 396 + PIN_FIELD_BASE(6, 6, 4, 0x50, 0x10, 3, 1), 397 + PIN_FIELD_BASE(7, 7, 4, 0x50, 0x10, 0, 1), 398 + PIN_FIELD_BASE(8, 8, 4, 0x50, 0x10, 4, 1), 399 + 400 + PIN_FIELD_BASE(9, 9, 5, 0x50, 0x10, 9, 1), 401 + PIN_FIELD_BASE(10, 10, 5, 0x50, 0x10, 8, 1), 402 + PIN_FIELD_BASE(11, 11, 5, 0x50, 0x10, 10, 1), 403 + PIN_FIELD_BASE(12, 12, 5, 0x50, 0x10, 7, 1), 404 + PIN_FIELD_BASE(13, 13, 5, 0x50, 0x10, 11, 1), 405 + 406 + PIN_FIELD_BASE(14, 14, 4, 0x50, 0x10, 8, 1), 407 + 408 + PIN_FIELD_BASE(15, 15, 2, 0x50, 0x10, 0, 1), 409 + PIN_FIELD_BASE(16, 16, 2, 0x50, 0x10, 1, 1), 410 + PIN_FIELD_BASE(17, 17, 2, 0x50, 0x10, 5, 1), 411 + PIN_FIELD_BASE(18, 18, 2, 0x50, 0x10, 4, 1), 412 + PIN_FIELD_BASE(19, 19, 2, 0x50, 0x10, 2, 1), 413 + PIN_FIELD_BASE(20, 20, 2, 0x50, 0x10, 3, 1), 414 + PIN_FIELD_BASE(21, 21, 2, 0x50, 0x10, 6, 1), 415 + PIN_FIELD_BASE(22, 22, 2, 0x50, 0x10, 7, 1), 416 + PIN_FIELD_BASE(23, 23, 2, 0x50, 0x10, 10, 1), 417 + PIN_FIELD_BASE(24, 24, 2, 0x50, 0x10, 9, 1), 418 + PIN_FIELD_BASE(25, 25, 2, 0x50, 0x10, 8, 1), 419 + 420 + PIN_FIELD_BASE(26, 26, 5, 0x50, 0x10, 0, 1), 421 + PIN_FIELD_BASE(27, 27, 5, 0x50, 0x10, 4, 1), 422 + PIN_FIELD_BASE(28, 28, 5, 0x50, 0x10, 3, 1), 423 + PIN_FIELD_BASE(29, 29, 5, 0x50, 0x10, 1, 1), 424 + PIN_FIELD_BASE(30, 30, 5, 0x50, 0x10, 2, 1), 425 + PIN_FIELD_BASE(31, 31, 5, 0x50, 0x10, 5, 1), 426 + 427 + PIN_FIELD_BASE(32, 32, 1, 0x40, 0x10, 2, 1), 428 + PIN_FIELD_BASE(33, 33, 1, 0x40, 0x10, 3, 1), 429 + 430 + PIN_FIELD_BASE(34, 34, 4, 0x50, 0x10, 5, 1), 431 + PIN_FIELD_BASE(35, 35, 4, 0x50, 0x10, 7, 1), 432 + 433 + PIN_FIELD_BASE(36, 36, 3, 0x40, 0x10, 2, 1), 434 + PIN_FIELD_BASE(37, 37, 3, 0x40, 0x10, 3, 1), 435 + PIN_FIELD_BASE(38, 38, 3, 0x40, 0x10, 0, 1), 436 + PIN_FIELD_BASE(39, 39, 3, 0x40, 0x10, 1, 1), 437 + }; 438 + 439 + static const unsigned int mt7981_pull_type[] = { 440 + MTK_PULL_PUPD_R1R0_TYPE,/*0*/ MTK_PULL_PUPD_R1R0_TYPE,/*1*/ 441 + MTK_PULL_PUPD_R1R0_TYPE,/*2*/ MTK_PULL_PUPD_R1R0_TYPE,/*3*/ 442 + MTK_PULL_PUPD_R1R0_TYPE,/*4*/ MTK_PULL_PUPD_R1R0_TYPE,/*5*/ 443 + MTK_PULL_PUPD_R1R0_TYPE,/*6*/ MTK_PULL_PUPD_R1R0_TYPE,/*7*/ 444 + MTK_PULL_PUPD_R1R0_TYPE,/*8*/ MTK_PULL_PUPD_R1R0_TYPE,/*9*/ 445 + MTK_PULL_PUPD_R1R0_TYPE,/*10*/ MTK_PULL_PUPD_R1R0_TYPE,/*11*/ 446 + MTK_PULL_PUPD_R1R0_TYPE,/*12*/ MTK_PULL_PUPD_R1R0_TYPE,/*13*/ 447 + MTK_PULL_PUPD_R1R0_TYPE,/*14*/ MTK_PULL_PUPD_R1R0_TYPE,/*15*/ 448 + MTK_PULL_PUPD_R1R0_TYPE,/*16*/ MTK_PULL_PUPD_R1R0_TYPE,/*17*/ 449 + MTK_PULL_PUPD_R1R0_TYPE,/*18*/ MTK_PULL_PUPD_R1R0_TYPE,/*19*/ 450 + MTK_PULL_PUPD_R1R0_TYPE,/*20*/ MTK_PULL_PUPD_R1R0_TYPE,/*21*/ 451 + MTK_PULL_PUPD_R1R0_TYPE,/*22*/ MTK_PULL_PUPD_R1R0_TYPE,/*23*/ 452 + MTK_PULL_PUPD_R1R0_TYPE,/*24*/ MTK_PULL_PUPD_R1R0_TYPE,/*25*/ 453 + MTK_PULL_PUPD_R1R0_TYPE,/*26*/ MTK_PULL_PUPD_R1R0_TYPE,/*27*/ 454 + MTK_PULL_PUPD_R1R0_TYPE,/*28*/ MTK_PULL_PUPD_R1R0_TYPE,/*29*/ 455 + MTK_PULL_PUPD_R1R0_TYPE,/*30*/ MTK_PULL_PUPD_R1R0_TYPE,/*31*/ 456 + MTK_PULL_PUPD_R1R0_TYPE,/*32*/ MTK_PULL_PUPD_R1R0_TYPE,/*33*/ 457 + MTK_PULL_PUPD_R1R0_TYPE,/*34*/ MTK_PULL_PUPD_R1R0_TYPE,/*35*/ 458 + MTK_PULL_PUPD_R1R0_TYPE,/*36*/ MTK_PULL_PUPD_R1R0_TYPE,/*37*/ 459 + MTK_PULL_PUPD_R1R0_TYPE,/*38*/ MTK_PULL_PUPD_R1R0_TYPE,/*39*/ 460 + MTK_PULL_PUPD_R1R0_TYPE,/*40*/ MTK_PULL_PUPD_R1R0_TYPE,/*41*/ 461 + MTK_PULL_PUPD_R1R0_TYPE,/*42*/ MTK_PULL_PUPD_R1R0_TYPE,/*43*/ 462 + MTK_PULL_PUPD_R1R0_TYPE,/*44*/ MTK_PULL_PUPD_R1R0_TYPE,/*45*/ 463 + MTK_PULL_PUPD_R1R0_TYPE,/*46*/ MTK_PULL_PUPD_R1R0_TYPE,/*47*/ 464 + MTK_PULL_PUPD_R1R0_TYPE,/*48*/ MTK_PULL_PUPD_R1R0_TYPE,/*49*/ 465 + MTK_PULL_PUPD_R1R0_TYPE,/*50*/ MTK_PULL_PUPD_R1R0_TYPE,/*51*/ 466 + MTK_PULL_PUPD_R1R0_TYPE,/*52*/ MTK_PULL_PUPD_R1R0_TYPE,/*53*/ 467 + MTK_PULL_PUPD_R1R0_TYPE,/*54*/ MTK_PULL_PUPD_R1R0_TYPE,/*55*/ 468 + MTK_PULL_PUPD_R1R0_TYPE,/*56*/ MTK_PULL_PUPD_R1R0_TYPE,/*57*/ 469 + MTK_PULL_PUPD_R1R0_TYPE,/*58*/ MTK_PULL_PUPD_R1R0_TYPE,/*59*/ 470 + MTK_PULL_PUPD_R1R0_TYPE,/*60*/ MTK_PULL_PUPD_R1R0_TYPE,/*61*/ 471 + MTK_PULL_PUPD_R1R0_TYPE,/*62*/ MTK_PULL_PUPD_R1R0_TYPE,/*63*/ 472 + MTK_PULL_PUPD_R1R0_TYPE,/*64*/ MTK_PULL_PUPD_R1R0_TYPE,/*65*/ 473 + MTK_PULL_PUPD_R1R0_TYPE,/*66*/ MTK_PULL_PUPD_R1R0_TYPE,/*67*/ 474 + MTK_PULL_PUPD_R1R0_TYPE,/*68*/ MTK_PULL_PU_PD_TYPE,/*69*/ 475 + MTK_PULL_PU_PD_TYPE,/*70*/ MTK_PULL_PU_PD_TYPE,/*71*/ 476 + MTK_PULL_PU_PD_TYPE,/*72*/ MTK_PULL_PU_PD_TYPE,/*73*/ 477 + MTK_PULL_PU_PD_TYPE,/*74*/ MTK_PULL_PU_PD_TYPE,/*75*/ 478 + MTK_PULL_PU_PD_TYPE,/*76*/ MTK_PULL_PU_PD_TYPE,/*77*/ 479 + MTK_PULL_PU_PD_TYPE,/*78*/ MTK_PULL_PU_PD_TYPE,/*79*/ 480 + MTK_PULL_PU_PD_TYPE,/*80*/ MTK_PULL_PU_PD_TYPE,/*81*/ 481 + MTK_PULL_PU_PD_TYPE,/*82*/ MTK_PULL_PU_PD_TYPE,/*83*/ 482 + MTK_PULL_PU_PD_TYPE,/*84*/ MTK_PULL_PU_PD_TYPE,/*85*/ 483 + MTK_PULL_PU_PD_TYPE,/*86*/ MTK_PULL_PU_PD_TYPE,/*87*/ 484 + MTK_PULL_PU_PD_TYPE,/*88*/ MTK_PULL_PU_PD_TYPE,/*89*/ 485 + MTK_PULL_PU_PD_TYPE,/*90*/ MTK_PULL_PU_PD_TYPE,/*91*/ 486 + MTK_PULL_PU_PD_TYPE,/*92*/ MTK_PULL_PU_PD_TYPE,/*93*/ 487 + MTK_PULL_PU_PD_TYPE,/*94*/ MTK_PULL_PU_PD_TYPE,/*95*/ 488 + MTK_PULL_PU_PD_TYPE,/*96*/ MTK_PULL_PU_PD_TYPE,/*97*/ 489 + MTK_PULL_PU_PD_TYPE,/*98*/ MTK_PULL_PU_PD_TYPE,/*99*/ 490 + MTK_PULL_PU_PD_TYPE,/*100*/ 491 + }; 492 + 493 + static const struct mtk_pin_reg_calc mt7981_reg_cals[] = { 494 + [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7981_pin_mode_range), 495 + [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7981_pin_dir_range), 496 + [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt7981_pin_di_range), 497 + [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt7981_pin_do_range), 498 + [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt7981_pin_smt_range), 499 + [PINCTRL_PIN_REG_IES] = MTK_RANGE(mt7981_pin_ies_range), 500 + [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt7981_pin_pu_range), 501 + [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt7981_pin_pd_range), 502 + [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt7981_pin_drv_range), 503 + [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt7981_pin_pupd_range), 504 + [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt7981_pin_r0_range), 505 + [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt7981_pin_r1_range), 506 + }; 507 + 508 + static const struct mtk_pin_desc mt7981_pins[] = { 509 + MT7981_PIN(0, "GPIO_WPS"), 510 + MT7981_PIN(1, "GPIO_RESET"), 511 + MT7981_PIN(2, "SYS_WATCHDOG"), 512 + MT7981_PIN(3, "PCIE_PERESET_N"), 513 + MT7981_PIN(4, "JTAG_JTDO"), 514 + MT7981_PIN(5, "JTAG_JTDI"), 515 + MT7981_PIN(6, "JTAG_JTMS"), 516 + MT7981_PIN(7, "JTAG_JTCLK"), 517 + MT7981_PIN(8, "JTAG_JTRST_N"), 518 + MT7981_PIN(9, "WO_JTAG_JTDO"), 519 + MT7981_PIN(10, "WO_JTAG_JTDI"), 520 + MT7981_PIN(11, "WO_JTAG_JTMS"), 521 + MT7981_PIN(12, "WO_JTAG_JTCLK"), 522 + MT7981_PIN(13, "WO_JTAG_JTRST_N"), 523 + MT7981_PIN(14, "USB_VBUS"), 524 + MT7981_PIN(15, "PWM0"), 525 + MT7981_PIN(16, "SPI0_CLK"), 526 + MT7981_PIN(17, "SPI0_MOSI"), 527 + MT7981_PIN(18, "SPI0_MISO"), 528 + MT7981_PIN(19, "SPI0_CS"), 529 + MT7981_PIN(20, "SPI0_HOLD"), 530 + MT7981_PIN(21, "SPI0_WP"), 531 + MT7981_PIN(22, "SPI1_CLK"), 532 + MT7981_PIN(23, "SPI1_MOSI"), 533 + MT7981_PIN(24, "SPI1_MISO"), 534 + MT7981_PIN(25, "SPI1_CS"), 535 + MT7981_PIN(26, "SPI2_CLK"), 536 + MT7981_PIN(27, "SPI2_MOSI"), 537 + MT7981_PIN(28, "SPI2_MISO"), 538 + MT7981_PIN(29, "SPI2_CS"), 539 + MT7981_PIN(30, "SPI2_HOLD"), 540 + MT7981_PIN(31, "SPI2_WP"), 541 + MT7981_PIN(32, "UART0_RXD"), 542 + MT7981_PIN(33, "UART0_TXD"), 543 + MT7981_PIN(34, "PCIE_CLK_REQ"), 544 + MT7981_PIN(35, "PCIE_WAKE_N"), 545 + MT7981_PIN(36, "SMI_MDC"), 546 + MT7981_PIN(37, "SMI_MDIO"), 547 + MT7981_PIN(38, "GBE_INT"), 548 + MT7981_PIN(39, "GBE_RESET"), 549 + MT7981_PIN(40, "WF_DIG_RESETB"), 550 + MT7981_PIN(41, "WF_CBA_RESETB"), 551 + MT7981_PIN(42, "WF_XO_REQ"), 552 + MT7981_PIN(43, "WF_TOP_CLK"), 553 + MT7981_PIN(44, "WF_TOP_DATA"), 554 + MT7981_PIN(45, "WF_HB1"), 555 + MT7981_PIN(46, "WF_HB2"), 556 + MT7981_PIN(47, "WF_HB3"), 557 + MT7981_PIN(48, "WF_HB4"), 558 + MT7981_PIN(49, "WF_HB0"), 559 + MT7981_PIN(50, "WF_HB0_B"), 560 + MT7981_PIN(51, "WF_HB5"), 561 + MT7981_PIN(52, "WF_HB6"), 562 + MT7981_PIN(53, "WF_HB7"), 563 + MT7981_PIN(54, "WF_HB8"), 564 + MT7981_PIN(55, "WF_HB9"), 565 + MT7981_PIN(56, "WF_HB10"), 566 + }; 567 + 568 + /* List all groups consisting of these pins dedicated to the enablement of 569 + * certain hardware block and the corresponding mode for all of the pins. 570 + * The hardware probably has multiple combinations of these pinouts. 571 + */ 572 + 573 + /* WA_AICE */ 574 + static int mt7981_wa_aice1_pins[] = { 0, 1, }; 575 + static int mt7981_wa_aice1_funcs[] = { 2, 2, }; 576 + 577 + static int mt7981_wa_aice2_pins[] = { 0, 1, }; 578 + static int mt7981_wa_aice2_funcs[] = { 3, 3, }; 579 + 580 + static int mt7981_wa_aice3_pins[] = { 28, 29, }; 581 + static int mt7981_wa_aice3_funcs[] = { 3, 3, }; 582 + 583 + static int mt7981_wm_aice1_pins[] = { 9, 10, }; 584 + static int mt7981_wm_aice1_funcs[] = { 2, 2, }; 585 + 586 + static int mt7981_wm_aice2_pins[] = { 30, 31, }; 587 + static int mt7981_wm_aice2_funcs[] = { 5, 5, }; 588 + 589 + /* WM_UART */ 590 + static int mt7981_wm_uart_0_pins[] = { 0, 1, }; 591 + static int mt7981_wm_uart_0_funcs[] = { 5, 5, }; 592 + 593 + static int mt7981_wm_uart_1_pins[] = { 20, 21, }; 594 + static int mt7981_wm_uart_1_funcs[] = { 4, 4, }; 595 + 596 + static int mt7981_wm_uart_2_pins[] = { 30, 31, }; 597 + static int mt7981_wm_uart_2_funcs[] = { 3, 3, }; 598 + 599 + /* DFD */ 600 + static int mt7981_dfd_pins[] = { 0, 1, 4, 5, }; 601 + static int mt7981_dfd_funcs[] = { 5, 5, 6, 6, }; 602 + 603 + /* SYS_WATCHDOG */ 604 + static int mt7981_watchdog_pins[] = { 2, }; 605 + static int mt7981_watchdog_funcs[] = { 1, }; 606 + 607 + static int mt7981_watchdog1_pins[] = { 13, }; 608 + static int mt7981_watchdog1_funcs[] = { 5, }; 609 + 610 + /* PCIE_PERESET_N */ 611 + static int mt7981_pcie_pereset_pins[] = { 3, }; 612 + static int mt7981_pcie_pereset_funcs[] = { 1, }; 613 + 614 + /* JTAG */ 615 + static int mt7981_jtag_pins[] = { 4, 5, 6, 7, 8, }; 616 + static int mt7981_jtag_funcs[] = { 1, 1, 1, 1, 1, }; 617 + 618 + /* WM_JTAG */ 619 + static int mt7981_wm_jtag_0_pins[] = { 4, 5, 6, 7, 8, }; 620 + static int mt7981_wm_jtag_0_funcs[] = { 2, 2, 2, 2, 2, }; 621 + 622 + static int mt7981_wm_jtag_1_pins[] = { 20, 21, 22, 23, 24, }; 623 + static int mt7981_wm_jtag_1_funcs[] = { 5, 5, 5, 5, 5, }; 624 + 625 + /* WO0_JTAG */ 626 + static int mt7981_wo0_jtag_0_pins[] = { 9, 10, 11, 12, 13, }; 627 + static int mt7981_wo0_jtag_0_funcs[] = { 1, 1, 1, 1, 1, }; 628 + 629 + static int mt7981_wo0_jtag_1_pins[] = { 25, 26, 27, 28, 29, }; 630 + static int mt7981_wo0_jtag_1_funcs[] = { 5, 5, 5, 5, 5, }; 631 + 632 + /* UART2 */ 633 + static int mt7981_uart2_0_pins[] = { 4, 5, 6, 7, }; 634 + static int mt7981_uart2_0_funcs[] = { 3, 3, 3, 3, }; 635 + 636 + /* GBE_LED0 */ 637 + static int mt7981_gbe_led0_pins[] = { 8, }; 638 + static int mt7981_gbe_led0_funcs[] = { 3, }; 639 + 640 + /* PTA_EXT */ 641 + static int mt7981_pta_ext_0_pins[] = { 4, 5, 6, }; 642 + static int mt7981_pta_ext_0_funcs[] = { 4, 4, 4, }; 643 + 644 + static int mt7981_pta_ext_1_pins[] = { 22, 23, 24, }; 645 + static int mt7981_pta_ext_1_funcs[] = { 4, 4, 4, }; 646 + 647 + /* PWM2 */ 648 + static int mt7981_pwm2_pins[] = { 7, }; 649 + static int mt7981_pwm2_funcs[] = { 4, }; 650 + 651 + /* NET_WO0_UART_TXD */ 652 + static int mt7981_net_wo0_uart_txd_0_pins[] = { 8, }; 653 + static int mt7981_net_wo0_uart_txd_0_funcs[] = { 4, }; 654 + 655 + static int mt7981_net_wo0_uart_txd_1_pins[] = { 14, }; 656 + static int mt7981_net_wo0_uart_txd_1_funcs[] = { 3, }; 657 + 658 + static int mt7981_net_wo0_uart_txd_2_pins[] = { 15, }; 659 + static int mt7981_net_wo0_uart_txd_2_funcs[] = { 4, }; 660 + 661 + /* SPI1 */ 662 + static int mt7981_spi1_0_pins[] = { 4, 5, 6, 7, }; 663 + static int mt7981_spi1_0_funcs[] = { 5, 5, 5, 5, }; 664 + 665 + /* I2C */ 666 + static int mt7981_i2c0_0_pins[] = { 6, 7, }; 667 + static int mt7981_i2c0_0_funcs[] = { 6, 6, }; 668 + 669 + static int mt7981_i2c0_1_pins[] = { 30, 31, }; 670 + static int mt7981_i2c0_1_funcs[] = { 4, 4, }; 671 + 672 + static int mt7981_i2c0_2_pins[] = { 36, 37, }; 673 + static int mt7981_i2c0_2_funcs[] = { 2, 2, }; 674 + 675 + static int mt7981_u2_phy_i2c_pins[] = { 30, 31, }; 676 + static int mt7981_u2_phy_i2c_funcs[] = { 6, 6, }; 677 + 678 + static int mt7981_u3_phy_i2c_pins[] = { 32, 33, }; 679 + static int mt7981_u3_phy_i2c_funcs[] = { 3, 3, }; 680 + 681 + static int mt7981_sgmii1_phy_i2c_pins[] = { 32, 33, }; 682 + static int mt7981_sgmii1_phy_i2c_funcs[] = { 2, 2, }; 683 + 684 + static int mt7981_sgmii0_phy_i2c_pins[] = { 32, 33, }; 685 + static int mt7981_sgmii0_phy_i2c_funcs[] = { 5, 5, }; 686 + 687 + /* DFD_NTRST */ 688 + static int mt7981_dfd_ntrst_pins[] = { 8, }; 689 + static int mt7981_dfd_ntrst_funcs[] = { 6, }; 690 + 691 + /* PWM0 */ 692 + static int mt7981_pwm0_0_pins[] = { 13, }; 693 + static int mt7981_pwm0_0_funcs[] = { 2, }; 694 + 695 + static int mt7981_pwm0_1_pins[] = { 15, }; 696 + static int mt7981_pwm0_1_funcs[] = { 1, }; 697 + 698 + /* PWM1 */ 699 + static int mt7981_pwm1_0_pins[] = { 14, }; 700 + static int mt7981_pwm1_0_funcs[] = { 2, }; 701 + 702 + static int mt7981_pwm1_1_pins[] = { 15, }; 703 + static int mt7981_pwm1_1_funcs[] = { 3, }; 704 + 705 + /* GBE_LED1 */ 706 + static int mt7981_gbe_led1_pins[] = { 13, }; 707 + static int mt7981_gbe_led1_funcs[] = { 3, }; 708 + 709 + /* PCM */ 710 + static int mt7981_pcm_pins[] = { 9, 10, 11, 12, 13, 25 }; 711 + static int mt7981_pcm_funcs[] = { 4, 4, 4, 4, 4, 4, }; 712 + 713 + /* UDI */ 714 + static int mt7981_udi_pins[] = { 9, 10, 11, 12, 13, }; 715 + static int mt7981_udi_funcs[] = { 6, 6, 6, 6, 6, }; 716 + 717 + /* DRV_VBUS */ 718 + static int mt7981_drv_vbus_pins[] = { 14, }; 719 + static int mt7981_drv_vbus_funcs[] = { 1, }; 720 + 721 + /* EMMC */ 722 + static int mt7981_emmc_45_pins[] = { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, }; 723 + static int mt7981_emmc_45_funcs[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, }; 724 + 725 + /* SNFI */ 726 + static int mt7981_snfi_pins[] = { 16, 17, 18, 19, 20, 21, }; 727 + static int mt7981_snfi_funcs[] = { 3, 3, 3, 3, 3, 3, }; 728 + 729 + /* SPI0 */ 730 + static int mt7981_spi0_pins[] = { 16, 17, 18, 19, }; 731 + static int mt7981_spi0_funcs[] = { 1, 1, 1, 1, }; 732 + 733 + /* SPI0 */ 734 + static int mt7981_spi0_wp_hold_pins[] = { 20, 21, }; 735 + static int mt7981_spi0_wp_hold_funcs[] = { 1, 1, }; 736 + 737 + /* SPI1 */ 738 + static int mt7981_spi1_1_pins[] = { 22, 23, 24, 25, }; 739 + static int mt7981_spi1_1_funcs[] = { 1, 1, 1, 1, }; 740 + 741 + /* SPI2 */ 742 + static int mt7981_spi2_pins[] = { 26, 27, 28, 29, }; 743 + static int mt7981_spi2_funcs[] = { 1, 1, 1, 1, }; 744 + 745 + /* SPI2 */ 746 + static int mt7981_spi2_wp_hold_pins[] = { 30, 31, }; 747 + static int mt7981_spi2_wp_hold_funcs[] = { 1, 1, }; 748 + 749 + /* UART1 */ 750 + static int mt7981_uart1_0_pins[] = { 16, 17, 18, 19, }; 751 + static int mt7981_uart1_0_funcs[] = { 4, 4, 4, 4, }; 752 + 753 + static int mt7981_uart1_1_pins[] = { 26, 27, 28, 29, }; 754 + static int mt7981_uart1_1_funcs[] = { 2, 2, 2, 2, }; 755 + 756 + /* UART2 */ 757 + static int mt7981_uart2_1_pins[] = { 22, 23, 24, 25, }; 758 + static int mt7981_uart2_1_funcs[] = { 3, 3, 3, 3, }; 759 + 760 + /* UART0 */ 761 + static int mt7981_uart0_pins[] = { 32, 33, }; 762 + static int mt7981_uart0_funcs[] = { 1, 1, }; 763 + 764 + /* PCIE_CLK_REQ */ 765 + static int mt7981_pcie_clk_pins[] = { 34, }; 766 + static int mt7981_pcie_clk_funcs[] = { 2, }; 767 + 768 + /* PCIE_WAKE_N */ 769 + static int mt7981_pcie_wake_pins[] = { 35, }; 770 + static int mt7981_pcie_wake_funcs[] = { 2, }; 771 + 772 + /* MDC_MDIO */ 773 + static int mt7981_smi_mdc_mdio_pins[] = { 36, 37, }; 774 + static int mt7981_smi_mdc_mdio_funcs[] = { 1, 1, }; 775 + 776 + static int mt7981_gbe_ext_mdc_mdio_pins[] = { 36, 37, }; 777 + static int mt7981_gbe_ext_mdc_mdio_funcs[] = { 3, 3, }; 778 + 779 + /* WF0_MODE1 */ 780 + static int mt7981_wf0_mode1_pins[] = { 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 }; 781 + static int mt7981_wf0_mode1_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 782 + 783 + /* WF0_MODE3 */ 784 + static int mt7981_wf0_mode3_pins[] = { 45, 46, 47, 48, 49, 51 }; 785 + static int mt7981_wf0_mode3_funcs[] = { 2, 2, 2, 2, 2, 2 }; 786 + 787 + /* WF2G_LED */ 788 + static int mt7981_wf2g_led0_pins[] = { 30, }; 789 + static int mt7981_wf2g_led0_funcs[] = { 2, }; 790 + 791 + static int mt7981_wf2g_led1_pins[] = { 34, }; 792 + static int mt7981_wf2g_led1_funcs[] = { 1, }; 793 + 794 + /* WF5G_LED */ 795 + static int mt7981_wf5g_led0_pins[] = { 31, }; 796 + static int mt7981_wf5g_led0_funcs[] = { 2, }; 797 + 798 + static int mt7981_wf5g_led1_pins[] = { 35, }; 799 + static int mt7981_wf5g_led1_funcs[] = { 1, }; 800 + 801 + /* MT7531_INT */ 802 + static int mt7981_mt7531_int_pins[] = { 38, }; 803 + static int mt7981_mt7531_int_funcs[] = { 1, }; 804 + 805 + /* ANT_SEL */ 806 + static int mt7981_ant_sel_pins[] = { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 34, 35 }; 807 + static int mt7981_ant_sel_funcs[] = { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }; 808 + 809 + static const struct group_desc mt7981_groups[] = { 810 + /* @GPIO(0,1): WA_AICE(2) */ 811 + PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1), 812 + /* @GPIO(0,1): WA_AICE(3) */ 813 + PINCTRL_PIN_GROUP("wa_aice2", mt7981_wa_aice2), 814 + /* @GPIO(0,1): WM_UART(5) */ 815 + PINCTRL_PIN_GROUP("wm_uart_0", mt7981_wm_uart_0), 816 + /* @GPIO(0,1,4,5): DFD(6) */ 817 + PINCTRL_PIN_GROUP("dfd", mt7981_dfd), 818 + /* @GPIO(2): SYS_WATCHDOG(1) */ 819 + PINCTRL_PIN_GROUP("watchdog", mt7981_watchdog), 820 + /* @GPIO(3): PCIE_PERESET_N(1) */ 821 + PINCTRL_PIN_GROUP("pcie_pereset", mt7981_pcie_pereset), 822 + /* @GPIO(4,8) JTAG(1) */ 823 + PINCTRL_PIN_GROUP("jtag", mt7981_jtag), 824 + /* @GPIO(4,8) WM_JTAG(2) */ 825 + PINCTRL_PIN_GROUP("wm_jtag_0", mt7981_wm_jtag_0), 826 + /* @GPIO(9,13) WO0_JTAG(1) */ 827 + PINCTRL_PIN_GROUP("wo0_jtag_0", mt7981_wo0_jtag_0), 828 + /* @GPIO(4,7) WM_JTAG(3) */ 829 + PINCTRL_PIN_GROUP("uart2_0", mt7981_uart2_0), 830 + /* @GPIO(8) GBE_LED0(3) */ 831 + PINCTRL_PIN_GROUP("gbe_led0", mt7981_gbe_led0), 832 + /* @GPIO(4,6) PTA_EXT(4) */ 833 + PINCTRL_PIN_GROUP("pta_ext_0", mt7981_pta_ext_0), 834 + /* @GPIO(7) PWM2(4) */ 835 + PINCTRL_PIN_GROUP("pwm2", mt7981_pwm2), 836 + /* @GPIO(8) NET_WO0_UART_TXD(4) */ 837 + PINCTRL_PIN_GROUP("net_wo0_uart_txd_0", mt7981_net_wo0_uart_txd_0), 838 + /* @GPIO(4,7) SPI1(5) */ 839 + PINCTRL_PIN_GROUP("spi1_0", mt7981_spi1_0), 840 + /* @GPIO(6,7) I2C(5) */ 841 + PINCTRL_PIN_GROUP("i2c0_0", mt7981_i2c0_0), 842 + /* @GPIO(0,1,4,5): DFD_NTRST(6) */ 843 + PINCTRL_PIN_GROUP("dfd_ntrst", mt7981_dfd_ntrst), 844 + /* @GPIO(9,10): WM_AICE(2) */ 845 + PINCTRL_PIN_GROUP("wm_aice1", mt7981_wm_aice1), 846 + /* @GPIO(13): PWM0(2) */ 847 + PINCTRL_PIN_GROUP("pwm0_0", mt7981_pwm0_0), 848 + /* @GPIO(15): PWM0(1) */ 849 + PINCTRL_PIN_GROUP("pwm0_1", mt7981_pwm0_1), 850 + /* @GPIO(14): PWM1(2) */ 851 + PINCTRL_PIN_GROUP("pwm1_0", mt7981_pwm1_0), 852 + /* @GPIO(15): PWM1(3) */ 853 + PINCTRL_PIN_GROUP("pwm1_1", mt7981_pwm1_1), 854 + /* @GPIO(14) NET_WO0_UART_TXD(3) */ 855 + PINCTRL_PIN_GROUP("net_wo0_uart_txd_1", mt7981_net_wo0_uart_txd_1), 856 + /* @GPIO(15) NET_WO0_UART_TXD(4) */ 857 + PINCTRL_PIN_GROUP("net_wo0_uart_txd_2", mt7981_net_wo0_uart_txd_2), 858 + /* @GPIO(13) GBE_LED0(3) */ 859 + PINCTRL_PIN_GROUP("gbe_led1", mt7981_gbe_led1), 860 + /* @GPIO(9,13) PCM(4) */ 861 + PINCTRL_PIN_GROUP("pcm", mt7981_pcm), 862 + /* @GPIO(13): SYS_WATCHDOG1(5) */ 863 + PINCTRL_PIN_GROUP("watchdog1", mt7981_watchdog1), 864 + /* @GPIO(9,13) UDI(4) */ 865 + PINCTRL_PIN_GROUP("udi", mt7981_udi), 866 + /* @GPIO(14) DRV_VBUS(1) */ 867 + PINCTRL_PIN_GROUP("drv_vbus", mt7981_drv_vbus), 868 + /* @GPIO(15,25): EMMC(2) */ 869 + PINCTRL_PIN_GROUP("emmc_45", mt7981_emmc_45), 870 + /* @GPIO(16,21): SNFI(3) */ 871 + PINCTRL_PIN_GROUP("snfi", mt7981_snfi), 872 + /* @GPIO(16,19): SPI0(1) */ 873 + PINCTRL_PIN_GROUP("spi0", mt7981_spi0), 874 + /* @GPIO(20,21): SPI0(1) */ 875 + PINCTRL_PIN_GROUP("spi0_wp_hold", mt7981_spi0_wp_hold), 876 + /* @GPIO(22,25) SPI1(1) */ 877 + PINCTRL_PIN_GROUP("spi1_1", mt7981_spi1_1), 878 + /* @GPIO(26,29): SPI2(1) */ 879 + PINCTRL_PIN_GROUP("spi2", mt7981_spi2), 880 + /* @GPIO(30,31): SPI0(1) */ 881 + PINCTRL_PIN_GROUP("spi2_wp_hold", mt7981_spi2_wp_hold), 882 + /* @GPIO(16,19): UART1(4) */ 883 + PINCTRL_PIN_GROUP("uart1_0", mt7981_uart1_0), 884 + /* @GPIO(26,29): UART1(2) */ 885 + PINCTRL_PIN_GROUP("uart1_1", mt7981_uart1_1), 886 + /* @GPIO(22,25): UART1(3) */ 887 + PINCTRL_PIN_GROUP("uart2_1", mt7981_uart2_1), 888 + /* @GPIO(22,24) PTA_EXT(4) */ 889 + PINCTRL_PIN_GROUP("pta_ext_1", mt7981_pta_ext_1), 890 + /* @GPIO(20,21): WM_UART(4) */ 891 + PINCTRL_PIN_GROUP("wm_aurt_1", mt7981_wm_uart_1), 892 + /* @GPIO(30,31): WM_UART(3) */ 893 + PINCTRL_PIN_GROUP("wm_aurt_2", mt7981_wm_uart_2), 894 + /* @GPIO(20,24) WM_JTAG(5) */ 895 + PINCTRL_PIN_GROUP("wm_jtag_1", mt7981_wm_jtag_1), 896 + /* @GPIO(25,29) WO0_JTAG(5) */ 897 + PINCTRL_PIN_GROUP("wo0_jtag_1", mt7981_wo0_jtag_1), 898 + /* @GPIO(28,29): WA_AICE(3) */ 899 + PINCTRL_PIN_GROUP("wa_aice3", mt7981_wa_aice3), 900 + /* @GPIO(30,31): WM_AICE(5) */ 901 + PINCTRL_PIN_GROUP("wm_aice2", mt7981_wm_aice2), 902 + /* @GPIO(30,31): I2C(4) */ 903 + PINCTRL_PIN_GROUP("i2c0_1", mt7981_i2c0_1), 904 + /* @GPIO(30,31): I2C(6) */ 905 + PINCTRL_PIN_GROUP("u2_phy_i2c", mt7981_u2_phy_i2c), 906 + /* @GPIO(32,33): I2C(1) */ 907 + PINCTRL_PIN_GROUP("uart0", mt7981_uart0), 908 + /* @GPIO(32,33): I2C(2) */ 909 + PINCTRL_PIN_GROUP("sgmii1_phy_i2c", mt7981_sgmii1_phy_i2c), 910 + /* @GPIO(32,33): I2C(3) */ 911 + PINCTRL_PIN_GROUP("u3_phy_i2c", mt7981_u3_phy_i2c), 912 + /* @GPIO(32,33): I2C(5) */ 913 + PINCTRL_PIN_GROUP("sgmii0_phy_i2c", mt7981_sgmii0_phy_i2c), 914 + /* @GPIO(34): PCIE_CLK_REQ(2) */ 915 + PINCTRL_PIN_GROUP("pcie_clk", mt7981_pcie_clk), 916 + /* @GPIO(35): PCIE_WAKE_N(2) */ 917 + PINCTRL_PIN_GROUP("pcie_wake", mt7981_pcie_wake), 918 + /* @GPIO(36,37): I2C(2) */ 919 + PINCTRL_PIN_GROUP("i2c0_2", mt7981_i2c0_2), 920 + /* @GPIO(36,37): MDC_MDIO(1) */ 921 + PINCTRL_PIN_GROUP("smi_mdc_mdio", mt7981_smi_mdc_mdio), 922 + /* @GPIO(36,37): MDC_MDIO(3) */ 923 + PINCTRL_PIN_GROUP("gbe_ext_mdc_mdio", mt7981_gbe_ext_mdc_mdio), 924 + /* @GPIO(69,85): WF0_MODE1(1) */ 925 + PINCTRL_PIN_GROUP("wf0_mode1", mt7981_wf0_mode1), 926 + /* @GPIO(74,80): WF0_MODE3(3) */ 927 + PINCTRL_PIN_GROUP("wf0_mode3", mt7981_wf0_mode3), 928 + /* @GPIO(30): WF2G_LED(2) */ 929 + PINCTRL_PIN_GROUP("wf2g_led0", mt7981_wf2g_led0), 930 + /* @GPIO(34): WF2G_LED(1) */ 931 + PINCTRL_PIN_GROUP("wf2g_led1", mt7981_wf2g_led1), 932 + /* @GPIO(31): WF5G_LED(2) */ 933 + PINCTRL_PIN_GROUP("wf5g_led0", mt7981_wf5g_led0), 934 + /* @GPIO(35): WF5G_LED(1) */ 935 + PINCTRL_PIN_GROUP("wf5g_led1", mt7981_wf5g_led1), 936 + /* @GPIO(38): MT7531_INT(1) */ 937 + PINCTRL_PIN_GROUP("mt7531_int", mt7981_mt7531_int), 938 + /* @GPIO(14,15,26,17,18,19,20,21,22,23,24,25,34,35): ANT_SEL(1) */ 939 + PINCTRL_PIN_GROUP("ant_sel", mt7981_ant_sel), 940 + }; 941 + 942 + /* Joint those groups owning the same capability in user point of view which 943 + * allows that people tend to use through the device tree. 944 + */ 945 + static const char *mt7981_wa_aice_groups[] = { "wa_aice1", "wa_aice2", "wm_aice1_1", 946 + "wa_aice3", "wm_aice1_2", }; 947 + static const char *mt7981_uart_groups[] = { "wm_uart_0", "uart2_0", 948 + "net_wo0_uart_txd_0", "net_wo0_uart_txd_1", "net_wo0_uart_txd_2", 949 + "uart1_0", "uart1_1", "uart2_1", "wm_aurt_1", "wm_aurt_2", "uart0", }; 950 + static const char *mt7981_dfd_groups[] = { "dfd", "dfd_ntrst", }; 951 + static const char *mt7981_wdt_groups[] = { "watchdog", "watchdog1", }; 952 + static const char *mt7981_pcie_groups[] = { "pcie_pereset", "pcie_clk", "pcie_wake", }; 953 + static const char *mt7981_jtag_groups[] = { "jtag", "wm_jtag_0", "wo0_jtag_0", 954 + "wo0_jtag_1", "wm_jtag_1", }; 955 + static const char *mt7981_led_groups[] = { "gbe_led0", "gbe_led1", "wf2g_led0", 956 + "wf2g_led1", "wf5g_led0", "wf5g_led1", }; 957 + static const char *mt7981_pta_groups[] = { "pta_ext_0", "pta_ext_1", }; 958 + static const char *mt7981_pwm_groups[] = { "pwm2", "pwm0_0", "pwm0_1", 959 + "pwm1_0", "pwm1_1", }; 960 + static const char *mt7981_spi_groups[] = { "spi1_0", "spi0", "spi0_wp_hold", "spi1_1", "spi2", 961 + "spi2_wp_hold", }; 962 + static const char *mt7981_i2c_groups[] = { "i2c0_0", "i2c0_1", "u2_phy_i2c", 963 + "sgmii1_phy_i2c", "u3_phy_i2c", "sgmii0_phy_i2c", "i2c0_2", }; 964 + static const char *mt7981_pcm_groups[] = { "pcm", }; 965 + static const char *mt7981_udi_groups[] = { "udi", }; 966 + static const char *mt7981_usb_groups[] = { "drv_vbus", }; 967 + static const char *mt7981_flash_groups[] = { "emmc_45", "snfi", }; 968 + static const char *mt7981_ethernet_groups[] = { "smi_mdc_mdio", "gbe_ext_mdc_mdio", 969 + "wf0_mode1", "wf0_mode3", "mt7531_int", }; 970 + static const char *mt7981_ant_groups[] = { "ant_sel", }; 971 + 972 + static const struct function_desc mt7981_functions[] = { 973 + {"wa_aice", mt7981_wa_aice_groups, ARRAY_SIZE(mt7981_wa_aice_groups)}, 974 + {"dfd", mt7981_dfd_groups, ARRAY_SIZE(mt7981_dfd_groups)}, 975 + {"jtag", mt7981_jtag_groups, ARRAY_SIZE(mt7981_jtag_groups)}, 976 + {"pta", mt7981_pta_groups, ARRAY_SIZE(mt7981_pta_groups)}, 977 + {"pcm", mt7981_pcm_groups, ARRAY_SIZE(mt7981_pcm_groups)}, 978 + {"udi", mt7981_udi_groups, ARRAY_SIZE(mt7981_udi_groups)}, 979 + {"usb", mt7981_usb_groups, ARRAY_SIZE(mt7981_usb_groups)}, 980 + {"ant", mt7981_ant_groups, ARRAY_SIZE(mt7981_ant_groups)}, 981 + {"eth", mt7981_ethernet_groups, ARRAY_SIZE(mt7981_ethernet_groups)}, 982 + {"i2c", mt7981_i2c_groups, ARRAY_SIZE(mt7981_i2c_groups)}, 983 + {"led", mt7981_led_groups, ARRAY_SIZE(mt7981_led_groups)}, 984 + {"pwm", mt7981_pwm_groups, ARRAY_SIZE(mt7981_pwm_groups)}, 985 + {"spi", mt7981_spi_groups, ARRAY_SIZE(mt7981_spi_groups)}, 986 + {"uart", mt7981_uart_groups, ARRAY_SIZE(mt7981_uart_groups)}, 987 + {"watchdog", mt7981_wdt_groups, ARRAY_SIZE(mt7981_wdt_groups)}, 988 + {"flash", mt7981_flash_groups, ARRAY_SIZE(mt7981_flash_groups)}, 989 + {"pcie", mt7981_pcie_groups, ARRAY_SIZE(mt7981_pcie_groups)}, 990 + }; 991 + 992 + static const struct mtk_eint_hw mt7981_eint_hw = { 993 + .port_mask = 7, 994 + .ports = 7, 995 + .ap_num = ARRAY_SIZE(mt7981_pins), 996 + .db_cnt = 16, 997 + }; 998 + 999 + static const char * const mt7981_pinctrl_register_base_names[] = { 1000 + "gpio", "iocfg_rt", "iocfg_rm", "iocfg_rb", 1001 + "iocfg_lb", "iocfg_bl", "iocfg_tm", "iocfg_tl", 1002 + }; 1003 + 1004 + static struct mtk_pin_soc mt7981_data = { 1005 + .reg_cal = mt7981_reg_cals, 1006 + .pins = mt7981_pins, 1007 + .npins = ARRAY_SIZE(mt7981_pins), 1008 + .grps = mt7981_groups, 1009 + .ngrps = ARRAY_SIZE(mt7981_groups), 1010 + .funcs = mt7981_functions, 1011 + .nfuncs = ARRAY_SIZE(mt7981_functions), 1012 + .eint_hw = &mt7981_eint_hw, 1013 + .gpio_m = 0, 1014 + .ies_present = false, 1015 + .base_names = mt7981_pinctrl_register_base_names, 1016 + .nbase_names = ARRAY_SIZE(mt7981_pinctrl_register_base_names), 1017 + .pull_type = mt7981_pull_type, 1018 + .bias_set_combo = mtk_pinconf_bias_set_combo, 1019 + .bias_get_combo = mtk_pinconf_bias_get_combo, 1020 + .drive_set = mtk_pinconf_drive_set_rev1, 1021 + .drive_get = mtk_pinconf_drive_get_rev1, 1022 + .adv_pull_get = mtk_pinconf_adv_pull_get, 1023 + .adv_pull_set = mtk_pinconf_adv_pull_set, 1024 + }; 1025 + 1026 + static const struct of_device_id mt7981_pinctrl_of_match[] = { 1027 + { .compatible = "mediatek,mt7981-pinctrl", }, 1028 + {} 1029 + }; 1030 + 1031 + static int mt7981_pinctrl_probe(struct platform_device *pdev) 1032 + { 1033 + return mtk_moore_pinctrl_probe(pdev, &mt7981_data); 1034 + } 1035 + 1036 + static struct platform_driver mt7981_pinctrl_driver = { 1037 + .driver = { 1038 + .name = "mt7981-pinctrl", 1039 + .of_match_table = mt7981_pinctrl_of_match, 1040 + }, 1041 + .probe = mt7981_pinctrl_probe, 1042 + }; 1043 + 1044 + static int __init mt7981_pinctrl_init(void) 1045 + { 1046 + return platform_driver_register(&mt7981_pinctrl_driver); 1047 + } 1048 + arch_initcall(mt7981_pinctrl_init);
-1
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 906 906 .set = mtk_gpio_set, 907 907 .to_irq = mtk_gpio_to_irq, 908 908 .set_config = mtk_gpio_set_config, 909 - .of_gpio_n_cells = 2, 910 909 }; 911 910 912 911 static int mtk_eint_suspend(struct device *device)
+2 -3
drivers/pinctrl/mediatek/pinctrl-paris.c
··· 640 640 ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw, 641 641 unsigned int gpio, char *buf, unsigned int buf_len) 642 642 { 643 - int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1, rsel = -1; 643 + int pinmux, pullup = 0, pullen = 0, len = 0, r1 = -1, r0 = -1, rsel = -1; 644 644 const struct mtk_pin_desc *desc; 645 645 u32 try_all_type = 0; 646 646 ··· 717 717 unsigned int gpio) 718 718 { 719 719 struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev); 720 - char buf[PIN_DBG_BUF_SZ]; 720 + char buf[PIN_DBG_BUF_SZ] = { 0 }; 721 721 722 722 (void)mtk_pctrl_show_one_pin(hw, gpio, buf, PIN_DBG_BUF_SZ); 723 723 ··· 987 987 chip->set_config = mtk_gpio_set_config; 988 988 chip->base = -1; 989 989 chip->ngpio = hw->soc->npins; 990 - chip->of_gpio_n_cells = 2; 991 990 992 991 ret = gpiochip_add_data(chip, hw); 993 992 if (ret < 0)
-2
drivers/pinctrl/nomadik/pinctrl-abx500.c
··· 446 446 return ret; 447 447 } 448 448 449 - #include <linux/seq_file.h> 450 - 451 449 static void abx500_gpio_dbg_show_one(struct seq_file *s, 452 450 struct pinctrl_dev *pctldev, 453 451 struct gpio_chip *chip,
+7
drivers/pinctrl/pinctrl-amd.c
··· 218 218 char *orientation; 219 219 char debounce_value[40]; 220 220 char *debounce_enable; 221 + char *wake_cntrlz; 221 222 222 223 for (bank = 0; bank < gpio_dev->hwbank_num; bank++) { 223 224 unsigned int time = 0; ··· 305 304 else 306 305 wake_cntrl2 = " ∅"; 307 306 seq_printf(s, "S4/S5 %s| ", wake_cntrl2); 307 + 308 + if (pin_reg & BIT(WAKECNTRL_Z_OFF)) 309 + wake_cntrlz = "⏰"; 310 + else 311 + wake_cntrlz = " ∅"; 312 + seq_printf(s, "Z %s| ", wake_cntrlz); 308 313 309 314 if (pin_reg & BIT(PULL_UP_ENABLE_OFF)) { 310 315 pull_up_enable = "+";
+1
drivers/pinctrl/pinctrl-amd.h
··· 42 42 #define OUTPUT_ENABLE_OFF 23 43 43 #define SW_CNTRL_IN_OFF 24 44 44 #define SW_CNTRL_EN_OFF 25 45 + #define WAKECNTRL_Z_OFF 27 45 46 #define INTERRUPT_STS_OFF 28 46 47 #define WAKE_STS_OFF 29 47 48
+2 -2
drivers/pinctrl/pinctrl-at91-pio4.c
··· 1149 1149 1150 1150 pin_desc[i].number = i; 1151 1151 /* Pin naming convention: P(bank_name)(bank_pin_number). */ 1152 - pin_desc[i].name = kasprintf(GFP_KERNEL, "P%c%d", 1153 - bank + 'A', line); 1152 + pin_desc[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "P%c%d", 1153 + bank + 'A', line); 1154 1154 1155 1155 group->name = group_names[i] = pin_desc[i].name; 1156 1156 group->pin = pin_desc[i].number;
+17 -27
drivers/pinctrl/pinctrl-at91.c
··· 1294 1294 struct at91_pinctrl *info) 1295 1295 { 1296 1296 int ret = 0; 1297 - int i, j; 1297 + int i, j, ngpio_chips_enabled = 0; 1298 1298 uint32_t *tmp; 1299 1299 struct device_node *np = pdev->dev.of_node; 1300 1300 struct device_node *child; ··· 1307 1307 of_match_device(at91_pinctrl_of_match, &pdev->dev)->data; 1308 1308 at91_pinctrl_child_count(info, np); 1309 1309 1310 - if (gpio_banks < 1) { 1311 - dev_err(&pdev->dev, "you need to specify at least one gpio-controller\n"); 1312 - return -EINVAL; 1313 - } 1310 + /* 1311 + * We need all the GPIO drivers to probe FIRST, or we will not be able 1312 + * to obtain references to the struct gpio_chip * for them, and we 1313 + * need this to proceed. 1314 + */ 1315 + for (i = 0; i < MAX_GPIO_BANKS; i++) 1316 + if (gpio_chips[i]) 1317 + ngpio_chips_enabled++; 1318 + 1319 + if (ngpio_chips_enabled < info->nactive_banks) 1320 + return -EPROBE_DEFER; 1314 1321 1315 1322 ret = at91_pinctrl_mux_mask(info, np); 1316 1323 if (ret) ··· 1373 1366 { 1374 1367 struct at91_pinctrl *info; 1375 1368 struct pinctrl_pin_desc *pdesc; 1376 - int ret, i, j, k, ngpio_chips_enabled = 0; 1369 + int ret, i, j, k; 1377 1370 1378 1371 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 1379 1372 if (!info) ··· 1382 1375 ret = at91_pinctrl_probe_dt(pdev, info); 1383 1376 if (ret) 1384 1377 return ret; 1385 - 1386 - /* 1387 - * We need all the GPIO drivers to probe FIRST, or we will not be able 1388 - * to obtain references to the struct gpio_chip * for them, and we 1389 - * need this to proceed. 1390 - */ 1391 - for (i = 0; i < gpio_banks; i++) 1392 - if (gpio_chips[i]) 1393 - ngpio_chips_enabled++; 1394 - 1395 - if (ngpio_chips_enabled < info->nactive_banks) { 1396 - dev_warn(&pdev->dev, 1397 - "All GPIO chips are not registered yet (%d/%d)\n", 1398 - ngpio_chips_enabled, info->nactive_banks); 1399 - devm_kfree(&pdev->dev, info); 1400 - return -EPROBE_DEFER; 1401 - } 1402 1378 1403 1379 at91_pinctrl_desc.name = dev_name(&pdev->dev); 1404 1380 at91_pinctrl_desc.npins = gpio_banks * MAX_NB_GPIO_PER_BANK; ··· 1639 1649 return 0; 1640 1650 } 1641 1651 1642 - static int at91_gpio_suspend(struct device *dev) 1652 + static int __maybe_unused at91_gpio_suspend(struct device *dev) 1643 1653 { 1644 1654 struct at91_gpio_chip *at91_chip = dev_get_drvdata(dev); 1645 1655 void __iomem *pio = at91_chip->regbase; ··· 1657 1667 return 0; 1658 1668 } 1659 1669 1660 - static int at91_gpio_resume(struct device *dev) 1670 + static int __maybe_unused at91_gpio_resume(struct device *dev) 1661 1671 { 1662 1672 struct at91_gpio_chip *at91_chip = dev_get_drvdata(dev); 1663 1673 void __iomem *pio = at91_chip->regbase; ··· 1875 1885 } 1876 1886 1877 1887 for (i = 0; i < chip->ngpio; i++) 1878 - names[i] = kasprintf(GFP_KERNEL, "pio%c%d", alias_idx + 'A', i); 1888 + names[i] = devm_kasprintf(&pdev->dev, GFP_KERNEL, "pio%c%d", alias_idx + 'A', i); 1879 1889 1880 1890 chip->names = (const char *const *)names; 1881 1891 ··· 1913 1923 } 1914 1924 1915 1925 static const struct dev_pm_ops at91_gpio_pm_ops = { 1916 - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(at91_gpio_suspend, at91_gpio_resume) 1926 + NOIRQ_SYSTEM_SLEEP_PM_OPS(at91_gpio_suspend, at91_gpio_resume) 1917 1927 }; 1918 1928 1919 1929 static struct platform_driver at91_gpio_driver = {
-6
drivers/pinctrl/pinctrl-da850-pupd.c
··· 173 173 return 0; 174 174 } 175 175 176 - static int da850_pupd_remove(struct platform_device *pdev) 177 - { 178 - return 0; 179 - } 180 - 181 176 static const struct of_device_id da850_pupd_of_match[] = { 182 177 { .compatible = "ti,da850-pupd" }, 183 178 { } ··· 185 190 .of_match_table = da850_pupd_of_match, 186 191 }, 187 192 .probe = da850_pupd_probe, 188 - .remove = da850_pupd_remove, 189 193 }; 190 194 module_platform_driver(da850_pupd_driver); 191 195
+6 -6
drivers/pinctrl/pinctrl-digicolor.c
··· 11 11 * - Pin pad configuration (pull up/down, strength) 12 12 */ 13 13 14 - #include <linux/init.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/of.h> 17 - #include <linux/of_device.h> 18 - #include <linux/io.h> 19 14 #include <linux/gpio/driver.h> 15 + #include <linux/init.h> 16 + #include <linux/io.h> 17 + #include <linux/mod_devicetable.h> 18 + #include <linux/platform_device.h> 20 19 #include <linux/spinlock.h> 20 + 21 21 #include <linux/pinctrl/machine.h> 22 22 #include <linux/pinctrl/pinconf.h> 23 23 #include <linux/pinctrl/pinconf-generic.h> 24 24 #include <linux/pinctrl/pinctrl.h> 25 25 #include <linux/pinctrl/pinmux.h> 26 + 26 27 #include "pinctrl-utils.h" 27 28 28 29 #define DRIVER_NAME "pinctrl-digicolor" ··· 249 248 chip->set = dc_gpio_set; 250 249 chip->base = -1; 251 250 chip->ngpio = PINS_COUNT; 252 - chip->of_gpio_n_cells = 2; 253 251 254 252 spin_lock_init(&pmap->lock); 255 253
+3 -2
drivers/pinctrl/pinctrl-mcp23s08_i2c.c
··· 8 8 9 9 #include "pinctrl-mcp23s08.h" 10 10 11 - static int mcp230xx_probe(struct i2c_client *client, const struct i2c_device_id *id) 11 + static int mcp230xx_probe(struct i2c_client *client) 12 12 { 13 + const struct i2c_device_id *id = i2c_client_get_device_id(client); 13 14 struct device *dev = &client->dev; 14 15 unsigned int type = id->driver_data; 15 16 struct mcp23s08 *mcp; ··· 101 100 .name = "mcp230xx", 102 101 .of_match_table = mcp23s08_i2c_of_match, 103 102 }, 104 - .probe = mcp230xx_probe, 103 + .probe_new = mcp230xx_probe, 105 104 .id_table = mcp230xx_id, 106 105 }; 107 106
+1
drivers/pinctrl/pinctrl-rockchip.c
··· 3045 3045 np_config = of_find_node_by_phandle(be32_to_cpup(phandle)); 3046 3046 ret = pinconf_generic_parse_dt_config(np_config, NULL, 3047 3047 &grp->data[j].configs, &grp->data[j].nconfigs); 3048 + of_node_put(np_config); 3048 3049 if (ret) 3049 3050 return ret; 3050 3051 }
+3 -3
drivers/pinctrl/pinctrl-sx150x.c
··· 1094 1094 .volatile_reg = sx150x_reg_volatile, 1095 1095 }; 1096 1096 1097 - static int sx150x_probe(struct i2c_client *client, 1098 - const struct i2c_device_id *id) 1097 + static int sx150x_probe(struct i2c_client *client) 1099 1098 { 1099 + const struct i2c_device_id *id = i2c_client_get_device_id(client); 1100 1100 static const u32 i2c_funcs = I2C_FUNC_SMBUS_BYTE_DATA | 1101 1101 I2C_FUNC_SMBUS_WRITE_WORD_DATA; 1102 1102 struct device *dev = &client->dev; ··· 1252 1252 .name = "sx150x-pinctrl", 1253 1253 .of_match_table = of_match_ptr(sx150x_of_match), 1254 1254 }, 1255 - .probe = sx150x_probe, 1255 + .probe_new = sx150x_probe, 1256 1256 .id_table = sx150x_id, 1257 1257 }; 1258 1258
-7
drivers/pinctrl/pinctrl-thunderbay.c
··· 1278 1278 return 0; 1279 1279 } 1280 1280 1281 - static int thunderbay_pinctrl_remove(struct platform_device *pdev) 1282 - { 1283 - /* thunderbay_pinctrl_remove function to clear the assigned memory */ 1284 - return 0; 1285 - } 1286 - 1287 1281 static struct platform_driver thunderbay_pinctrl_driver = { 1288 1282 .driver = { 1289 1283 .name = "thunderbay-pinctrl", 1290 1284 .of_match_table = thunderbay_pinctrl_match, 1291 1285 }, 1292 1286 .probe = thunderbay_pinctrl_probe, 1293 - .remove = thunderbay_pinctrl_remove, 1294 1287 }; 1295 1288 1296 1289 builtin_platform_driver(thunderbay_pinctrl_driver);
+1 -3
drivers/pinctrl/pinmux.c
··· 744 744 } 745 745 746 746 ret = pinctrl_get_group_selector(pctldev, gname); 747 - if (ret < 0) { 748 - dev_err(pctldev->dev, "failed to get group selector for %s", gname); 747 + if (ret < 0) 749 748 goto exit_free_buf; 750 - } 751 749 gsel = ret; 752 750 753 751 ret = pmxops->set_mux(pctldev, fsel, gsel);
+50
drivers/pinctrl/qcom/Kconfig
··· 48 48 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 49 49 Qualcomm TLMM block found in the Qualcomm IPQ8064 platform. 50 50 51 + config PINCTRL_IPQ5332 52 + tristate "Qualcomm Technologies Inc IPQ5332 pin controller driver" 53 + depends on OF 54 + depends on ARM64 || COMPILE_TEST 55 + depends on PINCTRL_MSM 56 + help 57 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 58 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 59 + Technologies Inc IPQ5332 platform. 60 + 51 61 config PINCTRL_IPQ8074 52 62 tristate "Qualcomm Technologies, Inc. IPQ8074 pin controller driver" 53 63 depends on OF ··· 257 247 Qualcomm GPIO and MPP blocks found in the Qualcomm PMIC's chips, 258 248 which are using SSBI for communication with SoC. Example PMIC's 259 249 devices are pm8058 and pm8921. 250 + 251 + config PINCTRL_QDU1000 252 + tristate "Qualcomm Tehcnologies Inc QDU1000/QRU1000 pin controller driver" 253 + depends on GPIOLIB && OF 254 + depends on ARM64 || COMPILE_TEST 255 + depends on PINCTRL_MSM 256 + help 257 + This is the pinctrl, pinmux, pinconf, and gpiolib driver for the 258 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 259 + Technologies Inc QDU1000 and QRU1000 platforms. 260 + 261 + config PINCTRL_SA8775P 262 + tristate "Qualcomm Technologies Inc SA8775P pin controller driver" 263 + depends on OF 264 + depends on ARM64 || COMPILE_TEST 265 + depends on PINCTRL_MSM 266 + help 267 + This is the pinctrl, pinmux and pinconf driver for the Qualcomm 268 + TLMM block found on the Qualcomm SA8775P platforms. 260 269 261 270 config PINCTRL_SC7180 262 271 tristate "Qualcomm Technologies Inc SC7180 pin controller driver" ··· 485 456 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 486 457 Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 487 458 (Low Power Island) found on the Qualcomm Technologies Inc SC8280XP platform. 459 + 460 + config PINCTRL_SM8550 461 + tristate "Qualcomm Technologies Inc SM8550 pin controller driver" 462 + depends on GPIOLIB 463 + depends on ARM64 || COMPILE_TEST 464 + depends on PINCTRL_MSM 465 + help 466 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 467 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 468 + Technologies Inc SM8550 platform. 469 + 470 + config PINCTRL_SM8550_LPASS_LPI 471 + tristate "Qualcomm Technologies Inc SM8550 LPASS LPI pin controller driver" 472 + depends on GPIOLIB 473 + depends on ARM64 || COMPILE_TEST 474 + depends on PINCTRL_LPASS_LPI 475 + help 476 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 477 + Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 478 + (Low Power Island) found on the Qualcomm Technologies Inc SM8550 479 + platform. 488 480 489 481 config PINCTRL_LPASS_LPI 490 482 tristate "Qualcomm Technologies Inc LPASS LPI pin controller driver"
+5
drivers/pinctrl/qcom/Makefile
··· 5 5 obj-$(CONFIG_PINCTRL_APQ8084) += pinctrl-apq8084.o 6 6 obj-$(CONFIG_PINCTRL_IPQ4019) += pinctrl-ipq4019.o 7 7 obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o 8 + obj-$(CONFIG_PINCTRL_IPQ5332) += pinctrl-ipq5332.o 8 9 obj-$(CONFIG_PINCTRL_IPQ8074) += pinctrl-ipq8074.o 9 10 obj-$(CONFIG_PINCTRL_IPQ6018) += pinctrl-ipq6018.o 10 11 obj-$(CONFIG_PINCTRL_MSM8226) += pinctrl-msm8226.o ··· 28 27 obj-$(CONFIG_PINCTRL_QCOM_SPMI_PMIC) += pinctrl-spmi-mpp.o 29 28 obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-gpio.o 30 29 obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-mpp.o 30 + obj-$(CONFIG_PINCTRL_QDU1000) += pinctrl-qdu1000.o 31 + obj-$(CONFIG_PINCTRL_SA8775P) += pinctrl-sa8775p.o 31 32 obj-$(CONFIG_PINCTRL_SC7180) += pinctrl-sc7180.o 32 33 obj-$(CONFIG_PINCTRL_SC7280) += pinctrl-sc7280.o 33 34 obj-$(CONFIG_PINCTRL_SC7280_LPASS_LPI) += pinctrl-sc7280-lpass-lpi.o ··· 50 47 obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o 51 48 obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o 52 49 obj-$(CONFIG_PINCTRL_SM8450_LPASS_LPI) += pinctrl-sm8450-lpass-lpi.o 50 + obj-$(CONFIG_PINCTRL_SM8550) += pinctrl-sm8550.o 51 + obj-$(CONFIG_PINCTRL_SM8550_LPASS_LPI) += pinctrl-sm8550-lpass-lpi.o 53 52 obj-$(CONFIG_PINCTRL_SC8280XP_LPASS_LPI) += pinctrl-sc8280xp-lpass-lpi.o 54 53 obj-$(CONFIG_PINCTRL_LPASS_LPI) += pinctrl-lpass-lpi.o
+861
drivers/pinctrl/qcom/pinctrl-ipq5332.c
··· 1 + // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + /* 3 + * Copyright (c) 2022-2023 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 + #include <linux/pinctrl/pinctrl.h> 10 + 11 + #include "pinctrl-msm.h" 12 + 13 + #define FUNCTION(fname) \ 14 + [msm_mux_##fname] = { \ 15 + .name = #fname, \ 16 + .groups = fname##_groups, \ 17 + .ngroups = ARRAY_SIZE(fname##_groups), \ 18 + } 19 + 20 + #define REG_SIZE 0x1000 21 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 22 + { \ 23 + .name = "gpio" #id, \ 24 + .pins = gpio##id##_pins, \ 25 + .npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins), \ 26 + .funcs = (int[]){ \ 27 + msm_mux_gpio, /* gpio mode */ \ 28 + msm_mux_##f1, \ 29 + msm_mux_##f2, \ 30 + msm_mux_##f3, \ 31 + msm_mux_##f4, \ 32 + msm_mux_##f5, \ 33 + msm_mux_##f6, \ 34 + msm_mux_##f7, \ 35 + msm_mux_##f8, \ 36 + msm_mux_##f9 \ 37 + }, \ 38 + .nfuncs = 10, \ 39 + .ctl_reg = REG_SIZE * id, \ 40 + .io_reg = 0x4 + REG_SIZE * id, \ 41 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 42 + .intr_status_reg = 0xc + REG_SIZE * id, \ 43 + .intr_target_reg = 0x8 + REG_SIZE * id, \ 44 + .mux_bit = 2, \ 45 + .pull_bit = 0, \ 46 + .drv_bit = 6, \ 47 + .oe_bit = 9, \ 48 + .in_bit = 0, \ 49 + .out_bit = 1, \ 50 + .intr_enable_bit = 0, \ 51 + .intr_status_bit = 0, \ 52 + .intr_target_bit = 5, \ 53 + .intr_target_kpss_val = 3, \ 54 + .intr_raw_status_bit = 4, \ 55 + .intr_polarity_bit = 1, \ 56 + .intr_detection_bit = 2, \ 57 + .intr_detection_width = 2, \ 58 + } 59 + 60 + static const struct pinctrl_pin_desc ipq5332_pins[] = { 61 + PINCTRL_PIN(0, "GPIO_0"), 62 + PINCTRL_PIN(1, "GPIO_1"), 63 + PINCTRL_PIN(2, "GPIO_2"), 64 + PINCTRL_PIN(3, "GPIO_3"), 65 + PINCTRL_PIN(4, "GPIO_4"), 66 + PINCTRL_PIN(5, "GPIO_5"), 67 + PINCTRL_PIN(6, "GPIO_6"), 68 + PINCTRL_PIN(7, "GPIO_7"), 69 + PINCTRL_PIN(8, "GPIO_8"), 70 + PINCTRL_PIN(9, "GPIO_9"), 71 + PINCTRL_PIN(10, "GPIO_10"), 72 + PINCTRL_PIN(11, "GPIO_11"), 73 + PINCTRL_PIN(12, "GPIO_12"), 74 + PINCTRL_PIN(13, "GPIO_13"), 75 + PINCTRL_PIN(14, "GPIO_14"), 76 + PINCTRL_PIN(15, "GPIO_15"), 77 + PINCTRL_PIN(16, "GPIO_16"), 78 + PINCTRL_PIN(17, "GPIO_17"), 79 + PINCTRL_PIN(18, "GPIO_18"), 80 + PINCTRL_PIN(19, "GPIO_19"), 81 + PINCTRL_PIN(20, "GPIO_20"), 82 + PINCTRL_PIN(21, "GPIO_21"), 83 + PINCTRL_PIN(22, "GPIO_22"), 84 + PINCTRL_PIN(23, "GPIO_23"), 85 + PINCTRL_PIN(24, "GPIO_24"), 86 + PINCTRL_PIN(25, "GPIO_25"), 87 + PINCTRL_PIN(26, "GPIO_26"), 88 + PINCTRL_PIN(27, "GPIO_27"), 89 + PINCTRL_PIN(28, "GPIO_28"), 90 + PINCTRL_PIN(29, "GPIO_29"), 91 + PINCTRL_PIN(30, "GPIO_30"), 92 + PINCTRL_PIN(31, "GPIO_31"), 93 + PINCTRL_PIN(32, "GPIO_32"), 94 + PINCTRL_PIN(33, "GPIO_33"), 95 + PINCTRL_PIN(34, "GPIO_34"), 96 + PINCTRL_PIN(35, "GPIO_35"), 97 + PINCTRL_PIN(36, "GPIO_36"), 98 + PINCTRL_PIN(37, "GPIO_37"), 99 + PINCTRL_PIN(38, "GPIO_38"), 100 + PINCTRL_PIN(39, "GPIO_39"), 101 + PINCTRL_PIN(40, "GPIO_40"), 102 + PINCTRL_PIN(41, "GPIO_41"), 103 + PINCTRL_PIN(42, "GPIO_42"), 104 + PINCTRL_PIN(43, "GPIO_43"), 105 + PINCTRL_PIN(44, "GPIO_44"), 106 + PINCTRL_PIN(45, "GPIO_45"), 107 + PINCTRL_PIN(46, "GPIO_46"), 108 + PINCTRL_PIN(47, "GPIO_47"), 109 + PINCTRL_PIN(48, "GPIO_48"), 110 + PINCTRL_PIN(49, "GPIO_49"), 111 + PINCTRL_PIN(50, "GPIO_50"), 112 + PINCTRL_PIN(51, "GPIO_51"), 113 + PINCTRL_PIN(52, "GPIO_52"), 114 + }; 115 + 116 + #define DECLARE_MSM_GPIO_PINS(pin) \ 117 + static const unsigned int gpio##pin##_pins[] = { pin } 118 + DECLARE_MSM_GPIO_PINS(0); 119 + DECLARE_MSM_GPIO_PINS(1); 120 + DECLARE_MSM_GPIO_PINS(2); 121 + DECLARE_MSM_GPIO_PINS(3); 122 + DECLARE_MSM_GPIO_PINS(4); 123 + DECLARE_MSM_GPIO_PINS(5); 124 + DECLARE_MSM_GPIO_PINS(6); 125 + DECLARE_MSM_GPIO_PINS(7); 126 + DECLARE_MSM_GPIO_PINS(8); 127 + DECLARE_MSM_GPIO_PINS(9); 128 + DECLARE_MSM_GPIO_PINS(10); 129 + DECLARE_MSM_GPIO_PINS(11); 130 + DECLARE_MSM_GPIO_PINS(12); 131 + DECLARE_MSM_GPIO_PINS(13); 132 + DECLARE_MSM_GPIO_PINS(14); 133 + DECLARE_MSM_GPIO_PINS(15); 134 + DECLARE_MSM_GPIO_PINS(16); 135 + DECLARE_MSM_GPIO_PINS(17); 136 + DECLARE_MSM_GPIO_PINS(18); 137 + DECLARE_MSM_GPIO_PINS(19); 138 + DECLARE_MSM_GPIO_PINS(20); 139 + DECLARE_MSM_GPIO_PINS(21); 140 + DECLARE_MSM_GPIO_PINS(22); 141 + DECLARE_MSM_GPIO_PINS(23); 142 + DECLARE_MSM_GPIO_PINS(24); 143 + DECLARE_MSM_GPIO_PINS(25); 144 + DECLARE_MSM_GPIO_PINS(26); 145 + DECLARE_MSM_GPIO_PINS(27); 146 + DECLARE_MSM_GPIO_PINS(28); 147 + DECLARE_MSM_GPIO_PINS(29); 148 + DECLARE_MSM_GPIO_PINS(30); 149 + DECLARE_MSM_GPIO_PINS(31); 150 + DECLARE_MSM_GPIO_PINS(32); 151 + DECLARE_MSM_GPIO_PINS(33); 152 + DECLARE_MSM_GPIO_PINS(34); 153 + DECLARE_MSM_GPIO_PINS(35); 154 + DECLARE_MSM_GPIO_PINS(36); 155 + DECLARE_MSM_GPIO_PINS(37); 156 + DECLARE_MSM_GPIO_PINS(38); 157 + DECLARE_MSM_GPIO_PINS(39); 158 + DECLARE_MSM_GPIO_PINS(40); 159 + DECLARE_MSM_GPIO_PINS(41); 160 + DECLARE_MSM_GPIO_PINS(42); 161 + DECLARE_MSM_GPIO_PINS(43); 162 + DECLARE_MSM_GPIO_PINS(44); 163 + DECLARE_MSM_GPIO_PINS(45); 164 + DECLARE_MSM_GPIO_PINS(46); 165 + DECLARE_MSM_GPIO_PINS(47); 166 + DECLARE_MSM_GPIO_PINS(48); 167 + DECLARE_MSM_GPIO_PINS(49); 168 + DECLARE_MSM_GPIO_PINS(50); 169 + DECLARE_MSM_GPIO_PINS(51); 170 + DECLARE_MSM_GPIO_PINS(52); 171 + 172 + enum ipq5332_functions { 173 + msm_mux_atest_char, 174 + msm_mux_atest_char0, 175 + msm_mux_atest_char1, 176 + msm_mux_atest_char2, 177 + msm_mux_atest_char3, 178 + msm_mux_atest_tic, 179 + msm_mux_audio_pri, 180 + msm_mux_audio_pri0, 181 + msm_mux_audio_pri1, 182 + msm_mux_audio_sec, 183 + msm_mux_audio_sec0, 184 + msm_mux_audio_sec1, 185 + msm_mux_blsp0_i2c, 186 + msm_mux_blsp0_spi, 187 + msm_mux_blsp0_uart0, 188 + msm_mux_blsp0_uart1, 189 + msm_mux_blsp1_i2c0, 190 + msm_mux_blsp1_i2c1, 191 + msm_mux_blsp1_spi0, 192 + msm_mux_blsp1_spi1, 193 + msm_mux_blsp1_uart0, 194 + msm_mux_blsp1_uart1, 195 + msm_mux_blsp1_uart2, 196 + msm_mux_blsp2_i2c0, 197 + msm_mux_blsp2_i2c1, 198 + msm_mux_blsp2_spi, 199 + msm_mux_blsp2_spi0, 200 + msm_mux_blsp2_spi1, 201 + msm_mux_core_voltage, 202 + msm_mux_cri_trng0, 203 + msm_mux_cri_trng1, 204 + msm_mux_cri_trng2, 205 + msm_mux_cri_trng3, 206 + msm_mux_cxc_clk, 207 + msm_mux_cxc_data, 208 + msm_mux_dbg_out, 209 + msm_mux_gcc_plltest, 210 + msm_mux_gcc_tlmm, 211 + msm_mux_gpio, 212 + msm_mux_lock_det, 213 + msm_mux_mac0, 214 + msm_mux_mac1, 215 + msm_mux_mdc0, 216 + msm_mux_mdc1, 217 + msm_mux_mdio0, 218 + msm_mux_mdio1, 219 + msm_mux_pc, 220 + msm_mux_pcie0_clk, 221 + msm_mux_pcie0_wake, 222 + msm_mux_pcie1_clk, 223 + msm_mux_pcie1_wake, 224 + msm_mux_pcie2_clk, 225 + msm_mux_pcie2_wake, 226 + msm_mux_pll_test, 227 + msm_mux_prng_rosc0, 228 + msm_mux_prng_rosc1, 229 + msm_mux_prng_rosc2, 230 + msm_mux_prng_rosc3, 231 + msm_mux_pta, 232 + msm_mux_pwm0, 233 + msm_mux_pwm1, 234 + msm_mux_pwm2, 235 + msm_mux_pwm3, 236 + msm_mux_qdss_cti_trig_in_a0, 237 + msm_mux_qdss_cti_trig_in_a1, 238 + msm_mux_qdss_cti_trig_in_b0, 239 + msm_mux_qdss_cti_trig_in_b1, 240 + msm_mux_qdss_cti_trig_out_a0, 241 + msm_mux_qdss_cti_trig_out_a1, 242 + msm_mux_qdss_cti_trig_out_b0, 243 + msm_mux_qdss_cti_trig_out_b1, 244 + msm_mux_qdss_traceclk_a, 245 + msm_mux_qdss_traceclk_b, 246 + msm_mux_qdss_tracectl_a, 247 + msm_mux_qdss_tracectl_b, 248 + msm_mux_qdss_tracedata_a, 249 + msm_mux_qdss_tracedata_b, 250 + msm_mux_qspi_data, 251 + msm_mux_qspi_clk, 252 + msm_mux_qspi_cs, 253 + msm_mux_resout, 254 + msm_mux_rx0, 255 + msm_mux_rx1, 256 + msm_mux_sdc_data, 257 + msm_mux_sdc_clk, 258 + msm_mux_sdc_cmd, 259 + msm_mux_tsens_max, 260 + msm_mux_wci_txd, 261 + msm_mux_wci_rxd, 262 + msm_mux_wsi_clk, 263 + msm_mux_wsi_clk3, 264 + msm_mux_wsi_data, 265 + msm_mux_wsi_data3, 266 + msm_mux_wsis_reset, 267 + msm_mux_xfem, 268 + msm_mux__, 269 + }; 270 + 271 + static const char * const gpio_groups[] = { 272 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 273 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 274 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 275 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 276 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 277 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 278 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 279 + "gpio50", "gpio51", "gpio52", 280 + }; 281 + 282 + static const char * const atest_char_groups[] = { 283 + "gpio46", 284 + }; 285 + 286 + static const char * const atest_char0_groups[] = { 287 + "gpio0", 288 + }; 289 + 290 + static const char * const atest_char1_groups[] = { 291 + "gpio1", 292 + }; 293 + 294 + static const char * const atest_char2_groups[] = { 295 + "gpio2", 296 + }; 297 + 298 + static const char * const atest_char3_groups[] = { 299 + "gpio3", 300 + }; 301 + 302 + static const char * const atest_tic_groups[] = { 303 + "gpio9", 304 + }; 305 + 306 + static const char * const audio_pri_groups[] = { 307 + "gpio29", "gpio30", "gpio31", "gpio32", 308 + }; 309 + 310 + static const char * const audio_pri0_groups[] = { 311 + "gpio34", "gpio34", 312 + }; 313 + 314 + static const char * const audio_pri1_groups[] = { 315 + "gpio43", "gpio43", 316 + }; 317 + 318 + static const char * const audio_sec_groups[] = { 319 + "gpio33", "gpio34", "gpio35", "gpio36", 320 + }; 321 + 322 + static const char * const audio_sec0_groups[] = { 323 + "gpio30", "gpio30", 324 + }; 325 + 326 + static const char * const audio_sec1_groups[] = { 327 + "gpio45", "gpio45", 328 + }; 329 + 330 + static const char * const blsp0_i2c_groups[] = { 331 + "gpio16", "gpio17", 332 + }; 333 + 334 + static const char * const blsp0_spi_groups[] = { 335 + "gpio14", "gpio15", "gpio16", "gpio17", 336 + }; 337 + 338 + static const char * const blsp0_uart0_groups[] = { 339 + "gpio18", "gpio19", 340 + }; 341 + 342 + static const char * const blsp0_uart1_groups[] = { 343 + "gpio27", "gpio28", 344 + }; 345 + 346 + static const char * const blsp1_i2c0_groups[] = { 347 + "gpio29", "gpio30", 348 + }; 349 + 350 + static const char * const blsp1_i2c1_groups[] = { 351 + "gpio40", "gpio41", 352 + }; 353 + 354 + static const char * const blsp1_spi0_groups[] = { 355 + "gpio29", "gpio30", "gpio31", "gpio32", 356 + }; 357 + 358 + static const char * const blsp1_spi1_groups[] = { 359 + "gpio25", "gpio26", "gpio27", "gpio28", 360 + }; 361 + 362 + static const char * const blsp1_uart0_groups[] = { 363 + "gpio14", "gpio15", "gpio16", "gpio17", 364 + }; 365 + 366 + static const char * const blsp1_uart1_groups[] = { 367 + "gpio25", "gpio26", "gpio27", "gpio28", 368 + }; 369 + 370 + static const char * const blsp1_uart2_groups[] = { 371 + "gpio33", "gpio34", "gpio35", "gpio36", 372 + }; 373 + 374 + static const char * const blsp2_i2c0_groups[] = { 375 + "gpio43", "gpio45", 376 + }; 377 + 378 + static const char * const blsp2_i2c1_groups[] = { 379 + "gpio33", "gpio34", 380 + }; 381 + 382 + static const char * const blsp2_spi_groups[] = { 383 + "gpio37", 384 + }; 385 + 386 + static const char * const blsp2_spi0_groups[] = { 387 + "gpio33", "gpio34", "gpio35", "gpio36", 388 + }; 389 + 390 + static const char * const blsp2_spi1_groups[] = { 391 + "gpio40", "gpio41", "gpio42", "gpio52", 392 + }; 393 + 394 + static const char * const core_voltage_groups[] = { 395 + "gpio21", "gpio23", 396 + }; 397 + 398 + static const char * const cri_trng0_groups[] = { 399 + "gpio17", 400 + }; 401 + 402 + static const char * const cri_trng1_groups[] = { 403 + "gpio18", 404 + }; 405 + 406 + static const char * const cri_trng2_groups[] = { 407 + "gpio19", 408 + }; 409 + 410 + static const char * const cri_trng3_groups[] = { 411 + "gpio20", 412 + }; 413 + 414 + static const char * const cxc_clk_groups[] = { 415 + "gpio49", 416 + }; 417 + 418 + static const char * const cxc_data_groups[] = { 419 + "gpio50", 420 + }; 421 + 422 + static const char * const dbg_out_groups[] = { 423 + "gpio48", 424 + }; 425 + 426 + static const char * const gcc_plltest_groups[] = { 427 + "gpio43", "gpio45", 428 + }; 429 + 430 + static const char * const gcc_tlmm_groups[] = { 431 + "gpio44", 432 + }; 433 + 434 + static const char * const lock_det_groups[] = { 435 + "gpio51", 436 + }; 437 + 438 + static const char * const mac0_groups[] = { 439 + "gpio18", 440 + }; 441 + 442 + static const char * const mac1_groups[] = { 443 + "gpio19", 444 + }; 445 + 446 + static const char * const mdc0_groups[] = { 447 + "gpio25", 448 + }; 449 + 450 + static const char * const mdc1_groups[] = { 451 + "gpio27", 452 + }; 453 + 454 + static const char * const mdio0_groups[] = { 455 + "gpio26", 456 + }; 457 + 458 + static const char * const mdio1_groups[] = { 459 + "gpio28", 460 + }; 461 + 462 + static const char * const pc_groups[] = { 463 + "gpio35", 464 + }; 465 + 466 + static const char * const pcie0_clk_groups[] = { 467 + "gpio37", 468 + }; 469 + 470 + static const char * const pcie0_wake_groups[] = { 471 + "gpio39", 472 + }; 473 + 474 + static const char * const pcie1_clk_groups[] = { 475 + "gpio46", 476 + }; 477 + 478 + static const char * const pcie1_wake_groups[] = { 479 + "gpio48", 480 + }; 481 + 482 + static const char * const pcie2_clk_groups[] = { 483 + "gpio43", 484 + }; 485 + 486 + static const char * const pcie2_wake_groups[] = { 487 + "gpio45", 488 + }; 489 + 490 + static const char * const pll_test_groups[] = { 491 + "gpio49", 492 + }; 493 + 494 + static const char * const prng_rosc0_groups[] = { 495 + "gpio22", 496 + }; 497 + 498 + static const char * const prng_rosc1_groups[] = { 499 + "gpio24", 500 + }; 501 + 502 + static const char * const prng_rosc2_groups[] = { 503 + "gpio25", 504 + }; 505 + 506 + static const char * const prng_rosc3_groups[] = { 507 + "gpio26", 508 + }; 509 + 510 + static const char * const pta_groups[] = { 511 + "gpio49", "gpio50", "gpio51", 512 + }; 513 + 514 + static const char * const pwm0_groups[] = { 515 + "gpio43", "gpio44", "gpio45", "gpio46", 516 + }; 517 + 518 + static const char * const pwm1_groups[] = { 519 + "gpio29", "gpio30", "gpio31", "gpio32", 520 + }; 521 + 522 + static const char * const pwm2_groups[] = { 523 + "gpio25", "gpio26", "gpio27", "gpio28", 524 + }; 525 + 526 + static const char * const pwm3_groups[] = { 527 + "gpio8", "gpio9", "gpio10", "gpio11", 528 + }; 529 + 530 + static const char * const qdss_cti_trig_in_a0_groups[] = { 531 + "gpio5", 532 + }; 533 + 534 + static const char * const qdss_cti_trig_in_a1_groups[] = { 535 + "gpio7", 536 + }; 537 + 538 + static const char * const qdss_cti_trig_in_b0_groups[] = { 539 + "gpio47", 540 + }; 541 + 542 + static const char * const qdss_cti_trig_in_b1_groups[] = { 543 + "gpio49", 544 + }; 545 + 546 + static const char * const qdss_cti_trig_out_a0_groups[] = { 547 + "gpio4", 548 + }; 549 + 550 + static const char * const qdss_cti_trig_out_a1_groups[] = { 551 + "gpio6", 552 + }; 553 + 554 + static const char * const qdss_cti_trig_out_b0_groups[] = { 555 + "gpio46", 556 + }; 557 + 558 + static const char * const qdss_cti_trig_out_b1_groups[] = { 559 + "gpio48", 560 + }; 561 + 562 + static const char * const qdss_traceclk_a_groups[] = { 563 + "gpio8", 564 + }; 565 + 566 + static const char * const qdss_traceclk_b_groups[] = { 567 + "gpio45", 568 + }; 569 + 570 + static const char * const qdss_tracectl_a_groups[] = { 571 + "gpio9", 572 + }; 573 + 574 + static const char * const qdss_tracectl_b_groups[] = { 575 + "gpio44", 576 + }; 577 + 578 + static const char * const qdss_tracedata_a_groups[] = { 579 + "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16", 580 + "gpio17", "gpio18", "gpio19", "gpio20", "gpio22", "gpio24", "gpio25", 581 + "gpio26", "gpio27", 582 + }; 583 + 584 + static const char * const qdss_tracedata_b_groups[] = { 585 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 586 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 587 + "gpio43", "gpio52", 588 + }; 589 + 590 + static const char * const qspi_clk_groups[] = { 591 + "gpio13", 592 + }; 593 + 594 + static const char * const qspi_cs_groups[] = { 595 + "gpio12", 596 + }; 597 + 598 + static const char * const qspi_data_groups[] = { 599 + "gpio8", "gpio9", "gpio10", "gpio11", 600 + }; 601 + 602 + static const char * const resout_groups[] = { 603 + "gpio20", 604 + }; 605 + 606 + static const char * const rx0_groups[] = { 607 + "gpio48", 608 + }; 609 + 610 + static const char * const rx1_groups[] = { 611 + "gpio45", 612 + }; 613 + 614 + static const char * const sdc_clk_groups[] = { 615 + "gpio13", 616 + }; 617 + 618 + static const char * const sdc_cmd_groups[] = { 619 + "gpio12", 620 + }; 621 + 622 + static const char * const sdc_data_groups[] = { 623 + "gpio8", "gpio9", "gpio10", "gpio11", 624 + }; 625 + 626 + static const char * const tsens_max_groups[] = { 627 + "gpio28", 628 + }; 629 + 630 + static const char * const wci_txd_groups[] = { 631 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 632 + "gpio36", "gpio43", "gpio45", 633 + }; 634 + 635 + static const char * const wci_rxd_groups[] = { 636 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 637 + "gpio35", "gpio36", "gpio43", "gpio45", 638 + }; 639 + 640 + static const char * const wsi_clk_groups[] = { 641 + "gpio40", "gpio42", 642 + }; 643 + 644 + static const char * const wsi_clk3_groups[] = { 645 + "gpio43", 646 + }; 647 + 648 + static const char * const wsi_data_groups[] = { 649 + "gpio41", "gpio52", 650 + }; 651 + 652 + static const char * const wsi_data3_groups[] = { 653 + "gpio44", 654 + }; 655 + 656 + static const char * const wsis_reset_groups[] = { 657 + "gpio41", 658 + }; 659 + 660 + static const char * const xfem_groups[] = { 661 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 662 + }; 663 + 664 + static const struct msm_function ipq5332_functions[] = { 665 + FUNCTION(atest_char), 666 + FUNCTION(atest_char0), 667 + FUNCTION(atest_char1), 668 + FUNCTION(atest_char2), 669 + FUNCTION(atest_char3), 670 + FUNCTION(atest_tic), 671 + FUNCTION(audio_pri), 672 + FUNCTION(audio_pri0), 673 + FUNCTION(audio_pri1), 674 + FUNCTION(audio_sec), 675 + FUNCTION(audio_sec0), 676 + FUNCTION(audio_sec1), 677 + FUNCTION(blsp0_i2c), 678 + FUNCTION(blsp0_spi), 679 + FUNCTION(blsp0_uart0), 680 + FUNCTION(blsp0_uart1), 681 + FUNCTION(blsp1_i2c0), 682 + FUNCTION(blsp1_i2c1), 683 + FUNCTION(blsp1_spi0), 684 + FUNCTION(blsp1_spi1), 685 + FUNCTION(blsp1_uart0), 686 + FUNCTION(blsp1_uart1), 687 + FUNCTION(blsp1_uart2), 688 + FUNCTION(blsp2_i2c0), 689 + FUNCTION(blsp2_i2c1), 690 + FUNCTION(blsp2_spi), 691 + FUNCTION(blsp2_spi0), 692 + FUNCTION(blsp2_spi1), 693 + FUNCTION(core_voltage), 694 + FUNCTION(cri_trng0), 695 + FUNCTION(cri_trng1), 696 + FUNCTION(cri_trng2), 697 + FUNCTION(cri_trng3), 698 + FUNCTION(cxc_clk), 699 + FUNCTION(cxc_data), 700 + FUNCTION(dbg_out), 701 + FUNCTION(gcc_plltest), 702 + FUNCTION(gcc_tlmm), 703 + FUNCTION(gpio), 704 + FUNCTION(lock_det), 705 + FUNCTION(mac0), 706 + FUNCTION(mac1), 707 + FUNCTION(mdc0), 708 + FUNCTION(mdc1), 709 + FUNCTION(mdio0), 710 + FUNCTION(mdio1), 711 + FUNCTION(pc), 712 + FUNCTION(pcie0_clk), 713 + FUNCTION(pcie0_wake), 714 + FUNCTION(pcie1_clk), 715 + FUNCTION(pcie1_wake), 716 + FUNCTION(pcie2_clk), 717 + FUNCTION(pcie2_wake), 718 + FUNCTION(pll_test), 719 + FUNCTION(prng_rosc0), 720 + FUNCTION(prng_rosc1), 721 + FUNCTION(prng_rosc2), 722 + FUNCTION(prng_rosc3), 723 + FUNCTION(pta), 724 + FUNCTION(pwm0), 725 + FUNCTION(pwm1), 726 + FUNCTION(pwm2), 727 + FUNCTION(pwm3), 728 + FUNCTION(qdss_cti_trig_in_a0), 729 + FUNCTION(qdss_cti_trig_in_a1), 730 + FUNCTION(qdss_cti_trig_in_b0), 731 + FUNCTION(qdss_cti_trig_in_b1), 732 + FUNCTION(qdss_cti_trig_out_a0), 733 + FUNCTION(qdss_cti_trig_out_a1), 734 + FUNCTION(qdss_cti_trig_out_b0), 735 + FUNCTION(qdss_cti_trig_out_b1), 736 + FUNCTION(qdss_traceclk_a), 737 + FUNCTION(qdss_traceclk_b), 738 + FUNCTION(qdss_tracectl_a), 739 + FUNCTION(qdss_tracectl_b), 740 + FUNCTION(qdss_tracedata_a), 741 + FUNCTION(qdss_tracedata_b), 742 + FUNCTION(qspi_data), 743 + FUNCTION(qspi_clk), 744 + FUNCTION(qspi_cs), 745 + FUNCTION(resout), 746 + FUNCTION(rx0), 747 + FUNCTION(rx1), 748 + FUNCTION(sdc_data), 749 + FUNCTION(sdc_clk), 750 + FUNCTION(sdc_cmd), 751 + FUNCTION(tsens_max), 752 + FUNCTION(wci_txd), 753 + FUNCTION(wci_rxd), 754 + FUNCTION(wsi_clk), 755 + FUNCTION(wsi_clk3), 756 + FUNCTION(wsi_data), 757 + FUNCTION(wsi_data3), 758 + FUNCTION(wsis_reset), 759 + FUNCTION(xfem), 760 + }; 761 + 762 + static const struct msm_pingroup ipq5332_groups[] = { 763 + PINGROUP(0, atest_char0, wci_txd, wci_rxd, xfem, _, _, _, _, _), 764 + PINGROUP(1, atest_char1, wci_txd, wci_rxd, xfem, _, _, _, _, _), 765 + PINGROUP(2, atest_char2, wci_txd, wci_rxd, xfem, _, _, _, _, _), 766 + PINGROUP(3, atest_char3, wci_txd, wci_rxd, xfem, _, _, _, _, _), 767 + PINGROUP(4, qdss_cti_trig_out_a0, wci_txd, wci_rxd, xfem, _, _, _, _, _), 768 + PINGROUP(5, qdss_cti_trig_in_a0, wci_txd, wci_rxd, xfem, _, _, _, _, _), 769 + PINGROUP(6, qdss_cti_trig_out_a1, wci_txd, wci_rxd, xfem, _, _, _, _, _), 770 + PINGROUP(7, qdss_cti_trig_in_a1, wci_txd, wci_rxd, xfem, _, _, _, _, _), 771 + PINGROUP(8, sdc_data, qspi_data, pwm3, qdss_traceclk_a, _, _, _, _, _), 772 + PINGROUP(9, sdc_data, qspi_data, pwm3, qdss_tracectl_a, _, atest_tic, _, _, _), 773 + PINGROUP(10, sdc_data, qspi_data, pwm3, qdss_tracedata_a, _, _, _, _, _), 774 + PINGROUP(11, sdc_data, qspi_data, pwm3, qdss_tracedata_a, _, _, _, _, _), 775 + PINGROUP(12, sdc_cmd, qspi_cs, qdss_tracedata_a, _, _, _, _, _, _), 776 + PINGROUP(13, sdc_clk, qspi_clk, qdss_tracedata_a, _, _, _, _, _, _), 777 + PINGROUP(14, blsp0_spi, blsp1_uart0, qdss_tracedata_a, _, _, _, _, _, _), 778 + PINGROUP(15, blsp0_spi, blsp1_uart0, qdss_tracedata_a, _, _, _, _, _, _), 779 + PINGROUP(16, blsp0_spi, blsp0_i2c, blsp1_uart0, _, qdss_tracedata_a, _, _, _, _), 780 + PINGROUP(17, blsp0_spi, blsp0_i2c, blsp1_uart0, _, cri_trng0, qdss_tracedata_a, _, _, _), 781 + PINGROUP(18, blsp0_uart0, mac0, _, cri_trng1, qdss_tracedata_a, _, _, _, _), 782 + PINGROUP(19, blsp0_uart0, mac1, _, cri_trng2, qdss_tracedata_a, _, _, _, _), 783 + PINGROUP(20, resout, _, cri_trng3, qdss_tracedata_a, _, _, _, _, _), 784 + PINGROUP(21, core_voltage, _, _, _, _, _, _, _, _), 785 + PINGROUP(22, _, prng_rosc0, qdss_tracedata_a, _, _, _, _, _, _), 786 + PINGROUP(23, core_voltage, _, _, _, _, _, _, _, _), 787 + PINGROUP(24, _, prng_rosc1, qdss_tracedata_a, _, _, _, _, _, _), 788 + PINGROUP(25, mdc0, blsp1_uart1, blsp1_spi1, pwm2, _, _, prng_rosc2, qdss_tracedata_a, _), 789 + PINGROUP(26, mdio0, blsp1_uart1, blsp1_spi1, pwm2, _, _, prng_rosc3, qdss_tracedata_a, _), 790 + PINGROUP(27, mdc1, blsp0_uart1, blsp1_uart1, blsp1_spi1, pwm2, _, _, qdss_tracedata_a, _), 791 + PINGROUP(28, mdio1, blsp0_uart1, blsp1_uart1, blsp1_spi1, pwm2, _, tsens_max, _, _), 792 + PINGROUP(29, audio_pri, blsp1_spi0, blsp1_i2c0, pwm1, _, qdss_tracedata_b, _, _, _), 793 + PINGROUP(30, audio_pri, blsp1_spi0, blsp1_i2c0, pwm1, audio_sec0, audio_sec0, _, qdss_tracedata_b, _), 794 + PINGROUP(31, audio_pri, blsp1_spi0, pwm1, _, qdss_tracedata_b, _, _, _, _), 795 + PINGROUP(32, audio_pri, blsp1_spi0, pwm1, _, qdss_tracedata_b, _, _, _, _), 796 + PINGROUP(33, audio_sec, blsp1_uart2, blsp2_i2c1, blsp2_spi0, _, qdss_tracedata_b, _, _, _), 797 + PINGROUP(34, audio_sec, blsp1_uart2, blsp2_i2c1, blsp2_spi0, audio_pri0, audio_pri0, _, qdss_tracedata_b, _), 798 + PINGROUP(35, audio_sec, blsp1_uart2, pc, wci_rxd, blsp2_spi0, _, qdss_tracedata_b, _, _), 799 + PINGROUP(36, audio_sec, blsp1_uart2, wci_txd, wci_rxd, blsp2_spi0, _, qdss_tracedata_b, _, _), 800 + PINGROUP(37, pcie0_clk, blsp2_spi, _, qdss_tracedata_b, _, _, _, _, _), 801 + PINGROUP(38, _, qdss_tracedata_b, _, _, _, _, _, _, _), 802 + PINGROUP(39, pcie0_wake, _, qdss_tracedata_b, _, _, _, _, _, _), 803 + PINGROUP(40, wsi_clk, blsp1_i2c1, blsp2_spi1, _, _, qdss_tracedata_b, _, _, _), 804 + PINGROUP(41, wsi_data, blsp1_i2c1, blsp2_spi1, _, _, qdss_tracedata_b, _, wsis_reset, _), 805 + PINGROUP(42, wsi_clk, blsp2_spi1, _, qdss_tracedata_b, _, _, _, _, _), 806 + PINGROUP(43, pcie2_clk, wci_txd, wci_rxd, blsp2_i2c0, pwm0, audio_pri1, audio_pri1, _, gcc_plltest), 807 + PINGROUP(44, pwm0, _, gcc_tlmm, qdss_tracectl_b, _, wsi_data3, _, _, _), 808 + PINGROUP(45, pcie2_wake, wci_txd, wci_rxd, blsp2_i2c0, rx1, pwm0, audio_sec1, audio_sec1, _), 809 + PINGROUP(46, pcie1_clk, atest_char, pwm0, _, qdss_cti_trig_out_b0, _, _, _, _), 810 + PINGROUP(47, _, qdss_cti_trig_in_b0, _, _, _, _, _, _, _), 811 + PINGROUP(48, pcie1_wake, rx0, dbg_out, qdss_cti_trig_out_b1, _, _, _, _, _), 812 + PINGROUP(49, pta, cxc_clk, pll_test, _, qdss_cti_trig_in_b1, _, _, _, _), 813 + PINGROUP(50, pta, cxc_data, _, _, _, _, _, _, _), 814 + PINGROUP(51, pta, lock_det, _, _, _, _, _, _, _), 815 + PINGROUP(52, wsi_data, blsp2_spi1, _, qdss_tracedata_b, _, _, _, _, _), 816 + }; 817 + 818 + static const struct msm_pinctrl_soc_data ipq5332_pinctrl = { 819 + .pins = ipq5332_pins, 820 + .npins = ARRAY_SIZE(ipq5332_pins), 821 + .functions = ipq5332_functions, 822 + .nfunctions = ARRAY_SIZE(ipq5332_functions), 823 + .groups = ipq5332_groups, 824 + .ngroups = ARRAY_SIZE(ipq5332_groups), 825 + .ngpios = 53, 826 + }; 827 + 828 + static int ipq5332_pinctrl_probe(struct platform_device *pdev) 829 + { 830 + return msm_pinctrl_probe(pdev, &ipq5332_pinctrl); 831 + } 832 + 833 + static const struct of_device_id ipq5332_pinctrl_of_match[] = { 834 + { .compatible = "qcom,ipq5332-tlmm", }, 835 + { }, 836 + }; 837 + MODULE_DEVICE_TABLE(of, ipq5332_pinctrl_of_match); 838 + 839 + static struct platform_driver ipq5332_pinctrl_driver = { 840 + .driver = { 841 + .name = "ipq5332-tlmm", 842 + .of_match_table = ipq5332_pinctrl_of_match, 843 + }, 844 + .probe = ipq5332_pinctrl_probe, 845 + .remove = msm_pinctrl_remove, 846 + }; 847 + 848 + static int __init ipq5332_pinctrl_init(void) 849 + { 850 + return platform_driver_register(&ipq5332_pinctrl_driver); 851 + } 852 + arch_initcall(ipq5332_pinctrl_init); 853 + 854 + static void __exit ipq5332_pinctrl_exit(void) 855 + { 856 + platform_driver_unregister(&ipq5332_pinctrl_driver); 857 + } 858 + module_exit(ipq5332_pinctrl_exit); 859 + 860 + MODULE_DESCRIPTION("QTI IPQ5332 TLMM driver"); 861 + MODULE_LICENSE("GPL");
-1
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
··· 430 430 pctrl->chip.base = -1; 431 431 pctrl->chip.ngpio = data->npins; 432 432 pctrl->chip.label = dev_name(dev); 433 - pctrl->chip.of_gpio_n_cells = 2; 434 433 pctrl->chip.can_sleep = false; 435 434 436 435 mutex_init(&pctrl->slew_access_lock);
+8 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 310 310 case PIN_CONFIG_BIAS_PULL_UP: 311 311 *bit = g->pull_bit; 312 312 *mask = 3; 313 + if (g->i2c_pull_bit) 314 + *mask |= BIT(g->i2c_pull_bit) >> *bit; 313 315 break; 314 316 case PIN_CONFIG_DRIVE_OPEN_DRAIN: 315 317 *bit = g->od_bit; ··· 338 336 #define MSM_KEEPER 2 339 337 #define MSM_PULL_UP_NO_KEEPER 2 340 338 #define MSM_PULL_UP 3 339 + #define MSM_I2C_STRONG_PULL_UP 2200 341 340 342 341 static unsigned msm_regval_to_drive(u32 val) 343 342 { ··· 390 387 case PIN_CONFIG_BIAS_PULL_UP: 391 388 if (pctrl->soc->pull_no_keeper) 392 389 arg = arg == MSM_PULL_UP_NO_KEEPER; 390 + else if (arg & BIT(g->i2c_pull_bit)) 391 + arg = MSM_I2C_STRONG_PULL_UP; 393 392 else 394 393 arg = arg == MSM_PULL_UP; 395 394 if (!arg) ··· 472 467 case PIN_CONFIG_BIAS_PULL_UP: 473 468 if (pctrl->soc->pull_no_keeper) 474 469 arg = MSM_PULL_UP_NO_KEEPER; 470 + else if (g->i2c_pull_bit && arg == MSM_I2C_STRONG_PULL_UP) 471 + arg = BIT(g->i2c_pull_bit) | MSM_PULL_UP; 475 472 else 476 473 arg = MSM_PULL_UP; 477 474 break; ··· 1357 1350 girq = &chip->irq; 1358 1351 gpio_irq_chip_set_chip(girq, &msm_gpio_irq_chip); 1359 1352 girq->parent_handler = msm_gpio_irq_handler; 1360 - girq->fwnode = pctrl->dev->fwnode; 1353 + girq->fwnode = dev_fwnode(pctrl->dev); 1361 1354 girq->num_parents = 1; 1362 1355 girq->parents = devm_kcalloc(pctrl->dev, 1, sizeof(*girq->parents), 1363 1356 GFP_KERNEL);
+1
drivers/pinctrl/qcom/pinctrl-msm.h
··· 80 80 81 81 unsigned pull_bit:5; 82 82 unsigned drv_bit:5; 83 + unsigned i2c_pull_bit:5; 83 84 84 85 unsigned od_bit:5; 85 86 unsigned egpio_enable:5;
+9 -2
drivers/pinctrl/qcom/pinctrl-msm8226.c
··· 362 362 MSM_MUX_cam_mclk0, 363 363 MSM_MUX_cam_mclk1, 364 364 MSM_MUX_cci_i2c0, 365 + MSM_MUX_gp0_clk, 366 + MSM_MUX_gp1_clk, 365 367 MSM_MUX_gpio, 366 368 MSM_MUX_sdc3, 367 369 MSM_MUX_wlan, ··· 449 447 static const char * const cam_mclk0_groups[] = { "gpio26" }; 450 448 static const char * const cam_mclk1_groups[] = { "gpio27" }; 451 449 450 + static const char * const gp0_clk_groups[] = { "gpio33" }; 451 + static const char * const gp1_clk_groups[] = { "gpio34" }; 452 + 452 453 static const char * const sdc3_groups[] = { 453 454 "gpio39", "gpio40", "gpio41", "gpio42", "gpio43", "gpio44" 454 455 }; ··· 485 480 FUNCTION(cam_mclk0), 486 481 FUNCTION(cam_mclk1), 487 482 FUNCTION(cci_i2c0), 483 + FUNCTION(gp0_clk), 484 + FUNCTION(gp1_clk), 488 485 FUNCTION(gpio), 489 486 FUNCTION(sdc3), 490 487 FUNCTION(wlan), ··· 526 519 PINGROUP(30, cci_i2c0, NA, NA, NA, NA, NA, NA), 527 520 PINGROUP(31, NA, NA, NA, NA, NA, NA, NA), 528 521 PINGROUP(32, NA, NA, NA, NA, NA, NA, NA), 529 - PINGROUP(33, NA, NA, NA, NA, NA, NA, NA), 530 - PINGROUP(34, NA, NA, NA, NA, NA, NA, NA), 522 + PINGROUP(33, NA, NA, gp0_clk, NA, NA, NA, NA), 523 + PINGROUP(34, NA, NA, gp1_clk, NA, NA, NA, NA), 531 524 PINGROUP(35, NA, NA, NA, NA, NA, NA, NA), 532 525 PINGROUP(36, NA, NA, NA, NA, NA, NA, NA), 533 526 PINGROUP(37, NA, NA, NA, NA, NA, NA, NA),
+4 -4
drivers/pinctrl/qcom/pinctrl-msm8976.c
··· 733 733 "gpio74", 734 734 }; 735 735 static const char * const wcss_bt_groups[] = { 736 - "gpio39", "gpio47", "gpio88", 736 + "gpio39", "gpio47", "gpio48", 737 737 }; 738 738 static const char * const sdc3_groups[] = { 739 739 "gpio39", "gpio40", "gpio41", ··· 958 958 PINGROUP(37, NA, NA, NA, qdss_tracedata_b, NA, NA, NA, NA, NA), 959 959 PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b, NA), 960 960 PINGROUP(39, wcss_bt, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 961 - PINGROUP(40, wcss_wlan, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 962 - PINGROUP(41, wcss_wlan, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 963 - PINGROUP(42, wcss_wlan, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 961 + PINGROUP(40, wcss_wlan2, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 962 + PINGROUP(41, wcss_wlan1, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 963 + PINGROUP(42, wcss_wlan0, sdc3, NA, qdss_tracedata_a, NA, NA, NA, NA, NA), 964 964 PINGROUP(43, wcss_wlan, sdc3, NA, NA, qdss_tracedata_a, NA, NA, NA, NA), 965 965 PINGROUP(44, wcss_wlan, sdc3, NA, NA, NA, NA, NA, NA, NA), 966 966 PINGROUP(45, wcss_fm, NA, qdss_tracectl_a, NA, NA, NA, NA, NA, NA),
+1274
drivers/pinctrl/qcom/pinctrl-qdu1000.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2021, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2022 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 + #include <linux/pinctrl/pinctrl.h> 11 + 12 + #include "pinctrl-msm.h" 13 + 14 + #define FUNCTION(fname) \ 15 + [msm_mux_##fname] = { \ 16 + .name = #fname, \ 17 + .groups = fname##_groups, \ 18 + .ngroups = ARRAY_SIZE(fname##_groups), \ 19 + } 20 + 21 + #define REG_BASE 0x100000 22 + #define REG_SIZE 0x1000 23 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 24 + { \ 25 + .name = "gpio" #id, \ 26 + .pins = gpio##id##_pins, \ 27 + .npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins), \ 28 + .funcs = (int[]){ \ 29 + msm_mux_gpio, /* gpio mode */ \ 30 + msm_mux_##f1, \ 31 + msm_mux_##f2, \ 32 + msm_mux_##f3, \ 33 + msm_mux_##f4, \ 34 + msm_mux_##f5, \ 35 + msm_mux_##f6, \ 36 + msm_mux_##f7, \ 37 + msm_mux_##f8, \ 38 + msm_mux_##f9 \ 39 + }, \ 40 + .nfuncs = 10, \ 41 + .ctl_reg = REG_BASE + REG_SIZE * id, \ 42 + .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \ 43 + .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 44 + .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \ 45 + .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 46 + .mux_bit = 2, \ 47 + .pull_bit = 0, \ 48 + .drv_bit = 6, \ 49 + .oe_bit = 9, \ 50 + .in_bit = 0, \ 51 + .out_bit = 1, \ 52 + .intr_enable_bit = 0, \ 53 + .intr_status_bit = 0, \ 54 + .intr_target_bit = 5, \ 55 + .intr_target_kpss_val = 3, \ 56 + .intr_raw_status_bit = 4, \ 57 + .intr_polarity_bit = 1, \ 58 + .intr_detection_bit = 2, \ 59 + .intr_detection_width = 2, \ 60 + } 61 + 62 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 63 + { \ 64 + .name = #pg_name, \ 65 + .pins = pg_name##_pins, \ 66 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 67 + .ctl_reg = REG_BASE + ctl, \ 68 + .io_reg = 0, \ 69 + .intr_cfg_reg = 0, \ 70 + .intr_status_reg = 0, \ 71 + .intr_target_reg = 0, \ 72 + .mux_bit = -1, \ 73 + .pull_bit = pull, \ 74 + .drv_bit = drv, \ 75 + .oe_bit = -1, \ 76 + .in_bit = -1, \ 77 + .out_bit = -1, \ 78 + .intr_enable_bit = -1, \ 79 + .intr_status_bit = -1, \ 80 + .intr_target_bit = -1, \ 81 + .intr_raw_status_bit = -1, \ 82 + .intr_polarity_bit = -1, \ 83 + .intr_detection_bit = -1, \ 84 + .intr_detection_width = -1, \ 85 + } 86 + 87 + #define UFS_RESET(pg_name, offset) \ 88 + { \ 89 + .name = #pg_name, \ 90 + .pins = pg_name##_pins, \ 91 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 92 + .ctl_reg = offset, \ 93 + .io_reg = offset + 0x4, \ 94 + .intr_cfg_reg = 0, \ 95 + .intr_status_reg = 0, \ 96 + .intr_target_reg = 0, \ 97 + .mux_bit = -1, \ 98 + .pull_bit = 3, \ 99 + .drv_bit = 0, \ 100 + .oe_bit = -1, \ 101 + .in_bit = -1, \ 102 + .out_bit = 0, \ 103 + .intr_enable_bit = -1, \ 104 + .intr_status_bit = -1, \ 105 + .intr_target_bit = -1, \ 106 + .intr_raw_status_bit = -1, \ 107 + .intr_polarity_bit = -1, \ 108 + .intr_detection_bit = -1, \ 109 + .intr_detection_width = -1, \ 110 + } 111 + 112 + #define QUP_I3C(qup_mode, qup_offset) \ 113 + { \ 114 + .mode = qup_mode, \ 115 + .offset = qup_offset, \ 116 + } 117 + 118 + static const struct pinctrl_pin_desc qdu1000_pins[] = { 119 + PINCTRL_PIN(0, "GPIO_0"), 120 + PINCTRL_PIN(1, "GPIO_1"), 121 + PINCTRL_PIN(2, "GPIO_2"), 122 + PINCTRL_PIN(3, "GPIO_3"), 123 + PINCTRL_PIN(4, "GPIO_4"), 124 + PINCTRL_PIN(5, "GPIO_5"), 125 + PINCTRL_PIN(6, "GPIO_6"), 126 + PINCTRL_PIN(7, "GPIO_7"), 127 + PINCTRL_PIN(8, "GPIO_8"), 128 + PINCTRL_PIN(9, "GPIO_9"), 129 + PINCTRL_PIN(10, "GPIO_10"), 130 + PINCTRL_PIN(11, "GPIO_11"), 131 + PINCTRL_PIN(12, "GPIO_12"), 132 + PINCTRL_PIN(13, "GPIO_13"), 133 + PINCTRL_PIN(14, "GPIO_14"), 134 + PINCTRL_PIN(15, "GPIO_15"), 135 + PINCTRL_PIN(16, "GPIO_16"), 136 + PINCTRL_PIN(17, "GPIO_17"), 137 + PINCTRL_PIN(18, "GPIO_18"), 138 + PINCTRL_PIN(19, "GPIO_19"), 139 + PINCTRL_PIN(20, "GPIO_20"), 140 + PINCTRL_PIN(21, "GPIO_21"), 141 + PINCTRL_PIN(22, "GPIO_22"), 142 + PINCTRL_PIN(23, "GPIO_23"), 143 + PINCTRL_PIN(24, "GPIO_24"), 144 + PINCTRL_PIN(25, "GPIO_25"), 145 + PINCTRL_PIN(26, "GPIO_26"), 146 + PINCTRL_PIN(27, "GPIO_27"), 147 + PINCTRL_PIN(28, "GPIO_28"), 148 + PINCTRL_PIN(29, "GPIO_29"), 149 + PINCTRL_PIN(30, "GPIO_30"), 150 + PINCTRL_PIN(31, "GPIO_31"), 151 + PINCTRL_PIN(32, "GPIO_32"), 152 + PINCTRL_PIN(33, "GPIO_33"), 153 + PINCTRL_PIN(34, "GPIO_34"), 154 + PINCTRL_PIN(35, "GPIO_35"), 155 + PINCTRL_PIN(36, "GPIO_36"), 156 + PINCTRL_PIN(37, "GPIO_37"), 157 + PINCTRL_PIN(38, "GPIO_38"), 158 + PINCTRL_PIN(39, "GPIO_39"), 159 + PINCTRL_PIN(40, "GPIO_40"), 160 + PINCTRL_PIN(41, "GPIO_41"), 161 + PINCTRL_PIN(42, "GPIO_42"), 162 + PINCTRL_PIN(43, "GPIO_43"), 163 + PINCTRL_PIN(44, "GPIO_44"), 164 + PINCTRL_PIN(45, "GPIO_45"), 165 + PINCTRL_PIN(46, "GPIO_46"), 166 + PINCTRL_PIN(47, "GPIO_47"), 167 + PINCTRL_PIN(48, "GPIO_48"), 168 + PINCTRL_PIN(49, "GPIO_49"), 169 + PINCTRL_PIN(50, "GPIO_50"), 170 + PINCTRL_PIN(51, "GPIO_51"), 171 + PINCTRL_PIN(52, "GPIO_52"), 172 + PINCTRL_PIN(53, "GPIO_53"), 173 + PINCTRL_PIN(54, "GPIO_54"), 174 + PINCTRL_PIN(55, "GPIO_55"), 175 + PINCTRL_PIN(56, "GPIO_56"), 176 + PINCTRL_PIN(57, "GPIO_57"), 177 + PINCTRL_PIN(58, "GPIO_58"), 178 + PINCTRL_PIN(59, "GPIO_59"), 179 + PINCTRL_PIN(60, "GPIO_60"), 180 + PINCTRL_PIN(61, "GPIO_61"), 181 + PINCTRL_PIN(62, "GPIO_62"), 182 + PINCTRL_PIN(63, "GPIO_63"), 183 + PINCTRL_PIN(64, "GPIO_64"), 184 + PINCTRL_PIN(65, "GPIO_65"), 185 + PINCTRL_PIN(66, "GPIO_66"), 186 + PINCTRL_PIN(67, "GPIO_67"), 187 + PINCTRL_PIN(68, "GPIO_68"), 188 + PINCTRL_PIN(69, "GPIO_69"), 189 + PINCTRL_PIN(70, "GPIO_70"), 190 + PINCTRL_PIN(71, "GPIO_71"), 191 + PINCTRL_PIN(72, "GPIO_72"), 192 + PINCTRL_PIN(73, "GPIO_73"), 193 + PINCTRL_PIN(74, "GPIO_74"), 194 + PINCTRL_PIN(75, "GPIO_75"), 195 + PINCTRL_PIN(76, "GPIO_76"), 196 + PINCTRL_PIN(77, "GPIO_77"), 197 + PINCTRL_PIN(78, "GPIO_78"), 198 + PINCTRL_PIN(79, "GPIO_79"), 199 + PINCTRL_PIN(80, "GPIO_80"), 200 + PINCTRL_PIN(81, "GPIO_81"), 201 + PINCTRL_PIN(82, "GPIO_82"), 202 + PINCTRL_PIN(83, "GPIO_83"), 203 + PINCTRL_PIN(84, "GPIO_84"), 204 + PINCTRL_PIN(85, "GPIO_85"), 205 + PINCTRL_PIN(86, "GPIO_86"), 206 + PINCTRL_PIN(87, "GPIO_87"), 207 + PINCTRL_PIN(88, "GPIO_88"), 208 + PINCTRL_PIN(89, "GPIO_89"), 209 + PINCTRL_PIN(90, "GPIO_90"), 210 + PINCTRL_PIN(91, "GPIO_91"), 211 + PINCTRL_PIN(92, "GPIO_92"), 212 + PINCTRL_PIN(93, "GPIO_93"), 213 + PINCTRL_PIN(94, "GPIO_94"), 214 + PINCTRL_PIN(95, "GPIO_95"), 215 + PINCTRL_PIN(96, "GPIO_96"), 216 + PINCTRL_PIN(97, "GPIO_97"), 217 + PINCTRL_PIN(98, "GPIO_98"), 218 + PINCTRL_PIN(99, "GPIO_99"), 219 + PINCTRL_PIN(100, "GPIO_100"), 220 + PINCTRL_PIN(101, "GPIO_101"), 221 + PINCTRL_PIN(102, "GPIO_102"), 222 + PINCTRL_PIN(103, "GPIO_103"), 223 + PINCTRL_PIN(104, "GPIO_104"), 224 + PINCTRL_PIN(105, "GPIO_105"), 225 + PINCTRL_PIN(106, "GPIO_106"), 226 + PINCTRL_PIN(107, "GPIO_107"), 227 + PINCTRL_PIN(108, "GPIO_108"), 228 + PINCTRL_PIN(109, "GPIO_109"), 229 + PINCTRL_PIN(110, "GPIO_110"), 230 + PINCTRL_PIN(111, "GPIO_111"), 231 + PINCTRL_PIN(112, "GPIO_112"), 232 + PINCTRL_PIN(113, "GPIO_113"), 233 + PINCTRL_PIN(114, "GPIO_114"), 234 + PINCTRL_PIN(115, "GPIO_115"), 235 + PINCTRL_PIN(116, "GPIO_116"), 236 + PINCTRL_PIN(117, "GPIO_117"), 237 + PINCTRL_PIN(118, "GPIO_118"), 238 + PINCTRL_PIN(119, "GPIO_119"), 239 + PINCTRL_PIN(120, "GPIO_120"), 240 + PINCTRL_PIN(121, "GPIO_121"), 241 + PINCTRL_PIN(122, "GPIO_122"), 242 + PINCTRL_PIN(123, "GPIO_123"), 243 + PINCTRL_PIN(124, "GPIO_124"), 244 + PINCTRL_PIN(125, "GPIO_125"), 245 + PINCTRL_PIN(126, "GPIO_126"), 246 + PINCTRL_PIN(127, "GPIO_127"), 247 + PINCTRL_PIN(128, "GPIO_128"), 248 + PINCTRL_PIN(129, "GPIO_129"), 249 + PINCTRL_PIN(130, "GPIO_130"), 250 + PINCTRL_PIN(131, "GPIO_131"), 251 + PINCTRL_PIN(132, "GPIO_132"), 252 + PINCTRL_PIN(133, "GPIO_133"), 253 + PINCTRL_PIN(134, "GPIO_134"), 254 + PINCTRL_PIN(135, "GPIO_135"), 255 + PINCTRL_PIN(136, "GPIO_136"), 256 + PINCTRL_PIN(137, "GPIO_137"), 257 + PINCTRL_PIN(138, "GPIO_138"), 258 + PINCTRL_PIN(139, "GPIO_139"), 259 + PINCTRL_PIN(140, "GPIO_140"), 260 + PINCTRL_PIN(141, "GPIO_141"), 261 + PINCTRL_PIN(142, "GPIO_142"), 262 + PINCTRL_PIN(143, "GPIO_143"), 263 + PINCTRL_PIN(144, "GPIO_144"), 264 + PINCTRL_PIN(145, "GPIO_145"), 265 + PINCTRL_PIN(146, "GPIO_146"), 266 + PINCTRL_PIN(147, "GPIO_147"), 267 + PINCTRL_PIN(148, "GPIO_148"), 268 + PINCTRL_PIN(149, "GPIO_149"), 269 + PINCTRL_PIN(150, "GPIO_150"), 270 + PINCTRL_PIN(151, "SDC1_RCLK"), 271 + PINCTRL_PIN(152, "SDC1_CLK"), 272 + PINCTRL_PIN(153, "SDC1_CMD"), 273 + PINCTRL_PIN(154, "SDC1_DATA"), 274 + }; 275 + 276 + #define DECLARE_MSM_GPIO_PINS(pin) \ 277 + static const unsigned int gpio##pin##_pins[] = { pin } 278 + DECLARE_MSM_GPIO_PINS(0); 279 + DECLARE_MSM_GPIO_PINS(1); 280 + DECLARE_MSM_GPIO_PINS(2); 281 + DECLARE_MSM_GPIO_PINS(3); 282 + DECLARE_MSM_GPIO_PINS(4); 283 + DECLARE_MSM_GPIO_PINS(5); 284 + DECLARE_MSM_GPIO_PINS(6); 285 + DECLARE_MSM_GPIO_PINS(7); 286 + DECLARE_MSM_GPIO_PINS(8); 287 + DECLARE_MSM_GPIO_PINS(9); 288 + DECLARE_MSM_GPIO_PINS(10); 289 + DECLARE_MSM_GPIO_PINS(11); 290 + DECLARE_MSM_GPIO_PINS(12); 291 + DECLARE_MSM_GPIO_PINS(13); 292 + DECLARE_MSM_GPIO_PINS(14); 293 + DECLARE_MSM_GPIO_PINS(15); 294 + DECLARE_MSM_GPIO_PINS(16); 295 + DECLARE_MSM_GPIO_PINS(17); 296 + DECLARE_MSM_GPIO_PINS(18); 297 + DECLARE_MSM_GPIO_PINS(19); 298 + DECLARE_MSM_GPIO_PINS(20); 299 + DECLARE_MSM_GPIO_PINS(21); 300 + DECLARE_MSM_GPIO_PINS(22); 301 + DECLARE_MSM_GPIO_PINS(23); 302 + DECLARE_MSM_GPIO_PINS(24); 303 + DECLARE_MSM_GPIO_PINS(25); 304 + DECLARE_MSM_GPIO_PINS(26); 305 + DECLARE_MSM_GPIO_PINS(27); 306 + DECLARE_MSM_GPIO_PINS(28); 307 + DECLARE_MSM_GPIO_PINS(29); 308 + DECLARE_MSM_GPIO_PINS(30); 309 + DECLARE_MSM_GPIO_PINS(31); 310 + DECLARE_MSM_GPIO_PINS(32); 311 + DECLARE_MSM_GPIO_PINS(33); 312 + DECLARE_MSM_GPIO_PINS(34); 313 + DECLARE_MSM_GPIO_PINS(35); 314 + DECLARE_MSM_GPIO_PINS(36); 315 + DECLARE_MSM_GPIO_PINS(37); 316 + DECLARE_MSM_GPIO_PINS(38); 317 + DECLARE_MSM_GPIO_PINS(39); 318 + DECLARE_MSM_GPIO_PINS(40); 319 + DECLARE_MSM_GPIO_PINS(41); 320 + DECLARE_MSM_GPIO_PINS(42); 321 + DECLARE_MSM_GPIO_PINS(43); 322 + DECLARE_MSM_GPIO_PINS(44); 323 + DECLARE_MSM_GPIO_PINS(45); 324 + DECLARE_MSM_GPIO_PINS(46); 325 + DECLARE_MSM_GPIO_PINS(47); 326 + DECLARE_MSM_GPIO_PINS(48); 327 + DECLARE_MSM_GPIO_PINS(49); 328 + DECLARE_MSM_GPIO_PINS(50); 329 + DECLARE_MSM_GPIO_PINS(51); 330 + DECLARE_MSM_GPIO_PINS(52); 331 + DECLARE_MSM_GPIO_PINS(53); 332 + DECLARE_MSM_GPIO_PINS(54); 333 + DECLARE_MSM_GPIO_PINS(55); 334 + DECLARE_MSM_GPIO_PINS(56); 335 + DECLARE_MSM_GPIO_PINS(57); 336 + DECLARE_MSM_GPIO_PINS(58); 337 + DECLARE_MSM_GPIO_PINS(59); 338 + DECLARE_MSM_GPIO_PINS(60); 339 + DECLARE_MSM_GPIO_PINS(61); 340 + DECLARE_MSM_GPIO_PINS(62); 341 + DECLARE_MSM_GPIO_PINS(63); 342 + DECLARE_MSM_GPIO_PINS(64); 343 + DECLARE_MSM_GPIO_PINS(65); 344 + DECLARE_MSM_GPIO_PINS(66); 345 + DECLARE_MSM_GPIO_PINS(67); 346 + DECLARE_MSM_GPIO_PINS(68); 347 + DECLARE_MSM_GPIO_PINS(69); 348 + DECLARE_MSM_GPIO_PINS(70); 349 + DECLARE_MSM_GPIO_PINS(71); 350 + DECLARE_MSM_GPIO_PINS(72); 351 + DECLARE_MSM_GPIO_PINS(73); 352 + DECLARE_MSM_GPIO_PINS(74); 353 + DECLARE_MSM_GPIO_PINS(75); 354 + DECLARE_MSM_GPIO_PINS(76); 355 + DECLARE_MSM_GPIO_PINS(77); 356 + DECLARE_MSM_GPIO_PINS(78); 357 + DECLARE_MSM_GPIO_PINS(79); 358 + DECLARE_MSM_GPIO_PINS(80); 359 + DECLARE_MSM_GPIO_PINS(81); 360 + DECLARE_MSM_GPIO_PINS(82); 361 + DECLARE_MSM_GPIO_PINS(83); 362 + DECLARE_MSM_GPIO_PINS(84); 363 + DECLARE_MSM_GPIO_PINS(85); 364 + DECLARE_MSM_GPIO_PINS(86); 365 + DECLARE_MSM_GPIO_PINS(87); 366 + DECLARE_MSM_GPIO_PINS(88); 367 + DECLARE_MSM_GPIO_PINS(89); 368 + DECLARE_MSM_GPIO_PINS(90); 369 + DECLARE_MSM_GPIO_PINS(91); 370 + DECLARE_MSM_GPIO_PINS(92); 371 + DECLARE_MSM_GPIO_PINS(93); 372 + DECLARE_MSM_GPIO_PINS(94); 373 + DECLARE_MSM_GPIO_PINS(95); 374 + DECLARE_MSM_GPIO_PINS(96); 375 + DECLARE_MSM_GPIO_PINS(97); 376 + DECLARE_MSM_GPIO_PINS(98); 377 + DECLARE_MSM_GPIO_PINS(99); 378 + DECLARE_MSM_GPIO_PINS(100); 379 + DECLARE_MSM_GPIO_PINS(101); 380 + DECLARE_MSM_GPIO_PINS(102); 381 + DECLARE_MSM_GPIO_PINS(103); 382 + DECLARE_MSM_GPIO_PINS(104); 383 + DECLARE_MSM_GPIO_PINS(105); 384 + DECLARE_MSM_GPIO_PINS(106); 385 + DECLARE_MSM_GPIO_PINS(107); 386 + DECLARE_MSM_GPIO_PINS(108); 387 + DECLARE_MSM_GPIO_PINS(109); 388 + DECLARE_MSM_GPIO_PINS(110); 389 + DECLARE_MSM_GPIO_PINS(111); 390 + DECLARE_MSM_GPIO_PINS(112); 391 + DECLARE_MSM_GPIO_PINS(113); 392 + DECLARE_MSM_GPIO_PINS(114); 393 + DECLARE_MSM_GPIO_PINS(115); 394 + DECLARE_MSM_GPIO_PINS(116); 395 + DECLARE_MSM_GPIO_PINS(117); 396 + DECLARE_MSM_GPIO_PINS(118); 397 + DECLARE_MSM_GPIO_PINS(119); 398 + DECLARE_MSM_GPIO_PINS(120); 399 + DECLARE_MSM_GPIO_PINS(121); 400 + DECLARE_MSM_GPIO_PINS(122); 401 + DECLARE_MSM_GPIO_PINS(123); 402 + DECLARE_MSM_GPIO_PINS(124); 403 + DECLARE_MSM_GPIO_PINS(125); 404 + DECLARE_MSM_GPIO_PINS(126); 405 + DECLARE_MSM_GPIO_PINS(127); 406 + DECLARE_MSM_GPIO_PINS(128); 407 + DECLARE_MSM_GPIO_PINS(129); 408 + DECLARE_MSM_GPIO_PINS(130); 409 + DECLARE_MSM_GPIO_PINS(131); 410 + DECLARE_MSM_GPIO_PINS(132); 411 + DECLARE_MSM_GPIO_PINS(133); 412 + DECLARE_MSM_GPIO_PINS(134); 413 + DECLARE_MSM_GPIO_PINS(135); 414 + DECLARE_MSM_GPIO_PINS(136); 415 + DECLARE_MSM_GPIO_PINS(137); 416 + DECLARE_MSM_GPIO_PINS(138); 417 + DECLARE_MSM_GPIO_PINS(139); 418 + DECLARE_MSM_GPIO_PINS(140); 419 + DECLARE_MSM_GPIO_PINS(141); 420 + DECLARE_MSM_GPIO_PINS(142); 421 + DECLARE_MSM_GPIO_PINS(143); 422 + DECLARE_MSM_GPIO_PINS(144); 423 + DECLARE_MSM_GPIO_PINS(145); 424 + DECLARE_MSM_GPIO_PINS(146); 425 + DECLARE_MSM_GPIO_PINS(147); 426 + DECLARE_MSM_GPIO_PINS(148); 427 + DECLARE_MSM_GPIO_PINS(149); 428 + DECLARE_MSM_GPIO_PINS(150); 429 + 430 + static const unsigned int sdc1_rclk_pins[] = { 151 }; 431 + static const unsigned int sdc1_clk_pins[] = { 152 }; 432 + static const unsigned int sdc1_cmd_pins[] = { 153 }; 433 + static const unsigned int sdc1_data_pins[] = { 154 }; 434 + 435 + enum qdu1000_functions { 436 + msm_mux_gpio, 437 + msm_mux_cmo_pri, 438 + msm_mux_si5518_int, 439 + msm_mux_atest_char, 440 + msm_mux_atest_usb, 441 + msm_mux_char_exec, 442 + msm_mux_cmu_rng, 443 + msm_mux_dbg_out_clk, 444 + msm_mux_ddr_bist, 445 + msm_mux_ddr_pxi0, 446 + msm_mux_ddr_pxi1, 447 + msm_mux_ddr_pxi2, 448 + msm_mux_ddr_pxi3, 449 + msm_mux_ddr_pxi4, 450 + msm_mux_ddr_pxi5, 451 + msm_mux_ddr_pxi6, 452 + msm_mux_ddr_pxi7, 453 + msm_mux_eth012_int_n, 454 + msm_mux_eth345_int_n, 455 + msm_mux_eth6_int_n, 456 + msm_mux_gcc_gp1, 457 + msm_mux_gcc_gp2, 458 + msm_mux_gcc_gp3, 459 + msm_mux_gps_pps_in, 460 + msm_mux_hardsync_pps_in, 461 + msm_mux_intr_c, 462 + msm_mux_jitter_bist_ref, 463 + msm_mux_pcie_clkreqn, 464 + msm_mux_phase_flag, 465 + msm_mux_pll_bist, 466 + msm_mux_pll_clk, 467 + msm_mux_prng_rosc, 468 + msm_mux_qdss_cti, 469 + msm_mux_qdss_gpio, 470 + msm_mux_qlink0_enable, 471 + msm_mux_qlink0_request, 472 + msm_mux_qlink0_wmss, 473 + msm_mux_qlink1_enable, 474 + msm_mux_qlink1_request, 475 + msm_mux_qlink1_wmss, 476 + msm_mux_qlink2_enable, 477 + msm_mux_qlink2_request, 478 + msm_mux_qlink2_wmss, 479 + msm_mux_qlink3_enable, 480 + msm_mux_qlink3_request, 481 + msm_mux_qlink3_wmss, 482 + msm_mux_qlink4_enable, 483 + msm_mux_qlink4_request, 484 + msm_mux_qlink4_wmss, 485 + msm_mux_qlink5_enable, 486 + msm_mux_qlink5_request, 487 + msm_mux_qlink5_wmss, 488 + msm_mux_qlink6_enable, 489 + msm_mux_qlink6_request, 490 + msm_mux_qlink6_wmss, 491 + msm_mux_qlink7_enable, 492 + msm_mux_qlink7_request, 493 + msm_mux_qlink7_wmss, 494 + msm_mux_qspi_clk, 495 + msm_mux_qspi_cs, 496 + msm_mux_qspi0, 497 + msm_mux_qspi1, 498 + msm_mux_qspi2, 499 + msm_mux_qspi3, 500 + msm_mux_qup00, 501 + msm_mux_qup01, 502 + msm_mux_qup02, 503 + msm_mux_qup03, 504 + msm_mux_qup04, 505 + msm_mux_qup05, 506 + msm_mux_qup06, 507 + msm_mux_qup07, 508 + msm_mux_qup08, 509 + msm_mux_qup10, 510 + msm_mux_qup11, 511 + msm_mux_qup12, 512 + msm_mux_qup13, 513 + msm_mux_qup14, 514 + msm_mux_qup15, 515 + msm_mux_qup16, 516 + msm_mux_qup17, 517 + msm_mux_qup20, 518 + msm_mux_qup21, 519 + msm_mux_qup22, 520 + msm_mux_smb_alert, 521 + msm_mux_smb_clk, 522 + msm_mux_smb_dat, 523 + msm_mux_tb_trig, 524 + msm_mux_tgu_ch0, 525 + msm_mux_tgu_ch1, 526 + msm_mux_tgu_ch2, 527 + msm_mux_tgu_ch3, 528 + msm_mux_tgu_ch4, 529 + msm_mux_tgu_ch5, 530 + msm_mux_tgu_ch6, 531 + msm_mux_tgu_ch7, 532 + msm_mux_tmess_prng0, 533 + msm_mux_tmess_prng1, 534 + msm_mux_tmess_prng2, 535 + msm_mux_tmess_prng3, 536 + msm_mux_tod_pps_in, 537 + msm_mux_tsense_pwm1, 538 + msm_mux_tsense_pwm2, 539 + msm_mux_usb2phy_ac, 540 + msm_mux_usb_con_det, 541 + msm_mux_usb_dfp_en, 542 + msm_mux_usb_phy, 543 + msm_mux_vfr_0, 544 + msm_mux_vfr_1, 545 + msm_mux_vsense_trigger, 546 + msm_mux__, 547 + }; 548 + 549 + static const char * const gpio_groups[] = { 550 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 551 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 552 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 553 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 554 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 555 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 556 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 557 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 558 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 559 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 560 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 561 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 562 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 563 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 564 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 565 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 566 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 567 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 568 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 569 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 570 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 571 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 572 + "gpio147", "gpio148", "gpio149", "gpio150", 573 + }; 574 + static const char * const cmo_pri_groups[] = { 575 + "gpio103", 576 + }; 577 + static const char * const si5518_int_groups[] = { 578 + "gpio44", 579 + }; 580 + static const char * const atest_char_groups[] = { 581 + "gpio89", "gpio90", "gpio91", "gpio92", "gpio95", 582 + }; 583 + static const char * const atest_usb_groups[] = { 584 + "gpio114", "gpio115", "gpio116", "gpio117", "gpio118", 585 + }; 586 + static const char * const char_exec_groups[] = { 587 + "gpio99", "gpio100", 588 + }; 589 + static const char * const cmu_rng_groups[] = { 590 + "gpio89", "gpio90", "gpio91", "gpio92", 591 + }; 592 + static const char * const dbg_out_clk_groups[] = { 593 + "gpio136", 594 + }; 595 + static const char * const ddr_bist_groups[] = { 596 + "gpio0", "gpio1", "gpio2", "gpio3", 597 + }; 598 + static const char * const ddr_pxi0_groups[] = { 599 + "gpio114", "gpio115", 600 + }; 601 + static const char * const ddr_pxi1_groups[] = { 602 + "gpio116", "gpio117", 603 + }; 604 + static const char * const ddr_pxi2_groups[] = { 605 + "gpio118", "gpio119", 606 + }; 607 + static const char * const ddr_pxi3_groups[] = { 608 + "gpio120", "gpio121", 609 + }; 610 + static const char * const ddr_pxi4_groups[] = { 611 + "gpio122", "gpio123", 612 + }; 613 + static const char * const ddr_pxi5_groups[] = { 614 + "gpio124", "gpio125", 615 + }; 616 + static const char * const ddr_pxi6_groups[] = { 617 + "gpio126", "gpio127", 618 + }; 619 + static const char * const ddr_pxi7_groups[] = { 620 + "gpio128", "gpio129", 621 + }; 622 + static const char * const eth012_int_n_groups[] = { 623 + "gpio86", 624 + }; 625 + static const char * const eth345_int_n_groups[] = { 626 + "gpio87", 627 + }; 628 + static const char * const eth6_int_n_groups[] = { 629 + "gpio88", 630 + }; 631 + static const char * const gcc_gp1_groups[] = { 632 + "gpio86", "gpio134", 633 + }; 634 + static const char * const gcc_gp2_groups[] = { 635 + "gpio87", "gpio135", 636 + }; 637 + static const char * const gcc_gp3_groups[] = { 638 + "gpio88", "gpio136", 639 + }; 640 + static const char * const gps_pps_in_groups[] = { 641 + "gpio49", 642 + }; 643 + static const char * const hardsync_pps_in_groups[] = { 644 + "gpio47", 645 + }; 646 + static const char * const intr_c_groups[] = { 647 + "gpio26", "gpio27", "gpio28", "gpio141", "gpio142", "gpio143", 648 + }; 649 + static const char * const jitter_bist_ref_groups[] = { 650 + "gpio130", 651 + }; 652 + static const char * const pcie_clkreqn_groups[] = { 653 + "gpio98", "gpio99", "gpio100", 654 + }; 655 + static const char * const phase_flag_groups[] = { 656 + "gpio6", "gpio7", "gpio8", "gpio9", "gpio16", "gpio17", "gpio18", 657 + "gpio19", "gpio20", "gpio22", "gpio21", "gpio23", "gpio24", "gpio25", 658 + "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32", 659 + "gpio33", "gpio42", "gpio43", "gpio89", "gpio90", "gpio91", "gpio92", 660 + "gpio95", "gpio96", "gpio97", "gpio102", 661 + }; 662 + static const char * const pll_bist_groups[] = { 663 + "gpio20", 664 + }; 665 + static const char * const pll_clk_groups[] = { 666 + "gpio98", 667 + }; 668 + static const char * const prng_rosc_groups[] = { 669 + "gpio18", "gpio19", "gpio20", "gpio21", 670 + }; 671 + static const char * const qdss_cti_groups[] = { 672 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio48", 673 + "gpio49", "gpio86", "gpio87", "gpio93", "gpio94", "gpio130", "gpio131", 674 + "gpio132", "gpio133", "gpio134", "gpio135", "gpio144", "gpio145", 675 + }; 676 + static const char * const qdss_gpio_groups[] = { 677 + "gpio6", "gpio7", "gpio8", "gpio9", "gpio16", "gpio17", "gpio18", 678 + "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", "gpio25", "gpio26", 679 + "gpio27", "gpio28", "gpio24", "gpio29", "gpio30", "gpio31", "gpio32", 680 + "gpio33", "gpio34", "gpio35", "gpio42", "gpio43", "gpio88", "gpio89", 681 + "gpio90", "gpio91", "gpio92", "gpio95", "gpio96", "gpio97", "gpio102", 682 + "gpio103", 683 + }; 684 + static const char * const qlink0_enable_groups[] = { 685 + "gpio67", 686 + }; 687 + static const char * const qlink0_request_groups[] = { 688 + "gpio66", 689 + }; 690 + static const char * const qlink0_wmss_groups[] = { 691 + "gpio82", 692 + }; 693 + static const char * const qlink1_enable_groups[] = { 694 + "gpio69", 695 + }; 696 + static const char * const qlink1_request_groups[] = { 697 + "gpio68", 698 + }; 699 + static const char * const qlink1_wmss_groups[] = { 700 + "gpio83", 701 + }; 702 + static const char * const qlink2_enable_groups[] = { 703 + "gpio71", 704 + }; 705 + static const char * const qlink2_request_groups[] = { 706 + "gpio70", 707 + }; 708 + static const char * const qlink2_wmss_groups[] = { 709 + "gpio138", 710 + }; 711 + static const char * const qlink3_enable_groups[] = { 712 + "gpio73", 713 + }; 714 + static const char * const qlink3_request_groups[] = { 715 + "gpio72", 716 + }; 717 + static const char * const qlink3_wmss_groups[] = { 718 + "gpio139", 719 + }; 720 + static const char * const qlink4_enable_groups[] = { 721 + "gpio75", 722 + }; 723 + static const char * const qlink4_request_groups[] = { 724 + "gpio74", 725 + }; 726 + static const char * const qlink4_wmss_groups[] = { 727 + "gpio84", 728 + }; 729 + static const char * const qlink5_enable_groups[] = { 730 + "gpio77", 731 + }; 732 + static const char * const qlink5_request_groups[] = { 733 + "gpio76", 734 + }; 735 + static const char * const qlink5_wmss_groups[] = { 736 + "gpio85", 737 + }; 738 + static const char * const qlink6_enable_groups[] = { 739 + "gpio79", 740 + }; 741 + static const char * const qlink6_request_groups[] = { 742 + "gpio78", 743 + }; 744 + static const char * const qlink6_wmss_groups[] = { 745 + "gpio56", 746 + }; 747 + static const char * const qlink7_enable_groups[] = { 748 + "gpio81", 749 + }; 750 + static const char * const qlink7_request_groups[] = { 751 + "gpio80", 752 + }; 753 + static const char * const qlink7_wmss_groups[] = { 754 + "gpio57", 755 + }; 756 + static const char * const qspi0_groups[] = { 757 + "gpio114", 758 + }; 759 + static const char * const qspi1_groups[] = { 760 + "gpio115", 761 + }; 762 + static const char * const qspi2_groups[] = { 763 + "gpio116", 764 + }; 765 + static const char * const qspi3_groups[] = { 766 + "gpio117", 767 + }; 768 + static const char * const qspi_clk_groups[] = { 769 + "gpio126", 770 + }; 771 + static const char * const qspi_cs_groups[] = { 772 + "gpio125", 773 + }; 774 + static const char * const qup00_groups[] = { 775 + "gpio6", "gpio7", "gpio8", "gpio9", 776 + }; 777 + static const char * const qup01_groups[] = { 778 + "gpio10", "gpio11", "gpio12", "gpio13", 779 + }; 780 + static const char * const qup02_groups[] = { 781 + "gpio10", "gpio11", "gpio12", "gpio13", 782 + }; 783 + static const char * const qup03_groups[] = { 784 + "gpio14", "gpio15", "gpio16", "gpio17", 785 + }; 786 + static const char * const qup04_groups[] = { 787 + "gpio14", "gpio15", "gpio16", "gpio17", 788 + }; 789 + static const char * const qup05_groups[] = { 790 + "gpio130", "gpio131", "gpio132", "gpio133", 791 + }; 792 + static const char * const qup06_groups[] = { 793 + "gpio130", "gpio131", "gpio132", "gpio133", 794 + }; 795 + static const char * const qup07_groups[] = { 796 + "gpio134", "gpio135", 797 + }; 798 + static const char * const qup08_groups[] = { 799 + "gpio134", "gpio135", 800 + }; 801 + static const char * const qup10_groups[] = { 802 + "gpio18", "gpio19", "gpio20", "gpio21", 803 + }; 804 + static const char * const qup11_groups[] = { 805 + "gpio22", "gpio23", "gpio24", "gpio25", 806 + }; 807 + static const char * const qup12_groups[] = { 808 + "gpio22", "gpio23", "gpio24", "gpio25", 809 + }; 810 + static const char * const qup13_groups[] = { 811 + "gpio26", "gpio27", "gpio28", "gpio29", 812 + }; 813 + static const char * const qup14_groups[] = { 814 + "gpio26", "gpio27", "gpio28", "gpio29", 815 + }; 816 + static const char * const qup15_groups[] = { 817 + "gpio30", "gpio31", "gpio32", "gpio33", 818 + }; 819 + static const char * const qup16_groups[] = { 820 + "gpio29", "gpio34", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", 821 + }; 822 + static const char * const qup17_groups[] = { 823 + "gpio12", "gpio13", "gpio14", "gpio30", "gpio31", "gpio40", "gpio41", 824 + }; 825 + static const char * const qup20_groups[] = { 826 + "gpio0", "gpio1", "gpio2", "gpio3", 827 + }; 828 + static const char * const qup21_groups[] = { 829 + "gpio0", "gpio1", "gpio2", "gpio3", 830 + }; 831 + static const char * const qup22_groups[] = { 832 + "gpio4", "gpio5", "gpio128", "gpio129", 833 + }; 834 + static const char * const smb_alert_groups[] = { 835 + "gpio88", "gpio101", 836 + }; 837 + static const char * const smb_clk_groups[] = { 838 + "gpio133", 839 + }; 840 + static const char * const smb_dat_groups[] = { 841 + "gpio132", 842 + }; 843 + static const char * const tb_trig_groups[] = { 844 + "gpio114", 845 + }; 846 + static const char * const tgu_ch0_groups[] = { 847 + "gpio6", 848 + }; 849 + static const char * const tgu_ch1_groups[] = { 850 + "gpio7", 851 + }; 852 + static const char * const tgu_ch2_groups[] = { 853 + "gpio8", 854 + }; 855 + static const char * const tgu_ch3_groups[] = { 856 + "gpio9", 857 + }; 858 + static const char * const tgu_ch4_groups[] = { 859 + "gpio44", 860 + }; 861 + static const char * const tgu_ch5_groups[] = { 862 + "gpio45", 863 + }; 864 + static const char * const tgu_ch6_groups[] = { 865 + "gpio46", 866 + }; 867 + static const char * const tgu_ch7_groups[] = { 868 + "gpio47", 869 + }; 870 + static const char * const tmess_prng0_groups[] = { 871 + "gpio33", 872 + }; 873 + static const char * const tmess_prng1_groups[] = { 874 + "gpio32", 875 + }; 876 + static const char * const tmess_prng2_groups[] = { 877 + "gpio31", 878 + }; 879 + static const char * const tmess_prng3_groups[] = { 880 + "gpio30", 881 + }; 882 + static const char * const tod_pps_in_groups[] = { 883 + "gpio48", 884 + }; 885 + static const char * const tsense_pwm1_groups[] = { 886 + "gpio2", 887 + }; 888 + static const char * const tsense_pwm2_groups[] = { 889 + "gpio3", 890 + }; 891 + static const char * const usb2phy_ac_groups[] = { 892 + "gpio90", 893 + }; 894 + static const char * const usb_con_det_groups[] = { 895 + "gpio42", 896 + }; 897 + static const char * const usb_dfp_en_groups[] = { 898 + "gpio43", 899 + }; 900 + static const char * const usb_phy_groups[] = { 901 + "gpio91", 902 + }; 903 + static const char * const vfr_0_groups[] = { 904 + "gpio93", 905 + }; 906 + static const char * const vfr_1_groups[] = { 907 + "gpio94", 908 + }; 909 + static const char * const vsense_trigger_groups[] = { 910 + "gpio135", 911 + }; 912 + 913 + static const struct msm_function qdu1000_functions[] = { 914 + FUNCTION(gpio), 915 + FUNCTION(cmo_pri), 916 + FUNCTION(si5518_int), 917 + FUNCTION(atest_char), 918 + FUNCTION(atest_usb), 919 + FUNCTION(char_exec), 920 + FUNCTION(cmu_rng), 921 + FUNCTION(dbg_out_clk), 922 + FUNCTION(ddr_bist), 923 + FUNCTION(ddr_pxi0), 924 + FUNCTION(ddr_pxi1), 925 + FUNCTION(ddr_pxi2), 926 + FUNCTION(ddr_pxi3), 927 + FUNCTION(ddr_pxi4), 928 + FUNCTION(ddr_pxi5), 929 + FUNCTION(ddr_pxi6), 930 + FUNCTION(ddr_pxi7), 931 + FUNCTION(eth012_int_n), 932 + FUNCTION(eth345_int_n), 933 + FUNCTION(eth6_int_n), 934 + FUNCTION(gcc_gp1), 935 + FUNCTION(gcc_gp2), 936 + FUNCTION(gcc_gp3), 937 + FUNCTION(gps_pps_in), 938 + FUNCTION(hardsync_pps_in), 939 + FUNCTION(intr_c), 940 + FUNCTION(jitter_bist_ref), 941 + FUNCTION(pcie_clkreqn), 942 + FUNCTION(phase_flag), 943 + FUNCTION(pll_bist), 944 + FUNCTION(pll_clk), 945 + FUNCTION(prng_rosc), 946 + FUNCTION(qdss_cti), 947 + FUNCTION(qdss_gpio), 948 + FUNCTION(qlink0_enable), 949 + FUNCTION(qlink0_request), 950 + FUNCTION(qlink0_wmss), 951 + FUNCTION(qlink1_enable), 952 + FUNCTION(qlink1_request), 953 + FUNCTION(qlink1_wmss), 954 + FUNCTION(qlink2_enable), 955 + FUNCTION(qlink2_request), 956 + FUNCTION(qlink2_wmss), 957 + FUNCTION(qlink3_enable), 958 + FUNCTION(qlink3_request), 959 + FUNCTION(qlink3_wmss), 960 + FUNCTION(qlink4_enable), 961 + FUNCTION(qlink4_request), 962 + FUNCTION(qlink4_wmss), 963 + FUNCTION(qlink5_enable), 964 + FUNCTION(qlink5_request), 965 + FUNCTION(qlink5_wmss), 966 + FUNCTION(qlink6_enable), 967 + FUNCTION(qlink6_request), 968 + FUNCTION(qlink6_wmss), 969 + FUNCTION(qlink7_enable), 970 + FUNCTION(qlink7_request), 971 + FUNCTION(qlink7_wmss), 972 + FUNCTION(qspi0), 973 + FUNCTION(qspi1), 974 + FUNCTION(qspi2), 975 + FUNCTION(qspi3), 976 + FUNCTION(qspi_clk), 977 + FUNCTION(qspi_cs), 978 + FUNCTION(qup00), 979 + FUNCTION(qup01), 980 + FUNCTION(qup02), 981 + FUNCTION(qup03), 982 + FUNCTION(qup04), 983 + FUNCTION(qup05), 984 + FUNCTION(qup06), 985 + FUNCTION(qup07), 986 + FUNCTION(qup08), 987 + FUNCTION(qup10), 988 + FUNCTION(qup11), 989 + FUNCTION(qup12), 990 + FUNCTION(qup13), 991 + FUNCTION(qup14), 992 + FUNCTION(qup15), 993 + FUNCTION(qup16), 994 + FUNCTION(qup17), 995 + FUNCTION(qup20), 996 + FUNCTION(qup21), 997 + FUNCTION(qup22), 998 + FUNCTION(smb_alert), 999 + FUNCTION(smb_clk), 1000 + FUNCTION(smb_dat), 1001 + FUNCTION(tb_trig), 1002 + FUNCTION(tgu_ch0), 1003 + FUNCTION(tgu_ch1), 1004 + FUNCTION(tgu_ch2), 1005 + FUNCTION(tgu_ch3), 1006 + FUNCTION(tgu_ch4), 1007 + FUNCTION(tgu_ch5), 1008 + FUNCTION(tgu_ch6), 1009 + FUNCTION(tgu_ch7), 1010 + FUNCTION(tmess_prng0), 1011 + FUNCTION(tmess_prng1), 1012 + FUNCTION(tmess_prng2), 1013 + FUNCTION(tmess_prng3), 1014 + FUNCTION(tod_pps_in), 1015 + FUNCTION(tsense_pwm1), 1016 + FUNCTION(tsense_pwm2), 1017 + FUNCTION(usb2phy_ac), 1018 + FUNCTION(usb_con_det), 1019 + FUNCTION(usb_dfp_en), 1020 + FUNCTION(usb_phy), 1021 + FUNCTION(vfr_0), 1022 + FUNCTION(vfr_1), 1023 + FUNCTION(vsense_trigger), 1024 + }; 1025 + 1026 + /* 1027 + * Every pin is maintained as a single group, and missing or non-existing pin 1028 + * would be maintained as dummy group to synchronize pin group index with 1029 + * pin descriptor registered with pinctrl core. 1030 + * Clients would not be able to request these dummy pin groups. 1031 + */ 1032 + static const struct msm_pingroup qdu1000_groups[] = { 1033 + [0] = PINGROUP(0, qup20, qup21, ddr_bist, _, _, _, _, _, _), 1034 + [1] = PINGROUP(1, qup20, qup21, ddr_bist, _, _, _, _, _, _), 1035 + [2] = PINGROUP(2, qup21, qup20, ddr_bist, _, 1036 + tsense_pwm1, _, _, _, _), 1037 + [3] = PINGROUP(3, qup21, qup20, ddr_bist, _, 1038 + tsense_pwm2, _, _, _, _), 1039 + [4] = PINGROUP(4, qup22, _, _, _, _, _, _, _, _), 1040 + [5] = PINGROUP(5, qup22, _, _, _, _, _, _, _, _), 1041 + [6] = PINGROUP(6, qup00, tgu_ch0, phase_flag, _, 1042 + qdss_gpio, _, _, _, _), 1043 + [7] = PINGROUP(7, qup00, tgu_ch1, phase_flag, _, 1044 + qdss_gpio, _, _, _, _), 1045 + [8] = PINGROUP(8, qup00, tgu_ch2, phase_flag, _, 1046 + qdss_gpio, _, _, _, _), 1047 + [9] = PINGROUP(9, qup00, tgu_ch3, phase_flag, _, 1048 + qdss_gpio, _, _, _, _), 1049 + [10] = PINGROUP(10, qup01, qup02, _, _, _, _, _, _, _), 1050 + [11] = PINGROUP(11, qup01, qup02, _, _, _, _, _, _, _), 1051 + [12] = PINGROUP(12, qup02, qup01, qup17, _, _, _, _, _, _), 1052 + [13] = PINGROUP(13, qup02, qup01, qup17, _, _, _, _, _, _), 1053 + [14] = PINGROUP(14, qup03, qup04, qup17, _, _, _, _, _, _), 1054 + [15] = PINGROUP(15, qup03, qup04, _, _, _, _, _, _, _), 1055 + [16] = PINGROUP(16, qup04, qup03, phase_flag, _, 1056 + qdss_gpio, _, _, _, _), 1057 + [17] = PINGROUP(17, qup04, qup03, phase_flag, _, 1058 + qdss_gpio, _, _, _, _), 1059 + [18] = PINGROUP(18, qup10, prng_rosc, phase_flag, 1060 + _, qdss_gpio, _, _, _, _), 1061 + [19] = PINGROUP(19, qup10, prng_rosc, phase_flag, 1062 + _, qdss_gpio, _, _, _, _), 1063 + [20] = PINGROUP(20, qup10, prng_rosc, pll_bist, 1064 + phase_flag, _, qdss_gpio, _, _, _), 1065 + [21] = PINGROUP(21, qup10, prng_rosc, phase_flag, 1066 + _, qdss_gpio, _, _, _, _), 1067 + [22] = PINGROUP(22, qup11, qup12, phase_flag, _, 1068 + qdss_gpio, _, _, _, _), 1069 + [23] = PINGROUP(23, qup11, qup12, phase_flag, _, 1070 + qdss_gpio, _, _, _, _), 1071 + [24] = PINGROUP(24, qup12, qup11, phase_flag, _, 1072 + qdss_gpio, _, _, _, _), 1073 + [25] = PINGROUP(25, qup12, qup11, phase_flag, _, 1074 + qdss_gpio, _, _, _, _), 1075 + [26] = PINGROUP(26, qup13, qup14, intr_c, 1076 + phase_flag, _, qdss_gpio, _, _, _), 1077 + [27] = PINGROUP(27, qup13, qup14, intr_c, 1078 + phase_flag, _, qdss_gpio, _, _, _), 1079 + [28] = PINGROUP(28, qup14, qup13, intr_c, 1080 + phase_flag, _, qdss_gpio, _, _, _), 1081 + [29] = PINGROUP(29, qup14, qup13, qup16, 1082 + phase_flag, _, qdss_gpio, _, _, _), 1083 + [30] = PINGROUP(30, qup17, qup15, tmess_prng3, 1084 + phase_flag, _, qdss_gpio, _, _, _), 1085 + [31] = PINGROUP(31, qup17, qup15, tmess_prng2, 1086 + phase_flag, _, qdss_gpio, _, _, _), 1087 + [32] = PINGROUP(32, qup15, tmess_prng1, phase_flag, 1088 + _, qdss_gpio, _, _, _, _), 1089 + [33] = PINGROUP(33, qup15, tmess_prng0, phase_flag, 1090 + _, qdss_gpio, _, _, _, _), 1091 + [34] = PINGROUP(34, qup16, qdss_gpio, _, _, _, _, _, _, _), 1092 + [35] = PINGROUP(35, qup16, qdss_gpio, _, _, _, _, _, _, _), 1093 + [36] = PINGROUP(36, qup16, qdss_cti, _, _, _, _, _, _, _), 1094 + [37] = PINGROUP(37, qup16, qdss_cti, _, _, _, _, _, _, _), 1095 + [38] = PINGROUP(38, qup16, qdss_cti, _, _, _, _, _, _, _), 1096 + [39] = PINGROUP(39, qup16, qdss_cti, _, _, _, _, _, _, _), 1097 + [40] = PINGROUP(40, qup17, qdss_cti, _, _, _, _, _, _, _), 1098 + [41] = PINGROUP(41, qup17, qdss_cti, _, _, _, _, _, _, _), 1099 + [42] = PINGROUP(42, usb_con_det, phase_flag, _, 1100 + qdss_gpio, _, _, _, _, _), 1101 + [43] = PINGROUP(43, usb_dfp_en, phase_flag, _, 1102 + qdss_gpio, _, _, _, _, _), 1103 + [44] = PINGROUP(44, si5518_int, tgu_ch4, _, _, _, _, _, _, _), 1104 + [45] = PINGROUP(45, tgu_ch5, _, _, _, _, _, _, _, _), 1105 + [46] = PINGROUP(46, tgu_ch6, _, _, _, _, _, _, _, _), 1106 + [47] = PINGROUP(47, hardsync_pps_in, tgu_ch7, _, _, _, _, _, _, _), 1107 + [48] = PINGROUP(48, tod_pps_in, qdss_cti, _, _, _, _, _, _, _), 1108 + [49] = PINGROUP(49, gps_pps_in, qdss_cti, _, _, _, _, _, _, _), 1109 + [50] = PINGROUP(50, _, _, _, _, _, _, _, _, _), 1110 + [51] = PINGROUP(51, _, _, _, _, _, _, _, _, _), 1111 + [52] = PINGROUP(52, _, _, _, _, _, _, _, _, _), 1112 + [53] = PINGROUP(53, _, _, _, _, _, _, _, _, _), 1113 + [54] = PINGROUP(54, _, _, _, _, _, _, _, _, _), 1114 + [55] = PINGROUP(55, _, _, _, _, _, _, _, _, _), 1115 + [56] = PINGROUP(56, _, qlink6_wmss, _, _, _, _, _, _, _), 1116 + [57] = PINGROUP(57, _, qlink7_wmss, _, _, _, _, _, _, _), 1117 + [58] = PINGROUP(58, _, _, _, _, _, _, _, _, _), 1118 + [59] = PINGROUP(59, _, _, _, _, _, _, _, _, _), 1119 + [60] = PINGROUP(60, _, _, _, _, _, _, _, _, _), 1120 + [61] = PINGROUP(61, _, _, _, _, _, _, _, _, _), 1121 + [62] = PINGROUP(62, _, _, _, _, _, _, _, _, _), 1122 + [63] = PINGROUP(63, _, _, _, _, _, _, _, _, _), 1123 + [64] = PINGROUP(64, _, _, _, _, _, _, _, _, _), 1124 + [65] = PINGROUP(65, _, _, _, _, _, _, _, _, _), 1125 + [66] = PINGROUP(66, qlink0_request, _, _, _, _, _, _, _, _), 1126 + [67] = PINGROUP(67, qlink0_enable, _, _, _, _, _, _, _, _), 1127 + [68] = PINGROUP(68, qlink1_request, _, _, _, _, _, _, _, _), 1128 + [69] = PINGROUP(69, qlink1_enable, _, _, _, _, _, _, _, _), 1129 + [70] = PINGROUP(70, qlink2_request, _, _, _, _, _, _, _, _), 1130 + [71] = PINGROUP(71, qlink2_enable, _, _, _, _, _, _, _, _), 1131 + [72] = PINGROUP(72, qlink3_request, _, _, _, _, _, _, _, _), 1132 + [73] = PINGROUP(73, qlink3_enable, _, _, _, _, _, _, _, _), 1133 + [74] = PINGROUP(74, qlink4_request, _, _, _, _, _, _, _, _), 1134 + [75] = PINGROUP(75, qlink4_enable, _, _, _, _, _, _, _, _), 1135 + [76] = PINGROUP(76, qlink5_request, _, _, _, _, _, _, _, _), 1136 + [77] = PINGROUP(77, qlink5_enable, _, _, _, _, _, _, _, _), 1137 + [78] = PINGROUP(78, qlink6_request, _, _, _, _, _, _, _, _), 1138 + [79] = PINGROUP(79, qlink6_enable, _, _, _, _, _, _, _, _), 1139 + [80] = PINGROUP(80, qlink7_request, _, _, _, _, _, _, _, _), 1140 + [81] = PINGROUP(81, qlink7_enable, _, _, _, _, _, _, _, _), 1141 + [82] = PINGROUP(82, qlink0_wmss, _, _, _, _, _, _, _, _), 1142 + [83] = PINGROUP(83, qlink1_wmss, _, _, _, _, _, _, _, _), 1143 + [84] = PINGROUP(84, qlink4_wmss, _, _, _, _, _, _, _, _), 1144 + [85] = PINGROUP(85, qlink5_wmss, _, _, _, _, _, _, _, _), 1145 + [86] = PINGROUP(86, eth012_int_n, gcc_gp1, _, qdss_cti, _, _, _, _, _), 1146 + [87] = PINGROUP(87, eth345_int_n, gcc_gp2, _, qdss_cti, _, _, _, _, _), 1147 + [88] = PINGROUP(88, eth6_int_n, smb_alert, gcc_gp3, _, 1148 + qdss_gpio, _, _, _, _), 1149 + [89] = PINGROUP(89, phase_flag, cmu_rng, _, 1150 + qdss_gpio, atest_char, _, _, _, _), 1151 + [90] = PINGROUP(90, usb2phy_ac, phase_flag, 1152 + cmu_rng, _, qdss_gpio, 1153 + atest_char, _, _, _), 1154 + [91] = PINGROUP(91, usb_phy, phase_flag, cmu_rng, 1155 + _, qdss_gpio, atest_char, _, _, _), 1156 + [92] = PINGROUP(92, phase_flag, cmu_rng, _, 1157 + qdss_gpio, atest_char, _, _, _, _), 1158 + [93] = PINGROUP(93, vfr_0, qdss_cti, _, _, _, _, _, _, _), 1159 + [94] = PINGROUP(94, vfr_1, qdss_cti, _, _, _, _, _, _, _), 1160 + [95] = PINGROUP(95, phase_flag, _, qdss_gpio, 1161 + atest_char, _, _, _, _, _), 1162 + [96] = PINGROUP(96, phase_flag, _, qdss_gpio, _, _, _, _, _, _), 1163 + [97] = PINGROUP(97, phase_flag, _, qdss_gpio, _, _, _, _, _, _), 1164 + [98] = PINGROUP(98, pll_clk, _, _, _, _, _, _, _, _), 1165 + [99] = PINGROUP(99, pcie_clkreqn, char_exec, _, _, _, _, _, _, _), 1166 + [100] = PINGROUP(100, char_exec, _, _, _, _, _, _, _, _), 1167 + [101] = PINGROUP(101, smb_alert, _, _, _, _, _, _, _, _), 1168 + [102] = PINGROUP(102, phase_flag, _, qdss_gpio, _, _, _, _, _, _), 1169 + [103] = PINGROUP(103, cmo_pri, qdss_gpio, _, _, _, _, _, _, _), 1170 + [104] = PINGROUP(104, _, _, _, _, _, _, _, _, _), 1171 + [105] = PINGROUP(105, _, _, _, _, _, _, _, _, _), 1172 + [106] = PINGROUP(106, _, _, _, _, _, _, _, _, _), 1173 + [107] = PINGROUP(107, _, _, _, _, _, _, _, _, _), 1174 + [108] = PINGROUP(108, _, _, _, _, _, _, _, _, _), 1175 + [109] = PINGROUP(109, _, _, _, _, _, _, _, _, _), 1176 + [110] = PINGROUP(110, _, _, _, _, _, _, _, _, _), 1177 + [111] = PINGROUP(111, _, _, _, _, _, _, _, _, _), 1178 + [112] = PINGROUP(112, _, _, _, _, _, _, _, _, _), 1179 + [113] = PINGROUP(113, _, _, _, _, _, _, _, _, _), 1180 + [114] = PINGROUP(114, qspi0, tb_trig, _, 1181 + atest_usb, ddr_pxi0, _, _, _, _), 1182 + [115] = PINGROUP(115, qspi1, _, atest_usb, 1183 + ddr_pxi0, _, _, _, _, _), 1184 + [116] = PINGROUP(116, qspi2, _, atest_usb, 1185 + ddr_pxi1, _, _, _, _, _), 1186 + [117] = PINGROUP(117, qspi3, _, atest_usb, 1187 + ddr_pxi1, _, _, _, _, _), 1188 + [118] = PINGROUP(118, _, atest_usb, ddr_pxi2, _, _, _, _, _, _), 1189 + [119] = PINGROUP(119, _, _, ddr_pxi2, _, _, _, _, _, _), 1190 + [120] = PINGROUP(120, _, _, ddr_pxi3, _, _, _, _, _, _), 1191 + [121] = PINGROUP(121, _, ddr_pxi3, _, _, _, _, _, _, _), 1192 + [122] = PINGROUP(122, _, ddr_pxi4, _, _, _, _, _, _, _), 1193 + [123] = PINGROUP(123, _, ddr_pxi4, _, _, _, _, _, _, _), 1194 + [124] = PINGROUP(124, _, ddr_pxi5, _, _, _, _, _, _, _), 1195 + [125] = PINGROUP(125, qspi_cs, _, ddr_pxi5, _, _, _, _, _, _), 1196 + [126] = PINGROUP(126, qspi_clk, _, ddr_pxi6, _, _, _, _, _, _), 1197 + [127] = PINGROUP(127, _, ddr_pxi6, _, _, _, _, _, _, _), 1198 + [128] = PINGROUP(128, qup22, _, ddr_pxi7, _, _, _, _, _, _), 1199 + [129] = PINGROUP(129, qup22, ddr_pxi7, _, _, _, _, _, _, _), 1200 + [130] = PINGROUP(130, qup05, qup06, jitter_bist_ref, 1201 + qdss_cti, _, _, _, _, _), 1202 + [131] = PINGROUP(131, qup05, qup06, qdss_cti, _, _, _, _, _, _), 1203 + [132] = PINGROUP(132, qup06, qup05, smb_dat, 1204 + qdss_cti, _, _, _, _, _), 1205 + [133] = PINGROUP(133, qup06, qup05, smb_clk, 1206 + qdss_cti, _, _, _, _, _), 1207 + [134] = PINGROUP(134, qup08, qup07, gcc_gp1, _, 1208 + qdss_cti, _, _, _, _), 1209 + [135] = PINGROUP(135, qup08, qup07, gcc_gp2, _, 1210 + qdss_cti, vsense_trigger, _, _, _), 1211 + [136] = PINGROUP(136, gcc_gp3, dbg_out_clk, _, _, _, _, _, _, _), 1212 + [137] = PINGROUP(137, _, _, _, _, _, _, _, _, _), 1213 + [138] = PINGROUP(138, qlink2_wmss, _, _, _, _, _, _, _, _), 1214 + [139] = PINGROUP(139, qlink3_wmss, _, _, _, _, _, _, _, _), 1215 + [140] = PINGROUP(140, _, _, _, _, _, _, _, _, _), 1216 + [141] = PINGROUP(141, intr_c, _, _, _, _, _, _, _, _), 1217 + [142] = PINGROUP(142, intr_c, _, _, _, _, _, _, _, _), 1218 + [143] = PINGROUP(143, intr_c, _, _, _, _, _, _, _, _), 1219 + [144] = PINGROUP(144, qdss_cti, _, _, _, _, _, _, _, _), 1220 + [145] = PINGROUP(145, qdss_cti, _, _, _, _, _, _, _, _), 1221 + [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _), 1222 + [147] = PINGROUP(147, _, _, _, _, _, _, _, _, _), 1223 + [148] = PINGROUP(148, _, _, _, _, _, _, _, _, _), 1224 + [149] = PINGROUP(149, _, _, _, _, _, _, _, _, _), 1225 + [150] = PINGROUP(150, _, _, _, _, _, _, _, _, _), 1226 + [151] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x9e000, 0, 0), 1227 + [152] = SDC_QDSD_PINGROUP(sdc1_clk, 0x9d000, 13, 6), 1228 + [153] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x9d000, 11, 3), 1229 + [154] = SDC_QDSD_PINGROUP(sdc1_data, 0x9d000, 9, 0), 1230 + }; 1231 + static const struct msm_pinctrl_soc_data qdu1000_tlmm = { 1232 + .pins = qdu1000_pins, 1233 + .npins = ARRAY_SIZE(qdu1000_pins), 1234 + .functions = qdu1000_functions, 1235 + .nfunctions = ARRAY_SIZE(qdu1000_functions), 1236 + .groups = qdu1000_groups, 1237 + .ngroups = ARRAY_SIZE(qdu1000_groups), 1238 + .ngpios = 151, 1239 + }; 1240 + 1241 + static int qdu1000_tlmm_probe(struct platform_device *pdev) 1242 + { 1243 + return msm_pinctrl_probe(pdev, &qdu1000_tlmm); 1244 + } 1245 + 1246 + static const struct of_device_id qdu1000_tlmm_of_match[] = { 1247 + { .compatible = "qcom,qdu1000-tlmm", }, 1248 + { }, 1249 + }; 1250 + MODULE_DEVICE_TABLE(of, qdu1000_tlmm_of_match); 1251 + 1252 + static struct platform_driver qdu1000_tlmm_driver = { 1253 + .driver = { 1254 + .name = "qdu1000-tlmm", 1255 + .of_match_table = qdu1000_tlmm_of_match, 1256 + }, 1257 + .probe = qdu1000_tlmm_probe, 1258 + .remove = msm_pinctrl_remove, 1259 + }; 1260 + 1261 + static int __init qdu1000_tlmm_init(void) 1262 + { 1263 + return platform_driver_register(&qdu1000_tlmm_driver); 1264 + } 1265 + arch_initcall(qdu1000_tlmm_init); 1266 + 1267 + static void __exit qdu1000_tlmm_exit(void) 1268 + { 1269 + platform_driver_unregister(&qdu1000_tlmm_driver); 1270 + } 1271 + module_exit(qdu1000_tlmm_exit); 1272 + 1273 + MODULE_DESCRIPTION("QTI QDU1000 TLMM driver"); 1274 + MODULE_LICENSE("GPL");
+1537
drivers/pinctrl/qcom/pinctrl-sa8775p.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2023, Linaro Limited 5 + */ 6 + 7 + #include <linux/module.h> 8 + #include <linux/of.h> 9 + #include <linux/platform_device.h> 10 + #include <linux/pinctrl/pinctrl.h> 11 + 12 + #include "pinctrl-msm.h" 13 + 14 + #define FUNCTION(fname) \ 15 + [msm_mux_##fname] = { \ 16 + .name = #fname, \ 17 + .groups = fname##_groups, \ 18 + .ngroups = ARRAY_SIZE(fname##_groups), \ 19 + } 20 + 21 + #define REG_BASE 0x100000 22 + #define REG_SIZE 0x1000 23 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)\ 24 + { \ 25 + .name = "gpio" #id, \ 26 + .pins = gpio##id##_pins, \ 27 + .npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins), \ 28 + .funcs = (int[]){ \ 29 + msm_mux_gpio, /* gpio mode */ \ 30 + msm_mux_##f1, \ 31 + msm_mux_##f2, \ 32 + msm_mux_##f3, \ 33 + msm_mux_##f4, \ 34 + msm_mux_##f5, \ 35 + msm_mux_##f6, \ 36 + msm_mux_##f7, \ 37 + msm_mux_##f8, \ 38 + msm_mux_##f9 \ 39 + }, \ 40 + .nfuncs = 10, \ 41 + .ctl_reg = REG_BASE + REG_SIZE * id, \ 42 + .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \ 43 + .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 44 + .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \ 45 + .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 46 + .mux_bit = 2, \ 47 + .pull_bit = 0, \ 48 + .drv_bit = 6, \ 49 + .egpio_enable = 12, \ 50 + .egpio_present = 11, \ 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, ctl, pull, drv) \ 65 + { \ 66 + .name = #pg_name, \ 67 + .pins = pg_name##_pins, \ 68 + .npins = (unsigned int)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 + .mux_bit = -1, \ 75 + .pull_bit = pull, \ 76 + .drv_bit = drv, \ 77 + .oe_bit = -1, \ 78 + .in_bit = -1, \ 79 + .out_bit = -1, \ 80 + .intr_enable_bit = -1, \ 81 + .intr_status_bit = -1, \ 82 + .intr_target_bit = -1, \ 83 + .intr_raw_status_bit = -1, \ 84 + .intr_polarity_bit = -1, \ 85 + .intr_detection_bit = -1, \ 86 + .intr_detection_width = -1, \ 87 + } 88 + 89 + #define UFS_RESET(pg_name, offset) \ 90 + { \ 91 + .name = #pg_name, \ 92 + .pins = pg_name##_pins, \ 93 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 94 + .ctl_reg = offset, \ 95 + .io_reg = offset + 0x4, \ 96 + .intr_cfg_reg = 0, \ 97 + .intr_status_reg = 0, \ 98 + .intr_target_reg = 0, \ 99 + .mux_bit = -1, \ 100 + .pull_bit = 3, \ 101 + .drv_bit = 0, \ 102 + .oe_bit = -1, \ 103 + .in_bit = -1, \ 104 + .out_bit = 0, \ 105 + .intr_enable_bit = -1, \ 106 + .intr_status_bit = -1, \ 107 + .intr_target_bit = -1, \ 108 + .intr_raw_status_bit = -1, \ 109 + .intr_polarity_bit = -1, \ 110 + .intr_detection_bit = -1, \ 111 + .intr_detection_width = -1, \ 112 + } 113 + 114 + #define QUP_I3C(qup_mode, qup_offset) \ 115 + { \ 116 + .mode = qup_mode, \ 117 + .offset = qup_offset, \ 118 + } 119 + 120 + #define QUP_I3C_6_MODE_OFFSET 0xAF000 121 + #define QUP_I3C_7_MODE_OFFSET 0xB0000 122 + #define QUP_I3C_13_MODE_OFFSET 0xB1000 123 + #define QUP_I3C_14_MODE_OFFSET 0xB2000 124 + 125 + static const struct pinctrl_pin_desc sa8775p_pins[] = { 126 + PINCTRL_PIN(0, "GPIO_0"), 127 + PINCTRL_PIN(1, "GPIO_1"), 128 + PINCTRL_PIN(2, "GPIO_2"), 129 + PINCTRL_PIN(3, "GPIO_3"), 130 + PINCTRL_PIN(4, "GPIO_4"), 131 + PINCTRL_PIN(5, "GPIO_5"), 132 + PINCTRL_PIN(6, "GPIO_6"), 133 + PINCTRL_PIN(7, "GPIO_7"), 134 + PINCTRL_PIN(8, "GPIO_8"), 135 + PINCTRL_PIN(9, "GPIO_9"), 136 + PINCTRL_PIN(10, "GPIO_10"), 137 + PINCTRL_PIN(11, "GPIO_11"), 138 + PINCTRL_PIN(12, "GPIO_12"), 139 + PINCTRL_PIN(13, "GPIO_13"), 140 + PINCTRL_PIN(14, "GPIO_14"), 141 + PINCTRL_PIN(15, "GPIO_15"), 142 + PINCTRL_PIN(16, "GPIO_16"), 143 + PINCTRL_PIN(17, "GPIO_17"), 144 + PINCTRL_PIN(18, "GPIO_18"), 145 + PINCTRL_PIN(19, "GPIO_19"), 146 + PINCTRL_PIN(20, "GPIO_20"), 147 + PINCTRL_PIN(21, "GPIO_21"), 148 + PINCTRL_PIN(22, "GPIO_22"), 149 + PINCTRL_PIN(23, "GPIO_23"), 150 + PINCTRL_PIN(24, "GPIO_24"), 151 + PINCTRL_PIN(25, "GPIO_25"), 152 + PINCTRL_PIN(26, "GPIO_26"), 153 + PINCTRL_PIN(27, "GPIO_27"), 154 + PINCTRL_PIN(28, "GPIO_28"), 155 + PINCTRL_PIN(29, "GPIO_29"), 156 + PINCTRL_PIN(30, "GPIO_30"), 157 + PINCTRL_PIN(31, "GPIO_31"), 158 + PINCTRL_PIN(32, "GPIO_32"), 159 + PINCTRL_PIN(33, "GPIO_33"), 160 + PINCTRL_PIN(34, "GPIO_34"), 161 + PINCTRL_PIN(35, "GPIO_35"), 162 + PINCTRL_PIN(36, "GPIO_36"), 163 + PINCTRL_PIN(37, "GPIO_37"), 164 + PINCTRL_PIN(38, "GPIO_38"), 165 + PINCTRL_PIN(39, "GPIO_39"), 166 + PINCTRL_PIN(40, "GPIO_40"), 167 + PINCTRL_PIN(41, "GPIO_41"), 168 + PINCTRL_PIN(42, "GPIO_42"), 169 + PINCTRL_PIN(43, "GPIO_43"), 170 + PINCTRL_PIN(44, "GPIO_44"), 171 + PINCTRL_PIN(45, "GPIO_45"), 172 + PINCTRL_PIN(46, "GPIO_46"), 173 + PINCTRL_PIN(47, "GPIO_47"), 174 + PINCTRL_PIN(48, "GPIO_48"), 175 + PINCTRL_PIN(49, "GPIO_49"), 176 + PINCTRL_PIN(50, "GPIO_50"), 177 + PINCTRL_PIN(51, "GPIO_51"), 178 + PINCTRL_PIN(52, "GPIO_52"), 179 + PINCTRL_PIN(53, "GPIO_53"), 180 + PINCTRL_PIN(54, "GPIO_54"), 181 + PINCTRL_PIN(55, "GPIO_55"), 182 + PINCTRL_PIN(56, "GPIO_56"), 183 + PINCTRL_PIN(57, "GPIO_57"), 184 + PINCTRL_PIN(58, "GPIO_58"), 185 + PINCTRL_PIN(59, "GPIO_59"), 186 + PINCTRL_PIN(60, "GPIO_60"), 187 + PINCTRL_PIN(61, "GPIO_61"), 188 + PINCTRL_PIN(62, "GPIO_62"), 189 + PINCTRL_PIN(63, "GPIO_63"), 190 + PINCTRL_PIN(64, "GPIO_64"), 191 + PINCTRL_PIN(65, "GPIO_65"), 192 + PINCTRL_PIN(66, "GPIO_66"), 193 + PINCTRL_PIN(67, "GPIO_67"), 194 + PINCTRL_PIN(68, "GPIO_68"), 195 + PINCTRL_PIN(69, "GPIO_69"), 196 + PINCTRL_PIN(70, "GPIO_70"), 197 + PINCTRL_PIN(71, "GPIO_71"), 198 + PINCTRL_PIN(72, "GPIO_72"), 199 + PINCTRL_PIN(73, "GPIO_73"), 200 + PINCTRL_PIN(74, "GPIO_74"), 201 + PINCTRL_PIN(75, "GPIO_75"), 202 + PINCTRL_PIN(76, "GPIO_76"), 203 + PINCTRL_PIN(77, "GPIO_77"), 204 + PINCTRL_PIN(78, "GPIO_78"), 205 + PINCTRL_PIN(79, "GPIO_79"), 206 + PINCTRL_PIN(80, "GPIO_80"), 207 + PINCTRL_PIN(81, "GPIO_81"), 208 + PINCTRL_PIN(82, "GPIO_82"), 209 + PINCTRL_PIN(83, "GPIO_83"), 210 + PINCTRL_PIN(84, "GPIO_84"), 211 + PINCTRL_PIN(85, "GPIO_85"), 212 + PINCTRL_PIN(86, "GPIO_86"), 213 + PINCTRL_PIN(87, "GPIO_87"), 214 + PINCTRL_PIN(88, "GPIO_88"), 215 + PINCTRL_PIN(89, "GPIO_89"), 216 + PINCTRL_PIN(90, "GPIO_90"), 217 + PINCTRL_PIN(91, "GPIO_91"), 218 + PINCTRL_PIN(92, "GPIO_92"), 219 + PINCTRL_PIN(93, "GPIO_93"), 220 + PINCTRL_PIN(94, "GPIO_94"), 221 + PINCTRL_PIN(95, "GPIO_95"), 222 + PINCTRL_PIN(96, "GPIO_96"), 223 + PINCTRL_PIN(97, "GPIO_97"), 224 + PINCTRL_PIN(98, "GPIO_98"), 225 + PINCTRL_PIN(99, "GPIO_99"), 226 + PINCTRL_PIN(100, "GPIO_100"), 227 + PINCTRL_PIN(101, "GPIO_101"), 228 + PINCTRL_PIN(102, "GPIO_102"), 229 + PINCTRL_PIN(103, "GPIO_103"), 230 + PINCTRL_PIN(104, "GPIO_104"), 231 + PINCTRL_PIN(105, "GPIO_105"), 232 + PINCTRL_PIN(106, "GPIO_106"), 233 + PINCTRL_PIN(107, "GPIO_107"), 234 + PINCTRL_PIN(108, "GPIO_108"), 235 + PINCTRL_PIN(109, "GPIO_109"), 236 + PINCTRL_PIN(110, "GPIO_110"), 237 + PINCTRL_PIN(111, "GPIO_111"), 238 + PINCTRL_PIN(112, "GPIO_112"), 239 + PINCTRL_PIN(113, "GPIO_113"), 240 + PINCTRL_PIN(114, "GPIO_114"), 241 + PINCTRL_PIN(115, "GPIO_115"), 242 + PINCTRL_PIN(116, "GPIO_116"), 243 + PINCTRL_PIN(117, "GPIO_117"), 244 + PINCTRL_PIN(118, "GPIO_118"), 245 + PINCTRL_PIN(119, "GPIO_119"), 246 + PINCTRL_PIN(120, "GPIO_120"), 247 + PINCTRL_PIN(121, "GPIO_121"), 248 + PINCTRL_PIN(122, "GPIO_122"), 249 + PINCTRL_PIN(123, "GPIO_123"), 250 + PINCTRL_PIN(124, "GPIO_124"), 251 + PINCTRL_PIN(125, "GPIO_125"), 252 + PINCTRL_PIN(126, "GPIO_126"), 253 + PINCTRL_PIN(127, "GPIO_127"), 254 + PINCTRL_PIN(128, "GPIO_128"), 255 + PINCTRL_PIN(129, "GPIO_129"), 256 + PINCTRL_PIN(130, "GPIO_130"), 257 + PINCTRL_PIN(131, "GPIO_131"), 258 + PINCTRL_PIN(132, "GPIO_132"), 259 + PINCTRL_PIN(133, "GPIO_133"), 260 + PINCTRL_PIN(134, "GPIO_134"), 261 + PINCTRL_PIN(135, "GPIO_135"), 262 + PINCTRL_PIN(136, "GPIO_136"), 263 + PINCTRL_PIN(137, "GPIO_137"), 264 + PINCTRL_PIN(138, "GPIO_138"), 265 + PINCTRL_PIN(139, "GPIO_139"), 266 + PINCTRL_PIN(140, "GPIO_140"), 267 + PINCTRL_PIN(141, "GPIO_141"), 268 + PINCTRL_PIN(142, "GPIO_142"), 269 + PINCTRL_PIN(143, "GPIO_143"), 270 + PINCTRL_PIN(144, "GPIO_144"), 271 + PINCTRL_PIN(145, "GPIO_145"), 272 + PINCTRL_PIN(146, "GPIO_146"), 273 + PINCTRL_PIN(147, "GPIO_147"), 274 + PINCTRL_PIN(148, "GPIO_148"), 275 + PINCTRL_PIN(149, "UFS_RESET"), 276 + PINCTRL_PIN(150, "SDC1_RCLK"), 277 + PINCTRL_PIN(151, "SDC1_CLK"), 278 + PINCTRL_PIN(152, "SDC1_CMD"), 279 + PINCTRL_PIN(153, "SDC1_DATA"), 280 + }; 281 + 282 + #define DECLARE_MSM_GPIO_PINS(pin) \ 283 + static const unsigned int gpio##pin##_pins[] = { pin } 284 + DECLARE_MSM_GPIO_PINS(0); 285 + DECLARE_MSM_GPIO_PINS(1); 286 + DECLARE_MSM_GPIO_PINS(2); 287 + DECLARE_MSM_GPIO_PINS(3); 288 + DECLARE_MSM_GPIO_PINS(4); 289 + DECLARE_MSM_GPIO_PINS(5); 290 + DECLARE_MSM_GPIO_PINS(6); 291 + DECLARE_MSM_GPIO_PINS(7); 292 + DECLARE_MSM_GPIO_PINS(8); 293 + DECLARE_MSM_GPIO_PINS(9); 294 + DECLARE_MSM_GPIO_PINS(10); 295 + DECLARE_MSM_GPIO_PINS(11); 296 + DECLARE_MSM_GPIO_PINS(12); 297 + DECLARE_MSM_GPIO_PINS(13); 298 + DECLARE_MSM_GPIO_PINS(14); 299 + DECLARE_MSM_GPIO_PINS(15); 300 + DECLARE_MSM_GPIO_PINS(16); 301 + DECLARE_MSM_GPIO_PINS(17); 302 + DECLARE_MSM_GPIO_PINS(18); 303 + DECLARE_MSM_GPIO_PINS(19); 304 + DECLARE_MSM_GPIO_PINS(20); 305 + DECLARE_MSM_GPIO_PINS(21); 306 + DECLARE_MSM_GPIO_PINS(22); 307 + DECLARE_MSM_GPIO_PINS(23); 308 + DECLARE_MSM_GPIO_PINS(24); 309 + DECLARE_MSM_GPIO_PINS(25); 310 + DECLARE_MSM_GPIO_PINS(26); 311 + DECLARE_MSM_GPIO_PINS(27); 312 + DECLARE_MSM_GPIO_PINS(28); 313 + DECLARE_MSM_GPIO_PINS(29); 314 + DECLARE_MSM_GPIO_PINS(30); 315 + DECLARE_MSM_GPIO_PINS(31); 316 + DECLARE_MSM_GPIO_PINS(32); 317 + DECLARE_MSM_GPIO_PINS(33); 318 + DECLARE_MSM_GPIO_PINS(34); 319 + DECLARE_MSM_GPIO_PINS(35); 320 + DECLARE_MSM_GPIO_PINS(36); 321 + DECLARE_MSM_GPIO_PINS(37); 322 + DECLARE_MSM_GPIO_PINS(38); 323 + DECLARE_MSM_GPIO_PINS(39); 324 + DECLARE_MSM_GPIO_PINS(40); 325 + DECLARE_MSM_GPIO_PINS(41); 326 + DECLARE_MSM_GPIO_PINS(42); 327 + DECLARE_MSM_GPIO_PINS(43); 328 + DECLARE_MSM_GPIO_PINS(44); 329 + DECLARE_MSM_GPIO_PINS(45); 330 + DECLARE_MSM_GPIO_PINS(46); 331 + DECLARE_MSM_GPIO_PINS(47); 332 + DECLARE_MSM_GPIO_PINS(48); 333 + DECLARE_MSM_GPIO_PINS(49); 334 + DECLARE_MSM_GPIO_PINS(50); 335 + DECLARE_MSM_GPIO_PINS(51); 336 + DECLARE_MSM_GPIO_PINS(52); 337 + DECLARE_MSM_GPIO_PINS(53); 338 + DECLARE_MSM_GPIO_PINS(54); 339 + DECLARE_MSM_GPIO_PINS(55); 340 + DECLARE_MSM_GPIO_PINS(56); 341 + DECLARE_MSM_GPIO_PINS(57); 342 + DECLARE_MSM_GPIO_PINS(58); 343 + DECLARE_MSM_GPIO_PINS(59); 344 + DECLARE_MSM_GPIO_PINS(60); 345 + DECLARE_MSM_GPIO_PINS(61); 346 + DECLARE_MSM_GPIO_PINS(62); 347 + DECLARE_MSM_GPIO_PINS(63); 348 + DECLARE_MSM_GPIO_PINS(64); 349 + DECLARE_MSM_GPIO_PINS(65); 350 + DECLARE_MSM_GPIO_PINS(66); 351 + DECLARE_MSM_GPIO_PINS(67); 352 + DECLARE_MSM_GPIO_PINS(68); 353 + DECLARE_MSM_GPIO_PINS(69); 354 + DECLARE_MSM_GPIO_PINS(70); 355 + DECLARE_MSM_GPIO_PINS(71); 356 + DECLARE_MSM_GPIO_PINS(72); 357 + DECLARE_MSM_GPIO_PINS(73); 358 + DECLARE_MSM_GPIO_PINS(74); 359 + DECLARE_MSM_GPIO_PINS(75); 360 + DECLARE_MSM_GPIO_PINS(76); 361 + DECLARE_MSM_GPIO_PINS(77); 362 + DECLARE_MSM_GPIO_PINS(78); 363 + DECLARE_MSM_GPIO_PINS(79); 364 + DECLARE_MSM_GPIO_PINS(80); 365 + DECLARE_MSM_GPIO_PINS(81); 366 + DECLARE_MSM_GPIO_PINS(82); 367 + DECLARE_MSM_GPIO_PINS(83); 368 + DECLARE_MSM_GPIO_PINS(84); 369 + DECLARE_MSM_GPIO_PINS(85); 370 + DECLARE_MSM_GPIO_PINS(86); 371 + DECLARE_MSM_GPIO_PINS(87); 372 + DECLARE_MSM_GPIO_PINS(88); 373 + DECLARE_MSM_GPIO_PINS(89); 374 + DECLARE_MSM_GPIO_PINS(90); 375 + DECLARE_MSM_GPIO_PINS(91); 376 + DECLARE_MSM_GPIO_PINS(92); 377 + DECLARE_MSM_GPIO_PINS(93); 378 + DECLARE_MSM_GPIO_PINS(94); 379 + DECLARE_MSM_GPIO_PINS(95); 380 + DECLARE_MSM_GPIO_PINS(96); 381 + DECLARE_MSM_GPIO_PINS(97); 382 + DECLARE_MSM_GPIO_PINS(98); 383 + DECLARE_MSM_GPIO_PINS(99); 384 + DECLARE_MSM_GPIO_PINS(100); 385 + DECLARE_MSM_GPIO_PINS(101); 386 + DECLARE_MSM_GPIO_PINS(102); 387 + DECLARE_MSM_GPIO_PINS(103); 388 + DECLARE_MSM_GPIO_PINS(104); 389 + DECLARE_MSM_GPIO_PINS(105); 390 + DECLARE_MSM_GPIO_PINS(106); 391 + DECLARE_MSM_GPIO_PINS(107); 392 + DECLARE_MSM_GPIO_PINS(108); 393 + DECLARE_MSM_GPIO_PINS(109); 394 + DECLARE_MSM_GPIO_PINS(110); 395 + DECLARE_MSM_GPIO_PINS(111); 396 + DECLARE_MSM_GPIO_PINS(112); 397 + DECLARE_MSM_GPIO_PINS(113); 398 + DECLARE_MSM_GPIO_PINS(114); 399 + DECLARE_MSM_GPIO_PINS(115); 400 + DECLARE_MSM_GPIO_PINS(116); 401 + DECLARE_MSM_GPIO_PINS(117); 402 + DECLARE_MSM_GPIO_PINS(118); 403 + DECLARE_MSM_GPIO_PINS(119); 404 + DECLARE_MSM_GPIO_PINS(120); 405 + DECLARE_MSM_GPIO_PINS(121); 406 + DECLARE_MSM_GPIO_PINS(122); 407 + DECLARE_MSM_GPIO_PINS(123); 408 + DECLARE_MSM_GPIO_PINS(124); 409 + DECLARE_MSM_GPIO_PINS(125); 410 + DECLARE_MSM_GPIO_PINS(126); 411 + DECLARE_MSM_GPIO_PINS(127); 412 + DECLARE_MSM_GPIO_PINS(128); 413 + DECLARE_MSM_GPIO_PINS(129); 414 + DECLARE_MSM_GPIO_PINS(130); 415 + DECLARE_MSM_GPIO_PINS(131); 416 + DECLARE_MSM_GPIO_PINS(132); 417 + DECLARE_MSM_GPIO_PINS(133); 418 + DECLARE_MSM_GPIO_PINS(134); 419 + DECLARE_MSM_GPIO_PINS(135); 420 + DECLARE_MSM_GPIO_PINS(136); 421 + DECLARE_MSM_GPIO_PINS(137); 422 + DECLARE_MSM_GPIO_PINS(138); 423 + DECLARE_MSM_GPIO_PINS(139); 424 + DECLARE_MSM_GPIO_PINS(140); 425 + DECLARE_MSM_GPIO_PINS(141); 426 + DECLARE_MSM_GPIO_PINS(142); 427 + DECLARE_MSM_GPIO_PINS(143); 428 + DECLARE_MSM_GPIO_PINS(144); 429 + DECLARE_MSM_GPIO_PINS(145); 430 + DECLARE_MSM_GPIO_PINS(146); 431 + DECLARE_MSM_GPIO_PINS(147); 432 + DECLARE_MSM_GPIO_PINS(148); 433 + 434 + static const unsigned int ufs_reset_pins[] = { 149 }; 435 + static const unsigned int sdc1_rclk_pins[] = { 150 }; 436 + static const unsigned int sdc1_clk_pins[] = { 151 }; 437 + static const unsigned int sdc1_cmd_pins[] = { 152 }; 438 + static const unsigned int sdc1_data_pins[] = { 153 }; 439 + 440 + enum sa8775p_functions { 441 + msm_mux_gpio, 442 + msm_mux_atest_char, 443 + msm_mux_atest_usb2, 444 + msm_mux_audio_ref, 445 + msm_mux_cam_mclk, 446 + msm_mux_cci_async, 447 + msm_mux_cci_i2c, 448 + msm_mux_cci_timer0, 449 + msm_mux_cci_timer1, 450 + msm_mux_cci_timer2, 451 + msm_mux_cci_timer3, 452 + msm_mux_cci_timer4, 453 + msm_mux_cci_timer5, 454 + msm_mux_cci_timer6, 455 + msm_mux_cci_timer7, 456 + msm_mux_cci_timer8, 457 + msm_mux_cci_timer9, 458 + msm_mux_cri_trng, 459 + msm_mux_cri_trng0, 460 + msm_mux_cri_trng1, 461 + msm_mux_dbg_out, 462 + msm_mux_ddr_bist, 463 + msm_mux_ddr_pxi0, 464 + msm_mux_ddr_pxi1, 465 + msm_mux_ddr_pxi2, 466 + msm_mux_ddr_pxi3, 467 + msm_mux_ddr_pxi4, 468 + msm_mux_ddr_pxi5, 469 + msm_mux_edp0_hot, 470 + msm_mux_edp0_lcd, 471 + msm_mux_edp1_hot, 472 + msm_mux_edp1_lcd, 473 + msm_mux_edp2_hot, 474 + msm_mux_edp2_lcd, 475 + msm_mux_edp3_hot, 476 + msm_mux_edp3_lcd, 477 + msm_mux_emac0_mcg0, 478 + msm_mux_emac0_mcg1, 479 + msm_mux_emac0_mcg2, 480 + msm_mux_emac0_mcg3, 481 + msm_mux_emac0_mdc, 482 + msm_mux_emac0_mdio, 483 + msm_mux_emac0_ptp_aux, 484 + msm_mux_emac0_ptp_pps, 485 + msm_mux_emac1_mcg0, 486 + msm_mux_emac1_mcg1, 487 + msm_mux_emac1_mcg2, 488 + msm_mux_emac1_mcg3, 489 + msm_mux_emac1_mdc, 490 + msm_mux_emac1_mdio, 491 + msm_mux_emac1_ptp_aux, 492 + msm_mux_emac1_ptp_pps, 493 + msm_mux_gcc_gp1, 494 + msm_mux_gcc_gp2, 495 + msm_mux_gcc_gp3, 496 + msm_mux_gcc_gp4, 497 + msm_mux_gcc_gp5, 498 + msm_mux_hs0_mi2s, 499 + msm_mux_hs1_mi2s, 500 + msm_mux_hs2_mi2s, 501 + msm_mux_ibi_i3c, 502 + msm_mux_jitter_bist, 503 + msm_mux_mdp0_vsync0, 504 + msm_mux_mdp0_vsync1, 505 + msm_mux_mdp0_vsync2, 506 + msm_mux_mdp0_vsync3, 507 + msm_mux_mdp0_vsync4, 508 + msm_mux_mdp0_vsync5, 509 + msm_mux_mdp0_vsync6, 510 + msm_mux_mdp0_vsync7, 511 + msm_mux_mdp0_vsync8, 512 + msm_mux_mdp1_vsync0, 513 + msm_mux_mdp1_vsync1, 514 + msm_mux_mdp1_vsync2, 515 + msm_mux_mdp1_vsync3, 516 + msm_mux_mdp1_vsync4, 517 + msm_mux_mdp1_vsync5, 518 + msm_mux_mdp1_vsync6, 519 + msm_mux_mdp1_vsync7, 520 + msm_mux_mdp1_vsync8, 521 + msm_mux_mdp_vsync, 522 + msm_mux_mi2s1_data0, 523 + msm_mux_mi2s1_data1, 524 + msm_mux_mi2s1_sck, 525 + msm_mux_mi2s1_ws, 526 + msm_mux_mi2s2_data0, 527 + msm_mux_mi2s2_data1, 528 + msm_mux_mi2s2_sck, 529 + msm_mux_mi2s2_ws, 530 + msm_mux_mi2s_mclk0, 531 + msm_mux_mi2s_mclk1, 532 + msm_mux_pcie0_clkreq, 533 + msm_mux_pcie1_clkreq, 534 + msm_mux_phase_flag, 535 + msm_mux_pll_bist, 536 + msm_mux_pll_clk, 537 + msm_mux_prng_rosc0, 538 + msm_mux_prng_rosc1, 539 + msm_mux_prng_rosc2, 540 + msm_mux_prng_rosc3, 541 + msm_mux_qdss_cti, 542 + msm_mux_qdss_gpio, 543 + msm_mux_qup0_se0, 544 + msm_mux_qup0_se1, 545 + msm_mux_qup0_se2, 546 + msm_mux_qup0_se3, 547 + msm_mux_qup0_se4, 548 + msm_mux_qup0_se5, 549 + msm_mux_qup1_se0, 550 + msm_mux_qup1_se1, 551 + msm_mux_qup1_se2, 552 + msm_mux_qup1_se3, 553 + msm_mux_qup1_se4, 554 + msm_mux_qup1_se5, 555 + msm_mux_qup1_se6, 556 + msm_mux_qup2_se0, 557 + msm_mux_qup2_se1, 558 + msm_mux_qup2_se2, 559 + msm_mux_qup2_se3, 560 + msm_mux_qup2_se4, 561 + msm_mux_qup2_se5, 562 + msm_mux_qup2_se6, 563 + msm_mux_qup3_se0, 564 + msm_mux_sail_top, 565 + msm_mux_sailss_emac0, 566 + msm_mux_sailss_ospi, 567 + msm_mux_sgmii_phy, 568 + msm_mux_tb_trig, 569 + msm_mux_tgu_ch0, 570 + msm_mux_tgu_ch1, 571 + msm_mux_tgu_ch2, 572 + msm_mux_tgu_ch3, 573 + msm_mux_tgu_ch4, 574 + msm_mux_tgu_ch5, 575 + msm_mux_tsense_pwm1, 576 + msm_mux_tsense_pwm2, 577 + msm_mux_tsense_pwm3, 578 + msm_mux_tsense_pwm4, 579 + msm_mux_usb2phy_ac, 580 + msm_mux_vsense_trigger, 581 + msm_mux__, 582 + }; 583 + 584 + static const char * const gpio_groups[] = { 585 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 586 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 587 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 588 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 589 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 590 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 591 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 592 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 593 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 594 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 595 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 596 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 597 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 598 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 599 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 600 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 601 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 602 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 603 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 604 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 605 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 606 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 607 + "gpio147", "gpio148", 608 + }; 609 + 610 + static const char * const atest_char_groups[] = { 611 + "gpio27", "gpio58", "gpio59", "gpio89", "gpio90", 612 + }; 613 + 614 + static const char * const atest_usb2_groups[] = { 615 + "gpio58", "gpio59", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", 616 + "gpio91", "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", 617 + "gpio105", 618 + }; 619 + 620 + static const char * const audio_ref_groups[] = { 621 + "gpio113", 622 + }; 623 + 624 + static const char * const cam_mclk_groups[] = { 625 + "gpio72", "gpio73", "gpio74", "gpio75", 626 + }; 627 + 628 + static const char * const cci_async_groups[] = { 629 + "gpio50", "gpio66", "gpio68", "gpio69", "gpio70", "gpio71", 630 + }; 631 + 632 + static const char * const cci_i2c_groups[] = { 633 + "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", 634 + "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65", 635 + "gpio66", "gpio67", 636 + }; 637 + 638 + static const char * const cci_timer0_groups[] = { 639 + "gpio68", 640 + }; 641 + 642 + static const char * const cci_timer1_groups[] = { 643 + "gpio69", 644 + }; 645 + 646 + static const char * const cci_timer2_groups[] = { 647 + "gpio70", 648 + }; 649 + 650 + static const char * const cci_timer3_groups[] = { 651 + "gpio71", 652 + }; 653 + 654 + static const char * const cci_timer4_groups[] = { 655 + "gpio52", 656 + }; 657 + 658 + static const char * const cci_timer5_groups[] = { 659 + "gpio53", 660 + }; 661 + 662 + static const char * const cci_timer6_groups[] = { 663 + "gpio54", 664 + }; 665 + 666 + static const char * const cci_timer7_groups[] = { 667 + "gpio55", 668 + }; 669 + 670 + static const char * const cci_timer8_groups[] = { 671 + "gpio56", 672 + }; 673 + 674 + static const char * const cci_timer9_groups[] = { 675 + "gpio57", 676 + }; 677 + 678 + static const char * const cri_trng_groups[] = { 679 + "gpio99", 680 + }; 681 + 682 + static const char * const cri_trng0_groups[] = { 683 + "gpio97", 684 + }; 685 + 686 + static const char * const cri_trng1_groups[] = { 687 + "gpio98", 688 + }; 689 + 690 + static const char * const dbg_out_groups[] = { 691 + "gpio144", 692 + }; 693 + 694 + static const char * const ddr_bist_groups[] = { 695 + "gpio56", "gpio57", "gpio58", "gpio59", 696 + }; 697 + 698 + static const char * const ddr_pxi0_groups[] = { 699 + "gpio33", "gpio34", 700 + }; 701 + 702 + static const char * const ddr_pxi1_groups[] = { 703 + "gpio52", "gpio53", 704 + }; 705 + 706 + static const char * const ddr_pxi2_groups[] = { 707 + "gpio55", "gpio86", 708 + }; 709 + 710 + static const char * const ddr_pxi3_groups[] = { 711 + "gpio87", "gpio88", 712 + }; 713 + 714 + static const char * const ddr_pxi4_groups[] = { 715 + "gpio89", "gpio90", 716 + }; 717 + 718 + static const char * const ddr_pxi5_groups[] = { 719 + "gpio118", "gpio119", 720 + }; 721 + 722 + static const char * const edp0_hot_groups[] = { 723 + "gpio101", 724 + }; 725 + 726 + static const char * const edp0_lcd_groups[] = { 727 + "gpio44", 728 + }; 729 + 730 + static const char * const edp1_hot_groups[] = { 731 + "gpio102", 732 + }; 733 + 734 + static const char * const edp1_lcd_groups[] = { 735 + "gpio45", 736 + }; 737 + 738 + static const char * const edp2_hot_groups[] = { 739 + "gpio104", 740 + }; 741 + 742 + static const char * const edp2_lcd_groups[] = { 743 + "gpio48", 744 + }; 745 + 746 + static const char * const edp3_hot_groups[] = { 747 + "gpio103", 748 + }; 749 + 750 + static const char * const edp3_lcd_groups[] = { 751 + "gpio49", 752 + }; 753 + 754 + static const char * const emac0_mcg0_groups[] = { 755 + "gpio12", 756 + }; 757 + 758 + static const char * const emac0_mcg1_groups[] = { 759 + "gpio13", 760 + }; 761 + 762 + static const char * const emac0_mcg2_groups[] = { 763 + "gpio14", 764 + }; 765 + 766 + static const char * const emac0_mcg3_groups[] = { 767 + "gpio15", 768 + }; 769 + 770 + static const char * const emac0_mdc_groups[] = { 771 + "gpio8", 772 + }; 773 + 774 + static const char * const emac0_mdio_groups[] = { 775 + "gpio9", 776 + }; 777 + 778 + static const char * const emac0_ptp_aux_groups[] = { 779 + "gpio6", "gpio10", "gpio11", "gpio12", 780 + }; 781 + 782 + static const char * const emac0_ptp_pps_groups[] = { 783 + "gpio6", "gpio10", "gpio11", "gpio12", 784 + }; 785 + 786 + static const char * const emac1_mcg0_groups[] = { 787 + "gpio16", 788 + 789 + }; 790 + 791 + static const char * const emac1_mcg1_groups[] = { 792 + "gpio17", 793 + }; 794 + 795 + static const char * const emac1_mcg2_groups[] = { 796 + "gpio18", 797 + }; 798 + 799 + static const char * const emac1_mcg3_groups[] = { 800 + "gpio19", 801 + }; 802 + 803 + static const char * const emac1_mdc_groups[] = { 804 + "gpio20", 805 + }; 806 + 807 + static const char * const emac1_mdio_groups[] = { 808 + "gpio21", 809 + }; 810 + 811 + static const char * const emac1_ptp_aux_groups[] = { 812 + "gpio6", "gpio10", "gpio11", "gpio12", 813 + }; 814 + 815 + static const char * const emac1_ptp_pps_groups[] = { 816 + "gpio6", "gpio10", "gpio11", "gpio12", 817 + }; 818 + 819 + static const char * const gcc_gp1_groups[] = { 820 + "gpio51", "gpio82", 821 + }; 822 + 823 + static const char * const gcc_gp2_groups[] = { 824 + "gpio52", "gpio83", 825 + }; 826 + 827 + static const char * const gcc_gp3_groups[] = { 828 + "gpio53", "gpio84", 829 + }; 830 + 831 + static const char * const gcc_gp4_groups[] = { 832 + "gpio33", "gpio55", 833 + }; 834 + 835 + static const char * const gcc_gp5_groups[] = { 836 + "gpio34", "gpio42", 837 + }; 838 + 839 + static const char * const hs0_mi2s_groups[] = { 840 + "gpio114", "gpio115", "gpio116", "gpio117", 841 + }; 842 + 843 + static const char * const hs1_mi2s_groups[] = { 844 + "gpio118", "gpio119", "gpio120", "gpio121", 845 + }; 846 + 847 + static const char * const hs2_mi2s_groups[] = { 848 + "gpio122", "gpio123", "gpio124", "gpio125", 849 + }; 850 + 851 + static const char * const ibi_i3c_groups[] = { 852 + "gpio40", "gpio41", "gpio42", "gpio43", "gpio80", "gpio81", "gpio84", 853 + "gpio85", 854 + }; 855 + 856 + static const char * const jitter_bist_groups[] = { 857 + "gpio86", 858 + }; 859 + 860 + static const char * const mdp0_vsync0_groups[] = { 861 + "gpio57", 862 + }; 863 + 864 + static const char * const mdp0_vsync1_groups[] = { 865 + "gpio58", 866 + }; 867 + 868 + static const char * const mdp0_vsync2_groups[] = { 869 + "gpio59", 870 + }; 871 + 872 + static const char * const mdp0_vsync3_groups[] = { 873 + "gpio80", 874 + }; 875 + 876 + static const char * const mdp0_vsync4_groups[] = { 877 + "gpio81", 878 + }; 879 + 880 + static const char * const mdp0_vsync5_groups[] = { 881 + "gpio91", 882 + }; 883 + 884 + static const char * const mdp0_vsync6_groups[] = { 885 + "gpio92", 886 + }; 887 + 888 + static const char * const mdp0_vsync7_groups[] = { 889 + "gpio93", 890 + }; 891 + 892 + static const char * const mdp0_vsync8_groups[] = { 893 + "gpio94", 894 + }; 895 + 896 + static const char * const mdp1_vsync0_groups[] = { 897 + "gpio40", 898 + }; 899 + 900 + static const char * const mdp1_vsync1_groups[] = { 901 + "gpio41", 902 + }; 903 + 904 + static const char * const mdp1_vsync2_groups[] = { 905 + "gpio42", 906 + }; 907 + 908 + static const char * const mdp1_vsync3_groups[] = { 909 + "gpio43", 910 + }; 911 + 912 + static const char * const mdp1_vsync4_groups[] = { 913 + "gpio46", 914 + }; 915 + 916 + static const char * const mdp1_vsync5_groups[] = { 917 + "gpio47", 918 + }; 919 + 920 + static const char * const mdp1_vsync6_groups[] = { 921 + "gpio51", 922 + }; 923 + 924 + static const char * const mdp1_vsync7_groups[] = { 925 + "gpio52", 926 + }; 927 + 928 + static const char * const mdp1_vsync8_groups[] = { 929 + "gpio50", 930 + }; 931 + 932 + static const char * const mdp_vsync_groups[] = { 933 + "gpio82", "gpio83", "gpio84", 934 + }; 935 + 936 + static const char * const mi2s1_data0_groups[] = { 937 + "gpio108", 938 + }; 939 + 940 + static const char * const mi2s1_data1_groups[] = { 941 + "gpio109", 942 + }; 943 + 944 + static const char * const mi2s1_sck_groups[] = { 945 + "gpio106", 946 + }; 947 + 948 + static const char * const mi2s1_ws_groups[] = { 949 + "gpio107", 950 + }; 951 + 952 + static const char * const mi2s2_data0_groups[] = { 953 + "gpio112", 954 + }; 955 + 956 + static const char * const mi2s2_data1_groups[] = { 957 + "gpio113", 958 + }; 959 + 960 + static const char * const mi2s2_sck_groups[] = { 961 + "gpio110", 962 + }; 963 + 964 + static const char * const mi2s2_ws_groups[] = { 965 + "gpio111", 966 + }; 967 + 968 + static const char * const mi2s_mclk0_groups[] = { 969 + "gpio105", 970 + }; 971 + 972 + static const char * const mi2s_mclk1_groups[] = { 973 + "gpio117", 974 + }; 975 + 976 + static const char * const pcie0_clkreq_groups[] = { 977 + "gpio1", 978 + }; 979 + 980 + static const char * const pcie1_clkreq_groups[] = { 981 + "gpio3", 982 + }; 983 + 984 + static const char * const phase_flag_groups[] = { 985 + "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", 986 + "gpio32", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", "gpio56", 987 + "gpio57", "gpio98", "gpio99", "gpio106", "gpio107", "gpio108", 988 + "gpio109", "gpio110", "gpio111", "gpio112", "gpio113", "gpio114", 989 + "gpio120", "gpio121", "gpio122", "gpio123", "gpio124", "gpio125", 990 + }; 991 + 992 + static const char * const pll_bist_groups[] = { 993 + "gpio114", 994 + }; 995 + 996 + static const char * const pll_clk_groups[] = { 997 + "gpio87", 998 + }; 999 + 1000 + static const char * const prng_rosc0_groups[] = { 1001 + "gpio101", 1002 + }; 1003 + 1004 + static const char * const prng_rosc1_groups[] = { 1005 + "gpio102", 1006 + }; 1007 + 1008 + static const char * const prng_rosc2_groups[] = { 1009 + "gpio103", 1010 + }; 1011 + 1012 + static const char * const prng_rosc3_groups[] = { 1013 + "gpio104", 1014 + }; 1015 + 1016 + static const char * const qdss_cti_groups[] = { 1017 + "gpio26", "gpio27", "gpio38", "gpio39", "gpio48", "gpio49", "gpio50", 1018 + "gpio51", 1019 + }; 1020 + 1021 + static const char * const qdss_gpio_groups[] = { 1022 + "gpio20", "gpio21", "gpio22", "gpio23", "gpio24", "gpio25", "gpio28", 1023 + "gpio29", "gpio30", "gpio31", "gpio60", "gpio61", "gpio62", "gpio63", 1024 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio105", "gpio106", "gpio107", 1025 + "gpio108", "gpio109", "gpio110", "gpio111", "gpio112", "gpio113", 1026 + "gpio114", "gpio115", "gpio116", "gpio117", "gpio118", "gpio119", 1027 + "gpio120", "gpio121", "gpio122", 1028 + }; 1029 + 1030 + static const char * const qup0_se0_groups[] = { 1031 + "gpio20", "gpio21", "gpio22", "gpio23", 1032 + }; 1033 + 1034 + static const char * const qup0_se1_groups[] = { 1035 + "gpio24", "gpio25", "gpio26", "gpio27", 1036 + }; 1037 + 1038 + static const char * const qup0_se2_groups[] = { 1039 + "gpio36", "gpio37", "gpio38", "gpio39", 1040 + }; 1041 + 1042 + static const char * const qup0_se3_groups[] = { 1043 + "gpio28", "gpio29", "gpio30", "gpio31", 1044 + }; 1045 + 1046 + static const char * const qup0_se4_groups[] = { 1047 + "gpio32", "gpio33", "gpio34", "gpio35", 1048 + }; 1049 + 1050 + static const char * const qup0_se5_groups[] = { 1051 + "gpio36", "gpio37", "gpio38", "gpio39", 1052 + }; 1053 + 1054 + static const char * const qup1_se0_groups[] = { 1055 + "gpio40", "gpio41", "gpio42", "gpio43", 1056 + }; 1057 + 1058 + static const char * const qup1_se1_groups[] = { 1059 + "gpio40", "gpio41", "gpio42", "gpio43", 1060 + }; 1061 + 1062 + static const char * const qup1_se2_groups[] = { 1063 + "gpio44", "gpio45", "gpio46", "gpio47", 1064 + }; 1065 + 1066 + static const char * const qup1_se3_groups[] = { 1067 + "gpio44", "gpio45", "gpio46", "gpio47", 1068 + }; 1069 + 1070 + static const char * const qup1_se4_groups[] = { 1071 + "gpio48", "gpio49", "gpio50", "gpio51", 1072 + }; 1073 + 1074 + static const char * const qup1_se5_groups[] = { 1075 + "gpio52", "gpio53", "gpio54", "gpio55", 1076 + }; 1077 + 1078 + static const char * const qup1_se6_groups[] = { 1079 + "gpio56", "gpio56", "gpio57", "gpio57", 1080 + }; 1081 + 1082 + static const char * const qup2_se0_groups[] = { 1083 + "gpio80", "gpio81", "gpio82", "gpio83", 1084 + }; 1085 + 1086 + static const char * const qup2_se1_groups[] = { 1087 + "gpio84", "gpio85", "gpio99", "gpio100", 1088 + }; 1089 + 1090 + static const char * const qup2_se2_groups[] = { 1091 + "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", 1092 + }; 1093 + 1094 + static const char * const qup2_se3_groups[] = { 1095 + "gpio91", "gpio92", "gpio93", "gpio94", 1096 + }; 1097 + 1098 + static const char * const qup2_se4_groups[] = { 1099 + "gpio95", "gpio96", "gpio97", "gpio98", 1100 + }; 1101 + 1102 + static const char * const qup2_se5_groups[] = { 1103 + "gpio84", "gpio85", "gpio99", "gpio100", 1104 + }; 1105 + 1106 + static const char * const qup2_se6_groups[] = { 1107 + "gpio95", "gpio96", "gpio97", "gpio98", 1108 + }; 1109 + 1110 + static const char * const qup3_se0_groups[] = { 1111 + "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", 1112 + }; 1113 + 1114 + static const char * const sail_top_groups[] = { 1115 + "gpio13", "gpio14", "gpio15", "gpio16", 1116 + }; 1117 + 1118 + static const char * const sailss_emac0_groups[] = { 1119 + "gpio18", "gpio19", 1120 + }; 1121 + 1122 + static const char * const sailss_ospi_groups[] = { 1123 + "gpio18", "gpio19", 1124 + }; 1125 + 1126 + static const char * const sgmii_phy_groups[] = { 1127 + "gpio7", "gpio26", 1128 + }; 1129 + 1130 + static const char * const tb_trig_groups[] = { 1131 + "gpio17", "gpio17", 1132 + }; 1133 + 1134 + static const char * const tgu_ch0_groups[] = { 1135 + "gpio46", 1136 + }; 1137 + 1138 + static const char * const tgu_ch1_groups[] = { 1139 + "gpio47", 1140 + }; 1141 + 1142 + static const char * const tgu_ch2_groups[] = { 1143 + "gpio36", 1144 + }; 1145 + 1146 + static const char * const tgu_ch3_groups[] = { 1147 + "gpio37", 1148 + }; 1149 + 1150 + static const char * const tgu_ch4_groups[] = { 1151 + "gpio38", 1152 + }; 1153 + 1154 + static const char * const tgu_ch5_groups[] = { 1155 + "gpio39", 1156 + }; 1157 + 1158 + static const char * const tsense_pwm1_groups[] = { 1159 + "gpio104", 1160 + }; 1161 + 1162 + static const char * const tsense_pwm2_groups[] = { 1163 + "gpio103", 1164 + }; 1165 + 1166 + static const char * const tsense_pwm3_groups[] = { 1167 + "gpio102", 1168 + }; 1169 + 1170 + static const char * const tsense_pwm4_groups[] = { 1171 + "gpio101", 1172 + }; 1173 + 1174 + static const char * const usb2phy_ac_groups[] = { 1175 + "gpio10", "gpio11", "gpio12", 1176 + }; 1177 + 1178 + static const char * const vsense_trigger_groups[] = { 1179 + "gpio111", 1180 + }; 1181 + 1182 + static const struct msm_function sa8775p_functions[] = { 1183 + FUNCTION(gpio), 1184 + FUNCTION(atest_char), 1185 + FUNCTION(atest_usb2), 1186 + FUNCTION(audio_ref), 1187 + FUNCTION(cam_mclk), 1188 + FUNCTION(cci_async), 1189 + FUNCTION(cci_i2c), 1190 + FUNCTION(cci_timer0), 1191 + FUNCTION(cci_timer1), 1192 + FUNCTION(cci_timer2), 1193 + FUNCTION(cci_timer3), 1194 + FUNCTION(cci_timer4), 1195 + FUNCTION(cci_timer5), 1196 + FUNCTION(cci_timer6), 1197 + FUNCTION(cci_timer7), 1198 + FUNCTION(cci_timer8), 1199 + FUNCTION(cci_timer9), 1200 + FUNCTION(cri_trng), 1201 + FUNCTION(cri_trng0), 1202 + FUNCTION(cri_trng1), 1203 + FUNCTION(dbg_out), 1204 + FUNCTION(ddr_bist), 1205 + FUNCTION(ddr_pxi0), 1206 + FUNCTION(ddr_pxi1), 1207 + FUNCTION(ddr_pxi2), 1208 + FUNCTION(ddr_pxi3), 1209 + FUNCTION(ddr_pxi4), 1210 + FUNCTION(ddr_pxi5), 1211 + FUNCTION(edp0_hot), 1212 + FUNCTION(edp0_lcd), 1213 + FUNCTION(edp1_hot), 1214 + FUNCTION(edp1_lcd), 1215 + FUNCTION(edp2_hot), 1216 + FUNCTION(edp2_lcd), 1217 + FUNCTION(edp3_hot), 1218 + FUNCTION(edp3_lcd), 1219 + FUNCTION(emac0_mcg0), 1220 + FUNCTION(emac0_mcg1), 1221 + FUNCTION(emac0_mcg2), 1222 + FUNCTION(emac0_mcg3), 1223 + FUNCTION(emac0_mdc), 1224 + FUNCTION(emac0_mdio), 1225 + FUNCTION(emac0_ptp_aux), 1226 + FUNCTION(emac0_ptp_pps), 1227 + FUNCTION(emac1_mcg0), 1228 + FUNCTION(emac1_mcg1), 1229 + FUNCTION(emac1_mcg2), 1230 + FUNCTION(emac1_mcg3), 1231 + FUNCTION(emac1_mdc), 1232 + FUNCTION(emac1_mdio), 1233 + FUNCTION(emac1_ptp_aux), 1234 + FUNCTION(emac1_ptp_pps), 1235 + FUNCTION(gcc_gp1), 1236 + FUNCTION(gcc_gp2), 1237 + FUNCTION(gcc_gp3), 1238 + FUNCTION(gcc_gp4), 1239 + FUNCTION(gcc_gp5), 1240 + FUNCTION(hs0_mi2s), 1241 + FUNCTION(hs1_mi2s), 1242 + FUNCTION(hs2_mi2s), 1243 + FUNCTION(ibi_i3c), 1244 + FUNCTION(jitter_bist), 1245 + FUNCTION(mdp0_vsync0), 1246 + FUNCTION(mdp0_vsync1), 1247 + FUNCTION(mdp0_vsync2), 1248 + FUNCTION(mdp0_vsync3), 1249 + FUNCTION(mdp0_vsync4), 1250 + FUNCTION(mdp0_vsync5), 1251 + FUNCTION(mdp0_vsync6), 1252 + FUNCTION(mdp0_vsync7), 1253 + FUNCTION(mdp0_vsync8), 1254 + FUNCTION(mdp1_vsync0), 1255 + FUNCTION(mdp1_vsync1), 1256 + FUNCTION(mdp1_vsync2), 1257 + FUNCTION(mdp1_vsync3), 1258 + FUNCTION(mdp1_vsync4), 1259 + FUNCTION(mdp1_vsync5), 1260 + FUNCTION(mdp1_vsync6), 1261 + FUNCTION(mdp1_vsync7), 1262 + FUNCTION(mdp1_vsync8), 1263 + FUNCTION(mdp_vsync), 1264 + FUNCTION(mi2s1_data0), 1265 + FUNCTION(mi2s1_data1), 1266 + FUNCTION(mi2s1_sck), 1267 + FUNCTION(mi2s1_ws), 1268 + FUNCTION(mi2s2_data0), 1269 + FUNCTION(mi2s2_data1), 1270 + FUNCTION(mi2s2_sck), 1271 + FUNCTION(mi2s2_ws), 1272 + FUNCTION(mi2s_mclk0), 1273 + FUNCTION(mi2s_mclk1), 1274 + FUNCTION(pcie0_clkreq), 1275 + FUNCTION(pcie1_clkreq), 1276 + FUNCTION(phase_flag), 1277 + FUNCTION(pll_bist), 1278 + FUNCTION(pll_clk), 1279 + FUNCTION(prng_rosc0), 1280 + FUNCTION(prng_rosc1), 1281 + FUNCTION(prng_rosc2), 1282 + FUNCTION(prng_rosc3), 1283 + FUNCTION(qdss_cti), 1284 + FUNCTION(qdss_gpio), 1285 + FUNCTION(qup0_se0), 1286 + FUNCTION(qup0_se1), 1287 + FUNCTION(qup0_se2), 1288 + FUNCTION(qup0_se3), 1289 + FUNCTION(qup0_se4), 1290 + FUNCTION(qup0_se5), 1291 + FUNCTION(qup1_se0), 1292 + FUNCTION(qup1_se1), 1293 + FUNCTION(qup1_se2), 1294 + FUNCTION(qup1_se3), 1295 + FUNCTION(qup1_se4), 1296 + FUNCTION(qup1_se5), 1297 + FUNCTION(qup1_se6), 1298 + FUNCTION(qup2_se0), 1299 + FUNCTION(qup2_se1), 1300 + FUNCTION(qup2_se2), 1301 + FUNCTION(qup2_se3), 1302 + FUNCTION(qup2_se4), 1303 + FUNCTION(qup2_se5), 1304 + FUNCTION(qup2_se6), 1305 + FUNCTION(qup3_se0), 1306 + FUNCTION(sail_top), 1307 + FUNCTION(sailss_emac0), 1308 + FUNCTION(sailss_ospi), 1309 + FUNCTION(sgmii_phy), 1310 + FUNCTION(tb_trig), 1311 + FUNCTION(tgu_ch0), 1312 + FUNCTION(tgu_ch1), 1313 + FUNCTION(tgu_ch2), 1314 + FUNCTION(tgu_ch3), 1315 + FUNCTION(tgu_ch4), 1316 + FUNCTION(tgu_ch5), 1317 + FUNCTION(tsense_pwm1), 1318 + FUNCTION(tsense_pwm2), 1319 + FUNCTION(tsense_pwm3), 1320 + FUNCTION(tsense_pwm4), 1321 + FUNCTION(usb2phy_ac), 1322 + FUNCTION(vsense_trigger), 1323 + }; 1324 + 1325 + /* 1326 + * Every pin is maintained as a single group, and missing or non-existing pin 1327 + * would be maintained as dummy group to synchronize pin group index with 1328 + * pin descriptor registered with pinctrl core. 1329 + * Clients would not be able to request these dummy pin groups. 1330 + */ 1331 + static const struct msm_pingroup sa8775p_groups[] = { 1332 + [0] = PINGROUP(0, _, _, _, _, _, _, _, _, _), 1333 + [1] = PINGROUP(1, pcie0_clkreq, _, _, _, _, _, _, _, _), 1334 + [2] = PINGROUP(2, _, _, _, _, _, _, _, _, _), 1335 + [3] = PINGROUP(3, pcie1_clkreq, _, _, _, _, _, _, _, _), 1336 + [4] = PINGROUP(4, _, _, _, _, _, _, _, _, _), 1337 + [5] = PINGROUP(5, _, _, _, _, _, _, _, _, _), 1338 + [6] = PINGROUP(6, emac0_ptp_aux, emac0_ptp_pps, emac1_ptp_aux, emac1_ptp_pps, 1339 + _, _, _, _, _), 1340 + [7] = PINGROUP(7, sgmii_phy, _, _, _, _, _, _, _, _), 1341 + [8] = PINGROUP(8, emac0_mdc, _, _, _, _, _, _, _, _), 1342 + [9] = PINGROUP(9, emac0_mdio, _, _, _, _, _, _, _, _), 1343 + [10] = PINGROUP(10, usb2phy_ac, emac0_ptp_aux, emac0_ptp_pps, emac1_ptp_aux, emac1_ptp_pps, 1344 + _, _, _, _), 1345 + [11] = PINGROUP(11, usb2phy_ac, emac0_ptp_aux, emac0_ptp_pps, emac1_ptp_aux, emac1_ptp_pps, 1346 + _, _, _, _), 1347 + [12] = PINGROUP(12, usb2phy_ac, emac0_ptp_aux, emac0_ptp_pps, emac1_ptp_aux, emac1_ptp_pps, 1348 + emac0_mcg0, _, _, _), 1349 + [13] = PINGROUP(13, qup3_se0, emac0_mcg1, _, _, sail_top, _, _, _, _), 1350 + [14] = PINGROUP(14, qup3_se0, emac0_mcg2, _, _, sail_top, _, _, _, _), 1351 + [15] = PINGROUP(15, qup3_se0, emac0_mcg3, _, _, sail_top, _, _, _, _), 1352 + [16] = PINGROUP(16, qup3_se0, emac1_mcg0, _, _, sail_top, _, _, _, _), 1353 + [17] = PINGROUP(17, qup3_se0, tb_trig, tb_trig, emac1_mcg1, _, _, _, _, _), 1354 + [18] = PINGROUP(18, qup3_se0, emac1_mcg2, _, _, sailss_ospi, sailss_emac0, _, _, _), 1355 + [19] = PINGROUP(19, qup3_se0, emac1_mcg3, _, _, sailss_ospi, sailss_emac0, _, _, _), 1356 + [20] = PINGROUP(20, qup0_se0, emac1_mdc, qdss_gpio, _, _, _, _, _, _), 1357 + [21] = PINGROUP(21, qup0_se0, emac1_mdio, qdss_gpio, _, _, _, _, _, _), 1358 + [22] = PINGROUP(22, qup0_se0, qdss_gpio, _, _, _, _, _, _, _), 1359 + [23] = PINGROUP(23, qup0_se0, qdss_gpio, _, _, _, _, _, _, _), 1360 + [24] = PINGROUP(24, qup0_se1, qdss_gpio, _, _, _, _, _, _, _), 1361 + [25] = PINGROUP(25, qup0_se1, phase_flag, _, qdss_gpio, _, _, _, _, _), 1362 + [26] = PINGROUP(26, sgmii_phy, qup0_se1, qdss_cti, phase_flag, _, _, _, _, _), 1363 + [27] = PINGROUP(27, qup0_se1, qdss_cti, phase_flag, _, atest_char, _, _, _, _), 1364 + [28] = PINGROUP(28, qup0_se3, phase_flag, _, qdss_gpio, _, _, _, _, _), 1365 + [29] = PINGROUP(29, qup0_se3, phase_flag, _, qdss_gpio, _, _, _, _, _), 1366 + [30] = PINGROUP(30, qup0_se3, phase_flag, _, qdss_gpio, _, _, _, _, _), 1367 + [31] = PINGROUP(31, qup0_se3, phase_flag, _, qdss_gpio, _, _, _, _, _), 1368 + [32] = PINGROUP(32, qup0_se4, phase_flag, _, _, _, _, _, _, _), 1369 + [33] = PINGROUP(33, qup0_se4, gcc_gp4, _, ddr_pxi0, _, _, _, _, _), 1370 + [34] = PINGROUP(34, qup0_se4, gcc_gp5, _, ddr_pxi0, _, _, _, _, _), 1371 + [35] = PINGROUP(35, qup0_se4, phase_flag, _, _, _, _, _, _, _), 1372 + [36] = PINGROUP(36, qup0_se2, qup0_se5, phase_flag, tgu_ch2, _, _, _, _, _), 1373 + [37] = PINGROUP(37, qup0_se2, qup0_se5, phase_flag, tgu_ch3, _, _, _, _, _), 1374 + [38] = PINGROUP(38, qup0_se5, qup0_se2, qdss_cti, phase_flag, tgu_ch4, _, _, _, _), 1375 + [39] = PINGROUP(39, qup0_se5, qup0_se2, qdss_cti, phase_flag, tgu_ch5, _, _, _, _), 1376 + [40] = PINGROUP(40, qup1_se0, qup1_se1, ibi_i3c, mdp1_vsync0, _, _, _, _, _), 1377 + [41] = PINGROUP(41, qup1_se0, qup1_se1, ibi_i3c, mdp1_vsync1, _, _, _, _, _), 1378 + [42] = PINGROUP(42, qup1_se1, qup1_se0, ibi_i3c, mdp1_vsync2, gcc_gp5, _, _, _, _), 1379 + [43] = PINGROUP(43, qup1_se1, qup1_se0, ibi_i3c, mdp1_vsync3, _, _, _, _, _), 1380 + [44] = PINGROUP(44, qup1_se2, qup1_se3, edp0_lcd, _, _, _, _, _, _), 1381 + [45] = PINGROUP(45, qup1_se2, qup1_se3, edp1_lcd, _, _, _, _, _, _), 1382 + [46] = PINGROUP(46, qup1_se3, qup1_se2, mdp1_vsync4, tgu_ch0, _, _, _, _, _), 1383 + [47] = PINGROUP(47, qup1_se3, qup1_se2, mdp1_vsync5, tgu_ch1, _, _, _, _, _), 1384 + [48] = PINGROUP(48, qup1_se4, qdss_cti, edp2_lcd, _, _, _, _, _, _), 1385 + [49] = PINGROUP(49, qup1_se4, qdss_cti, edp3_lcd, _, _, _, _, _, _), 1386 + [50] = PINGROUP(50, qup1_se4, cci_async, qdss_cti, mdp1_vsync8, _, _, _, _, _), 1387 + [51] = PINGROUP(51, qup1_se4, qdss_cti, mdp1_vsync6, gcc_gp1, _, _, _, _, _), 1388 + [52] = PINGROUP(52, qup1_se5, cci_timer4, cci_i2c, mdp1_vsync7, gcc_gp2, _, ddr_pxi1, _, _), 1389 + [53] = PINGROUP(53, qup1_se5, cci_timer5, cci_i2c, gcc_gp3, _, ddr_pxi1, _, _, _), 1390 + [54] = PINGROUP(54, qup1_se5, cci_timer6, cci_i2c, _, _, _, _, _, _), 1391 + [55] = PINGROUP(55, qup1_se5, cci_timer7, cci_i2c, gcc_gp4, _, ddr_pxi2, _, _, _), 1392 + [56] = PINGROUP(56, qup1_se6, qup1_se6, cci_timer8, cci_i2c, phase_flag, 1393 + ddr_bist, _, _, _), 1394 + [57] = PINGROUP(57, qup1_se6, qup1_se6, cci_timer9, cci_i2c, mdp0_vsync0, 1395 + phase_flag, ddr_bist, _, _), 1396 + [58] = PINGROUP(58, cci_i2c, mdp0_vsync1, ddr_bist, _, atest_usb2, atest_char, _, _, _), 1397 + [59] = PINGROUP(59, cci_i2c, mdp0_vsync2, ddr_bist, _, atest_usb2, atest_char, _, _, _), 1398 + [60] = PINGROUP(60, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1399 + [61] = PINGROUP(61, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1400 + [62] = PINGROUP(62, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1401 + [63] = PINGROUP(63, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1402 + [64] = PINGROUP(64, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1403 + [65] = PINGROUP(65, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1404 + [66] = PINGROUP(66, cci_i2c, cci_async, qdss_gpio, _, _, _, _, _, _), 1405 + [67] = PINGROUP(67, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1406 + [68] = PINGROUP(68, cci_timer0, cci_async, _, _, _, _, _, _, _), 1407 + [69] = PINGROUP(69, cci_timer1, cci_async, _, _, _, _, _, _, _), 1408 + [70] = PINGROUP(70, cci_timer2, cci_async, _, _, _, _, _, _, _), 1409 + [71] = PINGROUP(71, cci_timer3, cci_async, _, _, _, _, _, _, _), 1410 + [72] = PINGROUP(72, cam_mclk, _, _, _, _, _, _, _, _), 1411 + [73] = PINGROUP(73, cam_mclk, _, _, _, _, _, _, _, _), 1412 + [74] = PINGROUP(74, cam_mclk, _, _, _, _, _, _, _, _), 1413 + [75] = PINGROUP(75, cam_mclk, _, _, _, _, _, _, _, _), 1414 + [76] = PINGROUP(76, _, _, _, _, _, _, _, _, _), 1415 + [77] = PINGROUP(77, _, _, _, _, _, _, _, _, _), 1416 + [78] = PINGROUP(78, _, _, _, _, _, _, _, _, _), 1417 + [79] = PINGROUP(79, _, _, _, _, _, _, _, _, _), 1418 + [80] = PINGROUP(80, qup2_se0, ibi_i3c, mdp0_vsync3, _, _, _, _, _, _), 1419 + [81] = PINGROUP(81, qup2_se0, ibi_i3c, mdp0_vsync4, _, _, _, _, _, _), 1420 + [82] = PINGROUP(82, qup2_se0, mdp_vsync, gcc_gp1, _, _, _, _, _, _), 1421 + [83] = PINGROUP(83, qup2_se0, mdp_vsync, gcc_gp2, _, _, _, _, _, _), 1422 + [84] = PINGROUP(84, qup2_se1, qup2_se5, ibi_i3c, mdp_vsync, gcc_gp3, _, _, _, _), 1423 + [85] = PINGROUP(85, qup2_se1, qup2_se5, ibi_i3c, _, _, _, _, _, _), 1424 + [86] = PINGROUP(86, qup2_se2, jitter_bist, atest_usb2, ddr_pxi2, _, _, _, _, _), 1425 + [87] = PINGROUP(87, qup2_se2, pll_clk, atest_usb2, ddr_pxi3, _, _, _, _, _), 1426 + [88] = PINGROUP(88, qup2_se2, _, atest_usb2, ddr_pxi3, _, _, _, _, _), 1427 + [89] = PINGROUP(89, qup2_se2, _, atest_usb2, ddr_pxi4, atest_char, _, _, _, _), 1428 + [90] = PINGROUP(90, qup2_se2, _, atest_usb2, ddr_pxi4, atest_char, _, _, _, _), 1429 + [91] = PINGROUP(91, qup2_se3, mdp0_vsync5, _, atest_usb2, _, _, _, _, _), 1430 + [92] = PINGROUP(92, qup2_se3, mdp0_vsync6, _, atest_usb2, _, _, _, _, _), 1431 + [93] = PINGROUP(93, qup2_se3, mdp0_vsync7, _, atest_usb2, _, _, _, _, _), 1432 + [94] = PINGROUP(94, qup2_se3, mdp0_vsync8, _, atest_usb2, _, _, _, _, _), 1433 + [95] = PINGROUP(95, qup2_se4, qup2_se6, _, atest_usb2, _, _, _, _, _), 1434 + [96] = PINGROUP(96, qup2_se4, qup2_se6, _, atest_usb2, _, _, _, _, _), 1435 + [97] = PINGROUP(97, qup2_se6, qup2_se4, cri_trng0, _, atest_usb2, _, _, _, _), 1436 + [98] = PINGROUP(98, qup2_se6, qup2_se4, phase_flag, cri_trng1, _, _, _, _, _), 1437 + [99] = PINGROUP(99, qup2_se5, qup2_se1, phase_flag, cri_trng, _, _, _, _, _), 1438 + [100] = PINGROUP(100, qup2_se5, qup2_se1, _, _, _, _, _, _, _), 1439 + [101] = PINGROUP(101, edp0_hot, prng_rosc0, tsense_pwm4, _, _, _, _, _, _), 1440 + [102] = PINGROUP(102, edp1_hot, prng_rosc1, tsense_pwm3, _, _, _, _, _, _), 1441 + [103] = PINGROUP(103, edp3_hot, prng_rosc2, tsense_pwm2, _, _, _, _, _, _), 1442 + [104] = PINGROUP(104, edp2_hot, prng_rosc3, tsense_pwm1, _, _, _, _, _, _), 1443 + [105] = PINGROUP(105, mi2s_mclk0, _, qdss_gpio, atest_usb2, _, _, _, _, _), 1444 + [106] = PINGROUP(106, mi2s1_sck, phase_flag, _, qdss_gpio, _, _, _, _, _), 1445 + [107] = PINGROUP(107, mi2s1_ws, phase_flag, _, qdss_gpio, _, _, _, _, _), 1446 + [108] = PINGROUP(108, mi2s1_data0, phase_flag, _, qdss_gpio, _, _, _, _, _), 1447 + [109] = PINGROUP(109, mi2s1_data1, phase_flag, _, qdss_gpio, _, _, _, _, _), 1448 + [110] = PINGROUP(110, mi2s2_sck, phase_flag, _, qdss_gpio, _, _, _, _, _), 1449 + [111] = PINGROUP(111, mi2s2_ws, phase_flag, _, qdss_gpio, vsense_trigger, _, _, _, _), 1450 + [112] = PINGROUP(112, mi2s2_data0, phase_flag, _, qdss_gpio, _, _, _, _, _), 1451 + [113] = PINGROUP(113, mi2s2_data1, audio_ref, phase_flag, _, qdss_gpio, _, _, _, _), 1452 + [114] = PINGROUP(114, hs0_mi2s, pll_bist, phase_flag, _, qdss_gpio, _, _, _, _), 1453 + [115] = PINGROUP(115, hs0_mi2s, _, qdss_gpio, _, _, _, _, _, _), 1454 + [116] = PINGROUP(116, hs0_mi2s, _, qdss_gpio, _, _, _, _, _, _), 1455 + [117] = PINGROUP(117, hs0_mi2s, mi2s_mclk1, _, qdss_gpio, _, _, _, _, _), 1456 + [118] = PINGROUP(118, hs1_mi2s, _, qdss_gpio, ddr_pxi5, _, _, _, _, _), 1457 + [119] = PINGROUP(119, hs1_mi2s, _, qdss_gpio, ddr_pxi5, _, _, _, _, _), 1458 + [120] = PINGROUP(120, hs1_mi2s, phase_flag, _, qdss_gpio, _, _, _, _, _), 1459 + [121] = PINGROUP(121, hs1_mi2s, phase_flag, _, qdss_gpio, _, _, _, _, _), 1460 + [122] = PINGROUP(122, hs2_mi2s, phase_flag, _, qdss_gpio, _, _, _, _, _), 1461 + [123] = PINGROUP(123, hs2_mi2s, phase_flag, _, _, _, _, _, _, _), 1462 + [124] = PINGROUP(124, hs2_mi2s, phase_flag, _, _, _, _, _, _, _), 1463 + [125] = PINGROUP(125, hs2_mi2s, phase_flag, _, _, _, _, _, _, _), 1464 + [126] = PINGROUP(126, _, _, _, _, _, _, _, _, _), 1465 + [127] = PINGROUP(127, _, _, _, _, _, _, _, _, _), 1466 + [128] = PINGROUP(128, _, _, _, _, _, _, _, _, _), 1467 + [129] = PINGROUP(129, _, _, _, _, _, _, _, _, _), 1468 + [130] = PINGROUP(130, _, _, _, _, _, _, _, _, _), 1469 + [131] = PINGROUP(131, _, _, _, _, _, _, _, _, _), 1470 + [132] = PINGROUP(132, _, _, _, _, _, _, _, _, _), 1471 + [133] = PINGROUP(133, _, _, _, _, _, _, _, _, _), 1472 + [134] = PINGROUP(134, _, _, _, _, _, _, _, _, _), 1473 + [135] = PINGROUP(135, _, _, _, _, _, _, _, _, _), 1474 + [136] = PINGROUP(136, _, _, _, _, _, _, _, _, _), 1475 + [137] = PINGROUP(137, _, _, _, _, _, _, _, _, _), 1476 + [138] = PINGROUP(138, _, _, _, _, _, _, _, _, _), 1477 + [139] = PINGROUP(139, _, _, _, _, _, _, _, _, _), 1478 + [140] = PINGROUP(140, _, _, _, _, _, _, _, _, _), 1479 + [141] = PINGROUP(141, _, _, _, _, _, _, _, _, _), 1480 + [142] = PINGROUP(142, _, _, _, _, _, _, _, _, _), 1481 + [143] = PINGROUP(143, _, _, _, _, _, _, _, _, _), 1482 + [144] = PINGROUP(144, dbg_out, _, _, _, _, _, _, _, _), 1483 + [145] = PINGROUP(145, _, _, _, _, _, _, _, _, _), 1484 + [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _), 1485 + [147] = PINGROUP(147, _, _, _, _, _, _, _, _, _), 1486 + [148] = PINGROUP(148, _, _, _, _, _, _, _, _, _), 1487 + [149] = UFS_RESET(ufs_reset, 0x1a2000), 1488 + [150] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x199000, 15, 0), 1489 + [151] = SDC_QDSD_PINGROUP(sdc1_clk, 0x199000, 13, 6), 1490 + [152] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x199000, 11, 3), 1491 + [153] = SDC_QDSD_PINGROUP(sdc1_data, 0x199000, 9, 0), 1492 + }; 1493 + 1494 + static const struct msm_pinctrl_soc_data sa8775p_pinctrl = { 1495 + .pins = sa8775p_pins, 1496 + .npins = ARRAY_SIZE(sa8775p_pins), 1497 + .functions = sa8775p_functions, 1498 + .nfunctions = ARRAY_SIZE(sa8775p_functions), 1499 + .groups = sa8775p_groups, 1500 + .ngroups = ARRAY_SIZE(sa8775p_groups), 1501 + .ngpios = 150, 1502 + }; 1503 + 1504 + static int sa8775p_pinctrl_probe(struct platform_device *pdev) 1505 + { 1506 + return msm_pinctrl_probe(pdev, &sa8775p_pinctrl); 1507 + } 1508 + 1509 + static const struct of_device_id sa8775p_pinctrl_of_match[] = { 1510 + { .compatible = "qcom,sa8775p-tlmm", }, 1511 + { }, 1512 + }; 1513 + MODULE_DEVICE_TABLE(of, sa8775p_pinctrl_of_match); 1514 + 1515 + static struct platform_driver sa8775p_pinctrl_driver = { 1516 + .driver = { 1517 + .name = "sa8775p-tlmm", 1518 + .of_match_table = sa8775p_pinctrl_of_match, 1519 + }, 1520 + .probe = sa8775p_pinctrl_probe, 1521 + .remove = msm_pinctrl_remove, 1522 + }; 1523 + 1524 + static int __init sa8775p_pinctrl_init(void) 1525 + { 1526 + return platform_driver_register(&sa8775p_pinctrl_driver); 1527 + } 1528 + arch_initcall(sa8775p_pinctrl_init); 1529 + 1530 + static void __exit sa8775p_pinctrl_exit(void) 1531 + { 1532 + platform_driver_unregister(&sa8775p_pinctrl_driver); 1533 + } 1534 + module_exit(sa8775p_pinctrl_exit); 1535 + 1536 + MODULE_DESCRIPTION("QTI SA8775P pinctrl driver"); 1537 + MODULE_LICENSE("GPL");
+240
drivers/pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2022-2023 Linaro Ltd. 4 + */ 5 + 6 + #include <linux/gpio/driver.h> 7 + #include <linux/module.h> 8 + #include <linux/platform_device.h> 9 + 10 + #include "pinctrl-lpass-lpi.h" 11 + 12 + enum lpass_lpi_functions { 13 + LPI_MUX_dmic1_clk, 14 + LPI_MUX_dmic1_data, 15 + LPI_MUX_dmic2_clk, 16 + LPI_MUX_dmic2_data, 17 + LPI_MUX_dmic3_clk, 18 + LPI_MUX_dmic3_data, 19 + LPI_MUX_dmic4_clk, 20 + LPI_MUX_dmic4_data, 21 + LPI_MUX_i2s0_clk, 22 + LPI_MUX_i2s0_data, 23 + LPI_MUX_i2s0_ws, 24 + LPI_MUX_i2s1_clk, 25 + LPI_MUX_i2s1_data, 26 + LPI_MUX_i2s1_ws, 27 + LPI_MUX_i2s2_clk, 28 + LPI_MUX_i2s2_data, 29 + LPI_MUX_i2s2_ws, 30 + LPI_MUX_i2s3_clk, 31 + LPI_MUX_i2s3_data, 32 + LPI_MUX_i2s3_ws, 33 + LPI_MUX_i2s4_clk, 34 + LPI_MUX_i2s4_data, 35 + LPI_MUX_i2s4_ws, 36 + LPI_MUX_slimbus_clk, 37 + LPI_MUX_slimbus_data, 38 + LPI_MUX_swr_rx_clk, 39 + LPI_MUX_swr_rx_data, 40 + LPI_MUX_swr_tx_clk, 41 + LPI_MUX_swr_tx_data, 42 + LPI_MUX_wsa_swr_clk, 43 + LPI_MUX_wsa_swr_data, 44 + LPI_MUX_wsa2_swr_clk, 45 + LPI_MUX_wsa2_swr_data, 46 + LPI_MUX_ext_mclk1_a, 47 + LPI_MUX_ext_mclk1_b, 48 + LPI_MUX_ext_mclk1_c, 49 + LPI_MUX_ext_mclk1_d, 50 + LPI_MUX_ext_mclk1_e, 51 + LPI_MUX_gpio, 52 + LPI_MUX__, 53 + }; 54 + 55 + static int gpio0_pins[] = { 0 }; 56 + static int gpio1_pins[] = { 1 }; 57 + static int gpio2_pins[] = { 2 }; 58 + static int gpio3_pins[] = { 3 }; 59 + static int gpio4_pins[] = { 4 }; 60 + static int gpio5_pins[] = { 5 }; 61 + static int gpio6_pins[] = { 6 }; 62 + static int gpio7_pins[] = { 7 }; 63 + static int gpio8_pins[] = { 8 }; 64 + static int gpio9_pins[] = { 9 }; 65 + static int gpio10_pins[] = { 10 }; 66 + static int gpio11_pins[] = { 11 }; 67 + static int gpio12_pins[] = { 12 }; 68 + static int gpio13_pins[] = { 13 }; 69 + static int gpio14_pins[] = { 14 }; 70 + static int gpio15_pins[] = { 15 }; 71 + static int gpio16_pins[] = { 16 }; 72 + static int gpio17_pins[] = { 17 }; 73 + static int gpio18_pins[] = { 18 }; 74 + static int gpio19_pins[] = { 19 }; 75 + static int gpio20_pins[] = { 20 }; 76 + static int gpio21_pins[] = { 21 }; 77 + static int gpio22_pins[] = { 22 }; 78 + 79 + static const struct pinctrl_pin_desc sm8550_lpi_pins[] = { 80 + PINCTRL_PIN(0, "gpio0"), 81 + PINCTRL_PIN(1, "gpio1"), 82 + PINCTRL_PIN(2, "gpio2"), 83 + PINCTRL_PIN(3, "gpio3"), 84 + PINCTRL_PIN(4, "gpio4"), 85 + PINCTRL_PIN(5, "gpio5"), 86 + PINCTRL_PIN(6, "gpio6"), 87 + PINCTRL_PIN(7, "gpio7"), 88 + PINCTRL_PIN(8, "gpio8"), 89 + PINCTRL_PIN(9, "gpio9"), 90 + PINCTRL_PIN(10, "gpio10"), 91 + PINCTRL_PIN(11, "gpio11"), 92 + PINCTRL_PIN(12, "gpio12"), 93 + PINCTRL_PIN(13, "gpio13"), 94 + PINCTRL_PIN(14, "gpio14"), 95 + PINCTRL_PIN(15, "gpio15"), 96 + PINCTRL_PIN(16, "gpio16"), 97 + PINCTRL_PIN(17, "gpio17"), 98 + PINCTRL_PIN(18, "gpio18"), 99 + PINCTRL_PIN(19, "gpio19"), 100 + PINCTRL_PIN(20, "gpio20"), 101 + PINCTRL_PIN(21, "gpio21"), 102 + PINCTRL_PIN(22, "gpio22"), 103 + }; 104 + 105 + static const char * const dmic1_clk_groups[] = { "gpio6" }; 106 + static const char * const dmic1_data_groups[] = { "gpio7" }; 107 + static const char * const dmic2_clk_groups[] = { "gpio8" }; 108 + static const char * const dmic2_data_groups[] = { "gpio9" }; 109 + static const char * const dmic3_clk_groups[] = { "gpio12" }; 110 + static const char * const dmic3_data_groups[] = { "gpio13" }; 111 + static const char * const dmic4_clk_groups[] = { "gpio17" }; 112 + static const char * const dmic4_data_groups[] = { "gpio18" }; 113 + static const char * const i2s0_clk_groups[] = { "gpio0" }; 114 + static const char * const i2s0_ws_groups[] = { "gpio1" }; 115 + static const char * const i2s0_data_groups[] = { "gpio2", "gpio3", "gpio4", "gpio5" }; 116 + static const char * const i2s1_clk_groups[] = { "gpio6" }; 117 + static const char * const i2s1_ws_groups[] = { "gpio7" }; 118 + static const char * const i2s1_data_groups[] = { "gpio8", "gpio9" }; 119 + static const char * const i2s2_clk_groups[] = { "gpio10" }; 120 + static const char * const i2s2_ws_groups[] = { "gpio11" }; 121 + static const char * const i2s2_data_groups[] = { "gpio15", "gpio16" }; 122 + static const char * const i2s3_clk_groups[] = { "gpio12" }; 123 + static const char * const i2s3_ws_groups[] = { "gpio13" }; 124 + static const char * const i2s3_data_groups[] = { "gpio17", "gpio18" }; 125 + static const char * const i2s4_clk_groups[] = { "gpio19"}; 126 + static const char * const i2s4_ws_groups[] = { "gpio20"}; 127 + static const char * const i2s4_data_groups[] = { "gpio21", "gpio22"}; 128 + static const char * const slimbus_clk_groups[] = { "gpio19"}; 129 + static const char * const slimbus_data_groups[] = { "gpio20"}; 130 + static const char * const swr_tx_clk_groups[] = { "gpio0" }; 131 + static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio14" }; 132 + static const char * const swr_rx_clk_groups[] = { "gpio3" }; 133 + static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5", "gpio15" }; 134 + static const char * const wsa_swr_clk_groups[] = { "gpio10" }; 135 + static const char * const wsa_swr_data_groups[] = { "gpio11" }; 136 + static const char * const wsa2_swr_clk_groups[] = { "gpio15" }; 137 + static const char * const wsa2_swr_data_groups[] = { "gpio16" }; 138 + static const char * const ext_mclk1_c_groups[] = { "gpio5" }; 139 + static const char * const ext_mclk1_b_groups[] = { "gpio9" }; 140 + static const char * const ext_mclk1_a_groups[] = { "gpio13" }; 141 + static const char * const ext_mclk1_d_groups[] = { "gpio14" }; 142 + static const char * const ext_mclk1_e_groups[] = { "gpio22" }; 143 + 144 + static const struct lpi_pingroup sm8550_groups[] = { 145 + LPI_PINGROUP(0, 0, swr_tx_clk, i2s0_clk, _, _), 146 + LPI_PINGROUP(1, 2, swr_tx_data, i2s0_ws, _, _), 147 + LPI_PINGROUP(2, 4, swr_tx_data, i2s0_data, _, _), 148 + LPI_PINGROUP(3, 8, swr_rx_clk, i2s0_data, _, _), 149 + LPI_PINGROUP(4, 10, swr_rx_data, i2s0_data, _, _), 150 + LPI_PINGROUP(5, 12, swr_rx_data, ext_mclk1_c, i2s0_data, _), 151 + LPI_PINGROUP(6, LPI_NO_SLEW, dmic1_clk, i2s1_clk, _, _), 152 + LPI_PINGROUP(7, LPI_NO_SLEW, dmic1_data, i2s1_ws, _, _), 153 + LPI_PINGROUP(8, LPI_NO_SLEW, dmic2_clk, i2s1_data, _, _), 154 + LPI_PINGROUP(9, LPI_NO_SLEW, dmic2_data, i2s1_data, ext_mclk1_b, _), 155 + LPI_PINGROUP(10, 16, i2s2_clk, wsa_swr_clk, _, _), 156 + LPI_PINGROUP(11, 18, i2s2_ws, wsa_swr_data, _, _), 157 + LPI_PINGROUP(12, LPI_NO_SLEW, dmic3_clk, i2s3_clk, _, _), 158 + LPI_PINGROUP(13, LPI_NO_SLEW, dmic3_data, i2s3_ws, ext_mclk1_a, _), 159 + LPI_PINGROUP(14, 6, swr_tx_data, ext_mclk1_d, _, _), 160 + LPI_PINGROUP(15, 20, i2s2_data, wsa2_swr_clk, _, _), 161 + LPI_PINGROUP(16, 22, i2s2_data, wsa2_swr_data, _, _), 162 + LPI_PINGROUP(17, LPI_NO_SLEW, dmic4_clk, i2s3_data, _, _), 163 + LPI_PINGROUP(18, LPI_NO_SLEW, dmic4_data, i2s3_data, _, _), 164 + LPI_PINGROUP(19, LPI_NO_SLEW, i2s4_clk, slimbus_clk, _, _), 165 + LPI_PINGROUP(20, LPI_NO_SLEW, i2s4_ws, slimbus_data, _, _), 166 + LPI_PINGROUP(21, LPI_NO_SLEW, i2s4_data, _, _, _), 167 + LPI_PINGROUP(22, LPI_NO_SLEW, i2s4_data, ext_mclk1_e, _, _), 168 + }; 169 + 170 + static const struct lpi_function sm8550_functions[] = { 171 + LPI_FUNCTION(dmic1_clk), 172 + LPI_FUNCTION(dmic1_data), 173 + LPI_FUNCTION(dmic2_clk), 174 + LPI_FUNCTION(dmic2_data), 175 + LPI_FUNCTION(dmic3_clk), 176 + LPI_FUNCTION(dmic3_data), 177 + LPI_FUNCTION(dmic4_clk), 178 + LPI_FUNCTION(dmic4_data), 179 + LPI_FUNCTION(i2s0_clk), 180 + LPI_FUNCTION(i2s0_data), 181 + LPI_FUNCTION(i2s0_ws), 182 + LPI_FUNCTION(i2s1_clk), 183 + LPI_FUNCTION(i2s1_data), 184 + LPI_FUNCTION(i2s1_ws), 185 + LPI_FUNCTION(i2s2_clk), 186 + LPI_FUNCTION(i2s2_data), 187 + LPI_FUNCTION(i2s2_ws), 188 + LPI_FUNCTION(i2s3_clk), 189 + LPI_FUNCTION(i2s3_data), 190 + LPI_FUNCTION(i2s3_ws), 191 + LPI_FUNCTION(i2s4_clk), 192 + LPI_FUNCTION(i2s4_data), 193 + LPI_FUNCTION(i2s4_ws), 194 + LPI_FUNCTION(slimbus_clk), 195 + LPI_FUNCTION(slimbus_data), 196 + LPI_FUNCTION(swr_rx_clk), 197 + LPI_FUNCTION(swr_rx_data), 198 + LPI_FUNCTION(swr_tx_clk), 199 + LPI_FUNCTION(swr_tx_data), 200 + LPI_FUNCTION(wsa_swr_clk), 201 + LPI_FUNCTION(wsa_swr_data), 202 + LPI_FUNCTION(wsa2_swr_clk), 203 + LPI_FUNCTION(wsa2_swr_data), 204 + LPI_FUNCTION(ext_mclk1_a), 205 + LPI_FUNCTION(ext_mclk1_b), 206 + LPI_FUNCTION(ext_mclk1_c), 207 + LPI_FUNCTION(ext_mclk1_d), 208 + LPI_FUNCTION(ext_mclk1_e), 209 + }; 210 + 211 + static const struct lpi_pinctrl_variant_data sm8550_lpi_data = { 212 + .pins = sm8550_lpi_pins, 213 + .npins = ARRAY_SIZE(sm8550_lpi_pins), 214 + .groups = sm8550_groups, 215 + .ngroups = ARRAY_SIZE(sm8550_groups), 216 + .functions = sm8550_functions, 217 + .nfunctions = ARRAY_SIZE(sm8550_functions), 218 + }; 219 + 220 + static const struct of_device_id lpi_pinctrl_of_match[] = { 221 + { 222 + .compatible = "qcom,sm8550-lpass-lpi-pinctrl", 223 + .data = &sm8550_lpi_data, 224 + }, 225 + { } 226 + }; 227 + MODULE_DEVICE_TABLE(of, lpi_pinctrl_of_match); 228 + 229 + static struct platform_driver lpi_pinctrl_driver = { 230 + .driver = { 231 + .name = "qcom-sm8550-lpass-lpi-pinctrl", 232 + .of_match_table = lpi_pinctrl_of_match, 233 + }, 234 + .probe = lpi_pinctrl_probe, 235 + .remove = lpi_pinctrl_remove, 236 + }; 237 + 238 + module_platform_driver(lpi_pinctrl_driver); 239 + MODULE_DESCRIPTION("Qualcomm SM8550 LPI GPIO pin control driver"); 240 + MODULE_LICENSE("GPL");
+1790
drivers/pinctrl/qcom/pinctrl-sm8550.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2021, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 5 + * Copyright (c) 2022, Linaro Limited 6 + */ 7 + 8 + #include <linux/module.h> 9 + #include <linux/of.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/pinctrl/pinctrl.h> 12 + 13 + #include "pinctrl-msm.h" 14 + 15 + #define FUNCTION(fname) \ 16 + [msm_mux_##fname] = { \ 17 + .name = #fname, \ 18 + .groups = fname##_groups, \ 19 + .ngroups = ARRAY_SIZE(fname##_groups), \ 20 + } 21 + 22 + #define REG_SIZE 0x1000 23 + 24 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 25 + { \ 26 + .name = "gpio" #id, \ 27 + .pins = gpio##id##_pins, \ 28 + .npins = (unsigned int)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 = REG_SIZE * id, \ 43 + .io_reg = 0x4 + REG_SIZE * id, \ 44 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 45 + .intr_status_reg = 0xc + REG_SIZE * id, \ 46 + .intr_target_reg = 0x8 + REG_SIZE * id, \ 47 + .mux_bit = 2, \ 48 + .pull_bit = 0, \ 49 + .drv_bit = 6, \ 50 + .i2c_pull_bit = 13, \ 51 + .egpio_enable = 12, \ 52 + .egpio_present = 11, \ 53 + .oe_bit = 9, \ 54 + .in_bit = 0, \ 55 + .out_bit = 1, \ 56 + .intr_enable_bit = 0, \ 57 + .intr_status_bit = 0, \ 58 + .intr_target_bit = 5, \ 59 + .intr_target_kpss_val = 3, \ 60 + .intr_raw_status_bit = 4, \ 61 + .intr_polarity_bit = 1, \ 62 + .intr_detection_bit = 2, \ 63 + .intr_detection_width = 2, \ 64 + } 65 + 66 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 67 + { \ 68 + .name = #pg_name, \ 69 + .pins = pg_name##_pins, \ 70 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 71 + .ctl_reg = ctl, \ 72 + .io_reg = 0, \ 73 + .intr_cfg_reg = 0, \ 74 + .intr_status_reg = 0, \ 75 + .intr_target_reg = 0, \ 76 + .mux_bit = -1, \ 77 + .pull_bit = pull, \ 78 + .drv_bit = drv, \ 79 + .oe_bit = -1, \ 80 + .in_bit = -1, \ 81 + .out_bit = -1, \ 82 + .intr_enable_bit = -1, \ 83 + .intr_status_bit = -1, \ 84 + .intr_target_bit = -1, \ 85 + .intr_raw_status_bit = -1, \ 86 + .intr_polarity_bit = -1, \ 87 + .intr_detection_bit = -1, \ 88 + .intr_detection_width = -1, \ 89 + } 90 + 91 + #define UFS_RESET(pg_name, offset) \ 92 + { \ 93 + .name = #pg_name, \ 94 + .pins = pg_name##_pins, \ 95 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 96 + .ctl_reg = offset, \ 97 + .io_reg = offset + 0x4, \ 98 + .intr_cfg_reg = 0, \ 99 + .intr_status_reg = 0, \ 100 + .intr_target_reg = 0, \ 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 sm8550_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, "GPIO_123"), 241 + PINCTRL_PIN(124, "GPIO_124"), 242 + PINCTRL_PIN(125, "GPIO_125"), 243 + PINCTRL_PIN(126, "GPIO_126"), 244 + PINCTRL_PIN(127, "GPIO_127"), 245 + PINCTRL_PIN(128, "GPIO_128"), 246 + PINCTRL_PIN(129, "GPIO_129"), 247 + PINCTRL_PIN(130, "GPIO_130"), 248 + PINCTRL_PIN(131, "GPIO_131"), 249 + PINCTRL_PIN(132, "GPIO_132"), 250 + PINCTRL_PIN(133, "GPIO_133"), 251 + PINCTRL_PIN(134, "GPIO_134"), 252 + PINCTRL_PIN(135, "GPIO_135"), 253 + PINCTRL_PIN(136, "GPIO_136"), 254 + PINCTRL_PIN(137, "GPIO_137"), 255 + PINCTRL_PIN(138, "GPIO_138"), 256 + PINCTRL_PIN(139, "GPIO_139"), 257 + PINCTRL_PIN(140, "GPIO_140"), 258 + PINCTRL_PIN(141, "GPIO_141"), 259 + PINCTRL_PIN(142, "GPIO_142"), 260 + PINCTRL_PIN(143, "GPIO_143"), 261 + PINCTRL_PIN(144, "GPIO_144"), 262 + PINCTRL_PIN(145, "GPIO_145"), 263 + PINCTRL_PIN(146, "GPIO_146"), 264 + PINCTRL_PIN(147, "GPIO_147"), 265 + PINCTRL_PIN(148, "GPIO_148"), 266 + PINCTRL_PIN(149, "GPIO_149"), 267 + PINCTRL_PIN(150, "GPIO_150"), 268 + PINCTRL_PIN(151, "GPIO_151"), 269 + PINCTRL_PIN(152, "GPIO_152"), 270 + PINCTRL_PIN(153, "GPIO_153"), 271 + PINCTRL_PIN(154, "GPIO_154"), 272 + PINCTRL_PIN(155, "GPIO_155"), 273 + PINCTRL_PIN(156, "GPIO_156"), 274 + PINCTRL_PIN(157, "GPIO_157"), 275 + PINCTRL_PIN(158, "GPIO_158"), 276 + PINCTRL_PIN(159, "GPIO_159"), 277 + PINCTRL_PIN(160, "GPIO_160"), 278 + PINCTRL_PIN(161, "GPIO_161"), 279 + PINCTRL_PIN(162, "GPIO_162"), 280 + PINCTRL_PIN(163, "GPIO_163"), 281 + PINCTRL_PIN(164, "GPIO_164"), 282 + PINCTRL_PIN(165, "GPIO_165"), 283 + PINCTRL_PIN(166, "GPIO_166"), 284 + PINCTRL_PIN(167, "GPIO_167"), 285 + PINCTRL_PIN(168, "GPIO_168"), 286 + PINCTRL_PIN(169, "GPIO_169"), 287 + PINCTRL_PIN(170, "GPIO_170"), 288 + PINCTRL_PIN(171, "GPIO_171"), 289 + PINCTRL_PIN(172, "GPIO_172"), 290 + PINCTRL_PIN(173, "GPIO_173"), 291 + PINCTRL_PIN(174, "GPIO_174"), 292 + PINCTRL_PIN(175, "GPIO_175"), 293 + PINCTRL_PIN(176, "GPIO_176"), 294 + PINCTRL_PIN(177, "GPIO_177"), 295 + PINCTRL_PIN(178, "GPIO_178"), 296 + PINCTRL_PIN(179, "GPIO_179"), 297 + PINCTRL_PIN(180, "GPIO_180"), 298 + PINCTRL_PIN(181, "GPIO_181"), 299 + PINCTRL_PIN(182, "GPIO_182"), 300 + PINCTRL_PIN(183, "GPIO_183"), 301 + PINCTRL_PIN(184, "GPIO_184"), 302 + PINCTRL_PIN(185, "GPIO_185"), 303 + PINCTRL_PIN(186, "GPIO_186"), 304 + PINCTRL_PIN(187, "GPIO_187"), 305 + PINCTRL_PIN(188, "GPIO_188"), 306 + PINCTRL_PIN(189, "GPIO_189"), 307 + PINCTRL_PIN(190, "GPIO_190"), 308 + PINCTRL_PIN(191, "GPIO_191"), 309 + PINCTRL_PIN(192, "GPIO_192"), 310 + PINCTRL_PIN(193, "GPIO_193"), 311 + PINCTRL_PIN(194, "GPIO_194"), 312 + PINCTRL_PIN(195, "GPIO_195"), 313 + PINCTRL_PIN(196, "GPIO_196"), 314 + PINCTRL_PIN(197, "GPIO_197"), 315 + PINCTRL_PIN(198, "GPIO_198"), 316 + PINCTRL_PIN(199, "GPIO_199"), 317 + PINCTRL_PIN(200, "GPIO_200"), 318 + PINCTRL_PIN(201, "GPIO_201"), 319 + PINCTRL_PIN(202, "GPIO_202"), 320 + PINCTRL_PIN(203, "GPIO_203"), 321 + PINCTRL_PIN(204, "GPIO_204"), 322 + PINCTRL_PIN(205, "GPIO_205"), 323 + PINCTRL_PIN(206, "GPIO_206"), 324 + PINCTRL_PIN(207, "GPIO_207"), 325 + PINCTRL_PIN(208, "GPIO_208"), 326 + PINCTRL_PIN(209, "GPIO_209"), 327 + PINCTRL_PIN(210, "UFS_RESET"), 328 + PINCTRL_PIN(211, "SDC2_CLK"), 329 + PINCTRL_PIN(212, "SDC2_CMD"), 330 + PINCTRL_PIN(213, "SDC2_DATA"), 331 + }; 332 + 333 + #define DECLARE_MSM_GPIO_PINS(pin) \ 334 + static const unsigned int gpio##pin##_pins[] = { pin } 335 + DECLARE_MSM_GPIO_PINS(0); 336 + DECLARE_MSM_GPIO_PINS(1); 337 + DECLARE_MSM_GPIO_PINS(2); 338 + DECLARE_MSM_GPIO_PINS(3); 339 + DECLARE_MSM_GPIO_PINS(4); 340 + DECLARE_MSM_GPIO_PINS(5); 341 + DECLARE_MSM_GPIO_PINS(6); 342 + DECLARE_MSM_GPIO_PINS(7); 343 + DECLARE_MSM_GPIO_PINS(8); 344 + DECLARE_MSM_GPIO_PINS(9); 345 + DECLARE_MSM_GPIO_PINS(10); 346 + DECLARE_MSM_GPIO_PINS(11); 347 + DECLARE_MSM_GPIO_PINS(12); 348 + DECLARE_MSM_GPIO_PINS(13); 349 + DECLARE_MSM_GPIO_PINS(14); 350 + DECLARE_MSM_GPIO_PINS(15); 351 + DECLARE_MSM_GPIO_PINS(16); 352 + DECLARE_MSM_GPIO_PINS(17); 353 + DECLARE_MSM_GPIO_PINS(18); 354 + DECLARE_MSM_GPIO_PINS(19); 355 + DECLARE_MSM_GPIO_PINS(20); 356 + DECLARE_MSM_GPIO_PINS(21); 357 + DECLARE_MSM_GPIO_PINS(22); 358 + DECLARE_MSM_GPIO_PINS(23); 359 + DECLARE_MSM_GPIO_PINS(24); 360 + DECLARE_MSM_GPIO_PINS(25); 361 + DECLARE_MSM_GPIO_PINS(26); 362 + DECLARE_MSM_GPIO_PINS(27); 363 + DECLARE_MSM_GPIO_PINS(28); 364 + DECLARE_MSM_GPIO_PINS(29); 365 + DECLARE_MSM_GPIO_PINS(30); 366 + DECLARE_MSM_GPIO_PINS(31); 367 + DECLARE_MSM_GPIO_PINS(32); 368 + DECLARE_MSM_GPIO_PINS(33); 369 + DECLARE_MSM_GPIO_PINS(34); 370 + DECLARE_MSM_GPIO_PINS(35); 371 + DECLARE_MSM_GPIO_PINS(36); 372 + DECLARE_MSM_GPIO_PINS(37); 373 + DECLARE_MSM_GPIO_PINS(38); 374 + DECLARE_MSM_GPIO_PINS(39); 375 + DECLARE_MSM_GPIO_PINS(40); 376 + DECLARE_MSM_GPIO_PINS(41); 377 + DECLARE_MSM_GPIO_PINS(42); 378 + DECLARE_MSM_GPIO_PINS(43); 379 + DECLARE_MSM_GPIO_PINS(44); 380 + DECLARE_MSM_GPIO_PINS(45); 381 + DECLARE_MSM_GPIO_PINS(46); 382 + DECLARE_MSM_GPIO_PINS(47); 383 + DECLARE_MSM_GPIO_PINS(48); 384 + DECLARE_MSM_GPIO_PINS(49); 385 + DECLARE_MSM_GPIO_PINS(50); 386 + DECLARE_MSM_GPIO_PINS(51); 387 + DECLARE_MSM_GPIO_PINS(52); 388 + DECLARE_MSM_GPIO_PINS(53); 389 + DECLARE_MSM_GPIO_PINS(54); 390 + DECLARE_MSM_GPIO_PINS(55); 391 + DECLARE_MSM_GPIO_PINS(56); 392 + DECLARE_MSM_GPIO_PINS(57); 393 + DECLARE_MSM_GPIO_PINS(58); 394 + DECLARE_MSM_GPIO_PINS(59); 395 + DECLARE_MSM_GPIO_PINS(60); 396 + DECLARE_MSM_GPIO_PINS(61); 397 + DECLARE_MSM_GPIO_PINS(62); 398 + DECLARE_MSM_GPIO_PINS(63); 399 + DECLARE_MSM_GPIO_PINS(64); 400 + DECLARE_MSM_GPIO_PINS(65); 401 + DECLARE_MSM_GPIO_PINS(66); 402 + DECLARE_MSM_GPIO_PINS(67); 403 + DECLARE_MSM_GPIO_PINS(68); 404 + DECLARE_MSM_GPIO_PINS(69); 405 + DECLARE_MSM_GPIO_PINS(70); 406 + DECLARE_MSM_GPIO_PINS(71); 407 + DECLARE_MSM_GPIO_PINS(72); 408 + DECLARE_MSM_GPIO_PINS(73); 409 + DECLARE_MSM_GPIO_PINS(74); 410 + DECLARE_MSM_GPIO_PINS(75); 411 + DECLARE_MSM_GPIO_PINS(76); 412 + DECLARE_MSM_GPIO_PINS(77); 413 + DECLARE_MSM_GPIO_PINS(78); 414 + DECLARE_MSM_GPIO_PINS(79); 415 + DECLARE_MSM_GPIO_PINS(80); 416 + DECLARE_MSM_GPIO_PINS(81); 417 + DECLARE_MSM_GPIO_PINS(82); 418 + DECLARE_MSM_GPIO_PINS(83); 419 + DECLARE_MSM_GPIO_PINS(84); 420 + DECLARE_MSM_GPIO_PINS(85); 421 + DECLARE_MSM_GPIO_PINS(86); 422 + DECLARE_MSM_GPIO_PINS(87); 423 + DECLARE_MSM_GPIO_PINS(88); 424 + DECLARE_MSM_GPIO_PINS(89); 425 + DECLARE_MSM_GPIO_PINS(90); 426 + DECLARE_MSM_GPIO_PINS(91); 427 + DECLARE_MSM_GPIO_PINS(92); 428 + DECLARE_MSM_GPIO_PINS(93); 429 + DECLARE_MSM_GPIO_PINS(94); 430 + DECLARE_MSM_GPIO_PINS(95); 431 + DECLARE_MSM_GPIO_PINS(96); 432 + DECLARE_MSM_GPIO_PINS(97); 433 + DECLARE_MSM_GPIO_PINS(98); 434 + DECLARE_MSM_GPIO_PINS(99); 435 + DECLARE_MSM_GPIO_PINS(100); 436 + DECLARE_MSM_GPIO_PINS(101); 437 + DECLARE_MSM_GPIO_PINS(102); 438 + DECLARE_MSM_GPIO_PINS(103); 439 + DECLARE_MSM_GPIO_PINS(104); 440 + DECLARE_MSM_GPIO_PINS(105); 441 + DECLARE_MSM_GPIO_PINS(106); 442 + DECLARE_MSM_GPIO_PINS(107); 443 + DECLARE_MSM_GPIO_PINS(108); 444 + DECLARE_MSM_GPIO_PINS(109); 445 + DECLARE_MSM_GPIO_PINS(110); 446 + DECLARE_MSM_GPIO_PINS(111); 447 + DECLARE_MSM_GPIO_PINS(112); 448 + DECLARE_MSM_GPIO_PINS(113); 449 + DECLARE_MSM_GPIO_PINS(114); 450 + DECLARE_MSM_GPIO_PINS(115); 451 + DECLARE_MSM_GPIO_PINS(116); 452 + DECLARE_MSM_GPIO_PINS(117); 453 + DECLARE_MSM_GPIO_PINS(118); 454 + DECLARE_MSM_GPIO_PINS(119); 455 + DECLARE_MSM_GPIO_PINS(120); 456 + DECLARE_MSM_GPIO_PINS(121); 457 + DECLARE_MSM_GPIO_PINS(122); 458 + DECLARE_MSM_GPIO_PINS(123); 459 + DECLARE_MSM_GPIO_PINS(124); 460 + DECLARE_MSM_GPIO_PINS(125); 461 + DECLARE_MSM_GPIO_PINS(126); 462 + DECLARE_MSM_GPIO_PINS(127); 463 + DECLARE_MSM_GPIO_PINS(128); 464 + DECLARE_MSM_GPIO_PINS(129); 465 + DECLARE_MSM_GPIO_PINS(130); 466 + DECLARE_MSM_GPIO_PINS(131); 467 + DECLARE_MSM_GPIO_PINS(132); 468 + DECLARE_MSM_GPIO_PINS(133); 469 + DECLARE_MSM_GPIO_PINS(134); 470 + DECLARE_MSM_GPIO_PINS(135); 471 + DECLARE_MSM_GPIO_PINS(136); 472 + DECLARE_MSM_GPIO_PINS(137); 473 + DECLARE_MSM_GPIO_PINS(138); 474 + DECLARE_MSM_GPIO_PINS(139); 475 + DECLARE_MSM_GPIO_PINS(140); 476 + DECLARE_MSM_GPIO_PINS(141); 477 + DECLARE_MSM_GPIO_PINS(142); 478 + DECLARE_MSM_GPIO_PINS(143); 479 + DECLARE_MSM_GPIO_PINS(144); 480 + DECLARE_MSM_GPIO_PINS(145); 481 + DECLARE_MSM_GPIO_PINS(146); 482 + DECLARE_MSM_GPIO_PINS(147); 483 + DECLARE_MSM_GPIO_PINS(148); 484 + DECLARE_MSM_GPIO_PINS(149); 485 + DECLARE_MSM_GPIO_PINS(150); 486 + DECLARE_MSM_GPIO_PINS(151); 487 + DECLARE_MSM_GPIO_PINS(152); 488 + DECLARE_MSM_GPIO_PINS(153); 489 + DECLARE_MSM_GPIO_PINS(154); 490 + DECLARE_MSM_GPIO_PINS(155); 491 + DECLARE_MSM_GPIO_PINS(156); 492 + DECLARE_MSM_GPIO_PINS(157); 493 + DECLARE_MSM_GPIO_PINS(158); 494 + DECLARE_MSM_GPIO_PINS(159); 495 + DECLARE_MSM_GPIO_PINS(160); 496 + DECLARE_MSM_GPIO_PINS(161); 497 + DECLARE_MSM_GPIO_PINS(162); 498 + DECLARE_MSM_GPIO_PINS(163); 499 + DECLARE_MSM_GPIO_PINS(164); 500 + DECLARE_MSM_GPIO_PINS(165); 501 + DECLARE_MSM_GPIO_PINS(166); 502 + DECLARE_MSM_GPIO_PINS(167); 503 + DECLARE_MSM_GPIO_PINS(168); 504 + DECLARE_MSM_GPIO_PINS(169); 505 + DECLARE_MSM_GPIO_PINS(170); 506 + DECLARE_MSM_GPIO_PINS(171); 507 + DECLARE_MSM_GPIO_PINS(172); 508 + DECLARE_MSM_GPIO_PINS(173); 509 + DECLARE_MSM_GPIO_PINS(174); 510 + DECLARE_MSM_GPIO_PINS(175); 511 + DECLARE_MSM_GPIO_PINS(176); 512 + DECLARE_MSM_GPIO_PINS(177); 513 + DECLARE_MSM_GPIO_PINS(178); 514 + DECLARE_MSM_GPIO_PINS(179); 515 + DECLARE_MSM_GPIO_PINS(180); 516 + DECLARE_MSM_GPIO_PINS(181); 517 + DECLARE_MSM_GPIO_PINS(182); 518 + DECLARE_MSM_GPIO_PINS(183); 519 + DECLARE_MSM_GPIO_PINS(184); 520 + DECLARE_MSM_GPIO_PINS(185); 521 + DECLARE_MSM_GPIO_PINS(186); 522 + DECLARE_MSM_GPIO_PINS(187); 523 + DECLARE_MSM_GPIO_PINS(188); 524 + DECLARE_MSM_GPIO_PINS(189); 525 + DECLARE_MSM_GPIO_PINS(190); 526 + DECLARE_MSM_GPIO_PINS(191); 527 + DECLARE_MSM_GPIO_PINS(192); 528 + DECLARE_MSM_GPIO_PINS(193); 529 + DECLARE_MSM_GPIO_PINS(194); 530 + DECLARE_MSM_GPIO_PINS(195); 531 + DECLARE_MSM_GPIO_PINS(196); 532 + DECLARE_MSM_GPIO_PINS(197); 533 + DECLARE_MSM_GPIO_PINS(198); 534 + DECLARE_MSM_GPIO_PINS(199); 535 + DECLARE_MSM_GPIO_PINS(200); 536 + DECLARE_MSM_GPIO_PINS(201); 537 + DECLARE_MSM_GPIO_PINS(202); 538 + DECLARE_MSM_GPIO_PINS(203); 539 + DECLARE_MSM_GPIO_PINS(204); 540 + DECLARE_MSM_GPIO_PINS(205); 541 + DECLARE_MSM_GPIO_PINS(206); 542 + DECLARE_MSM_GPIO_PINS(207); 543 + DECLARE_MSM_GPIO_PINS(208); 544 + DECLARE_MSM_GPIO_PINS(209); 545 + 546 + static const unsigned int ufs_reset_pins[] = { 210 }; 547 + static const unsigned int sdc2_clk_pins[] = { 211 }; 548 + static const unsigned int sdc2_cmd_pins[] = { 212 }; 549 + static const unsigned int sdc2_data_pins[] = { 213 }; 550 + 551 + enum sm8550_functions { 552 + msm_mux_gpio, 553 + msm_mux_aon_cci, 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_mclk4, 561 + msm_mux_cam_mclk, 562 + msm_mux_cci_async_in, 563 + msm_mux_cci_i2c_scl, 564 + msm_mux_cci_i2c_sda, 565 + msm_mux_cci_timer, 566 + msm_mux_cmu_rng, 567 + msm_mux_coex_uart1_rx, 568 + msm_mux_coex_uart1_tx, 569 + msm_mux_coex_uart2_rx, 570 + msm_mux_coex_uart2_tx, 571 + msm_mux_cri_trng, 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_gcc_gp1, 583 + msm_mux_gcc_gp2, 584 + msm_mux_gcc_gp3, 585 + msm_mux_i2chub0_se0, 586 + msm_mux_i2chub0_se1, 587 + msm_mux_i2chub0_se2, 588 + msm_mux_i2chub0_se3, 589 + msm_mux_i2chub0_se4, 590 + msm_mux_i2chub0_se5, 591 + msm_mux_i2chub0_se6, 592 + msm_mux_i2chub0_se7, 593 + msm_mux_i2chub0_se8, 594 + msm_mux_i2chub0_se9, 595 + msm_mux_i2s0_data0, 596 + msm_mux_i2s0_data1, 597 + msm_mux_i2s0_sck, 598 + msm_mux_i2s0_ws, 599 + msm_mux_i2s1_data0, 600 + msm_mux_i2s1_data1, 601 + msm_mux_i2s1_sck, 602 + msm_mux_i2s1_ws, 603 + msm_mux_ibi_i3c, 604 + msm_mux_jitter_bist, 605 + msm_mux_mdp_vsync, 606 + msm_mux_mdp_vsync0_out, 607 + msm_mux_mdp_vsync1_out, 608 + msm_mux_mdp_vsync2_out, 609 + msm_mux_mdp_vsync3_out, 610 + msm_mux_mdp_vsync_e, 611 + msm_mux_nav_gpio0, 612 + msm_mux_nav_gpio1, 613 + msm_mux_nav_gpio2, 614 + msm_mux_pcie0_clk_req_n, 615 + msm_mux_pcie1_clk_req_n, 616 + msm_mux_phase_flag, 617 + msm_mux_pll_bist_sync, 618 + msm_mux_pll_clk_aux, 619 + msm_mux_prng_rosc0, 620 + msm_mux_prng_rosc1, 621 + msm_mux_prng_rosc2, 622 + msm_mux_prng_rosc3, 623 + msm_mux_qdss_cti, 624 + msm_mux_qdss_gpio, 625 + msm_mux_qlink0_enable, 626 + msm_mux_qlink0_request, 627 + msm_mux_qlink0_wmss, 628 + msm_mux_qlink1_enable, 629 + msm_mux_qlink1_request, 630 + msm_mux_qlink1_wmss, 631 + msm_mux_qlink2_enable, 632 + msm_mux_qlink2_request, 633 + msm_mux_qlink2_wmss, 634 + msm_mux_qspi0, 635 + msm_mux_qspi1, 636 + msm_mux_qspi2, 637 + msm_mux_qspi3, 638 + msm_mux_qspi_clk, 639 + msm_mux_qspi_cs, 640 + msm_mux_qup1_se0, 641 + msm_mux_qup1_se1, 642 + msm_mux_qup1_se2, 643 + msm_mux_qup1_se3, 644 + msm_mux_qup1_se4, 645 + msm_mux_qup1_se5, 646 + msm_mux_qup1_se6, 647 + msm_mux_qup1_se7, 648 + msm_mux_qup2_se0, 649 + msm_mux_qup2_se0_l0_mira, 650 + msm_mux_qup2_se0_l0_mirb, 651 + msm_mux_qup2_se0_l1_mira, 652 + msm_mux_qup2_se0_l1_mirb, 653 + msm_mux_qup2_se0_l2_mira, 654 + msm_mux_qup2_se0_l2_mirb, 655 + msm_mux_qup2_se0_l3_mira, 656 + msm_mux_qup2_se0_l3_mirb, 657 + msm_mux_qup2_se1, 658 + msm_mux_qup2_se2, 659 + msm_mux_qup2_se3, 660 + msm_mux_qup2_se4, 661 + msm_mux_qup2_se5, 662 + msm_mux_qup2_se6, 663 + msm_mux_qup2_se7, 664 + msm_mux_resout_n, 665 + msm_mux_sd_write_protect, 666 + msm_mux_sdc40, 667 + msm_mux_sdc41, 668 + msm_mux_sdc42, 669 + msm_mux_sdc43, 670 + msm_mux_sdc4_clk, 671 + msm_mux_sdc4_cmd, 672 + msm_mux_tb_trig_sdc2, 673 + msm_mux_tb_trig_sdc4, 674 + msm_mux_tgu_ch0_trigout, 675 + msm_mux_tgu_ch1_trigout, 676 + msm_mux_tgu_ch2_trigout, 677 + msm_mux_tgu_ch3_trigout, 678 + msm_mux_tmess_prng0, 679 + msm_mux_tmess_prng1, 680 + msm_mux_tmess_prng2, 681 + msm_mux_tmess_prng3, 682 + msm_mux_tsense_pwm1, 683 + msm_mux_tsense_pwm2, 684 + msm_mux_tsense_pwm3, 685 + msm_mux_uim0_clk, 686 + msm_mux_uim0_data, 687 + msm_mux_uim0_present, 688 + msm_mux_uim0_reset, 689 + msm_mux_uim1_clk, 690 + msm_mux_uim1_data, 691 + msm_mux_uim1_present, 692 + msm_mux_uim1_reset, 693 + msm_mux_usb1_hs, 694 + msm_mux_usb_phy, 695 + msm_mux_vfr_0, 696 + msm_mux_vfr_1, 697 + msm_mux_vsense_trigger_mirnat, 698 + msm_mux__, 699 + }; 700 + 701 + static const char * const gpio_groups[] = { 702 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 703 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 704 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 705 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 706 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 707 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 708 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 709 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 710 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 711 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 712 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 713 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 714 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 715 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 716 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 717 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 718 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 719 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 720 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 721 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 722 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 723 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 724 + "gpio147", "gpio148", "gpio149", "gpio150", "gpio151", "gpio152", 725 + "gpio153", "gpio154", "gpio155", "gpio156", "gpio157", "gpio158", 726 + "gpio159", "gpio160", "gpio161", "gpio162", "gpio163", "gpio164", 727 + "gpio165", "gpio166", "gpio167", "gpio168", "gpio169", "gpio170", 728 + "gpio171", "gpio172", "gpio173", "gpio174", "gpio175", "gpio176", 729 + "gpio177", "gpio178", "gpio179", "gpio180", "gpio181", "gpio182", 730 + "gpio183", "gpio184", "gpio185", "gpio186", "gpio187", "gpio188", 731 + "gpio189", "gpio190", "gpio191", "gpio192", "gpio193", "gpio194", 732 + "gpio195", "gpio196", "gpio197", "gpio198", "gpio199", "gpio200", 733 + "gpio201", "gpio202", "gpio203", "gpio204", "gpio205", "gpio206", 734 + "gpio207", "gpio208", "gpio209", 735 + }; 736 + 737 + static const char * const aon_cci_groups[] = { 738 + "gpio208", "gpio209", 739 + }; 740 + 741 + static const char * const aoss_cti_groups[] = { 742 + "gpio44", "gpio45", "gpio46", "gpio47", 743 + }; 744 + 745 + static const char *const atest_char_groups[] = { 746 + "gpio130", "gpio132", "gpio133", "gpio134", "gpio135", 747 + }; 748 + 749 + static const char *const atest_usb_groups[] = { 750 + "gpio37", "gpio39", "gpio55", "gpio149", "gpio148", 751 + }; 752 + 753 + static const char *const audio_ext_mclk0_groups[] = { 754 + "gpio125", 755 + }; 756 + 757 + static const char *const audio_ext_mclk1_groups[] = { 758 + "gpio124", 759 + }; 760 + 761 + static const char *const audio_ref_clk_groups[] = { 762 + "gpio124", 763 + }; 764 + 765 + static const char *const cam_aon_mclk4_groups[] = { 766 + "gpio104", 767 + }; 768 + 769 + static const char *const cam_mclk_groups[] = { 770 + "gpio100", "gpio101", "gpio102", "gpio103", 771 + "gpio105", "gpio106", "gpio107", 772 + }; 773 + 774 + static const char *const cci_async_in_groups[] = { 775 + "gpio71", "gpio72", "gpio109", 776 + }; 777 + 778 + static const char *const cci_i2c_scl_groups[] = { 779 + "gpio111", "gpio113", "gpio115", "gpio75", "gpio1", 780 + }; 781 + 782 + static const char *const cci_i2c_sda_groups[] = { 783 + "gpio110", "gpio112", "gpio114", "gpio74", "gpio0", 784 + }; 785 + 786 + static const char *const cci_timer_groups[] = { 787 + "gpio116", "gpio117", "gpio118", "gpio119", "gpio120", 788 + }; 789 + 790 + static const char *const cmu_rng_groups[] = { 791 + "gpio129", "gpio128", "gpio127", "gpio122", 792 + }; 793 + 794 + static const char *const coex_uart1_rx_groups[] = { 795 + "gpio148", 796 + }; 797 + 798 + static const char *const coex_uart1_tx_groups[] = { 799 + "gpio149", 800 + }; 801 + 802 + static const char *const coex_uart2_rx_groups[] = { 803 + "gpio150", 804 + }; 805 + 806 + static const char *const coex_uart2_tx_groups[] = { 807 + "gpio151", 808 + }; 809 + 810 + static const char *const cri_trng_groups[] = { 811 + "gpio187", 812 + }; 813 + 814 + static const char *const dbg_out_clk_groups[] = { 815 + "gpio89", 816 + }; 817 + 818 + static const char *const ddr_bist_complete_groups[] = { 819 + "gpio40", 820 + }; 821 + 822 + static const char *const ddr_bist_fail_groups[] = { 823 + "gpio36", 824 + }; 825 + 826 + static const char *const ddr_bist_start_groups[] = { 827 + "gpio37", 828 + }; 829 + 830 + static const char *const ddr_bist_stop_groups[] = { 831 + "gpio41", 832 + }; 833 + 834 + static const char *const ddr_pxi0_groups[] = { 835 + "gpio51", 836 + "gpio52", 837 + }; 838 + 839 + static const char *const ddr_pxi1_groups[] = { 840 + "gpio40", 841 + "gpio41", 842 + }; 843 + 844 + static const char *const ddr_pxi2_groups[] = { 845 + "gpio45", 846 + "gpio47", 847 + }; 848 + 849 + static const char *const ddr_pxi3_groups[] = { 850 + "gpio43", 851 + "gpio44", 852 + }; 853 + 854 + static const char *const dp_hot_groups[] = { 855 + "gpio47", 856 + }; 857 + 858 + static const char *const gcc_gp1_groups[] = { 859 + "gpio86", 860 + "gpio134", 861 + }; 862 + 863 + static const char *const gcc_gp2_groups[] = { 864 + "gpio87", 865 + "gpio135", 866 + }; 867 + 868 + static const char *const gcc_gp3_groups[] = { 869 + "gpio88", 870 + "gpio136", 871 + }; 872 + 873 + static const char *const i2chub0_se0_groups[] = { 874 + "gpio16", 875 + "gpio17", 876 + }; 877 + 878 + static const char *const i2chub0_se1_groups[] = { 879 + "gpio18", 880 + "gpio19", 881 + }; 882 + 883 + static const char *const i2chub0_se2_groups[] = { 884 + "gpio20", 885 + "gpio21", 886 + }; 887 + 888 + static const char *const i2chub0_se3_groups[] = { 889 + "gpio22", 890 + "gpio23", 891 + }; 892 + 893 + static const char *const i2chub0_se4_groups[] = { 894 + "gpio4", 895 + "gpio5", 896 + }; 897 + 898 + static const char *const i2chub0_se5_groups[] = { 899 + "gpio6", 900 + "gpio7", 901 + }; 902 + 903 + static const char *const i2chub0_se6_groups[] = { 904 + "gpio8", 905 + "gpio9", 906 + }; 907 + 908 + static const char *const i2chub0_se7_groups[] = { 909 + "gpio10", 910 + "gpio11", 911 + }; 912 + 913 + static const char *const i2chub0_se8_groups[] = { 914 + "gpio206", 915 + "gpio207", 916 + }; 917 + 918 + static const char *const i2chub0_se9_groups[] = { 919 + "gpio84", 920 + "gpio85", 921 + }; 922 + 923 + static const char *const i2s0_data0_groups[] = { 924 + "gpio127", 925 + }; 926 + 927 + static const char *const i2s0_data1_groups[] = { 928 + "gpio128", 929 + }; 930 + 931 + static const char *const i2s0_sck_groups[] = { 932 + "gpio126", 933 + }; 934 + 935 + static const char *const i2s0_ws_groups[] = { 936 + "gpio129", 937 + }; 938 + 939 + static const char *const i2s1_data0_groups[] = { 940 + "gpio122", 941 + }; 942 + 943 + static const char *const i2s1_data1_groups[] = { 944 + "gpio124", 945 + }; 946 + 947 + static const char *const i2s1_sck_groups[] = { 948 + "gpio121", 949 + }; 950 + 951 + static const char *const i2s1_ws_groups[] = { 952 + "gpio123", 953 + }; 954 + 955 + static const char *const ibi_i3c_groups[] = { 956 + "gpio0", "gpio1", "gpio28", "gpio29", "gpio32", 957 + "gpio33", "gpio56", "gpio57", "gpio60", "gpio61", 958 + }; 959 + 960 + static const char *const jitter_bist_groups[] = { 961 + "gpio43", 962 + }; 963 + 964 + static const char *const mdp_vsync_groups[] = { 965 + "gpio86", 966 + "gpio87", 967 + "gpio133", 968 + "gpio137", 969 + }; 970 + 971 + static const char *const mdp_vsync0_out_groups[] = { 972 + "gpio86", 973 + }; 974 + 975 + static const char *const mdp_vsync1_out_groups[] = { 976 + "gpio86", 977 + }; 978 + 979 + static const char *const mdp_vsync2_out_groups[] = { 980 + "gpio87", 981 + }; 982 + 983 + static const char *const mdp_vsync3_out_groups[] = { 984 + "gpio87", 985 + }; 986 + 987 + static const char *const mdp_vsync_e_groups[] = { 988 + "gpio88", 989 + }; 990 + 991 + static const char *const nav_gpio0_groups[] = { 992 + "gpio154", 993 + }; 994 + 995 + static const char *const nav_gpio1_groups[] = { 996 + "gpio155", 997 + }; 998 + 999 + static const char *const nav_gpio2_groups[] = { 1000 + "gpio153", 1001 + }; 1002 + 1003 + static const char *const pcie0_clk_req_n_groups[] = { 1004 + "gpio95", 1005 + }; 1006 + 1007 + static const char *const pcie1_clk_req_n_groups[] = { 1008 + "gpio98", 1009 + }; 1010 + 1011 + static const char *const phase_flag_groups[] = { 1012 + "gpio0", "gpio2", "gpio3", "gpio10", "gpio11", "gpio12", "gpio13", "gpio59", 1013 + "gpio63", "gpio64", "gpio65", "gpio67", "gpio68", "gpio69", "gpio75", "gpio76", 1014 + "gpio77", "gpio79", "gpio80", "gpio81", "gpio92", "gpio83", "gpio94", "gpio95", 1015 + "gpio96", "gpio97", "gpio98", "gpio99", "gpio116", "gpio117", "gpio119", "gpio120", 1016 + }; 1017 + 1018 + static const char *const pll_bist_sync_groups[] = { 1019 + "gpio20", 1020 + }; 1021 + 1022 + static const char *const pll_clk_aux_groups[] = { 1023 + "gpio107", 1024 + }; 1025 + 1026 + static const char *const prng_rosc0_groups[] = { 1027 + "gpio186", 1028 + }; 1029 + 1030 + static const char *const prng_rosc1_groups[] = { 1031 + "gpio183", 1032 + }; 1033 + 1034 + static const char *const prng_rosc2_groups[] = { 1035 + "gpio182", 1036 + }; 1037 + 1038 + static const char *const prng_rosc3_groups[] = { 1039 + "gpio181", 1040 + }; 1041 + 1042 + static const char *const qdss_cti_groups[] = { 1043 + "gpio10", "gpio11", "gpio75", "gpio79", 1044 + "gpio159", "gpio160", "gpio161", "gpio162", 1045 + }; 1046 + 1047 + static const char *const qdss_gpio_groups[] = { 1048 + "gpio59", "gpio64", "gpio73", "gpio100", "gpio101", "gpio102", "gpio103", 1049 + "gpio104", "gpio105", "gpio110", "gpio111", "gpio112", "gpio113", "gpio114", 1050 + "gpio115", "gpio116", "gpio117", "gpio120", "gpio138", "gpio139", "gpio140", 1051 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio148", "gpio149", 1052 + "gpio150", "gpio151", "gpio152", "gpio153", "gpio154", "gpio155", "gpio156", 1053 + "gpio157", 1054 + }; 1055 + 1056 + static const char *const qlink0_enable_groups[] = { 1057 + "gpio157", 1058 + }; 1059 + 1060 + static const char *const qlink0_request_groups[] = { 1061 + "gpio156", 1062 + }; 1063 + 1064 + static const char *const qlink0_wmss_groups[] = { 1065 + "gpio158", 1066 + }; 1067 + 1068 + static const char *const qlink1_enable_groups[] = { 1069 + "gpio160", 1070 + }; 1071 + 1072 + static const char *const qlink1_request_groups[] = { 1073 + "gpio159", 1074 + }; 1075 + 1076 + static const char *const qlink1_wmss_groups[] = { 1077 + "gpio161", 1078 + }; 1079 + 1080 + static const char *const qlink2_enable_groups[] = { 1081 + "gpio163", 1082 + }; 1083 + 1084 + static const char *const qlink2_request_groups[] = { 1085 + "gpio162", 1086 + }; 1087 + 1088 + static const char *const qlink2_wmss_groups[] = { 1089 + "gpio164", 1090 + }; 1091 + 1092 + static const char *const qspi0_groups[] = { 1093 + "gpio89", 1094 + }; 1095 + 1096 + static const char *const qspi1_groups[] = { 1097 + "gpio90", 1098 + }; 1099 + 1100 + static const char *const qspi2_groups[] = { 1101 + "gpio48", 1102 + }; 1103 + 1104 + static const char *const qspi3_groups[] = { 1105 + "gpio49", 1106 + }; 1107 + 1108 + static const char *const qspi_clk_groups[] = { 1109 + "gpio50", 1110 + }; 1111 + 1112 + static const char *const qspi_cs_groups[] = { 1113 + "gpio51", "gpio91", 1114 + }; 1115 + 1116 + static const char *const qup1_se0_groups[] = { 1117 + "gpio28", "gpio29", "gpio30", "gpio31", 1118 + }; 1119 + 1120 + static const char *const qup1_se1_groups[] = { 1121 + "gpio32", "gpio33", "gpio34", "gpio35", 1122 + }; 1123 + 1124 + static const char *const qup1_se2_groups[] = { 1125 + "gpio40", "gpio41", "gpio42", "gpio36", 1126 + "gpio37", "gpio38", "gpio39", 1127 + }; 1128 + 1129 + static const char *const qup1_se3_groups[] = { 1130 + "gpio40", "gpio41", "gpio42", "gpio43", 1131 + }; 1132 + 1133 + static const char *const qup1_se4_groups[] = { 1134 + "gpio44", "gpio45", "gpio46", "gpio47", 1135 + }; 1136 + 1137 + static const char *const qup1_se5_groups[] = { 1138 + "gpio52", "gpio53", "gpio54", "gpio55", 1139 + }; 1140 + 1141 + static const char *const qup1_se6_groups[] = { 1142 + "gpio48", "gpio49", "gpio50", "gpio51", 1143 + }; 1144 + 1145 + static const char *const qup1_se7_groups[] = { 1146 + "gpio24", "gpio25", "gpio26", "gpio27", 1147 + }; 1148 + 1149 + static const char *const qup2_se0_groups[] = { 1150 + "gpio63", "gpio66", "gpio67", 1151 + }; 1152 + 1153 + static const char *const qup2_se0_l0_mira_groups[] = { 1154 + "gpio56", 1155 + }; 1156 + 1157 + static const char *const qup2_se0_l0_mirb_groups[] = { 1158 + "gpio0", 1159 + }; 1160 + 1161 + static const char *const qup2_se0_l1_mira_groups[] = { 1162 + "gpio57", 1163 + }; 1164 + 1165 + static const char *const qup2_se0_l1_mirb_groups[] = { 1166 + "gpio1", 1167 + }; 1168 + 1169 + static const char *const qup2_se0_l2_mira_groups[] = { 1170 + "gpio58", 1171 + }; 1172 + 1173 + static const char *const qup2_se0_l2_mirb_groups[] = { 1174 + "gpio109", 1175 + }; 1176 + 1177 + static const char *const qup2_se0_l3_mira_groups[] = { 1178 + "gpio59", 1179 + }; 1180 + 1181 + static const char *const qup2_se0_l3_mirb_groups[] = { 1182 + "gpio107", 1183 + }; 1184 + 1185 + static const char *const qup2_se1_groups[] = { 1186 + "gpio60", "gpio61", "gpio62", "gpio63", 1187 + }; 1188 + 1189 + static const char *const qup2_se2_groups[] = { 1190 + "gpio64", "gpio65", "gpio66", "gpio67", 1191 + }; 1192 + 1193 + static const char *const qup2_se3_groups[] = { 1194 + "gpio68", "gpio69", "gpio70", "gpio71", 1195 + }; 1196 + 1197 + static const char *const qup2_se4_groups[] = { 1198 + "gpio2", "gpio3", "gpio118", "gpio119", 1199 + }; 1200 + 1201 + static const char *const qup2_se5_groups[] = { 1202 + "gpio80", "gpio81", "gpio82", "gpio83", 1203 + }; 1204 + 1205 + static const char *const qup2_se6_groups[] = { 1206 + "gpio76", "gpio77", "gpio78", "gpio79", 1207 + }; 1208 + 1209 + static const char *const qup2_se7_groups[] = { 1210 + "gpio72", "gpio106", "gpio74", "gpio75", 1211 + }; 1212 + 1213 + static const char * const resout_n_groups[] = { 1214 + "gpio92", 1215 + }; 1216 + 1217 + static const char *const sd_write_protect_groups[] = { 1218 + "gpio93", 1219 + }; 1220 + 1221 + static const char *const sdc40_groups[] = { 1222 + "gpio89", 1223 + }; 1224 + 1225 + static const char *const sdc41_groups[] = { 1226 + "gpio90", 1227 + }; 1228 + 1229 + static const char *const sdc42_groups[] = { 1230 + "gpio48", 1231 + }; 1232 + 1233 + static const char *const sdc43_groups[] = { 1234 + "gpio49", 1235 + }; 1236 + 1237 + static const char *const sdc4_clk_groups[] = { 1238 + "gpio50", 1239 + }; 1240 + 1241 + static const char *const sdc4_cmd_groups[] = { 1242 + "gpio51", 1243 + }; 1244 + 1245 + static const char * const tb_trig_sdc2_groups[] = { 1246 + "gpio64", 1247 + }; 1248 + 1249 + static const char * const tb_trig_sdc4_groups[] = { 1250 + "gpio91", 1251 + }; 1252 + 1253 + static const char * const tgu_ch0_trigout_groups[] = { 1254 + "gpio64", 1255 + }; 1256 + 1257 + static const char * const tgu_ch1_trigout_groups[] = { 1258 + "gpio65", 1259 + }; 1260 + 1261 + static const char * const tgu_ch2_trigout_groups[] = { 1262 + "gpio66", 1263 + }; 1264 + 1265 + static const char * const tgu_ch3_trigout_groups[] = { 1266 + "gpio67", 1267 + }; 1268 + 1269 + static const char *const tmess_prng0_groups[] = { 1270 + "gpio92", 1271 + }; 1272 + 1273 + static const char *const tmess_prng1_groups[] = { 1274 + "gpio94", 1275 + }; 1276 + 1277 + static const char *const tmess_prng2_groups[] = { 1278 + "gpio95", 1279 + }; 1280 + 1281 + static const char *const tmess_prng3_groups[] = { 1282 + "gpio96", 1283 + }; 1284 + 1285 + static const char *const tsense_pwm1_groups[] = { 1286 + "gpio50", 1287 + }; 1288 + 1289 + static const char *const tsense_pwm2_groups[] = { 1290 + "gpio50", 1291 + }; 1292 + 1293 + static const char *const tsense_pwm3_groups[] = { 1294 + "gpio50", 1295 + }; 1296 + 1297 + static const char *const uim0_clk_groups[] = { 1298 + "gpio131", 1299 + }; 1300 + 1301 + static const char *const uim0_data_groups[] = { 1302 + "gpio130", 1303 + }; 1304 + 1305 + static const char *const uim0_present_groups[] = { 1306 + "gpio27", 1307 + }; 1308 + 1309 + static const char *const uim0_reset_groups[] = { 1310 + "gpio132", 1311 + }; 1312 + 1313 + static const char *const uim1_clk_groups[] = { 1314 + "gpio135", 1315 + }; 1316 + 1317 + static const char *const uim1_data_groups[] = { 1318 + "gpio134", 1319 + }; 1320 + 1321 + static const char *const uim1_present_groups[] = { 1322 + "gpio26", 1323 + }; 1324 + 1325 + static const char *const uim1_reset_groups[] = { 1326 + "gpio136", 1327 + }; 1328 + 1329 + static const char *const usb1_hs_groups[] = { 1330 + "gpio90", 1331 + }; 1332 + 1333 + static const char *const usb_phy_groups[] = { 1334 + "gpio11", 1335 + "gpio48", 1336 + }; 1337 + 1338 + static const char *const vfr_0_groups[] = { 1339 + "gpio150", 1340 + }; 1341 + 1342 + static const char *const vfr_1_groups[] = { 1343 + "gpio155", 1344 + }; 1345 + 1346 + static const char *const vsense_trigger_mirnat_groups[] = { 1347 + "gpio24", 1348 + }; 1349 + 1350 + static const struct msm_function sm8550_functions[] = { 1351 + FUNCTION(gpio), 1352 + FUNCTION(aon_cci), 1353 + FUNCTION(aoss_cti), 1354 + FUNCTION(atest_char), 1355 + FUNCTION(atest_usb), 1356 + FUNCTION(audio_ext_mclk0), 1357 + FUNCTION(audio_ext_mclk1), 1358 + FUNCTION(audio_ref_clk), 1359 + FUNCTION(cam_aon_mclk4), 1360 + FUNCTION(cam_mclk), 1361 + FUNCTION(cci_async_in), 1362 + FUNCTION(cci_i2c_scl), 1363 + FUNCTION(cci_i2c_sda), 1364 + FUNCTION(cci_timer), 1365 + FUNCTION(cmu_rng), 1366 + FUNCTION(coex_uart1_rx), 1367 + FUNCTION(coex_uart1_tx), 1368 + FUNCTION(coex_uart2_rx), 1369 + FUNCTION(coex_uart2_tx), 1370 + FUNCTION(cri_trng), 1371 + FUNCTION(dbg_out_clk), 1372 + FUNCTION(ddr_bist_complete), 1373 + FUNCTION(ddr_bist_fail), 1374 + FUNCTION(ddr_bist_start), 1375 + FUNCTION(ddr_bist_stop), 1376 + FUNCTION(ddr_pxi0), 1377 + FUNCTION(ddr_pxi1), 1378 + FUNCTION(ddr_pxi2), 1379 + FUNCTION(ddr_pxi3), 1380 + FUNCTION(dp_hot), 1381 + FUNCTION(gcc_gp1), 1382 + FUNCTION(gcc_gp2), 1383 + FUNCTION(gcc_gp3), 1384 + FUNCTION(i2chub0_se0), 1385 + FUNCTION(i2chub0_se1), 1386 + FUNCTION(i2chub0_se2), 1387 + FUNCTION(i2chub0_se3), 1388 + FUNCTION(i2chub0_se4), 1389 + FUNCTION(i2chub0_se5), 1390 + FUNCTION(i2chub0_se6), 1391 + FUNCTION(i2chub0_se7), 1392 + FUNCTION(i2chub0_se8), 1393 + FUNCTION(i2chub0_se9), 1394 + FUNCTION(i2s0_data0), 1395 + FUNCTION(i2s0_data1), 1396 + FUNCTION(i2s0_sck), 1397 + FUNCTION(i2s0_ws), 1398 + FUNCTION(i2s1_data0), 1399 + FUNCTION(i2s1_data1), 1400 + FUNCTION(i2s1_sck), 1401 + FUNCTION(i2s1_ws), 1402 + FUNCTION(ibi_i3c), 1403 + FUNCTION(jitter_bist), 1404 + FUNCTION(mdp_vsync), 1405 + FUNCTION(mdp_vsync0_out), 1406 + FUNCTION(mdp_vsync1_out), 1407 + FUNCTION(mdp_vsync2_out), 1408 + FUNCTION(mdp_vsync3_out), 1409 + FUNCTION(mdp_vsync_e), 1410 + FUNCTION(nav_gpio0), 1411 + FUNCTION(nav_gpio1), 1412 + FUNCTION(nav_gpio2), 1413 + FUNCTION(pcie0_clk_req_n), 1414 + FUNCTION(pcie1_clk_req_n), 1415 + FUNCTION(phase_flag), 1416 + FUNCTION(pll_bist_sync), 1417 + FUNCTION(pll_clk_aux), 1418 + FUNCTION(prng_rosc0), 1419 + FUNCTION(prng_rosc1), 1420 + FUNCTION(prng_rosc2), 1421 + FUNCTION(prng_rosc3), 1422 + FUNCTION(qdss_cti), 1423 + FUNCTION(qdss_gpio), 1424 + FUNCTION(qlink0_enable), 1425 + FUNCTION(qlink0_request), 1426 + FUNCTION(qlink0_wmss), 1427 + FUNCTION(qlink1_enable), 1428 + FUNCTION(qlink1_request), 1429 + FUNCTION(qlink1_wmss), 1430 + FUNCTION(qlink2_enable), 1431 + FUNCTION(qlink2_request), 1432 + FUNCTION(qlink2_wmss), 1433 + FUNCTION(qspi0), 1434 + FUNCTION(qspi1), 1435 + FUNCTION(qspi2), 1436 + FUNCTION(qspi3), 1437 + FUNCTION(qspi_clk), 1438 + FUNCTION(qspi_cs), 1439 + FUNCTION(qup1_se0), 1440 + FUNCTION(qup1_se1), 1441 + FUNCTION(qup1_se2), 1442 + FUNCTION(qup1_se3), 1443 + FUNCTION(qup1_se4), 1444 + FUNCTION(qup1_se5), 1445 + FUNCTION(qup1_se6), 1446 + FUNCTION(qup1_se7), 1447 + FUNCTION(qup2_se0), 1448 + FUNCTION(qup2_se0_l0_mira), 1449 + FUNCTION(qup2_se0_l0_mirb), 1450 + FUNCTION(qup2_se0_l1_mira), 1451 + FUNCTION(qup2_se0_l1_mirb), 1452 + FUNCTION(qup2_se0_l2_mira), 1453 + FUNCTION(qup2_se0_l2_mirb), 1454 + FUNCTION(qup2_se0_l3_mira), 1455 + FUNCTION(qup2_se0_l3_mirb), 1456 + FUNCTION(qup2_se1), 1457 + FUNCTION(qup2_se2), 1458 + FUNCTION(qup2_se3), 1459 + FUNCTION(qup2_se4), 1460 + FUNCTION(qup2_se5), 1461 + FUNCTION(qup2_se6), 1462 + FUNCTION(qup2_se7), 1463 + FUNCTION(resout_n), 1464 + FUNCTION(sd_write_protect), 1465 + FUNCTION(sdc40), 1466 + FUNCTION(sdc41), 1467 + FUNCTION(sdc42), 1468 + FUNCTION(sdc43), 1469 + FUNCTION(sdc4_clk), 1470 + FUNCTION(sdc4_cmd), 1471 + FUNCTION(tb_trig_sdc2), 1472 + FUNCTION(tb_trig_sdc4), 1473 + FUNCTION(tgu_ch0_trigout), 1474 + FUNCTION(tgu_ch1_trigout), 1475 + FUNCTION(tgu_ch2_trigout), 1476 + FUNCTION(tgu_ch3_trigout), 1477 + FUNCTION(tmess_prng0), 1478 + FUNCTION(tmess_prng1), 1479 + FUNCTION(tmess_prng2), 1480 + FUNCTION(tmess_prng3), 1481 + FUNCTION(tsense_pwm1), 1482 + FUNCTION(tsense_pwm2), 1483 + FUNCTION(tsense_pwm3), 1484 + FUNCTION(uim0_clk), 1485 + FUNCTION(uim0_data), 1486 + FUNCTION(uim0_present), 1487 + FUNCTION(uim0_reset), 1488 + FUNCTION(uim1_clk), 1489 + FUNCTION(uim1_data), 1490 + FUNCTION(uim1_present), 1491 + FUNCTION(uim1_reset), 1492 + FUNCTION(usb1_hs), 1493 + FUNCTION(usb_phy), 1494 + FUNCTION(vfr_0), 1495 + FUNCTION(vfr_1), 1496 + FUNCTION(vsense_trigger_mirnat), 1497 + }; 1498 + 1499 + /* 1500 + * Every pin is maintained as a single group, and missing or non-existing pin 1501 + * would be maintained as dummy group to synchronize pin group index with 1502 + * pin descriptor registered with pinctrl core. 1503 + * Clients would not be able to request these dummy pin groups. 1504 + */ 1505 + static const struct msm_pingroup sm8550_groups[] = { 1506 + [0] = PINGROUP(0, cci_i2c_sda, qup2_se0_l0_mirb, ibi_i3c, phase_flag, _, _, _, _, _), 1507 + [1] = PINGROUP(1, cci_i2c_scl, qup2_se0_l1_mirb, ibi_i3c, _, _, _, _, _, _), 1508 + [2] = PINGROUP(2, qup2_se4, phase_flag, _, _, _, _, _, _, _), 1509 + [3] = PINGROUP(3, qup2_se4, phase_flag, _, _, _, _, _, _, _), 1510 + [4] = PINGROUP(4, i2chub0_se4, _, _, _, _, _, _, _, _), 1511 + [5] = PINGROUP(5, i2chub0_se4, _, _, _, _, _, _, _, _), 1512 + [6] = PINGROUP(6, i2chub0_se5, _, _, _, _, _, _, _, _), 1513 + [7] = PINGROUP(7, i2chub0_se5, _, _, _, _, _, _, _, _), 1514 + [8] = PINGROUP(8, i2chub0_se6, _, _, _, _, _, _, _, _), 1515 + [9] = PINGROUP(9, i2chub0_se6, _, _, _, _, _, _, _, _), 1516 + [10] = PINGROUP(10, i2chub0_se7, qdss_cti, phase_flag, _, _, _, _, _, _), 1517 + [11] = PINGROUP(11, i2chub0_se7, usb_phy, qdss_cti, phase_flag, _, _, _, _, _), 1518 + [12] = PINGROUP(12, phase_flag, _, _, _, _, _, _, _, _), 1519 + [13] = PINGROUP(13, phase_flag, _, _, _, _, _, _, _, _), 1520 + [14] = PINGROUP(14, _, _, _, _, _, _, _, _, _), 1521 + [15] = PINGROUP(15, _, _, _, _, _, _, _, _, _), 1522 + [16] = PINGROUP(16, i2chub0_se0, _, _, _, _, _, _, _, _), 1523 + [17] = PINGROUP(17, i2chub0_se0, _, _, _, _, _, _, _, _), 1524 + [18] = PINGROUP(18, i2chub0_se1, _, _, _, _, _, _, _, _), 1525 + [19] = PINGROUP(19, i2chub0_se1, _, _, _, _, _, _, _, _), 1526 + [20] = PINGROUP(20, i2chub0_se2, pll_bist_sync, _, _, _, _, _, _, _), 1527 + [21] = PINGROUP(21, i2chub0_se2, _, _, _, _, _, _, _, _), 1528 + [22] = PINGROUP(22, i2chub0_se3, _, _, _, _, _, _, _, _), 1529 + [23] = PINGROUP(23, i2chub0_se3, _, _, _, _, _, _, _, _), 1530 + [24] = PINGROUP(24, qup1_se7, vsense_trigger_mirnat, _, _, _, _, _, _, _), 1531 + [25] = PINGROUP(25, qup1_se7, _, _, _, _, _, _, _, _), 1532 + [26] = PINGROUP(26, qup1_se7, uim1_present, _, _, _, _, _, _, _), 1533 + [27] = PINGROUP(27, qup1_se7, uim0_present, _, _, _, _, _, _, _), 1534 + [28] = PINGROUP(28, qup1_se0, ibi_i3c, _, _, _, _, _, _, _), 1535 + [29] = PINGROUP(29, qup1_se0, ibi_i3c, _, _, _, _, _, _, _), 1536 + [30] = PINGROUP(30, qup1_se0, _, _, _, _, _, _, _, _), 1537 + [31] = PINGROUP(31, qup1_se0, _, _, _, _, _, _, _, _), 1538 + [32] = PINGROUP(32, qup1_se1, ibi_i3c, _, _, _, _, _, _, _), 1539 + [33] = PINGROUP(33, qup1_se1, ibi_i3c, _, _, _, _, _, _, _), 1540 + [34] = PINGROUP(34, qup1_se1, _, _, _, _, _, _, _, _), 1541 + [35] = PINGROUP(35, qup1_se1, _, _, _, _, _, _, _, _), 1542 + [36] = PINGROUP(36, qup1_se2, ddr_bist_fail, _, _, _, _, _, _, _), 1543 + [37] = PINGROUP(37, qup1_se2, ddr_bist_start, _, atest_usb, _, _, _, _, _), 1544 + [38] = PINGROUP(38, qup1_se2, _, _, _, _, _, _, _, _), 1545 + [39] = PINGROUP(39, qup1_se2, _, atest_usb, _, _, _, _, _, _), 1546 + [40] = PINGROUP(40, qup1_se3, qup1_se2, ddr_bist_complete, _, ddr_pxi1, _, _, _, _), 1547 + [41] = PINGROUP(41, qup1_se3, qup1_se2, ddr_bist_stop, _, ddr_pxi1, _, _, _, _), 1548 + [42] = PINGROUP(42, qup1_se3, qup1_se2, _, _, _, _, _, _, _), 1549 + [43] = PINGROUP(43, qup1_se3, jitter_bist, ddr_pxi3, _, _, _, _, _, _), 1550 + [44] = PINGROUP(44, qup1_se4, aoss_cti, ddr_pxi3, _, _, _, _, _, _), 1551 + [45] = PINGROUP(45, qup1_se4, aoss_cti, ddr_pxi2, _, _, _, _, _, _), 1552 + [46] = PINGROUP(46, qup1_se4, aoss_cti, _, _, _, _, _, _, _), 1553 + [47] = PINGROUP(47, qup1_se4, aoss_cti, dp_hot, ddr_pxi2, _, _, _, _, _), 1554 + [48] = PINGROUP(48, usb_phy, qup1_se6, qspi2, sdc42, _, _, _, _, _), 1555 + [49] = PINGROUP(49, qup1_se6, qspi3, sdc43, _, _, _, _, _, _), 1556 + [50] = PINGROUP(50, qup1_se6, qspi_clk, sdc4_clk, tsense_pwm1, tsense_pwm2, tsense_pwm3, _, _, _), 1557 + [51] = PINGROUP(51, qup1_se6, qspi_cs, sdc4_cmd, ddr_pxi0, _, _, _, _, _), 1558 + [52] = PINGROUP(52, _, qup1_se5, ddr_pxi0, _, _, _, _, _, _), 1559 + [53] = PINGROUP(53, _, qup1_se5, _, _, _, _, _, _, _), 1560 + [54] = PINGROUP(54, _, qup1_se5, _, _, _, _, _, _, _), 1561 + [55] = PINGROUP(55, qup1_se5, atest_usb, _, _, _, _, _, _, _), 1562 + [56] = PINGROUP(56, qup2_se0_l0_mira, ibi_i3c, _, _, _, _, _, _, _), 1563 + [57] = PINGROUP(57, qup2_se0_l1_mira, ibi_i3c, _, _, _, _, _, _, _), 1564 + [58] = PINGROUP(58, qup2_se0_l2_mira, _, _, _, _, _, _, _, _), 1565 + [59] = PINGROUP(59, qup2_se0_l3_mira, phase_flag, _, qdss_gpio, _, _, _, _, _), 1566 + [60] = PINGROUP(60, qup2_se1, ibi_i3c, _, _, _, _, _, _, _), 1567 + [61] = PINGROUP(61, qup2_se1, ibi_i3c, _, _, _, _, _, _, _), 1568 + [62] = PINGROUP(62, qup2_se1, _, _, _, _, _, _, _, _), 1569 + [63] = PINGROUP(63, qup2_se1, qup2_se0, phase_flag, _, _, _, _, _, _), 1570 + [64] = PINGROUP(64, qup2_se2, tb_trig_sdc2, phase_flag, tgu_ch0_trigout, _, qdss_gpio, _, _, _), 1571 + [65] = PINGROUP(65, qup2_se2, phase_flag, tgu_ch1_trigout, _, _, _, _, _, _), 1572 + [66] = PINGROUP(66, qup2_se2, qup2_se0, tgu_ch2_trigout, _, _, _, _, _, _), 1573 + [67] = PINGROUP(67, qup2_se2, qup2_se0, phase_flag, tgu_ch3_trigout, _, _, _, _, _), 1574 + [68] = PINGROUP(68, qup2_se3, phase_flag, _, _, _, _, _, _, _), 1575 + [69] = PINGROUP(69, qup2_se3, phase_flag, _, _, _, _, _, _, _), 1576 + [70] = PINGROUP(70, qup2_se3, _, _, _, _, _, _, _, _), 1577 + [71] = PINGROUP(71, cci_async_in, qup2_se3, _, _, _, _, _, _, _), 1578 + [72] = PINGROUP(72, cci_async_in, qup2_se7, _, _, _, _, _, _, _), 1579 + [73] = PINGROUP(73, qdss_gpio, _, _, _, _, _, _, _, _), 1580 + [74] = PINGROUP(74, cci_i2c_sda, qup2_se7, _, _, _, _, _, _, _), 1581 + [75] = PINGROUP(75, cci_i2c_scl, qup2_se7, qdss_cti, phase_flag, _, _, _, _, _), 1582 + [76] = PINGROUP(76, qup2_se6, phase_flag, _, _, _, _, _, _, _), 1583 + [77] = PINGROUP(77, qup2_se6, phase_flag, _, _, _, _, _, _, _), 1584 + [78] = PINGROUP(78, qup2_se6, _, _, _, _, _, _, _, _), 1585 + [79] = PINGROUP(79, qup2_se6, qdss_cti, phase_flag, _, _, _, _, _, _), 1586 + [80] = PINGROUP(80, qup2_se5, phase_flag, _, _, _, _, _, _, _), 1587 + [81] = PINGROUP(81, qup2_se5, phase_flag, _, _, _, _, _, _, _), 1588 + [82] = PINGROUP(82, qup2_se5, _, _, _, _, _, _, _, _), 1589 + [83] = PINGROUP(83, qup2_se5, phase_flag, _, _, _, _, _, _, _), 1590 + [84] = PINGROUP(84, i2chub0_se9, _, _, _, _, _, _, _, _), 1591 + [85] = PINGROUP(85, i2chub0_se9, _, _, _, _, _, _, _, _), 1592 + [86] = PINGROUP(86, mdp_vsync, mdp_vsync0_out, mdp_vsync1_out, gcc_gp1, _, _, _, _, _), 1593 + [87] = PINGROUP(87, mdp_vsync, mdp_vsync2_out, mdp_vsync3_out, gcc_gp2, _, _, _, _, _), 1594 + [88] = PINGROUP(88, mdp_vsync_e, gcc_gp3, _, _, _, _, _, _, _), 1595 + [89] = PINGROUP(89, qspi0, sdc40, dbg_out_clk, _, _, _, _, _, _), 1596 + [90] = PINGROUP(90, usb1_hs, qspi1, sdc41, _, _, _, _, _, _), 1597 + [91] = PINGROUP(91, qspi_cs, tb_trig_sdc4, _, _, _, _, _, _, _), 1598 + [92] = PINGROUP(92, resout_n, phase_flag, tmess_prng0, _, _, _, _, _, _), 1599 + [93] = PINGROUP(93, sd_write_protect, _, _, _, _, _, _, _, _), 1600 + [94] = PINGROUP(94, phase_flag, tmess_prng1, _, _, _, _, _, _, _), 1601 + [95] = PINGROUP(95, pcie0_clk_req_n, phase_flag, tmess_prng2, _, _, _, _, _, _), 1602 + [96] = PINGROUP(96, phase_flag, tmess_prng3, _, _, _, _, _, _, _), 1603 + [97] = PINGROUP(97, phase_flag, _, _, _, _, _, _, _, _), 1604 + [98] = PINGROUP(98, pcie1_clk_req_n, phase_flag, _, _, _, _, _, _, _), 1605 + [99] = PINGROUP(99, phase_flag, _, _, _, _, _, _, _, _), 1606 + [100] = PINGROUP(100, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1607 + [101] = PINGROUP(101, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1608 + [102] = PINGROUP(102, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1609 + [103] = PINGROUP(103, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1610 + [104] = PINGROUP(104, cam_aon_mclk4, qdss_gpio, _, _, _, _, _, _, _), 1611 + [105] = PINGROUP(105, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1612 + [106] = PINGROUP(106, cam_mclk, qup2_se7, _, _, _, _, _, _, _), 1613 + [107] = PINGROUP(107, cam_mclk, qup2_se0_l3_mirb, pll_clk_aux, _, _, _, _, _, _), 1614 + [108] = PINGROUP(108, _, _, _, _, _, _, _, _, _), 1615 + [109] = PINGROUP(109, cci_async_in, qup2_se0_l2_mirb, _, _, _, _, _, _, _), 1616 + [110] = PINGROUP(110, cci_i2c_sda, qdss_gpio, _, _, _, _, _, _, _), 1617 + [111] = PINGROUP(111, cci_i2c_scl, qdss_gpio, _, _, _, _, _, _, _), 1618 + [112] = PINGROUP(112, cci_i2c_sda, qdss_gpio, _, _, _, _, _, _, _), 1619 + [113] = PINGROUP(113, cci_i2c_scl, qdss_gpio, _, _, _, _, _, _, _), 1620 + [114] = PINGROUP(114, cci_i2c_sda, qdss_gpio, _, _, _, _, _, _, _), 1621 + [115] = PINGROUP(115, cci_i2c_scl, qdss_gpio, _, _, _, _, _, _, _), 1622 + [116] = PINGROUP(116, cci_timer, phase_flag, _, qdss_gpio, _, _, _, _, _), 1623 + [117] = PINGROUP(117, cci_timer, phase_flag, _, qdss_gpio, _, _, _, _, _), 1624 + [118] = PINGROUP(118, qup2_se4, cci_timer, _, _, _, _, _, _, _), 1625 + [119] = PINGROUP(119, qup2_se4, cci_timer, phase_flag, _, _, _, _, _, _), 1626 + [120] = PINGROUP(120, cci_timer, phase_flag, _, qdss_gpio, _, _, _, _, _), 1627 + [121] = PINGROUP(121, i2s1_sck, _, _, _, _, _, _, _, _), 1628 + [122] = PINGROUP(122, i2s1_data0, cmu_rng, _, _, _, _, _, _, _), 1629 + [123] = PINGROUP(123, i2s1_ws, _, _, _, _, _, _, _, _), 1630 + [124] = PINGROUP(124, i2s1_data1, audio_ext_mclk1, audio_ref_clk, _, _, _, _, _, _), 1631 + [125] = PINGROUP(125, audio_ext_mclk0, _, _, _, _, _, _, _, _), 1632 + [126] = PINGROUP(126, i2s0_sck, _, _, _, _, _, _, _, _), 1633 + [127] = PINGROUP(127, i2s0_data0, cmu_rng, _, _, _, _, _, _, _), 1634 + [128] = PINGROUP(128, i2s0_data1, cmu_rng, _, _, _, _, _, _, _), 1635 + [129] = PINGROUP(129, i2s0_ws, cmu_rng, _, _, _, _, _, _, _), 1636 + [130] = PINGROUP(130, uim0_data, atest_char, _, _, _, _, _, _, _), 1637 + [131] = PINGROUP(131, uim0_clk, _, _, _, _, _, _, _, _), 1638 + [132] = PINGROUP(132, uim0_reset, atest_char, _, _, _, _, _, _, _), 1639 + [133] = PINGROUP(133, mdp_vsync, atest_char, _, _, _, _, _, _, _), 1640 + [134] = PINGROUP(134, uim1_data, gcc_gp1, atest_char, _, _, _, _, _, _), 1641 + [135] = PINGROUP(135, uim1_clk, gcc_gp2, atest_char, _, _, _, _, _, _), 1642 + [136] = PINGROUP(136, uim1_reset, gcc_gp3, _, _, _, _, _, _, _), 1643 + [137] = PINGROUP(137, mdp_vsync, _, _, _, _, _, _, _, _), 1644 + [138] = PINGROUP(138, _, _, qdss_gpio, _, _, _, _, _, _), 1645 + [139] = PINGROUP(139, _, _, qdss_gpio, _, _, _, _, _, _), 1646 + [140] = PINGROUP(140, _, _, qdss_gpio, _, _, _, _, _, _), 1647 + [141] = PINGROUP(141, _, _, qdss_gpio, _, _, _, _, _, _), 1648 + [142] = PINGROUP(142, _, _, qdss_gpio, _, _, _, _, _, _), 1649 + [143] = PINGROUP(143, _, _, qdss_gpio, _, _, _, _, _, _), 1650 + [144] = PINGROUP(144, _, _, qdss_gpio, _, _, _, _, _, _), 1651 + [145] = PINGROUP(145, _, _, qdss_gpio, _, _, _, _, _, _), 1652 + [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _), 1653 + [147] = PINGROUP(147, _, _, _, _, _, _, _, _, _), 1654 + [148] = PINGROUP(148, coex_uart1_rx, qdss_gpio, atest_usb, _, _, _, _, _, _), 1655 + [149] = PINGROUP(149, coex_uart1_tx, qdss_gpio, atest_usb, _, _, _, _, _, _), 1656 + [150] = PINGROUP(150, coex_uart2_rx, _, vfr_0, qdss_gpio, _, _, _, _, _), 1657 + [151] = PINGROUP(151, coex_uart2_tx, _, qdss_gpio, _, _, _, _, _, _), 1658 + [152] = PINGROUP(152, _, qdss_gpio, _, _, _, _, _, _, _), 1659 + [153] = PINGROUP(153, _, nav_gpio2, qdss_gpio, _, _, _, _, _, _), 1660 + [154] = PINGROUP(154, nav_gpio0, qdss_gpio, _, _, _, _, _, _, _), 1661 + [155] = PINGROUP(155, nav_gpio1, vfr_1, qdss_gpio, _, _, _, _, _, _), 1662 + [156] = PINGROUP(156, qlink0_request, qdss_gpio, _, _, _, _, _, _, _), 1663 + [157] = PINGROUP(157, qlink0_enable, qdss_gpio, _, _, _, _, _, _, _), 1664 + [158] = PINGROUP(158, qlink0_wmss, _, _, _, _, _, _, _, _), 1665 + [159] = PINGROUP(159, qlink1_request, qdss_cti, _, _, _, _, _, _, _), 1666 + [160] = PINGROUP(160, qlink1_enable, qdss_cti, _, _, _, _, _, _, _), 1667 + [161] = PINGROUP(161, qlink1_wmss, qdss_cti, _, _, _, _, _, _, _), 1668 + [162] = PINGROUP(162, qlink2_request, qdss_cti, _, _, _, _, _, _, _), 1669 + [163] = PINGROUP(163, qlink2_enable, _, _, _, _, _, _, _, _), 1670 + [164] = PINGROUP(164, qlink2_wmss, _, _, _, _, _, _, _, _), 1671 + [165] = PINGROUP(165, _, _, _, _, _, _, _, _, _), 1672 + [166] = PINGROUP(166, _, _, _, _, _, _, _, _, _), 1673 + [167] = PINGROUP(167, _, _, _, _, _, _, _, _, _), 1674 + [168] = PINGROUP(168, _, _, _, _, _, _, _, _, _), 1675 + [169] = PINGROUP(169, _, _, _, _, _, _, _, _, _), 1676 + [170] = PINGROUP(170, _, _, _, _, _, _, _, _, _), 1677 + [171] = PINGROUP(171, _, _, _, _, _, _, _, _, _), 1678 + [172] = PINGROUP(172, _, _, _, _, _, _, _, _, _), 1679 + [173] = PINGROUP(173, _, _, _, _, _, _, _, _, _), 1680 + [174] = PINGROUP(174, _, _, _, _, _, _, _, _, _), 1681 + [175] = PINGROUP(175, _, _, _, _, _, _, _, _, _), 1682 + [176] = PINGROUP(176, _, _, _, _, _, _, _, _, _), 1683 + [177] = PINGROUP(177, _, _, _, _, _, _, _, _, _), 1684 + [178] = PINGROUP(178, _, _, _, _, _, _, _, _, _), 1685 + [179] = PINGROUP(179, _, _, _, _, _, _, _, _, _), 1686 + [180] = PINGROUP(180, _, _, _, _, _, _, _, _, _), 1687 + [181] = PINGROUP(181, prng_rosc3, _, _, _, _, _, _, _, _), 1688 + [182] = PINGROUP(182, prng_rosc2, _, _, _, _, _, _, _, _), 1689 + [183] = PINGROUP(183, prng_rosc1, _, _, _, _, _, _, _, _), 1690 + [184] = PINGROUP(184, _, _, _, _, _, _, _, _, _), 1691 + [185] = PINGROUP(185, _, _, _, _, _, _, _, _, _), 1692 + [186] = PINGROUP(186, prng_rosc0, _, _, _, _, _, _, _, _), 1693 + [187] = PINGROUP(187, cri_trng, _, _, _, _, _, _, _, _), 1694 + [188] = PINGROUP(188, _, _, _, _, _, _, _, _, _), 1695 + [189] = PINGROUP(189, _, _, _, _, _, _, _, _, _), 1696 + [190] = PINGROUP(190, _, _, _, _, _, _, _, _, _), 1697 + [191] = PINGROUP(191, _, _, _, _, _, _, _, _, _), 1698 + [192] = PINGROUP(192, _, _, _, _, _, _, _, _, _), 1699 + [193] = PINGROUP(193, _, _, _, _, _, _, _, _, _), 1700 + [194] = PINGROUP(194, _, _, _, _, _, _, _, _, _), 1701 + [195] = PINGROUP(195, _, _, _, _, _, _, _, _, _), 1702 + [196] = PINGROUP(196, _, _, _, _, _, _, _, _, _), 1703 + [197] = PINGROUP(197, _, _, _, _, _, _, _, _, _), 1704 + [198] = PINGROUP(198, _, _, _, _, _, _, _, _, _), 1705 + [199] = PINGROUP(199, _, _, _, _, _, _, _, _, _), 1706 + [200] = PINGROUP(200, _, _, _, _, _, _, _, _, _), 1707 + [201] = PINGROUP(201, _, _, _, _, _, _, _, _, _), 1708 + [202] = PINGROUP(202, _, _, _, _, _, _, _, _, _), 1709 + [203] = PINGROUP(203, _, _, _, _, _, _, _, _, _), 1710 + [204] = PINGROUP(204, _, _, _, _, _, _, _, _, _), 1711 + [205] = PINGROUP(205, _, _, _, _, _, _, _, _, _), 1712 + [206] = PINGROUP(206, i2chub0_se8, _, _, _, _, _, _, _, _), 1713 + [207] = PINGROUP(207, i2chub0_se8, _, _, _, _, _, _, _, _), 1714 + [208] = PINGROUP(208, aon_cci, _, _, _, _, _, _, _, _), 1715 + [209] = PINGROUP(209, aon_cci, _, _, _, _, _, _, _, _), 1716 + [210] = UFS_RESET(ufs_reset, 0xde000), 1717 + [211] = SDC_QDSD_PINGROUP(sdc2_clk, 0xd6000, 14, 6), 1718 + [212] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xd6000, 11, 3), 1719 + [213] = SDC_QDSD_PINGROUP(sdc2_data, 0xd6000, 9, 0), 1720 + }; 1721 + 1722 + static const struct msm_gpio_wakeirq_map sm8550_pdc_map[] = { 1723 + { 0, 118 }, { 2, 90 }, { 3, 101 }, { 8, 60 }, { 9, 67 }, 1724 + { 11, 103 }, { 14, 136 }, { 15, 78 }, { 16, 138 }, { 17, 80 }, 1725 + { 18, 71 }, { 19, 59 }, { 25, 57 }, { 26, 74 }, { 27, 76 }, 1726 + { 28, 62 }, { 31, 88 }, { 32, 63 }, { 35, 124 }, { 39, 92 }, 1727 + { 40, 77 }, { 41, 83 }, { 43, 86 }, { 44, 75 }, { 45, 93 }, 1728 + { 46, 96 }, { 47, 64 }, { 48, 110 }, { 51, 89 }, { 55, 95 }, 1729 + { 56, 68 }, { 59, 87 }, { 60, 65 }, { 62, 100 }, { 63, 81 }, 1730 + { 67, 79 }, { 71, 102 }, { 73, 82 }, { 75, 72 }, { 79, 140 }, 1731 + { 82, 105 }, { 83, 104 }, { 84, 126 }, { 85, 142 }, { 86, 106 }, 1732 + { 87, 107 }, { 88, 61 }, { 89, 111 }, { 95, 108 }, { 96, 109 }, 1733 + { 98, 97 }, { 99, 58 }, { 107, 139 }, { 119, 94 }, { 120, 135 }, 1734 + { 133, 52 }, { 137, 84 }, { 148, 66 }, { 150, 73 }, { 153, 70 }, 1735 + { 154, 53 }, { 155, 69 }, { 156, 54 }, { 159, 55 }, { 162, 56 }, 1736 + { 166, 116 }, { 169, 119 }, { 171, 120 }, { 172, 85 }, { 174, 98 }, 1737 + { 176, 112 }, { 177, 51 }, { 181, 114 }, { 182, 115 }, { 185, 117 }, 1738 + { 187, 91 }, { 188, 123 }, { 190, 127 }, { 191, 113 }, { 192, 128 }, 1739 + { 193, 129 }, { 196, 133 }, { 197, 134 }, { 198, 50 }, { 199, 99 }, 1740 + { 200, 49 }, { 201, 48 }, { 203, 125 }, { 205, 141 }, { 206, 137 }, 1741 + { 207, 47 }, { 208, 121 }, { 209, 122 }, 1742 + }; 1743 + 1744 + static const struct msm_pinctrl_soc_data sm8550_tlmm = { 1745 + .pins = sm8550_pins, 1746 + .npins = ARRAY_SIZE(sm8550_pins), 1747 + .functions = sm8550_functions, 1748 + .nfunctions = ARRAY_SIZE(sm8550_functions), 1749 + .groups = sm8550_groups, 1750 + .ngroups = ARRAY_SIZE(sm8550_groups), 1751 + .ngpios = 211, 1752 + .wakeirq_map = sm8550_pdc_map, 1753 + .nwakeirq_map = ARRAY_SIZE(sm8550_pdc_map), 1754 + .egpio_func = 9, 1755 + }; 1756 + 1757 + static int sm8550_tlmm_probe(struct platform_device *pdev) 1758 + { 1759 + return msm_pinctrl_probe(pdev, &sm8550_tlmm); 1760 + } 1761 + 1762 + static const struct of_device_id sm8550_tlmm_of_match[] = { 1763 + { .compatible = "qcom,sm8550-tlmm", }, 1764 + {}, 1765 + }; 1766 + 1767 + static struct platform_driver sm8550_tlmm_driver = { 1768 + .driver = { 1769 + .name = "sm8550-tlmm", 1770 + .of_match_table = sm8550_tlmm_of_match, 1771 + }, 1772 + .probe = sm8550_tlmm_probe, 1773 + .remove = msm_pinctrl_remove, 1774 + }; 1775 + 1776 + static int __init sm8550_tlmm_init(void) 1777 + { 1778 + return platform_driver_register(&sm8550_tlmm_driver); 1779 + } 1780 + arch_initcall(sm8550_tlmm_init); 1781 + 1782 + static void __exit sm8550_tlmm_exit(void) 1783 + { 1784 + platform_driver_unregister(&sm8550_tlmm_driver); 1785 + } 1786 + module_exit(sm8550_tlmm_exit); 1787 + 1788 + MODULE_DESCRIPTION("QTI SM8550 TLMM driver"); 1789 + MODULE_LICENSE("GPL"); 1790 + MODULE_DEVICE_TABLE(of, sm8550_tlmm_of_match);
+7 -1
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 1146 1146 gpio_irq_chip_set_chip(girq, &spmi_gpio_irq_chip); 1147 1147 girq->default_type = IRQ_TYPE_NONE; 1148 1148 girq->handler = handle_level_irq; 1149 - girq->fwnode = of_node_to_fwnode(state->dev->of_node); 1149 + girq->fwnode = dev_fwnode(state->dev); 1150 1150 girq->parent_domain = parent_domain; 1151 1151 girq->child_to_parent_hwirq = pmic_gpio_child_to_parent_hwirq; 1152 1152 girq->populate_parent_alloc_arg = pmic_gpio_populate_parent_fwspec; ··· 1221 1221 { .compatible = "qcom,pm8350b-gpio", .data = (void *) 8 }, 1222 1222 { .compatible = "qcom,pm8350c-gpio", .data = (void *) 9 }, 1223 1223 { .compatible = "qcom,pm8450-gpio", .data = (void *) 4 }, 1224 + { .compatible = "qcom,pm8550-gpio", .data = (void *) 12 }, 1225 + { .compatible = "qcom,pm8550b-gpio", .data = (void *) 12 }, 1226 + { .compatible = "qcom,pm8550ve-gpio", .data = (void *) 8 }, 1227 + { .compatible = "qcom,pm8550vs-gpio", .data = (void *) 6 }, 1224 1228 { .compatible = "qcom,pm8916-gpio", .data = (void *) 4 }, 1225 1229 { .compatible = "qcom,pm8941-gpio", .data = (void *) 36 }, 1226 1230 /* pm8950 has 8 GPIOs with holes on 3 */ ··· 1236 1232 { .compatible = "qcom,pmi8994-gpio", .data = (void *) 10 }, 1237 1233 { .compatible = "qcom,pmi8998-gpio", .data = (void *) 14 }, 1238 1234 { .compatible = "qcom,pmk8350-gpio", .data = (void *) 4 }, 1235 + { .compatible = "qcom,pmk8550-gpio", .data = (void *) 6 }, 1239 1236 { .compatible = "qcom,pmm8155au-gpio", .data = (void *) 10 }, 1240 1237 /* pmp8074 has 12 GPIOs with holes on 1 and 12 */ 1241 1238 { .compatible = "qcom,pmp8074-gpio", .data = (void *) 12 }, 1242 1239 { .compatible = "qcom,pmr735a-gpio", .data = (void *) 4 }, 1243 1240 { .compatible = "qcom,pmr735b-gpio", .data = (void *) 4 }, 1241 + { .compatible = "qcom,pmr735d-gpio", .data = (void *) 2 }, 1244 1242 /* pms405 has 12 GPIOs with holes on 1, 9, and 10 */ 1245 1243 { .compatible = "qcom,pms405-gpio", .data = (void *) 12 }, 1246 1244 /* pmx55 has 11 GPIOs with holes on 3, 7, 10, 11 */
+1 -1
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
··· 927 927 girq->chip = &state->irq; 928 928 girq->default_type = IRQ_TYPE_NONE; 929 929 girq->handler = handle_level_irq; 930 - girq->fwnode = of_node_to_fwnode(state->dev->of_node); 930 + girq->fwnode = dev_fwnode(state->dev); 931 931 girq->parent_domain = parent_domain; 932 932 girq->child_to_parent_hwirq = pmic_mpp_child_to_parent_hwirq; 933 933 girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_fourcell;
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 791 791 girq->chip = &pm8xxx_irq_chip; 792 792 girq->default_type = IRQ_TYPE_NONE; 793 793 girq->handler = handle_level_irq; 794 - girq->fwnode = of_node_to_fwnode(pctrl->dev->of_node); 794 + girq->fwnode = dev_fwnode(pctrl->dev); 795 795 girq->parent_domain = parent_domain; 796 796 girq->child_to_parent_hwirq = pm8xxx_child_to_parent_hwirq; 797 797 girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_twocell;
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 881 881 girq->chip = &pctrl->irq; 882 882 girq->default_type = IRQ_TYPE_NONE; 883 883 girq->handler = handle_level_irq; 884 - girq->fwnode = of_node_to_fwnode(pctrl->dev->of_node); 884 + girq->fwnode = dev_fwnode(pctrl->dev); 885 885 girq->parent_domain = parent_domain; 886 886 if (of_device_is_compatible(pdev->dev.of_node, "qcom,pm8821-mpp")) 887 887 girq->child_to_parent_hwirq = pm8821_mpp_child_to_parent_hwirq;
+82 -82
drivers/pinctrl/ralink/pinctrl-mt7620.c
··· 54 54 #define MT7620_GPIO_MODE_EPHY 15 55 55 #define MT7620_GPIO_MODE_PA 20 56 56 57 - static struct ralink_pmx_func i2c_func[] = { FUNC("i2c", 0, 1, 2) }; 58 - static struct ralink_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) }; 59 - static struct ralink_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 15, 2) }; 60 - static struct ralink_pmx_func mdio_func[] = { 57 + static struct ralink_pmx_func i2c_grp[] = { FUNC("i2c", 0, 1, 2) }; 58 + static struct ralink_pmx_func spi_grp[] = { FUNC("spi", 0, 3, 4) }; 59 + static struct ralink_pmx_func uartlite_grp[] = { FUNC("uartlite", 0, 15, 2) }; 60 + static struct ralink_pmx_func mdio_grp[] = { 61 61 FUNC("mdio", MT7620_GPIO_MODE_MDIO, 22, 2), 62 62 FUNC("refclk", MT7620_GPIO_MODE_MDIO_REFCLK, 22, 2), 63 63 }; 64 - static struct ralink_pmx_func rgmii1_func[] = { FUNC("rgmii1", 0, 24, 12) }; 65 - static struct ralink_pmx_func refclk_func[] = { FUNC("spi refclk", 0, 37, 3) }; 66 - static struct ralink_pmx_func ephy_func[] = { FUNC("ephy", 0, 40, 5) }; 67 - static struct ralink_pmx_func rgmii2_func[] = { FUNC("rgmii2", 0, 60, 12) }; 68 - static struct ralink_pmx_func wled_func[] = { FUNC("wled", 0, 72, 1) }; 69 - static struct ralink_pmx_func pa_func[] = { FUNC("pa", 0, 18, 4) }; 70 - static struct ralink_pmx_func uartf_func[] = { 64 + static struct ralink_pmx_func rgmii1_grp[] = { FUNC("rgmii1", 0, 24, 12) }; 65 + static struct ralink_pmx_func refclk_grp[] = { FUNC("spi refclk", 0, 37, 3) }; 66 + static struct ralink_pmx_func ephy_grp[] = { FUNC("ephy", 0, 40, 5) }; 67 + static struct ralink_pmx_func rgmii2_grp[] = { FUNC("rgmii2", 0, 60, 12) }; 68 + static struct ralink_pmx_func wled_grp[] = { FUNC("wled", 0, 72, 1) }; 69 + static struct ralink_pmx_func pa_grp[] = { FUNC("pa", 0, 18, 4) }; 70 + static struct ralink_pmx_func uartf_grp[] = { 71 71 FUNC("uartf", MT7620_GPIO_MODE_UARTF, 7, 8), 72 72 FUNC("pcm uartf", MT7620_GPIO_MODE_PCM_UARTF, 7, 8), 73 73 FUNC("pcm i2s", MT7620_GPIO_MODE_PCM_I2S, 7, 8), ··· 76 76 FUNC("gpio uartf", MT7620_GPIO_MODE_GPIO_UARTF, 7, 4), 77 77 FUNC("gpio i2s", MT7620_GPIO_MODE_GPIO_I2S, 7, 4), 78 78 }; 79 - static struct ralink_pmx_func wdt_func[] = { 79 + static struct ralink_pmx_func wdt_grp[] = { 80 80 FUNC("wdt rst", 0, 17, 1), 81 81 FUNC("wdt refclk", 0, 17, 1), 82 82 }; 83 - static struct ralink_pmx_func pcie_rst_func[] = { 83 + static struct ralink_pmx_func pcie_rst_grp[] = { 84 84 FUNC("pcie rst", MT7620_GPIO_MODE_PCIE_RST, 36, 1), 85 85 FUNC("pcie refclk", MT7620_GPIO_MODE_PCIE_REF, 36, 1) 86 86 }; 87 - static struct ralink_pmx_func nd_sd_func[] = { 87 + static struct ralink_pmx_func nd_sd_grp[] = { 88 88 FUNC("nand", MT7620_GPIO_MODE_NAND, 45, 15), 89 89 FUNC("sd", MT7620_GPIO_MODE_SD, 47, 13) 90 90 }; 91 91 92 92 static struct ralink_pmx_group mt7620a_pinmux_data[] = { 93 - GRP("i2c", i2c_func, 1, MT7620_GPIO_MODE_I2C), 94 - GRP("uartf", uartf_func, MT7620_GPIO_MODE_UART0_MASK, 93 + GRP("i2c", i2c_grp, 1, MT7620_GPIO_MODE_I2C), 94 + GRP("uartf", uartf_grp, MT7620_GPIO_MODE_UART0_MASK, 95 95 MT7620_GPIO_MODE_UART0_SHIFT), 96 - GRP("spi", spi_func, 1, MT7620_GPIO_MODE_SPI), 97 - GRP("uartlite", uartlite_func, 1, MT7620_GPIO_MODE_UART1), 98 - GRP_G("wdt", wdt_func, MT7620_GPIO_MODE_WDT_MASK, 96 + GRP("spi", spi_grp, 1, MT7620_GPIO_MODE_SPI), 97 + GRP("uartlite", uartlite_grp, 1, MT7620_GPIO_MODE_UART1), 98 + GRP_G("wdt", wdt_grp, MT7620_GPIO_MODE_WDT_MASK, 99 99 MT7620_GPIO_MODE_WDT_GPIO, MT7620_GPIO_MODE_WDT_SHIFT), 100 - GRP_G("mdio", mdio_func, MT7620_GPIO_MODE_MDIO_MASK, 100 + GRP_G("mdio", mdio_grp, MT7620_GPIO_MODE_MDIO_MASK, 101 101 MT7620_GPIO_MODE_MDIO_GPIO, MT7620_GPIO_MODE_MDIO_SHIFT), 102 - GRP("rgmii1", rgmii1_func, 1, MT7620_GPIO_MODE_RGMII1), 103 - GRP("spi refclk", refclk_func, 1, MT7620_GPIO_MODE_SPI_REF_CLK), 104 - GRP_G("pcie", pcie_rst_func, MT7620_GPIO_MODE_PCIE_MASK, 102 + GRP("rgmii1", rgmii1_grp, 1, MT7620_GPIO_MODE_RGMII1), 103 + GRP("spi refclk", refclk_grp, 1, MT7620_GPIO_MODE_SPI_REF_CLK), 104 + GRP_G("pcie", pcie_rst_grp, MT7620_GPIO_MODE_PCIE_MASK, 105 105 MT7620_GPIO_MODE_PCIE_GPIO, MT7620_GPIO_MODE_PCIE_SHIFT), 106 - GRP_G("nd_sd", nd_sd_func, MT7620_GPIO_MODE_ND_SD_MASK, 106 + GRP_G("nd_sd", nd_sd_grp, MT7620_GPIO_MODE_ND_SD_MASK, 107 107 MT7620_GPIO_MODE_ND_SD_GPIO, MT7620_GPIO_MODE_ND_SD_SHIFT), 108 - GRP("rgmii2", rgmii2_func, 1, MT7620_GPIO_MODE_RGMII2), 109 - GRP("wled", wled_func, 1, MT7620_GPIO_MODE_WLED), 110 - GRP("ephy", ephy_func, 1, MT7620_GPIO_MODE_EPHY), 111 - GRP("pa", pa_func, 1, MT7620_GPIO_MODE_PA), 108 + GRP("rgmii2", rgmii2_grp, 1, MT7620_GPIO_MODE_RGMII2), 109 + GRP("wled", wled_grp, 1, MT7620_GPIO_MODE_WLED), 110 + GRP("ephy", ephy_grp, 1, MT7620_GPIO_MODE_EPHY), 111 + GRP("pa", pa_grp, 1, MT7620_GPIO_MODE_PA), 112 112 { 0 } 113 113 }; 114 114 115 - static struct ralink_pmx_func pwm1_func_mt76x8[] = { 115 + static struct ralink_pmx_func pwm1_grp_mt76x8[] = { 116 116 FUNC("sdxc d6", 3, 19, 1), 117 117 FUNC("utif", 2, 19, 1), 118 118 FUNC("gpio", 1, 19, 1), 119 119 FUNC("pwm1", 0, 19, 1), 120 120 }; 121 121 122 - static struct ralink_pmx_func pwm0_func_mt76x8[] = { 122 + static struct ralink_pmx_func pwm0_grp_mt76x8[] = { 123 123 FUNC("sdxc d7", 3, 18, 1), 124 124 FUNC("utif", 2, 18, 1), 125 125 FUNC("gpio", 1, 18, 1), 126 126 FUNC("pwm0", 0, 18, 1), 127 127 }; 128 128 129 - static struct ralink_pmx_func uart2_func_mt76x8[] = { 129 + static struct ralink_pmx_func uart2_grp_mt76x8[] = { 130 130 FUNC("sdxc d5 d4", 3, 20, 2), 131 131 FUNC("pwm", 2, 20, 2), 132 132 FUNC("gpio", 1, 20, 2), 133 133 FUNC("uart2", 0, 20, 2), 134 134 }; 135 135 136 - static struct ralink_pmx_func uart1_func_mt76x8[] = { 136 + static struct ralink_pmx_func uart1_grp_mt76x8[] = { 137 137 FUNC("sw_r", 3, 45, 2), 138 138 FUNC("pwm", 2, 45, 2), 139 139 FUNC("gpio", 1, 45, 2), 140 140 FUNC("uart1", 0, 45, 2), 141 141 }; 142 142 143 - static struct ralink_pmx_func i2c_func_mt76x8[] = { 143 + static struct ralink_pmx_func i2c_grp_mt76x8[] = { 144 144 FUNC("-", 3, 4, 2), 145 145 FUNC("debug", 2, 4, 2), 146 146 FUNC("gpio", 1, 4, 2), 147 147 FUNC("i2c", 0, 4, 2), 148 148 }; 149 149 150 - static struct ralink_pmx_func refclk_func_mt76x8[] = { FUNC("refclk", 0, 37, 1) }; 151 - static struct ralink_pmx_func perst_func_mt76x8[] = { FUNC("perst", 0, 36, 1) }; 152 - static struct ralink_pmx_func wdt_func_mt76x8[] = { FUNC("wdt", 0, 38, 1) }; 153 - static struct ralink_pmx_func spi_func_mt76x8[] = { FUNC("spi", 0, 7, 4) }; 150 + static struct ralink_pmx_func refclk_grp_mt76x8[] = { FUNC("refclk", 0, 37, 1) }; 151 + static struct ralink_pmx_func perst_grp_mt76x8[] = { FUNC("perst", 0, 36, 1) }; 152 + static struct ralink_pmx_func wdt_grp_mt76x8[] = { FUNC("wdt", 0, 38, 1) }; 153 + static struct ralink_pmx_func spi_grp_mt76x8[] = { FUNC("spi", 0, 7, 4) }; 154 154 155 - static struct ralink_pmx_func sd_mode_func_mt76x8[] = { 155 + static struct ralink_pmx_func sd_mode_grp_mt76x8[] = { 156 156 FUNC("jtag", 3, 22, 8), 157 157 FUNC("utif", 2, 22, 8), 158 158 FUNC("gpio", 1, 22, 8), 159 159 FUNC("sdxc", 0, 22, 8), 160 160 }; 161 161 162 - static struct ralink_pmx_func uart0_func_mt76x8[] = { 162 + static struct ralink_pmx_func uart0_grp_mt76x8[] = { 163 163 FUNC("-", 3, 12, 2), 164 164 FUNC("-", 2, 12, 2), 165 165 FUNC("gpio", 1, 12, 2), 166 166 FUNC("uart0", 0, 12, 2), 167 167 }; 168 168 169 - static struct ralink_pmx_func i2s_func_mt76x8[] = { 169 + static struct ralink_pmx_func i2s_grp_mt76x8[] = { 170 170 FUNC("antenna", 3, 0, 4), 171 171 FUNC("pcm", 2, 0, 4), 172 172 FUNC("gpio", 1, 0, 4), 173 173 FUNC("i2s", 0, 0, 4), 174 174 }; 175 175 176 - static struct ralink_pmx_func spi_cs1_func_mt76x8[] = { 176 + static struct ralink_pmx_func spi_cs1_grp_mt76x8[] = { 177 177 FUNC("-", 3, 6, 1), 178 178 FUNC("refclk", 2, 6, 1), 179 179 FUNC("gpio", 1, 6, 1), 180 180 FUNC("spi cs1", 0, 6, 1), 181 181 }; 182 182 183 - static struct ralink_pmx_func spis_func_mt76x8[] = { 183 + static struct ralink_pmx_func spis_grp_mt76x8[] = { 184 184 FUNC("pwm_uart2", 3, 14, 4), 185 185 FUNC("utif", 2, 14, 4), 186 186 FUNC("gpio", 1, 14, 4), 187 187 FUNC("spis", 0, 14, 4), 188 188 }; 189 189 190 - static struct ralink_pmx_func gpio_func_mt76x8[] = { 190 + static struct ralink_pmx_func gpio_grp_mt76x8[] = { 191 191 FUNC("pcie", 3, 11, 1), 192 192 FUNC("refclk", 2, 11, 1), 193 193 FUNC("gpio", 1, 11, 1), 194 194 FUNC("gpio", 0, 11, 1), 195 195 }; 196 196 197 - static struct ralink_pmx_func p4led_kn_func_mt76x8[] = { 197 + static struct ralink_pmx_func p4led_kn_grp_mt76x8[] = { 198 198 FUNC("jtag", 3, 30, 1), 199 199 FUNC("utif", 2, 30, 1), 200 200 FUNC("gpio", 1, 30, 1), 201 201 FUNC("p4led_kn", 0, 30, 1), 202 202 }; 203 203 204 - static struct ralink_pmx_func p3led_kn_func_mt76x8[] = { 204 + static struct ralink_pmx_func p3led_kn_grp_mt76x8[] = { 205 205 FUNC("jtag", 3, 31, 1), 206 206 FUNC("utif", 2, 31, 1), 207 207 FUNC("gpio", 1, 31, 1), 208 208 FUNC("p3led_kn", 0, 31, 1), 209 209 }; 210 210 211 - static struct ralink_pmx_func p2led_kn_func_mt76x8[] = { 211 + static struct ralink_pmx_func p2led_kn_grp_mt76x8[] = { 212 212 FUNC("jtag", 3, 32, 1), 213 213 FUNC("utif", 2, 32, 1), 214 214 FUNC("gpio", 1, 32, 1), 215 215 FUNC("p2led_kn", 0, 32, 1), 216 216 }; 217 217 218 - static struct ralink_pmx_func p1led_kn_func_mt76x8[] = { 218 + static struct ralink_pmx_func p1led_kn_grp_mt76x8[] = { 219 219 FUNC("jtag", 3, 33, 1), 220 220 FUNC("utif", 2, 33, 1), 221 221 FUNC("gpio", 1, 33, 1), 222 222 FUNC("p1led_kn", 0, 33, 1), 223 223 }; 224 224 225 - static struct ralink_pmx_func p0led_kn_func_mt76x8[] = { 225 + static struct ralink_pmx_func p0led_kn_grp_mt76x8[] = { 226 226 FUNC("jtag", 3, 34, 1), 227 227 FUNC("rsvd", 2, 34, 1), 228 228 FUNC("gpio", 1, 34, 1), 229 229 FUNC("p0led_kn", 0, 34, 1), 230 230 }; 231 231 232 - static struct ralink_pmx_func wled_kn_func_mt76x8[] = { 232 + static struct ralink_pmx_func wled_kn_grp_mt76x8[] = { 233 233 FUNC("rsvd", 3, 35, 1), 234 234 FUNC("rsvd", 2, 35, 1), 235 235 FUNC("gpio", 1, 35, 1), 236 236 FUNC("wled_kn", 0, 35, 1), 237 237 }; 238 238 239 - static struct ralink_pmx_func p4led_an_func_mt76x8[] = { 239 + static struct ralink_pmx_func p4led_an_grp_mt76x8[] = { 240 240 FUNC("jtag", 3, 39, 1), 241 241 FUNC("utif", 2, 39, 1), 242 242 FUNC("gpio", 1, 39, 1), 243 243 FUNC("p4led_an", 0, 39, 1), 244 244 }; 245 245 246 - static struct ralink_pmx_func p3led_an_func_mt76x8[] = { 246 + static struct ralink_pmx_func p3led_an_grp_mt76x8[] = { 247 247 FUNC("jtag", 3, 40, 1), 248 248 FUNC("utif", 2, 40, 1), 249 249 FUNC("gpio", 1, 40, 1), 250 250 FUNC("p3led_an", 0, 40, 1), 251 251 }; 252 252 253 - static struct ralink_pmx_func p2led_an_func_mt76x8[] = { 253 + static struct ralink_pmx_func p2led_an_grp_mt76x8[] = { 254 254 FUNC("jtag", 3, 41, 1), 255 255 FUNC("utif", 2, 41, 1), 256 256 FUNC("gpio", 1, 41, 1), 257 257 FUNC("p2led_an", 0, 41, 1), 258 258 }; 259 259 260 - static struct ralink_pmx_func p1led_an_func_mt76x8[] = { 260 + static struct ralink_pmx_func p1led_an_grp_mt76x8[] = { 261 261 FUNC("jtag", 3, 42, 1), 262 262 FUNC("utif", 2, 42, 1), 263 263 FUNC("gpio", 1, 42, 1), 264 264 FUNC("p1led_an", 0, 42, 1), 265 265 }; 266 266 267 - static struct ralink_pmx_func p0led_an_func_mt76x8[] = { 267 + static struct ralink_pmx_func p0led_an_grp_mt76x8[] = { 268 268 FUNC("jtag", 3, 43, 1), 269 269 FUNC("rsvd", 2, 43, 1), 270 270 FUNC("gpio", 1, 43, 1), 271 271 FUNC("p0led_an", 0, 43, 1), 272 272 }; 273 273 274 - static struct ralink_pmx_func wled_an_func_mt76x8[] = { 274 + static struct ralink_pmx_func wled_an_grp_mt76x8[] = { 275 275 FUNC("rsvd", 3, 44, 1), 276 276 FUNC("rsvd", 2, 44, 1), 277 277 FUNC("gpio", 1, 44, 1), ··· 309 309 #define MT76X8_GPIO_MODE_GPIO 0 310 310 311 311 static struct ralink_pmx_group mt76x8_pinmux_data[] = { 312 - GRP_G("pwm1", pwm1_func_mt76x8, MT76X8_GPIO_MODE_MASK, 312 + GRP_G("pwm1", pwm1_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 313 313 1, MT76X8_GPIO_MODE_PWM1), 314 - GRP_G("pwm0", pwm0_func_mt76x8, MT76X8_GPIO_MODE_MASK, 314 + GRP_G("pwm0", pwm0_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 315 315 1, MT76X8_GPIO_MODE_PWM0), 316 - GRP_G("uart2", uart2_func_mt76x8, MT76X8_GPIO_MODE_MASK, 316 + GRP_G("uart2", uart2_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 317 317 1, MT76X8_GPIO_MODE_UART2), 318 - GRP_G("uart1", uart1_func_mt76x8, MT76X8_GPIO_MODE_MASK, 318 + GRP_G("uart1", uart1_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 319 319 1, MT76X8_GPIO_MODE_UART1), 320 - GRP_G("i2c", i2c_func_mt76x8, MT76X8_GPIO_MODE_MASK, 320 + GRP_G("i2c", i2c_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 321 321 1, MT76X8_GPIO_MODE_I2C), 322 - GRP("refclk", refclk_func_mt76x8, 1, MT76X8_GPIO_MODE_REFCLK), 323 - GRP("perst", perst_func_mt76x8, 1, MT76X8_GPIO_MODE_PERST), 324 - GRP("wdt", wdt_func_mt76x8, 1, MT76X8_GPIO_MODE_WDT), 325 - GRP("spi", spi_func_mt76x8, 1, MT76X8_GPIO_MODE_SPI), 326 - GRP_G("sdmode", sd_mode_func_mt76x8, MT76X8_GPIO_MODE_MASK, 322 + GRP("refclk", refclk_grp_mt76x8, 1, MT76X8_GPIO_MODE_REFCLK), 323 + GRP("perst", perst_grp_mt76x8, 1, MT76X8_GPIO_MODE_PERST), 324 + GRP("wdt", wdt_grp_mt76x8, 1, MT76X8_GPIO_MODE_WDT), 325 + GRP("spi", spi_grp_mt76x8, 1, MT76X8_GPIO_MODE_SPI), 326 + GRP_G("sdmode", sd_mode_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 327 327 1, MT76X8_GPIO_MODE_SDMODE), 328 - GRP_G("uart0", uart0_func_mt76x8, MT76X8_GPIO_MODE_MASK, 328 + GRP_G("uart0", uart0_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 329 329 1, MT76X8_GPIO_MODE_UART0), 330 - GRP_G("i2s", i2s_func_mt76x8, MT76X8_GPIO_MODE_MASK, 330 + GRP_G("i2s", i2s_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 331 331 1, MT76X8_GPIO_MODE_I2S), 332 - GRP_G("spi cs1", spi_cs1_func_mt76x8, MT76X8_GPIO_MODE_MASK, 332 + GRP_G("spi cs1", spi_cs1_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 333 333 1, MT76X8_GPIO_MODE_CS1), 334 - GRP_G("spis", spis_func_mt76x8, MT76X8_GPIO_MODE_MASK, 334 + GRP_G("spis", spis_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 335 335 1, MT76X8_GPIO_MODE_SPIS), 336 - GRP_G("gpio", gpio_func_mt76x8, MT76X8_GPIO_MODE_MASK, 336 + GRP_G("gpio", gpio_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 337 337 1, MT76X8_GPIO_MODE_GPIO), 338 - GRP_G("wled_an", wled_an_func_mt76x8, MT76X8_GPIO_MODE_MASK, 338 + GRP_G("wled_an", wled_an_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 339 339 1, MT76X8_GPIO_MODE_WLED_AN), 340 - GRP_G("p0led_an", p0led_an_func_mt76x8, MT76X8_GPIO_MODE_MASK, 340 + GRP_G("p0led_an", p0led_an_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 341 341 1, MT76X8_GPIO_MODE_P0LED_AN), 342 - GRP_G("p1led_an", p1led_an_func_mt76x8, MT76X8_GPIO_MODE_MASK, 342 + GRP_G("p1led_an", p1led_an_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 343 343 1, MT76X8_GPIO_MODE_P1LED_AN), 344 - GRP_G("p2led_an", p2led_an_func_mt76x8, MT76X8_GPIO_MODE_MASK, 344 + GRP_G("p2led_an", p2led_an_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 345 345 1, MT76X8_GPIO_MODE_P2LED_AN), 346 - GRP_G("p3led_an", p3led_an_func_mt76x8, MT76X8_GPIO_MODE_MASK, 346 + GRP_G("p3led_an", p3led_an_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 347 347 1, MT76X8_GPIO_MODE_P3LED_AN), 348 - GRP_G("p4led_an", p4led_an_func_mt76x8, MT76X8_GPIO_MODE_MASK, 348 + GRP_G("p4led_an", p4led_an_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 349 349 1, MT76X8_GPIO_MODE_P4LED_AN), 350 - GRP_G("wled_kn", wled_kn_func_mt76x8, MT76X8_GPIO_MODE_MASK, 350 + GRP_G("wled_kn", wled_kn_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 351 351 1, MT76X8_GPIO_MODE_WLED_KN), 352 - GRP_G("p0led_kn", p0led_kn_func_mt76x8, MT76X8_GPIO_MODE_MASK, 352 + GRP_G("p0led_kn", p0led_kn_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 353 353 1, MT76X8_GPIO_MODE_P0LED_KN), 354 - GRP_G("p1led_kn", p1led_kn_func_mt76x8, MT76X8_GPIO_MODE_MASK, 354 + GRP_G("p1led_kn", p1led_kn_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 355 355 1, MT76X8_GPIO_MODE_P1LED_KN), 356 - GRP_G("p2led_kn", p2led_kn_func_mt76x8, MT76X8_GPIO_MODE_MASK, 356 + GRP_G("p2led_kn", p2led_kn_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 357 357 1, MT76X8_GPIO_MODE_P2LED_KN), 358 - GRP_G("p3led_kn", p3led_kn_func_mt76x8, MT76X8_GPIO_MODE_MASK, 358 + GRP_G("p3led_kn", p3led_kn_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 359 359 1, MT76X8_GPIO_MODE_P3LED_KN), 360 - GRP_G("p4led_kn", p4led_kn_func_mt76x8, MT76X8_GPIO_MODE_MASK, 360 + GRP_G("p4led_kn", p4led_kn_grp_mt76x8, MT76X8_GPIO_MODE_MASK, 361 361 1, MT76X8_GPIO_MODE_P4LED_KN), 362 362 { 0 } 363 363 };
+24 -24
drivers/pinctrl/ralink/pinctrl-mt7621.c
··· 34 34 #define MT7621_GPIO_MODE_SDHCI_SHIFT 18 35 35 #define MT7621_GPIO_MODE_SDHCI_GPIO 1 36 36 37 - static struct ralink_pmx_func uart1_func[] = { FUNC("uart1", 0, 1, 2) }; 38 - static struct ralink_pmx_func i2c_func[] = { FUNC("i2c", 0, 3, 2) }; 39 - static struct ralink_pmx_func uart3_func[] = { 37 + static struct ralink_pmx_func uart1_grp[] = { FUNC("uart1", 0, 1, 2) }; 38 + static struct ralink_pmx_func i2c_grp[] = { FUNC("i2c", 0, 3, 2) }; 39 + static struct ralink_pmx_func uart3_grp[] = { 40 40 FUNC("uart3", 0, 5, 4), 41 41 FUNC("i2s", 2, 5, 4), 42 42 FUNC("spdif3", 3, 5, 4), 43 43 }; 44 - static struct ralink_pmx_func uart2_func[] = { 44 + static struct ralink_pmx_func uart2_grp[] = { 45 45 FUNC("uart2", 0, 9, 4), 46 46 FUNC("pcm", 2, 9, 4), 47 47 FUNC("spdif2", 3, 9, 4), 48 48 }; 49 - static struct ralink_pmx_func jtag_func[] = { FUNC("jtag", 0, 13, 5) }; 50 - static struct ralink_pmx_func wdt_func[] = { 49 + static struct ralink_pmx_func jtag_grp[] = { FUNC("jtag", 0, 13, 5) }; 50 + static struct ralink_pmx_func wdt_grp[] = { 51 51 FUNC("wdt rst", 0, 18, 1), 52 52 FUNC("wdt refclk", 2, 18, 1), 53 53 }; 54 - static struct ralink_pmx_func pcie_rst_func[] = { 54 + static struct ralink_pmx_func pcie_rst_grp[] = { 55 55 FUNC("pcie rst", MT7621_GPIO_MODE_PCIE_RST, 19, 1), 56 56 FUNC("pcie refclk", MT7621_GPIO_MODE_PCIE_REF, 19, 1) 57 57 }; 58 - static struct ralink_pmx_func mdio_func[] = { FUNC("mdio", 0, 20, 2) }; 59 - static struct ralink_pmx_func rgmii2_func[] = { FUNC("rgmii2", 0, 22, 12) }; 60 - static struct ralink_pmx_func spi_func[] = { 58 + static struct ralink_pmx_func mdio_grp[] = { FUNC("mdio", 0, 20, 2) }; 59 + static struct ralink_pmx_func rgmii2_grp[] = { FUNC("rgmii2", 0, 22, 12) }; 60 + static struct ralink_pmx_func spi_grp[] = { 61 61 FUNC("spi", 0, 34, 7), 62 62 FUNC("nand1", 2, 34, 7), 63 63 }; 64 - static struct ralink_pmx_func sdhci_func[] = { 64 + static struct ralink_pmx_func sdhci_grp[] = { 65 65 FUNC("sdhci", 0, 41, 8), 66 66 FUNC("nand2", 2, 41, 8), 67 67 }; 68 - static struct ralink_pmx_func rgmii1_func[] = { FUNC("rgmii1", 0, 49, 12) }; 68 + static struct ralink_pmx_func rgmii1_grp[] = { FUNC("rgmii1", 0, 49, 12) }; 69 69 70 70 static struct ralink_pmx_group mt7621_pinmux_data[] = { 71 - GRP("uart1", uart1_func, 1, MT7621_GPIO_MODE_UART1), 72 - GRP("i2c", i2c_func, 1, MT7621_GPIO_MODE_I2C), 73 - GRP_G("uart3", uart3_func, MT7621_GPIO_MODE_UART3_MASK, 71 + GRP("uart1", uart1_grp, 1, MT7621_GPIO_MODE_UART1), 72 + GRP("i2c", i2c_grp, 1, MT7621_GPIO_MODE_I2C), 73 + GRP_G("uart3", uart3_grp, MT7621_GPIO_MODE_UART3_MASK, 74 74 MT7621_GPIO_MODE_UART3_GPIO, MT7621_GPIO_MODE_UART3_SHIFT), 75 - GRP_G("uart2", uart2_func, MT7621_GPIO_MODE_UART2_MASK, 75 + GRP_G("uart2", uart2_grp, MT7621_GPIO_MODE_UART2_MASK, 76 76 MT7621_GPIO_MODE_UART2_GPIO, MT7621_GPIO_MODE_UART2_SHIFT), 77 - GRP("jtag", jtag_func, 1, MT7621_GPIO_MODE_JTAG), 78 - GRP_G("wdt", wdt_func, MT7621_GPIO_MODE_WDT_MASK, 77 + GRP("jtag", jtag_grp, 1, MT7621_GPIO_MODE_JTAG), 78 + GRP_G("wdt", wdt_grp, MT7621_GPIO_MODE_WDT_MASK, 79 79 MT7621_GPIO_MODE_WDT_GPIO, MT7621_GPIO_MODE_WDT_SHIFT), 80 - GRP_G("pcie", pcie_rst_func, MT7621_GPIO_MODE_PCIE_MASK, 80 + GRP_G("pcie", pcie_rst_grp, MT7621_GPIO_MODE_PCIE_MASK, 81 81 MT7621_GPIO_MODE_PCIE_GPIO, MT7621_GPIO_MODE_PCIE_SHIFT), 82 - GRP_G("mdio", mdio_func, MT7621_GPIO_MODE_MDIO_MASK, 82 + GRP_G("mdio", mdio_grp, MT7621_GPIO_MODE_MDIO_MASK, 83 83 MT7621_GPIO_MODE_MDIO_GPIO, MT7621_GPIO_MODE_MDIO_SHIFT), 84 - GRP("rgmii2", rgmii2_func, 1, MT7621_GPIO_MODE_RGMII2), 85 - GRP_G("spi", spi_func, MT7621_GPIO_MODE_SPI_MASK, 84 + GRP("rgmii2", rgmii2_grp, 1, MT7621_GPIO_MODE_RGMII2), 85 + GRP_G("spi", spi_grp, MT7621_GPIO_MODE_SPI_MASK, 86 86 MT7621_GPIO_MODE_SPI_GPIO, MT7621_GPIO_MODE_SPI_SHIFT), 87 - GRP_G("sdhci", sdhci_func, MT7621_GPIO_MODE_SDHCI_MASK, 87 + GRP_G("sdhci", sdhci_grp, MT7621_GPIO_MODE_SDHCI_MASK, 88 88 MT7621_GPIO_MODE_SDHCI_GPIO, MT7621_GPIO_MODE_SDHCI_SHIFT), 89 - GRP("rgmii1", rgmii1_func, 1, MT7621_GPIO_MODE_RGMII1), 89 + GRP("rgmii1", rgmii1_grp, 1, MT7621_GPIO_MODE_RGMII1), 90 90 { 0 } 91 91 }; 92 92
+14 -14
drivers/pinctrl/ralink/pinctrl-rt2880.c
··· 15 15 #define RT2880_GPIO_MODE_SDRAM BIT(6) 16 16 #define RT2880_GPIO_MODE_PCI BIT(7) 17 17 18 - static struct ralink_pmx_func i2c_func[] = { FUNC("i2c", 0, 1, 2) }; 19 - static struct ralink_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) }; 20 - static struct ralink_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 7, 8) }; 21 - static struct ralink_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) }; 22 - static struct ralink_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) }; 23 - static struct ralink_pmx_func sdram_func[] = { FUNC("sdram", 0, 24, 16) }; 24 - static struct ralink_pmx_func pci_func[] = { FUNC("pci", 0, 40, 32) }; 18 + static struct ralink_pmx_func i2c_grp[] = { FUNC("i2c", 0, 1, 2) }; 19 + static struct ralink_pmx_func spi_grp[] = { FUNC("spi", 0, 3, 4) }; 20 + static struct ralink_pmx_func uartlite_grp[] = { FUNC("uartlite", 0, 7, 8) }; 21 + static struct ralink_pmx_func jtag_grp[] = { FUNC("jtag", 0, 17, 5) }; 22 + static struct ralink_pmx_func mdio_grp[] = { FUNC("mdio", 0, 22, 2) }; 23 + static struct ralink_pmx_func sdram_grp[] = { FUNC("sdram", 0, 24, 16) }; 24 + static struct ralink_pmx_func pci_grp[] = { FUNC("pci", 0, 40, 32) }; 25 25 26 26 static struct ralink_pmx_group rt2880_pinmux_data_act[] = { 27 - GRP("i2c", i2c_func, 1, RT2880_GPIO_MODE_I2C), 28 - GRP("spi", spi_func, 1, RT2880_GPIO_MODE_SPI), 29 - GRP("uartlite", uartlite_func, 1, RT2880_GPIO_MODE_UART0), 30 - GRP("jtag", jtag_func, 1, RT2880_GPIO_MODE_JTAG), 31 - GRP("mdio", mdio_func, 1, RT2880_GPIO_MODE_MDIO), 32 - GRP("sdram", sdram_func, 1, RT2880_GPIO_MODE_SDRAM), 33 - GRP("pci", pci_func, 1, RT2880_GPIO_MODE_PCI), 27 + GRP("i2c", i2c_grp, 1, RT2880_GPIO_MODE_I2C), 28 + GRP("spi", spi_grp, 1, RT2880_GPIO_MODE_SPI), 29 + GRP("uartlite", uartlite_grp, 1, RT2880_GPIO_MODE_UART0), 30 + GRP("jtag", jtag_grp, 1, RT2880_GPIO_MODE_JTAG), 31 + GRP("mdio", mdio_grp, 1, RT2880_GPIO_MODE_MDIO), 32 + GRP("sdram", sdram_grp, 1, RT2880_GPIO_MODE_SDRAM), 33 + GRP("pci", pci_grp, 1, RT2880_GPIO_MODE_PCI), 34 34 { 0 } 35 35 }; 36 36
+41 -41
drivers/pinctrl/ralink/pinctrl-rt305x.c
··· 31 31 #define RT3352_GPIO_MODE_LNA 18 32 32 #define RT3352_GPIO_MODE_PA 20 33 33 34 - static struct ralink_pmx_func i2c_func[] = { FUNC("i2c", 0, 1, 2) }; 35 - static struct ralink_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) }; 36 - static struct ralink_pmx_func uartf_func[] = { 34 + static struct ralink_pmx_func i2c_grp[] = { FUNC("i2c", 0, 1, 2) }; 35 + static struct ralink_pmx_func spi_grp[] = { FUNC("spi", 0, 3, 4) }; 36 + static struct ralink_pmx_func uartf_grp[] = { 37 37 FUNC("uartf", RT305X_GPIO_MODE_UARTF, 7, 8), 38 38 FUNC("pcm uartf", RT305X_GPIO_MODE_PCM_UARTF, 7, 8), 39 39 FUNC("pcm i2s", RT305X_GPIO_MODE_PCM_I2S, 7, 8), ··· 42 42 FUNC("gpio uartf", RT305X_GPIO_MODE_GPIO_UARTF, 7, 4), 43 43 FUNC("gpio i2s", RT305X_GPIO_MODE_GPIO_I2S, 7, 4), 44 44 }; 45 - static struct ralink_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 15, 2) }; 46 - static struct ralink_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) }; 47 - static struct ralink_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) }; 48 - static struct ralink_pmx_func rt5350_led_func[] = { FUNC("led", 0, 22, 5) }; 49 - static struct ralink_pmx_func rt5350_cs1_func[] = { 45 + static struct ralink_pmx_func uartlite_grp[] = { FUNC("uartlite", 0, 15, 2) }; 46 + static struct ralink_pmx_func jtag_grp[] = { FUNC("jtag", 0, 17, 5) }; 47 + static struct ralink_pmx_func mdio_grp[] = { FUNC("mdio", 0, 22, 2) }; 48 + static struct ralink_pmx_func rt5350_led_grp[] = { FUNC("led", 0, 22, 5) }; 49 + static struct ralink_pmx_func rt5350_cs1_grp[] = { 50 50 FUNC("spi_cs1", 0, 27, 1), 51 51 FUNC("wdg_cs1", 1, 27, 1), 52 52 }; 53 - static struct ralink_pmx_func sdram_func[] = { FUNC("sdram", 0, 24, 16) }; 54 - static struct ralink_pmx_func rt3352_rgmii_func[] = { 53 + static struct ralink_pmx_func sdram_grp[] = { FUNC("sdram", 0, 24, 16) }; 54 + static struct ralink_pmx_func rt3352_rgmii_grp[] = { 55 55 FUNC("rgmii", 0, 24, 12) 56 56 }; 57 - static struct ralink_pmx_func rgmii_func[] = { FUNC("rgmii", 0, 40, 12) }; 58 - static struct ralink_pmx_func rt3352_lna_func[] = { FUNC("lna", 0, 36, 2) }; 59 - static struct ralink_pmx_func rt3352_pa_func[] = { FUNC("pa", 0, 38, 2) }; 60 - static struct ralink_pmx_func rt3352_led_func[] = { FUNC("led", 0, 40, 5) }; 61 - static struct ralink_pmx_func rt3352_cs1_func[] = { 57 + static struct ralink_pmx_func rgmii_grp[] = { FUNC("rgmii", 0, 40, 12) }; 58 + static struct ralink_pmx_func rt3352_lna_grp[] = { FUNC("lna", 0, 36, 2) }; 59 + static struct ralink_pmx_func rt3352_pa_grp[] = { FUNC("pa", 0, 38, 2) }; 60 + static struct ralink_pmx_func rt3352_led_grp[] = { FUNC("led", 0, 40, 5) }; 61 + static struct ralink_pmx_func rt3352_cs1_grp[] = { 62 62 FUNC("spi_cs1", 0, 45, 1), 63 63 FUNC("wdg_cs1", 1, 45, 1), 64 64 }; 65 65 66 66 static struct ralink_pmx_group rt3050_pinmux_data[] = { 67 - GRP("i2c", i2c_func, 1, RT305X_GPIO_MODE_I2C), 68 - GRP("spi", spi_func, 1, RT305X_GPIO_MODE_SPI), 69 - GRP("uartf", uartf_func, RT305X_GPIO_MODE_UART0_MASK, 67 + GRP("i2c", i2c_grp, 1, RT305X_GPIO_MODE_I2C), 68 + GRP("spi", spi_grp, 1, RT305X_GPIO_MODE_SPI), 69 + GRP("uartf", uartf_grp, RT305X_GPIO_MODE_UART0_MASK, 70 70 RT305X_GPIO_MODE_UART0_SHIFT), 71 - GRP("uartlite", uartlite_func, 1, RT305X_GPIO_MODE_UART1), 72 - GRP("jtag", jtag_func, 1, RT305X_GPIO_MODE_JTAG), 73 - GRP("mdio", mdio_func, 1, RT305X_GPIO_MODE_MDIO), 74 - GRP("rgmii", rgmii_func, 1, RT305X_GPIO_MODE_RGMII), 75 - GRP("sdram", sdram_func, 1, RT305X_GPIO_MODE_SDRAM), 71 + GRP("uartlite", uartlite_grp, 1, RT305X_GPIO_MODE_UART1), 72 + GRP("jtag", jtag_grp, 1, RT305X_GPIO_MODE_JTAG), 73 + GRP("mdio", mdio_grp, 1, RT305X_GPIO_MODE_MDIO), 74 + GRP("rgmii", rgmii_grp, 1, RT305X_GPIO_MODE_RGMII), 75 + GRP("sdram", sdram_grp, 1, RT305X_GPIO_MODE_SDRAM), 76 76 { 0 } 77 77 }; 78 78 79 79 static struct ralink_pmx_group rt3352_pinmux_data[] = { 80 - GRP("i2c", i2c_func, 1, RT305X_GPIO_MODE_I2C), 81 - GRP("spi", spi_func, 1, RT305X_GPIO_MODE_SPI), 82 - GRP("uartf", uartf_func, RT305X_GPIO_MODE_UART0_MASK, 80 + GRP("i2c", i2c_grp, 1, RT305X_GPIO_MODE_I2C), 81 + GRP("spi", spi_grp, 1, RT305X_GPIO_MODE_SPI), 82 + GRP("uartf", uartf_grp, RT305X_GPIO_MODE_UART0_MASK, 83 83 RT305X_GPIO_MODE_UART0_SHIFT), 84 - GRP("uartlite", uartlite_func, 1, RT305X_GPIO_MODE_UART1), 85 - GRP("jtag", jtag_func, 1, RT305X_GPIO_MODE_JTAG), 86 - GRP("mdio", mdio_func, 1, RT305X_GPIO_MODE_MDIO), 87 - GRP("rgmii", rt3352_rgmii_func, 1, RT305X_GPIO_MODE_RGMII), 88 - GRP("lna", rt3352_lna_func, 1, RT3352_GPIO_MODE_LNA), 89 - GRP("pa", rt3352_pa_func, 1, RT3352_GPIO_MODE_PA), 90 - GRP("led", rt3352_led_func, 1, RT5350_GPIO_MODE_PHY_LED), 91 - GRP("spi_cs1", rt3352_cs1_func, 2, RT5350_GPIO_MODE_SPI_CS1), 84 + GRP("uartlite", uartlite_grp, 1, RT305X_GPIO_MODE_UART1), 85 + GRP("jtag", jtag_grp, 1, RT305X_GPIO_MODE_JTAG), 86 + GRP("mdio", mdio_grp, 1, RT305X_GPIO_MODE_MDIO), 87 + GRP("rgmii", rt3352_rgmii_grp, 1, RT305X_GPIO_MODE_RGMII), 88 + GRP("lna", rt3352_lna_grp, 1, RT3352_GPIO_MODE_LNA), 89 + GRP("pa", rt3352_pa_grp, 1, RT3352_GPIO_MODE_PA), 90 + GRP("led", rt3352_led_grp, 1, RT5350_GPIO_MODE_PHY_LED), 91 + GRP("spi_cs1", rt3352_cs1_grp, 2, RT5350_GPIO_MODE_SPI_CS1), 92 92 { 0 } 93 93 }; 94 94 95 95 static struct ralink_pmx_group rt5350_pinmux_data[] = { 96 - GRP("i2c", i2c_func, 1, RT305X_GPIO_MODE_I2C), 97 - GRP("spi", spi_func, 1, RT305X_GPIO_MODE_SPI), 98 - GRP("uartf", uartf_func, RT305X_GPIO_MODE_UART0_MASK, 96 + GRP("i2c", i2c_grp, 1, RT305X_GPIO_MODE_I2C), 97 + GRP("spi", spi_grp, 1, RT305X_GPIO_MODE_SPI), 98 + GRP("uartf", uartf_grp, RT305X_GPIO_MODE_UART0_MASK, 99 99 RT305X_GPIO_MODE_UART0_SHIFT), 100 - GRP("uartlite", uartlite_func, 1, RT305X_GPIO_MODE_UART1), 101 - GRP("jtag", jtag_func, 1, RT305X_GPIO_MODE_JTAG), 102 - GRP("led", rt5350_led_func, 1, RT5350_GPIO_MODE_PHY_LED), 103 - GRP("spi_cs1", rt5350_cs1_func, 2, RT5350_GPIO_MODE_SPI_CS1), 100 + GRP("uartlite", uartlite_grp, 1, RT305X_GPIO_MODE_UART1), 101 + GRP("jtag", jtag_grp, 1, RT305X_GPIO_MODE_JTAG), 102 + GRP("led", rt5350_led_grp, 1, RT5350_GPIO_MODE_PHY_LED), 103 + GRP("spi_cs1", rt5350_cs1_grp, 2, RT5350_GPIO_MODE_SPI_CS1), 104 104 { 0 } 105 105 }; 106 106
+22 -22
drivers/pinctrl/ralink/pinctrl-rt3883.c
··· 39 39 #define RT3883_GPIO_MODE_LNA_G_GPIO 0x3 40 40 #define RT3883_GPIO_MODE_LNA_G _RT3883_GPIO_MODE_LNA_G(RT3883_GPIO_MODE_LNA_G_MASK) 41 41 42 - static struct ralink_pmx_func i2c_func[] = { FUNC("i2c", 0, 1, 2) }; 43 - static struct ralink_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) }; 44 - static struct ralink_pmx_func uartf_func[] = { 42 + static struct ralink_pmx_func i2c_grp[] = { FUNC("i2c", 0, 1, 2) }; 43 + static struct ralink_pmx_func spi_grp[] = { FUNC("spi", 0, 3, 4) }; 44 + static struct ralink_pmx_func uartf_grp[] = { 45 45 FUNC("uartf", RT3883_GPIO_MODE_UARTF, 7, 8), 46 46 FUNC("pcm uartf", RT3883_GPIO_MODE_PCM_UARTF, 7, 8), 47 47 FUNC("pcm i2s", RT3883_GPIO_MODE_PCM_I2S, 7, 8), ··· 50 50 FUNC("gpio uartf", RT3883_GPIO_MODE_GPIO_UARTF, 7, 4), 51 51 FUNC("gpio i2s", RT3883_GPIO_MODE_GPIO_I2S, 7, 4), 52 52 }; 53 - static struct ralink_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 15, 2) }; 54 - static struct ralink_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) }; 55 - static struct ralink_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) }; 56 - static struct ralink_pmx_func lna_a_func[] = { FUNC("lna a", 0, 32, 3) }; 57 - static struct ralink_pmx_func lna_g_func[] = { FUNC("lna g", 0, 35, 3) }; 58 - static struct ralink_pmx_func pci_func[] = { 53 + static struct ralink_pmx_func uartlite_grp[] = { FUNC("uartlite", 0, 15, 2) }; 54 + static struct ralink_pmx_func jtag_grp[] = { FUNC("jtag", 0, 17, 5) }; 55 + static struct ralink_pmx_func mdio_grp[] = { FUNC("mdio", 0, 22, 2) }; 56 + static struct ralink_pmx_func lna_a_grp[] = { FUNC("lna a", 0, 32, 3) }; 57 + static struct ralink_pmx_func lna_g_grp[] = { FUNC("lna g", 0, 35, 3) }; 58 + static struct ralink_pmx_func pci_grp[] = { 59 59 FUNC("pci-dev", 0, 40, 32), 60 60 FUNC("pci-host2", 1, 40, 32), 61 61 FUNC("pci-host1", 2, 40, 32), 62 62 FUNC("pci-fnc", 3, 40, 32) 63 63 }; 64 - static struct ralink_pmx_func ge1_func[] = { FUNC("ge1", 0, 72, 12) }; 65 - static struct ralink_pmx_func ge2_func[] = { FUNC("ge2", 0, 84, 12) }; 64 + static struct ralink_pmx_func ge1_grp[] = { FUNC("ge1", 0, 72, 12) }; 65 + static struct ralink_pmx_func ge2_grp[] = { FUNC("ge2", 0, 84, 12) }; 66 66 67 67 static struct ralink_pmx_group rt3883_pinmux_data[] = { 68 - GRP("i2c", i2c_func, 1, RT3883_GPIO_MODE_I2C), 69 - GRP("spi", spi_func, 1, RT3883_GPIO_MODE_SPI), 70 - GRP("uartf", uartf_func, RT3883_GPIO_MODE_UART0_MASK, 68 + GRP("i2c", i2c_grp, 1, RT3883_GPIO_MODE_I2C), 69 + GRP("spi", spi_grp, 1, RT3883_GPIO_MODE_SPI), 70 + GRP("uartf", uartf_grp, RT3883_GPIO_MODE_UART0_MASK, 71 71 RT3883_GPIO_MODE_UART0_SHIFT), 72 - GRP("uartlite", uartlite_func, 1, RT3883_GPIO_MODE_UART1), 73 - GRP("jtag", jtag_func, 1, RT3883_GPIO_MODE_JTAG), 74 - GRP("mdio", mdio_func, 1, RT3883_GPIO_MODE_MDIO), 75 - GRP("lna a", lna_a_func, 1, RT3883_GPIO_MODE_LNA_A), 76 - GRP("lna g", lna_g_func, 1, RT3883_GPIO_MODE_LNA_G), 77 - GRP("pci", pci_func, RT3883_GPIO_MODE_PCI_MASK, 72 + GRP("uartlite", uartlite_grp, 1, RT3883_GPIO_MODE_UART1), 73 + GRP("jtag", jtag_grp, 1, RT3883_GPIO_MODE_JTAG), 74 + GRP("mdio", mdio_grp, 1, RT3883_GPIO_MODE_MDIO), 75 + GRP("lna a", lna_a_grp, 1, RT3883_GPIO_MODE_LNA_A), 76 + GRP("lna g", lna_g_grp, 1, RT3883_GPIO_MODE_LNA_G), 77 + GRP("pci", pci_grp, RT3883_GPIO_MODE_PCI_MASK, 78 78 RT3883_GPIO_MODE_PCI_SHIFT), 79 - GRP("ge1", ge1_func, 1, RT3883_GPIO_MODE_GE1), 80 - GRP("ge2", ge2_func, 1, RT3883_GPIO_MODE_GE2), 79 + GRP("ge1", ge1_grp, 1, RT3883_GPIO_MODE_GE1), 80 + GRP("ge2", ge2_grp, 1, RT3883_GPIO_MODE_GE2), 81 81 { 0 } 82 82 }; 83 83
+244
drivers/pinctrl/renesas/pfc-r8a77950.c
··· 3820 3820 USB31_PWEN_MARK, USB31_OVC_MARK, 3821 3821 }; 3822 3822 3823 + /* - VIN4 ------------------------------------------------------------------- */ 3824 + static const unsigned int vin4_data18_a_pins[] = { 3825 + RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11), 3826 + RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13), 3827 + RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15), 3828 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 3829 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 3830 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 3831 + RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3), 3832 + RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5), 3833 + RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7), 3834 + }; 3835 + static const unsigned int vin4_data18_a_mux[] = { 3836 + VI4_DATA2_A_MARK, VI4_DATA3_A_MARK, 3837 + VI4_DATA4_A_MARK, VI4_DATA5_A_MARK, 3838 + VI4_DATA6_A_MARK, VI4_DATA7_A_MARK, 3839 + VI4_DATA10_MARK, VI4_DATA11_MARK, 3840 + VI4_DATA12_MARK, VI4_DATA13_MARK, 3841 + VI4_DATA14_MARK, VI4_DATA15_MARK, 3842 + VI4_DATA18_MARK, VI4_DATA19_MARK, 3843 + VI4_DATA20_MARK, VI4_DATA21_MARK, 3844 + VI4_DATA22_MARK, VI4_DATA23_MARK, 3845 + }; 3846 + static const unsigned int vin4_data18_b_pins[] = { 3847 + RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3), 3848 + RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5), 3849 + RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7), 3850 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 3851 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 3852 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 3853 + RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3), 3854 + RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5), 3855 + RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7), 3856 + }; 3857 + static const unsigned int vin4_data18_b_mux[] = { 3858 + VI4_DATA2_B_MARK, VI4_DATA3_B_MARK, 3859 + VI4_DATA4_B_MARK, VI4_DATA5_B_MARK, 3860 + VI4_DATA6_B_MARK, VI4_DATA7_B_MARK, 3861 + VI4_DATA10_MARK, VI4_DATA11_MARK, 3862 + VI4_DATA12_MARK, VI4_DATA13_MARK, 3863 + VI4_DATA14_MARK, VI4_DATA15_MARK, 3864 + VI4_DATA18_MARK, VI4_DATA19_MARK, 3865 + VI4_DATA20_MARK, VI4_DATA21_MARK, 3866 + VI4_DATA22_MARK, VI4_DATA23_MARK, 3867 + }; 3868 + static const unsigned int vin4_data_a_pins[] = { 3869 + RCAR_GP_PIN(0, 8), RCAR_GP_PIN(0, 9), 3870 + RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11), 3871 + RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13), 3872 + RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15), 3873 + RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1), 3874 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 3875 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 3876 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 3877 + RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1), 3878 + RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3), 3879 + RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5), 3880 + RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7), 3881 + }; 3882 + static const unsigned int vin4_data_a_mux[] = { 3883 + VI4_DATA0_A_MARK, VI4_DATA1_A_MARK, 3884 + VI4_DATA2_A_MARK, VI4_DATA3_A_MARK, 3885 + VI4_DATA4_A_MARK, VI4_DATA5_A_MARK, 3886 + VI4_DATA6_A_MARK, VI4_DATA7_A_MARK, 3887 + VI4_DATA8_MARK, VI4_DATA9_MARK, 3888 + VI4_DATA10_MARK, VI4_DATA11_MARK, 3889 + VI4_DATA12_MARK, VI4_DATA13_MARK, 3890 + VI4_DATA14_MARK, VI4_DATA15_MARK, 3891 + VI4_DATA16_MARK, VI4_DATA17_MARK, 3892 + VI4_DATA18_MARK, VI4_DATA19_MARK, 3893 + VI4_DATA20_MARK, VI4_DATA21_MARK, 3894 + VI4_DATA22_MARK, VI4_DATA23_MARK, 3895 + }; 3896 + static const unsigned int vin4_data_b_pins[] = { 3897 + RCAR_GP_PIN(2, 0), RCAR_GP_PIN(2, 1), 3898 + RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3), 3899 + RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5), 3900 + RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7), 3901 + RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1), 3902 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 3903 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 3904 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 3905 + RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1), 3906 + RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3), 3907 + RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5), 3908 + RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7), 3909 + }; 3910 + static const unsigned int vin4_data_b_mux[] = { 3911 + VI4_DATA0_B_MARK, VI4_DATA1_B_MARK, 3912 + VI4_DATA2_B_MARK, VI4_DATA3_B_MARK, 3913 + VI4_DATA4_B_MARK, VI4_DATA5_B_MARK, 3914 + VI4_DATA6_B_MARK, VI4_DATA7_B_MARK, 3915 + VI4_DATA8_MARK, VI4_DATA9_MARK, 3916 + VI4_DATA10_MARK, VI4_DATA11_MARK, 3917 + VI4_DATA12_MARK, VI4_DATA13_MARK, 3918 + VI4_DATA14_MARK, VI4_DATA15_MARK, 3919 + VI4_DATA16_MARK, VI4_DATA17_MARK, 3920 + VI4_DATA18_MARK, VI4_DATA19_MARK, 3921 + VI4_DATA20_MARK, VI4_DATA21_MARK, 3922 + VI4_DATA22_MARK, VI4_DATA23_MARK, 3923 + }; 3924 + static const unsigned int vin4_sync_pins[] = { 3925 + /* HSYNC#, VSYNC# */ 3926 + RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 17), 3927 + }; 3928 + static const unsigned int vin4_sync_mux[] = { 3929 + VI4_HSYNC_N_MARK, VI4_VSYNC_N_MARK, 3930 + }; 3931 + static const unsigned int vin4_field_pins[] = { 3932 + /* FIELD */ 3933 + RCAR_GP_PIN(1, 16), 3934 + }; 3935 + static const unsigned int vin4_field_mux[] = { 3936 + VI4_FIELD_MARK, 3937 + }; 3938 + static const unsigned int vin4_clkenb_pins[] = { 3939 + /* CLKENB */ 3940 + RCAR_GP_PIN(1, 19), 3941 + }; 3942 + static const unsigned int vin4_clkenb_mux[] = { 3943 + VI4_CLKENB_MARK, 3944 + }; 3945 + static const unsigned int vin4_clk_pins[] = { 3946 + /* CLK */ 3947 + RCAR_GP_PIN(1, 27), 3948 + }; 3949 + static const unsigned int vin4_clk_mux[] = { 3950 + VI4_CLK_MARK, 3951 + }; 3952 + 3953 + /* - VIN5 ------------------------------------------------------------------- */ 3954 + static const unsigned int vin5_data_pins[] = { 3955 + RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1), 3956 + RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3), 3957 + RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5), 3958 + RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7), 3959 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 3960 + RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15), 3961 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 3962 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 3963 + }; 3964 + static const unsigned int vin5_data_mux[] = { 3965 + VI5_DATA0_MARK, VI5_DATA1_MARK, 3966 + VI5_DATA2_MARK, VI5_DATA3_MARK, 3967 + VI5_DATA4_MARK, VI5_DATA5_MARK, 3968 + VI5_DATA6_MARK, VI5_DATA7_MARK, 3969 + VI5_DATA8_MARK, VI5_DATA9_MARK, 3970 + VI5_DATA10_MARK, VI5_DATA11_MARK, 3971 + VI5_DATA12_MARK, VI5_DATA13_MARK, 3972 + VI5_DATA14_MARK, VI5_DATA15_MARK, 3973 + }; 3974 + static const unsigned int vin5_sync_pins[] = { 3975 + /* HSYNC#, VSYNC# */ 3976 + RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 9), 3977 + }; 3978 + static const unsigned int vin5_sync_mux[] = { 3979 + VI5_HSYNC_N_MARK, VI5_VSYNC_N_MARK, 3980 + }; 3981 + static const unsigned int vin5_field_pins[] = { 3982 + RCAR_GP_PIN(1, 11), 3983 + }; 3984 + static const unsigned int vin5_field_mux[] = { 3985 + /* FIELD */ 3986 + VI5_FIELD_MARK, 3987 + }; 3988 + static const unsigned int vin5_clkenb_pins[] = { 3989 + RCAR_GP_PIN(1, 20), 3990 + }; 3991 + static const unsigned int vin5_clkenb_mux[] = { 3992 + /* CLKENB */ 3993 + VI5_CLKENB_MARK, 3994 + }; 3995 + static const unsigned int vin5_clk_pins[] = { 3996 + RCAR_GP_PIN(1, 21), 3997 + }; 3998 + static const unsigned int vin5_clk_mux[] = { 3999 + /* CLK */ 4000 + VI5_CLK_MARK, 4001 + }; 4002 + 3823 4003 static const struct sh_pfc_pin_group pinmux_groups[] = { 3824 4004 SH_PFC_PIN_GROUP(audio_clk_a_a), 3825 4005 SH_PFC_PIN_GROUP(audio_clk_a_b), ··· 4321 4141 SH_PFC_PIN_GROUP(usb2), 4322 4142 SH_PFC_PIN_GROUP(usb30), 4323 4143 SH_PFC_PIN_GROUP(usb31), 4144 + BUS_DATA_PIN_GROUP(vin4_data, 8, _a), 4145 + BUS_DATA_PIN_GROUP(vin4_data, 10, _a), 4146 + BUS_DATA_PIN_GROUP(vin4_data, 12, _a), 4147 + BUS_DATA_PIN_GROUP(vin4_data, 16, _a), 4148 + SH_PFC_PIN_GROUP(vin4_data18_a), 4149 + BUS_DATA_PIN_GROUP(vin4_data, 20, _a), 4150 + BUS_DATA_PIN_GROUP(vin4_data, 24, _a), 4151 + BUS_DATA_PIN_GROUP(vin4_data, 8, _b), 4152 + BUS_DATA_PIN_GROUP(vin4_data, 10, _b), 4153 + BUS_DATA_PIN_GROUP(vin4_data, 12, _b), 4154 + BUS_DATA_PIN_GROUP(vin4_data, 16, _b), 4155 + SH_PFC_PIN_GROUP(vin4_data18_b), 4156 + BUS_DATA_PIN_GROUP(vin4_data, 20, _b), 4157 + BUS_DATA_PIN_GROUP(vin4_data, 24, _b), 4158 + SH_PFC_PIN_GROUP_SUBSET(vin4_g8, vin4_data_a, 8, 8), 4159 + SH_PFC_PIN_GROUP(vin4_sync), 4160 + SH_PFC_PIN_GROUP(vin4_field), 4161 + SH_PFC_PIN_GROUP(vin4_clkenb), 4162 + SH_PFC_PIN_GROUP(vin4_clk), 4163 + BUS_DATA_PIN_GROUP(vin5_data, 8), 4164 + BUS_DATA_PIN_GROUP(vin5_data, 10), 4165 + BUS_DATA_PIN_GROUP(vin5_data, 12), 4166 + BUS_DATA_PIN_GROUP(vin5_data, 16), 4167 + SH_PFC_PIN_GROUP_SUBSET(vin5_high8, vin5_data, 8, 8), 4168 + SH_PFC_PIN_GROUP(vin5_sync), 4169 + SH_PFC_PIN_GROUP(vin5_field), 4170 + SH_PFC_PIN_GROUP(vin5_clkenb), 4171 + SH_PFC_PIN_GROUP(vin5_clk), 4324 4172 }; 4325 4173 4326 4174 static const char * const audio_clk_groups[] = { ··· 4845 4637 "usb31", 4846 4638 }; 4847 4639 4640 + static const char * const vin4_groups[] = { 4641 + "vin4_data8_a", 4642 + "vin4_data10_a", 4643 + "vin4_data12_a", 4644 + "vin4_data16_a", 4645 + "vin4_data18_a", 4646 + "vin4_data20_a", 4647 + "vin4_data24_a", 4648 + "vin4_data8_b", 4649 + "vin4_data10_b", 4650 + "vin4_data12_b", 4651 + "vin4_data16_b", 4652 + "vin4_data18_b", 4653 + "vin4_data20_b", 4654 + "vin4_data24_b", 4655 + "vin4_g8", 4656 + "vin4_sync", 4657 + "vin4_field", 4658 + "vin4_clkenb", 4659 + "vin4_clk", 4660 + }; 4661 + 4662 + static const char * const vin5_groups[] = { 4663 + "vin5_data8", 4664 + "vin5_data10", 4665 + "vin5_data12", 4666 + "vin5_data16", 4667 + "vin5_high8", 4668 + "vin5_sync", 4669 + "vin5_field", 4670 + "vin5_clkenb", 4671 + "vin5_clk", 4672 + }; 4673 + 4848 4674 static const struct sh_pfc_function pinmux_functions[] = { 4849 4675 SH_PFC_FUNCTION(audio_clk), 4850 4676 SH_PFC_FUNCTION(avb), ··· 4938 4696 SH_PFC_FUNCTION(usb2), 4939 4697 SH_PFC_FUNCTION(usb30), 4940 4698 SH_PFC_FUNCTION(usb31), 4699 + SH_PFC_FUNCTION(vin4), 4700 + SH_PFC_FUNCTION(vin5), 4941 4701 }; 4942 4702 4943 4703 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
+56 -56
drivers/pinctrl/renesas/pfc-r8a779g0.c
··· 206 206 #define GPSR5_0 FM(AVB2_AVTP_PPS) 207 207 208 208 /* GPSR 6 */ 209 - #define GPSR6_20 F_(AVB1_TXCREFCLK, IP2SR6_19_16) 210 - #define GPSR6_19 F_(AVB1_RD3, IP2SR6_15_12) 211 - #define GPSR6_18 F_(AVB1_TD3, IP2SR6_11_8) 212 - #define GPSR6_17 F_(AVB1_RD2, IP2SR6_7_4) 213 - #define GPSR6_16 F_(AVB1_TD2, IP2SR6_3_0) 214 - #define GPSR6_15 F_(AVB1_RD0, IP1SR6_31_28) 215 - #define GPSR6_14 F_(AVB1_RD1, IP1SR6_27_24) 216 - #define GPSR6_13 F_(AVB1_TD0, IP1SR6_23_20) 217 - #define GPSR6_12 F_(AVB1_TD1, IP1SR6_19_16) 218 - #define GPSR6_11 F_(AVB1_AVTP_CAPTURE, IP1SR6_15_12) 219 - #define GPSR6_10 F_(AVB1_AVTP_PPS, IP1SR6_11_8) 220 - #define GPSR6_9 F_(AVB1_RX_CTL, IP1SR6_7_4) 221 - #define GPSR6_8 F_(AVB1_RXC, IP1SR6_3_0) 222 - #define GPSR6_7 F_(AVB1_TX_CTL, IP0SR6_31_28) 223 - #define GPSR6_6 F_(AVB1_TXC, IP0SR6_27_24) 224 - #define GPSR6_5 F_(AVB1_AVTP_MATCH, IP0SR6_23_20) 225 - #define GPSR6_4 F_(AVB1_LINK, IP0SR6_19_16) 226 - #define GPSR6_3 F_(AVB1_PHY_INT, IP0SR6_15_12) 227 - #define GPSR6_2 F_(AVB1_MDC, IP0SR6_11_8) 228 - #define GPSR6_1 F_(AVB1_MAGIC, IP0SR6_7_4) 229 - #define GPSR6_0 F_(AVB1_MDIO, IP0SR6_3_0) 209 + #define GPSR6_20 F_(AVB1_TXCREFCLK, IP2SR6_19_16) 210 + #define GPSR6_19 F_(AVB1_RD3, IP2SR6_15_12) 211 + #define GPSR6_18 F_(AVB1_TD3, IP2SR6_11_8) 212 + #define GPSR6_17 F_(AVB1_RD2, IP2SR6_7_4) 213 + #define GPSR6_16 F_(AVB1_TD2, IP2SR6_3_0) 214 + #define GPSR6_15 F_(AVB1_RD0, IP1SR6_31_28) 215 + #define GPSR6_14 F_(AVB1_RD1, IP1SR6_27_24) 216 + #define GPSR6_13 F_(AVB1_TD0, IP1SR6_23_20) 217 + #define GPSR6_12 F_(AVB1_TD1, IP1SR6_19_16) 218 + #define GPSR6_11 F_(AVB1_AVTP_CAPTURE, IP1SR6_15_12) 219 + #define GPSR6_10 F_(AVB1_AVTP_PPS, IP1SR6_11_8) 220 + #define GPSR6_9 F_(AVB1_RX_CTL, IP1SR6_7_4) 221 + #define GPSR6_8 F_(AVB1_RXC, IP1SR6_3_0) 222 + #define GPSR6_7 F_(AVB1_TX_CTL, IP0SR6_31_28) 223 + #define GPSR6_6 F_(AVB1_TXC, IP0SR6_27_24) 224 + #define GPSR6_5 F_(AVB1_AVTP_MATCH, IP0SR6_23_20) 225 + #define GPSR6_4 F_(AVB1_LINK, IP0SR6_19_16) 226 + #define GPSR6_3 F_(AVB1_PHY_INT, IP0SR6_15_12) 227 + #define GPSR6_2 F_(AVB1_MDC, IP0SR6_11_8) 228 + #define GPSR6_1 F_(AVB1_MAGIC, IP0SR6_7_4) 229 + #define GPSR6_0 F_(AVB1_MDIO, IP0SR6_3_0) 230 230 231 231 /* GPSR7 */ 232 - #define GPSR7_20 F_(AVB0_RX_CTL, IP2SR7_19_16) 233 - #define GPSR7_19 F_(AVB0_RXC, IP2SR7_15_12) 234 - #define GPSR7_18 F_(AVB0_RD0, IP2SR7_11_8) 235 - #define GPSR7_17 F_(AVB0_RD1, IP2SR7_7_4) 236 - #define GPSR7_16 F_(AVB0_TX_CTL, IP2SR7_3_0) 237 - #define GPSR7_15 F_(AVB0_TXC, IP1SR7_31_28) 238 - #define GPSR7_14 F_(AVB0_MDIO, IP1SR7_27_24) 239 - #define GPSR7_13 F_(AVB0_MDC, IP1SR7_23_20) 240 - #define GPSR7_12 F_(AVB0_RD2, IP1SR7_19_16) 241 - #define GPSR7_11 F_(AVB0_TD0, IP1SR7_15_12) 242 - #define GPSR7_10 F_(AVB0_MAGIC, IP1SR7_11_8) 243 - #define GPSR7_9 F_(AVB0_TXCREFCLK, IP1SR7_7_4) 244 - #define GPSR7_8 F_(AVB0_RD3, IP1SR7_3_0) 245 - #define GPSR7_7 F_(AVB0_TD1, IP0SR7_31_28) 246 - #define GPSR7_6 F_(AVB0_TD2, IP0SR7_27_24) 247 - #define GPSR7_5 F_(AVB0_PHY_INT, IP0SR7_23_20) 248 - #define GPSR7_4 F_(AVB0_LINK, IP0SR7_19_16) 249 - #define GPSR7_3 F_(AVB0_TD3, IP0SR7_15_12) 250 - #define GPSR7_2 F_(AVB0_AVTP_MATCH, IP0SR7_11_8) 251 - #define GPSR7_1 F_(AVB0_AVTP_CAPTURE, IP0SR7_7_4) 252 - #define GPSR7_0 F_(AVB0_AVTP_PPS, IP0SR7_3_0) 232 + #define GPSR7_20 F_(AVB0_RX_CTL, IP2SR7_19_16) 233 + #define GPSR7_19 F_(AVB0_RXC, IP2SR7_15_12) 234 + #define GPSR7_18 F_(AVB0_RD0, IP2SR7_11_8) 235 + #define GPSR7_17 F_(AVB0_RD1, IP2SR7_7_4) 236 + #define GPSR7_16 F_(AVB0_TX_CTL, IP2SR7_3_0) 237 + #define GPSR7_15 F_(AVB0_TXC, IP1SR7_31_28) 238 + #define GPSR7_14 F_(AVB0_MDIO, IP1SR7_27_24) 239 + #define GPSR7_13 F_(AVB0_MDC, IP1SR7_23_20) 240 + #define GPSR7_12 F_(AVB0_RD2, IP1SR7_19_16) 241 + #define GPSR7_11 F_(AVB0_TD0, IP1SR7_15_12) 242 + #define GPSR7_10 F_(AVB0_MAGIC, IP1SR7_11_8) 243 + #define GPSR7_9 F_(AVB0_TXCREFCLK, IP1SR7_7_4) 244 + #define GPSR7_8 F_(AVB0_RD3, IP1SR7_3_0) 245 + #define GPSR7_7 F_(AVB0_TD1, IP0SR7_31_28) 246 + #define GPSR7_6 F_(AVB0_TD2, IP0SR7_27_24) 247 + #define GPSR7_5 F_(AVB0_PHY_INT, IP0SR7_23_20) 248 + #define GPSR7_4 F_(AVB0_LINK, IP0SR7_19_16) 249 + #define GPSR7_3 F_(AVB0_TD3, IP0SR7_15_12) 250 + #define GPSR7_2 F_(AVB0_AVTP_MATCH, IP0SR7_11_8) 251 + #define GPSR7_1 F_(AVB0_AVTP_CAPTURE, IP0SR7_7_4) 252 + #define GPSR7_0 F_(AVB0_AVTP_PPS, IP0SR7_3_0) 253 253 254 254 /* GPSR8 */ 255 - #define GPSR8_13 F_(GP8_13, IP1SR8_23_20) 256 - #define GPSR8_12 F_(GP8_12, IP1SR8_19_16) 257 - #define GPSR8_11 F_(SDA5, IP1SR8_15_12) 258 - #define GPSR8_10 F_(SCL5, IP1SR8_11_8) 259 - #define GPSR8_9 F_(SDA4, IP1SR8_7_4) 260 - #define GPSR8_8 F_(SCL4, IP1SR8_3_0) 261 - #define GPSR8_7 F_(SDA3, IP0SR8_31_28) 262 - #define GPSR8_6 F_(SCL3, IP0SR8_27_24) 263 - #define GPSR8_5 F_(SDA2, IP0SR8_23_20) 264 - #define GPSR8_4 F_(SCL2, IP0SR8_19_16) 265 - #define GPSR8_3 F_(SDA1, IP0SR8_15_12) 266 - #define GPSR8_2 F_(SCL1, IP0SR8_11_8) 267 - #define GPSR8_1 F_(SDA0, IP0SR8_7_4) 268 - #define GPSR8_0 F_(SCL0, IP0SR8_3_0) 255 + #define GPSR8_13 F_(GP8_13, IP1SR8_23_20) 256 + #define GPSR8_12 F_(GP8_12, IP1SR8_19_16) 257 + #define GPSR8_11 F_(SDA5, IP1SR8_15_12) 258 + #define GPSR8_10 F_(SCL5, IP1SR8_11_8) 259 + #define GPSR8_9 F_(SDA4, IP1SR8_7_4) 260 + #define GPSR8_8 F_(SCL4, IP1SR8_3_0) 261 + #define GPSR8_7 F_(SDA3, IP0SR8_31_28) 262 + #define GPSR8_6 F_(SCL3, IP0SR8_27_24) 263 + #define GPSR8_5 F_(SDA2, IP0SR8_23_20) 264 + #define GPSR8_4 F_(SCL2, IP0SR8_19_16) 265 + #define GPSR8_3 F_(SDA1, IP0SR8_15_12) 266 + #define GPSR8_2 F_(SCL1, IP0SR8_11_8) 267 + #define GPSR8_1 F_(SDA0, IP0SR8_7_4) 268 + #define GPSR8_0 F_(SCL0, IP0SR8_3_0) 269 269 270 270 /* SR0 */ 271 271 /* IP0SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */
+17 -8
drivers/pinctrl/renesas/pinctrl-rzg2l.c
··· 130 130 struct rzg2l_pinctrl_data { 131 131 const char * const *port_pins; 132 132 const u32 *port_pin_configs; 133 + unsigned int n_ports; 133 134 struct rzg2l_dedicated_configs *dedicated_pins; 134 135 unsigned int n_port_pins; 135 136 unsigned int n_dedicated_pins; ··· 1125 1124 } 1126 1125 }; 1127 1126 1128 - static int rzg2l_gpio_get_gpioint(unsigned int virq) 1127 + static int rzg2l_gpio_get_gpioint(unsigned int virq, const struct rzg2l_pinctrl_data *data) 1129 1128 { 1130 1129 unsigned int gpioint; 1131 1130 unsigned int i; ··· 1134 1133 port = virq / 8; 1135 1134 bit = virq % 8; 1136 1135 1137 - if (port >= ARRAY_SIZE(rzg2l_gpio_configs) || 1138 - bit >= RZG2L_GPIO_PORT_GET_PINCNT(rzg2l_gpio_configs[port])) 1136 + if (port >= data->n_ports || 1137 + bit >= RZG2L_GPIO_PORT_GET_PINCNT(data->port_pin_configs[port])) 1139 1138 return -EINVAL; 1140 1139 1141 1140 gpioint = bit; 1142 1141 for (i = 0; i < port; i++) 1143 - gpioint += RZG2L_GPIO_PORT_GET_PINCNT(rzg2l_gpio_configs[i]); 1142 + gpioint += RZG2L_GPIO_PORT_GET_PINCNT(data->port_pin_configs[i]); 1144 1143 1145 1144 return gpioint; 1146 1145 } ··· 1240 1239 unsigned long flags; 1241 1240 int gpioint, irq; 1242 1241 1243 - gpioint = rzg2l_gpio_get_gpioint(child); 1242 + gpioint = rzg2l_gpio_get_gpioint(child, pctrl->data); 1244 1243 if (gpioint < 0) 1245 1244 return gpioint; 1246 1245 ··· 1314 1313 port = offset / 8; 1315 1314 bit = offset % 8; 1316 1315 1317 - if (port >= ARRAY_SIZE(rzg2l_gpio_configs) || 1318 - bit >= RZG2L_GPIO_PORT_GET_PINCNT(rzg2l_gpio_configs[port])) 1316 + if (port >= pctrl->data->n_ports || 1317 + bit >= RZG2L_GPIO_PORT_GET_PINCNT(pctrl->data->port_pin_configs[port])) 1319 1318 clear_bit(offset, valid_mask); 1320 1319 } 1321 1320 } ··· 1468 1467 struct rzg2l_pinctrl *pctrl; 1469 1468 int ret; 1470 1469 1470 + BUILD_BUG_ON(ARRAY_SIZE(rzg2l_gpio_configs) * RZG2L_PINS_PER_PORT > 1471 + ARRAY_SIZE(rzg2l_gpio_names)); 1472 + 1473 + BUILD_BUG_ON(ARRAY_SIZE(r9a07g043_gpio_configs) * RZG2L_PINS_PER_PORT > 1474 + ARRAY_SIZE(rzg2l_gpio_names)); 1475 + 1471 1476 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); 1472 1477 if (!pctrl) 1473 1478 return -ENOMEM; ··· 1526 1519 static struct rzg2l_pinctrl_data r9a07g043_data = { 1527 1520 .port_pins = rzg2l_gpio_names, 1528 1521 .port_pin_configs = r9a07g043_gpio_configs, 1522 + .n_ports = ARRAY_SIZE(r9a07g043_gpio_configs), 1529 1523 .dedicated_pins = rzg2l_dedicated_pins.common, 1530 1524 .n_port_pins = ARRAY_SIZE(r9a07g043_gpio_configs) * RZG2L_PINS_PER_PORT, 1531 1525 .n_dedicated_pins = ARRAY_SIZE(rzg2l_dedicated_pins.common), ··· 1535 1527 static struct rzg2l_pinctrl_data r9a07g044_data = { 1536 1528 .port_pins = rzg2l_gpio_names, 1537 1529 .port_pin_configs = rzg2l_gpio_configs, 1530 + .n_ports = ARRAY_SIZE(rzg2l_gpio_configs), 1538 1531 .dedicated_pins = rzg2l_dedicated_pins.common, 1539 - .n_port_pins = ARRAY_SIZE(rzg2l_gpio_names), 1532 + .n_port_pins = ARRAY_SIZE(rzg2l_gpio_configs) * RZG2L_PINS_PER_PORT, 1540 1533 .n_dedicated_pins = ARRAY_SIZE(rzg2l_dedicated_pins.common) + 1541 1534 ARRAY_SIZE(rzg2l_dedicated_pins.rzg2l_pins), 1542 1535 };
+1 -1
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 649 649 } 650 650 651 651 /* 652 - * gpiolib gpio_to_irq callback function. Creates a mapping between a GPIO pin 652 + * gpiod_to_irq() callback function. Creates a mapping between a GPIO pin 653 653 * and a virtual IRQ, if not already present. 654 654 */ 655 655 static int samsung_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
+33
drivers/pinctrl/starfive/Kconfig
··· 16 16 This also provides an interface to the GPIO pins not used by other 17 17 peripherals supporting inputs, outputs, configuring pull-up/pull-down 18 18 and interrupts on input changes. 19 + 20 + config PINCTRL_STARFIVE_JH7110 21 + bool 22 + select GENERIC_PINCTRL_GROUPS 23 + select GENERIC_PINMUX_FUNCTIONS 24 + select GENERIC_PINCONF 25 + select GPIOLIB 26 + select GPIOLIB_IRQCHIP 27 + select OF_GPIO 28 + 29 + config PINCTRL_STARFIVE_JH7110_SYS 30 + tristate "System pinctrl and GPIO driver for the StarFive JH7110 SoC" 31 + depends on SOC_STARFIVE || COMPILE_TEST 32 + depends on OF 33 + select PINCTRL_STARFIVE_JH7110 34 + default SOC_STARFIVE 35 + help 36 + Say yes here to support system pin control on the StarFive JH7110 SoC. 37 + This also provides an interface to the GPIO pins not used by other 38 + peripherals supporting inputs, outputs, configuring pull-up/pull-down 39 + and interrupts on input changes. 40 + 41 + config PINCTRL_STARFIVE_JH7110_AON 42 + tristate "Always-on pinctrl and GPIO driver for the StarFive JH7110 SoC" 43 + depends on SOC_STARFIVE || COMPILE_TEST 44 + depends on OF 45 + select PINCTRL_STARFIVE_JH7110 46 + default SOC_STARFIVE 47 + help 48 + Say yes here to support always-on pin control on the StarFive JH7110 SoC. 49 + This also provides an interface to the GPIO pins not used by other 50 + peripherals supporting inputs, outputs, configuring pull-up/pull-down 51 + and interrupts on input changes.
+4
drivers/pinctrl/starfive/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 3 obj-$(CONFIG_PINCTRL_STARFIVE_JH7100) += pinctrl-starfive-jh7100.o 4 + 5 + obj-$(CONFIG_PINCTRL_STARFIVE_JH7110) += pinctrl-starfive-jh7110.o 6 + obj-$(CONFIG_PINCTRL_STARFIVE_JH7110_SYS) += pinctrl-starfive-jh7110-sys.o 7 + obj-$(CONFIG_PINCTRL_STARFIVE_JH7110_AON) += pinctrl-starfive-jh7110-aon.o
+177
drivers/pinctrl/starfive/pinctrl-starfive-jh7110-aon.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Pinctrl / GPIO driver for StarFive JH7110 SoC aon controller 4 + * 5 + * Copyright (C) 2022 StarFive Technology Co., Ltd. 6 + */ 7 + 8 + #include <linux/err.h> 9 + #include <linux/gpio/driver.h> 10 + #include <linux/init.h> 11 + #include <linux/interrupt.h> 12 + #include <linux/io.h> 13 + #include <linux/module.h> 14 + #include <linux/of.h> 15 + #include <linux/of_device.h> 16 + #include <linux/of_irq.h> 17 + #include <linux/of_platform.h> 18 + #include <linux/pinctrl/pinconf.h> 19 + #include <linux/pinctrl/pinconf-generic.h> 20 + #include <linux/pinctrl/pinctrl.h> 21 + #include <linux/pinctrl/pinmux.h> 22 + #include <linux/platform_device.h> 23 + #include <linux/pm_runtime.h> 24 + #include <linux/regmap.h> 25 + #include <linux/slab.h> 26 + 27 + #include <dt-bindings/pinctrl/starfive,jh7110-pinctrl.h> 28 + 29 + #include "../core.h" 30 + #include "../pinconf.h" 31 + #include "../pinmux.h" 32 + #include "pinctrl-starfive-jh7110.h" 33 + 34 + #define JH7110_AON_NGPIO 4 35 + #define JH7110_AON_GC_BASE 64 36 + 37 + /* registers */ 38 + #define JH7110_AON_DOEN 0x0 39 + #define JH7110_AON_DOUT 0x4 40 + #define JH7110_AON_GPI 0x8 41 + #define JH7110_AON_GPIOIN 0x2c 42 + 43 + #define JH7110_AON_GPIOEN 0xc 44 + #define JH7110_AON_GPIOIS 0x10 45 + #define JH7110_AON_GPIOIC 0x14 46 + #define JH7110_AON_GPIOIBE 0x18 47 + #define JH7110_AON_GPIOIEV 0x1c 48 + #define JH7110_AON_GPIOIE 0x20 49 + #define JH7110_AON_GPIORIS 0x28 50 + #define JH7110_AON_GPIOMIS 0x28 51 + 52 + #define JH7110_AON_GPO_PDA_0_5_CFG 0x30 53 + 54 + static const struct pinctrl_pin_desc jh7110_aon_pins[] = { 55 + PINCTRL_PIN(PAD_TESTEN, "TESTEN"), 56 + PINCTRL_PIN(PAD_RGPIO0, "RGPIO0"), 57 + PINCTRL_PIN(PAD_RGPIO1, "RGPIO1"), 58 + PINCTRL_PIN(PAD_RGPIO2, "RGPIO2"), 59 + PINCTRL_PIN(PAD_RGPIO3, "RGPIO3"), 60 + PINCTRL_PIN(PAD_RSTN, "RSTN"), 61 + PINCTRL_PIN(PAD_GMAC0_MDC, "GMAC0_MDC"), 62 + PINCTRL_PIN(PAD_GMAC0_MDIO, "GMAC0_MDIO"), 63 + PINCTRL_PIN(PAD_GMAC0_RXD0, "GMAC0_RXD0"), 64 + PINCTRL_PIN(PAD_GMAC0_RXD1, "GMAC0_RXD1"), 65 + PINCTRL_PIN(PAD_GMAC0_RXD2, "GMAC0_RXD2"), 66 + PINCTRL_PIN(PAD_GMAC0_RXD3, "GMAC0_RXD3"), 67 + PINCTRL_PIN(PAD_GMAC0_RXDV, "GMAC0_RXDV"), 68 + PINCTRL_PIN(PAD_GMAC0_RXC, "GMAC0_RXC"), 69 + PINCTRL_PIN(PAD_GMAC0_TXD0, "GMAC0_TXD0"), 70 + PINCTRL_PIN(PAD_GMAC0_TXD1, "GMAC0_TXD1"), 71 + PINCTRL_PIN(PAD_GMAC0_TXD2, "GMAC0_TXD2"), 72 + PINCTRL_PIN(PAD_GMAC0_TXD3, "GMAC0_TXD3"), 73 + PINCTRL_PIN(PAD_GMAC0_TXEN, "GMAC0_TXEN"), 74 + PINCTRL_PIN(PAD_GMAC0_TXC, "GMAC0_TXC"), 75 + }; 76 + 77 + static int jh7110_aon_set_one_pin_mux(struct jh7110_pinctrl *sfp, 78 + unsigned int pin, 79 + unsigned int din, u32 dout, 80 + u32 doen, u32 func) 81 + { 82 + if (pin < sfp->gc.ngpio && func == 0) 83 + jh7110_set_gpiomux(sfp, pin, din, dout, doen); 84 + 85 + return 0; 86 + } 87 + 88 + static int jh7110_aon_get_padcfg_base(struct jh7110_pinctrl *sfp, 89 + unsigned int pin) 90 + { 91 + if (pin < PAD_GMAC0_MDC) 92 + return JH7110_AON_GPO_PDA_0_5_CFG; 93 + 94 + return -1; 95 + } 96 + 97 + static void jh7110_aon_irq_handler(struct irq_desc *desc) 98 + { 99 + struct jh7110_pinctrl *sfp = jh7110_from_irq_desc(desc); 100 + struct irq_chip *chip = irq_desc_get_chip(desc); 101 + unsigned long mis; 102 + unsigned int pin; 103 + 104 + chained_irq_enter(chip, desc); 105 + 106 + mis = readl_relaxed(sfp->base + JH7110_AON_GPIOMIS); 107 + for_each_set_bit(pin, &mis, JH7110_AON_NGPIO) 108 + generic_handle_domain_irq(sfp->gc.irq.domain, pin); 109 + 110 + chained_irq_exit(chip, desc); 111 + } 112 + 113 + static int jh7110_aon_init_hw(struct gpio_chip *gc) 114 + { 115 + struct jh7110_pinctrl *sfp = container_of(gc, 116 + struct jh7110_pinctrl, gc); 117 + 118 + /* mask all GPIO interrupts */ 119 + writel_relaxed(0, sfp->base + JH7110_AON_GPIOIE); 120 + /* clear edge interrupt flags */ 121 + writel_relaxed(0, sfp->base + JH7110_AON_GPIOIC); 122 + writel_relaxed(0x0f, sfp->base + JH7110_AON_GPIOIC); 123 + /* enable GPIO interrupts */ 124 + writel_relaxed(1, sfp->base + JH7110_AON_GPIOEN); 125 + return 0; 126 + } 127 + 128 + static const struct jh7110_gpio_irq_reg jh7110_aon_irq_reg = { 129 + .is_reg_base = JH7110_AON_GPIOIS, 130 + .ic_reg_base = JH7110_AON_GPIOIC, 131 + .ibe_reg_base = JH7110_AON_GPIOIBE, 132 + .iev_reg_base = JH7110_AON_GPIOIEV, 133 + .ie_reg_base = JH7110_AON_GPIOIE, 134 + .ris_reg_base = JH7110_AON_GPIORIS, 135 + .mis_reg_base = JH7110_AON_GPIOMIS, 136 + }; 137 + 138 + static const struct jh7110_pinctrl_soc_info jh7110_aon_pinctrl_info = { 139 + .pins = jh7110_aon_pins, 140 + .npins = ARRAY_SIZE(jh7110_aon_pins), 141 + .ngpios = JH7110_AON_NGPIO, 142 + .gc_base = JH7110_AON_GC_BASE, 143 + .dout_reg_base = JH7110_AON_DOUT, 144 + .dout_mask = GENMASK(3, 0), 145 + .doen_reg_base = JH7110_AON_DOEN, 146 + .doen_mask = GENMASK(2, 0), 147 + .gpi_reg_base = JH7110_AON_GPI, 148 + .gpi_mask = GENMASK(3, 0), 149 + .gpioin_reg_base = JH7110_AON_GPIOIN, 150 + .irq_reg = &jh7110_aon_irq_reg, 151 + .jh7110_set_one_pin_mux = jh7110_aon_set_one_pin_mux, 152 + .jh7110_get_padcfg_base = jh7110_aon_get_padcfg_base, 153 + .jh7110_gpio_irq_handler = jh7110_aon_irq_handler, 154 + .jh7110_gpio_init_hw = jh7110_aon_init_hw, 155 + }; 156 + 157 + static const struct of_device_id jh7110_aon_pinctrl_of_match[] = { 158 + { 159 + .compatible = "starfive,jh7110-aon-pinctrl", 160 + .data = &jh7110_aon_pinctrl_info, 161 + }, 162 + { /* sentinel */ } 163 + }; 164 + MODULE_DEVICE_TABLE(of, jh7110_aon_pinctrl_of_match); 165 + 166 + static struct platform_driver jh7110_aon_pinctrl_driver = { 167 + .probe = jh7110_pinctrl_probe, 168 + .driver = { 169 + .name = "starfive-jh7110-aon-pinctrl", 170 + .of_match_table = jh7110_aon_pinctrl_of_match, 171 + }, 172 + }; 173 + module_platform_driver(jh7110_aon_pinctrl_driver); 174 + 175 + MODULE_DESCRIPTION("Pinctrl driver for the StarFive JH7110 SoC aon controller"); 176 + MODULE_AUTHOR("Jianlong Huang <jianlong.huang@starfivetech.com>"); 177 + MODULE_LICENSE("GPL");
+449
drivers/pinctrl/starfive/pinctrl-starfive-jh7110-sys.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Pinctrl / GPIO driver for StarFive JH7110 SoC sys controller 4 + * 5 + * Copyright (C) 2022 Emil Renner Berthing <kernel@esmil.dk> 6 + * Copyright (C) 2022 StarFive Technology Co., Ltd. 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/clk.h> 11 + #include <linux/gpio/driver.h> 12 + #include <linux/io.h> 13 + #include <linux/mod_devicetable.h> 14 + #include <linux/module.h> 15 + #include <linux/mutex.h> 16 + #include <linux/of.h> 17 + #include <linux/of_device.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/reset.h> 20 + #include <linux/spinlock.h> 21 + 22 + #include <linux/pinctrl/pinctrl.h> 23 + #include <linux/pinctrl/pinmux.h> 24 + 25 + #include <dt-bindings/pinctrl/starfive,jh7110-pinctrl.h> 26 + 27 + #include "../core.h" 28 + #include "../pinctrl-utils.h" 29 + #include "../pinmux.h" 30 + #include "../pinconf.h" 31 + #include "pinctrl-starfive-jh7110.h" 32 + 33 + #define JH7110_SYS_NGPIO 64 34 + #define JH7110_SYS_GC_BASE 0 35 + 36 + /* registers */ 37 + #define JH7110_SYS_DOEN 0x000 38 + #define JH7110_SYS_DOUT 0x040 39 + #define JH7110_SYS_GPI 0x080 40 + #define JH7110_SYS_GPIOIN 0x118 41 + 42 + #define JH7110_SYS_GPIOEN 0x0dc 43 + #define JH7110_SYS_GPIOIS0 0x0e0 44 + #define JH7110_SYS_GPIOIS1 0x0e4 45 + #define JH7110_SYS_GPIOIC0 0x0e8 46 + #define JH7110_SYS_GPIOIC1 0x0ec 47 + #define JH7110_SYS_GPIOIBE0 0x0f0 48 + #define JH7110_SYS_GPIOIBE1 0x0f4 49 + #define JH7110_SYS_GPIOIEV0 0x0f8 50 + #define JH7110_SYS_GPIOIEV1 0x0fc 51 + #define JH7110_SYS_GPIOIE0 0x100 52 + #define JH7110_SYS_GPIOIE1 0x104 53 + #define JH7110_SYS_GPIORIS0 0x108 54 + #define JH7110_SYS_GPIORIS1 0x10c 55 + #define JH7110_SYS_GPIOMIS0 0x110 56 + #define JH7110_SYS_GPIOMIS1 0x114 57 + 58 + #define JH7110_SYS_GPO_PDA_0_74_CFG 0x120 59 + #define JH7110_SYS_GPO_PDA_89_94_CFG 0x284 60 + 61 + static const struct pinctrl_pin_desc jh7110_sys_pins[] = { 62 + PINCTRL_PIN(PAD_GPIO0, "GPIO0"), 63 + PINCTRL_PIN(PAD_GPIO1, "GPIO1"), 64 + PINCTRL_PIN(PAD_GPIO2, "GPIO2"), 65 + PINCTRL_PIN(PAD_GPIO3, "GPIO3"), 66 + PINCTRL_PIN(PAD_GPIO4, "GPIO4"), 67 + PINCTRL_PIN(PAD_GPIO5, "GPIO5"), 68 + PINCTRL_PIN(PAD_GPIO6, "GPIO6"), 69 + PINCTRL_PIN(PAD_GPIO7, "GPIO7"), 70 + PINCTRL_PIN(PAD_GPIO8, "GPIO8"), 71 + PINCTRL_PIN(PAD_GPIO9, "GPIO9"), 72 + PINCTRL_PIN(PAD_GPIO10, "GPIO10"), 73 + PINCTRL_PIN(PAD_GPIO11, "GPIO11"), 74 + PINCTRL_PIN(PAD_GPIO12, "GPIO12"), 75 + PINCTRL_PIN(PAD_GPIO13, "GPIO13"), 76 + PINCTRL_PIN(PAD_GPIO14, "GPIO14"), 77 + PINCTRL_PIN(PAD_GPIO15, "GPIO15"), 78 + PINCTRL_PIN(PAD_GPIO16, "GPIO16"), 79 + PINCTRL_PIN(PAD_GPIO17, "GPIO17"), 80 + PINCTRL_PIN(PAD_GPIO18, "GPIO18"), 81 + PINCTRL_PIN(PAD_GPIO19, "GPIO19"), 82 + PINCTRL_PIN(PAD_GPIO20, "GPIO20"), 83 + PINCTRL_PIN(PAD_GPIO21, "GPIO21"), 84 + PINCTRL_PIN(PAD_GPIO22, "GPIO22"), 85 + PINCTRL_PIN(PAD_GPIO23, "GPIO23"), 86 + PINCTRL_PIN(PAD_GPIO24, "GPIO24"), 87 + PINCTRL_PIN(PAD_GPIO25, "GPIO25"), 88 + PINCTRL_PIN(PAD_GPIO26, "GPIO26"), 89 + PINCTRL_PIN(PAD_GPIO27, "GPIO27"), 90 + PINCTRL_PIN(PAD_GPIO28, "GPIO28"), 91 + PINCTRL_PIN(PAD_GPIO29, "GPIO29"), 92 + PINCTRL_PIN(PAD_GPIO30, "GPIO30"), 93 + PINCTRL_PIN(PAD_GPIO31, "GPIO31"), 94 + PINCTRL_PIN(PAD_GPIO32, "GPIO32"), 95 + PINCTRL_PIN(PAD_GPIO33, "GPIO33"), 96 + PINCTRL_PIN(PAD_GPIO34, "GPIO34"), 97 + PINCTRL_PIN(PAD_GPIO35, "GPIO35"), 98 + PINCTRL_PIN(PAD_GPIO36, "GPIO36"), 99 + PINCTRL_PIN(PAD_GPIO37, "GPIO37"), 100 + PINCTRL_PIN(PAD_GPIO38, "GPIO38"), 101 + PINCTRL_PIN(PAD_GPIO39, "GPIO39"), 102 + PINCTRL_PIN(PAD_GPIO40, "GPIO40"), 103 + PINCTRL_PIN(PAD_GPIO41, "GPIO41"), 104 + PINCTRL_PIN(PAD_GPIO42, "GPIO42"), 105 + PINCTRL_PIN(PAD_GPIO43, "GPIO43"), 106 + PINCTRL_PIN(PAD_GPIO44, "GPIO44"), 107 + PINCTRL_PIN(PAD_GPIO45, "GPIO45"), 108 + PINCTRL_PIN(PAD_GPIO46, "GPIO46"), 109 + PINCTRL_PIN(PAD_GPIO47, "GPIO47"), 110 + PINCTRL_PIN(PAD_GPIO48, "GPIO48"), 111 + PINCTRL_PIN(PAD_GPIO49, "GPIO49"), 112 + PINCTRL_PIN(PAD_GPIO50, "GPIO50"), 113 + PINCTRL_PIN(PAD_GPIO51, "GPIO51"), 114 + PINCTRL_PIN(PAD_GPIO52, "GPIO52"), 115 + PINCTRL_PIN(PAD_GPIO53, "GPIO53"), 116 + PINCTRL_PIN(PAD_GPIO54, "GPIO54"), 117 + PINCTRL_PIN(PAD_GPIO55, "GPIO55"), 118 + PINCTRL_PIN(PAD_GPIO56, "GPIO56"), 119 + PINCTRL_PIN(PAD_GPIO57, "GPIO57"), 120 + PINCTRL_PIN(PAD_GPIO58, "GPIO58"), 121 + PINCTRL_PIN(PAD_GPIO59, "GPIO59"), 122 + PINCTRL_PIN(PAD_GPIO60, "GPIO60"), 123 + PINCTRL_PIN(PAD_GPIO61, "GPIO61"), 124 + PINCTRL_PIN(PAD_GPIO62, "GPIO62"), 125 + PINCTRL_PIN(PAD_GPIO63, "GPIO63"), 126 + PINCTRL_PIN(PAD_SD0_CLK, "SD0_CLK"), 127 + PINCTRL_PIN(PAD_SD0_CMD, "SD0_CMD"), 128 + PINCTRL_PIN(PAD_SD0_DATA0, "SD0_DATA0"), 129 + PINCTRL_PIN(PAD_SD0_DATA1, "SD0_DATA1"), 130 + PINCTRL_PIN(PAD_SD0_DATA2, "SD0_DATA2"), 131 + PINCTRL_PIN(PAD_SD0_DATA3, "SD0_DATA3"), 132 + PINCTRL_PIN(PAD_SD0_DATA4, "SD0_DATA4"), 133 + PINCTRL_PIN(PAD_SD0_DATA5, "SD0_DATA5"), 134 + PINCTRL_PIN(PAD_SD0_DATA6, "SD0_DATA6"), 135 + PINCTRL_PIN(PAD_SD0_DATA7, "SD0_DATA7"), 136 + PINCTRL_PIN(PAD_SD0_STRB, "SD0_STRB"), 137 + PINCTRL_PIN(PAD_GMAC1_MDC, "GMAC1_MDC"), 138 + PINCTRL_PIN(PAD_GMAC1_MDIO, "GMAC1_MDIO"), 139 + PINCTRL_PIN(PAD_GMAC1_RXD0, "GMAC1_RXD0"), 140 + PINCTRL_PIN(PAD_GMAC1_RXD1, "GMAC1_RXD1"), 141 + PINCTRL_PIN(PAD_GMAC1_RXD2, "GMAC1_RXD2"), 142 + PINCTRL_PIN(PAD_GMAC1_RXD3, "GMAC1_RXD3"), 143 + PINCTRL_PIN(PAD_GMAC1_RXDV, "GMAC1_RXDV"), 144 + PINCTRL_PIN(PAD_GMAC1_RXC, "GMAC1_RXC"), 145 + PINCTRL_PIN(PAD_GMAC1_TXD0, "GMAC1_TXD0"), 146 + PINCTRL_PIN(PAD_GMAC1_TXD1, "GMAC1_TXD1"), 147 + PINCTRL_PIN(PAD_GMAC1_TXD2, "GMAC1_TXD2"), 148 + PINCTRL_PIN(PAD_GMAC1_TXD3, "GMAC1_TXD3"), 149 + PINCTRL_PIN(PAD_GMAC1_TXEN, "GMAC1_TXEN"), 150 + PINCTRL_PIN(PAD_GMAC1_TXC, "GMAC1_TXC"), 151 + PINCTRL_PIN(PAD_QSPI_SCLK, "QSPI_SCLK"), 152 + PINCTRL_PIN(PAD_QSPI_CS0, "QSPI_CS0"), 153 + PINCTRL_PIN(PAD_QSPI_DATA0, "QSPI_DATA0"), 154 + PINCTRL_PIN(PAD_QSPI_DATA1, "QSPI_DATA1"), 155 + PINCTRL_PIN(PAD_QSPI_DATA2, "QSPI_DATA2"), 156 + PINCTRL_PIN(PAD_QSPI_DATA3, "QSPI_DATA3"), 157 + }; 158 + 159 + struct jh7110_func_sel { 160 + u16 offset; 161 + u8 shift; 162 + u8 max; 163 + }; 164 + 165 + static const struct jh7110_func_sel 166 + jh7110_sys_func_sel[ARRAY_SIZE(jh7110_sys_pins)] = { 167 + [PAD_GMAC1_RXC] = { 0x29c, 0, 1 }, 168 + [PAD_GPIO10] = { 0x29c, 2, 3 }, 169 + [PAD_GPIO11] = { 0x29c, 5, 3 }, 170 + [PAD_GPIO12] = { 0x29c, 8, 3 }, 171 + [PAD_GPIO13] = { 0x29c, 11, 3 }, 172 + [PAD_GPIO14] = { 0x29c, 14, 3 }, 173 + [PAD_GPIO15] = { 0x29c, 17, 3 }, 174 + [PAD_GPIO16] = { 0x29c, 20, 3 }, 175 + [PAD_GPIO17] = { 0x29c, 23, 3 }, 176 + [PAD_GPIO18] = { 0x29c, 26, 3 }, 177 + [PAD_GPIO19] = { 0x29c, 29, 3 }, 178 + 179 + [PAD_GPIO20] = { 0x2a0, 0, 3 }, 180 + [PAD_GPIO21] = { 0x2a0, 3, 3 }, 181 + [PAD_GPIO22] = { 0x2a0, 6, 3 }, 182 + [PAD_GPIO23] = { 0x2a0, 9, 3 }, 183 + [PAD_GPIO24] = { 0x2a0, 12, 3 }, 184 + [PAD_GPIO25] = { 0x2a0, 15, 3 }, 185 + [PAD_GPIO26] = { 0x2a0, 18, 3 }, 186 + [PAD_GPIO27] = { 0x2a0, 21, 3 }, 187 + [PAD_GPIO28] = { 0x2a0, 24, 3 }, 188 + [PAD_GPIO29] = { 0x2a0, 27, 3 }, 189 + 190 + [PAD_GPIO30] = { 0x2a4, 0, 3 }, 191 + [PAD_GPIO31] = { 0x2a4, 3, 3 }, 192 + [PAD_GPIO32] = { 0x2a4, 6, 3 }, 193 + [PAD_GPIO33] = { 0x2a4, 9, 3 }, 194 + [PAD_GPIO34] = { 0x2a4, 12, 3 }, 195 + [PAD_GPIO35] = { 0x2a4, 15, 3 }, 196 + [PAD_GPIO36] = { 0x2a4, 17, 3 }, 197 + [PAD_GPIO37] = { 0x2a4, 20, 3 }, 198 + [PAD_GPIO38] = { 0x2a4, 23, 3 }, 199 + [PAD_GPIO39] = { 0x2a4, 26, 3 }, 200 + [PAD_GPIO40] = { 0x2a4, 29, 3 }, 201 + 202 + [PAD_GPIO41] = { 0x2a8, 0, 3 }, 203 + [PAD_GPIO42] = { 0x2a8, 3, 3 }, 204 + [PAD_GPIO43] = { 0x2a8, 6, 3 }, 205 + [PAD_GPIO44] = { 0x2a8, 9, 3 }, 206 + [PAD_GPIO45] = { 0x2a8, 12, 3 }, 207 + [PAD_GPIO46] = { 0x2a8, 15, 3 }, 208 + [PAD_GPIO47] = { 0x2a8, 18, 3 }, 209 + [PAD_GPIO48] = { 0x2a8, 21, 3 }, 210 + [PAD_GPIO49] = { 0x2a8, 24, 3 }, 211 + [PAD_GPIO50] = { 0x2a8, 27, 3 }, 212 + [PAD_GPIO51] = { 0x2a8, 30, 3 }, 213 + 214 + [PAD_GPIO52] = { 0x2ac, 0, 3 }, 215 + [PAD_GPIO53] = { 0x2ac, 2, 3 }, 216 + [PAD_GPIO54] = { 0x2ac, 4, 3 }, 217 + [PAD_GPIO55] = { 0x2ac, 6, 3 }, 218 + [PAD_GPIO56] = { 0x2ac, 9, 3 }, 219 + [PAD_GPIO57] = { 0x2ac, 12, 3 }, 220 + [PAD_GPIO58] = { 0x2ac, 15, 3 }, 221 + [PAD_GPIO59] = { 0x2ac, 18, 3 }, 222 + [PAD_GPIO60] = { 0x2ac, 21, 3 }, 223 + [PAD_GPIO61] = { 0x2ac, 24, 3 }, 224 + [PAD_GPIO62] = { 0x2ac, 27, 3 }, 225 + [PAD_GPIO63] = { 0x2ac, 30, 3 }, 226 + 227 + [PAD_GPIO6] = { 0x2b0, 0, 3 }, 228 + [PAD_GPIO7] = { 0x2b0, 2, 3 }, 229 + [PAD_GPIO8] = { 0x2b0, 5, 3 }, 230 + [PAD_GPIO9] = { 0x2b0, 8, 3 }, 231 + }; 232 + 233 + struct jh7110_vin_group_sel { 234 + u16 offset; 235 + u8 shift; 236 + u8 group; 237 + }; 238 + 239 + static const struct jh7110_vin_group_sel 240 + jh7110_sys_vin_group_sel[ARRAY_SIZE(jh7110_sys_pins)] = { 241 + [PAD_GPIO6] = { 0x2b4, 21, 0 }, 242 + [PAD_GPIO7] = { 0x2b4, 18, 0 }, 243 + [PAD_GPIO8] = { 0x2b4, 15, 0 }, 244 + [PAD_GPIO9] = { 0x2b0, 11, 0 }, 245 + [PAD_GPIO10] = { 0x2b0, 20, 0 }, 246 + [PAD_GPIO11] = { 0x2b0, 23, 0 }, 247 + [PAD_GPIO12] = { 0x2b0, 26, 0 }, 248 + [PAD_GPIO13] = { 0x2b0, 29, 0 }, 249 + [PAD_GPIO14] = { 0x2b4, 0, 0 }, 250 + [PAD_GPIO15] = { 0x2b4, 3, 0 }, 251 + [PAD_GPIO16] = { 0x2b4, 6, 0 }, 252 + [PAD_GPIO17] = { 0x2b4, 9, 0 }, 253 + [PAD_GPIO18] = { 0x2b4, 12, 0 }, 254 + [PAD_GPIO19] = { 0x2b0, 14, 0 }, 255 + [PAD_GPIO20] = { 0x2b0, 17, 0 }, 256 + 257 + [PAD_GPIO21] = { 0x2b4, 21, 1 }, 258 + [PAD_GPIO22] = { 0x2b4, 18, 1 }, 259 + [PAD_GPIO23] = { 0x2b4, 15, 1 }, 260 + [PAD_GPIO24] = { 0x2b0, 11, 1 }, 261 + [PAD_GPIO25] = { 0x2b0, 20, 1 }, 262 + [PAD_GPIO26] = { 0x2b0, 23, 1 }, 263 + [PAD_GPIO27] = { 0x2b0, 26, 1 }, 264 + [PAD_GPIO28] = { 0x2b0, 29, 1 }, 265 + [PAD_GPIO29] = { 0x2b4, 0, 1 }, 266 + [PAD_GPIO30] = { 0x2b4, 3, 1 }, 267 + [PAD_GPIO31] = { 0x2b4, 6, 1 }, 268 + [PAD_GPIO32] = { 0x2b4, 9, 1 }, 269 + [PAD_GPIO33] = { 0x2b4, 12, 1 }, 270 + [PAD_GPIO34] = { 0x2b0, 14, 1 }, 271 + [PAD_GPIO35] = { 0x2b0, 17, 1 }, 272 + 273 + [PAD_GPIO36] = { 0x2b4, 21, 2 }, 274 + [PAD_GPIO37] = { 0x2b4, 18, 2 }, 275 + [PAD_GPIO38] = { 0x2b4, 15, 2 }, 276 + [PAD_GPIO39] = { 0x2b0, 11, 2 }, 277 + [PAD_GPIO40] = { 0x2b0, 20, 2 }, 278 + [PAD_GPIO41] = { 0x2b0, 23, 2 }, 279 + [PAD_GPIO42] = { 0x2b0, 26, 2 }, 280 + [PAD_GPIO43] = { 0x2b0, 29, 2 }, 281 + [PAD_GPIO44] = { 0x2b4, 0, 2 }, 282 + [PAD_GPIO45] = { 0x2b4, 3, 2 }, 283 + [PAD_GPIO46] = { 0x2b4, 6, 2 }, 284 + [PAD_GPIO47] = { 0x2b4, 9, 2 }, 285 + [PAD_GPIO48] = { 0x2b4, 12, 2 }, 286 + [PAD_GPIO49] = { 0x2b0, 14, 2 }, 287 + [PAD_GPIO50] = { 0x2b0, 17, 2 }, 288 + }; 289 + 290 + static void jh7110_set_function(struct jh7110_pinctrl *sfp, 291 + unsigned int pin, u32 func) 292 + { 293 + const struct jh7110_func_sel *fs = &jh7110_sys_func_sel[pin]; 294 + unsigned long flags; 295 + void __iomem *reg; 296 + u32 mask; 297 + 298 + if (!fs->offset) 299 + return; 300 + 301 + if (func > fs->max) 302 + return; 303 + 304 + reg = sfp->base + fs->offset; 305 + func = func << fs->shift; 306 + mask = 0x3U << fs->shift; 307 + 308 + raw_spin_lock_irqsave(&sfp->lock, flags); 309 + func |= readl_relaxed(reg) & ~mask; 310 + writel_relaxed(func, reg); 311 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 312 + } 313 + 314 + static void jh7110_set_vin_group(struct jh7110_pinctrl *sfp, 315 + unsigned int pin) 316 + { 317 + const struct jh7110_vin_group_sel *gs = &jh7110_sys_vin_group_sel[pin]; 318 + unsigned long flags; 319 + void __iomem *reg; 320 + u32 mask; 321 + u32 grp; 322 + 323 + if (!gs->offset) 324 + return; 325 + 326 + reg = sfp->base + gs->offset; 327 + grp = gs->group << gs->shift; 328 + mask = 0x3U << gs->shift; 329 + 330 + raw_spin_lock_irqsave(&sfp->lock, flags); 331 + grp |= readl_relaxed(reg) & ~mask; 332 + writel_relaxed(grp, reg); 333 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 334 + } 335 + 336 + static int jh7110_sys_set_one_pin_mux(struct jh7110_pinctrl *sfp, 337 + unsigned int pin, 338 + unsigned int din, u32 dout, 339 + u32 doen, u32 func) 340 + { 341 + if (pin < sfp->gc.ngpio && func == 0) 342 + jh7110_set_gpiomux(sfp, pin, din, dout, doen); 343 + 344 + jh7110_set_function(sfp, pin, func); 345 + 346 + if (pin < sfp->gc.ngpio && func == 2) 347 + jh7110_set_vin_group(sfp, pin); 348 + 349 + return 0; 350 + } 351 + 352 + static int jh7110_sys_get_padcfg_base(struct jh7110_pinctrl *sfp, 353 + unsigned int pin) 354 + { 355 + if (pin < PAD_GMAC1_MDC) 356 + return JH7110_SYS_GPO_PDA_0_74_CFG; 357 + else if (pin > PAD_GMAC1_TXC && pin <= PAD_QSPI_DATA3) 358 + return JH7110_SYS_GPO_PDA_89_94_CFG; 359 + else 360 + return -1; 361 + } 362 + 363 + static void jh7110_sys_irq_handler(struct irq_desc *desc) 364 + { 365 + struct jh7110_pinctrl *sfp = jh7110_from_irq_desc(desc); 366 + struct irq_chip *chip = irq_desc_get_chip(desc); 367 + unsigned long mis; 368 + unsigned int pin; 369 + 370 + chained_irq_enter(chip, desc); 371 + 372 + mis = readl_relaxed(sfp->base + JH7110_SYS_GPIOMIS0); 373 + for_each_set_bit(pin, &mis, 32) 374 + generic_handle_domain_irq(sfp->gc.irq.domain, pin); 375 + 376 + mis = readl_relaxed(sfp->base + JH7110_SYS_GPIOMIS1); 377 + for_each_set_bit(pin, &mis, 32) 378 + generic_handle_domain_irq(sfp->gc.irq.domain, pin + 32); 379 + 380 + chained_irq_exit(chip, desc); 381 + } 382 + 383 + static int jh7110_sys_init_hw(struct gpio_chip *gc) 384 + { 385 + struct jh7110_pinctrl *sfp = container_of(gc, 386 + struct jh7110_pinctrl, gc); 387 + 388 + /* mask all GPIO interrupts */ 389 + writel(0U, sfp->base + JH7110_SYS_GPIOIE0); 390 + writel(0U, sfp->base + JH7110_SYS_GPIOIE1); 391 + /* clear edge interrupt flags */ 392 + writel(~0U, sfp->base + JH7110_SYS_GPIOIC0); 393 + writel(~0U, sfp->base + JH7110_SYS_GPIOIC1); 394 + /* enable GPIO interrupts */ 395 + writel(1U, sfp->base + JH7110_SYS_GPIOEN); 396 + return 0; 397 + } 398 + 399 + static const struct jh7110_gpio_irq_reg jh7110_sys_irq_reg = { 400 + .is_reg_base = JH7110_SYS_GPIOIS0, 401 + .ic_reg_base = JH7110_SYS_GPIOIC0, 402 + .ibe_reg_base = JH7110_SYS_GPIOIBE0, 403 + .iev_reg_base = JH7110_SYS_GPIOIEV0, 404 + .ie_reg_base = JH7110_SYS_GPIOIE0, 405 + .ris_reg_base = JH7110_SYS_GPIORIS0, 406 + .mis_reg_base = JH7110_SYS_GPIOMIS0, 407 + }; 408 + 409 + static const struct jh7110_pinctrl_soc_info jh7110_sys_pinctrl_info = { 410 + .pins = jh7110_sys_pins, 411 + .npins = ARRAY_SIZE(jh7110_sys_pins), 412 + .ngpios = JH7110_SYS_NGPIO, 413 + .gc_base = JH7110_SYS_GC_BASE, 414 + .dout_reg_base = JH7110_SYS_DOUT, 415 + .dout_mask = GENMASK(6, 0), 416 + .doen_reg_base = JH7110_SYS_DOEN, 417 + .doen_mask = GENMASK(5, 0), 418 + .gpi_reg_base = JH7110_SYS_GPI, 419 + .gpi_mask = GENMASK(6, 0), 420 + .gpioin_reg_base = JH7110_SYS_GPIOIN, 421 + .irq_reg = &jh7110_sys_irq_reg, 422 + .jh7110_set_one_pin_mux = jh7110_sys_set_one_pin_mux, 423 + .jh7110_get_padcfg_base = jh7110_sys_get_padcfg_base, 424 + .jh7110_gpio_irq_handler = jh7110_sys_irq_handler, 425 + .jh7110_gpio_init_hw = jh7110_sys_init_hw, 426 + }; 427 + 428 + static const struct of_device_id jh7110_sys_pinctrl_of_match[] = { 429 + { 430 + .compatible = "starfive,jh7110-sys-pinctrl", 431 + .data = &jh7110_sys_pinctrl_info, 432 + }, 433 + { /* sentinel */ } 434 + }; 435 + MODULE_DEVICE_TABLE(of, jh7110_sys_pinctrl_of_match); 436 + 437 + static struct platform_driver jh7110_sys_pinctrl_driver = { 438 + .probe = jh7110_pinctrl_probe, 439 + .driver = { 440 + .name = "starfive-jh7110-sys-pinctrl", 441 + .of_match_table = jh7110_sys_pinctrl_of_match, 442 + }, 443 + }; 444 + module_platform_driver(jh7110_sys_pinctrl_driver); 445 + 446 + MODULE_DESCRIPTION("Pinctrl driver for the StarFive JH7110 SoC sys controller"); 447 + MODULE_AUTHOR("Emil Renner Berthing <kernel@esmil.dk>"); 448 + MODULE_AUTHOR("Jianlong Huang <jianlong.huang@starfivetech.com>"); 449 + MODULE_LICENSE("GPL");
+982
drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Pinctrl / GPIO driver for StarFive JH7110 SoC 4 + * 5 + * Copyright (C) 2022 Emil Renner Berthing <kernel@esmil.dk> 6 + * Copyright (C) 2022 StarFive Technology Co., Ltd. 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/clk.h> 11 + #include <linux/gpio/driver.h> 12 + #include <linux/io.h> 13 + #include <linux/mod_devicetable.h> 14 + #include <linux/module.h> 15 + #include <linux/mutex.h> 16 + #include <linux/of.h> 17 + #include <linux/of_device.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/reset.h> 20 + #include <linux/seq_file.h> 21 + #include <linux/spinlock.h> 22 + 23 + #include <linux/pinctrl/consumer.h> 24 + #include <linux/pinctrl/pinconf.h> 25 + #include <linux/pinctrl/pinctrl.h> 26 + #include <linux/pinctrl/pinmux.h> 27 + 28 + #include <dt-bindings/pinctrl/starfive,jh7110-pinctrl.h> 29 + 30 + #include "../core.h" 31 + #include "../pinctrl-utils.h" 32 + #include "../pinmux.h" 33 + #include "../pinconf.h" 34 + #include "pinctrl-starfive-jh7110.h" 35 + 36 + /* pad control bits */ 37 + #define JH7110_PADCFG_POS BIT(7) 38 + #define JH7110_PADCFG_SMT BIT(6) 39 + #define JH7110_PADCFG_SLEW BIT(5) 40 + #define JH7110_PADCFG_PD BIT(4) 41 + #define JH7110_PADCFG_PU BIT(3) 42 + #define JH7110_PADCFG_BIAS (JH7110_PADCFG_PD | JH7110_PADCFG_PU) 43 + #define JH7110_PADCFG_DS_MASK GENMASK(2, 1) 44 + #define JH7110_PADCFG_DS_2MA (0U << 1) 45 + #define JH7110_PADCFG_DS_4MA BIT(1) 46 + #define JH7110_PADCFG_DS_8MA (2U << 1) 47 + #define JH7110_PADCFG_DS_12MA (3U << 1) 48 + #define JH7110_PADCFG_IE BIT(0) 49 + 50 + /* 51 + * The packed pinmux values from the device tree look like this: 52 + * 53 + * | 31 - 24 | 23 - 16 | 15 - 10 | 9 - 8 | 7 - 0 | 54 + * | din | dout | doen | function | pin | 55 + */ 56 + static unsigned int jh7110_pinmux_din(u32 v) 57 + { 58 + return (v & GENMASK(31, 24)) >> 24; 59 + } 60 + 61 + static u32 jh7110_pinmux_dout(u32 v) 62 + { 63 + return (v & GENMASK(23, 16)) >> 16; 64 + } 65 + 66 + static u32 jh7110_pinmux_doen(u32 v) 67 + { 68 + return (v & GENMASK(15, 10)) >> 10; 69 + } 70 + 71 + static u32 jh7110_pinmux_function(u32 v) 72 + { 73 + return (v & GENMASK(9, 8)) >> 8; 74 + } 75 + 76 + static unsigned int jh7110_pinmux_pin(u32 v) 77 + { 78 + return v & GENMASK(7, 0); 79 + } 80 + 81 + static struct jh7110_pinctrl *jh7110_from_irq_data(struct irq_data *d) 82 + { 83 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 84 + 85 + return container_of(gc, struct jh7110_pinctrl, gc); 86 + } 87 + 88 + struct jh7110_pinctrl *jh7110_from_irq_desc(struct irq_desc *desc) 89 + { 90 + struct gpio_chip *gc = irq_desc_get_handler_data(desc); 91 + 92 + return container_of(gc, struct jh7110_pinctrl, gc); 93 + } 94 + EXPORT_SYMBOL_GPL(jh7110_from_irq_desc); 95 + 96 + #ifdef CONFIG_DEBUG_FS 97 + static void jh7110_pin_dbg_show(struct pinctrl_dev *pctldev, 98 + struct seq_file *s, unsigned int pin) 99 + { 100 + struct jh7110_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev); 101 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 102 + 103 + seq_printf(s, "%s", dev_name(pctldev->dev)); 104 + 105 + if (pin < sfp->gc.ngpio) { 106 + unsigned int offset = 4 * (pin / 4); 107 + unsigned int shift = 8 * (pin % 4); 108 + u32 dout = readl_relaxed(sfp->base + info->dout_reg_base + offset); 109 + u32 doen = readl_relaxed(sfp->base + info->doen_reg_base + offset); 110 + u32 gpi = readl_relaxed(sfp->base + info->gpi_reg_base + offset); 111 + 112 + dout = (dout >> shift) & info->dout_mask; 113 + doen = (doen >> shift) & info->doen_mask; 114 + gpi = ((gpi >> shift) - 2) & info->gpi_mask; 115 + 116 + seq_printf(s, " dout=%u doen=%u din=%u", dout, doen, gpi); 117 + } 118 + } 119 + #else 120 + #define jh7110_pin_dbg_show NULL 121 + #endif 122 + 123 + static int jh7110_dt_node_to_map(struct pinctrl_dev *pctldev, 124 + struct device_node *np, 125 + struct pinctrl_map **maps, 126 + unsigned int *num_maps) 127 + { 128 + struct jh7110_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev); 129 + struct device *dev = sfp->gc.parent; 130 + struct device_node *child; 131 + struct pinctrl_map *map; 132 + const char **pgnames; 133 + const char *grpname; 134 + int ngroups; 135 + int nmaps; 136 + int ret; 137 + 138 + ngroups = 0; 139 + for_each_child_of_node(np, child) 140 + ngroups += 1; 141 + nmaps = 2 * ngroups; 142 + 143 + pgnames = devm_kcalloc(dev, ngroups, sizeof(*pgnames), GFP_KERNEL); 144 + if (!pgnames) 145 + return -ENOMEM; 146 + 147 + map = kcalloc(nmaps, sizeof(*map), GFP_KERNEL); 148 + if (!map) 149 + return -ENOMEM; 150 + 151 + nmaps = 0; 152 + ngroups = 0; 153 + mutex_lock(&sfp->mutex); 154 + for_each_child_of_node(np, child) { 155 + int npins = of_property_count_u32_elems(child, "pinmux"); 156 + int *pins; 157 + u32 *pinmux; 158 + int i; 159 + 160 + if (npins < 1) { 161 + dev_err(dev, 162 + "invalid pinctrl group %pOFn.%pOFn: pinmux not set\n", 163 + np, child); 164 + ret = -EINVAL; 165 + goto put_child; 166 + } 167 + 168 + grpname = devm_kasprintf(dev, GFP_KERNEL, "%pOFn.%pOFn", np, child); 169 + if (!grpname) { 170 + ret = -ENOMEM; 171 + goto put_child; 172 + } 173 + 174 + pgnames[ngroups++] = grpname; 175 + 176 + pins = devm_kcalloc(dev, npins, sizeof(*pins), GFP_KERNEL); 177 + if (!pins) { 178 + ret = -ENOMEM; 179 + goto put_child; 180 + } 181 + 182 + pinmux = devm_kcalloc(dev, npins, sizeof(*pinmux), GFP_KERNEL); 183 + if (!pinmux) { 184 + ret = -ENOMEM; 185 + goto put_child; 186 + } 187 + 188 + ret = of_property_read_u32_array(child, "pinmux", pinmux, npins); 189 + if (ret) 190 + goto put_child; 191 + 192 + for (i = 0; i < npins; i++) 193 + pins[i] = jh7110_pinmux_pin(pinmux[i]); 194 + 195 + map[nmaps].type = PIN_MAP_TYPE_MUX_GROUP; 196 + map[nmaps].data.mux.function = np->name; 197 + map[nmaps].data.mux.group = grpname; 198 + nmaps += 1; 199 + 200 + ret = pinctrl_generic_add_group(pctldev, grpname, 201 + pins, npins, pinmux); 202 + if (ret < 0) { 203 + dev_err(dev, "error adding group %s: %d\n", grpname, ret); 204 + goto put_child; 205 + } 206 + 207 + ret = pinconf_generic_parse_dt_config(child, pctldev, 208 + &map[nmaps].data.configs.configs, 209 + &map[nmaps].data.configs.num_configs); 210 + if (ret) { 211 + dev_err(dev, "error parsing pin config of group %s: %d\n", 212 + grpname, ret); 213 + goto put_child; 214 + } 215 + 216 + /* don't create a map if there are no pinconf settings */ 217 + if (map[nmaps].data.configs.num_configs == 0) 218 + continue; 219 + 220 + map[nmaps].type = PIN_MAP_TYPE_CONFIGS_GROUP; 221 + map[nmaps].data.configs.group_or_pin = grpname; 222 + nmaps += 1; 223 + } 224 + 225 + ret = pinmux_generic_add_function(pctldev, np->name, 226 + pgnames, ngroups, NULL); 227 + if (ret < 0) { 228 + dev_err(dev, "error adding function %s: %d\n", np->name, ret); 229 + goto free_map; 230 + } 231 + mutex_unlock(&sfp->mutex); 232 + 233 + *maps = map; 234 + *num_maps = nmaps; 235 + return 0; 236 + 237 + put_child: 238 + of_node_put(child); 239 + free_map: 240 + pinctrl_utils_free_map(pctldev, map, nmaps); 241 + mutex_unlock(&sfp->mutex); 242 + return ret; 243 + } 244 + 245 + static const struct pinctrl_ops jh7110_pinctrl_ops = { 246 + .get_groups_count = pinctrl_generic_get_group_count, 247 + .get_group_name = pinctrl_generic_get_group_name, 248 + .get_group_pins = pinctrl_generic_get_group_pins, 249 + .pin_dbg_show = jh7110_pin_dbg_show, 250 + .dt_node_to_map = jh7110_dt_node_to_map, 251 + .dt_free_map = pinctrl_utils_free_map, 252 + }; 253 + 254 + void jh7110_set_gpiomux(struct jh7110_pinctrl *sfp, unsigned int pin, 255 + unsigned int din, u32 dout, u32 doen) 256 + { 257 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 258 + 259 + unsigned int offset = 4 * (pin / 4); 260 + unsigned int shift = 8 * (pin % 4); 261 + u32 dout_mask = info->dout_mask << shift; 262 + u32 done_mask = info->doen_mask << shift; 263 + u32 ival, imask; 264 + void __iomem *reg_dout; 265 + void __iomem *reg_doen; 266 + void __iomem *reg_din; 267 + unsigned long flags; 268 + 269 + reg_dout = sfp->base + info->dout_reg_base + offset; 270 + reg_doen = sfp->base + info->doen_reg_base + offset; 271 + dout <<= shift; 272 + doen <<= shift; 273 + if (din != GPI_NONE) { 274 + unsigned int ioffset = 4 * (din / 4); 275 + unsigned int ishift = 8 * (din % 4); 276 + 277 + reg_din = sfp->base + info->gpi_reg_base + ioffset; 278 + ival = (pin + 2) << ishift; 279 + imask = info->gpi_mask << ishift; 280 + } else { 281 + reg_din = NULL; 282 + } 283 + 284 + raw_spin_lock_irqsave(&sfp->lock, flags); 285 + dout |= readl_relaxed(reg_dout) & ~dout_mask; 286 + writel_relaxed(dout, reg_dout); 287 + doen |= readl_relaxed(reg_doen) & ~done_mask; 288 + writel_relaxed(doen, reg_doen); 289 + if (reg_din) { 290 + ival |= readl_relaxed(reg_din) & ~imask; 291 + writel_relaxed(ival, reg_din); 292 + } 293 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 294 + } 295 + EXPORT_SYMBOL_GPL(jh7110_set_gpiomux); 296 + 297 + static int jh7110_set_mux(struct pinctrl_dev *pctldev, 298 + unsigned int fsel, unsigned int gsel) 299 + { 300 + struct jh7110_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev); 301 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 302 + const struct group_desc *group; 303 + const u32 *pinmux; 304 + unsigned int i; 305 + 306 + group = pinctrl_generic_get_group(pctldev, gsel); 307 + if (!group) 308 + return -EINVAL; 309 + 310 + pinmux = group->data; 311 + for (i = 0; i < group->num_pins; i++) { 312 + u32 v = pinmux[i]; 313 + 314 + if (info->jh7110_set_one_pin_mux) 315 + info->jh7110_set_one_pin_mux(sfp, 316 + jh7110_pinmux_pin(v), 317 + jh7110_pinmux_din(v), 318 + jh7110_pinmux_dout(v), 319 + jh7110_pinmux_doen(v), 320 + jh7110_pinmux_function(v)); 321 + } 322 + 323 + return 0; 324 + } 325 + 326 + static const struct pinmux_ops jh7110_pinmux_ops = { 327 + .get_functions_count = pinmux_generic_get_function_count, 328 + .get_function_name = pinmux_generic_get_function_name, 329 + .get_function_groups = pinmux_generic_get_function_groups, 330 + .set_mux = jh7110_set_mux, 331 + .strict = true, 332 + }; 333 + 334 + static const u8 jh7110_drive_strength_mA[4] = { 2, 4, 8, 12 }; 335 + 336 + static u32 jh7110_padcfg_ds_to_mA(u32 padcfg) 337 + { 338 + return jh7110_drive_strength_mA[(padcfg >> 1) & 3U]; 339 + } 340 + 341 + static u32 jh7110_padcfg_ds_from_mA(u32 v) 342 + { 343 + int i; 344 + 345 + for (i = 0; i < 3; i++) { 346 + if (v <= jh7110_drive_strength_mA[i]) 347 + break; 348 + } 349 + return i << 1; 350 + } 351 + 352 + static void jh7110_padcfg_rmw(struct jh7110_pinctrl *sfp, 353 + unsigned int pin, u32 mask, u32 value) 354 + { 355 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 356 + void __iomem *reg; 357 + unsigned long flags; 358 + int padcfg_base; 359 + 360 + if (!info->jh7110_get_padcfg_base) 361 + return; 362 + 363 + padcfg_base = info->jh7110_get_padcfg_base(sfp, pin); 364 + if (padcfg_base < 0) 365 + return; 366 + 367 + reg = sfp->base + padcfg_base + 4 * pin; 368 + value &= mask; 369 + 370 + raw_spin_lock_irqsave(&sfp->lock, flags); 371 + value |= readl_relaxed(reg) & ~mask; 372 + writel_relaxed(value, reg); 373 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 374 + } 375 + 376 + static int jh7110_pinconf_get(struct pinctrl_dev *pctldev, 377 + unsigned int pin, unsigned long *config) 378 + { 379 + struct jh7110_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev); 380 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 381 + int param = pinconf_to_config_param(*config); 382 + u32 padcfg, arg; 383 + bool enabled; 384 + int padcfg_base; 385 + 386 + if (!info->jh7110_get_padcfg_base) 387 + return 0; 388 + 389 + padcfg_base = info->jh7110_get_padcfg_base(sfp, pin); 390 + if (padcfg_base < 0) 391 + return 0; 392 + 393 + padcfg = readl_relaxed(sfp->base + padcfg_base + 4 * pin); 394 + switch (param) { 395 + case PIN_CONFIG_BIAS_DISABLE: 396 + enabled = !(padcfg & JH7110_PADCFG_BIAS); 397 + arg = 0; 398 + break; 399 + case PIN_CONFIG_BIAS_PULL_DOWN: 400 + enabled = padcfg & JH7110_PADCFG_PD; 401 + arg = 1; 402 + break; 403 + case PIN_CONFIG_BIAS_PULL_UP: 404 + enabled = padcfg & JH7110_PADCFG_PU; 405 + arg = 1; 406 + break; 407 + case PIN_CONFIG_DRIVE_STRENGTH: 408 + enabled = true; 409 + arg = jh7110_padcfg_ds_to_mA(padcfg); 410 + break; 411 + case PIN_CONFIG_INPUT_ENABLE: 412 + enabled = padcfg & JH7110_PADCFG_IE; 413 + arg = enabled; 414 + break; 415 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 416 + enabled = padcfg & JH7110_PADCFG_SMT; 417 + arg = enabled; 418 + break; 419 + case PIN_CONFIG_SLEW_RATE: 420 + enabled = true; 421 + arg = !!(padcfg & JH7110_PADCFG_SLEW); 422 + break; 423 + default: 424 + return -ENOTSUPP; 425 + } 426 + 427 + *config = pinconf_to_config_packed(param, arg); 428 + return enabled ? 0 : -EINVAL; 429 + } 430 + 431 + static int jh7110_pinconf_group_get(struct pinctrl_dev *pctldev, 432 + unsigned int gsel, 433 + unsigned long *config) 434 + { 435 + const struct group_desc *group; 436 + 437 + group = pinctrl_generic_get_group(pctldev, gsel); 438 + if (!group) 439 + return -EINVAL; 440 + 441 + return jh7110_pinconf_get(pctldev, group->pins[0], config); 442 + } 443 + 444 + static int jh7110_pinconf_group_set(struct pinctrl_dev *pctldev, 445 + unsigned int gsel, 446 + unsigned long *configs, 447 + unsigned int num_configs) 448 + { 449 + struct jh7110_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev); 450 + const struct group_desc *group; 451 + u16 mask, value; 452 + int i; 453 + 454 + group = pinctrl_generic_get_group(pctldev, gsel); 455 + if (!group) 456 + return -EINVAL; 457 + 458 + mask = 0; 459 + value = 0; 460 + for (i = 0; i < num_configs; i++) { 461 + int param = pinconf_to_config_param(configs[i]); 462 + u32 arg = pinconf_to_config_argument(configs[i]); 463 + 464 + switch (param) { 465 + case PIN_CONFIG_BIAS_DISABLE: 466 + mask |= JH7110_PADCFG_BIAS; 467 + value &= ~JH7110_PADCFG_BIAS; 468 + break; 469 + case PIN_CONFIG_BIAS_PULL_DOWN: 470 + if (arg == 0) 471 + return -ENOTSUPP; 472 + mask |= JH7110_PADCFG_BIAS; 473 + value = (value & ~JH7110_PADCFG_BIAS) | JH7110_PADCFG_PD; 474 + break; 475 + case PIN_CONFIG_BIAS_PULL_UP: 476 + if (arg == 0) 477 + return -ENOTSUPP; 478 + mask |= JH7110_PADCFG_BIAS; 479 + value = (value & ~JH7110_PADCFG_BIAS) | JH7110_PADCFG_PU; 480 + break; 481 + case PIN_CONFIG_DRIVE_STRENGTH: 482 + mask |= JH7110_PADCFG_DS_MASK; 483 + value = (value & ~JH7110_PADCFG_DS_MASK) | 484 + jh7110_padcfg_ds_from_mA(arg); 485 + break; 486 + case PIN_CONFIG_INPUT_ENABLE: 487 + mask |= JH7110_PADCFG_IE; 488 + if (arg) 489 + value |= JH7110_PADCFG_IE; 490 + else 491 + value &= ~JH7110_PADCFG_IE; 492 + break; 493 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 494 + mask |= JH7110_PADCFG_SMT; 495 + if (arg) 496 + value |= JH7110_PADCFG_SMT; 497 + else 498 + value &= ~JH7110_PADCFG_SMT; 499 + break; 500 + case PIN_CONFIG_SLEW_RATE: 501 + mask |= JH7110_PADCFG_SLEW; 502 + if (arg) 503 + value |= JH7110_PADCFG_SLEW; 504 + else 505 + value &= ~JH7110_PADCFG_SLEW; 506 + break; 507 + default: 508 + return -ENOTSUPP; 509 + } 510 + } 511 + 512 + for (i = 0; i < group->num_pins; i++) 513 + jh7110_padcfg_rmw(sfp, group->pins[i], mask, value); 514 + 515 + return 0; 516 + } 517 + 518 + #ifdef CONFIG_DEBUG_FS 519 + static void jh7110_pinconf_dbg_show(struct pinctrl_dev *pctldev, 520 + struct seq_file *s, unsigned int pin) 521 + { 522 + struct jh7110_pinctrl *sfp = pinctrl_dev_get_drvdata(pctldev); 523 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 524 + u32 value; 525 + int padcfg_base; 526 + 527 + if (!info->jh7110_get_padcfg_base) 528 + return; 529 + 530 + padcfg_base = info->jh7110_get_padcfg_base(sfp, pin); 531 + if (padcfg_base < 0) 532 + return; 533 + 534 + value = readl_relaxed(sfp->base + padcfg_base + 4 * pin); 535 + seq_printf(s, " (0x%02x)", value); 536 + } 537 + #else 538 + #define jh7110_pinconf_dbg_show NULL 539 + #endif 540 + 541 + static const struct pinconf_ops jh7110_pinconf_ops = { 542 + .pin_config_get = jh7110_pinconf_get, 543 + .pin_config_group_get = jh7110_pinconf_group_get, 544 + .pin_config_group_set = jh7110_pinconf_group_set, 545 + .pin_config_dbg_show = jh7110_pinconf_dbg_show, 546 + .is_generic = true, 547 + }; 548 + 549 + static int jh7110_gpio_request(struct gpio_chip *gc, unsigned int gpio) 550 + { 551 + return pinctrl_gpio_request(gc->base + gpio); 552 + } 553 + 554 + static void jh7110_gpio_free(struct gpio_chip *gc, unsigned int gpio) 555 + { 556 + pinctrl_gpio_free(gc->base + gpio); 557 + } 558 + 559 + static int jh7110_gpio_get_direction(struct gpio_chip *gc, 560 + unsigned int gpio) 561 + { 562 + struct jh7110_pinctrl *sfp = container_of(gc, 563 + struct jh7110_pinctrl, gc); 564 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 565 + unsigned int offset = 4 * (gpio / 4); 566 + unsigned int shift = 8 * (gpio % 4); 567 + u32 doen = readl_relaxed(sfp->base + info->doen_reg_base + offset); 568 + 569 + doen = (doen >> shift) & info->doen_mask; 570 + 571 + return doen == GPOEN_ENABLE ? 572 + GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; 573 + } 574 + 575 + static int jh7110_gpio_direction_input(struct gpio_chip *gc, 576 + unsigned int gpio) 577 + { 578 + struct jh7110_pinctrl *sfp = container_of(gc, 579 + struct jh7110_pinctrl, gc); 580 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 581 + 582 + /* enable input and schmitt trigger */ 583 + jh7110_padcfg_rmw(sfp, gpio, 584 + JH7110_PADCFG_IE | JH7110_PADCFG_SMT, 585 + JH7110_PADCFG_IE | JH7110_PADCFG_SMT); 586 + 587 + if (info->jh7110_set_one_pin_mux) 588 + info->jh7110_set_one_pin_mux(sfp, gpio, 589 + GPI_NONE, GPOUT_LOW, GPOEN_DISABLE, 0); 590 + 591 + return 0; 592 + } 593 + 594 + static int jh7110_gpio_direction_output(struct gpio_chip *gc, 595 + unsigned int gpio, int value) 596 + { 597 + struct jh7110_pinctrl *sfp = container_of(gc, 598 + struct jh7110_pinctrl, gc); 599 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 600 + 601 + if (info->jh7110_set_one_pin_mux) 602 + info->jh7110_set_one_pin_mux(sfp, gpio, 603 + GPI_NONE, value ? GPOUT_HIGH : GPOUT_LOW, 604 + GPOEN_ENABLE, 0); 605 + 606 + /* disable input, schmitt trigger and bias */ 607 + jh7110_padcfg_rmw(sfp, gpio, 608 + JH7110_PADCFG_IE | JH7110_PADCFG_SMT | 609 + JH7110_PADCFG_BIAS, 0); 610 + return 0; 611 + } 612 + 613 + static int jh7110_gpio_get(struct gpio_chip *gc, unsigned int gpio) 614 + { 615 + struct jh7110_pinctrl *sfp = container_of(gc, 616 + struct jh7110_pinctrl, gc); 617 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 618 + void __iomem *reg = sfp->base + info->gpioin_reg_base 619 + + 4 * (gpio / 32); 620 + 621 + return !!(readl_relaxed(reg) & BIT(gpio % 32)); 622 + } 623 + 624 + static void jh7110_gpio_set(struct gpio_chip *gc, 625 + unsigned int gpio, int value) 626 + { 627 + struct jh7110_pinctrl *sfp = container_of(gc, 628 + struct jh7110_pinctrl, gc); 629 + const struct jh7110_pinctrl_soc_info *info = sfp->info; 630 + unsigned int offset = 4 * (gpio / 4); 631 + unsigned int shift = 8 * (gpio % 4); 632 + void __iomem *reg_dout = sfp->base + info->dout_reg_base + offset; 633 + u32 dout = (value ? GPOUT_HIGH : GPOUT_LOW) << shift; 634 + u32 mask = info->dout_mask << shift; 635 + unsigned long flags; 636 + 637 + raw_spin_lock_irqsave(&sfp->lock, flags); 638 + dout |= readl_relaxed(reg_dout) & ~mask; 639 + writel_relaxed(dout, reg_dout); 640 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 641 + } 642 + 643 + static int jh7110_gpio_set_config(struct gpio_chip *gc, 644 + unsigned int gpio, unsigned long config) 645 + { 646 + struct jh7110_pinctrl *sfp = container_of(gc, 647 + struct jh7110_pinctrl, gc); 648 + u32 arg = pinconf_to_config_argument(config); 649 + u32 value; 650 + u32 mask; 651 + 652 + switch (pinconf_to_config_param(config)) { 653 + case PIN_CONFIG_BIAS_DISABLE: 654 + mask = JH7110_PADCFG_BIAS; 655 + value = 0; 656 + break; 657 + case PIN_CONFIG_BIAS_PULL_DOWN: 658 + if (arg == 0) 659 + return -ENOTSUPP; 660 + mask = JH7110_PADCFG_BIAS; 661 + value = JH7110_PADCFG_PD; 662 + break; 663 + case PIN_CONFIG_BIAS_PULL_UP: 664 + if (arg == 0) 665 + return -ENOTSUPP; 666 + mask = JH7110_PADCFG_BIAS; 667 + value = JH7110_PADCFG_PU; 668 + break; 669 + case PIN_CONFIG_DRIVE_PUSH_PULL: 670 + return 0; 671 + case PIN_CONFIG_INPUT_ENABLE: 672 + mask = JH7110_PADCFG_IE; 673 + value = arg ? JH7110_PADCFG_IE : 0; 674 + break; 675 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 676 + mask = JH7110_PADCFG_SMT; 677 + value = arg ? JH7110_PADCFG_SMT : 0; 678 + break; 679 + default: 680 + return -ENOTSUPP; 681 + } 682 + 683 + jh7110_padcfg_rmw(sfp, gpio, mask, value); 684 + return 0; 685 + } 686 + 687 + static int jh7110_gpio_add_pin_ranges(struct gpio_chip *gc) 688 + { 689 + struct jh7110_pinctrl *sfp = container_of(gc, 690 + struct jh7110_pinctrl, gc); 691 + 692 + sfp->gpios.name = sfp->gc.label; 693 + sfp->gpios.base = sfp->gc.base; 694 + sfp->gpios.pin_base = 0; 695 + sfp->gpios.npins = sfp->gc.ngpio; 696 + sfp->gpios.gc = &sfp->gc; 697 + pinctrl_add_gpio_range(sfp->pctl, &sfp->gpios); 698 + return 0; 699 + } 700 + 701 + static void jh7110_irq_ack(struct irq_data *d) 702 + { 703 + struct jh7110_pinctrl *sfp = jh7110_from_irq_data(d); 704 + const struct jh7110_gpio_irq_reg *irq_reg = sfp->info->irq_reg; 705 + irq_hw_number_t gpio = irqd_to_hwirq(d); 706 + void __iomem *ic = sfp->base + irq_reg->ic_reg_base 707 + + 4 * (gpio / 32); 708 + u32 mask = BIT(gpio % 32); 709 + unsigned long flags; 710 + u32 value; 711 + 712 + raw_spin_lock_irqsave(&sfp->lock, flags); 713 + value = readl_relaxed(ic) & ~mask; 714 + writel_relaxed(value, ic); 715 + writel_relaxed(value | mask, ic); 716 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 717 + } 718 + 719 + static void jh7110_irq_mask(struct irq_data *d) 720 + { 721 + struct jh7110_pinctrl *sfp = jh7110_from_irq_data(d); 722 + const struct jh7110_gpio_irq_reg *irq_reg = sfp->info->irq_reg; 723 + irq_hw_number_t gpio = irqd_to_hwirq(d); 724 + void __iomem *ie = sfp->base + irq_reg->ie_reg_base 725 + + 4 * (gpio / 32); 726 + u32 mask = BIT(gpio % 32); 727 + unsigned long flags; 728 + u32 value; 729 + 730 + raw_spin_lock_irqsave(&sfp->lock, flags); 731 + value = readl_relaxed(ie) & ~mask; 732 + writel_relaxed(value, ie); 733 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 734 + 735 + gpiochip_disable_irq(&sfp->gc, d->hwirq); 736 + } 737 + 738 + static void jh7110_irq_mask_ack(struct irq_data *d) 739 + { 740 + struct jh7110_pinctrl *sfp = jh7110_from_irq_data(d); 741 + const struct jh7110_gpio_irq_reg *irq_reg = sfp->info->irq_reg; 742 + irq_hw_number_t gpio = irqd_to_hwirq(d); 743 + void __iomem *ie = sfp->base + irq_reg->ie_reg_base 744 + + 4 * (gpio / 32); 745 + void __iomem *ic = sfp->base + irq_reg->ic_reg_base 746 + + 4 * (gpio / 32); 747 + u32 mask = BIT(gpio % 32); 748 + unsigned long flags; 749 + u32 value; 750 + 751 + raw_spin_lock_irqsave(&sfp->lock, flags); 752 + value = readl_relaxed(ie) & ~mask; 753 + writel_relaxed(value, ie); 754 + 755 + value = readl_relaxed(ic) & ~mask; 756 + writel_relaxed(value, ic); 757 + writel_relaxed(value | mask, ic); 758 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 759 + } 760 + 761 + static void jh7110_irq_unmask(struct irq_data *d) 762 + { 763 + struct jh7110_pinctrl *sfp = jh7110_from_irq_data(d); 764 + const struct jh7110_gpio_irq_reg *irq_reg = sfp->info->irq_reg; 765 + irq_hw_number_t gpio = irqd_to_hwirq(d); 766 + void __iomem *ie = sfp->base + irq_reg->ie_reg_base 767 + + 4 * (gpio / 32); 768 + u32 mask = BIT(gpio % 32); 769 + unsigned long flags; 770 + u32 value; 771 + 772 + gpiochip_enable_irq(&sfp->gc, d->hwirq); 773 + 774 + raw_spin_lock_irqsave(&sfp->lock, flags); 775 + value = readl_relaxed(ie) | mask; 776 + writel_relaxed(value, ie); 777 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 778 + } 779 + 780 + static int jh7110_irq_set_type(struct irq_data *d, unsigned int trigger) 781 + { 782 + struct jh7110_pinctrl *sfp = jh7110_from_irq_data(d); 783 + const struct jh7110_gpio_irq_reg *irq_reg = sfp->info->irq_reg; 784 + irq_hw_number_t gpio = irqd_to_hwirq(d); 785 + void __iomem *base = sfp->base + 4 * (gpio / 32); 786 + u32 mask = BIT(gpio % 32); 787 + u32 irq_type, edge_both, polarity; 788 + unsigned long flags; 789 + 790 + switch (trigger) { 791 + case IRQ_TYPE_EDGE_RISING: 792 + irq_type = mask; /* 1: edge triggered */ 793 + edge_both = 0; /* 0: single edge */ 794 + polarity = mask; /* 1: rising edge */ 795 + break; 796 + case IRQ_TYPE_EDGE_FALLING: 797 + irq_type = mask; /* 1: edge triggered */ 798 + edge_both = 0; /* 0: single edge */ 799 + polarity = 0; /* 0: falling edge */ 800 + break; 801 + case IRQ_TYPE_EDGE_BOTH: 802 + irq_type = mask; /* 1: edge triggered */ 803 + edge_both = mask; /* 1: both edges */ 804 + polarity = 0; /* 0: ignored */ 805 + break; 806 + case IRQ_TYPE_LEVEL_HIGH: 807 + irq_type = 0; /* 0: level triggered */ 808 + edge_both = 0; /* 0: ignored */ 809 + polarity = mask; /* 1: high level */ 810 + break; 811 + case IRQ_TYPE_LEVEL_LOW: 812 + irq_type = 0; /* 0: level triggered */ 813 + edge_both = 0; /* 0: ignored */ 814 + polarity = 0; /* 0: low level */ 815 + break; 816 + default: 817 + return -EINVAL; 818 + } 819 + 820 + if (trigger & IRQ_TYPE_EDGE_BOTH) 821 + irq_set_handler_locked(d, handle_edge_irq); 822 + else 823 + irq_set_handler_locked(d, handle_level_irq); 824 + 825 + raw_spin_lock_irqsave(&sfp->lock, flags); 826 + irq_type |= readl_relaxed(base + irq_reg->is_reg_base) & ~mask; 827 + writel_relaxed(irq_type, base + irq_reg->is_reg_base); 828 + 829 + edge_both |= readl_relaxed(base + irq_reg->ibe_reg_base) & ~mask; 830 + writel_relaxed(edge_both, base + irq_reg->ibe_reg_base); 831 + 832 + polarity |= readl_relaxed(base + irq_reg->iev_reg_base) & ~mask; 833 + writel_relaxed(polarity, base + irq_reg->iev_reg_base); 834 + raw_spin_unlock_irqrestore(&sfp->lock, flags); 835 + return 0; 836 + } 837 + 838 + static struct irq_chip jh7110_irq_chip = { 839 + .irq_ack = jh7110_irq_ack, 840 + .irq_mask = jh7110_irq_mask, 841 + .irq_mask_ack = jh7110_irq_mask_ack, 842 + .irq_unmask = jh7110_irq_unmask, 843 + .irq_set_type = jh7110_irq_set_type, 844 + .flags = IRQCHIP_IMMUTABLE | IRQCHIP_SET_TYPE_MASKED, 845 + GPIOCHIP_IRQ_RESOURCE_HELPERS, 846 + }; 847 + 848 + static void jh7110_disable_clock(void *data) 849 + { 850 + clk_disable_unprepare(data); 851 + } 852 + 853 + int jh7110_pinctrl_probe(struct platform_device *pdev) 854 + { 855 + struct device *dev = &pdev->dev; 856 + const struct jh7110_pinctrl_soc_info *info; 857 + struct jh7110_pinctrl *sfp; 858 + struct pinctrl_desc *jh7110_pinctrl_desc; 859 + struct reset_control *rst; 860 + struct clk *clk; 861 + int ret; 862 + 863 + info = of_device_get_match_data(&pdev->dev); 864 + if (!info) 865 + return -ENODEV; 866 + 867 + if (!info->pins || !info->npins) { 868 + dev_err(dev, "wrong pinctrl info\n"); 869 + return -EINVAL; 870 + } 871 + 872 + sfp = devm_kzalloc(dev, sizeof(*sfp), GFP_KERNEL); 873 + if (!sfp) 874 + return -ENOMEM; 875 + 876 + sfp->base = devm_platform_ioremap_resource(pdev, 0); 877 + if (IS_ERR(sfp->base)) 878 + return PTR_ERR(sfp->base); 879 + 880 + clk = devm_clk_get_optional(dev, NULL); 881 + if (IS_ERR(clk)) 882 + return dev_err_probe(dev, PTR_ERR(clk), "could not get clock\n"); 883 + 884 + rst = devm_reset_control_get_exclusive(dev, NULL); 885 + if (IS_ERR(rst)) 886 + return dev_err_probe(dev, PTR_ERR(rst), "could not get reset\n"); 887 + 888 + /* 889 + * we don't want to assert reset and risk undoing pin muxing for the 890 + * early boot serial console, but let's make sure the reset line is 891 + * deasserted in case someone runs a really minimal bootloader. 892 + */ 893 + ret = reset_control_deassert(rst); 894 + if (ret) 895 + return dev_err_probe(dev, ret, "could not deassert reset\n"); 896 + 897 + if (clk) { 898 + ret = clk_prepare_enable(clk); 899 + if (ret) 900 + return dev_err_probe(dev, ret, "could not enable clock\n"); 901 + 902 + ret = devm_add_action_or_reset(dev, jh7110_disable_clock, clk); 903 + if (ret) 904 + return ret; 905 + } 906 + 907 + jh7110_pinctrl_desc = devm_kzalloc(&pdev->dev, 908 + sizeof(*jh7110_pinctrl_desc), 909 + GFP_KERNEL); 910 + if (!jh7110_pinctrl_desc) 911 + return -ENOMEM; 912 + 913 + jh7110_pinctrl_desc->name = dev_name(dev); 914 + jh7110_pinctrl_desc->pins = info->pins; 915 + jh7110_pinctrl_desc->npins = info->npins; 916 + jh7110_pinctrl_desc->pctlops = &jh7110_pinctrl_ops; 917 + jh7110_pinctrl_desc->pmxops = &jh7110_pinmux_ops; 918 + jh7110_pinctrl_desc->confops = &jh7110_pinconf_ops; 919 + jh7110_pinctrl_desc->owner = THIS_MODULE; 920 + 921 + sfp->info = info; 922 + sfp->dev = dev; 923 + platform_set_drvdata(pdev, sfp); 924 + sfp->gc.parent = dev; 925 + raw_spin_lock_init(&sfp->lock); 926 + mutex_init(&sfp->mutex); 927 + 928 + ret = devm_pinctrl_register_and_init(dev, 929 + jh7110_pinctrl_desc, 930 + sfp, &sfp->pctl); 931 + if (ret) 932 + return dev_err_probe(dev, ret, 933 + "could not register pinctrl driver\n"); 934 + 935 + sfp->gc.label = dev_name(dev); 936 + sfp->gc.owner = THIS_MODULE; 937 + sfp->gc.request = jh7110_gpio_request; 938 + sfp->gc.free = jh7110_gpio_free; 939 + sfp->gc.get_direction = jh7110_gpio_get_direction; 940 + sfp->gc.direction_input = jh7110_gpio_direction_input; 941 + sfp->gc.direction_output = jh7110_gpio_direction_output; 942 + sfp->gc.get = jh7110_gpio_get; 943 + sfp->gc.set = jh7110_gpio_set; 944 + sfp->gc.set_config = jh7110_gpio_set_config; 945 + sfp->gc.add_pin_ranges = jh7110_gpio_add_pin_ranges; 946 + sfp->gc.base = info->gc_base; 947 + sfp->gc.ngpio = info->ngpios; 948 + 949 + jh7110_irq_chip.name = sfp->gc.label; 950 + gpio_irq_chip_set_chip(&sfp->gc.irq, &jh7110_irq_chip); 951 + sfp->gc.irq.parent_handler = info->jh7110_gpio_irq_handler; 952 + sfp->gc.irq.num_parents = 1; 953 + sfp->gc.irq.parents = devm_kcalloc(dev, sfp->gc.irq.num_parents, 954 + sizeof(*sfp->gc.irq.parents), 955 + GFP_KERNEL); 956 + if (!sfp->gc.irq.parents) 957 + return -ENOMEM; 958 + sfp->gc.irq.default_type = IRQ_TYPE_NONE; 959 + sfp->gc.irq.handler = handle_bad_irq; 960 + sfp->gc.irq.init_hw = info->jh7110_gpio_init_hw; 961 + 962 + ret = platform_get_irq(pdev, 0); 963 + if (ret < 0) 964 + return ret; 965 + sfp->gc.irq.parents[0] = ret; 966 + 967 + ret = devm_gpiochip_add_data(dev, &sfp->gc, sfp); 968 + if (ret) 969 + return dev_err_probe(dev, ret, "could not register gpiochip\n"); 970 + 971 + irq_domain_set_pm_device(sfp->gc.irq.domain, dev); 972 + 973 + dev_info(dev, "StarFive GPIO chip registered %d GPIOs\n", sfp->gc.ngpio); 974 + 975 + return pinctrl_enable(sfp->pctl); 976 + } 977 + EXPORT_SYMBOL_GPL(jh7110_pinctrl_probe); 978 + 979 + MODULE_DESCRIPTION("Pinctrl driver for the StarFive JH7110 SoC"); 980 + MODULE_AUTHOR("Emil Renner Berthing <kernel@esmil.dk>"); 981 + MODULE_AUTHOR("Jianlong Huang <jianlong.huang@starfivetech.com>"); 982 + MODULE_LICENSE("GPL");
+70
drivers/pinctrl/starfive/pinctrl-starfive-jh7110.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Pinctrl / GPIO driver for StarFive JH7110 SoC 4 + * 5 + * Copyright (C) 2022 StarFive Technology Co., Ltd. 6 + */ 7 + 8 + #ifndef __PINCTRL_STARFIVE_JH7110_H__ 9 + #define __PINCTRL_STARFIVE_JH7110_H__ 10 + 11 + #include <linux/pinctrl/pinconf-generic.h> 12 + #include <linux/pinctrl/pinmux.h> 13 + 14 + struct jh7110_pinctrl { 15 + struct device *dev; 16 + struct gpio_chip gc; 17 + struct pinctrl_gpio_range gpios; 18 + raw_spinlock_t lock; 19 + void __iomem *base; 20 + struct pinctrl_dev *pctl; 21 + /* register read/write mutex */ 22 + struct mutex mutex; 23 + const struct jh7110_pinctrl_soc_info *info; 24 + }; 25 + 26 + struct jh7110_gpio_irq_reg { 27 + unsigned int is_reg_base; 28 + unsigned int ic_reg_base; 29 + unsigned int ibe_reg_base; 30 + unsigned int iev_reg_base; 31 + unsigned int ie_reg_base; 32 + unsigned int ris_reg_base; 33 + unsigned int mis_reg_base; 34 + }; 35 + 36 + struct jh7110_pinctrl_soc_info { 37 + const struct pinctrl_pin_desc *pins; 38 + unsigned int npins; 39 + unsigned int ngpios; 40 + unsigned int gc_base; 41 + 42 + /* gpio dout/doen/din/gpioinput register */ 43 + unsigned int dout_reg_base; 44 + unsigned int dout_mask; 45 + unsigned int doen_reg_base; 46 + unsigned int doen_mask; 47 + unsigned int gpi_reg_base; 48 + unsigned int gpi_mask; 49 + unsigned int gpioin_reg_base; 50 + 51 + const struct jh7110_gpio_irq_reg *irq_reg; 52 + 53 + /* generic pinmux */ 54 + int (*jh7110_set_one_pin_mux)(struct jh7110_pinctrl *sfp, 55 + unsigned int pin, 56 + unsigned int din, u32 dout, 57 + u32 doen, u32 func); 58 + /* gpio chip */ 59 + int (*jh7110_get_padcfg_base)(struct jh7110_pinctrl *sfp, 60 + unsigned int pin); 61 + void (*jh7110_gpio_irq_handler)(struct irq_desc *desc); 62 + int (*jh7110_gpio_init_hw)(struct gpio_chip *gc); 63 + }; 64 + 65 + void jh7110_set_gpiomux(struct jh7110_pinctrl *sfp, unsigned int pin, 66 + unsigned int din, u32 dout, u32 doen); 67 + int jh7110_pinctrl_probe(struct platform_device *pdev); 68 + struct jh7110_pinctrl *jh7110_from_irq_desc(struct irq_desc *desc); 69 + 70 + #endif /* __PINCTRL_STARFIVE_JH7110_H__ */
+1
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 1382 1382 return ERR_PTR(-ENXIO); 1383 1383 1384 1384 domain = irq_find_host(parent); 1385 + of_node_put(parent); 1385 1386 if (!domain) 1386 1387 /* domain not registered yet */ 1387 1388 return ERR_PTR(-EPROBE_DEFER);
-1
drivers/pinctrl/sunplus/sppctl.c
··· 553 553 gchip->base = -1; 554 554 gchip->ngpio = sppctl_gpio_list_sz; 555 555 gchip->names = sppctl_gpio_list_s; 556 - gchip->of_gpio_n_cells = 2; 557 556 558 557 pctl->pctl_grange.npins = gchip->ngpio; 559 558 pctl->pctl_grange.name = gchip->label;
+137
include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 + /* 3 + * Copyright (C) 2022 Emil Renner Berthing <kernel@esmil.dk> 4 + * Copyright (C) 2022 StarFive Technology Co., Ltd. 5 + */ 6 + 7 + #ifndef __DT_BINDINGS_PINCTRL_STARFIVE_JH7110_H__ 8 + #define __DT_BINDINGS_PINCTRL_STARFIVE_JH7110_H__ 9 + 10 + /* sys_iomux pins */ 11 + #define PAD_GPIO0 0 12 + #define PAD_GPIO1 1 13 + #define PAD_GPIO2 2 14 + #define PAD_GPIO3 3 15 + #define PAD_GPIO4 4 16 + #define PAD_GPIO5 5 17 + #define PAD_GPIO6 6 18 + #define PAD_GPIO7 7 19 + #define PAD_GPIO8 8 20 + #define PAD_GPIO9 9 21 + #define PAD_GPIO10 10 22 + #define PAD_GPIO11 11 23 + #define PAD_GPIO12 12 24 + #define PAD_GPIO13 13 25 + #define PAD_GPIO14 14 26 + #define PAD_GPIO15 15 27 + #define PAD_GPIO16 16 28 + #define PAD_GPIO17 17 29 + #define PAD_GPIO18 18 30 + #define PAD_GPIO19 19 31 + #define PAD_GPIO20 20 32 + #define PAD_GPIO21 21 33 + #define PAD_GPIO22 22 34 + #define PAD_GPIO23 23 35 + #define PAD_GPIO24 24 36 + #define PAD_GPIO25 25 37 + #define PAD_GPIO26 26 38 + #define PAD_GPIO27 27 39 + #define PAD_GPIO28 28 40 + #define PAD_GPIO29 29 41 + #define PAD_GPIO30 30 42 + #define PAD_GPIO31 31 43 + #define PAD_GPIO32 32 44 + #define PAD_GPIO33 33 45 + #define PAD_GPIO34 34 46 + #define PAD_GPIO35 35 47 + #define PAD_GPIO36 36 48 + #define PAD_GPIO37 37 49 + #define PAD_GPIO38 38 50 + #define PAD_GPIO39 39 51 + #define PAD_GPIO40 40 52 + #define PAD_GPIO41 41 53 + #define PAD_GPIO42 42 54 + #define PAD_GPIO43 43 55 + #define PAD_GPIO44 44 56 + #define PAD_GPIO45 45 57 + #define PAD_GPIO46 46 58 + #define PAD_GPIO47 47 59 + #define PAD_GPIO48 48 60 + #define PAD_GPIO49 49 61 + #define PAD_GPIO50 50 62 + #define PAD_GPIO51 51 63 + #define PAD_GPIO52 52 64 + #define PAD_GPIO53 53 65 + #define PAD_GPIO54 54 66 + #define PAD_GPIO55 55 67 + #define PAD_GPIO56 56 68 + #define PAD_GPIO57 57 69 + #define PAD_GPIO58 58 70 + #define PAD_GPIO59 59 71 + #define PAD_GPIO60 60 72 + #define PAD_GPIO61 61 73 + #define PAD_GPIO62 62 74 + #define PAD_GPIO63 63 75 + #define PAD_SD0_CLK 64 76 + #define PAD_SD0_CMD 65 77 + #define PAD_SD0_DATA0 66 78 + #define PAD_SD0_DATA1 67 79 + #define PAD_SD0_DATA2 68 80 + #define PAD_SD0_DATA3 69 81 + #define PAD_SD0_DATA4 70 82 + #define PAD_SD0_DATA5 71 83 + #define PAD_SD0_DATA6 72 84 + #define PAD_SD0_DATA7 73 85 + #define PAD_SD0_STRB 74 86 + #define PAD_GMAC1_MDC 75 87 + #define PAD_GMAC1_MDIO 76 88 + #define PAD_GMAC1_RXD0 77 89 + #define PAD_GMAC1_RXD1 78 90 + #define PAD_GMAC1_RXD2 79 91 + #define PAD_GMAC1_RXD3 80 92 + #define PAD_GMAC1_RXDV 81 93 + #define PAD_GMAC1_RXC 82 94 + #define PAD_GMAC1_TXD0 83 95 + #define PAD_GMAC1_TXD1 84 96 + #define PAD_GMAC1_TXD2 85 97 + #define PAD_GMAC1_TXD3 86 98 + #define PAD_GMAC1_TXEN 87 99 + #define PAD_GMAC1_TXC 88 100 + #define PAD_QSPI_SCLK 89 101 + #define PAD_QSPI_CS0 90 102 + #define PAD_QSPI_DATA0 91 103 + #define PAD_QSPI_DATA1 92 104 + #define PAD_QSPI_DATA2 93 105 + #define PAD_QSPI_DATA3 94 106 + 107 + /* aon_iomux pins */ 108 + #define PAD_TESTEN 0 109 + #define PAD_RGPIO0 1 110 + #define PAD_RGPIO1 2 111 + #define PAD_RGPIO2 3 112 + #define PAD_RGPIO3 4 113 + #define PAD_RSTN 5 114 + #define PAD_GMAC0_MDC 6 115 + #define PAD_GMAC0_MDIO 7 116 + #define PAD_GMAC0_RXD0 8 117 + #define PAD_GMAC0_RXD1 9 118 + #define PAD_GMAC0_RXD2 10 119 + #define PAD_GMAC0_RXD3 11 120 + #define PAD_GMAC0_RXDV 12 121 + #define PAD_GMAC0_RXC 13 122 + #define PAD_GMAC0_TXD0 14 123 + #define PAD_GMAC0_TXD1 15 124 + #define PAD_GMAC0_TXD2 16 125 + #define PAD_GMAC0_TXD3 17 126 + #define PAD_GMAC0_TXEN 18 127 + #define PAD_GMAC0_TXC 19 128 + 129 + #define GPOUT_LOW 0 130 + #define GPOUT_HIGH 1 131 + 132 + #define GPOEN_ENABLE 0 133 + #define GPOEN_DISABLE 1 134 + 135 + #define GPI_NONE 255 136 + 137 + #endif
-12
include/linux/gpio/driver.h
··· 518 518 */ 519 519 int (*of_xlate)(struct gpio_chip *gc, 520 520 const struct of_phandle_args *gpiospec, u32 *flags); 521 - 522 - /** 523 - * @of_gpio_ranges_fallback: 524 - * 525 - * Optional hook for the case that no gpio-ranges property is defined 526 - * within the device tree node "np" (usually DT before introduction 527 - * of gpio-ranges). So this callback is helpful to provide the 528 - * necessary backward compatibility for the pin ranges. 529 - */ 530 - int (*of_gpio_ranges_fallback)(struct gpio_chip *gc, 531 - struct device_node *np); 532 - 533 521 #endif /* CONFIG_OF_GPIO */ 534 522 }; 535 523
+20
include/linux/pinctrl/pinctrl.h
··· 206 206 const char *pin_group, const unsigned **pins, 207 207 unsigned *num_pins); 208 208 209 + /** 210 + * struct pinfunction - Description about a function 211 + * @name: Name of the function 212 + * @groups: An array of groups for this function 213 + * @ngroups: Number of groups in @groups 214 + */ 215 + struct pinfunction { 216 + const char *name; 217 + const char * const *groups; 218 + size_t ngroups; 219 + }; 220 + 221 + /* Convenience macro to define a single named pinfunction */ 222 + #define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \ 223 + (struct pinfunction) { \ 224 + .name = (_name), \ 225 + .groups = (_groups), \ 226 + .ngroups = (_ngroups), \ 227 + } 228 + 209 229 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) 210 230 extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); 211 231 #else