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

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

Pull pin control bulk updates from Linus Walleij:
"Core changes:

- New standard enumerator and corresponding device tree bindings for
output impedance pin configuration. (Implemented and used in the
Renesas rzg2l driver.)

- Cleanup of Kconfig and Makefile to be somewhat orderly and
alphabetic.

New drivers:

- Samsung Exynos 7885 pin controller.

- Ocelot LAN966x pin controller.

- Qualcomm SDX65 pin controller.

- Qualcomm SM8450 pin controller.

- Qualcomm PM8019, PM8226 and PM2250 pin controllers.

- NXP/Freescale i.MXRT1050 pin controller.

- Intel Thunder Bay pin controller.

Enhancements:

- Introduction of the string library helper function
"kasprintf_strarray()" and subsequent use in Rockchip, ST and
Armada pin control drivers, as well as the GPIO mockup driver.

- The Ocelot pin controller has been extensively rewritten to use
regmap and other modern kernel infrastructure.

- The Microchip SGPIO driver has been converted to use regmap.

- The SPEAr driver had been converted to use regmap.

- Substantial cleanups and janitorial on the Apple pin control driver
that was merged for v5.16.

- Janitorial to remove of_node assignments in the GPIO portions that
anyway get this handled in the GPIO core.

- Minor cleanups and improvements in several pin controllers"

* tag 'pinctrl-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (98 commits)
pinctrl: imx: fix assigning groups names
dt-bindings: pinctrl: mt8195: add wrapping node of pin configurations
pinctrl: bcm: ns: use generic groups & functions helpers
pinctrl: imx: fix allocation result check
pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt
pinctrl: Propagate firmware node from a parent device
dt-bindings: pinctrl: qcom: Add SDX65 pinctrl bindings
pinctrl: add one more "const" for generic function groups
pinctrl: keembay: rework loops looking for groups names
pinctrl: keembay: comment process of building functions a bit
pinctrl: imx: prepare for making "group_names" in "function_desc" const
ARM: dts: gpio-ranges property is now required
pinctrl: aspeed: fix unmet dependencies on MFD_SYSCON for PINCTRL_ASPEED
pinctrl: Get rid of duplicate of_node assignment in the drivers
pinctrl-sunxi: don't call pinctrl_gpio_direction()
pinctrl-bcm2835: don't call pinctrl_gpio_direction()
pinctrl: bcm2835: Silence uninit warning
pinctrl: Sort Kconfig and Makefile entries alphabetically
pinctrl: Add Intel Thunder Bay pinctrl driver
dt-bindings: pinctrl: Add bindings for Intel Thunderbay pinctrl driver
...

+7127 -1249
+3
Documentation/devicetree/bindings/pinctrl/actions,s500-pinctrl.yaml
··· 184 184 185 185 additionalProperties: false 186 186 187 + allOf: 188 + - $ref: "pinctrl.yaml#" 189 + 187 190 required: 188 191 - compatible 189 192 - reg
+1
Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
··· 147 147 # boards are defining it at the moment so it would generate a lot of 148 148 # warnings. 149 149 150 + - $ref: "pinctrl.yaml#" 150 151 - if: 151 152 properties: 152 153 compatible:
+3
Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
··· 72 72 73 73 additionalProperties: false 74 74 75 + allOf: 76 + - $ref: "pinctrl.yaml#" 77 + 75 78 required: 76 79 - compatible 77 80 - reg
+3
Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml
··· 50 50 TXD3, TXD4, UART6, USB11D1, USB11H2, USB2D1, USB2H1, USBCKI, VGABIOS_ROM, 51 51 VGAHS, VGAVS, VPI18, VPI24, VPI30, VPO12, VPO24, WDTRST1, WDTRST2] 52 52 53 + allOf: 54 + - $ref: "pinctrl.yaml#" 55 + 53 56 required: 54 57 - compatible 55 58
+3
Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml
··· 62 62 USB11BHID, USB2AD, USB2AH, USB2BD, USB2BH, USBCKI, VGABIOSROM, VGAHS, 63 63 VGAVS, VPI24, VPO, WDTRST1, WDTRST2] 64 64 65 + allOf: 66 + - $ref: "pinctrl.yaml#" 67 + 65 68 required: 66 69 - compatible 67 70 - aspeed,external-nodes
+3
Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml
··· 83 83 UART7, UART8, UART9, USBA, USBB, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, 84 84 WDTRST3, WDTRST4] 85 85 86 + allOf: 87 + - $ref: "pinctrl.yaml#" 88 + 86 89 required: 87 90 - compatible 88 91
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm6318-pinctrl.yaml
··· 37 37 enum: [ gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, 38 38 gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio40 ] 39 39 40 + allOf: 41 + - $ref: "pinctrl.yaml#" 42 + 40 43 required: 41 44 - compatible 42 45 - reg
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.yaml
··· 41 41 vdsl_phy_override_1_grp, vdsl_phy_override_2_grp, 42 42 vdsl_phy_override_3_grp, dsl_gpio8, dsl_gpio9 ] 43 43 44 + allOf: 45 + - $ref: "pinctrl.yaml#" 46 + 44 47 required: 45 48 - compatible 46 49 - reg
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.yaml
··· 36 36 gpio20, gpio25, gpio26, gpio27, gpio28, hsspi_cs1, 37 37 usb_port1 ] 38 38 39 + allOf: 40 + - $ref: "pinctrl.yaml#" 41 + 39 42 required: 40 43 - compatible 41 44 - reg
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.yaml
··· 34 34 enum: [ ebi_cs_grp, uart1_grp, serial_led_grp, legacy_led_grp, 35 35 led_grp, spi_cs_grp, utopia_grp, pwm_syn_clk, sys_irq_grp ] 36 36 37 + allOf: 38 + - $ref: "pinctrl.yaml#" 39 + 37 40 required: 38 41 - compatible 39 42 - reg
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.yaml
··· 41 41 gpio15, gpio16, gpio17, gpio18, gpio19, gpio20, gpio21, 42 42 gpio22, gpio23, gpio24, gpio25, gpio26, gpio27, nand_grp ] 43 43 44 + allOf: 45 + - $ref: "pinctrl.yaml#" 46 + 44 47 required: 45 48 - compatible 46 49 - reg
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.yaml
··· 42 42 gpio24, gpio25, gpio26, gpio27, gpio28, gpio29, gpio30, 43 43 gpio31, uart1_grp ] 44 44 45 + allOf: 46 + - $ref: "pinctrl.yaml#" 47 + 45 48 required: 46 49 - compatible 47 50 - reg
+2 -1
Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml
··· 53 53 additionalProperties: false 54 54 55 55 allOf: 56 + - $ref: "pinctrl.yaml#" 56 57 - if: 57 58 properties: 58 59 compatible: ··· 78 77 79 78 examples: 80 79 - | 81 - pin-controller@1800c1c0 { 80 + pinctrl@1800c1c0 { 82 81 compatible = "brcm,bcm4708-pinmux"; 83 82 reg = <0x1800c1c0 0x24>; 84 83 reg-names = "cru_gpio_control";
+5 -2
Documentation/devicetree/bindings/pinctrl/canaan,k210-fpioa.yaml
··· 137 137 138 138 additionalProperties: false 139 139 140 + allOf: 141 + - $ref: "pinctrl.yaml#" 142 + 140 143 required: 141 144 - compatible 142 145 - reg ··· 154 151 #include <dt-bindings/clock/k210-clk.h> 155 152 #include <dt-bindings/reset/k210-rst.h> 156 153 157 - fpioa: pinmux@502B0000 { 154 + fpioa: pinmux@502b0000 { 158 155 compatible = "canaan,k210-fpioa"; 159 - reg = <0x502B0000 0x100>; 156 + reg = <0x502b0000 0x100>; 160 157 clocks = <&sysclk K210_CLK_FPIOA>, 161 158 <&sysclk K210_CLK_APB0>; 162 159 clock-names = "ref", "pclk";
+3
Documentation/devicetree/bindings/pinctrl/cirrus,lochnagar.yaml
··· 181 181 182 182 additionalProperties: false 183 183 184 + allOf: 185 + - $ref: "pinctrl.yaml#" 186 + 184 187 required: 185 188 - compatible 186 189 - gpio-controller
+3
Documentation/devicetree/bindings/pinctrl/cirrus,madera.yaml
··· 117 117 118 118 additionalProperties: false 119 119 120 + allOf: 121 + - $ref: "pinctrl.yaml#" 122 + 120 123 required: 121 124 - pinctrl-0 122 125 - pinctrl-names
+3
Documentation/devicetree/bindings/pinctrl/fsl,imx8mm-pinctrl.yaml
··· 58 58 59 59 additionalProperties: false 60 60 61 + allOf: 62 + - $ref: "pinctrl.yaml#" 63 + 61 64 required: 62 65 - compatible 63 66 - reg
+3
Documentation/devicetree/bindings/pinctrl/fsl,imx8mn-pinctrl.yaml
··· 58 58 59 59 additionalProperties: false 60 60 61 + allOf: 62 + - $ref: "pinctrl.yaml#" 63 + 61 64 required: 62 65 - compatible 63 66 - reg
+3
Documentation/devicetree/bindings/pinctrl/fsl,imx8mp-pinctrl.yaml
··· 58 58 59 59 additionalProperties: false 60 60 61 + allOf: 62 + - $ref: "pinctrl.yaml#" 63 + 61 64 required: 62 65 - compatible 63 66 - reg
+3
Documentation/devicetree/bindings/pinctrl/fsl,imx8mq-pinctrl.yaml
··· 58 58 59 59 additionalProperties: false 60 60 61 + allOf: 62 + - $ref: "pinctrl.yaml#" 63 + 61 64 required: 62 65 - compatible 63 66 - reg
+3
Documentation/devicetree/bindings/pinctrl/fsl,imx8ulp-pinctrl.yaml
··· 56 56 57 57 additionalProperties: false 58 58 59 + allOf: 60 + - $ref: "pinctrl.yaml#" 61 + 59 62 required: 60 63 - compatible 61 64 - reg
+79
Documentation/devicetree/bindings/pinctrl/fsl,imxrt1050.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/fsl,imxrt1050.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Freescale IMXRT1050 IOMUX Controller 8 + 9 + maintainers: 10 + - Giulio Benetti <giulio.benetti@benettiengineering.com> 11 + - Jesse Taube <Mr.Bossman075@gmail.com> 12 + 13 + description: 14 + Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory 15 + for common binding part and usage. 16 + 17 + properties: 18 + compatible: 19 + const: fsl,imxrt1050-iomuxc 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + # Client device subnode's properties 25 + patternProperties: 26 + 'grp$': 27 + type: object 28 + description: 29 + Pinctrl node's client devices use subnodes for desired pin configuration. 30 + Client device subnodes use below standard properties. 31 + 32 + properties: 33 + fsl,pins: 34 + description: 35 + each entry consists of 6 integers and represents the mux and config 36 + setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 37 + mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 38 + be found in <include/dt-bindings/pinctrl/pins-imxrt1050.h>. The last 39 + integer CONFIG is the pad setting value like pull-up on this pin. Please 40 + refer to i.MXRT1050 Reference Manual for detailed CONFIG settings. 41 + $ref: /schemas/types.yaml#/definitions/uint32-matrix 42 + items: 43 + items: 44 + - description: | 45 + "mux_reg" indicates the offset of mux register. 46 + - description: | 47 + "conf_reg" indicates the offset of pad configuration register. 48 + - description: | 49 + "input_reg" indicates the offset of select input register. 50 + - description: | 51 + "mux_val" indicates the mux value to be applied. 52 + - description: | 53 + "input_val" indicates the select input value to be applied. 54 + - description: | 55 + "pad_setting" indicates the pad configuration value to be applied. 56 + 57 + required: 58 + - fsl,pins 59 + 60 + additionalProperties: false 61 + 62 + required: 63 + - compatible 64 + - reg 65 + 66 + additionalProperties: false 67 + 68 + examples: 69 + - | 70 + iomuxc: iomuxc@401f8000 { 71 + compatible = "fsl,imxrt1050-iomuxc"; 72 + reg = <0x401f8000 0x4000>; 73 + 74 + pinctrl_lpuart1: lpuart1grp { 75 + fsl,pins = 76 + <0x0EC 0x2DC 0x000 0x2 0x0 0xf1>, 77 + <0x0F0 0x2E0 0x000 0x2 0x0 0xf1>; 78 + }; 79 + };
+4 -4
Documentation/devicetree/bindings/pinctrl/ingenic,pinctrl.yaml
··· 28 28 - Paul Cercueil <paul@crapouillou.net> 29 29 30 30 properties: 31 - nodename: 32 - pattern: "^pinctrl@[0-9a-f]+$" 33 - 34 31 compatible: 35 32 oneOf: 36 33 - enum: ··· 118 121 119 122 additionalProperties: false 120 123 124 + allOf: 125 + - $ref: "pinctrl.yaml#" 126 + 121 127 required: 122 128 - compatible 123 129 - reg ··· 169 169 170 170 examples: 171 171 - | 172 - pin-controller@10010000 { 172 + pinctrl@10010000 { 173 173 compatible = "ingenic,jz4770-pinctrl"; 174 174 reg = <0x10010000 0x600>; 175 175
+3
Documentation/devicetree/bindings/pinctrl/intel,lgm-io.yaml
··· 47 47 48 48 additionalProperties: false 49 49 50 + allOf: 51 + - $ref: "pinctrl.yaml#" 52 + 50 53 required: 51 54 - compatible 52 55 - reg
+119
Documentation/devicetree/bindings/pinctrl/intel,pinctrl-thunderbay.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/intel,pinctrl-thunderbay.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Intel Thunder Bay pin controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com> 11 + 12 + description: | 13 + Intel Thunder Bay SoC integrates a pin controller which enables control 14 + of pin directions, input/output values and configuration 15 + for a total of 67 pins. 16 + 17 + properties: 18 + compatible: 19 + const: intel,thunderbay-pinctrl 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + gpio-controller: true 25 + 26 + '#gpio-cells': 27 + const: 2 28 + 29 + gpio-ranges: 30 + maxItems: 1 31 + 32 + interrupts: 33 + description: 34 + Specifies the interrupt lines to be used by the controller. 35 + maxItems: 2 36 + 37 + interrupt-controller: true 38 + 39 + '#interrupt-cells': 40 + const: 2 41 + 42 + patternProperties: 43 + '^gpio@[0-9a-f]*$': 44 + type: object 45 + 46 + description: 47 + Child nodes can be specified to contain pin configuration information, 48 + which can then be utilized by pinctrl client devices. 49 + The following properties are supported. 50 + 51 + properties: 52 + pins: 53 + description: | 54 + The name(s) of the pins to be configured in the child node. 55 + Supported pin names are "GPIO0" up to "GPIO66". 56 + 57 + bias-disable: true 58 + 59 + bias-pull-down: true 60 + 61 + bias-pull-up: true 62 + 63 + drive-strength: 64 + description: Drive strength for the pad. 65 + enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] 66 + 67 + bias-bus-hold: 68 + type: boolean 69 + 70 + input-schmitt-enable: 71 + type: boolean 72 + 73 + slew-rate: 74 + description: GPIO slew rate control. 75 + 0 - Slow 76 + 1 - Fast 77 + enum: [0, 1] 78 + 79 + additionalProperties: false 80 + 81 + required: 82 + - compatible 83 + - reg 84 + - gpio-controller 85 + - '#gpio-cells' 86 + - gpio-ranges 87 + - interrupts 88 + - interrupt-controller 89 + - '#interrupt-cells' 90 + 91 + examples: 92 + - | 93 + #include <dt-bindings/interrupt-controller/arm-gic.h> 94 + #include <dt-bindings/interrupt-controller/irq.h> 95 + // Example 1 96 + pinctrl0: gpio@0 { 97 + compatible = "intel,thunderbay-pinctrl"; 98 + reg = <0x600b0000 0x88>; 99 + gpio-controller; 100 + #gpio-cells = <0x2>; 101 + gpio-ranges = <&pinctrl0 0 0 67>; 102 + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>, 103 + <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; 104 + interrupt-controller; 105 + #interrupt-cells = <2>; 106 + }; 107 + 108 + // Example 2 109 + pinctrl1: gpio@1 { 110 + compatible = "intel,thunderbay-pinctrl"; 111 + reg = <0x600c0000 0x88>; 112 + gpio-controller; 113 + #gpio-cells = <0x2>; 114 + gpio-ranges = <&pinctrl1 0 0 53>; 115 + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>, 116 + <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; 117 + interrupt-controller; 118 + #interrupt-cells = <2>; 119 + };
+3
Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
··· 64 64 - gpio-controller 65 65 - "#gpio-cells" 66 66 67 + allOf: 68 + - $ref: "pinctrl.yaml#" 69 + 67 70 patternProperties: 68 71 '-[0-9]+$': 69 72 type: object
+3
Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml
··· 59 59 "#interrupt-cells": 60 60 const: 2 61 61 62 + allOf: 63 + - $ref: "pinctrl.yaml#" 64 + 62 65 required: 63 66 - compatible 64 67 - reg
+3
Documentation/devicetree/bindings/pinctrl/mediatek,mt6797-pinctrl.yaml
··· 45 45 "#interrupt-cells": 46 46 const: 2 47 47 48 + allOf: 49 + - $ref: "pinctrl.yaml#" 50 + 48 51 required: 49 52 - compatible 50 53 - reg
+3
Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml
··· 42 42 "#interrupt-cells": 43 43 const: 2 44 44 45 + allOf: 46 + - $ref: "pinctrl.yaml#" 47 + 45 48 required: 46 49 - compatible 47 50 - reg
+3
Documentation/devicetree/bindings/pinctrl/mediatek,mt7986-pinctrl.yaml
··· 56 56 "#interrupt-cells": 57 57 const: 2 58 58 59 + allOf: 60 + - $ref: "pinctrl.yaml#" 61 + 59 62 required: 60 63 - compatible 61 64 - reg
+3
Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml
··· 56 56 "#interrupt-cells": 57 57 const: 2 58 58 59 + allOf: 60 + - $ref: "pinctrl.yaml#" 61 + 59 62 required: 60 63 - compatible 61 64 - reg
+2 -1
Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.txt
··· 4 4 Required properties: 5 5 - compatible : Should be "mscc,ocelot-pinctrl", 6 6 "mscc,jaguar2-pinctrl", "microchip,sparx5-pinctrl", 7 - "mscc,luton-pinctrl" or "mscc,serval-pinctrl" 7 + "mscc,luton-pinctrl", "mscc,serval-pinctrl" or 8 + "microchip,lan966x-pinctrl" 8 9 - reg : Address and length of the register set for the device 9 10 - gpio-controller : Indicates this device is a GPIO controller 10 11 - #gpio-cells : Must be 2.
+3
Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml
··· 114 114 description: enable output on a pin without actively driving it 115 115 (such as enabling an output buffer) 116 116 117 + output-impedance-ohms: 118 + description: set the output impedance of a pin to at most X ohms 119 + 117 120 output-low: 118 121 type: boolean 119 122 description: set the pin to output mode with low level
+1 -40
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
··· 97 97 }; 98 98 99 99 == Pin controller devices == 100 - Required properties: See the pin controller driver specific documentation 101 100 102 - Optional properties: 103 - #pinctrl-cells: Number of pin control cells in addition to the index within the 104 - pin controller device instance 105 - 106 - pinctrl-use-default: Boolean. Indicates that the OS can use the boot default 107 - pin configuration. This allows using an OS that does not have a 108 - driver for the pin controller. This property can be set either 109 - globally for the pin controller or in child nodes for individual 110 - pin group control. 111 - 112 - Pin controller devices should contain the pin configuration nodes that client 113 - devices reference. 114 - 115 - For example: 116 - 117 - pincontroller { 118 - ... /* Standard DT properties for the device itself elided */ 119 - 120 - state_0_node_a { 121 - ... 122 - }; 123 - state_1_node_a { 124 - ... 125 - }; 126 - state_1_node_b { 127 - ... 128 - }; 129 - } 130 - 131 - The contents of each of those pin configuration child nodes is defined 132 - entirely by the binding for the individual pin controller device. There 133 - exists no common standard for this content. The pinctrl framework only 134 - provides generic helper bindings that the pin controller driver can use. 135 - 136 - The pin configuration nodes need not be direct children of the pin controller 137 - device; they may be grandchildren, for example. Whether this is legal, and 138 - whether there is any interaction between the child and intermediate parent 139 - nodes, is again defined entirely by the binding for the individual pin 140 - controller device. 101 + See pinctrl.yaml 141 102 142 103 == Generic pin multiplexing node content == 143 104
+3
Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
··· 108 108 109 109 additionalProperties: false 110 110 111 + allOf: 112 + - $ref: "pinctrl.yaml#" 113 + 111 114 required: 112 115 - compatible 113 116 - reg
+194 -153
Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
··· 55 55 Identifying i2c pins pull up/down type which is RSEL. It can support 56 56 RSEL define or si unit value(ohm) to set different resistance. 57 57 58 - #PIN CONFIGURATION NODES 58 + # PIN CONFIGURATION NODES 59 59 patternProperties: 60 60 '-pins$': 61 61 type: object 62 - description: | 63 - A pinctrl node should contain at least one subnodes representing the 64 - pinctrl groups available on the machine. Each subnode will list the 65 - pins it needs, and how they should be configured, with regard to muxer 66 - configuration, pullups, drive strength, input enable/disable and 67 - input schmitt. 68 - An example of using macro: 69 - pincontroller { 70 - /* GPIO0 set as multifunction GPIO0 */ 71 - gpio_pin { 72 - pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 73 - }; 74 - /* GPIO8 set as multifunction SDA0 */ 75 - i2c0_pin { 76 - pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 77 - }; 78 - }; 79 - $ref: "pinmux-node.yaml" 80 - 81 - properties: 82 - pinmux: 83 - description: | 84 - Integer array, represents gpio pin number and mux setting. 85 - Supported pin number and mux varies for different SoCs, and are defined 86 - as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 87 - 88 - drive-strength: 89 - enum: [2, 4, 6, 8, 10, 12, 14, 16] 90 - 91 - bias-pull-down: 92 - description: | 93 - For pull down type is normal, it don't need add RSEL & R1R0 define 94 - and resistance value. 95 - For pull down type is PUPD/R0/R1 type, it can add R1R0 define to 96 - set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 97 - "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & "MTK_PUPD_SET_R1R0_11" 98 - define in mt8195. 99 - For pull down type is RSEL, it can add RSEL define & resistance value(ohm) 100 - to set different resistance by identifying property "mediatek,rsel_resistance_in_si_unit". 101 - It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 102 - & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & "MTK_PULL_SET_RSEL_100" 103 - & "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 104 - define in mt8195. It can also support resistance value(ohm) "75000" & "5000" in mt8195. 105 - oneOf: 106 - - enum: [100, 101, 102, 103] 107 - - description: mt8195 pull down PUPD/R0/R1 type define value. 108 - - enum: [200, 201, 202, 203, 204, 205, 206, 207] 109 - - description: mt8195 pull down RSEL type define value. 110 - - enum: [75000, 5000] 111 - - description: mt8195 pull down RSEL type si unit value(ohm). 112 - 113 - An example of using RSEL define: 114 - pincontroller { 115 - i2c0_pin { 116 - pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 117 - bias-pull-down = <MTK_PULL_SET_RSEL_001>; 118 - }; 119 - }; 120 - An example of using si unit resistance value(ohm): 121 - &pio { 122 - mediatek,rsel_resistance_in_si_unit; 123 - } 124 - pincontroller { 125 - i2c0_pin { 126 - pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 127 - bias-pull-down = <75000>; 128 - }; 129 - }; 130 - 131 - bias-pull-up: 132 - description: | 133 - For pull up type is normal, it don't need add RSEL & R1R0 define 134 - and resistance value. 135 - For pull up type is PUPD/R0/R1 type, it can add R1R0 define to 136 - set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 137 - "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & "MTK_PUPD_SET_R1R0_11" 138 - define in mt8195. 139 - For pull up type is RSEL, it can add RSEL define & resistance value(ohm) 140 - to set different resistance by identifying property "mediatek,rsel_resistance_in_si_unit". 141 - It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 142 - & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & "MTK_PULL_SET_RSEL_100" 143 - & "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 144 - define in mt8195. It can also support resistance value(ohm) 145 - "1000" & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" & "75000" in mt8195. 146 - oneOf: 147 - - enum: [100, 101, 102, 103] 148 - - description: mt8195 pull up PUPD/R0/R1 type define value. 149 - - enum: [200, 201, 202, 203, 204, 205, 206, 207] 150 - - description: mt8195 pull up RSEL type define value. 151 - - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000] 152 - - description: mt8195 pull up RSEL type si unit value(ohm). 153 - An example of using RSEL define: 154 - pincontroller { 155 - i2c0_pin { 156 - pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 157 - bias-pull-up = <MTK_PULL_SET_RSEL_001>; 158 - }; 159 - }; 160 - An example of using si unit resistance value(ohm): 161 - &pio { 162 - mediatek,rsel_resistance_in_si_unit; 163 - } 164 - pincontroller { 165 - i2c0_pin { 166 - pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 167 - bias-pull-up = <1000>; 168 - }; 169 - }; 170 - 171 - bias-disable: true 172 - 173 - output-high: true 174 - 175 - output-low: true 176 - 177 - input-enable: true 178 - 179 - input-disable: true 180 - 181 - input-schmitt-enable: true 182 - 183 - input-schmitt-disable: true 184 - 185 - required: 186 - - pinmux 187 - 188 62 additionalProperties: false 63 + patternProperties: 64 + '^pins': 65 + type: object 66 + additionalProperties: false 67 + description: | 68 + A pinctrl node should contain at least one subnodes representing the 69 + pinctrl groups available on the machine. Each subnode will list the 70 + pins it needs, and how they should be configured, with regard to muxer 71 + configuration, pullups, drive strength, input enable/disable and 72 + input schmitt. 73 + An example of using macro: 74 + pincontroller { 75 + /* GPIO0 set as multifunction GPIO0 */ 76 + gpio-pins { 77 + pins { 78 + pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 79 + } 80 + }; 81 + /* GPIO8 set as multifunction SDA0 */ 82 + i2c0-pins { 83 + pins { 84 + pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 85 + } 86 + }; 87 + }; 88 + $ref: "pinmux-node.yaml" 89 + 90 + properties: 91 + pinmux: 92 + description: | 93 + Integer array, represents gpio pin number and mux setting. 94 + Supported pin number and mux varies for different SoCs, and are 95 + defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h 96 + directly. 97 + 98 + drive-strength: 99 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 100 + 101 + bias-pull-down: 102 + description: | 103 + For pull down type is normal, it don't need add RSEL & R1R0 define 104 + and resistance value. 105 + For pull down type is PUPD/R0/R1 type, it can add R1R0 define to 106 + set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 107 + "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & 108 + "MTK_PUPD_SET_R1R0_11" define in mt8195. 109 + For pull down type is RSEL, it can add RSEL define & resistance 110 + value(ohm) to set different resistance by identifying property 111 + "mediatek,rsel_resistance_in_si_unit". 112 + It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 113 + & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" 114 + & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101" 115 + & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 116 + define in mt8195. It can also support resistance value(ohm) 117 + "75000" & "5000" in mt8195. 118 + oneOf: 119 + - enum: [100, 101, 102, 103] 120 + - description: mt8195 pull down PUPD/R0/R1 type define value. 121 + - enum: [200, 201, 202, 203, 204, 205, 206, 207] 122 + - description: mt8195 pull down RSEL type define value. 123 + - enum: [75000, 5000] 124 + - description: mt8195 pull down RSEL type si unit value(ohm). 125 + 126 + An example of using RSEL define: 127 + pincontroller { 128 + i2c0_pin { 129 + pins { 130 + pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 131 + bias-pull-down = <MTK_PULL_SET_RSEL_001>; 132 + } 133 + }; 134 + }; 135 + An example of using si unit resistance value(ohm): 136 + &pio { 137 + mediatek,rsel_resistance_in_si_unit; 138 + } 139 + pincontroller { 140 + i2c0_pin { 141 + pins { 142 + pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 143 + bias-pull-down = <75000>; 144 + } 145 + }; 146 + }; 147 + 148 + bias-pull-up: 149 + description: | 150 + For pull up type is normal, it don't need add RSEL & R1R0 define 151 + and resistance value. 152 + For pull up type is PUPD/R0/R1 type, it can add R1R0 define to 153 + set different resistance. It can support "MTK_PUPD_SET_R1R0_00" & 154 + "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & 155 + "MTK_PUPD_SET_R1R0_11" define in mt8195. 156 + For pull up type is RSEL, it can add RSEL define & resistance 157 + value(ohm) to set different resistance by identifying property 158 + "mediatek,rsel_resistance_in_si_unit". 159 + It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" 160 + & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" 161 + & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101" 162 + & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" 163 + define in mt8195. It can also support resistance value(ohm) 164 + "1000" & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" & 165 + "75000" in mt8195. 166 + oneOf: 167 + - enum: [100, 101, 102, 103] 168 + - description: mt8195 pull up PUPD/R0/R1 type define value. 169 + - enum: [200, 201, 202, 203, 204, 205, 206, 207] 170 + - description: mt8195 pull up RSEL type define value. 171 + - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000] 172 + - description: mt8195 pull up RSEL type si unit value(ohm). 173 + An example of using RSEL define: 174 + pincontroller { 175 + i2c0-pins { 176 + pins { 177 + pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 178 + bias-pull-up = <MTK_PULL_SET_RSEL_001>; 179 + } 180 + }; 181 + }; 182 + An example of using si unit resistance value(ohm): 183 + &pio { 184 + mediatek,rsel_resistance_in_si_unit; 185 + } 186 + pincontroller { 187 + i2c0-pins { 188 + pins { 189 + pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 190 + bias-pull-up = <1000>; 191 + } 192 + }; 193 + }; 194 + 195 + bias-disable: true 196 + 197 + output-high: true 198 + 199 + output-low: true 200 + 201 + input-enable: true 202 + 203 + input-disable: true 204 + 205 + input-schmitt-enable: true 206 + 207 + input-schmitt-disable: true 208 + 209 + required: 210 + - pinmux 211 + 212 + allOf: 213 + - $ref: "pinctrl.yaml#" 189 214 190 215 required: 191 216 - compatible ··· 226 201 227 202 examples: 228 203 - | 229 - #include <dt-bindings/pinctrl/mt8195-pinfunc.h> 230 - #include <dt-bindings/interrupt-controller/arm-gic.h> 231 - pio: pinctrl@10005000 { 232 - compatible = "mediatek,mt8195-pinctrl"; 233 - reg = <0x10005000 0x1000>, 234 - <0x11d10000 0x1000>, 235 - <0x11d30000 0x1000>, 236 - <0x11d40000 0x1000>, 237 - <0x11e20000 0x1000>, 238 - <0x11eb0000 0x1000>, 239 - <0x11f40000 0x1000>, 240 - <0x1000b000 0x1000>; 241 - reg-names = "iocfg0", "iocfg_bm", "iocfg_bl", 242 - "iocfg_br", "iocfg_lm", "iocfg_rb", 243 - "iocfg_tl", "eint"; 244 - gpio-controller; 245 - #gpio-cells = <2>; 246 - gpio-ranges = <&pio 0 0 144>; 247 - interrupt-controller; 248 - interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>; 249 - #interrupt-cells = <2>; 204 + #include <dt-bindings/pinctrl/mt8195-pinfunc.h> 205 + #include <dt-bindings/interrupt-controller/arm-gic.h> 206 + # 207 + pio: pinctrl@10005000 { 208 + compatible = "mediatek,mt8195-pinctrl"; 209 + reg = <0x10005000 0x1000>, 210 + <0x11d10000 0x1000>, 211 + <0x11d30000 0x1000>, 212 + <0x11d40000 0x1000>, 213 + <0x11e20000 0x1000>, 214 + <0x11eb0000 0x1000>, 215 + <0x11f40000 0x1000>, 216 + <0x1000b000 0x1000>; 217 + reg-names = "iocfg0", "iocfg_bm", "iocfg_bl", 218 + "iocfg_br", "iocfg_lm", "iocfg_rb", 219 + "iocfg_tl", "eint"; 220 + gpio-controller; 221 + #gpio-cells = <2>; 222 + gpio-ranges = <&pio 0 0 144>; 223 + interrupt-controller; 224 + interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>; 225 + #interrupt-cells = <2>; 250 226 251 - pio-pins { 252 - pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 253 - output-low; 254 - }; 255 - }; 227 + pio-pins { 228 + pins { 229 + pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 230 + output-low; 231 + }; 232 + }; 233 + 234 + spi0-pins { 235 + pins-spi { 236 + pinmux = <PINMUX_GPIO132__FUNC_SPIM0_CSB>, 237 + <PINMUX_GPIO134__FUNC_SPIM0_MO>, 238 + <PINMUX_GPIO133__FUNC_SPIM0_CLK>; 239 + bias-disable; 240 + }; 241 + pins-spi-mi { 242 + pinmux = <PINMUX_GPIO135__FUNC_SPIM0_MI>; 243 + bias-pull-down; 244 + }; 245 + }; 246 + };
+45
Documentation/devicetree/bindings/pinctrl/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/pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Pin controller device 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + - Rafał Miłecki <rafal@milecki.pl> 12 + 13 + description: | 14 + Pin controller devices should contain the pin configuration nodes that client 15 + devices reference. 16 + 17 + The contents of each of those pin configuration child nodes is defined 18 + entirely by the binding for the individual pin controller device. There 19 + exists no common standard for this content. The pinctrl framework only 20 + provides generic helper bindings that the pin controller driver can use. 21 + 22 + The pin configuration nodes need not be direct children of the pin controller 23 + device; they may be grandchildren, for example. Whether this is legal, and 24 + whether there is any interaction between the child and intermediate parent 25 + nodes, is again defined entirely by the binding for the individual pin 26 + controller device. 27 + 28 + properties: 29 + $nodename: 30 + pattern: "^(pinctrl|pinmux)(@[0-9a-f]+)?$" 31 + 32 + "#pinctrl-cells": 33 + description: > 34 + Number of pin control cells in addition to the index within the pin 35 + controller device instance. 36 + 37 + pinctrl-use-default: 38 + type: boolean 39 + description: > 40 + Indicates that the OS can use the boot default pin configuration. This 41 + allows using an OS that does not have a driver for the pin controller. 42 + This property can be set either globally for the pin controller or in 43 + child nodes for individual pin group control. 44 + 45 + additionalProperties: true
+3
Documentation/devicetree/bindings/pinctrl/qcom,ipq6018-pinctrl.yaml
··· 118 118 119 119 additionalProperties: false 120 120 121 + allOf: 122 + - $ref: "pinctrl.yaml#" 123 + 121 124 required: 122 125 - compatible 123 126 - reg
+3
Documentation/devicetree/bindings/pinctrl/qcom,lpass-lpi-pinctrl.yaml
··· 103 103 104 104 additionalProperties: false 105 105 106 + allOf: 107 + - $ref: "pinctrl.yaml#" 108 + 106 109 required: 107 110 - compatible 108 111 - reg
+1
Documentation/devicetree/bindings/pinctrl/qcom,mdm9607-pinctrl.yaml
··· 14 14 MDM9607 platform. 15 15 16 16 allOf: 17 + - $ref: "pinctrl.yaml#" 17 18 - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 19 19 20 properties:
+3
Documentation/devicetree/bindings/pinctrl/qcom,msm8226-pinctrl.yaml
··· 97 97 98 98 additionalProperties: false 99 99 100 + allOf: 101 + - $ref: "pinctrl.yaml#" 102 + 100 103 required: 101 104 - compatible 102 105 - reg
+3
Documentation/devicetree/bindings/pinctrl/qcom,msm8953-pinctrl.yaml
··· 133 133 134 134 additionalProperties: false 135 135 136 + allOf: 137 + - $ref: "pinctrl.yaml#" 138 + 136 139 required: 137 140 - compatible 138 141 - reg
+3
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
··· 17 17 compatible: 18 18 items: 19 19 - enum: 20 + - qcom,pm2250-gpio 20 21 - qcom,pm660-gpio 21 22 - qcom,pm660l-gpio 22 23 - qcom,pm6150-gpio ··· 27 26 - qcom,pm8005-gpio 28 27 - qcom,pm8008-gpio 29 28 - qcom,pm8018-gpio 29 + - qcom,pm8019-gpio 30 30 - qcom,pm8038-gpio 31 31 - qcom,pm8058-gpio 32 32 - qcom,pm8150-gpio 33 33 - qcom,pm8150b-gpio 34 + - qcom,pm8226-gpio 34 35 - qcom,pm8350-gpio 35 36 - qcom,pm8350b-gpio 36 37 - qcom,pm8350c-gpio
+3
Documentation/devicetree/bindings/pinctrl/qcom,qcm2290-pinctrl.yaml
··· 118 118 119 119 additionalProperties: false 120 120 121 + allOf: 122 + - $ref: "pinctrl.yaml#" 123 + 121 124 required: 122 125 - compatible 123 126 - reg
+3
Documentation/devicetree/bindings/pinctrl/qcom,sc7280-pinctrl.yaml
··· 123 123 124 124 additionalProperties: false 125 125 126 + allOf: 127 + - $ref: "pinctrl.yaml#" 128 + 126 129 required: 127 130 - compatible 128 131 - reg
+1
Documentation/devicetree/bindings/pinctrl/qcom,sc8180x-pinctrl.yaml
··· 14 14 SC8180X platform. 15 15 16 16 allOf: 17 + - $ref: "pinctrl.yaml#" 17 18 - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 19 19 20 properties:
+3
Documentation/devicetree/bindings/pinctrl/qcom,sdx55-pinctrl.yaml
··· 118 118 119 119 additionalProperties: false 120 120 121 + allOf: 122 + - $ref: "pinctrl.yaml#" 123 + 121 124 required: 122 125 - compatible 123 126 - reg
+191
Documentation/devicetree/bindings/pinctrl/qcom,sdx65-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,sdx65-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. SDX65 TLMM block 8 + 9 + maintainers: 10 + - Vamsi krishna Lanka <quic_vamslank@quicinc.com> 11 + 12 + description: 13 + This binding describes the Top Level Mode Multiplexer block found in the 14 + SDX65 platform. 15 + 16 + properties: 17 + compatible: 18 + const: qcom,sdx65-tlmm 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + interrupts: 24 + maxItems: 1 25 + 26 + interrupt-controller: true 27 + 28 + '#interrupt-cells': 29 + description: Specifies the PIN numbers and Flags, as defined in 30 + include/dt-bindings/interrupt-controller/irq.h 31 + const: 2 32 + 33 + gpio-controller: true 34 + 35 + '#gpio-cells': 36 + description: Specifying the pin number and flags, as defined in 37 + include/dt-bindings/gpio/gpio.h 38 + const: 2 39 + 40 + gpio-ranges: 41 + maxItems: 1 42 + 43 + gpio-reserved-ranges: 44 + maxItems: 1 45 + 46 + #PIN CONFIGURATION NODES 47 + patternProperties: 48 + '-state$': 49 + oneOf: 50 + - $ref: "#/$defs/qcom-sdx65-tlmm-state" 51 + - patternProperties: 52 + ".*": 53 + $ref: "#/$defs/qcom-sdx65-tlmm-state" 54 + '$defs': 55 + qcom-sdx65-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 subnode. 66 + items: 67 + oneOf: 68 + - pattern: "^gpio([0-9]|[1-9][0-9]|10[0-7])$" 69 + - enum: [ ufs_reset, sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data, sdc1_rclk ] 70 + minItems: 1 71 + maxItems: 150 72 + 73 + function: 74 + description: 75 + Specify the alternative function to be configured for the specified 76 + pins. Functions are only valid for gpio pins. 77 + enum: [ blsp_uart1, blsp_spi1, blsp_i2c1, blsp_uim1, atest_tsens, 78 + bimc_dte1, dac_calib0, blsp_spi8, blsp_uart8, blsp_uim8, 79 + qdss_cti_trig_out_b, bimc_dte0, dac_calib1, qdss_cti_trig_in_b, 80 + dac_calib2, atest_tsens2, atest_usb1, blsp_spi10, blsp_uart10, 81 + blsp_uim10, atest_bbrx1, atest_usb13, atest_bbrx0, atest_usb12, 82 + mdp_vsync, edp_lcd, blsp_i2c10, atest_gpsadc1, atest_usb11, 83 + atest_gpsadc0, edp_hot, atest_usb10, m_voc, dac_gpio, atest_char, 84 + cam_mclk, pll_bypassnl, qdss_stm7, blsp_i2c8, qdss_tracedata_b, 85 + pll_reset, qdss_stm6, qdss_stm5, qdss_stm4, atest_usb2, cci_i2c, 86 + qdss_stm3, dac_calib3, atest_usb23, atest_char3, dac_calib4, 87 + qdss_stm2, atest_usb22, atest_char2, qdss_stm1, dac_calib5, 88 + atest_usb21, atest_char1, dbg_out, qdss_stm0, dac_calib6, 89 + atest_usb20, atest_char0, dac_calib10, qdss_stm10, 90 + qdss_cti_trig_in_a, cci_timer4, blsp_spi6, blsp_uart6, blsp_uim6, 91 + blsp2_spi, qdss_stm9, qdss_cti_trig_out_a, dac_calib11, 92 + qdss_stm8, cci_timer0, qdss_stm13, dac_calib7, cci_timer1, 93 + qdss_stm12, dac_calib8, cci_timer2, blsp1_spi, qdss_stm11, 94 + dac_calib9, cci_timer3, cci_async, dac_calib12, blsp_i2c6, 95 + qdss_tracectl_a, dac_calib13, qdss_traceclk_a, dac_calib14, 96 + dac_calib15, hdmi_rcv, dac_calib16, hdmi_cec, pwr_modem, 97 + dac_calib17, hdmi_ddc, pwr_nav, dac_calib18, pwr_crypto, 98 + dac_calib19, hdmi_hot, dac_calib20, dac_calib21, pci_e0, 99 + dac_calib22, dac_calib23, dac_calib24, tsif1_sync, dac_calib25, 100 + sd_write, tsif1_error, blsp_spi2, blsp_uart2, blsp_uim2, 101 + qdss_cti, blsp_i2c2, blsp_spi3, blsp_uart3, blsp_uim3, blsp_i2c3, 102 + uim3, blsp_spi9, blsp_uart9, blsp_uim9, blsp10_spi, blsp_i2c9, 103 + blsp_spi7, blsp_uart7, blsp_uim7, qdss_tracedata_a, blsp_i2c7, 104 + qua_mi2s, gcc_gp1_clk_a, ssc_irq, uim4, blsp_spi11, blsp_uart11, 105 + blsp_uim11, gcc_gp2_clk_a, gcc_gp3_clk_a, blsp_i2c11, cri_trng0, 106 + cri_trng1, cri_trng, qdss_stm18, pri_mi2s, qdss_stm17, blsp_spi4, 107 + blsp_uart4, blsp_uim4, qdss_stm16, qdss_stm15, blsp_i2c4, 108 + qdss_stm14, dac_calib26, spkr_i2s, audio_ref, lpass_slimbus, 109 + isense_dbg, tsense_pwm1, tsense_pwm2, btfm_slimbus, ter_mi2s, 110 + qdss_stm22, qdss_stm21, qdss_stm20, qdss_stm19, gcc_gp1_clk_b, 111 + sec_mi2s, blsp_spi5, blsp_uart5, blsp_uim5, gcc_gp2_clk_b, 112 + gcc_gp3_clk_b, blsp_i2c5, blsp_spi12, blsp_uart12, blsp_uim12, 113 + qdss_stm25, qdss_stm31, blsp_i2c12, qdss_stm30, qdss_stm29, 114 + tsif1_clk, qdss_stm28, tsif1_en, tsif1_data, sdc4_cmd, qdss_stm27, 115 + qdss_traceclk_b, tsif2_error, sdc43, vfr_1, qdss_stm26, tsif2_clk, 116 + sdc4_clk, qdss_stm24, tsif2_en, sdc42, qdss_stm23, qdss_tracectl_b, 117 + sd_card, tsif2_data, sdc41, tsif2_sync, sdc40, mdp_vsync_p_b, 118 + ldo_en, mdp_vsync_s_b, ldo_update, blsp11_uart_tx_b, blsp11_uart_rx_b, 119 + blsp11_i2c_sda_b, prng_rosc, blsp11_i2c_scl_b, uim2, uim1, uim_batt, 120 + pci_e2, pa_indicator, adsp_ext, ddr_bist, qdss_tracedata_11, 121 + qdss_tracedata_12, modem_tsync, nav_dr, nav_pps, pci_e1, gsm_tx, 122 + qspi_cs, ssbi2, ssbi1, mss_lte, qspi_clk, qspi0, qspi1, qspi2, qspi3, 123 + gpio ] 124 + 125 + drive-strength: 126 + enum: [2, 4, 6, 8, 10, 12, 14, 16] 127 + default: 2 128 + description: 129 + Selects the drive strength for the specified pins, in mA. 130 + 131 + bias-pull-down: true 132 + 133 + bias-pull-up: true 134 + 135 + bias-disable: true 136 + 137 + output-high: true 138 + 139 + output-low: true 140 + 141 + required: 142 + - pins 143 + - function 144 + 145 + additionalProperties: false 146 + 147 + required: 148 + - compatible 149 + - reg 150 + - interrupts 151 + - interrupt-controller 152 + - '#interrupt-cells' 153 + - gpio-controller 154 + - '#gpio-cells' 155 + - gpio-ranges 156 + 157 + additionalProperties: false 158 + 159 + examples: 160 + - | 161 + #include <dt-bindings/interrupt-controller/arm-gic.h> 162 + tlmm: pinctrl@f100000 { 163 + compatible = "qcom,sdx65-tlmm"; 164 + reg = <0x03000000 0xdc2000>; 165 + gpio-controller; 166 + #gpio-cells = <2>; 167 + gpio-ranges = <&tlmm 0 0 109>; 168 + interrupt-controller; 169 + #interrupt-cells = <2>; 170 + interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>; 171 + 172 + gpio-wo-subnode-state { 173 + pins = "gpio1"; 174 + function = "gpio"; 175 + }; 176 + 177 + uart-w-subnodes-state { 178 + rx { 179 + pins = "gpio4"; 180 + function = "blsp_uart1"; 181 + bias-pull-up; 182 + }; 183 + 184 + tx { 185 + pins = "gpio5"; 186 + function = "blsp_uart1"; 187 + bias-disable; 188 + }; 189 + }; 190 + }; 191 + ...
+3
Documentation/devicetree/bindings/pinctrl/qcom,sm6115-pinctrl.yaml
··· 121 121 122 122 additionalProperties: false 123 123 124 + allOf: 125 + - $ref: "pinctrl.yaml#" 126 + 124 127 required: 125 128 - compatible 126 129 - reg
+1
Documentation/devicetree/bindings/pinctrl/qcom,sm6125-pinctrl.yaml
··· 13 13 in the SM6125 platform. 14 14 15 15 allOf: 16 + - $ref: "pinctrl.yaml#" 16 17 - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 17 18 18 19 properties:
+1
Documentation/devicetree/bindings/pinctrl/qcom,sm6350-pinctrl.yaml
··· 14 14 in the SM6350 platform. 15 15 16 16 allOf: 17 + - $ref: "pinctrl.yaml#" 17 18 - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 19 19 20 properties:
+3
Documentation/devicetree/bindings/pinctrl/qcom,sm8250-pinctrl.yaml
··· 115 115 116 116 additionalProperties: false 117 117 118 + allOf: 119 + - $ref: "pinctrl.yaml#" 120 + 118 121 required: 119 122 - compatible 120 123 - reg
+1
Documentation/devicetree/bindings/pinctrl/qcom,sm8350-pinctrl.yaml
··· 14 14 in the SM8350 platform. 15 15 16 16 allOf: 17 + - $ref: "pinctrl.yaml#" 17 18 - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 19 19 20 properties:
+143
Documentation/devicetree/bindings/pinctrl/qcom,sm8450-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,sm8450-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. SM8450 TLMM block 8 + 9 + maintainers: 10 + - Vinod Koul <vkoul@kernel.org> 11 + 12 + description: | 13 + This binding describes the Top Level Mode Multiplexer (TLMM) block found 14 + in the SM8450 platform. 15 + 16 + allOf: 17 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 + 19 + properties: 20 + compatible: 21 + const: qcom,sm8450-tlmm 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: true 27 + interrupt-controller: true 28 + '#interrupt-cells': true 29 + gpio-controller: true 30 + gpio-reserved-ranges: true 31 + '#gpio-cells': true 32 + gpio-ranges: true 33 + wakeup-parent: true 34 + 35 + required: 36 + - compatible 37 + - reg 38 + 39 + additionalProperties: false 40 + 41 + patternProperties: 42 + '-state$': 43 + oneOf: 44 + - $ref: "#/$defs/qcom-sm8450-tlmm-state" 45 + - patternProperties: 46 + ".*": 47 + $ref: "#/$defs/qcom-sm8450-tlmm-state" 48 + 49 + $defs: 50 + qcom-sm8450-tlmm-state: 51 + type: object 52 + description: 53 + Pinctrl node's client devices use subnodes for desired pin configuration. 54 + Client device subnodes use below standard properties. 55 + $ref: "qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state" 56 + 57 + properties: 58 + pins: 59 + description: 60 + List of gpio pins affected by the properties specified in this 61 + subnode. 62 + items: 63 + oneOf: 64 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-9])$" 65 + - enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ] 66 + minItems: 1 67 + maxItems: 36 68 + 69 + function: 70 + description: 71 + Specify the alternative function to be configured for the specified 72 + pins. 73 + enum: [ aon_cam, atest_char, atest_usb, audio_ref, cam_mclk, cci_async, 74 + cci_i2c, cci_timer, cmu_rng, coex_uart1, coex_uart2, cri_trng, 75 + cri_trng0, cri_trng1, dbg_out, ddr_bist, ddr_pxi0, ddr_pxi1, 76 + ddr_pxi2, ddr_pxi3, dp_hot, gcc_gp1, gcc_gp2, gcc_gp3, 77 + gpio, ibi_i3c, jitter_bist, mdp_vsync, mdp_vsync0, mdp_vsync1, 78 + mdp_vsync2, mdp_vsync3, mi2s0_data0, mi2s0_data1, mi2s0_sck, 79 + mi2s0_ws, mi2s2_data0, mi2s2_data1, mi2s2_sck, mi2s2_ws, 80 + mss_grfc0, mss_grfc1, mss_grfc10, mss_grfc11, mss_grfc12, 81 + mss_grfc2, mss_grfc3, mss_grfc4, mss_grfc5, mss_grfc6, 82 + mss_grfc7, mss_grfc8, mss_grfc9, nav, pcie0_clkreqn, 83 + pcie1_clkreqn, phase_flag, pll_bist, pll_clk, pri_mi2s, 84 + prng_rosc, qdss_cti, qdss_gpio, qlink0_enable, qlink0_request, 85 + qlink0_wmss, qlink1_enable, qlink1_request, qlink1_wmss, 86 + qlink2_enable, qlink2_request, qlink2_wmss, qspi0, qspi1, 87 + qspi2, qspi3, qspi_clk, qspi_cs, qup0, qup1, qup10, qup11, 88 + qup12, qup13, qup14, qup15, qup16, qup17, qup18, qup19, qup2, 89 + qup20, qup21, qup3, qup4, qup5, qup6, qup7, qup8, qup9, qup_l4, 90 + qup_l5, qup_l6, sd_write, sdc40, sdc41, sdc42, sdc43, sdc4_clk, 91 + sdc4_cmd, sec_mi2s, tb_trig, tgu_ch0, tgu_ch1, tgu_ch2, 92 + tgu_ch3, tmess_prng0, tmess_prng1, tmess_prng2, tmess_prng3, 93 + tsense_pwm1, tsense_pwm2, uim0_clk, uim0_data, uim0_present, 94 + uim0_reset, uim1_clk, uim1_data, uim1_present, uim1_reset, 95 + usb2phy_ac, usb_phy, vfr_0, vfr_1, vsense_trigger ] 96 + 97 + bias-disable: true 98 + bias-pull-down: true 99 + bias-pull-up: true 100 + drive-strength: true 101 + input-enable: true 102 + output-high: true 103 + output-low: true 104 + 105 + required: 106 + - pins 107 + - function 108 + 109 + additionalProperties: false 110 + 111 + examples: 112 + - | 113 + #include <dt-bindings/interrupt-controller/arm-gic.h> 114 + pinctrl@f100000 { 115 + compatible = "qcom,sm8450-tlmm"; 116 + reg = <0x0f100000 0x300000>; 117 + gpio-controller; 118 + #gpio-cells = <2>; 119 + gpio-ranges = <&tlmm 0 0 211>; 120 + interrupt-controller; 121 + #interrupt-cells = <2>; 122 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 123 + 124 + gpio-wo-subnode-state { 125 + pins = "gpio1"; 126 + function = "gpio"; 127 + }; 128 + 129 + uart-w-subnodes-state { 130 + rx { 131 + pins = "gpio26"; 132 + function = "qup7"; 133 + bias-pull-up; 134 + }; 135 + 136 + tx { 137 + pins = "gpio27"; 138 + function = "qup7"; 139 + bias-disable; 140 + }; 141 + }; 142 + }; 143 + ...
+3
Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml
··· 51 51 should not be accessed by the OS. Please see the ../gpio/gpio.txt for more 52 52 information. 53 53 54 + allOf: 55 + - $ref: "pinctrl.yaml#" 56 + 54 57 required: 55 58 - interrupts 56 59 - interrupt-controller
+3
Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml
··· 44 44 45 45 additionalProperties: false 46 46 47 + allOf: 48 + - $ref: "pinctrl.yaml#" 49 + 47 50 required: 48 51 - compatible 49 52
+3
Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
··· 70 70 power-domains: 71 71 maxItems: 1 72 72 73 + allOf: 74 + - $ref: "pinctrl.yaml#" 75 + 73 76 required: 74 77 - compatible 75 78 - reg
+3
Documentation/devicetree/bindings/pinctrl/renesas,rza1-ports.yaml
··· 31 31 reg: 32 32 maxItems: 1 33 33 34 + allOf: 35 + - $ref: "pinctrl.yaml#" 36 + 34 37 required: 35 38 - compatible 36 39 - reg
+3
Documentation/devicetree/bindings/pinctrl/renesas,rza2-pinctrl.yaml
··· 72 72 73 73 additionalProperties: false 74 74 75 + allOf: 76 + - $ref: "pinctrl.yaml#" 77 + 75 78 required: 76 79 - compatible 77 80 - reg
+5
Documentation/devicetree/bindings/pinctrl/renesas,rzg2l-pinctrl.yaml
··· 73 73 pins: true 74 74 drive-strength: 75 75 enum: [ 2, 4, 8, 12 ] 76 + output-impedance-ohms: 77 + enum: [ 33, 50, 66, 100 ] 76 78 power-source: 77 79 enum: [ 1800, 2500, 3300 ] 78 80 slew-rate: true ··· 91 89 92 90 additionalProperties: 93 91 $ref: "#/additionalProperties/anyOf/0" 92 + 93 + allOf: 94 + - $ref: "pinctrl.yaml#" 94 95 95 96 required: 96 97 - compatible
+3
Documentation/devicetree/bindings/pinctrl/renesas,rzn1-pinctrl.yaml
··· 31 31 description: 32 32 The bus clock, sometimes described as pclk, for register accesses. 33 33 34 + allOf: 35 + - $ref: "pinctrl.yaml#" 36 + 34 37 required: 35 38 - compatible 36 39 - reg
+3
Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
··· 67 67 68 68 ranges: true 69 69 70 + allOf: 71 + - $ref: "pinctrl.yaml#" 72 + 70 73 required: 71 74 - compatible 72 75 - rockchip,grf
+1
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
··· 22 22 - "samsung,exynos5420-pinctrl": for Exynos5420 compatible pin-controller. 23 23 - "samsung,exynos5433-pinctrl": for Exynos5433 compatible pin-controller. 24 24 - "samsung,exynos7-pinctrl": for Exynos7 compatible pin-controller. 25 + - "samsung,exynos7885-pinctrl": for Exynos7885 compatible pin-controller. 25 26 - "samsung,exynos850-pinctrl": for Exynos850 compatible pin-controller. 26 27 - "samsung,exynosautov9-pinctrl": for ExynosAutov9 compatible pin-controller. 27 28
+39 -5
Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.yaml
··· 10 10 - Masahiro Yamada <yamada.masahiro@socionext.com> 11 11 12 12 properties: 13 - $nodename: 14 - pattern: "pinctrl" 15 - 16 13 compatible: 17 14 enum: 18 15 - socionext,uniphier-ld4-pinctrl ··· 23 26 - socionext,uniphier-pxs3-pinctrl 24 27 - socionext,uniphier-nx1-pinctrl 25 28 29 + additionalProperties: 30 + type: object 31 + 32 + allOf: 33 + - $ref: pincfg-node.yaml# 34 + - $ref: pinmux-node.yaml# 35 + 36 + properties: 37 + phandle: true 38 + function: true 39 + groups: true 40 + pins: true 41 + bias-pull-up: true 42 + bias-pull-down: true 43 + bias-pull-pin-default: true 44 + drive-strength: true 45 + 46 + additionalProperties: 47 + type: object 48 + 49 + allOf: 50 + - $ref: pincfg-node.yaml# 51 + - $ref: pinmux-node.yaml# 52 + 53 + properties: 54 + phandle: true 55 + function: true 56 + groups: true 57 + pins: true 58 + bias-pull-up: true 59 + bias-pull-down: true 60 + bias-pull-pin-default: true 61 + drive-strength: true 62 + 63 + unevaluatedProperties: false 64 + 65 + allOf: 66 + - $ref: "pinctrl.yaml#" 67 + 26 68 required: 27 69 - compatible 28 - 29 - additionalProperties: false 30 70 31 71 examples: 32 72 - |
+3
Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
··· 183 183 required: 184 184 - pinmux 185 185 186 + allOf: 187 + - $ref: "pinctrl.yaml#" 188 + 186 189 required: 187 190 - compatible 188 191 - '#address-cells'
+4 -1
Documentation/devicetree/bindings/pinctrl/toshiba,visconti-pinctrl.yaml
··· 20 20 reg: 21 21 maxItems: 1 22 22 23 + allOf: 24 + - $ref: "pinctrl.yaml#" 25 + 23 26 required: 24 27 - compatible 25 28 - reg ··· 83 80 #address-cells = <2>; 84 81 #size-cells = <2>; 85 82 86 - pmux: pmux@24190000 { 83 + pmux: pinmux@24190000 { 87 84 compatible = "toshiba,tmpv7708-pinctrl"; 88 85 reg = <0 0x24190000 0 0x10000>; 89 86
+3
Documentation/devicetree/bindings/pinctrl/xlnx,zynq-pinctrl.yaml
··· 167 167 168 168 additionalProperties: false 169 169 170 + allOf: 171 + - $ref: "pinctrl.yaml#" 172 + 170 173 required: 171 174 - compatible 172 175 - reg
+3
Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
··· 290 290 291 291 additionalProperties: false 292 292 293 + allOf: 294 + - $ref: pinctrl.yaml# 295 + 293 296 required: 294 297 - compatible 295 298
+5
MAINTAINERS
··· 15241 15241 S: Maintained 15242 15242 F: drivers/pinctrl/pinctrl-single.c 15243 15243 15244 + PIN CONTROLLER - THUNDERBAY 15245 + M: Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com> 15246 + S: Supported 15247 + F: drivers/pinctrl/pinctrl-thunderbay.c 15248 + 15244 15249 PKTCDVD DRIVER 15245 15250 M: linux-block@vger.kernel.org 15246 15251 S: Orphan
+1 -22
drivers/gpio/gpio-mockup.c
··· 491 491 } 492 492 } 493 493 494 - static __init char **gpio_mockup_make_line_names(const char *label, 495 - unsigned int num_lines) 496 - { 497 - unsigned int i; 498 - char **names; 499 - 500 - names = kcalloc(num_lines + 1, sizeof(char *), GFP_KERNEL); 501 - if (!names) 502 - return NULL; 503 - 504 - for (i = 0; i < num_lines; i++) { 505 - names[i] = kasprintf(GFP_KERNEL, "%s-%u", label, i); 506 - if (!names[i]) { 507 - kfree_strarray(names, i); 508 - return NULL; 509 - } 510 - } 511 - 512 - return names; 513 - } 514 - 515 494 static int __init gpio_mockup_register_chip(int idx) 516 495 { 517 496 struct property_entry properties[GPIO_MOCKUP_MAX_PROP]; ··· 517 538 properties[prop++] = PROPERTY_ENTRY_U16("nr-gpios", ngpio); 518 539 519 540 if (gpio_mockup_named_lines) { 520 - line_names = gpio_mockup_make_line_names(chip_label, ngpio); 541 + line_names = kasprintf_strarray(GFP_KERNEL, chip_label, ngpio); 521 542 if (!line_names) 522 543 return -ENOMEM; 523 544
+238 -220
drivers/pinctrl/Kconfig
··· 31 31 help 32 32 Say Y here to add some extra checks and diagnostics to PINCTRL calls. 33 33 34 + config PINCTRL_AMD 35 + tristate "AMD GPIO pin control" 36 + depends on HAS_IOMEM 37 + depends on ACPI || COMPILE_TEST 38 + select GPIOLIB 39 + select GPIOLIB_IRQCHIP 40 + select PINMUX 41 + select PINCONF 42 + select GENERIC_PINCONF 43 + help 44 + The driver for memory mapped GPIO functionality on AMD platforms 45 + (x86 or arm). Most of the pins are usually muxed to some other 46 + functionality by firmware, so only a small amount is available 47 + for GPIO use. 48 + 49 + Requires ACPI/FDT device enumeration code to set up a platform 50 + device. 51 + 34 52 config PINCTRL_APPLE_GPIO 35 53 tristate "Apple SoC GPIO pin controller driver" 36 54 depends on ARCH_APPLE ··· 87 69 open drain configuration for the GPIO pins of AS3722 devices. It also 88 70 supports the GPIO functionality through gpiolib. 89 71 90 - config PINCTRL_AXP209 91 - tristate "X-Powers AXP209 PMIC pinctrl and GPIO Support" 92 - depends on MFD_AXP20X 93 - depends on OF 94 - select PINMUX 95 - select GENERIC_PINCONF 96 - select GPIOLIB 97 - help 98 - AXP PMICs provides multiple GPIOs that can be muxed for different 99 - functions. This driver bundles a pinctrl driver to select the function 100 - muxing and a GPIO driver to handle the GPIO when the GPIO function is 101 - selected. 102 - Say yes to enable pinctrl and GPIO support for the AXP209 PMIC 103 - 104 72 config PINCTRL_AT91 105 73 bool "AT91 pinctrl driver" 106 74 depends on OF ··· 113 109 Say Y here to enable the at91 pinctrl/gpio driver for Atmel PIO4 114 110 controller available on sama5d2 SoC. 115 111 116 - config PINCTRL_AMD 117 - tristate "AMD GPIO pin control" 118 - depends on HAS_IOMEM 119 - depends on ACPI || COMPILE_TEST 120 - select GPIOLIB 121 - select GPIOLIB_IRQCHIP 112 + config PINCTRL_AXP209 113 + tristate "X-Powers AXP209 PMIC pinctrl and GPIO Support" 114 + depends on MFD_AXP20X 115 + depends on OF 122 116 select PINMUX 123 - select PINCONF 124 117 select GENERIC_PINCONF 118 + select GPIOLIB 125 119 help 126 - driver for memory mapped GPIO functionality on AMD platforms 127 - (x86 or arm).Most pins are usually muxed to some other 128 - functionality by firmware,so only a small amount is available 129 - for gpio use. 130 - 131 - Requires ACPI/FDT device enumeration code to set up a platform 132 - device. 120 + AXP PMICs provides multiple GPIOs that can be muxed for different 121 + functions. This driver bundles a pinctrl driver to select the function 122 + muxing and a GPIO driver to handle the GPIO when the GPIO function is 123 + selected. 124 + Say Y to enable pinctrl and GPIO support for the AXP209 PMIC. 133 125 134 126 config PINCTRL_BM1880 135 127 bool "Bitmain BM1880 Pinctrl driver" ··· 136 136 Pinctrl driver for Bitmain BM1880 SoC. 137 137 138 138 config PINCTRL_DA850_PUPD 139 - tristate "TI DA850/OMAP-L138/AM18XX pullup/pulldown groups" 139 + tristate "TI DA850/OMAP-L138/AM18XX pull-up and pull-down groups" 140 140 depends on OF && (ARCH_DAVINCI_DA850 || COMPILE_TEST) 141 141 select PINCONF 142 142 select GENERIC_PINCONF 143 143 help 144 144 Driver for TI DA850/OMAP-L138/AM18XX pinconf. Used to control 145 - pullup/pulldown pin groups. 145 + pull-up and pull-down pin groups. 146 146 147 147 config PINCTRL_DA9062 148 148 tristate "Dialog Semiconductor DA9062 PMIC pinctrl and GPIO Support" ··· 154 154 function muxing and a GPIO driver to handle the GPIO when the GPIO 155 155 function is selected. 156 156 157 - Say yes to enable pinctrl and GPIO support for the DA9062 PMIC. 157 + Say Y to enable pinctrl and GPIO support for the DA9062 PMIC. 158 158 159 159 config PINCTRL_DIGICOLOR 160 160 bool ··· 162 162 select PINMUX 163 163 select GENERIC_PINCONF 164 164 165 + config PINCTRL_EQUILIBRIUM 166 + tristate "Generic pinctrl and GPIO driver for Intel Lightning Mountain SoC" 167 + depends on OF && HAS_IOMEM 168 + depends on X86 || COMPILE_TEST 169 + select PINMUX 170 + select PINCONF 171 + select GPIOLIB 172 + select GPIO_GENERIC 173 + select GPIOLIB_IRQCHIP 174 + select GENERIC_PINCONF 175 + select GENERIC_PINCTRL_GROUPS 176 + select GENERIC_PINMUX_FUNCTIONS 177 + help 178 + Equilibrium driver is a pinctrl and GPIO driver for Intel Lightning 179 + Mountain network processor SoC that supports both the GPIO and pin 180 + control frameworks. It provides interfaces to setup pin muxing, assign 181 + desired pin functions, configure GPIO attributes for LGM SoC pins. 182 + Pin muxing and pin config settings are retrieved from device tree. 183 + 184 + config PINCTRL_GEMINI 185 + bool 186 + depends on ARCH_GEMINI 187 + default ARCH_GEMINI 188 + select PINMUX 189 + select GENERIC_PINCONF 190 + select MFD_SYSCON 191 + 192 + config PINCTRL_INGENIC 193 + bool "Pinctrl driver for the Ingenic JZ47xx SoCs" 194 + default MACH_INGENIC 195 + depends on OF 196 + depends on MIPS || COMPILE_TEST 197 + select GENERIC_PINCONF 198 + select GENERIC_PINCTRL_GROUPS 199 + select GENERIC_PINMUX_FUNCTIONS 200 + select GPIOLIB 201 + select GPIOLIB_IRQCHIP 202 + select REGMAP_MMIO 203 + 204 + config PINCTRL_K210 205 + bool "Pinctrl driver for the Canaan Kendryte K210 SoC" 206 + depends on RISCV && SOC_CANAAN && OF 207 + select GENERIC_PINMUX_FUNCTIONS 208 + select GENERIC_PINCONF 209 + select GPIOLIB 210 + select OF_GPIO 211 + select REGMAP_MMIO 212 + default SOC_CANAAN 213 + help 214 + Add support for the Canaan Kendryte K210 RISC-V SOC Field 215 + Programmable IO Array (FPIOA) controller. 216 + 217 + config PINCTRL_KEEMBAY 218 + tristate "Pinctrl driver for Intel Keem Bay SoC" 219 + depends on ARCH_KEEMBAY || (ARM64 && COMPILE_TEST) 220 + depends on HAS_IOMEM 221 + select PINMUX 222 + select PINCONF 223 + select GENERIC_PINCONF 224 + select GENERIC_PINCTRL_GROUPS 225 + select GENERIC_PINMUX_FUNCTIONS 226 + select GPIOLIB 227 + select GPIOLIB_IRQCHIP 228 + select GPIO_GENERIC 229 + help 230 + This selects pin control driver for the Intel Keem Bay SoC. 231 + It provides pin config functions such as pull-up, pull-down, 232 + interrupt, drive strength, sec lock, Schmitt trigger, slew 233 + rate control and direction control. This module will be 234 + called as pinctrl-keembay. 235 + 165 236 config PINCTRL_LANTIQ 166 237 bool 167 238 depends on LANTIQ 168 239 select PINMUX 169 240 select PINCONF 241 + 242 + config PINCTRL_FALCON 243 + bool 244 + depends on SOC_FALCON 245 + depends on PINCTRL_LANTIQ 246 + 247 + config PINCTRL_XWAY 248 + bool 249 + depends on SOC_TYPE_XWAY 250 + depends on PINCTRL_LANTIQ 170 251 171 252 config PINCTRL_LPC18XX 172 253 bool "NXP LPC18XX/43XX SCU pinctrl driver" ··· 258 177 help 259 178 Pinctrl driver for NXP LPC18xx/43xx System Control Unit (SCU). 260 179 261 - config PINCTRL_FALCON 262 - bool 263 - depends on SOC_FALCON 264 - depends on PINCTRL_LANTIQ 265 - 266 - config PINCTRL_GEMINI 267 - bool 268 - depends on ARCH_GEMINI 269 - default ARCH_GEMINI 180 + config PINCTRL_MAX77620 181 + tristate "MAX77620/MAX20024 Pincontrol support" 182 + depends on MFD_MAX77620 && OF 270 183 select PINMUX 271 184 select GENERIC_PINCONF 272 - select MFD_SYSCON 185 + help 186 + Say Y here to enable Pin control support for Maxim MAX77620 PMIC. 187 + This PMIC has 8 GPIO pins that work as GPIO as well as special 188 + function in alternate mode. This driver also configure push-pull, 189 + open drain, FPS slots etc. 273 190 274 191 config PINCTRL_MCP23S08_I2C 275 192 tristate ··· 291 212 This provides a GPIO interface supporting inputs and outputs and a 292 213 corresponding interrupt-controller. 293 214 215 + config PINCTRL_MICROCHIP_SGPIO 216 + bool "Pinctrl driver for Microsemi/Microchip Serial GPIO" 217 + depends on OF 218 + depends on HAS_IOMEM 219 + select GPIOLIB 220 + select GPIOLIB_IRQCHIP 221 + select GENERIC_PINCONF 222 + select GENERIC_PINCTRL_GROUPS 223 + select GENERIC_PINMUX_FUNCTIONS 224 + select OF_GPIO 225 + help 226 + Support for the serial GPIO interface used on Microsemi and 227 + Microchip SoCs. By using a serial interface, the SIO 228 + controller significantly extends the number of available 229 + GPIOs with a minimum number of additional pins on the 230 + device. The primary purpose of the SIO controller is to 231 + connect control signals from SFP modules and to act as an 232 + LED controller. 233 + 234 + config PINCTRL_OCELOT 235 + bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs" 236 + depends on OF 237 + depends on HAS_IOMEM 238 + select GPIOLIB 239 + select GPIOLIB_IRQCHIP 240 + select GENERIC_PINCONF 241 + select GENERIC_PINCTRL_GROUPS 242 + select GENERIC_PINMUX_FUNCTIONS 243 + select OF_GPIO 244 + select REGMAP_MMIO 245 + 294 246 config PINCTRL_OXNAS 295 247 bool 296 248 depends on OF ··· 332 222 select OF_GPIO 333 223 select GPIOLIB_IRQCHIP 334 224 select MFD_SYSCON 225 + 226 + config PINCTRL_PALMAS 227 + tristate "Pinctrl driver for the PALMAS Series MFD devices" 228 + depends on OF && MFD_PALMAS 229 + select PINMUX 230 + select GENERIC_PINCONF 231 + help 232 + Palmas device supports the configuration of pins for different 233 + functionality. This driver supports the pinmux, push-pull and 234 + open drain configuration for the Palmas series devices like 235 + TPS65913, TPS80036 etc. 236 + 237 + config PINCTRL_PIC32 238 + bool "Microchip PIC32 pin controller driver" 239 + depends on OF 240 + depends on MACH_PIC32 241 + select PINMUX 242 + select GENERIC_PINCONF 243 + select GPIOLIB_IRQCHIP 244 + select OF_GPIO 245 + help 246 + This is the pin controller and gpio driver for Microchip PIC32 247 + microcontrollers. This option is selected automatically when specific 248 + machine and arch are selected to build. 249 + 250 + config PINCTRL_PIC32MZDA 251 + def_bool y if PIC32MZDA 252 + select PINCTRL_PIC32 253 + 254 + config PINCTRL_PISTACHIO 255 + bool "IMG Pistachio SoC pinctrl driver" 256 + depends on OF && (MIPS || COMPILE_TEST) 257 + depends on GPIOLIB 258 + select PINMUX 259 + select GENERIC_PINCONF 260 + select GPIOLIB_IRQCHIP 261 + select OF_GPIO 262 + help 263 + This support pinctrl and GPIO driver for IMG Pistachio SoC. 264 + 265 + config PINCTRL_RK805 266 + tristate "Pinctrl and GPIO driver for RK805 PMIC" 267 + depends on MFD_RK808 268 + select GPIOLIB 269 + select PINMUX 270 + select GENERIC_PINCONF 271 + help 272 + This selects the pinctrl driver for RK805. 335 273 336 274 config PINCTRL_ROCKCHIP 337 275 tristate "Rockchip gpio and pinctrl driver" ··· 393 235 select OF_GPIO 394 236 default ARCH_ROCKCHIP 395 237 help 396 - This support pinctrl and gpio driver for Rockchip SoCs. 238 + This support pinctrl and GPIO driver for Rockchip SoCs. 397 239 398 240 config PINCTRL_SINGLE 399 241 tristate "One-register-per-pin type device tree based pinctrl driver" ··· 404 246 select GENERIC_PINCONF 405 247 help 406 248 This selects the device tree based generic pinctrl driver. 407 - 408 - config PINCTRL_SX150X 409 - bool "Semtech SX150x I2C GPIO expander pinctrl driver" 410 - depends on I2C=y 411 - select PINMUX 412 - select PINCONF 413 - select GENERIC_PINCONF 414 - select GPIOLIB 415 - select GPIOLIB_IRQCHIP 416 - select REGMAP 417 - help 418 - Say yes here to provide support for Semtech SX150x-series I2C 419 - GPIO expanders as pinctrl module. 420 - Compatible models include: 421 - - 8 bits: sx1508q, sx1502q 422 - - 16 bits: sx1509q, sx1506q 423 - 424 - config PINCTRL_PISTACHIO 425 - bool "IMG Pistachio SoC pinctrl driver" 426 - depends on OF && (MIPS || COMPILE_TEST) 427 - depends on GPIOLIB 428 - select PINMUX 429 - select GENERIC_PINCONF 430 - select GPIOLIB_IRQCHIP 431 - select OF_GPIO 432 - help 433 - This support pinctrl and gpio driver for IMG Pistachio SoC. 434 249 435 250 config PINCTRL_ST 436 251 bool ··· 443 312 and configuring push-pull, open-drain, and can also be used as 444 313 interrupt-controller. 445 314 446 - config PINCTRL_MAX77620 447 - tristate "MAX77620/MAX20024 Pincontrol support" 448 - depends on MFD_MAX77620 && OF 315 + config PINCTRL_SX150X 316 + bool "Semtech SX150x I2C GPIO expander pinctrl driver" 317 + depends on I2C=y 449 318 select PINMUX 319 + select PINCONF 450 320 select GENERIC_PINCONF 451 - help 452 - Say Yes here to enable Pin control support for Maxim PMIC MAX77620. 453 - This PMIC has 8 GPIO pins that work as GPIO as well as special 454 - function in alternate mode. This driver also configure push-pull, 455 - open drain, FPS slots etc. 456 - 457 - config PINCTRL_PALMAS 458 - tristate "Pinctrl driver for the PALMAS Series MFD devices" 459 - depends on OF && MFD_PALMAS 460 - select PINMUX 461 - select GENERIC_PINCONF 462 - help 463 - Palmas device supports the configuration of pins for different 464 - functionality. This driver supports the pinmux, push-pull and 465 - open drain configuration for the Palmas series devices like 466 - TPS65913, TPS80036 etc. 467 - 468 - config PINCTRL_PIC32 469 - bool "Microchip PIC32 pin controller driver" 470 - depends on OF 471 - depends on MACH_PIC32 472 - select PINMUX 473 - select GENERIC_PINCONF 321 + select GPIOLIB 474 322 select GPIOLIB_IRQCHIP 475 - select OF_GPIO 323 + select REGMAP 476 324 help 477 - This is the pin controller and gpio driver for Microchip PIC32 478 - microcontrollers. This option is selected automatically when specific 479 - machine and arch are selected to build. 325 + Say Y here to provide support for Semtech SX150x-series I2C 326 + GPIO expanders as pinctrl module. 327 + Compatible models include: 328 + - 8 bits: sx1508q, sx1502q 329 + - 16 bits: sx1509q, sx1506q 480 330 481 - config PINCTRL_PIC32MZDA 482 - def_bool y if PIC32MZDA 483 - select PINCTRL_PIC32 331 + config PINCTRL_TB10X 332 + bool 333 + depends on OF && ARC_PLAT_TB10X 334 + select GPIOLIB 335 + 336 + config PINCTRL_THUNDERBAY 337 + tristate "Generic pinctrl and GPIO driver for Intel Thunder Bay SoC" 338 + depends on ARCH_THUNDERBAY || (ARM64 && COMPILE_TEST) 339 + depends on HAS_IOMEM 340 + select PINMUX 341 + select PINCONF 342 + select GENERIC_PINCONF 343 + select GENERIC_PINCTRL_GROUPS 344 + select GENERIC_PINMUX_FUNCTIONS 345 + select GPIOLIB 346 + select GPIOLIB_IRQCHIP 347 + select GPIO_GENERIC 348 + help 349 + This selects pin control driver for the Intel Thunder Bay SoC. 350 + It provides pin config functions such as pull-up, pull-down, 351 + interrupt, drive strength, sec lock, Schmitt trigger, slew 352 + rate control and direction control. This module will be 353 + called as pinctrl-thunderbay. 484 354 485 355 config PINCTRL_ZYNQ 486 356 bool "Pinctrl driver for Xilinx Zynq" ··· 507 375 This driver can also be built as a module. If so, the module 508 376 will be called pinctrl-zynqmp. 509 377 510 - config PINCTRL_INGENIC 511 - bool "Pinctrl driver for the Ingenic JZ47xx SoCs" 512 - default MACH_INGENIC 513 - depends on OF 514 - depends on MIPS || COMPILE_TEST 515 - select GENERIC_PINCONF 516 - select GENERIC_PINCTRL_GROUPS 517 - select GENERIC_PINMUX_FUNCTIONS 518 - select GPIOLIB 519 - select GPIOLIB_IRQCHIP 520 - select REGMAP_MMIO 521 - 522 - config PINCTRL_RK805 523 - tristate "Pinctrl and GPIO driver for RK805 PMIC" 524 - depends on MFD_RK808 525 - select GPIOLIB 526 - select PINMUX 527 - select GENERIC_PINCONF 528 - help 529 - This selects the pinctrl driver for RK805. 530 - 531 - config PINCTRL_OCELOT 532 - bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs" 533 - depends on OF 534 - depends on HAS_IOMEM 535 - select GPIOLIB 536 - select GPIOLIB_IRQCHIP 537 - select GENERIC_PINCONF 538 - select GENERIC_PINCTRL_GROUPS 539 - select GENERIC_PINMUX_FUNCTIONS 540 - select OF_GPIO 541 - select REGMAP_MMIO 542 - 543 - config PINCTRL_MICROCHIP_SGPIO 544 - bool "Pinctrl driver for Microsemi/Microchip Serial GPIO" 545 - depends on OF 546 - depends on HAS_IOMEM 547 - select GPIOLIB 548 - select GPIOLIB_IRQCHIP 549 - select GENERIC_PINCONF 550 - select GENERIC_PINCTRL_GROUPS 551 - select GENERIC_PINMUX_FUNCTIONS 552 - select OF_GPIO 553 - help 554 - Support for the serial GPIO interface used on Microsemi and 555 - Microchip SoC's. By using a serial interface, the SIO 556 - controller significantly extends the number of available 557 - GPIOs with a minimum number of additional pins on the 558 - device. The primary purpose of the SIO controller is to 559 - connect control signals from SFP modules and to act as an 560 - LED controller. 561 - 562 - config PINCTRL_K210 563 - bool "Pinctrl driver for the Canaan Kendryte K210 SoC" 564 - depends on RISCV && SOC_CANAAN && OF 565 - select GENERIC_PINMUX_FUNCTIONS 566 - select GENERIC_PINCONF 567 - select GPIOLIB 568 - select OF_GPIO 569 - select REGMAP_MMIO 570 - default SOC_CANAAN 571 - help 572 - Add support for the Canaan Kendryte K210 RISC-V SOC Field 573 - Programmable IO Array (FPIOA) controller. 574 - 575 - config PINCTRL_KEEMBAY 576 - tristate "Pinctrl driver for Intel Keem Bay SoC" 577 - depends on ARCH_KEEMBAY || (ARM64 && COMPILE_TEST) 578 - depends on HAS_IOMEM 579 - select PINMUX 580 - select PINCONF 581 - select GENERIC_PINCONF 582 - select GENERIC_PINCTRL_GROUPS 583 - select GENERIC_PINMUX_FUNCTIONS 584 - select GPIOLIB 585 - select GPIOLIB_IRQCHIP 586 - select GPIO_GENERIC 587 - help 588 - This selects pin control driver for the Intel Keembay SoC. 589 - It provides pin config functions such as pullup, pulldown, 590 - interrupt, drive strength, sec lock, schmitt trigger, slew 591 - rate control and direction control. This module will be 592 - called as pinctrl-keembay. 593 - 594 378 source "drivers/pinctrl/actions/Kconfig" 595 379 source "drivers/pinctrl/aspeed/Kconfig" 596 380 source "drivers/pinctrl/bcm/Kconfig" 597 381 source "drivers/pinctrl/berlin/Kconfig" 382 + source "drivers/pinctrl/cirrus/Kconfig" 598 383 source "drivers/pinctrl/freescale/Kconfig" 599 384 source "drivers/pinctrl/intel/Kconfig" 385 + source "drivers/pinctrl/mediatek/Kconfig" 386 + source "drivers/pinctrl/meson/Kconfig" 600 387 source "drivers/pinctrl/mvebu/Kconfig" 601 388 source "drivers/pinctrl/nomadik/Kconfig" 602 389 source "drivers/pinctrl/nuvoton/Kconfig" ··· 531 480 source "drivers/pinctrl/tegra/Kconfig" 532 481 source "drivers/pinctrl/ti/Kconfig" 533 482 source "drivers/pinctrl/uniphier/Kconfig" 534 - source "drivers/pinctrl/vt8500/Kconfig" 535 - source "drivers/pinctrl/mediatek/Kconfig" 536 - source "drivers/pinctrl/meson/Kconfig" 537 - source "drivers/pinctrl/cirrus/Kconfig" 538 483 source "drivers/pinctrl/visconti/Kconfig" 539 - 540 - config PINCTRL_XWAY 541 - bool 542 - depends on SOC_TYPE_XWAY 543 - depends on PINCTRL_LANTIQ 544 - 545 - config PINCTRL_TB10X 546 - bool 547 - depends on OF && ARC_PLAT_TB10X 548 - select GPIOLIB 549 - 550 - config PINCTRL_EQUILIBRIUM 551 - tristate "Generic pinctrl and GPIO driver for Intel Lightning Mountain SoC" 552 - depends on OF && HAS_IOMEM 553 - depends on X86 || COMPILE_TEST 554 - select PINMUX 555 - select PINCONF 556 - select GPIOLIB 557 - select GPIO_GENERIC 558 - select GPIOLIB_IRQCHIP 559 - select GENERIC_PINCONF 560 - select GENERIC_PINCTRL_GROUPS 561 - select GENERIC_PINMUX_FUNCTIONS 562 - 563 - help 564 - Equilibrium pinctrl driver is a pinctrl & GPIO driver for Intel Lightning 565 - Mountain network processor SoC that supports both the linux GPIO and pin 566 - control frameworks. It provides interfaces to setup pinmux, assign desired 567 - pin functions, configure GPIO attributes for LGM SoC pins. Pinmux and 568 - pinconf settings are retrieved from device tree. 484 + source "drivers/pinctrl/vt8500/Kconfig" 569 485 570 486 endif
+25 -23
drivers/pinctrl/Makefile
··· 6 6 obj-y += core.o pinctrl-utils.o 7 7 obj-$(CONFIG_PINMUX) += pinmux.o 8 8 obj-$(CONFIG_PINCONF) += pinconf.o 9 - obj-$(CONFIG_OF) += devicetree.o 10 9 obj-$(CONFIG_GENERIC_PINCONF) += pinconf-generic.o 10 + obj-$(CONFIG_OF) += devicetree.o 11 + 12 + obj-$(CONFIG_PINCTRL_AMD) += pinctrl-amd.o 11 13 obj-$(CONFIG_PINCTRL_APPLE_GPIO) += pinctrl-apple-gpio.o 12 14 obj-$(CONFIG_PINCTRL_ARTPEC6) += pinctrl-artpec6.o 13 15 obj-$(CONFIG_PINCTRL_AS3722) += pinctrl-as3722.o 14 - obj-$(CONFIG_PINCTRL_AXP209) += pinctrl-axp209.o 15 16 obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o 16 17 obj-$(CONFIG_PINCTRL_AT91PIO4) += pinctrl-at91-pio4.o 17 - obj-$(CONFIG_PINCTRL_AMD) += pinctrl-amd.o 18 + obj-$(CONFIG_PINCTRL_AXP209) += pinctrl-axp209.o 18 19 obj-$(CONFIG_PINCTRL_BM1880) += pinctrl-bm1880.o 19 20 obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o 20 21 obj-$(CONFIG_PINCTRL_DA9062) += pinctrl-da9062.o 21 22 obj-$(CONFIG_PINCTRL_DIGICOLOR) += pinctrl-digicolor.o 22 - obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o 23 + obj-$(CONFIG_PINCTRL_EQUILIBRIUM) += pinctrl-equilibrium.o 23 24 obj-$(CONFIG_PINCTRL_GEMINI) += pinctrl-gemini.o 25 + obj-$(CONFIG_PINCTRL_INGENIC) += pinctrl-ingenic.o 26 + obj-$(CONFIG_PINCTRL_K210) += pinctrl-k210.o 27 + obj-$(CONFIG_PINCTRL_KEEMBAY) += pinctrl-keembay.o 28 + obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o 29 + obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o 30 + obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o 31 + obj-$(CONFIG_PINCTRL_LPC18XX) += pinctrl-lpc18xx.o 24 32 obj-$(CONFIG_PINCTRL_MAX77620) += pinctrl-max77620.o 25 33 obj-$(CONFIG_PINCTRL_MCP23S08_I2C) += pinctrl-mcp23s08_i2c.o 26 34 obj-$(CONFIG_PINCTRL_MCP23S08_SPI) += pinctrl-mcp23s08_spi.o 27 35 obj-$(CONFIG_PINCTRL_MCP23S08) += pinctrl-mcp23s08.o 28 - obj-$(CONFIG_PINCTRL_MESON) += meson/ 36 + obj-$(CONFIG_PINCTRL_MICROCHIP_SGPIO) += pinctrl-microchip-sgpio.o 37 + obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o 29 38 obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o 30 39 obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o 31 40 obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o 32 41 obj-$(CONFIG_PINCTRL_PISTACHIO) += pinctrl-pistachio.o 42 + obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o 33 43 obj-$(CONFIG_PINCTRL_ROCKCHIP) += pinctrl-rockchip.o 34 44 obj-$(CONFIG_PINCTRL_SINGLE) += pinctrl-single.o 35 - obj-$(CONFIG_PINCTRL_SX150X) += pinctrl-sx150x.o 36 - obj-$(CONFIG_ARCH_TEGRA) += tegra/ 37 - obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o 38 - obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o 39 - obj-$(CONFIG_PINCTRL_LPC18XX) += pinctrl-lpc18xx.o 40 - obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o 41 - obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o 42 45 obj-$(CONFIG_PINCTRL_STARFIVE) += pinctrl-starfive.o 43 46 obj-$(CONFIG_PINCTRL_STMFX) += pinctrl-stmfx.o 44 - obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o 47 + obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o 48 + obj-$(CONFIG_PINCTRL_SX150X) += pinctrl-sx150x.o 49 + obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o 50 + obj-$(CONFIG_PINCTRL_THUNDERBAY) += pinctrl-thunderbay.o 45 51 obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o 46 - obj-$(CONFIG_PINCTRL_INGENIC) += pinctrl-ingenic.o 47 - obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o 48 - obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o 49 - obj-$(CONFIG_PINCTRL_MICROCHIP_SGPIO) += pinctrl-microchip-sgpio.o 50 - obj-$(CONFIG_PINCTRL_EQUILIBRIUM) += pinctrl-equilibrium.o 51 - obj-$(CONFIG_PINCTRL_K210) += pinctrl-k210.o 52 - obj-$(CONFIG_PINCTRL_KEEMBAY) += pinctrl-keembay.o 52 + obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o 53 53 54 54 obj-y += actions/ 55 55 obj-$(CONFIG_ARCH_ASPEED) += aspeed/ 56 56 obj-y += bcm/ 57 57 obj-$(CONFIG_PINCTRL_BERLIN) += berlin/ 58 + obj-y += cirrus/ 58 59 obj-y += freescale/ 59 60 obj-$(CONFIG_X86) += intel/ 61 + obj-y += mediatek/ 62 + obj-$(CONFIG_PINCTRL_MESON) += meson/ 60 63 obj-y += mvebu/ 61 64 obj-y += nomadik/ 62 65 obj-$(CONFIG_ARCH_NPCM7XX) += nuvoton/ ··· 72 69 obj-y += sprd/ 73 70 obj-$(CONFIG_PINCTRL_STM32) += stm32/ 74 71 obj-$(CONFIG_PINCTRL_SUNXI) += sunxi/ 72 + obj-$(CONFIG_ARCH_TEGRA) += tegra/ 75 73 obj-y += ti/ 76 74 obj-$(CONFIG_PINCTRL_UNIPHIER) += uniphier/ 77 - obj-$(CONFIG_ARCH_VT8500) += vt8500/ 78 - obj-y += mediatek/ 79 - obj-y += cirrus/ 80 75 obj-$(CONFIG_PINCTRL_VISCONTI) += visconti/ 76 + obj-$(CONFIG_ARCH_VT8500) += vt8500/
-1
drivers/pinctrl/actions/pinctrl-owl.c
··· 874 874 chip->label = dev_name(pctrl->dev); 875 875 chip->parent = pctrl->dev; 876 876 chip->owner = THIS_MODULE; 877 - chip->of_node = pctrl->dev->of_node; 878 877 879 878 pctrl->irq_chip.name = chip->of_node->name; 880 879 pctrl->irq_chip.irq_ack = owl_gpio_irq_ack;
+1 -1
drivers/pinctrl/aspeed/Kconfig
··· 2 2 config PINCTRL_ASPEED 3 3 bool 4 4 depends on (ARCH_ASPEED || COMPILE_TEST) && OF 5 - depends on MFD_SYSCON 5 + select MFD_SYSCON 6 6 select PINMUX 7 7 select PINCONF 8 8 select GENERIC_PINCONF
+2
drivers/pinctrl/bcm/Kconfig
··· 146 146 depends on OF && (ARCH_BCM_5301X || COMPILE_TEST) 147 147 select PINMUX 148 148 select GENERIC_PINCONF 149 + select GENERIC_PINCTRL_GROUPS 150 + select GENERIC_PINMUX_FUNCTIONS 149 151 default ARCH_BCM_5301X 150 152 help 151 153 Say yes here to enable the Broadcom NS SoC pins driver.
+10 -5
drivers/pinctrl/bcm/pinctrl-bcm2835.c
··· 313 313 314 314 static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 315 315 { 316 - return pinctrl_gpio_direction_input(chip->base + offset); 316 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 317 + 318 + bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); 319 + return 0; 317 320 } 318 321 319 322 static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) ··· 351 348 static int bcm2835_gpio_direction_output(struct gpio_chip *chip, 352 349 unsigned offset, int value) 353 350 { 354 - bcm2835_gpio_set(chip, offset, value); 355 - return pinctrl_gpio_direction_output(chip->base + offset); 351 + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 352 + 353 + bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); 354 + bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_OUT); 355 + return 0; 356 356 } 357 357 358 358 static const struct gpio_chip bcm2835_gpio_chip = { ··· 413 407 struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); 414 408 struct irq_chip *host_chip = irq_desc_get_chip(desc); 415 409 int irq = irq_desc_get_irq(desc); 416 - int group; 410 + int group = 0; 417 411 int i; 418 412 419 413 for (i = 0; i < BCM2835_NUM_IRQS; i++) { ··· 1228 1222 1229 1223 pc->gpio_chip = *pdata->gpio_chip; 1230 1224 pc->gpio_chip.parent = dev; 1231 - pc->gpio_chip.of_node = np; 1232 1225 1233 1226 for (i = 0; i < BCM2835_NUM_BANKS; i++) { 1234 1227 unsigned long events;
-1
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
··· 836 836 chip->num_banks = (ngpios + NGPIOS_PER_BANK - 1) / NGPIOS_PER_BANK; 837 837 gc->label = dev_name(dev); 838 838 gc->parent = dev; 839 - gc->of_node = dev->of_node; 840 839 gc->request = iproc_gpio_request; 841 840 gc->free = iproc_gpio_free; 842 841 gc->direction_input = iproc_gpio_direction_input;
+49 -116
drivers/pinctrl/bcm/pinctrl-ns.c
··· 14 14 #include <linux/platform_device.h> 15 15 #include <linux/slab.h> 16 16 17 + #include "../core.h" 18 + #include "../pinmux.h" 19 + 17 20 #define FLAG_BCM4708 BIT(1) 18 21 #define FLAG_BCM4709 BIT(2) 19 22 #define FLAG_BCM53012 BIT(3) ··· 28 25 void __iomem *base; 29 26 30 27 struct pinctrl_desc pctldesc; 31 - struct ns_pinctrl_group *groups; 32 - unsigned int num_groups; 33 - struct ns_pinctrl_function *functions; 34 - unsigned int num_functions; 35 28 }; 36 29 37 30 /* ··· 64 65 65 66 struct ns_pinctrl_group { 66 67 const char *name; 67 - const unsigned int *pins; 68 + unsigned int *pins; 68 69 const unsigned int num_pins; 69 70 unsigned int chipsets; 70 71 }; 71 72 72 - static const unsigned int spi_pins[] = { 0, 1, 2, 3 }; 73 - static const unsigned int i2c_pins[] = { 4, 5 }; 74 - static const unsigned int mdio_pins[] = { 6, 7 }; 75 - static const unsigned int pwm0_pins[] = { 8 }; 76 - static const unsigned int pwm1_pins[] = { 9 }; 77 - static const unsigned int pwm2_pins[] = { 10 }; 78 - static const unsigned int pwm3_pins[] = { 11 }; 79 - static const unsigned int uart1_pins[] = { 12, 13, 14, 15 }; 80 - static const unsigned int uart2_pins[] = { 16, 17 }; 81 - static const unsigned int sdio_pwr_pins[] = { 22 }; 82 - static const unsigned int sdio_1p8v_pins[] = { 23 }; 73 + static unsigned int spi_pins[] = { 0, 1, 2, 3 }; 74 + static unsigned int i2c_pins[] = { 4, 5 }; 75 + static unsigned int mdio_pins[] = { 6, 7 }; 76 + static unsigned int pwm0_pins[] = { 8 }; 77 + static unsigned int pwm1_pins[] = { 9 }; 78 + static unsigned int pwm2_pins[] = { 10 }; 79 + static unsigned int pwm3_pins[] = { 11 }; 80 + static unsigned int uart1_pins[] = { 12, 13, 14, 15 }; 81 + static unsigned int uart2_pins[] = { 16, 17 }; 82 + static unsigned int sdio_pwr_pins[] = { 22 }; 83 + static unsigned int sdio_1p8v_pins[] = { 23 }; 83 84 84 85 #define NS_GROUP(_name, _pins, _chipsets) \ 85 86 { \ ··· 145 146 * Groups code 146 147 */ 147 148 148 - static int ns_pinctrl_get_groups_count(struct pinctrl_dev *pctrl_dev) 149 - { 150 - struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 151 - 152 - return ns_pinctrl->num_groups; 153 - } 154 - 155 - static const char *ns_pinctrl_get_group_name(struct pinctrl_dev *pctrl_dev, 156 - unsigned int selector) 157 - { 158 - struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 159 - 160 - return ns_pinctrl->groups[selector].name; 161 - } 162 - 163 - static int ns_pinctrl_get_group_pins(struct pinctrl_dev *pctrl_dev, 164 - unsigned int selector, 165 - const unsigned int **pins, 166 - unsigned int *num_pins) 167 - { 168 - struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 169 - 170 - *pins = ns_pinctrl->groups[selector].pins; 171 - *num_pins = ns_pinctrl->groups[selector].num_pins; 172 - 173 - return 0; 174 - } 175 - 176 149 static const struct pinctrl_ops ns_pinctrl_ops = { 177 - .get_groups_count = ns_pinctrl_get_groups_count, 178 - .get_group_name = ns_pinctrl_get_group_name, 179 - .get_group_pins = ns_pinctrl_get_group_pins, 150 + .get_groups_count = pinctrl_generic_get_group_count, 151 + .get_group_name = pinctrl_generic_get_group_name, 152 + .get_group_pins = pinctrl_generic_get_group_pins, 180 153 .dt_node_to_map = pinconf_generic_dt_node_to_map_group, 181 154 .dt_free_map = pinconf_generic_dt_free_map, 182 155 }; ··· 157 186 * Functions code 158 187 */ 159 188 160 - static int ns_pinctrl_get_functions_count(struct pinctrl_dev *pctrl_dev) 161 - { 162 - struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 163 - 164 - return ns_pinctrl->num_functions; 165 - } 166 - 167 - static const char *ns_pinctrl_get_function_name(struct pinctrl_dev *pctrl_dev, 168 - unsigned int selector) 169 - { 170 - struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 171 - 172 - return ns_pinctrl->functions[selector].name; 173 - } 174 - 175 - static int ns_pinctrl_get_function_groups(struct pinctrl_dev *pctrl_dev, 176 - unsigned int selector, 177 - const char * const **groups, 178 - unsigned * const num_groups) 179 - { 180 - struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 181 - 182 - *groups = ns_pinctrl->functions[selector].groups; 183 - *num_groups = ns_pinctrl->functions[selector].num_groups; 184 - 185 - return 0; 186 - } 187 - 188 189 static int ns_pinctrl_set_mux(struct pinctrl_dev *pctrl_dev, 189 190 unsigned int func_select, 190 - unsigned int grp_select) 191 + unsigned int group_selector) 191 192 { 192 193 struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); 194 + struct group_desc *group; 193 195 u32 unset = 0; 194 196 u32 tmp; 195 197 int i; 196 198 197 - for (i = 0; i < ns_pinctrl->groups[grp_select].num_pins; i++) { 198 - int pin_number = ns_pinctrl->groups[grp_select].pins[i]; 199 + group = pinctrl_generic_get_group(pctrl_dev, group_selector); 200 + if (!group) 201 + return -EINVAL; 199 202 200 - unset |= BIT(pin_number); 201 - } 203 + for (i = 0; i < group->num_pins; i++) 204 + unset |= BIT(group->pins[i]); 202 205 203 206 tmp = readl(ns_pinctrl->base); 204 207 tmp &= ~unset; ··· 182 237 } 183 238 184 239 static const struct pinmux_ops ns_pinctrl_pmxops = { 185 - .get_functions_count = ns_pinctrl_get_functions_count, 186 - .get_function_name = ns_pinctrl_get_function_name, 187 - .get_function_groups = ns_pinctrl_get_function_groups, 240 + .get_functions_count = pinmux_generic_get_function_count, 241 + .get_function_name = pinmux_generic_get_function_name, 242 + .get_function_groups = pinmux_generic_get_function_groups, 188 243 .set_mux = ns_pinctrl_set_mux, 189 244 }; 190 245 ··· 212 267 struct ns_pinctrl *ns_pinctrl; 213 268 struct pinctrl_desc *pctldesc; 214 269 struct pinctrl_pin_desc *pin; 215 - struct ns_pinctrl_group *group; 216 - struct ns_pinctrl_function *function; 217 270 struct resource *res; 218 271 int i; 219 272 ··· 258 315 } 259 316 } 260 317 261 - ns_pinctrl->groups = devm_kcalloc(dev, ARRAY_SIZE(ns_pinctrl_groups), 262 - sizeof(struct ns_pinctrl_group), 263 - GFP_KERNEL); 264 - if (!ns_pinctrl->groups) 265 - return -ENOMEM; 266 - for (i = 0, group = &ns_pinctrl->groups[0]; 267 - i < ARRAY_SIZE(ns_pinctrl_groups); i++) { 268 - const struct ns_pinctrl_group *src = &ns_pinctrl_groups[i]; 269 - 270 - if (src->chipsets & ns_pinctrl->chipset_flag) { 271 - memcpy(group++, src, sizeof(*src)); 272 - ns_pinctrl->num_groups++; 273 - } 274 - } 275 - 276 - ns_pinctrl->functions = devm_kcalloc(dev, 277 - ARRAY_SIZE(ns_pinctrl_functions), 278 - sizeof(struct ns_pinctrl_function), 279 - GFP_KERNEL); 280 - if (!ns_pinctrl->functions) 281 - return -ENOMEM; 282 - for (i = 0, function = &ns_pinctrl->functions[0]; 283 - i < ARRAY_SIZE(ns_pinctrl_functions); i++) { 284 - const struct ns_pinctrl_function *src = &ns_pinctrl_functions[i]; 285 - 286 - if (src->chipsets & ns_pinctrl->chipset_flag) { 287 - memcpy(function++, src, sizeof(*src)); 288 - ns_pinctrl->num_functions++; 289 - } 290 - } 291 - 292 318 /* Register */ 293 319 294 320 ns_pinctrl->pctldev = devm_pinctrl_register(dev, pctldesc, ns_pinctrl); 295 321 if (IS_ERR(ns_pinctrl->pctldev)) { 296 322 dev_err(dev, "Failed to register pinctrl\n"); 297 323 return PTR_ERR(ns_pinctrl->pctldev); 324 + } 325 + 326 + for (i = 0; i < ARRAY_SIZE(ns_pinctrl_groups); i++) { 327 + const struct ns_pinctrl_group *group = &ns_pinctrl_groups[i]; 328 + 329 + if (!(group->chipsets & ns_pinctrl->chipset_flag)) 330 + continue; 331 + 332 + pinctrl_generic_add_group(ns_pinctrl->pctldev, group->name, 333 + group->pins, group->num_pins, NULL); 334 + } 335 + 336 + for (i = 0; i < ARRAY_SIZE(ns_pinctrl_functions); i++) { 337 + const struct ns_pinctrl_function *function = &ns_pinctrl_functions[i]; 338 + 339 + if (!(function->chipsets & ns_pinctrl->chipset_flag)) 340 + continue; 341 + 342 + pinmux_generic_add_function(ns_pinctrl->pctldev, function->name, 343 + function->groups, 344 + function->num_groups, NULL); 298 345 } 299 346 300 347 return 0;
-1
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
··· 648 648 gc->ngpio = val; 649 649 gc->label = dev_name(dev); 650 650 gc->parent = dev; 651 - gc->of_node = dev->of_node; 652 651 gc->request = gpiochip_generic_request; 653 652 gc->free = gpiochip_generic_free; 654 653 gc->direction_input = nsp_gpio_direction_input;
-3
drivers/pinctrl/cirrus/pinctrl-lochnagar.c
··· 1161 1161 priv->gpio_chip.can_sleep = true; 1162 1162 priv->gpio_chip.parent = dev; 1163 1163 priv->gpio_chip.base = -1; 1164 - #ifdef CONFIG_OF_GPIO 1165 - priv->gpio_chip.of_node = dev->of_node; 1166 - #endif 1167 1164 1168 1165 switch (lochnagar->type) { 1169 1166 case LOCHNAGAR1:
+4 -1
drivers/pinctrl/cirrus/pinctrl-madera-core.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/module.h> 10 10 #include <linux/platform_device.h> 11 + #include <linux/property.h> 11 12 #include <linux/regmap.h> 12 13 #include <linux/slab.h> 14 + 13 15 #include <linux/pinctrl/machine.h> 14 16 #include <linux/pinctrl/pinctrl.h> 15 17 #include <linux/pinctrl/pinmux.h> ··· 1006 1004 1007 1005 dev_dbg(&pdev->dev, "%s\n", __func__); 1008 1006 1007 + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); 1008 + 1009 1009 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 1010 1010 if (!priv) 1011 1011 return -ENOMEM; 1012 1012 1013 1013 priv->dev = &pdev->dev; 1014 1014 priv->madera = madera; 1015 - pdev->dev.of_node = madera->dev->of_node; 1016 1015 1017 1016 switch (madera->type) { 1018 1017 case CS47L15:
+7
drivers/pinctrl/freescale/Kconfig
··· 173 173 help 174 174 Say Y here to enable the imx8ulp pinctrl driver 175 175 176 + config PINCTRL_IMXRT1050 177 + bool "IMXRT1050 pinctrl driver" 178 + depends on ARCH_MXC 179 + select PINCTRL_IMX 180 + help 181 + Say Y here to enable the imxrt1050 pinctrl driver 182 + 176 183 config PINCTRL_VF610 177 184 bool "Freescale Vybrid VF610 pinctrl driver" 178 185 depends on SOC_VF610
+1
drivers/pinctrl/freescale/Makefile
··· 30 30 obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o 31 31 obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o 32 32 obj-$(CONFIG_PINCTRL_IMX28) += pinctrl-imx28.o 33 + obj-$(CONFIG_PINCTRL_IMXRT1050) += pinctrl-imxrt1050.o
+11 -6
drivers/pinctrl/freescale/pinctrl-imx.c
··· 648 648 struct device_node *child; 649 649 struct function_desc *func; 650 650 struct group_desc *grp; 651 - u32 i = 0; 651 + const char **group_names; 652 + u32 i; 652 653 653 654 dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np); 654 655 ··· 664 663 dev_err(ipctl->dev, "no groups defined in %pOF\n", np); 665 664 return -EINVAL; 666 665 } 667 - func->group_names = devm_kcalloc(ipctl->dev, func->num_group_names, 668 - sizeof(char *), GFP_KERNEL); 669 - if (!func->group_names) 666 + 667 + group_names = devm_kcalloc(ipctl->dev, func->num_group_names, 668 + sizeof(char *), GFP_KERNEL); 669 + if (!group_names) 670 670 return -ENOMEM; 671 + i = 0; 672 + for_each_child_of_node(np, child) 673 + group_names[i++] = child->name; 674 + func->group_names = group_names; 671 675 676 + i = 0; 672 677 for_each_child_of_node(np, child) { 673 - func->group_names[i] = child->name; 674 - 675 678 grp = devm_kzalloc(ipctl->dev, sizeof(struct group_desc), 676 679 GFP_KERNEL); 677 680 if (!grp) {
+349
drivers/pinctrl/freescale/pinctrl-imxrt1050.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2020 4 + * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com> 5 + */ 6 + 7 + #include <linux/err.h> 8 + #include <linux/init.h> 9 + #include <linux/of_device.h> 10 + #include <linux/pinctrl/pinctrl.h> 11 + #include <linux/platform_device.h> 12 + 13 + #include "pinctrl-imx.h" 14 + 15 + enum imxrt1050_pads { 16 + IMXRT1050_PAD_RESERVE0 = 0, 17 + IMXRT1050_PAD_RESERVE1 = 1, 18 + IMXRT1050_PAD_RESERVE2 = 2, 19 + IMXRT1050_PAD_RESERVE3 = 3, 20 + IMXRT1050_PAD_RESERVE4 = 4, 21 + IMXRT1050_PAD_RESERVE5 = 5, 22 + IMXRT1050_PAD_RESERVE6 = 6, 23 + IMXRT1050_PAD_RESERVE7 = 7, 24 + IMXRT1050_PAD_RESERVE8 = 8, 25 + IMXRT1050_PAD_RESERVE9 = 9, 26 + IMXRT1050_IOMUXC_GPIO1_IO00 = 10, 27 + IMXRT1050_IOMUXC_GPIO1_IO01 = 11, 28 + IMXRT1050_IOMUXC_GPIO1_IO02 = 12, 29 + IMXRT1050_IOMUXC_GPIO1_IO03 = 13, 30 + IMXRT1050_IOMUXC_GPIO1_IO04 = 14, 31 + IMXRT1050_IOMUXC_GPIO1_IO05 = 15, 32 + IMXRT1050_IOMUXC_GPIO1_IO06 = 16, 33 + IMXRT1050_IOMUXC_GPIO1_IO07 = 17, 34 + IMXRT1050_IOMUXC_GPIO1_IO08 = 18, 35 + IMXRT1050_IOMUXC_GPIO1_IO09 = 19, 36 + IMXRT1050_IOMUXC_GPIO1_IO10 = 20, 37 + IMXRT1050_IOMUXC_GPIO1_IO11 = 21, 38 + IMXRT1050_IOMUXC_GPIO1_IO12 = 22, 39 + IMXRT1050_IOMUXC_GPIO1_IO13 = 23, 40 + IMXRT1050_IOMUXC_GPIO1_IO14 = 24, 41 + IMXRT1050_IOMUXC_GPIO1_IO15 = 25, 42 + IMXRT1050_IOMUXC_ENET_MDC = 26, 43 + IMXRT1050_IOMUXC_ENET_MDIO = 27, 44 + IMXRT1050_IOMUXC_ENET_TD3 = 28, 45 + IMXRT1050_IOMUXC_ENET_TD2 = 29, 46 + IMXRT1050_IOMUXC_ENET_TD1 = 30, 47 + IMXRT1050_IOMUXC_ENET_TD0 = 31, 48 + IMXRT1050_IOMUXC_ENET_TX_CTL = 32, 49 + IMXRT1050_IOMUXC_ENET_TXC = 33, 50 + IMXRT1050_IOMUXC_ENET_RX_CTL = 34, 51 + IMXRT1050_IOMUXC_ENET_RXC = 35, 52 + IMXRT1050_IOMUXC_ENET_RD0 = 36, 53 + IMXRT1050_IOMUXC_ENET_RD1 = 37, 54 + IMXRT1050_IOMUXC_ENET_RD2 = 38, 55 + IMXRT1050_IOMUXC_ENET_RD3 = 39, 56 + IMXRT1050_IOMUXC_SD1_CLK = 40, 57 + IMXRT1050_IOMUXC_SD1_CMD = 41, 58 + IMXRT1050_IOMUXC_SD1_DATA0 = 42, 59 + IMXRT1050_IOMUXC_SD1_DATA1 = 43, 60 + IMXRT1050_IOMUXC_SD1_DATA2 = 44, 61 + IMXRT1050_IOMUXC_SD1_DATA3 = 45, 62 + IMXRT1050_IOMUXC_SD1_DATA4 = 46, 63 + IMXRT1050_IOMUXC_SD1_DATA5 = 47, 64 + IMXRT1050_IOMUXC_SD1_DATA6 = 48, 65 + IMXRT1050_IOMUXC_SD1_DATA7 = 49, 66 + IMXRT1050_IOMUXC_SD1_RESET_B = 50, 67 + IMXRT1050_IOMUXC_SD1_STROBE = 51, 68 + IMXRT1050_IOMUXC_SD2_CD_B = 52, 69 + IMXRT1050_IOMUXC_SD2_CLK = 53, 70 + IMXRT1050_IOMUXC_SD2_CMD = 54, 71 + IMXRT1050_IOMUXC_SD2_DATA0 = 55, 72 + IMXRT1050_IOMUXC_SD2_DATA1 = 56, 73 + IMXRT1050_IOMUXC_SD2_DATA2 = 57, 74 + IMXRT1050_IOMUXC_SD2_DATA3 = 58, 75 + IMXRT1050_IOMUXC_SD2_RESET_B = 59, 76 + IMXRT1050_IOMUXC_SD2_WP = 60, 77 + IMXRT1050_IOMUXC_NAND_ALE = 61, 78 + IMXRT1050_IOMUXC_NAND_CE0 = 62, 79 + IMXRT1050_IOMUXC_NAND_CE1 = 63, 80 + IMXRT1050_IOMUXC_NAND_CE2 = 64, 81 + IMXRT1050_IOMUXC_NAND_CE3 = 65, 82 + IMXRT1050_IOMUXC_NAND_CLE = 66, 83 + IMXRT1050_IOMUXC_NAND_DATA00 = 67, 84 + IMXRT1050_IOMUXC_NAND_DATA01 = 68, 85 + IMXRT1050_IOMUXC_NAND_DATA02 = 69, 86 + IMXRT1050_IOMUXC_NAND_DATA03 = 70, 87 + IMXRT1050_IOMUXC_NAND_DATA04 = 71, 88 + IMXRT1050_IOMUXC_NAND_DATA05 = 72, 89 + IMXRT1050_IOMUXC_NAND_DATA06 = 73, 90 + IMXRT1050_IOMUXC_NAND_DATA07 = 74, 91 + IMXRT1050_IOMUXC_NAND_DQS = 75, 92 + IMXRT1050_IOMUXC_NAND_RE_B = 76, 93 + IMXRT1050_IOMUXC_NAND_READY_B = 77, 94 + IMXRT1050_IOMUXC_NAND_WE_B = 78, 95 + IMXRT1050_IOMUXC_NAND_WP_B = 79, 96 + IMXRT1050_IOMUXC_SAI5_RXFS = 80, 97 + IMXRT1050_IOMUXC_SAI5_RXC = 81, 98 + IMXRT1050_IOMUXC_SAI5_RXD0 = 82, 99 + IMXRT1050_IOMUXC_SAI5_RXD1 = 83, 100 + IMXRT1050_IOMUXC_SAI5_RXD2 = 84, 101 + IMXRT1050_IOMUXC_SAI5_RXD3 = 85, 102 + IMXRT1050_IOMUXC_SAI5_MCLK = 86, 103 + IMXRT1050_IOMUXC_SAI1_RXFS = 87, 104 + IMXRT1050_IOMUXC_SAI1_RXC = 88, 105 + IMXRT1050_IOMUXC_SAI1_RXD0 = 89, 106 + IMXRT1050_IOMUXC_SAI1_RXD1 = 90, 107 + IMXRT1050_IOMUXC_SAI1_RXD2 = 91, 108 + IMXRT1050_IOMUXC_SAI1_RXD3 = 92, 109 + IMXRT1050_IOMUXC_SAI1_RXD4 = 93, 110 + IMXRT1050_IOMUXC_SAI1_RXD5 = 94, 111 + IMXRT1050_IOMUXC_SAI1_RXD6 = 95, 112 + IMXRT1050_IOMUXC_SAI1_RXD7 = 96, 113 + IMXRT1050_IOMUXC_SAI1_TXFS = 97, 114 + IMXRT1050_IOMUXC_SAI1_TXC = 98, 115 + IMXRT1050_IOMUXC_SAI1_TXD0 = 99, 116 + IMXRT1050_IOMUXC_SAI1_TXD1 = 100, 117 + IMXRT1050_IOMUXC_SAI1_TXD2 = 101, 118 + IMXRT1050_IOMUXC_SAI1_TXD3 = 102, 119 + IMXRT1050_IOMUXC_SAI1_TXD4 = 103, 120 + IMXRT1050_IOMUXC_SAI1_TXD5 = 104, 121 + IMXRT1050_IOMUXC_SAI1_TXD6 = 105, 122 + IMXRT1050_IOMUXC_SAI1_TXD7 = 106, 123 + IMXRT1050_IOMUXC_SAI1_MCLK = 107, 124 + IMXRT1050_IOMUXC_SAI2_RXFS = 108, 125 + IMXRT1050_IOMUXC_SAI2_RXC = 109, 126 + IMXRT1050_IOMUXC_SAI2_RXD0 = 110, 127 + IMXRT1050_IOMUXC_SAI2_TXFS = 111, 128 + IMXRT1050_IOMUXC_SAI2_TXC = 112, 129 + IMXRT1050_IOMUXC_SAI2_TXD0 = 113, 130 + IMXRT1050_IOMUXC_SAI2_MCLK = 114, 131 + IMXRT1050_IOMUXC_SAI3_RXFS = 115, 132 + IMXRT1050_IOMUXC_SAI3_RXC = 116, 133 + IMXRT1050_IOMUXC_SAI3_RXD = 117, 134 + IMXRT1050_IOMUXC_SAI3_TXFS = 118, 135 + IMXRT1050_IOMUXC_SAI3_TXC = 119, 136 + IMXRT1050_IOMUXC_SAI3_TXD = 120, 137 + IMXRT1050_IOMUXC_SAI3_MCLK = 121, 138 + IMXRT1050_IOMUXC_SPDIF_TX = 122, 139 + IMXRT1050_IOMUXC_SPDIF_RX = 123, 140 + IMXRT1050_IOMUXC_SPDIF_EXT_CLK = 124, 141 + IMXRT1050_IOMUXC_ECSPI1_SCLK = 125, 142 + IMXRT1050_IOMUXC_ECSPI1_MOSI = 126, 143 + IMXRT1050_IOMUXC_ECSPI1_MISO = 127, 144 + IMXRT1050_IOMUXC_ECSPI1_SS0 = 128, 145 + IMXRT1050_IOMUXC_ECSPI2_SCLK = 129, 146 + IMXRT1050_IOMUXC_ECSPI2_MOSI = 130, 147 + IMXRT1050_IOMUXC_ECSPI2_MISO = 131, 148 + IMXRT1050_IOMUXC_ECSPI2_SS0 = 132, 149 + IMXRT1050_IOMUXC_I2C1_SCL = 133, 150 + IMXRT1050_IOMUXC_I2C1_SDA = 134, 151 + IMXRT1050_IOMUXC_I2C2_SCL = 135, 152 + IMXRT1050_IOMUXC_I2C2_SDA = 136, 153 + IMXRT1050_IOMUXC_I2C3_SCL = 137, 154 + IMXRT1050_IOMUXC_I2C3_SDA = 138, 155 + IMXRT1050_IOMUXC_I2C4_SCL = 139, 156 + IMXRT1050_IOMUXC_I2C4_SDA = 140, 157 + IMXRT1050_IOMUXC_UART1_RXD = 141, 158 + IMXRT1050_IOMUXC_UART1_TXD = 142, 159 + IMXRT1050_IOMUXC_UART2_RXD = 143, 160 + IMXRT1050_IOMUXC_UART2_TXD = 144, 161 + IMXRT1050_IOMUXC_UART3_RXD = 145, 162 + IMXRT1050_IOMUXC_UART3_TXD = 146, 163 + IMXRT1050_IOMUXC_UART4_RXD = 147, 164 + IMXRT1050_IOMUXC_UART4_TXD = 148, 165 + }; 166 + 167 + /* Pad names for the pinmux subsystem */ 168 + static const struct pinctrl_pin_desc imxrt1050_pinctrl_pads[] = { 169 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE0), 170 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE1), 171 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE2), 172 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE3), 173 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE4), 174 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE5), 175 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE6), 176 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE7), 177 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE8), 178 + IMX_PINCTRL_PIN(IMXRT1050_PAD_RESERVE9), 179 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO00), 180 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO01), 181 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO02), 182 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO03), 183 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO04), 184 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO05), 185 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO06), 186 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO07), 187 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO08), 188 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO09), 189 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO10), 190 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO11), 191 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO12), 192 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO13), 193 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO14), 194 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_GPIO1_IO15), 195 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_MDC), 196 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_MDIO), 197 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_TD3), 198 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_TD2), 199 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_TD1), 200 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_TD0), 201 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_TX_CTL), 202 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_TXC), 203 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_RX_CTL), 204 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_RXC), 205 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_RD0), 206 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_RD1), 207 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_RD2), 208 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ENET_RD3), 209 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_CLK), 210 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_CMD), 211 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA0), 212 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA1), 213 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA2), 214 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA3), 215 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA4), 216 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA5), 217 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA6), 218 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_DATA7), 219 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_RESET_B), 220 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD1_STROBE), 221 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_CD_B), 222 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_CLK), 223 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_CMD), 224 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_DATA0), 225 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_DATA1), 226 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_DATA2), 227 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_DATA3), 228 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_RESET_B), 229 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SD2_WP), 230 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_ALE), 231 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_CE0), 232 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_CE1), 233 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_CE2), 234 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_CE3), 235 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_CLE), 236 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA00), 237 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA01), 238 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA02), 239 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA03), 240 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA04), 241 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA05), 242 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA06), 243 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DATA07), 244 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_DQS), 245 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_RE_B), 246 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_READY_B), 247 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_WE_B), 248 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_NAND_WP_B), 249 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_RXFS), 250 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_RXC), 251 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_RXD0), 252 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_RXD1), 253 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_RXD2), 254 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_RXD3), 255 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI5_MCLK), 256 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXFS), 257 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXC), 258 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD0), 259 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD1), 260 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD2), 261 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD3), 262 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD4), 263 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD5), 264 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD6), 265 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_RXD7), 266 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXFS), 267 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXC), 268 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD0), 269 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD1), 270 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD2), 271 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD3), 272 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD4), 273 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD5), 274 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD6), 275 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_TXD7), 276 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI1_MCLK), 277 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_RXFS), 278 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_RXC), 279 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_RXD0), 280 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_TXFS), 281 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_TXC), 282 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_TXD0), 283 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI2_MCLK), 284 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_RXFS), 285 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_RXC), 286 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_RXD), 287 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_TXFS), 288 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_TXC), 289 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_TXD), 290 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SAI3_MCLK), 291 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SPDIF_TX), 292 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SPDIF_RX), 293 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_SPDIF_EXT_CLK), 294 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI1_SCLK), 295 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI1_MOSI), 296 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI1_MISO), 297 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI1_SS0), 298 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI2_SCLK), 299 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI2_MOSI), 300 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI2_MISO), 301 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_ECSPI2_SS0), 302 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C1_SCL), 303 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C1_SDA), 304 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C2_SCL), 305 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C2_SDA), 306 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C3_SCL), 307 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C3_SDA), 308 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C4_SCL), 309 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_I2C4_SDA), 310 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART1_RXD), 311 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART1_TXD), 312 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART2_RXD), 313 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART2_TXD), 314 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART3_RXD), 315 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART3_TXD), 316 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART4_RXD), 317 + IMX_PINCTRL_PIN(IMXRT1050_IOMUXC_UART4_TXD), 318 + }; 319 + 320 + static const struct imx_pinctrl_soc_info imxrt1050_pinctrl_info = { 321 + .pins = imxrt1050_pinctrl_pads, 322 + .npins = ARRAY_SIZE(imxrt1050_pinctrl_pads), 323 + .gpr_compatible = "fsl,imxrt1050-iomuxc-gpr", 324 + }; 325 + 326 + static const struct of_device_id imxrt1050_pinctrl_of_match[] = { 327 + { .compatible = "fsl,imxrt1050-iomuxc", .data = &imxrt1050_pinctrl_info, }, 328 + { /* sentinel */ } 329 + }; 330 + 331 + static int imxrt1050_pinctrl_probe(struct platform_device *pdev) 332 + { 333 + return imx_pinctrl_probe(pdev, &imxrt1050_pinctrl_info); 334 + } 335 + 336 + static struct platform_driver imxrt1050_pinctrl_driver = { 337 + .driver = { 338 + .name = "imxrt1050-pinctrl", 339 + .of_match_table = of_match_ptr(imxrt1050_pinctrl_of_match), 340 + .suppress_bind_attrs = true, 341 + }, 342 + .probe = imxrt1050_pinctrl_probe, 343 + }; 344 + 345 + static int __init imxrt1050_pinctrl_init(void) 346 + { 347 + return platform_driver_register(&imxrt1050_pinctrl_driver); 348 + } 349 + arch_initcall(imxrt1050_pinctrl_init);
+1 -1
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 1577 1577 vg->irqchip.irq_mask = byt_irq_mask, 1578 1578 vg->irqchip.irq_unmask = byt_irq_unmask, 1579 1579 vg->irqchip.irq_set_type = byt_irq_type, 1580 - vg->irqchip.flags = IRQCHIP_SKIP_SET_WAKE, 1580 + vg->irqchip.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_SET_TYPE_MASKED, 1581 1581 1582 1582 girq = &gc->irq; 1583 1583 girq->chip = &vg->irqchip;
+99 -31
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 73 73 u32 padctrl1; 74 74 }; 75 75 76 + #define CHV_INVALID_HWIRQ ((unsigned int)INVALID_HWIRQ) 77 + 76 78 /** 77 79 * struct intel_community_context - community context for Cherryview 78 80 * @intr_lines: Mapping between 16 HW interrupt wires and GPIO offset (in GPIO number space) ··· 711 709 unsigned int function, unsigned int group) 712 710 { 713 711 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 712 + struct device *dev = pctrl->dev; 714 713 const struct intel_pingroup *grp; 715 714 unsigned long flags; 716 715 int i; ··· 723 720 /* Check first that the pad is not locked */ 724 721 for (i = 0; i < grp->npins; i++) { 725 722 if (chv_pad_locked(pctrl, grp->pins[i])) { 726 - dev_warn(pctrl->dev, "unable to set mode for locked pin %u\n", 727 - grp->pins[i]); 728 723 raw_spin_unlock_irqrestore(&chv_lock, flags); 724 + dev_warn(dev, "unable to set mode for locked pin %u\n", grp->pins[i]); 729 725 return -EBUSY; 730 726 } 731 727 } ··· 759 757 value |= CHV_PADCTRL1_INVRXTX_TXENABLE; 760 758 chv_writel(pctrl, pin, CHV_PADCTRL1, value); 761 759 762 - dev_dbg(pctrl->dev, "configured pin %u mode %u OE %sinverted\n", 763 - pin, mode, invert_oe ? "" : "not "); 760 + dev_dbg(dev, "configured pin %u mode %u OE %sinverted\n", pin, mode, 761 + invert_oe ? "" : "not "); 764 762 } 765 763 766 764 raw_spin_unlock_irqrestore(&chv_lock, flags); ··· 814 812 /* Reset the interrupt mapping */ 815 813 for (i = 0; i < ARRAY_SIZE(cctx->intr_lines); i++) { 816 814 if (cctx->intr_lines[i] == offset) { 817 - cctx->intr_lines[i] = 0; 815 + cctx->intr_lines[i] = CHV_INVALID_HWIRQ; 818 816 break; 819 817 } 820 818 } ··· 1060 1058 unsigned long *configs, unsigned int nconfigs) 1061 1059 { 1062 1060 struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 1061 + struct device *dev = pctrl->dev; 1063 1062 enum pin_config_param param; 1064 1063 int i, ret; 1065 1064 u32 arg; ··· 1097 1094 return -ENOTSUPP; 1098 1095 } 1099 1096 1100 - dev_dbg(pctrl->dev, "pin %d set config %d arg %u\n", pin, 1101 - param, arg); 1097 + dev_dbg(dev, "pin %d set config %d arg %u\n", pin, param, arg); 1102 1098 } 1103 1099 1104 1100 return 0; ··· 1304 1302 if (irqd_get_trigger_type(d) == IRQ_TYPE_NONE) { 1305 1303 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 1306 1304 struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 1305 + struct device *dev = pctrl->dev; 1307 1306 struct intel_community_context *cctx = &pctrl->context.communities[0]; 1308 1307 unsigned int pin = irqd_to_hwirq(d); 1309 1308 irq_flow_handler_t handler; ··· 1322 1319 else 1323 1320 handler = handle_edge_irq; 1324 1321 1325 - if (!cctx->intr_lines[intsel]) { 1322 + if (cctx->intr_lines[intsel] == CHV_INVALID_HWIRQ) { 1326 1323 irq_set_handler_locked(d, handler); 1324 + dev_dbg(dev, "using interrupt line %u for IRQ_TYPE_NONE on pin %u\n", 1325 + intsel, pin); 1327 1326 cctx->intr_lines[intsel] = pin; 1328 1327 } 1329 1328 raw_spin_unlock_irqrestore(&chv_lock, flags); ··· 1335 1330 return 0; 1336 1331 } 1337 1332 1333 + static int chv_gpio_set_intr_line(struct intel_pinctrl *pctrl, unsigned int pin) 1334 + { 1335 + struct device *dev = pctrl->dev; 1336 + struct intel_community_context *cctx = &pctrl->context.communities[0]; 1337 + const struct intel_community *community = &pctrl->communities[0]; 1338 + u32 value, intsel; 1339 + int i; 1340 + 1341 + value = chv_readl(pctrl, pin, CHV_PADCTRL0); 1342 + intsel = (value & CHV_PADCTRL0_INTSEL_MASK) >> CHV_PADCTRL0_INTSEL_SHIFT; 1343 + 1344 + if (cctx->intr_lines[intsel] == pin) 1345 + return 0; 1346 + 1347 + if (cctx->intr_lines[intsel] == CHV_INVALID_HWIRQ) { 1348 + dev_dbg(dev, "using interrupt line %u for pin %u\n", intsel, pin); 1349 + cctx->intr_lines[intsel] = pin; 1350 + return 0; 1351 + } 1352 + 1353 + /* 1354 + * The interrupt line selected by the BIOS is already in use by 1355 + * another pin, this is a known BIOS bug found on several models. 1356 + * But this may also be caused by Linux deciding to use a pin as 1357 + * IRQ which was not expected to be used as such by the BIOS authors, 1358 + * so log this at info level only. 1359 + */ 1360 + dev_info(dev, "interrupt line %u is used by both pin %u and pin %u\n", intsel, 1361 + cctx->intr_lines[intsel], pin); 1362 + 1363 + if (chv_pad_locked(pctrl, pin)) 1364 + return -EBUSY; 1365 + 1366 + /* 1367 + * The BIOS fills the interrupt lines from 0 counting up, start at 1368 + * the other end to find a free interrupt line to workaround this. 1369 + */ 1370 + for (i = community->nirqs - 1; i >= 0; i--) { 1371 + if (cctx->intr_lines[i] == CHV_INVALID_HWIRQ) 1372 + break; 1373 + } 1374 + if (i < 0) 1375 + return -EBUSY; 1376 + 1377 + dev_info(dev, "changing the interrupt line for pin %u to %d\n", pin, i); 1378 + 1379 + value = (value & ~CHV_PADCTRL0_INTSEL_MASK) | (i << CHV_PADCTRL0_INTSEL_SHIFT); 1380 + chv_writel(pctrl, pin, CHV_PADCTRL0, value); 1381 + cctx->intr_lines[i] = pin; 1382 + 1383 + return 0; 1384 + } 1385 + 1338 1386 static int chv_gpio_irq_type(struct irq_data *d, unsigned int type) 1339 1387 { 1340 1388 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 1341 1389 struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 1342 - struct intel_community_context *cctx = &pctrl->context.communities[0]; 1343 1390 unsigned int pin = irqd_to_hwirq(d); 1344 1391 unsigned long flags; 1345 1392 u32 value; 1393 + int ret; 1346 1394 1347 1395 raw_spin_lock_irqsave(&chv_lock, flags); 1396 + 1397 + ret = chv_gpio_set_intr_line(pctrl, pin); 1398 + if (ret) 1399 + goto out_unlock; 1348 1400 1349 1401 /* 1350 1402 * Pins which can be used as shared interrupt are configured in ··· 1437 1375 chv_writel(pctrl, pin, CHV_PADCTRL1, value); 1438 1376 } 1439 1377 1440 - value = chv_readl(pctrl, pin, CHV_PADCTRL0); 1441 - value &= CHV_PADCTRL0_INTSEL_MASK; 1442 - value >>= CHV_PADCTRL0_INTSEL_SHIFT; 1443 - 1444 - cctx->intr_lines[value] = pin; 1445 - 1446 1378 if (type & IRQ_TYPE_EDGE_BOTH) 1447 1379 irq_set_handler_locked(d, handle_edge_irq); 1448 1380 else if (type & IRQ_TYPE_LEVEL_MASK) 1449 1381 irq_set_handler_locked(d, handle_level_irq); 1450 1382 1383 + out_unlock: 1451 1384 raw_spin_unlock_irqrestore(&chv_lock, flags); 1452 1385 1453 - return 0; 1386 + return ret; 1454 1387 } 1455 1388 1456 1389 static void chv_gpio_irq_handler(struct irq_desc *desc) 1457 1390 { 1458 1391 struct gpio_chip *gc = irq_desc_get_handler_data(desc); 1459 1392 struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 1393 + struct device *dev = pctrl->dev; 1460 1394 const struct intel_community *community = &pctrl->communities[0]; 1461 1395 struct intel_community_context *cctx = &pctrl->context.communities[0]; 1462 1396 struct irq_chip *chip = irq_desc_get_chip(desc); ··· 1470 1412 unsigned int offset; 1471 1413 1472 1414 offset = cctx->intr_lines[intr_line]; 1415 + if (offset == CHV_INVALID_HWIRQ) { 1416 + dev_err(dev, "interrupt on unused interrupt line %u\n", intr_line); 1417 + continue; 1418 + } 1419 + 1473 1420 generic_handle_domain_irq(gc->irq.domain, offset); 1474 1421 } 1475 1422 ··· 1575 1512 static int chv_gpio_add_pin_ranges(struct gpio_chip *chip) 1576 1513 { 1577 1514 struct intel_pinctrl *pctrl = gpiochip_get_data(chip); 1515 + struct device *dev = pctrl->dev; 1578 1516 const struct intel_community *community = &pctrl->communities[0]; 1579 1517 const struct intel_padgroup *gpp; 1580 1518 int ret, i; 1581 1519 1582 1520 for (i = 0; i < community->ngpps; i++) { 1583 1521 gpp = &community->gpps[i]; 1584 - ret = gpiochip_add_pin_range(chip, dev_name(pctrl->dev), 1585 - gpp->base, gpp->base, 1586 - gpp->size); 1522 + ret = gpiochip_add_pin_range(chip, dev_name(dev), gpp->base, gpp->base, gpp->size); 1587 1523 if (ret) { 1588 - dev_err(pctrl->dev, "failed to add GPIO pin range\n"); 1524 + dev_err(dev, "failed to add GPIO pin range\n"); 1589 1525 return ret; 1590 1526 } 1591 1527 } ··· 1597 1535 const struct intel_community *community = &pctrl->communities[0]; 1598 1536 const struct intel_padgroup *gpp; 1599 1537 struct gpio_chip *chip = &pctrl->chip; 1538 + struct device *dev = pctrl->dev; 1600 1539 bool need_valid_mask = !dmi_check_system(chv_no_valid_mask); 1601 1540 int ret, i, irq_base; 1602 1541 1603 1542 *chip = chv_gpio_chip; 1604 1543 1605 1544 chip->ngpio = pctrl->soc->pins[pctrl->soc->npins - 1].number + 1; 1606 - chip->label = dev_name(pctrl->dev); 1545 + chip->label = dev_name(dev); 1607 1546 chip->add_pin_ranges = chv_gpio_add_pin_ranges; 1608 - chip->parent = pctrl->dev; 1547 + chip->parent = dev; 1609 1548 chip->base = -1; 1610 1549 1611 1550 pctrl->irq = irq; ··· 1628 1565 if (need_valid_mask) { 1629 1566 chip->irq.init_valid_mask = chv_init_irq_valid_mask; 1630 1567 } else { 1631 - irq_base = devm_irq_alloc_descs(pctrl->dev, -1, 0, 1632 - pctrl->soc->npins, NUMA_NO_NODE); 1568 + irq_base = devm_irq_alloc_descs(dev, -1, 0, pctrl->soc->npins, NUMA_NO_NODE); 1633 1569 if (irq_base < 0) { 1634 - dev_err(pctrl->dev, "Failed to allocate IRQ numbers\n"); 1570 + dev_err(dev, "Failed to allocate IRQ numbers\n"); 1635 1571 return irq_base; 1636 1572 } 1637 1573 } 1638 1574 1639 - ret = devm_gpiochip_add_data(pctrl->dev, chip, pctrl); 1575 + ret = devm_gpiochip_add_data(dev, chip, pctrl); 1640 1576 if (ret) { 1641 - dev_err(pctrl->dev, "Failed to register gpiochip\n"); 1577 + dev_err(dev, "Failed to register gpiochip\n"); 1642 1578 return ret; 1643 1579 } 1644 1580 ··· 1679 1617 static int chv_pinctrl_probe(struct platform_device *pdev) 1680 1618 { 1681 1619 const struct intel_pinctrl_soc_data *soc_data; 1620 + struct intel_community_context *cctx; 1682 1621 struct intel_community *community; 1683 1622 struct device *dev = &pdev->dev; 1684 1623 struct acpi_device *adev = ACPI_COMPANION(dev); 1685 1624 struct intel_pinctrl *pctrl; 1686 1625 acpi_status status; 1626 + unsigned int i; 1687 1627 int ret, irq; 1688 1628 1689 1629 soc_data = intel_pinctrl_get_soc_data(pdev); ··· 1726 1662 GFP_KERNEL); 1727 1663 if (!pctrl->context.communities) 1728 1664 return -ENOMEM; 1665 + 1666 + cctx = &pctrl->context.communities[0]; 1667 + for (i = 0; i < ARRAY_SIZE(cctx->intr_lines); i++) 1668 + cctx->intr_lines[i] = CHV_INVALID_HWIRQ; 1729 1669 1730 1670 irq = platform_get_irq(pdev, 0); 1731 1671 if (irq < 0) ··· 1835 1767 val &= ~CHV_PADCTRL0_GPIORXSTATE; 1836 1768 if (ctx->padctrl0 != val) { 1837 1769 chv_writel(pctrl, desc->number, CHV_PADCTRL0, ctx->padctrl0); 1838 - dev_dbg(pctrl->dev, "restored pin %2u ctrl0 0x%08x\n", 1839 - desc->number, chv_readl(pctrl, desc->number, CHV_PADCTRL0)); 1770 + dev_dbg(dev, "restored pin %2u ctrl0 0x%08x\n", desc->number, 1771 + chv_readl(pctrl, desc->number, CHV_PADCTRL0)); 1840 1772 } 1841 1773 1842 1774 val = chv_readl(pctrl, desc->number, CHV_PADCTRL1); 1843 1775 if (ctx->padctrl1 != val) { 1844 1776 chv_writel(pctrl, desc->number, CHV_PADCTRL1, ctx->padctrl1); 1845 - dev_dbg(pctrl->dev, "restored pin %2u ctrl1 0x%08x\n", 1846 - desc->number, chv_readl(pctrl, desc->number, CHV_PADCTRL1)); 1777 + dev_dbg(dev, "restored pin %2u ctrl1 0x%08x\n", desc->number, 1778 + chv_readl(pctrl, desc->number, CHV_PADCTRL1)); 1847 1779 } 1848 1780 } 1849 1781
+3 -4
drivers/pinctrl/mediatek/pinctrl-moore.c
··· 519 519 return mtk_eint_set_debounce(hw->eint, desc->eint.eint_n, debounce); 520 520 } 521 521 522 - static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np) 522 + static int mtk_build_gpiochip(struct mtk_pinctrl *hw) 523 523 { 524 524 struct gpio_chip *chip = &hw->chip; 525 525 int ret; ··· 536 536 chip->set_config = mtk_gpio_set_config; 537 537 chip->base = -1; 538 538 chip->ngpio = hw->soc->npins; 539 - chip->of_node = np; 540 539 chip->of_gpio_n_cells = 2; 541 540 542 541 ret = gpiochip_add_data(chip, hw); ··· 549 550 * Documentation/devicetree/bindings/gpio/gpio.txt on how to 550 551 * bind pinctrl and gpio drivers via the "gpio-ranges" property. 551 552 */ 552 - if (!of_find_property(np, "gpio-ranges", NULL)) { 553 + if (!of_find_property(hw->dev->of_node, "gpio-ranges", NULL)) { 553 554 ret = gpiochip_add_pin_range(chip, dev_name(hw->dev), 0, 0, 554 555 chip->ngpio); 555 556 if (ret < 0) { ··· 690 691 "Failed to add EINT, but pinctrl still can work\n"); 691 692 692 693 /* Build gpiochip should be after pinctrl_enable is done */ 693 - err = mtk_build_gpiochip(hw, pdev->dev.of_node); 694 + err = mtk_build_gpiochip(hw); 694 695 if (err) { 695 696 dev_err(&pdev->dev, "Failed to add gpio_chip\n"); 696 697 return err;
+2
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
··· 815 815 goto out; 816 816 817 817 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); 818 + if (err) 819 + goto out; 818 820 819 821 if (pu == 0 && pd == 0) { 820 822 *pullup = 0;
+3 -4
drivers/pinctrl/mediatek/pinctrl-paris.c
··· 581 581 { 582 582 int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1, rsel = -1; 583 583 const struct mtk_pin_desc *desc; 584 - u32 try_all_type; 584 + u32 try_all_type = 0; 585 585 586 586 if (gpio >= hw->soc->npins) 587 587 return -EINVAL; ··· 895 895 return mtk_eint_set_debounce(hw->eint, desc->eint.eint_n, debounce); 896 896 } 897 897 898 - static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np) 898 + static int mtk_build_gpiochip(struct mtk_pinctrl *hw) 899 899 { 900 900 struct gpio_chip *chip = &hw->chip; 901 901 int ret; ··· 913 913 chip->set_config = mtk_gpio_set_config; 914 914 chip->base = -1; 915 915 chip->ngpio = hw->soc->npins; 916 - chip->of_node = np; 917 916 chip->of_gpio_n_cells = 2; 918 917 919 918 ret = gpiochip_add_data(chip, hw); ··· 1036 1037 "Failed to add EINT, but pinctrl still can work\n"); 1037 1038 1038 1039 /* Build gpiochip should be after pinctrl_enable is done */ 1039 - err = mtk_build_gpiochip(hw, pdev->dev.of_node); 1040 + err = mtk_build_gpiochip(hw); 1040 1041 if (err) { 1041 1042 dev_err(&pdev->dev, "Failed to add gpio_chip\n"); 1042 1043 return err;
+34 -51
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/regmap.h> 25 25 #include <linux/slab.h> 26 + #include <linux/string_helpers.h> 26 27 27 28 #include "../pinctrl-utils.h" 28 29 ··· 342 341 struct armada_37xx_pin_group *grp) 343 342 { 344 343 struct armada_37xx_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 344 + struct device *dev = info->dev; 345 345 unsigned int reg = SELECTION; 346 346 unsigned int mask = grp->reg_mask; 347 347 int func, val; 348 348 349 - dev_dbg(info->dev, "enable function %s group %s\n", 350 - name, grp->name); 349 + dev_dbg(dev, "enable function %s group %s\n", name, grp->name); 351 350 352 351 func = match_string(grp->funcs, NB_FUNCS, name); 353 352 if (func < 0) ··· 723 722 static int armada_37xx_irqchip_register(struct platform_device *pdev, 724 723 struct armada_37xx_pinctrl *info) 725 724 { 726 - struct device_node *np = info->dev->of_node; 727 725 struct gpio_chip *gc = &info->gpio_chip; 728 726 struct irq_chip *irqchip = &info->irq_chip; 729 727 struct gpio_irq_chip *girq = &gc->irq; 730 728 struct device *dev = &pdev->dev; 731 - struct resource res; 729 + struct device_node *np; 732 730 int ret = -ENODEV, i, nr_irq_parent; 733 731 734 732 /* Check if we have at least one gpio-controller child node */ 735 - for_each_child_of_node(info->dev->of_node, np) { 733 + for_each_child_of_node(dev->of_node, np) { 736 734 if (of_property_read_bool(np, "gpio-controller")) { 737 735 ret = 0; 738 736 break; 739 737 } 740 738 } 741 - if (ret) { 742 - dev_err(dev, "no gpio-controller child node\n"); 743 - return ret; 744 - } 739 + if (ret) 740 + return dev_err_probe(dev, ret, "no gpio-controller child node\n"); 745 741 746 742 nr_irq_parent = of_irq_count(np); 747 743 spin_lock_init(&info->irq_lock); ··· 748 750 return 0; 749 751 } 750 752 751 - if (of_address_to_resource(info->dev->of_node, 1, &res)) { 752 - dev_err(dev, "cannot find IO resource\n"); 753 - return -ENOENT; 754 - } 755 - 756 - info->base = devm_ioremap_resource(info->dev, &res); 753 + info->base = devm_platform_ioremap_resource(pdev, 1); 757 754 if (IS_ERR(info->base)) 758 755 return PTR_ERR(info->base); 759 756 ··· 767 774 * the chained irq with all of them. 768 775 */ 769 776 girq->num_parents = nr_irq_parent; 770 - girq->parents = devm_kcalloc(&pdev->dev, nr_irq_parent, 771 - sizeof(*girq->parents), GFP_KERNEL); 777 + girq->parents = devm_kcalloc(dev, nr_irq_parent, sizeof(*girq->parents), GFP_KERNEL); 772 778 if (!girq->parents) 773 779 return -ENOMEM; 774 780 for (i = 0; i < nr_irq_parent; i++) { ··· 786 794 static int armada_37xx_gpiochip_register(struct platform_device *pdev, 787 795 struct armada_37xx_pinctrl *info) 788 796 { 797 + struct device *dev = &pdev->dev; 789 798 struct device_node *np; 790 799 struct gpio_chip *gc; 791 800 int ret = -ENODEV; 792 801 793 - for_each_child_of_node(info->dev->of_node, np) { 802 + for_each_child_of_node(dev->of_node, np) { 794 803 if (of_find_property(np, "gpio-controller", NULL)) { 795 804 ret = 0; 796 805 break; ··· 804 811 805 812 gc = &info->gpio_chip; 806 813 gc->ngpio = info->data->nr_pins; 807 - gc->parent = &pdev->dev; 814 + gc->parent = dev; 808 815 gc->base = -1; 809 816 gc->of_node = np; 810 817 gc->label = info->data->name; ··· 812 819 ret = armada_37xx_irqchip_register(pdev, info); 813 820 if (ret) 814 821 return ret; 815 - ret = devm_gpiochip_add_data(&pdev->dev, gc, info); 816 - if (ret) 817 - return ret; 818 822 819 - return 0; 823 + return devm_gpiochip_add_data(dev, gc, info); 820 824 } 821 825 822 826 /** ··· 864 874 static int armada_37xx_fill_group(struct armada_37xx_pinctrl *info) 865 875 { 866 876 int n, num = 0, funcsize = info->data->nr_pins; 877 + struct device *dev = info->dev; 867 878 868 879 for (n = 0; n < info->ngroups; n++) { 869 880 struct armada_37xx_pin_group *grp = &info->groups[n]; 870 881 int i, j, f; 871 882 872 - grp->pins = devm_kcalloc(info->dev, 873 - grp->npins + grp->extra_npins, 883 + grp->pins = devm_kcalloc(dev, grp->npins + grp->extra_npins, 874 884 sizeof(*grp->pins), 875 885 GFP_KERNEL); 876 886 if (!grp->pins) ··· 888 898 ret = armada_37xx_add_function(info->funcs, &funcsize, 889 899 grp->funcs[f]); 890 900 if (ret == -EOVERFLOW) 891 - dev_err(info->dev, 892 - "More functions than pins(%d)\n", 901 + dev_err(dev, "More functions than pins(%d)\n", 893 902 info->data->nr_pins); 894 903 if (ret < 0) 895 904 continue; ··· 902 913 } 903 914 904 915 /** 905 - * armada_37xx_fill_funcs() - complete the funcs array 916 + * armada_37xx_fill_func() - complete the funcs array 906 917 * @info: info driver instance 907 918 * 908 919 * Based on the data available from the armada_37xx_pin_group array ··· 914 925 static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info) 915 926 { 916 927 struct armada_37xx_pmx_func *funcs = info->funcs; 928 + struct device *dev = info->dev; 917 929 int n; 918 930 919 931 for (n = 0; n < info->nfuncs; n++) { ··· 922 932 const char **groups; 923 933 int g; 924 934 925 - funcs[n].groups = devm_kcalloc(info->dev, 926 - funcs[n].ngroups, 935 + funcs[n].groups = devm_kcalloc(dev, funcs[n].ngroups, 927 936 sizeof(*(funcs[n].groups)), 928 937 GFP_KERNEL); 929 938 if (!funcs[n].groups) ··· 951 962 const struct armada_37xx_pin_data *pin_data = info->data; 952 963 struct pinctrl_desc *ctrldesc = &info->pctl; 953 964 struct pinctrl_pin_desc *pindesc, *pdesc; 965 + struct device *dev = &pdev->dev; 966 + char **pin_names; 954 967 int pin, ret; 955 968 956 969 info->groups = pin_data->groups; ··· 964 973 ctrldesc->pmxops = &armada_37xx_pmx_ops; 965 974 ctrldesc->confops = &armada_37xx_pinconf_ops; 966 975 967 - pindesc = devm_kcalloc(&pdev->dev, 968 - pin_data->nr_pins, sizeof(*pindesc), 969 - GFP_KERNEL); 976 + pindesc = devm_kcalloc(dev, pin_data->nr_pins, sizeof(*pindesc), GFP_KERNEL); 970 977 if (!pindesc) 971 978 return -ENOMEM; 972 979 973 980 ctrldesc->pins = pindesc; 974 981 ctrldesc->npins = pin_data->nr_pins; 975 982 983 + pin_names = devm_kasprintf_strarray(dev, pin_data->name, pin_data->nr_pins); 984 + if (IS_ERR(pin_names)) 985 + return PTR_ERR(pin_names); 986 + 976 987 pdesc = pindesc; 977 988 for (pin = 0; pin < pin_data->nr_pins; pin++) { 978 989 pdesc->number = pin; 979 - pdesc->name = kasprintf(GFP_KERNEL, "%s-%d", 980 - pin_data->name, pin); 990 + pdesc->name = pin_names[pin]; 981 991 pdesc++; 982 992 } 983 993 ··· 986 994 * we allocate functions for number of pins and hope there are 987 995 * fewer unique functions than pins available 988 996 */ 989 - info->funcs = devm_kcalloc(&pdev->dev, 990 - pin_data->nr_pins, 991 - sizeof(struct armada_37xx_pmx_func), 992 - GFP_KERNEL); 997 + info->funcs = devm_kcalloc(dev, pin_data->nr_pins, sizeof(*info->funcs), GFP_KERNEL); 993 998 if (!info->funcs) 994 999 return -ENOMEM; 995 - 996 1000 997 1001 ret = armada_37xx_fill_group(info); 998 1002 if (ret) ··· 998 1010 if (ret) 999 1011 return ret; 1000 1012 1001 - info->pctl_dev = devm_pinctrl_register(&pdev->dev, ctrldesc, info); 1002 - if (IS_ERR(info->pctl_dev)) { 1003 - dev_err(&pdev->dev, "could not register pinctrl driver\n"); 1004 - return PTR_ERR(info->pctl_dev); 1005 - } 1013 + info->pctl_dev = devm_pinctrl_register(dev, ctrldesc, info); 1014 + if (IS_ERR(info->pctl_dev)) 1015 + return dev_err_probe(dev, PTR_ERR(info->pctl_dev), "could not register pinctrl driver\n"); 1006 1016 1007 1017 return 0; 1008 1018 } ··· 1129 1143 struct regmap *regmap; 1130 1144 int ret; 1131 1145 1132 - info = devm_kzalloc(dev, sizeof(struct armada_37xx_pinctrl), 1133 - GFP_KERNEL); 1146 + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); 1134 1147 if (!info) 1135 1148 return -ENOMEM; 1136 1149 1137 1150 info->dev = dev; 1138 1151 1139 1152 regmap = syscon_node_to_regmap(np); 1140 - if (IS_ERR(regmap)) { 1141 - dev_err(&pdev->dev, "cannot get regmap\n"); 1142 - return PTR_ERR(regmap); 1143 - } 1153 + if (IS_ERR(regmap)) 1154 + return dev_err_probe(dev, PTR_ERR(regmap), "cannot get regmap\n"); 1144 1155 info->regmap = regmap; 1145 1156 1146 1157 info->data = of_device_get_match_data(dev);
+2
drivers/pinctrl/pinconf-generic.c
··· 46 46 PCONFDUMP(PIN_CONFIG_MODE_LOW_POWER, "pin low power", "mode", true), 47 47 PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false), 48 48 PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), 49 + PCONFDUMP(PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS, "output impedance", "ohms", true), 49 50 PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), 50 51 PCONFDUMP(PIN_CONFIG_SLEEP_HARDWARE_STATE, "sleep hardware state", NULL, false), 51 52 PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), ··· 180 179 { "output-disable", PIN_CONFIG_OUTPUT_ENABLE, 0 }, 181 180 { "output-enable", PIN_CONFIG_OUTPUT_ENABLE, 1 }, 182 181 { "output-high", PIN_CONFIG_OUTPUT, 1, }, 182 + { "output-impedance-ohms", PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS, 0 }, 183 183 { "output-low", PIN_CONFIG_OUTPUT, 0, }, 184 184 { "power-source", PIN_CONFIG_POWER_SOURCE, 0 }, 185 185 { "sleep-hardware-state", PIN_CONFIG_SLEEP_HARDWARE_STATE, 0 },
-3
drivers/pinctrl/pinctrl-amd.c
··· 1009 1009 gpio_dev->gc.owner = THIS_MODULE; 1010 1010 gpio_dev->gc.parent = &pdev->dev; 1011 1011 gpio_dev->gc.ngpio = resource_size(res) / 4; 1012 - #if defined(CONFIG_OF_GPIO) 1013 - gpio_dev->gc.of_node = pdev->dev.of_node; 1014 - #endif 1015 1012 1016 1013 gpio_dev->hwbank_num = gpio_dev->gc.ngpio / 64; 1017 1014 gpio_dev->groups = kerncz_groups;
+47 -58
drivers/pinctrl/pinctrl-apple-gpio.c
··· 11 11 */ 12 12 13 13 #include <dt-bindings/pinctrl/apple.h> 14 + #include <linux/bits.h> 14 15 #include <linux/gpio/driver.h> 15 16 #include <linux/interrupt.h> 16 17 #include <linux/irq.h> ··· 37 36 struct pinctrl_desc pinctrl_desc; 38 37 struct gpio_chip gpio_chip; 39 38 struct irq_chip irq_chip; 40 - u8 irqgrps[0]; 39 + u8 irqgrps[]; 41 40 }; 42 41 43 42 #define REG_GPIO(x) (4 * (x)) ··· 71 70 .cache_type = REGCACHE_FLAT, 72 71 .max_register = 512 * sizeof(u32), 73 72 .num_reg_defaults_raw = 512, 74 - .use_relaxed_mmio = true 73 + .use_relaxed_mmio = true, 75 74 }; 76 75 77 - // No locking needed to mask/unmask IRQs as the interrupt mode is per pin-register. 76 + /* No locking needed to mask/unmask IRQs as the interrupt mode is per pin-register. */ 78 77 static void apple_gpio_set_reg(struct apple_gpio_pinctrl *pctl, 79 - unsigned int pin, u32 mask, u32 value) 78 + unsigned int pin, u32 mask, u32 value) 80 79 { 81 80 regmap_update_bits(pctl->map, REG_GPIO(pin), mask, value); 82 81 } 83 82 84 - static uint32_t apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl, 85 - unsigned int pin) 83 + static u32 apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl, 84 + unsigned int pin) 86 85 { 87 - unsigned int val = 0; 86 + int ret; 87 + u32 val; 88 88 89 - regmap_read(pctl->map, REG_GPIO(pin), &val); 89 + ret = regmap_read(pctl->map, REG_GPIO(pin), &val); 90 + if (ret) 91 + return 0; 92 + 90 93 return val; 91 94 } 92 95 93 96 /* Pin controller functions */ 94 97 95 98 static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev, 96 - struct device_node *node, 97 - struct pinctrl_map **map, 98 - unsigned *num_maps) 99 + struct device_node *node, 100 + struct pinctrl_map **map, 101 + unsigned *num_maps) 99 102 { 100 103 unsigned reserved_maps; 101 104 struct apple_gpio_pinctrl *pctl; ··· 119 114 dev_err(pctl->dev, 120 115 "missing or empty pinmux property in node %pOFn.\n", 121 116 node); 122 - return ret; 117 + return ret ? ret : -EINVAL; 123 118 } 124 119 125 120 num_pins = ret; 126 121 127 - ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps, num_maps, 128 - num_pins); 122 + ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps, num_maps, num_pins); 129 123 if (ret) 130 124 return ret; 131 125 ··· 142 138 } 143 139 144 140 group_name = pinctrl_generic_get_group_name(pctldev, pin); 145 - function_name = 146 - pinmux_generic_get_function_name(pctl->pctldev, func); 141 + function_name = pinmux_generic_get_function_name(pctl->pctldev, func); 147 142 ret = pinctrl_utils_add_map_mux(pctl->pctldev, map, 148 - &reserved_maps, num_maps, 149 - group_name, function_name); 143 + &reserved_maps, num_maps, 144 + group_name, function_name); 150 145 if (ret) 151 146 goto free_map; 152 147 } ··· 168 165 /* Pin multiplexer functions */ 169 166 170 167 static int apple_gpio_pinmux_set(struct pinctrl_dev *pctldev, unsigned func, 171 - unsigned group) 168 + unsigned group) 172 169 { 173 170 struct apple_gpio_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 174 171 ··· 189 186 190 187 /* GPIO chip functions */ 191 188 192 - static int apple_gpio_get_direction(struct gpio_chip *chip, 193 - unsigned int offset) 189 + static int apple_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) 194 190 { 195 191 struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip); 196 192 unsigned int reg = apple_gpio_get_reg(pctl, offset); 197 193 198 - return (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT) ? 199 - GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; 194 + if (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT) 195 + return GPIO_LINE_DIRECTION_OUT; 196 + return GPIO_LINE_DIRECTION_IN; 200 197 } 201 198 202 199 static int apple_gpio_get(struct gpio_chip *chip, unsigned offset) ··· 214 211 return !!(reg & REG_GPIOx_DATA); 215 212 } 216 213 217 - static void apple_gpio_set(struct gpio_chip *chip, unsigned int offset, 218 - int value) 214 + static void apple_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) 219 215 { 220 216 struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip); 221 217 222 - apple_gpio_set_reg(pctl, offset, REG_GPIOx_DATA, 223 - value ? REG_GPIOx_DATA : 0); 218 + apple_gpio_set_reg(pctl, offset, REG_GPIOx_DATA, value ? REG_GPIOx_DATA : 0); 224 219 } 225 220 226 - static int apple_gpio_direction_input(struct gpio_chip *chip, 227 - unsigned int offset) 221 + static int apple_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) 228 222 { 229 223 struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip); 230 224 ··· 234 234 } 235 235 236 236 static int apple_gpio_direction_output(struct gpio_chip *chip, 237 - unsigned int offset, int value) 237 + unsigned int offset, int value) 238 238 { 239 239 struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip); 240 240 ··· 249 249 250 250 static void apple_gpio_irq_ack(struct irq_data *data) 251 251 { 252 - struct apple_gpio_pinctrl *pctl = 253 - gpiochip_get_data(irq_data_get_irq_chip_data(data)); 254 - unsigned int irqgrp = 255 - FIELD_GET(REG_GPIOx_GRP, apple_gpio_get_reg(pctl, data->hwirq)); 252 + struct apple_gpio_pinctrl *pctl = gpiochip_get_data(irq_data_get_irq_chip_data(data)); 253 + unsigned int irqgrp = FIELD_GET(REG_GPIOx_GRP, apple_gpio_get_reg(pctl, data->hwirq)); 256 254 257 - writel(BIT(data->hwirq & 31), 258 - pctl->base + REG_IRQ(irqgrp, data->hwirq)); 255 + writel(BIT(data->hwirq % 32), pctl->base + REG_IRQ(irqgrp, data->hwirq)); 259 256 } 260 257 261 258 static unsigned int apple_gpio_irq_type(unsigned int type) ··· 275 278 276 279 static void apple_gpio_irq_mask(struct irq_data *data) 277 280 { 278 - struct apple_gpio_pinctrl *pctl = 279 - gpiochip_get_data(irq_data_get_irq_chip_data(data)); 281 + struct apple_gpio_pinctrl *pctl = gpiochip_get_data(irq_data_get_irq_chip_data(data)); 282 + 280 283 apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE, 281 - FIELD_PREP(REG_GPIOx_MODE, REG_GPIOx_IN_IRQ_OFF)); 284 + FIELD_PREP(REG_GPIOx_MODE, REG_GPIOx_IN_IRQ_OFF)); 282 285 } 283 286 284 287 static void apple_gpio_irq_unmask(struct irq_data *data) 285 288 { 286 - struct apple_gpio_pinctrl *pctl = 287 - gpiochip_get_data(irq_data_get_irq_chip_data(data)); 289 + struct apple_gpio_pinctrl *pctl = gpiochip_get_data(irq_data_get_irq_chip_data(data)); 288 290 unsigned int irqtype = apple_gpio_irq_type(irqd_get_trigger_type(data)); 289 291 290 292 apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE, 291 - FIELD_PREP(REG_GPIOx_MODE, irqtype)); 293 + FIELD_PREP(REG_GPIOx_MODE, irqtype)); 292 294 } 293 295 294 296 static unsigned int apple_gpio_irq_startup(struct irq_data *data) ··· 296 300 struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip); 297 301 298 302 apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_GRP, 299 - FIELD_PREP(REG_GPIOx_GRP, 0)); 303 + FIELD_PREP(REG_GPIOx_GRP, 0)); 300 304 301 305 apple_gpio_direction_input(chip, data->hwirq); 302 306 apple_gpio_irq_unmask(data); ··· 304 308 return 0; 305 309 } 306 310 307 - static int apple_gpio_irq_set_type(struct irq_data *data, 308 - unsigned int type) 311 + static int apple_gpio_irq_set_type(struct irq_data *data, unsigned int type) 309 312 { 310 - struct apple_gpio_pinctrl *pctl = 311 - gpiochip_get_data(irq_data_get_irq_chip_data(data)); 313 + struct apple_gpio_pinctrl *pctl = gpiochip_get_data(irq_data_get_irq_chip_data(data)); 312 314 unsigned int irqtype = apple_gpio_irq_type(type); 313 315 314 316 if (irqtype == REG_GPIOx_IN_IRQ_OFF) 315 317 return -EINVAL; 316 318 317 319 apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE, 318 - FIELD_PREP(REG_GPIOx_MODE, irqtype)); 320 + FIELD_PREP(REG_GPIOx_MODE, irqtype)); 319 321 320 322 if (type & IRQ_TYPE_LEVEL_MASK) 321 323 irq_set_handler_locked(data, handle_level_irq); ··· 360 366 void **irq_data = NULL; 361 367 int ret; 362 368 363 - if (!of_property_read_bool(pctl->dev->of_node, "gpio-controller")) 364 - return dev_err_probe(pctl->dev, -ENODEV, 365 - "No gpio-controller property\n"); 366 - 367 369 pctl->irq_chip = apple_gpio_irqchip; 368 370 369 371 pctl->gpio_chip.label = dev_name(pctl->dev); ··· 373 383 pctl->gpio_chip.base = -1; 374 384 pctl->gpio_chip.ngpio = pctl->pinctrl_desc.npins; 375 385 pctl->gpio_chip.parent = pctl->dev; 376 - pctl->gpio_chip.of_node = pctl->dev->of_node; 377 386 378 387 if (girq->num_parents) { 379 388 int i; ··· 387 398 GFP_KERNEL); 388 399 if (!girq->parents || !irq_data) { 389 400 ret = -ENOMEM; 390 - goto out; 401 + goto out_free_irq_data; 391 402 } 392 403 393 404 for (i = 0; i < girq->num_parents; i++) { 394 - ret = platform_get_irq(to_platform_device(pctl->dev), 395 - i); 405 + ret = platform_get_irq(to_platform_device(pctl->dev), i); 396 406 if (ret < 0) 397 - goto out; 407 + goto out_free_irq_data; 398 408 399 409 girq->parents[i] = ret; 400 410 pctl->irqgrps[i] = i; ··· 407 419 } 408 420 409 421 ret = devm_gpiochip_add_data(pctl->dev, &pctl->gpio_chip, pctl); 410 - out: 422 + 423 + out_free_irq_data: 411 424 kfree(girq->parents); 412 425 kfree(irq_data); 413 426
+7 -6
drivers/pinctrl/pinctrl-as3722.c
··· 23 23 #include <linux/delay.h> 24 24 #include <linux/gpio/driver.h> 25 25 #include <linux/kernel.h> 26 + #include <linux/mod_devicetable.h> 26 27 #include <linux/module.h> 27 28 #include <linux/mfd/as3722.h> 28 - #include <linux/of.h> 29 - #include <linux/of_device.h> 30 29 #include <linux/platform_device.h> 30 + #include <linux/pm.h> 31 + #include <linux/property.h> 32 + #include <linux/slab.h> 33 + 31 34 #include <linux/pinctrl/consumer.h> 32 35 #include <linux/pinctrl/machine.h> 33 36 #include <linux/pinctrl/pinctrl.h> 34 37 #include <linux/pinctrl/pinconf-generic.h> 35 38 #include <linux/pinctrl/pinconf.h> 36 39 #include <linux/pinctrl/pinmux.h> 37 - #include <linux/pm.h> 38 - #include <linux/slab.h> 39 40 40 41 #include "core.h" 41 42 #include "pinconf.h" ··· 552 551 struct as3722_pctrl_info *as_pci; 553 552 int ret; 554 553 554 + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); 555 + 555 556 as_pci = devm_kzalloc(&pdev->dev, sizeof(*as_pci), GFP_KERNEL); 556 557 if (!as_pci) 557 558 return -ENOMEM; 558 559 559 560 as_pci->dev = &pdev->dev; 560 - as_pci->dev->of_node = pdev->dev.parent->of_node; 561 561 as_pci->as3722 = dev_get_drvdata(pdev->dev.parent); 562 562 platform_set_drvdata(pdev, as_pci); 563 563 ··· 580 578 581 579 as_pci->gpio_chip = as3722_gpio_chip; 582 580 as_pci->gpio_chip.parent = &pdev->dev; 583 - as_pci->gpio_chip.of_node = pdev->dev.parent->of_node; 584 581 ret = gpiochip_add_data(&as_pci->gpio_chip, as_pci); 585 582 if (ret < 0) { 586 583 dev_err(&pdev->dev, "Couldn't register gpiochip, %d\n", ret);
-1
drivers/pinctrl/pinctrl-at91-pio4.c
··· 1136 1136 } 1137 1137 1138 1138 atmel_pioctrl->gpio_chip = &atmel_gpio_chip; 1139 - atmel_pioctrl->gpio_chip->of_node = dev->of_node; 1140 1139 atmel_pioctrl->gpio_chip->ngpio = atmel_pioctrl->npins; 1141 1140 atmel_pioctrl->gpio_chip->label = dev_name(dev); 1142 1141 atmel_pioctrl->gpio_chip->parent = dev;
-1
drivers/pinctrl/pinctrl-at91.c
··· 1868 1868 at91_chip->chip = at91_gpio_template; 1869 1869 1870 1870 chip = &at91_chip->chip; 1871 - chip->of_node = np; 1872 1871 chip->label = dev_name(&pdev->dev); 1873 1872 chip->parent = &pdev->dev; 1874 1873 chip->owner = THIS_MODULE;
+3 -3
drivers/pinctrl/pinctrl-da9062.c
··· 14 14 #include <linux/bits.h> 15 15 #include <linux/module.h> 16 16 #include <linux/platform_device.h> 17 + #include <linux/property.h> 17 18 #include <linux/regmap.h> 18 19 19 20 #include <linux/gpio/driver.h> ··· 257 256 struct da9062_pctl *pctl; 258 257 int i; 259 258 259 + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); 260 + 260 261 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); 261 262 if (!pctl) 262 263 return -ENOMEM; ··· 280 277 pctl->gc = reference_gc; 281 278 pctl->gc.label = dev_name(&pdev->dev); 282 279 pctl->gc.parent = &pdev->dev; 283 - #ifdef CONFIG_OF_GPIO 284 - pctl->gc.of_node = parent->of_node; 285 - #endif 286 280 287 281 platform_set_drvdata(pdev, pctl); 288 282
+2 -3
drivers/pinctrl/pinctrl-digicolor.c
··· 233 233 spin_unlock_irqrestore(&pmap->lock, flags); 234 234 } 235 235 236 - static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np) 236 + static int dc_gpiochip_add(struct dc_pinmap *pmap) 237 237 { 238 238 struct gpio_chip *chip = &pmap->chip; 239 239 int ret; ··· 248 248 chip->set = dc_gpio_set; 249 249 chip->base = -1; 250 250 chip->ngpio = PINS_COUNT; 251 - chip->of_node = np; 252 251 chip->of_gpio_n_cells = 2; 253 252 254 253 spin_lock_init(&pmap->lock); ··· 325 326 return PTR_ERR(pmap->pctl); 326 327 } 327 328 328 - return dc_gpiochip_add(pmap, pdev->dev.of_node); 329 + return dc_gpiochip_add(pmap); 329 330 } 330 331 331 332 static const struct of_device_id dc_pinctrl_ids[] = {
+34 -49
drivers/pinctrl/pinctrl-keembay.c
··· 1555 1555 } 1556 1556 1557 1557 static int keembay_add_functions(struct keembay_pinctrl *kpc, 1558 - struct function_desc *function) 1558 + struct function_desc *functions) 1559 1559 { 1560 1560 unsigned int i; 1561 1561 1562 1562 /* Assign the groups for each function */ 1563 - for (i = 0; i < kpc->npins; i++) { 1564 - const struct pinctrl_pin_desc *pdesc = keembay_pins + i; 1565 - struct keembay_mux_desc *mux = pdesc->drv_data; 1563 + for (i = 0; i < kpc->nfuncs; i++) { 1564 + struct function_desc *func = &functions[i]; 1565 + const char **group_names; 1566 + unsigned int grp_idx = 0; 1567 + int j; 1566 1568 1567 - while (mux->name) { 1568 - struct function_desc *func; 1569 - const char **grp; 1570 - size_t grp_size; 1571 - u32 j, grp_num; 1569 + group_names = devm_kcalloc(kpc->dev, func->num_group_names, 1570 + sizeof(*group_names), GFP_KERNEL); 1571 + if (!group_names) 1572 + return -ENOMEM; 1572 1573 1573 - for (j = 0; j < kpc->nfuncs; j++) { 1574 - if (!strcmp(mux->name, function[j].name)) 1575 - break; 1574 + for (j = 0; j < kpc->npins; j++) { 1575 + const struct pinctrl_pin_desc *pdesc = &keembay_pins[j]; 1576 + struct keembay_mux_desc *mux; 1577 + 1578 + for (mux = pdesc->drv_data; mux->name; mux++) { 1579 + if (!strcmp(mux->name, func->name)) 1580 + group_names[grp_idx++] = pdesc->name; 1576 1581 } 1577 - 1578 - if (j == kpc->nfuncs) 1579 - return -EINVAL; 1580 - 1581 - func = function + j; 1582 - grp_num = func->num_group_names; 1583 - grp_size = sizeof(*func->group_names); 1584 - 1585 - if (!func->group_names) { 1586 - func->group_names = devm_kcalloc(kpc->dev, 1587 - grp_num, 1588 - grp_size, 1589 - GFP_KERNEL); 1590 - if (!func->group_names) 1591 - return -ENOMEM; 1592 - } 1593 - 1594 - grp = func->group_names; 1595 - while (*grp) 1596 - grp++; 1597 - 1598 - *grp = pdesc->name; 1599 - mux++; 1600 1582 } 1583 + 1584 + func->group_names = group_names; 1601 1585 } 1602 1586 1603 1587 /* Add all functions */ 1604 1588 for (i = 0; i < kpc->nfuncs; i++) { 1605 1589 pinmux_generic_add_function(kpc->pctrl, 1606 - function[i].name, 1607 - function[i].group_names, 1608 - function[i].num_group_names, 1609 - function[i].data); 1590 + functions[i].name, 1591 + functions[i].group_names, 1592 + functions[i].num_group_names, 1593 + functions[i].data); 1610 1594 } 1611 1595 1612 1596 return 0; ··· 1601 1617 struct function_desc *keembay_funcs, *new_funcs; 1602 1618 int i; 1603 1619 1604 - /* Allocate total number of functions */ 1620 + /* 1621 + * Allocate maximum possible number of functions. Assume every pin 1622 + * being part of 8 (hw maximum) globally unique muxes. 1623 + */ 1605 1624 kpc->nfuncs = 0; 1606 1625 keembay_funcs = kcalloc(kpc->npins * 8, sizeof(*keembay_funcs), GFP_KERNEL); 1607 1626 if (!keembay_funcs) 1608 1627 return -ENOMEM; 1609 1628 1610 - /* Find total number of functions and each's properties */ 1629 + /* Setup 1 function for each unique mux */ 1611 1630 for (i = 0; i < kpc->npins; i++) { 1612 1631 const struct pinctrl_pin_desc *pdesc = keembay_pins + i; 1613 - struct keembay_mux_desc *mux = pdesc->drv_data; 1632 + struct keembay_mux_desc *mux; 1614 1633 1615 - while (mux->name) { 1616 - struct function_desc *fdesc = keembay_funcs; 1634 + for (mux = pdesc->drv_data; mux->name; mux++) { 1635 + struct function_desc *fdesc; 1617 1636 1618 - while (fdesc->name) { 1637 + /* Check if we already have function for this mux */ 1638 + for (fdesc = keembay_funcs; fdesc->name; fdesc++) { 1619 1639 if (!strcmp(mux->name, fdesc->name)) { 1620 1640 fdesc->num_group_names++; 1621 1641 break; 1622 1642 } 1623 - 1624 - fdesc++; 1625 1643 } 1626 1644 1645 + /* Setup new function for this mux we didn't see before */ 1627 1646 if (!fdesc->name) { 1628 1647 fdesc->name = mux->name; 1629 1648 fdesc->num_group_names = 1; 1630 1649 fdesc->data = &mux->mode; 1631 1650 kpc->nfuncs++; 1632 1651 } 1633 - 1634 - mux++; 1635 1652 } 1636 1653 } 1637 1654
+7 -4
drivers/pinctrl/pinctrl-max77620.c
··· 10 10 */ 11 11 12 12 #include <linux/mfd/max77620.h> 13 + #include <linux/mod_devicetable.h> 13 14 #include <linux/module.h> 14 - #include <linux/of.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/property.h> 17 + #include <linux/regmap.h> 18 + 15 19 #include <linux/pinctrl/pinctrl.h> 16 20 #include <linux/pinctrl/pinconf-generic.h> 17 21 #include <linux/pinctrl/pinconf.h> 18 22 #include <linux/pinctrl/pinmux.h> 19 - #include <linux/platform_device.h> 20 - #include <linux/regmap.h> 21 23 22 24 #include "core.h" 23 25 #include "pinconf.h" ··· 553 551 struct max77620_pctrl_info *mpci; 554 552 int i; 555 553 554 + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); 555 + 556 556 mpci = devm_kzalloc(&pdev->dev, sizeof(*mpci), GFP_KERNEL); 557 557 if (!mpci) 558 558 return -ENOMEM; 559 559 560 560 mpci->dev = &pdev->dev; 561 - mpci->dev->of_node = pdev->dev.parent->of_node; 562 561 mpci->rmap = max77620->rmap; 563 562 564 563 mpci->pins = max77620_pins_desc;
-1
drivers/pinctrl/pinctrl-mcp23s08.c
··· 551 551 mcp->chip.set = mcp23s08_set; 552 552 #ifdef CONFIG_OF_GPIO 553 553 mcp->chip.of_gpio_n_cells = 2; 554 - mcp->chip.of_node = dev->of_node; 555 554 #endif 556 555 557 556 mcp->chip.base = base;
+35 -12
drivers/pinctrl/pinctrl-microchip-sgpio.c
··· 17 17 #include <linux/pinctrl/pinmux.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/property.h> 20 + #include <linux/regmap.h> 20 21 #include <linux/reset.h> 21 22 22 23 #include "core.h" ··· 114 113 u32 bitcount; 115 114 u32 ports; 116 115 u32 clock; 117 - u32 __iomem *regs; 116 + struct regmap *regs; 118 117 const struct sgpio_properties *properties; 119 118 }; 120 119 ··· 135 134 return bit + port * priv->bitcount; 136 135 } 137 136 138 - static inline u32 sgpio_readl(struct sgpio_priv *priv, u32 rno, u32 off) 137 + static inline u32 sgpio_get_addr(struct sgpio_priv *priv, u32 rno, u32 off) 139 138 { 140 - u32 __iomem *reg = &priv->regs[priv->properties->regoff[rno] + off]; 141 - 142 - return readl(reg); 139 + return priv->properties->regoff[rno] + off; 143 140 } 144 141 145 - static inline void sgpio_writel(struct sgpio_priv *priv, 142 + static u32 sgpio_readl(struct sgpio_priv *priv, u32 rno, u32 off) 143 + { 144 + u32 addr = sgpio_get_addr(priv, rno, off); 145 + u32 val = 0; 146 + int ret; 147 + 148 + ret = regmap_read(priv->regs, addr, &val); 149 + WARN_ONCE(ret, "error reading sgpio reg %d\n", ret); 150 + 151 + return val; 152 + } 153 + 154 + static void sgpio_writel(struct sgpio_priv *priv, 146 155 u32 val, u32 rno, u32 off) 147 156 { 148 - u32 __iomem *reg = &priv->regs[priv->properties->regoff[rno] + off]; 157 + u32 addr = sgpio_get_addr(priv, rno, off); 158 + int ret; 149 159 150 - writel(val, reg); 160 + ret = regmap_write(priv->regs, addr, val); 161 + WARN_ONCE(ret, "error writing sgpio reg %d\n", ret); 151 162 } 152 163 153 164 static inline void sgpio_clrsetbits(struct sgpio_priv *priv, 154 165 u32 rno, u32 off, u32 clear, u32 set) 155 166 { 156 - u32 __iomem *reg = &priv->regs[priv->properties->regoff[rno] + off]; 157 - u32 val = readl(reg); 167 + u32 val = sgpio_readl(priv, rno, off); 158 168 159 169 val &= ~clear; 160 170 val |= set; 161 171 162 - writel(val, reg); 172 + sgpio_writel(priv, val, rno, off); 163 173 } 164 174 165 175 static inline void sgpio_configure_bitstream(struct sgpio_priv *priv) ··· 819 807 struct reset_control *reset; 820 808 struct sgpio_priv *priv; 821 809 struct clk *clk; 810 + u32 __iomem *regs; 822 811 u32 val; 812 + struct regmap_config regmap_config = { 813 + .reg_bits = 32, 814 + .val_bits = 32, 815 + .reg_stride = 4, 816 + }; 823 817 824 818 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 825 819 if (!priv) ··· 850 832 return -EINVAL; 851 833 } 852 834 853 - priv->regs = devm_platform_ioremap_resource(pdev, 0); 835 + regs = devm_platform_ioremap_resource(pdev, 0); 836 + if (IS_ERR(regs)) 837 + return PTR_ERR(regs); 838 + 839 + priv->regs = devm_regmap_init_mmio(dev, regs, &regmap_config); 854 840 if (IS_ERR(priv->regs)) 855 841 return PTR_ERR(priv->regs); 842 + 856 843 priv->properties = device_get_match_data(dev); 857 844 priv->in.is_input = true; 858 845
+472 -14
drivers/pinctrl/pinctrl-ocelot.c
··· 57 57 #define OCELOT_FUNC_PER_PIN 4 58 58 59 59 enum { 60 + FUNC_CAN0_a, 61 + FUNC_CAN0_b, 62 + FUNC_CAN1, 60 63 FUNC_NONE, 64 + FUNC_FC0_a, 65 + FUNC_FC0_b, 66 + FUNC_FC0_c, 67 + FUNC_FC1_a, 68 + FUNC_FC1_b, 69 + FUNC_FC1_c, 70 + FUNC_FC2_a, 71 + FUNC_FC2_b, 72 + FUNC_FC3_a, 73 + FUNC_FC3_b, 74 + FUNC_FC3_c, 75 + FUNC_FC4_a, 76 + FUNC_FC4_b, 77 + FUNC_FC4_c, 78 + FUNC_FC_SHRD0, 79 + FUNC_FC_SHRD1, 80 + FUNC_FC_SHRD2, 81 + FUNC_FC_SHRD3, 82 + FUNC_FC_SHRD4, 83 + FUNC_FC_SHRD5, 84 + FUNC_FC_SHRD6, 85 + FUNC_FC_SHRD7, 86 + FUNC_FC_SHRD8, 87 + FUNC_FC_SHRD9, 88 + FUNC_FC_SHRD10, 89 + FUNC_FC_SHRD11, 90 + FUNC_FC_SHRD12, 91 + FUNC_FC_SHRD13, 92 + FUNC_FC_SHRD14, 93 + FUNC_FC_SHRD15, 94 + FUNC_FC_SHRD16, 95 + FUNC_FC_SHRD17, 96 + FUNC_FC_SHRD18, 97 + FUNC_FC_SHRD19, 98 + FUNC_FC_SHRD20, 61 99 FUNC_GPIO, 100 + FUNC_IB_TRG_a, 101 + FUNC_IB_TRG_b, 102 + FUNC_IB_TRG_c, 62 103 FUNC_IRQ0, 104 + FUNC_IRQ_IN_a, 105 + FUNC_IRQ_IN_b, 106 + FUNC_IRQ_IN_c, 63 107 FUNC_IRQ0_IN, 108 + FUNC_IRQ_OUT_a, 109 + FUNC_IRQ_OUT_b, 110 + FUNC_IRQ_OUT_c, 64 111 FUNC_IRQ0_OUT, 65 112 FUNC_IRQ1, 66 113 FUNC_IRQ1_IN, 67 114 FUNC_IRQ1_OUT, 68 115 FUNC_EXT_IRQ, 69 116 FUNC_MIIM, 117 + FUNC_MIIM_a, 118 + FUNC_MIIM_b, 119 + FUNC_MIIM_c, 120 + FUNC_MIIM_Sa, 121 + FUNC_MIIM_Sb, 122 + FUNC_OB_TRG, 123 + FUNC_OB_TRG_a, 124 + FUNC_OB_TRG_b, 70 125 FUNC_PHY_LED, 71 126 FUNC_PCI_WAKE, 72 127 FUNC_MD, ··· 129 74 FUNC_PTP1, 130 75 FUNC_PTP2, 131 76 FUNC_PTP3, 77 + FUNC_PTPSYNC_1, 78 + FUNC_PTPSYNC_2, 79 + FUNC_PTPSYNC_3, 80 + FUNC_PTPSYNC_4, 81 + FUNC_PTPSYNC_5, 82 + FUNC_PTPSYNC_6, 83 + FUNC_PTPSYNC_7, 132 84 FUNC_PWM, 85 + FUNC_QSPI1, 86 + FUNC_QSPI2, 87 + FUNC_R, 88 + FUNC_RECO_a, 89 + FUNC_RECO_b, 133 90 FUNC_RECO_CLK, 91 + FUNC_SD, 134 92 FUNC_SFP, 93 + FUNC_SFP_SD, 135 94 FUNC_SG0, 136 95 FUNC_SG1, 137 96 FUNC_SG2, 97 + FUNC_SGPIO_a, 98 + FUNC_SGPIO_b, 138 99 FUNC_SI, 139 100 FUNC_SI2, 140 101 FUNC_TACHO, 102 + FUNC_TACHO_a, 103 + FUNC_TACHO_b, 141 104 FUNC_TWI, 142 105 FUNC_TWI2, 143 106 FUNC_TWI3, 144 107 FUNC_TWI_SCL_M, 108 + FUNC_TWI_SLC_GATE, 109 + FUNC_TWI_SLC_GATE_AD, 145 110 FUNC_UART, 146 111 FUNC_UART2, 147 112 FUNC_UART3, 113 + FUNC_USB_H_a, 114 + FUNC_USB_H_b, 115 + FUNC_USB_H_c, 116 + FUNC_USB_S_a, 117 + FUNC_USB_S_b, 118 + FUNC_USB_S_c, 148 119 FUNC_PLL_STAT, 149 120 FUNC_EMMC, 121 + FUNC_EMMC_SD, 150 122 FUNC_REF_CLK, 151 123 FUNC_RCVRD_CLK, 152 124 FUNC_MAX 153 125 }; 154 126 155 127 static const char *const ocelot_function_names[] = { 128 + [FUNC_CAN0_a] = "can0_a", 129 + [FUNC_CAN0_b] = "can0_b", 130 + [FUNC_CAN1] = "can1", 156 131 [FUNC_NONE] = "none", 132 + [FUNC_FC0_a] = "fc0_a", 133 + [FUNC_FC0_b] = "fc0_b", 134 + [FUNC_FC0_c] = "fc0_c", 135 + [FUNC_FC1_a] = "fc1_a", 136 + [FUNC_FC1_b] = "fc1_b", 137 + [FUNC_FC1_c] = "fc1_c", 138 + [FUNC_FC2_a] = "fc2_a", 139 + [FUNC_FC2_b] = "fc2_b", 140 + [FUNC_FC3_a] = "fc3_a", 141 + [FUNC_FC3_b] = "fc3_b", 142 + [FUNC_FC3_c] = "fc3_c", 143 + [FUNC_FC4_a] = "fc4_a", 144 + [FUNC_FC4_b] = "fc4_b", 145 + [FUNC_FC4_c] = "fc4_c", 146 + [FUNC_FC_SHRD0] = "fc_shrd0", 147 + [FUNC_FC_SHRD1] = "fc_shrd1", 148 + [FUNC_FC_SHRD2] = "fc_shrd2", 149 + [FUNC_FC_SHRD3] = "fc_shrd3", 150 + [FUNC_FC_SHRD4] = "fc_shrd4", 151 + [FUNC_FC_SHRD5] = "fc_shrd5", 152 + [FUNC_FC_SHRD6] = "fc_shrd6", 153 + [FUNC_FC_SHRD7] = "fc_shrd7", 154 + [FUNC_FC_SHRD8] = "fc_shrd8", 155 + [FUNC_FC_SHRD9] = "fc_shrd9", 156 + [FUNC_FC_SHRD10] = "fc_shrd10", 157 + [FUNC_FC_SHRD11] = "fc_shrd11", 158 + [FUNC_FC_SHRD12] = "fc_shrd12", 159 + [FUNC_FC_SHRD13] = "fc_shrd13", 160 + [FUNC_FC_SHRD14] = "fc_shrd14", 161 + [FUNC_FC_SHRD15] = "fc_shrd15", 162 + [FUNC_FC_SHRD16] = "fc_shrd16", 163 + [FUNC_FC_SHRD17] = "fc_shrd17", 164 + [FUNC_FC_SHRD18] = "fc_shrd18", 165 + [FUNC_FC_SHRD19] = "fc_shrd19", 166 + [FUNC_FC_SHRD20] = "fc_shrd20", 157 167 [FUNC_GPIO] = "gpio", 168 + [FUNC_IB_TRG_a] = "ib_trig_a", 169 + [FUNC_IB_TRG_b] = "ib_trig_b", 170 + [FUNC_IB_TRG_c] = "ib_trig_c", 158 171 [FUNC_IRQ0] = "irq0", 172 + [FUNC_IRQ_IN_a] = "irq_in_a", 173 + [FUNC_IRQ_IN_b] = "irq_in_b", 174 + [FUNC_IRQ_IN_c] = "irq_in_c", 159 175 [FUNC_IRQ0_IN] = "irq0_in", 176 + [FUNC_IRQ_OUT_a] = "irq_out_a", 177 + [FUNC_IRQ_OUT_b] = "irq_out_b", 178 + [FUNC_IRQ_OUT_c] = "irq_out_c", 160 179 [FUNC_IRQ0_OUT] = "irq0_out", 161 180 [FUNC_IRQ1] = "irq1", 162 181 [FUNC_IRQ1_IN] = "irq1_in", 163 182 [FUNC_IRQ1_OUT] = "irq1_out", 164 183 [FUNC_EXT_IRQ] = "ext_irq", 165 184 [FUNC_MIIM] = "miim", 185 + [FUNC_MIIM_a] = "miim_a", 186 + [FUNC_MIIM_b] = "miim_b", 187 + [FUNC_MIIM_c] = "miim_c", 188 + [FUNC_MIIM_Sa] = "miim_slave_a", 189 + [FUNC_MIIM_Sb] = "miim_slave_b", 166 190 [FUNC_PHY_LED] = "phy_led", 167 191 [FUNC_PCI_WAKE] = "pci_wake", 168 192 [FUNC_MD] = "md", 193 + [FUNC_OB_TRG] = "ob_trig", 194 + [FUNC_OB_TRG_a] = "ob_trig_a", 195 + [FUNC_OB_TRG_b] = "ob_trig_b", 169 196 [FUNC_PTP0] = "ptp0", 170 197 [FUNC_PTP1] = "ptp1", 171 198 [FUNC_PTP2] = "ptp2", 172 199 [FUNC_PTP3] = "ptp3", 200 + [FUNC_PTPSYNC_1] = "ptpsync_1", 201 + [FUNC_PTPSYNC_2] = "ptpsync_2", 202 + [FUNC_PTPSYNC_3] = "ptpsync_3", 203 + [FUNC_PTPSYNC_4] = "ptpsync_4", 204 + [FUNC_PTPSYNC_5] = "ptpsync_5", 205 + [FUNC_PTPSYNC_6] = "ptpsync_6", 206 + [FUNC_PTPSYNC_7] = "ptpsync_7", 173 207 [FUNC_PWM] = "pwm", 208 + [FUNC_QSPI1] = "qspi1", 209 + [FUNC_QSPI2] = "qspi2", 210 + [FUNC_R] = "reserved", 211 + [FUNC_RECO_a] = "reco_a", 212 + [FUNC_RECO_b] = "reco_b", 174 213 [FUNC_RECO_CLK] = "reco_clk", 214 + [FUNC_SD] = "sd", 175 215 [FUNC_SFP] = "sfp", 216 + [FUNC_SFP_SD] = "sfp_sd", 176 217 [FUNC_SG0] = "sg0", 177 218 [FUNC_SG1] = "sg1", 178 219 [FUNC_SG2] = "sg2", 220 + [FUNC_SGPIO_a] = "sgpio_a", 221 + [FUNC_SGPIO_b] = "sgpio_b", 179 222 [FUNC_SI] = "si", 180 223 [FUNC_SI2] = "si2", 181 224 [FUNC_TACHO] = "tacho", 225 + [FUNC_TACHO_a] = "tacho_a", 226 + [FUNC_TACHO_b] = "tacho_b", 182 227 [FUNC_TWI] = "twi", 183 228 [FUNC_TWI2] = "twi2", 184 229 [FUNC_TWI3] = "twi3", 185 230 [FUNC_TWI_SCL_M] = "twi_scl_m", 231 + [FUNC_TWI_SLC_GATE] = "twi_slc_gate", 232 + [FUNC_TWI_SLC_GATE_AD] = "twi_slc_gate_ad", 233 + [FUNC_USB_H_a] = "usb_host_a", 234 + [FUNC_USB_H_b] = "usb_host_b", 235 + [FUNC_USB_H_c] = "usb_host_c", 236 + [FUNC_USB_S_a] = "usb_slave_a", 237 + [FUNC_USB_S_b] = "usb_slave_b", 238 + [FUNC_USB_S_c] = "usb_slave_c", 186 239 [FUNC_UART] = "uart", 187 240 [FUNC_UART2] = "uart2", 188 241 [FUNC_UART3] = "uart3", 189 242 [FUNC_PLL_STAT] = "pll_stat", 190 243 [FUNC_EMMC] = "emmc", 244 + [FUNC_EMMC_SD] = "emmc_sd", 191 245 [FUNC_REF_CLK] = "ref_clk", 192 246 [FUNC_RCVRD_CLK] = "rcvrd_clk", 193 247 }; ··· 309 145 struct ocelot_pin_caps { 310 146 unsigned int pin; 311 147 unsigned char functions[OCELOT_FUNC_PER_PIN]; 148 + unsigned char a_functions[OCELOT_FUNC_PER_PIN]; /* Additional functions */ 312 149 }; 313 150 314 151 struct ocelot_pinctrl { ··· 317 152 struct pinctrl_dev *pctl; 318 153 struct gpio_chip gpio_chip; 319 154 struct regmap *map; 320 - void __iomem *pincfg; 155 + struct regmap *pincfg; 321 156 struct pinctrl_desc *desc; 322 157 struct ocelot_pmx_func func[FUNC_MAX]; 323 158 u8 stride; ··· 841 676 SPARX5_PIN(63), 842 677 }; 843 678 679 + #define LAN966X_P(p, f0, f1, f2, f3, f4, f5, f6, f7) \ 680 + static struct ocelot_pin_caps lan966x_pin_##p = { \ 681 + .pin = p, \ 682 + .functions = { \ 683 + FUNC_##f0, FUNC_##f1, FUNC_##f2, \ 684 + FUNC_##f3 \ 685 + }, \ 686 + .a_functions = { \ 687 + FUNC_##f4, FUNC_##f5, FUNC_##f6, \ 688 + FUNC_##f7 \ 689 + }, \ 690 + } 691 + 692 + /* Pinmuxing table taken from data sheet */ 693 + /* Pin FUNC0 FUNC1 FUNC2 FUNC3 FUNC4 FUNC5 FUNC6 FUNC7 */ 694 + LAN966X_P(0, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 695 + LAN966X_P(1, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 696 + LAN966X_P(2, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 697 + LAN966X_P(3, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 698 + LAN966X_P(4, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 699 + LAN966X_P(5, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 700 + LAN966X_P(6, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 701 + LAN966X_P(7, GPIO, NONE, NONE, NONE, NONE, NONE, NONE, R); 702 + LAN966X_P(8, GPIO, FC0_a, USB_H_b, NONE, USB_S_b, NONE, NONE, R); 703 + LAN966X_P(9, GPIO, FC0_a, USB_H_b, NONE, NONE, NONE, NONE, R); 704 + LAN966X_P(10, GPIO, FC0_a, NONE, NONE, NONE, NONE, NONE, R); 705 + LAN966X_P(11, GPIO, FC1_a, NONE, NONE, NONE, NONE, NONE, R); 706 + LAN966X_P(12, GPIO, FC1_a, NONE, NONE, NONE, NONE, NONE, R); 707 + LAN966X_P(13, GPIO, FC1_a, NONE, NONE, NONE, NONE, NONE, R); 708 + LAN966X_P(14, GPIO, FC2_a, NONE, NONE, NONE, NONE, NONE, R); 709 + LAN966X_P(15, GPIO, FC2_a, NONE, NONE, NONE, NONE, NONE, R); 710 + LAN966X_P(16, GPIO, FC2_a, IB_TRG_a, NONE, OB_TRG_a, IRQ_IN_c, IRQ_OUT_c, R); 711 + LAN966X_P(17, GPIO, FC3_a, IB_TRG_a, NONE, OB_TRG_a, IRQ_IN_c, IRQ_OUT_c, R); 712 + LAN966X_P(18, GPIO, FC3_a, IB_TRG_a, NONE, OB_TRG_a, IRQ_IN_c, IRQ_OUT_c, R); 713 + LAN966X_P(19, GPIO, FC3_a, IB_TRG_a, NONE, OB_TRG_a, IRQ_IN_c, IRQ_OUT_c, R); 714 + LAN966X_P(20, GPIO, FC4_a, IB_TRG_a, NONE, OB_TRG_a, IRQ_IN_c, NONE, R); 715 + LAN966X_P(21, GPIO, FC4_a, NONE, NONE, OB_TRG_a, NONE, NONE, R); 716 + LAN966X_P(22, GPIO, FC4_a, NONE, NONE, OB_TRG_a, NONE, NONE, R); 717 + LAN966X_P(23, GPIO, NONE, NONE, NONE, OB_TRG_a, NONE, NONE, R); 718 + LAN966X_P(24, GPIO, FC0_b, IB_TRG_a, USB_H_c, OB_TRG_a, IRQ_IN_c, TACHO_a, R); 719 + LAN966X_P(25, GPIO, FC0_b, IB_TRG_a, USB_H_c, OB_TRG_a, IRQ_OUT_c, SFP_SD, R); 720 + LAN966X_P(26, GPIO, FC0_b, IB_TRG_a, USB_S_c, OB_TRG_a, CAN0_a, SFP_SD, R); 721 + LAN966X_P(27, GPIO, NONE, NONE, NONE, OB_TRG_a, CAN0_a, NONE, R); 722 + LAN966X_P(28, GPIO, MIIM_a, NONE, NONE, OB_TRG_a, IRQ_OUT_c, SFP_SD, R); 723 + LAN966X_P(29, GPIO, MIIM_a, NONE, NONE, OB_TRG_a, NONE, NONE, R); 724 + LAN966X_P(30, GPIO, FC3_c, CAN1, NONE, OB_TRG, RECO_b, NONE, R); 725 + LAN966X_P(31, GPIO, FC3_c, CAN1, NONE, OB_TRG, RECO_b, NONE, R); 726 + LAN966X_P(32, GPIO, FC3_c, NONE, SGPIO_a, NONE, MIIM_Sa, NONE, R); 727 + LAN966X_P(33, GPIO, FC1_b, NONE, SGPIO_a, NONE, MIIM_Sa, MIIM_b, R); 728 + LAN966X_P(34, GPIO, FC1_b, NONE, SGPIO_a, NONE, MIIM_Sa, MIIM_b, R); 729 + LAN966X_P(35, GPIO, FC1_b, NONE, SGPIO_a, CAN0_b, NONE, NONE, R); 730 + LAN966X_P(36, GPIO, NONE, PTPSYNC_1, NONE, CAN0_b, NONE, NONE, R); 731 + LAN966X_P(37, GPIO, FC_SHRD0, PTPSYNC_2, TWI_SLC_GATE_AD, NONE, NONE, NONE, R); 732 + LAN966X_P(38, GPIO, NONE, PTPSYNC_3, NONE, NONE, NONE, NONE, R); 733 + LAN966X_P(39, GPIO, NONE, PTPSYNC_4, NONE, NONE, NONE, NONE, R); 734 + LAN966X_P(40, GPIO, FC_SHRD1, PTPSYNC_5, NONE, NONE, NONE, NONE, R); 735 + LAN966X_P(41, GPIO, FC_SHRD2, PTPSYNC_6, TWI_SLC_GATE_AD, NONE, NONE, NONE, R); 736 + LAN966X_P(42, GPIO, FC_SHRD3, PTPSYNC_7, TWI_SLC_GATE_AD, NONE, NONE, NONE, R); 737 + LAN966X_P(43, GPIO, FC2_b, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, RECO_a, IRQ_IN_a, R); 738 + LAN966X_P(44, GPIO, FC2_b, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, RECO_a, IRQ_IN_a, R); 739 + LAN966X_P(45, GPIO, FC2_b, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, NONE, IRQ_IN_a, R); 740 + LAN966X_P(46, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD4, IRQ_IN_a, R); 741 + LAN966X_P(47, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD5, IRQ_IN_a, R); 742 + LAN966X_P(48, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD6, IRQ_IN_a, R); 743 + LAN966X_P(49, GPIO, FC_SHRD7, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, TWI_SLC_GATE, IRQ_IN_a, R); 744 + LAN966X_P(50, GPIO, FC_SHRD16, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, TWI_SLC_GATE, NONE, R); 745 + LAN966X_P(51, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, NONE, IRQ_IN_b, R); 746 + LAN966X_P(52, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TACHO_b, IRQ_IN_b, R); 747 + LAN966X_P(53, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, NONE, IRQ_IN_b, R); 748 + LAN966X_P(54, GPIO, FC_SHRD8, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TWI_SLC_GATE, IRQ_IN_b, R); 749 + LAN966X_P(55, GPIO, FC_SHRD9, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TWI_SLC_GATE, IRQ_IN_b, R); 750 + LAN966X_P(56, GPIO, FC4_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, FC_SHRD10, IRQ_IN_b, R); 751 + LAN966X_P(57, GPIO, FC4_b, TWI_SLC_GATE, IB_TRG_c, IRQ_OUT_b, FC_SHRD11, IRQ_IN_b, R); 752 + LAN966X_P(58, GPIO, FC4_b, TWI_SLC_GATE, IB_TRG_c, IRQ_OUT_b, FC_SHRD12, IRQ_IN_b, R); 753 + LAN966X_P(59, GPIO, QSPI1, MIIM_c, NONE, NONE, MIIM_Sb, NONE, R); 754 + LAN966X_P(60, GPIO, QSPI1, MIIM_c, NONE, NONE, MIIM_Sb, NONE, R); 755 + LAN966X_P(61, GPIO, QSPI1, NONE, SGPIO_b, FC0_c, MIIM_Sb, NONE, R); 756 + LAN966X_P(62, GPIO, QSPI1, FC_SHRD13, SGPIO_b, FC0_c, TWI_SLC_GATE, SFP_SD, R); 757 + LAN966X_P(63, GPIO, QSPI1, FC_SHRD14, SGPIO_b, FC0_c, TWI_SLC_GATE, SFP_SD, R); 758 + LAN966X_P(64, GPIO, QSPI1, FC4_c, SGPIO_b, FC_SHRD15, TWI_SLC_GATE, SFP_SD, R); 759 + LAN966X_P(65, GPIO, USB_H_a, FC4_c, NONE, IRQ_OUT_c, TWI_SLC_GATE_AD, NONE, R); 760 + LAN966X_P(66, GPIO, USB_H_a, FC4_c, USB_S_a, IRQ_OUT_c, IRQ_IN_c, NONE, R); 761 + LAN966X_P(67, GPIO, EMMC_SD, NONE, QSPI2, NONE, NONE, NONE, R); 762 + LAN966X_P(68, GPIO, EMMC_SD, NONE, QSPI2, NONE, NONE, NONE, R); 763 + LAN966X_P(69, GPIO, EMMC_SD, NONE, QSPI2, NONE, NONE, NONE, R); 764 + LAN966X_P(70, GPIO, EMMC_SD, NONE, QSPI2, NONE, NONE, NONE, R); 765 + LAN966X_P(71, GPIO, EMMC_SD, NONE, QSPI2, NONE, NONE, NONE, R); 766 + LAN966X_P(72, GPIO, EMMC_SD, NONE, QSPI2, NONE, NONE, NONE, R); 767 + LAN966X_P(73, GPIO, EMMC, NONE, NONE, SD, NONE, NONE, R); 768 + LAN966X_P(74, GPIO, EMMC, NONE, FC_SHRD17, SD, TWI_SLC_GATE, NONE, R); 769 + LAN966X_P(75, GPIO, EMMC, NONE, FC_SHRD18, SD, TWI_SLC_GATE, NONE, R); 770 + LAN966X_P(76, GPIO, EMMC, NONE, FC_SHRD19, SD, TWI_SLC_GATE, NONE, R); 771 + LAN966X_P(77, GPIO, EMMC_SD, NONE, FC_SHRD20, NONE, TWI_SLC_GATE, NONE, R); 772 + 773 + #define LAN966X_PIN(n) { \ 774 + .number = n, \ 775 + .name = "GPIO_"#n, \ 776 + .drv_data = &lan966x_pin_##n \ 777 + } 778 + 779 + static const struct pinctrl_pin_desc lan966x_pins[] = { 780 + LAN966X_PIN(0), 781 + LAN966X_PIN(1), 782 + LAN966X_PIN(2), 783 + LAN966X_PIN(3), 784 + LAN966X_PIN(4), 785 + LAN966X_PIN(5), 786 + LAN966X_PIN(6), 787 + LAN966X_PIN(7), 788 + LAN966X_PIN(8), 789 + LAN966X_PIN(9), 790 + LAN966X_PIN(10), 791 + LAN966X_PIN(11), 792 + LAN966X_PIN(12), 793 + LAN966X_PIN(13), 794 + LAN966X_PIN(14), 795 + LAN966X_PIN(15), 796 + LAN966X_PIN(16), 797 + LAN966X_PIN(17), 798 + LAN966X_PIN(18), 799 + LAN966X_PIN(19), 800 + LAN966X_PIN(20), 801 + LAN966X_PIN(21), 802 + LAN966X_PIN(22), 803 + LAN966X_PIN(23), 804 + LAN966X_PIN(24), 805 + LAN966X_PIN(25), 806 + LAN966X_PIN(26), 807 + LAN966X_PIN(27), 808 + LAN966X_PIN(28), 809 + LAN966X_PIN(29), 810 + LAN966X_PIN(30), 811 + LAN966X_PIN(31), 812 + LAN966X_PIN(32), 813 + LAN966X_PIN(33), 814 + LAN966X_PIN(34), 815 + LAN966X_PIN(35), 816 + LAN966X_PIN(36), 817 + LAN966X_PIN(37), 818 + LAN966X_PIN(38), 819 + LAN966X_PIN(39), 820 + LAN966X_PIN(40), 821 + LAN966X_PIN(41), 822 + LAN966X_PIN(42), 823 + LAN966X_PIN(43), 824 + LAN966X_PIN(44), 825 + LAN966X_PIN(45), 826 + LAN966X_PIN(46), 827 + LAN966X_PIN(47), 828 + LAN966X_PIN(48), 829 + LAN966X_PIN(49), 830 + LAN966X_PIN(50), 831 + LAN966X_PIN(51), 832 + LAN966X_PIN(52), 833 + LAN966X_PIN(53), 834 + LAN966X_PIN(54), 835 + LAN966X_PIN(55), 836 + LAN966X_PIN(56), 837 + LAN966X_PIN(57), 838 + LAN966X_PIN(58), 839 + LAN966X_PIN(59), 840 + LAN966X_PIN(60), 841 + LAN966X_PIN(61), 842 + LAN966X_PIN(62), 843 + LAN966X_PIN(63), 844 + LAN966X_PIN(64), 845 + LAN966X_PIN(65), 846 + LAN966X_PIN(66), 847 + LAN966X_PIN(67), 848 + LAN966X_PIN(68), 849 + LAN966X_PIN(69), 850 + LAN966X_PIN(70), 851 + LAN966X_PIN(71), 852 + LAN966X_PIN(72), 853 + LAN966X_PIN(73), 854 + LAN966X_PIN(74), 855 + LAN966X_PIN(75), 856 + LAN966X_PIN(76), 857 + LAN966X_PIN(77), 858 + }; 859 + 844 860 static int ocelot_get_functions_count(struct pinctrl_dev *pctldev) 845 861 { 846 862 return ARRAY_SIZE(ocelot_function_names); ··· 1055 709 for (i = 0; i < OCELOT_FUNC_PER_PIN; i++) { 1056 710 if (function == p->functions[i]) 1057 711 return i; 712 + 713 + if (function == p->a_functions[i]) 714 + return i + OCELOT_FUNC_PER_PIN; 1058 715 } 1059 716 1060 717 return -1; ··· 1093 744 return 0; 1094 745 } 1095 746 747 + static int lan966x_pinmux_set_mux(struct pinctrl_dev *pctldev, 748 + unsigned int selector, unsigned int group) 749 + { 750 + struct ocelot_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 751 + struct ocelot_pin_caps *pin = info->desc->pins[group].drv_data; 752 + unsigned int p = pin->pin % 32; 753 + int f; 754 + 755 + f = ocelot_pin_function_idx(info, group, selector); 756 + if (f < 0) 757 + return -EINVAL; 758 + 759 + /* 760 + * f is encoded on three bits. 761 + * bit 0 of f goes in BIT(pin) of ALT[0], bit 1 of f goes in BIT(pin) of 762 + * ALT[1], bit 2 of f goes in BIT(pin) of ALT[2] 763 + * This is racy because three registers can't be updated at the same time 764 + * but it doesn't matter much for now. 765 + * Note: ALT0/ALT1/ALT2 are organized specially for 78 gpio targets 766 + */ 767 + regmap_update_bits(info->map, REG_ALT(0, info, pin->pin), 768 + BIT(p), f << p); 769 + regmap_update_bits(info->map, REG_ALT(1, info, pin->pin), 770 + BIT(p), (f >> 1) << p); 771 + regmap_update_bits(info->map, REG_ALT(2, info, pin->pin), 772 + BIT(p), (f >> 2) << p); 773 + 774 + return 0; 775 + } 776 + 1096 777 #define REG(r, info, p) ((r) * (info)->stride + (4 * ((p) / 32))) 1097 778 1098 779 static int ocelot_gpio_set_direction(struct pinctrl_dev *pctldev, ··· 1153 774 return 0; 1154 775 } 1155 776 777 + static int lan966x_gpio_request_enable(struct pinctrl_dev *pctldev, 778 + struct pinctrl_gpio_range *range, 779 + unsigned int offset) 780 + { 781 + struct ocelot_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 782 + unsigned int p = offset % 32; 783 + 784 + regmap_update_bits(info->map, REG_ALT(0, info, offset), 785 + BIT(p), 0); 786 + regmap_update_bits(info->map, REG_ALT(1, info, offset), 787 + BIT(p), 0); 788 + regmap_update_bits(info->map, REG_ALT(2, info, offset), 789 + BIT(p), 0); 790 + 791 + return 0; 792 + } 793 + 1156 794 static const struct pinmux_ops ocelot_pmx_ops = { 1157 795 .get_functions_count = ocelot_get_functions_count, 1158 796 .get_function_name = ocelot_get_function_name, ··· 1177 781 .set_mux = ocelot_pinmux_set_mux, 1178 782 .gpio_set_direction = ocelot_gpio_set_direction, 1179 783 .gpio_request_enable = ocelot_gpio_request_enable, 784 + }; 785 + 786 + static const struct pinmux_ops lan966x_pmx_ops = { 787 + .get_functions_count = ocelot_get_functions_count, 788 + .get_function_name = ocelot_get_function_name, 789 + .get_function_groups = ocelot_get_function_groups, 790 + .set_mux = lan966x_pinmux_set_mux, 791 + .gpio_set_direction = ocelot_gpio_set_direction, 792 + .gpio_request_enable = lan966x_gpio_request_enable, 1180 793 }; 1181 794 1182 795 static int ocelot_pctl_get_groups_count(struct pinctrl_dev *pctldev) ··· 1224 819 int ret = -EOPNOTSUPP; 1225 820 1226 821 if (info->pincfg) { 1227 - u32 regcfg = readl(info->pincfg + (pin * sizeof(u32))); 822 + u32 regcfg; 823 + 824 + ret = regmap_read(info->pincfg, pin, &regcfg); 825 + if (ret) 826 + return ret; 1228 827 1229 828 ret = 0; 1230 829 switch (reg) { ··· 1252 843 return ret; 1253 844 } 1254 845 846 + static int ocelot_pincfg_clrsetbits(struct ocelot_pinctrl *info, u32 regaddr, 847 + u32 clrbits, u32 setbits) 848 + { 849 + u32 val; 850 + int ret; 851 + 852 + ret = regmap_read(info->pincfg, regaddr, &val); 853 + if (ret) 854 + return ret; 855 + 856 + val &= ~clrbits; 857 + val |= setbits; 858 + 859 + ret = regmap_write(info->pincfg, regaddr, val); 860 + 861 + return ret; 862 + } 863 + 1255 864 static int ocelot_hw_set_value(struct ocelot_pinctrl *info, 1256 865 unsigned int pin, 1257 866 unsigned int reg, ··· 1278 851 int ret = -EOPNOTSUPP; 1279 852 1280 853 if (info->pincfg) { 1281 - void __iomem *regaddr = info->pincfg + (pin * sizeof(u32)); 1282 854 1283 855 ret = 0; 1284 856 switch (reg) { 1285 857 case PINCONF_BIAS: 1286 - ocelot_clrsetbits(regaddr, BIAS_BITS, val); 858 + ret = ocelot_pincfg_clrsetbits(info, pin, BIAS_BITS, 859 + val); 1287 860 break; 1288 861 1289 862 case PINCONF_SCHMITT: 1290 - ocelot_clrsetbits(regaddr, SCHMITT_BIT, val); 863 + ret = ocelot_pincfg_clrsetbits(info, pin, SCHMITT_BIT, 864 + val); 1291 865 break; 1292 866 1293 867 case PINCONF_DRIVE_STRENGTH: 1294 868 if (val <= 3) 1295 - ocelot_clrsetbits(regaddr, DRIVE_BITS, val); 869 + ret = ocelot_pincfg_clrsetbits(info, pin, 870 + DRIVE_BITS, val); 1296 871 else 1297 872 ret = -EINVAL; 1298 873 break; ··· 1503 1074 .npins = ARRAY_SIZE(sparx5_pins), 1504 1075 .pctlops = &ocelot_pctl_ops, 1505 1076 .pmxops = &ocelot_pmx_ops, 1077 + .confops = &ocelot_confops, 1078 + .owner = THIS_MODULE, 1079 + }; 1080 + 1081 + static struct pinctrl_desc lan966x_desc = { 1082 + .name = "lan966x-pinctrl", 1083 + .pins = lan966x_pins, 1084 + .npins = ARRAY_SIZE(lan966x_pins), 1085 + .pctlops = &ocelot_pctl_ops, 1086 + .pmxops = &lan966x_pmx_ops, 1506 1087 .confops = &ocelot_confops, 1507 1088 .owner = THIS_MODULE, 1508 1089 }; ··· 1747 1308 gc = &info->gpio_chip; 1748 1309 gc->ngpio = info->desc->npins; 1749 1310 gc->parent = &pdev->dev; 1750 - gc->base = 0; 1751 - gc->of_node = info->dev->of_node; 1311 + gc->base = -1; 1752 1312 gc->label = "ocelot-gpio"; 1753 1313 1754 1314 irq = irq_of_parse_and_map(gc->of_node, 0); ··· 1775 1337 { .compatible = "mscc,ocelot-pinctrl", .data = &ocelot_desc }, 1776 1338 { .compatible = "mscc,jaguar2-pinctrl", .data = &jaguar2_desc }, 1777 1339 { .compatible = "microchip,sparx5-pinctrl", .data = &sparx5_desc }, 1340 + { .compatible = "microchip,lan966x-pinctrl", .data = &lan966x_desc }, 1778 1341 {}, 1779 1342 }; 1343 + 1344 + static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev) 1345 + { 1346 + void __iomem *base; 1347 + 1348 + const struct regmap_config regmap_config = { 1349 + .reg_bits = 32, 1350 + .val_bits = 32, 1351 + .reg_stride = 4, 1352 + .max_register = 32, 1353 + }; 1354 + 1355 + base = devm_platform_ioremap_resource(pdev, 0); 1356 + if (IS_ERR(base)) { 1357 + dev_dbg(&pdev->dev, "Failed to ioremap config registers (no extended pinconf)\n"); 1358 + return NULL; 1359 + } 1360 + 1361 + return devm_regmap_init_mmio(&pdev->dev, base, &regmap_config); 1362 + } 1780 1363 1781 1364 static int ocelot_pinctrl_probe(struct platform_device *pdev) 1782 1365 { 1783 1366 struct device *dev = &pdev->dev; 1784 1367 struct ocelot_pinctrl *info; 1368 + struct regmap *pincfg; 1785 1369 void __iomem *base; 1786 - struct resource *res; 1787 1370 int ret; 1788 1371 struct regmap_config regmap_config = { 1789 1372 .reg_bits = 32, ··· 1837 1378 1838 1379 /* Pinconf registers */ 1839 1380 if (info->desc->confops) { 1840 - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1841 - base = devm_ioremap_resource(dev, res); 1842 - if (IS_ERR(base)) 1843 - dev_dbg(dev, "Failed to ioremap config registers (no extended pinconf)\n"); 1381 + pincfg = ocelot_pinctrl_create_pincfg(pdev); 1382 + if (IS_ERR(pincfg)) 1383 + dev_dbg(dev, "Failed to create pincfg regmap\n"); 1844 1384 else 1845 - info->pincfg = base; 1385 + info->pincfg = pincfg; 1846 1386 } 1847 1387 1848 1388 ret = ocelot_pinctrl_register(pdev, info);
-1
drivers/pinctrl/pinctrl-oxnas.c
··· 1232 1232 1233 1233 bank->id = id; 1234 1234 bank->gpio_chip.parent = &pdev->dev; 1235 - bank->gpio_chip.of_node = np; 1236 1235 bank->gpio_chip.ngpio = ngpios; 1237 1236 girq = &bank->gpio_chip.irq; 1238 1237 girq->chip = &bank->irq_chip;
+1 -1
drivers/pinctrl/pinctrl-pic32.c
··· 2241 2241 } 2242 2242 2243 2243 bank->gpio_chip.parent = &pdev->dev; 2244 - bank->gpio_chip.of_node = np; 2244 + 2245 2245 girq = &bank->gpio_chip.irq; 2246 2246 girq->chip = &bank->irq_chip; 2247 2247 girq->parent_handler = pic32_gpio_irq_handler;
+6 -6
drivers/pinctrl/pinctrl-rk805.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/module.h> 15 15 #include <linux/mfd/rk808.h> 16 - #include <linux/of.h> 17 - #include <linux/of_device.h> 18 16 #include <linux/platform_device.h> 17 + #include <linux/pm.h> 18 + #include <linux/property.h> 19 + #include <linux/slab.h> 20 + 19 21 #include <linux/pinctrl/consumer.h> 20 22 #include <linux/pinctrl/machine.h> 21 23 #include <linux/pinctrl/pinctrl.h> 22 24 #include <linux/pinctrl/pinconf-generic.h> 23 25 #include <linux/pinctrl/pinconf.h> 24 26 #include <linux/pinctrl/pinmux.h> 25 - #include <linux/pm.h> 26 - #include <linux/slab.h> 27 27 28 28 #include "core.h" 29 29 #include "pinconf.h" ··· 420 420 struct rk805_pctrl_info *pci; 421 421 int ret; 422 422 423 + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); 424 + 423 425 pci = devm_kzalloc(&pdev->dev, sizeof(*pci), GFP_KERNEL); 424 426 if (!pci) 425 427 return -ENOMEM; 426 428 427 429 pci->dev = &pdev->dev; 428 - pci->dev->of_node = pdev->dev.parent->of_node; 429 430 pci->rk808 = dev_get_drvdata(pdev->dev.parent); 430 431 431 432 pci->pinctrl_desc = rk805_pinctrl_desc; 432 433 pci->gpio_chip = rk805_gpio_chip; 433 434 pci->gpio_chip.parent = &pdev->dev; 434 - pci->gpio_chip.of_node = pdev->dev.parent->of_node; 435 435 436 436 platform_set_drvdata(pdev, pci); 437 437
+73 -88
drivers/pinctrl/pinctrl-rockchip.c
··· 33 33 #include <linux/clk.h> 34 34 #include <linux/regmap.h> 35 35 #include <linux/mfd/syscon.h> 36 + #include <linux/string_helpers.h> 37 + 36 38 #include <dt-bindings/pinctrl/rockchip.h> 37 39 38 40 #include "core.h" 39 41 #include "pinconf.h" 40 42 #include "pinctrl-rockchip.h" 41 43 42 - /** 44 + /* 43 45 * Generate a bitmask for setting a value (v) with a write mask bit in hiword 44 46 * register 31:16 area. 45 47 */ ··· 287 285 { 288 286 struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 289 287 const struct rockchip_pin_group *grp; 288 + struct device *dev = info->dev; 290 289 struct pinctrl_map *new_map; 291 290 struct device_node *parent; 292 291 int map_num = 1; ··· 299 296 */ 300 297 grp = pinctrl_name_to_group(info, np->name); 301 298 if (!grp) { 302 - dev_err(info->dev, "unable to find group for node %pOFn\n", 303 - np); 299 + dev_err(dev, "unable to find group for node %pOFn\n", np); 304 300 return -EINVAL; 305 301 } 306 302 ··· 333 331 new_map[i].data.configs.num_configs = grp->data[i].nconfigs; 334 332 } 335 333 336 - dev_dbg(pctldev->dev, "maps: function %s group %s num %d\n", 334 + dev_dbg(dev, "maps: function %s group %s num %d\n", 337 335 (*map)->data.mux.function, (*map)->data.mux.group, map_num); 338 336 339 337 return 0; ··· 874 872 int pin, int mux) 875 873 { 876 874 struct rockchip_pinctrl *info = bank->drvdata; 875 + struct device *dev = info->dev; 877 876 int iomux_num = (pin / 8); 878 877 879 878 if (iomux_num > 3) 880 879 return -EINVAL; 881 880 882 881 if (bank->iomux[iomux_num].type & IOMUX_UNROUTED) { 883 - dev_err(info->dev, "pin %d is unrouted\n", pin); 882 + dev_err(dev, "pin %d is unrouted\n", pin); 884 883 return -EINVAL; 885 884 } 886 885 887 886 if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) { 888 887 if (mux != RK_FUNC_GPIO) { 889 - dev_err(info->dev, 890 - "pin %d only supports a gpio mux\n", pin); 888 + dev_err(dev, "pin %d only supports a gpio mux\n", pin); 891 889 return -ENOTSUPP; 892 890 } 893 891 } ··· 911 909 static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) 912 910 { 913 911 struct rockchip_pinctrl *info = bank->drvdata; 912 + struct device *dev = info->dev; 914 913 int iomux_num = (pin / 8); 915 914 struct regmap *regmap; 916 915 int reg, ret, mask, mux_type; ··· 925 922 if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) 926 923 return 0; 927 924 928 - dev_dbg(info->dev, "setting mux of GPIO%d-%d to %d\n", 929 - bank->bank_num, pin, mux); 925 + dev_dbg(dev, "setting mux of GPIO%d-%d to %d\n", bank->bank_num, pin, mux); 930 926 931 927 regmap = (bank->iomux[iomux_num].type & IOMUX_SOURCE_PMU) 932 928 ? info->regmap_pmu : info->regmap_base; ··· 1577 1575 { 1578 1576 struct rockchip_pinctrl *info = bank->drvdata; 1579 1577 struct rockchip_pin_ctrl *ctrl = info->ctrl; 1578 + struct device *dev = info->dev; 1580 1579 struct regmap *regmap; 1581 1580 int reg, ret; 1582 1581 u32 data, temp, rmask_bits; ··· 1623 1620 bit -= 16; 1624 1621 break; 1625 1622 default: 1626 - dev_err(info->dev, "unsupported bit: %d for pinctrl drive type: %d\n", 1623 + dev_err(dev, "unsupported bit: %d for pinctrl drive type: %d\n", 1627 1624 bit, drv_type); 1628 1625 return -EINVAL; 1629 1626 } ··· 1635 1632 rmask_bits = RK3288_DRV_BITS_PER_PIN; 1636 1633 break; 1637 1634 default: 1638 - dev_err(info->dev, "unsupported pinctrl drive type: %d\n", 1639 - drv_type); 1635 + dev_err(dev, "unsupported pinctrl drive type: %d\n", drv_type); 1640 1636 return -EINVAL; 1641 1637 } 1642 1638 ··· 1654 1652 { 1655 1653 struct rockchip_pinctrl *info = bank->drvdata; 1656 1654 struct rockchip_pin_ctrl *ctrl = info->ctrl; 1655 + struct device *dev = info->dev; 1657 1656 struct regmap *regmap; 1658 1657 int reg, ret, i; 1659 1658 u32 data, rmask, rmask_bits, temp; 1660 1659 u8 bit; 1661 1660 int drv_type = bank->drv[pin_num / 8].drv_type; 1662 1661 1663 - dev_dbg(info->dev, "setting drive of GPIO%d-%d to %d\n", 1662 + dev_dbg(dev, "setting drive of GPIO%d-%d to %d\n", 1664 1663 bank->bank_num, pin_num, strength); 1665 1664 1666 1665 ctrl->drv_calc_reg(bank, pin_num, &regmap, &reg, &bit); ··· 1683 1680 } 1684 1681 1685 1682 if (ret < 0) { 1686 - dev_err(info->dev, "unsupported driver strength %d\n", 1687 - strength); 1683 + dev_err(dev, "unsupported driver strength %d\n", strength); 1688 1684 return ret; 1689 1685 } 1690 1686 ··· 1722 1720 bit -= 16; 1723 1721 break; 1724 1722 default: 1725 - dev_err(info->dev, "unsupported bit: %d for pinctrl drive type: %d\n", 1723 + dev_err(dev, "unsupported bit: %d for pinctrl drive type: %d\n", 1726 1724 bit, drv_type); 1727 1725 return -EINVAL; 1728 1726 } ··· 1733 1731 rmask_bits = RK3288_DRV_BITS_PER_PIN; 1734 1732 break; 1735 1733 default: 1736 - dev_err(info->dev, "unsupported pinctrl drive type: %d\n", 1737 - drv_type); 1734 + dev_err(dev, "unsupported pinctrl drive type: %d\n", drv_type); 1738 1735 return -EINVAL; 1739 1736 } 1740 1737 ··· 1767 1766 { 1768 1767 struct rockchip_pinctrl *info = bank->drvdata; 1769 1768 struct rockchip_pin_ctrl *ctrl = info->ctrl; 1769 + struct device *dev = info->dev; 1770 1770 struct regmap *regmap; 1771 1771 int reg, ret, pull_type; 1772 1772 u8 bit; ··· 1802 1800 1803 1801 return rockchip_pull_list[pull_type][data]; 1804 1802 default: 1805 - dev_err(info->dev, "unsupported pinctrl type\n"); 1803 + dev_err(dev, "unsupported pinctrl type\n"); 1806 1804 return -EINVAL; 1807 1805 }; 1808 1806 } ··· 1812 1810 { 1813 1811 struct rockchip_pinctrl *info = bank->drvdata; 1814 1812 struct rockchip_pin_ctrl *ctrl = info->ctrl; 1813 + struct device *dev = info->dev; 1815 1814 struct regmap *regmap; 1816 1815 int reg, ret, i, pull_type; 1817 1816 u8 bit; 1818 1817 u32 data, rmask; 1819 1818 1820 - dev_dbg(info->dev, "setting pull of GPIO%d-%d to %d\n", 1821 - bank->bank_num, pin_num, pull); 1819 + dev_dbg(dev, "setting pull of GPIO%d-%d to %d\n", bank->bank_num, pin_num, pull); 1822 1820 1823 1821 /* rk3066b does support any pulls */ 1824 1822 if (ctrl->type == RK3066B) ··· 1861 1859 } 1862 1860 1863 1861 if (ret < 0) { 1864 - dev_err(info->dev, "unsupported pull setting %d\n", 1865 - pull); 1862 + dev_err(dev, "unsupported pull setting %d\n", pull); 1866 1863 return ret; 1867 1864 } 1868 1865 ··· 1873 1872 ret = regmap_update_bits(regmap, reg, rmask, data); 1874 1873 break; 1875 1874 default: 1876 - dev_err(info->dev, "unsupported pinctrl type\n"); 1875 + dev_err(dev, "unsupported pinctrl type\n"); 1877 1876 return -EINVAL; 1878 1877 } 1879 1878 ··· 1964 1963 { 1965 1964 struct rockchip_pinctrl *info = bank->drvdata; 1966 1965 struct rockchip_pin_ctrl *ctrl = info->ctrl; 1966 + struct device *dev = info->dev; 1967 1967 struct regmap *regmap; 1968 1968 int reg, ret; 1969 1969 u8 bit; 1970 1970 u32 data, rmask; 1971 1971 1972 - dev_dbg(info->dev, "setting input schmitt of GPIO%d-%d to %d\n", 1972 + dev_dbg(dev, "setting input schmitt of GPIO%d-%d to %d\n", 1973 1973 bank->bank_num, pin_num, enable); 1974 1974 1975 1975 ret = ctrl->schmitt_calc_reg(bank, pin_num, &regmap, &reg, &bit); ··· 2030 2028 struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 2031 2029 const unsigned int *pins = info->groups[group].pins; 2032 2030 const struct rockchip_pin_config *data = info->groups[group].data; 2031 + struct device *dev = info->dev; 2033 2032 struct rockchip_pin_bank *bank; 2034 2033 int cnt, ret = 0; 2035 2034 2036 - dev_dbg(info->dev, "enable function %s group %s\n", 2035 + dev_dbg(dev, "enable function %s group %s\n", 2037 2036 info->functions[selector].name, info->groups[group].name); 2038 2037 2039 2038 /* ··· 2313 2310 struct rockchip_pinctrl *info, 2314 2311 u32 index) 2315 2312 { 2313 + struct device *dev = info->dev; 2316 2314 struct rockchip_pin_bank *bank; 2317 2315 int size; 2318 2316 const __be32 *list; ··· 2321 2317 int i, j; 2322 2318 int ret; 2323 2319 2324 - dev_dbg(info->dev, "group(%d): %pOFn\n", index, np); 2320 + dev_dbg(dev, "group(%d): %pOFn\n", index, np); 2325 2321 2326 2322 /* Initialise group */ 2327 2323 grp->name = np->name; ··· 2333 2329 list = of_get_property(np, "rockchip,pins", &size); 2334 2330 /* we do not check return since it's safe node passed down */ 2335 2331 size /= sizeof(*list); 2336 - if (!size || size % 4) { 2337 - dev_err(info->dev, "wrong pins number or pins and configs should be by 4\n"); 2338 - return -EINVAL; 2339 - } 2332 + if (!size || size % 4) 2333 + return dev_err_probe(dev, -EINVAL, "wrong pins number or pins and configs should be by 4\n"); 2340 2334 2341 2335 grp->npins = size / 4; 2342 2336 2343 - grp->pins = devm_kcalloc(info->dev, grp->npins, sizeof(unsigned int), 2344 - GFP_KERNEL); 2345 - grp->data = devm_kcalloc(info->dev, 2346 - grp->npins, 2347 - sizeof(struct rockchip_pin_config), 2348 - GFP_KERNEL); 2337 + grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL); 2338 + grp->data = devm_kcalloc(dev, grp->npins, sizeof(*grp->data), GFP_KERNEL); 2349 2339 if (!grp->pins || !grp->data) 2350 2340 return -ENOMEM; 2351 2341 ··· 2373 2375 struct rockchip_pinctrl *info, 2374 2376 u32 index) 2375 2377 { 2378 + struct device *dev = info->dev; 2376 2379 struct device_node *child; 2377 2380 struct rockchip_pmx_func *func; 2378 2381 struct rockchip_pin_group *grp; ··· 2381 2382 static u32 grp_index; 2382 2383 u32 i = 0; 2383 2384 2384 - dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np); 2385 + dev_dbg(dev, "parse function(%d): %pOFn\n", index, np); 2385 2386 2386 2387 func = &info->functions[index]; 2387 2388 ··· 2391 2392 if (func->ngroups <= 0) 2392 2393 return 0; 2393 2394 2394 - func->groups = devm_kcalloc(info->dev, 2395 - func->ngroups, sizeof(char *), GFP_KERNEL); 2395 + func->groups = devm_kcalloc(dev, func->ngroups, sizeof(*func->groups), GFP_KERNEL); 2396 2396 if (!func->groups) 2397 2397 return -ENOMEM; 2398 2398 ··· 2419 2421 2420 2422 rockchip_pinctrl_child_count(info, np); 2421 2423 2422 - dev_dbg(&pdev->dev, "nfunctions = %d\n", info->nfunctions); 2423 - dev_dbg(&pdev->dev, "ngroups = %d\n", info->ngroups); 2424 + dev_dbg(dev, "nfunctions = %d\n", info->nfunctions); 2425 + dev_dbg(dev, "ngroups = %d\n", info->ngroups); 2424 2426 2425 - info->functions = devm_kcalloc(dev, 2426 - info->nfunctions, 2427 - sizeof(struct rockchip_pmx_func), 2428 - GFP_KERNEL); 2427 + info->functions = devm_kcalloc(dev, info->nfunctions, sizeof(*info->functions), GFP_KERNEL); 2429 2428 if (!info->functions) 2430 2429 return -ENOMEM; 2431 2430 2432 - info->groups = devm_kcalloc(dev, 2433 - info->ngroups, 2434 - sizeof(struct rockchip_pin_group), 2435 - GFP_KERNEL); 2431 + info->groups = devm_kcalloc(dev, info->ngroups, sizeof(*info->groups), GFP_KERNEL); 2436 2432 if (!info->groups) 2437 2433 return -ENOMEM; 2438 2434 ··· 2438 2446 2439 2447 ret = rockchip_pinctrl_parse_functions(child, info, i++); 2440 2448 if (ret) { 2441 - dev_err(&pdev->dev, "failed to parse function\n"); 2449 + dev_err(dev, "failed to parse function\n"); 2442 2450 of_node_put(child); 2443 2451 return ret; 2444 2452 } ··· 2453 2461 struct pinctrl_desc *ctrldesc = &info->pctl; 2454 2462 struct pinctrl_pin_desc *pindesc, *pdesc; 2455 2463 struct rockchip_pin_bank *pin_bank; 2464 + struct device *dev = &pdev->dev; 2465 + char **pin_names; 2456 2466 int pin, bank, ret; 2457 2467 int k; 2458 2468 ··· 2464 2470 ctrldesc->pmxops = &rockchip_pmx_ops; 2465 2471 ctrldesc->confops = &rockchip_pinconf_ops; 2466 2472 2467 - pindesc = devm_kcalloc(&pdev->dev, 2468 - info->ctrl->nr_pins, sizeof(*pindesc), 2469 - GFP_KERNEL); 2473 + pindesc = devm_kcalloc(dev, info->ctrl->nr_pins, sizeof(*pindesc), GFP_KERNEL); 2470 2474 if (!pindesc) 2471 2475 return -ENOMEM; 2472 2476 ··· 2474 2482 pdesc = pindesc; 2475 2483 for (bank = 0, k = 0; bank < info->ctrl->nr_banks; bank++) { 2476 2484 pin_bank = &info->ctrl->pin_banks[bank]; 2485 + 2486 + pin_names = devm_kasprintf_strarray(dev, pin_bank->name, pin_bank->nr_pins); 2487 + if (IS_ERR(pin_names)) 2488 + return PTR_ERR(pin_names); 2489 + 2477 2490 for (pin = 0; pin < pin_bank->nr_pins; pin++, k++) { 2478 2491 pdesc->number = k; 2479 - pdesc->name = kasprintf(GFP_KERNEL, "%s-%d", 2480 - pin_bank->name, pin); 2492 + pdesc->name = pin_names[pin]; 2481 2493 pdesc++; 2482 2494 } 2483 2495 ··· 2493 2497 if (ret) 2494 2498 return ret; 2495 2499 2496 - info->pctl_dev = devm_pinctrl_register(&pdev->dev, ctrldesc, info); 2497 - if (IS_ERR(info->pctl_dev)) { 2498 - dev_err(&pdev->dev, "could not register pinctrl driver\n"); 2499 - return PTR_ERR(info->pctl_dev); 2500 - } 2500 + info->pctl_dev = devm_pinctrl_register(dev, ctrldesc, info); 2501 + if (IS_ERR(info->pctl_dev)) 2502 + return dev_err_probe(dev, PTR_ERR(info->pctl_dev), "could not register pinctrl driver\n"); 2501 2503 2502 2504 return 0; 2503 2505 } ··· 2507 2513 struct rockchip_pinctrl *d, 2508 2514 struct platform_device *pdev) 2509 2515 { 2516 + struct device *dev = &pdev->dev; 2517 + struct device_node *node = dev->of_node; 2510 2518 const struct of_device_id *match; 2511 - struct device_node *node = pdev->dev.of_node; 2512 2519 struct rockchip_pin_ctrl *ctrl; 2513 2520 struct rockchip_pin_bank *bank; 2514 2521 int grf_offs, pmu_offs, drv_grf_offs, drv_pmu_offs, i, j; ··· 2561 2566 drv_pmu_offs : drv_grf_offs; 2562 2567 } 2563 2568 2564 - dev_dbg(d->dev, "bank %d, iomux %d has iom_offset 0x%x drv_offset 0x%x\n", 2569 + dev_dbg(dev, "bank %d, iomux %d has iom_offset 0x%x drv_offset 0x%x\n", 2565 2570 i, j, iom->offset, drv->offset); 2566 2571 2567 2572 /* ··· 2670 2675 { 2671 2676 struct rockchip_pinctrl *info; 2672 2677 struct device *dev = &pdev->dev; 2678 + struct device_node *np = dev->of_node, *node; 2673 2679 struct rockchip_pin_ctrl *ctrl; 2674 - struct device_node *np = pdev->dev.of_node, *node; 2675 2680 struct resource *res; 2676 2681 void __iomem *base; 2677 2682 int ret; 2678 2683 2679 - if (!dev->of_node) { 2680 - dev_err(dev, "device tree node not found\n"); 2681 - return -ENODEV; 2682 - } 2684 + if (!dev->of_node) 2685 + return dev_err_probe(dev, -ENODEV, "device tree node not found\n"); 2683 2686 2684 2687 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); 2685 2688 if (!info) ··· 2686 2693 info->dev = dev; 2687 2694 2688 2695 ctrl = rockchip_pinctrl_get_soc_data(info, pdev); 2689 - if (!ctrl) { 2690 - dev_err(dev, "driver data not available\n"); 2691 - return -EINVAL; 2692 - } 2696 + if (!ctrl) 2697 + return dev_err_probe(dev, -EINVAL, "driver data not available\n"); 2693 2698 info->ctrl = ctrl; 2694 2699 2695 2700 node = of_parse_phandle(np, "rockchip,grf", 0); ··· 2696 2705 if (IS_ERR(info->regmap_base)) 2697 2706 return PTR_ERR(info->regmap_base); 2698 2707 } else { 2699 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2700 - base = devm_ioremap_resource(&pdev->dev, res); 2708 + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 2701 2709 if (IS_ERR(base)) 2702 2710 return PTR_ERR(base); 2703 2711 2704 2712 rockchip_regmap_config.max_register = resource_size(res) - 4; 2705 2713 rockchip_regmap_config.name = "rockchip,pinctrl"; 2706 - info->regmap_base = devm_regmap_init_mmio(&pdev->dev, base, 2707 - &rockchip_regmap_config); 2714 + info->regmap_base = 2715 + devm_regmap_init_mmio(dev, base, &rockchip_regmap_config); 2708 2716 2709 2717 /* to check for the old dt-bindings */ 2710 2718 info->reg_size = resource_size(res); 2711 2719 2712 2720 /* Honor the old binding, with pull registers as 2nd resource */ 2713 2721 if (ctrl->type == RK3188 && info->reg_size < 0x200) { 2714 - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 2715 - base = devm_ioremap_resource(&pdev->dev, res); 2722 + base = devm_platform_get_and_ioremap_resource(pdev, 1, &res); 2716 2723 if (IS_ERR(base)) 2717 2724 return PTR_ERR(base); 2718 2725 2719 - rockchip_regmap_config.max_register = 2720 - resource_size(res) - 4; 2726 + rockchip_regmap_config.max_register = resource_size(res) - 4; 2721 2727 rockchip_regmap_config.name = "rockchip,pinctrl-pull"; 2722 - info->regmap_pull = devm_regmap_init_mmio(&pdev->dev, 2723 - base, 2724 - &rockchip_regmap_config); 2728 + info->regmap_pull = 2729 + devm_regmap_init_mmio(dev, base, &rockchip_regmap_config); 2725 2730 } 2726 2731 } 2727 2732 ··· 2735 2748 2736 2749 platform_set_drvdata(pdev, info); 2737 2750 2738 - ret = of_platform_populate(np, rockchip_bank_match, NULL, NULL); 2739 - if (ret) { 2740 - dev_err(&pdev->dev, "failed to register gpio device\n"); 2741 - return ret; 2742 - } 2751 + ret = of_platform_populate(np, NULL, NULL, &pdev->dev); 2752 + if (ret) 2753 + return dev_err_probe(dev, ret, "failed to register gpio device\n"); 2743 2754 2744 2755 return 0; 2745 2756 }
+52 -64
drivers/pinctrl/pinctrl-st.c
··· 55 55 #define ST_GPIO_DIRECTION_OUT 0x2 56 56 #define ST_GPIO_DIRECTION_IN 0x4 57 57 58 - /** 58 + /* 59 59 * Packed style retime configuration. 60 60 * There are two registers cfg0 and cfg1 in this style for each bank. 61 61 * Each field in this register is 8 bit corresponding to 8 pins in the bank. ··· 69 69 #define RT_P_CFG1_CLKNOTDATA_FIELD(reg) REG_FIELD(reg, 16, 23) 70 70 #define RT_P_CFG1_DOUBLE_EDGE_FIELD(reg) REG_FIELD(reg, 24, 31) 71 71 72 - /** 72 + /* 73 73 * Dedicated style retime Configuration register 74 74 * each register is dedicated per pin. 75 75 */ ··· 814 814 { 815 815 struct st_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 816 816 const struct st_pctl_group *grp; 817 + struct device *dev = info->dev; 817 818 struct pinctrl_map *new_map; 818 819 struct device_node *parent; 819 820 int map_num, i; 820 821 821 822 grp = st_pctl_find_group_by_name(info, np->name); 822 823 if (!grp) { 823 - dev_err(info->dev, "unable to find group for node %pOFn\n", 824 - np); 824 + dev_err(dev, "unable to find group for node %pOFn\n", np); 825 825 return -EINVAL; 826 826 } 827 827 828 828 map_num = grp->npins + 1; 829 - new_map = devm_kcalloc(pctldev->dev, 830 - map_num, sizeof(*new_map), GFP_KERNEL); 829 + new_map = devm_kcalloc(dev, map_num, sizeof(*new_map), GFP_KERNEL); 831 830 if (!new_map) 832 831 return -ENOMEM; 833 832 834 833 parent = of_get_parent(np); 835 834 if (!parent) { 836 - devm_kfree(pctldev->dev, new_map); 835 + devm_kfree(dev, new_map); 837 836 return -EINVAL; 838 837 } 839 838 ··· 852 853 new_map[i].data.configs.configs = &grp->pin_conf[i].config; 853 854 new_map[i].data.configs.num_configs = 1; 854 855 } 855 - dev_info(pctldev->dev, "maps: function %s group %s num %d\n", 856 + dev_info(dev, "maps: function %s group %s num %d\n", 856 857 (*map)->data.mux.function, grp->name, map_num); 857 858 858 859 return 0; ··· 1172 1173 /* bank pad direction val altfunction */ 1173 1174 const __be32 *list; 1174 1175 struct property *pp; 1176 + struct device *dev = info->dev; 1175 1177 struct st_pinconf *conf; 1176 1178 struct device_node *pins; 1177 1179 int i = 0, npins = 0, nr_props, ret = 0; ··· 1197 1197 1198 1198 grp->npins = npins; 1199 1199 grp->name = np->name; 1200 - grp->pins = devm_kcalloc(info->dev, npins, sizeof(u32), GFP_KERNEL); 1201 - grp->pin_conf = devm_kcalloc(info->dev, 1202 - npins, sizeof(*conf), GFP_KERNEL); 1200 + grp->pins = devm_kcalloc(dev, npins, sizeof(*grp->pins), GFP_KERNEL); 1201 + grp->pin_conf = devm_kcalloc(dev, npins, sizeof(*grp->pin_conf), GFP_KERNEL); 1203 1202 1204 1203 if (!grp->pins || !grp->pin_conf) { 1205 1204 ret = -ENOMEM; ··· 1246 1247 static int st_pctl_parse_functions(struct device_node *np, 1247 1248 struct st_pinctrl *info, u32 index, int *grp_index) 1248 1249 { 1250 + struct device *dev = info->dev; 1249 1251 struct device_node *child; 1250 1252 struct st_pmx_func *func; 1251 1253 struct st_pctl_group *grp; ··· 1255 1255 func = &info->functions[index]; 1256 1256 func->name = np->name; 1257 1257 func->ngroups = of_get_child_count(np); 1258 - if (func->ngroups == 0) { 1259 - dev_err(info->dev, "No groups defined\n"); 1260 - return -EINVAL; 1261 - } 1262 - func->groups = devm_kcalloc(info->dev, 1263 - func->ngroups, sizeof(char *), GFP_KERNEL); 1258 + if (func->ngroups == 0) 1259 + return dev_err_probe(dev, -EINVAL, "No groups defined\n"); 1260 + func->groups = devm_kcalloc(dev, func->ngroups, sizeof(*func->groups), GFP_KERNEL); 1264 1261 if (!func->groups) 1265 1262 return -ENOMEM; 1266 1263 ··· 1272 1275 return ret; 1273 1276 } 1274 1277 } 1275 - dev_info(info->dev, "Function[%d\t name:%s,\tgroups:%d]\n", 1276 - index, func->name, func->ngroups); 1278 + dev_info(dev, "Function[%d\t name:%s,\tgroups:%d]\n", index, func->name, func->ngroups); 1277 1279 1278 1280 return 0; 1279 1281 } ··· 1553 1557 1554 1558 skip_irq: 1555 1559 err = gpiochip_add_data(&bank->gpio_chip, bank); 1556 - if (err) { 1557 - dev_err(dev, "Failed to add gpiochip(%d)!\n", bank_num); 1558 - return err; 1559 - } 1560 + if (err) 1561 + return dev_err_probe(dev, err, "Failed to add gpiochip(%d)!\n", bank_num); 1560 1562 dev_info(dev, "%s bank added.\n", range->name); 1561 1563 1562 1564 return 0; ··· 1571 1577 static int st_pctl_probe_dt(struct platform_device *pdev, 1572 1578 struct pinctrl_desc *pctl_desc, struct st_pinctrl *info) 1573 1579 { 1580 + struct device *dev = &pdev->dev; 1574 1581 int ret = 0; 1575 1582 int i = 0, j = 0, k = 0, bank; 1576 1583 struct pinctrl_pin_desc *pdesc; 1577 - struct device_node *np = pdev->dev.of_node; 1584 + struct device_node *np = dev->of_node; 1578 1585 struct device_node *child; 1579 1586 int grp_index = 0; 1580 1587 int irq = 0; 1581 - struct resource *res; 1582 1588 1583 1589 st_pctl_dt_child_count(info, np); 1584 - if (!info->nbanks) { 1585 - dev_err(&pdev->dev, "you need at least one gpio bank\n"); 1586 - return -EINVAL; 1587 - } 1590 + if (!info->nbanks) 1591 + return dev_err_probe(dev, -EINVAL, "you need at least one gpio bank\n"); 1588 1592 1589 - dev_info(&pdev->dev, "nbanks = %d\n", info->nbanks); 1590 - dev_info(&pdev->dev, "nfunctions = %d\n", info->nfunctions); 1591 - dev_info(&pdev->dev, "ngroups = %d\n", info->ngroups); 1593 + dev_info(dev, "nbanks = %d\n", info->nbanks); 1594 + dev_info(dev, "nfunctions = %d\n", info->nfunctions); 1595 + dev_info(dev, "ngroups = %d\n", info->ngroups); 1592 1596 1593 - info->functions = devm_kcalloc(&pdev->dev, 1594 - info->nfunctions, sizeof(*info->functions), GFP_KERNEL); 1597 + info->functions = devm_kcalloc(dev, info->nfunctions, sizeof(*info->functions), GFP_KERNEL); 1595 1598 1596 - info->groups = devm_kcalloc(&pdev->dev, 1597 - info->ngroups, sizeof(*info->groups), 1598 - GFP_KERNEL); 1599 + info->groups = devm_kcalloc(dev, info->ngroups, sizeof(*info->groups), GFP_KERNEL); 1599 1600 1600 - info->banks = devm_kcalloc(&pdev->dev, 1601 - info->nbanks, sizeof(*info->banks), GFP_KERNEL); 1601 + info->banks = devm_kcalloc(dev, info->nbanks, sizeof(*info->banks), GFP_KERNEL); 1602 1602 1603 1603 if (!info->functions || !info->groups || !info->banks) 1604 1604 return -ENOMEM; 1605 1605 1606 1606 info->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); 1607 - if (IS_ERR(info->regmap)) { 1608 - dev_err(info->dev, "No syscfg phandle specified\n"); 1609 - return PTR_ERR(info->regmap); 1610 - } 1607 + if (IS_ERR(info->regmap)) 1608 + return dev_err_probe(dev, PTR_ERR(info->regmap), "No syscfg phandle specified\n"); 1611 1609 info->data = of_match_node(st_pctl_of_match, np)->data; 1612 1610 1613 1611 irq = platform_get_irq(pdev, 0); 1614 1612 1615 1613 if (irq > 0) { 1616 - res = platform_get_resource_byname(pdev, 1617 - IORESOURCE_MEM, "irqmux"); 1618 - info->irqmux_base = devm_ioremap_resource(&pdev->dev, res); 1619 - 1614 + info->irqmux_base = devm_platform_ioremap_resource_byname(pdev, "irqmux"); 1620 1615 if (IS_ERR(info->irqmux_base)) 1621 1616 return PTR_ERR(info->irqmux_base); 1622 1617 1623 1618 irq_set_chained_handler_and_data(irq, st_gpio_irqmux_handler, 1624 1619 info); 1625 - 1626 1620 } 1627 1621 1628 1622 pctl_desc->npins = info->nbanks * ST_GPIO_PINS_PER_BANK; 1629 - pdesc = devm_kcalloc(&pdev->dev, 1630 - pctl_desc->npins, sizeof(*pdesc), GFP_KERNEL); 1623 + pdesc = devm_kcalloc(dev, pctl_desc->npins, sizeof(*pdesc), GFP_KERNEL); 1631 1624 if (!pdesc) 1632 1625 return -ENOMEM; 1633 1626 ··· 1624 1643 for_each_child_of_node(np, child) { 1625 1644 if (of_property_read_bool(child, "gpio-controller")) { 1626 1645 const char *bank_name = NULL; 1646 + char **pin_names; 1647 + 1627 1648 ret = st_gpiolib_register_bank(info, bank, child); 1628 1649 if (ret) { 1629 1650 of_node_put(child); ··· 1634 1651 1635 1652 k = info->banks[bank].range.pin_base; 1636 1653 bank_name = info->banks[bank].range.name; 1654 + 1655 + pin_names = devm_kasprintf_strarray(dev, bank_name, ST_GPIO_PINS_PER_BANK); 1656 + if (IS_ERR(pin_names)) { 1657 + of_node_put(child); 1658 + return PTR_ERR(pin_names); 1659 + } 1660 + 1637 1661 for (j = 0; j < ST_GPIO_PINS_PER_BANK; j++, k++) { 1638 1662 pdesc->number = k; 1639 - pdesc->name = kasprintf(GFP_KERNEL, "%s[%d]", 1640 - bank_name, j); 1663 + pdesc->name = pin_names[j]; 1641 1664 pdesc++; 1642 1665 } 1643 1666 st_parse_syscfgs(info, bank, child); ··· 1652 1663 ret = st_pctl_parse_functions(child, info, 1653 1664 i++, &grp_index); 1654 1665 if (ret) { 1655 - dev_err(&pdev->dev, "No functions found.\n"); 1666 + dev_err(dev, "No functions found.\n"); 1656 1667 of_node_put(child); 1657 1668 return ret; 1658 1669 } ··· 1664 1675 1665 1676 static int st_pctl_probe(struct platform_device *pdev) 1666 1677 { 1678 + struct device *dev = &pdev->dev; 1667 1679 struct st_pinctrl *info; 1668 1680 struct pinctrl_desc *pctl_desc; 1669 1681 int ret, i; 1670 1682 1671 - if (!pdev->dev.of_node) { 1672 - dev_err(&pdev->dev, "device node not found.\n"); 1683 + if (!dev->of_node) { 1684 + dev_err(dev, "device node not found.\n"); 1673 1685 return -EINVAL; 1674 1686 } 1675 1687 1676 - pctl_desc = devm_kzalloc(&pdev->dev, sizeof(*pctl_desc), GFP_KERNEL); 1688 + pctl_desc = devm_kzalloc(dev, sizeof(*pctl_desc), GFP_KERNEL); 1677 1689 if (!pctl_desc) 1678 1690 return -ENOMEM; 1679 1691 1680 - info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 1692 + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); 1681 1693 if (!info) 1682 1694 return -ENOMEM; 1683 1695 1684 - info->dev = &pdev->dev; 1696 + info->dev = dev; 1685 1697 platform_set_drvdata(pdev, info); 1686 1698 ret = st_pctl_probe_dt(pdev, pctl_desc, info); 1687 1699 if (ret) ··· 1692 1702 pctl_desc->pctlops = &st_pctlops; 1693 1703 pctl_desc->pmxops = &st_pmxops; 1694 1704 pctl_desc->confops = &st_confops; 1695 - pctl_desc->name = dev_name(&pdev->dev); 1705 + pctl_desc->name = dev_name(dev); 1696 1706 1697 - info->pctl = devm_pinctrl_register(&pdev->dev, pctl_desc, info); 1698 - if (IS_ERR(info->pctl)) { 1699 - dev_err(&pdev->dev, "Failed pinctrl registration\n"); 1700 - return PTR_ERR(info->pctl); 1701 - } 1707 + info->pctl = devm_pinctrl_register(dev, pctl_desc, info); 1708 + if (IS_ERR(info->pctl)) 1709 + return dev_err_probe(dev, PTR_ERR(info->pctl), "Failed pinctrl registration\n"); 1702 1710 1703 1711 for (i = 0; i < info->nbanks; i++) 1704 1712 pinctrl_add_gpio_range(info->pctl, &info->banks[i].range);
-1
drivers/pinctrl/pinctrl-stmfx.c
··· 675 675 pctl->gpio_chip.base = -1; 676 676 pctl->gpio_chip.ngpio = pctl->pctl_desc.npins; 677 677 pctl->gpio_chip.can_sleep = true; 678 - pctl->gpio_chip.of_node = np; 679 678 680 679 pctl->irq_chip.name = dev_name(pctl->dev); 681 680 pctl->irq_chip.irq_mask = stmfx_pinctrl_irq_mask;
-3
drivers/pinctrl/pinctrl-sx150x.c
··· 1163 1163 pctl->gpio.set = sx150x_gpio_set; 1164 1164 pctl->gpio.set_config = gpiochip_generic_config; 1165 1165 pctl->gpio.parent = dev; 1166 - #ifdef CONFIG_OF_GPIO 1167 - pctl->gpio.of_node = dev->of_node; 1168 - #endif 1169 1166 pctl->gpio.can_sleep = true; 1170 1167 pctl->gpio.label = devm_kstrdup(dev, client->name, GFP_KERNEL); 1171 1168 if (!pctl->gpio.label)
+1322
drivers/pinctrl/pinctrl-thunderbay.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Intel Thunder Bay SOC pinctrl/GPIO driver 4 + * 5 + * Copyright (C) 2021 Intel Corporation 6 + */ 7 + 8 + #include <linux/device.h> 9 + #include <linux/err.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/init.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/io.h> 14 + #include <linux/irq.h> 15 + #include <linux/module.h> 16 + #include <linux/of.h> 17 + #include <linux/of_irq.h> 18 + 19 + #include <linux/pinctrl/pinconf.h> 20 + #include <linux/pinctrl/pinconf-generic.h> 21 + #include <linux/pinctrl/pinctrl.h> 22 + #include <linux/pinctrl/pinmux.h> 23 + 24 + #include <linux/platform_device.h> 25 + #include <linux/slab.h> 26 + #include <linux/spinlock.h> 27 + 28 + #include "core.h" 29 + #include "pinconf.h" 30 + #include "pinctrl-utils.h" 31 + #include "pinmux.h" 32 + 33 + /* Bit 0:2 and 4:6 should be used for mode selection */ 34 + #define THB_GPIO_PINMUX_MODE_0 0x00 35 + #define THB_GPIO_PINMUX_MODE_1 0x11 36 + #define THB_GPIO_PINMUX_MODE_2 0x22 37 + #define THB_GPIO_PINMUX_MODE_3 0x33 38 + #define THB_GPIO_PINMUX_MODE_4 0x44 39 + 40 + #define THB_GPIO_PORT_SELECT_MASK BIT(8) 41 + #define THB_GPIO_PAD_DIRECTION_MASK BIT(10) 42 + #define THB_GPIO_SPU_MASK BIT(11) 43 + #define THB_GPIO_PULL_ENABLE_MASK BIT(12) 44 + #define THB_GPIO_PULL_UP_MASK BIT(13) 45 + #define THB_GPIO_PULL_DOWN_MASK BIT(14) 46 + #define THB_GPIO_ENAQ_MASK BIT(15) 47 + /* bit 16-19: Drive Strength for the Pad */ 48 + #define THB_GPIO_DRIVE_STRENGTH_MASK (0xF0000) 49 + #define THB_GPIO_SLEW_RATE_MASK BIT(20) 50 + #define THB_GPIO_SCHMITT_TRIGGER_MASK BIT(21) 51 + 52 + #define THB_GPIO_REG_OFFSET(pin_num) ((pin_num) * (0x4)) 53 + #define THB_MAX_MODE_SUPPORTED (5u) 54 + #define THB_MAX_NPINS_SUPPORTED (67u) 55 + 56 + /* store Pin status */ 57 + static u32 thb_pinx_status[THB_MAX_NPINS_SUPPORTED]; 58 + 59 + struct thunderbay_mux_desc { 60 + u8 mode; 61 + const char *name; 62 + }; 63 + 64 + #define THUNDERBAY_PIN_DESC(pin_number, pin_name, ...) { \ 65 + .number = pin_number, \ 66 + .name = pin_name, \ 67 + .drv_data = &(struct thunderbay_mux_desc[]) { \ 68 + __VA_ARGS__, { } }, \ 69 + } 70 + 71 + #define THUNDERBAY_MUX(pin_mode, pin_function) { \ 72 + .mode = pin_mode, \ 73 + .name = pin_function, \ 74 + } 75 + 76 + struct thunderbay_pin_soc { 77 + const struct pinctrl_pin_desc *pins; 78 + unsigned int npins; 79 + }; 80 + 81 + /** 82 + * struct thunderbay_pinctrl - Intel Thunderbay pinctrl structure 83 + * @pctrl: Pointer to the pin controller device 84 + * @base0: First register base address 85 + * @dev: Pointer to the device structure 86 + * @chip: GPIO chip used by this pin controller 87 + * @soc: Pin control configuration data based on SoC 88 + * @ngroups: Number of pin groups available 89 + * @nfuncs: Number of pin functions available 90 + */ 91 + struct thunderbay_pinctrl { 92 + struct pinctrl_dev *pctrl; 93 + void __iomem *base0; 94 + struct device *dev; 95 + struct gpio_chip chip; 96 + const struct thunderbay_pin_soc *soc; 97 + unsigned int ngroups; 98 + unsigned int nfuncs; 99 + }; 100 + 101 + static const struct pinctrl_pin_desc thunderbay_pins[] = { 102 + THUNDERBAY_PIN_DESC(0, "GPIO0", 103 + THUNDERBAY_MUX(0X0, "I2C0_M0"), 104 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 105 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 106 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 107 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 108 + THUNDERBAY_PIN_DESC(1, "GPIO1", 109 + THUNDERBAY_MUX(0X0, "I2C0_M0"), 110 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 111 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 112 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 113 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 114 + THUNDERBAY_PIN_DESC(2, "GPIO2", 115 + THUNDERBAY_MUX(0X0, "I2C1_M0"), 116 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 117 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 118 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 119 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 120 + THUNDERBAY_PIN_DESC(3, "GPIO3", 121 + THUNDERBAY_MUX(0X0, "I2C1_M0"), 122 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 123 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 124 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 125 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 126 + THUNDERBAY_PIN_DESC(4, "GPIO4", 127 + THUNDERBAY_MUX(0X0, "I2C2_M0"), 128 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 129 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 130 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 131 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 132 + THUNDERBAY_PIN_DESC(5, "GPIO5", 133 + THUNDERBAY_MUX(0X0, "I2C2_M0"), 134 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 135 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 136 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 137 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 138 + THUNDERBAY_PIN_DESC(6, "GPIO6", 139 + THUNDERBAY_MUX(0X0, "I2C3_M0"), 140 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 141 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 142 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 143 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 144 + THUNDERBAY_PIN_DESC(7, "GPIO7", 145 + THUNDERBAY_MUX(0X0, "I2C3_M0"), 146 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 147 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 148 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 149 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 150 + THUNDERBAY_PIN_DESC(8, "GPIO8", 151 + THUNDERBAY_MUX(0X0, "I2C4_M0"), 152 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 153 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 154 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 155 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 156 + THUNDERBAY_PIN_DESC(9, "GPIO9", 157 + THUNDERBAY_MUX(0X0, "I2C4_M0"), 158 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 159 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 160 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 161 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 162 + THUNDERBAY_PIN_DESC(10, "GPIO10", 163 + THUNDERBAY_MUX(0X0, "UART0_M0"), 164 + THUNDERBAY_MUX(0X1, "RT0_DSU_M1"), 165 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 166 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 167 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 168 + THUNDERBAY_PIN_DESC(11, "GPIO11", 169 + THUNDERBAY_MUX(0X0, "UART0_M0"), 170 + THUNDERBAY_MUX(0X1, "RT0_DSU_M1"), 171 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 172 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 173 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 174 + THUNDERBAY_PIN_DESC(12, "GPIO12", 175 + THUNDERBAY_MUX(0X0, "UART0_M0"), 176 + THUNDERBAY_MUX(0X1, "RT1_DSU_M1"), 177 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 178 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 179 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 180 + THUNDERBAY_PIN_DESC(13, "GPIO13", 181 + THUNDERBAY_MUX(0X0, "UART0_M0"), 182 + THUNDERBAY_MUX(0X1, "RT1_DSU_M1"), 183 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 184 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 185 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 186 + THUNDERBAY_PIN_DESC(14, "GPIO14", 187 + THUNDERBAY_MUX(0X0, "UART1_M0"), 188 + THUNDERBAY_MUX(0X1, "RT2_DSU_M1"), 189 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 190 + THUNDERBAY_MUX(0X3, "TRIGGER_M3"), 191 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 192 + THUNDERBAY_PIN_DESC(15, "GPIO15", 193 + THUNDERBAY_MUX(0X0, "UART1_M0"), 194 + THUNDERBAY_MUX(0X1, "RT2_DSU_M1"), 195 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 196 + THUNDERBAY_MUX(0X3, "TRIGGER_M3"), 197 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 198 + THUNDERBAY_PIN_DESC(16, "GPIO16", 199 + THUNDERBAY_MUX(0X0, "UART1_M0"), 200 + THUNDERBAY_MUX(0X1, "RT3_DSU_M1"), 201 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 202 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 203 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 204 + THUNDERBAY_PIN_DESC(17, "GPIO17", 205 + THUNDERBAY_MUX(0X0, "UART1_M0"), 206 + THUNDERBAY_MUX(0X1, "RT3_DSU_M1"), 207 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 208 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 209 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 210 + THUNDERBAY_PIN_DESC(18, "GPIO18", 211 + THUNDERBAY_MUX(0X0, "SPI0_M0"), 212 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 213 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 214 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 215 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 216 + THUNDERBAY_PIN_DESC(19, "GPIO19", 217 + THUNDERBAY_MUX(0X0, "SPI0_M0"), 218 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 219 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 220 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 221 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 222 + THUNDERBAY_PIN_DESC(20, "GPIO20", 223 + THUNDERBAY_MUX(0X0, "SPI0_M0"), 224 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 225 + THUNDERBAY_MUX(0X2, "TPIU_TRACE_M2"), 226 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 227 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 228 + THUNDERBAY_PIN_DESC(21, "GPIO21", 229 + THUNDERBAY_MUX(0X0, "SPI0_M0"), 230 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 231 + THUNDERBAY_MUX(0X2, "TPIU_TRACE_M2"), 232 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 233 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 234 + THUNDERBAY_PIN_DESC(22, "GPIO22", 235 + THUNDERBAY_MUX(0X0, "SPI1_M0"), 236 + THUNDERBAY_MUX(0X1, "EMPTY_M0"), 237 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 238 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 239 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 240 + THUNDERBAY_PIN_DESC(23, "GPIO23", 241 + THUNDERBAY_MUX(0X0, "SPI1_M0"), 242 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 243 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 244 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 245 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 246 + THUNDERBAY_PIN_DESC(24, "GPIO24", 247 + THUNDERBAY_MUX(0X0, "SPI1_M0"), 248 + THUNDERBAY_MUX(0X1, "TPIU_TRACE_M1"), 249 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 250 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 251 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 252 + THUNDERBAY_PIN_DESC(25, "GPIO25", 253 + THUNDERBAY_MUX(0X0, "SPI1_M0"), 254 + THUNDERBAY_MUX(0X1, "TPIU_TRACE_M1"), 255 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 256 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 257 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 258 + THUNDERBAY_PIN_DESC(26, "GPIO26", 259 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 260 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 261 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 262 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 263 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 264 + THUNDERBAY_PIN_DESC(27, "GPIO27", 265 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 266 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 267 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 268 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 269 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 270 + THUNDERBAY_PIN_DESC(28, "GPIO28", 271 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 272 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 273 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 274 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 275 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 276 + THUNDERBAY_PIN_DESC(29, "GPIO29", 277 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 278 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 279 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 280 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 281 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 282 + THUNDERBAY_PIN_DESC(30, "GPIO30", 283 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 284 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 285 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 286 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 287 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 288 + THUNDERBAY_PIN_DESC(31, "GPIO31", 289 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 290 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 291 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 292 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 293 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 294 + THUNDERBAY_PIN_DESC(32, "GPIO32", 295 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 296 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 297 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 298 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 299 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 300 + THUNDERBAY_PIN_DESC(33, "GPIO33", 301 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 302 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 303 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 304 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 305 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 306 + THUNDERBAY_PIN_DESC(34, "GPIO34", 307 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 308 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 309 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 310 + THUNDERBAY_MUX(0X3, "DIG_VIEW_0"), 311 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 312 + THUNDERBAY_PIN_DESC(35, "GPIO35", 313 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 314 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 315 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 316 + THUNDERBAY_MUX(0X3, "DIG_VIEW_1"), 317 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 318 + THUNDERBAY_PIN_DESC(36, "GPIO36", 319 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 320 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 321 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 322 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_0"), 323 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 324 + THUNDERBAY_PIN_DESC(37, "GPIO37", 325 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 326 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 327 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 328 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_1"), 329 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 330 + THUNDERBAY_PIN_DESC(38, "GPIO38", 331 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 332 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 333 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 334 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_2"), 335 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 336 + THUNDERBAY_PIN_DESC(39, "GPIO39", 337 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 338 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 339 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 340 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_3"), 341 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 342 + THUNDERBAY_PIN_DESC(40, "GPIO40", 343 + THUNDERBAY_MUX(0X0, "ETHER0_M0"), 344 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 345 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 346 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 347 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 348 + THUNDERBAY_PIN_DESC(41, "GPIO41", 349 + THUNDERBAY_MUX(0X0, "POWER_INTERRUPT_MAX_PLATFORM_POWER_M0"), 350 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 351 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 352 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 353 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 354 + THUNDERBAY_PIN_DESC(42, "GPIO42", 355 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 356 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 357 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 358 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 359 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 360 + THUNDERBAY_PIN_DESC(43, "GPIO43", 361 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 362 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 363 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 364 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 365 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 366 + THUNDERBAY_PIN_DESC(44, "GPIO44", 367 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 368 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 369 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 370 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 371 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 372 + THUNDERBAY_PIN_DESC(45, "GPIO45", 373 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 374 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 375 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 376 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 377 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 378 + THUNDERBAY_PIN_DESC(46, "GPIO46", 379 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 380 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 381 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 382 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 383 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 384 + THUNDERBAY_PIN_DESC(47, "GPIO47", 385 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 386 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 387 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 388 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 389 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 390 + THUNDERBAY_PIN_DESC(48, "GPIO48", 391 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 392 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 393 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 394 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 395 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 396 + THUNDERBAY_PIN_DESC(49, "GPIO49", 397 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 398 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 399 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 400 + THUNDERBAY_MUX(0X3, "DEBUG_M3"), 401 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 402 + THUNDERBAY_PIN_DESC(50, "GPIO50", 403 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 404 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 405 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 406 + THUNDERBAY_MUX(0X3, "DIG_VIEW_0"), 407 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 408 + THUNDERBAY_PIN_DESC(51, "GPIO51", 409 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 410 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 411 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 412 + THUNDERBAY_MUX(0X3, "DIG_VIEW_1"), 413 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 414 + THUNDERBAY_PIN_DESC(52, "GPIO52", 415 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 416 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 417 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 418 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_0"), 419 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 420 + THUNDERBAY_PIN_DESC(53, "GPIO53", 421 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 422 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 423 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 424 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_1"), 425 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 426 + THUNDERBAY_PIN_DESC(54, "GPIO54", 427 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 428 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 429 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 430 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_2"), 431 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 432 + THUNDERBAY_PIN_DESC(55, "GPIO55", 433 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 434 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 435 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 436 + THUNDERBAY_MUX(0X3, "CPR_IO_OUT_CLK_3"), 437 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 438 + THUNDERBAY_PIN_DESC(56, "GPIO56", 439 + THUNDERBAY_MUX(0X0, "ETHER1_M0"), 440 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 441 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 442 + THUNDERBAY_MUX(0X3, "POWER_INTERRUPT_ICCMAX_VDDD_M3"), 443 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 444 + THUNDERBAY_PIN_DESC(57, "GPIO57", 445 + THUNDERBAY_MUX(0X0, "POWER_INTERRUPT_ICCMAX_VPU_M0"), 446 + THUNDERBAY_MUX(0X1, "TPIU_DATA_M1"), 447 + THUNDERBAY_MUX(0X2, "TPIU_DATA_M2"), 448 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 449 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 450 + THUNDERBAY_PIN_DESC(58, "GPIO58", 451 + THUNDERBAY_MUX(0X0, "THERMTRIP_M0"), 452 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 453 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 454 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 455 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 456 + THUNDERBAY_PIN_DESC(59, "GPIO59", 457 + THUNDERBAY_MUX(0X0, "THERMTRIP_M0"), 458 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 459 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 460 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 461 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 462 + THUNDERBAY_PIN_DESC(60, "GPIO60", 463 + THUNDERBAY_MUX(0X0, "SMBUS_M0"), 464 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 465 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 466 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 467 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 468 + THUNDERBAY_PIN_DESC(61, "GPIO61", 469 + THUNDERBAY_MUX(0X0, "SMBUS_M0"), 470 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 471 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 472 + THUNDERBAY_MUX(0X3, "POWER_INTERRUPT_ICCMAX_VDDD_M3"), 473 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 474 + THUNDERBAY_PIN_DESC(62, "GPIO62", 475 + THUNDERBAY_MUX(0X0, "PLATFORM_RESET_M0"), 476 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 477 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 478 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 479 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 480 + THUNDERBAY_PIN_DESC(63, "GPIO63", 481 + THUNDERBAY_MUX(0X0, "PLATFORM_RESET_M0"), 482 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 483 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 484 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 485 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 486 + THUNDERBAY_PIN_DESC(64, "GPIO64", 487 + THUNDERBAY_MUX(0X0, "PLATFORM_SHUTDOWN_M0"), 488 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 489 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 490 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 491 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 492 + THUNDERBAY_PIN_DESC(65, "GPIO65", 493 + THUNDERBAY_MUX(0X0, "PLATFORM_SHUTDOWN_M0"), 494 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 495 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 496 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 497 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 498 + THUNDERBAY_PIN_DESC(66, "GPIO66", 499 + THUNDERBAY_MUX(0X0, "POWER_INTERRUPT_ICCMAX_MEDIA_M0"), 500 + THUNDERBAY_MUX(0X1, "EMPTY_M1"), 501 + THUNDERBAY_MUX(0X2, "EMPTY_M2"), 502 + THUNDERBAY_MUX(0X3, "EMPTY_M3"), 503 + THUNDERBAY_MUX(0X4, "GPIO_M4")), 504 + }; 505 + 506 + static const struct thunderbay_pin_soc thunderbay_data = { 507 + .pins = thunderbay_pins, 508 + .npins = ARRAY_SIZE(thunderbay_pins), 509 + }; 510 + 511 + static u32 thb_gpio_read_reg(struct gpio_chip *chip, unsigned int pinnr) 512 + { 513 + struct thunderbay_pinctrl *tpc = gpiochip_get_data(chip); 514 + 515 + return readl(tpc->base0 + THB_GPIO_REG_OFFSET(pinnr)); 516 + } 517 + 518 + static u32 thb_gpio_write_reg(struct gpio_chip *chip, unsigned int pinnr, u32 value) 519 + { 520 + struct thunderbay_pinctrl *tpc = gpiochip_get_data(chip); 521 + 522 + writel(value, (tpc->base0 + THB_GPIO_REG_OFFSET(pinnr))); 523 + return 0; 524 + } 525 + 526 + static int thb_read_gpio_data(struct gpio_chip *chip, unsigned int offset, unsigned int pad_dir) 527 + { 528 + int data_offset; 529 + u32 data_reg; 530 + 531 + /* as per GPIO Spec = pad_dir 0:input, 1:output */ 532 + data_offset = 0x2000u + (offset / 32); 533 + if (!pad_dir) 534 + data_offset += 4; 535 + data_reg = thb_gpio_read_reg(chip, data_offset); 536 + 537 + return data_reg & BIT(offset % 32); 538 + } 539 + 540 + static int thb_write_gpio_data(struct gpio_chip *chip, unsigned int offset, unsigned int value) 541 + { 542 + int data_offset; 543 + u32 data_reg; 544 + 545 + data_offset = 0x2000u + (offset / 32); 546 + 547 + data_reg = thb_gpio_read_reg(chip, data_offset); 548 + 549 + if (value > 0) 550 + data_reg |= BIT(offset % 32); 551 + else 552 + data_reg &= ~BIT(offset % 32); 553 + 554 + return thb_gpio_write_reg(chip, data_offset, data_reg); 555 + } 556 + 557 + static int thunderbay_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) 558 + { 559 + u32 reg = thb_gpio_read_reg(chip, offset); 560 + 561 + /* Return direction only if configured as GPIO else negative error */ 562 + if (reg & THB_GPIO_PORT_SELECT_MASK) 563 + return !(reg & THB_GPIO_PAD_DIRECTION_MASK); 564 + return -EINVAL; 565 + } 566 + 567 + static int thunderbay_gpio_set_direction_input(struct gpio_chip *chip, unsigned int offset) 568 + { 569 + u32 reg = thb_gpio_read_reg(chip, offset); 570 + 571 + /* set pin as input only if it is GPIO else error */ 572 + if (reg & THB_GPIO_PORT_SELECT_MASK) { 573 + reg &= (~THB_GPIO_PAD_DIRECTION_MASK); 574 + thb_gpio_write_reg(chip, offset, reg); 575 + return 0; 576 + } 577 + return -EINVAL; 578 + } 579 + 580 + static void thunderbay_gpio_set_value(struct gpio_chip *chip, unsigned int offset, int value) 581 + { 582 + u32 reg = thb_gpio_read_reg(chip, offset); 583 + 584 + /* update pin value only if it is GPIO-output else error */ 585 + if ((reg & THB_GPIO_PORT_SELECT_MASK) && (reg & THB_GPIO_PAD_DIRECTION_MASK)) 586 + thb_write_gpio_data(chip, offset, value); 587 + } 588 + 589 + static int thunderbay_gpio_set_direction_output(struct gpio_chip *chip, 590 + unsigned int offset, int value) 591 + { 592 + u32 reg = thb_gpio_read_reg(chip, offset); 593 + 594 + /* set pin as output only if it is GPIO else error */ 595 + if (reg & THB_GPIO_PORT_SELECT_MASK) { 596 + reg |= THB_GPIO_PAD_DIRECTION_MASK; 597 + thb_gpio_write_reg(chip, offset, reg); 598 + thunderbay_gpio_set_value(chip, offset, value); 599 + return 0; 600 + } 601 + return -EINVAL; 602 + } 603 + 604 + static int thunderbay_gpio_get_value(struct gpio_chip *chip, unsigned int offset) 605 + { 606 + u32 reg = thb_gpio_read_reg(chip, offset); 607 + int gpio_dir = 0; 608 + 609 + /* Read pin value only if it is GPIO else error */ 610 + if (reg & THB_GPIO_PORT_SELECT_MASK) { 611 + /* 0=in, 1=out */ 612 + gpio_dir = (reg & THB_GPIO_PAD_DIRECTION_MASK) > 0; 613 + 614 + /* Returns negative value when pin is configured as PORT */ 615 + return thb_read_gpio_data(chip, offset, gpio_dir); 616 + } 617 + return -EINVAL; 618 + } 619 + 620 + static int thunderbay_gpiochip_probe(struct thunderbay_pinctrl *tpc) 621 + { 622 + struct gpio_chip *chip = &tpc->chip; 623 + int ret; 624 + 625 + chip->label = dev_name(tpc->dev); 626 + chip->parent = tpc->dev; 627 + chip->request = gpiochip_generic_request; 628 + chip->free = gpiochip_generic_free; 629 + chip->get_direction = thunderbay_gpio_get_direction; 630 + chip->direction_input = thunderbay_gpio_set_direction_input; 631 + chip->direction_output = thunderbay_gpio_set_direction_output; 632 + chip->get = thunderbay_gpio_get_value; 633 + chip->set = thunderbay_gpio_set_value; 634 + chip->set_config = gpiochip_generic_config; 635 + /* identifies the first GPIO number handled by this chip; or, 636 + * if negative during registration, requests dynamic ID allocation. 637 + * Please pass -1 as base to let gpiolib select the chip base in all possible cases. 638 + * We want to get rid of the static GPIO number space in the long run. 639 + */ 640 + chip->base = -1; 641 + /* Number of GPIOs handled by this controller; the last GPIO handled is (base + ngpio - 1)*/ 642 + chip->ngpio = THB_MAX_NPINS_SUPPORTED; 643 + 644 + /* Register/add Thunder Bay GPIO chip with Linux framework */ 645 + ret = gpiochip_add_data(chip, tpc); 646 + if (ret) 647 + dev_err(tpc->dev, "Failed to add gpiochip\n"); 648 + return ret; 649 + } 650 + 651 + static int thunderbay_request_gpio(struct pinctrl_dev *pctldev, 652 + struct pinctrl_gpio_range *range, 653 + unsigned int pin) 654 + { 655 + struct thunderbay_pinctrl *tpc = pinctrl_dev_get_drvdata(pctldev); 656 + struct gpio_chip *chip = &tpc->chip; 657 + u32 reg = 0; 658 + 659 + if (thb_pinx_status[pin] == 0u) { 660 + reg = thb_gpio_read_reg(chip, pin); 661 + /* Updates PIN configuration as GPIO and sets GPIO to MODE-4*/ 662 + reg |= (THB_GPIO_PORT_SELECT_MASK | THB_GPIO_PINMUX_MODE_4); 663 + thb_gpio_write_reg(chip, pin, reg); 664 + 665 + /* update pin status as busy */ 666 + thb_pinx_status[pin] = 1u; 667 + 668 + return 0; 669 + } 670 + return -EINVAL; 671 + } 672 + 673 + static void thunderbay_free_gpio(struct pinctrl_dev *pctldev, 674 + struct pinctrl_gpio_range *range, 675 + unsigned int pin) 676 + { 677 + struct thunderbay_pinctrl *tpc = pinctrl_dev_get_drvdata(pctldev); 678 + struct gpio_chip *chip = &tpc->chip; 679 + u32 reg = 0; 680 + 681 + if (thb_pinx_status[pin] == 1u) { 682 + reg = thb_gpio_read_reg(chip, pin); 683 + 684 + /* Updates PIN configuration from GPIO to PORT */ 685 + reg &= (~THB_GPIO_PORT_SELECT_MASK); 686 + 687 + /* Change Port/gpio mode to default mode-0 */ 688 + reg &= (~THB_GPIO_PINMUX_MODE_4); 689 + 690 + thb_gpio_write_reg(chip, pin, reg); 691 + 692 + /* update pin status as free */ 693 + thb_pinx_status[pin] = 0u; 694 + } 695 + } 696 + 697 + static int thb_pinctrl_set_mux(struct pinctrl_dev *pctldev, 698 + unsigned int func_select, unsigned int group_select) 699 + { 700 + struct thunderbay_pinctrl *tpc = pinctrl_dev_get_drvdata(pctldev); 701 + struct gpio_chip *chip = &tpc->chip; 702 + struct function_desc *function; 703 + unsigned int i, pin_mode; 704 + struct group_desc *group; 705 + int ret = -EINVAL; 706 + u32 reg = 0u; 707 + 708 + group = pinctrl_generic_get_group(pctldev, group_select); 709 + if (!group) 710 + return -EINVAL; 711 + 712 + function = pinmux_generic_get_function(pctldev, func_select); 713 + if (!function) 714 + return -EINVAL; 715 + 716 + pin_mode = *(unsigned int *)(function->data); 717 + 718 + /* Change modes for pins in the selected group */ 719 + for (i = 0; i < group->num_pins; i++) { 720 + reg = thb_gpio_read_reg(chip, group->pins[i]); 721 + 722 + switch (pin_mode) { 723 + case 0u: 724 + reg |= THB_GPIO_PINMUX_MODE_0; 725 + break; 726 + case 1u: 727 + reg |= THB_GPIO_PINMUX_MODE_1; 728 + break; 729 + case 2u: 730 + reg |= THB_GPIO_PINMUX_MODE_2; 731 + break; 732 + case 3u: 733 + reg |= THB_GPIO_PINMUX_MODE_3; 734 + break; 735 + case 4u: 736 + reg |= THB_GPIO_PINMUX_MODE_4; 737 + break; 738 + default: 739 + return -EINVAL; 740 + } 741 + 742 + ret = thb_gpio_write_reg(chip, group->pins[i], reg); 743 + if (~ret) { 744 + /* update pin status as busy */ 745 + thb_pinx_status[group->pins[i]] = 1u; 746 + } 747 + } 748 + return ret; 749 + } 750 + 751 + static int thunderbay_build_groups(struct thunderbay_pinctrl *tpc) 752 + { 753 + struct group_desc *thunderbay_groups; 754 + int i; 755 + 756 + tpc->ngroups = tpc->soc->npins; 757 + thunderbay_groups = devm_kcalloc(tpc->dev, tpc->ngroups, 758 + sizeof(*thunderbay_groups), GFP_KERNEL); 759 + if (!thunderbay_groups) 760 + return -ENOMEM; 761 + 762 + for (i = 0; i < tpc->ngroups; i++) { 763 + struct group_desc *group = thunderbay_groups + i; 764 + const struct pinctrl_pin_desc *pin_info = thunderbay_pins + i; 765 + 766 + group->name = pin_info->name; 767 + group->pins = (int *)&pin_info->number; 768 + pinctrl_generic_add_group(tpc->pctrl, group->name, 769 + group->pins, 1, NULL); 770 + } 771 + return 0; 772 + } 773 + 774 + static int thunderbay_add_functions(struct thunderbay_pinctrl *tpc, struct function_desc *funcs) 775 + { 776 + struct function_desc *function = funcs; 777 + int i; 778 + 779 + /* Assign the groups for each function */ 780 + for (i = 0; i < tpc->soc->npins; i++) { 781 + const struct pinctrl_pin_desc *pin_info = thunderbay_pins + i; 782 + struct thunderbay_mux_desc *pin_mux = pin_info->drv_data; 783 + 784 + while (pin_mux->name) { 785 + const char **grp; 786 + int j, grp_num, match = 0; 787 + size_t grp_size; 788 + struct function_desc *func; 789 + 790 + for (j = 0; j < tpc->nfuncs; j++) { 791 + if (!strcmp(pin_mux->name, function[j].name)) { 792 + match = 1; 793 + break; 794 + } 795 + } 796 + 797 + if (!match) 798 + return -EINVAL; 799 + 800 + func = function + j; 801 + grp_num = func->num_group_names; 802 + grp_size = sizeof(*func->group_names); 803 + 804 + if (!func->group_names) { 805 + func->group_names = devm_kcalloc(tpc->dev, 806 + grp_num, 807 + grp_size, 808 + GFP_KERNEL); 809 + if (!func->group_names) { 810 + kfree(func); 811 + return -ENOMEM; 812 + } 813 + } 814 + 815 + grp = func->group_names; 816 + while (*grp) 817 + grp++; 818 + 819 + *grp = pin_info->name; 820 + pin_mux++; 821 + } 822 + } 823 + 824 + /* Add all functions */ 825 + for (i = 0; i < tpc->nfuncs; i++) { 826 + pinmux_generic_add_function(tpc->pctrl, 827 + function[i].name, 828 + function[i].group_names, 829 + function[i].num_group_names, 830 + function[i].data); 831 + } 832 + kfree(function); 833 + return 0; 834 + } 835 + 836 + static int thunderbay_build_functions(struct thunderbay_pinctrl *tpc) 837 + { 838 + struct function_desc *thunderbay_funcs; 839 + void *ptr; 840 + int pin; 841 + 842 + /* Total number of functions is unknown at this point. Allocate first. */ 843 + tpc->nfuncs = 0; 844 + thunderbay_funcs = kcalloc(tpc->soc->npins * 8, 845 + sizeof(*thunderbay_funcs), GFP_KERNEL); 846 + if (!thunderbay_funcs) 847 + return -ENOMEM; 848 + 849 + /* Find total number of functions and each's properties */ 850 + for (pin = 0; pin < tpc->soc->npins; pin++) { 851 + const struct pinctrl_pin_desc *pin_info = thunderbay_pins + pin; 852 + struct thunderbay_mux_desc *pin_mux = pin_info->drv_data; 853 + 854 + while (pin_mux->name) { 855 + struct function_desc *func = thunderbay_funcs; 856 + 857 + while (func->name) { 858 + if (!strcmp(pin_mux->name, func->name)) { 859 + func->num_group_names++; 860 + break; 861 + } 862 + func++; 863 + } 864 + 865 + if (!func->name) { 866 + func->name = pin_mux->name; 867 + func->num_group_names = 1; 868 + func->data = (int *)&pin_mux->mode; 869 + tpc->nfuncs++; 870 + } 871 + 872 + pin_mux++; 873 + } 874 + } 875 + 876 + /* Reallocate memory based on actual number of functions */ 877 + ptr = krealloc(thunderbay_funcs, 878 + tpc->nfuncs * sizeof(*thunderbay_funcs), GFP_KERNEL); 879 + if (!ptr) 880 + return -ENOMEM; 881 + 882 + thunderbay_funcs = ptr; 883 + return thunderbay_add_functions(tpc, thunderbay_funcs); 884 + } 885 + 886 + static int thunderbay_pinconf_set_tristate(struct thunderbay_pinctrl *tpc, 887 + unsigned int pin, u32 config) 888 + { 889 + struct gpio_chip *chip = &tpc->chip; 890 + u32 reg; 891 + 892 + reg = thb_gpio_read_reg(chip, pin); 893 + if (config > 0) 894 + reg |= THB_GPIO_ENAQ_MASK; 895 + else 896 + reg &= ~THB_GPIO_ENAQ_MASK; 897 + 898 + return thb_gpio_write_reg(chip, pin, reg); 899 + } 900 + 901 + static int thunderbay_pinconf_get_tristate(struct thunderbay_pinctrl *tpc, 902 + unsigned int pin, u32 *config) 903 + { 904 + struct gpio_chip *chip = &tpc->chip; 905 + u32 reg; 906 + 907 + reg = thb_gpio_read_reg(chip, pin); 908 + *config = (reg & THB_GPIO_ENAQ_MASK) > 0; 909 + 910 + return 0; 911 + } 912 + 913 + static int thunderbay_pinconf_set_pulldown(struct thunderbay_pinctrl *tpc, 914 + unsigned int pin, u32 config) 915 + { 916 + struct gpio_chip *chip = &tpc->chip; 917 + u32 reg; 918 + 919 + reg = thb_gpio_read_reg(chip, pin); 920 + if (config > 0) 921 + reg |= THB_GPIO_PULL_DOWN_MASK; 922 + else 923 + reg &= ~THB_GPIO_PULL_DOWN_MASK; 924 + 925 + return thb_gpio_write_reg(chip, pin, reg); 926 + } 927 + 928 + static int thunderbay_pinconf_get_pulldown(struct thunderbay_pinctrl *tpc, 929 + unsigned int pin, u32 *config) 930 + { 931 + struct gpio_chip *chip = &tpc->chip; 932 + u32 reg = 0; 933 + 934 + reg = thb_gpio_read_reg(chip, pin); 935 + *config = ((reg & THB_GPIO_PULL_DOWN_MASK) > 0) ? 1 : 0; 936 + 937 + return 0; 938 + } 939 + 940 + static int thunderbay_pinconf_set_pullup(struct thunderbay_pinctrl *tpc, 941 + unsigned int pin, u32 config) 942 + { 943 + struct gpio_chip *chip = &tpc->chip; 944 + u32 reg; 945 + 946 + reg = thb_gpio_read_reg(chip, pin); 947 + if (config > 0) 948 + reg &= ~THB_GPIO_PULL_UP_MASK; 949 + else 950 + reg |= THB_GPIO_PULL_UP_MASK; 951 + 952 + return thb_gpio_write_reg(chip, pin, reg); 953 + } 954 + 955 + static int thunderbay_pinconf_get_pullup(struct thunderbay_pinctrl *tpc, 956 + unsigned int pin, u32 *config) 957 + { 958 + struct gpio_chip *chip = &tpc->chip; 959 + u32 reg; 960 + 961 + reg = thb_gpio_read_reg(chip, pin); 962 + *config = ((reg & THB_GPIO_PULL_UP_MASK) == 0) ? 1 : 0; 963 + 964 + return 0; 965 + } 966 + 967 + static int thunderbay_pinconf_set_opendrain(struct thunderbay_pinctrl *tpc, 968 + unsigned int pin, u32 config) 969 + { 970 + struct gpio_chip *chip = &tpc->chip; 971 + u32 reg; 972 + 973 + reg = thb_gpio_read_reg(chip, pin); 974 + if (config > 0) 975 + reg &= ~THB_GPIO_PULL_ENABLE_MASK; 976 + else 977 + reg |= THB_GPIO_PULL_ENABLE_MASK; 978 + 979 + return thb_gpio_write_reg(chip, pin, reg); 980 + } 981 + 982 + static int thunderbay_pinconf_get_opendrain(struct thunderbay_pinctrl *tpc, 983 + unsigned int pin, u32 *config) 984 + { 985 + struct gpio_chip *chip = &tpc->chip; 986 + u32 reg; 987 + 988 + reg = thb_gpio_read_reg(chip, pin); 989 + *config = ((reg & THB_GPIO_PULL_ENABLE_MASK) == 0) ? 1 : 0; 990 + 991 + return 0; 992 + } 993 + 994 + static int thunderbay_pinconf_set_pushpull(struct thunderbay_pinctrl *tpc, 995 + unsigned int pin, u32 config) 996 + { 997 + struct gpio_chip *chip = &tpc->chip; 998 + u32 reg; 999 + 1000 + reg = thb_gpio_read_reg(chip, pin); 1001 + if (config > 0) 1002 + reg |= THB_GPIO_PULL_ENABLE_MASK; 1003 + else 1004 + reg &= ~THB_GPIO_PULL_ENABLE_MASK; 1005 + 1006 + return thb_gpio_write_reg(chip, pin, reg); 1007 + } 1008 + 1009 + static int thunderbay_pinconf_get_pushpull(struct thunderbay_pinctrl *tpc, 1010 + unsigned int pin, u32 *config) 1011 + { 1012 + struct gpio_chip *chip = &tpc->chip; 1013 + u32 reg; 1014 + 1015 + reg = thb_gpio_read_reg(chip, pin); 1016 + *config = ((reg & THB_GPIO_PULL_ENABLE_MASK) > 0) ? 1 : 0; 1017 + 1018 + return 0; 1019 + } 1020 + 1021 + static int thunderbay_pinconf_set_drivestrength(struct thunderbay_pinctrl *tpc, 1022 + unsigned int pin, u32 config) 1023 + { 1024 + struct gpio_chip *chip = &tpc->chip; 1025 + u32 reg; 1026 + 1027 + reg = thb_gpio_read_reg(chip, pin); 1028 + 1029 + /* Drive Strength: 0x0 to 0xF */ 1030 + if (config <= 0xF) { 1031 + reg = (reg | config); 1032 + return thb_gpio_write_reg(chip, pin, reg); 1033 + } 1034 + 1035 + return -EINVAL; 1036 + } 1037 + 1038 + static int thunderbay_pinconf_get_drivestrength(struct thunderbay_pinctrl *tpc, 1039 + unsigned int pin, u32 *config) 1040 + { 1041 + struct gpio_chip *chip = &tpc->chip; 1042 + u32 reg; 1043 + 1044 + reg = thb_gpio_read_reg(chip, pin); 1045 + reg = (reg & THB_GPIO_DRIVE_STRENGTH_MASK) >> 16; 1046 + *config = (reg > 0) ? reg : 0; 1047 + 1048 + return 0; 1049 + } 1050 + 1051 + static int thunderbay_pinconf_set_schmitt(struct thunderbay_pinctrl *tpc, 1052 + unsigned int pin, u32 config) 1053 + { 1054 + struct gpio_chip *chip = &tpc->chip; 1055 + u32 reg; 1056 + 1057 + reg = thb_gpio_read_reg(chip, pin); 1058 + if (config > 0) 1059 + reg |= THB_GPIO_SCHMITT_TRIGGER_MASK; 1060 + else 1061 + reg &= ~THB_GPIO_SCHMITT_TRIGGER_MASK; 1062 + 1063 + return thb_gpio_write_reg(chip, pin, reg); 1064 + } 1065 + 1066 + static int thunderbay_pinconf_get_schmitt(struct thunderbay_pinctrl *tpc, 1067 + unsigned int pin, u32 *config) 1068 + { 1069 + struct gpio_chip *chip = &tpc->chip; 1070 + u32 reg; 1071 + 1072 + reg = thb_gpio_read_reg(chip, pin); 1073 + *config = ((reg & THB_GPIO_SCHMITT_TRIGGER_MASK) > 0) ? 1 : 0; 1074 + 1075 + return 0; 1076 + } 1077 + 1078 + static int thunderbay_pinconf_set_slew_rate(struct thunderbay_pinctrl *tpc, 1079 + unsigned int pin, u32 config) 1080 + { 1081 + struct gpio_chip *chip = &tpc->chip; 1082 + u32 reg = 0; 1083 + 1084 + reg = thb_gpio_read_reg(chip, pin); 1085 + if (config > 0) 1086 + reg |= THB_GPIO_SLEW_RATE_MASK; 1087 + else 1088 + reg &= ~THB_GPIO_SLEW_RATE_MASK; 1089 + 1090 + return thb_gpio_write_reg(chip, pin, reg); 1091 + } 1092 + 1093 + static int thunderbay_pinconf_get_slew_rate(struct thunderbay_pinctrl *tpc, 1094 + unsigned int pin, u32 *config) 1095 + { 1096 + struct gpio_chip *chip = &tpc->chip; 1097 + u32 reg; 1098 + 1099 + reg = thb_gpio_read_reg(chip, pin); 1100 + *config = ((reg & THB_GPIO_SLEW_RATE_MASK) > 0) ? 1 : 0; 1101 + 1102 + return 0; 1103 + } 1104 + 1105 + static int thunderbay_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, 1106 + unsigned long *config) 1107 + { 1108 + struct thunderbay_pinctrl *tpc = pinctrl_dev_get_drvdata(pctldev); 1109 + enum pin_config_param param = pinconf_to_config_param(*config); 1110 + u32 arg; 1111 + int ret; 1112 + 1113 + switch (param) { 1114 + case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: 1115 + ret = thunderbay_pinconf_get_tristate(tpc, pin, &arg); 1116 + break; 1117 + 1118 + case PIN_CONFIG_BIAS_PULL_DOWN: 1119 + ret = thunderbay_pinconf_get_pulldown(tpc, pin, &arg); 1120 + break; 1121 + 1122 + case PIN_CONFIG_BIAS_PULL_UP: 1123 + ret = thunderbay_pinconf_get_pullup(tpc, pin, &arg); 1124 + break; 1125 + 1126 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 1127 + ret = thunderbay_pinconf_get_opendrain(tpc, pin, &arg); 1128 + break; 1129 + 1130 + case PIN_CONFIG_DRIVE_PUSH_PULL: 1131 + ret = thunderbay_pinconf_get_pushpull(tpc, pin, &arg); 1132 + break; 1133 + 1134 + case PIN_CONFIG_DRIVE_STRENGTH: 1135 + ret = thunderbay_pinconf_get_drivestrength(tpc, pin, &arg); 1136 + break; 1137 + 1138 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 1139 + ret = thunderbay_pinconf_get_schmitt(tpc, pin, &arg); 1140 + break; 1141 + 1142 + case PIN_CONFIG_SLEW_RATE: 1143 + ret = thunderbay_pinconf_get_slew_rate(tpc, pin, &arg); 1144 + break; 1145 + 1146 + default: 1147 + return -ENOTSUPP; 1148 + } 1149 + 1150 + *config = pinconf_to_config_packed(param, arg); 1151 + 1152 + return ret; 1153 + } 1154 + 1155 + static int thunderbay_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, 1156 + unsigned long *configs, unsigned int num_configs) 1157 + { 1158 + struct thunderbay_pinctrl *tpc = pinctrl_dev_get_drvdata(pctldev); 1159 + enum pin_config_param param; 1160 + unsigned int pinconf; 1161 + int ret = 0; 1162 + u32 arg; 1163 + 1164 + for (pinconf = 0; pinconf < num_configs; pinconf++) { 1165 + param = pinconf_to_config_param(configs[pinconf]); 1166 + arg = pinconf_to_config_argument(configs[pinconf]); 1167 + 1168 + switch (param) { 1169 + case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: 1170 + ret = thunderbay_pinconf_set_tristate(tpc, pin, arg); 1171 + break; 1172 + 1173 + case PIN_CONFIG_BIAS_PULL_DOWN: 1174 + ret = thunderbay_pinconf_set_pulldown(tpc, pin, arg); 1175 + break; 1176 + 1177 + case PIN_CONFIG_BIAS_PULL_UP: 1178 + ret = thunderbay_pinconf_set_pullup(tpc, pin, arg); 1179 + break; 1180 + 1181 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 1182 + ret = thunderbay_pinconf_set_opendrain(tpc, pin, arg); 1183 + break; 1184 + 1185 + case PIN_CONFIG_DRIVE_PUSH_PULL: 1186 + ret = thunderbay_pinconf_set_pushpull(tpc, pin, arg); 1187 + break; 1188 + 1189 + case PIN_CONFIG_DRIVE_STRENGTH: 1190 + ret = thunderbay_pinconf_set_drivestrength(tpc, pin, arg); 1191 + break; 1192 + 1193 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 1194 + ret = thunderbay_pinconf_set_schmitt(tpc, pin, arg); 1195 + break; 1196 + 1197 + case PIN_CONFIG_SLEW_RATE: 1198 + ret = thunderbay_pinconf_set_slew_rate(tpc, pin, arg); 1199 + break; 1200 + 1201 + default: 1202 + return -ENOTSUPP; 1203 + } 1204 + } 1205 + return ret; 1206 + } 1207 + 1208 + static const struct pinctrl_ops thunderbay_pctlops = { 1209 + .get_groups_count = pinctrl_generic_get_group_count, 1210 + .get_group_name = pinctrl_generic_get_group_name, 1211 + .get_group_pins = pinctrl_generic_get_group_pins, 1212 + .dt_node_to_map = pinconf_generic_dt_node_to_map_all, 1213 + .dt_free_map = pinconf_generic_dt_free_map, 1214 + }; 1215 + 1216 + static const struct pinmux_ops thunderbay_pmxops = { 1217 + .get_functions_count = pinmux_generic_get_function_count, 1218 + .get_function_name = pinmux_generic_get_function_name, 1219 + .get_function_groups = pinmux_generic_get_function_groups, 1220 + .set_mux = thb_pinctrl_set_mux, 1221 + .gpio_request_enable = thunderbay_request_gpio, 1222 + .gpio_disable_free = thunderbay_free_gpio, 1223 + }; 1224 + 1225 + static const struct pinconf_ops thunderbay_confops = { 1226 + .is_generic = true, 1227 + .pin_config_get = thunderbay_pinconf_get, 1228 + .pin_config_set = thunderbay_pinconf_set, 1229 + }; 1230 + 1231 + static struct pinctrl_desc thunderbay_pinctrl_desc = { 1232 + .name = "thunderbay-pinmux", 1233 + .pctlops = &thunderbay_pctlops, 1234 + .pmxops = &thunderbay_pmxops, 1235 + .confops = &thunderbay_confops, 1236 + .owner = THIS_MODULE, 1237 + }; 1238 + 1239 + static const struct of_device_id thunderbay_pinctrl_match[] = { 1240 + { 1241 + .compatible = "intel,thunderbay-pinctrl", 1242 + .data = &thunderbay_data 1243 + }, 1244 + {} 1245 + }; 1246 + 1247 + static int thunderbay_pinctrl_probe(struct platform_device *pdev) 1248 + { 1249 + const struct of_device_id *of_id; 1250 + struct device *dev = &pdev->dev; 1251 + struct thunderbay_pinctrl *tpc; 1252 + struct resource *iomem; 1253 + int ret; 1254 + 1255 + of_id = of_match_node(thunderbay_pinctrl_match, pdev->dev.of_node); 1256 + if (!of_id) 1257 + return -ENODEV; 1258 + 1259 + tpc = devm_kzalloc(dev, sizeof(*tpc), GFP_KERNEL); 1260 + if (!tpc) 1261 + return -ENOMEM; 1262 + 1263 + tpc->dev = dev; 1264 + tpc->soc = of_id->data; 1265 + 1266 + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1267 + if (!iomem) 1268 + return -ENXIO; 1269 + 1270 + tpc->base0 = devm_ioremap_resource(dev, iomem); 1271 + if (IS_ERR(tpc->base0)) 1272 + return PTR_ERR(tpc->base0); 1273 + 1274 + thunderbay_pinctrl_desc.pins = tpc->soc->pins; 1275 + thunderbay_pinctrl_desc.npins = tpc->soc->npins; 1276 + 1277 + /* Register pinctrl */ 1278 + tpc->pctrl = devm_pinctrl_register(dev, &thunderbay_pinctrl_desc, tpc); 1279 + if (IS_ERR(tpc->pctrl)) 1280 + return PTR_ERR(tpc->pctrl); 1281 + 1282 + /* Setup pinmux groups */ 1283 + ret = thunderbay_build_groups(tpc); 1284 + if (ret) 1285 + return ret; 1286 + 1287 + /* Setup pinmux functions */ 1288 + ret = thunderbay_build_functions(tpc); 1289 + if (ret) 1290 + return ret; 1291 + 1292 + /* Setup GPIO */ 1293 + ret = thunderbay_gpiochip_probe(tpc); 1294 + if (ret < 0) 1295 + return ret; 1296 + 1297 + platform_set_drvdata(pdev, tpc); 1298 + 1299 + return 0; 1300 + } 1301 + 1302 + static int thunderbay_pinctrl_remove(struct platform_device *pdev) 1303 + { 1304 + /* thunderbay_pinctrl_remove function to clear the assigned memory */ 1305 + return 0; 1306 + } 1307 + 1308 + static struct platform_driver thunderbay_pinctrl_driver = { 1309 + .driver = { 1310 + .name = "thunderbay-pinctrl", 1311 + .of_match_table = thunderbay_pinctrl_match, 1312 + }, 1313 + .probe = thunderbay_pinctrl_probe, 1314 + .remove = thunderbay_pinctrl_remove, 1315 + }; 1316 + 1317 + builtin_platform_driver(thunderbay_pinctrl_driver); 1318 + 1319 + MODULE_AUTHOR("Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>"); 1320 + MODULE_AUTHOR("Kiran Kumar S <kiran.kumar1.s@intel.com>"); 1321 + MODULE_DESCRIPTION("Intel Thunder Bay Pinctrl/GPIO Driver"); 1322 + MODULE_LICENSE("GPL v2");
-1
drivers/pinctrl/pinctrl-xway.c
··· 1763 1763 /* register the gpio chip */ 1764 1764 xway_chip.parent = &pdev->dev; 1765 1765 xway_chip.owner = THIS_MODULE; 1766 - xway_chip.of_node = pdev->dev.of_node; 1767 1766 ret = devm_gpiochip_add_data(&pdev->dev, &xway_chip, NULL); 1768 1767 if (ret) { 1769 1768 dev_err(&pdev->dev, "Failed to register gpio chip\n");
+6 -4
drivers/pinctrl/pinctrl-zynqmp.c
··· 809 809 unsigned int *npins) 810 810 { 811 811 struct pinctrl_pin_desc *pins, *pin; 812 + char **pin_names; 812 813 int ret; 813 814 int i; 814 815 ··· 821 820 if (!pins) 822 821 return -ENOMEM; 823 822 823 + pin_names = devm_kasprintf_strarray(dev, ZYNQMP_PIN_PREFIX, *npins); 824 + if (IS_ERR(pin_names)) 825 + return PTR_ERR(pin_names); 826 + 824 827 for (i = 0; i < *npins; i++) { 825 828 pin = &pins[i]; 826 829 pin->number = i; 827 - pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", 828 - ZYNQMP_PIN_PREFIX, i); 829 - if (!pin->name) 830 - return -ENOMEM; 830 + pin->name = pin_names[i]; 831 831 } 832 832 833 833 *zynqmp_pins = pins;
+1 -1
drivers/pinctrl/pinmux.c
··· 875 875 */ 876 876 int pinmux_generic_add_function(struct pinctrl_dev *pctldev, 877 877 const char *name, 878 - const char **groups, 878 + const char * const *groups, 879 879 const unsigned int num_groups, 880 880 void *data) 881 881 {
+2 -2
drivers/pinctrl/pinmux.h
··· 129 129 */ 130 130 struct function_desc { 131 131 const char *name; 132 - const char **group_names; 132 + const char * const *group_names; 133 133 int num_group_names; 134 134 void *data; 135 135 }; ··· 150 150 151 151 int pinmux_generic_add_function(struct pinctrl_dev *pctldev, 152 152 const char *name, 153 - const char **groups, 153 + const char * const *groups, 154 154 unsigned const num_groups, 155 155 void *data); 156 156
+18
drivers/pinctrl/qcom/Kconfig
··· 302 302 Qualcomm Technologies Inc TLMM block found on the Qualcomm 303 303 Technologies Inc SM6350 platform. 304 304 305 + config PINCTRL_SDX65 306 + tristate "Qualcomm Technologies Inc SDX65 pin controller driver" 307 + depends on GPIOLIB && OF 308 + depends on PINCTRL_MSM 309 + help 310 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 311 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 312 + Technologies Inc SDX65 platform. 313 + 305 314 config PINCTRL_SM8150 306 315 tristate "Qualcomm Technologies Inc SM8150 pin controller driver" 307 316 depends on OF ··· 336 327 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 337 328 Qualcomm Technologies Inc TLMM block found on the Qualcomm 338 329 Technologies Inc SM8350 platform. 330 + 331 + config PINCTRL_SM8450 332 + tristate "Qualcomm Technologies Inc SM8450 pin controller driver" 333 + depends on GPIOLIB && OF 334 + select PINCTRL_MSM 335 + help 336 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 337 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 338 + Technologies Inc SM8450 platform. 339 339 340 340 config PINCTRL_LPASS_LPI 341 341 tristate "Qualcomm Technologies Inc LPASS LPI pin controller driver"
+2
drivers/pinctrl/qcom/Makefile
··· 35 35 obj-$(CONFIG_PINCTRL_SM6115) += pinctrl-sm6115.o 36 36 obj-$(CONFIG_PINCTRL_SM6125) += pinctrl-sm6125.o 37 37 obj-$(CONFIG_PINCTRL_SM6350) += pinctrl-sm6350.o 38 + obj-$(CONFIG_PINCTRL_SDX65) += pinctrl-sdx65.o 38 39 obj-$(CONFIG_PINCTRL_SM8150) += pinctrl-sm8150.o 39 40 obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o 40 41 obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o 42 + obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o 41 43 obj-$(CONFIG_PINCTRL_LPASS_LPI) += pinctrl-lpass-lpi.o
+13 -3
drivers/pinctrl/qcom/pinctrl-msm.c
··· 185 185 unsigned int irq = irq_find_mapping(gc->irq.domain, group); 186 186 struct irq_data *d = irq_get_irq_data(irq); 187 187 unsigned int gpio_func = pctrl->soc->gpio_func; 188 + unsigned int egpio_func = pctrl->soc->egpio_func; 188 189 const struct msm_pingroup *g; 189 190 unsigned long flags; 190 191 u32 val, mask; ··· 219 218 raw_spin_lock_irqsave(&pctrl->lock, flags); 220 219 221 220 val = msm_readl_ctl(pctrl, g); 222 - val &= ~mask; 223 - val |= i << g->mux_bit; 221 + 222 + if (egpio_func && i == egpio_func) { 223 + if (val & BIT(g->egpio_present)) 224 + val &= ~BIT(g->egpio_enable); 225 + } else { 226 + val &= ~mask; 227 + val |= i << g->mux_bit; 228 + /* Claim ownership of pin if egpio capable */ 229 + if (egpio_func && val & BIT(g->egpio_present)) 230 + val |= BIT(g->egpio_enable); 231 + } 232 + 224 233 msm_writel_ctl(val, pctrl, g); 225 234 226 235 raw_spin_unlock_irqrestore(&pctrl->lock, flags); ··· 1264 1253 chip->label = dev_name(pctrl->dev); 1265 1254 chip->parent = pctrl->dev; 1266 1255 chip->owner = THIS_MODULE; 1267 - chip->of_node = pctrl->dev->of_node; 1268 1256 if (msm_gpio_needs_valid_mask(pctrl)) 1269 1257 chip->init_valid_mask = msm_gpio_init_valid_mask; 1270 1258
+10
drivers/pinctrl/qcom/pinctrl-msm.h
··· 77 77 unsigned drv_bit:5; 78 78 79 79 unsigned od_bit:5; 80 + unsigned egpio_enable:5; 81 + unsigned egpio_present:5; 80 82 unsigned oe_bit:5; 81 83 unsigned in_bit:5; 82 84 unsigned out_bit:5; ··· 121 119 * to be aware that their parent can't handle dual 122 120 * edge interrupts. 123 121 * @gpio_func: Which function number is GPIO (usually 0). 122 + * @egpio_func: If non-zero then this SoC supports eGPIO. Even though in 123 + * hardware this is a mux 1-level above the TLMM, we'll treat 124 + * it as if this is just another mux state of the TLMM. Since 125 + * it doesn't really map to hardware, we'll allocate a virtual 126 + * function number for eGPIO and any time we see that function 127 + * number used we'll treat it as a request to mux away from 128 + * our TLMM towards another owner. 124 129 */ 125 130 struct msm_pinctrl_soc_data { 126 131 const struct pinctrl_pin_desc *pins; ··· 145 136 unsigned int nwakeirq_map; 146 137 bool wakeirq_dual_edge_errata; 147 138 unsigned int gpio_func; 139 + unsigned int egpio_func; 148 140 }; 149 141 150 142 extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
+44 -31
drivers/pinctrl/qcom/pinctrl-sc7280.c
··· 43 43 .mux_bit = 2, \ 44 44 .pull_bit = 0, \ 45 45 .drv_bit = 6, \ 46 + .egpio_enable = 12, \ 47 + .egpio_present = 11, \ 46 48 .oe_bit = 9, \ 47 49 .in_bit = 0, \ 48 50 .out_bit = 1, \ ··· 522 520 msm_mux_dp_lcd, 523 521 msm_mux_edp_hot, 524 522 msm_mux_edp_lcd, 523 + msm_mux_egpio, 525 524 msm_mux_gcc_gp1, 526 525 msm_mux_gcc_gp2, 527 526 msm_mux_gcc_gp3, ··· 660 657 "gpio159", "gpio160", "gpio161", "gpio162", "gpio163", "gpio164", 661 658 "gpio165", "gpio166", "gpio167", "gpio168", "gpio169", "gpio170", 662 659 "gpio171", "gpio172", "gpio173", "gpio174", 660 + }; 661 + static const char * const egpio_groups[] = { 662 + "gpio144", "gpio145", "gpio146", "gpio147", "gpio148", "gpio149", 663 + "gpio150", "gpio151", "gpio152", "gpio153", "gpio154", "gpio155", 664 + "gpio156", "gpio157", "gpio158", "gpio159", "gpio160", "gpio161", 665 + "gpio162", "gpio163", "gpio164", "gpio165", "gpio166", "gpio167", 666 + "gpio168", "gpio169", "gpio170", "gpio171", "gpio172", "gpio173", 667 + "gpio174", 663 668 }; 664 669 static const char * const atest_char_groups[] = { 665 670 "gpio81", ··· 1161 1150 FUNCTION(dp_lcd), 1162 1151 FUNCTION(edp_hot), 1163 1152 FUNCTION(edp_lcd), 1153 + FUNCTION(egpio), 1164 1154 FUNCTION(gcc_gp1), 1165 1155 FUNCTION(gcc_gp2), 1166 1156 FUNCTION(gcc_gp3), ··· 1420 1408 [141] = PINGROUP(141, _, _, _, _, _, _, _, _, _), 1421 1409 [142] = PINGROUP(142, _, _, _, _, _, _, _, _, _), 1422 1410 [143] = PINGROUP(143, _, _, _, _, _, _, _, _, _), 1423 - [144] = PINGROUP(144, _, _, _, _, _, _, _, _, _), 1424 - [145] = PINGROUP(145, _, _, _, _, _, _, _, _, _), 1425 - [146] = PINGROUP(146, _, _, _, _, _, _, _, _, _), 1426 - [147] = PINGROUP(147, _, _, _, _, _, _, _, _, _), 1427 - [148] = PINGROUP(148, _, _, _, _, _, _, _, _, _), 1428 - [149] = PINGROUP(149, _, _, _, _, _, _, _, _, _), 1429 - [150] = PINGROUP(150, qdss, _, _, _, _, _, _, _, _), 1430 - [151] = PINGROUP(151, qdss, _, _, _, _, _, _, _, _), 1431 - [152] = PINGROUP(152, qdss, _, _, _, _, _, _, _, _), 1432 - [153] = PINGROUP(153, qdss, _, _, _, _, _, _, _, _), 1433 - [154] = PINGROUP(154, _, _, _, _, _, _, _, _, _), 1434 - [155] = PINGROUP(155, _, _, _, _, _, _, _, _, _), 1435 - [156] = PINGROUP(156, qdss_cti, _, _, _, _, _, _, _, _), 1436 - [157] = PINGROUP(157, qdss_cti, _, _, _, _, _, _, _, _), 1437 - [158] = PINGROUP(158, _, _, _, _, _, _, _, _, _), 1438 - [159] = PINGROUP(159, _, _, _, _, _, _, _, _, _), 1439 - [160] = PINGROUP(160, _, _, _, _, _, _, _, _, _), 1440 - [161] = PINGROUP(161, _, _, _, _, _, _, _, _, _), 1441 - [162] = PINGROUP(162, _, _, _, _, _, _, _, _, _), 1442 - [163] = PINGROUP(163, _, _, _, _, _, _, _, _, _), 1443 - [164] = PINGROUP(164, _, _, _, _, _, _, _, _, _), 1444 - [165] = PINGROUP(165, qdss_cti, _, _, _, _, _, _, _, _), 1445 - [166] = PINGROUP(166, qdss_cti, _, _, _, _, _, _, _, _), 1446 - [167] = PINGROUP(167, _, _, _, _, _, _, _, _, _), 1447 - [168] = PINGROUP(168, _, _, _, _, _, _, _, _, _), 1448 - [169] = PINGROUP(169, _, _, _, _, _, _, _, _, _), 1449 - [170] = PINGROUP(170, _, _, _, _, _, _, _, _, _), 1450 - [171] = PINGROUP(171, qdss, _, _, _, _, _, _, _, _), 1451 - [172] = PINGROUP(172, qdss, _, _, _, _, _, _, _, _), 1452 - [173] = PINGROUP(173, qdss, _, _, _, _, _, _, _, _), 1453 - [174] = PINGROUP(174, qdss, _, _, _, _, _, _, _, _), 1411 + [144] = PINGROUP(144, _, _, _, _, _, _, _, _, egpio), 1412 + [145] = PINGROUP(145, _, _, _, _, _, _, _, _, egpio), 1413 + [146] = PINGROUP(146, _, _, _, _, _, _, _, _, egpio), 1414 + [147] = PINGROUP(147, _, _, _, _, _, _, _, _, egpio), 1415 + [148] = PINGROUP(148, _, _, _, _, _, _, _, _, egpio), 1416 + [149] = PINGROUP(149, _, _, _, _, _, _, _, _, egpio), 1417 + [150] = PINGROUP(150, qdss, _, _, _, _, _, _, _, egpio), 1418 + [151] = PINGROUP(151, qdss, _, _, _, _, _, _, _, egpio), 1419 + [152] = PINGROUP(152, qdss, _, _, _, _, _, _, _, egpio), 1420 + [153] = PINGROUP(153, qdss, _, _, _, _, _, _, _, egpio), 1421 + [154] = PINGROUP(154, _, _, _, _, _, _, _, _, egpio), 1422 + [155] = PINGROUP(155, _, _, _, _, _, _, _, _, egpio), 1423 + [156] = PINGROUP(156, qdss_cti, _, _, _, _, _, _, _, egpio), 1424 + [157] = PINGROUP(157, qdss_cti, _, _, _, _, _, _, _, egpio), 1425 + [158] = PINGROUP(158, _, _, _, _, _, _, _, _, egpio), 1426 + [159] = PINGROUP(159, _, _, _, _, _, _, _, _, egpio), 1427 + [160] = PINGROUP(160, _, _, _, _, _, _, _, _, egpio), 1428 + [161] = PINGROUP(161, _, _, _, _, _, _, _, _, egpio), 1429 + [162] = PINGROUP(162, _, _, _, _, _, _, _, _, egpio), 1430 + [163] = PINGROUP(163, _, _, _, _, _, _, _, _, egpio), 1431 + [164] = PINGROUP(164, _, _, _, _, _, _, _, _, egpio), 1432 + [165] = PINGROUP(165, qdss_cti, _, _, _, _, _, _, _, egpio), 1433 + [166] = PINGROUP(166, qdss_cti, _, _, _, _, _, _, _, egpio), 1434 + [167] = PINGROUP(167, _, _, _, _, _, _, _, _, egpio), 1435 + [168] = PINGROUP(168, _, _, _, _, _, _, _, _, egpio), 1436 + [169] = PINGROUP(169, _, _, _, _, _, _, _, _, egpio), 1437 + [170] = PINGROUP(170, _, _, _, _, _, _, _, _, egpio), 1438 + [171] = PINGROUP(171, qdss, _, _, _, _, _, _, _, egpio), 1439 + [172] = PINGROUP(172, qdss, _, _, _, _, _, _, _, egpio), 1440 + [173] = PINGROUP(173, qdss, _, _, _, _, _, _, _, egpio), 1441 + [174] = PINGROUP(174, qdss, _, _, _, _, _, _, _, egpio), 1454 1442 [175] = UFS_RESET(ufs_reset, 0xbe000), 1455 1443 [176] = SDC_QDSD_PINGROUP(sdc1_rclk, 0xb3004, 0, 6), 1456 1444 [177] = SDC_QDSD_PINGROUP(sdc1_clk, 0xb3000, 13, 6), ··· 1493 1481 .ngpios = 176, 1494 1482 .wakeirq_map = sc7280_pdc_map, 1495 1483 .nwakeirq_map = ARRAY_SIZE(sc7280_pdc_map), 1484 + .egpio_func = 9, 1496 1485 }; 1497 1486 1498 1487 static int sc7280_pinctrl_probe(struct platform_device *pdev)
+967
drivers/pinctrl/qcom/pinctrl-sdx65.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2021 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_BASE 0x0 21 + #define REG_SIZE 0x1000 22 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 23 + { \ 24 + .name = "gpio" #id, \ 25 + .pins = gpio##id##_pins, \ 26 + .npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins), \ 27 + .funcs = (int[]){ \ 28 + msm_mux_gpio, /* gpio mode */ \ 29 + msm_mux_##f1, \ 30 + msm_mux_##f2, \ 31 + msm_mux_##f3, \ 32 + msm_mux_##f4, \ 33 + msm_mux_##f5, \ 34 + msm_mux_##f6, \ 35 + msm_mux_##f7, \ 36 + msm_mux_##f8, \ 37 + msm_mux_##f9 \ 38 + }, \ 39 + .nfuncs = 10, \ 40 + .ctl_reg = REG_BASE + REG_SIZE * id, \ 41 + .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \ 42 + .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 43 + .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \ 44 + .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 45 + .mux_bit = 2, \ 46 + .pull_bit = 0, \ 47 + .drv_bit = 6, \ 48 + .oe_bit = 9, \ 49 + .in_bit = 0, \ 50 + .out_bit = 1, \ 51 + .intr_enable_bit = 0, \ 52 + .intr_status_bit = 0, \ 53 + .intr_target_bit = 5, \ 54 + .intr_target_kpss_val = 3, \ 55 + .intr_raw_status_bit = 4, \ 56 + .intr_polarity_bit = 1, \ 57 + .intr_detection_bit = 2, \ 58 + .intr_detection_width = 2, \ 59 + } 60 + 61 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 62 + { \ 63 + .name = #pg_name, \ 64 + .pins = pg_name##_pins, \ 65 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 66 + .ctl_reg = ctl, \ 67 + .io_reg = 0, \ 68 + .intr_cfg_reg = 0, \ 69 + .intr_status_reg = 0, \ 70 + .intr_target_reg = 0, \ 71 + .mux_bit = -1, \ 72 + .pull_bit = pull, \ 73 + .drv_bit = drv, \ 74 + .oe_bit = -1, \ 75 + .in_bit = -1, \ 76 + .out_bit = -1, \ 77 + .intr_enable_bit = -1, \ 78 + .intr_status_bit = -1, \ 79 + .intr_target_bit = -1, \ 80 + .intr_raw_status_bit = -1, \ 81 + .intr_polarity_bit = -1, \ 82 + .intr_detection_bit = -1, \ 83 + .intr_detection_width = -1, \ 84 + } 85 + 86 + #define UFS_RESET(pg_name, offset) \ 87 + { \ 88 + .name = #pg_name, \ 89 + .pins = pg_name##_pins, \ 90 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 91 + .ctl_reg = offset, \ 92 + .io_reg = offset + 0x4, \ 93 + .intr_cfg_reg = 0, \ 94 + .intr_status_reg = 0, \ 95 + .intr_target_reg = 0, \ 96 + .mux_bit = -1, \ 97 + .pull_bit = 3, \ 98 + .drv_bit = 0, \ 99 + .oe_bit = -1, \ 100 + .in_bit = -1, \ 101 + .out_bit = 0, \ 102 + .intr_enable_bit = -1, \ 103 + .intr_status_bit = -1, \ 104 + .intr_target_bit = -1, \ 105 + .intr_raw_status_bit = -1, \ 106 + .intr_polarity_bit = -1, \ 107 + .intr_detection_bit = -1, \ 108 + .intr_detection_width = -1, \ 109 + } 110 + 111 + static const struct pinctrl_pin_desc sdx65_pins[] = { 112 + PINCTRL_PIN(0, "GPIO_0"), 113 + PINCTRL_PIN(1, "GPIO_1"), 114 + PINCTRL_PIN(2, "GPIO_2"), 115 + PINCTRL_PIN(3, "GPIO_3"), 116 + PINCTRL_PIN(4, "GPIO_4"), 117 + PINCTRL_PIN(5, "GPIO_5"), 118 + PINCTRL_PIN(6, "GPIO_6"), 119 + PINCTRL_PIN(7, "GPIO_7"), 120 + PINCTRL_PIN(8, "GPIO_8"), 121 + PINCTRL_PIN(9, "GPIO_9"), 122 + PINCTRL_PIN(10, "GPIO_10"), 123 + PINCTRL_PIN(11, "GPIO_11"), 124 + PINCTRL_PIN(12, "GPIO_12"), 125 + PINCTRL_PIN(13, "GPIO_13"), 126 + PINCTRL_PIN(14, "GPIO_14"), 127 + PINCTRL_PIN(15, "GPIO_15"), 128 + PINCTRL_PIN(16, "GPIO_16"), 129 + PINCTRL_PIN(17, "GPIO_17"), 130 + PINCTRL_PIN(18, "GPIO_18"), 131 + PINCTRL_PIN(19, "GPIO_19"), 132 + PINCTRL_PIN(20, "GPIO_20"), 133 + PINCTRL_PIN(21, "GPIO_21"), 134 + PINCTRL_PIN(22, "GPIO_22"), 135 + PINCTRL_PIN(23, "GPIO_23"), 136 + PINCTRL_PIN(24, "GPIO_24"), 137 + PINCTRL_PIN(25, "GPIO_25"), 138 + PINCTRL_PIN(26, "GPIO_26"), 139 + PINCTRL_PIN(27, "GPIO_27"), 140 + PINCTRL_PIN(28, "GPIO_28"), 141 + PINCTRL_PIN(29, "GPIO_29"), 142 + PINCTRL_PIN(30, "GPIO_30"), 143 + PINCTRL_PIN(31, "GPIO_31"), 144 + PINCTRL_PIN(32, "GPIO_32"), 145 + PINCTRL_PIN(33, "GPIO_33"), 146 + PINCTRL_PIN(34, "GPIO_34"), 147 + PINCTRL_PIN(35, "GPIO_35"), 148 + PINCTRL_PIN(36, "GPIO_36"), 149 + PINCTRL_PIN(37, "GPIO_37"), 150 + PINCTRL_PIN(38, "GPIO_38"), 151 + PINCTRL_PIN(39, "GPIO_39"), 152 + PINCTRL_PIN(40, "GPIO_40"), 153 + PINCTRL_PIN(41, "GPIO_41"), 154 + PINCTRL_PIN(42, "GPIO_42"), 155 + PINCTRL_PIN(43, "GPIO_43"), 156 + PINCTRL_PIN(44, "GPIO_44"), 157 + PINCTRL_PIN(45, "GPIO_45"), 158 + PINCTRL_PIN(46, "GPIO_46"), 159 + PINCTRL_PIN(47, "GPIO_47"), 160 + PINCTRL_PIN(48, "GPIO_48"), 161 + PINCTRL_PIN(49, "GPIO_49"), 162 + PINCTRL_PIN(50, "GPIO_50"), 163 + PINCTRL_PIN(51, "GPIO_51"), 164 + PINCTRL_PIN(52, "GPIO_52"), 165 + PINCTRL_PIN(53, "GPIO_53"), 166 + PINCTRL_PIN(54, "GPIO_54"), 167 + PINCTRL_PIN(55, "GPIO_55"), 168 + PINCTRL_PIN(56, "GPIO_56"), 169 + PINCTRL_PIN(57, "GPIO_57"), 170 + PINCTRL_PIN(58, "GPIO_58"), 171 + PINCTRL_PIN(59, "GPIO_59"), 172 + PINCTRL_PIN(60, "GPIO_60"), 173 + PINCTRL_PIN(61, "GPIO_61"), 174 + PINCTRL_PIN(62, "GPIO_62"), 175 + PINCTRL_PIN(63, "GPIO_63"), 176 + PINCTRL_PIN(64, "GPIO_64"), 177 + PINCTRL_PIN(65, "GPIO_65"), 178 + PINCTRL_PIN(66, "GPIO_66"), 179 + PINCTRL_PIN(67, "GPIO_67"), 180 + PINCTRL_PIN(68, "GPIO_68"), 181 + PINCTRL_PIN(69, "GPIO_69"), 182 + PINCTRL_PIN(70, "GPIO_70"), 183 + PINCTRL_PIN(71, "GPIO_71"), 184 + PINCTRL_PIN(72, "GPIO_72"), 185 + PINCTRL_PIN(73, "GPIO_73"), 186 + PINCTRL_PIN(74, "GPIO_74"), 187 + PINCTRL_PIN(75, "GPIO_75"), 188 + PINCTRL_PIN(76, "GPIO_76"), 189 + PINCTRL_PIN(77, "GPIO_77"), 190 + PINCTRL_PIN(78, "GPIO_78"), 191 + PINCTRL_PIN(79, "GPIO_79"), 192 + PINCTRL_PIN(80, "GPIO_80"), 193 + PINCTRL_PIN(81, "GPIO_81"), 194 + PINCTRL_PIN(82, "GPIO_82"), 195 + PINCTRL_PIN(83, "GPIO_83"), 196 + PINCTRL_PIN(84, "GPIO_84"), 197 + PINCTRL_PIN(85, "GPIO_85"), 198 + PINCTRL_PIN(86, "GPIO_86"), 199 + PINCTRL_PIN(87, "GPIO_87"), 200 + PINCTRL_PIN(88, "GPIO_88"), 201 + PINCTRL_PIN(89, "GPIO_89"), 202 + PINCTRL_PIN(90, "GPIO_90"), 203 + PINCTRL_PIN(91, "GPIO_91"), 204 + PINCTRL_PIN(92, "GPIO_92"), 205 + PINCTRL_PIN(93, "GPIO_93"), 206 + PINCTRL_PIN(94, "GPIO_94"), 207 + PINCTRL_PIN(95, "GPIO_95"), 208 + PINCTRL_PIN(96, "GPIO_96"), 209 + PINCTRL_PIN(97, "GPIO_97"), 210 + PINCTRL_PIN(98, "GPIO_98"), 211 + PINCTRL_PIN(99, "GPIO_99"), 212 + PINCTRL_PIN(100, "GPIO_100"), 213 + PINCTRL_PIN(101, "GPIO_101"), 214 + PINCTRL_PIN(102, "GPIO_102"), 215 + PINCTRL_PIN(103, "GPIO_103"), 216 + PINCTRL_PIN(104, "GPIO_104"), 217 + PINCTRL_PIN(105, "GPIO_105"), 218 + PINCTRL_PIN(106, "GPIO_106"), 219 + PINCTRL_PIN(107, "GPIO_107"), 220 + PINCTRL_PIN(108, "UFS_RESET"), 221 + PINCTRL_PIN(109, "SDC1_RCLK"), 222 + PINCTRL_PIN(110, "SDC1_CLK"), 223 + PINCTRL_PIN(111, "SDC1_CMD"), 224 + PINCTRL_PIN(112, "SDC1_DATA"), 225 + }; 226 + 227 + #define DECLARE_MSM_GPIO_PINS(pin) \ 228 + static const unsigned int gpio##pin##_pins[] = { pin } 229 + DECLARE_MSM_GPIO_PINS(0); 230 + DECLARE_MSM_GPIO_PINS(1); 231 + DECLARE_MSM_GPIO_PINS(2); 232 + DECLARE_MSM_GPIO_PINS(3); 233 + DECLARE_MSM_GPIO_PINS(4); 234 + DECLARE_MSM_GPIO_PINS(5); 235 + DECLARE_MSM_GPIO_PINS(6); 236 + DECLARE_MSM_GPIO_PINS(7); 237 + DECLARE_MSM_GPIO_PINS(8); 238 + DECLARE_MSM_GPIO_PINS(9); 239 + DECLARE_MSM_GPIO_PINS(10); 240 + DECLARE_MSM_GPIO_PINS(11); 241 + DECLARE_MSM_GPIO_PINS(12); 242 + DECLARE_MSM_GPIO_PINS(13); 243 + DECLARE_MSM_GPIO_PINS(14); 244 + DECLARE_MSM_GPIO_PINS(15); 245 + DECLARE_MSM_GPIO_PINS(16); 246 + DECLARE_MSM_GPIO_PINS(17); 247 + DECLARE_MSM_GPIO_PINS(18); 248 + DECLARE_MSM_GPIO_PINS(19); 249 + DECLARE_MSM_GPIO_PINS(20); 250 + DECLARE_MSM_GPIO_PINS(21); 251 + DECLARE_MSM_GPIO_PINS(22); 252 + DECLARE_MSM_GPIO_PINS(23); 253 + DECLARE_MSM_GPIO_PINS(24); 254 + DECLARE_MSM_GPIO_PINS(25); 255 + DECLARE_MSM_GPIO_PINS(26); 256 + DECLARE_MSM_GPIO_PINS(27); 257 + DECLARE_MSM_GPIO_PINS(28); 258 + DECLARE_MSM_GPIO_PINS(29); 259 + DECLARE_MSM_GPIO_PINS(30); 260 + DECLARE_MSM_GPIO_PINS(31); 261 + DECLARE_MSM_GPIO_PINS(32); 262 + DECLARE_MSM_GPIO_PINS(33); 263 + DECLARE_MSM_GPIO_PINS(34); 264 + DECLARE_MSM_GPIO_PINS(35); 265 + DECLARE_MSM_GPIO_PINS(36); 266 + DECLARE_MSM_GPIO_PINS(37); 267 + DECLARE_MSM_GPIO_PINS(38); 268 + DECLARE_MSM_GPIO_PINS(39); 269 + DECLARE_MSM_GPIO_PINS(40); 270 + DECLARE_MSM_GPIO_PINS(41); 271 + DECLARE_MSM_GPIO_PINS(42); 272 + DECLARE_MSM_GPIO_PINS(43); 273 + DECLARE_MSM_GPIO_PINS(44); 274 + DECLARE_MSM_GPIO_PINS(45); 275 + DECLARE_MSM_GPIO_PINS(46); 276 + DECLARE_MSM_GPIO_PINS(47); 277 + DECLARE_MSM_GPIO_PINS(48); 278 + DECLARE_MSM_GPIO_PINS(49); 279 + DECLARE_MSM_GPIO_PINS(50); 280 + DECLARE_MSM_GPIO_PINS(51); 281 + DECLARE_MSM_GPIO_PINS(52); 282 + DECLARE_MSM_GPIO_PINS(53); 283 + DECLARE_MSM_GPIO_PINS(54); 284 + DECLARE_MSM_GPIO_PINS(55); 285 + DECLARE_MSM_GPIO_PINS(56); 286 + DECLARE_MSM_GPIO_PINS(57); 287 + DECLARE_MSM_GPIO_PINS(58); 288 + DECLARE_MSM_GPIO_PINS(59); 289 + DECLARE_MSM_GPIO_PINS(60); 290 + DECLARE_MSM_GPIO_PINS(61); 291 + DECLARE_MSM_GPIO_PINS(62); 292 + DECLARE_MSM_GPIO_PINS(63); 293 + DECLARE_MSM_GPIO_PINS(64); 294 + DECLARE_MSM_GPIO_PINS(65); 295 + DECLARE_MSM_GPIO_PINS(66); 296 + DECLARE_MSM_GPIO_PINS(67); 297 + DECLARE_MSM_GPIO_PINS(68); 298 + DECLARE_MSM_GPIO_PINS(69); 299 + DECLARE_MSM_GPIO_PINS(70); 300 + DECLARE_MSM_GPIO_PINS(71); 301 + DECLARE_MSM_GPIO_PINS(72); 302 + DECLARE_MSM_GPIO_PINS(73); 303 + DECLARE_MSM_GPIO_PINS(74); 304 + DECLARE_MSM_GPIO_PINS(75); 305 + DECLARE_MSM_GPIO_PINS(76); 306 + DECLARE_MSM_GPIO_PINS(77); 307 + DECLARE_MSM_GPIO_PINS(78); 308 + DECLARE_MSM_GPIO_PINS(79); 309 + DECLARE_MSM_GPIO_PINS(80); 310 + DECLARE_MSM_GPIO_PINS(81); 311 + DECLARE_MSM_GPIO_PINS(82); 312 + DECLARE_MSM_GPIO_PINS(83); 313 + DECLARE_MSM_GPIO_PINS(84); 314 + DECLARE_MSM_GPIO_PINS(85); 315 + DECLARE_MSM_GPIO_PINS(86); 316 + DECLARE_MSM_GPIO_PINS(87); 317 + DECLARE_MSM_GPIO_PINS(88); 318 + DECLARE_MSM_GPIO_PINS(89); 319 + DECLARE_MSM_GPIO_PINS(90); 320 + DECLARE_MSM_GPIO_PINS(91); 321 + DECLARE_MSM_GPIO_PINS(92); 322 + DECLARE_MSM_GPIO_PINS(93); 323 + DECLARE_MSM_GPIO_PINS(94); 324 + DECLARE_MSM_GPIO_PINS(95); 325 + DECLARE_MSM_GPIO_PINS(96); 326 + DECLARE_MSM_GPIO_PINS(97); 327 + DECLARE_MSM_GPIO_PINS(98); 328 + DECLARE_MSM_GPIO_PINS(99); 329 + DECLARE_MSM_GPIO_PINS(100); 330 + DECLARE_MSM_GPIO_PINS(101); 331 + DECLARE_MSM_GPIO_PINS(102); 332 + DECLARE_MSM_GPIO_PINS(103); 333 + DECLARE_MSM_GPIO_PINS(104); 334 + DECLARE_MSM_GPIO_PINS(105); 335 + DECLARE_MSM_GPIO_PINS(106); 336 + DECLARE_MSM_GPIO_PINS(107); 337 + 338 + static const unsigned int ufs_reset_pins[] = { 108 }; 339 + static const unsigned int sdc1_rclk_pins[] = { 109 }; 340 + static const unsigned int sdc1_clk_pins[] = { 110 }; 341 + static const unsigned int sdc1_cmd_pins[] = { 111 }; 342 + static const unsigned int sdc1_data_pins[] = { 112 }; 343 + 344 + enum sdx65_functions { 345 + msm_mux_qlink0_wmss, 346 + msm_mux_adsp_ext, 347 + msm_mux_atest_char, 348 + msm_mux_atest_char0, 349 + msm_mux_atest_char1, 350 + msm_mux_atest_char2, 351 + msm_mux_atest_char3, 352 + msm_mux_audio_ref, 353 + msm_mux_bimc_dte0, 354 + msm_mux_bimc_dte1, 355 + msm_mux_blsp_i2c1, 356 + msm_mux_blsp_i2c2, 357 + msm_mux_blsp_i2c3, 358 + msm_mux_blsp_i2c4, 359 + msm_mux_blsp_spi1, 360 + msm_mux_blsp_spi2, 361 + msm_mux_blsp_spi3, 362 + msm_mux_blsp_spi4, 363 + msm_mux_blsp_uart1, 364 + msm_mux_blsp_uart2, 365 + msm_mux_blsp_uart3, 366 + msm_mux_blsp_uart4, 367 + msm_mux_char_exec, 368 + msm_mux_coex_uart, 369 + msm_mux_coex_uart2, 370 + msm_mux_cri_trng, 371 + msm_mux_cri_trng0, 372 + msm_mux_cri_trng1, 373 + msm_mux_dbg_out, 374 + msm_mux_ddr_bist, 375 + msm_mux_ddr_pxi0, 376 + msm_mux_ebi0_wrcdc, 377 + msm_mux_ebi2_a, 378 + msm_mux_ebi2_lcd, 379 + msm_mux_ext_dbg, 380 + msm_mux_gcc_gp1, 381 + msm_mux_gcc_gp2, 382 + msm_mux_gcc_gp3, 383 + msm_mux_gcc_plltest, 384 + msm_mux_gpio, 385 + msm_mux_i2s_mclk, 386 + msm_mux_jitter_bist, 387 + msm_mux_ldo_en, 388 + msm_mux_ldo_update, 389 + msm_mux_m_voc, 390 + msm_mux_mgpi_clk, 391 + msm_mux_native_char, 392 + msm_mux_native_tsens, 393 + msm_mux_native_tsense, 394 + msm_mux_nav_gpio, 395 + msm_mux_pa_indicator, 396 + msm_mux_pci_e, 397 + msm_mux_pcie_clkreq, 398 + msm_mux_pll_bist, 399 + msm_mux_pll_ref, 400 + msm_mux_pri_mi2s, 401 + msm_mux_pri_mi2s_ws, 402 + msm_mux_prng_rosc, 403 + msm_mux_qdss_cti, 404 + msm_mux_qdss_gpio, 405 + msm_mux_qlink0_en, 406 + msm_mux_qlink0_req, 407 + msm_mux_qlink1_en, 408 + msm_mux_qlink1_req, 409 + msm_mux_qlink1_wmss, 410 + msm_mux_qlink2_en, 411 + msm_mux_qlink2_req, 412 + msm_mux_qlink2_wmss, 413 + msm_mux_sdc1_tb, 414 + msm_mux_sec_mi2s, 415 + msm_mux_spmi_coex, 416 + msm_mux_spmi_vgi, 417 + msm_mux_tgu_ch0, 418 + msm_mux_uim1_clk, 419 + msm_mux_uim1_data, 420 + msm_mux_uim1_present, 421 + msm_mux_uim1_reset, 422 + msm_mux_uim2_clk, 423 + msm_mux_uim2_data, 424 + msm_mux_uim2_present, 425 + msm_mux_uim2_reset, 426 + msm_mux_usb2phy_ac, 427 + msm_mux_vsense_trigger, 428 + msm_mux__, 429 + }; 430 + 431 + static const char * const gpio_groups[] = { 432 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 433 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 434 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 435 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 436 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 437 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 438 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 439 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 440 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 441 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 442 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 443 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 444 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 445 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 446 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 447 + "gpio105", "gpio106", "gpio107", 448 + }; 449 + static const char * const uim2_data_groups[] = { 450 + "gpio0", 451 + }; 452 + static const char * const blsp_uart1_groups[] = { 453 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio48", "gpio49", "gpio80", 454 + "gpio81", 455 + }; 456 + static const char * const ebi0_wrcdc_groups[] = { 457 + "gpio0", "gpio2", 458 + }; 459 + static const char * const uim2_present_groups[] = { 460 + "gpio1", 461 + }; 462 + static const char * const uim2_reset_groups[] = { 463 + "gpio2", 464 + }; 465 + static const char * const blsp_i2c1_groups[] = { 466 + "gpio2", "gpio3", "gpio82", "gpio83", 467 + }; 468 + static const char * const uim2_clk_groups[] = { 469 + "gpio3", 470 + }; 471 + static const char * const blsp_spi2_groups[] = { 472 + "gpio4", "gpio5", "gpio6", "gpio7", "gpio23", "gpio47", "gpio62", 473 + }; 474 + static const char * const blsp_uart2_groups[] = { 475 + "gpio4", "gpio5", "gpio6", "gpio7", "gpio63", "gpio64", "gpio65", 476 + "gpio66", 477 + }; 478 + static const char * const blsp_i2c2_groups[] = { 479 + "gpio6", "gpio7", "gpio65", "gpio66", 480 + }; 481 + static const char * const char_exec_groups[] = { 482 + "gpio6", "gpio7", 483 + }; 484 + static const char * const qdss_gpio_groups[] = { 485 + "gpio4", "gpio5", "gpio6", "gpio7", "gpio12", "gpio13", 486 + "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", 487 + "gpio33", "gpio42", "gpio63", "gpio64", "gpio65", "gpio66", 488 + }; 489 + static const char * const blsp_spi3_groups[] = { 490 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio23", "gpio47", "gpio62", 491 + }; 492 + static const char * const blsp_uart3_groups[] = { 493 + "gpio8", "gpio9", "gpio10", "gpio11", 494 + }; 495 + static const char * const ext_dbg_groups[] = { 496 + "gpio8", "gpio9", "gpio10", "gpio11", 497 + }; 498 + static const char * const ldo_en_groups[] = { 499 + "gpio8", 500 + }; 501 + static const char * const blsp_i2c3_groups[] = { 502 + "gpio10", "gpio11", 503 + }; 504 + static const char * const gcc_gp3_groups[] = { 505 + "gpio11", 506 + }; 507 + static const char * const pri_mi2s_ws_groups[] = { 508 + "gpio12", 509 + }; 510 + static const char * const pri_mi2s_groups[] = { 511 + "gpio13", "gpio14", "gpio15", 512 + }; 513 + static const char * const vsense_trigger_groups[] = { 514 + "gpio13", 515 + }; 516 + static const char * const native_tsens_groups[] = { 517 + "gpio14", 518 + }; 519 + static const char * const bimc_dte0_groups[] = { 520 + "gpio14", "gpio59", 521 + }; 522 + static const char * const bimc_dte1_groups[] = { 523 + "gpio15", "gpio61", 524 + }; 525 + static const char * const sec_mi2s_groups[] = { 526 + "gpio16", "gpio17", "gpio18", "gpio19", 527 + }; 528 + static const char * const blsp_spi4_groups[] = { 529 + "gpio16", "gpio17", "gpio18", "gpio19", "gpio23", "gpio47", "gpio62", 530 + }; 531 + static const char * const blsp_uart4_groups[] = { 532 + "gpio16", "gpio17", "gpio18", "gpio19", "gpio22", "gpio23", "gpio48", 533 + "gpio49", 534 + }; 535 + static const char * const qdss_cti_groups[] = { 536 + "gpio16", "gpio16", "gpio17", "gpio17", "gpio54", "gpio54", "gpio55", 537 + "gpio55", "gpio59", "gpio60", "gpio65", "gpio65", "gpio66", "gpio66", 538 + "gpio94", "gpio94", "gpio95", "gpio95", 539 + }; 540 + static const char * const blsp_i2c4_groups[] = { 541 + "gpio18", "gpio19", "gpio84", "gpio85", 542 + }; 543 + static const char * const gcc_gp1_groups[] = { 544 + "gpio18", 545 + }; 546 + static const char * const jitter_bist_groups[] = { 547 + "gpio19", 548 + }; 549 + static const char * const gcc_gp2_groups[] = { 550 + "gpio19", 551 + }; 552 + static const char * const pll_bist_groups[] = { 553 + "gpio22", 554 + }; 555 + static const char * const blsp_spi1_groups[] = { 556 + "gpio23", "gpio47", "gpio62", "gpio80", "gpio81", "gpio82", "gpio83", 557 + }; 558 + static const char * const adsp_ext_groups[] = { 559 + "gpio24", "gpio25", 560 + }; 561 + static const char * const qlink0_wmss_groups[] = { 562 + "gpio28", 563 + }; 564 + static const char * const native_tsense_groups[] = { 565 + "gpio29", "gpio72", 566 + }; 567 + static const char * const nav_gpio_groups[] = { 568 + "gpio31", "gpio32", 569 + }; 570 + static const char * const pll_ref_groups[] = { 571 + "gpio32", 572 + }; 573 + static const char * const pa_indicator_groups[] = { 574 + "gpio33", 575 + }; 576 + static const char * const qlink0_en_groups[] = { 577 + "gpio34", 578 + }; 579 + static const char * const qlink0_req_groups[] = { 580 + "gpio35", 581 + }; 582 + static const char * const dbg_out_groups[] = { 583 + "gpio35", 584 + }; 585 + static const char * const cri_trng_groups[] = { 586 + "gpio36", 587 + }; 588 + static const char * const prng_rosc_groups[] = { 589 + "gpio38", 590 + }; 591 + static const char * const cri_trng0_groups[] = { 592 + "gpio40", 593 + }; 594 + static const char * const cri_trng1_groups[] = { 595 + "gpio41", 596 + }; 597 + static const char * const coex_uart_groups[] = { 598 + "gpio44", "gpio45", 599 + }; 600 + static const char * const ddr_pxi0_groups[] = { 601 + "gpio45", "gpio46", 602 + }; 603 + static const char * const m_voc_groups[] = { 604 + "gpio46", "gpio48", "gpio49", "gpio59", "gpio60", 605 + }; 606 + static const char * const ddr_bist_groups[] = { 607 + "gpio46", "gpio47", "gpio48", "gpio49", 608 + }; 609 + static const char * const pci_e_groups[] = { 610 + "gpio53", 611 + }; 612 + static const char * const tgu_ch0_groups[] = { 613 + "gpio55", 614 + }; 615 + static const char * const pcie_clkreq_groups[] = { 616 + "gpio56", 617 + }; 618 + static const char * const native_char_groups[] = { 619 + "gpio26", "gpio29", "gpio33", "gpio42", "gpio57", 620 + }; 621 + static const char * const mgpi_clk_groups[] = { 622 + "gpio61", "gpio71", 623 + }; 624 + static const char * const qlink2_wmss_groups[] = { 625 + "gpio61", 626 + }; 627 + static const char * const i2s_mclk_groups[] = { 628 + "gpio62", 629 + }; 630 + static const char * const audio_ref_groups[] = { 631 + "gpio62", 632 + }; 633 + static const char * const ldo_update_groups[] = { 634 + "gpio62", 635 + }; 636 + static const char * const atest_char_groups[] = { 637 + "gpio63", 638 + }; 639 + static const char * const atest_char3_groups[] = { 640 + "gpio64", 641 + }; 642 + static const char * const atest_char2_groups[] = { 643 + "gpio65", 644 + }; 645 + static const char * const atest_char1_groups[] = { 646 + "gpio66", 647 + }; 648 + static const char * const uim1_data_groups[] = { 649 + "gpio67", 650 + }; 651 + static const char * const atest_char0_groups[] = { 652 + "gpio67", 653 + }; 654 + static const char * const uim1_present_groups[] = { 655 + "gpio68", 656 + }; 657 + static const char * const uim1_reset_groups[] = { 658 + "gpio69", 659 + }; 660 + static const char * const uim1_clk_groups[] = { 661 + "gpio70", 662 + }; 663 + static const char * const qlink2_en_groups[] = { 664 + "gpio71", 665 + }; 666 + static const char * const qlink1_en_groups[] = { 667 + "gpio72", 668 + }; 669 + static const char * const qlink1_req_groups[] = { 670 + "gpio73", 671 + }; 672 + static const char * const qlink1_wmss_groups[] = { 673 + "gpio74", 674 + }; 675 + static const char * const coex_uart2_groups[] = { 676 + "gpio75", "gpio76", "gpio102", "gpio103", 677 + }; 678 + static const char * const spmi_coex_groups[] = { 679 + "gpio75", "gpio76", 680 + }; 681 + static const char * const qlink2_req_groups[] = { 682 + "gpio77", 683 + }; 684 + static const char * const spmi_vgi_groups[] = { 685 + "gpio78", "gpio79", 686 + }; 687 + static const char * const gcc_plltest_groups[] = { 688 + "gpio81", "gpio82", 689 + }; 690 + static const char * const ebi2_lcd_groups[] = { 691 + "gpio84", "gpio85", "gpio90", 692 + }; 693 + static const char * const ebi2_a_groups[] = { 694 + "gpio89", 695 + }; 696 + static const char * const usb2phy_ac_groups[] = { 697 + "gpio93", 698 + }; 699 + static const char * const sdc1_tb_groups[] = { 700 + "gpio106", 701 + }; 702 + 703 + static const struct msm_function sdx65_functions[] = { 704 + FUNCTION(qlink0_wmss), 705 + FUNCTION(adsp_ext), 706 + FUNCTION(atest_char), 707 + FUNCTION(atest_char0), 708 + FUNCTION(atest_char1), 709 + FUNCTION(atest_char2), 710 + FUNCTION(atest_char3), 711 + FUNCTION(audio_ref), 712 + FUNCTION(bimc_dte0), 713 + FUNCTION(bimc_dte1), 714 + FUNCTION(blsp_i2c1), 715 + FUNCTION(blsp_i2c2), 716 + FUNCTION(blsp_i2c3), 717 + FUNCTION(blsp_i2c4), 718 + FUNCTION(blsp_spi1), 719 + FUNCTION(blsp_spi2), 720 + FUNCTION(blsp_spi3), 721 + FUNCTION(blsp_spi4), 722 + FUNCTION(blsp_uart1), 723 + FUNCTION(blsp_uart2), 724 + FUNCTION(blsp_uart3), 725 + FUNCTION(blsp_uart4), 726 + FUNCTION(char_exec), 727 + FUNCTION(coex_uart), 728 + FUNCTION(coex_uart2), 729 + FUNCTION(cri_trng), 730 + FUNCTION(cri_trng0), 731 + FUNCTION(cri_trng1), 732 + FUNCTION(dbg_out), 733 + FUNCTION(ddr_bist), 734 + FUNCTION(ddr_pxi0), 735 + FUNCTION(ebi0_wrcdc), 736 + FUNCTION(ebi2_a), 737 + FUNCTION(ebi2_lcd), 738 + FUNCTION(ext_dbg), 739 + FUNCTION(gcc_gp1), 740 + FUNCTION(gcc_gp2), 741 + FUNCTION(gcc_gp3), 742 + FUNCTION(gcc_plltest), 743 + FUNCTION(gpio), 744 + FUNCTION(i2s_mclk), 745 + FUNCTION(jitter_bist), 746 + FUNCTION(ldo_en), 747 + FUNCTION(ldo_update), 748 + FUNCTION(m_voc), 749 + FUNCTION(mgpi_clk), 750 + FUNCTION(native_char), 751 + FUNCTION(native_tsens), 752 + FUNCTION(native_tsense), 753 + FUNCTION(nav_gpio), 754 + FUNCTION(pa_indicator), 755 + FUNCTION(pci_e), 756 + FUNCTION(pcie_clkreq), 757 + FUNCTION(pll_bist), 758 + FUNCTION(pll_ref), 759 + FUNCTION(pri_mi2s), 760 + FUNCTION(pri_mi2s_ws), 761 + FUNCTION(prng_rosc), 762 + FUNCTION(qdss_cti), 763 + FUNCTION(qdss_gpio), 764 + FUNCTION(qlink0_en), 765 + FUNCTION(qlink0_req), 766 + FUNCTION(qlink1_en), 767 + FUNCTION(qlink1_req), 768 + FUNCTION(qlink1_wmss), 769 + FUNCTION(qlink2_en), 770 + FUNCTION(qlink2_req), 771 + FUNCTION(qlink2_wmss), 772 + FUNCTION(sdc1_tb), 773 + FUNCTION(sec_mi2s), 774 + FUNCTION(spmi_coex), 775 + FUNCTION(spmi_vgi), 776 + FUNCTION(tgu_ch0), 777 + FUNCTION(uim1_clk), 778 + FUNCTION(uim1_data), 779 + FUNCTION(uim1_present), 780 + FUNCTION(uim1_reset), 781 + FUNCTION(uim2_clk), 782 + FUNCTION(uim2_data), 783 + FUNCTION(uim2_present), 784 + FUNCTION(uim2_reset), 785 + FUNCTION(usb2phy_ac), 786 + FUNCTION(vsense_trigger), 787 + }; 788 + 789 + /* Every pin is maintained as a single group, and missing or non-existing pin 790 + * would be maintained as dummy group to synchronize pin group index with 791 + * pin descriptor registered with pinctrl core. 792 + * Clients would not be able to request these dummy pin groups. 793 + */ 794 + static const struct msm_pingroup sdx65_groups[] = { 795 + [0] = PINGROUP(0, uim2_data, blsp_uart1, ebi0_wrcdc, _, _, _, _, _, _), 796 + [1] = PINGROUP(1, uim2_present, blsp_uart1, _, _, _, _, _, _, _), 797 + [2] = PINGROUP(2, uim2_reset, blsp_uart1, blsp_i2c1, ebi0_wrcdc, _, _, _, _, _), 798 + [3] = PINGROUP(3, uim2_clk, blsp_uart1, blsp_i2c1, _, _, _, _, _, _), 799 + [4] = PINGROUP(4, blsp_spi2, blsp_uart2, _, qdss_gpio, _, _, _, _, _), 800 + [5] = PINGROUP(5, blsp_spi2, blsp_uart2, _, qdss_gpio, _, _, _, _, _), 801 + [6] = PINGROUP(6, blsp_spi2, blsp_uart2, blsp_i2c2, char_exec, _, qdss_gpio, _, _, _), 802 + [7] = PINGROUP(7, blsp_spi2, blsp_uart2, blsp_i2c2, char_exec, _, qdss_gpio, _, _, _), 803 + [8] = PINGROUP(8, blsp_spi3, blsp_uart3, ext_dbg, ldo_en, _, _, _, _, _), 804 + [9] = PINGROUP(9, blsp_spi3, blsp_uart3, ext_dbg, _, _, _, _, _, _), 805 + [10] = PINGROUP(10, blsp_spi3, blsp_uart3, blsp_i2c3, ext_dbg, _, _, _, _, _), 806 + [11] = PINGROUP(11, blsp_spi3, blsp_uart3, blsp_i2c3, ext_dbg, gcc_gp3, _, _, _, _), 807 + [12] = PINGROUP(12, pri_mi2s_ws, _, qdss_gpio, _, _, _, _, _, _), 808 + [13] = PINGROUP(13, pri_mi2s, _, qdss_gpio, vsense_trigger, _, _, _, _, _), 809 + [14] = PINGROUP(14, pri_mi2s, _, _, qdss_gpio, native_tsens, bimc_dte0, _, _, _), 810 + [15] = PINGROUP(15, pri_mi2s, _, _, qdss_gpio, bimc_dte1, _, _, _, _), 811 + [16] = PINGROUP(16, sec_mi2s, blsp_spi4, blsp_uart4, qdss_cti, qdss_cti, _, _, qdss_gpio, _), 812 + [17] = PINGROUP(17, sec_mi2s, blsp_spi4, blsp_uart4, qdss_cti, qdss_cti, _, qdss_gpio, _, _), 813 + [18] = PINGROUP(18, sec_mi2s, blsp_spi4, blsp_uart4, blsp_i2c4, gcc_gp1, qdss_gpio, _, _, _), 814 + [19] = PINGROUP(19, sec_mi2s, blsp_spi4, blsp_uart4, blsp_i2c4, jitter_bist, gcc_gp2, _, qdss_gpio, _), 815 + [20] = PINGROUP(20, _, _, _, _, _, _, _, _, _), 816 + [21] = PINGROUP(21, _, _, _, _, _, _, _, _, _), 817 + [22] = PINGROUP(22, blsp_uart4, pll_bist, _, _, _, _, _, _, _), 818 + [23] = PINGROUP(23, blsp_uart4, blsp_spi2, blsp_spi1, blsp_spi3, blsp_spi4, _, _, _, _), 819 + [24] = PINGROUP(24, adsp_ext, _, _, _, _, _, _, _, _), 820 + [25] = PINGROUP(25, adsp_ext, _, _, _, _, _, _, _, _), 821 + [26] = PINGROUP(26, _, _, _, native_char, _, _, _, _, _), 822 + [27] = PINGROUP(27, _, _, _, _, _, _, _, _, _), 823 + [28] = PINGROUP(28, qlink0_wmss, _, _, _, _, _, _, _, _), 824 + [29] = PINGROUP(29, _, _, _, native_tsense, native_char, _, _, _, _), 825 + [30] = PINGROUP(30, _, _, _, _, _, _, _, _, _), 826 + [31] = PINGROUP(31, nav_gpio, _, _, _, _, _, _, _, _), 827 + [32] = PINGROUP(32, nav_gpio, pll_ref, _, _, _, _, _, _, _), 828 + [33] = PINGROUP(33, _, pa_indicator, qdss_gpio, native_char, _, _, _, _, _), 829 + [34] = PINGROUP(34, qlink0_en, _, _, _, _, _, _, _, _), 830 + [35] = PINGROUP(35, qlink0_req, dbg_out, _, _, _, _, _, _, _), 831 + [36] = PINGROUP(36, _, _, cri_trng, _, _, _, _, _, _), 832 + [37] = PINGROUP(37, _, _, _, _, _, _, _, _, _), 833 + [38] = PINGROUP(38, _, _, prng_rosc, _, _, _, _, _, _), 834 + [39] = PINGROUP(39, _, _, _, _, _, _, _, _, _), 835 + [40] = PINGROUP(40, _, _, cri_trng0, _, _, _, _, _, _), 836 + [41] = PINGROUP(41, _, _, cri_trng1, _, _, _, _, _, _), 837 + [42] = PINGROUP(42, _, qdss_gpio, native_char, _, _, _, _, _, _), 838 + [43] = PINGROUP(43, _, _, _, _, _, _, _, _, _), 839 + [44] = PINGROUP(44, coex_uart, _, _, _, _, _, _, _, _), 840 + [45] = PINGROUP(45, coex_uart, ddr_pxi0, _, _, _, _, _, _, _), 841 + [46] = PINGROUP(46, m_voc, ddr_bist, ddr_pxi0, _, _, _, _, _, _), 842 + [47] = PINGROUP(47, ddr_bist, blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, _, _, _, _), 843 + [48] = PINGROUP(48, m_voc, blsp_uart1, blsp_uart4, ddr_bist, _, _, _, _, _), 844 + [49] = PINGROUP(49, m_voc, blsp_uart1, blsp_uart4, ddr_bist, _, _, _, _, _), 845 + [50] = PINGROUP(50, _, _, _, _, _, _, _, _, _), 846 + [51] = PINGROUP(51, _, _, _, _, _, _, _, _, _), 847 + [52] = PINGROUP(52, _, _, _, _, _, _, _, _, _), 848 + [53] = PINGROUP(53, pci_e, _, _, _, _, _, _, _, _), 849 + [54] = PINGROUP(54, qdss_cti, qdss_cti, _, _, _, _, _, _, _), 850 + [55] = PINGROUP(55, qdss_cti, qdss_cti, tgu_ch0, _, _, _, _, _, _), 851 + [56] = PINGROUP(56, pcie_clkreq, _, _, _, _, _, _, _, _), 852 + [57] = PINGROUP(57, _, native_char, _, _, _, _, _, _, _), 853 + [58] = PINGROUP(58, _, _, _, _, _, _, _, _, _), 854 + [59] = PINGROUP(59, qdss_cti, m_voc, bimc_dte0, _, _, _, _, _, _), 855 + [60] = PINGROUP(60, qdss_cti, _, m_voc, _, _, _, _, _, _), 856 + [61] = PINGROUP(61, mgpi_clk, qlink2_wmss, bimc_dte1, _, _, _, _, _, _), 857 + [62] = PINGROUP(62, i2s_mclk, audio_ref, blsp_spi1, blsp_spi2, blsp_spi3, blsp_spi4, ldo_update, _, _), 858 + [63] = PINGROUP(63, blsp_uart2, _, qdss_gpio, atest_char, _, _, _, _, _), 859 + [64] = PINGROUP(64, blsp_uart2, qdss_gpio, atest_char3, _, _, _, _, _, _), 860 + [65] = PINGROUP(65, blsp_uart2, blsp_i2c2, qdss_cti, qdss_cti, _, qdss_gpio, atest_char2, _, _), 861 + [66] = PINGROUP(66, blsp_uart2, blsp_i2c2, qdss_cti, qdss_cti, qdss_gpio, atest_char1, _, _, _), 862 + [67] = PINGROUP(67, uim1_data, atest_char0, _, _, _, _, _, _, _), 863 + [68] = PINGROUP(68, uim1_present, _, _, _, _, _, _, _, _), 864 + [69] = PINGROUP(69, uim1_reset, _, _, _, _, _, _, _, _), 865 + [70] = PINGROUP(70, uim1_clk, _, _, _, _, _, _, _, _), 866 + [71] = PINGROUP(71, mgpi_clk, qlink2_en, _, _, _, _, _, _, _), 867 + [72] = PINGROUP(72, qlink1_en, _, native_tsense, _, _, _, _, _, _), 868 + [73] = PINGROUP(73, qlink1_req, _, _, _, _, _, _, _, _), 869 + [74] = PINGROUP(74, qlink1_wmss, _, _, _, _, _, _, _, _), 870 + [75] = PINGROUP(75, coex_uart2, spmi_coex, _, _, _, _, _, _, _), 871 + [76] = PINGROUP(76, coex_uart2, spmi_coex, _, _, _, _, _, _, _), 872 + [77] = PINGROUP(77, _, qlink2_req, _, _, _, _, _, _, _), 873 + [78] = PINGROUP(78, spmi_vgi, _, _, _, _, _, _, _, _), 874 + [79] = PINGROUP(79, spmi_vgi, _, _, _, _, _, _, _, _), 875 + [80] = PINGROUP(80, _, blsp_spi1, _, blsp_uart1, _, _, _, _, _), 876 + [81] = PINGROUP(81, _, blsp_spi1, _, blsp_uart1, gcc_plltest, _, _, _, _), 877 + [82] = PINGROUP(82, _, blsp_spi1, _, blsp_i2c1, gcc_plltest, _, _, _, _), 878 + [83] = PINGROUP(83, _, blsp_spi1, _, blsp_i2c1, _, _, _, _, _), 879 + [84] = PINGROUP(84, _, ebi2_lcd, _, blsp_i2c4, _, _, _, _, _), 880 + [85] = PINGROUP(85, _, ebi2_lcd, _, blsp_i2c4, _, _, _, _, _), 881 + [86] = PINGROUP(86, _, _, _, _, _, _, _, _, _), 882 + [87] = PINGROUP(87, _, _, _, _, _, _, _, _, _), 883 + [88] = PINGROUP(88, _, _, _, _, _, _, _, _, _), 884 + [89] = PINGROUP(89, _, _, _, _, ebi2_a, _, _, _, _), 885 + [90] = PINGROUP(90, _, _, _, _, ebi2_lcd, _, _, _, _), 886 + [91] = PINGROUP(91, _, _, _, _, _, _, _, _, _), 887 + [92] = PINGROUP(92, _, _, _, _, _, _, _, _, _), 888 + [93] = PINGROUP(93, _, _, usb2phy_ac, _, _, _, _, _, _), 889 + [94] = PINGROUP(94, qdss_cti, qdss_cti, _, _, _, _, _, _, _), 890 + [95] = PINGROUP(95, qdss_cti, qdss_cti, _, _, _, _, _, _, _), 891 + [96] = PINGROUP(96, _, _, _, _, _, _, _, _, _), 892 + [97] = PINGROUP(97, _, _, _, _, _, _, _, _, _), 893 + [98] = PINGROUP(98, _, _, _, _, _, _, _, _, _), 894 + [99] = PINGROUP(99, _, _, _, _, _, _, _, _, _), 895 + [100] = PINGROUP(100, _, _, _, _, _, _, _, _, _), 896 + [101] = PINGROUP(101, _, _, _, _, _, _, _, _, _), 897 + [102] = PINGROUP(102, _, _, coex_uart2, _, _, _, _, _, _), 898 + [103] = PINGROUP(103, _, _, coex_uart2, _, _, _, _, _, _), 899 + [104] = PINGROUP(104, _, _, _, _, _, _, _, _, _), 900 + [105] = PINGROUP(105, _, _, _, _, _, _, _, _, _), 901 + [106] = PINGROUP(106, sdc1_tb, _, _, _, _, _, _, _, _), 902 + [107] = PINGROUP(107, _, _, _, _, _, _, _, _, _), 903 + [108] = UFS_RESET(ufs_reset, 0x0), 904 + [109] = SDC_QDSD_PINGROUP(sdc1_rclk, 0x9a000, 15, 0), 905 + [110] = SDC_QDSD_PINGROUP(sdc1_clk, 0x9a000, 13, 6), 906 + [111] = SDC_QDSD_PINGROUP(sdc1_cmd, 0x9a000, 11, 3), 907 + [112] = SDC_QDSD_PINGROUP(sdc1_data, 0x9a000, 9, 0), 908 + }; 909 + 910 + static const struct msm_gpio_wakeirq_map sdx65_pdc_map[] = { 911 + {1, 20}, {2, 21}, {5, 22}, {6, 23}, {9, 24}, {10, 25}, 912 + {11, 26}, {12, 27}, {13, 28}, {14, 29}, {15, 30}, {16, 31}, 913 + {17, 32}, {18, 33}, {19, 34}, {21, 35}, {22, 36}, {23, 70}, 914 + {24, 37}, {25, 38}, {35, 40}, {43, 41}, {46, 44}, {48, 45}, 915 + {49, 57}, {50, 46}, {52, 47}, {54, 49}, {55, 50}, {60, 53}, 916 + {61, 54}, {64, 55}, {65, 81}, {68, 56}, {71, 58}, {73, 59}, 917 + {77, 77}, {81, 65}, {83, 63}, {84, 64}, {86, 66}, {88, 67}, 918 + {89, 68}, {90, 69}, {93, 71}, {94, 72}, {95, 73}, {96, 74}, 919 + {99, 75}, {103, 78}, {104, 79} 920 + }; 921 + 922 + static const struct msm_pinctrl_soc_data sdx65_pinctrl = { 923 + .pins = sdx65_pins, 924 + .npins = ARRAY_SIZE(sdx65_pins), 925 + .functions = sdx65_functions, 926 + .nfunctions = ARRAY_SIZE(sdx65_functions), 927 + .groups = sdx65_groups, 928 + .ngroups = ARRAY_SIZE(sdx65_groups), 929 + .ngpios = 109, 930 + .wakeirq_map = sdx65_pdc_map, 931 + .nwakeirq_map = ARRAY_SIZE(sdx65_pdc_map), 932 + }; 933 + 934 + static int sdx65_pinctrl_probe(struct platform_device *pdev) 935 + { 936 + return msm_pinctrl_probe(pdev, &sdx65_pinctrl); 937 + } 938 + 939 + static const struct of_device_id sdx65_pinctrl_of_match[] = { 940 + { .compatible = "qcom,sdx65-tlmm", }, 941 + { }, 942 + }; 943 + 944 + static struct platform_driver sdx65_pinctrl_driver = { 945 + .driver = { 946 + .name = "sdx65-tlmm", 947 + .of_match_table = sdx65_pinctrl_of_match, 948 + }, 949 + .probe = sdx65_pinctrl_probe, 950 + .remove = msm_pinctrl_remove, 951 + }; 952 + 953 + static int __init sdx65_pinctrl_init(void) 954 + { 955 + return platform_driver_register(&sdx65_pinctrl_driver); 956 + } 957 + arch_initcall(sdx65_pinctrl_init); 958 + 959 + static void __exit sdx65_pinctrl_exit(void) 960 + { 961 + platform_driver_unregister(&sdx65_pinctrl_driver); 962 + } 963 + module_exit(sdx65_pinctrl_exit); 964 + 965 + MODULE_DESCRIPTION("QTI sdx65 pinctrl driver"); 966 + MODULE_LICENSE("GPL v2"); 967 + MODULE_DEVICE_TABLE(of, sdx65_pinctrl_of_match);
+1689
drivers/pinctrl/qcom/pinctrl-sm8450.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2021, Linaro Limited 5 + */ 6 + 7 + #include <linux/module.h> 8 + #include <linux/of.h> 9 + #include <linux/platform_device.h> 10 + #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_SIZE 0x1000 22 + 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_SIZE * id, \ 42 + .io_reg = 0x4 + REG_SIZE * id, \ 43 + .intr_cfg_reg = 0x8 + REG_SIZE * id, \ 44 + .intr_status_reg = 0xc + REG_SIZE * id, \ 45 + .intr_target_reg = 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 = 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 + static const struct pinctrl_pin_desc sm8450_pins[] = { 113 + PINCTRL_PIN(0, "GPIO_0"), 114 + PINCTRL_PIN(1, "GPIO_1"), 115 + PINCTRL_PIN(2, "GPIO_2"), 116 + PINCTRL_PIN(3, "GPIO_3"), 117 + PINCTRL_PIN(4, "GPIO_4"), 118 + PINCTRL_PIN(5, "GPIO_5"), 119 + PINCTRL_PIN(6, "GPIO_6"), 120 + PINCTRL_PIN(7, "GPIO_7"), 121 + PINCTRL_PIN(8, "GPIO_8"), 122 + PINCTRL_PIN(9, "GPIO_9"), 123 + PINCTRL_PIN(10, "GPIO_10"), 124 + PINCTRL_PIN(11, "GPIO_11"), 125 + PINCTRL_PIN(12, "GPIO_12"), 126 + PINCTRL_PIN(13, "GPIO_13"), 127 + PINCTRL_PIN(14, "GPIO_14"), 128 + PINCTRL_PIN(15, "GPIO_15"), 129 + PINCTRL_PIN(16, "GPIO_16"), 130 + PINCTRL_PIN(17, "GPIO_17"), 131 + PINCTRL_PIN(18, "GPIO_18"), 132 + PINCTRL_PIN(19, "GPIO_19"), 133 + PINCTRL_PIN(20, "GPIO_20"), 134 + PINCTRL_PIN(21, "GPIO_21"), 135 + PINCTRL_PIN(22, "GPIO_22"), 136 + PINCTRL_PIN(23, "GPIO_23"), 137 + PINCTRL_PIN(24, "GPIO_24"), 138 + PINCTRL_PIN(25, "GPIO_25"), 139 + PINCTRL_PIN(26, "GPIO_26"), 140 + PINCTRL_PIN(27, "GPIO_27"), 141 + PINCTRL_PIN(28, "GPIO_28"), 142 + PINCTRL_PIN(29, "GPIO_29"), 143 + PINCTRL_PIN(30, "GPIO_30"), 144 + PINCTRL_PIN(31, "GPIO_31"), 145 + PINCTRL_PIN(32, "GPIO_32"), 146 + PINCTRL_PIN(33, "GPIO_33"), 147 + PINCTRL_PIN(34, "GPIO_34"), 148 + PINCTRL_PIN(35, "GPIO_35"), 149 + PINCTRL_PIN(36, "GPIO_36"), 150 + PINCTRL_PIN(37, "GPIO_37"), 151 + PINCTRL_PIN(38, "GPIO_38"), 152 + PINCTRL_PIN(39, "GPIO_39"), 153 + PINCTRL_PIN(40, "GPIO_40"), 154 + PINCTRL_PIN(41, "GPIO_41"), 155 + PINCTRL_PIN(42, "GPIO_42"), 156 + PINCTRL_PIN(43, "GPIO_43"), 157 + PINCTRL_PIN(44, "GPIO_44"), 158 + PINCTRL_PIN(45, "GPIO_45"), 159 + PINCTRL_PIN(46, "GPIO_46"), 160 + PINCTRL_PIN(47, "GPIO_47"), 161 + PINCTRL_PIN(48, "GPIO_48"), 162 + PINCTRL_PIN(49, "GPIO_49"), 163 + PINCTRL_PIN(50, "GPIO_50"), 164 + PINCTRL_PIN(51, "GPIO_51"), 165 + PINCTRL_PIN(52, "GPIO_52"), 166 + PINCTRL_PIN(53, "GPIO_53"), 167 + PINCTRL_PIN(54, "GPIO_54"), 168 + PINCTRL_PIN(55, "GPIO_55"), 169 + PINCTRL_PIN(56, "GPIO_56"), 170 + PINCTRL_PIN(57, "GPIO_57"), 171 + PINCTRL_PIN(58, "GPIO_58"), 172 + PINCTRL_PIN(59, "GPIO_59"), 173 + PINCTRL_PIN(60, "GPIO_60"), 174 + PINCTRL_PIN(61, "GPIO_61"), 175 + PINCTRL_PIN(62, "GPIO_62"), 176 + PINCTRL_PIN(63, "GPIO_63"), 177 + PINCTRL_PIN(64, "GPIO_64"), 178 + PINCTRL_PIN(65, "GPIO_65"), 179 + PINCTRL_PIN(66, "GPIO_66"), 180 + PINCTRL_PIN(67, "GPIO_67"), 181 + PINCTRL_PIN(68, "GPIO_68"), 182 + PINCTRL_PIN(69, "GPIO_69"), 183 + PINCTRL_PIN(70, "GPIO_70"), 184 + PINCTRL_PIN(71, "GPIO_71"), 185 + PINCTRL_PIN(72, "GPIO_72"), 186 + PINCTRL_PIN(73, "GPIO_73"), 187 + PINCTRL_PIN(74, "GPIO_74"), 188 + PINCTRL_PIN(75, "GPIO_75"), 189 + PINCTRL_PIN(76, "GPIO_76"), 190 + PINCTRL_PIN(77, "GPIO_77"), 191 + PINCTRL_PIN(78, "GPIO_78"), 192 + PINCTRL_PIN(79, "GPIO_79"), 193 + PINCTRL_PIN(80, "GPIO_80"), 194 + PINCTRL_PIN(81, "GPIO_81"), 195 + PINCTRL_PIN(82, "GPIO_82"), 196 + PINCTRL_PIN(83, "GPIO_83"), 197 + PINCTRL_PIN(84, "GPIO_84"), 198 + PINCTRL_PIN(85, "GPIO_85"), 199 + PINCTRL_PIN(86, "GPIO_86"), 200 + PINCTRL_PIN(87, "GPIO_87"), 201 + PINCTRL_PIN(88, "GPIO_88"), 202 + PINCTRL_PIN(89, "GPIO_89"), 203 + PINCTRL_PIN(90, "GPIO_90"), 204 + PINCTRL_PIN(91, "GPIO_91"), 205 + PINCTRL_PIN(92, "GPIO_92"), 206 + PINCTRL_PIN(93, "GPIO_93"), 207 + PINCTRL_PIN(94, "GPIO_94"), 208 + PINCTRL_PIN(95, "GPIO_95"), 209 + PINCTRL_PIN(96, "GPIO_96"), 210 + PINCTRL_PIN(97, "GPIO_97"), 211 + PINCTRL_PIN(98, "GPIO_98"), 212 + PINCTRL_PIN(99, "GPIO_99"), 213 + PINCTRL_PIN(100, "GPIO_100"), 214 + PINCTRL_PIN(101, "GPIO_101"), 215 + PINCTRL_PIN(102, "GPIO_102"), 216 + PINCTRL_PIN(103, "GPIO_103"), 217 + PINCTRL_PIN(104, "GPIO_104"), 218 + PINCTRL_PIN(105, "GPIO_105"), 219 + PINCTRL_PIN(106, "GPIO_106"), 220 + PINCTRL_PIN(107, "GPIO_107"), 221 + PINCTRL_PIN(108, "GPIO_108"), 222 + PINCTRL_PIN(109, "GPIO_109"), 223 + PINCTRL_PIN(110, "GPIO_110"), 224 + PINCTRL_PIN(111, "GPIO_111"), 225 + PINCTRL_PIN(112, "GPIO_112"), 226 + PINCTRL_PIN(113, "GPIO_113"), 227 + PINCTRL_PIN(114, "GPIO_114"), 228 + PINCTRL_PIN(115, "GPIO_115"), 229 + PINCTRL_PIN(116, "GPIO_116"), 230 + PINCTRL_PIN(117, "GPIO_117"), 231 + PINCTRL_PIN(118, "GPIO_118"), 232 + PINCTRL_PIN(119, "GPIO_119"), 233 + PINCTRL_PIN(120, "GPIO_120"), 234 + PINCTRL_PIN(121, "GPIO_121"), 235 + PINCTRL_PIN(122, "GPIO_122"), 236 + PINCTRL_PIN(123, "GPIO_123"), 237 + PINCTRL_PIN(124, "GPIO_124"), 238 + PINCTRL_PIN(125, "GPIO_125"), 239 + PINCTRL_PIN(126, "GPIO_126"), 240 + PINCTRL_PIN(127, "GPIO_127"), 241 + PINCTRL_PIN(128, "GPIO_128"), 242 + PINCTRL_PIN(129, "GPIO_129"), 243 + PINCTRL_PIN(130, "GPIO_130"), 244 + PINCTRL_PIN(131, "GPIO_131"), 245 + PINCTRL_PIN(132, "GPIO_132"), 246 + PINCTRL_PIN(133, "GPIO_133"), 247 + PINCTRL_PIN(134, "GPIO_134"), 248 + PINCTRL_PIN(135, "GPIO_135"), 249 + PINCTRL_PIN(136, "GPIO_136"), 250 + PINCTRL_PIN(137, "GPIO_137"), 251 + PINCTRL_PIN(138, "GPIO_138"), 252 + PINCTRL_PIN(139, "GPIO_139"), 253 + PINCTRL_PIN(140, "GPIO_140"), 254 + PINCTRL_PIN(141, "GPIO_141"), 255 + PINCTRL_PIN(142, "GPIO_142"), 256 + PINCTRL_PIN(143, "GPIO_143"), 257 + PINCTRL_PIN(144, "GPIO_144"), 258 + PINCTRL_PIN(145, "GPIO_145"), 259 + PINCTRL_PIN(146, "GPIO_146"), 260 + PINCTRL_PIN(147, "GPIO_147"), 261 + PINCTRL_PIN(148, "GPIO_148"), 262 + PINCTRL_PIN(149, "GPIO_149"), 263 + PINCTRL_PIN(150, "GPIO_150"), 264 + PINCTRL_PIN(151, "GPIO_151"), 265 + PINCTRL_PIN(152, "GPIO_152"), 266 + PINCTRL_PIN(153, "GPIO_153"), 267 + PINCTRL_PIN(154, "GPIO_154"), 268 + PINCTRL_PIN(155, "GPIO_155"), 269 + PINCTRL_PIN(156, "GPIO_156"), 270 + PINCTRL_PIN(157, "GPIO_157"), 271 + PINCTRL_PIN(158, "GPIO_158"), 272 + PINCTRL_PIN(159, "GPIO_159"), 273 + PINCTRL_PIN(160, "GPIO_160"), 274 + PINCTRL_PIN(161, "GPIO_161"), 275 + PINCTRL_PIN(162, "GPIO_162"), 276 + PINCTRL_PIN(163, "GPIO_163"), 277 + PINCTRL_PIN(164, "GPIO_164"), 278 + PINCTRL_PIN(165, "GPIO_165"), 279 + PINCTRL_PIN(166, "GPIO_166"), 280 + PINCTRL_PIN(167, "GPIO_167"), 281 + PINCTRL_PIN(168, "GPIO_168"), 282 + PINCTRL_PIN(169, "GPIO_169"), 283 + PINCTRL_PIN(170, "GPIO_170"), 284 + PINCTRL_PIN(171, "GPIO_171"), 285 + PINCTRL_PIN(172, "GPIO_172"), 286 + PINCTRL_PIN(173, "GPIO_173"), 287 + PINCTRL_PIN(174, "GPIO_174"), 288 + PINCTRL_PIN(175, "GPIO_175"), 289 + PINCTRL_PIN(176, "GPIO_176"), 290 + PINCTRL_PIN(177, "GPIO_177"), 291 + PINCTRL_PIN(178, "GPIO_178"), 292 + PINCTRL_PIN(179, "GPIO_179"), 293 + PINCTRL_PIN(180, "GPIO_180"), 294 + PINCTRL_PIN(181, "GPIO_181"), 295 + PINCTRL_PIN(182, "GPIO_182"), 296 + PINCTRL_PIN(183, "GPIO_183"), 297 + PINCTRL_PIN(184, "GPIO_184"), 298 + PINCTRL_PIN(185, "GPIO_185"), 299 + PINCTRL_PIN(186, "GPIO_186"), 300 + PINCTRL_PIN(187, "GPIO_187"), 301 + PINCTRL_PIN(188, "GPIO_188"), 302 + PINCTRL_PIN(189, "GPIO_189"), 303 + PINCTRL_PIN(190, "GPIO_190"), 304 + PINCTRL_PIN(191, "GPIO_191"), 305 + PINCTRL_PIN(192, "GPIO_192"), 306 + PINCTRL_PIN(193, "GPIO_193"), 307 + PINCTRL_PIN(194, "GPIO_194"), 308 + PINCTRL_PIN(195, "GPIO_195"), 309 + PINCTRL_PIN(196, "GPIO_196"), 310 + PINCTRL_PIN(197, "GPIO_197"), 311 + PINCTRL_PIN(198, "GPIO_198"), 312 + PINCTRL_PIN(199, "GPIO_199"), 313 + PINCTRL_PIN(200, "GPIO_200"), 314 + PINCTRL_PIN(201, "GPIO_201"), 315 + PINCTRL_PIN(202, "GPIO_202"), 316 + PINCTRL_PIN(203, "GPIO_203"), 317 + PINCTRL_PIN(204, "GPIO_204"), 318 + PINCTRL_PIN(205, "GPIO_205"), 319 + PINCTRL_PIN(206, "GPIO_206"), 320 + PINCTRL_PIN(207, "GPIO_207"), 321 + PINCTRL_PIN(208, "GPIO_208"), 322 + PINCTRL_PIN(209, "GPIO_209"), 323 + PINCTRL_PIN(210, "UFS_RESET"), 324 + PINCTRL_PIN(211, "SDC2_CLK"), 325 + PINCTRL_PIN(212, "SDC2_CMD"), 326 + PINCTRL_PIN(213, "SDC2_DATA"), 327 + }; 328 + 329 + #define DECLARE_MSM_GPIO_PINS(pin) \ 330 + static const unsigned int gpio##pin##_pins[] = { pin } 331 + DECLARE_MSM_GPIO_PINS(0); 332 + DECLARE_MSM_GPIO_PINS(1); 333 + DECLARE_MSM_GPIO_PINS(2); 334 + DECLARE_MSM_GPIO_PINS(3); 335 + DECLARE_MSM_GPIO_PINS(4); 336 + DECLARE_MSM_GPIO_PINS(5); 337 + DECLARE_MSM_GPIO_PINS(6); 338 + DECLARE_MSM_GPIO_PINS(7); 339 + DECLARE_MSM_GPIO_PINS(8); 340 + DECLARE_MSM_GPIO_PINS(9); 341 + DECLARE_MSM_GPIO_PINS(10); 342 + DECLARE_MSM_GPIO_PINS(11); 343 + DECLARE_MSM_GPIO_PINS(12); 344 + DECLARE_MSM_GPIO_PINS(13); 345 + DECLARE_MSM_GPIO_PINS(14); 346 + DECLARE_MSM_GPIO_PINS(15); 347 + DECLARE_MSM_GPIO_PINS(16); 348 + DECLARE_MSM_GPIO_PINS(17); 349 + DECLARE_MSM_GPIO_PINS(18); 350 + DECLARE_MSM_GPIO_PINS(19); 351 + DECLARE_MSM_GPIO_PINS(20); 352 + DECLARE_MSM_GPIO_PINS(21); 353 + DECLARE_MSM_GPIO_PINS(22); 354 + DECLARE_MSM_GPIO_PINS(23); 355 + DECLARE_MSM_GPIO_PINS(24); 356 + DECLARE_MSM_GPIO_PINS(25); 357 + DECLARE_MSM_GPIO_PINS(26); 358 + DECLARE_MSM_GPIO_PINS(27); 359 + DECLARE_MSM_GPIO_PINS(28); 360 + DECLARE_MSM_GPIO_PINS(29); 361 + DECLARE_MSM_GPIO_PINS(30); 362 + DECLARE_MSM_GPIO_PINS(31); 363 + DECLARE_MSM_GPIO_PINS(32); 364 + DECLARE_MSM_GPIO_PINS(33); 365 + DECLARE_MSM_GPIO_PINS(34); 366 + DECLARE_MSM_GPIO_PINS(35); 367 + DECLARE_MSM_GPIO_PINS(36); 368 + DECLARE_MSM_GPIO_PINS(37); 369 + DECLARE_MSM_GPIO_PINS(38); 370 + DECLARE_MSM_GPIO_PINS(39); 371 + DECLARE_MSM_GPIO_PINS(40); 372 + DECLARE_MSM_GPIO_PINS(41); 373 + DECLARE_MSM_GPIO_PINS(42); 374 + DECLARE_MSM_GPIO_PINS(43); 375 + DECLARE_MSM_GPIO_PINS(44); 376 + DECLARE_MSM_GPIO_PINS(45); 377 + DECLARE_MSM_GPIO_PINS(46); 378 + DECLARE_MSM_GPIO_PINS(47); 379 + DECLARE_MSM_GPIO_PINS(48); 380 + DECLARE_MSM_GPIO_PINS(49); 381 + DECLARE_MSM_GPIO_PINS(50); 382 + DECLARE_MSM_GPIO_PINS(51); 383 + DECLARE_MSM_GPIO_PINS(52); 384 + DECLARE_MSM_GPIO_PINS(53); 385 + DECLARE_MSM_GPIO_PINS(54); 386 + DECLARE_MSM_GPIO_PINS(55); 387 + DECLARE_MSM_GPIO_PINS(56); 388 + DECLARE_MSM_GPIO_PINS(57); 389 + DECLARE_MSM_GPIO_PINS(58); 390 + DECLARE_MSM_GPIO_PINS(59); 391 + DECLARE_MSM_GPIO_PINS(60); 392 + DECLARE_MSM_GPIO_PINS(61); 393 + DECLARE_MSM_GPIO_PINS(62); 394 + DECLARE_MSM_GPIO_PINS(63); 395 + DECLARE_MSM_GPIO_PINS(64); 396 + DECLARE_MSM_GPIO_PINS(65); 397 + DECLARE_MSM_GPIO_PINS(66); 398 + DECLARE_MSM_GPIO_PINS(67); 399 + DECLARE_MSM_GPIO_PINS(68); 400 + DECLARE_MSM_GPIO_PINS(69); 401 + DECLARE_MSM_GPIO_PINS(70); 402 + DECLARE_MSM_GPIO_PINS(71); 403 + DECLARE_MSM_GPIO_PINS(72); 404 + DECLARE_MSM_GPIO_PINS(73); 405 + DECLARE_MSM_GPIO_PINS(74); 406 + DECLARE_MSM_GPIO_PINS(75); 407 + DECLARE_MSM_GPIO_PINS(76); 408 + DECLARE_MSM_GPIO_PINS(77); 409 + DECLARE_MSM_GPIO_PINS(78); 410 + DECLARE_MSM_GPIO_PINS(79); 411 + DECLARE_MSM_GPIO_PINS(80); 412 + DECLARE_MSM_GPIO_PINS(81); 413 + DECLARE_MSM_GPIO_PINS(82); 414 + DECLARE_MSM_GPIO_PINS(83); 415 + DECLARE_MSM_GPIO_PINS(84); 416 + DECLARE_MSM_GPIO_PINS(85); 417 + DECLARE_MSM_GPIO_PINS(86); 418 + DECLARE_MSM_GPIO_PINS(87); 419 + DECLARE_MSM_GPIO_PINS(88); 420 + DECLARE_MSM_GPIO_PINS(89); 421 + DECLARE_MSM_GPIO_PINS(90); 422 + DECLARE_MSM_GPIO_PINS(91); 423 + DECLARE_MSM_GPIO_PINS(92); 424 + DECLARE_MSM_GPIO_PINS(93); 425 + DECLARE_MSM_GPIO_PINS(94); 426 + DECLARE_MSM_GPIO_PINS(95); 427 + DECLARE_MSM_GPIO_PINS(96); 428 + DECLARE_MSM_GPIO_PINS(97); 429 + DECLARE_MSM_GPIO_PINS(98); 430 + DECLARE_MSM_GPIO_PINS(99); 431 + DECLARE_MSM_GPIO_PINS(100); 432 + DECLARE_MSM_GPIO_PINS(101); 433 + DECLARE_MSM_GPIO_PINS(102); 434 + DECLARE_MSM_GPIO_PINS(103); 435 + DECLARE_MSM_GPIO_PINS(104); 436 + DECLARE_MSM_GPIO_PINS(105); 437 + DECLARE_MSM_GPIO_PINS(106); 438 + DECLARE_MSM_GPIO_PINS(107); 439 + DECLARE_MSM_GPIO_PINS(108); 440 + DECLARE_MSM_GPIO_PINS(109); 441 + DECLARE_MSM_GPIO_PINS(110); 442 + DECLARE_MSM_GPIO_PINS(111); 443 + DECLARE_MSM_GPIO_PINS(112); 444 + DECLARE_MSM_GPIO_PINS(113); 445 + DECLARE_MSM_GPIO_PINS(114); 446 + DECLARE_MSM_GPIO_PINS(115); 447 + DECLARE_MSM_GPIO_PINS(116); 448 + DECLARE_MSM_GPIO_PINS(117); 449 + DECLARE_MSM_GPIO_PINS(118); 450 + DECLARE_MSM_GPIO_PINS(119); 451 + DECLARE_MSM_GPIO_PINS(120); 452 + DECLARE_MSM_GPIO_PINS(121); 453 + DECLARE_MSM_GPIO_PINS(122); 454 + DECLARE_MSM_GPIO_PINS(123); 455 + DECLARE_MSM_GPIO_PINS(124); 456 + DECLARE_MSM_GPIO_PINS(125); 457 + DECLARE_MSM_GPIO_PINS(126); 458 + DECLARE_MSM_GPIO_PINS(127); 459 + DECLARE_MSM_GPIO_PINS(128); 460 + DECLARE_MSM_GPIO_PINS(129); 461 + DECLARE_MSM_GPIO_PINS(130); 462 + DECLARE_MSM_GPIO_PINS(131); 463 + DECLARE_MSM_GPIO_PINS(132); 464 + DECLARE_MSM_GPIO_PINS(133); 465 + DECLARE_MSM_GPIO_PINS(134); 466 + DECLARE_MSM_GPIO_PINS(135); 467 + DECLARE_MSM_GPIO_PINS(136); 468 + DECLARE_MSM_GPIO_PINS(137); 469 + DECLARE_MSM_GPIO_PINS(138); 470 + DECLARE_MSM_GPIO_PINS(139); 471 + DECLARE_MSM_GPIO_PINS(140); 472 + DECLARE_MSM_GPIO_PINS(141); 473 + DECLARE_MSM_GPIO_PINS(142); 474 + DECLARE_MSM_GPIO_PINS(143); 475 + DECLARE_MSM_GPIO_PINS(144); 476 + DECLARE_MSM_GPIO_PINS(145); 477 + DECLARE_MSM_GPIO_PINS(146); 478 + DECLARE_MSM_GPIO_PINS(147); 479 + DECLARE_MSM_GPIO_PINS(148); 480 + DECLARE_MSM_GPIO_PINS(149); 481 + DECLARE_MSM_GPIO_PINS(150); 482 + DECLARE_MSM_GPIO_PINS(151); 483 + DECLARE_MSM_GPIO_PINS(152); 484 + DECLARE_MSM_GPIO_PINS(153); 485 + DECLARE_MSM_GPIO_PINS(154); 486 + DECLARE_MSM_GPIO_PINS(155); 487 + DECLARE_MSM_GPIO_PINS(156); 488 + DECLARE_MSM_GPIO_PINS(157); 489 + DECLARE_MSM_GPIO_PINS(158); 490 + DECLARE_MSM_GPIO_PINS(159); 491 + DECLARE_MSM_GPIO_PINS(160); 492 + DECLARE_MSM_GPIO_PINS(161); 493 + DECLARE_MSM_GPIO_PINS(162); 494 + DECLARE_MSM_GPIO_PINS(163); 495 + DECLARE_MSM_GPIO_PINS(164); 496 + DECLARE_MSM_GPIO_PINS(165); 497 + DECLARE_MSM_GPIO_PINS(166); 498 + DECLARE_MSM_GPIO_PINS(167); 499 + DECLARE_MSM_GPIO_PINS(168); 500 + DECLARE_MSM_GPIO_PINS(169); 501 + DECLARE_MSM_GPIO_PINS(170); 502 + DECLARE_MSM_GPIO_PINS(171); 503 + DECLARE_MSM_GPIO_PINS(172); 504 + DECLARE_MSM_GPIO_PINS(173); 505 + DECLARE_MSM_GPIO_PINS(174); 506 + DECLARE_MSM_GPIO_PINS(175); 507 + DECLARE_MSM_GPIO_PINS(176); 508 + DECLARE_MSM_GPIO_PINS(177); 509 + DECLARE_MSM_GPIO_PINS(178); 510 + DECLARE_MSM_GPIO_PINS(179); 511 + DECLARE_MSM_GPIO_PINS(180); 512 + DECLARE_MSM_GPIO_PINS(181); 513 + DECLARE_MSM_GPIO_PINS(182); 514 + DECLARE_MSM_GPIO_PINS(183); 515 + DECLARE_MSM_GPIO_PINS(184); 516 + DECLARE_MSM_GPIO_PINS(185); 517 + DECLARE_MSM_GPIO_PINS(186); 518 + DECLARE_MSM_GPIO_PINS(187); 519 + DECLARE_MSM_GPIO_PINS(188); 520 + DECLARE_MSM_GPIO_PINS(189); 521 + DECLARE_MSM_GPIO_PINS(190); 522 + DECLARE_MSM_GPIO_PINS(191); 523 + DECLARE_MSM_GPIO_PINS(192); 524 + DECLARE_MSM_GPIO_PINS(193); 525 + DECLARE_MSM_GPIO_PINS(194); 526 + DECLARE_MSM_GPIO_PINS(195); 527 + DECLARE_MSM_GPIO_PINS(196); 528 + DECLARE_MSM_GPIO_PINS(197); 529 + DECLARE_MSM_GPIO_PINS(198); 530 + DECLARE_MSM_GPIO_PINS(199); 531 + DECLARE_MSM_GPIO_PINS(200); 532 + DECLARE_MSM_GPIO_PINS(201); 533 + DECLARE_MSM_GPIO_PINS(202); 534 + DECLARE_MSM_GPIO_PINS(203); 535 + DECLARE_MSM_GPIO_PINS(204); 536 + DECLARE_MSM_GPIO_PINS(205); 537 + DECLARE_MSM_GPIO_PINS(206); 538 + DECLARE_MSM_GPIO_PINS(207); 539 + DECLARE_MSM_GPIO_PINS(208); 540 + DECLARE_MSM_GPIO_PINS(209); 541 + 542 + static const unsigned int ufs_reset_pins[] = { 210 }; 543 + static const unsigned int sdc2_clk_pins[] = { 211 }; 544 + static const unsigned int sdc2_cmd_pins[] = { 212 }; 545 + static const unsigned int sdc2_data_pins[] = { 213 }; 546 + 547 + enum sm8450_functions { 548 + msm_mux_gpio, 549 + msm_mux_aon_cam, 550 + msm_mux_atest_char, 551 + msm_mux_atest_usb, 552 + msm_mux_audio_ref, 553 + msm_mux_cam_mclk, 554 + msm_mux_cci_async, 555 + msm_mux_cci_i2c, 556 + msm_mux_cci_timer, 557 + msm_mux_cmu_rng, 558 + msm_mux_coex_uart1, 559 + msm_mux_coex_uart2, 560 + msm_mux_cri_trng, 561 + msm_mux_cri_trng0, 562 + msm_mux_cri_trng1, 563 + msm_mux_dbg_out, 564 + msm_mux_ddr_bist, 565 + msm_mux_ddr_pxi0, 566 + msm_mux_ddr_pxi1, 567 + msm_mux_ddr_pxi2, 568 + msm_mux_ddr_pxi3, 569 + msm_mux_dp_hot, 570 + msm_mux_gcc_gp1, 571 + msm_mux_gcc_gp2, 572 + msm_mux_gcc_gp3, 573 + msm_mux_ibi_i3c, 574 + msm_mux_jitter_bist, 575 + msm_mux_mdp_vsync, 576 + msm_mux_mdp_vsync0, 577 + msm_mux_mdp_vsync1, 578 + msm_mux_mdp_vsync2, 579 + msm_mux_mdp_vsync3, 580 + msm_mux_mi2s0_data0, 581 + msm_mux_mi2s0_data1, 582 + msm_mux_mi2s0_sck, 583 + msm_mux_mi2s0_ws, 584 + msm_mux_mi2s2_data0, 585 + msm_mux_mi2s2_data1, 586 + msm_mux_mi2s2_sck, 587 + msm_mux_mi2s2_ws, 588 + msm_mux_mss_grfc0, 589 + msm_mux_mss_grfc1, 590 + msm_mux_mss_grfc10, 591 + msm_mux_mss_grfc11, 592 + msm_mux_mss_grfc12, 593 + msm_mux_mss_grfc2, 594 + msm_mux_mss_grfc3, 595 + msm_mux_mss_grfc4, 596 + msm_mux_mss_grfc5, 597 + msm_mux_mss_grfc6, 598 + msm_mux_mss_grfc7, 599 + msm_mux_mss_grfc8, 600 + msm_mux_mss_grfc9, 601 + msm_mux_nav, 602 + msm_mux_pcie0_clkreqn, 603 + msm_mux_pcie1_clkreqn, 604 + msm_mux_phase_flag, 605 + msm_mux_pll_bist, 606 + msm_mux_pll_clk, 607 + msm_mux_pri_mi2s, 608 + msm_mux_prng_rosc, 609 + msm_mux_qdss_cti, 610 + msm_mux_qdss_gpio, 611 + msm_mux_qlink0_enable, 612 + msm_mux_qlink0_request, 613 + msm_mux_qlink0_wmss, 614 + msm_mux_qlink1_enable, 615 + msm_mux_qlink1_request, 616 + msm_mux_qlink1_wmss, 617 + msm_mux_qlink2_enable, 618 + msm_mux_qlink2_request, 619 + msm_mux_qlink2_wmss, 620 + msm_mux_qspi0, 621 + msm_mux_qspi1, 622 + msm_mux_qspi2, 623 + msm_mux_qspi3, 624 + msm_mux_qspi_clk, 625 + msm_mux_qspi_cs, 626 + msm_mux_qup0, 627 + msm_mux_qup1, 628 + msm_mux_qup10, 629 + msm_mux_qup11, 630 + msm_mux_qup12, 631 + msm_mux_qup13, 632 + msm_mux_qup14, 633 + msm_mux_qup15, 634 + msm_mux_qup16, 635 + msm_mux_qup17, 636 + msm_mux_qup18, 637 + msm_mux_qup19, 638 + msm_mux_qup2, 639 + msm_mux_qup20, 640 + msm_mux_qup21, 641 + msm_mux_qup3, 642 + msm_mux_qup4, 643 + msm_mux_qup5, 644 + msm_mux_qup6, 645 + msm_mux_qup7, 646 + msm_mux_qup8, 647 + msm_mux_qup9, 648 + msm_mux_qup_l4, 649 + msm_mux_qup_l5, 650 + msm_mux_qup_l6, 651 + msm_mux_sd_write, 652 + msm_mux_sdc40, 653 + msm_mux_sdc41, 654 + msm_mux_sdc42, 655 + msm_mux_sdc43, 656 + msm_mux_sdc4_clk, 657 + msm_mux_sdc4_cmd, 658 + msm_mux_sec_mi2s, 659 + msm_mux_tb_trig, 660 + msm_mux_tgu_ch0, 661 + msm_mux_tgu_ch1, 662 + msm_mux_tgu_ch2, 663 + msm_mux_tgu_ch3, 664 + msm_mux_tmess_prng0, 665 + msm_mux_tmess_prng1, 666 + msm_mux_tmess_prng2, 667 + msm_mux_tmess_prng3, 668 + msm_mux_tsense_pwm1, 669 + msm_mux_tsense_pwm2, 670 + msm_mux_uim0_clk, 671 + msm_mux_uim0_data, 672 + msm_mux_uim0_present, 673 + msm_mux_uim0_reset, 674 + msm_mux_uim1_clk, 675 + msm_mux_uim1_data, 676 + msm_mux_uim1_present, 677 + msm_mux_uim1_reset, 678 + msm_mux_usb2phy_ac, 679 + msm_mux_usb_phy, 680 + msm_mux_vfr_0, 681 + msm_mux_vfr_1, 682 + msm_mux_vsense_trigger, 683 + msm_mux__, 684 + }; 685 + 686 + static const char * const gpio_groups[] = { 687 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 688 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 689 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 690 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 691 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 692 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 693 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 694 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 695 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 696 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 697 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 698 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 699 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 700 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 701 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 702 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 703 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 704 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 705 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 706 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 707 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 708 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 709 + "gpio147", "gpio148", "gpio149", "gpio150", "gpio151", "gpio152", 710 + "gpio153", "gpio154", "gpio155", "gpio156", "gpio157", "gpio158", 711 + "gpio159", "gpio160", "gpio161", "gpio162", "gpio163", "gpio164", 712 + "gpio165", "gpio166", "gpio167", "gpio168", "gpio169", "gpio170", 713 + "gpio171", "gpio172", "gpio173", "gpio174", "gpio175", "gpio176", 714 + "gpio177", "gpio178", "gpio179", "gpio180", "gpio181", "gpio182", 715 + "gpio183", "gpio184", "gpio185", "gpio186", "gpio187", "gpio188", 716 + "gpio189", "gpio190", "gpio191", "gpio192", "gpio193", "gpio194", 717 + "gpio195", "gpio196", "gpio197", "gpio198", "gpio199", "gpio200", 718 + "gpio201", "gpio202", "gpio203", "gpio204", "gpio205", "gpio206", 719 + "gpio207", "gpio208", "gpio209", 720 + }; 721 + 722 + static const char * const aon_cam_groups[] = { 723 + "gpio108", 724 + }; 725 + 726 + static const char * const atest_char_groups[] = { 727 + "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", 728 + }; 729 + 730 + static const char * const atest_usb_groups[] = { 731 + "gpio37", "gpio39", "gpio55", "gpio148", "gpio149", 732 + }; 733 + 734 + static const char * const audio_ref_groups[] = { 735 + "gpio124", 736 + }; 737 + 738 + static const char * const cam_mclk_groups[] = { 739 + "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", "gpio105", "gpio106", "gpio107", 740 + }; 741 + 742 + static const char * const cci_async_groups[] = { 743 + "gpio109", "gpio119", "gpio120", 744 + }; 745 + 746 + static const char * const cci_i2c_groups[] = { 747 + "gpio110", "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio208", "gpio209", 748 + }; 749 + 750 + static const char * const cci_timer_groups[] = { 751 + "gpio116", "gpio117", "gpio118", "gpio119", "gpio120", 752 + }; 753 + 754 + static const char * const cmu_rng_groups[] = { 755 + "gpio94", "gpio95", "gpio96", "gpio97", 756 + }; 757 + 758 + static const char * const coex_uart1_groups[] = { 759 + "gpio148", "gpio149", 760 + }; 761 + 762 + static const char * const coex_uart2_groups[] = { 763 + "gpio150", "gpio151", 764 + }; 765 + 766 + static const char * const cri_trng_groups[] = { 767 + "gpio99", 768 + }; 769 + 770 + static const char * const cri_trng0_groups[] = { 771 + "gpio71", 772 + }; 773 + 774 + static const char * const cri_trng1_groups[] = { 775 + "gpio72", 776 + }; 777 + 778 + static const char * const dbg_out_groups[] = { 779 + "gpio9", 780 + }; 781 + 782 + static const char * const ddr_bist_groups[] = { 783 + "gpio36", "gpio37", "gpio40", "gpio41", 784 + }; 785 + 786 + static const char * const ddr_pxi0_groups[] = { 787 + "gpio51", "gpio52", 788 + }; 789 + 790 + static const char * const ddr_pxi1_groups[] = { 791 + "gpio40", "gpio41", 792 + }; 793 + 794 + static const char * const ddr_pxi2_groups[] = { 795 + "gpio45", "gpio47", 796 + }; 797 + 798 + static const char * const ddr_pxi3_groups[] = { 799 + "gpio43", "gpio44", 800 + }; 801 + 802 + static const char * const dp_hot_groups[] = { 803 + "gpio47", 804 + }; 805 + 806 + static const char * const gcc_gp1_groups[] = { 807 + "gpio86", "gpio134", 808 + }; 809 + 810 + static const char * const gcc_gp2_groups[] = { 811 + "gpio87", "gpio135", 812 + }; 813 + 814 + static const char * const gcc_gp3_groups[] = { 815 + "gpio88", "gpio136", 816 + }; 817 + 818 + static const char * const ibi_i3c_groups[] = { 819 + "gpio28", "gpio29", "gpio32", "gpio33", "gpio56", "gpio57", "gpio60", "gpio61", 820 + }; 821 + 822 + static const char * const jitter_bist_groups[] = { 823 + "gpio24", 824 + }; 825 + 826 + static const char * const mdp_vsync_groups[] = { 827 + "gpio46", "gpio47", "gpio86", "gpio87", "gpio88", 828 + }; 829 + 830 + static const char * const mdp_vsync0_groups[] = { 831 + "gpio86", 832 + }; 833 + 834 + static const char * const mdp_vsync1_groups[] = { 835 + "gpio86", 836 + }; 837 + 838 + static const char * const mdp_vsync2_groups[] = { 839 + "gpio87", 840 + }; 841 + 842 + static const char * const mdp_vsync3_groups[] = { 843 + "gpio87", 844 + }; 845 + 846 + static const char * const mi2s0_data0_groups[] = { 847 + "gpio127", 848 + }; 849 + 850 + static const char * const mi2s0_data1_groups[] = { 851 + "gpio128", 852 + }; 853 + 854 + static const char * const mi2s0_sck_groups[] = { 855 + "gpio126", 856 + }; 857 + 858 + static const char * const mi2s0_ws_groups[] = { 859 + "gpio129", 860 + }; 861 + 862 + static const char * const mi2s2_data0_groups[] = { 863 + "gpio122", 864 + }; 865 + 866 + static const char * const mi2s2_data1_groups[] = { 867 + "gpio124", 868 + }; 869 + 870 + static const char * const mi2s2_sck_groups[] = { 871 + "gpio121", 872 + }; 873 + 874 + static const char * const mi2s2_ws_groups[] = { 875 + "gpio123", 876 + }; 877 + 878 + static const char * const mss_grfc0_groups[] = { 879 + "gpio138", "gpio153", 880 + }; 881 + 882 + static const char * const mss_grfc1_groups[] = { 883 + "gpio139", 884 + }; 885 + 886 + static const char * const mss_grfc10_groups[] = { 887 + "gpio150", 888 + }; 889 + 890 + static const char * const mss_grfc11_groups[] = { 891 + "gpio151", 892 + }; 893 + 894 + static const char * const mss_grfc12_groups[] = { 895 + "gpio152", 896 + }; 897 + 898 + static const char * const mss_grfc2_groups[] = { 899 + "gpio140", 900 + }; 901 + 902 + static const char * const mss_grfc3_groups[] = { 903 + "gpio141", 904 + }; 905 + 906 + static const char * const mss_grfc4_groups[] = { 907 + "gpio142", 908 + }; 909 + 910 + static const char * const mss_grfc5_groups[] = { 911 + "gpio143", 912 + }; 913 + 914 + static const char * const mss_grfc6_groups[] = { 915 + "gpio144", 916 + }; 917 + 918 + static const char * const mss_grfc7_groups[] = { 919 + "gpio145", 920 + }; 921 + 922 + static const char * const mss_grfc8_groups[] = { 923 + "gpio146", 924 + }; 925 + 926 + static const char * const mss_grfc9_groups[] = { 927 + "gpio147", 928 + }; 929 + 930 + static const char * const nav_groups[] = { 931 + "gpio153", "gpio154", "gpio155", 932 + }; 933 + 934 + static const char * const pcie0_clkreqn_groups[] = { 935 + "gpio95", 936 + }; 937 + 938 + static const char * const pcie1_clkreqn_groups[] = { 939 + "gpio98", 940 + }; 941 + 942 + static const char * const phase_flag_groups[] = { 943 + "gpio4", "gpio5", "gpio6", "gpio7", "gpio10", "gpio11", "gpio12", "gpio13", 944 + "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio25", "gpio26", 945 + "gpio76", "gpio77", "gpio78", "gpio79", "gpio81", "gpio82", "gpio83", "gpio92", 946 + "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", "gpio99", 947 + }; 948 + 949 + static const char * const pll_bist_groups[] = { 950 + "gpio20", 951 + }; 952 + 953 + static const char * const pll_clk_groups[] = { 954 + "gpio107", 955 + }; 956 + 957 + static const char * const pri_mi2s_groups[] = { 958 + "gpio125", 959 + }; 960 + 961 + static const char * const prng_rosc_groups[] = { 962 + "gpio73", "gpio75", "gpio81", "gpio83", "gpio81", 963 + }; 964 + 965 + static const char * const qdss_cti_groups[] = { 966 + "gpio2", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", "gpio85", "gpio93", 967 + }; 968 + 969 + static const char * const qdss_gpio_groups[] = { 970 + "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", "gpio105", "gpio106", "gpio107", 971 + "gpio110", "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio117", "gpio118", 972 + "gpio119", "gpio120", "gpio188", "gpio189", "gpio190", "gpio191", "gpio192", "gpio193", 973 + "gpio194", "gpio195", "gpio196", "gpio197", "gpio198", "gpio199", "gpio200", "gpio201", 974 + "gpio202", "gpio203", "gpio204", "gpio205", 975 + }; 976 + 977 + static const char * const qlink0_enable_groups[] = { 978 + "gpio157", 979 + }; 980 + 981 + static const char * const qlink0_request_groups[] = { 982 + "gpio156", 983 + }; 984 + 985 + static const char * const qlink0_wmss_groups[] = { 986 + "gpio158", 987 + }; 988 + 989 + static const char * const qlink1_enable_groups[] = { 990 + "gpio160", 991 + }; 992 + 993 + static const char * const qlink1_request_groups[] = { 994 + "gpio159", 995 + }; 996 + 997 + static const char * const qlink1_wmss_groups[] = { 998 + "gpio161", 999 + }; 1000 + 1001 + static const char * const qlink2_enable_groups[] = { 1002 + "gpio163", 1003 + }; 1004 + 1005 + static const char * const qlink2_request_groups[] = { 1006 + "gpio162", 1007 + }; 1008 + 1009 + static const char * const qlink2_wmss_groups[] = { 1010 + "gpio164", 1011 + }; 1012 + 1013 + static const char * const qspi0_groups[] = { 1014 + "gpio52", 1015 + }; 1016 + 1017 + static const char * const qspi1_groups[] = { 1018 + "gpio53", 1019 + }; 1020 + 1021 + static const char * const qspi2_groups[] = { 1022 + "gpio48", 1023 + }; 1024 + 1025 + static const char * const qspi3_groups[] = { 1026 + "gpio49", 1027 + }; 1028 + 1029 + static const char * const qspi_clk_groups[] = { 1030 + "gpio50", 1031 + }; 1032 + 1033 + static const char * const qspi_cs_groups[] = { 1034 + "gpio51", "gpio54", 1035 + }; 1036 + 1037 + static const char * const qup0_groups[] = { 1038 + "gpio0", "gpio1", "gpio2", "gpio3", 1039 + }; 1040 + 1041 + static const char * const qup1_groups[] = { 1042 + "gpio4", "gpio5", "gpio6", "gpio7", 1043 + }; 1044 + 1045 + static const char * const qup10_groups[] = { 1046 + "gpio36", "gpio37", "gpio38", "gpio39", 1047 + }; 1048 + 1049 + static const char * const qup11_groups[] = { 1050 + "gpio40", "gpio41", "gpio42", "gpio43", 1051 + }; 1052 + 1053 + static const char * const qup12_groups[] = { 1054 + "gpio44", "gpio45", "gpio46", "gpio47", 1055 + }; 1056 + 1057 + static const char * const qup13_groups[] = { 1058 + "gpio48", "gpio49", "gpio50", "gpio51", 1059 + }; 1060 + 1061 + static const char * const qup14_groups[] = { 1062 + "gpio52", "gpio53", "gpio54", "gpio55", 1063 + }; 1064 + 1065 + static const char * const qup15_groups[] = { 1066 + "gpio56", "gpio57", "gpio58", "gpio59", 1067 + }; 1068 + 1069 + static const char * const qup16_groups[] = { 1070 + "gpio60", "gpio61", "gpio62", "gpio63", 1071 + }; 1072 + 1073 + static const char * const qup17_groups[] = { 1074 + "gpio64", "gpio65", "gpio66", "gpio67", 1075 + }; 1076 + 1077 + static const char * const qup18_groups[] = { 1078 + "gpio68", "gpio69", "gpio70", "gpio71", 1079 + }; 1080 + 1081 + static const char * const qup19_groups[] = { 1082 + "gpio72", "gpio73", "gpio74", "gpio75", 1083 + }; 1084 + 1085 + static const char * const qup2_groups[] = { 1086 + "gpio8", "gpio9", "gpio10", "gpio11", 1087 + }; 1088 + 1089 + static const char * const qup20_groups[] = { 1090 + "gpio76", "gpio77", "gpio78", "gpio79", 1091 + }; 1092 + 1093 + static const char * const qup21_groups[] = { 1094 + "gpio80", "gpio81", "gpio82", "gpio83", 1095 + }; 1096 + 1097 + static const char * const qup3_groups[] = { 1098 + "gpio12", "gpio13", "gpio14", "gpio15", 1099 + }; 1100 + 1101 + static const char * const qup4_groups[] = { 1102 + "gpio16", "gpio17", "gpio18", "gpio19", 1103 + }; 1104 + 1105 + static const char * const qup5_groups[] = { 1106 + "gpio84", "gpio85", "gpio206", "gpio207", 1107 + }; 1108 + 1109 + static const char * const qup6_groups[] = { 1110 + "gpio20", "gpio21", "gpio22", "gpio23", 1111 + }; 1112 + 1113 + static const char * const qup7_groups[] = { 1114 + "gpio24", "gpio25", "gpio26", "gpio27", 1115 + }; 1116 + 1117 + static const char * const qup8_groups[] = { 1118 + "gpio28", "gpio29", "gpio30", "gpio31", 1119 + }; 1120 + 1121 + static const char * const qup9_groups[] = { 1122 + "gpio32", "gpio33", "gpio34", "gpio35", 1123 + }; 1124 + 1125 + static const char * const qup_l4_groups[] = { 1126 + "gpio24", "gpio40", "gpio58", "gpio63", 1127 + }; 1128 + 1129 + static const char * const qup_l5_groups[] = { 1130 + "gpio25", "gpio41", "gpio59", "gpio66", 1131 + }; 1132 + 1133 + static const char * const qup_l6_groups[] = { 1134 + "gpio26", "gpio42", "gpio62", "gpio67", 1135 + }; 1136 + 1137 + static const char * const sd_write_groups[] = { 1138 + "gpio93", 1139 + }; 1140 + 1141 + static const char * const sdc40_groups[] = { 1142 + "gpio52", 1143 + }; 1144 + 1145 + static const char * const sdc41_groups[] = { 1146 + "gpio53", 1147 + }; 1148 + 1149 + static const char * const sdc42_groups[] = { 1150 + "gpio48", 1151 + }; 1152 + 1153 + static const char * const sdc43_groups[] = { 1154 + "gpio49", 1155 + }; 1156 + 1157 + static const char * const sdc4_clk_groups[] = { 1158 + "gpio50", 1159 + }; 1160 + 1161 + static const char * const sdc4_cmd_groups[] = { 1162 + "gpio51", 1163 + }; 1164 + 1165 + static const char * const sec_mi2s_groups[] = { 1166 + "gpio124", 1167 + }; 1168 + 1169 + static const char * const tb_trig_groups[] = { 1170 + "gpio64", "gpio137", 1171 + }; 1172 + 1173 + static const char * const tgu_ch0_groups[] = { 1174 + "gpio64", 1175 + }; 1176 + 1177 + static const char * const tgu_ch1_groups[] = { 1178 + "gpio65", 1179 + }; 1180 + 1181 + static const char * const tgu_ch2_groups[] = { 1182 + "gpio66", 1183 + }; 1184 + 1185 + static const char * const tgu_ch3_groups[] = { 1186 + "gpio67", 1187 + }; 1188 + 1189 + static const char * const tmess_prng0_groups[] = { 1190 + "gpio80", 1191 + }; 1192 + 1193 + static const char * const tmess_prng1_groups[] = { 1194 + "gpio79", 1195 + }; 1196 + 1197 + static const char * const tmess_prng2_groups[] = { 1198 + "gpio77", 1199 + }; 1200 + 1201 + static const char * const tmess_prng3_groups[] = { 1202 + "gpio76", 1203 + }; 1204 + 1205 + static const char * const tsense_pwm1_groups[] = { 1206 + "gpio91", 1207 + }; 1208 + 1209 + static const char * const tsense_pwm2_groups[] = { 1210 + "gpio91", 1211 + }; 1212 + 1213 + static const char * const uim0_clk_groups[] = { 1214 + "gpio131", 1215 + }; 1216 + 1217 + static const char * const uim0_data_groups[] = { 1218 + "gpio130", 1219 + }; 1220 + 1221 + static const char * const uim0_present_groups[] = { 1222 + "gpio133", 1223 + }; 1224 + 1225 + static const char * const uim0_reset_groups[] = { 1226 + "gpio132", 1227 + }; 1228 + 1229 + static const char * const uim1_clk_groups[] = { 1230 + "gpio135", 1231 + }; 1232 + 1233 + static const char * const uim1_data_groups[] = { 1234 + "gpio134", 1235 + }; 1236 + 1237 + static const char * const uim1_present_groups[] = { 1238 + "gpio137", 1239 + }; 1240 + 1241 + static const char * const uim1_reset_groups[] = { 1242 + "gpio136", 1243 + }; 1244 + 1245 + static const char * const usb2phy_ac_groups[] = { 1246 + "gpio90", 1247 + }; 1248 + 1249 + static const char * const usb_phy_groups[] = { 1250 + "gpio91", 1251 + }; 1252 + 1253 + static const char * const vfr_0_groups[] = { 1254 + "gpio89", 1255 + }; 1256 + 1257 + static const char * const vfr_1_groups[] = { 1258 + "gpio155", 1259 + }; 1260 + 1261 + static const char * const vsense_trigger_groups[] = { 1262 + "gpio18", 1263 + }; 1264 + 1265 + static const struct msm_function sm8450_functions[] = { 1266 + FUNCTION(gpio), 1267 + FUNCTION(aon_cam), 1268 + FUNCTION(atest_char), 1269 + FUNCTION(atest_usb), 1270 + FUNCTION(audio_ref), 1271 + FUNCTION(cam_mclk), 1272 + FUNCTION(cci_async), 1273 + FUNCTION(cci_i2c), 1274 + FUNCTION(cci_timer), 1275 + FUNCTION(cmu_rng), 1276 + FUNCTION(coex_uart1), 1277 + FUNCTION(coex_uart2), 1278 + FUNCTION(cri_trng), 1279 + FUNCTION(cri_trng0), 1280 + FUNCTION(cri_trng1), 1281 + FUNCTION(dbg_out), 1282 + FUNCTION(ddr_bist), 1283 + FUNCTION(ddr_pxi0), 1284 + FUNCTION(ddr_pxi1), 1285 + FUNCTION(ddr_pxi2), 1286 + FUNCTION(ddr_pxi3), 1287 + FUNCTION(dp_hot), 1288 + FUNCTION(gcc_gp1), 1289 + FUNCTION(gcc_gp2), 1290 + FUNCTION(gcc_gp3), 1291 + FUNCTION(ibi_i3c), 1292 + FUNCTION(jitter_bist), 1293 + FUNCTION(mdp_vsync), 1294 + FUNCTION(mdp_vsync0), 1295 + FUNCTION(mdp_vsync1), 1296 + FUNCTION(mdp_vsync2), 1297 + FUNCTION(mdp_vsync3), 1298 + FUNCTION(mi2s0_data0), 1299 + FUNCTION(mi2s0_data1), 1300 + FUNCTION(mi2s0_sck), 1301 + FUNCTION(mi2s0_ws), 1302 + FUNCTION(mi2s2_data0), 1303 + FUNCTION(mi2s2_data1), 1304 + FUNCTION(mi2s2_sck), 1305 + FUNCTION(mi2s2_ws), 1306 + FUNCTION(mss_grfc0), 1307 + FUNCTION(mss_grfc1), 1308 + FUNCTION(mss_grfc10), 1309 + FUNCTION(mss_grfc11), 1310 + FUNCTION(mss_grfc12), 1311 + FUNCTION(mss_grfc2), 1312 + FUNCTION(mss_grfc3), 1313 + FUNCTION(mss_grfc4), 1314 + FUNCTION(mss_grfc5), 1315 + FUNCTION(mss_grfc6), 1316 + FUNCTION(mss_grfc7), 1317 + FUNCTION(mss_grfc8), 1318 + FUNCTION(mss_grfc9), 1319 + FUNCTION(nav), 1320 + FUNCTION(pcie0_clkreqn), 1321 + FUNCTION(pcie1_clkreqn), 1322 + FUNCTION(phase_flag), 1323 + FUNCTION(pll_bist), 1324 + FUNCTION(pll_clk), 1325 + FUNCTION(pri_mi2s), 1326 + FUNCTION(prng_rosc), 1327 + FUNCTION(qdss_cti), 1328 + FUNCTION(qdss_gpio), 1329 + FUNCTION(qlink0_enable), 1330 + FUNCTION(qlink0_request), 1331 + FUNCTION(qlink0_wmss), 1332 + FUNCTION(qlink1_enable), 1333 + FUNCTION(qlink1_request), 1334 + FUNCTION(qlink1_wmss), 1335 + FUNCTION(qlink2_enable), 1336 + FUNCTION(qlink2_request), 1337 + FUNCTION(qlink2_wmss), 1338 + FUNCTION(qspi0), 1339 + FUNCTION(qspi1), 1340 + FUNCTION(qspi2), 1341 + FUNCTION(qspi3), 1342 + FUNCTION(qspi_clk), 1343 + FUNCTION(qspi_cs), 1344 + FUNCTION(qup0), 1345 + FUNCTION(qup1), 1346 + FUNCTION(qup10), 1347 + FUNCTION(qup11), 1348 + FUNCTION(qup12), 1349 + FUNCTION(qup13), 1350 + FUNCTION(qup14), 1351 + FUNCTION(qup15), 1352 + FUNCTION(qup16), 1353 + FUNCTION(qup17), 1354 + FUNCTION(qup18), 1355 + FUNCTION(qup19), 1356 + FUNCTION(qup2), 1357 + FUNCTION(qup20), 1358 + FUNCTION(qup21), 1359 + FUNCTION(qup3), 1360 + FUNCTION(qup4), 1361 + FUNCTION(qup5), 1362 + FUNCTION(qup6), 1363 + FUNCTION(qup7), 1364 + FUNCTION(qup8), 1365 + FUNCTION(qup9), 1366 + FUNCTION(qup_l4), 1367 + FUNCTION(qup_l5), 1368 + FUNCTION(qup_l6), 1369 + FUNCTION(sd_write), 1370 + FUNCTION(sdc40), 1371 + FUNCTION(sdc41), 1372 + FUNCTION(sdc42), 1373 + FUNCTION(sdc43), 1374 + FUNCTION(sdc4_clk), 1375 + FUNCTION(sdc4_cmd), 1376 + FUNCTION(sec_mi2s), 1377 + FUNCTION(tb_trig), 1378 + FUNCTION(tgu_ch0), 1379 + FUNCTION(tgu_ch1), 1380 + FUNCTION(tgu_ch2), 1381 + FUNCTION(tgu_ch3), 1382 + FUNCTION(tmess_prng0), 1383 + FUNCTION(tmess_prng1), 1384 + FUNCTION(tmess_prng2), 1385 + FUNCTION(tmess_prng3), 1386 + FUNCTION(tsense_pwm1), 1387 + FUNCTION(tsense_pwm2), 1388 + FUNCTION(uim0_clk), 1389 + FUNCTION(uim0_data), 1390 + FUNCTION(uim0_present), 1391 + FUNCTION(uim0_reset), 1392 + FUNCTION(uim1_clk), 1393 + FUNCTION(uim1_data), 1394 + FUNCTION(uim1_present), 1395 + FUNCTION(uim1_reset), 1396 + FUNCTION(usb2phy_ac), 1397 + FUNCTION(usb_phy), 1398 + FUNCTION(vfr_0), 1399 + FUNCTION(vfr_1), 1400 + FUNCTION(vsense_trigger), 1401 + }; 1402 + 1403 + /* Every pin is maintained as a single group, and missing or non-existing pin 1404 + * would be maintained as dummy group to synchronize pin group index with 1405 + * pin descriptor registered with pinctrl core. 1406 + * Clients would not be able to request these dummy pin groups. 1407 + */ 1408 + static const struct msm_pingroup sm8450_groups[] = { 1409 + [0] = PINGROUP(0, qup0, _, _, _, _, _, _, _, _), 1410 + [1] = PINGROUP(1, qup0, _, _, _, _, _, _, _, _), 1411 + [2] = PINGROUP(2, qup0, qdss_cti, _, _, _, _, _, _, _), 1412 + [3] = PINGROUP(3, qup0, _, _, _, _, _, _, _, _), 1413 + [4] = PINGROUP(4, qup1, phase_flag, _, _, _, _, _, _, _), 1414 + [5] = PINGROUP(5, qup1, phase_flag, _, _, _, _, _, _, _), 1415 + [6] = PINGROUP(6, qup1, phase_flag, _, _, _, _, _, _, _), 1416 + [7] = PINGROUP(7, qup1, phase_flag, _, _, _, _, _, _, _), 1417 + [8] = PINGROUP(8, qup2, _, _, _, _, _, _, _, _), 1418 + [9] = PINGROUP(9, qup2, dbg_out, _, _, _, _, _, _, _), 1419 + [10] = PINGROUP(10, qup2, phase_flag, _, _, _, _, _, _, _), 1420 + [11] = PINGROUP(11, qup2, phase_flag, _, _, _, _, _, _, _), 1421 + [12] = PINGROUP(12, qup3, phase_flag, _, _, _, _, _, _, _), 1422 + [13] = PINGROUP(13, qup3, phase_flag, _, _, _, _, _, _, _), 1423 + [14] = PINGROUP(14, qup3, phase_flag, _, _, _, _, _, _, _), 1424 + [15] = PINGROUP(15, qup3, phase_flag, _, _, _, _, _, _, _), 1425 + [16] = PINGROUP(16, qup4, phase_flag, _, _, _, _, _, _, _), 1426 + [17] = PINGROUP(17, qup4, phase_flag, _, _, _, _, _, _, _), 1427 + [18] = PINGROUP(18, qup4, phase_flag, _, vsense_trigger, _, _, _, _, _), 1428 + [19] = PINGROUP(19, qup4, phase_flag, _, _, _, _, _, _, _), 1429 + [20] = PINGROUP(20, qup6, pll_bist, _, _, _, _, _, _, _), 1430 + [21] = PINGROUP(21, qup6, _, _, _, _, _, _, _, _), 1431 + [22] = PINGROUP(22, qup6, _, _, _, _, _, _, _, _), 1432 + [23] = PINGROUP(23, qup6, _, _, _, _, _, _, _, _), 1433 + [24] = PINGROUP(24, qup7, qup_l4, jitter_bist, _, _, _, _, _, _), 1434 + [25] = PINGROUP(25, qup7, qup_l5, phase_flag, _, _, _, _, _, _), 1435 + [26] = PINGROUP(26, qup7, qup_l6, phase_flag, _, _, _, _, _, _), 1436 + [27] = PINGROUP(27, qup7, _, _, _, _, _, _, _, _), 1437 + [28] = PINGROUP(28, qup8, ibi_i3c, _, _, _, _, _, _, _), 1438 + [29] = PINGROUP(29, qup8, ibi_i3c, _, _, _, _, _, _, _), 1439 + [30] = PINGROUP(30, qup8, _, _, _, _, _, _, _, _), 1440 + [31] = PINGROUP(31, qup8, _, _, _, _, _, _, _, _), 1441 + [32] = PINGROUP(32, qup9, ibi_i3c, _, _, _, _, _, _, _), 1442 + [33] = PINGROUP(33, qup9, ibi_i3c, _, _, _, _, _, _, _), 1443 + [34] = PINGROUP(34, qup9, _, _, _, _, _, _, _, _), 1444 + [35] = PINGROUP(35, qup9, _, _, _, _, _, _, _, _), 1445 + [36] = PINGROUP(36, qup10, ddr_bist, _, _, _, _, _, _, _), 1446 + [37] = PINGROUP(37, qup10, ddr_bist, atest_usb, _, _, _, _, _, _), 1447 + [38] = PINGROUP(38, qup10, _, _, _, _, _, _, _, _), 1448 + [39] = PINGROUP(39, qup10, atest_usb, _, _, _, _, _, _, _), 1449 + [40] = PINGROUP(40, qup11, qup_l4, ddr_bist, ddr_pxi1, _, _, _, _, _), 1450 + [41] = PINGROUP(41, qup11, qup_l5, ddr_bist, ddr_pxi1, _, _, _, _, _), 1451 + [42] = PINGROUP(42, qup11, qup_l6, _, _, _, _, _, _, _), 1452 + [43] = PINGROUP(43, qup11, ddr_pxi3, _, _, _, _, _, _, _), 1453 + [44] = PINGROUP(44, qup12, ddr_pxi3, _, _, _, _, _, _, _), 1454 + [45] = PINGROUP(45, qup12, ddr_pxi2, _, _, _, _, _, _, _), 1455 + [46] = PINGROUP(46, qup12, mdp_vsync, _, _, _, _, _, _, _), 1456 + [47] = PINGROUP(47, qup12, dp_hot, mdp_vsync, ddr_pxi2, _, _, _, _, _), 1457 + [48] = PINGROUP(48, qup13, qspi2, sdc42, _, _, _, _, _, _), 1458 + [49] = PINGROUP(49, qup13, qspi3, sdc43, _, _, _, _, _, _), 1459 + [50] = PINGROUP(50, qup13, qspi_clk, sdc4_clk, _, _, _, _, _, _), 1460 + [51] = PINGROUP(51, qup13, qspi_cs, sdc4_cmd, ddr_pxi0, _, _, _, _, _), 1461 + [52] = PINGROUP(52, qup14, qspi0, sdc40, ddr_pxi0, _, _, _, _, _), 1462 + [53] = PINGROUP(53, qup14, qspi1, sdc41, _, _, _, _, _, _), 1463 + [54] = PINGROUP(54, qup14, qspi_cs, _, _, _, _, _, _, _), 1464 + [55] = PINGROUP(55, qup14, atest_usb, _, _, _, _, _, _, _), 1465 + [56] = PINGROUP(56, qup15, ibi_i3c, _, _, _, _, _, _, _), 1466 + [57] = PINGROUP(57, qup15, ibi_i3c, _, _, _, _, _, _, _), 1467 + [58] = PINGROUP(58, qup15, qup_l4, _, _, _, _, _, _, _), 1468 + [59] = PINGROUP(59, qup15, qup_l5, _, _, _, _, _, _, _), 1469 + [60] = PINGROUP(60, qup16, ibi_i3c, _, _, _, _, _, _, _), 1470 + [61] = PINGROUP(61, qup16, ibi_i3c, _, _, _, _, _, _, _), 1471 + [62] = PINGROUP(62, qup16, qup_l6, _, _, _, _, _, _, _), 1472 + [63] = PINGROUP(63, qup16, qup_l4, _, _, _, _, _, _, _), 1473 + [64] = PINGROUP(64, qup17, tb_trig, tgu_ch0, _, _, _, _, _, _), 1474 + [65] = PINGROUP(65, qup17, tgu_ch1, _, _, _, _, _, _, _), 1475 + [66] = PINGROUP(66, qup17, qup_l5, tgu_ch2, _, _, _, _, _, _), 1476 + [67] = PINGROUP(67, qup17, qup_l6, tgu_ch3, _, _, _, _, _, _), 1477 + [68] = PINGROUP(68, qup18, _, _, _, _, _, _, _, _), 1478 + [69] = PINGROUP(69, qup18, _, _, _, _, _, _, _, _), 1479 + [70] = PINGROUP(70, qup18, _, _, _, _, _, _, _, _), 1480 + [71] = PINGROUP(71, qup18, cri_trng0, _, _, _, _, _, _, _), 1481 + [72] = PINGROUP(72, qup19, cri_trng1, _, _, _, _, _, _, _), 1482 + [73] = PINGROUP(73, qup19, prng_rosc, _, _, _, _, _, _, _), 1483 + [74] = PINGROUP(74, qup19, _, _, _, _, _, _, _, _), 1484 + [75] = PINGROUP(75, qup19, prng_rosc, _, _, _, _, _, _, _), 1485 + [76] = PINGROUP(76, qup20, phase_flag, tmess_prng3, _, _, _, _, _, _), 1486 + [77] = PINGROUP(77, qup20, phase_flag, tmess_prng2, _, _, _, _, _, _), 1487 + [78] = PINGROUP(78, qup20, phase_flag, _, _, _, _, _, _, _), 1488 + [79] = PINGROUP(79, qup20, phase_flag, tmess_prng1, _, _, _, _, _, _), 1489 + [80] = PINGROUP(80, qup21, qdss_cti, phase_flag, tmess_prng0, _, _, _, _, _), 1490 + [81] = PINGROUP(81, qup21, qdss_cti, phase_flag, prng_rosc, _, _, _, _, _), 1491 + [82] = PINGROUP(82, qup21, qdss_cti, phase_flag, _, _, _, _, _, _), 1492 + [83] = PINGROUP(83, qup21, qdss_cti, phase_flag, prng_rosc, _, _, _, _, _), 1493 + [84] = PINGROUP(84, qup5, qdss_cti, _, _, _, _, _, _, _), 1494 + [85] = PINGROUP(85, qup5, qdss_cti, _, _, _, _, _, _, _), 1495 + [86] = PINGROUP(86, mdp_vsync, mdp_vsync0, mdp_vsync1, gcc_gp1, atest_char, _, _, _, _), 1496 + [87] = PINGROUP(87, mdp_vsync, mdp_vsync2, mdp_vsync3, gcc_gp2, atest_char, _, _, _, _), 1497 + [88] = PINGROUP(88, mdp_vsync, gcc_gp3, atest_char, _, _, _, _, _, _), 1498 + [89] = PINGROUP(89, vfr_0, atest_char, _, _, _, _, _, _, _), 1499 + [90] = PINGROUP(90, usb2phy_ac, atest_char, _, _, _, _, _, _, _), 1500 + [91] = PINGROUP(91, usb_phy, tsense_pwm1, tsense_pwm2, _, _, _, _, _, _), 1501 + [92] = PINGROUP(92, phase_flag, _, _, _, _, _, _, _, _), 1502 + [93] = PINGROUP(93, sd_write, qdss_cti, phase_flag, _, _, _, _, _, _), 1503 + [94] = PINGROUP(94, cmu_rng, phase_flag, _, _, _, _, _, _, _), 1504 + [95] = PINGROUP(95, pcie0_clkreqn, cmu_rng, phase_flag, _, _, _, _, _, _), 1505 + [96] = PINGROUP(96, cmu_rng, phase_flag, _, _, _, _, _, _, _), 1506 + [97] = PINGROUP(97, cmu_rng, phase_flag, _, _, _, _, _, _, _), 1507 + [98] = PINGROUP(98, pcie1_clkreqn, phase_flag, _, _, _, _, _, _, _), 1508 + [99] = PINGROUP(99, phase_flag, cri_trng, _, _, _, _, _, _, _), 1509 + [100] = PINGROUP(100, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1510 + [101] = PINGROUP(101, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1511 + [102] = PINGROUP(102, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1512 + [103] = PINGROUP(103, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1513 + [104] = PINGROUP(104, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1514 + [105] = PINGROUP(105, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1515 + [106] = PINGROUP(106, cam_mclk, qdss_gpio, _, _, _, _, _, _, _), 1516 + [107] = PINGROUP(107, cam_mclk, qdss_gpio, pll_clk, _, _, _, _, _, _), 1517 + [108] = PINGROUP(108, aon_cam, _, _, _, _, _, _, _, _), 1518 + [109] = PINGROUP(109, cci_async, _, _, _, _, _, _, _, _), 1519 + [110] = PINGROUP(110, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1520 + [111] = PINGROUP(111, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1521 + [112] = PINGROUP(112, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1522 + [113] = PINGROUP(113, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1523 + [114] = PINGROUP(114, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1524 + [115] = PINGROUP(115, cci_i2c, qdss_gpio, _, _, _, _, _, _, _), 1525 + [116] = PINGROUP(116, cci_timer, _, _, _, _, _, _, _, _), 1526 + [117] = PINGROUP(117, cci_timer, qdss_gpio, _, _, _, _, _, _, _), 1527 + [118] = PINGROUP(118, cci_timer, qdss_gpio, _, _, _, _, _, _, _), 1528 + [119] = PINGROUP(119, cci_timer, cci_async, qdss_gpio, _, _, _, _, _, _), 1529 + [120] = PINGROUP(120, cci_timer, cci_async, qdss_gpio, _, _, _, _, _, _), 1530 + [121] = PINGROUP(121, mi2s2_sck, _, _, _, _, _, _, _, _), 1531 + [122] = PINGROUP(122, mi2s2_data0, _, _, _, _, _, _, _, _), 1532 + [123] = PINGROUP(123, mi2s2_ws, _, _, _, _, _, _, _, _), 1533 + [124] = PINGROUP(124, mi2s2_data1, sec_mi2s, audio_ref, _, _, _, _, _, _), 1534 + [125] = PINGROUP(125, pri_mi2s, _, _, _, _, _, _, _, _), 1535 + [126] = PINGROUP(126, mi2s0_sck, _, _, _, _, _, _, _, _), 1536 + [127] = PINGROUP(127, mi2s0_data0, _, _, _, _, _, _, _, _), 1537 + [128] = PINGROUP(128, mi2s0_data1, _, _, _, _, _, _, _, _), 1538 + [129] = PINGROUP(129, mi2s0_ws, _, _, _, _, _, _, _, _), 1539 + [130] = PINGROUP(130, uim0_data, _, _, _, _, _, _, _, _), 1540 + [131] = PINGROUP(131, uim0_clk, _, _, _, _, _, _, _, _), 1541 + [132] = PINGROUP(132, uim0_reset, _, _, _, _, _, _, _, _), 1542 + [133] = PINGROUP(133, uim0_present, _, _, _, _, _, _, _, _), 1543 + [134] = PINGROUP(134, uim1_data, gcc_gp1, _, _, _, _, _, _, _), 1544 + [135] = PINGROUP(135, uim1_clk, gcc_gp2, _, _, _, _, _, _, _), 1545 + [136] = PINGROUP(136, uim1_reset, gcc_gp3, _, _, _, _, _, _, _), 1546 + [137] = PINGROUP(137, uim1_present, tb_trig, _, _, _, _, _, _, _), 1547 + [138] = PINGROUP(138, _, mss_grfc0, _, _, _, _, _, _, _), 1548 + [139] = PINGROUP(139, _, mss_grfc1, _, _, _, _, _, _, _), 1549 + [140] = PINGROUP(140, _, mss_grfc2, _, _, _, _, _, _, _), 1550 + [141] = PINGROUP(141, _, mss_grfc3, _, _, _, _, _, _, _), 1551 + [142] = PINGROUP(142, _, mss_grfc4, _, _, _, _, _, _, _), 1552 + [143] = PINGROUP(143, _, mss_grfc5, _, _, _, _, _, _, _), 1553 + [144] = PINGROUP(144, _, mss_grfc6, _, _, _, _, _, _, _), 1554 + [145] = PINGROUP(145, _, mss_grfc7, _, _, _, _, _, _, _), 1555 + [146] = PINGROUP(146, _, mss_grfc8, _, _, _, _, _, _, _), 1556 + [147] = PINGROUP(147, _, mss_grfc9, _, _, _, _, _, _, _), 1557 + [148] = PINGROUP(148, coex_uart1, atest_usb, _, _, _, _, _, _, _), 1558 + [149] = PINGROUP(149, coex_uart1, atest_usb, _, _, _, _, _, _, _), 1559 + [150] = PINGROUP(150, coex_uart2, mss_grfc10, _, _, _, _, _, _, _), 1560 + [151] = PINGROUP(151, coex_uart2, mss_grfc11, _, _, _, _, _, _, _), 1561 + [152] = PINGROUP(152, mss_grfc12, _, _, _, _, _, _, _, _), 1562 + [153] = PINGROUP(153, mss_grfc0, nav, _, _, _, _, _, _, _), 1563 + [154] = PINGROUP(154, nav, _, _, _, _, _, _, _, _), 1564 + [155] = PINGROUP(155, nav, vfr_1, _, _, _, _, _, _, _), 1565 + [156] = PINGROUP(156, qlink0_request, _, _, _, _, _, _, _, _), 1566 + [157] = PINGROUP(157, qlink0_enable, _, _, _, _, _, _, _, _), 1567 + [158] = PINGROUP(158, qlink0_wmss, _, _, _, _, _, _, _, _), 1568 + [159] = PINGROUP(159, qlink1_request, _, _, _, _, _, _, _, _), 1569 + [160] = PINGROUP(160, qlink1_enable, _, _, _, _, _, _, _, _), 1570 + [161] = PINGROUP(161, qlink1_wmss, _, _, _, _, _, _, _, _), 1571 + [162] = PINGROUP(162, qlink2_request, _, _, _, _, _, _, _, _), 1572 + [163] = PINGROUP(163, qlink2_enable, _, _, _, _, _, _, _, _), 1573 + [164] = PINGROUP(164, qlink2_wmss, _, _, _, _, _, _, _, _), 1574 + [165] = PINGROUP(165, _, _, _, _, _, _, _, _, _), 1575 + [166] = PINGROUP(166, _, _, _, _, _, _, _, _, _), 1576 + [167] = PINGROUP(167, _, _, _, _, _, _, _, _, _), 1577 + [168] = PINGROUP(168, _, _, _, _, _, _, _, _, _), 1578 + [169] = PINGROUP(169, _, _, _, _, _, _, _, _, _), 1579 + [170] = PINGROUP(170, _, _, _, _, _, _, _, _, _), 1580 + [171] = PINGROUP(171, _, _, _, _, _, _, _, _, _), 1581 + [172] = PINGROUP(172, _, _, _, _, _, _, _, _, _), 1582 + [173] = PINGROUP(173, _, _, _, _, _, _, _, _, _), 1583 + [174] = PINGROUP(174, _, _, _, _, _, _, _, _, _), 1584 + [175] = PINGROUP(175, _, _, _, _, _, _, _, _, _), 1585 + [176] = PINGROUP(176, _, _, _, _, _, _, _, _, _), 1586 + [177] = PINGROUP(177, _, _, _, _, _, _, _, _, _), 1587 + [178] = PINGROUP(178, _, _, _, _, _, _, _, _, _), 1588 + [179] = PINGROUP(179, _, _, _, _, _, _, _, _, _), 1589 + [180] = PINGROUP(180, _, _, _, _, _, _, _, _, _), 1590 + [181] = PINGROUP(181, _, _, _, _, _, _, _, _, _), 1591 + [182] = PINGROUP(182, _, _, _, _, _, _, _, _, _), 1592 + [183] = PINGROUP(183, _, _, _, _, _, _, _, _, _), 1593 + [184] = PINGROUP(184, _, _, _, _, _, _, _, _, _), 1594 + [185] = PINGROUP(185, _, _, _, _, _, _, _, _, _), 1595 + [186] = PINGROUP(186, _, _, _, _, _, _, _, _, _), 1596 + [187] = PINGROUP(187, _, _, _, _, _, _, _, _, _), 1597 + [188] = PINGROUP(188, _, qdss_gpio, _, _, _, _, _, _, _), 1598 + [189] = PINGROUP(189, _, qdss_gpio, _, _, _, _, _, _, _), 1599 + [190] = PINGROUP(190, qdss_gpio, _, _, _, _, _, _, _, _), 1600 + [191] = PINGROUP(191, qdss_gpio, _, _, _, _, _, _, _, _), 1601 + [192] = PINGROUP(192, _, qdss_gpio, _, _, _, _, _, _, _), 1602 + [193] = PINGROUP(193, _, qdss_gpio, _, _, _, _, _, _, _), 1603 + [194] = PINGROUP(194, _, qdss_gpio, _, _, _, _, _, _, _), 1604 + [195] = PINGROUP(195, _, qdss_gpio, _, _, _, _, _, _, _), 1605 + [196] = PINGROUP(196, _, qdss_gpio, _, _, _, _, _, _, _), 1606 + [197] = PINGROUP(197, _, qdss_gpio, _, _, _, _, _, _, _), 1607 + [198] = PINGROUP(198, _, qdss_gpio, _, _, _, _, _, _, _), 1608 + [199] = PINGROUP(199, _, qdss_gpio, _, _, _, _, _, _, _), 1609 + [200] = PINGROUP(200, _, qdss_gpio, _, _, _, _, _, _, _), 1610 + [201] = PINGROUP(201, _, qdss_gpio, _, _, _, _, _, _, _), 1611 + [202] = PINGROUP(202, qdss_gpio, _, _, _, _, _, _, _, _), 1612 + [203] = PINGROUP(203, qdss_gpio, _, _, _, _, _, _, _, _), 1613 + [204] = PINGROUP(204, qdss_gpio, _, _, _, _, _, _, _, _), 1614 + [205] = PINGROUP(205, qdss_gpio, _, _, _, _, _, _, _, _), 1615 + [206] = PINGROUP(206, qup5, _, _, _, _, _, _, _, _), 1616 + [207] = PINGROUP(207, qup5, _, _, _, _, _, _, _, _), 1617 + [208] = PINGROUP(208, cci_i2c, _, _, _, _, _, _, _, _), 1618 + [209] = PINGROUP(209, cci_i2c, _, _, _, _, _, _, _, _), 1619 + [210] = UFS_RESET(ufs_reset, 0xde000), 1620 + [211] = SDC_QDSD_PINGROUP(sdc2_clk, 0xd6000, 14, 6), 1621 + [212] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xd6000, 11, 3), 1622 + [213] = SDC_QDSD_PINGROUP(sdc2_data, 0xd6000, 9, 0), 1623 + }; 1624 + 1625 + static const struct msm_gpio_wakeirq_map sm8450_pdc_map[] = { 1626 + { 2, 70 }, { 3, 77 }, { 7, 52 }, { 8, 108 }, { 10, 128 }, { 11, 53 }, 1627 + { 12, 129 }, { 13, 130 }, { 14, 131 }, { 15, 67 }, { 19, 69 }, { 21, 132 }, 1628 + { 23, 54 }, { 26, 56 }, { 27, 71 }, { 28, 57 }, { 31, 55 }, { 32, 58 }, 1629 + { 34, 72 }, { 35, 43 }, { 36, 78 }, { 38, 79 }, { 39, 62 }, { 40, 80 }, 1630 + { 41, 133 }, { 43, 81 }, { 44, 87 }, { 45, 134 }, { 46, 66 }, { 47, 63 }, 1631 + { 50, 88 }, { 51, 89 }, { 55, 90 }, { 56, 59 }, { 59, 82 }, { 60, 60 }, 1632 + { 62, 135 }, { 63, 91 }, { 66, 136 }, { 67, 44 }, { 69, 137 }, { 71, 97 }, 1633 + { 75, 73 }, { 79, 74 }, { 80, 96 }, { 81, 98 }, { 82, 45 }, { 83, 99 }, 1634 + { 84, 94 }, { 85, 100 }, { 86, 101 }, { 87, 102 }, { 88, 92 }, { 89, 83 }, 1635 + { 90, 84 }, { 91, 85 }, { 92, 46 }, { 95, 103 }, { 96, 104 }, { 98, 105 }, 1636 + { 99, 106 }, { 115, 95 }, { 116, 76 }, { 117, 75 }, { 118, 86 }, { 119, 93 }, 1637 + { 133, 47 }, { 137, 42 }, { 148, 61 }, { 150, 68 }, { 153, 65 }, { 154, 48 }, 1638 + { 155, 49 }, { 156, 64 }, { 159, 50 }, { 162, 51 }, { 166, 111 }, { 169, 114 }, 1639 + { 171, 115 }, { 172, 116 }, { 174, 117 }, { 176, 107 }, { 181, 109 }, 1640 + { 182, 110 }, { 185, 112 }, { 187, 113 }, { 188, 118 }, { 190, 122 }, 1641 + { 192, 123 }, { 195, 124 }, { 201, 119 }, { 203, 120 }, { 205, 121 }, 1642 + }; 1643 + 1644 + static const struct msm_pinctrl_soc_data sm8450_tlmm = { 1645 + .pins = sm8450_pins, 1646 + .npins = ARRAY_SIZE(sm8450_pins), 1647 + .functions = sm8450_functions, 1648 + .nfunctions = ARRAY_SIZE(sm8450_functions), 1649 + .groups = sm8450_groups, 1650 + .ngroups = ARRAY_SIZE(sm8450_groups), 1651 + .ngpios = 211, 1652 + .wakeirq_map = sm8450_pdc_map, 1653 + .nwakeirq_map = ARRAY_SIZE(sm8450_pdc_map), 1654 + }; 1655 + 1656 + static int sm8450_tlmm_probe(struct platform_device *pdev) 1657 + { 1658 + return msm_pinctrl_probe(pdev, &sm8450_tlmm); 1659 + } 1660 + 1661 + static const struct of_device_id sm8450_tlmm_of_match[] = { 1662 + { .compatible = "qcom,sm8450-tlmm", }, 1663 + { }, 1664 + }; 1665 + 1666 + static struct platform_driver sm8450_tlmm_driver = { 1667 + .driver = { 1668 + .name = "sm8450-tlmm", 1669 + .of_match_table = sm8450_tlmm_of_match, 1670 + }, 1671 + .probe = sm8450_tlmm_probe, 1672 + .remove = msm_pinctrl_remove, 1673 + }; 1674 + 1675 + static int __init sm8450_tlmm_init(void) 1676 + { 1677 + return platform_driver_register(&sm8450_tlmm_driver); 1678 + } 1679 + arch_initcall(sm8450_tlmm_init); 1680 + 1681 + static void __exit sm8450_tlmm_exit(void) 1682 + { 1683 + platform_driver_unregister(&sm8450_tlmm_driver); 1684 + } 1685 + module_exit(sm8450_tlmm_exit); 1686 + 1687 + MODULE_DESCRIPTION("QTI SM8450 TLMM driver"); 1688 + MODULE_LICENSE("GPL v2"); 1689 + MODULE_DEVICE_TABLE(of, sm8450_tlmm_of_match);
+2
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 1141 1141 } 1142 1142 1143 1143 static const struct of_device_id pmic_gpio_of_match[] = { 1144 + { .compatible = "qcom,pm2250-gpio", .data = (void *) 10 }, 1144 1145 /* pm660 has 13 GPIOs with holes on 1, 5, 6, 7, 8 and 10 */ 1145 1146 { .compatible = "qcom,pm660-gpio", .data = (void *) 13 }, 1146 1147 /* pm660l has 12 GPIOs with holes on 1, 2, 10, 11 and 12 */ ··· 1152 1151 { .compatible = "qcom,pm7325-gpio", .data = (void *) 10 }, 1153 1152 { .compatible = "qcom,pm8005-gpio", .data = (void *) 4 }, 1154 1153 { .compatible = "qcom,pm8008-gpio", .data = (void *) 2 }, 1154 + { .compatible = "qcom,pm8019-gpio", .data = (void *) 6 }, 1155 1155 /* pm8150 has 10 GPIOs with holes on 2, 5, 7 and 8 */ 1156 1156 { .compatible = "qcom,pm8150-gpio", .data = (void *) 10 }, 1157 1157 { .compatible = "qcom,pmc8180-gpio", .data = (void *) 10 },
-1
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 773 773 pctrl->chip = pm8xxx_gpio_template; 774 774 pctrl->chip.base = -1; 775 775 pctrl->chip.parent = &pdev->dev; 776 - pctrl->chip.of_node = pdev->dev.of_node; 777 776 pctrl->chip.of_gpio_n_cells = 2; 778 777 pctrl->chip.label = dev_name(pctrl->dev); 779 778 pctrl->chip.ngpio = pctrl->npins;
-1
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 857 857 pctrl->chip = pm8xxx_mpp_template; 858 858 pctrl->chip.base = -1; 859 859 pctrl->chip.parent = &pdev->dev; 860 - pctrl->chip.of_node = pdev->dev.of_node; 861 860 pctrl->chip.of_gpio_n_cells = 2; 862 861 pctrl->chip.label = dev_name(pctrl->dev); 863 862 pctrl->chip.ngpio = pctrl->npins;
+2 -2
drivers/pinctrl/renesas/pfc-r8a779a0.c
··· 3835 3835 { RCAR_GP_PIN(3, 12), 16, 3 }, /* CANFD5_RX */ 3836 3836 { RCAR_GP_PIN(3, 11), 12, 3 }, /* CANFD5_TX */ 3837 3837 { RCAR_GP_PIN(3, 10), 8, 3 }, /* CANFD4_RX */ 3838 - { RCAR_GP_PIN(3, 9), 4, 3 }, /* CANFD4_TX*/ 3838 + { RCAR_GP_PIN(3, 9), 4, 3 }, /* CANFD4_TX */ 3839 3839 { RCAR_GP_PIN(3, 8), 0, 3 }, /* CANFD3_RX */ 3840 3840 } }, 3841 3841 { PINMUX_DRIVE_REG("DRV2CTRL3", 0xe6058888) { ··· 4305 4305 [11] = RCAR_GP_PIN(6, 11), /* AVB2_TD3 */ 4306 4306 [12] = RCAR_GP_PIN(6, 12), /* AVB2_TXCREFCLK */ 4307 4307 [13] = RCAR_GP_PIN(6, 13), /* AVB2_MDIO */ 4308 - [14] = RCAR_GP_PIN(6, 14), /* AVB2_MDC*/ 4308 + [14] = RCAR_GP_PIN(6, 14), /* AVB2_MDC */ 4309 4309 [15] = RCAR_GP_PIN(6, 15), /* AVB2_MAGIC */ 4310 4310 [16] = RCAR_GP_PIN(6, 16), /* AVB2_PHY_INT */ 4311 4311 [17] = RCAR_GP_PIN(6, 17), /* AVB2_LINK */
+3 -3
drivers/pinctrl/renesas/pinctrl-rza1.c
··· 757 757 } 758 758 759 759 /** 760 - * rza1_gpio_disable_free() - reset a pin 760 + * rza1_gpio_free() - reset a pin 761 761 * 762 - * Surprisingly, disable_free a gpio, is equivalent to request it. 762 + * Surprisingly, freeing a gpio is equivalent to requesting it. 763 763 * Reset pin to port mode, with input buffer disabled. This overwrites all 764 764 * port direction settings applied with set_direction 765 765 * ··· 875 875 } 876 876 877 877 /** 878 - * rza1_parse_pmx_function() - parse a pin mux sub-node 878 + * rza1_parse_pinmux_node() - parse a pin mux sub-node 879 879 * 880 880 * @rza1_pctl: RZ/A1 pin controller device 881 881 * @np: of pmx sub-node
-1
drivers/pinctrl/renesas/pinctrl-rza2.c
··· 240 240 int ret; 241 241 242 242 chip.label = devm_kasprintf(priv->dev, GFP_KERNEL, "%pOFn", np); 243 - chip.of_node = np; 244 243 chip.parent = priv->dev; 245 244 chip.ngpio = priv->npins; 246 245
+209 -99
drivers/pinctrl/renesas/pinctrl-rzg2l.c
··· 35 35 #define MUX_FUNC(pinconf) (((pinconf) & MUX_FUNC_MASK) >> MUX_FUNC_OFFS) 36 36 37 37 /* PIN capabilities */ 38 - #define PIN_CFG_IOLH BIT(0) 39 - #define PIN_CFG_SR BIT(1) 40 - #define PIN_CFG_IEN BIT(2) 41 - #define PIN_CFG_PUPD BIT(3) 42 - #define PIN_CFG_IOLH_SD0 BIT(4) 43 - #define PIN_CFG_IOLH_SD1 BIT(5) 44 - #define PIN_CFG_IOLH_QSPI BIT(6) 45 - #define PIN_CFG_IOLH_ETH0 BIT(7) 46 - #define PIN_CFG_IOLH_ETH1 BIT(8) 47 - #define PIN_CFG_FILONOFF BIT(9) 48 - #define PIN_CFG_FILNUM BIT(10) 49 - #define PIN_CFG_FILCLKSEL BIT(11) 38 + #define PIN_CFG_IOLH_A BIT(0) 39 + #define PIN_CFG_IOLH_B BIT(1) 40 + #define PIN_CFG_SR BIT(2) 41 + #define PIN_CFG_IEN BIT(3) 42 + #define PIN_CFG_PUPD BIT(4) 43 + #define PIN_CFG_IO_VMC_SD0 BIT(5) 44 + #define PIN_CFG_IO_VMC_SD1 BIT(6) 45 + #define PIN_CFG_IO_VMC_QSPI BIT(7) 46 + #define PIN_CFG_IO_VMC_ETH0 BIT(8) 47 + #define PIN_CFG_IO_VMC_ETH1 BIT(9) 48 + #define PIN_CFG_FILONOFF BIT(10) 49 + #define PIN_CFG_FILNUM BIT(11) 50 + #define PIN_CFG_FILCLKSEL BIT(12) 50 51 51 - #define RZG2L_MPXED_PIN_FUNCS (PIN_CFG_IOLH | \ 52 + #define RZG2L_MPXED_PIN_FUNCS (PIN_CFG_IOLH_A | \ 52 53 PIN_CFG_SR | \ 53 54 PIN_CFG_PUPD | \ 54 55 PIN_CFG_FILONOFF | \ ··· 78 77 #define RZG2L_SINGLE_PIN BIT(31) 79 78 #define RZG2L_SINGLE_PIN_PACK(p, b, f) (RZG2L_SINGLE_PIN | \ 80 79 ((p) << 24) | ((b) << 20) | (f)) 81 - #define RZG2L_SINGLE_PIN_GET_PORT(x) (((x) & GENMASK(30, 24)) >> 24) 80 + #define RZG2L_SINGLE_PIN_GET_PORT_OFFSET(x) (((x) & GENMASK(30, 24)) >> 24) 82 81 #define RZG2L_SINGLE_PIN_GET_BIT(x) (((x) & GENMASK(22, 20)) >> 20) 83 82 #define RZG2L_SINGLE_PIN_GET_CFGS(x) ((x) & GENMASK(19, 0)) 84 83 ··· 87 86 #define PMC(n) (0x0200 + 0x10 + (n)) 88 87 #define PFC(n) (0x0400 + 0x40 + (n) * 4) 89 88 #define PIN(n) (0x0800 + 0x10 + (n)) 89 + #define IOLH(n) (0x1000 + (n) * 8) 90 90 #define IEN(n) (0x1800 + (n) * 8) 91 91 #define PWPR (0x3014) 92 92 #define SD_CH(n) (0x3000 + (n) * 4) ··· 103 101 #define PVDD_MASK 0x01 104 102 #define PFC_MASK 0x07 105 103 #define IEN_MASK 0x01 104 + #define IOLH_MASK 0x03 106 105 107 106 #define PM_INPUT 0x1 108 107 #define PM_OUTPUT 0x2 109 108 110 109 #define RZG2L_PIN_ID_TO_PORT(id) ((id) / RZG2L_PINS_PER_PORT) 110 + #define RZG2L_PIN_ID_TO_PORT_OFFSET(id) (RZG2L_PIN_ID_TO_PORT(id) + 0x10) 111 111 #define RZG2L_PIN_ID_TO_PIN(id) ((id) % RZG2L_PINS_PER_PORT) 112 112 113 113 struct rzg2l_dedicated_configs { ··· 140 136 141 137 spinlock_t lock; 142 138 }; 139 + 140 + static const unsigned int iolh_groupa_mA[] = { 2, 4, 8, 12 }; 141 + static const unsigned int iolh_groupb_oi[] = { 100, 66, 50, 33 }; 143 142 144 143 static void rzg2l_pinctrl_set_pfc_mode(struct rzg2l_pinctrl *pctrl, 145 144 u8 port, u8 pin, u8 func) ··· 431 424 return ret; 432 425 } 433 426 427 + static int rzg2l_validate_gpio_pin(struct rzg2l_pinctrl *pctrl, 428 + u32 cfg, u32 port, u8 bit) 429 + { 430 + u8 pincount = RZG2L_GPIO_PORT_GET_PINCNT(cfg); 431 + u32 port_index = RZG2L_GPIO_PORT_GET_INDEX(cfg); 432 + u32 data; 433 + 434 + if (bit >= pincount || port >= pctrl->data->n_port_pins) 435 + return -EINVAL; 436 + 437 + data = pctrl->data->port_pin_configs[port]; 438 + if (port_index != RZG2L_GPIO_PORT_GET_INDEX(data)) 439 + return -EINVAL; 440 + 441 + return 0; 442 + } 443 + 444 + static u32 rzg2l_read_pin_config(struct rzg2l_pinctrl *pctrl, u32 offset, 445 + u8 bit, u32 mask) 446 + { 447 + void __iomem *addr = pctrl->base + offset; 448 + 449 + /* handle _L/_H for 32-bit register read/write */ 450 + if (bit >= 4) { 451 + bit -= 4; 452 + addr += 4; 453 + } 454 + 455 + return (readl(addr) >> (bit * 8)) & mask; 456 + } 457 + 458 + static void rzg2l_rmw_pin_config(struct rzg2l_pinctrl *pctrl, u32 offset, 459 + u8 bit, u32 mask, u32 val) 460 + { 461 + void __iomem *addr = pctrl->base + offset; 462 + unsigned long flags; 463 + u32 reg; 464 + 465 + /* handle _L/_H for 32-bit register read/write */ 466 + if (bit >= 4) { 467 + bit -= 4; 468 + addr += 4; 469 + } 470 + 471 + spin_lock_irqsave(&pctrl->lock, flags); 472 + reg = readl(addr) & ~(mask << (bit * 8)); 473 + writel(reg | (val << (bit * 8)), addr); 474 + spin_unlock_irqrestore(&pctrl->lock, flags); 475 + } 476 + 434 477 static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev, 435 478 unsigned int _pin, 436 479 unsigned long *config) ··· 492 435 unsigned int arg = 0; 493 436 unsigned long flags; 494 437 void __iomem *addr; 495 - u32 port = 0, reg; 438 + u32 port_offset; 496 439 u32 cfg = 0; 497 440 u8 bit = 0; 498 441 ··· 500 443 return -EINVAL; 501 444 502 445 if (*pin_data & RZG2L_SINGLE_PIN) { 503 - port = RZG2L_SINGLE_PIN_GET_PORT(*pin_data); 446 + port_offset = RZG2L_SINGLE_PIN_GET_PORT_OFFSET(*pin_data); 504 447 cfg = RZG2L_SINGLE_PIN_GET_CFGS(*pin_data); 505 448 bit = RZG2L_SINGLE_PIN_GET_BIT(*pin_data); 449 + } else { 450 + cfg = RZG2L_GPIO_PORT_GET_CFGS(*pin_data); 451 + port_offset = RZG2L_PIN_ID_TO_PORT_OFFSET(_pin); 452 + bit = RZG2L_PIN_ID_TO_PIN(_pin); 453 + 454 + if (rzg2l_validate_gpio_pin(pctrl, *pin_data, RZG2L_PIN_ID_TO_PORT(_pin), bit)) 455 + return -EINVAL; 506 456 } 507 457 508 458 switch (param) { 509 459 case PIN_CONFIG_INPUT_ENABLE: 510 460 if (!(cfg & PIN_CFG_IEN)) 511 461 return -EINVAL; 512 - spin_lock_irqsave(&pctrl->lock, flags); 513 - /* handle _L/_H for 32-bit register read/write */ 514 - addr = pctrl->base + IEN(port); 515 - if (bit >= 4) { 516 - bit -= 4; 517 - addr += 4; 518 - } 519 - 520 - reg = readl(addr) & (IEN_MASK << (bit * 8)); 521 - arg = (reg >> (bit * 8)) & 0x1; 522 - spin_unlock_irqrestore(&pctrl->lock, flags); 462 + arg = rzg2l_read_pin_config(pctrl, IEN(port_offset), bit, IEN_MASK); 523 463 break; 524 464 525 465 case PIN_CONFIG_POWER_SOURCE: { 526 466 u32 pwr_reg = 0x0; 527 467 528 - if (cfg & PIN_CFG_IOLH_SD0) 468 + if (cfg & PIN_CFG_IO_VMC_SD0) 529 469 pwr_reg = SD_CH(0); 530 - else if (cfg & PIN_CFG_IOLH_SD1) 470 + else if (cfg & PIN_CFG_IO_VMC_SD1) 531 471 pwr_reg = SD_CH(1); 532 - else if (cfg & PIN_CFG_IOLH_QSPI) 472 + else if (cfg & PIN_CFG_IO_VMC_QSPI) 533 473 pwr_reg = QSPI; 534 474 else 535 475 return -EINVAL; ··· 535 481 addr = pctrl->base + pwr_reg; 536 482 arg = (readl(addr) & PVDD_MASK) ? 1800 : 3300; 537 483 spin_unlock_irqrestore(&pctrl->lock, flags); 484 + break; 485 + } 486 + 487 + case PIN_CONFIG_DRIVE_STRENGTH: { 488 + unsigned int index; 489 + 490 + if (!(cfg & PIN_CFG_IOLH_A)) 491 + return -EINVAL; 492 + 493 + index = rzg2l_read_pin_config(pctrl, IOLH(port_offset), bit, IOLH_MASK); 494 + arg = iolh_groupa_mA[index]; 495 + break; 496 + } 497 + 498 + case PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS: { 499 + unsigned int index; 500 + 501 + if (!(cfg & PIN_CFG_IOLH_B)) 502 + return -EINVAL; 503 + 504 + index = rzg2l_read_pin_config(pctrl, IOLH(port_offset), bit, IOLH_MASK); 505 + arg = iolh_groupb_oi[index]; 538 506 break; 539 507 } 540 508 ··· 580 504 enum pin_config_param param; 581 505 unsigned long flags; 582 506 void __iomem *addr; 583 - u32 port = 0, reg; 507 + u32 port_offset; 584 508 unsigned int i; 585 509 u32 cfg = 0; 586 510 u8 bit = 0; ··· 589 513 return -EINVAL; 590 514 591 515 if (*pin_data & RZG2L_SINGLE_PIN) { 592 - port = RZG2L_SINGLE_PIN_GET_PORT(*pin_data); 516 + port_offset = RZG2L_SINGLE_PIN_GET_PORT_OFFSET(*pin_data); 593 517 cfg = RZG2L_SINGLE_PIN_GET_CFGS(*pin_data); 594 518 bit = RZG2L_SINGLE_PIN_GET_BIT(*pin_data); 519 + } else { 520 + cfg = RZG2L_GPIO_PORT_GET_CFGS(*pin_data); 521 + port_offset = RZG2L_PIN_ID_TO_PORT_OFFSET(_pin); 522 + bit = RZG2L_PIN_ID_TO_PIN(_pin); 523 + 524 + if (rzg2l_validate_gpio_pin(pctrl, *pin_data, RZG2L_PIN_ID_TO_PORT(_pin), bit)) 525 + return -EINVAL; 595 526 } 596 527 597 528 for (i = 0; i < num_configs; i++) { ··· 611 528 if (!(cfg & PIN_CFG_IEN)) 612 529 return -EINVAL; 613 530 614 - /* handle _L/_H for 32-bit register read/write */ 615 - addr = pctrl->base + IEN(port); 616 - if (bit >= 4) { 617 - bit -= 4; 618 - addr += 4; 619 - } 620 - 621 - spin_lock_irqsave(&pctrl->lock, flags); 622 - reg = readl(addr) & ~(IEN_MASK << (bit * 8)); 623 - writel(reg | (arg << (bit * 8)), addr); 624 - spin_unlock_irqrestore(&pctrl->lock, flags); 531 + rzg2l_rmw_pin_config(pctrl, IEN(port_offset), bit, IEN_MASK, !!arg); 625 532 break; 626 533 } 627 534 ··· 622 549 if (mV != 1800 && mV != 3300) 623 550 return -EINVAL; 624 551 625 - if (cfg & PIN_CFG_IOLH_SD0) 552 + if (cfg & PIN_CFG_IO_VMC_SD0) 626 553 pwr_reg = SD_CH(0); 627 - else if (cfg & PIN_CFG_IOLH_SD1) 554 + else if (cfg & PIN_CFG_IO_VMC_SD1) 628 555 pwr_reg = SD_CH(1); 629 - else if (cfg & PIN_CFG_IOLH_QSPI) 556 + else if (cfg & PIN_CFG_IO_VMC_QSPI) 630 557 pwr_reg = QSPI; 631 558 else 632 559 return -EINVAL; ··· 637 564 spin_unlock_irqrestore(&pctrl->lock, flags); 638 565 break; 639 566 } 567 + 568 + case PIN_CONFIG_DRIVE_STRENGTH: { 569 + unsigned int arg = pinconf_to_config_argument(_configs[i]); 570 + unsigned int index; 571 + 572 + if (!(cfg & PIN_CFG_IOLH_A)) 573 + return -EINVAL; 574 + 575 + for (index = 0; index < ARRAY_SIZE(iolh_groupa_mA); index++) { 576 + if (arg == iolh_groupa_mA[index]) 577 + break; 578 + } 579 + if (index >= ARRAY_SIZE(iolh_groupa_mA)) 580 + return -EINVAL; 581 + 582 + rzg2l_rmw_pin_config(pctrl, IOLH(port_offset), bit, IOLH_MASK, index); 583 + break; 584 + } 585 + 586 + case PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS: { 587 + unsigned int arg = pinconf_to_config_argument(_configs[i]); 588 + unsigned int index; 589 + 590 + if (!(cfg & PIN_CFG_IOLH_B)) 591 + return -EINVAL; 592 + 593 + for (index = 0; index < ARRAY_SIZE(iolh_groupb_oi); index++) { 594 + if (arg == iolh_groupb_oi[index]) 595 + break; 596 + } 597 + if (index >= ARRAY_SIZE(iolh_groupb_oi)) 598 + return -EINVAL; 599 + 600 + rzg2l_rmw_pin_config(pctrl, IOLH(port_offset), bit, IOLH_MASK, index); 601 + break; 602 + } 603 + 640 604 default: 641 605 return -EOPNOTSUPP; 642 606 } ··· 965 855 RZG2L_GPIO_PORT_PACK(3, 0x21, RZG2L_MPXED_PIN_FUNCS), 966 856 RZG2L_GPIO_PORT_PACK(2, 0x22, RZG2L_MPXED_PIN_FUNCS), 967 857 RZG2L_GPIO_PORT_PACK(2, 0x23, RZG2L_MPXED_PIN_FUNCS), 968 - RZG2L_GPIO_PORT_PACK(3, 0x24, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 969 - RZG2L_GPIO_PORT_PACK(2, 0x25, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 970 - RZG2L_GPIO_PORT_PACK(2, 0x26, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 971 - RZG2L_GPIO_PORT_PACK(2, 0x27, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 972 - RZG2L_GPIO_PORT_PACK(2, 0x28, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 973 - RZG2L_GPIO_PORT_PACK(2, 0x29, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 974 - RZG2L_GPIO_PORT_PACK(2, 0x2a, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 975 - RZG2L_GPIO_PORT_PACK(2, 0x2b, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 976 - RZG2L_GPIO_PORT_PACK(2, 0x2c, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)), 977 - RZG2L_GPIO_PORT_PACK(2, 0x2d, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 978 - RZG2L_GPIO_PORT_PACK(2, 0x2e, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 979 - RZG2L_GPIO_PORT_PACK(2, 0x2f, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 980 - RZG2L_GPIO_PORT_PACK(2, 0x30, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 981 - RZG2L_GPIO_PORT_PACK(2, 0x31, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 982 - RZG2L_GPIO_PORT_PACK(2, 0x32, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 983 - RZG2L_GPIO_PORT_PACK(2, 0x33, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 984 - RZG2L_GPIO_PORT_PACK(2, 0x34, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 985 - RZG2L_GPIO_PORT_PACK(3, 0x35, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH1)), 858 + RZG2L_GPIO_PORT_PACK(3, 0x24, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 859 + RZG2L_GPIO_PORT_PACK(2, 0x25, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 860 + RZG2L_GPIO_PORT_PACK(2, 0x26, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 861 + RZG2L_GPIO_PORT_PACK(2, 0x27, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 862 + RZG2L_GPIO_PORT_PACK(2, 0x28, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 863 + RZG2L_GPIO_PORT_PACK(2, 0x29, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 864 + RZG2L_GPIO_PORT_PACK(2, 0x2a, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 865 + RZG2L_GPIO_PORT_PACK(2, 0x2b, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 866 + RZG2L_GPIO_PORT_PACK(2, 0x2c, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH0)), 867 + RZG2L_GPIO_PORT_PACK(2, 0x2d, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 868 + RZG2L_GPIO_PORT_PACK(2, 0x2e, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 869 + RZG2L_GPIO_PORT_PACK(2, 0x2f, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 870 + RZG2L_GPIO_PORT_PACK(2, 0x30, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 871 + RZG2L_GPIO_PORT_PACK(2, 0x31, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 872 + RZG2L_GPIO_PORT_PACK(2, 0x32, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 873 + RZG2L_GPIO_PORT_PACK(2, 0x33, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 874 + RZG2L_GPIO_PORT_PACK(2, 0x34, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 875 + RZG2L_GPIO_PORT_PACK(3, 0x35, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IO_VMC_ETH1)), 986 876 RZG2L_GPIO_PORT_PACK(2, 0x36, RZG2L_MPXED_PIN_FUNCS), 987 877 RZG2L_GPIO_PORT_PACK(3, 0x37, RZG2L_MPXED_PIN_FUNCS), 988 878 RZG2L_GPIO_PORT_PACK(3, 0x38, RZG2L_MPXED_PIN_FUNCS), ··· 1000 890 { "NMI", RZG2L_SINGLE_PIN_PACK(0x1, 0, 1001 891 (PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL)) }, 1002 892 { "TMS/SWDIO", RZG2L_SINGLE_PIN_PACK(0x2, 0, 1003 - (PIN_CFG_SR | PIN_CFG_IOLH | PIN_CFG_IEN)) }, 893 + (PIN_CFG_SR | PIN_CFG_IOLH_A | PIN_CFG_IEN)) }, 1004 894 { "TDO", RZG2L_SINGLE_PIN_PACK(0x3, 0, 1005 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN)) }, 895 + (PIN_CFG_IOLH_A | PIN_CFG_SR | PIN_CFG_IEN)) }, 1006 896 { "AUDIO_CLK1", RZG2L_SINGLE_PIN_PACK(0x4, 0, PIN_CFG_IEN) }, 1007 897 { "AUDIO_CLK2", RZG2L_SINGLE_PIN_PACK(0x4, 1, PIN_CFG_IEN) }, 1008 898 { "SD0_CLK", RZG2L_SINGLE_PIN_PACK(0x6, 0, 1009 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_SD0)) }, 899 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_SD0)) }, 1010 900 { "SD0_CMD", RZG2L_SINGLE_PIN_PACK(0x6, 1, 1011 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 901 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1012 902 { "SD0_RST#", RZG2L_SINGLE_PIN_PACK(0x6, 2, 1013 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_SD0)) }, 903 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_SD0)) }, 1014 904 { "SD0_DATA0", RZG2L_SINGLE_PIN_PACK(0x7, 0, 1015 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 905 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1016 906 { "SD0_DATA1", RZG2L_SINGLE_PIN_PACK(0x7, 1, 1017 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 907 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1018 908 { "SD0_DATA2", RZG2L_SINGLE_PIN_PACK(0x7, 2, 1019 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 909 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1020 910 { "SD0_DATA3", RZG2L_SINGLE_PIN_PACK(0x7, 3, 1021 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 911 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1022 912 { "SD0_DATA4", RZG2L_SINGLE_PIN_PACK(0x7, 4, 1023 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 913 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1024 914 { "SD0_DATA5", RZG2L_SINGLE_PIN_PACK(0x7, 5, 1025 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 915 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1026 916 { "SD0_DATA6", RZG2L_SINGLE_PIN_PACK(0x7, 6, 1027 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 917 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1028 918 { "SD0_DATA7", RZG2L_SINGLE_PIN_PACK(0x7, 7, 1029 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD0)) }, 919 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD0)) }, 1030 920 { "SD1_CLK", RZG2L_SINGLE_PIN_PACK(0x8, 0, 1031 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_SD1))}, 921 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_SD1)) }, 1032 922 { "SD1_CMD", RZG2L_SINGLE_PIN_PACK(0x8, 1, 1033 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD1)) }, 923 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1)) }, 1034 924 { "SD1_DATA0", RZG2L_SINGLE_PIN_PACK(0x9, 0, 1035 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD1)) }, 925 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1)) }, 1036 926 { "SD1_DATA1", RZG2L_SINGLE_PIN_PACK(0x9, 1, 1037 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD1)) }, 927 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1)) }, 1038 928 { "SD1_DATA2", RZG2L_SINGLE_PIN_PACK(0x9, 2, 1039 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD1)) }, 929 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1)) }, 1040 930 { "SD1_DATA3", RZG2L_SINGLE_PIN_PACK(0x9, 3, 1041 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IOLH_SD1)) }, 931 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IEN | PIN_CFG_IO_VMC_SD1)) }, 1042 932 { "QSPI0_SPCLK", RZG2L_SINGLE_PIN_PACK(0xa, 0, 1043 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 933 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1044 934 { "QSPI0_IO0", RZG2L_SINGLE_PIN_PACK(0xa, 1, 1045 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 935 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1046 936 { "QSPI0_IO1", RZG2L_SINGLE_PIN_PACK(0xa, 2, 1047 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 937 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1048 938 { "QSPI0_IO2", RZG2L_SINGLE_PIN_PACK(0xa, 3, 1049 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 939 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1050 940 { "QSPI0_IO3", RZG2L_SINGLE_PIN_PACK(0xa, 4, 1051 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 941 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1052 942 { "QSPI0_SSL", RZG2L_SINGLE_PIN_PACK(0xa, 5, 1053 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 943 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1054 944 { "QSPI1_SPCLK", RZG2L_SINGLE_PIN_PACK(0xb, 0, 1055 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 945 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1056 946 { "QSPI1_IO0", RZG2L_SINGLE_PIN_PACK(0xb, 1, 1057 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 947 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1058 948 { "QSPI1_IO1", RZG2L_SINGLE_PIN_PACK(0xb, 2, 1059 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 949 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1060 950 { "QSPI1_IO2", RZG2L_SINGLE_PIN_PACK(0xb, 3, 1061 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 951 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1062 952 { "QSPI1_IO3", RZG2L_SINGLE_PIN_PACK(0xb, 4, 1063 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 953 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1064 954 { "QSPI1_SSL", RZG2L_SINGLE_PIN_PACK(0xb, 5, 1065 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 955 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1066 956 { "QSPI_RESET#", RZG2L_SINGLE_PIN_PACK(0xc, 0, 1067 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 957 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 1068 958 { "QSPI_WP#", RZG2L_SINGLE_PIN_PACK(0xc, 1, 1069 - (PIN_CFG_IOLH | PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 1070 - { "QSPI_INT#", RZG2L_SINGLE_PIN_PACK(0xc, 2, (PIN_CFG_SR | PIN_CFG_IOLH_QSPI)) }, 1071 - { "WDTOVF_PERROUT#", RZG2L_SINGLE_PIN_PACK(0xd, 0, (PIN_CFG_IOLH | PIN_CFG_SR)) }, 959 + (PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 960 + { "QSPI_INT#", RZG2L_SINGLE_PIN_PACK(0xc, 2, (PIN_CFG_SR | PIN_CFG_IO_VMC_QSPI)) }, 961 + { "WDTOVF_PERROUT#", RZG2L_SINGLE_PIN_PACK(0xd, 0, (PIN_CFG_IOLH_A | PIN_CFG_SR)) }, 1072 962 { "RIIC0_SDA", RZG2L_SINGLE_PIN_PACK(0xe, 0, PIN_CFG_IEN) }, 1073 963 { "RIIC0_SCL", RZG2L_SINGLE_PIN_PACK(0xe, 1, PIN_CFG_IEN) }, 1074 964 { "RIIC1_SDA", RZG2L_SINGLE_PIN_PACK(0xe, 2, PIN_CFG_IEN) },
+1 -8
drivers/pinctrl/renesas/pinctrl.c
··· 504 504 static int sh_pfc_pinconf_get_drive_strength(struct sh_pfc *pfc, 505 505 unsigned int pin) 506 506 { 507 - unsigned long flags; 508 507 unsigned int offset; 509 508 unsigned int size; 510 509 u32 reg; ··· 513 514 if (!reg) 514 515 return -EINVAL; 515 516 516 - spin_lock_irqsave(&pfc->lock, flags); 517 - val = sh_pfc_read(pfc, reg); 518 - spin_unlock_irqrestore(&pfc->lock, flags); 519 - 520 - val = (val >> offset) & GENMASK(size - 1, 0); 517 + val = (sh_pfc_read(pfc, reg) >> offset) & GENMASK(size - 1, 0); 521 518 522 519 /* Convert the value to mA based on a full drive strength value of 24mA. 523 520 * We can make the full value configurable later if needed. ··· 643 648 if (WARN(bit < 0, "invalid pin %#x", _pin)) 644 649 return bit; 645 650 646 - spin_lock_irqsave(&pfc->lock, flags); 647 651 val = sh_pfc_read(pfc, pocctrl); 648 - spin_unlock_irqrestore(&pfc->lock, flags); 649 652 650 653 lower_voltage = (pin->configs & SH_PFC_PIN_VOLTAGE_25_33) ? 651 654 2500 : 1800;
+81
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
··· 441 441 .num_ctrl = ARRAY_SIZE(exynos7_pin_ctrl), 442 442 }; 443 443 444 + /* pin banks of exynos7885 pin-controller 0 (ALIVE) */ 445 + static const struct samsung_pin_bank_data exynos7885_pin_banks0[] __initconst = { 446 + EXYNOS_PIN_BANK_EINTN(3, 0x000, "etc0"), 447 + EXYNOS_PIN_BANK_EINTN(3, 0x020, "etc1"), 448 + EXYNOS850_PIN_BANK_EINTW(8, 0x040, "gpa0", 0x00), 449 + EXYNOS850_PIN_BANK_EINTW(8, 0x060, "gpa1", 0x04), 450 + EXYNOS850_PIN_BANK_EINTW(8, 0x080, "gpa2", 0x08), 451 + EXYNOS850_PIN_BANK_EINTW(5, 0x0a0, "gpq0", 0x0c), 452 + }; 453 + 454 + /* pin banks of exynos7885 pin-controller 1 (DISPAUD) */ 455 + static const struct samsung_pin_bank_data exynos7885_pin_banks1[] __initconst = { 456 + EXYNOS850_PIN_BANK_EINTG(5, 0x000, "gpb0", 0x00), 457 + EXYNOS850_PIN_BANK_EINTG(4, 0x020, "gpb1", 0x04), 458 + EXYNOS850_PIN_BANK_EINTG(5, 0x040, "gpb2", 0x08), 459 + }; 460 + 461 + /* pin banks of exynos7885 pin-controller 2 (FSYS) */ 462 + static const struct samsung_pin_bank_data exynos7885_pin_banks2[] __initconst = { 463 + EXYNOS850_PIN_BANK_EINTG(4, 0x000, "gpf0", 0x00), 464 + EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpf2", 0x04), 465 + EXYNOS850_PIN_BANK_EINTG(6, 0x040, "gpf3", 0x08), 466 + EXYNOS850_PIN_BANK_EINTG(6, 0x060, "gpf4", 0x0c), 467 + }; 468 + 469 + /* pin banks of exynos7885 pin-controller 3 (TOP) */ 470 + static const struct samsung_pin_bank_data exynos7885_pin_banks3[] __initconst = { 471 + EXYNOS850_PIN_BANK_EINTG(4, 0x000, "gpp0", 0x00), 472 + EXYNOS850_PIN_BANK_EINTG(3, 0x020, "gpg0", 0x04), 473 + EXYNOS850_PIN_BANK_EINTG(4, 0x040, "gpp1", 0x08), 474 + EXYNOS850_PIN_BANK_EINTG(4, 0x060, "gpp2", 0x0c), 475 + EXYNOS850_PIN_BANK_EINTG(3, 0x080, "gpp3", 0x10), 476 + EXYNOS850_PIN_BANK_EINTG(6, 0x0a0, "gpp4", 0x14), 477 + EXYNOS850_PIN_BANK_EINTG(4, 0x0c0, "gpp5", 0x18), 478 + EXYNOS850_PIN_BANK_EINTG(5, 0x0e0, "gpp6", 0x1c), 479 + EXYNOS850_PIN_BANK_EINTG(2, 0x100, "gpp7", 0x20), 480 + EXYNOS850_PIN_BANK_EINTG(2, 0x120, "gpp8", 0x24), 481 + EXYNOS850_PIN_BANK_EINTG(8, 0x140, "gpg1", 0x28), 482 + EXYNOS850_PIN_BANK_EINTG(8, 0x160, "gpg2", 0x2c), 483 + EXYNOS850_PIN_BANK_EINTG(8, 0x180, "gpg3", 0x30), 484 + EXYNOS850_PIN_BANK_EINTG(2, 0x1a0, "gpg4", 0x34), 485 + EXYNOS850_PIN_BANK_EINTG(4, 0x1c0, "gpc0", 0x38), 486 + EXYNOS850_PIN_BANK_EINTG(8, 0x1e0, "gpc1", 0x3c), 487 + EXYNOS850_PIN_BANK_EINTG(8, 0x200, "gpc2", 0x40), 488 + }; 489 + 490 + static const struct samsung_pin_ctrl exynos7885_pin_ctrl[] __initconst = { 491 + { 492 + /* pin-controller instance 0 Alive data */ 493 + .pin_banks = exynos7885_pin_banks0, 494 + .nr_banks = ARRAY_SIZE(exynos7885_pin_banks0), 495 + .eint_gpio_init = exynos_eint_gpio_init, 496 + .eint_wkup_init = exynos_eint_wkup_init, 497 + .suspend = exynos_pinctrl_suspend, 498 + .resume = exynos_pinctrl_resume, 499 + }, { 500 + /* pin-controller instance 1 DISPAUD data */ 501 + .pin_banks = exynos7885_pin_banks1, 502 + .nr_banks = ARRAY_SIZE(exynos7885_pin_banks1), 503 + }, { 504 + /* pin-controller instance 2 FSYS data */ 505 + .pin_banks = exynos7885_pin_banks2, 506 + .nr_banks = ARRAY_SIZE(exynos7885_pin_banks2), 507 + .eint_gpio_init = exynos_eint_gpio_init, 508 + .suspend = exynos_pinctrl_suspend, 509 + .resume = exynos_pinctrl_resume, 510 + }, { 511 + /* pin-controller instance 3 TOP data */ 512 + .pin_banks = exynos7885_pin_banks3, 513 + .nr_banks = ARRAY_SIZE(exynos7885_pin_banks3), 514 + .eint_gpio_init = exynos_eint_gpio_init, 515 + .suspend = exynos_pinctrl_suspend, 516 + .resume = exynos_pinctrl_resume, 517 + }, 518 + }; 519 + 520 + const struct samsung_pinctrl_of_match_data exynos7885_of_data __initconst = { 521 + .ctrl = exynos7885_pin_ctrl, 522 + .num_ctrl = ARRAY_SIZE(exynos7885_pin_ctrl), 523 + }; 524 + 444 525 /* pin banks of exynos850 pin-controller 0 (ALIVE) */ 445 526 static const struct samsung_pin_bank_data exynos850_pin_banks0[] __initconst = { 446 527 /* Must start with EINTG banks, ordered by EINT group number. */
+7 -4
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 1095 1095 struct samsung_pinctrl_drv_data *drvdata; 1096 1096 const struct samsung_pin_ctrl *ctrl; 1097 1097 struct device *dev = &pdev->dev; 1098 - struct resource *res; 1099 1098 int ret; 1100 1099 1101 1100 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); ··· 1108 1109 } 1109 1110 drvdata->dev = dev; 1110 1111 1111 - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1112 - if (res) 1113 - drvdata->irq = res->start; 1112 + ret = platform_get_irq_optional(pdev, 0); 1113 + if (ret < 0 && ret != -ENXIO) 1114 + return ret; 1115 + if (ret > 0) 1116 + drvdata->irq = ret; 1114 1117 1115 1118 if (ctrl->retention_data) { 1116 1119 drvdata->retention_ctrl = ctrl->retention_data->init(drvdata, ··· 1265 1264 .data = &exynos5433_of_data }, 1266 1265 { .compatible = "samsung,exynos7-pinctrl", 1267 1266 .data = &exynos7_of_data }, 1267 + { .compatible = "samsung,exynos7885-pinctrl", 1268 + .data = &exynos7885_of_data }, 1268 1269 { .compatible = "samsung,exynos850-pinctrl", 1269 1270 .data = &exynos850_of_data }, 1270 1271 { .compatible = "samsung,exynosautov9-pinctrl",
+1
drivers/pinctrl/samsung/pinctrl-samsung.h
··· 339 339 extern const struct samsung_pinctrl_of_match_data exynos5420_of_data; 340 340 extern const struct samsung_pinctrl_of_match_data exynos5433_of_data; 341 341 extern const struct samsung_pinctrl_of_match_data exynos7_of_data; 342 + extern const struct samsung_pinctrl_of_match_data exynos7885_of_data; 342 343 extern const struct samsung_pinctrl_of_match_data exynos850_of_data; 343 344 extern const struct samsung_pinctrl_of_match_data exynosautov9_of_data; 344 345 extern const struct samsung_pinctrl_of_match_data s3c64xx_of_data;
+88 -61
drivers/pinctrl/spear/pinctrl-plgpio.c
··· 14 14 #include <linux/gpio/driver.h> 15 15 #include <linux/io.h> 16 16 #include <linux/init.h> 17 + #include <linux/mfd/syscon.h> 17 18 #include <linux/of.h> 18 19 #include <linux/of_platform.h> 19 20 #include <linux/pinctrl/consumer.h> 20 21 #include <linux/platform_device.h> 21 22 #include <linux/pm.h> 23 + #include <linux/regmap.h> 22 24 #include <linux/spinlock.h> 23 25 24 26 #define MAX_GPIO_PER_REG 32 ··· 66 64 */ 67 65 struct plgpio { 68 66 spinlock_t lock; 69 - void __iomem *base; 67 + struct regmap *regmap; 70 68 struct clk *clk; 71 69 struct gpio_chip chip; 72 70 int (*p2o)(int pin); /* pin_to_offset */ ··· 79 77 }; 80 78 81 79 /* register manipulation inline functions */ 82 - static inline u32 is_plgpio_set(void __iomem *base, u32 pin, u32 reg) 80 + static inline u32 is_plgpio_set(struct regmap *regmap, u32 pin, u32 reg) 83 81 { 84 82 u32 offset = PIN_OFFSET(pin); 85 - void __iomem *reg_off = REG_OFFSET(base, reg, pin); 86 - u32 val = readl_relaxed(reg_off); 83 + u32 reg_off = REG_OFFSET(0, reg, pin); 84 + u32 val; 85 + 86 + regmap_read(regmap, reg_off, &val); 87 87 88 88 return !!(val & (1 << offset)); 89 89 } 90 90 91 - static inline void plgpio_reg_set(void __iomem *base, u32 pin, u32 reg) 91 + static inline void plgpio_reg_set(struct regmap *regmap, u32 pin, u32 reg) 92 92 { 93 93 u32 offset = PIN_OFFSET(pin); 94 - void __iomem *reg_off = REG_OFFSET(base, reg, pin); 95 - u32 val = readl_relaxed(reg_off); 94 + u32 reg_off = REG_OFFSET(0, reg, pin); 95 + u32 mask; 96 96 97 - writel_relaxed(val | (1 << offset), reg_off); 97 + mask = 1 << offset; 98 + regmap_update_bits(regmap, reg_off, mask, mask); 98 99 } 99 100 100 - static inline void plgpio_reg_reset(void __iomem *base, u32 pin, u32 reg) 101 + static inline void plgpio_reg_reset(struct regmap *regmap, u32 pin, u32 reg) 101 102 { 102 103 u32 offset = PIN_OFFSET(pin); 103 - void __iomem *reg_off = REG_OFFSET(base, reg, pin); 104 - u32 val = readl_relaxed(reg_off); 104 + u32 reg_off = REG_OFFSET(0, reg, pin); 105 + u32 mask; 105 106 106 - writel_relaxed(val & ~(1 << offset), reg_off); 107 + mask = 1 << offset; 108 + regmap_update_bits(regmap, reg_off, mask, 0); 107 109 } 110 + 108 111 109 112 /* gpio framework specific routines */ 110 113 static int plgpio_direction_input(struct gpio_chip *chip, unsigned offset) ··· 125 118 } 126 119 127 120 spin_lock_irqsave(&plgpio->lock, flags); 128 - plgpio_reg_set(plgpio->base, offset, plgpio->regs.dir); 121 + plgpio_reg_set(plgpio->regmap, offset, plgpio->regs.dir); 129 122 spin_unlock_irqrestore(&plgpio->lock, flags); 130 123 131 124 return 0; ··· 152 145 153 146 spin_lock_irqsave(&plgpio->lock, flags); 154 147 if (value) 155 - plgpio_reg_set(plgpio->base, wdata_offset, 148 + plgpio_reg_set(plgpio->regmap, wdata_offset, 156 149 plgpio->regs.wdata); 157 150 else 158 - plgpio_reg_reset(plgpio->base, wdata_offset, 151 + plgpio_reg_reset(plgpio->regmap, wdata_offset, 159 152 plgpio->regs.wdata); 160 153 161 - plgpio_reg_reset(plgpio->base, dir_offset, plgpio->regs.dir); 154 + plgpio_reg_reset(plgpio->regmap, dir_offset, plgpio->regs.dir); 162 155 spin_unlock_irqrestore(&plgpio->lock, flags); 163 156 164 157 return 0; ··· 178 171 return -EINVAL; 179 172 } 180 173 181 - return is_plgpio_set(plgpio->base, offset, plgpio->regs.rdata); 174 + return is_plgpio_set(plgpio->regmap, offset, plgpio->regs.rdata); 182 175 } 183 176 184 177 static void plgpio_set_value(struct gpio_chip *chip, unsigned offset, int value) ··· 196 189 } 197 190 198 191 if (value) 199 - plgpio_reg_set(plgpio->base, offset, plgpio->regs.wdata); 192 + plgpio_reg_set(plgpio->regmap, offset, plgpio->regs.wdata); 200 193 else 201 - plgpio_reg_reset(plgpio->base, offset, plgpio->regs.wdata); 194 + plgpio_reg_reset(plgpio->regmap, offset, plgpio->regs.wdata); 202 195 } 203 196 204 197 static int plgpio_request(struct gpio_chip *chip, unsigned offset) ··· 241 234 } 242 235 243 236 spin_lock_irqsave(&plgpio->lock, flags); 244 - plgpio_reg_set(plgpio->base, offset, plgpio->regs.enb); 237 + plgpio_reg_set(plgpio->regmap, offset, plgpio->regs.enb); 245 238 spin_unlock_irqrestore(&plgpio->lock, flags); 246 239 return 0; 247 240 ··· 273 266 } 274 267 275 268 spin_lock_irqsave(&plgpio->lock, flags); 276 - plgpio_reg_reset(plgpio->base, offset, plgpio->regs.enb); 269 + plgpio_reg_reset(plgpio->regmap, offset, plgpio->regs.enb); 277 270 spin_unlock_irqrestore(&plgpio->lock, flags); 278 271 279 272 disable_clk: ··· 299 292 } 300 293 301 294 spin_lock_irqsave(&plgpio->lock, flags); 302 - plgpio_reg_set(plgpio->base, offset, plgpio->regs.ie); 295 + plgpio_reg_set(plgpio->regmap, offset, plgpio->regs.ie); 303 296 spin_unlock_irqrestore(&plgpio->lock, flags); 304 297 } 305 298 ··· 318 311 } 319 312 320 313 spin_lock_irqsave(&plgpio->lock, flags); 321 - plgpio_reg_reset(plgpio->base, offset, plgpio->regs.ie); 314 + plgpio_reg_reset(plgpio->regmap, offset, plgpio->regs.ie); 322 315 spin_unlock_irqrestore(&plgpio->lock, flags); 323 316 } 324 317 ··· 327 320 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 328 321 struct plgpio *plgpio = gpiochip_get_data(gc); 329 322 int offset = d->hwirq; 330 - void __iomem *reg_off; 323 + u32 reg_off; 331 324 unsigned int supported_type = 0, val; 332 325 333 326 if (offset >= plgpio->chip.ngpio) ··· 344 337 if (plgpio->regs.eit == -1) 345 338 return 0; 346 339 347 - reg_off = REG_OFFSET(plgpio->base, plgpio->regs.eit, offset); 348 - val = readl_relaxed(reg_off); 340 + reg_off = REG_OFFSET(0, plgpio->regs.eit, offset); 341 + regmap_read(plgpio->regmap, reg_off, &val); 349 342 350 343 offset = PIN_OFFSET(offset); 351 344 if (trigger & IRQ_TYPE_EDGE_RISING) 352 - writel_relaxed(val | (1 << offset), reg_off); 345 + regmap_write(plgpio->regmap, reg_off, val | (1 << offset)); 353 346 else 354 - writel_relaxed(val & ~(1 << offset), reg_off); 347 + regmap_write(plgpio->regmap, reg_off, val & ~(1 << offset)); 355 348 356 349 return 0; 357 350 } ··· 369 362 struct plgpio *plgpio = gpiochip_get_data(gc); 370 363 struct irq_chip *irqchip = irq_desc_get_chip(desc); 371 364 int regs_count, count, pin, offset, i = 0; 372 - unsigned long pending; 365 + u32 pending; 366 + unsigned long pendingl; 373 367 374 368 count = plgpio->chip.ngpio; 375 369 regs_count = DIV_ROUND_UP(count, MAX_GPIO_PER_REG); ··· 378 370 chained_irq_enter(irqchip, desc); 379 371 /* check all plgpio MIS registers for a possible interrupt */ 380 372 for (; i < regs_count; i++) { 381 - pending = readl_relaxed(plgpio->base + plgpio->regs.mis + 382 - i * sizeof(int *)); 373 + regmap_read(plgpio->regmap, plgpio->regs.mis + 374 + i * sizeof(int *), &pending); 383 375 if (!pending) 384 376 continue; 385 377 386 378 /* clear interrupts */ 387 - writel_relaxed(~pending, plgpio->base + plgpio->regs.mis + 388 - i * sizeof(int *)); 379 + regmap_write(plgpio->regmap, plgpio->regs.mis + 380 + i * sizeof(int *), ~pending); 389 381 /* 390 382 * clear extra bits in last register having gpios < MAX/REG 391 383 * ex: Suppose there are max 102 plgpios. then last register ··· 397 389 if (count < MAX_GPIO_PER_REG) 398 390 pending &= (1 << count) - 1; 399 391 400 - for_each_set_bit(offset, &pending, MAX_GPIO_PER_REG) { 392 + pendingl = pending; 393 + for_each_set_bit(offset, &pendingl, MAX_GPIO_PER_REG) { 401 394 /* get correct pin for "offset" */ 402 395 if (plgpio->o2p && (plgpio->p2o_regs & PTO_MIS_REG)) { 403 396 pin = plgpio->o2p(offset); ··· 520 511 end: 521 512 return ret; 522 513 } 514 + 523 515 static int plgpio_probe(struct platform_device *pdev) 524 516 { 517 + struct device_node *regmap_np; 525 518 struct plgpio *plgpio; 526 519 int ret, irq; 527 520 ··· 531 520 if (!plgpio) 532 521 return -ENOMEM; 533 522 534 - plgpio->base = devm_platform_ioremap_resource(pdev, 0); 535 - if (IS_ERR(plgpio->base)) 536 - return PTR_ERR(plgpio->base); 523 + regmap_np = of_parse_phandle(pdev->dev.of_node, "regmap", 0); 524 + if (regmap_np) { 525 + plgpio->regmap = device_node_to_regmap(regmap_np); 526 + of_node_put(regmap_np); 527 + if (IS_ERR(plgpio->regmap)) { 528 + dev_err(&pdev->dev, "Retrieve regmap failed (%pe)\n", 529 + plgpio->regmap); 530 + return PTR_ERR(plgpio->regmap); 531 + } 532 + } else { 533 + plgpio->regmap = device_node_to_regmap(pdev->dev.of_node); 534 + if (IS_ERR(plgpio->regmap)) { 535 + dev_err(&pdev->dev, "Init regmap failed (%pe)\n", 536 + plgpio->regmap); 537 + return PTR_ERR(plgpio->regmap); 538 + } 539 + } 537 540 538 541 ret = plgpio_probe_dt(pdev, plgpio); 539 542 if (ret) { ··· 581 556 plgpio->chip.label = dev_name(&pdev->dev); 582 557 plgpio->chip.parent = &pdev->dev; 583 558 plgpio->chip.owner = THIS_MODULE; 584 - plgpio->chip.of_node = pdev->dev.of_node; 585 559 586 560 if (!IS_ERR(plgpio->clk)) { 587 561 ret = clk_prepare(plgpio->clk); ··· 631 607 { 632 608 struct plgpio *plgpio = dev_get_drvdata(dev); 633 609 int i, reg_count = DIV_ROUND_UP(plgpio->chip.ngpio, MAX_GPIO_PER_REG); 634 - void __iomem *off; 610 + u32 off; 635 611 636 612 for (i = 0; i < reg_count; i++) { 637 - off = plgpio->base + i * sizeof(int *); 613 + off = i * sizeof(int *); 638 614 639 615 if (plgpio->regs.enb != -1) 640 - plgpio->csave_regs[i].enb = 641 - readl_relaxed(plgpio->regs.enb + off); 616 + regmap_read(plgpio->regmap, plgpio->regs.enb + off, 617 + &plgpio->csave_regs[i].enb); 642 618 if (plgpio->regs.eit != -1) 643 - plgpio->csave_regs[i].eit = 644 - readl_relaxed(plgpio->regs.eit + off); 645 - plgpio->csave_regs[i].wdata = readl_relaxed(plgpio->regs.wdata + 646 - off); 647 - plgpio->csave_regs[i].dir = readl_relaxed(plgpio->regs.dir + 648 - off); 649 - plgpio->csave_regs[i].ie = readl_relaxed(plgpio->regs.ie + off); 619 + regmap_read(plgpio->regmap, plgpio->regs.eit + off, 620 + &plgpio->csave_regs[i].eit); 621 + regmap_read(plgpio->regmap, plgpio->regs.wdata + off, 622 + &plgpio->csave_regs[i].wdata); 623 + regmap_read(plgpio->regmap, plgpio->regs.dir + off, 624 + &plgpio->csave_regs[i].dir); 625 + regmap_read(plgpio->regmap, plgpio->regs.ie + off, 626 + &plgpio->csave_regs[i].ie); 650 627 } 651 628 652 629 return 0; ··· 661 636 */ 662 637 #define plgpio_prepare_reg(__reg, _off, _mask, _tmp) \ 663 638 { \ 664 - _tmp = readl_relaxed(plgpio->regs.__reg + _off); \ 639 + regmap_read(plgpio->regmap, plgpio->regs.__reg + _off, &_tmp); \ 665 640 _tmp &= ~_mask; \ 666 641 plgpio->csave_regs[i].__reg = \ 667 642 _tmp | (plgpio->csave_regs[i].__reg & _mask); \ ··· 671 646 { 672 647 struct plgpio *plgpio = dev_get_drvdata(dev); 673 648 int i, reg_count = DIV_ROUND_UP(plgpio->chip.ngpio, MAX_GPIO_PER_REG); 674 - void __iomem *off; 649 + u32 off; 675 650 u32 mask, tmp; 676 651 677 652 for (i = 0; i < reg_count; i++) { 678 - off = plgpio->base + i * sizeof(int *); 653 + off = i * sizeof(int *); 679 654 680 655 if (i == reg_count - 1) { 681 656 mask = (1 << (plgpio->chip.ngpio - i * ··· 692 667 plgpio_prepare_reg(ie, off, mask, tmp); 693 668 } 694 669 695 - writel_relaxed(plgpio->csave_regs[i].wdata, plgpio->regs.wdata + 696 - off); 697 - writel_relaxed(plgpio->csave_regs[i].dir, plgpio->regs.dir + 698 - off); 670 + regmap_write(plgpio->regmap, plgpio->regs.wdata + off, 671 + plgpio->csave_regs[i].wdata); 672 + 673 + regmap_write(plgpio->regmap, plgpio->regs.dir + off, 674 + plgpio->csave_regs[i].dir); 699 675 700 676 if (plgpio->regs.eit != -1) 701 - writel_relaxed(plgpio->csave_regs[i].eit, 702 - plgpio->regs.eit + off); 677 + regmap_write(plgpio->regmap, plgpio->regs.eit + off, 678 + plgpio->csave_regs[i].eit); 703 679 704 - writel_relaxed(plgpio->csave_regs[i].ie, plgpio->regs.ie + off); 680 + regmap_write(plgpio->regmap, plgpio->regs.ie + off, 681 + plgpio->csave_regs[i].ie); 705 682 706 683 if (plgpio->regs.enb != -1) 707 - writel_relaxed(plgpio->csave_regs[i].enb, 708 - plgpio->regs.enb + off); 684 + regmap_write(plgpio->regmap, plgpio->regs.enb + off, 685 + plgpio->csave_regs[i].enb); 709 686 } 710 687 711 688 return 0;
+7 -3
drivers/pinctrl/spear/pinctrl-spear.c
··· 14 14 */ 15 15 16 16 #include <linux/err.h> 17 + #include <linux/mfd/syscon.h> 17 18 #include <linux/module.h> 18 19 #include <linux/of.h> 19 20 #include <linux/of_address.h> ··· 368 367 if (!pmx) 369 368 return -ENOMEM; 370 369 371 - pmx->vbase = devm_platform_ioremap_resource(pdev, 0); 372 - if (IS_ERR(pmx->vbase)) 373 - return PTR_ERR(pmx->vbase); 370 + pmx->regmap = device_node_to_regmap(np); 371 + if (IS_ERR(pmx->regmap)) { 372 + dev_err(&pdev->dev, "Init regmap failed (%pe).\n", 373 + pmx->regmap); 374 + return PTR_ERR(pmx->regmap); 375 + } 374 376 375 377 pmx->dev = &pdev->dev; 376 378 pmx->machdata = machdata;
+8 -4
drivers/pinctrl/spear/pinctrl-spear.h
··· 15 15 #include <linux/gpio/driver.h> 16 16 #include <linux/io.h> 17 17 #include <linux/pinctrl/pinctrl.h> 18 + #include <linux/regmap.h> 18 19 #include <linux/types.h> 19 20 20 21 struct platform_device; ··· 173 172 * @dev: pointer to struct dev of platform_device registered 174 173 * @pctl: pointer to struct pinctrl_dev 175 174 * @machdata: pointer to SoC or machine specific structure 176 - * @vbase: virtual base address of pinmux controller 175 + * @regmap: regmap of pinmux controller 177 176 */ 178 177 struct spear_pmx { 179 178 struct device *dev; 180 179 struct pinctrl_dev *pctl; 181 180 struct spear_pinctrl_machdata *machdata; 182 - void __iomem *vbase; 181 + struct regmap *regmap; 183 182 }; 184 183 185 184 /* exported routines */ 186 185 static inline u32 pmx_readl(struct spear_pmx *pmx, u32 reg) 187 186 { 188 - return readl_relaxed(pmx->vbase + reg); 187 + u32 val; 188 + 189 + regmap_read(pmx->regmap, reg, &val); 190 + return val; 189 191 } 190 192 191 193 static inline void pmx_writel(struct spear_pmx *pmx, u32 val, u32 reg) 192 194 { 193 - writel_relaxed(val, pmx->vbase + reg); 195 + regmap_write(pmx->regmap, reg, val); 194 196 } 195 197 196 198 void pmx_init_addr(struct spear_pinctrl_machdata *machdata, u16 reg);
+6 -2
drivers/pinctrl/sunxi/pinctrl-sunxi.c
··· 835 835 static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, 836 836 unsigned offset) 837 837 { 838 - return pinctrl_gpio_direction_input(chip->base + offset); 838 + struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); 839 + 840 + return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, true); 839 841 } 840 842 841 843 static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) ··· 887 885 static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip, 888 886 unsigned offset, int value) 889 887 { 888 + struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); 889 + 890 890 sunxi_pinctrl_gpio_set(chip, offset, value); 891 - return pinctrl_gpio_direction_output(chip->base + offset); 891 + return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, false); 892 892 } 893 893 894 894 static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
-1
drivers/pinctrl/vt8500/pinctrl-wmt.c
··· 565 565 566 566 data->gpio_chip = wmt_gpio_chip; 567 567 data->gpio_chip.parent = &pdev->dev; 568 - data->gpio_chip.of_node = pdev->dev.of_node; 569 568 data->gpio_chip.ngpio = data->nbanks * 32; 570 569 571 570 platform_set_drvdata(pdev, data);
+3
include/linux/pinctrl/pinconf-generic.h
··· 91 91 * configuration (eg. the currently selected mux function) drive values on 92 92 * the line. Use argument 1 to enable output mode, argument 0 to disable 93 93 * it. 94 + * @PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS: this will configure the output impedance 95 + * of the pin with the value passed as argument. The argument is in ohms. 94 96 * @PIN_CONFIG_PERSIST_STATE: retain pin state across sleep or controller reset 95 97 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 96 98 * supplies, the argument to this parameter (on a custom format) tells ··· 131 129 PIN_CONFIG_MODE_PWM, 132 130 PIN_CONFIG_OUTPUT, 133 131 PIN_CONFIG_OUTPUT_ENABLE, 132 + PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS, 134 133 PIN_CONFIG_PERSIST_STATE, 135 134 PIN_CONFIG_POWER_SOURCE, 136 135 PIN_CONFIG_SKEW_DELAY,
+4
include/linux/string_helpers.h
··· 7 7 #include <linux/string.h> 8 8 #include <linux/types.h> 9 9 10 + struct device; 10 11 struct file; 11 12 struct task_struct; 12 13 ··· 101 100 char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp); 102 101 char *kstrdup_quotable_file(struct file *file, gfp_t gfp); 103 102 103 + char **kasprintf_strarray(gfp_t gfp, const char *prefix, size_t n); 104 104 void kfree_strarray(char **array, size_t n); 105 + 106 + char **devm_kasprintf_strarray(struct device *dev, const char *prefix, size_t n); 105 107 106 108 #endif
+64
lib/string_helpers.c
··· 10 10 #include <linux/math64.h> 11 11 #include <linux/export.h> 12 12 #include <linux/ctype.h> 13 + #include <linux/device.h> 13 14 #include <linux/errno.h> 14 15 #include <linux/fs.h> 15 16 #include <linux/limits.h> ··· 676 675 EXPORT_SYMBOL_GPL(kstrdup_quotable_file); 677 676 678 677 /** 678 + * kasprintf_strarray - allocate and fill array of sequential strings 679 + * @gfp: flags for the slab allocator 680 + * @prefix: prefix to be used 681 + * @n: amount of lines to be allocated and filled 682 + * 683 + * Allocates and fills @n strings using pattern "%s-%zu", where prefix 684 + * is provided by caller. The caller is responsible to free them with 685 + * kfree_strarray() after use. 686 + * 687 + * Returns array of strings or NULL when memory can't be allocated. 688 + */ 689 + char **kasprintf_strarray(gfp_t gfp, const char *prefix, size_t n) 690 + { 691 + char **names; 692 + size_t i; 693 + 694 + names = kcalloc(n + 1, sizeof(char *), gfp); 695 + if (!names) 696 + return NULL; 697 + 698 + for (i = 0; i < n; i++) { 699 + names[i] = kasprintf(gfp, "%s-%zu", prefix, i); 700 + if (!names[i]) { 701 + kfree_strarray(names, i); 702 + return NULL; 703 + } 704 + } 705 + 706 + return names; 707 + } 708 + EXPORT_SYMBOL_GPL(kasprintf_strarray); 709 + 710 + /** 679 711 * kfree_strarray - free a number of dynamically allocated strings contained 680 712 * in an array and the array itself 681 713 * ··· 730 696 kfree(array); 731 697 } 732 698 EXPORT_SYMBOL_GPL(kfree_strarray); 699 + 700 + struct strarray { 701 + char **array; 702 + size_t n; 703 + }; 704 + 705 + static void devm_kfree_strarray(struct device *dev, void *res) 706 + { 707 + struct strarray *array = res; 708 + 709 + kfree_strarray(array->array, array->n); 710 + } 711 + 712 + char **devm_kasprintf_strarray(struct device *dev, const char *prefix, size_t n) 713 + { 714 + struct strarray *ptr; 715 + 716 + ptr = devres_alloc(devm_kfree_strarray, sizeof(*ptr), GFP_KERNEL); 717 + if (!ptr) 718 + return ERR_PTR(-ENOMEM); 719 + 720 + ptr->array = kasprintf_strarray(GFP_KERNEL, prefix, n); 721 + if (!ptr->array) { 722 + devres_free(ptr); 723 + return ERR_PTR(-ENOMEM); 724 + } 725 + 726 + return ptr->array; 727 + } 728 + EXPORT_SYMBOL_GPL(devm_kasprintf_strarray); 733 729 734 730 /** 735 731 * strscpy_pad() - Copy a C-string into a sized buffer