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

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

Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes for the v5.3 kernel cycle:

Core changes:

- Device links can optionally be added between a pin control producer
and its consumers. This will affect how the system power management
is handled: a pin controller will not suspend before all of its
consumers have been suspended.

This was necessary for the ST Microelectronics STMFX expander and
need to be tested on other systems as well: it makes sense to make
this default in the long run.

Right now it is opt-in per driver.

- Drive strength can be specified in microamps. With decreases in
silicon technology, milliamps isn't granular enough, let's make it
possible to select drive strengths in microamps.

Right now the Meson (AMlogic) driver needs this.

New drivers:

- New subdriver for the Tegra 194 SoC.

- New subdriver for the Qualcomm SDM845.

- New subdriver for the Qualcomm SM8150.

- New subdriver for the Freescale i.MX8MN (Freescale is now a product
line of NXP).

- New subdriver for Marvell MV98DX1135.

Driver improvements:

- The Bitmain BM1880 driver now supports pin config in addition to
muxing.

- The Qualcomm drivers can now reserve some GPIOs as taken aside and
not usable for users. This is used in ACPI systems to take out some
GPIO lines used by the BIOS so that noone else (neither kernel nor
userspace) will play with them by mistake and crash the machine.

- A slew of refurbishing around the Aspeed drivers (board management
controllers for servers) in preparation for the new Aspeed AST2600
SoC.

- A slew of improvements over the SH PFC drivers as usual.

- Misc cleanups and fixes"

* tag 'pinctrl-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (106 commits)
pinctrl: aspeed: Strip moved macros and structs from private header
pinctrl: aspeed: Fix missed include
pinctrl: baytrail: Use GENMASK() consistently
pinctrl: baytrail: Re-use data structures from pinctrl-intel.h
pinctrl: baytrail: Use defined macro instead of magic in byt_get_gpio_mux()
pinctrl: qcom: Add SM8150 pinctrl driver
dt-bindings: pinctrl: qcom: Add SM8150 pinctrl binding
dt-bindings: pinctrl: qcom: Document missing gpio nodes
pinctrl: aspeed: Add implementation-related documentation
pinctrl: aspeed: Split out pinmux from general pinctrl
pinctrl: aspeed: Clarify comment about strapping W1C
pinctrl: aspeed: Correct comment that is no longer true
MAINTAINERS: Add entry for ASPEED pinctrl drivers
dt-bindings: pinctrl: aspeed: Convert AST2500 bindings to json-schema
dt-bindings: pinctrl: aspeed: Convert AST2400 bindings to json-schema
dt-bindings: pinctrl: aspeed: Split bindings document in two
pinctrl: qcom: Add irq_enable callback for msm gpio
pinctrl: madera: Fixup SPDX headers
pinctrl: qcom: sdm845: Fix CONFIG preprocessor guard
pinctrl: tegra: Add bitmask support for parked bits
...

+7693 -3202
+2
Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt
··· 24 24 "allwinner,sun8i-h3-pinctrl" 25 25 "allwinner,sun8i-h3-r-pinctrl" 26 26 "allwinner,sun8i-r40-pinctrl" 27 + "allwinner,sun8i-v3-pinctrl" 28 + "allwinner,sun8i-v3s-pinctrl" 27 29 "allwinner,sun50i-a64-pinctrl" 28 30 "allwinner,sun50i-a64-r-pinctrl" 29 31 "allwinner,sun50i-h5-pinctrl"
+81
Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-or-later 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/aspeed,ast2400-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ASPEED AST2400 Pin Controller 8 + 9 + maintainers: 10 + - Andrew Jeffery <andrew@aj.id.au> 11 + 12 + description: |+ 13 + The pin controller node should be the child of a syscon node with the 14 + required property: 15 + 16 + - compatible: Should be one of the following: 17 + "aspeed,ast2400-scu", "syscon", "simple-mfd" 18 + "aspeed,g4-scu", "syscon", "simple-mfd" 19 + 20 + Refer to the the bindings described in 21 + Documentation/devicetree/bindings/mfd/syscon.txt 22 + 23 + properties: 24 + compatible: 25 + enum: [ aspeed,ast2400-pinctrl, aspeed,g4-pinctrl ] 26 + 27 + patternProperties: 28 + '^.*$': 29 + if: 30 + type: object 31 + then: 32 + patternProperties: 33 + "^function|groups$": 34 + allOf: 35 + - $ref: "/schemas/types.yaml#/definitions/string" 36 + - enum: [ "ACPI", "ADC0", "ADC1", "ADC10", "ADC11", "ADC12", "ADC13", 37 + "ADC14", "ADC15", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7", 38 + "ADC8", "ADC9", "BMCINT", "DDCCLK", "DDCDAT", "EXTRST", "FLACK", 39 + "FLBUSY", "FLWP", "GPID", "GPID0", "GPID2", "GPID4", "GPID6", 40 + "GPIE0", "GPIE2", "GPIE4", "GPIE6", "I2C10", "I2C11", "I2C12", 41 + "I2C13", "I2C14", "I2C3", "I2C4", "I2C5", "I2C6", "I2C7", "I2C8", 42 + "I2C9", "LPCPD", "LPCPME", "LPCRST", "LPCSMI", "MAC1LINK", 43 + "MAC2LINK", "MDIO1", "MDIO2", "NCTS1", "NCTS2", "NCTS3", "NCTS4", 44 + "NDCD1", "NDCD2", "NDCD3", "NDCD4", "NDSR1", "NDSR2", "NDSR3", 45 + "NDSR4", "NDTR1", "NDTR2", "NDTR3", "NDTR4", "NDTS4", "NRI1", 46 + "NRI2", "NRI3", "NRI4", "NRTS1", "NRTS2", "NRTS3", "OSCCLK", 47 + "PWM0", "PWM1", "PWM2", "PWM3", "PWM4", "PWM5", "PWM6", "PWM7", 48 + "RGMII1", "RGMII2", "RMII1", "RMII2", "ROM16", "ROM8", "ROMCS1", 49 + "ROMCS2", "ROMCS3", "ROMCS4", "RXD1", "RXD2", "RXD3", "RXD4", 50 + "SALT1", "SALT2", "SALT3", "SALT4", "SD1", "SD2", "SGPMCK", 51 + "SGPMI", "SGPMLD", "SGPMO", "SGPSCK", "SGPSI0", "SGPSI1", "SGPSLD", 52 + "SIOONCTRL", "SIOPBI", "SIOPBO", "SIOPWREQ", "SIOPWRGD", "SIOS3", 53 + "SIOS5", "SIOSCI", "SPI1", "SPI1DEBUG", "SPI1PASSTHRU", "SPICS1", 54 + "TIMER3", "TIMER4", "TIMER5", "TIMER6", "TIMER7", "TIMER8", "TXD1", 55 + "TXD2", "TXD3", "TXD4", "UART6", "USB11D1", "USB11H2", "USB2D1", 56 + "USB2H1", "USBCKI", "VGABIOS_ROM", "VGAHS", "VGAVS", "VPI18", 57 + "VPI24", "VPI30", "VPO12", "VPO24", "WDTRST1", "WDTRST2" ] 58 + 59 + required: 60 + - compatible 61 + 62 + examples: 63 + - | 64 + syscon: scu@1e6e2000 { 65 + compatible = "aspeed,ast2400-scu", "syscon", "simple-mfd"; 66 + reg = <0x1e6e2000 0x1a8>; 67 + 68 + pinctrl: pinctrl { 69 + compatible = "aspeed,g4-pinctrl"; 70 + 71 + pinctrl_i2c3_default: i2c3_default { 72 + function = "I2C3"; 73 + groups = "I2C3"; 74 + }; 75 + 76 + pinctrl_gpioh0_unbiased_default: gpioh0 { 77 + pins = "A8"; 78 + bias-disable; 79 + }; 80 + }; 81 + };
+134
Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-or-later 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/aspeed,ast2500-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ASPEED AST2500 Pin Controller 8 + 9 + maintainers: 10 + - Andrew Jeffery <andrew@aj.id.au> 11 + 12 + description: |+ 13 + The pin controller node should be the child of a syscon node with the 14 + required property: 15 + 16 + - compatible: Should be one of the following: 17 + "aspeed,ast2500-scu", "syscon", "simple-mfd" 18 + "aspeed,g5-scu", "syscon", "simple-mfd" 19 + 20 + Refer to the the bindings described in 21 + Documentation/devicetree/bindings/mfd/syscon.txt 22 + 23 + properties: 24 + compatible: 25 + enum: [ aspeed,ast2500-pinctrl, aspeed,g5-pinctrl ] 26 + aspeed,external-nodes: 27 + minItems: 2 28 + maxItems: 2 29 + allOf: 30 + - $ref: /schemas/types.yaml#/definitions/phandle-array 31 + description: | 32 + A cell of phandles to external controller nodes: 33 + 0: compatible with "aspeed,ast2500-gfx", "syscon" 34 + 1: compatible with "aspeed,ast2500-lhc", "syscon" 35 + 36 + patternProperties: 37 + '^.*$': 38 + if: 39 + type: object 40 + then: 41 + patternProperties: 42 + "^function|groups$": 43 + allOf: 44 + - $ref: "/schemas/types.yaml#/definitions/string" 45 + - enum: [ "ACPI", "ADC0", "ADC1", "ADC10", "ADC11", "ADC12", "ADC13", 46 + "ADC14", "ADC15", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7", 47 + "ADC8", "ADC9", "BMCINT", "DDCCLK", "DDCDAT", "ESPI", "FWSPICS1", 48 + "FWSPICS2", "GPID0", "GPID2", "GPID4", "GPID6", "GPIE0", "GPIE2", 49 + "GPIE4", "GPIE6", "I2C10", "I2C11", "I2C12", "I2C13", "I2C14", 50 + "I2C3", "I2C4", "I2C5", "I2C6", "I2C7", "I2C8", "I2C9", "LAD0", 51 + "LAD1", "LAD2", "LAD3", "LCLK", "LFRAME", "LPCHC", "LPCPD", 52 + "LPCPLUS", "LPCPME", "LPCRST", "LPCSMI", "LSIRQ", "MAC1LINK", 53 + "MAC2LINK", "MDIO1", "MDIO2", "NCTS1", "NCTS2", "NCTS3", "NCTS4", 54 + "NDCD1", "NDCD2", "NDCD3", "NDCD4", "NDSR1", "NDSR2", "NDSR3", 55 + "NDSR4", "NDTR1", "NDTR2", "NDTR3", "NDTR4", "NRI1", "NRI2", 56 + "NRI3", "NRI4", "NRTS1", "NRTS2", "NRTS3", "NRTS4", "OSCCLK", 57 + "PEWAKE", "PNOR", "PWM0", "PWM1", "PWM2", "PWM3", "PWM4", "PWM5", 58 + "PWM6", "PWM7", "RGMII1", "RGMII2", "RMII1", "RMII2", "RXD1", 59 + "RXD2", "RXD3", "RXD4", "SALT1", "SALT10", "SALT11", "SALT12", 60 + "SALT13", "SALT14", "SALT2", "SALT3", "SALT4", "SALT5", "SALT6", 61 + "SALT7", "SALT8", "SALT9", "SCL1", "SCL2", "SD1", "SD2", "SDA1", 62 + "SDA2", "SGPS1", "SGPS2", "SIOONCTRL", "SIOPBI", "SIOPBO", 63 + "SIOPWREQ", "SIOPWRGD", "SIOS3", "SIOS5", "SIOSCI", "SPI1", 64 + "SPI1CS1", "SPI1DEBUG", "SPI1PASSTHRU", "SPI2CK", "SPI2CS0", 65 + "SPI2CS1", "SPI2MISO", "SPI2MOSI", "TIMER3", "TIMER4", "TIMER5", 66 + "TIMER6", "TIMER7", "TIMER8", "TXD1", "TXD2", "TXD3", "TXD4", 67 + "UART6", "USB11BHID", "USB2AD", "USB2AH", "USB2BD", "USB2BH", 68 + "USBCKI", "VGABIOSROM", "VGAHS", "VGAVS", "VPI24", "VPO", 69 + "WDTRST1", "WDTRST2", ] 70 + 71 + required: 72 + - compatible 73 + - aspeed,external-nodes 74 + 75 + examples: 76 + - | 77 + compatible = "simple-bus"; 78 + ranges; 79 + 80 + apb { 81 + compatible = "simple-bus"; 82 + #address-cells = <1>; 83 + #size-cells = <1>; 84 + ranges; 85 + 86 + syscon: scu@1e6e2000 { 87 + compatible = "aspeed,ast2500-scu", "syscon", "simple-mfd"; 88 + reg = <0x1e6e2000 0x1a8>; 89 + 90 + pinctrl: pinctrl { 91 + compatible = "aspeed,g5-pinctrl"; 92 + aspeed,external-nodes = <&gfx &lhc>; 93 + 94 + pinctrl_i2c3_default: i2c3_default { 95 + function = "I2C3"; 96 + groups = "I2C3"; 97 + }; 98 + 99 + pinctrl_gpioh0_unbiased_default: gpioh0 { 100 + pins = "A18"; 101 + bias-disable; 102 + }; 103 + }; 104 + }; 105 + 106 + gfx: display@1e6e6000 { 107 + compatible = "aspeed,ast2500-gfx", "syscon"; 108 + reg = <0x1e6e6000 0x1000>; 109 + }; 110 + }; 111 + 112 + lpc: lpc@1e789000 { 113 + compatible = "aspeed,ast2500-lpc", "simple-mfd"; 114 + reg = <0x1e789000 0x1000>; 115 + 116 + #address-cells = <1>; 117 + #size-cells = <1>; 118 + ranges = <0x0 0x1e789000 0x1000>; 119 + 120 + lpc_host: lpc-host@80 { 121 + compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon"; 122 + reg = <0x80 0x1e0>; 123 + reg-io-width = <4>; 124 + 125 + #address-cells = <1>; 126 + #size-cells = <1>; 127 + ranges = <0x0 0x80 0x1e0>; 128 + 129 + lhc: lhc@20 { 130 + compatible = "aspeed,ast2500-lhc"; 131 + reg = <0x20 0x24 0x48 0x8>; 132 + }; 133 + }; 134 + };
+31 -3
Documentation/devicetree/bindings/pinctrl/bitmain,bm1880-pinctrl.txt
··· 14 14 The pin configuration nodes act as a container for an arbitrary number of 15 15 subnodes. Each of these subnodes represents some desired configuration for a 16 16 pin, a group, or a list of pins or groups. This configuration for BM1880 SoC 17 - includes only pinmux as there is no pinconf support available in SoC. 17 + includes pinmux and various pin configuration parameters, such as pull-up, 18 + slew rate etc... 18 19 19 20 Each configuration node can consist of multiple nodes describing the pinmux 20 21 options. The name of each subnode is not important; all subnodes should be ··· 85 84 gpio66, gpio67, eth1, i2s0, i2s0_mclkin, i2s1, i2s1_mclkin, 86 85 spi0 87 86 87 + Optional Properties: 88 + 89 + - bias-disable: No arguments. Disable pin bias. 90 + - bias-pull-down: No arguments. The specified pins should be configured as 91 + pull down. 92 + - bias-pull-up: No arguments. The specified pins should be configured as 93 + pull up. 94 + - input-schmitt-enable: No arguments: Enable schmitt trigger for the specified 95 + pins 96 + - input-schmitt-disable: No arguments: Disable schmitt trigger for the specified 97 + pins 98 + - slew-rate: Integer. Sets slew rate for the specified pins. 99 + Valid values are: 100 + <0> - Slow 101 + <1> - Fast 102 + - drive-strength: Integer. Selects the drive strength for the specified 103 + pins in mA. 104 + Valid values are: 105 + <4> 106 + <8> 107 + <12> 108 + <16> 109 + <20> 110 + <24> 111 + <28> 112 + <32> 113 + 88 114 Example: 89 - pinctrl: pinctrl@50 { 115 + pinctrl: pinctrl@400 { 90 116 compatible = "bitmain,bm1880-pinctrl"; 91 - reg = <0x50 0x4B0>; 117 + reg = <0x400 0x120>; 92 118 93 119 pinctrl_uart0_default: uart0-default { 94 120 pinmux {
+3
Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
··· 5 5 6 6 Required properties: 7 7 - compatible: "brcm,bcm2835-gpio" 8 + - compatible: should be one of: 9 + "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl 10 + "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 8 11 - reg: Should contain the physical address of the GPIO module's registers. 9 12 - gpio-controller: Marks the device node as a GPIO controller. 10 13 - #gpio-cells : Should be two. The first cell is the pin number and the
+1 -1
Documentation/devicetree/bindings/pinctrl/fsl,imx8mm-pinctrl.txt
··· 12 12 - fsl,pins: each entry consists of 6 integers and represents the mux and config 13 13 setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val 14 14 input_val> are specified using a PIN_FUNC_ID macro, which can be found in 15 - <dt-bindings/pinctrl/imx8mm-pinfunc.h>. The last integer CONFIG is 15 + <arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h>. The last integer CONFIG is 16 16 the pad setting value like pull-up on this pin. Please refer to i.MX8M Mini 17 17 Reference Manual for detailed CONFIG settings. 18 18
+39
Documentation/devicetree/bindings/pinctrl/fsl,imx8mn-pinctrl.txt
··· 1 + * Freescale IMX8MN IOMUX Controller 2 + 3 + Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory 4 + for common binding part and usage. 5 + 6 + Required properties: 7 + - compatible: "fsl,imx8mn-iomuxc" 8 + - reg: should contain the base physical address and size of the iomuxc 9 + registers. 10 + 11 + Required properties in sub-nodes: 12 + - fsl,pins: each entry consists of 6 integers and represents the mux and config 13 + setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val 14 + input_val> are specified using a PIN_FUNC_ID macro, which can be found in 15 + <arch/arm64/boot/dts/freescale/imx8mn-pinfunc.h>. The last integer CONFIG is 16 + the pad setting value like pull-up on this pin. Please refer to i.MX8M Nano 17 + Reference Manual for detailed CONFIG settings. 18 + 19 + Examples: 20 + 21 + &uart1 { 22 + pinctrl-names = "default"; 23 + pinctrl-0 = <&pinctrl_uart1>; 24 + }; 25 + 26 + iomuxc: pinctrl@30330000 { 27 + compatible = "fsl,imx8mn-iomuxc"; 28 + reg = <0x0 0x30330000 0x0 0x10000>; 29 + 30 + pinctrl_uart1: uart1grp { 31 + fsl,pins = < 32 + MX8MN_IOMUXC_UART1_RXD_UART1_DCE_RX 0x140 33 + MX8MN_IOMUXC_UART1_TXD_UART1_DCE_TX 0x140 34 + MX8MN_IOMUXC_UART3_RXD_UART1_DCE_CTS_B 0x140 35 + MX8MN_IOMUXC_UART3_TXD_UART1_DCE_RTS_B 0x140 36 + MX8MN_IOMUXC_SD1_DATA4_GPIO2_IO6 0x19 37 + >; 38 + }; 39 + };
+42 -2
Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt
··· 6 6 Required properties: 7 7 - compatible: "marvell,88f6180-pinctrl", 8 8 "marvell,88f6190-pinctrl", "marvell,88f6192-pinctrl", 9 - "marvell,88f6281-pinctrl", "marvell,88f6282-pinctrl" 10 - "marvell,98dx4122-pinctrl" 9 + "marvell,88f6281-pinctrl", "marvell,88f6282-pinctrl", 10 + "marvell,98dx4122-pinctrl", "marvell,98dx1135-pinctrl" 11 11 - reg: register specifier of MPP registers 12 12 13 13 This driver supports all kirkwood variants, i.e. 88f6180, 88f619x, and 88f628x. ··· 317 317 mpp45 45 gpio 318 318 mpp49 49 gpio 319 319 320 + * Marvell Poncat2 98dx1135 321 + 322 + name pins functions 323 + ================================================================================ 324 + 325 + mpp0 0 gpio, nand(io2), spi(cs) 326 + mpp1 1 gpo, nand(io3), spi(mosi) 327 + mpp2 2 gpo, nand(io4), spi(sck) 328 + mpp3 3 gpo, nand(io5), spi(miso) 329 + mpp4 4 gpio, nand(io6), uart0(rxd) 330 + mpp5 5 gpo, nand(io7), uart0(txd) 331 + mpp6 6 sysrst(out) 332 + mpp7 7 gpo, spi(cs) 333 + mpp8 8 gpio, twsi0(sda), uart1(rts) 334 + mpp9 9 gpio, twsi(sck), uart1(cts) 335 + mpp10 10 gpo, uart0(txd) 336 + mpp11 11 gpio, uart0(rxd) 337 + mpp13 13 gpio, uart1(txd) 338 + mpp14 14 gpio, uart1(rxd) 339 + mpp15 15 gpio, uart0(rts) 340 + mpp16 16 gpio, uart0(cts) 341 + mpp17 17 gpio, nand(cle) 342 + mpp18 18 gpo, nand(io0) 343 + mpp19 19 gpo, nand(io1) 344 + mpp20 20 gpio 345 + mpp21 21 gpio 346 + mpp22 22 gpio 347 + mpp23 23 gpio 348 + mpp24 24 gpio 349 + mpp25 25 gpio 350 + mpp26 26 gpio 351 + mpp27 27 gpio 352 + mpp28 28 gpio, nand(ren) 353 + mpp29 29 gpio, nand(wen) 354 + mpp30 30 gpio 355 + mpp31 31 gpio 356 + mpp32 32 gpio 357 + mpp33 33 gpio 358 + mpp34 34 gpio, nand(ale) 359 + mpp35 35 gpio, nand(cen)
+13 -3
Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt
··· 47 47 Required properties for configuration nodes: 48 48 - pins: a list of pin names 49 49 50 - Configuration nodes support the generic properties "bias-disable", 51 - "bias-pull-up" and "bias-pull-down", described in file 52 - pinctrl-bindings.txt 50 + Configuration nodes support the following generic properties, as 51 + described in file pinctrl-bindings.txt: 52 + - "bias-disable" 53 + - "bias-pull-up" 54 + - "bias-pull-down" 55 + - "output-enable" 56 + - "output-disable" 57 + - "output-low" 58 + - "output-high" 59 + 60 + Optional properties : 61 + - drive-strength-microamp: Drive strength for the specified pins in uA. 62 + This property is only valid for G12A and newer. 53 63 54 64 === Example === 55 65
+1 -1
Documentation/devicetree/bindings/pinctrl/microchip,pic32-pinctrl.txt
··· 5 5 pin controller, GPIO, and interrupt bindings. 6 6 7 7 PIC32 'pin configuration node' is a node of a group of pins which can be 8 - used for a specific device or function. This node represents configuraions of 8 + used for a specific device or function. This node represents configurations of 9 9 pins, optional function, and optional mux related configuration. 10 10 11 11 Required properties for pin controller node:
+107
Documentation/devicetree/bindings/pinctrl/nvidia,tegra194-pinmux.txt
··· 1 + NVIDIA Tegra194 pinmux controller 2 + 3 + Required properties: 4 + - compatible: "nvidia,tegra194-pinmux" 5 + - reg: Should contain a list of base address and size pairs for: 6 + - first entry: The APB_MISC_GP_*_PADCTRL registers (pad control) 7 + - second entry: The PINMUX_AUX_* registers (pinmux) 8 + 9 + Please refer to pinctrl-bindings.txt in this directory for details of the 10 + common pinctrl bindings used by client devices, including the meaning of the 11 + phrase "pin configuration node". 12 + 13 + Tegra's pin configuration nodes act as a container for an arbitrary number of 14 + subnodes. Each of these subnodes represents some desired configuration for a 15 + pin, a group, or a list of pins or groups. This configuration can include the 16 + mux function to select on those pin(s)/group(s), and various pin configuration 17 + parameters, such as pull-up, tristate, drive strength, etc. 18 + 19 + See the TRM to determine which properties and values apply to each pin/group. 20 + Macro values for property values are defined in 21 + include/dt-binding/pinctrl/pinctrl-tegra.h. 22 + 23 + Required subnode-properties: 24 + - nvidia,pins : An array of strings. Each string contains the name of a pin or 25 + group. Valid values for these names are listed below. 26 + 27 + Optional subnode-properties: 28 + - nvidia,function: A string containing the name of the function to mux to the 29 + pin or group. 30 + - nvidia,pull: Integer, representing the pull-down/up to apply to the pin. 31 + 0: none, 1: down, 2: up. 32 + - nvidia,tristate: Integer. 33 + 0: drive, 1: tristate. 34 + - nvidia,enable-input: Integer. Enable the pin's input path. 35 + enable :TEGRA_PIN_ENABLE and 36 + disable or output only: TEGRA_PIN_DISABLE. 37 + - nvidia,open-drain: Integer. 38 + enable: TEGRA_PIN_ENABLE. 39 + disable: TEGRA_PIN_DISABLE. 40 + - nvidia,lock: Integer. Lock the pin configuration against further changes 41 + until reset. 42 + enable: TEGRA_PIN_ENABLE. 43 + disable: TEGRA_PIN_DISABLE. 44 + - nvidia,io-hv: Integer. Select high-voltage receivers. 45 + normal: TEGRA_PIN_DISABLE 46 + high: TEGRA_PIN_ENABLE 47 + - nvidia,schmitt: Integer. Enables Schmitt Trigger on the input. 48 + normal: TEGRA_PIN_DISABLE 49 + high: TEGRA_PIN_ENABLE 50 + - nvidia,drive-type: Integer. Valid range 0...3. 51 + - nvidia,pull-down-strength: Integer. Controls drive strength. 0 is weakest. 52 + The range of valid values depends on the pingroup. See "CAL_DRVDN" in the 53 + Tegra TRM. 54 + - nvidia,pull-up-strength: Integer. Controls drive strength. 0 is weakest. 55 + The range of valid values depends on the pingroup. See "CAL_DRVUP" in the 56 + Tegra TRM. 57 + 58 + Valid values for pin and group names (nvidia,pin) are: 59 + 60 + These correspond to Tegra PADCTL_* (pinmux) registers. 61 + 62 + Mux groups: 63 + 64 + These correspond to Tegra PADCTL_* (pinmux) registers. Any property 65 + that exists in those registers may be set for the following pin names. 66 + 67 + pex_l5_clkreq_n_pgg0, pex_l5_rst_n_pgg1 68 + 69 + Drive groups: 70 + 71 + These registers controls a single pin for which a mux group exists. 72 + See the list above for the pin name to use when configuring the pinmux. 73 + 74 + pex_l5_clkreq_n_pgg0, pex_l5_rst_n_pgg1 75 + 76 + Valid values for nvidia,functions are: 77 + 78 + pe5 79 + 80 + Power Domain: 81 + pex_l5_clkreq_n_pgg0 and pex_l5_rst_n_pgg1 are part of PCIE C5 power 82 + partition. Client devices must enable this partition before accessing 83 + these pins here. 84 + 85 + 86 + Example: 87 + 88 + tegra_pinctrl: pinmux: pinmux@2430000 { 89 + compatible = "nvidia,tegra194-pinmux"; 90 + reg = <0x2430000 0x17000 91 + 0xc300000 0x4000>; 92 + 93 + pinctrl-names = "pex_rst"; 94 + pinctrl-0 = <&pex_rst_c5_out_state>; 95 + 96 + pex_rst_c5_out_state: pex_rst_c5_out { 97 + pex_rst { 98 + nvidia,pins = "pex_l5_rst_n_pgg1"; 99 + nvidia,schmitt = <TEGRA_PIN_DISABLE>; 100 + nvidia,lpdr = <TEGRA_PIN_ENABLE>; 101 + nvidia,enable-input = <TEGRA_PIN_DISABLE>; 102 + nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>; 103 + nvidia,tristate = <TEGRA_PIN_DISABLE>; 104 + nvidia,pull = <TEGRA_PIN_PULL_NONE>; 105 + }; 106 + }; 107 + };
-172
Documentation/devicetree/bindings/pinctrl/pinctrl-aspeed.txt
··· 1 - ====================== 2 - Aspeed Pin Controllers 3 - ====================== 4 - 5 - The Aspeed SoCs vary in functionality inside a generation but have a common mux 6 - device register layout. 7 - 8 - Required properties for g4: 9 - - compatible : Should be one of the following: 10 - "aspeed,ast2400-pinctrl" 11 - "aspeed,g4-pinctrl" 12 - 13 - Required properties for g5: 14 - - compatible : Should be one of the following: 15 - "aspeed,ast2500-pinctrl" 16 - "aspeed,g5-pinctrl" 17 - 18 - - aspeed,external-nodes: A cell of phandles to external controller nodes: 19 - 0: compatible with "aspeed,ast2500-gfx", "syscon" 20 - 1: compatible with "aspeed,ast2500-lhc", "syscon" 21 - 22 - The pin controller node should be the child of a syscon node with the required 23 - property: 24 - 25 - - compatible : Should be one of the following: 26 - "aspeed,ast2400-scu", "syscon", "simple-mfd" 27 - "aspeed,g4-scu", "syscon", "simple-mfd" 28 - "aspeed,ast2500-scu", "syscon", "simple-mfd" 29 - "aspeed,g5-scu", "syscon", "simple-mfd" 30 - 31 - Refer to the the bindings described in 32 - Documentation/devicetree/bindings/mfd/syscon.txt 33 - 34 - Subnode Format 35 - ============== 36 - 37 - The required properties of pinmux child nodes are: 38 - - function: the mux function to select 39 - - groups : the list of groups to select with this function 40 - 41 - Required properties of pinconf child nodes are: 42 - - groups: A list of groups to select (either this or "pins" must be 43 - specified) 44 - - pins : A list of ball names as strings, eg "D14" (either this or "groups" 45 - must be specified) 46 - 47 - Optional properties of pinconf child nodes are: 48 - - bias-disable : disable any pin bias 49 - - bias-pull-down: pull down the pin 50 - - drive-strength: sink or source at most X mA 51 - 52 - Definitions are as specified in 53 - Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt, with any 54 - further limitations as described above. 55 - 56 - For pinmux, each mux function has only one associated pin group. Each group is 57 - named by its function. The following values for the function and groups 58 - properties are supported: 59 - 60 - aspeed,ast2400-pinctrl, aspeed,g4-pinctrl: 61 - 62 - ACPI ADC0 ADC1 ADC10 ADC11 ADC12 ADC13 ADC14 ADC15 ADC2 ADC3 ADC4 ADC5 ADC6 63 - ADC7 ADC8 ADC9 BMCINT DDCCLK DDCDAT EXTRST FLACK FLBUSY FLWP GPID GPID0 GPID2 64 - GPID4 GPID6 GPIE0 GPIE2 GPIE4 GPIE6 I2C10 I2C11 I2C12 I2C13 I2C14 I2C3 I2C4 65 - I2C5 I2C6 I2C7 I2C8 I2C9 LPCPD LPCPME LPCRST LPCSMI MAC1LINK MAC2LINK MDIO1 66 - MDIO2 NCTS1 NCTS2 NCTS3 NCTS4 NDCD1 NDCD2 NDCD3 NDCD4 NDSR1 NDSR2 NDSR3 NDSR4 67 - NDTR1 NDTR2 NDTR3 NDTR4 NDTS4 NRI1 NRI2 NRI3 NRI4 NRTS1 NRTS2 NRTS3 OSCCLK PWM0 68 - PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7 RGMII1 RGMII2 RMII1 RMII2 ROM16 ROM8 ROMCS1 69 - ROMCS2 ROMCS3 ROMCS4 RXD1 RXD2 RXD3 RXD4 SALT1 SALT2 SALT3 SALT4 SD1 SD2 SGPMCK 70 - SGPMI SGPMLD SGPMO SGPSCK SGPSI0 SGPSI1 SGPSLD SIOONCTRL SIOPBI SIOPBO SIOPWREQ 71 - SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1DEBUG SPI1PASSTHRU SPICS1 TIMER3 TIMER4 72 - TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 TXD3 TXD4 UART6 USB11D1 USB11H2 USB2D1 73 - USB2H1 USBCKI VGABIOS_ROM VGAHS VGAVS VPI18 VPI24 VPI30 VPO12 VPO24 WDTRST1 74 - WDTRST2 75 - 76 - aspeed,ast2500-pinctrl, aspeed,g5-pinctrl: 77 - 78 - ACPI ADC0 ADC1 ADC10 ADC11 ADC12 ADC13 ADC14 ADC15 ADC2 ADC3 ADC4 ADC5 ADC6 79 - ADC7 ADC8 ADC9 BMCINT DDCCLK DDCDAT ESPI FWSPICS1 FWSPICS2 GPID0 GPID2 GPID4 80 - GPID6 GPIE0 GPIE2 GPIE4 GPIE6 I2C10 I2C11 I2C12 I2C13 I2C14 I2C3 I2C4 I2C5 I2C6 81 - I2C7 I2C8 I2C9 LAD0 LAD1 LAD2 LAD3 LCLK LFRAME LPCHC LPCPD LPCPLUS LPCPME 82 - LPCRST LPCSMI LSIRQ MAC1LINK MAC2LINK MDIO1 MDIO2 NCTS1 NCTS2 NCTS3 NCTS4 NDCD1 83 - NDCD2 NDCD3 NDCD4 NDSR1 NDSR2 NDSR3 NDSR4 NDTR1 NDTR2 NDTR3 NDTR4 NRI1 NRI2 84 - NRI3 NRI4 NRTS1 NRTS2 NRTS3 NRTS4 OSCCLK PEWAKE PNOR PWM0 PWM1 PWM2 PWM3 PWM4 85 - PWM5 PWM6 PWM7 RGMII1 RGMII2 RMII1 RMII2 RXD1 RXD2 RXD3 RXD4 SALT1 SALT10 86 - SALT11 SALT12 SALT13 SALT14 SALT2 SALT3 SALT4 SALT5 SALT6 SALT7 SALT8 SALT9 87 - SCL1 SCL2 SD1 SD2 SDA1 SDA2 SGPS1 SGPS2 SIOONCTRL SIOPBI SIOPBO SIOPWREQ 88 - SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1CS1 SPI1DEBUG SPI1PASSTHRU SPI2CK SPI2CS0 89 - SPI2CS1 SPI2MISO SPI2MOSI TIMER3 TIMER4 TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 90 - TXD3 TXD4 UART6 USB11BHID USB2AD USB2AH USB2BD USB2BH USBCKI VGABIOSROM VGAHS 91 - VGAVS VPI24 VPO WDTRST1 WDTRST2 92 - 93 - Examples 94 - ======== 95 - 96 - g4 Example 97 - ---------- 98 - 99 - syscon: scu@1e6e2000 { 100 - compatible = "aspeed,ast2400-scu", "syscon", "simple-mfd"; 101 - reg = <0x1e6e2000 0x1a8>; 102 - 103 - pinctrl: pinctrl { 104 - compatible = "aspeed,g4-pinctrl"; 105 - 106 - pinctrl_i2c3_default: i2c3_default { 107 - function = "I2C3"; 108 - groups = "I2C3"; 109 - }; 110 - 111 - pinctrl_gpioh0_unbiased_default: gpioh0 { 112 - pins = "A8"; 113 - bias-disable; 114 - }; 115 - }; 116 - }; 117 - 118 - g5 Example 119 - ---------- 120 - 121 - ahb { 122 - apb { 123 - syscon: scu@1e6e2000 { 124 - compatible = "aspeed,ast2500-scu", "syscon", "simple-mfd"; 125 - reg = <0x1e6e2000 0x1a8>; 126 - 127 - pinctrl: pinctrl { 128 - compatible = "aspeed,g5-pinctrl"; 129 - aspeed,external-nodes = <&gfx &lhc>; 130 - 131 - pinctrl_i2c3_default: i2c3_default { 132 - function = "I2C3"; 133 - groups = "I2C3"; 134 - }; 135 - 136 - pinctrl_gpioh0_unbiased_default: gpioh0 { 137 - pins = "A18"; 138 - bias-disable; 139 - }; 140 - }; 141 - }; 142 - 143 - gfx: display@1e6e6000 { 144 - compatible = "aspeed,ast2500-gfx", "syscon"; 145 - reg = <0x1e6e6000 0x1000>; 146 - }; 147 - }; 148 - 149 - lpc: lpc@1e789000 { 150 - compatible = "aspeed,ast2500-lpc", "simple-mfd"; 151 - reg = <0x1e789000 0x1000>; 152 - 153 - #address-cells = <1>; 154 - #size-cells = <1>; 155 - ranges = <0x0 0x1e789000 0x1000>; 156 - 157 - lpc_host: lpc-host@80 { 158 - compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon"; 159 - reg = <0x80 0x1e0>; 160 - reg-io-width = <4>; 161 - 162 - #address-cells = <1>; 163 - #size-cells = <1>; 164 - ranges = <0x0 0x80 0x1e0>; 165 - 166 - lhc: lhc@20 { 167 - compatible = "aspeed,ast2500-lhc"; 168 - reg = <0x20 0x24 0x48 0x8>; 169 - }; 170 - }; 171 - }; 172 - };
+3
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
··· 258 258 drive-open-drain - drive with open drain 259 259 drive-open-source - drive with open source 260 260 drive-strength - sink or source at most X mA 261 + drive-strength-microamp - sink or source at most X uA 261 262 input-enable - enable input on pin (no effect on output, such as 262 263 enabling an input buffer) 263 264 input-disable - disable input on pin (no effect on output, such as ··· 326 325 supporting it the pull strength in Ohm. bias-disable will disable the pull. 327 326 328 327 - drive-strength takes as argument the target strength in mA. 328 + 329 + - drive-strength-microamp takes as argument the target strength in uA. 329 330 330 331 - input-debounce takes the debounce time in usec as argument 331 332 or 0 to disable debouncing
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
··· 122 122 - bias-disable: 123 123 Usage: optional 124 124 Value type: <none> 125 - Definition: The specified pins should be configued as no pull. 125 + Definition: The specified pins should be configured as no pull. 126 126 127 127 - bias-pull-down: 128 128 Usage: optional 129 129 Value type: <none> 130 - Definition: The specified pins should be configued as pull down. 130 + Definition: The specified pins should be configured as pull down. 131 131 132 132 - bias-pull-up: 133 133 Usage: optional 134 134 Value type: <none> 135 - Definition: The specified pins should be configued as pull up. 135 + Definition: The specified pins should be configured as pull up. 136 136 137 137 - output-high: 138 138 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,ipq8074-pinctrl.txt
··· 118 118 - bias-disable: 119 119 Usage: optional 120 120 Value type: <none> 121 - Definition: The specified pins should be configued as no pull. 121 + Definition: The specified pins should be configured as no pull. 122 122 123 123 - bias-pull-down: 124 124 Usage: optional 125 125 Value type: <none> 126 - Definition: The specified pins should be configued as pull down. 126 + Definition: The specified pins should be configured as pull down. 127 127 128 128 - bias-pull-up: 129 129 Usage: optional 130 130 Value type: <none> 131 - Definition: The specified pins should be configued as pull up. 131 + Definition: The specified pins should be configured as pull up. 132 132 133 133 - output-high: 134 134 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,mdm9615-pinctrl.txt
··· 97 97 - bias-disable: 98 98 Usage: optional 99 99 Value type: <none> 100 - Definition: The specified pins should be configued as no pull. 100 + Definition: The specified pins should be configured as no pull. 101 101 102 102 - bias-pull-down: 103 103 Usage: optional 104 104 Value type: <none> 105 - Definition: The specified pins should be configued as pull down. 105 + Definition: The specified pins should be configured as pull down. 106 106 107 107 - bias-pull-up: 108 108 Usage: optional 109 109 Value type: <none> 110 - Definition: The specified pins should be configued as pull up. 110 + Definition: The specified pins should be configured as pull up. 111 111 112 112 - output-high: 113 113 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,msm8916-pinctrl.txt
··· 130 130 - bias-disable: 131 131 Usage: optional 132 132 Value type: <none> 133 - Definition: The specified pins should be configued as no pull. 133 + Definition: The specified pins should be configured as no pull. 134 134 135 135 - bias-pull-down: 136 136 Usage: optional 137 137 Value type: <none> 138 - Definition: The specified pins should be configued as pull down. 138 + Definition: The specified pins should be configured as pull down. 139 139 140 140 - bias-pull-up: 141 141 Usage: optional 142 142 Value type: <none> 143 - Definition: The specified pins should be configued as pull up. 143 + Definition: The specified pins should be configured as pull up. 144 144 145 145 - output-high: 146 146 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt
··· 124 124 - bias-disable: 125 125 Usage: optional 126 126 Value type: <none> 127 - Definition: The specified pins should be configued as no pull. 127 + Definition: The specified pins should be configured as no pull. 128 128 129 129 - bias-pull-down: 130 130 Usage: optional 131 131 Value type: <none> 132 - Definition: The specified pins should be configued as pull down. 132 + Definition: The specified pins should be configured as pull down. 133 133 134 134 - bias-pull-up: 135 135 Usage: optional 136 136 Value type: <none> 137 - Definition: The specified pins should be configued as pull up. 137 + Definition: The specified pins should be configured as pull up. 138 138 139 139 - output-high: 140 140 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,msm8994-pinctrl.txt
··· 128 128 - bias-disable: 129 129 Usage: optional 130 130 Value type: <none> 131 - Definition: The specified pins should be configued as no pull. 131 + Definition: The specified pins should be configured as no pull. 132 132 133 133 - bias-pull-down: 134 134 Usage: optional 135 135 Value type: <none> 136 - Definition: The specified pins should be configued as pull down. 136 + Definition: The specified pins should be configured as pull down. 137 137 138 138 - bias-pull-up: 139 139 Usage: optional 140 140 Value type: <none> 141 - Definition: The specified pins should be configued as pull up. 141 + Definition: The specified pins should be configured as pull up. 142 142 143 143 - output-high: 144 144 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,msm8996-pinctrl.txt
··· 149 149 - bias-disable: 150 150 Usage: optional 151 151 Value type: <none> 152 - Definition: The specified pins should be configued as no pull. 152 + Definition: The specified pins should be configured as no pull. 153 153 154 154 - bias-pull-down: 155 155 Usage: optional 156 156 Value type: <none> 157 - Definition: The specified pins should be configued as pull down. 157 + Definition: The specified pins should be configured as pull down. 158 158 159 159 - bias-pull-up: 160 160 Usage: optional 161 161 Value type: <none> 162 - Definition: The specified pins should be configued as pull up. 162 + Definition: The specified pins should be configured as pull up. 163 163 164 164 - output-high: 165 165 Usage: optional
+13 -3
Documentation/devicetree/bindings/pinctrl/qcom,msm8998-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 143 135 - bias-disable: 144 136 Usage: optional 145 137 Value type: <none> 146 - Definition: The specified pins should be configued as no pull. 138 + Definition: The specified pins should be configured as no pull. 147 139 148 140 - bias-pull-down: 149 141 Usage: optional 150 142 Value type: <none> 151 - Definition: The specified pins should be configued as pull down. 143 + Definition: The specified pins should be configured as pull down. 152 144 153 145 - bias-pull-up: 154 146 Usage: optional 155 147 Value type: <none> 156 - Definition: The specified pins should be configued as pull up. 148 + Definition: The specified pins should be configured as pull up. 157 149 158 150 - output-high: 159 151 Usage: optional ··· 183 175 interrupts = <0 208 0>; 184 176 gpio-controller; 185 177 #gpio-cells = <2>; 178 + gpio-ranges = <&tlmm 0 0 175>; 179 + gpio-reserved-ranges = <0 4>, <81 4>; 186 180 interrupt-controller; 187 181 #interrupt-cells = <2>; 188 182
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,qcs404-pinctrl.txt
··· 150 150 - bias-disable: 151 151 Usage: optional 152 152 Value type: <none> 153 - Definition: The specified pins should be configued as no pull. 153 + Definition: The specified pins should be configured as no pull. 154 154 155 155 - bias-pull-down: 156 156 Usage: optional 157 157 Value type: <none> 158 - Definition: The specified pins should be configued as pull down. 158 + Definition: The specified pins should be configured as pull down. 159 159 160 160 - bias-pull-up: 161 161 Usage: optional 162 162 Value type: <none> 163 - Definition: The specified pins should be configued as pull up. 163 + Definition: The specified pins should be configured as pull up. 164 164 165 165 - output-high: 166 166 Usage: optional
+3 -3
Documentation/devicetree/bindings/pinctrl/qcom,sdm660-pinctrl.txt
··· 142 142 - bias-disable: 143 143 Usage: optional 144 144 Value type: <none> 145 - Definition: The specified pins should be configued as no pull. 145 + Definition: The specified pins should be configured as no pull. 146 146 147 147 - bias-pull-down: 148 148 Usage: optional 149 149 Value type: <none> 150 - Definition: The specified pins should be configued as pull down. 150 + Definition: The specified pins should be configured as pull down. 151 151 152 152 - bias-pull-up: 153 153 Usage: optional 154 154 Value type: <none> 155 - Definition: The specified pins should be configued as pull up. 155 + Definition: The specified pins should be configured as pull up. 156 156 157 157 - output-high: 158 158 Usage: optional
+4 -4
Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.txt
··· 79 79 gpio0-gpio149 80 80 Supports mux, bias and drive-strength 81 81 82 - sdc2_clk, sdc2_cmd, sdc2_data 82 + sdc2_clk, sdc2_cmd, sdc2_data, ufs_reset 83 83 Supports bias and drive-strength 84 84 85 85 - function: ··· 118 118 - bias-disable: 119 119 Usage: optional 120 120 Value type: <none> 121 - Definition: The specified pins should be configued as no pull. 121 + Definition: The specified pins should be configured as no pull. 122 122 123 123 - bias-pull-down: 124 124 Usage: optional 125 125 Value type: <none> 126 - Definition: The specified pins should be configued as pull down. 126 + Definition: The specified pins should be configured as pull down. 127 127 128 128 - bias-pull-up: 129 129 Usage: optional 130 130 Value type: <none> 131 - Definition: The specified pins should be configued as pull up. 131 + Definition: The specified pins should be configured as pull up. 132 132 133 133 - output-high: 134 134 Usage: optional
+190
Documentation/devicetree/bindings/pinctrl/qcom,sm8150-pinctrl.txt
··· 1 + Qualcomm SM8150 TLMM block 2 + 3 + This binding describes the Top Level Mode Multiplexer block found in the 4 + QCS404 platform. 5 + 6 + - compatible: 7 + Usage: required 8 + Value type: <string> 9 + Definition: must be "qcom,sm8150-pinctrl" 10 + 11 + - reg: 12 + Usage: required 13 + Value type: <prop-encoded-array> 14 + Definition: the base address and size of the north, south, west 15 + and east TLMM tiles. 16 + 17 + - reg-names: 18 + Usage: required 19 + Value type: <prop-encoded-array> 20 + Defintiion: names for the cells of reg, must contain "north", "south" 21 + "west" and "east". 22 + 23 + - interrupts: 24 + Usage: required 25 + Value type: <prop-encoded-array> 26 + Definition: should specify the TLMM summary IRQ. 27 + 28 + - interrupt-controller: 29 + Usage: required 30 + Value type: <none> 31 + Definition: identifies this node as an interrupt controller 32 + 33 + - #interrupt-cells: 34 + Usage: required 35 + Value type: <u32> 36 + Definition: must be 2. Specifying the pin number and flags, as defined 37 + in <dt-bindings/interrupt-controller/irq.h> 38 + 39 + - gpio-controller: 40 + Usage: required 41 + Value type: <none> 42 + Definition: identifies this node as a gpio controller 43 + 44 + - #gpio-cells: 45 + Usage: required 46 + Value type: <u32> 47 + Definition: must be 2. Specifying the pin number and flags, as defined 48 + in <dt-bindings/gpio/gpio.h> 49 + 50 + - gpio-ranges: 51 + Usage: required 52 + Value type: <prop-encoded-array> 53 + Definition: see ../gpio/gpio.txt 54 + 55 + - gpio-reserved-ranges: 56 + Usage: optional 57 + Value type: <prop-encoded-array> 58 + Definition: see ../gpio/gpio.txt 59 + 60 + Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 61 + a general description of GPIO and interrupt bindings. 62 + 63 + Please refer to pinctrl-bindings.txt in this directory for details of the 64 + common pinctrl bindings used by client devices, including the meaning of the 65 + phrase "pin configuration node". 66 + 67 + The pin configuration nodes act as a container for an arbitrary number of 68 + subnodes. Each of these subnodes represents some desired configuration for a 69 + pin, a group, or a list of pins or groups. This configuration can include the 70 + mux function to select on those pin(s)/group(s), and various pin configuration 71 + parameters, such as pull-up, drive strength, etc. 72 + 73 + 74 + PIN CONFIGURATION NODES: 75 + 76 + The name of each subnode is not important; all subnodes should be enumerated 77 + and processed purely based on their content. 78 + 79 + Each subnode only affects those parameters that are explicitly listed. In 80 + other words, a subnode that lists a mux function but no pin configuration 81 + parameters implies no information about any pin configuration parameters. 82 + Similarly, a pin subnode that describes a pullup parameter implies no 83 + information about e.g. the mux function. 84 + 85 + 86 + The following generic properties as defined in pinctrl-bindings.txt are valid 87 + to specify in a pin configuration subnode: 88 + 89 + - pins: 90 + Usage: required 91 + Value type: <string-array> 92 + Definition: List of gpio pins affected by the properties specified in 93 + this subnode. 94 + 95 + Valid pins are: 96 + gpio0-gpio149 97 + Supports mux, bias and drive-strength 98 + 99 + sdc1_clk, sdc1_cmd, sdc1_data sdc2_clk, sdc2_cmd, 100 + sdc2_data sdc1_rclk 101 + Supports bias and drive-strength 102 + 103 + ufs_reset 104 + Supports bias and drive-strength 105 + 106 + - function: 107 + Usage: required 108 + Value type: <string> 109 + Definition: Specify the alternative function to be configured for the 110 + specified pins. Functions are only valid for gpio pins. 111 + Valid values are: 112 + 113 + adsp_ext, agera_pll, aoss_cti, ddr_pxi2, atest_char, 114 + atest_char0, atest_char1, atest_char2, atest_char3, 115 + audio_ref, atest_usb1, atest_usb2, atest_usb10, 116 + atest_usb11, atest_usb12, atest_usb13, atest_usb20, 117 + atest_usb21, atest_usb22, atest_usb2, atest_usb23, 118 + btfm_slimbus, cam_mclk, cci_async, cci_i2c, cci_timer0, 119 + cci_timer1, cci_timer2, cci_timer3, cci_timer4, 120 + cri_trng, cri_trng0, cri_trng1, dbg_out, ddr_bist, 121 + ddr_pxi0, ddr_pxi1, ddr_pxi3, edp_hot, edp_lcd, 122 + emac_phy, emac_pps, gcc_gp1, gcc_gp2, gcc_gp3, gpio, 123 + hs1_mi2s, hs2_mi2s, hs3_mi2s, jitter_bist, 124 + lpass_slimbus, mdp_vsync, mdp_vsync0, mdp_vsync1, 125 + mdp_vsync2, mdp_vsync3, mss_lte, m_voc, nav_pps, 126 + pa_indicator, pci_e0, phase_flag, pll_bypassnl, 127 + pll_bist, pci_e1, pll_reset, pri_mi2s, pri_mi2s_ws, 128 + prng_rosc, qdss, qdss_cti, qlink_request, qlink_enable, 129 + qspi0, qspi1, qspi2, qspi3, qspi_clk, qspi_cs, qua_mi2s, 130 + qup0, qup1, qup2, qup3, qup4, qup5, qup6, qup7, qup8, 131 + qup9, qup10, qup11, qup12, qup13, qup14, qup15, qup16, 132 + qup17, qup18, qup19, qup_l4, qup_l5, qup_l6, rgmii, 133 + sdc4, sd_write, sec_mi2s, spkr_i2s, sp_cmu, ter_mi2s, 134 + tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, tsense_pwm1, 135 + tsense_pwm2, tsif1, tsif2, uim1, uim2, uim_batt, 136 + usb2phy_ac, usb_phy, vfr_1, vsense_trigger, wlan1_adc0, 137 + wlan1_adc1, wlan2_adc0, wlan2_adc1, wmss_reset 138 + 139 + - bias-disable: 140 + Usage: optional 141 + Value type: <none> 142 + Definition: The specified pins should be configued as no pull. 143 + 144 + - bias-pull-down: 145 + Usage: optional 146 + Value type: <none> 147 + Definition: The specified pins should be configued as pull down. 148 + 149 + - bias-pull-up: 150 + Usage: optional 151 + Value type: <none> 152 + Definition: The specified pins should be configued as pull up. 153 + 154 + - output-high: 155 + Usage: optional 156 + Value type: <none> 157 + Definition: The specified pins are configured in output mode, driven 158 + high. 159 + Not valid for sdc pins. 160 + 161 + - output-low: 162 + Usage: optional 163 + Value type: <none> 164 + Definition: The specified pins are configured in output mode, driven 165 + low. 166 + Not valid for sdc pins. 167 + 168 + - drive-strength: 169 + Usage: optional 170 + Value type: <u32> 171 + Definition: Selects the drive strength for the specified pins, in mA. 172 + Valid values are: 2, 4, 6, 8, 10, 12, 14 and 16 173 + 174 + Example: 175 + 176 + tlmm: pinctrl@3000000 { 177 + compatible = "qcom,sm8150-pinctrl"; 178 + reg = <0x03100000 0x300000>, 179 + <0x03500000 0x300000>, 180 + <0x03900000 0x300000>, 181 + <0x03D00000 0x300000>; 182 + reg-names = "west", "east", "north", "south"; 183 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 184 + gpio-controller; 185 + #gpio-cells = <2>; 186 + gpio-ranges = <&tlmm 0 0 175>; 187 + gpio-reserved-ranges = <0 4>, <126 4>; 188 + interrupt-controller; 189 + #interrupt-cells = <2>; 190 + };
-208
Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt
··· 1 - * STM32 GPIO and Pin Mux/Config controller 2 - 3 - STMicroelectronics's STM32 MCUs intregrate a GPIO and Pin mux/config hardware 4 - controller. It controls the input/output settings on the available pins and 5 - also provides ability to multiplex and configure the output of various on-chip 6 - controllers onto these pads. 7 - 8 - Pin controller node: 9 - Required properies: 10 - - compatible: value should be one of the following: 11 - "st,stm32f429-pinctrl" 12 - "st,stm32f469-pinctrl" 13 - "st,stm32f746-pinctrl" 14 - "st,stm32f769-pinctrl" 15 - "st,stm32h743-pinctrl" 16 - "st,stm32mp157-pinctrl" 17 - "st,stm32mp157-z-pinctrl" 18 - - #address-cells: The value of this property must be 1 19 - - #size-cells : The value of this property must be 1 20 - - ranges : defines mapping between pin controller node (parent) to 21 - gpio-bank node (children). 22 - - pins-are-numbered: Specify the subnodes are using numbered pinmux to 23 - specify pins. 24 - 25 - GPIO controller/bank node: 26 - Required properties: 27 - - gpio-controller : Indicates this device is a GPIO controller 28 - - #gpio-cells : Should be two. 29 - The first cell is the pin number 30 - The second one is the polarity: 31 - - 0 for active high 32 - - 1 for active low 33 - - reg : The gpio address range, relative to the pinctrl range 34 - - clocks : clock that drives this bank 35 - - st,bank-name : Should be a name string for this bank as specified in 36 - the datasheet 37 - 38 - Optional properties: 39 - - reset: : Reference to the reset controller 40 - - st,syscfg: Should be phandle/offset/mask. 41 - -The phandle to the syscon node which includes IRQ mux selection register. 42 - -The offset of the IRQ mux selection register 43 - -The field mask of IRQ mux, needed if different of 0xf. 44 - - gpio-ranges: Define a dedicated mapping between a pin-controller and 45 - a gpio controller. Format is <&phandle a b c> with: 46 - -(phandle): phandle of pin-controller. 47 - -(a): gpio base offset in range. 48 - -(b): pin base offset in range. 49 - -(c): gpio count in range 50 - This entry has to be used either if there are holes inside a bank: 51 - GPIOB0/B1/B2/B14/B15 (see example 2) 52 - or if banks are not contiguous: 53 - GPIOA/B/C/E... 54 - NOTE: If "gpio-ranges" is used for a gpio controller, all gpio-controller 55 - have to use a "gpio-ranges" entry. 56 - More details in Documentation/devicetree/bindings/gpio/gpio.txt. 57 - - st,bank-ioport: should correspond to the EXTI IOport selection (EXTI line 58 - used to select GPIOs as interrupts). 59 - - hwlocks: reference to a phandle of a hardware spinlock provider node. 60 - - st,package: Indicates the SOC package used. 61 - More details in include/dt-bindings/pinctrl/stm32-pinfunc.h 62 - 63 - Example 1: 64 - #include <dt-bindings/pinctrl/stm32f429-pinfunc.h> 65 - ... 66 - 67 - pin-controller { 68 - #address-cells = <1>; 69 - #size-cells = <1>; 70 - compatible = "st,stm32f429-pinctrl"; 71 - ranges = <0 0x40020000 0x3000>; 72 - pins-are-numbered; 73 - 74 - gpioa: gpio@40020000 { 75 - gpio-controller; 76 - #gpio-cells = <2>; 77 - reg = <0x0 0x400>; 78 - resets = <&reset_ahb1 0>; 79 - st,bank-name = "GPIOA"; 80 - }; 81 - ... 82 - pin-functions nodes follow... 83 - }; 84 - 85 - Example 2: 86 - #include <dt-bindings/pinctrl/stm32f429-pinfunc.h> 87 - ... 88 - 89 - pinctrl: pin-controller { 90 - #address-cells = <1>; 91 - #size-cells = <1>; 92 - compatible = "st,stm32f429-pinctrl"; 93 - ranges = <0 0x40020000 0x3000>; 94 - pins-are-numbered; 95 - 96 - gpioa: gpio@40020000 { 97 - gpio-controller; 98 - #gpio-cells = <2>; 99 - reg = <0x0 0x400>; 100 - resets = <&reset_ahb1 0>; 101 - st,bank-name = "GPIOA"; 102 - gpio-ranges = <&pinctrl 0 0 16>; 103 - }; 104 - 105 - gpiob: gpio@40020400 { 106 - gpio-controller; 107 - #gpio-cells = <2>; 108 - reg = <0x0 0x400>; 109 - resets = <&reset_ahb1 0>; 110 - st,bank-name = "GPIOB"; 111 - ngpios = 4; 112 - gpio-ranges = <&pinctrl 0 16 3>, 113 - <&pinctrl 14 30 2>; 114 - }; 115 - 116 - 117 - ... 118 - pin-functions nodes follow... 119 - }; 120 - 121 - 122 - Contents of function subnode node: 123 - ---------------------------------- 124 - Subnode format 125 - A pinctrl node should contain at least one subnode representing the 126 - pinctrl group available on the machine. Each subnode will list the 127 - pins it needs, and how they should be configured, with regard to muxer 128 - configuration, pullups, drive, output high/low and output speed. 129 - 130 - node { 131 - pinmux = <PIN_NUMBER_PINMUX>; 132 - GENERIC_PINCONFIG; 133 - }; 134 - 135 - Required properties: 136 - - pinmux: integer array, represents gpio pin number and mux setting. 137 - Supported pin number and mux varies for different SoCs, and are defined in 138 - dt-bindings/pinctrl/<soc>-pinfunc.h directly. 139 - These defines are calculated as: 140 - ((port * 16 + line) << 8) | function 141 - With: 142 - - port: The gpio port index (PA = 0, PB = 1, ..., PK = 11) 143 - - line: The line offset within the port (PA0 = 0, PA1 = 1, ..., PA15 = 15) 144 - - function: The function number, can be: 145 - * 0 : GPIO 146 - * 1 : Alternate Function 0 147 - * 2 : Alternate Function 1 148 - * 3 : Alternate Function 2 149 - * ... 150 - * 16 : Alternate Function 15 151 - * 17 : Analog 152 - 153 - To simplify the usage, macro is available to generate "pinmux" field. 154 - This macro is available here: 155 - - include/dt-bindings/pinctrl/stm32-pinfunc.h 156 - 157 - Some examples of using macro: 158 - /* GPIO A9 set as alernate function 2 */ 159 - ... { 160 - pinmux = <STM32_PINMUX('A', 9, AF2)>; 161 - }; 162 - /* GPIO A9 set as GPIO */ 163 - ... { 164 - pinmux = <STM32_PINMUX('A', 9, GPIO)>; 165 - }; 166 - /* GPIO A9 set as analog */ 167 - ... { 168 - pinmux = <STM32_PINMUX('A', 9, ANALOG)>; 169 - }; 170 - 171 - Optional properties: 172 - - GENERIC_PINCONFIG: is the generic pinconfig options to use. 173 - Available options are: 174 - - bias-disable, 175 - - bias-pull-down, 176 - - bias-pull-up, 177 - - drive-push-pull, 178 - - drive-open-drain, 179 - - output-low 180 - - output-high 181 - - slew-rate = <x>, with x being: 182 - < 0 > : Low speed 183 - < 1 > : Medium speed 184 - < 2 > : Fast speed 185 - < 3 > : High speed 186 - 187 - Example: 188 - 189 - pin-controller { 190 - ... 191 - usart1_pins_a: usart1@0 { 192 - pins1 { 193 - pinmux = <STM32_PINMUX('A', 9, AF7)>; 194 - bias-disable; 195 - drive-push-pull; 196 - slew-rate = <0>; 197 - }; 198 - pins2 { 199 - pinmux = <STM32_PINMUX('A', 10, AF7)>; 200 - bias-disable; 201 - }; 202 - }; 203 - }; 204 - 205 - &usart1 { 206 - pinctrl-0 = <&usart1_pins_a>; 207 - pinctrl-names = "default"; 208 - };
+264
Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright (C) STMicroelectronics 2019. 3 + %YAML 1.2 4 + --- 5 + $id: http://devicetree.org/schemas/pinctrl/st,stm32-pinctrl.yaml# 6 + $schema: http://devicetree.org/meta-schemas/core.yaml# 7 + 8 + title: STM32 GPIO and Pin Mux/Config controller 9 + 10 + maintainers: 11 + - Alexandre TORGUE <alexandre.torgue@st.com> 12 + 13 + description: | 14 + STMicroelectronics's STM32 MCUs intregrate a GPIO and Pin mux/config hardware 15 + controller. It controls the input/output settings on the available pins and 16 + also provides ability to multiplex and configure the output of various 17 + on-chip controllers onto these pads. 18 + 19 + properties: 20 + compatible: 21 + enum: 22 + - st,stm32f429-pinctrl 23 + - st,stm32f469-pinctrl 24 + - st,stm32f746-pinctrl 25 + - st,stm32f769-pinctrl 26 + - st,stm32h743-pinctrl 27 + - st,stm32mp157-pinctrl 28 + - st,stm32mp157-z-pinctrl 29 + 30 + '#address-cells': 31 + const: 1 32 + '#size-cells': 33 + const: 1 34 + 35 + ranges: true 36 + pins-are-numbered: true 37 + hwlocks: true 38 + 39 + st,syscfg: 40 + $ref: "/schemas/types.yaml#/definitions/phandle-array" 41 + description: Should be phandle/offset/mask 42 + items: 43 + - description: Phandle to the syscon node which includes IRQ mux selection. 44 + - description: The offset of the IRQ mux selection register. 45 + - description: The field mask of IRQ mux, needed if different of 0xf. 46 + 47 + st,package: 48 + allOf: 49 + - $ref: /schemas/types.yaml#/definitions/uint32 50 + - enum: [1, 2, 4, 8] 51 + description: 52 + Indicates the SOC package used. 53 + More details in include/dt-bindings/pinctrl/stm32-pinfunc.h 54 + 55 + 56 + patternProperties: 57 + '^gpio@[0-9a-f]*$': 58 + properties: 59 + gpio-controller: true 60 + '#gpio-cells': 61 + const: 2 62 + 63 + reg: 64 + maxItems: 1 65 + clocks: 66 + maxItems: 1 67 + reset: 68 + minItems: 1 69 + maxItems: 1 70 + gpio-ranges: 71 + minItems: 1 72 + maxItems: 16 73 + ngpios: 74 + description: 75 + Number of available gpios in a bank. 76 + minimum: 1 77 + maximum: 16 78 + 79 + st,bank-name: 80 + allOf: 81 + - $ref: "/schemas/types.yaml#/definitions/string" 82 + - enum: 83 + - GPIOA 84 + - GPIOB 85 + - GPIOC 86 + - GPIOD 87 + - GPIOE 88 + - GPIOF 89 + - GPIOG 90 + - GPIOH 91 + - GPIOI 92 + - GPIOJ 93 + - GPIOK 94 + - GPIOZ 95 + description: 96 + Should be a name string for this bank as specified in the datasheet. 97 + 98 + st,bank-ioport: 99 + allOf: 100 + - $ref: "/schemas/types.yaml#/definitions/uint32" 101 + - minimum: 0 102 + - maximum: 11 103 + 104 + description: 105 + Should correspond to the EXTI IOport selection (EXTI line used 106 + to select GPIOs as interrupts). 107 + 108 + required: 109 + - gpio-controller 110 + - '#gpio-cells' 111 + - reg 112 + - clocks 113 + - st,bank-name 114 + 115 + '-[0-9]*$': 116 + patternProperties: 117 + '^pins': 118 + description: | 119 + A pinctrl node should contain at least one subnode representing the 120 + pinctrl group available on the machine. Each subnode will list the 121 + pins it needs, and how they should be configured, with regard to muxer 122 + configuration, pullups, drive, output high/low and output speed. 123 + properties: 124 + pinmux: 125 + allOf: 126 + - $ref: "/schemas/types.yaml#/definitions/uint32-array" 127 + description: | 128 + Integer array, represents gpio pin number and mux setting. 129 + Supported pin number and mux varies for different SoCs, and are 130 + defined in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 131 + These defines are calculated as: ((port * 16 + line) << 8) | function 132 + With: 133 + - port: The gpio port index (PA = 0, PB = 1, ..., PK = 11) 134 + - line: The line offset within the port (PA0 = 0, PA1 = 1, ..., PA15 = 15) 135 + - function: The function number, can be: 136 + * 0 : GPIO 137 + * 1 : Alternate Function 0 138 + * 2 : Alternate Function 1 139 + * 3 : Alternate Function 2 140 + * ... 141 + * 16 : Alternate Function 15 142 + * 17 : Analog 143 + To simplify the usage, macro is available to generate "pinmux" field. 144 + This macro is available here: 145 + - include/dt-bindings/pinctrl/stm32-pinfunc.h 146 + Some examples of using macro: 147 + /* GPIO A9 set as alernate function 2 */ 148 + ... { 149 + pinmux = <STM32_PINMUX('A', 9, AF2)>; 150 + }; 151 + /* GPIO A9 set as GPIO */ 152 + ... { 153 + pinmux = <STM32_PINMUX('A', 9, GPIO)>; 154 + }; 155 + /* GPIO A9 set as analog */ 156 + ... { 157 + pinmux = <STM32_PINMUX('A', 9, ANALOG)>; 158 + }; 159 + 160 + bias-disable: 161 + type: boolean 162 + bias-pull-down: 163 + type: boolean 164 + bias-pull-up: 165 + type: boolean 166 + drive-push-pull: 167 + type: boolean 168 + drive-open-drain: 169 + type: boolean 170 + output-low: 171 + type: boolean 172 + output-high: 173 + type: boolean 174 + slew-rate: 175 + description: | 176 + 0: Low speed 177 + 1: Medium speed 178 + 2: Fast speed 179 + 3: High speed 180 + allOf: 181 + - $ref: /schemas/types.yaml#/definitions/uint32 182 + - enum: [0, 1, 2, 3] 183 + 184 + required: 185 + - pinmux 186 + 187 + required: 188 + - compatible 189 + - '#address-cells' 190 + - '#size-cells' 191 + - ranges 192 + - pins-are-numbered 193 + 194 + examples: 195 + - | 196 + #include <dt-bindings/pinctrl/stm32-pinfunc.h> 197 + //Example 1 198 + pinctrl@40020000 { 199 + #address-cells = <1>; 200 + #size-cells = <1>; 201 + compatible = "st,stm32f429-pinctrl"; 202 + ranges = <0 0x40020000 0x3000>; 203 + pins-are-numbered; 204 + 205 + gpioa: gpio@0 { 206 + gpio-controller; 207 + #gpio-cells = <2>; 208 + reg = <0x0 0x400>; 209 + resets = <&reset_ahb1 0>; 210 + st,bank-name = "GPIOA"; 211 + }; 212 + }; 213 + 214 + //Example 2 (using gpio-ranges) 215 + pinctrl@50020000 { 216 + #address-cells = <1>; 217 + #size-cells = <1>; 218 + compatible = "st,stm32f429-pinctrl"; 219 + ranges = <0 0x50020000 0x3000>; 220 + pins-are-numbered; 221 + 222 + gpiob: gpio@1000 { 223 + gpio-controller; 224 + #gpio-cells = <2>; 225 + reg = <0x1000 0x400>; 226 + resets = <&reset_ahb1 0>; 227 + st,bank-name = "GPIOB"; 228 + gpio-ranges = <&pinctrl 0 0 16>; 229 + }; 230 + 231 + gpioc: gpio@2000 { 232 + gpio-controller; 233 + #gpio-cells = <2>; 234 + reg = <0x2000 0x400>; 235 + resets = <&reset_ahb1 0>; 236 + st,bank-name = "GPIOC"; 237 + ngpios = <5>; 238 + gpio-ranges = <&pinctrl 0 16 3>, 239 + <&pinctrl 14 30 2>; 240 + }; 241 + }; 242 + 243 + //Example 3 pin groups 244 + pinctrl@60020000 { 245 + usart1_pins_a: usart1-0 { 246 + pins1 { 247 + pinmux = <STM32_PINMUX('A', 9, AF7)>; 248 + bias-disable; 249 + drive-push-pull; 250 + slew-rate = <0>; 251 + }; 252 + pins2 { 253 + pinmux = <STM32_PINMUX('A', 10, AF7)>; 254 + bias-disable; 255 + }; 256 + }; 257 + }; 258 + 259 + usart1 { 260 + pinctrl-0 = <&usart1_pins_a>; 261 + pinctrl-names = "default"; 262 + }; 263 + 264 + ...
+9
MAINTAINERS
··· 2625 2625 F: Documentation/hwmon/asc7621.rst 2626 2626 F: drivers/hwmon/asc7621.c 2627 2627 2628 + ASPEED PINCTRL DRIVERS 2629 + M: Andrew Jeffery <andrew@aj.id.au> 2630 + L: linux-aspeed@lists.ozlabs.org (moderated for non-subscribers) 2631 + L: openbmc@lists.ozlabs.org (moderated for non-subscribers) 2632 + L: linux-gpio@vger.kernel.org 2633 + S: Maintained 2634 + F: drivers/pinctrl/aspeed/ 2635 + F: Documentation/devicetree/bindings/pinctrl/aspeed,* 2636 + 2628 2637 ASPEED VIDEO ENGINE DRIVER 2629 2638 M: Eddie James <eajames@linux.ibm.com> 2630 2639 L: linux-media@vger.kernel.org
+646
arch/arm64/boot/dts/freescale/imx8mn-pinfunc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* 3 + * Copyright 2018-2019 NXP 4 + */ 5 + 6 + #ifndef __DTS_IMX8MN_PINFUNC_H 7 + #define __DTS_IMX8MN_PINFUNC_H 8 + 9 + /* 10 + * The pin function ID is a tuple of 11 + * <mux_reg conf_reg input_reg mux_mode input_val> 12 + */ 13 + 14 + #define MX8MN_IOMUXC_BOOT_MODE2_CCMSRCGPCMIX_BOOT_MODE2 0x020 0x25C 0x000 0x0 0x0 15 + #define MX8MN_IOMUXC_BOOT_MODE2_I2C1_SCL 0x020 0x25C 0x55C 0x1 0x3 16 + #define MX8MN_IOMUXC_BOOT_MODE3_CCMSRCGPCMIX_BOOT_MODE3 0x024 0x260 0x000 0x0 0x0 17 + #define MX8MN_IOMUXC_BOOT_MODE3_I2C1_SDA 0x024 0x260 0x56C 0x1 0x3 18 + #define MX8MN_IOMUXC_GPIO1_IO00_GPIO1_IO0 0x028 0x290 0x000 0x0 0x0 19 + #define MX8MN_IOMUXC_GPIO1_IO00_CCMSRCGPCMIX_ENET_PHY_REF_CLK_ROOT 0x028 0x290 0x000 0x1 0x0 20 + #define MX8MN_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K 0x028 0x290 0x000 0x5 0x0 21 + #define MX8MN_IOMUXC_GPIO1_IO00_CCMSRCGPCMIX_EXT_CLK1 0x028 0x290 0x000 0x6 0x0 22 + #define MX8MN_IOMUXC_GPIO1_IO01_GPIO1_IO1 0x02C 0x294 0x000 0x0 0x0 23 + #define MX8MN_IOMUXC_GPIO1_IO01_PWM1_OUT 0x02C 0x294 0x000 0x1 0x0 24 + #define MX8MN_IOMUXC_GPIO1_IO01_ANAMIX_REF_CLK_24M 0x02C 0x294 0x000 0x5 0x0 25 + #define MX8MN_IOMUXC_GPIO1_IO01_CCMSRCGPCMIX_EXT_CLK2 0x02C 0x294 0x000 0x6 0x0 26 + #define MX8MN_IOMUXC_GPIO1_IO02_GPIO1_IO2 0x030 0x298 0x000 0x0 0x0 27 + #define MX8MN_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B 0x030 0x298 0x000 0x1 0x0 28 + #define MX8MN_IOMUXC_GPIO1_IO02_WDOG1_WDOG_ANY 0x030 0x298 0x000 0x5 0x0 29 + #define MX8MN_IOMUXC_GPIO1_IO03_GPIO1_IO3 0x034 0x29C 0x000 0x0 0x0 30 + #define MX8MN_IOMUXC_GPIO1_IO03_USDHC1_VSELECT 0x034 0x29C 0x000 0x1 0x0 31 + #define MX8MN_IOMUXC_GPIO1_IO03_SDMA1_EXT_EVENT0 0x034 0x29C 0x000 0x5 0x0 32 + #define MX8MN_IOMUXC_GPIO1_IO03_ANAMIX_XTAL_OK 0x034 0x29C 0x000 0x6 0x0 33 + #define MX8MN_IOMUXC_GPIO1_IO04_GPIO1_IO4 0x038 0x2A0 0x000 0x0 0x0 34 + #define MX8MN_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x038 0x2A0 0x000 0x1 0x0 35 + #define MX8MN_IOMUXC_GPIO1_IO04_SDMA1_EXT_EVENT1 0x038 0x2A0 0x000 0x5 0x0 36 + #define MX8MN_IOMUXC_GPIO1_IO04_ANAMIX_XTAL_OK_LV 0x038 0x2A0 0x000 0x6 0x0 37 + #define MX8MN_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x03C 0x2A4 0x000 0x0 0x0 38 + #define MX8MN_IOMUXC_GPIO1_IO05_M4_NMI 0x03C 0x2A4 0x000 0x1 0x0 39 + #define MX8MN_IOMUXC_GPIO1_IO05_CCMSRCGPCMIX_PMIC_READY 0x03C 0x2A4 0x4BC 0x5 0x0 40 + #define MX8MN_IOMUXC_GPIO1_IO05_CCMSRCGPCMIX_INT_BOOT 0x03C 0x2A4 0x000 0x6 0x0 41 + #define MX8MN_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x040 0x2A8 0x000 0x0 0x0 42 + #define MX8MN_IOMUXC_GPIO1_IO06_ENET1_MDC 0x040 0x2A8 0x000 0x1 0x0 43 + #define MX8MN_IOMUXC_GPIO1_IO06_USDHC1_CD_B 0x040 0x2A8 0x000 0x5 0x0 44 + #define MX8MN_IOMUXC_GPIO1_IO06_CCMSRCGPCMIX_EXT_CLK3 0x040 0x2A8 0x000 0x6 0x0 45 + #define MX8MN_IOMUXC_GPIO1_IO07_GPIO1_IO7 0x044 0x2AC 0x000 0x0 0x0 46 + #define MX8MN_IOMUXC_GPIO1_IO07_ENET1_MDIO 0x044 0x2AC 0x4C0 0x1 0x0 47 + #define MX8MN_IOMUXC_GPIO1_IO07_USDHC1_WP 0x044 0x2AC 0x000 0x5 0x0 48 + #define MX8MN_IOMUXC_GPIO1_IO07_CCMSRCGPCMIX_EXT_CLK4 0x044 0x2AC 0x000 0x6 0x0 49 + #define MX8MN_IOMUXC_GPIO1_IO08_GPIO1_IO8 0x048 0x2B0 0x000 0x0 0x0 50 + #define MX8MN_IOMUXC_GPIO1_IO08_ENET1_1588_EVENT0_IN 0x048 0x2B0 0x000 0x1 0x0 51 + #define MX8MN_IOMUXC_GPIO1_IO08_PWM1_OUT 0x048 0x2B0 0x000 0x2 0x0 52 + #define MX8MN_IOMUXC_GPIO1_IO08_USDHC2_RESET_B 0x048 0x2B0 0x000 0x5 0x0 53 + #define MX8MN_IOMUXC_GPIO1_IO08_CCMSRCGPCMIX_WAIT 0x048 0x2B0 0x000 0x6 0x0 54 + #define MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x04C 0x2B4 0x000 0x0 0x0 55 + #define MX8MN_IOMUXC_GPIO1_IO09_ENET1_1588_EVENT0_OUT 0x04C 0x2B4 0x000 0x1 0x0 56 + #define MX8MN_IOMUXC_GPIO1_IO09_PWM2_OUT 0x04C 0x2B4 0x000 0x2 0x0 57 + #define MX8MN_IOMUXC_GPIO1_IO09_USDHC3_RESET_B 0x04C 0x2B4 0x000 0x4 0x0 58 + #define MX8MN_IOMUXC_GPIO1_IO09_SDMA2_EXT_EVENT0 0x04C 0x2B4 0x000 0x5 0x0 59 + #define MX8MN_IOMUXC_GPIO1_IO09_CCMSRCGPCMIX_STOP 0x04C 0x2B4 0x000 0x6 0x0 60 + #define MX8MN_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x050 0x2B8 0x000 0x0 0x0 61 + #define MX8MN_IOMUXC_GPIO1_IO10_USB1_OTG_ID 0x050 0x2B8 0x000 0x1 0x0 62 + #define MX8MN_IOMUXC_GPIO1_IO10_PWM3_OUT 0x050 0x2B8 0x000 0x2 0x0 63 + #define MX8MN_IOMUXC_GPIO1_IO11_GPIO1_IO11 0x054 0x2BC 0x000 0x0 0x0 64 + #define MX8MN_IOMUXC_GPIO1_IO11_PWM2_OUT 0x054 0x2BC 0x000 0x1 0x0 65 + #define MX8MN_IOMUXC_GPIO1_IO11_USDHC3_VSELECT 0x054 0x2BC 0x000 0x4 0x0 66 + #define MX8MN_IOMUXC_GPIO1_IO11_CCMSRCGPCMIX_PMIC_READY 0x054 0x2BC 0x4BC 0x5 0x1 67 + #define MX8MN_IOMUXC_GPIO1_IO11_CCMSRCGPCMIX_OUT0 0x054 0x2BC 0x000 0x6 0x0 68 + #define MX8MN_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x058 0x2C0 0x000 0x0 0x0 69 + #define MX8MN_IOMUXC_GPIO1_IO12_USB1_OTG_PWR 0x058 0x2C0 0x000 0x1 0x0 70 + #define MX8MN_IOMUXC_GPIO1_IO12_SDMA2_EXT_EVENT1 0x058 0x2C0 0x000 0x5 0x0 71 + #define MX8MN_IOMUXC_GPIO1_IO12_CCMSRCGPCMIX_OUT1 0x058 0x2C0 0x000 0x6 0x0 72 + #define MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13 0x05C 0x2C4 0x000 0x0 0x0 73 + #define MX8MN_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x05C 0x2C4 0x000 0x1 0x0 74 + #define MX8MN_IOMUXC_GPIO1_IO13_PWM2_OUT 0x05C 0x2C4 0x000 0x5 0x0 75 + #define MX8MN_IOMUXC_GPIO1_IO13_CCMSRCGPCMIX_OUT2 0x05C 0x2C4 0x000 0x6 0x0 76 + #define MX8MN_IOMUXC_GPIO1_IO14_GPIO1_IO14 0x060 0x2C8 0x000 0x0 0x0 77 + #define MX8MN_IOMUXC_GPIO1_IO14_USDHC3_CD_B 0x060 0x2C8 0x598 0x4 0x2 78 + #define MX8MN_IOMUXC_GPIO1_IO14_PWM3_OUT 0x060 0x2C8 0x000 0x5 0x0 79 + #define MX8MN_IOMUXC_GPIO1_IO14_CCMSRCGPCMIX_CLKO1 0x060 0x2C8 0x000 0x6 0x0 80 + #define MX8MN_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x064 0x2CC 0x000 0x0 0x0 81 + #define MX8MN_IOMUXC_GPIO1_IO15_USDHC3_WP 0x064 0x2CC 0x5B8 0x4 0x2 82 + #define MX8MN_IOMUXC_GPIO1_IO15_PWM4_OUT 0x064 0x2CC 0x000 0x5 0x0 83 + #define MX8MN_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2 0x064 0x2CC 0x000 0x6 0x0 84 + #define MX8MN_IOMUXC_ENET_MDC_ENET1_MDC 0x068 0x2D0 0x000 0x0 0x0 85 + #define MX8MN_IOMUXC_ENET_MDC_SAI6_TX_DATA0 0x068 0x2D0 0x000 0x2 0x0 86 + #define MX8MN_IOMUXC_ENET_MDC_PDM_BIT_STREAM3 0x068 0x2D0 0x540 0x3 0x1 87 + #define MX8MN_IOMUXC_ENET_MDC_SPDIF1_OUT 0x068 0x2D0 0x000 0x4 0x0 88 + #define MX8MN_IOMUXC_ENET_MDC_GPIO1_IO16 0x068 0x2D0 0x000 0x5 0x0 89 + #define MX8MN_IOMUXC_ENET_MDC_USDHC3_STROBE 0x068 0x2D0 0x59C 0x6 0x1 90 + #define MX8MN_IOMUXC_ENET_MDIO_ENET1_MDIO 0x06C 0x2D4 0x4C0 0x0 0x1 91 + #define MX8MN_IOMUXC_ENET_MDIO_SAI6_TX_SYNC 0x06C 0x2D4 0x000 0x2 0x0 92 + #define MX8MN_IOMUXC_ENET_MDIO_PDM_BIT_STREAM2 0x06C 0x2D4 0x53C 0x3 0x1 93 + #define MX8MN_IOMUXC_ENET_MDIO_SPDIF1_IN 0x06C 0x2D4 0x5CC 0x4 0x1 94 + #define MX8MN_IOMUXC_ENET_MDIO_GPIO1_IO17 0x06C 0x2D4 0x000 0x5 0x0 95 + #define MX8MN_IOMUXC_ENET_MDIO_USDHC3_DATA5 0x06C 0x2D4 0x550 0x6 0x1 96 + #define MX8MN_IOMUXC_ENET_TD3_ENET1_RGMII_TD3 0x070 0x2D8 0x000 0x0 0x0 97 + #define MX8MN_IOMUXC_ENET_TD3_SAI6_TX_BCLK 0x070 0x2D8 0x000 0x2 0x0 98 + #define MX8MN_IOMUXC_ENET_TD3_PDM_BIT_STREAM1 0x070 0x2D8 0x538 0x3 0x1 99 + #define MX8MN_IOMUXC_ENET_TD3_SPDIF1_EXT_CLK 0x070 0x2D8 0x568 0x4 0x1 100 + #define MX8MN_IOMUXC_ENET_TD3_GPIO1_IO18 0x070 0x2D8 0x000 0x5 0x0 101 + #define MX8MN_IOMUXC_ENET_TD3_USDHC3_DATA6 0x070 0x2D8 0x584 0x6 0x1 102 + #define MX8MN_IOMUXC_ENET_TD2_ENET1_RGMII_TD2 0x074 0x2DC 0x000 0x0 0x0 103 + #define MX8MN_IOMUXC_ENET_TD2_ENET1_TX_CLK 0x074 0x2DC 0x5A4 0x1 0x0 104 + #define MX8MN_IOMUXC_ENET_TD2_CCMSRCGPCMIX_ENET_REF_CLK_ROOT 0x074 0x2DC 0x5A4 0x1 0x0 105 + #define MX8MN_IOMUXC_ENET_TD2_SAI6_RX_DATA0 0x074 0x2DC 0x000 0x2 0x0 106 + #define MX8MN_IOMUXC_ENET_TD2_PDM_BIT_STREAM3 0x074 0x2DC 0x540 0x3 0x2 107 + #define MX8MN_IOMUXC_ENET_TD2_GPIO1_IO19 0x074 0x2DC 0x000 0x5 0x0 108 + #define MX8MN_IOMUXC_ENET_TD2_USDHC3_DATA7 0x074 0x2DC 0x54C 0x6 0x1 109 + #define MX8MN_IOMUXC_ENET_TD1_ENET1_RGMII_TD1 0x078 0x2E0 0x000 0x0 0x0 110 + #define MX8MN_IOMUXC_ENET_TD1_SAI6_RX_SYNC 0x078 0x2E0 0x000 0x2 0x0 111 + #define MX8MN_IOMUXC_ENET_TD1_PDM_BIT_STREAM2 0x078 0x2E0 0x53C 0x3 0x2 112 + #define MX8MN_IOMUXC_ENET_TD1_GPIO1_IO20 0x078 0x2E0 0x000 0x5 0x0 113 + #define MX8MN_IOMUXC_ENET_TD1_USDHC3_CD_B 0x078 0x2E0 0x598 0x6 0x3 114 + #define MX8MN_IOMUXC_ENET_TD0_ENET1_RGMII_TD0 0x07C 0x2E4 0x000 0x0 0x0 115 + #define MX8MN_IOMUXC_ENET_TD0_SAI6_RX_BCLK 0x07C 0x2E4 0x000 0x2 0x0 116 + #define MX8MN_IOMUXC_ENET_TD0_PDM_BIT_STREAM1 0x07C 0x2E4 0x538 0x3 0x2 117 + #define MX8MN_IOMUXC_ENET_TD0_GPIO1_IO21 0x07C 0x2E4 0x000 0x5 0x0 118 + #define MX8MN_IOMUXC_ENET_TD0_USDHC3_WP 0x07C 0x2E4 0x5B8 0x6 0x3 119 + #define MX8MN_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL 0x080 0x2E8 0x000 0x0 0x0 120 + #define MX8MN_IOMUXC_ENET_TX_CTL_SAI6_MCLK 0x080 0x2E8 0x000 0x2 0x0 121 + #define MX8MN_IOMUXC_ENET_TX_CTL_GPIO1_IO22 0x080 0x2E8 0x000 0x5 0x0 122 + #define MX8MN_IOMUXC_ENET_TX_CTL_USDHC3_DATA0 0x080 0x2E8 0x5B4 0x6 0x1 123 + #define MX8MN_IOMUXC_ENET_TXC_ENET1_RGMII_TXC 0x084 0x2EC 0x000 0x0 0x0 124 + #define MX8MN_IOMUXC_ENET_TXC_ENET1_TX_ER 0x084 0x2EC 0x000 0x1 0x0 125 + #define MX8MN_IOMUXC_ENET_TXC_SAI7_TX_DATA0 0x084 0x2EC 0x000 0x2 0x0 126 + #define MX8MN_IOMUXC_ENET_TXC_GPIO1_IO23 0x084 0x2EC 0x000 0x5 0x0 127 + #define MX8MN_IOMUXC_ENET_TXC_USDHC3_DATA1 0x084 0x2EC 0x5B0 0x6 0x1 128 + #define MX8MN_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL 0x088 0x2F0 0x574 0x0 0x0 129 + #define MX8MN_IOMUXC_ENET_RX_CTL_SAI7_TX_SYNC 0x088 0x2F0 0x000 0x2 0x0 130 + #define MX8MN_IOMUXC_ENET_RX_CTL_PDM_BIT_STREAM3 0x088 0x2F0 0x540 0x3 0x3 131 + #define MX8MN_IOMUXC_ENET_RX_CTL_GPIO1_IO24 0x088 0x2F0 0x000 0x5 0x0 132 + #define MX8MN_IOMUXC_ENET_RX_CTL_USDHC3_DATA2 0x088 0x2F0 0x5E4 0x6 0x1 133 + #define MX8MN_IOMUXC_ENET_RXC_ENET1_RGMII_RXC 0x08C 0x2F4 0x000 0x0 0x0 134 + #define MX8MN_IOMUXC_ENET_RXC_ENET1_RX_ER 0x08C 0x2F4 0x5C8 0x1 0x0 135 + #define MX8MN_IOMUXC_ENET_RXC_SAI7_TX_BCLK 0x08C 0x2F4 0x000 0x2 0x0 136 + #define MX8MN_IOMUXC_ENET_RXC_PDM_BIT_STREAM2 0x08C 0x2F4 0x53C 0x3 0x3 137 + #define MX8MN_IOMUXC_ENET_RXC_GPIO1_IO25 0x08C 0x2F4 0x000 0x5 0x0 138 + #define MX8MN_IOMUXC_ENET_RXC_USDHC3_DATA3 0x08C 0x2F4 0x5E0 0x6 0x1 139 + #define MX8MN_IOMUXC_ENET_RD0_ENET1_RGMII_RD0 0x090 0x2F8 0x57C 0x0 0x0 140 + #define MX8MN_IOMUXC_ENET_RD0_SAI7_RX_DATA0 0x090 0x2F8 0x000 0x2 0x0 141 + #define MX8MN_IOMUXC_ENET_RD0_PDM_BIT_STREAM1 0x090 0x2F8 0x538 0x3 0x3 142 + #define MX8MN_IOMUXC_ENET_RD0_GPIO1_IO26 0x090 0x2F8 0x000 0x5 0x0 143 + #define MX8MN_IOMUXC_ENET_RD0_USDHC3_DATA4 0x090 0x2F8 0x558 0x6 0x1 144 + #define MX8MN_IOMUXC_ENET_RD1_ENET1_RGMII_RD1 0x094 0x2FC 0x554 0x0 0x0 145 + #define MX8MN_IOMUXC_ENET_RD1_SAI7_RX_SYNC 0x094 0x2FC 0x000 0x2 0x0 146 + #define MX8MN_IOMUXC_ENET_RD1_PDM_BIT_STREAM0 0x094 0x2FC 0x534 0x3 0x1 147 + #define MX8MN_IOMUXC_ENET_RD1_GPIO1_IO27 0x094 0x2FC 0x000 0x5 0x0 148 + #define MX8MN_IOMUXC_ENET_RD1_USDHC3_RESET_B 0x094 0x2FC 0x000 0x6 0x0 149 + #define MX8MN_IOMUXC_ENET_RD2_ENET1_RGMII_RD2 0x098 0x300 0x000 0x0 0x0 150 + #define MX8MN_IOMUXC_ENET_RD2_SAI7_RX_BCLK 0x098 0x300 0x000 0x2 0x0 151 + #define MX8MN_IOMUXC_ENET_RD2_PDM_CLK 0x098 0x300 0x000 0x3 0x0 152 + #define MX8MN_IOMUXC_ENET_RD2_GPIO1_IO28 0x098 0x300 0x000 0x5 0x0 153 + #define MX8MN_IOMUXC_ENET_RD2_USDHC3_CLK 0x098 0x300 0x5A0 0x6 0x1 154 + #define MX8MN_IOMUXC_ENET_RD3_ENET1_RGMII_RD3 0x09C 0x304 0x000 0x0 0x0 155 + #define MX8MN_IOMUXC_ENET_RD3_SAI7_MCLK 0x09C 0x304 0x000 0x2 0x0 156 + #define MX8MN_IOMUXC_ENET_RD3_SPDIF1_IN 0x09C 0x304 0x5CC 0x3 0x5 157 + #define MX8MN_IOMUXC_ENET_RD3_GPIO1_IO29 0x09C 0x304 0x000 0x5 0x0 158 + #define MX8MN_IOMUXC_ENET_RD3_USDHC3_CMD 0x09C 0x304 0x5DC 0x6 0x1 159 + #define MX8MN_IOMUXC_SD1_CLK_USDHC1_CLK 0x0A0 0x308 0x000 0x0 0x0 160 + #define MX8MN_IOMUXC_SD1_CLK_ENET1_MDC 0x0A0 0x308 0x000 0x1 0x0 161 + #define MX8MN_IOMUXC_SD1_CLK_UART1_DCE_TX 0x0A0 0x308 0x000 0x4 0x0 162 + #define MX8MN_IOMUXC_SD1_CLK_UART1_DTE_RX 0x0A0 0x308 0x4F4 0x4 0x4 163 + #define MX8MN_IOMUXC_SD1_CLK_GPIO2_IO0 0x0A0 0x308 0x000 0x5 0x0 164 + #define MX8MN_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 165 + #define MX8MN_IOMUXC_SD1_CMD_ENET1_MDIO 0x0A4 0x30C 0x4C0 0x1 0x3 166 + #define MX8MN_IOMUXC_SD1_CMD_UART1_DCE_RX 0x0A4 0x30C 0x4F4 0x4 0x5 167 + #define MX8MN_IOMUXC_SD1_CMD_UART1_DTE_TX 0x0A4 0x30C 0x000 0x4 0x0 168 + #define MX8MN_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 169 + #define MX8MN_IOMUXC_SD1_DATA0_USDHC1_DATA0 0x0A8 0x310 0x000 0x0 0x0 170 + #define MX8MN_IOMUXC_SD1_DATA0_ENET1_RGMII_TD1 0x0A8 0x310 0x000 0x1 0x0 171 + #define MX8MN_IOMUXC_SD1_DATA0_UART1_DCE_RTS_B 0x0A8 0x310 0x4F0 0x4 0x4 172 + #define MX8MN_IOMUXC_SD1_DATA0_UART1_DTE_CTS_B 0x0A8 0x310 0x000 0x4 0x0 173 + #define MX8MN_IOMUXC_SD1_DATA0_GPIO2_IO2 0x0A8 0x310 0x000 0x5 0x0 174 + #define MX8MN_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 175 + #define MX8MN_IOMUXC_SD1_DATA1_ENET1_RGMII_TD0 0x0AC 0x314 0x000 0x1 0x0 176 + #define MX8MN_IOMUXC_SD1_DATA1_UART1_DCE_CTS_B 0x0AC 0x314 0x000 0x4 0x0 177 + #define MX8MN_IOMUXC_SD1_DATA1_UART1_DTE_RTS_B 0x0AC 0x314 0x4F0 0x4 0x5 178 + #define MX8MN_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 179 + #define MX8MN_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 180 + #define MX8MN_IOMUXC_SD1_DATA2_ENET1_RGMII_RD0 0x0B0 0x318 0x57C 0x1 0x1 181 + #define MX8MN_IOMUXC_SD1_DATA2_UART2_DCE_TX 0x0B0 0x318 0x000 0x4 0x0 182 + #define MX8MN_IOMUXC_SD1_DATA2_UART2_DTE_RX 0x0B0 0x318 0x4FC 0x4 0x4 183 + #define MX8MN_IOMUXC_SD1_DATA2_GPIO2_IO4 0x0B0 0x318 0x000 0x5 0x0 184 + #define MX8MN_IOMUXC_SD1_DATA3_USDHC1_DATA3 0x0B4 0x31C 0x000 0x0 0x0 185 + #define MX8MN_IOMUXC_SD1_DATA3_ENET1_RGMII_RD1 0x0B4 0x31C 0x554 0x1 0x1 186 + #define MX8MN_IOMUXC_SD1_DATA3_UART2_DCE_RX 0x0B4 0x31C 0x4FC 0x4 0x5 187 + #define MX8MN_IOMUXC_SD1_DATA3_UART2_DTE_TX 0x0B4 0x31C 0x000 0x4 0x0 188 + #define MX8MN_IOMUXC_SD1_DATA3_GPIO2_IO5 0x0B4 0x31C 0x000 0x5 0x0 189 + #define MX8MN_IOMUXC_SD1_DATA4_USDHC1_DATA4 0x0B8 0x320 0x000 0x0 0x0 190 + #define MX8MN_IOMUXC_SD1_DATA4_ENET1_RGMII_TX_CTL 0x0B8 0x320 0x000 0x1 0x0 191 + #define MX8MN_IOMUXC_SD1_DATA4_I2C1_SCL 0x0B8 0x320 0x55C 0x3 0x1 192 + #define MX8MN_IOMUXC_SD1_DATA4_UART2_DCE_RTS_B 0x0B8 0x320 0x4F8 0x4 0x4 193 + #define MX8MN_IOMUXC_SD1_DATA4_UART2_DTE_CTS_B 0x0B8 0x320 0x000 0x4 0x0 194 + #define MX8MN_IOMUXC_SD1_DATA4_GPIO2_IO6 0x0B8 0x320 0x000 0x5 0x0 195 + #define MX8MN_IOMUXC_SD1_DATA5_USDHC1_DATA5 0x0BC 0x324 0x000 0x0 0x0 196 + #define MX8MN_IOMUXC_SD1_DATA5_ENET1_TX_ER 0x0BC 0x324 0x000 0x1 0x0 197 + #define MX8MN_IOMUXC_SD1_DATA5_I2C1_SDA 0x0BC 0x324 0x56C 0x3 0x1 198 + #define MX8MN_IOMUXC_SD1_DATA5_UART2_DCE_CTS_B 0x0BC 0x324 0x000 0x4 0x0 199 + #define MX8MN_IOMUXC_SD1_DATA5_UART2_DTE_RTS_B 0x0BC 0x324 0x4F8 0x4 0x5 200 + #define MX8MN_IOMUXC_SD1_DATA5_GPIO2_IO7 0x0BC 0x324 0x000 0x5 0x0 201 + #define MX8MN_IOMUXC_SD1_DATA6_USDHC1_DATA6 0x0C0 0x328 0x000 0x0 0x0 202 + #define MX8MN_IOMUXC_SD1_DATA6_ENET1_RGMII_RX_CTL 0x0C0 0x328 0x574 0x1 0x1 203 + #define MX8MN_IOMUXC_SD1_DATA6_I2C2_SCL 0x0C0 0x328 0x5D0 0x3 0x1 204 + #define MX8MN_IOMUXC_SD1_DATA6_UART3_DCE_TX 0x0C0 0x328 0x000 0x4 0x0 205 + #define MX8MN_IOMUXC_SD1_DATA6_UART3_DTE_RX 0x0C0 0x328 0x504 0x4 0x4 206 + #define MX8MN_IOMUXC_SD1_DATA6_GPIO2_IO8 0x0C0 0x328 0x000 0x5 0x0 207 + #define MX8MN_IOMUXC_SD1_DATA7_USDHC1_DATA7 0x0C4 0x32C 0x000 0x0 0x0 208 + #define MX8MN_IOMUXC_SD1_DATA7_ENET1_RX_ER 0x0C4 0x32C 0x5C8 0x1 0x1 209 + #define MX8MN_IOMUXC_SD1_DATA7_I2C2_SDA 0x0C4 0x32C 0x560 0x3 0x1 210 + #define MX8MN_IOMUXC_SD1_DATA7_UART3_DCE_RX 0x0C4 0x32C 0x504 0x4 0x5 211 + #define MX8MN_IOMUXC_SD1_DATA7_UART3_DTE_TX 0x0C4 0x32C 0x000 0x4 0x0 212 + #define MX8MN_IOMUXC_SD1_DATA7_GPIO2_IO9 0x0C4 0x32C 0x000 0x5 0x0 213 + #define MX8MN_IOMUXC_SD1_RESET_B_USDHC1_RESET_B 0x0C8 0x330 0x000 0x0 0x0 214 + #define MX8MN_IOMUXC_SD1_RESET_B_ENET1_TX_CLK 0x0C8 0x330 0x5A4 0x1 0x1 215 + #define MX8MN_IOMUXC_SD1_RESET_B_CCMSRCGPCMIX_ENET_REF_CLK_ROOT 0x0C8 0x330 0x5A4 0x1 0x0 216 + #define MX8MN_IOMUXC_SD1_RESET_B_I2C3_SCL 0x0C8 0x330 0x588 0x3 0x1 217 + #define MX8MN_IOMUXC_SD1_RESET_B_UART3_DCE_RTS_B 0x0C8 0x330 0x500 0x4 0x2 218 + #define MX8MN_IOMUXC_SD1_RESET_B_UART3_DTE_CTS_B 0x0C8 0x330 0x000 0x4 0x0 219 + #define MX8MN_IOMUXC_SD1_RESET_B_GPIO2_IO10 0x0C8 0x330 0x000 0x5 0x0 220 + #define MX8MN_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x0CC 0x334 0x000 0x0 0x0 221 + #define MX8MN_IOMUXC_SD1_STROBE_I2C3_SDA 0x0CC 0x334 0x5BC 0x3 0x1 222 + #define MX8MN_IOMUXC_SD1_STROBE_UART3_DCE_CTS_B 0x0CC 0x334 0x000 0x4 0x0 223 + #define MX8MN_IOMUXC_SD1_STROBE_UART3_DTE_RTS_B 0x0CC 0x334 0x500 0x4 0x3 224 + #define MX8MN_IOMUXC_SD1_STROBE_GPIO2_IO11 0x0CC 0x334 0x000 0x5 0x0 225 + #define MX8MN_IOMUXC_SD2_CD_B_USDHC2_CD_B 0x0D0 0x338 0x000 0x0 0x0 226 + #define MX8MN_IOMUXC_SD2_CD_B_GPIO2_IO12 0x0D0 0x338 0x000 0x5 0x0 227 + #define MX8MN_IOMUXC_SD2_CD_B_CCMSRCGPCMIX_TESTER_ACK 0x0D0 0x338 0x000 0x6 0x0 228 + #define MX8MN_IOMUXC_SD2_CLK_USDHC2_CLK 0x0D4 0x33C 0x000 0x0 0x0 229 + #define MX8MN_IOMUXC_SD2_CLK_SAI5_RX_SYNC 0x0D4 0x33C 0x4E4 0x1 0x1 230 + #define MX8MN_IOMUXC_SD2_CLK_ECSPI2_SCLK 0x0D4 0x33C 0x580 0x2 0x1 231 + #define MX8MN_IOMUXC_SD2_CLK_UART4_DCE_RX 0x0D4 0x33C 0x50C 0x3 0x4 232 + #define MX8MN_IOMUXC_SD2_CLK_UART4_DTE_TX 0x0D4 0x33C 0x000 0x3 0x0 233 + #define MX8MN_IOMUXC_SD2_CLK_SAI5_MCLK 0x0D4 0x33C 0x594 0x4 0x1 234 + #define MX8MN_IOMUXC_SD2_CLK_GPIO2_IO13 0x0D4 0x33C 0x000 0x5 0x0 235 + #define MX8MN_IOMUXC_SD2_CLK_CCMSRCGPCMIX_OBSERVE0 0x0D4 0x33C 0x000 0x6 0x0 236 + #define MX8MN_IOMUXC_SD2_CMD_USDHC2_CMD 0x0D8 0x340 0x000 0x0 0x0 237 + #define MX8MN_IOMUXC_SD2_CMD_SAI5_RX_BCLK 0x0D8 0x340 0x4D0 0x1 0x1 238 + #define MX8MN_IOMUXC_SD2_CMD_ECSPI2_MOSI 0x0D8 0x340 0x590 0x2 0x1 239 + #define MX8MN_IOMUXC_SD2_CMD_UART4_DCE_TX 0x0D8 0x340 0x000 0x3 0x0 240 + #define MX8MN_IOMUXC_SD2_CMD_UART4_DTE_RX 0x0D8 0x340 0x50C 0x3 0x5 241 + #define MX8MN_IOMUXC_SD2_CMD_PDM_CLK 0x0D8 0x340 0x000 0x4 0x0 242 + #define MX8MN_IOMUXC_SD2_CMD_GPIO2_IO14 0x0D8 0x340 0x000 0x5 0x0 243 + #define MX8MN_IOMUXC_SD2_CMD_CCMSRCGPCMIX_OBSERVE1 0x0D8 0x340 0x000 0x6 0x0 244 + #define MX8MN_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x0DC 0x344 0x000 0x0 0x0 245 + #define MX8MN_IOMUXC_SD2_DATA0_SAI5_RX_DATA0 0x0DC 0x344 0x4D4 0x1 0x1 246 + #define MX8MN_IOMUXC_SD2_DATA0_I2C4_SDA 0x0DC 0x344 0x58C 0x2 0x1 247 + #define MX8MN_IOMUXC_SD2_DATA0_UART2_DCE_RX 0x0DC 0x344 0x4FC 0x3 0x6 248 + #define MX8MN_IOMUXC_SD2_DATA0_UART2_DTE_TX 0x0DC 0x344 0x000 0x3 0x0 249 + #define MX8MN_IOMUXC_SD2_DATA0_PDM_BIT_STREAM0 0x0DC 0x344 0x534 0x4 0x2 250 + #define MX8MN_IOMUXC_SD2_DATA0_GPIO2_IO15 0x0DC 0x344 0x000 0x5 0x0 251 + #define MX8MN_IOMUXC_SD2_DATA0_CCMSRCGPCMIX_OBSERVE2 0x0DC 0x344 0x000 0x6 0x0 252 + #define MX8MN_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x0E0 0x348 0x000 0x0 0x0 253 + #define MX8MN_IOMUXC_SD2_DATA1_SAI5_TX_SYNC 0x0E0 0x348 0x4EC 0x1 0x1 254 + #define MX8MN_IOMUXC_SD2_DATA1_I2C4_SCL 0x0E0 0x348 0x5D4 0x2 0x1 255 + #define MX8MN_IOMUXC_SD2_DATA1_UART2_DCE_TX 0x0E0 0x348 0x000 0x3 0x0 256 + #define MX8MN_IOMUXC_SD2_DATA1_UART2_DTE_RX 0x0E0 0x348 0x4FC 0x3 0x7 257 + #define MX8MN_IOMUXC_SD2_DATA1_PDM_BIT_STREAM1 0x0E0 0x348 0x538 0x4 0x4 258 + #define MX8MN_IOMUXC_SD2_DATA1_GPIO2_IO16 0x0E0 0x348 0x000 0x5 0x0 259 + #define MX8MN_IOMUXC_SD2_DATA1_CCMSRCGPCMIX_WAIT 0x0E0 0x348 0x000 0x6 0x0 260 + #define MX8MN_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x0E4 0x34C 0x000 0x0 0x0 261 + #define MX8MN_IOMUXC_SD2_DATA2_SAI5_TX_BCLK 0x0E4 0x34C 0x4E8 0x1 0x1 262 + #define MX8MN_IOMUXC_SD2_DATA2_ECSPI2_SS0 0x0E4 0x34C 0x570 0x2 0x2 263 + #define MX8MN_IOMUXC_SD2_DATA2_SPDIF1_OUT 0x0E4 0x34C 0x000 0x3 0x0 264 + #define MX8MN_IOMUXC_SD2_DATA2_PDM_BIT_STREAM2 0x0E4 0x34C 0x53C 0x4 0x4 265 + #define MX8MN_IOMUXC_SD2_DATA2_GPIO2_IO17 0x0E4 0x34C 0x000 0x5 0x0 266 + #define MX8MN_IOMUXC_SD2_DATA2_CCMSRCGPCMIX_STOP 0x0E4 0x34C 0x000 0x6 0x0 267 + #define MX8MN_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x0E8 0x350 0x000 0x0 0x0 268 + #define MX8MN_IOMUXC_SD2_DATA3_SAI5_TX_DATA0 0x0E8 0x350 0x000 0x1 0x0 269 + #define MX8MN_IOMUXC_SD2_DATA3_ECSPI2_MISO 0x0E8 0x350 0x578 0x2 0x1 270 + #define MX8MN_IOMUXC_SD2_DATA3_SPDIF1_IN 0x0E8 0x350 0x5CC 0x3 0x2 271 + #define MX8MN_IOMUXC_SD2_DATA3_PDM_BIT_STREAM3 0x0E8 0x350 0x540 0x4 0x4 272 + #define MX8MN_IOMUXC_SD2_DATA3_GPIO2_IO18 0x0E8 0x350 0x000 0x5 0x0 273 + #define MX8MN_IOMUXC_SD2_DATA3_CCMSRCGPCMIX_EARLY_RESET 0x0E8 0x350 0x000 0x6 0x0 274 + #define MX8MN_IOMUXC_SD2_RESET_B_USDHC2_RESET_B 0x0EC 0x354 0x000 0x0 0x0 275 + #define MX8MN_IOMUXC_SD2_RESET_B_GPIO2_IO19 0x0EC 0x354 0x000 0x5 0x0 276 + #define MX8MN_IOMUXC_SD2_RESET_B_CCMSRCGPCMIX_SYSTEM_RESET 0x0EC 0x354 0x000 0x6 0x0 277 + #define MX8MN_IOMUXC_SD2_WP_USDHC2_WP 0x0F0 0x358 0x000 0x0 0x0 278 + #define MX8MN_IOMUXC_SD2_WP_GPIO2_IO20 0x0F0 0x358 0x000 0x5 0x0 279 + #define MX8MN_IOMUXC_SD2_WP_CORESIGHT_EVENTI 0x0F0 0x358 0x000 0x6 0x0 280 + #define MX8MN_IOMUXC_NAND_ALE_RAWNAND_ALE 0x0F4 0x35C 0x000 0x0 0x0 281 + #define MX8MN_IOMUXC_NAND_ALE_QSPI_A_SCLK 0x0F4 0x35C 0x000 0x1 0x0 282 + #define MX8MN_IOMUXC_NAND_ALE_PDM_BIT_STREAM0 0x0F4 0x35C 0x534 0x3 0x3 283 + #define MX8MN_IOMUXC_NAND_ALE_UART3_DCE_RX 0x0F4 0x35C 0x504 0x4 0x6 284 + #define MX8MN_IOMUXC_NAND_ALE_UART3_DTE_TX 0x0F4 0x35C 0x000 0x4 0x0 285 + #define MX8MN_IOMUXC_NAND_ALE_GPIO3_IO0 0x0F4 0x35C 0x000 0x5 0x0 286 + #define MX8MN_IOMUXC_NAND_ALE_CORESIGHT_TRACE_CLK 0x0F4 0x35C 0x000 0x6 0x0 287 + #define MX8MN_IOMUXC_NAND_CE0_B_RAWNAND_CE0_B 0x0F8 0x360 0x000 0x0 0x0 288 + #define MX8MN_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B 0x0F8 0x360 0x000 0x1 0x0 289 + #define MX8MN_IOMUXC_NAND_CE0_B_PDM_BIT_STREAM1 0x0F8 0x360 0x538 0x3 0x5 290 + #define MX8MN_IOMUXC_NAND_CE0_B_UART3_DCE_TX 0x0F8 0x360 0x000 0x4 0x0 291 + #define MX8MN_IOMUXC_NAND_CE0_B_UART3_DTE_RX 0x0F8 0x360 0x504 0x4 0x7 292 + #define MX8MN_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x0F8 0x360 0x000 0x5 0x0 293 + #define MX8MN_IOMUXC_NAND_CE0_B_CORESIGHT_TRACE_CTL 0x0F8 0x360 0x000 0x6 0x0 294 + #define MX8MN_IOMUXC_NAND_CE1_B_RAWNAND_CE1_B 0x0FC 0x364 0x000 0x0 0x0 295 + #define MX8MN_IOMUXC_NAND_CE1_B_QSPI_A_SS1_B 0x0FC 0x364 0x000 0x1 0x0 296 + #define MX8MN_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x0FC 0x364 0x59C 0x2 0x0 297 + #define MX8MN_IOMUXC_NAND_CE1_B_PDM_BIT_STREAM0 0x0FC 0x364 0x534 0x3 0x4 298 + #define MX8MN_IOMUXC_NAND_CE1_B_I2C4_SCL 0x0FC 0x364 0x5D4 0x4 0x2 299 + #define MX8MN_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x0FC 0x364 0x000 0x5 0x0 300 + #define MX8MN_IOMUXC_NAND_CE1_B_CORESIGHT_TRACE0 0x0FC 0x364 0x000 0x6 0x0 301 + #define MX8MN_IOMUXC_NAND_CE2_B_RAWNAND_CE2_B 0x100 0x368 0x000 0x0 0x0 302 + #define MX8MN_IOMUXC_NAND_CE2_B_QSPI_B_SS0_B 0x100 0x368 0x000 0x1 0x0 303 + #define MX8MN_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x100 0x368 0x550 0x2 0x0 304 + #define MX8MN_IOMUXC_NAND_CE2_B_PDM_BIT_STREAM1 0x100 0x368 0x538 0x3 0x6 305 + #define MX8MN_IOMUXC_NAND_CE2_B_I2C4_SDA 0x100 0x368 0x58C 0x4 0x2 306 + #define MX8MN_IOMUXC_NAND_CE2_B_GPIO3_IO3 0x100 0x368 0x000 0x5 0x0 307 + #define MX8MN_IOMUXC_NAND_CE2_B_CORESIGHT_TRACE1 0x100 0x368 0x000 0x6 0x0 308 + #define MX8MN_IOMUXC_NAND_CE3_B_RAWNAND_CE3_B 0x104 0x36C 0x000 0x0 0x0 309 + #define MX8MN_IOMUXC_NAND_CE3_B_QSPI_B_SS1_B 0x104 0x36C 0x000 0x1 0x0 310 + #define MX8MN_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x104 0x36C 0x584 0x2 0x0 311 + #define MX8MN_IOMUXC_NAND_CE3_B_PDM_BIT_STREAM2 0x104 0x36C 0x53C 0x3 0x5 312 + #define MX8MN_IOMUXC_NAND_CE3_B_I2C3_SDA 0x104 0x36C 0x5BC 0x4 0x2 313 + #define MX8MN_IOMUXC_NAND_CE3_B_GPIO3_IO4 0x104 0x36C 0x000 0x5 0x0 314 + #define MX8MN_IOMUXC_NAND_CE3_B_CORESIGHT_TRACE2 0x104 0x36C 0x000 0x6 0x0 315 + #define MX8MN_IOMUXC_NAND_CLE_RAWNAND_CLE 0x108 0x370 0x000 0x0 0x0 316 + #define MX8MN_IOMUXC_NAND_CLE_QSPI_B_SCLK 0x108 0x370 0x000 0x1 0x0 317 + #define MX8MN_IOMUXC_NAND_CLE_USDHC3_DATA7 0x108 0x370 0x54C 0x2 0x0 318 + #define MX8MN_IOMUXC_NAND_CLE_GPIO3_IO5 0x108 0x370 0x000 0x5 0x0 319 + #define MX8MN_IOMUXC_NAND_CLE_CORESIGHT_TRACE3 0x108 0x370 0x000 0x6 0x0 320 + #define MX8MN_IOMUXC_NAND_DATA00_RAWNAND_DATA00 0x10C 0x374 0x000 0x0 0x0 321 + #define MX8MN_IOMUXC_NAND_DATA00_QSPI_A_DATA0 0x10C 0x374 0x000 0x1 0x0 322 + #define MX8MN_IOMUXC_NAND_DATA00_PDM_BIT_STREAM2 0x10C 0x374 0x53C 0x3 0x6 323 + #define MX8MN_IOMUXC_NAND_DATA00_UART4_DCE_RX 0x10C 0x374 0x50C 0x4 0x6 324 + #define MX8MN_IOMUXC_NAND_DATA00_UART4_DTE_TX 0x10C 0x374 0x000 0x4 0x0 325 + #define MX8MN_IOMUXC_NAND_DATA00_GPIO3_IO6 0x10C 0x374 0x000 0x5 0x0 326 + #define MX8MN_IOMUXC_NAND_DATA00_CORESIGHT_TRACE4 0x10C 0x374 0x000 0x6 0x0 327 + #define MX8MN_IOMUXC_NAND_DATA01_RAWNAND_DATA01 0x110 0x378 0x000 0x0 0x0 328 + #define MX8MN_IOMUXC_NAND_DATA01_QSPI_A_DATA1 0x110 0x378 0x000 0x1 0x0 329 + #define MX8MN_IOMUXC_NAND_DATA01_PDM_BIT_STREAM3 0x110 0x378 0x540 0x3 0x5 330 + #define MX8MN_IOMUXC_NAND_DATA01_UART4_DCE_TX 0x110 0x378 0x000 0x4 0x0 331 + #define MX8MN_IOMUXC_NAND_DATA01_UART4_DTE_RX 0x110 0x378 0x50C 0x4 0x7 332 + #define MX8MN_IOMUXC_NAND_DATA01_GPIO3_IO7 0x110 0x378 0x000 0x5 0x0 333 + #define MX8MN_IOMUXC_NAND_DATA01_CORESIGHT_TRACE5 0x110 0x378 0x000 0x6 0x0 334 + #define MX8MN_IOMUXC_NAND_DATA02_RAWNAND_DATA02 0x114 0x37C 0x000 0x0 0x0 335 + #define MX8MN_IOMUXC_NAND_DATA02_QSPI_A_DATA2 0x114 0x37C 0x000 0x1 0x0 336 + #define MX8MN_IOMUXC_NAND_DATA02_USDHC3_CD_B 0x114 0x37C 0x598 0x2 0x0 337 + #define MX8MN_IOMUXC_NAND_DATA02_I2C4_SDA 0x114 0x37C 0x58C 0x4 0x3 338 + #define MX8MN_IOMUXC_NAND_DATA02_GPIO3_IO8 0x114 0x37C 0x000 0x5 0x0 339 + #define MX8MN_IOMUXC_NAND_DATA02_CORESIGHT_TRACE6 0x114 0x37C 0x000 0x6 0x0 340 + #define MX8MN_IOMUXC_NAND_DATA03_RAWNAND_DATA03 0x118 0x380 0x000 0x0 0x0 341 + #define MX8MN_IOMUXC_NAND_DATA03_QSPI_A_DATA3 0x118 0x380 0x000 0x1 0x0 342 + #define MX8MN_IOMUXC_NAND_DATA03_USDHC3_WP 0x118 0x380 0x5B8 0x2 0x0 343 + #define MX8MN_IOMUXC_NAND_DATA03_GPIO3_IO9 0x118 0x380 0x000 0x5 0x0 344 + #define MX8MN_IOMUXC_NAND_DATA03_CORESIGHT_TRACE7 0x118 0x380 0x000 0x6 0x0 345 + #define MX8MN_IOMUXC_NAND_DATA04_RAWNAND_DATA04 0x11C 0x384 0x000 0x0 0x0 346 + #define MX8MN_IOMUXC_NAND_DATA04_QSPI_B_DATA0 0x11C 0x384 0x000 0x1 0x0 347 + #define MX8MN_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x11C 0x384 0x5B4 0x2 0x0 348 + #define MX8MN_IOMUXC_NAND_DATA04_GPIO3_IO10 0x11C 0x384 0x000 0x5 0x0 349 + #define MX8MN_IOMUXC_NAND_DATA04_CORESIGHT_TRACE8 0x11C 0x384 0x000 0x6 0x0 350 + #define MX8MN_IOMUXC_NAND_DATA05_RAWNAND_DATA05 0x120 0x388 0x000 0x0 0x0 351 + #define MX8MN_IOMUXC_NAND_DATA05_QSPI_B_DATA1 0x120 0x388 0x000 0x1 0x0 352 + #define MX8MN_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x120 0x388 0x5B0 0x2 0x0 353 + #define MX8MN_IOMUXC_NAND_DATA05_GPIO3_IO11 0x120 0x388 0x000 0x5 0x0 354 + #define MX8MN_IOMUXC_NAND_DATA05_CORESIGHT_TRACE9 0x120 0x388 0x000 0x6 0x0 355 + #define MX8MN_IOMUXC_NAND_DATA06_RAWNAND_DATA06 0x124 0x38C 0x000 0x0 0x0 356 + #define MX8MN_IOMUXC_NAND_DATA06_QSPI_B_DATA2 0x124 0x38C 0x000 0x1 0x0 357 + #define MX8MN_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x124 0x38C 0x5E4 0x2 0x0 358 + #define MX8MN_IOMUXC_NAND_DATA06_GPIO3_IO12 0x124 0x38C 0x000 0x5 0x0 359 + #define MX8MN_IOMUXC_NAND_DATA06_CORESIGHT_TRACE10 0x124 0x38C 0x000 0x6 0x0 360 + #define MX8MN_IOMUXC_NAND_DATA07_RAWNAND_DATA07 0x128 0x390 0x000 0x0 0x0 361 + #define MX8MN_IOMUXC_NAND_DATA07_QSPI_B_DATA3 0x128 0x390 0x000 0x1 0x0 362 + #define MX8MN_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x128 0x390 0x5E0 0x2 0x0 363 + #define MX8MN_IOMUXC_NAND_DATA07_GPIO3_IO13 0x128 0x390 0x000 0x5 0x0 364 + #define MX8MN_IOMUXC_NAND_DATA07_CORESIGHT_TRACE11 0x128 0x390 0x000 0x6 0x0 365 + #define MX8MN_IOMUXC_NAND_DQS_RAWNAND_DQS 0x12C 0x394 0x000 0x0 0x0 366 + #define MX8MN_IOMUXC_NAND_DQS_QSPI_A_DQS 0x12C 0x394 0x000 0x1 0x0 367 + #define MX8MN_IOMUXC_NAND_DQS_PDM_CLK 0x12C 0x394 0x000 0x3 0x0 368 + #define MX8MN_IOMUXC_NAND_DQS_I2C3_SCL 0x12C 0x394 0x588 0x4 0x2 369 + #define MX8MN_IOMUXC_NAND_DQS_GPIO3_IO14 0x12C 0x394 0x000 0x5 0x0 370 + #define MX8MN_IOMUXC_NAND_DQS_CORESIGHT_TRACE12 0x12C 0x394 0x000 0x6 0x0 371 + #define MX8MN_IOMUXC_NAND_RE_B_RAWNAND_RE_B 0x130 0x398 0x000 0x0 0x0 372 + #define MX8MN_IOMUXC_NAND_RE_B_QSPI_B_DQS 0x130 0x398 0x000 0x1 0x0 373 + #define MX8MN_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x130 0x398 0x558 0x2 0x0 374 + #define MX8MN_IOMUXC_NAND_RE_B_PDM_BIT_STREAM1 0x130 0x398 0x538 0x3 0x7 375 + #define MX8MN_IOMUXC_NAND_RE_B_GPIO3_IO15 0x130 0x398 0x000 0x5 0x0 376 + #define MX8MN_IOMUXC_NAND_RE_B_CORESIGHT_TRACE13 0x130 0x398 0x000 0x6 0x0 377 + #define MX8MN_IOMUXC_NAND_READY_B_RAWNAND_READY_B 0x134 0x39C 0x000 0x0 0x0 378 + #define MX8MN_IOMUXC_NAND_READY_B_USDHC3_RESET_B 0x134 0x39C 0x000 0x2 0x0 379 + #define MX8MN_IOMUXC_NAND_READY_B_PDM_BIT_STREAM3 0x134 0x39C 0x540 0x3 0x6 380 + #define MX8MN_IOMUXC_NAND_READY_B_I2C3_SCL 0x134 0x39C 0x588 0x4 0x3 381 + #define MX8MN_IOMUXC_NAND_READY_B_GPIO3_IO16 0x134 0x39C 0x000 0x5 0x0 382 + #define MX8MN_IOMUXC_NAND_READY_B_CORESIGHT_TRACE14 0x134 0x39C 0x000 0x6 0x0 383 + #define MX8MN_IOMUXC_NAND_WE_B_RAWNAND_WE_B 0x138 0x3A0 0x000 0x0 0x0 384 + #define MX8MN_IOMUXC_NAND_WE_B_USDHC3_CLK 0x138 0x3A0 0x5A0 0x2 0x0 385 + #define MX8MN_IOMUXC_NAND_WE_B_I2C3_SDA 0x138 0x3A0 0x5BC 0x4 0x3 386 + #define MX8MN_IOMUXC_NAND_WE_B_GPIO3_IO17 0x138 0x3A0 0x000 0x5 0x0 387 + #define MX8MN_IOMUXC_NAND_WE_B_CORESIGHT_TRACE15 0x138 0x3A0 0x000 0x6 0x0 388 + #define MX8MN_IOMUXC_NAND_WP_B_RAWNAND_WP_B 0x13C 0x3A4 0x000 0x0 0x0 389 + #define MX8MN_IOMUXC_NAND_WP_B_USDHC3_CMD 0x13C 0x3A4 0x5DC 0x2 0x0 390 + #define MX8MN_IOMUXC_NAND_WP_B_I2C4_SDA 0x13C 0x3A4 0x58C 0x4 0x4 391 + #define MX8MN_IOMUXC_NAND_WP_B_GPIO3_IO18 0x13C 0x3A4 0x000 0x5 0x0 392 + #define MX8MN_IOMUXC_NAND_WP_B_CORESIGHT_EVENTO 0x13C 0x3A4 0x000 0x6 0x0 393 + #define MX8MN_IOMUXC_SAI5_RXFS_SAI5_RX_SYNC 0x140 0x3A8 0x4E4 0x0 0x0 394 + #define MX8MN_IOMUXC_SAI5_RXFS_GPIO3_IO19 0x140 0x3A8 0x000 0x5 0x0 395 + #define MX8MN_IOMUXC_SAI5_RXC_SAI5_RX_BCLK 0x144 0x3AC 0x4D0 0x0 0x0 396 + #define MX8MN_IOMUXC_SAI5_RXC_PDM_CLK 0x144 0x3AC 0x000 0x4 0x0 397 + #define MX8MN_IOMUXC_SAI5_RXC_GPIO3_IO20 0x144 0x3AC 0x000 0x5 0x0 398 + #define MX8MN_IOMUXC_SAI5_RXD0_SAI5_RX_DATA0 0x148 0x3B0 0x4D4 0x0 0x0 399 + #define MX8MN_IOMUXC_SAI5_RXD0_PDM_BIT_STREAM0 0x148 0x3B0 0x534 0x4 0x0 400 + #define MX8MN_IOMUXC_SAI5_RXD0_GPIO3_IO21 0x148 0x3B0 0x000 0x5 0x0 401 + #define MX8MN_IOMUXC_SAI5_RXD1_SAI5_RX_DATA1 0x14C 0x3B4 0x4D8 0x0 0x0 402 + #define MX8MN_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0x14C 0x3B4 0x4EC 0x3 0x0 403 + #define MX8MN_IOMUXC_SAI5_RXD1_PDM_BIT_STREAM1 0x14C 0x3B4 0x538 0x4 0x0 404 + #define MX8MN_IOMUXC_SAI5_RXD1_GPIO3_IO22 0x14C 0x3B4 0x000 0x5 0x0 405 + #define MX8MN_IOMUXC_SAI5_RXD2_SAI5_RX_DATA2 0x150 0x3B8 0x4DC 0x0 0x0 406 + #define MX8MN_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0x150 0x3B8 0x4E8 0x3 0x0 407 + #define MX8MN_IOMUXC_SAI5_RXD2_PDM_BIT_STREAM2 0x150 0x3B8 0x53C 0x4 0x0 408 + #define MX8MN_IOMUXC_SAI5_RXD2_GPIO3_IO23 0x150 0x3B8 0x000 0x5 0x0 409 + #define MX8MN_IOMUXC_SAI5_RXD3_SAI5_RX_DATA3 0x154 0x3BC 0x4E0 0x0 0x0 410 + #define MX8MN_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0x154 0x3BC 0x000 0x3 0x0 411 + #define MX8MN_IOMUXC_SAI5_RXD3_PDM_BIT_STREAM3 0x154 0x3BC 0x540 0x4 0x0 412 + #define MX8MN_IOMUXC_SAI5_RXD3_GPIO3_IO24 0x154 0x3BC 0x000 0x5 0x0 413 + #define MX8MN_IOMUXC_SAI5_MCLK_SAI5_MCLK 0x158 0x3C0 0x594 0x0 0x0 414 + #define MX8MN_IOMUXC_SAI5_MCLK_GPIO3_IO25 0x158 0x3C0 0x000 0x5 0x0 415 + #define MX8MN_IOMUXC_SAI2_RXFS_SAI2_RX_SYNC 0x1B0 0x418 0x000 0x0 0x0 416 + #define MX8MN_IOMUXC_SAI2_RXFS_SAI5_TX_SYNC 0x1B0 0x418 0x4EC 0x1 0x2 417 + #define MX8MN_IOMUXC_SAI2_RXFS_SAI5_TX_DATA1 0x1B0 0x418 0x000 0x2 0x0 418 + #define MX8MN_IOMUXC_SAI2_RXFS_SAI2_RX_DATA1 0x1B0 0x418 0x5AC 0x3 0x0 419 + #define MX8MN_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x1B0 0x418 0x000 0x4 0x0 420 + #define MX8MN_IOMUXC_SAI2_RXFS_UART1_DTE_RX 0x1B0 0x418 0x4F4 0x4 0x2 421 + #define MX8MN_IOMUXC_SAI2_RXFS_GPIO4_IO21 0x1B0 0x418 0x000 0x5 0x0 422 + #define MX8MN_IOMUXC_SAI2_RXFS_PDM_BIT_STREAM2 0x1B0 0x418 0x53C 0x6 0x7 423 + #define MX8MN_IOMUXC_SAI2_RXC_SAI2_RX_BCLK 0x1B4 0x41C 0x000 0x0 0x0 424 + #define MX8MN_IOMUXC_SAI2_RXC_SAI5_TX_BCLK 0x1B4 0x41C 0x4E8 0x1 0x2 425 + #define MX8MN_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x1B4 0x41C 0x4F4 0x4 0x3 426 + #define MX8MN_IOMUXC_SAI2_RXC_UART1_DTE_TX 0x1B4 0x41C 0x000 0x4 0x0 427 + #define MX8MN_IOMUXC_SAI2_RXC_GPIO4_IO22 0x1B4 0x41C 0x000 0x5 0x0 428 + #define MX8MN_IOMUXC_SAI2_RXC_PDM_BIT_STREAM1 0x1B4 0x41C 0x538 0x6 0x8 429 + #define MX8MN_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0 0x1B8 0x420 0x000 0x0 0x0 430 + #define MX8MN_IOMUXC_SAI2_RXD0_SAI5_TX_DATA0 0x1B8 0x420 0x000 0x1 0x0 431 + #define MX8MN_IOMUXC_SAI2_RXD0_SAI2_TX_DATA1 0x1B8 0x420 0x000 0x3 0x0 432 + #define MX8MN_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x1B8 0x420 0x4F0 0x4 0x2 433 + #define MX8MN_IOMUXC_SAI2_RXD0_UART1_DTE_CTS_B 0x1B8 0x420 0x000 0x4 0x0 434 + #define MX8MN_IOMUXC_SAI2_RXD0_GPIO4_IO23 0x1B8 0x420 0x000 0x5 0x0 435 + #define MX8MN_IOMUXC_SAI2_RXD0_PDM_BIT_STREAM3 0x1B8 0x420 0x540 0x6 0x7 436 + #define MX8MN_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0x1BC 0x424 0x000 0x0 0x0 437 + #define MX8MN_IOMUXC_SAI2_TXFS_SAI5_TX_DATA1 0x1BC 0x424 0x000 0x1 0x0 438 + #define MX8MN_IOMUXC_SAI2_TXFS_SAI2_TX_DATA1 0x1BC 0x424 0x000 0x3 0x0 439 + #define MX8MN_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x1BC 0x424 0x000 0x4 0x0 440 + #define MX8MN_IOMUXC_SAI2_TXFS_UART1_DTE_RTS_B 0x1BC 0x424 0x4F0 0x4 0x3 441 + #define MX8MN_IOMUXC_SAI2_TXFS_GPIO4_IO24 0x1BC 0x424 0x000 0x5 0x0 442 + #define MX8MN_IOMUXC_SAI2_TXFS_PDM_BIT_STREAM2 0x1BC 0x424 0x53C 0x6 0x8 443 + #define MX8MN_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0x1C0 0x428 0x000 0x0 0x0 444 + #define MX8MN_IOMUXC_SAI2_TXC_SAI5_TX_DATA2 0x1C0 0x428 0x000 0x1 0x0 445 + #define MX8MN_IOMUXC_SAI2_TXC_GPIO4_IO25 0x1C0 0x428 0x000 0x5 0x0 446 + #define MX8MN_IOMUXC_SAI2_TXC_PDM_BIT_STREAM1 0x1C0 0x428 0x538 0x6 0x9 447 + #define MX8MN_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0 0x1C4 0x42C 0x000 0x0 0x0 448 + #define MX8MN_IOMUXC_SAI2_TXD0_SAI5_TX_DATA3 0x1C4 0x42C 0x000 0x1 0x0 449 + #define MX8MN_IOMUXC_SAI2_TXD0_GPIO4_IO26 0x1C4 0x42C 0x000 0x5 0x0 450 + #define MX8MN_IOMUXC_SAI2_TXD0_CCMSRCGPCMIX_BOOT_MODE4 0x1C4 0x42C 0x540 0x6 0x8 451 + #define MX8MN_IOMUXC_SAI2_MCLK_SAI2_MCLK 0x1C8 0x430 0x000 0x0 0x0 452 + #define MX8MN_IOMUXC_SAI2_MCLK_SAI5_MCLK 0x1C8 0x430 0x594 0x1 0x2 453 + #define MX8MN_IOMUXC_SAI2_MCLK_GPIO4_IO27 0x1C8 0x430 0x000 0x5 0x0 454 + #define MX8MN_IOMUXC_SAI2_MCLK_SAI3_MCLK 0x1C8 0x430 0x5C0 0x6 0x1 455 + #define MX8MN_IOMUXC_SAI3_RXFS_SAI3_RX_SYNC 0x1CC 0x434 0x000 0x0 0x0 456 + #define MX8MN_IOMUXC_SAI3_RXFS_GPT1_CAPTURE1 0x1CC 0x434 0x5F0 0x1 0x0 457 + #define MX8MN_IOMUXC_SAI3_RXFS_SAI5_RX_SYNC 0x1CC 0x434 0x4E4 0x2 0x2 458 + #define MX8MN_IOMUXC_SAI3_RXFS_SAI3_RX_DATA1 0x1CC 0x434 0x000 0x3 0x0 459 + #define MX8MN_IOMUXC_SAI3_RXFS_SPDIF1_IN 0x1CC 0x434 0x5CC 0x4 0x3 460 + #define MX8MN_IOMUXC_SAI3_RXFS_GPIO4_IO28 0x1CC 0x434 0x000 0x5 0x0 461 + #define MX8MN_IOMUXC_SAI3_RXFS_PDM_BIT_STREAM0 0x1CC 0x434 0x534 0x6 0x5 462 + #define MX8MN_IOMUXC_SAI3_RXC_SAI3_RX_BCLK 0x1D0 0x438 0x000 0x0 0x0 463 + #define MX8MN_IOMUXC_SAI3_RXC_GPT1_CLK 0x1D0 0x438 0x5E8 0x1 0x0 464 + #define MX8MN_IOMUXC_SAI3_RXC_SAI5_RX_BCLK 0x1D0 0x438 0x4D0 0x2 0x2 465 + #define MX8MN_IOMUXC_SAI3_RXC_SAI2_RX_DATA1 0x1D0 0x438 0x5AC 0x3 0x2 466 + #define MX8MN_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x1D0 0x438 0x000 0x4 0x0 467 + #define MX8MN_IOMUXC_SAI3_RXC_UART2_DTE_RTS_B 0x1D0 0x438 0x4F8 0x4 0x2 468 + #define MX8MN_IOMUXC_SAI3_RXC_GPIO4_IO29 0x1D0 0x438 0x000 0x5 0x0 469 + #define MX8MN_IOMUXC_SAI3_RXC_PDM_CLK 0x1D0 0x438 0x000 0x6 0x0 470 + #define MX8MN_IOMUXC_SAI3_RXD_SAI3_RX_DATA0 0x1D4 0x43C 0x000 0x0 0x0 471 + #define MX8MN_IOMUXC_SAI3_RXD_GPT1_COMPARE1 0x1D4 0x43C 0x000 0x1 0x0 472 + #define MX8MN_IOMUXC_SAI3_RXD_SAI5_RX_DATA0 0x1D4 0x43C 0x4D4 0x2 0x2 473 + #define MX8MN_IOMUXC_SAI3_RXD_SAI3_TX_DATA1 0x1D4 0x43C 0x000 0x3 0x0 474 + #define MX8MN_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x1D4 0x43C 0x4F8 0x4 0x3 475 + #define MX8MN_IOMUXC_SAI3_RXD_UART2_DTE_CTS_B 0x1D4 0x43C 0x000 0x4 0x0 476 + #define MX8MN_IOMUXC_SAI3_RXD_GPIO4_IO30 0x1D4 0x43C 0x000 0x5 0x0 477 + #define MX8MN_IOMUXC_SAI3_RXD_PDM_BIT_STREAM1 0x1D4 0x43C 0x538 0x6 0x10 478 + #define MX8MN_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0x1D8 0x440 0x000 0x0 0x0 479 + #define MX8MN_IOMUXC_SAI3_TXFS_GPT1_CAPTURE2 0x1D8 0x440 0x5EC 0x1 0x0 480 + #define MX8MN_IOMUXC_SAI3_TXFS_SAI5_RX_DATA1 0x1D8 0x440 0x4D8 0x2 0x1 481 + #define MX8MN_IOMUXC_SAI3_TXFS_SAI3_TX_DATA1 0x1D8 0x440 0x000 0x3 0x0 482 + #define MX8MN_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x1D8 0x440 0x4FC 0x4 0x2 483 + #define MX8MN_IOMUXC_SAI3_TXFS_UART2_DTE_TX 0x1D8 0x440 0x000 0x4 0x0 484 + #define MX8MN_IOMUXC_SAI3_TXFS_GPIO4_IO31 0x1D8 0x440 0x000 0x5 0x0 485 + #define MX8MN_IOMUXC_SAI3_TXFS_PDM_BIT_STREAM3 0x1D8 0x440 0x540 0x6 0x9 486 + #define MX8MN_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0x1DC 0x444 0x000 0x0 0x0 487 + #define MX8MN_IOMUXC_SAI3_TXC_GPT1_COMPARE2 0x1DC 0x444 0x000 0x1 0x0 488 + #define MX8MN_IOMUXC_SAI3_TXC_SAI5_RX_DATA2 0x1DC 0x444 0x4DC 0x2 0x1 489 + #define MX8MN_IOMUXC_SAI3_TXC_SAI2_TX_DATA1 0x1DC 0x444 0x000 0x3 0x0 490 + #define MX8MN_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x1DC 0x444 0x000 0x4 0x0 491 + #define MX8MN_IOMUXC_SAI3_TXC_UART2_DTE_RX 0x1DC 0x444 0x4FC 0x4 0x3 492 + #define MX8MN_IOMUXC_SAI3_TXC_GPIO5_IO0 0x1DC 0x444 0x000 0x5 0x0 493 + #define MX8MN_IOMUXC_SAI3_TXC_PDM_BIT_STREAM2 0x1DC 0x444 0x53C 0x6 0x9 494 + #define MX8MN_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0x1E0 0x448 0x000 0x0 0x0 495 + #define MX8MN_IOMUXC_SAI3_TXD_GPT1_COMPARE3 0x1E0 0x448 0x000 0x1 0x0 496 + #define MX8MN_IOMUXC_SAI3_TXD_SAI5_RX_DATA3 0x1E0 0x448 0x4E0 0x2 0x1 497 + #define MX8MN_IOMUXC_SAI3_TXD_SPDIF1_EXT_CLK 0x1E0 0x448 0x568 0x4 0x2 498 + #define MX8MN_IOMUXC_SAI3_TXD_GPIO5_IO1 0x1E0 0x448 0x000 0x5 0x0 499 + #define MX8MN_IOMUXC_SAI3_TXD_CCMSRCGPCMIX_BOOT_MODE5 0x1E0 0x448 0x000 0x6 0x0 500 + #define MX8MN_IOMUXC_SAI3_MCLK_SAI3_MCLK 0x1E4 0x44C 0x5C0 0x0 0x0 501 + #define MX8MN_IOMUXC_SAI3_MCLK_PWM4_OUT 0x1E4 0x44C 0x000 0x1 0x0 502 + #define MX8MN_IOMUXC_SAI3_MCLK_SAI5_MCLK 0x1E4 0x44C 0x594 0x2 0x3 503 + #define MX8MN_IOMUXC_SAI3_MCLK_SPDIF1_OUT 0x1E4 0x44C 0x000 0x4 0x0 504 + #define MX8MN_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x1E4 0x44C 0x000 0x5 0x0 505 + #define MX8MN_IOMUXC_SAI3_MCLK_SPDIF1_IN 0x1E4 0x44C 0x5CC 0x6 0x4 506 + #define MX8MN_IOMUXC_SPDIF_TX_SPDIF1_OUT 0x1E8 0x450 0x000 0x0 0x0 507 + #define MX8MN_IOMUXC_SPDIF_TX_PWM3_OUT 0x1E8 0x450 0x000 0x1 0x0 508 + #define MX8MN_IOMUXC_SPDIF_TX_GPIO5_IO3 0x1E8 0x450 0x000 0x5 0x0 509 + #define MX8MN_IOMUXC_SPDIF_RX_SPDIF1_IN 0x1EC 0x454 0x5CC 0x0 0x0 510 + #define MX8MN_IOMUXC_SPDIF_RX_PWM2_OUT 0x1EC 0x454 0x000 0x1 0x0 511 + #define MX8MN_IOMUXC_SPDIF_RX_GPIO5_IO4 0x1EC 0x454 0x000 0x5 0x0 512 + #define MX8MN_IOMUXC_SPDIF_EXT_CLK_SPDIF1_EXT_CLK 0x1F0 0x458 0x568 0x0 0x0 513 + #define MX8MN_IOMUXC_SPDIF_EXT_CLK_PWM1_OUT 0x1F0 0x458 0x000 0x1 0x0 514 + #define MX8MN_IOMUXC_SPDIF_EXT_CLK_GPIO5_IO5 0x1F0 0x458 0x000 0x5 0x0 515 + #define MX8MN_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK 0x1F4 0x45C 0x5D8 0x0 0x0 516 + #define MX8MN_IOMUXC_ECSPI1_SCLK_UART3_DCE_RX 0x1F4 0x45C 0x504 0x1 0x0 517 + #define MX8MN_IOMUXC_ECSPI1_SCLK_UART3_DTE_TX 0x1F4 0x45C 0x000 0x1 0x0 518 + #define MX8MN_IOMUXC_ECSPI1_SCLK_I2C1_SCL 0x1F4 0x45C 0x55C 0x2 0x2 519 + #define MX8MN_IOMUXC_ECSPI1_SCLK_SAI5_RX_SYNC 0x1F4 0x45C 0x4DC 0x3 0x2 520 + #define MX8MN_IOMUXC_ECSPI1_SCLK_GPIO5_IO6 0x1F4 0x45C 0x000 0x5 0x0 521 + #define MX8MN_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI 0x1F8 0x460 0x5A8 0x0 0x0 522 + #define MX8MN_IOMUXC_ECSPI1_MOSI_UART3_DCE_TX 0x1F8 0x460 0x000 0x1 0x0 523 + #define MX8MN_IOMUXC_ECSPI1_MOSI_UART3_DTE_RX 0x1F8 0x460 0x504 0x1 0x1 524 + #define MX8MN_IOMUXC_ECSPI1_MOSI_I2C1_SDA 0x1F8 0x460 0x56C 0x2 0x2 525 + #define MX8MN_IOMUXC_ECSPI1_MOSI_SAI5_RX_BCLK 0x1F8 0x460 0x4D0 0x3 0x3 526 + #define MX8MN_IOMUXC_ECSPI1_MOSI_GPIO5_IO7 0x1F8 0x460 0x000 0x5 0x0 527 + #define MX8MN_IOMUXC_ECSPI1_MISO_ECSPI1_MISO 0x1FC 0x464 0x5C4 0x0 0x0 528 + #define MX8MN_IOMUXC_ECSPI1_MISO_UART3_DCE_CTS_B 0x1FC 0x464 0x000 0x1 0x0 529 + #define MX8MN_IOMUXC_ECSPI1_MISO_UART3_DTE_RTS_B 0x1FC 0x464 0x500 0x1 0x0 530 + #define MX8MN_IOMUXC_ECSPI1_MISO_I2C2_SCL 0x1FC 0x464 0x5D0 0x2 0x2 531 + #define MX8MN_IOMUXC_ECSPI1_MISO_SAI5_RX_DATA0 0x1FC 0x464 0x4D4 0x3 0x3 532 + #define MX8MN_IOMUXC_ECSPI1_MISO_GPIO5_IO8 0x1FC 0x464 0x000 0x5 0x0 533 + #define MX8MN_IOMUXC_ECSPI1_SS0_ECSPI1_SS0 0x200 0x468 0x564 0x0 0x0 534 + #define MX8MN_IOMUXC_ECSPI1_SS0_UART3_DCE_RTS_B 0x200 0x468 0x500 0x1 0x1 535 + #define MX8MN_IOMUXC_ECSPI1_SS0_UART3_DTE_CTS_B 0x200 0x468 0x000 0x1 0x0 536 + #define MX8MN_IOMUXC_ECSPI1_SS0_I2C2_SDA 0x200 0x468 0x560 0x2 0x2 537 + #define MX8MN_IOMUXC_ECSPI1_SS0_SAI5_RX_DATA1 0x200 0x468 0x4D8 0x3 0x2 538 + #define MX8MN_IOMUXC_ECSPI1_SS0_SAI5_TX_SYNC 0x200 0x468 0x4EC 0x4 0x3 539 + #define MX8MN_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x200 0x468 0x000 0x5 0x0 540 + #define MX8MN_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x204 0x46C 0x580 0x0 0x0 541 + #define MX8MN_IOMUXC_ECSPI2_SCLK_UART4_DCE_RX 0x204 0x46C 0x50C 0x1 0x0 542 + #define MX8MN_IOMUXC_ECSPI2_SCLK_UART4_DTE_TX 0x204 0x46C 0x000 0x1 0x0 543 + #define MX8MN_IOMUXC_ECSPI2_SCLK_I2C3_SCL 0x204 0x46C 0x588 0x2 0x4 544 + #define MX8MN_IOMUXC_ECSPI2_SCLK_SAI5_RX_DATA2 0x204 0x46C 0x000 0x3 0x0 545 + #define MX8MN_IOMUXC_ECSPI2_SCLK_SAI5_TX_BCLK 0x204 0x46C 0x4E8 0x4 0x3 546 + #define MX8MN_IOMUXC_ECSPI2_SCLK_GPIO5_IO10 0x204 0x46C 0x000 0x5 0x0 547 + #define MX8MN_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x208 0x470 0x590 0x0 0x0 548 + #define MX8MN_IOMUXC_ECSPI2_MOSI_UART4_DCE_TX 0x208 0x470 0x000 0x1 0x0 549 + #define MX8MN_IOMUXC_ECSPI2_MOSI_UART4_DTE_RX 0x208 0x470 0x50C 0x1 0x1 550 + #define MX8MN_IOMUXC_ECSPI2_MOSI_I2C3_SDA 0x208 0x470 0x5BC 0x2 0x4 551 + #define MX8MN_IOMUXC_ECSPI2_MOSI_SAI5_RX_DATA3 0x208 0x470 0x4E0 0x3 0x2 552 + #define MX8MN_IOMUXC_ECSPI2_MOSI_SAI5_TX_DATA0 0x208 0x470 0x000 0x4 0x0 553 + #define MX8MN_IOMUXC_ECSPI2_MOSI_GPIO5_IO11 0x208 0x470 0x000 0x5 0x0 554 + #define MX8MN_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x20C 0x474 0x578 0x0 0x0 555 + #define MX8MN_IOMUXC_ECSPI2_MISO_UART4_DCE_CTS_B 0x20C 0x474 0x000 0x1 0x0 556 + #define MX8MN_IOMUXC_ECSPI2_MISO_UART4_DTE_RTS_B 0x20C 0x474 0x508 0x1 0x0 557 + #define MX8MN_IOMUXC_ECSPI2_MISO_I2C4_SCL 0x20C 0x474 0x5D4 0x2 0x3 558 + #define MX8MN_IOMUXC_ECSPI2_MISO_SAI5_MCLK 0x20C 0x474 0x594 0x3 0x4 559 + #define MX8MN_IOMUXC_ECSPI2_MISO_GPIO5_IO12 0x20C 0x474 0x000 0x5 0x0 560 + #define MX8MN_IOMUXC_ECSPI2_SS0_ECSPI2_SS0 0x210 0x478 0x570 0x0 0x0 561 + #define MX8MN_IOMUXC_ECSPI2_SS0_UART4_DCE_RTS_B 0x210 0x478 0x508 0x1 0x1 562 + #define MX8MN_IOMUXC_ECSPI2_SS0_UART4_DTE_CTS_B 0x210 0x478 0x000 0x1 0x0 563 + #define MX8MN_IOMUXC_ECSPI2_SS0_I2C4_SDA 0x210 0x478 0x58C 0x2 0x5 564 + #define MX8MN_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0x210 0x478 0x000 0x5 0x0 565 + #define MX8MN_IOMUXC_I2C1_SCL_I2C1_SCL 0x214 0x47C 0x55C 0x0 0x0 566 + #define MX8MN_IOMUXC_I2C1_SCL_ENET1_MDC 0x214 0x47C 0x000 0x1 0x0 567 + #define MX8MN_IOMUXC_I2C1_SCL_ECSPI1_SCLK 0x214 0x47C 0x5D8 0x3 0x1 568 + #define MX8MN_IOMUXC_I2C1_SCL_GPIO5_IO14 0x214 0x47C 0x000 0x5 0x0 569 + #define MX8MN_IOMUXC_I2C1_SDA_I2C1_SDA 0x218 0x480 0x56C 0x0 0x0 570 + #define MX8MN_IOMUXC_I2C1_SDA_ENET1_MDIO 0x218 0x480 0x4C0 0x1 0x2 571 + #define MX8MN_IOMUXC_I2C1_SDA_ECSPI1_MOSI 0x218 0x480 0x5A8 0x3 0x1 572 + #define MX8MN_IOMUXC_I2C1_SDA_GPIO5_IO15 0x218 0x480 0x000 0x5 0x0 573 + #define MX8MN_IOMUXC_I2C2_SCL_I2C2_SCL 0x21C 0x484 0x5D0 0x0 0x0 574 + #define MX8MN_IOMUXC_I2C2_SCL_ENET1_1588_EVENT1_IN 0x21C 0x484 0x000 0x1 0x0 575 + #define MX8MN_IOMUXC_I2C2_SCL_USDHC3_CD_B 0x21C 0x484 0x598 0x2 0x1 576 + #define MX8MN_IOMUXC_I2C2_SCL_ECSPI1_MISO 0x21C 0x484 0x5C4 0x3 0x1 577 + #define MX8MN_IOMUXC_I2C2_SCL_GPIO5_IO16 0x21C 0x484 0x000 0x5 0x0 578 + #define MX8MN_IOMUXC_I2C2_SDA_I2C2_SDA 0x220 0x488 0x560 0x0 0x0 579 + #define MX8MN_IOMUXC_I2C2_SDA_ENET1_1588_EVENT1_OUT 0x220 0x488 0x000 0x1 0x0 580 + #define MX8MN_IOMUXC_I2C2_SDA_USDHC3_WP 0x220 0x488 0x5B8 0x2 0x1 581 + #define MX8MN_IOMUXC_I2C2_SDA_ECSPI1_SS0 0x220 0x488 0x564 0x3 0x1 582 + #define MX8MN_IOMUXC_I2C2_SDA_GPIO5_IO17 0x220 0x488 0x000 0x5 0x0 583 + #define MX8MN_IOMUXC_I2C3_SCL_I2C3_SCL 0x224 0x48C 0x588 0x0 0x0 584 + #define MX8MN_IOMUXC_I2C3_SCL_PWM4_OUT 0x224 0x48C 0x000 0x1 0x0 585 + #define MX8MN_IOMUXC_I2C3_SCL_GPT2_CLK 0x224 0x48C 0x000 0x2 0x0 586 + #define MX8MN_IOMUXC_I2C3_SCL_ECSPI2_SCLK 0x224 0x48C 0x580 0x3 0x2 587 + #define MX8MN_IOMUXC_I2C3_SCL_GPIO5_IO18 0x224 0x48C 0x000 0x5 0x0 588 + #define MX8MN_IOMUXC_I2C3_SDA_I2C3_SDA 0x228 0x490 0x5BC 0x0 0x0 589 + #define MX8MN_IOMUXC_I2C3_SDA_PWM3_OUT 0x228 0x490 0x000 0x1 0x0 590 + #define MX8MN_IOMUXC_I2C3_SDA_GPT3_CLK 0x228 0x490 0x000 0x2 0x0 591 + #define MX8MN_IOMUXC_I2C3_SDA_ECSPI2_MOSI 0x228 0x490 0x590 0x3 0x2 592 + #define MX8MN_IOMUXC_I2C3_SDA_GPIO5_IO19 0x228 0x490 0x000 0x5 0x0 593 + #define MX8MN_IOMUXC_I2C4_SCL_I2C4_SCL 0x22C 0x494 0x5D4 0x0 0x0 594 + #define MX8MN_IOMUXC_I2C4_SCL_PWM2_OUT 0x22C 0x494 0x000 0x1 0x0 595 + #define MX8MN_IOMUXC_I2C4_SCL_ECSPI2_MISO 0x22C 0x494 0x578 0x3 0x2 596 + #define MX8MN_IOMUXC_I2C4_SCL_GPIO5_IO20 0x22C 0x494 0x000 0x5 0x0 597 + #define MX8MN_IOMUXC_I2C4_SDA_I2C4_SDA 0x230 0x498 0x58C 0x0 0x0 598 + #define MX8MN_IOMUXC_I2C4_SDA_PWM1_OUT 0x230 0x498 0x000 0x1 0x0 599 + #define MX8MN_IOMUXC_I2C4_SDA_ECSPI2_SS0 0x230 0x498 0x570 0x3 0x1 600 + #define MX8MN_IOMUXC_I2C4_SDA_GPIO5_IO21 0x230 0x498 0x000 0x5 0x0 601 + #define MX8MN_IOMUXC_UART1_RXD_UART1_DCE_RX 0x234 0x49C 0x4F4 0x0 0x0 602 + #define MX8MN_IOMUXC_UART1_RXD_UART1_DTE_TX 0x234 0x49C 0x000 0x0 0x0 603 + #define MX8MN_IOMUXC_UART1_RXD_ECSPI3_SCLK 0x234 0x49C 0x000 0x1 0x0 604 + #define MX8MN_IOMUXC_UART1_RXD_GPIO5_IO22 0x234 0x49C 0x000 0x5 0x0 605 + #define MX8MN_IOMUXC_UART1_TXD_UART1_DCE_TX 0x238 0x4A0 0x000 0x0 0x0 606 + #define MX8MN_IOMUXC_UART1_TXD_UART1_DTE_RX 0x238 0x4A0 0x4F4 0x0 0x1 607 + #define MX8MN_IOMUXC_UART1_TXD_ECSPI3_MOSI 0x238 0x4A0 0x000 0x1 0x0 608 + #define MX8MN_IOMUXC_UART1_TXD_GPIO5_IO23 0x238 0x4A0 0x000 0x5 0x0 609 + #define MX8MN_IOMUXC_UART2_RXD_UART2_DCE_RX 0x23C 0x4A4 0x4FC 0x0 0x0 610 + #define MX8MN_IOMUXC_UART2_RXD_UART2_DTE_TX 0x23C 0x4A4 0x000 0x0 0x0 611 + #define MX8MN_IOMUXC_UART2_RXD_ECSPI3_MISO 0x23C 0x4A4 0x000 0x1 0x0 612 + #define MX8MN_IOMUXC_UART2_RXD_GPT1_COMPARE3 0x23C 0x4A4 0x000 0x3 0x0 613 + #define MX8MN_IOMUXC_UART2_RXD_GPIO5_IO24 0x23C 0x4A4 0x000 0x5 0x0 614 + #define MX8MN_IOMUXC_UART2_TXD_UART2_DCE_TX 0x240 0x4A8 0x000 0x0 0x0 615 + #define MX8MN_IOMUXC_UART2_TXD_UART2_DTE_RX 0x240 0x4A8 0x4FC 0x0 0x1 616 + #define MX8MN_IOMUXC_UART2_TXD_ECSPI3_SS0 0x240 0x4A8 0x000 0x1 0x0 617 + #define MX8MN_IOMUXC_UART2_TXD_GPT1_COMPARE2 0x240 0x4A8 0x000 0x3 0x0 618 + #define MX8MN_IOMUXC_UART2_TXD_GPIO5_IO25 0x240 0x4A8 0x000 0x5 0x0 619 + #define MX8MN_IOMUXC_UART3_RXD_UART3_DCE_RX 0x244 0x4AC 0x504 0x0 0x2 620 + #define MX8MN_IOMUXC_UART3_RXD_UART3_DTE_TX 0x244 0x4AC 0x000 0x0 0x0 621 + #define MX8MN_IOMUXC_UART3_RXD_UART1_DCE_CTS_B 0x244 0x4AC 0x000 0x1 0x0 622 + #define MX8MN_IOMUXC_UART3_RXD_UART1_DTE_RTS_B 0x244 0x4AC 0x4F0 0x1 0x0 623 + #define MX8MN_IOMUXC_UART3_RXD_USDHC3_RESET_B 0x244 0x4AC 0x000 0x2 0x0 624 + #define MX8MN_IOMUXC_UART3_RXD_GPT1_CAPTURE2 0x244 0x4AC 0x5EC 0x3 0x1 625 + #define MX8MN_IOMUXC_UART3_RXD_GPIO5_IO26 0x244 0x4AC 0x000 0x5 0x0 626 + #define MX8MN_IOMUXC_UART3_TXD_UART3_DCE_TX 0x248 0x4B0 0x000 0x0 0x0 627 + #define MX8MN_IOMUXC_UART3_TXD_UART3_DTE_RX 0x248 0x4B0 0x504 0x0 0x3 628 + #define MX8MN_IOMUXC_UART3_TXD_UART1_DCE_RTS_B 0x248 0x4B0 0x4F0 0x1 0x1 629 + #define MX8MN_IOMUXC_UART3_TXD_UART1_DTE_CTS_B 0x248 0x4B0 0x000 0x1 0x0 630 + #define MX8MN_IOMUXC_UART3_TXD_USDHC3_VSELECT 0x248 0x4B0 0x000 0x2 0x0 631 + #define MX8MN_IOMUXC_UART3_TXD_GPT1_CLK 0x248 0x4B0 0x5E8 0x3 0x1 632 + #define MX8MN_IOMUXC_UART3_TXD_GPIO5_IO27 0x248 0x4B0 0x000 0x5 0x0 633 + #define MX8MN_IOMUXC_UART4_RXD_UART4_DCE_RX 0x24C 0x4B4 0x50C 0x0 0x2 634 + #define MX8MN_IOMUXC_UART4_RXD_UART4_DTE_TX 0x24C 0x4B4 0x000 0x0 0x0 635 + #define MX8MN_IOMUXC_UART4_RXD_UART2_DCE_CTS_B 0x24C 0x4B4 0x000 0x1 0x0 636 + #define MX8MN_IOMUXC_UART4_RXD_UART2_DTE_RTS_B 0x24C 0x4B4 0x4F8 0x1 0x0 637 + #define MX8MN_IOMUXC_UART4_RXD_GPT1_COMPARE1 0x24C 0x4B4 0x000 0x3 0x0 638 + #define MX8MN_IOMUXC_UART4_RXD_GPIO5_IO28 0x24C 0x4B4 0x000 0x5 0x0 639 + #define MX8MN_IOMUXC_UART4_TXD_UART4_DCE_TX 0x250 0x4B8 0x000 0x0 0x0 640 + #define MX8MN_IOMUXC_UART4_TXD_UART4_DTE_RX 0x250 0x4B8 0x50C 0x0 0x3 641 + #define MX8MN_IOMUXC_UART4_TXD_UART2_DCE_RTS_B 0x250 0x4B8 0x4F8 0x1 0x1 642 + #define MX8MN_IOMUXC_UART4_TXD_UART2_DTE_CTS_B 0x250 0x4B8 0x000 0x1 0x0 643 + #define MX8MN_IOMUXC_UART4_TXD_GPT1_CAPTURE1 0x250 0x4B8 0x5F0 0x3 0x1 644 + #define MX8MN_IOMUXC_UART4_TXD_GPIO5_IO29 0x250 0x4B8 0x000 0x5 0x0 645 + 646 + #endif /* __DTS_IMX8MN_PINFUNC_H */
+1 -1
drivers/pinctrl/aspeed/Makefile
··· 2 2 # Aspeed pinctrl support 3 3 4 4 ccflags-y += $(call cc-option,-Woverride-init) 5 - obj-$(CONFIG_PINCTRL_ASPEED) += pinctrl-aspeed.o 5 + obj-$(CONFIG_PINCTRL_ASPEED) += pinctrl-aspeed.o pinmux-aspeed.o 6 6 obj-$(CONFIG_PINCTRL_ASPEED_G4) += pinctrl-aspeed-g4.o 7 7 obj-$(CONFIG_PINCTRL_ASPEED_G5) += pinctrl-aspeed-g5.o
+90 -4
drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
··· 18 18 19 19 #include "../core.h" 20 20 #include "../pinctrl-utils.h" 21 + #include "pinmux-aspeed.h" 21 22 #include "pinctrl-aspeed.h" 23 + 24 + /* 25 + * The "Multi-function Pins Mapping and Control" table in the SoC datasheet 26 + * references registers by the device/offset mnemonic. The register macros 27 + * below are named the same way to ease transcription and verification (as 28 + * opposed to naming them e.g. PINMUX_CTRL_[0-9]). Further, signal expressions 29 + * reference registers beyond those dedicated to pinmux, such as the system 30 + * reset control and MAC clock configuration registers. 31 + */ 32 + #define SCU2C 0x2C /* Misc. Control Register */ 33 + #define SCU3C 0x3C /* System Reset Control/Status Register */ 34 + #define SCU48 0x48 /* MAC Interface Clock Delay Setting */ 35 + #define HW_STRAP1 0x70 /* AST2400 strapping is 33 bits, is split */ 36 + #define HW_REVISION_ID 0x7C /* Silicon revision ID register */ 37 + #define SCU80 0x80 /* Multi-function Pin Control #1 */ 38 + #define SCU84 0x84 /* Multi-function Pin Control #2 */ 39 + #define SCU88 0x88 /* Multi-function Pin Control #3 */ 40 + #define SCU8C 0x8C /* Multi-function Pin Control #4 */ 41 + #define SCU90 0x90 /* Multi-function Pin Control #5 */ 42 + #define SCU94 0x94 /* Multi-function Pin Control #6 */ 43 + #define SCUA0 0xA0 /* Multi-function Pin Control #7 */ 44 + #define SCUA4 0xA4 /* Multi-function Pin Control #8 */ 45 + #define SCUA8 0xA8 /* Multi-function Pin Control #9 */ 46 + #define SCUAC 0xAC /* Multi-function Pin Control #10 */ 47 + #define HW_STRAP2 0xD0 /* Strapping */ 22 48 23 49 /* 24 50 * Uses undefined macros for symbol naming and references, eg GPIOA0, MAC1LINK, ··· 2412 2386 { PIN_CONFIG_INPUT_DEBOUNCE, { C14, B14 }, SCUA8, 27 }, 2413 2387 }; 2414 2388 2389 + static int aspeed_g4_sig_expr_set(const struct aspeed_pinmux_data *ctx, 2390 + const struct aspeed_sig_expr *expr, 2391 + bool enable) 2392 + { 2393 + int ret; 2394 + int i; 2395 + 2396 + for (i = 0; i < expr->ndescs; i++) { 2397 + const struct aspeed_sig_desc *desc = &expr->descs[i]; 2398 + u32 pattern = enable ? desc->enable : desc->disable; 2399 + u32 val = (pattern << __ffs(desc->mask)); 2400 + 2401 + if (!ctx->maps[desc->ip]) 2402 + return -ENODEV; 2403 + 2404 + /* 2405 + * Strap registers are configured in hardware or by early-boot 2406 + * firmware. Treat them as read-only despite that we can write 2407 + * them. This may mean that certain functions cannot be 2408 + * deconfigured and is the reason we re-evaluate after writing 2409 + * all descriptor bits. 2410 + * 2411 + * Port D and port E GPIO loopback modes are the only exception 2412 + * as those are commonly used with front-panel buttons to allow 2413 + * normal operation of the host when the BMC is powered off or 2414 + * fails to boot. Once the BMC has booted, the loopback mode 2415 + * must be disabled for the BMC to control host power-on and 2416 + * reset. 2417 + */ 2418 + if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1 && 2419 + !(desc->mask & (BIT(21) | BIT(22)))) 2420 + continue; 2421 + 2422 + if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP2) 2423 + continue; 2424 + 2425 + ret = regmap_update_bits(ctx->maps[desc->ip], desc->reg, 2426 + desc->mask, val); 2427 + 2428 + if (ret) 2429 + return ret; 2430 + } 2431 + 2432 + ret = aspeed_sig_expr_eval(ctx, expr, enable); 2433 + if (ret < 0) 2434 + return ret; 2435 + 2436 + if (!ret) 2437 + return -EPERM; 2438 + 2439 + return 0; 2440 + } 2441 + 2442 + static const struct aspeed_pinmux_ops aspeed_g4_ops = { 2443 + .set = aspeed_g4_sig_expr_set, 2444 + }; 2445 + 2415 2446 static struct aspeed_pinctrl_data aspeed_g4_pinctrl_data = { 2416 2447 .pins = aspeed_g4_pins, 2417 2448 .npins = ARRAY_SIZE(aspeed_g4_pins), 2418 - .groups = aspeed_g4_groups, 2419 - .ngroups = ARRAY_SIZE(aspeed_g4_groups), 2420 - .functions = aspeed_g4_functions, 2421 - .nfunctions = ARRAY_SIZE(aspeed_g4_functions), 2449 + .pinmux = { 2450 + .ops = &aspeed_g4_ops, 2451 + .groups = aspeed_g4_groups, 2452 + .ngroups = ARRAY_SIZE(aspeed_g4_groups), 2453 + .functions = aspeed_g4_functions, 2454 + .nfunctions = ARRAY_SIZE(aspeed_g4_functions), 2455 + }, 2422 2456 .configs = aspeed_g4_configs, 2423 2457 .nconfigs = ARRAY_SIZE(aspeed_g4_configs), 2424 2458 };
+121 -6
drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
··· 21 21 #include "../pinctrl-utils.h" 22 22 #include "pinctrl-aspeed.h" 23 23 24 + /* 25 + * The "Multi-function Pins Mapping and Control" table in the SoC datasheet 26 + * references registers by the device/offset mnemonic. The register macros 27 + * below are named the same way to ease transcription and verification (as 28 + * opposed to naming them e.g. PINMUX_CTRL_[0-9]). Further, signal expressions 29 + * reference registers beyond those dedicated to pinmux, such as the system 30 + * reset control and MAC clock configuration registers. The AST2500 goes a step 31 + * further and references registers in the graphics IP block. 32 + */ 33 + #define SCU2C 0x2C /* Misc. Control Register */ 34 + #define SCU3C 0x3C /* System Reset Control/Status Register */ 35 + #define SCU48 0x48 /* MAC Interface Clock Delay Setting */ 36 + #define HW_STRAP1 0x70 /* AST2400 strapping is 33 bits, is split */ 37 + #define HW_REVISION_ID 0x7C /* Silicon revision ID register */ 38 + #define SCU80 0x80 /* Multi-function Pin Control #1 */ 39 + #define SCU84 0x84 /* Multi-function Pin Control #2 */ 40 + #define SCU88 0x88 /* Multi-function Pin Control #3 */ 41 + #define SCU8C 0x8C /* Multi-function Pin Control #4 */ 42 + #define SCU90 0x90 /* Multi-function Pin Control #5 */ 43 + #define SCU94 0x94 /* Multi-function Pin Control #6 */ 44 + #define SCUA0 0xA0 /* Multi-function Pin Control #7 */ 45 + #define SCUA4 0xA4 /* Multi-function Pin Control #8 */ 46 + #define SCUA8 0xA8 /* Multi-function Pin Control #9 */ 47 + #define SCUAC 0xAC /* Multi-function Pin Control #10 */ 48 + #define HW_STRAP2 0xD0 /* Strapping */ 49 + 24 50 #define ASPEED_G5_NR_PINS 236 25 51 26 52 #define COND1 { ASPEED_IP_SCU, SCU90, BIT(6), 0, 0 } ··· 598 572 #define N4 75 599 573 SIG_EXPR_LIST_DECL_SINGLE(SGPMI, SGPM, SIG_DESC_SET(SCU84, 11)); 600 574 SS_PIN_DECL(N4, GPIOJ3, SGPMI); 575 + 576 + FUNC_GROUP_DECL(SGPM, R2, L2, N3, N4); 601 577 602 578 #define N5 76 603 579 SIG_EXPR_LIST_DECL_SINGLE(VGAHS, VGAHS, SIG_DESC_SET(SCU84, 12)); ··· 2151 2123 ASPEED_PINCTRL_GROUP(SD2), 2152 2124 ASPEED_PINCTRL_GROUP(SDA1), 2153 2125 ASPEED_PINCTRL_GROUP(SDA2), 2126 + ASPEED_PINCTRL_GROUP(SGPM), 2154 2127 ASPEED_PINCTRL_GROUP(SGPS1), 2155 2128 ASPEED_PINCTRL_GROUP(SGPS2), 2156 2129 ASPEED_PINCTRL_GROUP(SIOONCTRL), ··· 2321 2292 ASPEED_PINCTRL_FUNC(SD2), 2322 2293 ASPEED_PINCTRL_FUNC(SDA1), 2323 2294 ASPEED_PINCTRL_FUNC(SDA2), 2295 + ASPEED_PINCTRL_FUNC(SGPM), 2324 2296 ASPEED_PINCTRL_FUNC(SGPS1), 2325 2297 ASPEED_PINCTRL_FUNC(SGPS2), 2326 2298 ASPEED_PINCTRL_FUNC(SIOONCTRL), ··· 2507 2477 { PIN_CONFIG_INPUT_DEBOUNCE, { A20, B19 }, SCUA8, 27 }, 2508 2478 }; 2509 2479 2480 + /** 2481 + * Configure a pin's signal by applying an expression's descriptor state for 2482 + * all descriptors in the expression. 2483 + * 2484 + * @ctx: The pinmux context 2485 + * @expr: The expression associated with the function whose signal is to be 2486 + * configured 2487 + * @enable: true to enable an function's signal through a pin's signal 2488 + * expression, false to disable the function's signal 2489 + * 2490 + * Return: 0 if the expression is configured as requested and a negative error 2491 + * code otherwise 2492 + */ 2493 + static int aspeed_g5_sig_expr_set(const struct aspeed_pinmux_data *ctx, 2494 + const struct aspeed_sig_expr *expr, 2495 + bool enable) 2496 + { 2497 + int ret; 2498 + int i; 2499 + 2500 + for (i = 0; i < expr->ndescs; i++) { 2501 + const struct aspeed_sig_desc *desc = &expr->descs[i]; 2502 + u32 pattern = enable ? desc->enable : desc->disable; 2503 + u32 val = (pattern << __ffs(desc->mask)); 2504 + 2505 + if (!ctx->maps[desc->ip]) 2506 + return -ENODEV; 2507 + 2508 + /* 2509 + * Strap registers are configured in hardware or by early-boot 2510 + * firmware. Treat them as read-only despite that we can write 2511 + * them. This may mean that certain functions cannot be 2512 + * deconfigured and is the reason we re-evaluate after writing 2513 + * all descriptor bits. 2514 + * 2515 + * Port D and port E GPIO loopback modes are the only exception 2516 + * as those are commonly used with front-panel buttons to allow 2517 + * normal operation of the host when the BMC is powered off or 2518 + * fails to boot. Once the BMC has booted, the loopback mode 2519 + * must be disabled for the BMC to control host power-on and 2520 + * reset. 2521 + */ 2522 + if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1 && 2523 + !(desc->mask & (BIT(21) | BIT(22)))) 2524 + continue; 2525 + 2526 + if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP2) 2527 + continue; 2528 + 2529 + /* On AST2500, Set bits in SCU70 are cleared from SCU7C */ 2530 + if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1) { 2531 + u32 value = ~val & desc->mask; 2532 + 2533 + if (value) { 2534 + ret = regmap_write(ctx->maps[desc->ip], 2535 + HW_REVISION_ID, value); 2536 + if (ret < 0) 2537 + return ret; 2538 + } 2539 + } 2540 + 2541 + ret = regmap_update_bits(ctx->maps[desc->ip], desc->reg, 2542 + desc->mask, val); 2543 + 2544 + if (ret) 2545 + return ret; 2546 + } 2547 + 2548 + ret = aspeed_sig_expr_eval(ctx, expr, enable); 2549 + if (ret < 0) 2550 + return ret; 2551 + 2552 + if (!ret) 2553 + return -EPERM; 2554 + 2555 + return 0; 2556 + } 2557 + 2558 + static const struct aspeed_pinmux_ops aspeed_g5_ops = { 2559 + .set = aspeed_g5_sig_expr_set, 2560 + }; 2561 + 2510 2562 static struct aspeed_pinctrl_data aspeed_g5_pinctrl_data = { 2511 2563 .pins = aspeed_g5_pins, 2512 2564 .npins = ARRAY_SIZE(aspeed_g5_pins), 2513 - .groups = aspeed_g5_groups, 2514 - .ngroups = ARRAY_SIZE(aspeed_g5_groups), 2515 - .functions = aspeed_g5_functions, 2516 - .nfunctions = ARRAY_SIZE(aspeed_g5_functions), 2565 + .pinmux = { 2566 + .ops = &aspeed_g5_ops, 2567 + .groups = aspeed_g5_groups, 2568 + .ngroups = ARRAY_SIZE(aspeed_g5_groups), 2569 + .functions = aspeed_g5_functions, 2570 + .nfunctions = ARRAY_SIZE(aspeed_g5_functions), 2571 + }, 2517 2572 .configs = aspeed_g5_configs, 2518 2573 .nconfigs = ARRAY_SIZE(aspeed_g5_configs), 2519 2574 }; ··· 2654 2539 dev_warn(&pdev->dev, "No GFX phandle found, some mux configurations may fail\n"); 2655 2540 map = NULL; 2656 2541 } 2657 - aspeed_g5_pinctrl_data.maps[ASPEED_IP_GFX] = map; 2542 + aspeed_g5_pinctrl_data.pinmux.maps[ASPEED_IP_GFX] = map; 2658 2543 2659 2544 node = of_parse_phandle(pdev->dev.of_node, "aspeed,external-nodes", 1); 2660 2545 if (node) { ··· 2668 2553 map = NULL; 2669 2554 } 2670 2555 of_node_put(node); 2671 - aspeed_g5_pinctrl_data.maps[ASPEED_IP_LPC] = map; 2556 + aspeed_g5_pinctrl_data.pinmux.maps[ASPEED_IP_LPC] = map; 2672 2557 2673 2558 return aspeed_pinctrl_probe(pdev, &aspeed_g5_pinctrl_desc, 2674 2559 &aspeed_g5_pinctrl_data);
+37 -209
drivers/pinctrl/aspeed/pinctrl-aspeed.c
··· 10 10 #include "../core.h" 11 11 #include "pinctrl-aspeed.h" 12 12 13 - static const char *const aspeed_pinmux_ips[] = { 14 - [ASPEED_IP_SCU] = "SCU", 15 - [ASPEED_IP_GFX] = "GFX", 16 - [ASPEED_IP_LPC] = "LPC", 17 - }; 18 - 19 13 int aspeed_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) 20 14 { 21 15 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); 22 16 23 - return pdata->ngroups; 17 + return pdata->pinmux.ngroups; 24 18 } 25 19 26 20 const char *aspeed_pinctrl_get_group_name(struct pinctrl_dev *pctldev, ··· 22 28 { 23 29 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); 24 30 25 - return pdata->groups[group].name; 31 + return pdata->pinmux.groups[group].name; 26 32 } 27 33 28 34 int aspeed_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, ··· 31 37 { 32 38 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); 33 39 34 - *pins = &pdata->groups[group].pins[0]; 35 - *npins = pdata->groups[group].npins; 40 + *pins = &pdata->pinmux.groups[group].pins[0]; 41 + *npins = pdata->pinmux.groups[group].npins; 36 42 37 43 return 0; 38 44 } ··· 47 53 { 48 54 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); 49 55 50 - return pdata->nfunctions; 56 + return pdata->pinmux.nfunctions; 51 57 } 52 58 53 59 const char *aspeed_pinmux_get_fn_name(struct pinctrl_dev *pctldev, ··· 55 61 { 56 62 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); 57 63 58 - return pdata->functions[function].name; 64 + return pdata->pinmux.functions[function].name; 59 65 } 60 66 61 67 int aspeed_pinmux_get_fn_groups(struct pinctrl_dev *pctldev, ··· 65 71 { 66 72 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); 67 73 68 - *groups = pdata->functions[function].groups; 69 - *num_groups = pdata->functions[function].ngroups; 74 + *groups = pdata->pinmux.functions[function].groups; 75 + *num_groups = pdata->pinmux.functions[function].ngroups; 70 76 71 77 return 0; 72 78 } 73 79 74 - static inline void aspeed_sig_desc_print_val( 75 - const struct aspeed_sig_desc *desc, bool enable, u32 rv) 76 - { 77 - pr_debug("Want %s%X[0x%08X]=0x%X, got 0x%X from 0x%08X\n", 78 - aspeed_pinmux_ips[desc->ip], desc->reg, 79 - desc->mask, enable ? desc->enable : desc->disable, 80 - (rv & desc->mask) >> __ffs(desc->mask), rv); 81 - } 82 - 83 - /** 84 - * Query the enabled or disabled state of a signal descriptor 85 - * 86 - * @desc: The signal descriptor of interest 87 - * @enabled: True to query the enabled state, false to query disabled state 88 - * @map: The IP block's regmap instance 89 - * 90 - * Return: 1 if the descriptor's bitfield is configured to the state 91 - * selected by @enabled, 0 if not, and less than zero if an unrecoverable 92 - * failure occurred 93 - * 94 - * Evaluation of descriptor state is non-trivial in that it is not a binary 95 - * outcome: The bitfields can be greater than one bit in size and thus can take 96 - * a value that is neither the enabled nor disabled state recorded in the 97 - * descriptor (typically this means a different function to the one of interest 98 - * is enabled). Thus we must explicitly test for either condition as required. 99 - */ 100 - static int aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc, 101 - bool enabled, struct regmap *map) 80 + static int aspeed_sig_expr_enable(const struct aspeed_pinmux_data *ctx, 81 + const struct aspeed_sig_expr *expr) 102 82 { 103 83 int ret; 104 - unsigned int raw; 105 - u32 want; 106 84 107 - if (!map) 108 - return -ENODEV; 109 - 110 - ret = regmap_read(map, desc->reg, &raw); 111 - if (ret) 112 - return ret; 113 - 114 - aspeed_sig_desc_print_val(desc, enabled, raw); 115 - want = enabled ? desc->enable : desc->disable; 116 - 117 - return ((raw & desc->mask) >> __ffs(desc->mask)) == want; 118 - } 119 - 120 - /** 121 - * Query the enabled or disabled state for a mux function's signal on a pin 122 - * 123 - * @expr: An expression controlling the signal for a mux function on a pin 124 - * @enabled: True to query the enabled state, false to query disabled state 125 - * @maps: The list of regmap instances 126 - * 127 - * Return: 1 if the expression composed by @enabled evaluates true, 0 if not, 128 - * and less than zero if an unrecoverable failure occurred. 129 - * 130 - * A mux function is enabled or disabled if the function's signal expression 131 - * for each pin in the function's pin group evaluates true for the desired 132 - * state. An signal expression evaluates true if all of its associated signal 133 - * descriptors evaluate true for the desired state. 134 - * 135 - * If an expression's state is described by more than one bit, either through 136 - * multi-bit bitfields in a single signal descriptor or through multiple signal 137 - * descriptors of a single bit then it is possible for the expression to be in 138 - * neither the enabled nor disabled state. Thus we must explicitly test for 139 - * either condition as required. 140 - */ 141 - static int aspeed_sig_expr_eval(const struct aspeed_sig_expr *expr, 142 - bool enabled, struct regmap * const *maps) 143 - { 144 - int i; 145 - int ret; 146 - 147 - for (i = 0; i < expr->ndescs; i++) { 148 - const struct aspeed_sig_desc *desc = &expr->descs[i]; 149 - 150 - ret = aspeed_sig_desc_eval(desc, enabled, maps[desc->ip]); 151 - if (ret <= 0) 152 - return ret; 153 - } 154 - 155 - return 1; 156 - } 157 - 158 - /** 159 - * Configure a pin's signal by applying an expression's descriptor state for 160 - * all descriptors in the expression. 161 - * 162 - * @expr: The expression associated with the function whose signal is to be 163 - * configured 164 - * @enable: true to enable an function's signal through a pin's signal 165 - * expression, false to disable the function's signal 166 - * @maps: The list of regmap instances for pinmux register access. 167 - * 168 - * Return: 0 if the expression is configured as requested and a negative error 169 - * code otherwise 170 - */ 171 - static int aspeed_sig_expr_set(const struct aspeed_sig_expr *expr, 172 - bool enable, struct regmap * const *maps) 173 - { 174 - int ret; 175 - int i; 176 - 177 - for (i = 0; i < expr->ndescs; i++) { 178 - const struct aspeed_sig_desc *desc = &expr->descs[i]; 179 - u32 pattern = enable ? desc->enable : desc->disable; 180 - u32 val = (pattern << __ffs(desc->mask)); 181 - 182 - if (!maps[desc->ip]) 183 - return -ENODEV; 184 - 185 - /* 186 - * Strap registers are configured in hardware or by early-boot 187 - * firmware. Treat them as read-only despite that we can write 188 - * them. This may mean that certain functions cannot be 189 - * deconfigured and is the reason we re-evaluate after writing 190 - * all descriptor bits. 191 - * 192 - * Port D and port E GPIO loopback modes are the only exception 193 - * as those are commonly used with front-panel buttons to allow 194 - * normal operation of the host when the BMC is powered off or 195 - * fails to boot. Once the BMC has booted, the loopback mode 196 - * must be disabled for the BMC to control host power-on and 197 - * reset. 198 - */ 199 - if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1 && 200 - !(desc->mask & (BIT(21) | BIT(22)))) 201 - continue; 202 - 203 - if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP2) 204 - continue; 205 - 206 - /* On AST2500, Set bits in SCU7C are cleared from SCU70 */ 207 - if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1) { 208 - unsigned int rev_id; 209 - 210 - ret = regmap_read(maps[ASPEED_IP_SCU], 211 - HW_REVISION_ID, &rev_id); 212 - if (ret < 0) 213 - return ret; 214 - 215 - if (0x04 == (rev_id >> 24)) { 216 - u32 value = ~val & desc->mask; 217 - 218 - if (value) { 219 - ret = regmap_write(maps[desc->ip], 220 - HW_REVISION_ID, value); 221 - if (ret < 0) 222 - return ret; 223 - } 224 - } 225 - } 226 - 227 - ret = regmap_update_bits(maps[desc->ip], desc->reg, 228 - desc->mask, val); 229 - 230 - if (ret) 231 - return ret; 232 - } 233 - 234 - ret = aspeed_sig_expr_eval(expr, enable, maps); 85 + ret = aspeed_sig_expr_eval(ctx, expr, true); 235 86 if (ret < 0) 236 87 return ret; 237 88 238 89 if (!ret) 239 - return -EPERM; 90 + return aspeed_sig_expr_set(ctx, expr, true); 240 91 241 92 return 0; 242 93 } 243 94 244 - static int aspeed_sig_expr_enable(const struct aspeed_sig_expr *expr, 245 - struct regmap * const *maps) 95 + static int aspeed_sig_expr_disable(const struct aspeed_pinmux_data *ctx, 96 + const struct aspeed_sig_expr *expr) 246 97 { 247 98 int ret; 248 99 249 - ret = aspeed_sig_expr_eval(expr, true, maps); 250 - if (ret < 0) 251 - return ret; 252 - 253 - if (!ret) 254 - return aspeed_sig_expr_set(expr, true, maps); 255 - 256 - return 0; 257 - } 258 - 259 - static int aspeed_sig_expr_disable(const struct aspeed_sig_expr *expr, 260 - struct regmap * const *maps) 261 - { 262 - int ret; 263 - 264 - ret = aspeed_sig_expr_eval(expr, true, maps); 100 + ret = aspeed_sig_expr_eval(ctx, expr, true); 265 101 if (ret < 0) 266 102 return ret; 267 103 268 104 if (ret) 269 - return aspeed_sig_expr_set(expr, false, maps); 105 + return aspeed_sig_expr_set(ctx, expr, false); 270 106 271 107 return 0; 272 108 } ··· 104 280 /** 105 281 * Disable a signal on a pin by disabling all provided signal expressions. 106 282 * 283 + * @ctx: The pinmux context 107 284 * @exprs: The list of signal expressions (from a priority level on a pin) 108 - * @maps: The list of regmap instances for pinmux register access. 109 285 * 110 286 * Return: 0 if all expressions are disabled, otherwise a negative error code 111 287 */ 112 - static int aspeed_disable_sig(const struct aspeed_sig_expr **exprs, 113 - struct regmap * const *maps) 288 + static int aspeed_disable_sig(const struct aspeed_pinmux_data *ctx, 289 + const struct aspeed_sig_expr **exprs) 114 290 { 115 291 int ret = 0; 116 292 ··· 118 294 return true; 119 295 120 296 while (*exprs && !ret) { 121 - ret = aspeed_sig_expr_disable(*exprs, maps); 297 + ret = aspeed_sig_expr_disable(ctx, *exprs); 122 298 exprs++; 123 299 } 124 300 ··· 219 395 int ret; 220 396 const struct aspeed_pinctrl_data *pdata = 221 397 pinctrl_dev_get_drvdata(pctldev); 222 - const struct aspeed_pin_group *pgroup = &pdata->groups[group]; 398 + const struct aspeed_pin_group *pgroup = &pdata->pinmux.groups[group]; 223 399 const struct aspeed_pin_function *pfunc = 224 - &pdata->functions[function]; 400 + &pdata->pinmux.functions[function]; 225 401 226 402 for (i = 0; i < pgroup->npins; i++) { 227 403 int pin = pgroup->pins[i]; ··· 247 423 if (expr) 248 424 break; 249 425 250 - ret = aspeed_disable_sig(funcs, pdata->maps); 426 + ret = aspeed_disable_sig(&pdata->pinmux, funcs); 251 427 if (ret) 252 428 return ret; 253 429 ··· 267 443 return -ENXIO; 268 444 } 269 445 270 - ret = aspeed_sig_expr_enable(expr, pdata->maps); 446 + ret = aspeed_sig_expr_enable(&pdata->pinmux, expr); 271 447 if (ret) 272 448 return ret; 273 449 } ··· 324 500 if (aspeed_gpio_in_exprs(funcs)) 325 501 break; 326 502 327 - ret = aspeed_disable_sig(funcs, pdata->maps); 503 + ret = aspeed_disable_sig(&pdata->pinmux, funcs); 328 504 if (ret) 329 505 return ret; 330 506 ··· 355 531 * If GPIO is not the lowest priority signal type, assume there is only 356 532 * one expression defined to enable the GPIO function 357 533 */ 358 - return aspeed_sig_expr_enable(expr, pdata->maps); 534 + return aspeed_sig_expr_enable(&pdata->pinmux, expr); 359 535 } 360 536 361 537 int aspeed_pinctrl_probe(struct platform_device *pdev, ··· 371 547 return -ENODEV; 372 548 } 373 549 374 - pdata->maps[ASPEED_IP_SCU] = syscon_node_to_regmap(parent->of_node); 375 - if (IS_ERR(pdata->maps[ASPEED_IP_SCU])) { 550 + pdata->scu = syscon_node_to_regmap(parent->of_node); 551 + if (IS_ERR(pdata->scu)) { 376 552 dev_err(&pdev->dev, "No regmap for syscon pincontroller parent\n"); 377 - return PTR_ERR(pdata->maps[ASPEED_IP_SCU]); 553 + return PTR_ERR(pdata->scu); 378 554 } 555 + 556 + pdata->pinmux.maps[ASPEED_IP_SCU] = pdata->scu; 379 557 380 558 pctl = pinctrl_register(pdesc, &pdev->dev, pdata); 381 559 ··· 413 587 return NULL; 414 588 } 415 589 416 - /** 590 + /* 591 + * Aspeed pin configuration description. 592 + * 417 593 * @param: pinconf configuration parameter 418 594 * @arg: The supported argument for @param, or -1 if any value is supported 419 595 * @val: The register value to write to configure @arg for @param ··· 489 661 if (!pconf) 490 662 return -ENOTSUPP; 491 663 492 - rc = regmap_read(pdata->maps[ASPEED_IP_SCU], pconf->reg, &val); 664 + rc = regmap_read(pdata->scu, pconf->reg, &val); 493 665 if (rc < 0) 494 666 return rc; 495 667 ··· 544 716 545 717 val = pmap->val << pconf->bit; 546 718 547 - rc = regmap_update_bits(pdata->maps[ASPEED_IP_SCU], pconf->reg, 548 - BIT(pconf->bit), val); 719 + rc = regmap_update_bits(pdata->scu, pconf->reg, 720 + BIT(pconf->bit), val); 549 721 550 722 if (rc < 0) 551 723 return rc;
+11 -535
drivers/pinctrl/aspeed/pinctrl-aspeed.h
··· 12 12 #include <linux/pinctrl/pinconf-generic.h> 13 13 #include <linux/regmap.h> 14 14 15 - /* 16 - * The ASPEED SoCs provide typically more than 200 pins for GPIO and other 17 - * functions. The SoC function enabled on a pin is determined on a priority 18 - * basis where a given pin can provide a number of different signal types. 19 - * 20 - * The signal active on a pin is described by both a priority level and 21 - * compound logical expressions involving multiple operators, registers and 22 - * bits. Some difficulty arises as the pin's function bit masks for each 23 - * priority level are frequently not the same (i.e. cannot just flip a bit to 24 - * change from a high to low priority signal), or even in the same register. 25 - * Further, not all signals can be unmuxed, as some expressions depend on 26 - * values in the hardware strapping register (which is treated as read-only). 27 - * 28 - * SoC Multi-function Pin Expression Examples 29 - * ------------------------------------------ 30 - * 31 - * Here are some sample mux configurations from the AST2400 and AST2500 32 - * datasheets to illustrate the corner cases, roughly in order of least to most 33 - * corner. The signal priorities are in decending order from P0 (highest). 34 - * 35 - * D6 is a pin with a single function (beside GPIO); a high priority signal 36 - * that participates in one function: 37 - * 38 - * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 39 - * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 40 - * D6 GPIOA0 MAC1LINK SCU80[0]=1 GPIOA0 41 - * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 42 - * 43 - * C5 is a multi-signal pin (high and low priority signals). Here we touch 44 - * different registers for the different functions that enable each signal: 45 - * 46 - * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 47 - * C5 GPIOA4 SCL9 SCU90[22]=1 TIMER5 SCU80[4]=1 GPIOA4 48 - * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 49 - * 50 - * E19 is a single-signal pin with two functions that influence the active 51 - * signal. In this case both bits have the same meaning - enable a dedicated 52 - * LPC reset pin. However it's not always the case that the bits in the 53 - * OR-relationship have the same meaning. 54 - * 55 - * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 56 - * E19 GPIOB4 LPCRST# SCU80[12]=1 | Strap[14]=1 GPIOB4 57 - * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 58 - * 59 - * For example, pin B19 has a low-priority signal that's enabled by two 60 - * distinct SoC functions: A specific SIOPBI bit in register SCUA4, and an ACPI 61 - * bit in the STRAP register. The ACPI bit configures signals on pins in 62 - * addition to B19. Both of the low priority functions as well as the high 63 - * priority function must be disabled for GPIOF1 to be used. 64 - * 65 - * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 66 - * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 67 - * B19 GPIOF1 NDCD4 SCU80[25]=1 SIOPBI# SCUA4[12]=1 | Strap[19]=0 GPIOF1 68 - * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 69 - * 70 - * For pin E18, the SoC ANDs the expected state of three bits to determine the 71 - * pin's active signal: 72 - * 73 - * * SCU3C[3]: Enable external SOC reset function 74 - * * SCU80[15]: Enable SPICS1# or EXTRST# function pin 75 - * * SCU90[31]: Select SPI interface CS# output 76 - * 77 - * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 78 - * E18 GPIOB7 EXTRST# SCU3C[3]=1 & SCU80[15]=1 & SCU90[31]=0 SPICS1# SCU3C[3]=1 & SCU80[15]=1 & SCU90[31]=1 GPIOB7 79 - * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 80 - * 81 - * (Bits SCU3C[3] and SCU80[15] appear to only be used in the expressions for 82 - * selecting the signals on pin E18) 83 - * 84 - * Pin T5 is a multi-signal pin with a more complex configuration: 85 - * 86 - * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 87 - * -----+---------+-----------+------------------------------+-----------+---------------+---------- 88 - * T5 GPIOL1 VPIDE SCU90[5:4]!=0 & SCU84[17]=1 NDCD1 SCU84[17]=1 GPIOL1 89 - * -----+---------+-----------+------------------------------+-----------+---------------+---------- 90 - * 91 - * The high priority signal configuration is best thought of in terms of its 92 - * exploded form, with reference to the SCU90[5:4] bits: 93 - * 94 - * * SCU90[5:4]=00: disable 95 - * * SCU90[5:4]=01: 18 bits (R6/G6/B6) video mode. 96 - * * SCU90[5:4]=10: 24 bits (R8/G8/B8) video mode. 97 - * * SCU90[5:4]=11: 30 bits (R10/G10/B10) video mode. 98 - * 99 - * Re-writing: 100 - * 101 - * -----+---------+-----------+------------------------------+-----------+---------------+---------- 102 - * T5 GPIOL1 VPIDE (SCU90[5:4]=1 & SCU84[17]=1) NDCD1 SCU84[17]=1 GPIOL1 103 - * | (SCU90[5:4]=2 & SCU84[17]=1) 104 - * | (SCU90[5:4]=3 & SCU84[17]=1) 105 - * -----+---------+-----------+------------------------------+-----------+---------------+---------- 106 - * 107 - * For reference the SCU84[17] bit configure the "UART1 NDCD1 or Video VPIDE 108 - * function pin", where the signal itself is determined by whether SCU94[5:4] 109 - * is disabled or in one of the 18, 24 or 30bit video modes. 110 - * 111 - * Other video-input-related pins require an explicit state in SCU90[5:4], e.g. 112 - * W1 and U5: 113 - * 114 - * -----+---------+-----------+------------------------------+-----------+---------------+---------- 115 - * W1 GPIOL6 VPIB0 SCU90[5:4]=3 & SCU84[22]=1 TXD1 SCU84[22]=1 GPIOL6 116 - * U5 GPIOL7 VPIB1 SCU90[5:4]=3 & SCU84[23]=1 RXD1 SCU84[23]=1 GPIOL7 117 - * -----+---------+-----------+------------------------------+-----------+---------------+---------- 118 - * 119 - * The examples of T5 and W1 are particularly fertile, as they also demonstrate 120 - * that despite operating as part of the video input bus each signal needs to 121 - * be enabled individually via it's own SCU84 (in the cases of T5 and W1) 122 - * register bit. This is a little crazy if the bus doesn't have optional 123 - * signals, but is used to decent effect with some of the UARTs where not all 124 - * signals are required. However, this isn't done consistently - UART1 is 125 - * enabled on a per-pin basis, and by contrast, all signals for UART6 are 126 - * enabled by a single bit. 127 - * 128 - * Further, the high and low priority signals listed in the table above share 129 - * a configuration bit. The VPI signals should operate in concert in a single 130 - * function, but the UART signals should retain the ability to be configured 131 - * independently. This pushes the implementation down the path of tagging a 132 - * signal's expressions with the function they participate in, rather than 133 - * defining masks affecting multiple signals per function. The latter approach 134 - * fails in this instance where applying the configuration for the UART pin of 135 - * interest will stomp on the state of other UART signals when disabling the 136 - * VPI functions on the current pin. 137 - * 138 - * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 139 - * -----+------------+-----------+---------------------------+-----------+---------------+------------ 140 - * A12 RGMII1TXCK GPIOT0 SCUA0[0]=1 RMII1TXEN Strap[6]=0 RGMII1TXCK 141 - * B12 RGMII1TXCTL GPIOT1 SCUA0[1]=1 – Strap[6]=0 RGMII1TXCTL 142 - * -----+------------+-----------+---------------------------+-----------+---------------+------------ 143 - * 144 - * A12 demonstrates that the "Other" signal isn't always GPIO - in this case 145 - * GPIOT0 is a high-priority signal and RGMII1TXCK is Other. Thus, GPIO 146 - * should be treated like any other signal type with full function expression 147 - * requirements, and not assumed to be the default case. Separately, GPIOT0 and 148 - * GPIOT1's signal descriptor bits are distinct, therefore we must iterate all 149 - * pins in the function's group to disable the higher-priority signals such 150 - * that the signal for the function of interest is correctly enabled. 151 - * 152 - * Finally, three priority levels aren't always enough; the AST2500 brings with 153 - * it 18 pins of five priority levels, however the 18 pins only use three of 154 - * the five priority levels. 155 - * 156 - * Ultimately the requirement to control pins in the examples above drive the 157 - * design: 158 - * 159 - * * Pins provide signals according to functions activated in the mux 160 - * configuration 161 - * 162 - * * Pins provide up to five signal types in a priority order 163 - * 164 - * * For priorities levels defined on a pin, each priority provides one signal 165 - * 166 - * * Enabling lower priority signals requires higher priority signals be 167 - * disabled 168 - * 169 - * * A function represents a set of signals; functions are distinct if their 170 - * sets of signals are not equal 171 - * 172 - * * Signals participate in one or more functions 173 - * 174 - * * A function is described by an expression of one or more signal 175 - * descriptors, which compare bit values in a register 176 - * 177 - * * A signal expression is the smallest set of signal descriptors whose 178 - * comparisons must evaluate 'true' for a signal to be enabled on a pin. 179 - * 180 - * * A function's signal is active on a pin if evaluating all signal 181 - * descriptors in the pin's signal expression for the function yields a 'true' 182 - * result 183 - * 184 - * * A signal at a given priority on a given pin is active if any of the 185 - * functions in which the signal participates are active, and no higher 186 - * priority signal on the pin is active 187 - * 188 - * * GPIO is configured per-pin 189 - * 190 - * And so: 191 - * 192 - * * To disable a signal, any function(s) activating the signal must be 193 - * disabled 194 - * 195 - * * Each pin must know the signal expressions of functions in which it 196 - * participates, for the purpose of enabling the Other function. This is done 197 - * by deactivating all functions that activate higher priority signals on the 198 - * pin. 199 - * 200 - * As a concrete example: 201 - * 202 - * * T5 provides three signals types: VPIDE, NDCD1 and GPIO 203 - * 204 - * * The VPIDE signal participates in 3 functions: VPI18, VPI24 and VPI30 205 - * 206 - * * The NDCD1 signal participates in just its own NDCD1 function 207 - * 208 - * * VPIDE is high priority, NDCD1 is low priority, and GPIOL1 is the least 209 - * prioritised 210 - * 211 - * * The prerequisit for activating the NDCD1 signal is that the VPI18, VPI24 212 - * and VPI30 functions all be disabled 213 - * 214 - * * Similarly, all of VPI18, VPI24, VPI30 and NDCD1 functions must be disabled 215 - * to provide GPIOL6 216 - * 217 - * Considerations 218 - * -------------- 219 - * 220 - * If pinctrl allows us to allocate a pin we can configure a function without 221 - * concern for the function of already allocated pins, if pin groups are 222 - * created with respect to the SoC functions in which they participate. This is 223 - * intuitive, but it did not feel obvious from the bit/pin relationships. 224 - * 225 - * Conversely, failing to allocate all pins in a group indicates some bits (as 226 - * well as pins) required for the group's configuration will already be in use, 227 - * likely in a way that's inconsistent with the requirements of the failed 228 - * group. 229 - */ 230 - 231 - #define ASPEED_IP_SCU 0 232 - #define ASPEED_IP_GFX 1 233 - #define ASPEED_IP_LPC 2 234 - #define ASPEED_NR_PINMUX_IPS 3 235 - 236 - /* 237 - * The "Multi-function Pins Mapping and Control" table in the SoC datasheet 238 - * references registers by the device/offset mnemonic. The register macros 239 - * below are named the same way to ease transcription and verification (as 240 - * opposed to naming them e.g. PINMUX_CTRL_[0-9]). Further, signal expressions 241 - * reference registers beyond those dedicated to pinmux, such as the system 242 - * reset control and MAC clock configuration registers. The AST2500 goes a step 243 - * further and references registers in the graphics IP block, but that isn't 244 - * handled yet. 245 - */ 246 - #define SCU2C 0x2C /* Misc. Control Register */ 247 - #define SCU3C 0x3C /* System Reset Control/Status Register */ 248 - #define SCU48 0x48 /* MAC Interface Clock Delay Setting */ 249 - #define HW_STRAP1 0x70 /* AST2400 strapping is 33 bits, is split */ 250 - #define HW_REVISION_ID 0x7C /* Silicon revision ID register */ 251 - #define SCU80 0x80 /* Multi-function Pin Control #1 */ 252 - #define SCU84 0x84 /* Multi-function Pin Control #2 */ 253 - #define SCU88 0x88 /* Multi-function Pin Control #3 */ 254 - #define SCU8C 0x8C /* Multi-function Pin Control #4 */ 255 - #define SCU90 0x90 /* Multi-function Pin Control #5 */ 256 - #define SCU94 0x94 /* Multi-function Pin Control #6 */ 257 - #define SCUA0 0xA0 /* Multi-function Pin Control #7 */ 258 - #define SCUA4 0xA4 /* Multi-function Pin Control #8 */ 259 - #define SCUA8 0xA8 /* Multi-function Pin Control #9 */ 260 - #define SCUAC 0xAC /* Multi-function Pin Control #10 */ 261 - #define HW_STRAP2 0xD0 /* Strapping */ 262 - 263 - /** 264 - * A signal descriptor, which describes the register, bits and the 265 - * enable/disable values that should be compared or written. 266 - * 267 - * @ip: The IP block identifier, used as an index into the regmap array in 268 - * struct aspeed_pinctrl_data 269 - * @reg: The register offset with respect to the base address of the IP block 270 - * @mask: The mask to apply to the register. The lowest set bit of the mask is 271 - * used to derive the shift value. 272 - * @enable: The value that enables the function. Value should be in the LSBs, 273 - * not at the position of the mask. 274 - * @disable: The value that disables the function. Value should be in the 275 - * LSBs, not at the position of the mask. 276 - */ 277 - struct aspeed_sig_desc { 278 - unsigned int ip; 279 - unsigned int reg; 280 - u32 mask; 281 - u32 enable; 282 - u32 disable; 283 - }; 284 - 285 - /** 286 - * Describes a signal expression. The expression is evaluated by ANDing the 287 - * evaluation of the descriptors. 288 - * 289 - * @signal: The signal name for the priority level on the pin. If the signal 290 - * type is GPIO, then the signal name must begin with the string 291 - * "GPIO", e.g. GPIOA0, GPIOT4 etc. 292 - * @function: The name of the function the signal participates in for the 293 - * associated expression 294 - * @ndescs: The number of signal descriptors in the expression 295 - * @descs: Pointer to an array of signal descriptors that comprise the 296 - * function expression 297 - */ 298 - struct aspeed_sig_expr { 299 - const char *signal; 300 - const char *function; 301 - int ndescs; 302 - const struct aspeed_sig_desc *descs; 303 - }; 304 - 305 - /** 306 - * A struct capturing the list of expressions enabling signals at each priority 307 - * for a given pin. The signal configuration for a priority level is evaluated 308 - * by ORing the evaluation of the signal expressions in the respective 309 - * priority's list. 310 - * 311 - * @name: A name for the pin 312 - * @prios: A pointer to an array of expression list pointers 313 - * 314 - */ 315 - struct aspeed_pin_desc { 316 - const char *name; 317 - const struct aspeed_sig_expr ***prios; 318 - }; 319 - 320 - /* Macro hell */ 321 - 322 - #define SIG_DESC_IP_BIT(ip, reg, idx, val) \ 323 - { ip, reg, BIT_MASK(idx), val, (((val) + 1) & 1) } 324 - 325 - /** 326 - * Short-hand macro for describing an SCU descriptor enabled by the state of 327 - * one bit. The disable value is derived. 328 - * 329 - * @reg: The signal's associated register, offset from base 330 - * @idx: The signal's bit index in the register 331 - * @val: The value (0 or 1) that enables the function 332 - */ 333 - #define SIG_DESC_BIT(reg, idx, val) \ 334 - SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, val) 335 - 336 - #define SIG_DESC_IP_SET(ip, reg, idx) SIG_DESC_IP_BIT(ip, reg, idx, 1) 337 - 338 - /** 339 - * A further short-hand macro expanding to an SCU descriptor enabled by a set 340 - * bit. 341 - * 342 - * @reg: The register, offset from base 343 - * @idx: The bit index in the register 344 - */ 345 - #define SIG_DESC_SET(reg, idx) SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, 1) 346 - 347 - #define SIG_DESC_LIST_SYM(sig, func) sig_descs_ ## sig ## _ ## func 348 - #define SIG_DESC_LIST_DECL(sig, func, ...) \ 349 - static const struct aspeed_sig_desc SIG_DESC_LIST_SYM(sig, func)[] = \ 350 - { __VA_ARGS__ } 351 - 352 - #define SIG_EXPR_SYM(sig, func) sig_expr_ ## sig ## _ ## func 353 - #define SIG_EXPR_DECL_(sig, func) \ 354 - static const struct aspeed_sig_expr SIG_EXPR_SYM(sig, func) = \ 355 - { \ 356 - .signal = #sig, \ 357 - .function = #func, \ 358 - .ndescs = ARRAY_SIZE(SIG_DESC_LIST_SYM(sig, func)), \ 359 - .descs = &(SIG_DESC_LIST_SYM(sig, func))[0], \ 360 - } 361 - 362 - /** 363 - * Declare a signal expression. 364 - * 365 - * @sig: A macro symbol name for the signal (is subjected to stringification 366 - * and token pasting) 367 - * @func: The function in which the signal is participating 368 - * @...: Signal descriptors that define the signal expression 369 - * 370 - * For example, the following declares the ROMD8 signal for the ROM16 function: 371 - * 372 - * SIG_EXPR_DECL(ROMD8, ROM16, SIG_DESC_SET(SCU90, 6)); 373 - * 374 - * And with multiple signal descriptors: 375 - * 376 - * SIG_EXPR_DECL(ROMD8, ROM16S, SIG_DESC_SET(HW_STRAP1, 4), 377 - * { HW_STRAP1, GENMASK(1, 0), 0, 0 }); 378 - */ 379 - #define SIG_EXPR_DECL(sig, func, ...) \ 380 - SIG_DESC_LIST_DECL(sig, func, __VA_ARGS__); \ 381 - SIG_EXPR_DECL_(sig, func) 382 - 383 - /** 384 - * Declare a pointer to a signal expression 385 - * 386 - * @sig: The macro symbol name for the signal (subjected to token pasting) 387 - * @func: The macro symbol name for the function (subjected to token pasting) 388 - */ 389 - #define SIG_EXPR_PTR(sig, func) (&SIG_EXPR_SYM(sig, func)) 390 - 391 - #define SIG_EXPR_LIST_SYM(sig) sig_exprs_ ## sig 392 - 393 - /** 394 - * Declare a signal expression list for reference in a struct aspeed_pin_prio. 395 - * 396 - * @sig: A macro symbol name for the signal (is subjected to token pasting) 397 - * @...: Signal expression structure pointers (use SIG_EXPR_PTR()) 398 - * 399 - * For example, the 16-bit ROM bus can be enabled by one of two possible signal 400 - * expressions: 401 - * 402 - * SIG_EXPR_DECL(ROMD8, ROM16, SIG_DESC_SET(SCU90, 6)); 403 - * SIG_EXPR_DECL(ROMD8, ROM16S, SIG_DESC_SET(HW_STRAP1, 4), 404 - * { HW_STRAP1, GENMASK(1, 0), 0, 0 }); 405 - * SIG_EXPR_LIST_DECL(ROMD8, SIG_EXPR_PTR(ROMD8, ROM16), 406 - * SIG_EXPR_PTR(ROMD8, ROM16S)); 407 - */ 408 - #define SIG_EXPR_LIST_DECL(sig, ...) \ 409 - static const struct aspeed_sig_expr *SIG_EXPR_LIST_SYM(sig)[] = \ 410 - { __VA_ARGS__, NULL } 411 - 412 - /** 413 - * A short-hand macro for declaring a function expression and an expression 414 - * list with a single function. 415 - * 416 - * @func: A macro symbol name for the function (is subjected to token pasting) 417 - * @...: Function descriptors that define the function expression 418 - * 419 - * For example, signal NCTS6 participates in its own function with one group: 420 - * 421 - * SIG_EXPR_LIST_DECL_SINGLE(NCTS6, NCTS6, SIG_DESC_SET(SCU90, 7)); 422 - */ 423 - #define SIG_EXPR_LIST_DECL_SINGLE(sig, func, ...) \ 424 - SIG_DESC_LIST_DECL(sig, func, __VA_ARGS__); \ 425 - SIG_EXPR_DECL_(sig, func); \ 426 - SIG_EXPR_LIST_DECL(sig, SIG_EXPR_PTR(sig, func)) 427 - 428 - #define SIG_EXPR_LIST_DECL_DUAL(sig, f0, f1) \ 429 - SIG_EXPR_LIST_DECL(sig, SIG_EXPR_PTR(sig, f0), SIG_EXPR_PTR(sig, f1)) 430 - 431 - #define SIG_EXPR_LIST_PTR(sig) (&SIG_EXPR_LIST_SYM(sig)[0]) 432 - 433 - #define PIN_EXPRS_SYM(pin) pin_exprs_ ## pin 434 - #define PIN_EXPRS_PTR(pin) (&PIN_EXPRS_SYM(pin)[0]) 435 - #define PIN_SYM(pin) pin_ ## pin 436 - 437 - #define MS_PIN_DECL_(pin, ...) \ 438 - static const struct aspeed_sig_expr **PIN_EXPRS_SYM(pin)[] = \ 439 - { __VA_ARGS__, NULL }; \ 440 - static const struct aspeed_pin_desc PIN_SYM(pin) = \ 441 - { #pin, PIN_EXPRS_PTR(pin) } 442 - 443 - /** 444 - * Declare a multi-signal pin 445 - * 446 - * @pin: The pin number 447 - * @other: Macro name for "other" functionality (subjected to stringification) 448 - * @high: Macro name for the highest priority signal functions 449 - * @low: Macro name for the low signal functions 450 - * 451 - * For example: 452 - * 453 - * #define A8 56 454 - * SIG_EXPR_DECL(ROMD8, ROM16, SIG_DESC_SET(SCU90, 6)); 455 - * SIG_EXPR_DECL(ROMD8, ROM16S, SIG_DESC_SET(HW_STRAP1, 4), 456 - * { HW_STRAP1, GENMASK(1, 0), 0, 0 }); 457 - * SIG_EXPR_LIST_DECL(ROMD8, SIG_EXPR_PTR(ROMD8, ROM16), 458 - * SIG_EXPR_PTR(ROMD8, ROM16S)); 459 - * SIG_EXPR_LIST_DECL_SINGLE(NCTS6, NCTS6, SIG_DESC_SET(SCU90, 7)); 460 - * MS_PIN_DECL(A8, GPIOH0, ROMD8, NCTS6); 461 - */ 462 - #define MS_PIN_DECL(pin, other, high, low) \ 463 - SIG_EXPR_LIST_DECL_SINGLE(other, other); \ 464 - MS_PIN_DECL_(pin, \ 465 - SIG_EXPR_LIST_PTR(high), \ 466 - SIG_EXPR_LIST_PTR(low), \ 467 - SIG_EXPR_LIST_PTR(other)) 468 - 469 - #define PIN_GROUP_SYM(func) pins_ ## func 470 - #define FUNC_GROUP_SYM(func) groups_ ## func 471 - #define FUNC_GROUP_DECL(func, ...) \ 472 - static const int PIN_GROUP_SYM(func)[] = { __VA_ARGS__ }; \ 473 - static const char *FUNC_GROUP_SYM(func)[] = { #func } 474 - 475 - /** 476 - * Declare a single signal pin 477 - * 478 - * @pin: The pin number 479 - * @other: Macro name for "other" functionality (subjected to stringification) 480 - * @sig: Macro name for the signal (subjected to stringification) 481 - * 482 - * For example: 483 - * 484 - * #define E3 80 485 - * SIG_EXPR_LIST_DECL_SINGLE(SCL5, I2C5, I2C5_DESC); 486 - * SS_PIN_DECL(E3, GPIOK0, SCL5); 487 - */ 488 - #define SS_PIN_DECL(pin, other, sig) \ 489 - SIG_EXPR_LIST_DECL_SINGLE(other, other); \ 490 - MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(sig), SIG_EXPR_LIST_PTR(other)) 491 - 492 - /** 493 - * Single signal, single function pin declaration 494 - * 495 - * @pin: The pin number 496 - * @other: Macro name for "other" functionality (subjected to stringification) 497 - * @sig: Macro name for the signal (subjected to stringification) 498 - * @...: Signal descriptors that define the function expression 499 - * 500 - * For example: 501 - * 502 - * SSSF_PIN_DECL(A4, GPIOA2, TIMER3, SIG_DESC_SET(SCU80, 2)); 503 - */ 504 - #define SSSF_PIN_DECL(pin, other, sig, ...) \ 505 - SIG_EXPR_LIST_DECL_SINGLE(sig, sig, __VA_ARGS__); \ 506 - SIG_EXPR_LIST_DECL_SINGLE(other, other); \ 507 - MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(sig), SIG_EXPR_LIST_PTR(other)); \ 508 - FUNC_GROUP_DECL(sig, pin) 509 - 510 - #define GPIO_PIN_DECL(pin, gpio) \ 511 - SIG_EXPR_LIST_DECL_SINGLE(gpio, gpio); \ 512 - MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(gpio)) 15 + #include "pinmux-aspeed.h" 513 16 514 17 /** 515 18 * @param The pinconf parameter type ··· 28 525 u8 value; 29 526 }; 30 527 31 - struct aspeed_pinctrl_data { 32 - struct regmap *maps[ASPEED_NR_PINMUX_IPS]; 33 - 34 - const struct pinctrl_pin_desc *pins; 35 - const unsigned int npins; 36 - 37 - const struct aspeed_pin_group *groups; 38 - const unsigned int ngroups; 39 - 40 - const struct aspeed_pin_function *functions; 41 - const unsigned int nfunctions; 42 - 43 - const struct aspeed_pin_config *configs; 44 - const unsigned int nconfigs; 45 - }; 46 - 47 528 #define ASPEED_PINCTRL_PIN(name_) \ 48 529 [name_] = { \ 49 530 .number = name_, \ ··· 35 548 .drv_data = (void *) &(PIN_SYM(name_)) \ 36 549 } 37 550 38 - struct aspeed_pin_group { 39 - const char *name; 40 - const unsigned int *pins; 551 + struct aspeed_pinctrl_data { 552 + struct regmap *scu; 553 + 554 + const struct pinctrl_pin_desc *pins; 41 555 const unsigned int npins; 556 + 557 + const struct aspeed_pin_config *configs; 558 + const unsigned int nconfigs; 559 + 560 + struct aspeed_pinmux_data pinmux; 42 561 }; 43 562 44 - #define ASPEED_PINCTRL_GROUP(name_) { \ 45 - .name = #name_, \ 46 - .pins = &(PIN_GROUP_SYM(name_))[0], \ 47 - .npins = ARRAY_SIZE(PIN_GROUP_SYM(name_)), \ 48 - } 49 - 50 - struct aspeed_pin_function { 51 - const char *name; 52 - const char *const *groups; 53 - unsigned int ngroups; 54 - }; 55 - 56 - #define ASPEED_PINCTRL_FUNC(name_, ...) { \ 57 - .name = #name_, \ 58 - .groups = &FUNC_GROUP_SYM(name_)[0], \ 59 - .ngroups = ARRAY_SIZE(FUNC_GROUP_SYM(name_)), \ 60 - } 61 - 563 + /* Aspeed pinctrl helpers */ 62 564 int aspeed_pinctrl_get_groups_count(struct pinctrl_dev *pctldev); 63 565 const char *aspeed_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 64 566 unsigned int group);
+96
drivers/pinctrl/aspeed/pinmux-aspeed.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* Copyright (C) 2019 IBM Corp. */ 3 + 4 + /* Pieces to enable drivers to implement the .set callback */ 5 + 6 + #include "pinmux-aspeed.h" 7 + 8 + const char *const aspeed_pinmux_ips[] = { 9 + [ASPEED_IP_SCU] = "SCU", 10 + [ASPEED_IP_GFX] = "GFX", 11 + [ASPEED_IP_LPC] = "LPC", 12 + }; 13 + 14 + static inline void aspeed_sig_desc_print_val( 15 + const struct aspeed_sig_desc *desc, bool enable, u32 rv) 16 + { 17 + pr_debug("Want %s%X[0x%08X]=0x%X, got 0x%X from 0x%08X\n", 18 + aspeed_pinmux_ips[desc->ip], desc->reg, 19 + desc->mask, enable ? desc->enable : desc->disable, 20 + (rv & desc->mask) >> __ffs(desc->mask), rv); 21 + } 22 + 23 + /** 24 + * Query the enabled or disabled state of a signal descriptor 25 + * 26 + * @desc: The signal descriptor of interest 27 + * @enabled: True to query the enabled state, false to query disabled state 28 + * @map: The IP block's regmap instance 29 + * 30 + * Return: 1 if the descriptor's bitfield is configured to the state 31 + * selected by @enabled, 0 if not, and less than zero if an unrecoverable 32 + * failure occurred 33 + * 34 + * Evaluation of descriptor state is non-trivial in that it is not a binary 35 + * outcome: The bitfields can be greater than one bit in size and thus can take 36 + * a value that is neither the enabled nor disabled state recorded in the 37 + * descriptor (typically this means a different function to the one of interest 38 + * is enabled). Thus we must explicitly test for either condition as required. 39 + */ 40 + int aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc, 41 + bool enabled, struct regmap *map) 42 + { 43 + int ret; 44 + unsigned int raw; 45 + u32 want; 46 + 47 + if (!map) 48 + return -ENODEV; 49 + 50 + ret = regmap_read(map, desc->reg, &raw); 51 + if (ret) 52 + return ret; 53 + 54 + aspeed_sig_desc_print_val(desc, enabled, raw); 55 + want = enabled ? desc->enable : desc->disable; 56 + 57 + return ((raw & desc->mask) >> __ffs(desc->mask)) == want; 58 + } 59 + 60 + /** 61 + * Query the enabled or disabled state for a mux function's signal on a pin 62 + * 63 + * @ctx: The driver context for the pinctrl IP 64 + * @expr: An expression controlling the signal for a mux function on a pin 65 + * @enabled: True to query the enabled state, false to query disabled state 66 + * 67 + * Return: 1 if the expression composed by @enabled evaluates true, 0 if not, 68 + * and less than zero if an unrecoverable failure occurred. 69 + * 70 + * A mux function is enabled or disabled if the function's signal expression 71 + * for each pin in the function's pin group evaluates true for the desired 72 + * state. An signal expression evaluates true if all of its associated signal 73 + * descriptors evaluate true for the desired state. 74 + * 75 + * If an expression's state is described by more than one bit, either through 76 + * multi-bit bitfields in a single signal descriptor or through multiple signal 77 + * descriptors of a single bit then it is possible for the expression to be in 78 + * neither the enabled nor disabled state. Thus we must explicitly test for 79 + * either condition as required. 80 + */ 81 + int aspeed_sig_expr_eval(const struct aspeed_pinmux_data *ctx, 82 + const struct aspeed_sig_expr *expr, bool enabled) 83 + { 84 + int i; 85 + int ret; 86 + 87 + for (i = 0; i < expr->ndescs; i++) { 88 + const struct aspeed_sig_desc *desc = &expr->descs[i]; 89 + 90 + ret = aspeed_sig_desc_eval(desc, enabled, ctx->maps[desc->ip]); 91 + if (ret <= 0) 92 + return ret; 93 + } 94 + 95 + return 1; 96 + }
+735
drivers/pinctrl/aspeed/pinmux-aspeed.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* Copyright (C) 2019 IBM Corp. */ 3 + 4 + #ifndef ASPEED_PINMUX_H 5 + #define ASPEED_PINMUX_H 6 + 7 + #include <linux/regmap.h> 8 + #include <stdbool.h> 9 + 10 + /* 11 + * The ASPEED SoCs provide typically more than 200 pins for GPIO and other 12 + * functions. The SoC function enabled on a pin is determined on a priority 13 + * basis where a given pin can provide a number of different signal types. 14 + * 15 + * The signal active on a pin is described by both a priority level and 16 + * compound logical expressions involving multiple operators, registers and 17 + * bits. Some difficulty arises as the pin's function bit masks for each 18 + * priority level are frequently not the same (i.e. cannot just flip a bit to 19 + * change from a high to low priority signal), or even in the same register. 20 + * Further, not all signals can be unmuxed, as some expressions depend on 21 + * values in the hardware strapping register (which may be treated as 22 + * read-only). 23 + * 24 + * SoC Multi-function Pin Expression Examples 25 + * ------------------------------------------ 26 + * 27 + * Here are some sample mux configurations from the AST2400 and AST2500 28 + * datasheets to illustrate the corner cases, roughly in order of least to most 29 + * corner. The signal priorities are in decending order from P0 (highest). 30 + * 31 + * D6 is a pin with a single function (beside GPIO); a high priority signal 32 + * that participates in one function: 33 + * 34 + * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 35 + * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 36 + * D6 GPIOA0 MAC1LINK SCU80[0]=1 GPIOA0 37 + * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 38 + * 39 + * C5 is a multi-signal pin (high and low priority signals). Here we touch 40 + * different registers for the different functions that enable each signal: 41 + * 42 + * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 43 + * C5 GPIOA4 SCL9 SCU90[22]=1 TIMER5 SCU80[4]=1 GPIOA4 44 + * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 45 + * 46 + * E19 is a single-signal pin with two functions that influence the active 47 + * signal. In this case both bits have the same meaning - enable a dedicated 48 + * LPC reset pin. However it's not always the case that the bits in the 49 + * OR-relationship have the same meaning. 50 + * 51 + * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 52 + * E19 GPIOB4 LPCRST# SCU80[12]=1 | Strap[14]=1 GPIOB4 53 + * -----+---------+-----------+-----------------------------+-----------+---------------+---------- 54 + * 55 + * For example, pin B19 has a low-priority signal that's enabled by two 56 + * distinct SoC functions: A specific SIOPBI bit in register SCUA4, and an ACPI 57 + * bit in the STRAP register. The ACPI bit configures signals on pins in 58 + * addition to B19. Both of the low priority functions as well as the high 59 + * priority function must be disabled for GPIOF1 to be used. 60 + * 61 + * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 62 + * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 63 + * B19 GPIOF1 NDCD4 SCU80[25]=1 SIOPBI# SCUA4[12]=1 | Strap[19]=0 GPIOF1 64 + * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 65 + * 66 + * For pin E18, the SoC ANDs the expected state of three bits to determine the 67 + * pin's active signal: 68 + * 69 + * * SCU3C[3]: Enable external SOC reset function 70 + * * SCU80[15]: Enable SPICS1# or EXTRST# function pin 71 + * * SCU90[31]: Select SPI interface CS# output 72 + * 73 + * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 74 + * E18 GPIOB7 EXTRST# SCU3C[3]=1 & SCU80[15]=1 & SCU90[31]=0 SPICS1# SCU3C[3]=1 & SCU80[15]=1 & SCU90[31]=1 GPIOB7 75 + * -----+---------+-----------+-----------------------------------------+-----------+----------------------------------------+---------- 76 + * 77 + * (Bits SCU3C[3] and SCU80[15] appear to only be used in the expressions for 78 + * selecting the signals on pin E18) 79 + * 80 + * Pin T5 is a multi-signal pin with a more complex configuration: 81 + * 82 + * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 83 + * -----+---------+-----------+------------------------------+-----------+---------------+---------- 84 + * T5 GPIOL1 VPIDE SCU90[5:4]!=0 & SCU84[17]=1 NDCD1 SCU84[17]=1 GPIOL1 85 + * -----+---------+-----------+------------------------------+-----------+---------------+---------- 86 + * 87 + * The high priority signal configuration is best thought of in terms of its 88 + * exploded form, with reference to the SCU90[5:4] bits: 89 + * 90 + * * SCU90[5:4]=00: disable 91 + * * SCU90[5:4]=01: 18 bits (R6/G6/B6) video mode. 92 + * * SCU90[5:4]=10: 24 bits (R8/G8/B8) video mode. 93 + * * SCU90[5:4]=11: 30 bits (R10/G10/B10) video mode. 94 + * 95 + * Re-writing: 96 + * 97 + * -----+---------+-----------+------------------------------+-----------+---------------+---------- 98 + * T5 GPIOL1 VPIDE (SCU90[5:4]=1 & SCU84[17]=1) NDCD1 SCU84[17]=1 GPIOL1 99 + * | (SCU90[5:4]=2 & SCU84[17]=1) 100 + * | (SCU90[5:4]=3 & SCU84[17]=1) 101 + * -----+---------+-----------+------------------------------+-----------+---------------+---------- 102 + * 103 + * For reference the SCU84[17] bit configure the "UART1 NDCD1 or Video VPIDE 104 + * function pin", where the signal itself is determined by whether SCU94[5:4] 105 + * is disabled or in one of the 18, 24 or 30bit video modes. 106 + * 107 + * Other video-input-related pins require an explicit state in SCU90[5:4], e.g. 108 + * W1 and U5: 109 + * 110 + * -----+---------+-----------+------------------------------+-----------+---------------+---------- 111 + * W1 GPIOL6 VPIB0 SCU90[5:4]=3 & SCU84[22]=1 TXD1 SCU84[22]=1 GPIOL6 112 + * U5 GPIOL7 VPIB1 SCU90[5:4]=3 & SCU84[23]=1 RXD1 SCU84[23]=1 GPIOL7 113 + * -----+---------+-----------+------------------------------+-----------+---------------+---------- 114 + * 115 + * The examples of T5 and W1 are particularly fertile, as they also demonstrate 116 + * that despite operating as part of the video input bus each signal needs to 117 + * be enabled individually via it's own SCU84 (in the cases of T5 and W1) 118 + * register bit. This is a little crazy if the bus doesn't have optional 119 + * signals, but is used to decent effect with some of the UARTs where not all 120 + * signals are required. However, this isn't done consistently - UART1 is 121 + * enabled on a per-pin basis, and by contrast, all signals for UART6 are 122 + * enabled by a single bit. 123 + * 124 + * Further, the high and low priority signals listed in the table above share 125 + * a configuration bit. The VPI signals should operate in concert in a single 126 + * function, but the UART signals should retain the ability to be configured 127 + * independently. This pushes the implementation down the path of tagging a 128 + * signal's expressions with the function they participate in, rather than 129 + * defining masks affecting multiple signals per function. The latter approach 130 + * fails in this instance where applying the configuration for the UART pin of 131 + * interest will stomp on the state of other UART signals when disabling the 132 + * VPI functions on the current pin. 133 + * 134 + * Ball | Default | P0 Signal | P0 Expression | P1 Signal | P1 Expression | Other 135 + * -----+------------+-----------+---------------------------+-----------+---------------+------------ 136 + * A12 RGMII1TXCK GPIOT0 SCUA0[0]=1 RMII1TXEN Strap[6]=0 RGMII1TXCK 137 + * B12 RGMII1TXCTL GPIOT1 SCUA0[1]=1 – Strap[6]=0 RGMII1TXCTL 138 + * -----+------------+-----------+---------------------------+-----------+---------------+------------ 139 + * 140 + * A12 demonstrates that the "Other" signal isn't always GPIO - in this case 141 + * GPIOT0 is a high-priority signal and RGMII1TXCK is Other. Thus, GPIO 142 + * should be treated like any other signal type with full function expression 143 + * requirements, and not assumed to be the default case. Separately, GPIOT0 and 144 + * GPIOT1's signal descriptor bits are distinct, therefore we must iterate all 145 + * pins in the function's group to disable the higher-priority signals such 146 + * that the signal for the function of interest is correctly enabled. 147 + * 148 + * Finally, three priority levels aren't always enough; the AST2500 brings with 149 + * it 18 pins of five priority levels, however the 18 pins only use three of 150 + * the five priority levels. 151 + * 152 + * Ultimately the requirement to control pins in the examples above drive the 153 + * design: 154 + * 155 + * * Pins provide signals according to functions activated in the mux 156 + * configuration 157 + * 158 + * * Pins provide up to five signal types in a priority order 159 + * 160 + * * For priorities levels defined on a pin, each priority provides one signal 161 + * 162 + * * Enabling lower priority signals requires higher priority signals be 163 + * disabled 164 + * 165 + * * A function represents a set of signals; functions are distinct if their 166 + * sets of signals are not equal 167 + * 168 + * * Signals participate in one or more functions 169 + * 170 + * * A function is described by an expression of one or more signal 171 + * descriptors, which compare bit values in a register 172 + * 173 + * * A signal expression is the smallest set of signal descriptors whose 174 + * comparisons must evaluate 'true' for a signal to be enabled on a pin. 175 + * 176 + * * A signal participating in a function is active on a pin if evaluating all 177 + * signal descriptors in the pin's signal expression for the function yields 178 + * a 'true' result 179 + * 180 + * * A signal at a given priority on a given pin is active if any of the 181 + * functions in which the signal participates are active, and no higher 182 + * priority signal on the pin is active 183 + * 184 + * * GPIO is configured per-pin 185 + * 186 + * And so: 187 + * 188 + * * To disable a signal, any function(s) activating the signal must be 189 + * disabled 190 + * 191 + * * Each pin must know the signal expressions of functions in which it 192 + * participates, for the purpose of enabling the Other function. This is done 193 + * by deactivating all functions that activate higher priority signals on the 194 + * pin. 195 + * 196 + * As a concrete example: 197 + * 198 + * * T5 provides three signals types: VPIDE, NDCD1 and GPIO 199 + * 200 + * * The VPIDE signal participates in 3 functions: VPI18, VPI24 and VPI30 201 + * 202 + * * The NDCD1 signal participates in just its own NDCD1 function 203 + * 204 + * * VPIDE is high priority, NDCD1 is low priority, and GPIOL1 is the least 205 + * prioritised 206 + * 207 + * * The prerequisit for activating the NDCD1 signal is that the VPI18, VPI24 208 + * and VPI30 functions all be disabled 209 + * 210 + * * Similarly, all of VPI18, VPI24, VPI30 and NDCD1 functions must be disabled 211 + * to provide GPIOL6 212 + * 213 + * Considerations 214 + * -------------- 215 + * 216 + * If pinctrl allows us to allocate a pin we can configure a function without 217 + * concern for the function of already allocated pins, if pin groups are 218 + * created with respect to the SoC functions in which they participate. This is 219 + * intuitive, but it did not feel obvious from the bit/pin relationships. 220 + * 221 + * Conversely, failing to allocate all pins in a group indicates some bits (as 222 + * well as pins) required for the group's configuration will already be in use, 223 + * likely in a way that's inconsistent with the requirements of the failed 224 + * group. 225 + * 226 + * Implementation 227 + * -------------- 228 + * 229 + * Beyond the documentation below the various structures and helper macros that 230 + * allow the implementation to hang together are defined. The macros are fairly 231 + * dense, so below we walk through some raw examples of the configuration 232 + * tables in an effort to clarify the concepts. 233 + * 234 + * The complexity of configuring the mux combined with the scale of the pins 235 + * and functions was a concern, so the table design along with the macro jungle 236 + * is an attempt to address it. The rough principles of the approach are: 237 + * 238 + * 1. Use a data-driven solution rather than embedding state into code 239 + * 2. Minimise editing to the specifics of the given mux configuration 240 + * 3. Detect as many errors as possible at compile time 241 + * 242 + * Addressing point 3 leads to naming of symbols in terms of the four 243 + * properties associated with a given mux configuration: The pin, the signal, 244 + * the group and the function. In this way copy/paste errors cause duplicate 245 + * symbols to be defined, which prevents successful compilation. Failing to 246 + * properly parent the tables leads to unused symbol warnings, and use of 247 + * designated initialisers and additional warnings ensures that there are 248 + * no override errors in the pin, group and function arrays. 249 + * 250 + * Addressing point 2 drives the development of the macro jungle, as it 251 + * centralises the definition noise at the cost of taking some time to 252 + * understand. 253 + * 254 + * Here's a complete, concrete "pre-processed" example of the table structures 255 + * used to describe the D6 ball from the examples above: 256 + * 257 + * ``` 258 + * static const struct aspeed_sig_desc sig_descs_MAC1LINK_MAC1LINK[] = { 259 + * { 260 + * .ip = ASPEED_IP_SCU, 261 + * .reg = 0x80, 262 + * .mask = BIT(0), 263 + * .enable = 1, 264 + * .disable = 0 265 + * }, 266 + * }; 267 + * 268 + * static const struct aspeed_sig_expr sig_expr_MAC1LINK_MAC1LINK = { 269 + * .signal = "MAC1LINK", 270 + * .function = "MAC1LINK", 271 + * .ndescs = ARRAY_SIZE(sig_descs_MAC1LINK_MAC1LINK), 272 + * .descs = &(sig_descs_MAC1LINK_MAC1LINK)[0], 273 + * }; 274 + * 275 + * static const struct aspeed_sig_expr *sig_exprs_MAC1LINK_MAC1LINK[] = { 276 + * &sig_expr_MAC1LINK_MAC1LINK, 277 + * NULL, 278 + * }; 279 + * 280 + * static const struct aspeed_sig_desc sig_descs_GPIOA0_GPIOA0[] = { }; 281 + * 282 + * static const struct aspeed_sig_expr sig_expr_GPIOA0_GPIOA0 = { 283 + * .signal = "GPIOA0", 284 + * .function = "GPIOA0", 285 + * .ndescs = ARRAY_SIZE(sig_descs_GPIOA0_GPIOA0), 286 + * .descs = &(sig_descs_GPIOA0_GPIOA0)[0], 287 + * }; 288 + * 289 + * static const struct aspeed_sig_expr *sig_exprs_GPIOA0_GPIOA0[] = { 290 + * &sig_expr_GPIOA0_GPIOA0, 291 + * NULL 292 + * }; 293 + * 294 + * static const struct aspeed_sig_expr **pin_exprs_0[] = { 295 + * sig_exprs_MAC1LINK_MAC1LINK, 296 + * sig_exprs_GPIOA0_GPIOA0, 297 + * NULL 298 + * }; 299 + * 300 + * static const struct aspeed_pin_desc pin_0 = { "0", (&pin_exprs_0[0]) }; 301 + * static const int group_pins_MAC1LINK[] = { 0 }; 302 + * static const char *func_groups_MAC1LINK[] = { "MAC1LINK" }; 303 + * 304 + * static struct pinctrl_pin_desc aspeed_g4_pins[] = { 305 + * [0] = { .number = 0, .name = "D6", .drv_data = &pin_0 }, 306 + * }; 307 + * 308 + * static const struct aspeed_pin_group aspeed_g4_groups[] = { 309 + * { 310 + * .name = "MAC1LINK", 311 + * .pins = &(group_pins_MAC1LINK)[0], 312 + * .npins = ARRAY_SIZE(group_pins_MAC1LINK), 313 + * }, 314 + * }; 315 + * 316 + * static const struct aspeed_pin_function aspeed_g4_functions[] = { 317 + * { 318 + * .name = "MAC1LINK", 319 + * .groups = &func_groups_MAC1LINK[0], 320 + * .ngroups = ARRAY_SIZE(func_groups_MAC1LINK), 321 + * }, 322 + * }; 323 + * ``` 324 + * 325 + * At the end of the day much of the above code is compressed into the 326 + * following two lines: 327 + * 328 + * ``` 329 + * #define D6 0 330 + * SSSF_PIN_DECL(D6, GPIOA0, MAC1LINK, SIG_DESC_SET(SCU80, 0)); 331 + * ``` 332 + * 333 + * The two examples below show just the differences from the example above. 334 + * 335 + * Ball E18 demonstrates a function, EXTRST, that requires multiple descriptors 336 + * be set for it to be muxed: 337 + * 338 + * ``` 339 + * static const struct aspeed_sig_desc sig_descs_EXTRST_EXTRST[] = { 340 + * { 341 + * .ip = ASPEED_IP_SCU, 342 + * .reg = 0x3C, 343 + * .mask = BIT(3), 344 + * .enable = 1, 345 + * .disable = 0 346 + * }, 347 + * { 348 + * .ip = ASPEED_IP_SCU, 349 + * .reg = 0x80, 350 + * .mask = BIT(15), 351 + * .enable = 1, 352 + * .disable = 0 353 + * }, 354 + * { 355 + * .ip = ASPEED_IP_SCU, 356 + * .reg = 0x90, 357 + * .mask = BIT(31), 358 + * .enable = 0, 359 + * .disable = 1 360 + * }, 361 + * }; 362 + * 363 + * static const struct aspeed_sig_expr sig_expr_EXTRST_EXTRST = { 364 + * .signal = "EXTRST", 365 + * .function = "EXTRST", 366 + * .ndescs = ARRAY_SIZE(sig_descs_EXTRST_EXTRST), 367 + * .descs = &(sig_descs_EXTRST_EXTRST)[0], 368 + * }; 369 + * ... 370 + * ``` 371 + * 372 + * For ball E19, we have multiple functions enabling a single signal, LPCRST#. 373 + * The data structures look like: 374 + * 375 + * static const struct aspeed_sig_desc sig_descs_LPCRST_LPCRST[] = { 376 + * { 377 + * .ip = ASPEED_IP_SCU, 378 + * .reg = 0x80, 379 + * .mask = BIT(12), 380 + * .enable = 1, 381 + * .disable = 0 382 + * }, 383 + * }; 384 + * 385 + * static const struct aspeed_sig_expr sig_expr_LPCRST_LPCRST = { 386 + * .signal = "LPCRST", 387 + * .function = "LPCRST", 388 + * .ndescs = ARRAY_SIZE(sig_descs_LPCRST_LPCRST), 389 + * .descs = &(sig_descs_LPCRST_LPCRST)[0], 390 + * }; 391 + * 392 + * static const struct aspeed_sig_desc sig_descs_LPCRST_LPCRSTS[] = { 393 + * { 394 + * .ip = ASPEED_IP_SCU, 395 + * .reg = 0x70, 396 + * .mask = BIT(14), 397 + * .enable = 1, 398 + * .disable = 0 399 + * }, 400 + * }; 401 + * 402 + * static const struct aspeed_sig_expr sig_expr_LPCRST_LPCRSTS = { 403 + * .signal = "LPCRST", 404 + * .function = "LPCRSTS", 405 + * .ndescs = ARRAY_SIZE(sig_descs_LPCRST_LPCRSTS), 406 + * .descs = &(sig_descs_LPCRST_LPCRSTS)[0], 407 + * }; 408 + * 409 + * static const struct aspeed_sig_expr *sig_exprs_LPCRST_LPCRST[] = { 410 + * &sig_expr_LPCRST_LPCRST, 411 + * &sig_expr_LPCRST_LPCRSTS, 412 + * NULL, 413 + * }; 414 + * ... 415 + * ``` 416 + * 417 + * Both expressions listed in the sig_exprs_LPCRST_LPCRST array need to be set 418 + * to disabled for the associated GPIO to be muxed. 419 + * 420 + */ 421 + 422 + #define ASPEED_IP_SCU 0 423 + #define ASPEED_IP_GFX 1 424 + #define ASPEED_IP_LPC 2 425 + #define ASPEED_NR_PINMUX_IPS 3 426 + 427 + /** 428 + * A signal descriptor, which describes the register, bits and the 429 + * enable/disable values that should be compared or written. 430 + * 431 + * @ip: The IP block identifier, used as an index into the regmap array in 432 + * struct aspeed_pinctrl_data 433 + * @reg: The register offset with respect to the base address of the IP block 434 + * @mask: The mask to apply to the register. The lowest set bit of the mask is 435 + * used to derive the shift value. 436 + * @enable: The value that enables the function. Value should be in the LSBs, 437 + * not at the position of the mask. 438 + * @disable: The value that disables the function. Value should be in the 439 + * LSBs, not at the position of the mask. 440 + */ 441 + struct aspeed_sig_desc { 442 + unsigned int ip; 443 + unsigned int reg; 444 + u32 mask; 445 + u32 enable; 446 + u32 disable; 447 + }; 448 + 449 + /** 450 + * Describes a signal expression. The expression is evaluated by ANDing the 451 + * evaluation of the descriptors. 452 + * 453 + * @signal: The signal name for the priority level on the pin. If the signal 454 + * type is GPIO, then the signal name must begin with the string 455 + * "GPIO", e.g. GPIOA0, GPIOT4 etc. 456 + * @function: The name of the function the signal participates in for the 457 + * associated expression 458 + * @ndescs: The number of signal descriptors in the expression 459 + * @descs: Pointer to an array of signal descriptors that comprise the 460 + * function expression 461 + */ 462 + struct aspeed_sig_expr { 463 + const char *signal; 464 + const char *function; 465 + int ndescs; 466 + const struct aspeed_sig_desc *descs; 467 + }; 468 + 469 + /** 470 + * A struct capturing the list of expressions enabling signals at each priority 471 + * for a given pin. The signal configuration for a priority level is evaluated 472 + * by ORing the evaluation of the signal expressions in the respective 473 + * priority's list. 474 + * 475 + * @name: A name for the pin 476 + * @prios: A pointer to an array of expression list pointers 477 + * 478 + */ 479 + struct aspeed_pin_desc { 480 + const char *name; 481 + const struct aspeed_sig_expr ***prios; 482 + }; 483 + 484 + /* Macro hell */ 485 + 486 + #define SIG_DESC_IP_BIT(ip, reg, idx, val) \ 487 + { ip, reg, BIT_MASK(idx), val, (((val) + 1) & 1) } 488 + 489 + /** 490 + * Short-hand macro for describing an SCU descriptor enabled by the state of 491 + * one bit. The disable value is derived. 492 + * 493 + * @reg: The signal's associated register, offset from base 494 + * @idx: The signal's bit index in the register 495 + * @val: The value (0 or 1) that enables the function 496 + */ 497 + #define SIG_DESC_BIT(reg, idx, val) \ 498 + SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, val) 499 + 500 + #define SIG_DESC_IP_SET(ip, reg, idx) SIG_DESC_IP_BIT(ip, reg, idx, 1) 501 + 502 + /** 503 + * A further short-hand macro expanding to an SCU descriptor enabled by a set 504 + * bit. 505 + * 506 + * @reg: The register, offset from base 507 + * @idx: The bit index in the register 508 + */ 509 + #define SIG_DESC_SET(reg, idx) SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, 1) 510 + 511 + #define SIG_DESC_LIST_SYM(sig, func) sig_descs_ ## sig ## _ ## func 512 + #define SIG_DESC_LIST_DECL(sig, func, ...) \ 513 + static const struct aspeed_sig_desc SIG_DESC_LIST_SYM(sig, func)[] = \ 514 + { __VA_ARGS__ } 515 + 516 + #define SIG_EXPR_SYM(sig, func) sig_expr_ ## sig ## _ ## func 517 + #define SIG_EXPR_DECL_(sig, func) \ 518 + static const struct aspeed_sig_expr SIG_EXPR_SYM(sig, func) = \ 519 + { \ 520 + .signal = #sig, \ 521 + .function = #func, \ 522 + .ndescs = ARRAY_SIZE(SIG_DESC_LIST_SYM(sig, func)), \ 523 + .descs = &(SIG_DESC_LIST_SYM(sig, func))[0], \ 524 + } 525 + 526 + /** 527 + * Declare a signal expression. 528 + * 529 + * @sig: A macro symbol name for the signal (is subjected to stringification 530 + * and token pasting) 531 + * @func: The function in which the signal is participating 532 + * @...: Signal descriptors that define the signal expression 533 + * 534 + * For example, the following declares the ROMD8 signal for the ROM16 function: 535 + * 536 + * SIG_EXPR_DECL(ROMD8, ROM16, SIG_DESC_SET(SCU90, 6)); 537 + * 538 + * And with multiple signal descriptors: 539 + * 540 + * SIG_EXPR_DECL(ROMD8, ROM16S, SIG_DESC_SET(HW_STRAP1, 4), 541 + * { HW_STRAP1, GENMASK(1, 0), 0, 0 }); 542 + */ 543 + #define SIG_EXPR_DECL(sig, func, ...) \ 544 + SIG_DESC_LIST_DECL(sig, func, __VA_ARGS__); \ 545 + SIG_EXPR_DECL_(sig, func) 546 + 547 + /** 548 + * Declare a pointer to a signal expression 549 + * 550 + * @sig: The macro symbol name for the signal (subjected to token pasting) 551 + * @func: The macro symbol name for the function (subjected to token pasting) 552 + */ 553 + #define SIG_EXPR_PTR(sig, func) (&SIG_EXPR_SYM(sig, func)) 554 + 555 + #define SIG_EXPR_LIST_SYM(sig) sig_exprs_ ## sig 556 + 557 + /** 558 + * Declare a signal expression list for reference in a struct aspeed_pin_prio. 559 + * 560 + * @sig: A macro symbol name for the signal (is subjected to token pasting) 561 + * @...: Signal expression structure pointers (use SIG_EXPR_PTR()) 562 + * 563 + * For example, the 16-bit ROM bus can be enabled by one of two possible signal 564 + * expressions: 565 + * 566 + * SIG_EXPR_DECL(ROMD8, ROM16, SIG_DESC_SET(SCU90, 6)); 567 + * SIG_EXPR_DECL(ROMD8, ROM16S, SIG_DESC_SET(HW_STRAP1, 4), 568 + * { HW_STRAP1, GENMASK(1, 0), 0, 0 }); 569 + * SIG_EXPR_LIST_DECL(ROMD8, SIG_EXPR_PTR(ROMD8, ROM16), 570 + * SIG_EXPR_PTR(ROMD8, ROM16S)); 571 + */ 572 + #define SIG_EXPR_LIST_DECL(sig, ...) \ 573 + static const struct aspeed_sig_expr *SIG_EXPR_LIST_SYM(sig)[] = \ 574 + { __VA_ARGS__, NULL } 575 + 576 + /** 577 + * A short-hand macro for declaring a function expression and an expression 578 + * list with a single function. 579 + * 580 + * @func: A macro symbol name for the function (is subjected to token pasting) 581 + * @...: Function descriptors that define the function expression 582 + * 583 + * For example, signal NCTS6 participates in its own function with one group: 584 + * 585 + * SIG_EXPR_LIST_DECL_SINGLE(NCTS6, NCTS6, SIG_DESC_SET(SCU90, 7)); 586 + */ 587 + #define SIG_EXPR_LIST_DECL_SINGLE(sig, func, ...) \ 588 + SIG_DESC_LIST_DECL(sig, func, __VA_ARGS__); \ 589 + SIG_EXPR_DECL_(sig, func); \ 590 + SIG_EXPR_LIST_DECL(sig, SIG_EXPR_PTR(sig, func)) 591 + 592 + #define SIG_EXPR_LIST_DECL_DUAL(sig, f0, f1) \ 593 + SIG_EXPR_LIST_DECL(sig, SIG_EXPR_PTR(sig, f0), SIG_EXPR_PTR(sig, f1)) 594 + 595 + #define SIG_EXPR_LIST_PTR(sig) (&SIG_EXPR_LIST_SYM(sig)[0]) 596 + 597 + #define PIN_EXPRS_SYM(pin) pin_exprs_ ## pin 598 + #define PIN_EXPRS_PTR(pin) (&PIN_EXPRS_SYM(pin)[0]) 599 + #define PIN_SYM(pin) pin_ ## pin 600 + 601 + #define MS_PIN_DECL_(pin, ...) \ 602 + static const struct aspeed_sig_expr **PIN_EXPRS_SYM(pin)[] = \ 603 + { __VA_ARGS__, NULL }; \ 604 + static const struct aspeed_pin_desc PIN_SYM(pin) = \ 605 + { #pin, PIN_EXPRS_PTR(pin) } 606 + 607 + /** 608 + * Declare a multi-signal pin 609 + * 610 + * @pin: The pin number 611 + * @other: Macro name for "other" functionality (subjected to stringification) 612 + * @high: Macro name for the highest priority signal functions 613 + * @low: Macro name for the low signal functions 614 + * 615 + * For example: 616 + * 617 + * #define A8 56 618 + * SIG_EXPR_DECL(ROMD8, ROM16, SIG_DESC_SET(SCU90, 6)); 619 + * SIG_EXPR_DECL(ROMD8, ROM16S, SIG_DESC_SET(HW_STRAP1, 4), 620 + * { HW_STRAP1, GENMASK(1, 0), 0, 0 }); 621 + * SIG_EXPR_LIST_DECL(ROMD8, SIG_EXPR_PTR(ROMD8, ROM16), 622 + * SIG_EXPR_PTR(ROMD8, ROM16S)); 623 + * SIG_EXPR_LIST_DECL_SINGLE(NCTS6, NCTS6, SIG_DESC_SET(SCU90, 7)); 624 + * MS_PIN_DECL(A8, GPIOH0, ROMD8, NCTS6); 625 + */ 626 + #define MS_PIN_DECL(pin, other, high, low) \ 627 + SIG_EXPR_LIST_DECL_SINGLE(other, other); \ 628 + MS_PIN_DECL_(pin, \ 629 + SIG_EXPR_LIST_PTR(high), \ 630 + SIG_EXPR_LIST_PTR(low), \ 631 + SIG_EXPR_LIST_PTR(other)) 632 + 633 + #define PIN_GROUP_SYM(func) pins_ ## func 634 + #define FUNC_GROUP_SYM(func) groups_ ## func 635 + #define FUNC_GROUP_DECL(func, ...) \ 636 + static const int PIN_GROUP_SYM(func)[] = { __VA_ARGS__ }; \ 637 + static const char *FUNC_GROUP_SYM(func)[] = { #func } 638 + 639 + /** 640 + * Declare a single signal pin 641 + * 642 + * @pin: The pin number 643 + * @other: Macro name for "other" functionality (subjected to stringification) 644 + * @sig: Macro name for the signal (subjected to stringification) 645 + * 646 + * For example: 647 + * 648 + * #define E3 80 649 + * SIG_EXPR_LIST_DECL_SINGLE(SCL5, I2C5, I2C5_DESC); 650 + * SS_PIN_DECL(E3, GPIOK0, SCL5); 651 + */ 652 + #define SS_PIN_DECL(pin, other, sig) \ 653 + SIG_EXPR_LIST_DECL_SINGLE(other, other); \ 654 + MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(sig), SIG_EXPR_LIST_PTR(other)) 655 + 656 + /** 657 + * Single signal, single function pin declaration 658 + * 659 + * @pin: The pin number 660 + * @other: Macro name for "other" functionality (subjected to stringification) 661 + * @sig: Macro name for the signal (subjected to stringification) 662 + * @...: Signal descriptors that define the function expression 663 + * 664 + * For example: 665 + * 666 + * SSSF_PIN_DECL(A4, GPIOA2, TIMER3, SIG_DESC_SET(SCU80, 2)); 667 + */ 668 + #define SSSF_PIN_DECL(pin, other, sig, ...) \ 669 + SIG_EXPR_LIST_DECL_SINGLE(sig, sig, __VA_ARGS__); \ 670 + SIG_EXPR_LIST_DECL_SINGLE(other, other); \ 671 + MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(sig), SIG_EXPR_LIST_PTR(other)); \ 672 + FUNC_GROUP_DECL(sig, pin) 673 + 674 + #define GPIO_PIN_DECL(pin, gpio) \ 675 + SIG_EXPR_LIST_DECL_SINGLE(gpio, gpio); \ 676 + MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(gpio)) 677 + 678 + struct aspeed_pin_group { 679 + const char *name; 680 + const unsigned int *pins; 681 + const unsigned int npins; 682 + }; 683 + 684 + #define ASPEED_PINCTRL_GROUP(name_) { \ 685 + .name = #name_, \ 686 + .pins = &(PIN_GROUP_SYM(name_))[0], \ 687 + .npins = ARRAY_SIZE(PIN_GROUP_SYM(name_)), \ 688 + } 689 + 690 + struct aspeed_pin_function { 691 + const char *name; 692 + const char *const *groups; 693 + unsigned int ngroups; 694 + }; 695 + 696 + #define ASPEED_PINCTRL_FUNC(name_, ...) { \ 697 + .name = #name_, \ 698 + .groups = &FUNC_GROUP_SYM(name_)[0], \ 699 + .ngroups = ARRAY_SIZE(FUNC_GROUP_SYM(name_)), \ 700 + } 701 + 702 + struct aspeed_pinmux_data; 703 + 704 + struct aspeed_pinmux_ops { 705 + int (*set)(const struct aspeed_pinmux_data *ctx, 706 + const struct aspeed_sig_expr *expr, bool enabled); 707 + }; 708 + 709 + struct aspeed_pinmux_data { 710 + struct regmap *maps[ASPEED_NR_PINMUX_IPS]; 711 + 712 + const struct aspeed_pinmux_ops *ops; 713 + 714 + const struct aspeed_pin_group *groups; 715 + const unsigned int ngroups; 716 + 717 + const struct aspeed_pin_function *functions; 718 + const unsigned int nfunctions; 719 + }; 720 + 721 + int aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc, bool enabled, 722 + struct regmap *map); 723 + 724 + int aspeed_sig_expr_eval(const struct aspeed_pinmux_data *ctx, 725 + const struct aspeed_sig_expr *expr, 726 + bool enabled); 727 + 728 + static inline int aspeed_sig_expr_set(const struct aspeed_pinmux_data *ctx, 729 + const struct aspeed_sig_expr *expr, 730 + bool enabled) 731 + { 732 + return ctx->ops->set(ctx, expr, enabled); 733 + } 734 + 735 + #endif /* ASPEED_PINMUX_H */
+5 -1
drivers/pinctrl/bcm/Kconfig
··· 18 18 framework. GPIO is provided by a separate GPIO driver. 19 19 20 20 config PINCTRL_BCM2835 21 - bool 21 + bool "Broadcom BCM2835 GPIO (with PINCONF) driver" 22 + depends on OF && (ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST) 22 23 select PINMUX 23 24 select PINCONF 24 25 select GENERIC_PINCONF 25 26 select GPIOLIB_IRQCHIP 27 + default ARCH_BCM2835 || ARCH_BRCMSTB 28 + help 29 + Say Y here to enable the Broadcom BCM2835 GPIO driver. 26 30 27 31 config PINCTRL_IPROC_GPIO 28 32 bool "Broadcom iProc GPIO (with PINCONF) driver"
+2
drivers/pinctrl/bcm/pinctrl-ns2-mux.c
··· 1048 1048 return PTR_ERR(pinctrl->base0); 1049 1049 1050 1050 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1051 + if (!res) 1052 + return -EINVAL; 1051 1053 pinctrl->base1 = devm_ioremap_nocache(&pdev->dev, res->start, 1052 1054 resource_size(res)); 1053 1055 if (!pinctrl->base1) {
+1 -5
drivers/pinctrl/cirrus/pinctrl-cs47l35.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Pinctrl for Cirrus Logic CS47L35 4 4 * 5 5 * Copyright (C) 2016-2017 Cirrus Logic 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; version 2. 10 6 */ 11 7 12 8 #include <linux/err.h>
+1 -5
drivers/pinctrl/cirrus/pinctrl-cs47l85.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Pinctrl for Cirrus Logic CS47L85 4 4 * 5 5 * Copyright (C) 2016-2017 Cirrus Logic 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; version 2. 10 6 */ 11 7 12 8 #include <linux/err.h>
+1 -5
drivers/pinctrl/cirrus/pinctrl-cs47l90.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Pinctrl for Cirrus Logic CS47L90 4 4 * 5 5 * Copyright (C) 2016-2017 Cirrus Logic 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; version 2. 10 6 */ 11 7 12 8 #include <linux/err.h>
+1 -5
drivers/pinctrl/cirrus/pinctrl-madera-core.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 3 * Pinctrl for Cirrus Logic Madera codecs 4 4 * 5 5 * Copyright (C) 2016-2018 Cirrus Logic 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; version 2. 10 6 */ 11 7 12 8 #include <linux/err.h>
+1 -5
drivers/pinctrl/cirrus/pinctrl-madera.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 /* 3 3 * Pinctrl for Cirrus Logic Madera codecs 4 4 * 5 5 * Copyright (C) 2016-2017 Cirrus Logic 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; version 2. 10 6 */ 11 7 12 8 #ifndef PINCTRL_MADERA_H
+17 -27
drivers/pinctrl/core.c
··· 98 98 */ 99 99 struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *devname) 100 100 { 101 - struct pinctrl_dev *pctldev = NULL; 101 + struct pinctrl_dev *pctldev; 102 102 103 103 if (!devname) 104 104 return NULL; ··· 176 176 177 177 return desc->name; 178 178 } 179 - 180 - /** 181 - * pin_is_valid() - check if pin exists on controller 182 - * @pctldev: the pin control device to check the pin on 183 - * @pin: pin to check, use the local pin controller index number 184 - * 185 - * This tells us whether a certain pin exist on a certain pin controller or 186 - * not. Pin lists may be sparse, so some pins may not exist. 187 - */ 188 - bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) 189 - { 190 - struct pin_desc *pindesc; 191 - 192 - if (pin < 0) 193 - return false; 194 - 195 - mutex_lock(&pctldev->mutex); 196 - pindesc = pin_desc_get(pctldev, pin); 197 - mutex_unlock(&pctldev->mutex); 198 - 199 - return pindesc != NULL; 200 - } 201 - EXPORT_SYMBOL_GPL(pin_is_valid); 202 179 203 180 /* Deletes a range of pin descriptors */ 204 181 static void pinctrl_free_pindescs(struct pinctrl_dev *pctldev, ··· 288 311 static struct pinctrl_gpio_range * 289 312 pinctrl_match_gpio_range(struct pinctrl_dev *pctldev, unsigned gpio) 290 313 { 291 - struct pinctrl_gpio_range *range = NULL; 314 + struct pinctrl_gpio_range *range; 292 315 293 316 mutex_lock(&pctldev->mutex); 294 317 /* Loop over the ranges */ ··· 368 391 struct pinctrl_dev **outdev, 369 392 struct pinctrl_gpio_range **outrange) 370 393 { 371 - struct pinctrl_dev *pctldev = NULL; 394 + struct pinctrl_dev *pctldev; 372 395 373 396 mutex_lock(&pinctrldev_list_mutex); 374 397 ··· 1192 1215 } 1193 1216 EXPORT_SYMBOL_GPL(pinctrl_lookup_state); 1194 1217 1218 + static void pinctrl_link_add(struct pinctrl_dev *pctldev, 1219 + struct device *consumer) 1220 + { 1221 + if (pctldev->desc->link_consumers) 1222 + device_link_add(consumer, pctldev->dev, 1223 + DL_FLAG_PM_RUNTIME | 1224 + DL_FLAG_AUTOREMOVE_CONSUMER); 1225 + } 1226 + 1195 1227 /** 1196 1228 * pinctrl_commit_state() - select/activate/program a pinctrl state to HW 1197 1229 * @p: the pinctrl handle for the device that requests configuration ··· 1246 1260 if (ret < 0) { 1247 1261 goto unapply_new_state; 1248 1262 } 1263 + 1264 + /* Do not link hogs (circular dependency) */ 1265 + if (p != setting->pctldev->p) 1266 + pinctrl_link_add(setting->pctldev, p->dev); 1249 1267 } 1250 1268 1251 1269 p->state = state; ··· 1655 1665 static int pinctrl_gpioranges_show(struct seq_file *s, void *what) 1656 1666 { 1657 1667 struct pinctrl_dev *pctldev = s->private; 1658 - struct pinctrl_gpio_range *range = NULL; 1668 + struct pinctrl_gpio_range *range; 1659 1669 1660 1670 seq_puts(s, "GPIO ranges handled:\n"); 1661 1671
+7
drivers/pinctrl/freescale/Kconfig
··· 130 130 help 131 131 Say Y here to enable the imx8mm pinctrl driver 132 132 133 + config PINCTRL_IMX8MN 134 + bool "IMX8MN pinctrl driver" 135 + depends on ARCH_MXC && ARM64 136 + select PINCTRL_IMX 137 + help 138 + Say Y here to enable the imx8mn pinctrl driver 139 + 133 140 config PINCTRL_IMX8MQ 134 141 bool "IMX8MQ pinctrl driver" 135 142 depends on ARCH_MXC && ARM64
+1
drivers/pinctrl/freescale/Makefile
··· 19 19 obj-$(CONFIG_PINCTRL_IMX7D) += pinctrl-imx7d.o 20 20 obj-$(CONFIG_PINCTRL_IMX7ULP) += pinctrl-imx7ulp.o 21 21 obj-$(CONFIG_PINCTRL_IMX8MM) += pinctrl-imx8mm.o 22 + obj-$(CONFIG_PINCTRL_IMX8MN) += pinctrl-imx8mn.o 22 23 obj-$(CONFIG_PINCTRL_IMX8MQ) += pinctrl-imx8mq.o 23 24 obj-$(CONFIG_PINCTRL_IMX8QM) += pinctrl-imx8qm.o 24 25 obj-$(CONFIG_PINCTRL_IMX8QXP) += pinctrl-imx8qxp.o
+348
drivers/pinctrl/freescale/pinctrl-imx8mn.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright 2018-2019 NXP 4 + */ 5 + 6 + #include <linux/err.h> 7 + #include <linux/init.h> 8 + #include <linux/of.h> 9 + #include <linux/pinctrl/pinctrl.h> 10 + #include <linux/platform_device.h> 11 + 12 + #include "pinctrl-imx.h" 13 + 14 + enum imx8mn_pads { 15 + MX8MN_PAD_RESERVE0 = 0, 16 + MX8MN_PAD_RESERVE1 = 1, 17 + MX8MN_PAD_RESERVE2 = 2, 18 + MX8MN_PAD_RESERVE3 = 3, 19 + MX8MN_PAD_RESERVE4 = 4, 20 + MX8MN_PAD_RESERVE5 = 5, 21 + MX8MN_PAD_RESERVE6 = 6, 22 + MX8MN_PAD_RESERVE7 = 7, 23 + MX8MN_IOMUXC_BOOT_MODE2 = 8, 24 + MX8MN_IOMUXC_BOOT_MODE3 = 9, 25 + MX8MN_IOMUXC_GPIO1_IO00 = 10, 26 + MX8MN_IOMUXC_GPIO1_IO01 = 11, 27 + MX8MN_IOMUXC_GPIO1_IO02 = 12, 28 + MX8MN_IOMUXC_GPIO1_IO03 = 13, 29 + MX8MN_IOMUXC_GPIO1_IO04 = 14, 30 + MX8MN_IOMUXC_GPIO1_IO05 = 15, 31 + MX8MN_IOMUXC_GPIO1_IO06 = 16, 32 + MX8MN_IOMUXC_GPIO1_IO07 = 17, 33 + MX8MN_IOMUXC_GPIO1_IO08 = 18, 34 + MX8MN_IOMUXC_GPIO1_IO09 = 19, 35 + MX8MN_IOMUXC_GPIO1_IO10 = 20, 36 + MX8MN_IOMUXC_GPIO1_IO11 = 21, 37 + MX8MN_IOMUXC_GPIO1_IO12 = 22, 38 + MX8MN_IOMUXC_GPIO1_IO13 = 23, 39 + MX8MN_IOMUXC_GPIO1_IO14 = 24, 40 + MX8MN_IOMUXC_GPIO1_IO15 = 25, 41 + MX8MN_IOMUXC_ENET_MDC = 26, 42 + MX8MN_IOMUXC_ENET_MDIO = 27, 43 + MX8MN_IOMUXC_ENET_TD3 = 28, 44 + MX8MN_IOMUXC_ENET_TD2 = 29, 45 + MX8MN_IOMUXC_ENET_TD1 = 30, 46 + MX8MN_IOMUXC_ENET_TD0 = 31, 47 + MX8MN_IOMUXC_ENET_TX_CTL = 32, 48 + MX8MN_IOMUXC_ENET_TXC = 33, 49 + MX8MN_IOMUXC_ENET_RX_CTL = 34, 50 + MX8MN_IOMUXC_ENET_RXC = 35, 51 + MX8MN_IOMUXC_ENET_RD0 = 36, 52 + MX8MN_IOMUXC_ENET_RD1 = 37, 53 + MX8MN_IOMUXC_ENET_RD2 = 38, 54 + MX8MN_IOMUXC_ENET_RD3 = 39, 55 + MX8MN_IOMUXC_SD1_CLK = 40, 56 + MX8MN_IOMUXC_SD1_CMD = 41, 57 + MX8MN_IOMUXC_SD1_DATA0 = 42, 58 + MX8MN_IOMUXC_SD1_DATA1 = 43, 59 + MX8MN_IOMUXC_SD1_DATA2 = 44, 60 + MX8MN_IOMUXC_SD1_DATA3 = 45, 61 + MX8MN_IOMUXC_SD1_DATA4 = 46, 62 + MX8MN_IOMUXC_SD1_DATA5 = 47, 63 + MX8MN_IOMUXC_SD1_DATA6 = 48, 64 + MX8MN_IOMUXC_SD1_DATA7 = 49, 65 + MX8MN_IOMUXC_SD1_RESET_B = 50, 66 + MX8MN_IOMUXC_SD1_STROBE = 51, 67 + MX8MN_IOMUXC_SD2_CD_B = 52, 68 + MX8MN_IOMUXC_SD2_CLK = 53, 69 + MX8MN_IOMUXC_SD2_CMD = 54, 70 + MX8MN_IOMUXC_SD2_DATA0 = 55, 71 + MX8MN_IOMUXC_SD2_DATA1 = 56, 72 + MX8MN_IOMUXC_SD2_DATA2 = 57, 73 + MX8MN_IOMUXC_SD2_DATA3 = 58, 74 + MX8MN_IOMUXC_SD2_RESET_B = 59, 75 + MX8MN_IOMUXC_SD2_WP = 60, 76 + MX8MN_IOMUXC_NAND_ALE = 61, 77 + MX8MN_IOMUXC_NAND_CE0 = 62, 78 + MX8MN_IOMUXC_NAND_CE1 = 63, 79 + MX8MN_IOMUXC_NAND_CE2 = 64, 80 + MX8MN_IOMUXC_NAND_CE3 = 65, 81 + MX8MN_IOMUXC_NAND_CLE = 66, 82 + MX8MN_IOMUXC_NAND_DATA00 = 67, 83 + MX8MN_IOMUXC_NAND_DATA01 = 68, 84 + MX8MN_IOMUXC_NAND_DATA02 = 69, 85 + MX8MN_IOMUXC_NAND_DATA03 = 70, 86 + MX8MN_IOMUXC_NAND_DATA04 = 71, 87 + MX8MN_IOMUXC_NAND_DATA05 = 72, 88 + MX8MN_IOMUXC_NAND_DATA06 = 73, 89 + MX8MN_IOMUXC_NAND_DATA07 = 74, 90 + MX8MN_IOMUXC_NAND_DQS = 75, 91 + MX8MN_IOMUXC_NAND_RE_B = 76, 92 + MX8MN_IOMUXC_NAND_READY_B = 77, 93 + MX8MN_IOMUXC_NAND_WE_B = 78, 94 + MX8MN_IOMUXC_NAND_WP_B = 79, 95 + MX8MN_IOMUXC_SAI5_RXFS = 80, 96 + MX8MN_IOMUXC_SAI5_RXC = 81, 97 + MX8MN_IOMUXC_SAI5_RXD0 = 82, 98 + MX8MN_IOMUXC_SAI5_RXD1 = 83, 99 + MX8MN_IOMUXC_SAI5_RXD2 = 84, 100 + MX8MN_IOMUXC_SAI5_RXD3 = 85, 101 + MX8MN_IOMUXC_SAI5_MCLK = 86, 102 + MX8MN_IOMUXC_SAI1_RXFS = 87, 103 + MX8MN_IOMUXC_SAI1_RXC = 88, 104 + MX8MN_IOMUXC_SAI1_RXD0 = 89, 105 + MX8MN_IOMUXC_SAI1_RXD1 = 90, 106 + MX8MN_IOMUXC_SAI1_RXD2 = 91, 107 + MX8MN_IOMUXC_SAI1_RXD3 = 92, 108 + MX8MN_IOMUXC_SAI1_RXD4 = 93, 109 + MX8MN_IOMUXC_SAI1_RXD5 = 94, 110 + MX8MN_IOMUXC_SAI1_RXD6 = 95, 111 + MX8MN_IOMUXC_SAI1_RXD7 = 96, 112 + MX8MN_IOMUXC_SAI1_TXFS = 97, 113 + MX8MN_IOMUXC_SAI1_TXC = 98, 114 + MX8MN_IOMUXC_SAI1_TXD0 = 99, 115 + MX8MN_IOMUXC_SAI1_TXD1 = 100, 116 + MX8MN_IOMUXC_SAI1_TXD2 = 101, 117 + MX8MN_IOMUXC_SAI1_TXD3 = 102, 118 + MX8MN_IOMUXC_SAI1_TXD4 = 103, 119 + MX8MN_IOMUXC_SAI1_TXD5 = 104, 120 + MX8MN_IOMUXC_SAI1_TXD6 = 105, 121 + MX8MN_IOMUXC_SAI1_TXD7 = 106, 122 + MX8MN_IOMUXC_SAI1_MCLK = 107, 123 + MX8MN_IOMUXC_SAI2_RXFS = 108, 124 + MX8MN_IOMUXC_SAI2_RXC = 109, 125 + MX8MN_IOMUXC_SAI2_RXD0 = 110, 126 + MX8MN_IOMUXC_SAI2_TXFS = 111, 127 + MX8MN_IOMUXC_SAI2_TXC = 112, 128 + MX8MN_IOMUXC_SAI2_TXD0 = 113, 129 + MX8MN_IOMUXC_SAI2_MCLK = 114, 130 + MX8MN_IOMUXC_SAI3_RXFS = 115, 131 + MX8MN_IOMUXC_SAI3_RXC = 116, 132 + MX8MN_IOMUXC_SAI3_RXD = 117, 133 + MX8MN_IOMUXC_SAI3_TXFS = 118, 134 + MX8MN_IOMUXC_SAI3_TXC = 119, 135 + MX8MN_IOMUXC_SAI3_TXD = 120, 136 + MX8MN_IOMUXC_SAI3_MCLK = 121, 137 + MX8MN_IOMUXC_SPDIF_TX = 122, 138 + MX8MN_IOMUXC_SPDIF_RX = 123, 139 + MX8MN_IOMUXC_SPDIF_EXT_CLK = 124, 140 + MX8MN_IOMUXC_ECSPI1_SCLK = 125, 141 + MX8MN_IOMUXC_ECSPI1_MOSI = 126, 142 + MX8MN_IOMUXC_ECSPI1_MISO = 127, 143 + MX8MN_IOMUXC_ECSPI1_SS0 = 128, 144 + MX8MN_IOMUXC_ECSPI2_SCLK = 129, 145 + MX8MN_IOMUXC_ECSPI2_MOSI = 130, 146 + MX8MN_IOMUXC_ECSPI2_MISO = 131, 147 + MX8MN_IOMUXC_ECSPI2_SS0 = 132, 148 + MX8MN_IOMUXC_I2C1_SCL = 133, 149 + MX8MN_IOMUXC_I2C1_SDA = 134, 150 + MX8MN_IOMUXC_I2C2_SCL = 135, 151 + MX8MN_IOMUXC_I2C2_SDA = 136, 152 + MX8MN_IOMUXC_I2C3_SCL = 137, 153 + MX8MN_IOMUXC_I2C3_SDA = 138, 154 + MX8MN_IOMUXC_I2C4_SCL = 139, 155 + MX8MN_IOMUXC_I2C4_SDA = 140, 156 + MX8MN_IOMUXC_UART1_RXD = 141, 157 + MX8MN_IOMUXC_UART1_TXD = 142, 158 + MX8MN_IOMUXC_UART2_RXD = 143, 159 + MX8MN_IOMUXC_UART2_TXD = 144, 160 + MX8MN_IOMUXC_UART3_RXD = 145, 161 + MX8MN_IOMUXC_UART3_TXD = 146, 162 + MX8MN_IOMUXC_UART4_RXD = 147, 163 + MX8MN_IOMUXC_UART4_TXD = 148, 164 + }; 165 + 166 + /* Pad names for the pinmux subsystem */ 167 + static const struct pinctrl_pin_desc imx8mn_pinctrl_pads[] = { 168 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE0), 169 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE1), 170 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE2), 171 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE3), 172 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE4), 173 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE5), 174 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE6), 175 + IMX_PINCTRL_PIN(MX8MN_PAD_RESERVE7), 176 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_BOOT_MODE2), 177 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_BOOT_MODE3), 178 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO00), 179 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO01), 180 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO02), 181 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO03), 182 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO04), 183 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO05), 184 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO06), 185 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO07), 186 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO08), 187 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO09), 188 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO10), 189 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO11), 190 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO12), 191 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO13), 192 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO14), 193 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_GPIO1_IO15), 194 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_MDC), 195 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_MDIO), 196 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_TD3), 197 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_TD2), 198 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_TD1), 199 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_TD0), 200 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_TX_CTL), 201 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_TXC), 202 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_RX_CTL), 203 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_RXC), 204 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_RD0), 205 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_RD1), 206 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_RD2), 207 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ENET_RD3), 208 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_CLK), 209 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_CMD), 210 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA0), 211 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA1), 212 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA2), 213 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA3), 214 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA4), 215 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA5), 216 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA6), 217 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_DATA7), 218 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_RESET_B), 219 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD1_STROBE), 220 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_CD_B), 221 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_CLK), 222 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_CMD), 223 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_DATA0), 224 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_DATA1), 225 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_DATA2), 226 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_DATA3), 227 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_RESET_B), 228 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SD2_WP), 229 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_ALE), 230 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_CE0), 231 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_CE1), 232 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_CE2), 233 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_CE3), 234 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_CLE), 235 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA00), 236 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA01), 237 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA02), 238 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA03), 239 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA04), 240 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA05), 241 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA06), 242 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DATA07), 243 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_DQS), 244 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_RE_B), 245 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_READY_B), 246 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_WE_B), 247 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_NAND_WP_B), 248 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_RXFS), 249 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_RXC), 250 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_RXD0), 251 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_RXD1), 252 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_RXD2), 253 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_RXD3), 254 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI5_MCLK), 255 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXFS), 256 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXC), 257 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD0), 258 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD1), 259 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD2), 260 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD3), 261 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD4), 262 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD5), 263 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD6), 264 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_RXD7), 265 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXFS), 266 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXC), 267 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD0), 268 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD1), 269 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD2), 270 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD3), 271 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD4), 272 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD5), 273 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD6), 274 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_TXD7), 275 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI1_MCLK), 276 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_RXFS), 277 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_RXC), 278 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_RXD0), 279 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_TXFS), 280 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_TXC), 281 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_TXD0), 282 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI2_MCLK), 283 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_RXFS), 284 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_RXC), 285 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_RXD), 286 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_TXFS), 287 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_TXC), 288 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_TXD), 289 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SAI3_MCLK), 290 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SPDIF_TX), 291 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SPDIF_RX), 292 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_SPDIF_EXT_CLK), 293 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI1_SCLK), 294 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI1_MOSI), 295 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI1_MISO), 296 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI1_SS0), 297 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI2_SCLK), 298 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI2_MOSI), 299 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI2_MISO), 300 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_ECSPI2_SS0), 301 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C1_SCL), 302 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C1_SDA), 303 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C2_SCL), 304 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C2_SDA), 305 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C3_SCL), 306 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C3_SDA), 307 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C4_SCL), 308 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_I2C4_SDA), 309 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART1_RXD), 310 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART1_TXD), 311 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART2_RXD), 312 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART2_TXD), 313 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART3_RXD), 314 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART3_TXD), 315 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART4_RXD), 316 + IMX_PINCTRL_PIN(MX8MN_IOMUXC_UART4_TXD), 317 + }; 318 + 319 + static struct imx_pinctrl_soc_info imx8mn_pinctrl_info = { 320 + .pins = imx8mn_pinctrl_pads, 321 + .npins = ARRAY_SIZE(imx8mn_pinctrl_pads), 322 + .gpr_compatible = "fsl,imx8mn-iomuxc-gpr", 323 + }; 324 + 325 + static const struct of_device_id imx8mn_pinctrl_of_match[] = { 326 + { .compatible = "fsl,imx8mn-iomuxc", .data = &imx8mn_pinctrl_info, }, 327 + { /* sentinel */ } 328 + }; 329 + 330 + static int imx8mn_pinctrl_probe(struct platform_device *pdev) 331 + { 332 + return imx_pinctrl_probe(pdev, &imx8mn_pinctrl_info); 333 + } 334 + 335 + static struct platform_driver imx8mn_pinctrl_driver = { 336 + .driver = { 337 + .name = "imx8mn-pinctrl", 338 + .of_match_table = of_match_ptr(imx8mn_pinctrl_of_match), 339 + .suppress_bind_attrs = true, 340 + }, 341 + .probe = imx8mn_pinctrl_probe, 342 + }; 343 + 344 + static int __init imx8mn_pinctrl_init(void) 345 + { 346 + return platform_driver_register(&imx8mn_pinctrl_driver); 347 + } 348 + arch_initcall(imx8mn_pinctrl_init);
+71 -251
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 24 24 #include <linux/pinctrl/pinconf.h> 25 25 #include <linux/pinctrl/pinconf-generic.h> 26 26 27 + #include "pinctrl-intel.h" 28 + 27 29 /* memory mapped register offsets */ 28 30 #define BYT_CONF0_REG 0x000 29 31 #define BYT_CONF1_REG 0x004 ··· 37 35 /* BYT_CONF0_REG register bits */ 38 36 #define BYT_IODEN BIT(31) 39 37 #define BYT_DIRECT_IRQ_EN BIT(27) 38 + #define BYT_TRIG_MASK GENMASK(26, 24) 40 39 #define BYT_TRIG_NEG BIT(26) 41 40 #define BYT_TRIG_POS BIT(25) 42 41 #define BYT_TRIG_LVL BIT(24) ··· 46 43 #define BYT_GLITCH_F_SLOW_CLK BIT(17) 47 44 #define BYT_GLITCH_F_FAST_CLK BIT(16) 48 45 #define BYT_PULL_STR_SHIFT 9 49 - #define BYT_PULL_STR_MASK (3 << BYT_PULL_STR_SHIFT) 46 + #define BYT_PULL_STR_MASK GENMASK(10, 9) 50 47 #define BYT_PULL_STR_2K (0 << BYT_PULL_STR_SHIFT) 51 48 #define BYT_PULL_STR_10K (1 << BYT_PULL_STR_SHIFT) 52 49 #define BYT_PULL_STR_20K (2 << BYT_PULL_STR_SHIFT) 53 50 #define BYT_PULL_STR_40K (3 << BYT_PULL_STR_SHIFT) 54 51 #define BYT_PULL_ASSIGN_SHIFT 7 55 - #define BYT_PULL_ASSIGN_MASK (3 << BYT_PULL_ASSIGN_SHIFT) 52 + #define BYT_PULL_ASSIGN_MASK GENMASK(8, 7) 56 53 #define BYT_PULL_ASSIGN_UP (1 << BYT_PULL_ASSIGN_SHIFT) 57 54 #define BYT_PULL_ASSIGN_DOWN (2 << BYT_PULL_ASSIGN_SHIFT) 58 - #define BYT_PIN_MUX 0x07 55 + #define BYT_PIN_MUX GENMASK(2, 0) 59 56 60 57 /* BYT_VAL_REG register bits */ 58 + #define BYT_DIR_MASK GENMASK(2, 1) 61 59 #define BYT_INPUT_EN BIT(2) /* 0: input enabled (active low)*/ 62 60 #define BYT_OUTPUT_EN BIT(1) /* 0: output enabled (active low)*/ 63 61 #define BYT_LEVEL BIT(0) 64 62 65 - #define BYT_DIR_MASK (BIT(1) | BIT(2)) 66 - #define BYT_TRIG_MASK (BIT(26) | BIT(25) | BIT(24)) 67 - 68 - #define BYT_CONF0_RESTORE_MASK (BYT_DIRECT_IRQ_EN | BYT_TRIG_MASK | \ 69 - BYT_PIN_MUX) 63 + #define BYT_CONF0_RESTORE_MASK (BYT_DIRECT_IRQ_EN | BYT_TRIG_MASK | BYT_PIN_MUX) 70 64 #define BYT_VAL_RESTORE_MASK (BYT_DIR_MASK | BYT_LEVEL) 71 65 72 66 /* BYT_DEBOUNCE_REG bits */ 73 - #define BYT_DEBOUNCE_PULSE_MASK 0x7 67 + #define BYT_DEBOUNCE_PULSE_MASK GENMASK(2, 0) 74 68 #define BYT_DEBOUNCE_PULSE_375US 1 75 69 #define BYT_DEBOUNCE_PULSE_750US 2 76 70 #define BYT_DEBOUNCE_PULSE_1500US 3 ··· 91 91 * does not find a match for the requested function. 92 92 */ 93 93 #define BYT_DEFAULT_GPIO_MUX 0 94 + #define BYT_ALTER_GPIO_MUX 1 94 95 95 96 struct byt_gpio_pin_context { 96 97 u32 conf0; 97 98 u32 val; 98 - }; 99 - 100 - struct byt_simple_func_mux { 101 - const char *name; 102 - unsigned short func; 103 - }; 104 - 105 - struct byt_mixed_func_mux { 106 - const char *name; 107 - const unsigned short *func_values; 108 - }; 109 - 110 - struct byt_pingroup { 111 - const char *name; 112 - const unsigned int *pins; 113 - size_t npins; 114 - unsigned short has_simple_funcs; 115 - union { 116 - const struct byt_simple_func_mux *simple_funcs; 117 - const struct byt_mixed_func_mux *mixed_funcs; 118 - }; 119 - size_t nfuncs; 120 - }; 121 - 122 - struct byt_function { 123 - const char *name; 124 - const char * const *groups; 125 - size_t ngroups; 126 99 }; 127 100 128 101 struct byt_community { ··· 104 131 const unsigned int *pad_map; 105 132 void __iomem *reg_base; 106 133 }; 107 - 108 - #define SIMPLE_FUNC(n, f) \ 109 - { \ 110 - .name = (n), \ 111 - .func = (f), \ 112 - } 113 - #define MIXED_FUNC(n, f) \ 114 - { \ 115 - .name = (n), \ 116 - .func_values = (f), \ 117 - } 118 - 119 - #define PIN_GROUP_SIMPLE(n, p, f) \ 120 - { \ 121 - .name = (n), \ 122 - .pins = (p), \ 123 - .npins = ARRAY_SIZE((p)), \ 124 - .has_simple_funcs = 1, \ 125 - { \ 126 - .simple_funcs = (f), \ 127 - }, \ 128 - .nfuncs = ARRAY_SIZE((f)), \ 129 - } 130 - #define PIN_GROUP_MIXED(n, p, f) \ 131 - { \ 132 - .name = (n), \ 133 - .pins = (p), \ 134 - .npins = ARRAY_SIZE((p)), \ 135 - .has_simple_funcs = 0, \ 136 - { \ 137 - .mixed_funcs = (f), \ 138 - }, \ 139 - .nfuncs = ARRAY_SIZE((f)), \ 140 - } 141 - 142 - #define FUNCTION(n, g) \ 143 - { \ 144 - .name = (n), \ 145 - .groups = (g), \ 146 - .ngroups = ARRAY_SIZE((g)), \ 147 - } 148 134 149 135 #define COMMUNITY(p, n, map) \ 150 136 { \ ··· 116 184 const char *uid; 117 185 const struct pinctrl_pin_desc *pins; 118 186 size_t npins; 119 - const struct byt_pingroup *groups; 187 + const struct intel_pingroup *groups; 120 188 size_t ngroups; 121 - const struct byt_function *functions; 189 + const struct intel_function *functions; 122 190 size_t nfunctions; 123 191 const struct byt_community *communities; 124 192 size_t ncommunities; ··· 258 326 /* SCORE groups */ 259 327 static const unsigned int byt_score_uart1_pins[] = { 70, 71, 72, 73 }; 260 328 static const unsigned int byt_score_uart2_pins[] = { 74, 75, 76, 77 }; 261 - static const struct byt_simple_func_mux byt_score_uart_mux[] = { 262 - SIMPLE_FUNC("uart", 1), 263 - }; 264 329 265 330 static const unsigned int byt_score_pwm0_pins[] = { 94 }; 266 331 static const unsigned int byt_score_pwm1_pins[] = { 95 }; 267 - static const struct byt_simple_func_mux byt_score_pwm_mux[] = { 268 - SIMPLE_FUNC("pwm", 1), 269 - }; 270 332 271 333 static const unsigned int byt_score_sio_spi_pins[] = { 66, 67, 68, 69 }; 272 - static const struct byt_simple_func_mux byt_score_spi_mux[] = { 273 - SIMPLE_FUNC("spi", 1), 274 - }; 275 334 276 335 static const unsigned int byt_score_i2c5_pins[] = { 88, 89 }; 277 336 static const unsigned int byt_score_i2c6_pins[] = { 90, 91 }; ··· 271 348 static const unsigned int byt_score_i2c2_pins[] = { 82, 83 }; 272 349 static const unsigned int byt_score_i2c1_pins[] = { 80, 81 }; 273 350 static const unsigned int byt_score_i2c0_pins[] = { 78, 79 }; 274 - static const struct byt_simple_func_mux byt_score_i2c_mux[] = { 275 - SIMPLE_FUNC("i2c", 1), 276 - }; 277 351 278 352 static const unsigned int byt_score_ssp0_pins[] = { 8, 9, 10, 11 }; 279 353 static const unsigned int byt_score_ssp1_pins[] = { 12, 13, 14, 15 }; 280 354 static const unsigned int byt_score_ssp2_pins[] = { 62, 63, 64, 65 }; 281 - static const struct byt_simple_func_mux byt_score_ssp_mux[] = { 282 - SIMPLE_FUNC("ssp", 1), 283 - }; 284 355 285 356 static const unsigned int byt_score_sdcard_pins[] = { 286 357 7, 33, 34, 35, 36, 37, 38, 39, 40, 41, 287 358 }; 288 - static const unsigned short byt_score_sdcard_mux_values[] = { 359 + static const unsigned int byt_score_sdcard_mux_values[] = { 289 360 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 290 - }; 291 - static const struct byt_mixed_func_mux byt_score_sdcard_mux[] = { 292 - MIXED_FUNC("sdcard", byt_score_sdcard_mux_values), 293 361 }; 294 362 295 363 static const unsigned int byt_score_sdio_pins[] = { 27, 28, 29, 30, 31, 32 }; 296 - static const struct byt_simple_func_mux byt_score_sdio_mux[] = { 297 - SIMPLE_FUNC("sdio", 1), 298 - }; 299 364 300 365 static const unsigned int byt_score_emmc_pins[] = { 301 366 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 302 - }; 303 - static const struct byt_simple_func_mux byt_score_emmc_mux[] = { 304 - SIMPLE_FUNC("emmc", 1), 305 367 }; 306 368 307 369 static const unsigned int byt_score_ilb_lpc_pins[] = { 308 370 42, 43, 44, 45, 46, 47, 48, 49, 50, 309 371 }; 310 - static const struct byt_simple_func_mux byt_score_lpc_mux[] = { 311 - SIMPLE_FUNC("lpc", 1), 312 - }; 313 372 314 373 static const unsigned int byt_score_sata_pins[] = { 0, 1, 2 }; 315 - static const struct byt_simple_func_mux byt_score_sata_mux[] = { 316 - SIMPLE_FUNC("sata", 1), 317 - }; 318 374 319 375 static const unsigned int byt_score_plt_clk0_pins[] = { 96 }; 320 376 static const unsigned int byt_score_plt_clk1_pins[] = { 97 }; ··· 301 399 static const unsigned int byt_score_plt_clk3_pins[] = { 99 }; 302 400 static const unsigned int byt_score_plt_clk4_pins[] = { 100 }; 303 401 static const unsigned int byt_score_plt_clk5_pins[] = { 101 }; 304 - static const struct byt_simple_func_mux byt_score_plt_clk_mux[] = { 305 - SIMPLE_FUNC("plt_clk", 1), 306 - }; 307 402 308 403 static const unsigned int byt_score_smbus_pins[] = { 51, 52, 53 }; 309 - static const struct byt_simple_func_mux byt_score_smbus_mux[] = { 310 - SIMPLE_FUNC("smbus", 1), 311 - }; 312 404 313 - static const struct byt_pingroup byt_score_groups[] = { 314 - PIN_GROUP_SIMPLE("uart1_grp", 315 - byt_score_uart1_pins, byt_score_uart_mux), 316 - PIN_GROUP_SIMPLE("uart2_grp", 317 - byt_score_uart2_pins, byt_score_uart_mux), 318 - PIN_GROUP_SIMPLE("pwm0_grp", 319 - byt_score_pwm0_pins, byt_score_pwm_mux), 320 - PIN_GROUP_SIMPLE("pwm1_grp", 321 - byt_score_pwm1_pins, byt_score_pwm_mux), 322 - PIN_GROUP_SIMPLE("ssp2_grp", 323 - byt_score_ssp2_pins, byt_score_pwm_mux), 324 - PIN_GROUP_SIMPLE("sio_spi_grp", 325 - byt_score_sio_spi_pins, byt_score_spi_mux), 326 - PIN_GROUP_SIMPLE("i2c5_grp", 327 - byt_score_i2c5_pins, byt_score_i2c_mux), 328 - PIN_GROUP_SIMPLE("i2c6_grp", 329 - byt_score_i2c6_pins, byt_score_i2c_mux), 330 - PIN_GROUP_SIMPLE("i2c4_grp", 331 - byt_score_i2c4_pins, byt_score_i2c_mux), 332 - PIN_GROUP_SIMPLE("i2c3_grp", 333 - byt_score_i2c3_pins, byt_score_i2c_mux), 334 - PIN_GROUP_SIMPLE("i2c2_grp", 335 - byt_score_i2c2_pins, byt_score_i2c_mux), 336 - PIN_GROUP_SIMPLE("i2c1_grp", 337 - byt_score_i2c1_pins, byt_score_i2c_mux), 338 - PIN_GROUP_SIMPLE("i2c0_grp", 339 - byt_score_i2c0_pins, byt_score_i2c_mux), 340 - PIN_GROUP_SIMPLE("ssp0_grp", 341 - byt_score_ssp0_pins, byt_score_ssp_mux), 342 - PIN_GROUP_SIMPLE("ssp1_grp", 343 - byt_score_ssp1_pins, byt_score_ssp_mux), 344 - PIN_GROUP_MIXED("sdcard_grp", 345 - byt_score_sdcard_pins, byt_score_sdcard_mux), 346 - PIN_GROUP_SIMPLE("sdio_grp", 347 - byt_score_sdio_pins, byt_score_sdio_mux), 348 - PIN_GROUP_SIMPLE("emmc_grp", 349 - byt_score_emmc_pins, byt_score_emmc_mux), 350 - PIN_GROUP_SIMPLE("lpc_grp", 351 - byt_score_ilb_lpc_pins, byt_score_lpc_mux), 352 - PIN_GROUP_SIMPLE("sata_grp", 353 - byt_score_sata_pins, byt_score_sata_mux), 354 - PIN_GROUP_SIMPLE("plt_clk0_grp", 355 - byt_score_plt_clk0_pins, byt_score_plt_clk_mux), 356 - PIN_GROUP_SIMPLE("plt_clk1_grp", 357 - byt_score_plt_clk1_pins, byt_score_plt_clk_mux), 358 - PIN_GROUP_SIMPLE("plt_clk2_grp", 359 - byt_score_plt_clk2_pins, byt_score_plt_clk_mux), 360 - PIN_GROUP_SIMPLE("plt_clk3_grp", 361 - byt_score_plt_clk3_pins, byt_score_plt_clk_mux), 362 - PIN_GROUP_SIMPLE("plt_clk4_grp", 363 - byt_score_plt_clk4_pins, byt_score_plt_clk_mux), 364 - PIN_GROUP_SIMPLE("plt_clk5_grp", 365 - byt_score_plt_clk5_pins, byt_score_plt_clk_mux), 366 - PIN_GROUP_SIMPLE("smbus_grp", 367 - byt_score_smbus_pins, byt_score_smbus_mux), 405 + static const struct intel_pingroup byt_score_groups[] = { 406 + PIN_GROUP("uart1_grp", byt_score_uart1_pins, 1), 407 + PIN_GROUP("uart2_grp", byt_score_uart2_pins, 1), 408 + PIN_GROUP("pwm0_grp", byt_score_pwm0_pins, 1), 409 + PIN_GROUP("pwm1_grp", byt_score_pwm1_pins, 1), 410 + PIN_GROUP("ssp2_grp", byt_score_ssp2_pins, 1), 411 + PIN_GROUP("sio_spi_grp", byt_score_sio_spi_pins, 1), 412 + PIN_GROUP("i2c5_grp", byt_score_i2c5_pins, 1), 413 + PIN_GROUP("i2c6_grp", byt_score_i2c6_pins, 1), 414 + PIN_GROUP("i2c4_grp", byt_score_i2c4_pins, 1), 415 + PIN_GROUP("i2c3_grp", byt_score_i2c3_pins, 1), 416 + PIN_GROUP("i2c2_grp", byt_score_i2c2_pins, 1), 417 + PIN_GROUP("i2c1_grp", byt_score_i2c1_pins, 1), 418 + PIN_GROUP("i2c0_grp", byt_score_i2c0_pins, 1), 419 + PIN_GROUP("ssp0_grp", byt_score_ssp0_pins, 1), 420 + PIN_GROUP("ssp1_grp", byt_score_ssp1_pins, 1), 421 + PIN_GROUP("sdcard_grp", byt_score_sdcard_pins, byt_score_sdcard_mux_values), 422 + PIN_GROUP("sdio_grp", byt_score_sdio_pins, 1), 423 + PIN_GROUP("emmc_grp", byt_score_emmc_pins, 1), 424 + PIN_GROUP("lpc_grp", byt_score_ilb_lpc_pins, 1), 425 + PIN_GROUP("sata_grp", byt_score_sata_pins, 1), 426 + PIN_GROUP("plt_clk0_grp", byt_score_plt_clk0_pins, 1), 427 + PIN_GROUP("plt_clk1_grp", byt_score_plt_clk1_pins, 1), 428 + PIN_GROUP("plt_clk2_grp", byt_score_plt_clk2_pins, 1), 429 + PIN_GROUP("plt_clk3_grp", byt_score_plt_clk3_pins, 1), 430 + PIN_GROUP("plt_clk4_grp", byt_score_plt_clk4_pins, 1), 431 + PIN_GROUP("plt_clk5_grp", byt_score_plt_clk5_pins, 1), 432 + PIN_GROUP("smbus_grp", byt_score_smbus_pins, 1), 368 433 }; 369 434 370 435 static const char * const byt_score_uart_groups[] = { ··· 365 496 "sdcard_grp", "sdio_grp", "emmc_grp", "lpc_grp", "sata_grp", 366 497 "plt_clk0_grp", "plt_clk1_grp", "plt_clk2_grp", "plt_clk3_grp", 367 498 "plt_clk4_grp", "plt_clk5_grp", "smbus_grp", 368 - 369 499 }; 370 500 371 - static const struct byt_function byt_score_functions[] = { 501 + static const struct intel_function byt_score_functions[] = { 372 502 FUNCTION("uart", byt_score_uart_groups), 373 503 FUNCTION("pwm", byt_score_pwm_groups), 374 504 FUNCTION("ssp", byt_score_ssp_groups), ··· 456 588 }; 457 589 458 590 static const unsigned int byt_sus_usb_over_current_pins[] = { 19, 20 }; 459 - static const struct byt_simple_func_mux byt_sus_usb_oc_mux[] = { 460 - SIMPLE_FUNC("usb", 0), 461 - SIMPLE_FUNC("gpio", 1), 462 - }; 591 + static const unsigned int byt_sus_usb_over_current_mode_values[] = { 0, 0 }; 592 + static const unsigned int byt_sus_usb_over_current_gpio_mode_values[] = { 1, 1 }; 463 593 464 594 static const unsigned int byt_sus_usb_ulpi_pins[] = { 465 595 14, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 466 596 }; 467 - static const unsigned short byt_sus_usb_ulpi_mode_values[] = { 597 + static const unsigned int byt_sus_usb_ulpi_mode_values[] = { 468 598 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 469 599 }; 470 - static const unsigned short byt_sus_usb_ulpi_gpio_mode_values[] = { 471 - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 472 - }; 473 - static const struct byt_mixed_func_mux byt_sus_usb_ulpi_mux[] = { 474 - MIXED_FUNC("usb", byt_sus_usb_ulpi_mode_values), 475 - MIXED_FUNC("gpio", byt_sus_usb_ulpi_gpio_mode_values), 600 + static const unsigned int byt_sus_usb_ulpi_gpio_mode_values[] = { 601 + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 476 602 }; 477 603 478 604 static const unsigned int byt_sus_pcu_spi_pins[] = { 21 }; 479 - static const struct byt_simple_func_mux byt_sus_pcu_spi_mux[] = { 480 - SIMPLE_FUNC("spi", 0), 481 - SIMPLE_FUNC("gpio", 1), 482 - }; 605 + static const unsigned int byt_sus_pcu_spi_mode_values[] = { 0 }; 606 + static const unsigned int byt_sus_pcu_spi_gpio_mode_values[] = { 1 }; 483 607 484 - static const struct byt_pingroup byt_sus_groups[] = { 485 - PIN_GROUP_SIMPLE("usb_oc_grp", 486 - byt_sus_usb_over_current_pins, byt_sus_usb_oc_mux), 487 - PIN_GROUP_MIXED("usb_ulpi_grp", 488 - byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_mux), 489 - PIN_GROUP_SIMPLE("pcu_spi_grp", 490 - byt_sus_pcu_spi_pins, byt_sus_pcu_spi_mux), 608 + static const struct intel_pingroup byt_sus_groups[] = { 609 + PIN_GROUP("usb_oc_grp", byt_sus_usb_over_current_pins, byt_sus_usb_over_current_mode_values), 610 + PIN_GROUP("usb_ulpi_grp", byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_mode_values), 611 + PIN_GROUP("pcu_spi_grp", byt_sus_pcu_spi_pins, byt_sus_pcu_spi_mode_values), 612 + PIN_GROUP("usb_oc_grp_gpio", byt_sus_usb_over_current_pins, byt_sus_usb_over_current_gpio_mode_values), 613 + PIN_GROUP("usb_ulpi_grp_gpio", byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_gpio_mode_values), 614 + PIN_GROUP("pcu_spi_grp_gpio", byt_sus_pcu_spi_pins, byt_sus_pcu_spi_gpio_mode_values), 491 615 }; 492 616 493 617 static const char * const byt_sus_usb_groups[] = { ··· 487 627 }; 488 628 static const char * const byt_sus_spi_groups[] = { "pcu_spi_grp" }; 489 629 static const char * const byt_sus_gpio_groups[] = { 490 - "usb_oc_grp", "usb_ulpi_grp", "pcu_spi_grp", 630 + "usb_oc_grp_gpio", "usb_ulpi_grp_gpio", "pcu_spi_grp_gpio", 491 631 }; 492 632 493 - static const struct byt_function byt_sus_functions[] = { 633 + static const struct intel_function byt_sus_functions[] = { 494 634 FUNCTION("usb", byt_sus_usb_groups), 495 635 FUNCTION("spi", byt_sus_spi_groups), 496 636 FUNCTION("gpio", byt_sus_gpio_groups), ··· 670 810 return 0; 671 811 } 672 812 673 - static int byt_get_group_simple_mux(const struct byt_pingroup group, 674 - const char *func_name, 675 - unsigned short *func) 676 - { 677 - int i; 678 - 679 - for (i = 0; i < group.nfuncs; i++) { 680 - if (!strcmp(group.simple_funcs[i].name, func_name)) { 681 - *func = group.simple_funcs[i].func; 682 - return 0; 683 - } 684 - } 685 - 686 - return 1; 687 - } 688 - 689 - static int byt_get_group_mixed_mux(const struct byt_pingroup group, 690 - const char *func_name, 691 - const unsigned short **func) 692 - { 693 - int i; 694 - 695 - for (i = 0; i < group.nfuncs; i++) { 696 - if (!strcmp(group.mixed_funcs[i].name, func_name)) { 697 - *func = group.mixed_funcs[i].func_values; 698 - return 0; 699 - } 700 - } 701 - 702 - return 1; 703 - } 704 - 705 813 static void byt_set_group_simple_mux(struct byt_gpio *vg, 706 - const struct byt_pingroup group, 707 - unsigned short func) 814 + const struct intel_pingroup group, 815 + unsigned int func) 708 816 { 709 817 unsigned long flags; 710 818 int i; ··· 701 873 } 702 874 703 875 static void byt_set_group_mixed_mux(struct byt_gpio *vg, 704 - const struct byt_pingroup group, 705 - const unsigned short *func) 876 + const struct intel_pingroup group, 877 + const unsigned int *func) 706 878 { 707 879 unsigned long flags; 708 880 int i; ··· 734 906 unsigned int group_selector) 735 907 { 736 908 struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 737 - const struct byt_function func = vg->soc_data->functions[func_selector]; 738 - const struct byt_pingroup group = vg->soc_data->groups[group_selector]; 739 - const unsigned short *mixed_func; 740 - unsigned short simple_func; 741 - int ret = 1; 909 + const struct intel_function func = vg->soc_data->functions[func_selector]; 910 + const struct intel_pingroup group = vg->soc_data->groups[group_selector]; 742 911 743 - if (group.has_simple_funcs) 744 - ret = byt_get_group_simple_mux(group, func.name, &simple_func); 745 - else 746 - ret = byt_get_group_mixed_mux(group, func.name, &mixed_func); 747 - 748 - if (ret) 912 + if (group.modes) 913 + byt_set_group_mixed_mux(vg, group, group.modes); 914 + else if (!strcmp(func.name, "gpio")) 749 915 byt_set_group_simple_mux(vg, group, BYT_DEFAULT_GPIO_MUX); 750 - else if (group.has_simple_funcs) 751 - byt_set_group_simple_mux(vg, group, simple_func); 752 916 else 753 - byt_set_group_mixed_mux(vg, group, mixed_func); 917 + byt_set_group_simple_mux(vg, group, group.mode); 754 918 755 919 return 0; 756 920 } ··· 752 932 /* SCORE pin 92-93 */ 753 933 if (!strcmp(vg->soc_data->uid, BYT_SCORE_ACPI_UID) && 754 934 offset >= 92 && offset <= 93) 755 - return 1; 935 + return BYT_ALTER_GPIO_MUX; 756 936 757 937 /* SUS pin 11-21 */ 758 938 if (!strcmp(vg->soc_data->uid, BYT_SUS_ACPI_UID) && 759 939 offset >= 11 && offset <= 21) 760 - return 1; 940 + return BYT_ALTER_GPIO_MUX; 761 941 762 - return 0; 942 + return BYT_DEFAULT_GPIO_MUX; 763 943 } 764 944 765 945 static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset)
+1
drivers/pinctrl/mediatek/pinctrl-mt8183.c
··· 583 583 .driver = { 584 584 .name = "mt8183-pinctrl", 585 585 .of_match_table = mt8183_pinctrl_of_match, 586 + .pm = &mtk_paris_pinctrl_pm_ops, 586 587 }, 587 588 .probe = mt8183_pinctrl_probe, 588 589 };
+19
drivers/pinctrl/mediatek/pinctrl-paris.c
··· 926 926 927 927 return 0; 928 928 } 929 + 930 + static int mtk_paris_pinctrl_suspend(struct device *device) 931 + { 932 + struct mtk_pinctrl *pctl = dev_get_drvdata(device); 933 + 934 + return mtk_eint_do_suspend(pctl->eint); 935 + } 936 + 937 + static int mtk_paris_pinctrl_resume(struct device *device) 938 + { 939 + struct mtk_pinctrl *pctl = dev_get_drvdata(device); 940 + 941 + return mtk_eint_do_resume(pctl->eint); 942 + } 943 + 944 + const struct dev_pm_ops mtk_paris_pinctrl_pm_ops = { 945 + .suspend_noirq = mtk_paris_pinctrl_suspend, 946 + .resume_noirq = mtk_paris_pinctrl_resume, 947 + };
+2
drivers/pinctrl/mediatek/pinctrl-paris.h
··· 60 60 int mtk_paris_pinctrl_probe(struct platform_device *pdev, 61 61 const struct mtk_pin_soc *soc); 62 62 63 + extern const struct dev_pm_ops mtk_paris_pinctrl_pm_ops; 64 + 63 65 #endif /* __PINCTRL_PARIS_H */
+18 -18
drivers/pinctrl/meson/pinctrl-meson-g12a.c
··· 1304 1304 }; 1305 1305 1306 1306 static struct meson_bank meson_g12a_periphs_banks[] = { 1307 - /* name first last irq pullen pull dir out in */ 1308 - BANK("Z", GPIOZ_0, GPIOZ_15, 12, 27, 1309 - 4, 0, 4, 0, 12, 0, 13, 0, 14, 0), 1310 - BANK("H", GPIOH_0, GPIOH_8, 28, 36, 1311 - 3, 0, 3, 0, 9, 0, 10, 0, 11, 0), 1312 - BANK("BOOT", BOOT_0, BOOT_15, 37, 52, 1313 - 0, 0, 0, 0, 0, 0, 1, 0, 2, 0), 1314 - BANK("C", GPIOC_0, GPIOC_7, 53, 60, 1315 - 1, 0, 1, 0, 3, 0, 4, 0, 5, 0), 1316 - BANK("A", GPIOA_0, GPIOA_15, 61, 76, 1317 - 5, 0, 5, 0, 16, 0, 17, 0, 18, 0), 1318 - BANK("X", GPIOX_0, GPIOX_19, 77, 96, 1319 - 2, 0, 2, 0, 6, 0, 7, 0, 8, 0), 1307 + /* name first last irq pullen pull dir out in ds */ 1308 + BANK_DS("Z", GPIOZ_0, GPIOZ_15, 12, 27, 1309 + 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0), 1310 + BANK_DS("H", GPIOH_0, GPIOH_8, 28, 36, 1311 + 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0), 1312 + BANK_DS("BOOT", BOOT_0, BOOT_15, 37, 52, 1313 + 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0), 1314 + BANK_DS("C", GPIOC_0, GPIOC_7, 53, 60, 1315 + 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0), 1316 + BANK_DS("A", GPIOA_0, GPIOA_15, 61, 76, 1317 + 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0), 1318 + BANK_DS("X", GPIOX_0, GPIOX_19, 77, 96, 1319 + 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0), 1320 1320 }; 1321 1321 1322 1322 static struct meson_bank meson_g12a_aobus_banks[] = { 1323 - /* name first last irq pullen pull dir out in */ 1324 - BANK("AO", GPIOAO_0, GPIOAO_11, 0, 11, 1325 - 3, 0, 2, 0, 0, 0, 4, 0, 1, 0), 1323 + /* name first last irq pullen pull dir out in ds */ 1324 + BANK_DS("AO", GPIOAO_0, GPIOAO_11, 0, 11, 3, 0, 2, 0, 0, 0, 4, 0, 1, 0, 1325 + 0, 0), 1326 1326 /* GPIOE actually located in the AO bank */ 1327 - BANK("E", GPIOE_0, GPIOE_2, 97, 99, 1328 - 3, 16, 2, 16, 0, 16, 4, 16, 1, 16), 1327 + BANK_DS("E", GPIOE_0, GPIOE_2, 97, 99, 3, 16, 2, 16, 0, 16, 4, 16, 1, 1328 + 16, 1, 0), 1329 1329 }; 1330 1330 1331 1331 static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = {
+267 -83
drivers/pinctrl/meson/pinctrl-meson.c
··· 168 168 return 0; 169 169 } 170 170 171 - static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin, 172 - unsigned long *configs, unsigned num_configs) 171 + static int meson_pinconf_set_gpio_bit(struct meson_pinctrl *pc, 172 + unsigned int pin, 173 + unsigned int reg_type, 174 + bool arg) 173 175 { 174 - struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 175 176 struct meson_bank *bank; 176 - enum pin_config_param param; 177 177 unsigned int reg, bit; 178 - int i, ret; 178 + int ret; 179 179 180 180 ret = meson_get_bank(pc, pin, &bank); 181 181 if (ret) 182 182 return ret; 183 183 184 + meson_calc_reg_and_bit(bank, pin, reg_type, &reg, &bit); 185 + return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 186 + arg ? BIT(bit) : 0); 187 + } 188 + 189 + static int meson_pinconf_get_gpio_bit(struct meson_pinctrl *pc, 190 + unsigned int pin, 191 + unsigned int reg_type) 192 + { 193 + struct meson_bank *bank; 194 + unsigned int reg, bit, val; 195 + int ret; 196 + 197 + ret = meson_get_bank(pc, pin, &bank); 198 + if (ret) 199 + return ret; 200 + 201 + meson_calc_reg_and_bit(bank, pin, reg_type, &reg, &bit); 202 + ret = regmap_read(pc->reg_gpio, reg, &val); 203 + if (ret) 204 + return ret; 205 + 206 + return BIT(bit) & val ? 1 : 0; 207 + } 208 + 209 + static int meson_pinconf_set_output(struct meson_pinctrl *pc, 210 + unsigned int pin, 211 + bool out) 212 + { 213 + return meson_pinconf_set_gpio_bit(pc, pin, REG_DIR, !out); 214 + } 215 + 216 + static int meson_pinconf_get_output(struct meson_pinctrl *pc, 217 + unsigned int pin) 218 + { 219 + int ret = meson_pinconf_get_gpio_bit(pc, pin, REG_DIR); 220 + 221 + if (ret < 0) 222 + return ret; 223 + 224 + return !ret; 225 + } 226 + 227 + static int meson_pinconf_set_drive(struct meson_pinctrl *pc, 228 + unsigned int pin, 229 + bool high) 230 + { 231 + return meson_pinconf_set_gpio_bit(pc, pin, REG_OUT, high); 232 + } 233 + 234 + static int meson_pinconf_get_drive(struct meson_pinctrl *pc, 235 + unsigned int pin) 236 + { 237 + return meson_pinconf_get_gpio_bit(pc, pin, REG_OUT); 238 + } 239 + 240 + static int meson_pinconf_set_output_drive(struct meson_pinctrl *pc, 241 + unsigned int pin, 242 + bool high) 243 + { 244 + int ret; 245 + 246 + ret = meson_pinconf_set_output(pc, pin, true); 247 + if (ret) 248 + return ret; 249 + 250 + return meson_pinconf_set_drive(pc, pin, high); 251 + } 252 + 253 + static int meson_pinconf_disable_bias(struct meson_pinctrl *pc, 254 + unsigned int pin) 255 + { 256 + struct meson_bank *bank; 257 + unsigned int reg, bit = 0; 258 + int ret; 259 + 260 + ret = meson_get_bank(pc, pin, &bank); 261 + if (ret) 262 + return ret; 263 + 264 + meson_calc_reg_and_bit(bank, pin, REG_PULLEN, &reg, &bit); 265 + ret = regmap_update_bits(pc->reg_pullen, reg, BIT(bit), 0); 266 + if (ret) 267 + return ret; 268 + 269 + return 0; 270 + } 271 + 272 + static int meson_pinconf_enable_bias(struct meson_pinctrl *pc, unsigned int pin, 273 + bool pull_up) 274 + { 275 + struct meson_bank *bank; 276 + unsigned int reg, bit, val = 0; 277 + int ret; 278 + 279 + ret = meson_get_bank(pc, pin, &bank); 280 + if (ret) 281 + return ret; 282 + 283 + meson_calc_reg_and_bit(bank, pin, REG_PULL, &reg, &bit); 284 + if (pull_up) 285 + val = BIT(bit); 286 + 287 + ret = regmap_update_bits(pc->reg_pull, reg, BIT(bit), val); 288 + if (ret) 289 + return ret; 290 + 291 + meson_calc_reg_and_bit(bank, pin, REG_PULLEN, &reg, &bit); 292 + ret = regmap_update_bits(pc->reg_pullen, reg, BIT(bit), BIT(bit)); 293 + if (ret) 294 + return ret; 295 + 296 + return 0; 297 + } 298 + 299 + static int meson_pinconf_set_drive_strength(struct meson_pinctrl *pc, 300 + unsigned int pin, 301 + u16 drive_strength_ua) 302 + { 303 + struct meson_bank *bank; 304 + unsigned int reg, bit, ds_val; 305 + int ret; 306 + 307 + if (!pc->reg_ds) { 308 + dev_err(pc->dev, "drive-strength not supported\n"); 309 + return -ENOTSUPP; 310 + } 311 + 312 + ret = meson_get_bank(pc, pin, &bank); 313 + if (ret) 314 + return ret; 315 + 316 + meson_calc_reg_and_bit(bank, pin, REG_DS, &reg, &bit); 317 + bit = bit << 1; 318 + 319 + if (drive_strength_ua <= 500) { 320 + ds_val = MESON_PINCONF_DRV_500UA; 321 + } else if (drive_strength_ua <= 2500) { 322 + ds_val = MESON_PINCONF_DRV_2500UA; 323 + } else if (drive_strength_ua <= 3000) { 324 + ds_val = MESON_PINCONF_DRV_3000UA; 325 + } else if (drive_strength_ua <= 4000) { 326 + ds_val = MESON_PINCONF_DRV_4000UA; 327 + } else { 328 + dev_warn_once(pc->dev, 329 + "pin %u: invalid drive-strength : %d , default to 4mA\n", 330 + pin, drive_strength_ua); 331 + ds_val = MESON_PINCONF_DRV_4000UA; 332 + } 333 + 334 + ret = regmap_update_bits(pc->reg_ds, reg, 0x3 << bit, ds_val << bit); 335 + if (ret) 336 + return ret; 337 + 338 + return 0; 339 + } 340 + 341 + static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin, 342 + unsigned long *configs, unsigned num_configs) 343 + { 344 + struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 345 + enum pin_config_param param; 346 + unsigned int arg = 0; 347 + int i, ret; 348 + 184 349 for (i = 0; i < num_configs; i++) { 185 350 param = pinconf_to_config_param(configs[i]); 186 351 187 352 switch (param) { 188 - case PIN_CONFIG_BIAS_DISABLE: 189 - dev_dbg(pc->dev, "pin %u: disable bias\n", pin); 353 + case PIN_CONFIG_DRIVE_STRENGTH_UA: 354 + case PIN_CONFIG_OUTPUT_ENABLE: 355 + case PIN_CONFIG_OUTPUT: 356 + arg = pinconf_to_config_argument(configs[i]); 357 + break; 190 358 191 - meson_calc_reg_and_bit(bank, pin, REG_PULLEN, &reg, 192 - &bit); 193 - ret = regmap_update_bits(pc->reg_pullen, reg, 194 - BIT(bit), 0); 195 - if (ret) 196 - return ret; 359 + default: 360 + break; 361 + } 362 + 363 + switch (param) { 364 + case PIN_CONFIG_BIAS_DISABLE: 365 + ret = meson_pinconf_disable_bias(pc, pin); 197 366 break; 198 367 case PIN_CONFIG_BIAS_PULL_UP: 199 - dev_dbg(pc->dev, "pin %u: enable pull-up\n", pin); 200 - 201 - meson_calc_reg_and_bit(bank, pin, REG_PULLEN, 202 - &reg, &bit); 203 - ret = regmap_update_bits(pc->reg_pullen, reg, 204 - BIT(bit), BIT(bit)); 205 - if (ret) 206 - return ret; 207 - 208 - meson_calc_reg_and_bit(bank, pin, REG_PULL, &reg, &bit); 209 - ret = regmap_update_bits(pc->reg_pull, reg, 210 - BIT(bit), BIT(bit)); 211 - if (ret) 212 - return ret; 368 + ret = meson_pinconf_enable_bias(pc, pin, true); 213 369 break; 214 370 case PIN_CONFIG_BIAS_PULL_DOWN: 215 - dev_dbg(pc->dev, "pin %u: enable pull-down\n", pin); 216 - 217 - meson_calc_reg_and_bit(bank, pin, REG_PULLEN, 218 - &reg, &bit); 219 - ret = regmap_update_bits(pc->reg_pullen, reg, 220 - BIT(bit), BIT(bit)); 221 - if (ret) 222 - return ret; 223 - 224 - meson_calc_reg_and_bit(bank, pin, REG_PULL, &reg, &bit); 225 - ret = regmap_update_bits(pc->reg_pull, reg, 226 - BIT(bit), 0); 227 - if (ret) 228 - return ret; 371 + ret = meson_pinconf_enable_bias(pc, pin, false); 372 + break; 373 + case PIN_CONFIG_DRIVE_STRENGTH_UA: 374 + ret = meson_pinconf_set_drive_strength(pc, pin, arg); 375 + break; 376 + case PIN_CONFIG_OUTPUT_ENABLE: 377 + ret = meson_pinconf_set_output(pc, pin, arg); 378 + break; 379 + case PIN_CONFIG_OUTPUT: 380 + ret = meson_pinconf_set_output_drive(pc, pin, arg); 229 381 break; 230 382 default: 231 - return -ENOTSUPP; 383 + ret = -ENOTSUPP; 232 384 } 385 + 386 + if (ret) 387 + return ret; 233 388 } 234 389 235 390 return 0; ··· 424 269 return conf; 425 270 } 426 271 272 + static int meson_pinconf_get_drive_strength(struct meson_pinctrl *pc, 273 + unsigned int pin, 274 + u16 *drive_strength_ua) 275 + { 276 + struct meson_bank *bank; 277 + unsigned int reg, bit; 278 + unsigned int val; 279 + int ret; 280 + 281 + if (!pc->reg_ds) 282 + return -ENOTSUPP; 283 + 284 + ret = meson_get_bank(pc, pin, &bank); 285 + if (ret) 286 + return ret; 287 + 288 + meson_calc_reg_and_bit(bank, pin, REG_DS, &reg, &bit); 289 + 290 + ret = regmap_read(pc->reg_ds, reg, &val); 291 + if (ret) 292 + return ret; 293 + 294 + switch ((val >> bit) & 0x3) { 295 + case MESON_PINCONF_DRV_500UA: 296 + *drive_strength_ua = 500; 297 + break; 298 + case MESON_PINCONF_DRV_2500UA: 299 + *drive_strength_ua = 2500; 300 + break; 301 + case MESON_PINCONF_DRV_3000UA: 302 + *drive_strength_ua = 3000; 303 + break; 304 + case MESON_PINCONF_DRV_4000UA: 305 + *drive_strength_ua = 4000; 306 + break; 307 + default: 308 + return -EINVAL; 309 + } 310 + 311 + return 0; 312 + } 313 + 427 314 static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin, 428 315 unsigned long *config) 429 316 { 430 317 struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev); 431 318 enum pin_config_param param = pinconf_to_config_param(*config); 432 319 u16 arg; 320 + int ret; 433 321 434 322 switch (param) { 435 323 case PIN_CONFIG_BIAS_DISABLE: ··· 483 285 else 484 286 return -EINVAL; 485 287 break; 288 + case PIN_CONFIG_DRIVE_STRENGTH_UA: 289 + ret = meson_pinconf_get_drive_strength(pc, pin, &arg); 290 + if (ret) 291 + return ret; 292 + break; 293 + case PIN_CONFIG_OUTPUT_ENABLE: 294 + ret = meson_pinconf_get_output(pc, pin); 295 + if (ret <= 0) 296 + return -EINVAL; 297 + arg = 1; 298 + break; 299 + case PIN_CONFIG_OUTPUT: 300 + ret = meson_pinconf_get_output(pc, pin); 301 + if (ret <= 0) 302 + return -EINVAL; 303 + 304 + ret = meson_pinconf_get_drive(pc, pin); 305 + if (ret < 0) 306 + return -EINVAL; 307 + 308 + arg = ret; 309 + break; 310 + 486 311 default: 487 312 return -ENOTSUPP; 488 313 } ··· 550 329 551 330 static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 552 331 { 553 - struct meson_pinctrl *pc = gpiochip_get_data(chip); 554 - unsigned int reg, bit; 555 - struct meson_bank *bank; 556 - int ret; 557 - 558 - ret = meson_get_bank(pc, gpio, &bank); 559 - if (ret) 560 - return ret; 561 - 562 - meson_calc_reg_and_bit(bank, gpio, REG_DIR, &reg, &bit); 563 - 564 - return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), BIT(bit)); 332 + return meson_pinconf_set_output(gpiochip_get_data(chip), gpio, false); 565 333 } 566 334 567 335 static int meson_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, 568 336 int value) 569 337 { 570 - struct meson_pinctrl *pc = gpiochip_get_data(chip); 571 - unsigned int reg, bit; 572 - struct meson_bank *bank; 573 - int ret; 574 - 575 - ret = meson_get_bank(pc, gpio, &bank); 576 - if (ret) 577 - return ret; 578 - 579 - meson_calc_reg_and_bit(bank, gpio, REG_DIR, &reg, &bit); 580 - ret = regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 0); 581 - if (ret) 582 - return ret; 583 - 584 - meson_calc_reg_and_bit(bank, gpio, REG_OUT, &reg, &bit); 585 - return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 586 - value ? BIT(bit) : 0); 338 + return meson_pinconf_set_output_drive(gpiochip_get_data(chip), 339 + gpio, value); 587 340 } 588 341 589 342 static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) 590 343 { 591 - struct meson_pinctrl *pc = gpiochip_get_data(chip); 592 - unsigned int reg, bit; 593 - struct meson_bank *bank; 594 - int ret; 595 - 596 - ret = meson_get_bank(pc, gpio, &bank); 597 - if (ret) 598 - return; 599 - 600 - meson_calc_reg_and_bit(bank, gpio, REG_OUT, &reg, &bit); 601 - regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 602 - value ? BIT(bit) : 0); 344 + meson_pinconf_set_drive(gpiochip_get_data(chip), gpio, value); 603 345 } 604 346 605 347 static int meson_gpio_get(struct gpio_chip *chip, unsigned gpio)
+17 -1
drivers/pinctrl/meson/pinctrl-meson.h
··· 65 65 REG_DIR, 66 66 REG_OUT, 67 67 REG_IN, 68 + REG_DS, 68 69 NUM_REG, 70 + }; 71 + 72 + /** 73 + * enum meson_pinconf_drv - value of drive-strength supported 74 + */ 75 + enum meson_pinconf_drv { 76 + MESON_PINCONF_DRV_500UA, 77 + MESON_PINCONF_DRV_2500UA, 78 + MESON_PINCONF_DRV_3000UA, 79 + MESON_PINCONF_DRV_4000UA, 69 80 }; 70 81 71 82 /** ··· 137 126 .num_groups = ARRAY_SIZE(fn ## _groups), \ 138 127 } 139 128 140 - #define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \ 129 + #define BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, \ 130 + dsr, dsb) \ 141 131 { \ 142 132 .name = n, \ 143 133 .first = f, \ ··· 151 139 [REG_DIR] = { dr, db }, \ 152 140 [REG_OUT] = { or, ob }, \ 153 141 [REG_IN] = { ir, ib }, \ 142 + [REG_DS] = { dsr, dsb }, \ 154 143 }, \ 155 144 } 145 + 146 + #define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \ 147 + BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, 0, 0) 156 148 157 149 #define MESON_PIN(x) PINCTRL_PIN(x, #x) 158 150
+297 -279
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
··· 16 16 17 17 #include "pinctrl-mvebu.h" 18 18 19 - #define V(f6180, f6190, f6192, f6281, f6282, dx4122) \ 19 + #define V(f6180, f6190, f6192, f6281, f6282, dx4122, dx1135) \ 20 20 ((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \ 21 - (f6281 << 3) | (f6282 << 4) | (dx4122 << 5)) 21 + (f6281 << 3) | (f6282 << 4) | (dx4122 << 5) | \ 22 + (dx1135 << 6)) 22 23 23 24 enum kirkwood_variant { 24 - VARIANT_MV88F6180 = V(1, 0, 0, 0, 0, 0), 25 - VARIANT_MV88F6190 = V(0, 1, 0, 0, 0, 0), 26 - VARIANT_MV88F6192 = V(0, 0, 1, 0, 0, 0), 27 - VARIANT_MV88F6281 = V(0, 0, 0, 1, 0, 0), 28 - VARIANT_MV88F6282 = V(0, 0, 0, 0, 1, 0), 29 - VARIANT_MV98DX4122 = V(0, 0, 0, 0, 0, 1), 25 + VARIANT_MV88F6180 = V(1, 0, 0, 0, 0, 0, 0), 26 + VARIANT_MV88F6190 = V(0, 1, 0, 0, 0, 0, 0), 27 + VARIANT_MV88F6192 = V(0, 0, 1, 0, 0, 0, 0), 28 + VARIANT_MV88F6281 = V(0, 0, 0, 1, 0, 0, 0), 29 + VARIANT_MV88F6282 = V(0, 0, 0, 0, 1, 0, 0), 30 + VARIANT_MV98DX4122 = V(0, 0, 0, 0, 0, 1, 0), 31 + VARIANT_MV98DX1135 = V(0, 0, 0, 0, 0, 0, 1), 30 32 }; 31 33 32 34 static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = { 33 35 MPP_MODE(0, 34 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 35 - MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1, 1)), 36 - MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1))), 36 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 37 + MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1, 1, 1)), 38 + MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1, 1))), 37 39 MPP_MODE(1, 38 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 39 - MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1, 1)), 40 - MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1))), 40 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 41 + MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1, 1, 1)), 42 + MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1, 1))), 41 43 MPP_MODE(2, 42 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 43 - MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1, 1)), 44 - MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1))), 44 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 45 + MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1, 1, 1)), 46 + MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1, 1))), 45 47 MPP_MODE(3, 46 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 47 - MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1, 1)), 48 - MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1))), 48 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 49 + MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1, 1, 1)), 50 + MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1, 1))), 49 51 MPP_MODE(4, 50 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 51 - MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1, 1)), 52 - MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1, 1)), 53 - MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)), 54 - MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0)), 55 - MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0))), 52 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 53 + MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1, 1, 1)), 54 + MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1, 1, 1)), 55 + MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)), 56 + MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0, 0)), 57 + MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0, 0))), 56 58 MPP_MODE(5, 57 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 58 - MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1, 1)), 59 - MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1, 1)), 60 - MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0, 0)), 61 - MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), 62 - MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), 59 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 60 + MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1, 1, 1)), 61 + MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1, 1, 1)), 62 + MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0)), 63 + MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)), 64 + MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0, 0))), 63 65 MPP_MODE(6, 64 - MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), 65 - MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), 66 - MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), 66 + MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1, 1)), 67 + MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1, 1)), 68 + MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0))), 67 69 MPP_MODE(7, 68 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 69 - MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)), 70 - MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1)), 71 - MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0)), 72 - MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0))), 70 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 71 + MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1, 1)), 72 + MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1, 1)), 73 + MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0)), 74 + MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0, 0))), 73 75 MPP_MODE(8, 74 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 75 - MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1, 1)), 76 - MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1)), 77 - MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1, 1)), 78 - MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1, 0)), 79 - MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)), 80 - MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0, 0)), 81 - MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0))), 76 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 77 + MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1, 1, 1)), 78 + MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1, 1)), 79 + MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1, 1, 1)), 80 + MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1, 0, 0)), 81 + MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0, 0)), 82 + MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0, 0, 0)), 83 + MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0, 0))), 82 84 MPP_MODE(9, 83 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 84 - MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1, 1)), 85 - MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1)), 86 - MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1, 1)), 87 - MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)), 88 - MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0, 0)), 89 - MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0))), 85 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 86 + MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1, 1, 1)), 87 + MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1, 1)), 88 + MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1, 1, 1)), 89 + MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0, 0)), 90 + MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0, 0, 0)), 91 + MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0, 0))), 90 92 MPP_MODE(10, 91 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 92 - MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1)), 93 - MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1, 1)), 94 - MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)), 95 - MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), 93 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 94 + MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1, 1)), 95 + MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1, 1, 1)), 96 + MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)), 97 + MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0))), 96 98 MPP_MODE(11, 97 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 98 - MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1)), 99 - MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1, 1)), 100 - MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0, 0)), 101 - MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0, 0)), 102 - MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0)), 103 - MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0))), 99 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 100 + MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1, 1)), 101 + MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1, 1, 1)), 102 + MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0, 0, 0)), 103 + MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0, 0, 0)), 104 + MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0, 0)), 105 + MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0))), 104 106 MPP_MODE(12, 105 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1, 0)), 106 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 0)), 107 - MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1, 0)), 108 - MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0)), 109 - MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1, 0)), 110 - MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1, 0))), 107 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1, 0, 0)), 108 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 0, 0)), 109 + MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1, 0, 0)), 110 + MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0, 0)), 111 + MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1, 0, 0)), 112 + MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1, 0, 0))), 111 113 MPP_MODE(13, 112 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 113 - MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1, 0)), 114 - MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 1)), 115 - MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1, 0)), 116 - MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0))), 114 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 115 + MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1, 0, 0)), 116 + MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 1, 1)), 117 + MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1, 0, 0)), 118 + MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0, 0))), 117 119 MPP_MODE(14, 118 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 119 - MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1, 0)), 120 - MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 1)), 121 - MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)), 122 - MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0)), 123 - MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1, 0)), 124 - MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0))), 120 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 121 + MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1, 0, 0)), 122 + MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 1, 1)), 123 + MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0, 0)), 124 + MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0, 0)), 125 + MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1, 0, 0)), 126 + MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0, 0))), 125 127 MPP_MODE(15, 126 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 127 - MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1, 0)), 128 - MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1)), 129 - MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 0)), 130 - MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1, 0)), 131 - MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1, 0))), 128 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 129 + MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1, 0, 0)), 130 + MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1, 1)), 131 + MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 0, 0)), 132 + MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)), 133 + MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1, 0, 0))), 132 134 MPP_MODE(16, 133 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 134 - MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1, 0)), 135 - MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1)), 136 - MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 0)), 137 - MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1, 0)), 138 - MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1, 0)), 139 - MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0))), 135 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 136 + MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1, 0, 0)), 137 + MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1, 1)), 138 + MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 0, 0)), 139 + MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)), 140 + MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1, 0, 0)), 141 + MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0, 0))), 140 142 MPP_MODE(17, 141 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)), 142 - MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1, 0)), 143 - MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)), 144 - MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1, 0)), 145 - MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1, 0))), 143 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0, 0)), 144 + MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1, 0, 0)), 145 + MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0, 0)), 146 + MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1, 0, 0)), 147 + MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1, 0, 0))), 146 148 MPP_MODE(18, 147 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 148 - MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1, 1)), 149 - MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1, 0))), 149 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 150 + MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1, 1, 1)), 151 + MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1, 0, 0))), 150 152 MPP_MODE(19, 151 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), 152 - MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1, 1))), 153 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)), 154 + MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1, 1, 1))), 153 155 MPP_MODE(20, 154 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 155 - MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1, 0)), 156 - MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0)), 157 - MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1, 0)), 158 - MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0)), 159 - MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)), 160 - MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1, 0)), 161 - MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 0, 0, 0, 0, 0))), 156 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 157 + MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1, 0, 0)), 158 + MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0, 0)), 159 + MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1, 0, 0)), 160 + MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0, 0)), 161 + MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)), 162 + MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1, 0, 0)), 163 + MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 0, 0, 0, 0, 0, 0))), 162 164 MPP_MODE(21, 163 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 164 - MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1, 0)), 165 - MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1, 0)), 166 - MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1, 0)), 167 - MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0)), 168 - MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0)), 169 - MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), 170 - MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1, 0))), 165 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 166 + MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1, 0, 0)), 167 + MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1, 0, 0)), 168 + MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1, 0, 0)), 169 + MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0, 0)), 170 + MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0, 0)), 171 + MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)), 172 + MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1, 0, 0))), 171 173 MPP_MODE(22, 172 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 173 - MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1, 0)), 174 - MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1, 0)), 175 - MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1, 0)), 176 - MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0)), 177 - MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1, 0)), 178 - MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)), 179 - MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1, 0))), 174 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 175 + MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1, 0, 0)), 176 + MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1, 0, 0)), 177 + MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1, 0, 0)), 178 + MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0, 0)), 179 + MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1, 0, 0)), 180 + MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0, 0)), 181 + MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1, 0, 0))), 180 182 MPP_MODE(23, 181 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 182 - MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1, 0)), 183 - MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1, 0)), 184 - MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1, 0)), 185 - MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 0, 0, 0)), 186 - MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1, 0)), 187 - MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)), 188 - MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1, 0))), 183 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 184 + MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1, 0, 0)), 185 + MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1, 0, 0)), 186 + MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1, 0, 0)), 187 + MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 0, 0, 0, 0)), 188 + MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1, 0, 0)), 189 + MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0, 0)), 190 + MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1, 0, 0))), 189 191 MPP_MODE(24, 190 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 191 - MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1, 0)), 192 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1, 0)), 193 - MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1, 0)), 194 - MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 0, 0, 0)), 195 - MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1, 0)), 196 - MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1, 0))), 192 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 193 + MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1, 0, 0)), 194 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1, 0, 0)), 195 + MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1, 0, 0)), 196 + MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 0, 0, 0, 0)), 197 + MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1, 0, 0)), 198 + MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1, 0, 0))), 197 199 MPP_MODE(25, 198 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 199 - MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1, 0)), 200 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1, 0)), 201 - MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1, 0)), 202 - MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 0, 0, 0)), 203 - MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1, 0)), 204 - MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1, 0))), 200 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 201 + MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1, 0, 0)), 202 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1, 0, 0)), 203 + MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1, 0, 0)), 204 + MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 0, 0, 0, 0)), 205 + MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1, 0, 0)), 206 + MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1, 0, 0))), 205 207 MPP_MODE(26, 206 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 207 - MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1, 0)), 208 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0)), 209 - MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1, 0)), 210 - MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 0, 0, 0)), 211 - MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1, 0)), 212 - MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1, 0))), 208 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 209 + MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1, 0, 0)), 210 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0, 0)), 211 + MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1, 0, 0)), 212 + MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 0, 0, 0, 0)), 213 + MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1, 0, 0)), 214 + MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1, 0, 0))), 213 215 MPP_MODE(27, 214 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 215 - MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1, 0)), 216 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0)), 217 - MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1, 0)), 218 - MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 0, 0, 0)), 219 - MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1, 0)), 220 - MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1, 0))), 216 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 217 + MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1, 0, 0)), 218 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0, 0)), 219 + MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1, 0, 0)), 220 + MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 0, 0, 0, 0)), 221 + MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1, 0, 0)), 222 + MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1, 0, 0))), 221 223 MPP_MODE(28, 222 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 223 - MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1, 0)), 224 - MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1, 0)), 225 - MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1, 0)), 226 - MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 0, 0, 0)), 227 - MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0)), 228 - MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1, 0))), 224 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 0)), 225 + MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1, 0, 0)), 226 + MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1, 0, 0)), 227 + MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1, 0, 0)), 228 + MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 0, 0, 0, 0)), 229 + MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0, 0)), 230 + MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1, 0, 0)), 231 + MPP_VAR_FUNCTION(0x1, "nand", "ren", V(0, 0, 0, 0, 0, 0, 1))), 229 232 MPP_MODE(29, 230 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 231 - MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1, 0)), 232 - MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1, 0)), 233 - MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1, 0)), 234 - MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0)), 235 - MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1, 0))), 233 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 0)), 234 + MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1, 0, 0)), 235 + MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1, 0, 0)), 236 + MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1, 0, 0)), 237 + MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0, 0)), 238 + MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1, 0, 0)), 239 + MPP_VAR_FUNCTION(0x1, "nand", "wen", V(0, 0, 0, 0, 0, 0, 1))), 236 240 MPP_MODE(30, 237 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 238 - MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1, 0)), 239 - MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1, 0)), 240 - MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1, 0)), 241 - MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1, 0))), 241 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 242 + MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1, 0, 0)), 243 + MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1, 0, 0)), 244 + MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1, 0, 0)), 245 + MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1, 0, 0))), 242 246 MPP_MODE(31, 243 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 244 - MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1, 0)), 245 - MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1, 0)), 246 - MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1, 0)), 247 - MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1, 0))), 247 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 248 + MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1, 0, 0)), 249 + MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1, 0, 0)), 250 + MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1, 0, 0)), 251 + MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1, 0, 0))), 248 252 MPP_MODE(32, 249 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)), 250 - MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1, 0)), 251 - MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1, 0)), 252 - MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1, 0)), 253 - MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1, 0))), 253 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)), 254 + MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1, 0, 0)), 255 + MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1, 0, 0)), 256 + MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1, 0, 0)), 257 + MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1, 0, 0))), 254 258 MPP_MODE(33, 255 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1, 0)), 256 - MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1, 0)), 257 - MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1, 0)), 258 - MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1, 0))), 259 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1, 0, 1)), 260 + MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1, 0, 0)), 261 + MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1, 0, 0)), 262 + MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1, 0, 0))), 259 263 MPP_MODE(34, 260 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 1)), 261 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1, 0)), 262 - MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1, 0)), 263 - MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1, 0)), 264 - MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1, 0))), 264 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 1, 1)), 265 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1, 0, 0)), 266 + MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1, 0, 0)), 267 + MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1, 0, 0)), 268 + MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1, 0, 0)), 269 + MPP_VAR_FUNCTION(0x1, "nand", "ale", V(0, 0, 0, 0, 0, 0, 1))), 265 270 MPP_MODE(35, 266 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)), 267 - MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0)), 268 - MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1, 0)), 269 - MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), 270 - MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1, 0)), 271 - MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 1, 1, 1, 1, 0))), 271 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)), 272 + MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0, 0)), 273 + MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1, 0, 0)), 274 + MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)), 275 + MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1, 0, 0)), 276 + MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 1, 1, 1, 1, 0, 0)), 277 + MPP_VAR_FUNCTION(0x1, "nand", "cen", V(0, 0, 0, 0, 0, 0, 1))), 272 278 MPP_MODE(36, 273 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 274 - MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1, 0)), 275 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1, 0)), 276 - MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0)), 277 - MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1, 0))), 279 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 280 + MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1, 0, 0)), 281 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1, 0, 0)), 282 + MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0, 0)), 283 + MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1, 0, 0))), 278 284 MPP_MODE(37, 279 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 280 - MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1, 0)), 281 - MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1, 0)), 282 - MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0)), 283 - MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1, 0))), 285 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 286 + MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1, 0, 0)), 287 + MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1, 0, 0)), 288 + MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0, 0)), 289 + MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1, 0, 0))), 284 290 MPP_MODE(38, 285 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 286 - MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1, 0)), 287 - MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1, 0)), 288 - MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 1, 1, 0)), 289 - MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1, 0))), 291 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 292 + MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1, 0, 0)), 293 + MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1, 0, 0)), 294 + MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 1, 1, 0, 0)), 295 + MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1, 0, 0))), 290 296 MPP_MODE(39, 291 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 292 - MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1, 0)), 293 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1, 0)), 294 - MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 1, 1, 0)), 295 - MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1, 0))), 297 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 298 + MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1, 0, 0)), 299 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1, 0, 0)), 300 + MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 1, 1, 0, 0)), 301 + MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1, 0, 0))), 296 302 MPP_MODE(40, 297 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 298 - MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1, 0)), 299 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1, 0)), 300 - MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 1, 1, 0)), 301 - MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1, 0))), 303 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 304 + MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1, 0, 0)), 305 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1, 0, 0)), 306 + MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 1, 1, 0, 0)), 307 + MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1, 0, 0))), 302 308 MPP_MODE(41, 303 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 304 - MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1, 0)), 305 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0)), 306 - MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 1, 1, 0)), 307 - MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1, 0))), 309 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 310 + MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1, 0, 0)), 311 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0, 0)), 312 + MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 1, 1, 0, 0)), 313 + MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1, 0, 0))), 308 314 MPP_MODE(42, 309 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 310 - MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1, 0)), 311 - MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0)), 312 - MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 1, 1, 0)), 313 - MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1, 0))), 315 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 316 + MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1, 0, 0)), 317 + MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0, 0)), 318 + MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 1, 1, 0, 0)), 319 + MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1, 0, 0))), 314 320 MPP_MODE(43, 315 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 316 - MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1, 0)), 317 - MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1, 0)), 318 - MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 1, 1, 0)), 319 - MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1, 0))), 321 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 322 + MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1, 0, 0)), 323 + MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1, 0, 0)), 324 + MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 1, 1, 0, 0)), 325 + MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1, 0, 0))), 320 326 MPP_MODE(44, 321 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)), 322 - MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1, 0)), 323 - MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1, 0)), 324 - MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0)), 325 - MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1, 0))), 327 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)), 328 + MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1, 0, 0)), 329 + MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1, 0, 0)), 330 + MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0, 0)), 331 + MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1, 0, 0))), 326 332 MPP_MODE(45, 327 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)), 328 - MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1, 0)), 329 - MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1, 0)), 330 - MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1, 0))), 333 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1, 1)), 334 + MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1, 0, 0)), 335 + MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1, 0, 0)), 336 + MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1, 0, 0))), 331 337 MPP_MODE(46, 332 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)), 333 - MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1, 0)), 334 - MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1, 0)), 335 - MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0))), 338 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0, 0)), 339 + MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1, 0, 0)), 340 + MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1, 0, 0)), 341 + MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0, 0))), 336 342 MPP_MODE(47, 337 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)), 338 - MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1, 0)), 339 - MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1, 0)), 340 - MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), 343 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0, 0)), 344 + MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1, 0, 0)), 345 + MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1, 0, 0)), 346 + MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0, 0))), 341 347 MPP_MODE(48, 342 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)), 343 - MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1, 0)), 344 - MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1, 0)), 345 - MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1, 0))), 348 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0, 0)), 349 + MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1, 0, 0)), 350 + MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1, 0, 0)), 351 + MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1, 0, 0))), 346 352 MPP_MODE(49, 347 - MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 1)), 348 - MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1, 0)), 349 - MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0, 0)), 350 - MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1, 0)), 351 - MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0, 0)), 352 - MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1, 0)), 353 - MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1, 0))), 353 + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 1, 1)), 354 + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1, 0, 0)), 355 + MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0, 0, 0)), 356 + MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1, 0, 0)), 357 + MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0, 0, 0)), 358 + MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1, 0, 0)), 359 + MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1, 0, 0))), 354 360 }; 355 361 356 362 static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = { ··· 446 440 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges), 447 441 }; 448 442 443 + static struct mvebu_pinctrl_soc_info mv98dx1135_info = { 444 + .variant = VARIANT_MV98DX1135, 445 + .controls = mv88f628x_mpp_controls, 446 + .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls), 447 + .modes = mv88f6xxx_mpp_modes, 448 + .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes), 449 + .gpioranges = mv88f628x_gpio_ranges, 450 + .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges), 451 + }; 452 + 453 + 449 454 static const struct of_device_id kirkwood_pinctrl_of_match[] = { 450 455 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info }, 451 456 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info }, ··· 464 447 { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info }, 465 448 { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info }, 466 449 { .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info }, 450 + { .compatible = "marvell,98dx1135-pinctrl", .data = &mv98dx1135_info }, 467 451 { } 468 452 }; 469 453
+2
drivers/pinctrl/pinconf-generic.c
··· 38 38 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false), 39 39 PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false), 40 40 PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA", true), 41 + PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH_UA, "output drive strength", "uA", true), 41 42 PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec", true), 42 43 PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false), 43 44 PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false), ··· 167 166 { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, 168 167 { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 }, 169 168 { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, 169 + { "drive-strength-microamp", PIN_CONFIG_DRIVE_STRENGTH_UA, 0 }, 170 170 { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 }, 171 171 { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, 172 172 { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 },
+565 -172
drivers/pinctrl/pinctrl-bm1880.c
··· 27 27 * @ngroups: Number of @groups 28 28 * @funcs: Pinmux functions 29 29 * @nfuncs: Number of @funcs 30 + * @pconf: Pinconf data 30 31 */ 31 32 struct bm1880_pinctrl { 32 33 void __iomem *base; ··· 36 35 unsigned int ngroups; 37 36 const struct bm1880_pinmux_function *funcs; 38 37 unsigned int nfuncs; 38 + const struct bm1880_pinconf_data *pinconf; 39 39 }; 40 40 41 41 /** ··· 57 55 * @groups: List of pingroups for this function. 58 56 * @ngroups: Number of entries in @groups. 59 57 * @mux_val: Selector for this function 60 - * @mux_mask: Mask for function specific selector 61 58 * @mux: Offset of function specific mux 62 59 * @mux_shift: Shift for function specific selector 63 60 */ ··· 65 64 const char * const *groups; 66 65 unsigned int ngroups; 67 66 u32 mux_val; 68 - u32 mux_mask; 69 67 u32 mux; 70 68 u8 mux_shift; 69 + }; 70 + 71 + /** 72 + * struct bm1880_pinconf_data - pinconf data 73 + * @drv_bits: Drive strength bit width 74 + */ 75 + struct bm1880_pinconf_data { 76 + u32 drv_bits; 71 77 }; 72 78 73 79 static const struct pinctrl_pin_desc bm1880_pins[] = { ··· 644 636 static const char * const i2s1_mclkin_group[] = { "i2s1_mclkin_grp" }; 645 637 static const char * const spi0_group[] = { "spi0_grp" }; 646 638 647 - #define BM1880_PINMUX_FUNCTION(fname, mval, mask) \ 639 + #define BM1880_PINMUX_FUNCTION(fname, mval) \ 648 640 [F_##fname] = { \ 649 641 .name = #fname, \ 650 642 .groups = fname##_group, \ 651 643 .ngroups = ARRAY_SIZE(fname##_group), \ 652 644 .mux_val = mval, \ 653 - .mux_mask = mask, \ 654 - } 655 - 656 - #define BM1880_PINMUX_FUNCTION_MUX(fname, mval, mask, offset, shift)\ 657 - [F_##fname] = { \ 658 - .name = #fname, \ 659 - .groups = fname##_group, \ 660 - .ngroups = ARRAY_SIZE(fname##_group), \ 661 - .mux_val = mval, \ 662 - .mux_mask = mask, \ 663 - .mux = offset, \ 664 - .mux_shift = shift, \ 665 645 } 666 646 667 647 static const struct bm1880_pinmux_function bm1880_pmux_functions[] = { 668 - BM1880_PINMUX_FUNCTION(nand, 2, 0x03), 669 - BM1880_PINMUX_FUNCTION(spi, 0, 0x03), 670 - BM1880_PINMUX_FUNCTION(emmc, 1, 0x03), 671 - BM1880_PINMUX_FUNCTION(sdio, 0, 0x03), 672 - BM1880_PINMUX_FUNCTION(eth0, 0, 0x03), 673 - BM1880_PINMUX_FUNCTION_MUX(pwm0, 2, 0x0F, 0x50, 0x00), 674 - BM1880_PINMUX_FUNCTION_MUX(pwm1, 2, 0x0F, 0x50, 0x04), 675 - BM1880_PINMUX_FUNCTION_MUX(pwm2, 2, 0x0F, 0x50, 0x08), 676 - BM1880_PINMUX_FUNCTION_MUX(pwm3, 2, 0x0F, 0x50, 0x0C), 677 - BM1880_PINMUX_FUNCTION_MUX(pwm4, 2, 0x0F, 0x50, 0x10), 678 - BM1880_PINMUX_FUNCTION_MUX(pwm5, 2, 0x0F, 0x50, 0x14), 679 - BM1880_PINMUX_FUNCTION_MUX(pwm6, 2, 0x0F, 0x50, 0x18), 680 - BM1880_PINMUX_FUNCTION_MUX(pwm7, 2, 0x0F, 0x50, 0x1C), 681 - BM1880_PINMUX_FUNCTION_MUX(pwm8, 2, 0x0F, 0x54, 0x00), 682 - BM1880_PINMUX_FUNCTION_MUX(pwm9, 2, 0x0F, 0x54, 0x04), 683 - BM1880_PINMUX_FUNCTION_MUX(pwm10, 2, 0x0F, 0x54, 0x08), 684 - BM1880_PINMUX_FUNCTION_MUX(pwm11, 2, 0x0F, 0x54, 0x0C), 685 - BM1880_PINMUX_FUNCTION_MUX(pwm12, 2, 0x0F, 0x54, 0x10), 686 - BM1880_PINMUX_FUNCTION_MUX(pwm13, 2, 0x0F, 0x54, 0x14), 687 - BM1880_PINMUX_FUNCTION_MUX(pwm14, 2, 0x0F, 0x54, 0x18), 688 - BM1880_PINMUX_FUNCTION_MUX(pwm15, 2, 0x0F, 0x54, 0x1C), 689 - BM1880_PINMUX_FUNCTION_MUX(pwm16, 2, 0x0F, 0x58, 0x00), 690 - BM1880_PINMUX_FUNCTION_MUX(pwm17, 2, 0x0F, 0x58, 0x04), 691 - BM1880_PINMUX_FUNCTION_MUX(pwm18, 2, 0x0F, 0x58, 0x08), 692 - BM1880_PINMUX_FUNCTION_MUX(pwm19, 2, 0x0F, 0x58, 0x0C), 693 - BM1880_PINMUX_FUNCTION_MUX(pwm20, 2, 0x0F, 0x58, 0x10), 694 - BM1880_PINMUX_FUNCTION_MUX(pwm21, 2, 0x0F, 0x58, 0x14), 695 - BM1880_PINMUX_FUNCTION_MUX(pwm22, 2, 0x0F, 0x58, 0x18), 696 - BM1880_PINMUX_FUNCTION_MUX(pwm23, 2, 0x0F, 0x58, 0x1C), 697 - BM1880_PINMUX_FUNCTION_MUX(pwm24, 2, 0x0F, 0x5C, 0x00), 698 - BM1880_PINMUX_FUNCTION_MUX(pwm25, 2, 0x0F, 0x5C, 0x04), 699 - BM1880_PINMUX_FUNCTION_MUX(pwm26, 2, 0x0F, 0x5C, 0x08), 700 - BM1880_PINMUX_FUNCTION_MUX(pwm27, 2, 0x0F, 0x5C, 0x0C), 701 - BM1880_PINMUX_FUNCTION_MUX(pwm28, 2, 0x0F, 0x5C, 0x10), 702 - BM1880_PINMUX_FUNCTION_MUX(pwm29, 2, 0x0F, 0x5C, 0x14), 703 - BM1880_PINMUX_FUNCTION_MUX(pwm30, 2, 0x0F, 0x5C, 0x18), 704 - BM1880_PINMUX_FUNCTION_MUX(pwm31, 2, 0x0F, 0x5C, 0x1C), 705 - BM1880_PINMUX_FUNCTION_MUX(pwm32, 2, 0x0F, 0x60, 0x00), 706 - BM1880_PINMUX_FUNCTION_MUX(pwm33, 2, 0x0F, 0x60, 0x04), 707 - BM1880_PINMUX_FUNCTION_MUX(pwm34, 2, 0x0F, 0x60, 0x08), 708 - BM1880_PINMUX_FUNCTION_MUX(pwm35, 2, 0x0F, 0x60, 0x0C), 709 - BM1880_PINMUX_FUNCTION_MUX(pwm36, 2, 0x0F, 0x60, 0x10), 710 - BM1880_PINMUX_FUNCTION_MUX(pwm37, 2, 0x0F, 0x60, 0x1C), 711 - BM1880_PINMUX_FUNCTION(i2c0, 1, 0x03), 712 - BM1880_PINMUX_FUNCTION(i2c1, 1, 0x03), 713 - BM1880_PINMUX_FUNCTION(i2c2, 1, 0x03), 714 - BM1880_PINMUX_FUNCTION(i2c3, 1, 0x03), 715 - BM1880_PINMUX_FUNCTION(i2c4, 1, 0x03), 716 - BM1880_PINMUX_FUNCTION(uart0, 1, 0x03), 717 - BM1880_PINMUX_FUNCTION(uart1, 1, 0x03), 718 - BM1880_PINMUX_FUNCTION(uart2, 1, 0x03), 719 - BM1880_PINMUX_FUNCTION(uart3, 1, 0x03), 720 - BM1880_PINMUX_FUNCTION(uart4, 1, 0x03), 721 - BM1880_PINMUX_FUNCTION(uart5, 1, 0x03), 722 - BM1880_PINMUX_FUNCTION(uart6, 1, 0x03), 723 - BM1880_PINMUX_FUNCTION(uart7, 1, 0x03), 724 - BM1880_PINMUX_FUNCTION(uart8, 1, 0x03), 725 - BM1880_PINMUX_FUNCTION(uart9, 1, 0x03), 726 - BM1880_PINMUX_FUNCTION(uart10, 1, 0x03), 727 - BM1880_PINMUX_FUNCTION(uart11, 1, 0x03), 728 - BM1880_PINMUX_FUNCTION(uart12, 3, 0x03), 729 - BM1880_PINMUX_FUNCTION(uart13, 3, 0x03), 730 - BM1880_PINMUX_FUNCTION(uart14, 3, 0x03), 731 - BM1880_PINMUX_FUNCTION(uart15, 3, 0x03), 732 - BM1880_PINMUX_FUNCTION_MUX(gpio0, 0, 0x03, 0x4E0, 0x14), 733 - BM1880_PINMUX_FUNCTION_MUX(gpio1, 0, 0x03, 0x4E4, 0x04), 734 - BM1880_PINMUX_FUNCTION_MUX(gpio2, 0, 0x03, 0x4E4, 0x14), 735 - BM1880_PINMUX_FUNCTION_MUX(gpio3, 0, 0x03, 0x4E8, 0x04), 736 - BM1880_PINMUX_FUNCTION_MUX(gpio4, 0, 0x03, 0x4E8, 0x14), 737 - BM1880_PINMUX_FUNCTION_MUX(gpio5, 0, 0x03, 0x4EC, 0x04), 738 - BM1880_PINMUX_FUNCTION_MUX(gpio6, 0, 0x03, 0x4EC, 0x14), 739 - BM1880_PINMUX_FUNCTION_MUX(gpio7, 0, 0x03, 0x4F0, 0x04), 740 - BM1880_PINMUX_FUNCTION_MUX(gpio8, 0, 0x03, 0x4F0, 0x14), 741 - BM1880_PINMUX_FUNCTION_MUX(gpio9, 0, 0x03, 0x4F4, 0x04), 742 - BM1880_PINMUX_FUNCTION_MUX(gpio10, 0, 0x03, 0x4F4, 0x14), 743 - BM1880_PINMUX_FUNCTION_MUX(gpio11, 0, 0x03, 0x4F8, 0x04), 744 - BM1880_PINMUX_FUNCTION_MUX(gpio12, 1, 0x03, 0x4F8, 0x14), 745 - BM1880_PINMUX_FUNCTION_MUX(gpio13, 1, 0x03, 0x4FC, 0x04), 746 - BM1880_PINMUX_FUNCTION_MUX(gpio14, 0, 0x03, 0x474, 0x14), 747 - BM1880_PINMUX_FUNCTION_MUX(gpio15, 0, 0x03, 0x478, 0x04), 748 - BM1880_PINMUX_FUNCTION_MUX(gpio16, 0, 0x03, 0x478, 0x14), 749 - BM1880_PINMUX_FUNCTION_MUX(gpio17, 0, 0x03, 0x47C, 0x04), 750 - BM1880_PINMUX_FUNCTION_MUX(gpio18, 0, 0x03, 0x47C, 0x14), 751 - BM1880_PINMUX_FUNCTION_MUX(gpio19, 0, 0x03, 0x480, 0x04), 752 - BM1880_PINMUX_FUNCTION_MUX(gpio20, 0, 0x03, 0x480, 0x14), 753 - BM1880_PINMUX_FUNCTION_MUX(gpio21, 0, 0x03, 0x484, 0x04), 754 - BM1880_PINMUX_FUNCTION_MUX(gpio22, 0, 0x03, 0x484, 0x14), 755 - BM1880_PINMUX_FUNCTION_MUX(gpio23, 0, 0x03, 0x488, 0x04), 756 - BM1880_PINMUX_FUNCTION_MUX(gpio24, 0, 0x03, 0x488, 0x14), 757 - BM1880_PINMUX_FUNCTION_MUX(gpio25, 0, 0x03, 0x48C, 0x04), 758 - BM1880_PINMUX_FUNCTION_MUX(gpio26, 0, 0x03, 0x48C, 0x14), 759 - BM1880_PINMUX_FUNCTION_MUX(gpio27, 0, 0x03, 0x490, 0x04), 760 - BM1880_PINMUX_FUNCTION_MUX(gpio28, 0, 0x03, 0x490, 0x14), 761 - BM1880_PINMUX_FUNCTION_MUX(gpio29, 0, 0x03, 0x494, 0x04), 762 - BM1880_PINMUX_FUNCTION_MUX(gpio30, 0, 0x03, 0x494, 0x14), 763 - BM1880_PINMUX_FUNCTION_MUX(gpio31, 0, 0x03, 0x498, 0x04), 764 - BM1880_PINMUX_FUNCTION_MUX(gpio32, 0, 0x03, 0x498, 0x14), 765 - BM1880_PINMUX_FUNCTION_MUX(gpio33, 0, 0x03, 0x49C, 0x04), 766 - BM1880_PINMUX_FUNCTION_MUX(gpio34, 0, 0x03, 0x49C, 0x14), 767 - BM1880_PINMUX_FUNCTION_MUX(gpio35, 0, 0x03, 0x4A0, 0x04), 768 - BM1880_PINMUX_FUNCTION_MUX(gpio36, 0, 0x03, 0x4A0, 0x14), 769 - BM1880_PINMUX_FUNCTION_MUX(gpio37, 0, 0x03, 0x4A4, 0x04), 770 - BM1880_PINMUX_FUNCTION_MUX(gpio38, 0, 0x03, 0x4A4, 0x14), 771 - BM1880_PINMUX_FUNCTION_MUX(gpio39, 0, 0x03, 0x4A8, 0x04), 772 - BM1880_PINMUX_FUNCTION_MUX(gpio40, 0, 0x03, 0x4A8, 0x14), 773 - BM1880_PINMUX_FUNCTION_MUX(gpio41, 0, 0x03, 0x4AC, 0x04), 774 - BM1880_PINMUX_FUNCTION_MUX(gpio42, 0, 0x03, 0x4AC, 0x14), 775 - BM1880_PINMUX_FUNCTION_MUX(gpio43, 0, 0x03, 0x4B0, 0x04), 776 - BM1880_PINMUX_FUNCTION_MUX(gpio44, 0, 0x03, 0x4B0, 0x14), 777 - BM1880_PINMUX_FUNCTION_MUX(gpio45, 0, 0x03, 0x4B4, 0x04), 778 - BM1880_PINMUX_FUNCTION_MUX(gpio46, 0, 0x03, 0x4B4, 0x14), 779 - BM1880_PINMUX_FUNCTION_MUX(gpio47, 0, 0x03, 0x4B8, 0x04), 780 - BM1880_PINMUX_FUNCTION_MUX(gpio48, 0, 0x03, 0x4B8, 0x14), 781 - BM1880_PINMUX_FUNCTION_MUX(gpio49, 0, 0x03, 0x4BC, 0x04), 782 - BM1880_PINMUX_FUNCTION_MUX(gpio50, 0, 0x03, 0x4BC, 0x14), 783 - BM1880_PINMUX_FUNCTION_MUX(gpio51, 0, 0x03, 0x4C0, 0x04), 784 - BM1880_PINMUX_FUNCTION_MUX(gpio52, 0, 0x03, 0x4C0, 0x14), 785 - BM1880_PINMUX_FUNCTION_MUX(gpio53, 0, 0x03, 0x4C4, 0x04), 786 - BM1880_PINMUX_FUNCTION_MUX(gpio54, 0, 0x03, 0x4C4, 0x14), 787 - BM1880_PINMUX_FUNCTION_MUX(gpio55, 0, 0x03, 0x4C8, 0x04), 788 - BM1880_PINMUX_FUNCTION_MUX(gpio56, 0, 0x03, 0x4C8, 0x14), 789 - BM1880_PINMUX_FUNCTION_MUX(gpio57, 0, 0x03, 0x4CC, 0x04), 790 - BM1880_PINMUX_FUNCTION_MUX(gpio58, 0, 0x03, 0x4CC, 0x14), 791 - BM1880_PINMUX_FUNCTION_MUX(gpio59, 0, 0x03, 0x4D0, 0x04), 792 - BM1880_PINMUX_FUNCTION_MUX(gpio60, 0, 0x03, 0x4D0, 0x14), 793 - BM1880_PINMUX_FUNCTION_MUX(gpio61, 0, 0x03, 0x4D4, 0x04), 794 - BM1880_PINMUX_FUNCTION_MUX(gpio62, 0, 0x03, 0x4D4, 0x14), 795 - BM1880_PINMUX_FUNCTION_MUX(gpio63, 0, 0x03, 0x4D8, 0x04), 796 - BM1880_PINMUX_FUNCTION_MUX(gpio64, 0, 0x03, 0x4D8, 0x14), 797 - BM1880_PINMUX_FUNCTION_MUX(gpio65, 0, 0x03, 0x4DC, 0x04), 798 - BM1880_PINMUX_FUNCTION_MUX(gpio66, 0, 0x03, 0x4DC, 0x14), 799 - BM1880_PINMUX_FUNCTION_MUX(gpio67, 0, 0x03, 0x4E0, 0x04), 800 - BM1880_PINMUX_FUNCTION(eth1, 1, 0x03), 801 - BM1880_PINMUX_FUNCTION(i2s0, 2, 0x03), 802 - BM1880_PINMUX_FUNCTION(i2s0_mclkin, 1, 0x03), 803 - BM1880_PINMUX_FUNCTION(i2s1, 2, 0x03), 804 - BM1880_PINMUX_FUNCTION(i2s1_mclkin, 1, 0x03), 805 - BM1880_PINMUX_FUNCTION(spi0, 1, 0x03), 648 + BM1880_PINMUX_FUNCTION(nand, 2), 649 + BM1880_PINMUX_FUNCTION(spi, 0), 650 + BM1880_PINMUX_FUNCTION(emmc, 1), 651 + BM1880_PINMUX_FUNCTION(sdio, 0), 652 + BM1880_PINMUX_FUNCTION(eth0, 0), 653 + BM1880_PINMUX_FUNCTION(pwm0, 2), 654 + BM1880_PINMUX_FUNCTION(pwm1, 2), 655 + BM1880_PINMUX_FUNCTION(pwm2, 2), 656 + BM1880_PINMUX_FUNCTION(pwm3, 2), 657 + BM1880_PINMUX_FUNCTION(pwm4, 2), 658 + BM1880_PINMUX_FUNCTION(pwm5, 2), 659 + BM1880_PINMUX_FUNCTION(pwm6, 2), 660 + BM1880_PINMUX_FUNCTION(pwm7, 2), 661 + BM1880_PINMUX_FUNCTION(pwm8, 2), 662 + BM1880_PINMUX_FUNCTION(pwm9, 2), 663 + BM1880_PINMUX_FUNCTION(pwm10, 2), 664 + BM1880_PINMUX_FUNCTION(pwm11, 2), 665 + BM1880_PINMUX_FUNCTION(pwm12, 2), 666 + BM1880_PINMUX_FUNCTION(pwm13, 2), 667 + BM1880_PINMUX_FUNCTION(pwm14, 2), 668 + BM1880_PINMUX_FUNCTION(pwm15, 2), 669 + BM1880_PINMUX_FUNCTION(pwm16, 2), 670 + BM1880_PINMUX_FUNCTION(pwm17, 2), 671 + BM1880_PINMUX_FUNCTION(pwm18, 2), 672 + BM1880_PINMUX_FUNCTION(pwm19, 2), 673 + BM1880_PINMUX_FUNCTION(pwm20, 2), 674 + BM1880_PINMUX_FUNCTION(pwm21, 2), 675 + BM1880_PINMUX_FUNCTION(pwm22, 2), 676 + BM1880_PINMUX_FUNCTION(pwm23, 2), 677 + BM1880_PINMUX_FUNCTION(pwm24, 2), 678 + BM1880_PINMUX_FUNCTION(pwm25, 2), 679 + BM1880_PINMUX_FUNCTION(pwm26, 2), 680 + BM1880_PINMUX_FUNCTION(pwm27, 2), 681 + BM1880_PINMUX_FUNCTION(pwm28, 2), 682 + BM1880_PINMUX_FUNCTION(pwm29, 2), 683 + BM1880_PINMUX_FUNCTION(pwm30, 2), 684 + BM1880_PINMUX_FUNCTION(pwm31, 2), 685 + BM1880_PINMUX_FUNCTION(pwm32, 2), 686 + BM1880_PINMUX_FUNCTION(pwm33, 2), 687 + BM1880_PINMUX_FUNCTION(pwm34, 2), 688 + BM1880_PINMUX_FUNCTION(pwm35, 2), 689 + BM1880_PINMUX_FUNCTION(pwm36, 2), 690 + BM1880_PINMUX_FUNCTION(pwm37, 2), 691 + BM1880_PINMUX_FUNCTION(i2c0, 1), 692 + BM1880_PINMUX_FUNCTION(i2c1, 1), 693 + BM1880_PINMUX_FUNCTION(i2c2, 1), 694 + BM1880_PINMUX_FUNCTION(i2c3, 1), 695 + BM1880_PINMUX_FUNCTION(i2c4, 1), 696 + BM1880_PINMUX_FUNCTION(uart0, 3), 697 + BM1880_PINMUX_FUNCTION(uart1, 3), 698 + BM1880_PINMUX_FUNCTION(uart2, 3), 699 + BM1880_PINMUX_FUNCTION(uart3, 3), 700 + BM1880_PINMUX_FUNCTION(uart4, 1), 701 + BM1880_PINMUX_FUNCTION(uart5, 1), 702 + BM1880_PINMUX_FUNCTION(uart6, 1), 703 + BM1880_PINMUX_FUNCTION(uart7, 1), 704 + BM1880_PINMUX_FUNCTION(uart8, 1), 705 + BM1880_PINMUX_FUNCTION(uart9, 1), 706 + BM1880_PINMUX_FUNCTION(uart10, 1), 707 + BM1880_PINMUX_FUNCTION(uart11, 1), 708 + BM1880_PINMUX_FUNCTION(uart12, 3), 709 + BM1880_PINMUX_FUNCTION(uart13, 3), 710 + BM1880_PINMUX_FUNCTION(uart14, 3), 711 + BM1880_PINMUX_FUNCTION(uart15, 3), 712 + BM1880_PINMUX_FUNCTION(gpio0, 0), 713 + BM1880_PINMUX_FUNCTION(gpio1, 0), 714 + BM1880_PINMUX_FUNCTION(gpio2, 0), 715 + BM1880_PINMUX_FUNCTION(gpio3, 0), 716 + BM1880_PINMUX_FUNCTION(gpio4, 0), 717 + BM1880_PINMUX_FUNCTION(gpio5, 0), 718 + BM1880_PINMUX_FUNCTION(gpio6, 0), 719 + BM1880_PINMUX_FUNCTION(gpio7, 0), 720 + BM1880_PINMUX_FUNCTION(gpio8, 0), 721 + BM1880_PINMUX_FUNCTION(gpio9, 0), 722 + BM1880_PINMUX_FUNCTION(gpio10, 0), 723 + BM1880_PINMUX_FUNCTION(gpio11, 0), 724 + BM1880_PINMUX_FUNCTION(gpio12, 1), 725 + BM1880_PINMUX_FUNCTION(gpio13, 1), 726 + BM1880_PINMUX_FUNCTION(gpio14, 0), 727 + BM1880_PINMUX_FUNCTION(gpio15, 0), 728 + BM1880_PINMUX_FUNCTION(gpio16, 0), 729 + BM1880_PINMUX_FUNCTION(gpio17, 0), 730 + BM1880_PINMUX_FUNCTION(gpio18, 0), 731 + BM1880_PINMUX_FUNCTION(gpio19, 0), 732 + BM1880_PINMUX_FUNCTION(gpio20, 0), 733 + BM1880_PINMUX_FUNCTION(gpio21, 0), 734 + BM1880_PINMUX_FUNCTION(gpio22, 0), 735 + BM1880_PINMUX_FUNCTION(gpio23, 0), 736 + BM1880_PINMUX_FUNCTION(gpio24, 0), 737 + BM1880_PINMUX_FUNCTION(gpio25, 0), 738 + BM1880_PINMUX_FUNCTION(gpio26, 0), 739 + BM1880_PINMUX_FUNCTION(gpio27, 0), 740 + BM1880_PINMUX_FUNCTION(gpio28, 0), 741 + BM1880_PINMUX_FUNCTION(gpio29, 0), 742 + BM1880_PINMUX_FUNCTION(gpio30, 0), 743 + BM1880_PINMUX_FUNCTION(gpio31, 0), 744 + BM1880_PINMUX_FUNCTION(gpio32, 0), 745 + BM1880_PINMUX_FUNCTION(gpio33, 0), 746 + BM1880_PINMUX_FUNCTION(gpio34, 0), 747 + BM1880_PINMUX_FUNCTION(gpio35, 0), 748 + BM1880_PINMUX_FUNCTION(gpio36, 0), 749 + BM1880_PINMUX_FUNCTION(gpio37, 0), 750 + BM1880_PINMUX_FUNCTION(gpio38, 0), 751 + BM1880_PINMUX_FUNCTION(gpio39, 0), 752 + BM1880_PINMUX_FUNCTION(gpio40, 0), 753 + BM1880_PINMUX_FUNCTION(gpio41, 0), 754 + BM1880_PINMUX_FUNCTION(gpio42, 0), 755 + BM1880_PINMUX_FUNCTION(gpio43, 0), 756 + BM1880_PINMUX_FUNCTION(gpio44, 0), 757 + BM1880_PINMUX_FUNCTION(gpio45, 0), 758 + BM1880_PINMUX_FUNCTION(gpio46, 0), 759 + BM1880_PINMUX_FUNCTION(gpio47, 0), 760 + BM1880_PINMUX_FUNCTION(gpio48, 0), 761 + BM1880_PINMUX_FUNCTION(gpio49, 0), 762 + BM1880_PINMUX_FUNCTION(gpio50, 0), 763 + BM1880_PINMUX_FUNCTION(gpio51, 0), 764 + BM1880_PINMUX_FUNCTION(gpio52, 0), 765 + BM1880_PINMUX_FUNCTION(gpio53, 0), 766 + BM1880_PINMUX_FUNCTION(gpio54, 0), 767 + BM1880_PINMUX_FUNCTION(gpio55, 0), 768 + BM1880_PINMUX_FUNCTION(gpio56, 0), 769 + BM1880_PINMUX_FUNCTION(gpio57, 0), 770 + BM1880_PINMUX_FUNCTION(gpio58, 0), 771 + BM1880_PINMUX_FUNCTION(gpio59, 0), 772 + BM1880_PINMUX_FUNCTION(gpio60, 0), 773 + BM1880_PINMUX_FUNCTION(gpio61, 0), 774 + BM1880_PINMUX_FUNCTION(gpio62, 0), 775 + BM1880_PINMUX_FUNCTION(gpio63, 0), 776 + BM1880_PINMUX_FUNCTION(gpio64, 0), 777 + BM1880_PINMUX_FUNCTION(gpio65, 0), 778 + BM1880_PINMUX_FUNCTION(gpio66, 0), 779 + BM1880_PINMUX_FUNCTION(gpio67, 0), 780 + BM1880_PINMUX_FUNCTION(eth1, 1), 781 + BM1880_PINMUX_FUNCTION(i2s0, 2), 782 + BM1880_PINMUX_FUNCTION(i2s0_mclkin, 1), 783 + BM1880_PINMUX_FUNCTION(i2s1, 2), 784 + BM1880_PINMUX_FUNCTION(i2s1_mclkin, 1), 785 + BM1880_PINMUX_FUNCTION(spi0, 1), 786 + }; 787 + 788 + #define BM1880_PINCONF_DAT(_width) \ 789 + { \ 790 + .drv_bits = _width, \ 791 + } 792 + 793 + static const struct bm1880_pinconf_data bm1880_pinconf[] = { 794 + BM1880_PINCONF_DAT(0x03), 795 + BM1880_PINCONF_DAT(0x03), 796 + BM1880_PINCONF_DAT(0x03), 797 + BM1880_PINCONF_DAT(0x03), 798 + BM1880_PINCONF_DAT(0x03), 799 + BM1880_PINCONF_DAT(0x03), 800 + BM1880_PINCONF_DAT(0x03), 801 + BM1880_PINCONF_DAT(0x03), 802 + BM1880_PINCONF_DAT(0x03), 803 + BM1880_PINCONF_DAT(0x03), 804 + BM1880_PINCONF_DAT(0x03), 805 + BM1880_PINCONF_DAT(0x03), 806 + BM1880_PINCONF_DAT(0x03), 807 + BM1880_PINCONF_DAT(0x03), 808 + BM1880_PINCONF_DAT(0x03), 809 + BM1880_PINCONF_DAT(0x03), 810 + BM1880_PINCONF_DAT(0x03), 811 + BM1880_PINCONF_DAT(0x03), 812 + BM1880_PINCONF_DAT(0x03), 813 + BM1880_PINCONF_DAT(0x03), 814 + BM1880_PINCONF_DAT(0x03), 815 + BM1880_PINCONF_DAT(0x03), 816 + BM1880_PINCONF_DAT(0x03), 817 + BM1880_PINCONF_DAT(0x03), 818 + BM1880_PINCONF_DAT(0x03), 819 + BM1880_PINCONF_DAT(0x03), 820 + BM1880_PINCONF_DAT(0x03), 821 + BM1880_PINCONF_DAT(0x03), 822 + BM1880_PINCONF_DAT(0x03), 823 + BM1880_PINCONF_DAT(0x03), 824 + BM1880_PINCONF_DAT(0x03), 825 + BM1880_PINCONF_DAT(0x03), 826 + BM1880_PINCONF_DAT(0x03), 827 + BM1880_PINCONF_DAT(0x03), 828 + BM1880_PINCONF_DAT(0x03), 829 + BM1880_PINCONF_DAT(0x03), 830 + BM1880_PINCONF_DAT(0x03), 831 + BM1880_PINCONF_DAT(0x03), 832 + BM1880_PINCONF_DAT(0x03), 833 + BM1880_PINCONF_DAT(0x03), 834 + BM1880_PINCONF_DAT(0x03), 835 + BM1880_PINCONF_DAT(0x03), 836 + BM1880_PINCONF_DAT(0x03), 837 + BM1880_PINCONF_DAT(0x03), 838 + BM1880_PINCONF_DAT(0x03), 839 + BM1880_PINCONF_DAT(0x03), 840 + BM1880_PINCONF_DAT(0x03), 841 + BM1880_PINCONF_DAT(0x03), 842 + BM1880_PINCONF_DAT(0x03), 843 + BM1880_PINCONF_DAT(0x03), 844 + BM1880_PINCONF_DAT(0x03), 845 + BM1880_PINCONF_DAT(0x03), 846 + BM1880_PINCONF_DAT(0x03), 847 + BM1880_PINCONF_DAT(0x03), 848 + BM1880_PINCONF_DAT(0x03), 849 + BM1880_PINCONF_DAT(0x03), 850 + BM1880_PINCONF_DAT(0x03), 851 + BM1880_PINCONF_DAT(0x03), 852 + BM1880_PINCONF_DAT(0x03), 853 + BM1880_PINCONF_DAT(0x03), 854 + BM1880_PINCONF_DAT(0x02), 855 + BM1880_PINCONF_DAT(0x02), 856 + BM1880_PINCONF_DAT(0x02), 857 + BM1880_PINCONF_DAT(0x02), 858 + BM1880_PINCONF_DAT(0x02), 859 + BM1880_PINCONF_DAT(0x02), 860 + BM1880_PINCONF_DAT(0x02), 861 + BM1880_PINCONF_DAT(0x02), 862 + BM1880_PINCONF_DAT(0x02), 863 + BM1880_PINCONF_DAT(0x02), 864 + BM1880_PINCONF_DAT(0x02), 865 + BM1880_PINCONF_DAT(0x02), 866 + BM1880_PINCONF_DAT(0x02), 867 + BM1880_PINCONF_DAT(0x02), 868 + BM1880_PINCONF_DAT(0x02), 869 + BM1880_PINCONF_DAT(0x02), 870 + BM1880_PINCONF_DAT(0x02), 871 + BM1880_PINCONF_DAT(0x02), 872 + BM1880_PINCONF_DAT(0x02), 873 + BM1880_PINCONF_DAT(0x02), 874 + BM1880_PINCONF_DAT(0x02), 875 + BM1880_PINCONF_DAT(0x02), 876 + BM1880_PINCONF_DAT(0x02), 877 + BM1880_PINCONF_DAT(0x02), 878 + BM1880_PINCONF_DAT(0x02), 879 + BM1880_PINCONF_DAT(0x02), 880 + BM1880_PINCONF_DAT(0x02), 881 + BM1880_PINCONF_DAT(0x02), 882 + BM1880_PINCONF_DAT(0x02), 883 + BM1880_PINCONF_DAT(0x02), 884 + BM1880_PINCONF_DAT(0x02), 885 + BM1880_PINCONF_DAT(0x02), 886 + BM1880_PINCONF_DAT(0x02), 887 + BM1880_PINCONF_DAT(0x02), 888 + BM1880_PINCONF_DAT(0x02), 889 + BM1880_PINCONF_DAT(0x02), 890 + BM1880_PINCONF_DAT(0x02), 891 + BM1880_PINCONF_DAT(0x02), 892 + BM1880_PINCONF_DAT(0x02), 893 + BM1880_PINCONF_DAT(0x02), 894 + BM1880_PINCONF_DAT(0x02), 895 + BM1880_PINCONF_DAT(0x02), 896 + BM1880_PINCONF_DAT(0x02), 897 + BM1880_PINCONF_DAT(0x02), 898 + BM1880_PINCONF_DAT(0x02), 899 + BM1880_PINCONF_DAT(0x02), 900 + BM1880_PINCONF_DAT(0x02), 901 + BM1880_PINCONF_DAT(0x02), 902 + BM1880_PINCONF_DAT(0x02), 903 + BM1880_PINCONF_DAT(0x02), 904 + BM1880_PINCONF_DAT(0x02), 905 + BM1880_PINCONF_DAT(0x02), 806 906 }; 807 907 808 908 static int bm1880_pctrl_get_groups_count(struct pinctrl_dev *pctldev) ··· 986 870 const struct bm1880_pinmux_function *func = &pctrl->funcs[function]; 987 871 int i; 988 872 989 - if (func->mux) { 873 + for (i = 0; i < pgrp->npins; i++) { 874 + unsigned int pin = pgrp->pins[i]; 875 + u32 offset = (pin >> 1) << 2; 876 + u32 mux_offset = ((!((pin + 1) & 1) << 4) + 4); 990 877 u32 regval = readl_relaxed(pctrl->base + BM1880_REG_MUX + 991 - func->mux); 878 + offset); 992 879 993 - regval &= ~(func->mux_mask << func->mux_shift); 994 - regval |= func->mux_val << func->mux_shift; 995 - writel_relaxed(regval, pctrl->base + BM1880_REG_MUX + 996 - func->mux); 997 - } else { 998 - for (i = 0; i < pgrp->npins; i++) { 999 - unsigned int pin = pgrp->pins[i]; 1000 - u32 offset = (pin >> 1) << 2; 1001 - u32 mux_offset = ((!((pin + 1) & 1) << 4) + 4); 1002 - u32 regval = readl_relaxed(pctrl->base + 1003 - BM1880_REG_MUX + offset); 880 + regval &= ~(0x03 << mux_offset); 881 + regval |= func->mux_val << mux_offset; 1004 882 1005 - regval &= ~(func->mux_mask << mux_offset); 1006 - regval |= func->mux_val << mux_offset; 1007 - 1008 - writel_relaxed(regval, pctrl->base + 1009 - BM1880_REG_MUX + offset); 1010 - } 883 + writel_relaxed(regval, pctrl->base + BM1880_REG_MUX + offset); 1011 884 } 1012 885 1013 886 return 0; 1014 887 } 888 + 889 + #define BM1880_PINCONF(pin, idx) ((!((pin + 1) & 1) << 4) + idx) 890 + #define BM1880_PINCONF_PULLCTRL(pin) BM1880_PINCONF(pin, 0) 891 + #define BM1880_PINCONF_PULLUP(pin) BM1880_PINCONF(pin, 1) 892 + #define BM1880_PINCONF_PULLDOWN(pin) BM1880_PINCONF(pin, 2) 893 + #define BM1880_PINCONF_DRV(pin) BM1880_PINCONF(pin, 6) 894 + #define BM1880_PINCONF_SCHMITT(pin) BM1880_PINCONF(pin, 9) 895 + #define BM1880_PINCONF_SLEW(pin) BM1880_PINCONF(pin, 10) 896 + 897 + static int bm1880_pinconf_drv_set(unsigned int mA, u32 width, 898 + u32 *regval, u32 bit_offset) 899 + { 900 + u32 _regval; 901 + 902 + _regval = *regval; 903 + 904 + /* 905 + * There are two sets of drive strength bit width exposed by the 906 + * SoC at 4mA step, hence we need to handle them separately. 907 + */ 908 + if (width == 0x03) { 909 + switch (mA) { 910 + case 4: 911 + _regval &= ~(width << bit_offset); 912 + _regval |= (0 << bit_offset); 913 + break; 914 + case 8: 915 + _regval &= ~(width << bit_offset); 916 + _regval |= (1 << bit_offset); 917 + break; 918 + case 12: 919 + _regval &= ~(width << bit_offset); 920 + _regval |= (2 << bit_offset); 921 + break; 922 + case 16: 923 + _regval &= ~(width << bit_offset); 924 + _regval |= (3 << bit_offset); 925 + break; 926 + case 20: 927 + _regval &= ~(width << bit_offset); 928 + _regval |= (4 << bit_offset); 929 + break; 930 + case 24: 931 + _regval &= ~(width << bit_offset); 932 + _regval |= (5 << bit_offset); 933 + break; 934 + case 28: 935 + _regval &= ~(width << bit_offset); 936 + _regval |= (6 << bit_offset); 937 + break; 938 + case 32: 939 + _regval &= ~(width << bit_offset); 940 + _regval |= (7 << bit_offset); 941 + break; 942 + default: 943 + return -EINVAL; 944 + } 945 + } else { 946 + switch (mA) { 947 + case 4: 948 + _regval &= ~(width << bit_offset); 949 + _regval |= (0 << bit_offset); 950 + break; 951 + case 8: 952 + _regval &= ~(width << bit_offset); 953 + _regval |= (1 << bit_offset); 954 + break; 955 + case 12: 956 + _regval &= ~(width << bit_offset); 957 + _regval |= (2 << bit_offset); 958 + break; 959 + case 16: 960 + _regval &= ~(width << bit_offset); 961 + _regval |= (3 << bit_offset); 962 + break; 963 + default: 964 + return -EINVAL; 965 + } 966 + } 967 + 968 + *regval = _regval; 969 + 970 + return 0; 971 + } 972 + 973 + static int bm1880_pinconf_drv_get(u32 width, u32 drv) 974 + { 975 + int ret = -ENOTSUPP; 976 + 977 + /* 978 + * There are two sets of drive strength bit width exposed by the 979 + * SoC at 4mA step, hence we need to handle them separately. 980 + */ 981 + if (width == 0x03) { 982 + switch (drv) { 983 + case 0: 984 + ret = 4; 985 + break; 986 + case 1: 987 + ret = 8; 988 + break; 989 + case 2: 990 + ret = 12; 991 + break; 992 + case 3: 993 + ret = 16; 994 + break; 995 + case 4: 996 + ret = 20; 997 + break; 998 + case 5: 999 + ret = 24; 1000 + break; 1001 + case 6: 1002 + ret = 28; 1003 + break; 1004 + case 7: 1005 + ret = 32; 1006 + break; 1007 + default: 1008 + break; 1009 + } 1010 + } else { 1011 + switch (drv) { 1012 + case 0: 1013 + ret = 4; 1014 + break; 1015 + case 1: 1016 + ret = 8; 1017 + break; 1018 + case 2: 1019 + ret = 12; 1020 + break; 1021 + case 3: 1022 + ret = 16; 1023 + break; 1024 + default: 1025 + break; 1026 + } 1027 + } 1028 + 1029 + return ret; 1030 + } 1031 + 1032 + static int bm1880_pinconf_cfg_get(struct pinctrl_dev *pctldev, 1033 + unsigned int pin, 1034 + unsigned long *config) 1035 + { 1036 + struct bm1880_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 1037 + unsigned int param = pinconf_to_config_param(*config); 1038 + unsigned int arg = 0; 1039 + u32 regval, offset, bit_offset; 1040 + int ret; 1041 + 1042 + offset = (pin >> 1) << 2; 1043 + regval = readl_relaxed(pctrl->base + BM1880_REG_MUX + offset); 1044 + 1045 + switch (param) { 1046 + case PIN_CONFIG_BIAS_PULL_UP: 1047 + bit_offset = BM1880_PINCONF_PULLUP(pin); 1048 + arg = !!(regval & BIT(bit_offset)); 1049 + break; 1050 + case PIN_CONFIG_BIAS_PULL_DOWN: 1051 + bit_offset = BM1880_PINCONF_PULLDOWN(pin); 1052 + arg = !!(regval & BIT(bit_offset)); 1053 + break; 1054 + case PIN_CONFIG_BIAS_DISABLE: 1055 + bit_offset = BM1880_PINCONF_PULLCTRL(pin); 1056 + arg = !!(regval & BIT(bit_offset)); 1057 + break; 1058 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 1059 + bit_offset = BM1880_PINCONF_SCHMITT(pin); 1060 + arg = !!(regval & BIT(bit_offset)); 1061 + break; 1062 + case PIN_CONFIG_SLEW_RATE: 1063 + bit_offset = BM1880_PINCONF_SLEW(pin); 1064 + arg = !!(regval & BIT(bit_offset)); 1065 + break; 1066 + case PIN_CONFIG_DRIVE_STRENGTH: 1067 + bit_offset = BM1880_PINCONF_DRV(pin); 1068 + ret = bm1880_pinconf_drv_get(pctrl->pinconf[pin].drv_bits, 1069 + !!(regval & BIT(bit_offset))); 1070 + if (ret < 0) 1071 + return ret; 1072 + 1073 + arg = ret; 1074 + break; 1075 + default: 1076 + return -ENOTSUPP; 1077 + } 1078 + 1079 + *config = pinconf_to_config_packed(param, arg); 1080 + 1081 + return 0; 1082 + } 1083 + 1084 + static int bm1880_pinconf_cfg_set(struct pinctrl_dev *pctldev, 1085 + unsigned int pin, 1086 + unsigned long *configs, 1087 + unsigned int num_configs) 1088 + { 1089 + struct bm1880_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 1090 + u32 regval, offset, bit_offset; 1091 + int i, ret; 1092 + 1093 + offset = (pin >> 1) << 2; 1094 + regval = readl_relaxed(pctrl->base + BM1880_REG_MUX + offset); 1095 + 1096 + for (i = 0; i < num_configs; i++) { 1097 + unsigned int param = pinconf_to_config_param(configs[i]); 1098 + unsigned int arg = pinconf_to_config_argument(configs[i]); 1099 + 1100 + switch (param) { 1101 + case PIN_CONFIG_BIAS_PULL_UP: 1102 + bit_offset = BM1880_PINCONF_PULLUP(pin); 1103 + regval |= BIT(bit_offset); 1104 + break; 1105 + case PIN_CONFIG_BIAS_PULL_DOWN: 1106 + bit_offset = BM1880_PINCONF_PULLDOWN(pin); 1107 + regval |= BIT(bit_offset); 1108 + break; 1109 + case PIN_CONFIG_BIAS_DISABLE: 1110 + bit_offset = BM1880_PINCONF_PULLCTRL(pin); 1111 + regval |= BIT(bit_offset); 1112 + break; 1113 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 1114 + bit_offset = BM1880_PINCONF_SCHMITT(pin); 1115 + if (arg) 1116 + regval |= BIT(bit_offset); 1117 + else 1118 + regval &= ~BIT(bit_offset); 1119 + break; 1120 + case PIN_CONFIG_SLEW_RATE: 1121 + bit_offset = BM1880_PINCONF_SLEW(pin); 1122 + if (arg) 1123 + regval |= BIT(bit_offset); 1124 + else 1125 + regval &= ~BIT(bit_offset); 1126 + break; 1127 + case PIN_CONFIG_DRIVE_STRENGTH: 1128 + bit_offset = BM1880_PINCONF_DRV(pin); 1129 + ret = bm1880_pinconf_drv_set(arg, 1130 + pctrl->pinconf[pin].drv_bits, 1131 + &regval, bit_offset); 1132 + if (ret < 0) 1133 + return ret; 1134 + 1135 + break; 1136 + default: 1137 + dev_warn(pctldev->dev, 1138 + "unsupported configuration parameter '%u'\n", 1139 + param); 1140 + continue; 1141 + } 1142 + 1143 + writel_relaxed(regval, pctrl->base + BM1880_REG_MUX + offset); 1144 + } 1145 + 1146 + return 0; 1147 + } 1148 + 1149 + static int bm1880_pinconf_group_set(struct pinctrl_dev *pctldev, 1150 + unsigned int selector, 1151 + unsigned long *configs, 1152 + unsigned int num_configs) 1153 + { 1154 + int i, ret; 1155 + struct bm1880_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 1156 + const struct bm1880_pctrl_group *pgrp = &pctrl->groups[selector]; 1157 + 1158 + for (i = 0; i < pgrp->npins; i++) { 1159 + ret = bm1880_pinconf_cfg_set(pctldev, pgrp->pins[i], configs, 1160 + num_configs); 1161 + if (ret) 1162 + return ret; 1163 + } 1164 + 1165 + return 0; 1166 + } 1167 + 1168 + static const struct pinconf_ops bm1880_pinconf_ops = { 1169 + .is_generic = true, 1170 + .pin_config_get = bm1880_pinconf_cfg_get, 1171 + .pin_config_set = bm1880_pinconf_cfg_set, 1172 + .pin_config_group_set = bm1880_pinconf_group_set, 1173 + }; 1015 1174 1016 1175 static const struct pinmux_ops bm1880_pinmux_ops = { 1017 1176 .get_functions_count = bm1880_pmux_get_functions_count, ··· 1301 910 .npins = ARRAY_SIZE(bm1880_pins), 1302 911 .pctlops = &bm1880_pctrl_ops, 1303 912 .pmxops = &bm1880_pinmux_ops, 913 + .confops = &bm1880_pinconf_ops, 1304 914 .owner = THIS_MODULE, 1305 915 }; 1306 916 ··· 1324 932 pctrl->ngroups = ARRAY_SIZE(bm1880_pctrl_groups); 1325 933 pctrl->funcs = bm1880_pmux_functions; 1326 934 pctrl->nfuncs = ARRAY_SIZE(bm1880_pmux_functions); 935 + pctrl->pinconf = bm1880_pinconf; 1327 936 1328 937 pctrl->pctrldev = devm_pinctrl_register(&pdev->dev, &bm1880_desc, 1329 938 pctrl);
+1
drivers/pinctrl/pinctrl-rockchip.c
··· 3204 3204 base, 3205 3205 &rockchip_regmap_config); 3206 3206 } 3207 + of_node_put(node); 3207 3208 } 3208 3209 3209 3210 bank->irq = irq_of_parse_and_map(bank->of_node, 0);
+1
drivers/pinctrl/pinctrl-stmfx.c
··· 622 622 pctl->pctl_desc.pins = stmfx_pins; 623 623 pctl->pctl_desc.npins = ARRAY_SIZE(stmfx_pins); 624 624 pctl->pctl_desc.owner = THIS_MODULE; 625 + pctl->pctl_desc.link_consumers = true; 625 626 626 627 ret = devm_pinctrl_register_and_init(pctl->dev, &pctl->pctl_desc, 627 628 pctl, &pctl->pctl_dev);
+5 -7
drivers/pinctrl/pinctrl-tb10x.c
··· 471 471 * @base: register set base address. 472 472 * @pingroups: pointer to an array of the pin groups this driver manages. 473 473 * @pinfuncgrpcnt: number of pingroups in @pingroups. 474 - * @pinfuncs: pointer to an array of pin functions this driver manages. 475 474 * @pinfuncnt: number of pin functions in @pinfuncs. 476 475 * @mutex: mutex for exclusive access to a pin controller's state. 477 476 * @ports: current state of each port. 478 477 * @gpios: Indicates if a given pin is currently used as GPIO (1) or not (0). 478 + * @pinfuncs: flexible array of pin functions this driver manages. 479 479 */ 480 480 struct tb10x_pinctrl { 481 481 struct pinctrl_dev *pctl; 482 482 void *base; 483 483 const struct tb10x_pinfuncgrp *pingroups; 484 484 unsigned int pinfuncgrpcnt; 485 - struct tb10x_of_pinfunc *pinfuncs; 486 485 unsigned int pinfuncnt; 487 486 struct mutex mutex; 488 487 struct tb10x_port ports[TB10X_PORTS]; 489 488 DECLARE_BITMAP(gpios, MAX_PIN + 1); 489 + struct tb10x_of_pinfunc pinfuncs[]; 490 490 }; 491 491 492 492 static inline void tb10x_pinctrl_set_config(struct tb10x_pinctrl *state, ··· 759 759 return -EINVAL; 760 760 } 761 761 762 - state = devm_kzalloc(dev, sizeof(struct tb10x_pinctrl) + 763 - of_get_child_count(of_node) 764 - * sizeof(struct tb10x_of_pinfunc), 765 - GFP_KERNEL); 762 + state = devm_kzalloc(dev, struct_size(state, pinfuncs, 763 + of_get_child_count(of_node)), 764 + GFP_KERNEL); 766 765 if (!state) 767 766 return -ENOMEM; 768 767 769 768 platform_set_drvdata(pdev, state); 770 - state->pinfuncs = (struct tb10x_of_pinfunc *)(state + 1); 771 769 mutex_init(&state->mutex); 772 770 773 771 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+10 -1
drivers/pinctrl/qcom/Kconfig
··· 169 169 170 170 config PINCTRL_SDM845 171 171 tristate "Qualcomm Technologies Inc SDM845 pin controller driver" 172 - depends on GPIOLIB && OF 172 + depends on GPIOLIB && (OF || ACPI) 173 173 select PINCTRL_MSM 174 174 help 175 175 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 176 176 Qualcomm Technologies Inc TLMM block found on the Qualcomm 177 177 Technologies Inc SDM845 platform. 178 + 179 + config PINCTRL_SM8150 180 + tristate "Qualcomm Technologies Inc SM8150 pin controller driver" 181 + depends on GPIOLIB && OF 182 + select PINCTRL_MSM 183 + help 184 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 185 + Qualcomm Technologies Inc TLMM block found on the Qualcomm 186 + Technologies Inc SM8150 platform. 178 187 179 188 endif
+1
drivers/pinctrl/qcom/Makefile
··· 22 22 obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-mpp.o 23 23 obj-$(CONFIG_PINCTRL_SDM660) += pinctrl-sdm660.o 24 24 obj-$(CONFIG_PINCTRL_SDM845) += pinctrl-sdm845.o 25 + obj-$(CONFIG_PINCTRL_SM8150) += pinctrl-sm8150.o
+42 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 599 599 int ret; 600 600 unsigned int len, i; 601 601 unsigned int max_gpios = pctrl->soc->ngpios; 602 + const int *reserved = pctrl->soc->reserved_gpios; 602 603 u16 *tmp; 604 + 605 + /* Driver provided reserved list overrides DT and ACPI */ 606 + if (reserved) { 607 + bitmap_fill(chip->valid_mask, max_gpios); 608 + for (i = 0; reserved[i] >= 0; i++) { 609 + if (i >= max_gpios || reserved[i] >= max_gpios) { 610 + dev_err(pctrl->dev, "invalid list of reserved GPIOs\n"); 611 + return -EINVAL; 612 + } 613 + clear_bit(reserved[i], chip->valid_mask); 614 + } 615 + 616 + return 0; 617 + } 603 618 604 619 /* The number of GPIOs in the ACPI tables */ 605 620 len = ret = device_property_read_u16_array(pctrl->dev, "gpios", NULL, ··· 744 729 raw_spin_unlock_irqrestore(&pctrl->lock, flags); 745 730 } 746 731 747 - static void msm_gpio_irq_unmask(struct irq_data *d) 732 + static void msm_gpio_irq_clear_unmask(struct irq_data *d, bool status_clear) 748 733 { 749 734 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 750 735 struct msm_pinctrl *pctrl = gpiochip_get_data(gc); ··· 756 741 757 742 raw_spin_lock_irqsave(&pctrl->lock, flags); 758 743 744 + if (status_clear) { 745 + /* 746 + * clear the interrupt status bit before unmask to avoid 747 + * any erroneous interrupts that would have got latched 748 + * when the interrupt is not in use. 749 + */ 750 + val = msm_readl_intr_status(pctrl, g); 751 + val &= ~BIT(g->intr_status_bit); 752 + msm_writel_intr_status(val, pctrl, g); 753 + } 754 + 759 755 val = msm_readl_intr_cfg(pctrl, g); 760 756 val |= BIT(g->intr_raw_status_bit); 761 757 val |= BIT(g->intr_enable_bit); ··· 775 749 set_bit(d->hwirq, pctrl->enabled_irqs); 776 750 777 751 raw_spin_unlock_irqrestore(&pctrl->lock, flags); 752 + } 753 + 754 + static void msm_gpio_irq_enable(struct irq_data *d) 755 + { 756 + 757 + msm_gpio_irq_clear_unmask(d, true); 758 + } 759 + 760 + static void msm_gpio_irq_unmask(struct irq_data *d) 761 + { 762 + msm_gpio_irq_clear_unmask(d, false); 778 763 } 779 764 780 765 static void msm_gpio_irq_ack(struct irq_data *d) ··· 993 956 994 957 static bool msm_gpio_needs_valid_mask(struct msm_pinctrl *pctrl) 995 958 { 959 + if (pctrl->soc->reserved_gpios) 960 + return true; 961 + 996 962 return device_property_read_u16_array(pctrl->dev, "gpios", NULL, 0) > 0; 997 963 } 998 964 ··· 1018 978 chip->need_valid_mask = msm_gpio_needs_valid_mask(pctrl); 1019 979 1020 980 pctrl->irq_chip.name = "msmgpio"; 981 + pctrl->irq_chip.irq_enable = msm_gpio_irq_enable; 1021 982 pctrl->irq_chip.irq_mask = msm_gpio_irq_mask; 1022 983 pctrl->irq_chip.irq_unmask = msm_gpio_irq_unmask; 1023 984 pctrl->irq_chip.irq_ack = msm_gpio_irq_ack;
+1
drivers/pinctrl/qcom/pinctrl-msm.h
··· 113 113 bool pull_no_keeper; 114 114 const char *const *tiles; 115 115 unsigned int ntiles; 116 + const int *reserved_gpios; 116 117 }; 117 118 118 119 extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
+40 -6
drivers/pinctrl/qcom/pinctrl-sdm845.c
··· 3 3 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. 4 4 */ 5 5 6 + #include <linux/acpi.h> 6 7 #include <linux/module.h> 7 8 #include <linux/of.h> 8 9 #include <linux/platform_device.h> ··· 421 420 DECLARE_MSM_GPIO_PINS(148); 422 421 DECLARE_MSM_GPIO_PINS(149); 423 422 424 - static const unsigned int sdc2_clk_pins[] = { 150 }; 425 - static const unsigned int sdc2_cmd_pins[] = { 151 }; 426 - static const unsigned int sdc2_data_pins[] = { 152 }; 427 - static const unsigned int ufs_reset_pins[] = { 153 }; 423 + static const unsigned int ufs_reset_pins[] = { 150 }; 424 + static const unsigned int sdc2_clk_pins[] = { 151 }; 425 + static const unsigned int sdc2_cmd_pins[] = { 152 }; 426 + static const unsigned int sdc2_data_pins[] = { 153 }; 428 427 429 428 enum sdm845_functions { 430 429 msm_mux_gpio, ··· 1272 1271 PINGROUP(147, NORTH, _, _, _, _, _, _, _, _, _, _), 1273 1272 PINGROUP(148, NORTH, _, _, _, _, _, _, _, _, _, _), 1274 1273 PINGROUP(149, NORTH, _, _, _, _, _, _, _, _, _, _), 1274 + UFS_RESET(ufs_reset, 0x99f000), 1275 1275 SDC_QDSD_PINGROUP(sdc2_clk, 0x99a000, 14, 6), 1276 1276 SDC_QDSD_PINGROUP(sdc2_cmd, 0x99a000, 11, 3), 1277 1277 SDC_QDSD_PINGROUP(sdc2_data, 0x99a000, 9, 0), 1278 - UFS_RESET(ufs_reset, 0x99f000), 1278 + }; 1279 + 1280 + static const int sdm845_acpi_reserved_gpios[] = { 1281 + 0, 1, 2, 3, 81, 82, 83, 84, -1 1279 1282 }; 1280 1283 1281 1284 static const struct msm_pinctrl_soc_data sdm845_pinctrl = { ··· 1289 1284 .nfunctions = ARRAY_SIZE(sdm845_functions), 1290 1285 .groups = sdm845_groups, 1291 1286 .ngroups = ARRAY_SIZE(sdm845_groups), 1287 + .ngpios = 151, 1288 + }; 1289 + 1290 + static const struct msm_pinctrl_soc_data sdm845_acpi_pinctrl = { 1291 + .pins = sdm845_pins, 1292 + .npins = ARRAY_SIZE(sdm845_pins), 1293 + .groups = sdm845_groups, 1294 + .ngroups = ARRAY_SIZE(sdm845_groups), 1295 + .reserved_gpios = sdm845_acpi_reserved_gpios, 1292 1296 .ngpios = 150, 1293 1297 }; 1294 1298 1295 1299 static int sdm845_pinctrl_probe(struct platform_device *pdev) 1296 1300 { 1297 - return msm_pinctrl_probe(pdev, &sdm845_pinctrl); 1301 + int ret; 1302 + 1303 + if (pdev->dev.of_node) { 1304 + ret = msm_pinctrl_probe(pdev, &sdm845_pinctrl); 1305 + } else if (has_acpi_companion(&pdev->dev)) { 1306 + ret = msm_pinctrl_probe(pdev, &sdm845_acpi_pinctrl); 1307 + } else { 1308 + dev_err(&pdev->dev, "DT and ACPI disabled\n"); 1309 + return -EINVAL; 1310 + } 1311 + 1312 + return ret; 1298 1313 } 1314 + 1315 + #ifdef CONFIG_ACPI 1316 + static const struct acpi_device_id sdm845_pinctrl_acpi_match[] = { 1317 + { "QCOM0217"}, 1318 + { }, 1319 + }; 1320 + MODULE_DEVICE_TABLE(acpi, sdm845_pinctrl_acpi_match); 1321 + #endif 1299 1322 1300 1323 static const struct of_device_id sdm845_pinctrl_of_match[] = { 1301 1324 { .compatible = "qcom,sdm845-pinctrl", }, ··· 1335 1302 .name = "sdm845-pinctrl", 1336 1303 .pm = &msm_pinctrl_dev_pm_ops, 1337 1304 .of_match_table = sdm845_pinctrl_of_match, 1305 + .acpi_match_table = ACPI_PTR(sdm845_pinctrl_acpi_match), 1338 1306 }, 1339 1307 .probe = sdm845_pinctrl_probe, 1340 1308 .remove = msm_pinctrl_remove,
+1548
drivers/pinctrl/qcom/pinctrl-sm8150.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. 3 + 4 + #include <linux/module.h> 5 + #include <linux/of.h> 6 + #include <linux/platform_device.h> 7 + #include <linux/pinctrl/pinctrl.h> 8 + 9 + #include "pinctrl-msm.h" 10 + 11 + static const char * const sm8150_tiles[] = { 12 + "north", 13 + "south", 14 + "east", 15 + "west" 16 + }; 17 + 18 + enum { 19 + NORTH, 20 + SOUTH, 21 + EAST, 22 + WEST 23 + }; 24 + 25 + #define FUNCTION(fname) \ 26 + [msm_mux_##fname] = { \ 27 + .name = #fname, \ 28 + .groups = fname##_groups, \ 29 + .ngroups = ARRAY_SIZE(fname##_groups), \ 30 + } 31 + 32 + #define PINGROUP(id, _tile, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 33 + { \ 34 + .name = "gpio" #id, \ 35 + .pins = gpio##id##_pins, \ 36 + .npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins), \ 37 + .funcs = (int[]){ \ 38 + msm_mux_gpio, /* gpio mode */ \ 39 + msm_mux_##f1, \ 40 + msm_mux_##f2, \ 41 + msm_mux_##f3, \ 42 + msm_mux_##f4, \ 43 + msm_mux_##f5, \ 44 + msm_mux_##f6, \ 45 + msm_mux_##f7, \ 46 + msm_mux_##f8, \ 47 + msm_mux_##f9 \ 48 + }, \ 49 + .nfuncs = 10, \ 50 + .ctl_reg = 0x1000 * id, \ 51 + .io_reg = 0x1000 * id + 0x4, \ 52 + .intr_cfg_reg = 0x1000 * id + 0x8, \ 53 + .intr_status_reg = 0x1000 * id + 0xc, \ 54 + .intr_target_reg = 0x1000 * id + 0x8, \ 55 + .tile = _tile, \ 56 + .mux_bit = 2, \ 57 + .pull_bit = 0, \ 58 + .drv_bit = 6, \ 59 + .oe_bit = 9, \ 60 + .in_bit = 0, \ 61 + .out_bit = 1, \ 62 + .intr_enable_bit = 0, \ 63 + .intr_status_bit = 0, \ 64 + .intr_target_bit = 5, \ 65 + .intr_target_kpss_val = 3, \ 66 + .intr_raw_status_bit = 4, \ 67 + .intr_polarity_bit = 1, \ 68 + .intr_detection_bit = 2, \ 69 + .intr_detection_width = 2, \ 70 + } 71 + 72 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 73 + { \ 74 + .name = #pg_name, \ 75 + .pins = pg_name##_pins, \ 76 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 77 + .ctl_reg = ctl, \ 78 + .io_reg = 0, \ 79 + .intr_cfg_reg = 0, \ 80 + .intr_status_reg = 0, \ 81 + .intr_target_reg = 0, \ 82 + .tile = NORTH, \ 83 + .mux_bit = -1, \ 84 + .pull_bit = pull, \ 85 + .drv_bit = drv, \ 86 + .oe_bit = -1, \ 87 + .in_bit = -1, \ 88 + .out_bit = -1, \ 89 + .intr_enable_bit = -1, \ 90 + .intr_status_bit = -1, \ 91 + .intr_target_bit = -1, \ 92 + .intr_raw_status_bit = -1, \ 93 + .intr_polarity_bit = -1, \ 94 + .intr_detection_bit = -1, \ 95 + .intr_detection_width = -1, \ 96 + } 97 + 98 + #define UFS_RESET(pg_name, offset) \ 99 + { \ 100 + .name = #pg_name, \ 101 + .pins = pg_name##_pins, \ 102 + .npins = (unsigned int)ARRAY_SIZE(pg_name##_pins), \ 103 + .ctl_reg = offset, \ 104 + .io_reg = offset + 0x4, \ 105 + .intr_cfg_reg = 0, \ 106 + .intr_status_reg = 0, \ 107 + .intr_target_reg = 0, \ 108 + .tile = SOUTH, \ 109 + .mux_bit = -1, \ 110 + .pull_bit = 3, \ 111 + .drv_bit = 0, \ 112 + .oe_bit = -1, \ 113 + .in_bit = -1, \ 114 + .out_bit = 0, \ 115 + .intr_enable_bit = -1, \ 116 + .intr_status_bit = -1, \ 117 + .intr_target_bit = -1, \ 118 + .intr_raw_status_bit = -1, \ 119 + .intr_polarity_bit = -1, \ 120 + .intr_detection_bit = -1, \ 121 + .intr_detection_width = -1, \ 122 + } 123 + 124 + static const struct pinctrl_pin_desc sm8150_pins[] = { 125 + PINCTRL_PIN(0, "GPIO_0"), 126 + PINCTRL_PIN(1, "GPIO_1"), 127 + PINCTRL_PIN(2, "GPIO_2"), 128 + PINCTRL_PIN(3, "GPIO_3"), 129 + PINCTRL_PIN(4, "GPIO_4"), 130 + PINCTRL_PIN(5, "GPIO_5"), 131 + PINCTRL_PIN(6, "GPIO_6"), 132 + PINCTRL_PIN(7, "GPIO_7"), 133 + PINCTRL_PIN(8, "GPIO_8"), 134 + PINCTRL_PIN(9, "GPIO_9"), 135 + PINCTRL_PIN(10, "GPIO_10"), 136 + PINCTRL_PIN(11, "GPIO_11"), 137 + PINCTRL_PIN(12, "GPIO_12"), 138 + PINCTRL_PIN(13, "GPIO_13"), 139 + PINCTRL_PIN(14, "GPIO_14"), 140 + PINCTRL_PIN(15, "GPIO_15"), 141 + PINCTRL_PIN(16, "GPIO_16"), 142 + PINCTRL_PIN(17, "GPIO_17"), 143 + PINCTRL_PIN(18, "GPIO_18"), 144 + PINCTRL_PIN(19, "GPIO_19"), 145 + PINCTRL_PIN(20, "GPIO_20"), 146 + PINCTRL_PIN(21, "GPIO_21"), 147 + PINCTRL_PIN(22, "GPIO_22"), 148 + PINCTRL_PIN(23, "GPIO_23"), 149 + PINCTRL_PIN(24, "GPIO_24"), 150 + PINCTRL_PIN(25, "GPIO_25"), 151 + PINCTRL_PIN(26, "GPIO_26"), 152 + PINCTRL_PIN(27, "GPIO_27"), 153 + PINCTRL_PIN(28, "GPIO_28"), 154 + PINCTRL_PIN(29, "GPIO_29"), 155 + PINCTRL_PIN(30, "GPIO_30"), 156 + PINCTRL_PIN(31, "GPIO_31"), 157 + PINCTRL_PIN(32, "GPIO_32"), 158 + PINCTRL_PIN(33, "GPIO_33"), 159 + PINCTRL_PIN(34, "GPIO_34"), 160 + PINCTRL_PIN(35, "GPIO_35"), 161 + PINCTRL_PIN(36, "GPIO_36"), 162 + PINCTRL_PIN(37, "GPIO_37"), 163 + PINCTRL_PIN(38, "GPIO_38"), 164 + PINCTRL_PIN(39, "GPIO_39"), 165 + PINCTRL_PIN(40, "GPIO_40"), 166 + PINCTRL_PIN(41, "GPIO_41"), 167 + PINCTRL_PIN(42, "GPIO_42"), 168 + PINCTRL_PIN(43, "GPIO_43"), 169 + PINCTRL_PIN(44, "GPIO_44"), 170 + PINCTRL_PIN(45, "GPIO_45"), 171 + PINCTRL_PIN(46, "GPIO_46"), 172 + PINCTRL_PIN(47, "GPIO_47"), 173 + PINCTRL_PIN(48, "GPIO_48"), 174 + PINCTRL_PIN(49, "GPIO_49"), 175 + PINCTRL_PIN(50, "GPIO_50"), 176 + PINCTRL_PIN(51, "GPIO_51"), 177 + PINCTRL_PIN(52, "GPIO_52"), 178 + PINCTRL_PIN(53, "GPIO_53"), 179 + PINCTRL_PIN(54, "GPIO_54"), 180 + PINCTRL_PIN(55, "GPIO_55"), 181 + PINCTRL_PIN(56, "GPIO_56"), 182 + PINCTRL_PIN(57, "GPIO_57"), 183 + PINCTRL_PIN(58, "GPIO_58"), 184 + PINCTRL_PIN(59, "GPIO_59"), 185 + PINCTRL_PIN(60, "GPIO_60"), 186 + PINCTRL_PIN(61, "GPIO_61"), 187 + PINCTRL_PIN(62, "GPIO_62"), 188 + PINCTRL_PIN(63, "GPIO_63"), 189 + PINCTRL_PIN(64, "GPIO_64"), 190 + PINCTRL_PIN(65, "GPIO_65"), 191 + PINCTRL_PIN(66, "GPIO_66"), 192 + PINCTRL_PIN(67, "GPIO_67"), 193 + PINCTRL_PIN(68, "GPIO_68"), 194 + PINCTRL_PIN(69, "GPIO_69"), 195 + PINCTRL_PIN(70, "GPIO_70"), 196 + PINCTRL_PIN(71, "GPIO_71"), 197 + PINCTRL_PIN(72, "GPIO_72"), 198 + PINCTRL_PIN(73, "GPIO_73"), 199 + PINCTRL_PIN(74, "GPIO_74"), 200 + PINCTRL_PIN(75, "GPIO_75"), 201 + PINCTRL_PIN(76, "GPIO_76"), 202 + PINCTRL_PIN(77, "GPIO_77"), 203 + PINCTRL_PIN(78, "GPIO_78"), 204 + PINCTRL_PIN(79, "GPIO_79"), 205 + PINCTRL_PIN(80, "GPIO_80"), 206 + PINCTRL_PIN(81, "GPIO_81"), 207 + PINCTRL_PIN(82, "GPIO_82"), 208 + PINCTRL_PIN(83, "GPIO_83"), 209 + PINCTRL_PIN(84, "GPIO_84"), 210 + PINCTRL_PIN(85, "GPIO_85"), 211 + PINCTRL_PIN(86, "GPIO_86"), 212 + PINCTRL_PIN(87, "GPIO_87"), 213 + PINCTRL_PIN(88, "GPIO_88"), 214 + PINCTRL_PIN(89, "GPIO_89"), 215 + PINCTRL_PIN(90, "GPIO_90"), 216 + PINCTRL_PIN(91, "GPIO_91"), 217 + PINCTRL_PIN(92, "GPIO_92"), 218 + PINCTRL_PIN(93, "GPIO_93"), 219 + PINCTRL_PIN(94, "GPIO_94"), 220 + PINCTRL_PIN(95, "GPIO_95"), 221 + PINCTRL_PIN(96, "GPIO_96"), 222 + PINCTRL_PIN(97, "GPIO_97"), 223 + PINCTRL_PIN(98, "GPIO_98"), 224 + PINCTRL_PIN(99, "GPIO_99"), 225 + PINCTRL_PIN(100, "GPIO_100"), 226 + PINCTRL_PIN(101, "GPIO_101"), 227 + PINCTRL_PIN(102, "GPIO_102"), 228 + PINCTRL_PIN(103, "GPIO_103"), 229 + PINCTRL_PIN(104, "GPIO_104"), 230 + PINCTRL_PIN(105, "GPIO_105"), 231 + PINCTRL_PIN(106, "GPIO_106"), 232 + PINCTRL_PIN(107, "GPIO_107"), 233 + PINCTRL_PIN(108, "GPIO_108"), 234 + PINCTRL_PIN(109, "GPIO_109"), 235 + PINCTRL_PIN(110, "GPIO_110"), 236 + PINCTRL_PIN(111, "GPIO_111"), 237 + PINCTRL_PIN(112, "GPIO_112"), 238 + PINCTRL_PIN(113, "GPIO_113"), 239 + PINCTRL_PIN(114, "GPIO_114"), 240 + PINCTRL_PIN(115, "GPIO_115"), 241 + PINCTRL_PIN(116, "GPIO_116"), 242 + PINCTRL_PIN(117, "GPIO_117"), 243 + PINCTRL_PIN(118, "GPIO_118"), 244 + PINCTRL_PIN(119, "GPIO_119"), 245 + PINCTRL_PIN(120, "GPIO_120"), 246 + PINCTRL_PIN(121, "GPIO_121"), 247 + PINCTRL_PIN(122, "GPIO_122"), 248 + PINCTRL_PIN(123, "GPIO_123"), 249 + PINCTRL_PIN(124, "GPIO_124"), 250 + PINCTRL_PIN(125, "GPIO_125"), 251 + PINCTRL_PIN(126, "GPIO_126"), 252 + PINCTRL_PIN(127, "GPIO_127"), 253 + PINCTRL_PIN(128, "GPIO_128"), 254 + PINCTRL_PIN(129, "GPIO_129"), 255 + PINCTRL_PIN(130, "GPIO_130"), 256 + PINCTRL_PIN(131, "GPIO_131"), 257 + PINCTRL_PIN(132, "GPIO_132"), 258 + PINCTRL_PIN(133, "GPIO_133"), 259 + PINCTRL_PIN(134, "GPIO_134"), 260 + PINCTRL_PIN(135, "GPIO_135"), 261 + PINCTRL_PIN(136, "GPIO_136"), 262 + PINCTRL_PIN(137, "GPIO_137"), 263 + PINCTRL_PIN(138, "GPIO_138"), 264 + PINCTRL_PIN(139, "GPIO_139"), 265 + PINCTRL_PIN(140, "GPIO_140"), 266 + PINCTRL_PIN(141, "GPIO_141"), 267 + PINCTRL_PIN(142, "GPIO_142"), 268 + PINCTRL_PIN(143, "GPIO_143"), 269 + PINCTRL_PIN(144, "GPIO_144"), 270 + PINCTRL_PIN(145, "GPIO_145"), 271 + PINCTRL_PIN(146, "GPIO_146"), 272 + PINCTRL_PIN(147, "GPIO_147"), 273 + PINCTRL_PIN(148, "GPIO_148"), 274 + PINCTRL_PIN(149, "GPIO_149"), 275 + PINCTRL_PIN(150, "GPIO_150"), 276 + PINCTRL_PIN(151, "GPIO_151"), 277 + PINCTRL_PIN(152, "GPIO_152"), 278 + PINCTRL_PIN(153, "GPIO_153"), 279 + PINCTRL_PIN(154, "GPIO_154"), 280 + PINCTRL_PIN(155, "GPIO_155"), 281 + PINCTRL_PIN(156, "GPIO_156"), 282 + PINCTRL_PIN(157, "GPIO_157"), 283 + PINCTRL_PIN(158, "GPIO_158"), 284 + PINCTRL_PIN(159, "GPIO_159"), 285 + PINCTRL_PIN(160, "GPIO_160"), 286 + PINCTRL_PIN(161, "GPIO_161"), 287 + PINCTRL_PIN(162, "GPIO_162"), 288 + PINCTRL_PIN(163, "GPIO_163"), 289 + PINCTRL_PIN(164, "GPIO_164"), 290 + PINCTRL_PIN(165, "GPIO_165"), 291 + PINCTRL_PIN(166, "GPIO_166"), 292 + PINCTRL_PIN(167, "GPIO_167"), 293 + PINCTRL_PIN(168, "GPIO_168"), 294 + PINCTRL_PIN(169, "GPIO_169"), 295 + PINCTRL_PIN(170, "GPIO_170"), 296 + PINCTRL_PIN(171, "GPIO_171"), 297 + PINCTRL_PIN(172, "GPIO_172"), 298 + PINCTRL_PIN(173, "GPIO_173"), 299 + PINCTRL_PIN(174, "GPIO_174"), 300 + PINCTRL_PIN(175, "UFS_RESET"), 301 + PINCTRL_PIN(176, "SDC2_CLK"), 302 + PINCTRL_PIN(177, "SDC2_CMD"), 303 + PINCTRL_PIN(178, "SDC2_DATA"), 304 + }; 305 + 306 + #define DECLARE_MSM_GPIO_PINS(pin) \ 307 + static const unsigned int gpio##pin##_pins[] = { pin } 308 + DECLARE_MSM_GPIO_PINS(0); 309 + DECLARE_MSM_GPIO_PINS(1); 310 + DECLARE_MSM_GPIO_PINS(2); 311 + DECLARE_MSM_GPIO_PINS(3); 312 + DECLARE_MSM_GPIO_PINS(4); 313 + DECLARE_MSM_GPIO_PINS(5); 314 + DECLARE_MSM_GPIO_PINS(6); 315 + DECLARE_MSM_GPIO_PINS(7); 316 + DECLARE_MSM_GPIO_PINS(8); 317 + DECLARE_MSM_GPIO_PINS(9); 318 + DECLARE_MSM_GPIO_PINS(10); 319 + DECLARE_MSM_GPIO_PINS(11); 320 + DECLARE_MSM_GPIO_PINS(12); 321 + DECLARE_MSM_GPIO_PINS(13); 322 + DECLARE_MSM_GPIO_PINS(14); 323 + DECLARE_MSM_GPIO_PINS(15); 324 + DECLARE_MSM_GPIO_PINS(16); 325 + DECLARE_MSM_GPIO_PINS(17); 326 + DECLARE_MSM_GPIO_PINS(18); 327 + DECLARE_MSM_GPIO_PINS(19); 328 + DECLARE_MSM_GPIO_PINS(20); 329 + DECLARE_MSM_GPIO_PINS(21); 330 + DECLARE_MSM_GPIO_PINS(22); 331 + DECLARE_MSM_GPIO_PINS(23); 332 + DECLARE_MSM_GPIO_PINS(24); 333 + DECLARE_MSM_GPIO_PINS(25); 334 + DECLARE_MSM_GPIO_PINS(26); 335 + DECLARE_MSM_GPIO_PINS(27); 336 + DECLARE_MSM_GPIO_PINS(28); 337 + DECLARE_MSM_GPIO_PINS(29); 338 + DECLARE_MSM_GPIO_PINS(30); 339 + DECLARE_MSM_GPIO_PINS(31); 340 + DECLARE_MSM_GPIO_PINS(32); 341 + DECLARE_MSM_GPIO_PINS(33); 342 + DECLARE_MSM_GPIO_PINS(34); 343 + DECLARE_MSM_GPIO_PINS(35); 344 + DECLARE_MSM_GPIO_PINS(36); 345 + DECLARE_MSM_GPIO_PINS(37); 346 + DECLARE_MSM_GPIO_PINS(38); 347 + DECLARE_MSM_GPIO_PINS(39); 348 + DECLARE_MSM_GPIO_PINS(40); 349 + DECLARE_MSM_GPIO_PINS(41); 350 + DECLARE_MSM_GPIO_PINS(42); 351 + DECLARE_MSM_GPIO_PINS(43); 352 + DECLARE_MSM_GPIO_PINS(44); 353 + DECLARE_MSM_GPIO_PINS(45); 354 + DECLARE_MSM_GPIO_PINS(46); 355 + DECLARE_MSM_GPIO_PINS(47); 356 + DECLARE_MSM_GPIO_PINS(48); 357 + DECLARE_MSM_GPIO_PINS(49); 358 + DECLARE_MSM_GPIO_PINS(50); 359 + DECLARE_MSM_GPIO_PINS(51); 360 + DECLARE_MSM_GPIO_PINS(52); 361 + DECLARE_MSM_GPIO_PINS(53); 362 + DECLARE_MSM_GPIO_PINS(54); 363 + DECLARE_MSM_GPIO_PINS(55); 364 + DECLARE_MSM_GPIO_PINS(56); 365 + DECLARE_MSM_GPIO_PINS(57); 366 + DECLARE_MSM_GPIO_PINS(58); 367 + DECLARE_MSM_GPIO_PINS(59); 368 + DECLARE_MSM_GPIO_PINS(60); 369 + DECLARE_MSM_GPIO_PINS(61); 370 + DECLARE_MSM_GPIO_PINS(62); 371 + DECLARE_MSM_GPIO_PINS(63); 372 + DECLARE_MSM_GPIO_PINS(64); 373 + DECLARE_MSM_GPIO_PINS(65); 374 + DECLARE_MSM_GPIO_PINS(66); 375 + DECLARE_MSM_GPIO_PINS(67); 376 + DECLARE_MSM_GPIO_PINS(68); 377 + DECLARE_MSM_GPIO_PINS(69); 378 + DECLARE_MSM_GPIO_PINS(70); 379 + DECLARE_MSM_GPIO_PINS(71); 380 + DECLARE_MSM_GPIO_PINS(72); 381 + DECLARE_MSM_GPIO_PINS(73); 382 + DECLARE_MSM_GPIO_PINS(74); 383 + DECLARE_MSM_GPIO_PINS(75); 384 + DECLARE_MSM_GPIO_PINS(76); 385 + DECLARE_MSM_GPIO_PINS(77); 386 + DECLARE_MSM_GPIO_PINS(78); 387 + DECLARE_MSM_GPIO_PINS(79); 388 + DECLARE_MSM_GPIO_PINS(80); 389 + DECLARE_MSM_GPIO_PINS(81); 390 + DECLARE_MSM_GPIO_PINS(82); 391 + DECLARE_MSM_GPIO_PINS(83); 392 + DECLARE_MSM_GPIO_PINS(84); 393 + DECLARE_MSM_GPIO_PINS(85); 394 + DECLARE_MSM_GPIO_PINS(86); 395 + DECLARE_MSM_GPIO_PINS(87); 396 + DECLARE_MSM_GPIO_PINS(88); 397 + DECLARE_MSM_GPIO_PINS(89); 398 + DECLARE_MSM_GPIO_PINS(90); 399 + DECLARE_MSM_GPIO_PINS(91); 400 + DECLARE_MSM_GPIO_PINS(92); 401 + DECLARE_MSM_GPIO_PINS(93); 402 + DECLARE_MSM_GPIO_PINS(94); 403 + DECLARE_MSM_GPIO_PINS(95); 404 + DECLARE_MSM_GPIO_PINS(96); 405 + DECLARE_MSM_GPIO_PINS(97); 406 + DECLARE_MSM_GPIO_PINS(98); 407 + DECLARE_MSM_GPIO_PINS(99); 408 + DECLARE_MSM_GPIO_PINS(100); 409 + DECLARE_MSM_GPIO_PINS(101); 410 + DECLARE_MSM_GPIO_PINS(102); 411 + DECLARE_MSM_GPIO_PINS(103); 412 + DECLARE_MSM_GPIO_PINS(104); 413 + DECLARE_MSM_GPIO_PINS(105); 414 + DECLARE_MSM_GPIO_PINS(106); 415 + DECLARE_MSM_GPIO_PINS(107); 416 + DECLARE_MSM_GPIO_PINS(108); 417 + DECLARE_MSM_GPIO_PINS(109); 418 + DECLARE_MSM_GPIO_PINS(110); 419 + DECLARE_MSM_GPIO_PINS(111); 420 + DECLARE_MSM_GPIO_PINS(112); 421 + DECLARE_MSM_GPIO_PINS(113); 422 + DECLARE_MSM_GPIO_PINS(114); 423 + DECLARE_MSM_GPIO_PINS(115); 424 + DECLARE_MSM_GPIO_PINS(116); 425 + DECLARE_MSM_GPIO_PINS(117); 426 + DECLARE_MSM_GPIO_PINS(118); 427 + DECLARE_MSM_GPIO_PINS(119); 428 + DECLARE_MSM_GPIO_PINS(120); 429 + DECLARE_MSM_GPIO_PINS(121); 430 + DECLARE_MSM_GPIO_PINS(122); 431 + DECLARE_MSM_GPIO_PINS(123); 432 + DECLARE_MSM_GPIO_PINS(124); 433 + DECLARE_MSM_GPIO_PINS(125); 434 + DECLARE_MSM_GPIO_PINS(126); 435 + DECLARE_MSM_GPIO_PINS(127); 436 + DECLARE_MSM_GPIO_PINS(128); 437 + DECLARE_MSM_GPIO_PINS(129); 438 + DECLARE_MSM_GPIO_PINS(130); 439 + DECLARE_MSM_GPIO_PINS(131); 440 + DECLARE_MSM_GPIO_PINS(132); 441 + DECLARE_MSM_GPIO_PINS(133); 442 + DECLARE_MSM_GPIO_PINS(134); 443 + DECLARE_MSM_GPIO_PINS(135); 444 + DECLARE_MSM_GPIO_PINS(136); 445 + DECLARE_MSM_GPIO_PINS(137); 446 + DECLARE_MSM_GPIO_PINS(138); 447 + DECLARE_MSM_GPIO_PINS(139); 448 + DECLARE_MSM_GPIO_PINS(140); 449 + DECLARE_MSM_GPIO_PINS(141); 450 + DECLARE_MSM_GPIO_PINS(142); 451 + DECLARE_MSM_GPIO_PINS(143); 452 + DECLARE_MSM_GPIO_PINS(144); 453 + DECLARE_MSM_GPIO_PINS(145); 454 + DECLARE_MSM_GPIO_PINS(146); 455 + DECLARE_MSM_GPIO_PINS(147); 456 + DECLARE_MSM_GPIO_PINS(148); 457 + DECLARE_MSM_GPIO_PINS(149); 458 + DECLARE_MSM_GPIO_PINS(150); 459 + DECLARE_MSM_GPIO_PINS(151); 460 + DECLARE_MSM_GPIO_PINS(152); 461 + DECLARE_MSM_GPIO_PINS(153); 462 + DECLARE_MSM_GPIO_PINS(154); 463 + DECLARE_MSM_GPIO_PINS(155); 464 + DECLARE_MSM_GPIO_PINS(156); 465 + DECLARE_MSM_GPIO_PINS(157); 466 + DECLARE_MSM_GPIO_PINS(158); 467 + DECLARE_MSM_GPIO_PINS(159); 468 + DECLARE_MSM_GPIO_PINS(160); 469 + DECLARE_MSM_GPIO_PINS(161); 470 + DECLARE_MSM_GPIO_PINS(162); 471 + DECLARE_MSM_GPIO_PINS(163); 472 + DECLARE_MSM_GPIO_PINS(164); 473 + DECLARE_MSM_GPIO_PINS(165); 474 + DECLARE_MSM_GPIO_PINS(166); 475 + DECLARE_MSM_GPIO_PINS(167); 476 + DECLARE_MSM_GPIO_PINS(168); 477 + DECLARE_MSM_GPIO_PINS(169); 478 + DECLARE_MSM_GPIO_PINS(170); 479 + DECLARE_MSM_GPIO_PINS(171); 480 + DECLARE_MSM_GPIO_PINS(172); 481 + DECLARE_MSM_GPIO_PINS(173); 482 + DECLARE_MSM_GPIO_PINS(174); 483 + 484 + static const unsigned int ufs_reset_pins[] = { 175 }; 485 + static const unsigned int sdc2_clk_pins[] = { 176 }; 486 + static const unsigned int sdc2_cmd_pins[] = { 177 }; 487 + static const unsigned int sdc2_data_pins[] = { 178 }; 488 + 489 + enum sm8150_functions { 490 + msm_mux_adsp_ext, 491 + msm_mux_agera_pll, 492 + msm_mux_aoss_cti, 493 + msm_mux_atest_char, 494 + msm_mux_atest_char0, 495 + msm_mux_atest_char1, 496 + msm_mux_atest_char2, 497 + msm_mux_atest_char3, 498 + msm_mux_atest_usb1, 499 + msm_mux_atest_usb2, 500 + msm_mux_atest_usb10, 501 + msm_mux_atest_usb11, 502 + msm_mux_atest_usb12, 503 + msm_mux_atest_usb13, 504 + msm_mux_atest_usb20, 505 + msm_mux_atest_usb21, 506 + msm_mux_atest_usb22, 507 + msm_mux_atest_usb23, 508 + msm_mux_audio_ref, 509 + msm_mux_btfm_slimbus, 510 + msm_mux_cam_mclk, 511 + msm_mux_cci_async, 512 + msm_mux_cci_i2c, 513 + msm_mux_cci_timer0, 514 + msm_mux_cci_timer1, 515 + msm_mux_cci_timer2, 516 + msm_mux_cci_timer3, 517 + msm_mux_cci_timer4, 518 + msm_mux_cri_trng, 519 + msm_mux_cri_trng0, 520 + msm_mux_cri_trng1, 521 + msm_mux_dbg_out, 522 + msm_mux_ddr_bist, 523 + msm_mux_ddr_pxi0, 524 + msm_mux_ddr_pxi1, 525 + msm_mux_ddr_pxi2, 526 + msm_mux_ddr_pxi3, 527 + msm_mux_edp_hot, 528 + msm_mux_edp_lcd, 529 + msm_mux_emac_phy, 530 + msm_mux_emac_pps, 531 + msm_mux_gcc_gp1, 532 + msm_mux_gcc_gp2, 533 + msm_mux_gcc_gp3, 534 + msm_mux_gpio, 535 + msm_mux_jitter_bist, 536 + msm_mux_hs1_mi2s, 537 + msm_mux_hs2_mi2s, 538 + msm_mux_hs3_mi2s, 539 + msm_mux_lpass_slimbus, 540 + msm_mux_mdp_vsync, 541 + msm_mux_mdp_vsync0, 542 + msm_mux_mdp_vsync1, 543 + msm_mux_mdp_vsync2, 544 + msm_mux_mdp_vsync3, 545 + msm_mux_mss_lte, 546 + msm_mux_m_voc, 547 + msm_mux_nav_pps, 548 + msm_mux_pa_indicator, 549 + msm_mux_pci_e0, 550 + msm_mux_pci_e1, 551 + msm_mux_phase_flag, 552 + msm_mux_pll_bist, 553 + msm_mux_pll_bypassnl, 554 + msm_mux_pll_reset, 555 + msm_mux_pri_mi2s, 556 + msm_mux_pri_mi2s_ws, 557 + msm_mux_prng_rosc, 558 + msm_mux_qdss, 559 + msm_mux_qdss_cti, 560 + msm_mux_qlink_enable, 561 + msm_mux_qlink_request, 562 + msm_mux_qspi0, 563 + msm_mux_qspi1, 564 + msm_mux_qspi2, 565 + msm_mux_qspi3, 566 + msm_mux_qspi_clk, 567 + msm_mux_qspi_cs, 568 + msm_mux_qua_mi2s, 569 + msm_mux_qup0, 570 + msm_mux_qup1, 571 + msm_mux_qup2, 572 + msm_mux_qup3, 573 + msm_mux_qup4, 574 + msm_mux_qup5, 575 + msm_mux_qup6, 576 + msm_mux_qup7, 577 + msm_mux_qup8, 578 + msm_mux_qup9, 579 + msm_mux_qup10, 580 + msm_mux_qup11, 581 + msm_mux_qup12, 582 + msm_mux_qup13, 583 + msm_mux_qup14, 584 + msm_mux_qup15, 585 + msm_mux_qup16, 586 + msm_mux_qup17, 587 + msm_mux_qup18, 588 + msm_mux_qup19, 589 + msm_mux_qup_l4, 590 + msm_mux_qup_l5, 591 + msm_mux_qup_l6, 592 + msm_mux_rgmii, 593 + msm_mux_sdc4, 594 + msm_mux_sd_write, 595 + msm_mux_sec_mi2s, 596 + msm_mux_spkr_i2s, 597 + msm_mux_sp_cmu, 598 + msm_mux_ter_mi2s, 599 + msm_mux_tgu_ch0, 600 + msm_mux_tgu_ch2, 601 + msm_mux_tgu_ch1, 602 + msm_mux_tgu_ch3, 603 + msm_mux_tsense_pwm1, 604 + msm_mux_tsense_pwm2, 605 + msm_mux_tsif1, 606 + msm_mux_tsif2, 607 + msm_mux_uim1, 608 + msm_mux_uim2, 609 + msm_mux_uim_batt, 610 + msm_mux_usb2phy_ac, 611 + msm_mux_usb_phy, 612 + msm_mux_vfr_1, 613 + msm_mux_vsense_trigger, 614 + msm_mux_wlan1_adc1, 615 + msm_mux_wlan1_adc0, 616 + msm_mux_wlan2_adc1, 617 + msm_mux_wlan2_adc0, 618 + msm_mux_wmss_reset, 619 + msm_mux__, 620 + }; 621 + 622 + static const char * const phase_flag_groups[] = { 623 + "gpio18", "gpio19", "gpio20", "gpio55", "gpio56", 624 + "gpio57", "gpio59", "gpio64", "gpio68", "gpio76", 625 + "gpio79", "gpio80", "gpio90", "gpio91", "gpio92", 626 + "gpio93", "gpio94", "gpio96", "gpio114", "gpio115", 627 + "gpio116", "gpio117", "gpio118", "gpio119", "gpio120", 628 + "gpio121", "gpio122", "gpio126", "gpio127", "gpio128", 629 + "gpio144", "gpio145", 630 + }; 631 + 632 + static const char * const emac_pps_groups[] = { 633 + "gpio81", 634 + }; 635 + 636 + static const char * const qup12_groups[] = { 637 + "gpio83", "gpio84", "gpio85", "gpio86", 638 + }; 639 + 640 + static const char * const qup16_groups[] = { 641 + "gpio83", "gpio84", "gpio85", "gpio86", 642 + }; 643 + 644 + static const char * const tsif1_groups[] = { 645 + "gpio88", "gpio89", "gpio90", "gpio91", "gpio97", 646 + }; 647 + 648 + static const char * const qup8_groups[] = { 649 + "gpio88", "gpio89", "gpio90", "gpio91", 650 + }; 651 + 652 + static const char * const qspi_cs_groups[] = { 653 + "gpio88", "gpio94", 654 + }; 655 + 656 + static const char * const tgu_ch3_groups[] = { 657 + "gpio88", 658 + }; 659 + 660 + static const char * const qspi0_groups[] = { 661 + "gpio89", 662 + }; 663 + 664 + static const char * const mdp_vsync0_groups[] = { 665 + "gpio89", 666 + }; 667 + 668 + static const char * const mdp_vsync1_groups[] = { 669 + "gpio89", 670 + }; 671 + 672 + static const char * const mdp_vsync2_groups[] = { 673 + "gpio89", 674 + }; 675 + 676 + static const char * const mdp_vsync3_groups[] = { 677 + "gpio89", 678 + }; 679 + 680 + static const char * const tgu_ch0_groups[] = { 681 + "gpio89", 682 + }; 683 + 684 + static const char * const qspi1_groups[] = { 685 + "gpio90", 686 + }; 687 + 688 + static const char * const sdc4_groups[] = { 689 + "gpio90", "gpio91", "gpio92", "gpio93", "gpio94", "gpio95", 690 + }; 691 + 692 + static const char * const tgu_ch1_groups[] = { 693 + "gpio90", 694 + }; 695 + 696 + static const char * const wlan1_adc1_groups[] = { 697 + "gpio90", 698 + }; 699 + 700 + static const char * const qspi2_groups[] = { 701 + "gpio91", 702 + }; 703 + 704 + static const char * const vfr_1_groups[] = { 705 + "gpio91", 706 + }; 707 + 708 + static const char * const tgu_ch2_groups[] = { 709 + "gpio91", 710 + }; 711 + 712 + static const char * const wlan1_adc0_groups[] = { 713 + "gpio91", 714 + }; 715 + 716 + static const char * const tsif2_groups[] = { 717 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", 718 + }; 719 + 720 + static const char * const qup11_groups[] = { 721 + "gpio92", "gpio93", "gpio94", "gpio95", 722 + }; 723 + 724 + static const char * const qspi_clk_groups[] = { 725 + "gpio92", 726 + }; 727 + 728 + static const char * const wlan2_adc1_groups[] = { 729 + "gpio92", 730 + }; 731 + 732 + static const char * const qspi3_groups[] = { 733 + "gpio93", 734 + }; 735 + 736 + static const char * const wlan2_adc0_groups[] = { 737 + "gpio93", 738 + }; 739 + 740 + static const char * const sd_write_groups[] = { 741 + "gpio97", 742 + }; 743 + 744 + static const char * const qup7_groups[] = { 745 + "gpio98", "gpio99", "gpio100", "gpio101", 746 + }; 747 + 748 + static const char * const ddr_bist_groups[] = { 749 + "gpio98", "gpio99", "gpio145", "gpio146", 750 + }; 751 + 752 + static const char * const ddr_pxi3_groups[] = { 753 + "gpio98", "gpio101", 754 + }; 755 + 756 + static const char * const atest_usb13_groups[] = { 757 + "gpio99", 758 + }; 759 + 760 + static const char * const ddr_pxi1_groups[] = { 761 + "gpio99", "gpio100", 762 + }; 763 + 764 + static const char * const pll_bypassnl_groups[] = { 765 + "gpio100", 766 + }; 767 + 768 + static const char * const atest_usb12_groups[] = { 769 + "gpio100", 770 + }; 771 + 772 + static const char * const pll_reset_groups[] = { 773 + "gpio101", 774 + }; 775 + 776 + static const char * const pci_e1_groups[] = { 777 + "gpio102", "gpio103", 778 + }; 779 + 780 + static const char * const uim2_groups[] = { 781 + "gpio105", "gpio106", "gpio107", "gpio108", 782 + }; 783 + 784 + static const char * const uim1_groups[] = { 785 + "gpio109", "gpio110", "gpio111", "gpio112", 786 + }; 787 + 788 + static const char * const uim_batt_groups[] = { 789 + "gpio113", 790 + }; 791 + 792 + static const char * const usb2phy_ac_groups[] = { 793 + "gpio113", "gpio123", 794 + }; 795 + 796 + static const char * const aoss_cti_groups[] = { 797 + "gpio113", 798 + }; 799 + 800 + static const char * const qup1_groups[] = { 801 + "gpio114", "gpio115", "gpio116", "gpio117", 802 + }; 803 + 804 + static const char * const rgmii_groups[] = { 805 + "gpio4", "gpio5", "gpio6", "gpio7", "gpio59", 806 + "gpio114", "gpio115", "gpio116", "gpio117", 807 + "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 808 + }; 809 + 810 + static const char * const adsp_ext_groups[] = { 811 + "gpio115", 812 + }; 813 + 814 + static const char * const qup5_groups[] = { 815 + "gpio119", "gpio120", "gpio121", "gpio122", 816 + }; 817 + 818 + static const char * const atest_usb22_groups[] = { 819 + "gpio123", 820 + }; 821 + 822 + static const char * const emac_phy_groups[] = { 823 + "gpio124", 824 + }; 825 + 826 + static const char * const hs3_mi2s_groups[] = { 827 + "gpio125", "gpio165", "gpio166", "gpio167", "gpio168", 828 + }; 829 + 830 + static const char * const sec_mi2s_groups[] = { 831 + "gpio126", "gpio127", "gpio128", "gpio129", "gpio130", 832 + }; 833 + 834 + static const char * const qup2_groups[] = { 835 + "gpio126", "gpio127", "gpio128", "gpio129", 836 + }; 837 + 838 + static const char * const jitter_bist_groups[] = { 839 + "gpio129", 840 + }; 841 + 842 + static const char * const atest_usb21_groups[] = { 843 + "gpio129", 844 + }; 845 + 846 + static const char * const pll_bist_groups[] = { 847 + "gpio130", 848 + }; 849 + 850 + static const char * const atest_usb20_groups[] = { 851 + "gpio130", 852 + }; 853 + 854 + static const char * const atest_char0_groups[] = { 855 + "gpio130", 856 + }; 857 + 858 + static const char * const ter_mi2s_groups[] = { 859 + "gpio131", "gpio132", "gpio133", "gpio134", "gpio135", 860 + }; 861 + 862 + static const char * const gcc_gp1_groups[] = { 863 + "gpio131", "gpio136", 864 + }; 865 + 866 + static const char * const atest_char1_groups[] = { 867 + "gpio133", 868 + }; 869 + 870 + static const char * const atest_char2_groups[] = { 871 + "gpio134", 872 + }; 873 + 874 + static const char * const atest_char3_groups[] = { 875 + "gpio135", 876 + }; 877 + 878 + static const char * const qua_mi2s_groups[] = { 879 + "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", "gpio141", 880 + "gpio142", 881 + }; 882 + 883 + static const char * const pri_mi2s_groups[] = { 884 + "gpio143", "gpio144", "gpio146", "gpio147", 885 + }; 886 + 887 + static const char * const qup3_groups[] = { 888 + "gpio144", "gpio145", "gpio146", "gpio147", 889 + }; 890 + 891 + static const char * const ddr_pxi0_groups[] = { 892 + "gpio144", "gpio145", 893 + }; 894 + 895 + static const char * const pri_mi2s_ws_groups[] = { 896 + "gpio145", 897 + }; 898 + 899 + static const char * const vsense_trigger_groups[] = { 900 + "gpio145", 901 + }; 902 + 903 + static const char * const atest_usb1_groups[] = { 904 + "gpio145", 905 + }; 906 + 907 + static const char * const atest_usb11_groups[] = { 908 + "gpio146", 909 + }; 910 + 911 + static const char * const ddr_pxi2_groups[] = { 912 + "gpio146", "gpio147", 913 + }; 914 + 915 + static const char * const dbg_out_groups[] = { 916 + "gpio147", 917 + }; 918 + 919 + static const char * const atest_usb10_groups[] = { 920 + "gpio147", 921 + }; 922 + 923 + static const char * const spkr_i2s_groups[] = { 924 + "gpio148", "gpio149", "gpio150", "gpio151", "gpio152", 925 + }; 926 + 927 + static const char * const audio_ref_groups[] = { 928 + "gpio148", 929 + }; 930 + 931 + static const char * const lpass_slimbus_groups[] = { 932 + "gpio149", "gpio150", "gpio151", "gpio152", 933 + }; 934 + 935 + static const char * const tsense_pwm1_groups[] = { 936 + "gpio150", 937 + }; 938 + 939 + static const char * const tsense_pwm2_groups[] = { 940 + "gpio150", 941 + }; 942 + 943 + static const char * const btfm_slimbus_groups[] = { 944 + "gpio153", "gpio154", 945 + }; 946 + 947 + static const char * const hs1_mi2s_groups[] = { 948 + "gpio155", "gpio156", "gpio157", "gpio158", "gpio159", 949 + }; 950 + 951 + static const char * const cri_trng0_groups[] = { 952 + "gpio159", 953 + }; 954 + 955 + static const char * const hs2_mi2s_groups[] = { 956 + "gpio160", "gpio161", "gpio162", "gpio163", "gpio164", 957 + }; 958 + 959 + static const char * const cri_trng1_groups[] = { 960 + "gpio160", 961 + }; 962 + 963 + static const char * const cri_trng_groups[] = { 964 + "gpio161", 965 + }; 966 + 967 + static const char * const sp_cmu_groups[] = { 968 + "gpio162", 969 + }; 970 + 971 + static const char * const prng_rosc_groups[] = { 972 + "gpio163", 973 + }; 974 + 975 + static const char * const qup0_groups[] = { 976 + "gpio0", "gpio1", "gpio2", "gpio3", 977 + }; 978 + 979 + static const char * const gpio_groups[] = { 980 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 981 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 982 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 983 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 984 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 985 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 986 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 987 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 988 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 989 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 990 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 991 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 992 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 993 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 994 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 995 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 996 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 997 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 998 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 999 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 1000 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 1001 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 1002 + "gpio147", "gpio148", "gpio149", "gpio150", "gpio151", "gpio152", 1003 + "gpio153", "gpio154", "gpio155", "gpio156", "gpio157", "gpio158", 1004 + "gpio159", "gpio160", "gpio161", "gpio162", "gpio163", "gpio164", 1005 + "gpio165", "gpio166", "gpio167", "gpio168", "gpio169", "gpio170", 1006 + "gpio171", "gpio172", "gpio173", "gpio174", 1007 + }; 1008 + 1009 + static const char * const qup6_groups[] = { 1010 + "gpio4", "gpio5", "gpio6", "gpio7", 1011 + }; 1012 + 1013 + static const char * const qup_l6_groups[] = { 1014 + "gpio6", "gpio34", "gpio97", "gpio123", 1015 + }; 1016 + 1017 + static const char * const qup_l5_groups[] = { 1018 + "gpio7", "gpio33", "gpio82", "gpio96", 1019 + }; 1020 + 1021 + static const char * const mdp_vsync_groups[] = { 1022 + "gpio8", "gpio9", "gpio10", "gpio81", "gpio82", 1023 + }; 1024 + 1025 + static const char * const edp_lcd_groups[] = { 1026 + "gpio9", 1027 + }; 1028 + 1029 + static const char * const qup10_groups[] = { 1030 + "gpio9", "gpio10", "gpio11", "gpio12", 1031 + }; 1032 + 1033 + static const char * const m_voc_groups[] = { 1034 + "gpio10", 1035 + }; 1036 + 1037 + static const char * const edp_hot_groups[] = { 1038 + "gpio10", 1039 + }; 1040 + 1041 + static const char * const cam_mclk_groups[] = { 1042 + "gpio13", "gpio14", "gpio15", "gpio16", 1043 + }; 1044 + 1045 + static const char * const qdss_groups[] = { 1046 + "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", 1047 + "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", 1048 + "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", 1049 + "gpio28", "gpio29", "gpio30", "gpio31", "gpio32", 1050 + "gpio33", "gpio39", "gpio40", "gpio41", "gpio42", 1051 + "gpio47", "gpio48", "gpio83", "gpio117", "gpio118", 1052 + "gpio119", "gpio120", "gpio121", "gpio132", 1053 + "gpio133", "gpio134", 1054 + }; 1055 + 1056 + static const char * const cci_i2c_groups[] = { 1057 + "gpio17", "gpio18", "gpio19", "gpio20", "gpio31", "gpio32", "gpio33", 1058 + "gpio34", 1059 + }; 1060 + 1061 + static const char * const cci_timer0_groups[] = { 1062 + "gpio21", 1063 + }; 1064 + 1065 + static const char * const gcc_gp2_groups[] = { 1066 + "gpio21", "gpio137", 1067 + }; 1068 + 1069 + static const char * const cci_timer1_groups[] = { 1070 + "gpio22", 1071 + }; 1072 + 1073 + static const char * const gcc_gp3_groups[] = { 1074 + "gpio22", "gpio138", 1075 + }; 1076 + 1077 + static const char * const cci_timer2_groups[] = { 1078 + "gpio23", 1079 + }; 1080 + 1081 + static const char * const qup18_groups[] = { 1082 + "gpio23", "gpio24", "gpio25", "gpio26", 1083 + }; 1084 + 1085 + static const char * const cci_timer3_groups[] = { 1086 + "gpio24", 1087 + }; 1088 + 1089 + static const char * const cci_async_groups[] = { 1090 + "gpio24", "gpio25", "gpio26", 1091 + }; 1092 + 1093 + static const char * const cci_timer4_groups[] = { 1094 + "gpio25", 1095 + }; 1096 + 1097 + static const char * const qup15_groups[] = { 1098 + "gpio27", "gpio28", "gpio29", "gpio30", 1099 + }; 1100 + 1101 + static const char * const pci_e0_groups[] = { 1102 + "gpio35", "gpio36", 1103 + }; 1104 + 1105 + static const char * const qup_l4_groups[] = { 1106 + "gpio37", "gpio59", "gpio81", "gpio95", 1107 + }; 1108 + 1109 + static const char * const agera_pll_groups[] = { 1110 + "gpio37", 1111 + }; 1112 + 1113 + static const char * const usb_phy_groups[] = { 1114 + "gpio38", 1115 + }; 1116 + 1117 + static const char * const qup9_groups[] = { 1118 + "gpio39", "gpio40", "gpio41", "gpio42", 1119 + }; 1120 + 1121 + static const char * const qup13_groups[] = { 1122 + "gpio43", "gpio44", "gpio45", "gpio46", 1123 + }; 1124 + 1125 + static const char * const qdss_cti_groups[] = { 1126 + "gpio45", "gpio46", "gpio49", "gpio50", "gpio56", "gpio57", "gpio58", 1127 + "gpio58", 1128 + }; 1129 + 1130 + static const char * const qup14_groups[] = { 1131 + "gpio47", "gpio48", "gpio49", "gpio50", 1132 + }; 1133 + 1134 + static const char * const qup4_groups[] = { 1135 + "gpio51", "gpio52", "gpio53", "gpio54", 1136 + }; 1137 + 1138 + static const char * const qup17_groups[] = { 1139 + "gpio55", "gpio56", "gpio57", "gpio58", 1140 + }; 1141 + 1142 + static const char * const qup19_groups[] = { 1143 + "gpio55", "gpio56", "gpio57", "gpio58", 1144 + }; 1145 + 1146 + static const char * const atest_char_groups[] = { 1147 + "gpio59", 1148 + }; 1149 + 1150 + static const char * const nav_pps_groups[] = { 1151 + "gpio60", "gpio60", "gpio76", "gpio76", "gpio77", "gpio77", "gpio81", 1152 + "gpio81", "gpio82", "gpio82", 1153 + }; 1154 + 1155 + static const char * const atest_usb2_groups[] = { 1156 + "gpio60", 1157 + }; 1158 + 1159 + static const char * const qlink_request_groups[] = { 1160 + "gpio61", 1161 + }; 1162 + 1163 + static const char * const qlink_enable_groups[] = { 1164 + "gpio62", 1165 + }; 1166 + 1167 + static const char * const wmss_reset_groups[] = { 1168 + "gpio63", 1169 + }; 1170 + 1171 + static const char * const atest_usb23_groups[] = { 1172 + "gpio63", 1173 + }; 1174 + 1175 + static const char * const pa_indicator_groups[] = { 1176 + "gpio68", 1177 + }; 1178 + 1179 + static const char * const mss_lte_groups[] = { 1180 + "gpio69", "gpio70", 1181 + }; 1182 + 1183 + static const struct msm_function sm8150_functions[] = { 1184 + FUNCTION(adsp_ext), 1185 + FUNCTION(agera_pll), 1186 + FUNCTION(aoss_cti), 1187 + FUNCTION(ddr_pxi2), 1188 + FUNCTION(atest_char), 1189 + FUNCTION(atest_char0), 1190 + FUNCTION(atest_char1), 1191 + FUNCTION(atest_char2), 1192 + FUNCTION(atest_char3), 1193 + FUNCTION(audio_ref), 1194 + FUNCTION(atest_usb1), 1195 + FUNCTION(atest_usb2), 1196 + FUNCTION(atest_usb10), 1197 + FUNCTION(atest_usb11), 1198 + FUNCTION(atest_usb12), 1199 + FUNCTION(atest_usb13), 1200 + FUNCTION(atest_usb20), 1201 + FUNCTION(atest_usb21), 1202 + FUNCTION(atest_usb22), 1203 + FUNCTION(atest_usb23), 1204 + FUNCTION(btfm_slimbus), 1205 + FUNCTION(cam_mclk), 1206 + FUNCTION(cci_async), 1207 + FUNCTION(cci_i2c), 1208 + FUNCTION(cci_timer0), 1209 + FUNCTION(cci_timer1), 1210 + FUNCTION(cci_timer2), 1211 + FUNCTION(cci_timer3), 1212 + FUNCTION(cci_timer4), 1213 + FUNCTION(cri_trng), 1214 + FUNCTION(cri_trng0), 1215 + FUNCTION(cri_trng1), 1216 + FUNCTION(dbg_out), 1217 + FUNCTION(ddr_bist), 1218 + FUNCTION(ddr_pxi0), 1219 + FUNCTION(ddr_pxi1), 1220 + FUNCTION(ddr_pxi3), 1221 + FUNCTION(edp_hot), 1222 + FUNCTION(edp_lcd), 1223 + FUNCTION(emac_phy), 1224 + FUNCTION(emac_pps), 1225 + FUNCTION(gcc_gp1), 1226 + FUNCTION(gcc_gp2), 1227 + FUNCTION(gcc_gp3), 1228 + FUNCTION(gpio), 1229 + FUNCTION(hs1_mi2s), 1230 + FUNCTION(hs2_mi2s), 1231 + FUNCTION(hs3_mi2s), 1232 + FUNCTION(jitter_bist), 1233 + FUNCTION(lpass_slimbus), 1234 + FUNCTION(mdp_vsync), 1235 + FUNCTION(mdp_vsync0), 1236 + FUNCTION(mdp_vsync1), 1237 + FUNCTION(mdp_vsync2), 1238 + FUNCTION(mdp_vsync3), 1239 + FUNCTION(mss_lte), 1240 + FUNCTION(m_voc), 1241 + FUNCTION(nav_pps), 1242 + FUNCTION(pa_indicator), 1243 + FUNCTION(pci_e0), 1244 + FUNCTION(phase_flag), 1245 + FUNCTION(pll_bypassnl), 1246 + FUNCTION(pll_bist), 1247 + FUNCTION(pci_e1), 1248 + FUNCTION(pll_reset), 1249 + FUNCTION(pri_mi2s), 1250 + FUNCTION(pri_mi2s_ws), 1251 + FUNCTION(prng_rosc), 1252 + FUNCTION(qdss), 1253 + FUNCTION(qdss_cti), 1254 + FUNCTION(qlink_request), 1255 + FUNCTION(qlink_enable), 1256 + FUNCTION(qspi0), 1257 + FUNCTION(qspi1), 1258 + FUNCTION(qspi2), 1259 + FUNCTION(qspi3), 1260 + FUNCTION(qspi_clk), 1261 + FUNCTION(qspi_cs), 1262 + FUNCTION(qua_mi2s), 1263 + FUNCTION(qup0), 1264 + FUNCTION(qup1), 1265 + FUNCTION(qup2), 1266 + FUNCTION(qup3), 1267 + FUNCTION(qup4), 1268 + FUNCTION(qup5), 1269 + FUNCTION(qup6), 1270 + FUNCTION(qup7), 1271 + FUNCTION(qup8), 1272 + FUNCTION(qup9), 1273 + FUNCTION(qup10), 1274 + FUNCTION(qup11), 1275 + FUNCTION(qup12), 1276 + FUNCTION(qup13), 1277 + FUNCTION(qup14), 1278 + FUNCTION(qup15), 1279 + FUNCTION(qup16), 1280 + FUNCTION(qup17), 1281 + FUNCTION(qup18), 1282 + FUNCTION(qup19), 1283 + FUNCTION(qup_l4), 1284 + FUNCTION(qup_l5), 1285 + FUNCTION(qup_l6), 1286 + FUNCTION(rgmii), 1287 + FUNCTION(sdc4), 1288 + FUNCTION(sd_write), 1289 + FUNCTION(sec_mi2s), 1290 + FUNCTION(spkr_i2s), 1291 + FUNCTION(sp_cmu), 1292 + FUNCTION(ter_mi2s), 1293 + FUNCTION(tgu_ch0), 1294 + FUNCTION(tgu_ch1), 1295 + FUNCTION(tgu_ch2), 1296 + FUNCTION(tgu_ch3), 1297 + FUNCTION(tsense_pwm1), 1298 + FUNCTION(tsense_pwm2), 1299 + FUNCTION(tsif1), 1300 + FUNCTION(tsif2), 1301 + FUNCTION(uim1), 1302 + FUNCTION(uim2), 1303 + FUNCTION(uim_batt), 1304 + FUNCTION(usb2phy_ac), 1305 + FUNCTION(usb_phy), 1306 + FUNCTION(vfr_1), 1307 + FUNCTION(vsense_trigger), 1308 + FUNCTION(wlan1_adc0), 1309 + FUNCTION(wlan1_adc1), 1310 + FUNCTION(wlan2_adc0), 1311 + FUNCTION(wlan2_adc1), 1312 + FUNCTION(wmss_reset), 1313 + }; 1314 + 1315 + /* 1316 + * Every pin is maintained as a single group, and missing or non-existing pin 1317 + * would be maintained as dummy group to synchronize pin group index with 1318 + * pin descriptor registered with pinctrl core. 1319 + * Clients would not be able to request these dummy pin groups. 1320 + */ 1321 + static const struct msm_pingroup sm8150_groups[] = { 1322 + [0] = PINGROUP(0, SOUTH, qup0, _, _, _, _, _, _, _, _), 1323 + [1] = PINGROUP(1, SOUTH, qup0, _, _, _, _, _, _, _, _), 1324 + [2] = PINGROUP(2, SOUTH, qup0, _, _, _, _, _, _, _, _), 1325 + [3] = PINGROUP(3, SOUTH, qup0, _, _, _, _, _, _, _, _), 1326 + [4] = PINGROUP(4, SOUTH, qup6, rgmii, _, _, _, _, _, _, _), 1327 + [5] = PINGROUP(5, SOUTH, qup6, rgmii, _, _, _, _, _, _, _), 1328 + [6] = PINGROUP(6, SOUTH, qup6, rgmii, qup_l6, _, _, _, _, _, _), 1329 + [7] = PINGROUP(7, SOUTH, qup6, rgmii, qup_l5, _, _, _, _, _, _), 1330 + [8] = PINGROUP(8, NORTH, mdp_vsync, _, _, _, _, _, _, _, _), 1331 + [9] = PINGROUP(9, NORTH, mdp_vsync, edp_lcd, qup10, _, _, _, _, _, _), 1332 + [10] = PINGROUP(10, NORTH, mdp_vsync, m_voc, edp_hot, qup10, _, _, _, _, _), 1333 + [11] = PINGROUP(11, NORTH, qup10, _, _, _, _, _, _, _, _), 1334 + [12] = PINGROUP(12, NORTH, qup10, _, _, _, _, _, _, _, _), 1335 + [13] = PINGROUP(13, NORTH, cam_mclk, qdss, _, _, _, _, _, _, _), 1336 + [14] = PINGROUP(14, NORTH, cam_mclk, qdss, _, _, _, _, _, _, _), 1337 + [15] = PINGROUP(15, NORTH, cam_mclk, qdss, _, _, _, _, _, _, _), 1338 + [16] = PINGROUP(16, NORTH, cam_mclk, qdss, _, _, _, _, _, _, _), 1339 + [17] = PINGROUP(17, NORTH, cci_i2c, qdss, _, _, _, _, _, _, _), 1340 + [18] = PINGROUP(18, NORTH, cci_i2c, phase_flag, _, qdss, _, _, _, _, _), 1341 + [19] = PINGROUP(19, NORTH, cci_i2c, phase_flag, _, qdss, _, _, _, _, _), 1342 + [20] = PINGROUP(20, NORTH, cci_i2c, phase_flag, _, qdss, _, _, _, _, _), 1343 + [21] = PINGROUP(21, EAST, cci_timer0, gcc_gp2, qdss, _, _, _, _, _, _), 1344 + [22] = PINGROUP(22, EAST, cci_timer1, gcc_gp3, qdss, _, _, _, _, _, _), 1345 + [23] = PINGROUP(23, EAST, cci_timer2, qup18, qdss, _, _, _, _, _, _), 1346 + [24] = PINGROUP(24, EAST, cci_timer3, cci_async, qup18, qdss, _, _, _, _, _), 1347 + [25] = PINGROUP(25, EAST, cci_timer4, cci_async, qup18, qdss, _, _, _, _, _), 1348 + [26] = PINGROUP(26, EAST, cci_async, qup18, qdss, _, _, _, _, _, _), 1349 + [27] = PINGROUP(27, EAST, qup15, _, qdss, _, _, _, _, _, _), 1350 + [28] = PINGROUP(28, EAST, qup15, qdss, _, _, _, _, _, _, _), 1351 + [29] = PINGROUP(29, EAST, qup15, qdss, _, _, _, _, _, _, _), 1352 + [30] = PINGROUP(30, EAST, qup15, qdss, _, _, _, _, _, _, _), 1353 + [31] = PINGROUP(31, NORTH, cci_i2c, qdss, _, _, _, _, _, _, _), 1354 + [32] = PINGROUP(32, NORTH, cci_i2c, qdss, _, _, _, _, _, _, _), 1355 + [33] = PINGROUP(33, NORTH, cci_i2c, qup_l5, qdss, _, _, _, _, _, _), 1356 + [34] = PINGROUP(34, NORTH, cci_i2c, qup_l6, _, _, _, _, _, _, _), 1357 + [35] = PINGROUP(35, NORTH, pci_e0, _, _, _, _, _, _, _, _), 1358 + [36] = PINGROUP(36, NORTH, pci_e0, _, _, _, _, _, _, _, _), 1359 + [37] = PINGROUP(37, NORTH, qup_l4, agera_pll, _, _, _, _, _, _, _), 1360 + [38] = PINGROUP(38, SOUTH, usb_phy, _, _, _, _, _, _, _, _), 1361 + [39] = PINGROUP(39, NORTH, qup9, qdss, _, _, _, _, _, _, _), 1362 + [40] = PINGROUP(40, NORTH, qup9, qdss, _, _, _, _, _, _, _), 1363 + [41] = PINGROUP(41, NORTH, qup9, qdss, _, _, _, _, _, _, _), 1364 + [42] = PINGROUP(42, NORTH, qup9, qdss, _, _, _, _, _, _, _), 1365 + [43] = PINGROUP(43, EAST, qup13, _, _, _, _, _, _, _, _), 1366 + [44] = PINGROUP(44, EAST, qup13, _, _, _, _, _, _, _, _), 1367 + [45] = PINGROUP(45, EAST, qup13, qdss_cti, _, _, _, _, _, _, _), 1368 + [46] = PINGROUP(46, EAST, qup13, qdss_cti, _, _, _, _, _, _, _), 1369 + [47] = PINGROUP(47, EAST, qup14, qdss, _, _, _, _, _, _, _), 1370 + [48] = PINGROUP(48, EAST, qup14, qdss, _, _, _, _, _, _, _), 1371 + [49] = PINGROUP(49, EAST, qup14, _, qdss_cti, _, _, _, _, _, _), 1372 + [50] = PINGROUP(50, EAST, qup14, qdss_cti, _, _, _, _, _, _, _), 1373 + [51] = PINGROUP(51, SOUTH, qup4, _, _, _, _, _, _, _, _), 1374 + [52] = PINGROUP(52, SOUTH, qup4, _, _, _, _, _, _, _, _), 1375 + [53] = PINGROUP(53, SOUTH, qup4, _, _, _, _, _, _, _, _), 1376 + [54] = PINGROUP(54, SOUTH, qup4, _, _, _, _, _, _, _, _), 1377 + [55] = PINGROUP(55, SOUTH, qup17, qup19, phase_flag, _, _, _, _, _, _), 1378 + [56] = PINGROUP(56, SOUTH, qup17, qup19, qdss_cti, phase_flag, _, _, _, _, _), 1379 + [57] = PINGROUP(57, SOUTH, qup17, qup19, qdss_cti, phase_flag, _, _, _, _, _), 1380 + [58] = PINGROUP(58, SOUTH, qup17, qup19, qdss_cti, phase_flag, _, _, _, _, _), 1381 + [59] = PINGROUP(59, SOUTH, rgmii, qup_l4, phase_flag, _, atest_char, _, _, _, _), 1382 + [60] = PINGROUP(60, SOUTH, _, nav_pps, nav_pps, atest_usb2, _, _, _, _, _), 1383 + [61] = PINGROUP(61, SOUTH, qlink_request, _, _, _, _, _, _, _, _), 1384 + [62] = PINGROUP(62, SOUTH, qlink_enable, _, _, _, _, _, _, _, _), 1385 + [63] = PINGROUP(63, SOUTH, wmss_reset, atest_usb23, _, _, _, _, _, _, _), 1386 + [64] = PINGROUP(64, SOUTH, _, phase_flag, _, _, _, _, _, _, _), 1387 + [65] = PINGROUP(65, SOUTH, _, _, _, _, _, _, _, _, _), 1388 + [66] = PINGROUP(66, SOUTH, _, _, _, _, _, _, _, _, _), 1389 + [67] = PINGROUP(67, SOUTH, _, _, _, _, _, _, _, _, _), 1390 + [68] = PINGROUP(68, SOUTH, _, pa_indicator, phase_flag, _, _, _, _, _, _), 1391 + [69] = PINGROUP(69, SOUTH, mss_lte, _, _, _, _, _, _, _, _), 1392 + [70] = PINGROUP(70, SOUTH, mss_lte, _, _, _, _, _, _, _, _), 1393 + [71] = PINGROUP(71, SOUTH, _, _, _, _, _, _, _, _, _), 1394 + [72] = PINGROUP(72, SOUTH, _, _, _, _, _, _, _, _, _), 1395 + [73] = PINGROUP(73, SOUTH, _, _, _, _, _, _, _, _, _), 1396 + [74] = PINGROUP(74, SOUTH, _, _, _, _, _, _, _, _, _), 1397 + [75] = PINGROUP(75, SOUTH, _, _, _, _, _, _, _, _, _), 1398 + [76] = PINGROUP(76, SOUTH, _, _, _, nav_pps, nav_pps, phase_flag, _, _, _), 1399 + [77] = PINGROUP(77, SOUTH, _, _, _, nav_pps, nav_pps, _, _, _, _), 1400 + [78] = PINGROUP(78, SOUTH, _, _, _, _, _, _, _, _, _), 1401 + [79] = PINGROUP(79, SOUTH, _, _, phase_flag, _, _, _, _, _, _), 1402 + [80] = PINGROUP(80, SOUTH, _, _, phase_flag, _, _, _, _, _, _), 1403 + [81] = PINGROUP(81, SOUTH, _, _, _, nav_pps, nav_pps, qup_l4, mdp_vsync, emac_pps, _), 1404 + [82] = PINGROUP(82, SOUTH, _, _, _, nav_pps, nav_pps, qup_l5, mdp_vsync, _, _), 1405 + [83] = PINGROUP(83, NORTH, qup12, qup16, _, qdss, _, _, _, _, _), 1406 + [84] = PINGROUP(84, NORTH, qup12, qup16, _, _, _, _, _, _, _), 1407 + [85] = PINGROUP(85, NORTH, qup12, qup16, _, _, _, _, _, _, _), 1408 + [86] = PINGROUP(86, NORTH, qup12, qup16, _, _, _, _, _, _, _), 1409 + [87] = PINGROUP(87, EAST, _, _, _, _, _, _, _, _, _), 1410 + [88] = PINGROUP(88, NORTH, tsif1, qup8, qspi_cs, tgu_ch3, _, _, _, _, _), 1411 + [89] = PINGROUP(89, NORTH, tsif1, qup8, qspi0, mdp_vsync0, mdp_vsync1, mdp_vsync2, mdp_vsync3, tgu_ch0, _), 1412 + [90] = PINGROUP(90, NORTH, tsif1, qup8, qspi1, sdc4, phase_flag, tgu_ch1, _, _, wlan1_adc1), 1413 + [91] = PINGROUP(91, NORTH, tsif1, qup8, qspi2, sdc4, vfr_1, phase_flag, tgu_ch2, _, _), 1414 + [92] = PINGROUP(92, NORTH, tsif2, qup11, qspi_clk, sdc4, phase_flag, _, wlan2_adc1, _, _), 1415 + [93] = PINGROUP(93, NORTH, tsif2, qup11, qspi3, sdc4, phase_flag, _, wlan2_adc0, _, _), 1416 + [94] = PINGROUP(94, NORTH, tsif2, qup11, qspi_cs, sdc4, phase_flag, _, _, _, _), 1417 + [95] = PINGROUP(95, NORTH, tsif2, qup11, sdc4, qup_l4, _, _, _, _, _), 1418 + [96] = PINGROUP(96, NORTH, tsif2, qup_l5, phase_flag, _, _, _, _, _, _), 1419 + [97] = PINGROUP(97, NORTH, sd_write, tsif1, qup_l6, _, _, _, _, _, _), 1420 + [98] = PINGROUP(98, SOUTH, qup7, ddr_bist, ddr_pxi3, _, _, _, _, _, _), 1421 + [99] = PINGROUP(99, SOUTH, qup7, ddr_bist, atest_usb13, ddr_pxi1, _, _, _, _, _), 1422 + [100] = PINGROUP(100, SOUTH, qup7, pll_bypassnl, atest_usb12, ddr_pxi1, _, _, _, _, _), 1423 + [101] = PINGROUP(101, SOUTH, qup7, pll_reset, ddr_pxi3, _, _, _, _, _, _), 1424 + [102] = PINGROUP(102, NORTH, pci_e1, _, _, _, _, _, _, _, _), 1425 + [103] = PINGROUP(103, NORTH, pci_e1, _, _, _, _, _, _, _, _), 1426 + [104] = PINGROUP(104, NORTH, _, _, _, _, _, _, _, _, _), 1427 + [105] = PINGROUP(105, WEST, uim2, _, _, _, _, _, _, _, _), 1428 + [106] = PINGROUP(106, WEST, uim2, _, _, _, _, _, _, _, _), 1429 + [107] = PINGROUP(107, WEST, uim2, _, _, _, _, _, _, _, _), 1430 + [108] = PINGROUP(108, WEST, uim2, _, _, _, _, _, _, _, _), 1431 + [109] = PINGROUP(109, WEST, uim1, _, _, _, _, _, _, _, _), 1432 + [110] = PINGROUP(110, WEST, uim1, _, _, _, _, _, _, _, _), 1433 + [111] = PINGROUP(111, WEST, uim1, _, _, _, _, _, _, _, _), 1434 + [112] = PINGROUP(112, WEST, uim1, _, _, _, _, _, _, _, _), 1435 + [113] = PINGROUP(113, WEST, uim_batt, usb2phy_ac, aoss_cti, _, _, _, _, _, _), 1436 + [114] = PINGROUP(114, SOUTH, qup1, rgmii, phase_flag, _, _, _, _, _, _), 1437 + [115] = PINGROUP(115, SOUTH, qup1, rgmii, phase_flag, adsp_ext, _, _, _, _, _), 1438 + [116] = PINGROUP(116, SOUTH, qup1, rgmii, phase_flag, _, _, _, _, _, _), 1439 + [117] = PINGROUP(117, SOUTH, qup1, rgmii, phase_flag, _, qdss, _, _, _, _), 1440 + [118] = PINGROUP(118, SOUTH, rgmii, phase_flag, _, qdss, _, _, _, _, _), 1441 + [119] = PINGROUP(119, SOUTH, qup5, rgmii, phase_flag, _, qdss, _, _, _, _), 1442 + [120] = PINGROUP(120, SOUTH, qup5, rgmii, phase_flag, _, qdss, _, _, _, _), 1443 + [121] = PINGROUP(121, SOUTH, qup5, rgmii, phase_flag, _, qdss, _, _, _, _), 1444 + [122] = PINGROUP(122, SOUTH, qup5, rgmii, phase_flag, _, _, _, _, _, _), 1445 + [123] = PINGROUP(123, SOUTH, usb2phy_ac, qup_l6, atest_usb22, _, _, _, _, _, _), 1446 + [124] = PINGROUP(124, SOUTH, emac_phy, _, _, _, _, _, _, _, _), 1447 + [125] = PINGROUP(125, WEST, hs3_mi2s, _, _, _, _, _, _, _, _), 1448 + [126] = PINGROUP(126, SOUTH, sec_mi2s, qup2, phase_flag, _, _, _, _, _, _), 1449 + [127] = PINGROUP(127, SOUTH, sec_mi2s, qup2, phase_flag, _, _, _, _, _, _), 1450 + [128] = PINGROUP(128, SOUTH, sec_mi2s, qup2, phase_flag, _, _, _, _, _, _), 1451 + [129] = PINGROUP(129, SOUTH, sec_mi2s, qup2, jitter_bist, atest_usb21, _, _, _, _, _), 1452 + [130] = PINGROUP(130, SOUTH, sec_mi2s, pll_bist, atest_usb20, atest_char0, _, _, _, _, _), 1453 + [131] = PINGROUP(131, SOUTH, ter_mi2s, gcc_gp1, _, _, _, _, _, _, _), 1454 + [132] = PINGROUP(132, SOUTH, ter_mi2s, _, qdss, _, _, _, _, _, _), 1455 + [133] = PINGROUP(133, SOUTH, ter_mi2s, qdss, atest_char1, _, _, _, _, _, _), 1456 + [134] = PINGROUP(134, SOUTH, ter_mi2s, qdss, atest_char2, _, _, _, _, _, _), 1457 + [135] = PINGROUP(135, SOUTH, ter_mi2s, atest_char3, _, _, _, _, _, _, _), 1458 + [136] = PINGROUP(136, SOUTH, qua_mi2s, gcc_gp1, _, _, _, _, _, _, _), 1459 + [137] = PINGROUP(137, SOUTH, qua_mi2s, gcc_gp2, _, _, _, _, _, _, _), 1460 + [138] = PINGROUP(138, SOUTH, qua_mi2s, gcc_gp3, _, _, _, _, _, _, _), 1461 + [139] = PINGROUP(139, SOUTH, qua_mi2s, _, _, _, _, _, _, _, _), 1462 + [140] = PINGROUP(140, SOUTH, qua_mi2s, _, _, _, _, _, _, _, _), 1463 + [141] = PINGROUP(141, SOUTH, qua_mi2s, _, _, _, _, _, _, _, _), 1464 + [142] = PINGROUP(142, SOUTH, qua_mi2s, _, _, _, _, _, _, _, _), 1465 + [143] = PINGROUP(143, SOUTH, pri_mi2s, _, _, _, _, _, _, _, _), 1466 + [144] = PINGROUP(144, SOUTH, pri_mi2s, qup3, phase_flag, _, ddr_pxi0, _, _, _, _), 1467 + [145] = PINGROUP(145, SOUTH, pri_mi2s_ws, qup3, phase_flag, ddr_bist, _, vsense_trigger, atest_usb1, ddr_pxi0, _), 1468 + [146] = PINGROUP(146, SOUTH, pri_mi2s, qup3, ddr_bist, atest_usb11, ddr_pxi2, _, _, _, _), 1469 + [147] = PINGROUP(147, SOUTH, pri_mi2s, qup3, dbg_out, atest_usb10, ddr_pxi2, _, _, _, _), 1470 + [148] = PINGROUP(148, SOUTH, spkr_i2s, audio_ref, _, _, _, _, _, _, _), 1471 + [149] = PINGROUP(149, SOUTH, lpass_slimbus, spkr_i2s, _, _, _, _, _, _, _), 1472 + [150] = PINGROUP(150, SOUTH, lpass_slimbus, spkr_i2s, tsense_pwm1, tsense_pwm2, _, _, _, _, _), 1473 + [151] = PINGROUP(151, SOUTH, lpass_slimbus, spkr_i2s, _, _, _, _, _, _, _), 1474 + [152] = PINGROUP(152, SOUTH, lpass_slimbus, spkr_i2s, _, _, _, _, _, _, _), 1475 + [153] = PINGROUP(153, SOUTH, btfm_slimbus, _, _, _, _, _, _, _, _), 1476 + [154] = PINGROUP(154, SOUTH, btfm_slimbus, _, _, _, _, _, _, _, _), 1477 + [155] = PINGROUP(155, WEST, hs1_mi2s, _, _, _, _, _, _, _, _), 1478 + [156] = PINGROUP(156, WEST, hs1_mi2s, _, _, _, _, _, _, _, _), 1479 + [157] = PINGROUP(157, WEST, hs1_mi2s, _, _, _, _, _, _, _, _), 1480 + [158] = PINGROUP(158, WEST, hs1_mi2s, _, _, _, _, _, _, _, _), 1481 + [159] = PINGROUP(159, WEST, hs1_mi2s, cri_trng0, _, _, _, _, _, _, _), 1482 + [160] = PINGROUP(160, WEST, hs2_mi2s, cri_trng1, _, _, _, _, _, _, _), 1483 + [161] = PINGROUP(161, WEST, hs2_mi2s, cri_trng, _, _, _, _, _, _, _), 1484 + [162] = PINGROUP(162, WEST, hs2_mi2s, sp_cmu, _, _, _, _, _, _, _), 1485 + [163] = PINGROUP(163, WEST, hs2_mi2s, prng_rosc, _, _, _, _, _, _, _), 1486 + [164] = PINGROUP(164, WEST, hs2_mi2s, _, _, _, _, _, _, _, _), 1487 + [165] = PINGROUP(165, WEST, hs3_mi2s, _, _, _, _, _, _, _, _), 1488 + [166] = PINGROUP(166, WEST, hs3_mi2s, _, _, _, _, _, _, _, _), 1489 + [167] = PINGROUP(167, WEST, hs3_mi2s, _, _, _, _, _, _, _, _), 1490 + [168] = PINGROUP(168, WEST, hs3_mi2s, _, _, _, _, _, _, _, _), 1491 + [169] = PINGROUP(169, NORTH, _, _, _, _, _, _, _, _, _), 1492 + [170] = PINGROUP(170, NORTH, _, _, _, _, _, _, _, _, _), 1493 + [171] = PINGROUP(171, NORTH, _, _, _, _, _, _, _, _, _), 1494 + [172] = PINGROUP(172, NORTH, _, _, _, _, _, _, _, _, _), 1495 + [173] = PINGROUP(173, NORTH, _, _, _, _, _, _, _, _, _), 1496 + [174] = PINGROUP(174, NORTH, _, _, _, _, _, _, _, _, _), 1497 + [175] = UFS_RESET(ufs_reset, 0xB6000), 1498 + [176] = SDC_QDSD_PINGROUP(sdc2_clk, 0xB2000, 14, 6), 1499 + [177] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xB2000, 11, 3), 1500 + [178] = SDC_QDSD_PINGROUP(sdc2_data, 0xB2000, 9, 0), 1501 + }; 1502 + 1503 + static const struct msm_pinctrl_soc_data sm8150_pinctrl = { 1504 + .pins = sm8150_pins, 1505 + .npins = ARRAY_SIZE(sm8150_pins), 1506 + .functions = sm8150_functions, 1507 + .nfunctions = ARRAY_SIZE(sm8150_functions), 1508 + .groups = sm8150_groups, 1509 + .ngroups = ARRAY_SIZE(sm8150_groups), 1510 + .ngpios = 176, 1511 + .tiles = sm8150_tiles, 1512 + .ntiles = ARRAY_SIZE(sm8150_tiles), 1513 + }; 1514 + 1515 + static int sm8150_pinctrl_probe(struct platform_device *pdev) 1516 + { 1517 + return msm_pinctrl_probe(pdev, &sm8150_pinctrl); 1518 + } 1519 + 1520 + static const struct of_device_id sm8150_pinctrl_of_match[] = { 1521 + { .compatible = "qcom,sm8150-pinctrl", }, 1522 + { }, 1523 + }; 1524 + 1525 + static struct platform_driver sm8150_pinctrl_driver = { 1526 + .driver = { 1527 + .name = "sm8150-pinctrl", 1528 + .of_match_table = sm8150_pinctrl_of_match, 1529 + }, 1530 + .probe = sm8150_pinctrl_probe, 1531 + .remove = msm_pinctrl_remove, 1532 + }; 1533 + 1534 + static int __init sm8150_pinctrl_init(void) 1535 + { 1536 + return platform_driver_register(&sm8150_pinctrl_driver); 1537 + } 1538 + arch_initcall(sm8150_pinctrl_init); 1539 + 1540 + static void __exit sm8150_pinctrl_exit(void) 1541 + { 1542 + platform_driver_unregister(&sm8150_pinctrl_driver); 1543 + } 1544 + module_exit(sm8150_pinctrl_exit); 1545 + 1546 + MODULE_DESCRIPTION("QTI sm8150 pinctrl driver"); 1547 + MODULE_LICENSE("GPL v2"); 1548 + MODULE_DEVICE_TABLE(of, sm8150_pinctrl_of_match);
+50 -10
drivers/pinctrl/sh-pfc/core.c
··· 717 717 #endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */ 718 718 719 719 #ifdef DEBUG 720 - static bool is0s(const u16 *enum_ids, unsigned int n) 720 + static bool __init is0s(const u16 *enum_ids, unsigned int n) 721 721 { 722 722 unsigned int i; 723 723 ··· 728 728 return true; 729 729 } 730 730 731 - static unsigned int sh_pfc_errors; 732 - static unsigned int sh_pfc_warnings; 731 + static unsigned int sh_pfc_errors __initdata = 0; 732 + static unsigned int sh_pfc_warnings __initdata = 0; 733 733 734 - static void sh_pfc_check_cfg_reg(const char *drvname, 735 - const struct pinmux_cfg_reg *cfg_reg) 734 + static void __init sh_pfc_check_cfg_reg(const char *drvname, 735 + const struct pinmux_cfg_reg *cfg_reg) 736 736 { 737 737 unsigned int i, n, rw, fw; 738 738 ··· 764 764 } 765 765 } 766 766 767 - static void sh_pfc_check_info(const struct sh_pfc_soc_info *info) 767 + static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info) 768 768 { 769 769 const struct sh_pfc_function *func; 770 770 const char *drvname = info->name; ··· 773 773 774 774 pr_info("Checking %s\n", drvname); 775 775 776 + /* Check pins */ 777 + for (i = 0; i < info->nr_pins; i++) { 778 + for (j = 0; j < i; j++) { 779 + if (!strcmp(info->pins[i].name, info->pins[j].name)) { 780 + pr_err("%s: pin %s/%s: name conflict\n", 781 + drvname, info->pins[i].name, 782 + info->pins[j].name); 783 + sh_pfc_errors++; 784 + } 785 + 786 + if (info->pins[i].pin != (u16)-1 && 787 + info->pins[i].pin == info->pins[j].pin) { 788 + pr_err("%s: pin %s/%s: pin %u conflict\n", 789 + drvname, info->pins[i].name, 790 + info->pins[j].name, info->pins[i].pin); 791 + sh_pfc_errors++; 792 + } 793 + 794 + if (info->pins[i].enum_id && 795 + info->pins[i].enum_id == info->pins[j].enum_id) { 796 + pr_err("%s: pin %s/%s: enum_id %u conflict\n", 797 + drvname, info->pins[i].name, 798 + info->pins[j].name, 799 + info->pins[i].enum_id); 800 + sh_pfc_errors++; 801 + } 802 + } 803 + } 804 + 776 805 /* Check groups and functions */ 777 806 refcnts = kcalloc(info->nr_groups, sizeof(*refcnts), GFP_KERNEL); 778 807 if (!refcnts) ··· 809 780 810 781 for (i = 0; i < info->nr_functions; i++) { 811 782 func = &info->functions[i]; 783 + if (!func->name) { 784 + pr_err("%s: empty function %u\n", drvname, i); 785 + sh_pfc_errors++; 786 + continue; 787 + } 812 788 for (j = 0; j < func->nr_groups; j++) { 813 789 for (k = 0; k < info->nr_groups; k++) { 814 - if (!strcmp(func->groups[j], 790 + if (info->groups[k].name && 791 + !strcmp(func->groups[j], 815 792 info->groups[k].name)) { 816 793 refcnts[k]++; 817 794 break; ··· 833 798 } 834 799 835 800 for (i = 0; i < info->nr_groups; i++) { 801 + if (!info->groups[i].name) { 802 + pr_err("%s: empty group %u\n", drvname, i); 803 + sh_pfc_errors++; 804 + continue; 805 + } 836 806 if (!refcnts[i]) { 837 807 pr_err("%s: orphan group %s\n", drvname, 838 808 info->groups[i].name); 839 809 sh_pfc_errors++; 840 810 } else if (refcnts[i] > 1) { 841 - pr_err("%s: group %s referred by %u functions\n", 842 - drvname, info->groups[i].name, refcnts[i]); 811 + pr_warn("%s: group %s referenced by %u functions\n", 812 + drvname, info->groups[i].name, refcnts[i]); 843 813 sh_pfc_warnings++; 844 814 } 845 815 } ··· 856 816 sh_pfc_check_cfg_reg(drvname, &info->cfg_regs[i]); 857 817 } 858 818 859 - static void sh_pfc_check_driver(const struct platform_driver *pdrv) 819 + static void __init sh_pfc_check_driver(const struct platform_driver *pdrv) 860 820 { 861 821 unsigned int i; 862 822
+34 -36
drivers/pinctrl/sh-pfc/pfc-emev2.c
··· 19 19 PORT_1(155, fn, pfx##155, sfx), PORT_1(156, fn, pfx##156, sfx), \ 20 20 PORT_1(157, fn, pfx##157, sfx), PORT_1(158, fn, pfx##158, sfx) 21 21 22 + #define CPU_ALL_NOGP(fn) \ 23 + PIN_NOGP(LCD3_B2, "B15", fn), \ 24 + PIN_NOGP(LCD3_B3, "C15", fn), \ 25 + PIN_NOGP(LCD3_B4, "D15", fn), \ 26 + PIN_NOGP(LCD3_B5, "B14", fn), \ 27 + PIN_NOGP(LCD3_B6, "C14", fn), \ 28 + PIN_NOGP(LCD3_B7, "D14", fn), \ 29 + PIN_NOGP(LCD3_G2, "B17", fn), \ 30 + PIN_NOGP(LCD3_G3, "C17", fn), \ 31 + PIN_NOGP(LCD3_G4, "D17", fn), \ 32 + PIN_NOGP(LCD3_G5, "B16", fn), \ 33 + PIN_NOGP(LCD3_G6, "C16", fn), \ 34 + PIN_NOGP(LCD3_G7, "D16", fn) 35 + 22 36 enum { 23 37 PINMUX_RESERVED = 0, 24 38 ··· 232 218 PINMUX_MARK_END, 233 219 }; 234 220 235 - /* Pin numbers for pins without a corresponding GPIO port number are computed 236 - * from the row and column numbers with a 1000 offset to avoid collisions with 237 - * GPIO port numbers. */ 238 - #define PIN_NUMBER(row, col) (1000+((row)-1)*23+(col)-1) 221 + /* 222 + * Pins not associated with a GPIO port. 223 + */ 224 + enum { 225 + PORT_ASSIGN_LAST(), 226 + NOGP_ALL(), 227 + }; 239 228 240 229 /* Expand to a list of sh_pfc_pin entries (named PORT#). 241 230 * NOTE: No config are recorded since the driver do not handle pinconf. */ ··· 247 230 248 231 static const struct sh_pfc_pin pinmux_pins[] = { 249 232 PINMUX_EMEV_GPIO_ALL(), 250 - 251 - /* Pins not associated with a GPIO port */ 252 - SH_PFC_PIN_NAMED(2, 14, B14), 253 - SH_PFC_PIN_NAMED(2, 15, B15), 254 - SH_PFC_PIN_NAMED(2, 16, B16), 255 - SH_PFC_PIN_NAMED(2, 17, B17), 256 - SH_PFC_PIN_NAMED(3, 14, C14), 257 - SH_PFC_PIN_NAMED(3, 15, C15), 258 - SH_PFC_PIN_NAMED(3, 16, C16), 259 - SH_PFC_PIN_NAMED(3, 17, C17), 260 - SH_PFC_PIN_NAMED(4, 14, D14), 261 - SH_PFC_PIN_NAMED(4, 15, D15), 262 - SH_PFC_PIN_NAMED(4, 16, D16), 263 - SH_PFC_PIN_NAMED(4, 17, D17), 233 + PINMUX_NOGP_ALL(), 264 234 }; 265 235 266 236 /* Expand to a list of name_DATA, name_FN marks */ ··· 833 829 /* R[0:7], G[0:7], B[0:7] */ 834 830 32, 33, 34, 35, 835 831 36, 37, 38, 39, 836 - 40, 41, PIN_NUMBER(2, 17), PIN_NUMBER(3, 17), 837 - PIN_NUMBER(4, 17), PIN_NUMBER(2, 16), PIN_NUMBER(3, 16), 838 - PIN_NUMBER(4, 16), 839 - 42, 43, PIN_NUMBER(2, 15), PIN_NUMBER(3, 15), 840 - PIN_NUMBER(4, 15), PIN_NUMBER(2, 14), PIN_NUMBER(3, 14), 841 - PIN_NUMBER(4, 14) 832 + 40, 41, PIN_LCD3_G2, PIN_LCD3_G3, 833 + PIN_LCD3_G4, PIN_LCD3_G5, PIN_LCD3_G6, PIN_LCD3_G7, 834 + 42, 43, PIN_LCD3_B2, PIN_LCD3_B3, 835 + PIN_LCD3_B4, PIN_LCD3_B5, PIN_LCD3_B6, PIN_LCD3_B7 842 836 }; 843 837 static const unsigned int lcd3_rgb888_mux[] = { 844 838 LCD3_R0_MARK, LCD3_R1_MARK, LCD3_R2_MARK, LCD3_R3_MARK, ··· 852 850 /* CLK_O, HS, VS, DE */ 853 851 18, 21, 22, 23, 854 852 /* YUV3_D[0:15] */ 855 - 40, 41, PIN_NUMBER(2, 17), PIN_NUMBER(3, 17), 856 - PIN_NUMBER(4, 17), PIN_NUMBER(2, 16), PIN_NUMBER(3, 16), 857 - PIN_NUMBER(4, 16), 858 - 42, 43, PIN_NUMBER(2, 15), PIN_NUMBER(3, 15), 859 - PIN_NUMBER(4, 15), PIN_NUMBER(2, 14), PIN_NUMBER(3, 14), 860 - PIN_NUMBER(4, 14), 853 + 40, 41, PIN_LCD3_G2, PIN_LCD3_G3, 854 + PIN_LCD3_G4, PIN_LCD3_G5, PIN_LCD3_G6, PIN_LCD3_G7, 855 + 42, 43, PIN_LCD3_B2, PIN_LCD3_B3, 856 + PIN_LCD3_B4, PIN_LCD3_B5, PIN_LCD3_B6, PIN_LCD3_B7, 861 857 }; 862 858 static const unsigned int yuv3_mux[] = { 863 859 YUV3_CLK_O_MARK, YUV3_HS_MARK, YUV3_VS_MARK, YUV3_DE_MARK, ··· 972 972 /* CLK, CTRL */ 973 973 38, 39, 974 974 /* TP33_DATA[0:15] */ 975 - 40, 41, PIN_NUMBER(2, 17), PIN_NUMBER(3, 17), 976 - PIN_NUMBER(4, 17), PIN_NUMBER(2, 16), PIN_NUMBER(3, 16), 977 - PIN_NUMBER(4, 16), 978 - 42, 43, PIN_NUMBER(2, 15), PIN_NUMBER(3, 15), 979 - PIN_NUMBER(4, 15), PIN_NUMBER(2, 14), PIN_NUMBER(3, 14), 980 - PIN_NUMBER(4, 14), 975 + 40, 41, PIN_LCD3_G2, PIN_LCD3_G3, 976 + PIN_LCD3_G4, PIN_LCD3_G5, PIN_LCD3_G6, PIN_LCD3_G7, 977 + 42, 43, PIN_LCD3_B2, PIN_LCD3_B3, 978 + PIN_LCD3_B4, PIN_LCD3_B5, PIN_LCD3_B6, PIN_LCD3_B7, 981 979 }; 982 980 static const unsigned int tp33_mux[] = { 983 981 TP33_CLK_MARK, TP33_CTRL_MARK,
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
··· 1252 1252 1253 1253 #define __O (SH_PFC_PIN_CFG_OUTPUT) 1254 1254 #define __IO (SH_PFC_PIN_CFG_INPUT | SH_PFC_PIN_CFG_OUTPUT) 1255 - #define __PUD (SH_PFC_PIN_CFG_PULL_DOWN | SH_PFC_PIN_CFG_PULL_UP) 1255 + #define __PUD (SH_PFC_PIN_CFG_PULL_UP_DOWN) 1256 1256 1257 1257 #define R8A73A4_PIN_IO_PU_PD(pin) SH_PFC_PIN_CFG(pin, __IO | __PUD) 1258 1258 #define R8A73A4_PIN_O(pin) SH_PFC_PIN_CFG(pin, __O)
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7740.c
··· 1515 1515 #define __IO (SH_PFC_PIN_CFG_INPUT | SH_PFC_PIN_CFG_OUTPUT) 1516 1516 #define __PD (SH_PFC_PIN_CFG_PULL_DOWN) 1517 1517 #define __PU (SH_PFC_PIN_CFG_PULL_UP) 1518 - #define __PUD (SH_PFC_PIN_CFG_PULL_DOWN | SH_PFC_PIN_CFG_PULL_UP) 1518 + #define __PUD (SH_PFC_PIN_CFG_PULL_UP_DOWN) 1519 1519 1520 1520 #define R8A7740_PIN_I_PD(pin) SH_PFC_PIN_CFG(pin, __I | __PD) 1521 1521 #define R8A7740_PIN_I_PU(pin) SH_PFC_PIN_CFG(pin, __I | __PU)
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a77470.c
··· 10 10 11 11 #include "sh_pfc.h" 12 12 13 - #define CPU_ALL_PORT(fn, sfx) \ 13 + #define CPU_ALL_GP(fn, sfx) \ 14 14 PORT_GP_4(0, fn, sfx), \ 15 15 PORT_GP_1(0, 4, fn, sfx), \ 16 16 PORT_GP_CFG_1(0, 5, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \
+55 -70
drivers/pinctrl/sh-pfc/pfc-r8a7778.c
··· 22 22 #define PORT_GP_PUP_1(bank, pin, fn, sfx) \ 23 23 PORT_GP_CFG_1(bank, pin, fn, sfx, SH_PFC_PIN_CFG_PULL_UP) 24 24 25 - #define PORT_GP_PUP_27(bank, fn, sfx) \ 26 - PORT_GP_PUP_1(bank, 0, fn, sfx), PORT_GP_PUP_1(bank, 1, fn, sfx), \ 27 - PORT_GP_PUP_1(bank, 2, fn, sfx), PORT_GP_PUP_1(bank, 3, fn, sfx), \ 28 - PORT_GP_PUP_1(bank, 4, fn, sfx), PORT_GP_PUP_1(bank, 5, fn, sfx), \ 29 - PORT_GP_PUP_1(bank, 6, fn, sfx), PORT_GP_PUP_1(bank, 7, fn, sfx), \ 30 - PORT_GP_PUP_1(bank, 8, fn, sfx), PORT_GP_PUP_1(bank, 9, fn, sfx), \ 31 - PORT_GP_PUP_1(bank, 10, fn, sfx), PORT_GP_PUP_1(bank, 11, fn, sfx), \ 32 - PORT_GP_PUP_1(bank, 12, fn, sfx), PORT_GP_PUP_1(bank, 13, fn, sfx), \ 33 - PORT_GP_PUP_1(bank, 14, fn, sfx), PORT_GP_PUP_1(bank, 15, fn, sfx), \ 34 - PORT_GP_PUP_1(bank, 16, fn, sfx), PORT_GP_PUP_1(bank, 17, fn, sfx), \ 35 - PORT_GP_PUP_1(bank, 18, fn, sfx), PORT_GP_PUP_1(bank, 19, fn, sfx), \ 36 - PORT_GP_PUP_1(bank, 20, fn, sfx), PORT_GP_PUP_1(bank, 21, fn, sfx), \ 37 - PORT_GP_PUP_1(bank, 22, fn, sfx), PORT_GP_PUP_1(bank, 23, fn, sfx), \ 38 - PORT_GP_PUP_1(bank, 24, fn, sfx), PORT_GP_PUP_1(bank, 25, fn, sfx), \ 39 - PORT_GP_PUP_1(bank, 26, fn, sfx) 40 - 41 - #define CPU_ALL_PORT(fn, sfx) \ 25 + #define CPU_ALL_GP(fn, sfx) \ 42 26 PORT_GP_CFG_32(0, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 43 27 PORT_GP_CFG_32(1, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 44 28 PORT_GP_CFG_32(2, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 45 29 PORT_GP_CFG_32(3, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 46 - PORT_GP_PUP_27(4, fn, sfx) 30 + PORT_GP_CFG_27(4, fn, sfx, SH_PFC_PIN_CFG_PULL_UP) 31 + 32 + #define CPU_ALL_NOGP(fn) \ 33 + PIN_NOGP(CLKOUT, "B25", fn), \ 34 + PIN_NOGP(CS0, "A20", fn), \ 35 + PIN_NOGP(CS1_A26, "C20", fn) 47 36 48 37 enum { 49 38 PINMUX_RESERVED = 0, ··· 1242 1253 PINMUX_IPSR_MSEL(IP10_24_22, CAN_CLK_C, SEL_CANCLK_C), 1243 1254 }; 1244 1255 1245 - /* Pin numbers for pins without a corresponding GPIO port number are computed 1246 - * from the row and column numbers with a 1000 offset to avoid collisions with 1247 - * GPIO port numbers. 1256 + /* 1257 + * Pins not associated with a GPIO port. 1248 1258 */ 1249 - #define PIN_NUMBER(row, col) (1000+((row)-1)*25+(col)-1) 1259 + enum { 1260 + GP_ASSIGN_LAST(), 1261 + NOGP_ALL(), 1262 + }; 1250 1263 1251 1264 static const struct sh_pfc_pin pinmux_pins[] = { 1252 1265 PINMUX_GPIO_GP_ALL(), 1253 - 1254 - /* Pins not associated with a GPIO port */ 1255 - SH_PFC_PIN_NAMED(3, 20, C20), 1256 - SH_PFC_PIN_NAMED(1, 20, A20), 1257 - SH_PFC_PIN_NAMED(2, 25, B25), 1266 + PINMUX_NOGP_ALL(), 1258 1267 }; 1259 1268 1260 1269 /* - macro */ ··· 1387 1400 HSPI_RX1_A, HSPI_TX1_A); 1388 1401 1389 1402 HSPI_PFC_PIN(hspi1_b, RCAR_GP_PIN(0, 27), RCAR_GP_PIN(0, 26), 1390 - PIN_NUMBER(1, 20), PIN_NUMBER(2, 25)); 1403 + PIN_CS0, PIN_CLKOUT); 1391 1404 HSPI_PFC_DAT(hspi1_b, HSPI_CLK1_B, HSPI_CS1_B, 1392 1405 HSPI_RX1_B, HSPI_TX1_B); 1393 1406 ··· 1413 1426 I2C_PFC_MUX(i2c1_b, SDA1_B, SCL1_B); 1414 1427 1415 1428 /* - I2C2 ------------------------------------------------------------------ */ 1416 - I2C_PFC_PIN(i2c2_a, PIN_NUMBER(3, 20), RCAR_GP_PIN(1, 3)); 1429 + I2C_PFC_PIN(i2c2_a, PIN_CS1_A26, RCAR_GP_PIN(1, 3)); 1417 1430 I2C_PFC_MUX(i2c2_a, SDA2_A, SCL2_A); 1418 1431 I2C_PFC_PIN(i2c2_b, RCAR_GP_PIN(0, 3), RCAR_GP_PIN(0, 4)); 1419 1432 I2C_PFC_MUX(i2c2_b, SDA2_B, SCL2_B); ··· 1503 1516 SCIF_PFC_DAT(scif2_data_e, TX2_E, RX2_E); 1504 1517 SCIF_PFC_PIN(scif2_clk_a, RCAR_GP_PIN(3, 9)); 1505 1518 SCIF_PFC_CLK(scif2_clk_a, SCK2_A); 1506 - SCIF_PFC_PIN(scif2_clk_b, PIN_NUMBER(3, 20)); 1519 + SCIF_PFC_PIN(scif2_clk_b, PIN_CS1_A26); 1507 1520 SCIF_PFC_CLK(scif2_clk_b, SCK2_B); 1508 1521 SCIF_PFC_PIN(scif2_clk_c, RCAR_GP_PIN(4, 12)); 1509 1522 SCIF_PFC_CLK(scif2_clk_c, SCK2_C); ··· 1618 1631 SSI_PFC_DATA(ssi0_data, SSI_SDATA0); 1619 1632 SSI_PFC_PINS(ssi1_a_ctrl, RCAR_GP_PIN(2, 20), RCAR_GP_PIN(2, 21)); 1620 1633 SSI_PFC_CTRL(ssi1_a_ctrl, SSI_SCK1_A, SSI_WS1_A); 1621 - SSI_PFC_PINS(ssi1_b_ctrl, PIN_NUMBER(3, 20), RCAR_GP_PIN(1, 3)); 1634 + SSI_PFC_PINS(ssi1_b_ctrl, PIN_CS1_A26, RCAR_GP_PIN(1, 3)); 1622 1635 SSI_PFC_CTRL(ssi1_b_ctrl, SSI_SCK1_B, SSI_WS1_B); 1623 1636 SSI_PFC_PINS(ssi1_data, RCAR_GP_PIN(3, 9)); 1624 1637 SSI_PFC_DATA(ssi1_data, SSI_SDATA1); ··· 2908 2921 { }, 2909 2922 }; 2910 2923 2911 - #define PIN_NONE U16_MAX 2912 - 2913 2924 static const struct pinmux_bias_reg pinmux_bias_regs[] = { 2914 2925 { PINMUX_BIAS_REG("PUPR0", 0x100, "N/A", 0) { 2915 2926 [ 0] = RCAR_GP_PIN(0, 6), /* A0 */ ··· 2954 2969 [ 7] = RCAR_GP_PIN(1, 10), /* DACK0 */ 2955 2970 [ 8] = RCAR_GP_PIN(1, 12), /* IRQ0 */ 2956 2971 [ 9] = RCAR_GP_PIN(1, 13), /* IRQ1 */ 2957 - [10] = PIN_NONE, 2958 - [11] = PIN_NONE, 2959 - [12] = PIN_NONE, 2960 - [13] = PIN_NONE, 2961 - [14] = PIN_NONE, 2962 - [15] = PIN_NONE, 2963 - [16] = PIN_NONE, 2964 - [17] = PIN_NONE, 2965 - [18] = PIN_NONE, 2966 - [19] = PIN_NONE, 2967 - [20] = PIN_NONE, 2968 - [21] = PIN_NONE, 2969 - [22] = PIN_NONE, 2970 - [23] = PIN_NONE, 2971 - [24] = PIN_NONE, 2972 - [25] = PIN_NONE, 2973 - [26] = PIN_NONE, 2974 - [27] = PIN_NONE, 2975 - [28] = PIN_NONE, 2976 - [29] = PIN_NONE, 2977 - [30] = PIN_NONE, 2978 - [31] = PIN_NONE, 2972 + [10] = SH_PFC_PIN_NONE, 2973 + [11] = SH_PFC_PIN_NONE, 2974 + [12] = SH_PFC_PIN_NONE, 2975 + [13] = SH_PFC_PIN_NONE, 2976 + [14] = SH_PFC_PIN_NONE, 2977 + [15] = SH_PFC_PIN_NONE, 2978 + [16] = SH_PFC_PIN_NONE, 2979 + [17] = SH_PFC_PIN_NONE, 2980 + [18] = SH_PFC_PIN_NONE, 2981 + [19] = SH_PFC_PIN_NONE, 2982 + [20] = SH_PFC_PIN_NONE, 2983 + [21] = SH_PFC_PIN_NONE, 2984 + [22] = SH_PFC_PIN_NONE, 2985 + [23] = SH_PFC_PIN_NONE, 2986 + [24] = SH_PFC_PIN_NONE, 2987 + [25] = SH_PFC_PIN_NONE, 2988 + [26] = SH_PFC_PIN_NONE, 2989 + [27] = SH_PFC_PIN_NONE, 2990 + [28] = SH_PFC_PIN_NONE, 2991 + [29] = SH_PFC_PIN_NONE, 2992 + [30] = SH_PFC_PIN_NONE, 2993 + [31] = SH_PFC_PIN_NONE, 2979 2994 } }, 2980 2995 { PINMUX_BIAS_REG("PUPR2", 0x108, "N/A", 0) { 2981 2996 [ 0] = RCAR_GP_PIN(1, 22), /* DU0_DR0 */ ··· 3097 3112 [14] = RCAR_GP_PIN(4, 20), /* ETH_MAGIC */ 3098 3113 [15] = RCAR_GP_PIN(4, 25), /* AVS1 */ 3099 3114 [16] = RCAR_GP_PIN(4, 26), /* AVS2 */ 3100 - [17] = PIN_NONE, 3101 - [18] = PIN_NONE, 3102 - [19] = PIN_NONE, 3103 - [20] = PIN_NONE, 3104 - [21] = PIN_NONE, 3105 - [22] = PIN_NONE, 3106 - [23] = PIN_NONE, 3107 - [24] = PIN_NONE, 3108 - [25] = PIN_NONE, 3109 - [26] = PIN_NONE, 3110 - [27] = PIN_NONE, 3111 - [28] = PIN_NONE, 3112 - [29] = PIN_NONE, 3113 - [30] = PIN_NONE, 3114 - [31] = PIN_NONE, 3115 + [17] = SH_PFC_PIN_NONE, 3116 + [18] = SH_PFC_PIN_NONE, 3117 + [19] = SH_PFC_PIN_NONE, 3118 + [20] = SH_PFC_PIN_NONE, 3119 + [21] = SH_PFC_PIN_NONE, 3120 + [22] = SH_PFC_PIN_NONE, 3121 + [23] = SH_PFC_PIN_NONE, 3122 + [24] = SH_PFC_PIN_NONE, 3123 + [25] = SH_PFC_PIN_NONE, 3124 + [26] = SH_PFC_PIN_NONE, 3125 + [27] = SH_PFC_PIN_NONE, 3126 + [28] = SH_PFC_PIN_NONE, 3127 + [29] = SH_PFC_PIN_NONE, 3128 + [30] = SH_PFC_PIN_NONE, 3129 + [31] = SH_PFC_PIN_NONE, 3115 3130 } }, 3116 3131 { /* sentinel */ }, 3117 3132 };
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7779.c
··· 11 11 12 12 #include "sh_pfc.h" 13 13 14 - #define CPU_ALL_PORT(fn, sfx) \ 14 + #define CPU_ALL_GP(fn, sfx) \ 15 15 PORT_GP_32(0, fn, sfx), \ 16 16 PORT_GP_32(1, fn, sfx), \ 17 17 PORT_GP_32(2, fn, sfx), \
+20 -16
drivers/pinctrl/sh-pfc/pfc-r8a7790.c
··· 20 20 * All pins assigned to GPIO bank 3 can be used for SD interfaces in 21 21 * which case they support both 3.3V and 1.8V signalling. 22 22 */ 23 - #define CPU_ALL_PORT(fn, sfx) \ 23 + #define CPU_ALL_GP(fn, sfx) \ 24 24 PORT_GP_32(0, fn, sfx), \ 25 25 PORT_GP_30(1, fn, sfx), \ 26 26 PORT_GP_30(2, fn, sfx), \ 27 27 PORT_GP_CFG_32(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \ 28 28 PORT_GP_32(4, fn, sfx), \ 29 29 PORT_GP_32(5, fn, sfx) 30 + 31 + #define CPU_ALL_NOGP(fn) \ 32 + PIN_NOGP(IIC0_SDA, "AF15", fn), \ 33 + PIN_NOGP(IIC0_SCL, "AG15", fn), \ 34 + PIN_NOGP(IIC3_SDA, "AH15", fn), \ 35 + PIN_NOGP(IIC3_SCL, "AJ15", fn) 30 36 31 37 enum { 32 38 PINMUX_RESERVED = 0, ··· 1733 1727 PINMUX_DATA(I2C3_SDA_MARK, FN_SEL_IICDVFS_1), 1734 1728 }; 1735 1729 1736 - /* R8A7790 has 6 banks with 32 GPIOs in each = 192 GPIOs */ 1737 - #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1738 - #define PIN_NUMBER(r, c) (((r) - 'A') * 31 + (c) + 200) 1739 - #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1730 + /* 1731 + * Pins not associated with a GPIO port. 1732 + */ 1733 + enum { 1734 + GP_ASSIGN_LAST(), 1735 + NOGP_ALL(), 1736 + }; 1740 1737 1741 1738 static const struct sh_pfc_pin pinmux_pins[] = { 1742 1739 PINMUX_GPIO_GP_ALL(), 1743 - 1744 - /* Pins not associated with a GPIO port */ 1745 - SH_PFC_PIN_NAMED(ROW_GROUP_A('F'), 15, AF15), 1746 - SH_PFC_PIN_NAMED(ROW_GROUP_A('G'), 15, AG15), 1747 - SH_PFC_PIN_NAMED(ROW_GROUP_A('H'), 15, AH15), 1748 - SH_PFC_PIN_NAMED(ROW_GROUP_A('J'), 15, AJ15), 1740 + PINMUX_NOGP_ALL(), 1749 1741 }; 1750 1742 1751 1743 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 2139 2135 /* - I2C0 ------------------------------------------------------------------- */ 2140 2136 static const unsigned int i2c0_pins[] = { 2141 2137 /* SCL, SDA */ 2142 - PIN_A_NUMBER('G', 15), PIN_A_NUMBER('F', 15), 2138 + PIN_IIC0_SCL, PIN_IIC0_SDA, 2143 2139 }; 2144 2140 static const unsigned int i2c0_mux[] = { 2145 2141 I2C0_SCL_MARK, I2C0_SDA_MARK, ··· 2205 2201 /* - I2C3 ------------------------------------------------------------------- */ 2206 2202 static const unsigned int i2c3_pins[] = { 2207 2203 /* SCL, SDA */ 2208 - PIN_A_NUMBER('J', 15), PIN_A_NUMBER('H', 15), 2204 + PIN_IIC3_SCL, PIN_IIC3_SDA, 2209 2205 }; 2210 2206 static const unsigned int i2c3_mux[] = { 2211 2207 I2C3_SCL_MARK, I2C3_SDA_MARK, ··· 2213 2209 /* - IIC0 (I2C4) ------------------------------------------------------------ */ 2214 2210 static const unsigned int iic0_pins[] = { 2215 2211 /* SCL, SDA */ 2216 - PIN_A_NUMBER('G', 15), PIN_A_NUMBER('F', 15), 2212 + PIN_IIC0_SCL, PIN_IIC0_SDA, 2217 2213 }; 2218 2214 static const unsigned int iic0_mux[] = { 2219 2215 IIC0_SCL_MARK, IIC0_SDA_MARK, ··· 2278 2274 }; 2279 2275 /* - IIC3 (I2C7) ------------------------------------------------------------ */ 2280 2276 static const unsigned int iic3_pins[] = { 2281 - /* SCL, SDA */ 2282 - PIN_A_NUMBER('J', 15), PIN_A_NUMBER('H', 15), 2277 + /* SCL, SDA */ 2278 + PIN_IIC3_SCL, PIN_IIC3_SDA, 2283 2279 }; 2284 2280 static const unsigned int iic3_mux[] = { 2285 2281 IIC3_SCL_MARK, IIC3_SDA_MARK,
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7791.c
··· 15 15 * Pins 0-23 assigned to GPIO bank 6 can be used for SD interfaces in 16 16 * which case they support both 3.3V and 1.8V signalling. 17 17 */ 18 - #define CPU_ALL_PORT(fn, sfx) \ 18 + #define CPU_ALL_GP(fn, sfx) \ 19 19 PORT_GP_32(0, fn, sfx), \ 20 20 PORT_GP_26(1, fn, sfx), \ 21 21 PORT_GP_32(2, fn, sfx), \
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7792.c
··· 11 11 #include "core.h" 12 12 #include "sh_pfc.h" 13 13 14 - #define CPU_ALL_PORT(fn, sfx) \ 14 + #define CPU_ALL_GP(fn, sfx) \ 15 15 PORT_GP_29(0, fn, sfx), \ 16 16 PORT_GP_23(1, fn, sfx), \ 17 17 PORT_GP_32(2, fn, sfx), \
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7794.c
··· 14 14 #include "core.h" 15 15 #include "sh_pfc.h" 16 16 17 - #define CPU_ALL_PORT(fn, sfx) \ 17 + #define CPU_ALL_GP(fn, sfx) \ 18 18 PORT_GP_32(0, fn, sfx), \ 19 19 PORT_GP_26(1, fn, sfx), \ 20 20 PORT_GP_32(2, fn, sfx), \
+233 -201
drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c
··· 11 11 #include "core.h" 12 12 #include "sh_pfc.h" 13 13 14 - #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | \ 15 - SH_PFC_PIN_CFG_PULL_UP | \ 16 - SH_PFC_PIN_CFG_PULL_DOWN) 14 + #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) 17 15 18 - #define CPU_ALL_PORT(fn, sfx) \ 16 + #define CPU_ALL_GP(fn, sfx) \ 19 17 PORT_GP_CFG_16(0, fn, sfx, CFG_FLAGS), \ 20 18 PORT_GP_CFG_28(1, fn, sfx, CFG_FLAGS), \ 21 19 PORT_GP_CFG_15(2, fn, sfx, CFG_FLAGS), \ ··· 26 28 PORT_GP_CFG_26(5, fn, sfx, CFG_FLAGS), \ 27 29 PORT_GP_CFG_32(6, fn, sfx, CFG_FLAGS), \ 28 30 PORT_GP_CFG_4(7, fn, sfx, CFG_FLAGS) 31 + 32 + #define CPU_ALL_NOGP(fn) \ 33 + PIN_NOGP_CFG(ASEBRK, "ASEBRK", fn, CFG_FLAGS), \ 34 + PIN_NOGP_CFG(AVB_MDIO, "AVB_MDIO", fn, CFG_FLAGS), \ 35 + PIN_NOGP_CFG(AVB_RD0, "AVB_RD0", fn, CFG_FLAGS), \ 36 + PIN_NOGP_CFG(AVB_RD1, "AVB_RD1", fn, CFG_FLAGS), \ 37 + PIN_NOGP_CFG(AVB_RD2, "AVB_RD2", fn, CFG_FLAGS), \ 38 + PIN_NOGP_CFG(AVB_RD3, "AVB_RD3", fn, CFG_FLAGS), \ 39 + PIN_NOGP_CFG(AVB_RXC, "AVB_RXC", fn, CFG_FLAGS), \ 40 + PIN_NOGP_CFG(AVB_RX_CTL, "AVB_RX_CTL", fn, CFG_FLAGS), \ 41 + PIN_NOGP_CFG(AVB_TD0, "AVB_TD0", fn, CFG_FLAGS), \ 42 + PIN_NOGP_CFG(AVB_TD1, "AVB_TD1", fn, CFG_FLAGS), \ 43 + PIN_NOGP_CFG(AVB_TD2, "AVB_TD2", fn, CFG_FLAGS), \ 44 + PIN_NOGP_CFG(AVB_TD3, "AVB_TD3", fn, CFG_FLAGS), \ 45 + PIN_NOGP_CFG(AVB_TXC, "AVB_TXC", fn, CFG_FLAGS), \ 46 + PIN_NOGP_CFG(AVB_TXCREFCLK, "AVB_TXCREFCLK", fn, CFG_FLAGS), \ 47 + PIN_NOGP_CFG(AVB_TX_CTL, "AVB_TX_CTL", fn, CFG_FLAGS), \ 48 + PIN_NOGP_CFG(CLKOUT, "CLKOUT", fn, CFG_FLAGS), \ 49 + PIN_NOGP_CFG(DU_DOTCLKIN0, "DU_DOTCLKIN0", fn, CFG_FLAGS), \ 50 + PIN_NOGP_CFG(DU_DOTCLKIN1, "DU_DOTCLKIN1", fn, CFG_FLAGS), \ 51 + PIN_NOGP_CFG(DU_DOTCLKIN2, "DU_DOTCLKIN2", fn, CFG_FLAGS), \ 52 + PIN_NOGP_CFG(DU_DOTCLKIN3, "DU_DOTCLKIN3", fn, CFG_FLAGS), \ 53 + PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN),\ 54 + PIN_NOGP_CFG(FSCLKST_N, "FSCLKST#", fn, CFG_FLAGS), \ 55 + PIN_NOGP_CFG(MLB_REF, "MLB_REF", fn, CFG_FLAGS), \ 56 + PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, CFG_FLAGS), \ 57 + PIN_NOGP_CFG(QSPI0_IO2, "QSPI0_IO2", fn, CFG_FLAGS), \ 58 + PIN_NOGP_CFG(QSPI0_IO3, "QSPI0_IO3", fn, CFG_FLAGS), \ 59 + PIN_NOGP_CFG(QSPI0_MISO_IO1, "QSPI0_MISO_IO1", fn, CFG_FLAGS), \ 60 + PIN_NOGP_CFG(QSPI0_MOSI_IO0, "QSPI0_MOSI_IO0", fn, CFG_FLAGS), \ 61 + PIN_NOGP_CFG(QSPI0_SPCLK, "QSPI0_SPCLK", fn, CFG_FLAGS), \ 62 + PIN_NOGP_CFG(QSPI0_SSL, "QSPI0_SSL", fn, CFG_FLAGS), \ 63 + PIN_NOGP_CFG(QSPI1_IO2, "QSPI1_IO2", fn, CFG_FLAGS), \ 64 + PIN_NOGP_CFG(QSPI1_IO3, "QSPI1_IO3", fn, CFG_FLAGS), \ 65 + PIN_NOGP_CFG(QSPI1_MISO_IO1, "QSPI1_MISO_IO1", fn, CFG_FLAGS), \ 66 + PIN_NOGP_CFG(QSPI1_MOSI_IO0, "QSPI1_MOSI_IO0", fn, CFG_FLAGS), \ 67 + PIN_NOGP_CFG(QSPI1_SPCLK, "QSPI1_SPCLK", fn, CFG_FLAGS), \ 68 + PIN_NOGP_CFG(QSPI1_SSL, "QSPI1_SSL", fn, CFG_FLAGS), \ 69 + PIN_NOGP_CFG(RPC_INT_N, "RPC_INT#", fn, CFG_FLAGS), \ 70 + PIN_NOGP_CFG(RPC_RESET_N, "RPC_RESET#", fn, CFG_FLAGS), \ 71 + PIN_NOGP_CFG(RPC_WP_N, "RPC_WP#", fn, CFG_FLAGS), \ 72 + PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 73 + PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 74 + PIN_NOGP_CFG(TDO, "TDO", fn, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 75 + PIN_NOGP_CFG(TMS, "TMS", fn, CFG_FLAGS), \ 76 + PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN) 77 + 29 78 /* 30 79 * F_() : just information 31 80 * FM() : macro for FN_xxx / xxx_MARK ··· 1492 1447 }; 1493 1448 1494 1449 /* 1495 - * R8A7795 has 8 banks with 32 GPIOs in each => 256 GPIOs. 1496 - * Physical layout rows: A - AW, cols: 1 - 39. 1450 + * Pins not associated with a GPIO port. 1497 1451 */ 1498 - #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1499 - #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1500 - #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1501 - #define PIN_NONE U16_MAX 1452 + enum { 1453 + GP_ASSIGN_LAST(), 1454 + NOGP_ALL(), 1455 + }; 1502 1456 1503 1457 static const struct sh_pfc_pin pinmux_pins[] = { 1504 1458 PINMUX_GPIO_GP_ALL(), 1505 - 1506 - /* 1507 - * Pins not associated with a GPIO port. 1508 - * 1509 - * The pin positions are different between different r8a7795 1510 - * packages, all that is needed for the pfc driver is a unique 1511 - * number for each pin. To this end use the pin layout from 1512 - * R-Car H3SiP to calculate a unique number for each pin. 1513 - */ 1514 - SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, CFG_FLAGS), 1515 - SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, CFG_FLAGS), 1516 - SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, CFG_FLAGS), 1517 - SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, CFG_FLAGS), 1518 - SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, CFG_FLAGS), 1519 - SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, CFG_FLAGS), 1520 - SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, CFG_FLAGS), 1521 - SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, CFG_FLAGS), 1522 - SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, CFG_FLAGS), 1523 - SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, CFG_FLAGS), 1524 - SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, CFG_FLAGS), 1525 - SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, CFG_FLAGS), 1526 - SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, CFG_FLAGS), 1527 - SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, CFG_FLAGS), 1528 - SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, CFG_FLAGS), 1529 - SH_PFC_PIN_NAMED_CFG('F', 1, CLKOUT, CFG_FLAGS), 1530 - SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, CFG_FLAGS), 1531 - SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, CFG_FLAGS), 1532 - SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, CFG_FLAGS), 1533 - SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, CFG_FLAGS), 1534 - SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, CFG_FLAGS), 1535 - SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, CFG_FLAGS), 1536 - SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, CFG_FLAGS), 1537 - SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, CFG_FLAGS), 1538 - SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, CFG_FLAGS), 1539 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, CFG_FLAGS), 1540 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, CFG_FLAGS), 1541 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, CFG_FLAGS), 1542 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, CFG_FLAGS), 1543 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, CFG_FLAGS), 1544 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST#, CFG_FLAGS), 1545 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 39, EXTALR, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1546 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, CFG_FLAGS), 1547 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, CFG_FLAGS), 1548 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, CFG_FLAGS), 1549 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, CFG_FLAGS), 1550 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 7, DU_DOTCLKIN2, CFG_FLAGS), 1551 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN3, CFG_FLAGS), 1552 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 26, TRST#, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1553 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 29, TDI, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1554 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, CFG_FLAGS), 1555 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1556 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1557 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS), 1459 + PINMUX_NOGP_ALL(), 1558 1460 }; 1559 1461 1560 1462 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 1650 1658 }; 1651 1659 static const unsigned int avb_mdio_pins[] = { 1652 1660 /* AVB_MDC, AVB_MDIO */ 1653 - RCAR_GP_PIN(2, 9), PIN_NUMBER('A', 9), 1661 + RCAR_GP_PIN(2, 9), PIN_AVB_MDIO, 1654 1662 }; 1655 1663 static const unsigned int avb_mdio_mux[] = { 1656 1664 AVB_MDC_MARK, AVB_MDIO_MARK, ··· 1663 1671 * AVB_RD1, AVB_RD2, AVB_RD3, 1664 1672 * AVB_TXCREFCLK 1665 1673 */ 1666 - PIN_NUMBER('A', 8), PIN_NUMBER('A', 19), PIN_NUMBER('A', 18), 1667 - PIN_NUMBER('B', 18), PIN_NUMBER('A', 17), PIN_NUMBER('B', 17), 1668 - PIN_NUMBER('A', 16), PIN_NUMBER('B', 19), PIN_NUMBER('A', 13), 1669 - PIN_NUMBER('B', 13), PIN_NUMBER('A', 14), PIN_NUMBER('B', 14), 1670 - PIN_NUMBER('A', 12), 1674 + PIN_AVB_TX_CTL, PIN_AVB_TXC, PIN_AVB_TD0, 1675 + PIN_AVB_TD1, PIN_AVB_TD2, PIN_AVB_TD3, 1676 + PIN_AVB_RX_CTL, PIN_AVB_RXC, PIN_AVB_RD0, 1677 + PIN_AVB_RD1, PIN_AVB_RD2, PIN_AVB_RD3, 1678 + PIN_AVB_TXCREFCLK, 1671 1679 1672 1680 }; 1673 1681 static const unsigned int avb_mii_mux[] = { ··· 3129 3137 /* - QSPI0 ------------------------------------------------------------------ */ 3130 3138 static const unsigned int qspi0_ctrl_pins[] = { 3131 3139 /* QSPI0_SPCLK, QSPI0_SSL */ 3132 - PIN_NUMBER('W', 3), PIN_NUMBER('Y', 3), 3140 + PIN_QSPI0_SPCLK, PIN_QSPI0_SSL, 3133 3141 }; 3134 3142 static const unsigned int qspi0_ctrl_mux[] = { 3135 3143 QSPI0_SPCLK_MARK, QSPI0_SSL_MARK, 3136 3144 }; 3137 3145 static const unsigned int qspi0_data2_pins[] = { 3138 3146 /* QSPI0_MOSI_IO0, QSPI0_MISO_IO1 */ 3139 - PIN_A_NUMBER('C', 5), PIN_A_NUMBER('B', 4), 3147 + PIN_QSPI0_MOSI_IO0, PIN_QSPI0_MISO_IO1, 3140 3148 }; 3141 3149 static const unsigned int qspi0_data2_mux[] = { 3142 3150 QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK, 3143 3151 }; 3144 3152 static const unsigned int qspi0_data4_pins[] = { 3145 3153 /* QSPI0_MOSI_IO0, QSPI0_MISO_IO1, QSPI0_IO2, QSPI0_IO3 */ 3146 - PIN_A_NUMBER('C', 5), PIN_A_NUMBER('B', 4), 3147 - PIN_NUMBER('Y', 6), PIN_A_NUMBER('B', 6), 3154 + PIN_QSPI0_MOSI_IO0, PIN_QSPI0_MISO_IO1, PIN_QSPI0_IO2, PIN_QSPI0_IO3, 3148 3155 }; 3149 3156 static const unsigned int qspi0_data4_mux[] = { 3150 3157 QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK, ··· 3152 3161 /* - QSPI1 ------------------------------------------------------------------ */ 3153 3162 static const unsigned int qspi1_ctrl_pins[] = { 3154 3163 /* QSPI1_SPCLK, QSPI1_SSL */ 3155 - PIN_NUMBER('V', 3), PIN_NUMBER('V', 5), 3164 + PIN_QSPI1_SPCLK, PIN_QSPI1_SSL, 3156 3165 }; 3157 3166 static const unsigned int qspi1_ctrl_mux[] = { 3158 3167 QSPI1_SPCLK_MARK, QSPI1_SSL_MARK, 3159 3168 }; 3160 3169 static const unsigned int qspi1_data2_pins[] = { 3161 3170 /* QSPI1_MOSI_IO0, QSPI1_MISO_IO1 */ 3162 - PIN_A_NUMBER('C', 7), PIN_A_NUMBER('E', 5), 3171 + PIN_QSPI1_MOSI_IO0, PIN_QSPI1_MISO_IO1, 3163 3172 }; 3164 3173 static const unsigned int qspi1_data2_mux[] = { 3165 3174 QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK, 3166 3175 }; 3167 3176 static const unsigned int qspi1_data4_pins[] = { 3168 3177 /* QSPI1_MOSI_IO0, QSPI1_MISO_IO1, QSPI1_IO2, QSPI1_IO3 */ 3169 - PIN_A_NUMBER('C', 7), PIN_A_NUMBER('E', 5), 3170 - PIN_A_NUMBER('E', 4), PIN_A_NUMBER('C', 3), 3178 + PIN_QSPI1_MOSI_IO0, PIN_QSPI1_MISO_IO1, PIN_QSPI1_IO2, PIN_QSPI1_IO3, 3171 3179 }; 3172 3180 static const unsigned int qspi1_data4_mux[] = { 3173 3181 QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK, ··· 3802 3812 TCLK2_B_MARK, 3803 3813 }; 3804 3814 3815 + /* - TPU ------------------------------------------------------------------- */ 3816 + static const unsigned int tpu_to0_pins[] = { 3817 + /* TPU0TO0 */ 3818 + RCAR_GP_PIN(6, 28), 3819 + }; 3820 + static const unsigned int tpu_to0_mux[] = { 3821 + TPU0TO0_MARK, 3822 + }; 3823 + static const unsigned int tpu_to1_pins[] = { 3824 + /* TPU0TO1 */ 3825 + RCAR_GP_PIN(6, 29), 3826 + }; 3827 + static const unsigned int tpu_to1_mux[] = { 3828 + TPU0TO1_MARK, 3829 + }; 3830 + static const unsigned int tpu_to2_pins[] = { 3831 + /* TPU0TO2 */ 3832 + RCAR_GP_PIN(6, 30), 3833 + }; 3834 + static const unsigned int tpu_to2_mux[] = { 3835 + TPU0TO2_MARK, 3836 + }; 3837 + static const unsigned int tpu_to3_pins[] = { 3838 + /* TPU0TO3 */ 3839 + RCAR_GP_PIN(6, 31), 3840 + }; 3841 + static const unsigned int tpu_to3_mux[] = { 3842 + TPU0TO3_MARK, 3843 + }; 3844 + 3805 3845 /* - USB0 ------------------------------------------------------------------- */ 3806 3846 static const unsigned int usb0_pins[] = { 3807 3847 /* PWEN, OVC */ ··· 4185 4165 SH_PFC_PIN_GROUP(tmu_tclk1_b), 4186 4166 SH_PFC_PIN_GROUP(tmu_tclk2_a), 4187 4167 SH_PFC_PIN_GROUP(tmu_tclk2_b), 4168 + SH_PFC_PIN_GROUP(tpu_to0), 4169 + SH_PFC_PIN_GROUP(tpu_to1), 4170 + SH_PFC_PIN_GROUP(tpu_to2), 4171 + SH_PFC_PIN_GROUP(tpu_to3), 4188 4172 SH_PFC_PIN_GROUP(usb0), 4189 4173 SH_PFC_PIN_GROUP(usb1), 4190 4174 SH_PFC_PIN_GROUP(usb2), ··· 4659 4635 "tmu_tclk2_b", 4660 4636 }; 4661 4637 4638 + static const char * const tpu_groups[] = { 4639 + "tpu_to0", 4640 + "tpu_to1", 4641 + "tpu_to2", 4642 + "tpu_to3", 4643 + }; 4644 + 4662 4645 static const char * const usb0_groups[] = { 4663 4646 "usb0", 4664 4647 }; ··· 4738 4707 SH_PFC_FUNCTION(sdhi3), 4739 4708 SH_PFC_FUNCTION(ssi), 4740 4709 SH_PFC_FUNCTION(tmu), 4710 + SH_PFC_FUNCTION(tpu), 4741 4711 SH_PFC_FUNCTION(usb0), 4742 4712 SH_PFC_FUNCTION(usb1), 4743 4713 SH_PFC_FUNCTION(usb2), ··· 5304 5272 5305 5273 static const struct pinmux_drive_reg pinmux_drive_regs[] = { 5306 5274 { PINMUX_DRIVE_REG("DRVCTRL0", 0xe6060300) { 5307 - { PIN_NUMBER('W', 3), 28, 2 }, /* QSPI0_SPCLK */ 5308 - { PIN_A_NUMBER('C', 5), 24, 2 }, /* QSPI0_MOSI_IO0 */ 5309 - { PIN_A_NUMBER('B', 4), 20, 2 }, /* QSPI0_MISO_IO1 */ 5310 - { PIN_NUMBER('Y', 6), 16, 2 }, /* QSPI0_IO2 */ 5311 - { PIN_A_NUMBER('B', 6), 12, 2 }, /* QSPI0_IO3 */ 5312 - { PIN_NUMBER('Y', 3), 8, 2 }, /* QSPI0_SSL */ 5313 - { PIN_NUMBER('V', 3), 4, 2 }, /* QSPI1_SPCLK */ 5314 - { PIN_A_NUMBER('C', 7), 0, 2 }, /* QSPI1_MOSI_IO0 */ 5275 + { PIN_QSPI0_SPCLK, 28, 2 }, /* QSPI0_SPCLK */ 5276 + { PIN_QSPI0_MOSI_IO0, 24, 2 }, /* QSPI0_MOSI_IO0 */ 5277 + { PIN_QSPI0_MISO_IO1, 20, 2 }, /* QSPI0_MISO_IO1 */ 5278 + { PIN_QSPI0_IO2, 16, 2 }, /* QSPI0_IO2 */ 5279 + { PIN_QSPI0_IO3, 12, 2 }, /* QSPI0_IO3 */ 5280 + { PIN_QSPI0_SSL, 8, 2 }, /* QSPI0_SSL */ 5281 + { PIN_QSPI1_SPCLK, 4, 2 }, /* QSPI1_SPCLK */ 5282 + { PIN_QSPI1_MOSI_IO0, 0, 2 }, /* QSPI1_MOSI_IO0 */ 5315 5283 } }, 5316 5284 { PINMUX_DRIVE_REG("DRVCTRL1", 0xe6060304) { 5317 - { PIN_A_NUMBER('E', 5), 28, 2 }, /* QSPI1_MISO_IO1 */ 5318 - { PIN_A_NUMBER('E', 4), 24, 2 }, /* QSPI1_IO2 */ 5319 - { PIN_A_NUMBER('C', 3), 20, 2 }, /* QSPI1_IO3 */ 5320 - { PIN_NUMBER('V', 5), 16, 2 }, /* QSPI1_SSL */ 5321 - { PIN_NUMBER('Y', 7), 12, 2 }, /* RPC_INT# */ 5322 - { PIN_NUMBER('V', 6), 8, 2 }, /* RPC_WP# */ 5323 - { PIN_NUMBER('V', 7), 4, 2 }, /* RPC_RESET# */ 5324 - { PIN_NUMBER('A', 16), 0, 3 }, /* AVB_RX_CTL */ 5285 + { PIN_QSPI1_MISO_IO1, 28, 2 }, /* QSPI1_MISO_IO1 */ 5286 + { PIN_QSPI1_IO2, 24, 2 }, /* QSPI1_IO2 */ 5287 + { PIN_QSPI1_IO3, 20, 2 }, /* QSPI1_IO3 */ 5288 + { PIN_QSPI1_SSL, 16, 2 }, /* QSPI1_SSL */ 5289 + { PIN_RPC_INT_N, 12, 2 }, /* RPC_INT# */ 5290 + { PIN_RPC_WP_N, 8, 2 }, /* RPC_WP# */ 5291 + { PIN_RPC_RESET_N, 4, 2 }, /* RPC_RESET# */ 5292 + { PIN_AVB_RX_CTL, 0, 3 }, /* AVB_RX_CTL */ 5325 5293 } }, 5326 5294 { PINMUX_DRIVE_REG("DRVCTRL2", 0xe6060308) { 5327 - { PIN_NUMBER('B', 19), 28, 3 }, /* AVB_RXC */ 5328 - { PIN_NUMBER('A', 13), 24, 3 }, /* AVB_RD0 */ 5329 - { PIN_NUMBER('B', 13), 20, 3 }, /* AVB_RD1 */ 5330 - { PIN_NUMBER('A', 14), 16, 3 }, /* AVB_RD2 */ 5331 - { PIN_NUMBER('B', 14), 12, 3 }, /* AVB_RD3 */ 5332 - { PIN_NUMBER('A', 8), 8, 3 }, /* AVB_TX_CTL */ 5333 - { PIN_NUMBER('A', 19), 4, 3 }, /* AVB_TXC */ 5334 - { PIN_NUMBER('A', 18), 0, 3 }, /* AVB_TD0 */ 5295 + { PIN_AVB_RXC, 28, 3 }, /* AVB_RXC */ 5296 + { PIN_AVB_RD0, 24, 3 }, /* AVB_RD0 */ 5297 + { PIN_AVB_RD1, 20, 3 }, /* AVB_RD1 */ 5298 + { PIN_AVB_RD2, 16, 3 }, /* AVB_RD2 */ 5299 + { PIN_AVB_RD3, 12, 3 }, /* AVB_RD3 */ 5300 + { PIN_AVB_TX_CTL, 8, 3 }, /* AVB_TX_CTL */ 5301 + { PIN_AVB_TXC, 4, 3 }, /* AVB_TXC */ 5302 + { PIN_AVB_TD0, 0, 3 }, /* AVB_TD0 */ 5335 5303 } }, 5336 5304 { PINMUX_DRIVE_REG("DRVCTRL3", 0xe606030c) { 5337 - { PIN_NUMBER('B', 18), 28, 3 }, /* AVB_TD1 */ 5338 - { PIN_NUMBER('A', 17), 24, 3 }, /* AVB_TD2 */ 5339 - { PIN_NUMBER('B', 17), 20, 3 }, /* AVB_TD3 */ 5340 - { PIN_NUMBER('A', 12), 16, 3 }, /* AVB_TXCREFCLK */ 5341 - { PIN_NUMBER('A', 9), 12, 3 }, /* AVB_MDIO */ 5342 - { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5343 - { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5344 - { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5305 + { PIN_AVB_TD1, 28, 3 }, /* AVB_TD1 */ 5306 + { PIN_AVB_TD2, 24, 3 }, /* AVB_TD2 */ 5307 + { PIN_AVB_TD3, 20, 3 }, /* AVB_TD3 */ 5308 + { PIN_AVB_TXCREFCLK, 16, 3 }, /* AVB_TXCREFCLK */ 5309 + { PIN_AVB_MDIO, 12, 3 }, /* AVB_MDIO */ 5310 + { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5311 + { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5312 + { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5345 5313 } }, 5346 5314 { PINMUX_DRIVE_REG("DRVCTRL4", 0xe6060310) { 5347 5315 { RCAR_GP_PIN(2, 12), 28, 3 }, /* AVB_LINK */ ··· 5384 5352 { RCAR_GP_PIN(1, 19), 0, 3 }, /* A19 */ 5385 5353 } }, 5386 5354 { PINMUX_DRIVE_REG("DRVCTRL8", 0xe6060320) { 5387 - { PIN_NUMBER('F', 1), 28, 3 }, /* CLKOUT */ 5355 + { PIN_CLKOUT, 28, 3 }, /* CLKOUT */ 5388 5356 { RCAR_GP_PIN(1, 20), 24, 3 }, /* CS0 */ 5389 5357 { RCAR_GP_PIN(1, 21), 20, 3 }, /* CS1_A26 */ 5390 5358 { RCAR_GP_PIN(1, 22), 16, 3 }, /* BS */ ··· 5395 5363 } }, 5396 5364 { PINMUX_DRIVE_REG("DRVCTRL9", 0xe6060324) { 5397 5365 { RCAR_GP_PIN(1, 27), 28, 3 }, /* EX_WAIT0 */ 5398 - { PIN_NUMBER('C', 1), 24, 3 }, /* PRESETOUT# */ 5366 + { PIN_PRESETOUT_N, 24, 3 }, /* PRESETOUT# */ 5399 5367 { RCAR_GP_PIN(0, 0), 20, 3 }, /* D0 */ 5400 5368 { RCAR_GP_PIN(0, 1), 16, 3 }, /* D1 */ 5401 5369 { RCAR_GP_PIN(0, 2), 12, 3 }, /* D2 */ ··· 5414 5382 { RCAR_GP_PIN(0, 13), 0, 3 }, /* D13 */ 5415 5383 } }, 5416 5384 { PINMUX_DRIVE_REG("DRVCTRL11", 0xe606032c) { 5417 - { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5418 - { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5419 - { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5420 - { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5421 - { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5422 - { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5423 - { PIN_A_NUMBER('P', 7), 4, 2 }, /* DU_DOTCLKIN0 */ 5424 - { PIN_A_NUMBER('P', 8), 0, 2 }, /* DU_DOTCLKIN1 */ 5385 + { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5386 + { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5387 + { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5388 + { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5389 + { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5390 + { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5391 + { PIN_DU_DOTCLKIN0, 4, 2 }, /* DU_DOTCLKIN0 */ 5392 + { PIN_DU_DOTCLKIN1, 0, 2 }, /* DU_DOTCLKIN1 */ 5425 5393 } }, 5426 5394 { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) { 5427 - { PIN_A_NUMBER('R', 7), 28, 2 }, /* DU_DOTCLKIN2 */ 5428 - { PIN_A_NUMBER('R', 8), 24, 2 }, /* DU_DOTCLKIN3 */ 5429 - { PIN_A_NUMBER('D', 38), 20, 2 }, /* FSCLKST# */ 5430 - { PIN_A_NUMBER('R', 30), 4, 2 }, /* TMS */ 5395 + { PIN_DU_DOTCLKIN2, 28, 2 }, /* DU_DOTCLKIN2 */ 5396 + { PIN_DU_DOTCLKIN3, 24, 2 }, /* DU_DOTCLKIN3 */ 5397 + { PIN_FSCLKST_N, 20, 2 }, /* FSCLKST# */ 5398 + { PIN_TMS, 4, 2 }, /* TMS */ 5431 5399 } }, 5432 5400 { PINMUX_DRIVE_REG("DRVCTRL13", 0xe6060334) { 5433 - { PIN_A_NUMBER('T', 28), 28, 2 }, /* TDO */ 5434 - { PIN_A_NUMBER('T', 30), 24, 2 }, /* ASEBRK */ 5435 - { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5436 - { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5437 - { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5438 - { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5439 - { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5440 - { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5401 + { PIN_TDO, 28, 2 }, /* TDO */ 5402 + { PIN_ASEBRK, 24, 2 }, /* ASEBRK */ 5403 + { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5404 + { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5405 + { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5406 + { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5407 + { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5408 + { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5441 5409 } }, 5442 5410 { PINMUX_DRIVE_REG("DRVCTRL14", 0xe6060338) { 5443 5411 { RCAR_GP_PIN(3, 6), 28, 3 }, /* SD1_CLK */ ··· 5506 5474 { RCAR_GP_PIN(5, 23), 16, 3 }, /* MLB_CLK */ 5507 5475 { RCAR_GP_PIN(5, 24), 12, 3 }, /* MLB_SIG */ 5508 5476 { RCAR_GP_PIN(5, 25), 8, 3 }, /* MLB_DAT */ 5509 - { PIN_NUMBER('H', 37), 4, 3 }, /* MLB_REF */ 5477 + { PIN_MLB_REF, 4, 3 }, /* MLB_REF */ 5510 5478 { RCAR_GP_PIN(6, 0), 0, 3 }, /* SSI_SCK01239 */ 5511 5479 } }, 5512 5480 { PINMUX_DRIVE_REG("DRVCTRL21", 0xe6060354) { ··· 5580 5548 5581 5549 static const struct pinmux_bias_reg pinmux_bias_regs[] = { 5582 5550 { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 5583 - [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 5584 - [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 5585 - [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 5586 - [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 5587 - [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 5588 - [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 5589 - [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 5590 - [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 5591 - [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 5592 - [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 5593 - [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 5594 - [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 5595 - [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 5596 - [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 5597 - [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 5598 - [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 5599 - [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 5600 - [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 5601 - [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 5602 - [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 5603 - [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 5604 - [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 5605 - [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 5606 - [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 5607 - [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 5608 - [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 5609 - [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 5610 - [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 5611 - [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 5551 + [ 0] = PIN_QSPI0_SPCLK, /* QSPI0_SPCLK */ 5552 + [ 1] = PIN_QSPI0_MOSI_IO0, /* QSPI0_MOSI_IO0 */ 5553 + [ 2] = PIN_QSPI0_MISO_IO1, /* QSPI0_MISO_IO1 */ 5554 + [ 3] = PIN_QSPI0_IO2, /* QSPI0_IO2 */ 5555 + [ 4] = PIN_QSPI0_IO3, /* QSPI0_IO3 */ 5556 + [ 5] = PIN_QSPI0_SSL, /* QSPI0_SSL */ 5557 + [ 6] = PIN_QSPI1_SPCLK, /* QSPI1_SPCLK */ 5558 + [ 7] = PIN_QSPI1_MOSI_IO0, /* QSPI1_MOSI_IO0 */ 5559 + [ 8] = PIN_QSPI1_MISO_IO1, /* QSPI1_MISO_IO1 */ 5560 + [ 9] = PIN_QSPI1_IO2, /* QSPI1_IO2 */ 5561 + [10] = PIN_QSPI1_IO3, /* QSPI1_IO3 */ 5562 + [11] = PIN_QSPI1_SSL, /* QSPI1_SSL */ 5563 + [12] = PIN_RPC_INT_N, /* RPC_INT# */ 5564 + [13] = PIN_RPC_WP_N, /* RPC_WP# */ 5565 + [14] = PIN_RPC_RESET_N, /* RPC_RESET# */ 5566 + [15] = PIN_AVB_RX_CTL, /* AVB_RX_CTL */ 5567 + [16] = PIN_AVB_RXC, /* AVB_RXC */ 5568 + [17] = PIN_AVB_RD0, /* AVB_RD0 */ 5569 + [18] = PIN_AVB_RD1, /* AVB_RD1 */ 5570 + [19] = PIN_AVB_RD2, /* AVB_RD2 */ 5571 + [20] = PIN_AVB_RD3, /* AVB_RD3 */ 5572 + [21] = PIN_AVB_TX_CTL, /* AVB_TX_CTL */ 5573 + [22] = PIN_AVB_TXC, /* AVB_TXC */ 5574 + [23] = PIN_AVB_TD0, /* AVB_TD0 */ 5575 + [24] = PIN_AVB_TD1, /* AVB_TD1 */ 5576 + [25] = PIN_AVB_TD2, /* AVB_TD2 */ 5577 + [26] = PIN_AVB_TD3, /* AVB_TD3 */ 5578 + [27] = PIN_AVB_TXCREFCLK, /* AVB_TXCREFCLK */ 5579 + [28] = PIN_AVB_MDIO, /* AVB_MDIO */ 5612 5580 [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 5613 5581 [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 5614 5582 [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ ··· 5648 5616 [31] = RCAR_GP_PIN(1, 19), /* A19 */ 5649 5617 } }, 5650 5618 { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) { 5651 - [ 0] = PIN_NUMBER('F', 1), /* CLKOUT */ 5619 + [ 0] = PIN_CLKOUT, /* CLKOUT */ 5652 5620 [ 1] = RCAR_GP_PIN(1, 20), /* CS0_N */ 5653 5621 [ 2] = RCAR_GP_PIN(1, 21), /* CS1_N_A26 */ 5654 5622 [ 3] = RCAR_GP_PIN(1, 22), /* BS_N */ ··· 5657 5625 [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 5658 5626 [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 5659 5627 [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 5660 - [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 5628 + [ 9] = PIN_PRESETOUT_N, /* PRESETOUT# */ 5661 5629 [10] = RCAR_GP_PIN(0, 0), /* D0 */ 5662 5630 [11] = RCAR_GP_PIN(0, 1), /* D1 */ 5663 5631 [12] = RCAR_GP_PIN(0, 2), /* D2 */ ··· 5678 5646 [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 5679 5647 [28] = RCAR_GP_PIN(7, 2), /* GP7_02 */ 5680 5648 [29] = RCAR_GP_PIN(7, 3), /* GP7_03 */ 5681 - [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 5682 - [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 5649 + [30] = PIN_DU_DOTCLKIN0, /* DU_DOTCLKIN0 */ 5650 + [31] = PIN_DU_DOTCLKIN1, /* DU_DOTCLKIN1 */ 5683 5651 } }, 5684 5652 { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 5685 - [ 0] = PIN_A_NUMBER('R', 7), /* DU_DOTCLKIN2 */ 5686 - [ 1] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN3 */ 5687 - [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST# */ 5688 - [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 5689 - [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 5690 - [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 5691 - [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 5692 - [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 5693 - [ 8] = PIN_NONE, 5694 - [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 5653 + [ 0] = PIN_DU_DOTCLKIN2, /* DU_DOTCLKIN2 */ 5654 + [ 1] = PIN_DU_DOTCLKIN3, /* DU_DOTCLKIN3 */ 5655 + [ 2] = PIN_FSCLKST_N, /* FSCLKST# */ 5656 + [ 3] = PIN_EXTALR, /* EXTALR*/ 5657 + [ 4] = PIN_TRST_N, /* TRST# */ 5658 + [ 5] = PIN_TCK, /* TCK */ 5659 + [ 6] = PIN_TMS, /* TMS */ 5660 + [ 7] = PIN_TDI, /* TDI */ 5661 + [ 8] = SH_PFC_PIN_NONE, 5662 + [ 9] = PIN_ASEBRK, /* ASEBRK */ 5695 5663 [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 5696 5664 [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 5697 5665 [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ ··· 5756 5724 [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 5757 5725 [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 5758 5726 [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 5759 - [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 5727 + [ 6] = PIN_MLB_REF, /* MLB_REF */ 5760 5728 [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 5761 5729 [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 5762 5730 [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ ··· 5791 5759 [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 5792 5760 [ 5] = RCAR_GP_PIN(6, 30), /* USB31_PWEN */ 5793 5761 [ 6] = RCAR_GP_PIN(6, 31), /* USB31_OVC */ 5794 - [ 7] = PIN_NONE, 5795 - [ 8] = PIN_NONE, 5796 - [ 9] = PIN_NONE, 5797 - [10] = PIN_NONE, 5798 - [11] = PIN_NONE, 5799 - [12] = PIN_NONE, 5800 - [13] = PIN_NONE, 5801 - [14] = PIN_NONE, 5802 - [15] = PIN_NONE, 5803 - [16] = PIN_NONE, 5804 - [17] = PIN_NONE, 5805 - [18] = PIN_NONE, 5806 - [19] = PIN_NONE, 5807 - [20] = PIN_NONE, 5808 - [21] = PIN_NONE, 5809 - [22] = PIN_NONE, 5810 - [23] = PIN_NONE, 5811 - [24] = PIN_NONE, 5812 - [25] = PIN_NONE, 5813 - [26] = PIN_NONE, 5814 - [27] = PIN_NONE, 5815 - [28] = PIN_NONE, 5816 - [29] = PIN_NONE, 5817 - [30] = PIN_NONE, 5818 - [31] = PIN_NONE, 5762 + [ 7] = SH_PFC_PIN_NONE, 5763 + [ 8] = SH_PFC_PIN_NONE, 5764 + [ 9] = SH_PFC_PIN_NONE, 5765 + [10] = SH_PFC_PIN_NONE, 5766 + [11] = SH_PFC_PIN_NONE, 5767 + [12] = SH_PFC_PIN_NONE, 5768 + [13] = SH_PFC_PIN_NONE, 5769 + [14] = SH_PFC_PIN_NONE, 5770 + [15] = SH_PFC_PIN_NONE, 5771 + [16] = SH_PFC_PIN_NONE, 5772 + [17] = SH_PFC_PIN_NONE, 5773 + [18] = SH_PFC_PIN_NONE, 5774 + [19] = SH_PFC_PIN_NONE, 5775 + [20] = SH_PFC_PIN_NONE, 5776 + [21] = SH_PFC_PIN_NONE, 5777 + [22] = SH_PFC_PIN_NONE, 5778 + [23] = SH_PFC_PIN_NONE, 5779 + [24] = SH_PFC_PIN_NONE, 5780 + [25] = SH_PFC_PIN_NONE, 5781 + [26] = SH_PFC_PIN_NONE, 5782 + [27] = SH_PFC_PIN_NONE, 5783 + [28] = SH_PFC_PIN_NONE, 5784 + [29] = SH_PFC_PIN_NONE, 5785 + [30] = SH_PFC_PIN_NONE, 5786 + [31] = SH_PFC_PIN_NONE, 5819 5787 } }, 5820 5788 { /* sentinel */ }, 5821 5789 };
+224 -190
drivers/pinctrl/sh-pfc/pfc-r8a7795.c
··· 12 12 #include "core.h" 13 13 #include "sh_pfc.h" 14 14 15 - #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | \ 16 - SH_PFC_PIN_CFG_PULL_UP | \ 17 - SH_PFC_PIN_CFG_PULL_DOWN) 15 + #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) 18 16 19 - #define CPU_ALL_PORT(fn, sfx) \ 17 + #define CPU_ALL_GP(fn, sfx) \ 20 18 PORT_GP_CFG_16(0, fn, sfx, CFG_FLAGS), \ 21 19 PORT_GP_CFG_29(1, fn, sfx, CFG_FLAGS), \ 22 20 PORT_GP_CFG_15(2, fn, sfx, CFG_FLAGS), \ ··· 27 29 PORT_GP_CFG_26(5, fn, sfx, CFG_FLAGS), \ 28 30 PORT_GP_CFG_32(6, fn, sfx, CFG_FLAGS), \ 29 31 PORT_GP_CFG_4(7, fn, sfx, CFG_FLAGS) 32 + 33 + #define CPU_ALL_NOGP(fn) \ 34 + PIN_NOGP_CFG(ASEBRK, "ASEBRK", fn, CFG_FLAGS), \ 35 + PIN_NOGP_CFG(AVB_MDIO, "AVB_MDIO", fn, CFG_FLAGS), \ 36 + PIN_NOGP_CFG(AVB_RD0, "AVB_RD0", fn, CFG_FLAGS), \ 37 + PIN_NOGP_CFG(AVB_RD1, "AVB_RD1", fn, CFG_FLAGS), \ 38 + PIN_NOGP_CFG(AVB_RD2, "AVB_RD2", fn, CFG_FLAGS), \ 39 + PIN_NOGP_CFG(AVB_RD3, "AVB_RD3", fn, CFG_FLAGS), \ 40 + PIN_NOGP_CFG(AVB_RXC, "AVB_RXC", fn, CFG_FLAGS), \ 41 + PIN_NOGP_CFG(AVB_RX_CTL, "AVB_RX_CTL", fn, CFG_FLAGS), \ 42 + PIN_NOGP_CFG(AVB_TD0, "AVB_TD0", fn, CFG_FLAGS), \ 43 + PIN_NOGP_CFG(AVB_TD1, "AVB_TD1", fn, CFG_FLAGS), \ 44 + PIN_NOGP_CFG(AVB_TD2, "AVB_TD2", fn, CFG_FLAGS), \ 45 + PIN_NOGP_CFG(AVB_TD3, "AVB_TD3", fn, CFG_FLAGS), \ 46 + PIN_NOGP_CFG(AVB_TXC, "AVB_TXC", fn, CFG_FLAGS), \ 47 + PIN_NOGP_CFG(AVB_TXCREFCLK, "AVB_TXCREFCLK", fn, CFG_FLAGS), \ 48 + PIN_NOGP_CFG(AVB_TX_CTL, "AVB_TX_CTL", fn, CFG_FLAGS), \ 49 + PIN_NOGP_CFG(DU_DOTCLKIN0, "DU_DOTCLKIN0", fn, CFG_FLAGS), \ 50 + PIN_NOGP_CFG(DU_DOTCLKIN1, "DU_DOTCLKIN1", fn, CFG_FLAGS), \ 51 + PIN_NOGP_CFG(DU_DOTCLKIN2, "DU_DOTCLKIN2", fn, CFG_FLAGS), \ 52 + PIN_NOGP_CFG(DU_DOTCLKIN3, "DU_DOTCLKIN3", fn, CFG_FLAGS), \ 53 + PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN),\ 54 + PIN_NOGP_CFG(FSCLKST_N, "FSCLKST#", fn, CFG_FLAGS), \ 55 + PIN_NOGP_CFG(MLB_REF, "MLB_REF", fn, CFG_FLAGS), \ 56 + PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, CFG_FLAGS), \ 57 + PIN_NOGP_CFG(QSPI0_IO2, "QSPI0_IO2", fn, CFG_FLAGS), \ 58 + PIN_NOGP_CFG(QSPI0_IO3, "QSPI0_IO3", fn, CFG_FLAGS), \ 59 + PIN_NOGP_CFG(QSPI0_MISO_IO1, "QSPI0_MISO_IO1", fn, CFG_FLAGS), \ 60 + PIN_NOGP_CFG(QSPI0_MOSI_IO0, "QSPI0_MOSI_IO0", fn, CFG_FLAGS), \ 61 + PIN_NOGP_CFG(QSPI0_SPCLK, "QSPI0_SPCLK", fn, CFG_FLAGS), \ 62 + PIN_NOGP_CFG(QSPI0_SSL, "QSPI0_SSL", fn, CFG_FLAGS), \ 63 + PIN_NOGP_CFG(QSPI1_IO2, "QSPI1_IO2", fn, CFG_FLAGS), \ 64 + PIN_NOGP_CFG(QSPI1_IO3, "QSPI1_IO3", fn, CFG_FLAGS), \ 65 + PIN_NOGP_CFG(QSPI1_MISO_IO1, "QSPI1_MISO_IO1", fn, CFG_FLAGS), \ 66 + PIN_NOGP_CFG(QSPI1_MOSI_IO0, "QSPI1_MOSI_IO0", fn, CFG_FLAGS), \ 67 + PIN_NOGP_CFG(QSPI1_SPCLK, "QSPI1_SPCLK", fn, CFG_FLAGS), \ 68 + PIN_NOGP_CFG(QSPI1_SSL, "QSPI1_SSL", fn, CFG_FLAGS), \ 69 + PIN_NOGP_CFG(RPC_INT_N, "RPC_INT#", fn, CFG_FLAGS), \ 70 + PIN_NOGP_CFG(RPC_RESET_N, "RPC_RESET#", fn, CFG_FLAGS), \ 71 + PIN_NOGP_CFG(RPC_WP_N, "RPC_WP#", fn, CFG_FLAGS), \ 72 + PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 73 + PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 74 + PIN_NOGP_CFG(TDO, "TDO", fn, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 75 + PIN_NOGP_CFG(TMS, "TMS", fn, CFG_FLAGS), \ 76 + PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN) 77 + 30 78 /* 31 79 * F_() : just information 32 80 * FM() : macro for FN_xxx / xxx_MARK ··· 1552 1508 }; 1553 1509 1554 1510 /* 1555 - * R8A7795 has 8 banks with 32 GPIOs in each => 256 GPIOs. 1556 - * Physical layout rows: A - AW, cols: 1 - 39. 1511 + * Pins not associated with a GPIO port. 1557 1512 */ 1558 - #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1559 - #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1560 - #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1561 - #define PIN_NONE U16_MAX 1513 + enum { 1514 + GP_ASSIGN_LAST(), 1515 + NOGP_ALL(), 1516 + }; 1562 1517 1563 1518 static const struct sh_pfc_pin pinmux_pins[] = { 1564 1519 PINMUX_GPIO_GP_ALL(), 1565 - 1566 - /* 1567 - * Pins not associated with a GPIO port. 1568 - * 1569 - * The pin positions are different between different r8a7795 1570 - * packages, all that is needed for the pfc driver is a unique 1571 - * number for each pin. To this end use the pin layout from 1572 - * R-Car H3SiP to calculate a unique number for each pin. 1573 - */ 1574 - SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, CFG_FLAGS), 1575 - SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, CFG_FLAGS), 1576 - SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, CFG_FLAGS), 1577 - SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, CFG_FLAGS), 1578 - SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, CFG_FLAGS), 1579 - SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, CFG_FLAGS), 1580 - SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, CFG_FLAGS), 1581 - SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, CFG_FLAGS), 1582 - SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, CFG_FLAGS), 1583 - SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, CFG_FLAGS), 1584 - SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, CFG_FLAGS), 1585 - SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, CFG_FLAGS), 1586 - SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, CFG_FLAGS), 1587 - SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, CFG_FLAGS), 1588 - SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, CFG_FLAGS), 1589 - SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, CFG_FLAGS), 1590 - SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, CFG_FLAGS), 1591 - SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, CFG_FLAGS), 1592 - SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, CFG_FLAGS), 1593 - SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, CFG_FLAGS), 1594 - SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, CFG_FLAGS), 1595 - SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, CFG_FLAGS), 1596 - SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, CFG_FLAGS), 1597 - SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, CFG_FLAGS), 1598 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, CFG_FLAGS), 1599 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, CFG_FLAGS), 1600 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, CFG_FLAGS), 1601 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, CFG_FLAGS), 1602 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, CFG_FLAGS), 1603 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST#, CFG_FLAGS), 1604 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 39, EXTALR, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1605 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, CFG_FLAGS), 1606 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, CFG_FLAGS), 1607 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, CFG_FLAGS), 1608 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, CFG_FLAGS), 1609 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 7, DU_DOTCLKIN2, CFG_FLAGS), 1610 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN3, CFG_FLAGS), 1611 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 26, TRST#, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1612 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 29, TDI, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1613 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, CFG_FLAGS), 1614 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1615 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1616 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS), 1520 + PINMUX_NOGP_ALL(), 1617 1521 }; 1618 1522 1619 1523 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 1709 1717 }; 1710 1718 static const unsigned int avb_mdio_pins[] = { 1711 1719 /* AVB_MDC, AVB_MDIO */ 1712 - RCAR_GP_PIN(2, 9), PIN_NUMBER('A', 9), 1720 + RCAR_GP_PIN(2, 9), PIN_AVB_MDIO, 1713 1721 }; 1714 1722 static const unsigned int avb_mdio_mux[] = { 1715 1723 AVB_MDC_MARK, AVB_MDIO_MARK, ··· 1722 1730 * AVB_RD1, AVB_RD2, AVB_RD3, 1723 1731 * AVB_TXCREFCLK 1724 1732 */ 1725 - PIN_NUMBER('A', 8), PIN_NUMBER('A', 19), PIN_NUMBER('A', 18), 1726 - PIN_NUMBER('B', 18), PIN_NUMBER('A', 17), PIN_NUMBER('B', 17), 1727 - PIN_NUMBER('A', 16), PIN_NUMBER('B', 19), PIN_NUMBER('A', 13), 1728 - PIN_NUMBER('B', 13), PIN_NUMBER('A', 14), PIN_NUMBER('B', 14), 1729 - PIN_NUMBER('A', 12), 1733 + PIN_AVB_TX_CTL, PIN_AVB_TXC, PIN_AVB_TD0, 1734 + PIN_AVB_TD1, PIN_AVB_TD2, PIN_AVB_TD3, 1735 + PIN_AVB_RX_CTL, PIN_AVB_RXC, PIN_AVB_RD0, 1736 + PIN_AVB_RD1, PIN_AVB_RD2, PIN_AVB_RD3, 1737 + PIN_AVB_TXCREFCLK, 1730 1738 1731 1739 }; 1732 1740 static const unsigned int avb_mii_mux[] = { ··· 3893 3901 TCLK2_B_MARK, 3894 3902 }; 3895 3903 3904 + /* - TPU ------------------------------------------------------------------- */ 3905 + static const unsigned int tpu_to0_pins[] = { 3906 + /* TPU0TO0 */ 3907 + RCAR_GP_PIN(6, 28), 3908 + }; 3909 + static const unsigned int tpu_to0_mux[] = { 3910 + TPU0TO0_MARK, 3911 + }; 3912 + static const unsigned int tpu_to1_pins[] = { 3913 + /* TPU0TO1 */ 3914 + RCAR_GP_PIN(6, 29), 3915 + }; 3916 + static const unsigned int tpu_to1_mux[] = { 3917 + TPU0TO1_MARK, 3918 + }; 3919 + static const unsigned int tpu_to2_pins[] = { 3920 + /* TPU0TO2 */ 3921 + RCAR_GP_PIN(6, 30), 3922 + }; 3923 + static const unsigned int tpu_to2_mux[] = { 3924 + TPU0TO2_MARK, 3925 + }; 3926 + static const unsigned int tpu_to3_pins[] = { 3927 + /* TPU0TO3 */ 3928 + RCAR_GP_PIN(6, 31), 3929 + }; 3930 + static const unsigned int tpu_to3_mux[] = { 3931 + TPU0TO3_MARK, 3932 + }; 3933 + 3896 3934 /* - USB0 ------------------------------------------------------------------- */ 3897 3935 static const unsigned int usb0_pins[] = { 3898 3936 /* PWEN, OVC */ ··· 4473 4451 SH_PFC_PIN_GROUP(tmu_tclk1_b), 4474 4452 SH_PFC_PIN_GROUP(tmu_tclk2_a), 4475 4453 SH_PFC_PIN_GROUP(tmu_tclk2_b), 4454 + SH_PFC_PIN_GROUP(tpu_to0), 4455 + SH_PFC_PIN_GROUP(tpu_to1), 4456 + SH_PFC_PIN_GROUP(tpu_to2), 4457 + SH_PFC_PIN_GROUP(tpu_to3), 4476 4458 SH_PFC_PIN_GROUP(usb0), 4477 4459 SH_PFC_PIN_GROUP(usb1), 4478 4460 SH_PFC_PIN_GROUP(usb2), ··· 4972 4946 "tmu_tclk2_b", 4973 4947 }; 4974 4948 4949 + static const char * const tpu_groups[] = { 4950 + "tpu_to0", 4951 + "tpu_to1", 4952 + "tpu_to2", 4953 + "tpu_to3", 4954 + }; 4955 + 4975 4956 static const char * const usb0_groups[] = { 4976 4957 "usb0", 4977 4958 }; ··· 5081 5048 SH_PFC_FUNCTION(sdhi3), 5082 5049 SH_PFC_FUNCTION(ssi), 5083 5050 SH_PFC_FUNCTION(tmu), 5051 + SH_PFC_FUNCTION(tpu), 5084 5052 SH_PFC_FUNCTION(usb0), 5085 5053 SH_PFC_FUNCTION(usb1), 5086 5054 SH_PFC_FUNCTION(usb2), ··· 5657 5623 5658 5624 static const struct pinmux_drive_reg pinmux_drive_regs[] = { 5659 5625 { PINMUX_DRIVE_REG("DRVCTRL0", 0xe6060300) { 5660 - { PIN_NUMBER('W', 3), 28, 2 }, /* QSPI0_SPCLK */ 5661 - { PIN_A_NUMBER('C', 5), 24, 2 }, /* QSPI0_MOSI_IO0 */ 5662 - { PIN_A_NUMBER('B', 4), 20, 2 }, /* QSPI0_MISO_IO1 */ 5663 - { PIN_NUMBER('Y', 6), 16, 2 }, /* QSPI0_IO2 */ 5664 - { PIN_A_NUMBER('B', 6), 12, 2 }, /* QSPI0_IO3 */ 5665 - { PIN_NUMBER('Y', 3), 8, 2 }, /* QSPI0_SSL */ 5666 - { PIN_NUMBER('V', 3), 4, 2 }, /* QSPI1_SPCLK */ 5667 - { PIN_A_NUMBER('C', 7), 0, 2 }, /* QSPI1_MOSI_IO0 */ 5626 + { PIN_QSPI0_SPCLK, 28, 2 }, /* QSPI0_SPCLK */ 5627 + { PIN_QSPI0_MOSI_IO0, 24, 2 }, /* QSPI0_MOSI_IO0 */ 5628 + { PIN_QSPI0_MISO_IO1, 20, 2 }, /* QSPI0_MISO_IO1 */ 5629 + { PIN_QSPI0_IO2, 16, 2 }, /* QSPI0_IO2 */ 5630 + { PIN_QSPI0_IO3, 12, 2 }, /* QSPI0_IO3 */ 5631 + { PIN_QSPI0_SSL, 8, 2 }, /* QSPI0_SSL */ 5632 + { PIN_QSPI1_SPCLK, 4, 2 }, /* QSPI1_SPCLK */ 5633 + { PIN_QSPI1_MOSI_IO0, 0, 2 }, /* QSPI1_MOSI_IO0 */ 5668 5634 } }, 5669 5635 { PINMUX_DRIVE_REG("DRVCTRL1", 0xe6060304) { 5670 - { PIN_A_NUMBER('E', 5), 28, 2 }, /* QSPI1_MISO_IO1 */ 5671 - { PIN_A_NUMBER('E', 4), 24, 2 }, /* QSPI1_IO2 */ 5672 - { PIN_A_NUMBER('C', 3), 20, 2 }, /* QSPI1_IO3 */ 5673 - { PIN_NUMBER('V', 5), 16, 2 }, /* QSPI1_SSL */ 5674 - { PIN_NUMBER('Y', 7), 12, 2 }, /* RPC_INT# */ 5675 - { PIN_NUMBER('V', 6), 8, 2 }, /* RPC_WP# */ 5676 - { PIN_NUMBER('V', 7), 4, 2 }, /* RPC_RESET# */ 5677 - { PIN_NUMBER('A', 16), 0, 3 }, /* AVB_RX_CTL */ 5636 + { PIN_QSPI1_MISO_IO1, 28, 2 }, /* QSPI1_MISO_IO1 */ 5637 + { PIN_QSPI1_IO2, 24, 2 }, /* QSPI1_IO2 */ 5638 + { PIN_QSPI1_IO3, 20, 2 }, /* QSPI1_IO3 */ 5639 + { PIN_QSPI1_SSL, 16, 2 }, /* QSPI1_SSL */ 5640 + { PIN_RPC_INT_N, 12, 2 }, /* RPC_INT# */ 5641 + { PIN_RPC_WP_N, 8, 2 }, /* RPC_WP# */ 5642 + { PIN_RPC_RESET_N, 4, 2 }, /* RPC_RESET# */ 5643 + { PIN_AVB_RX_CTL, 0, 3 }, /* AVB_RX_CTL */ 5678 5644 } }, 5679 5645 { PINMUX_DRIVE_REG("DRVCTRL2", 0xe6060308) { 5680 - { PIN_NUMBER('B', 19), 28, 3 }, /* AVB_RXC */ 5681 - { PIN_NUMBER('A', 13), 24, 3 }, /* AVB_RD0 */ 5682 - { PIN_NUMBER('B', 13), 20, 3 }, /* AVB_RD1 */ 5683 - { PIN_NUMBER('A', 14), 16, 3 }, /* AVB_RD2 */ 5684 - { PIN_NUMBER('B', 14), 12, 3 }, /* AVB_RD3 */ 5685 - { PIN_NUMBER('A', 8), 8, 3 }, /* AVB_TX_CTL */ 5686 - { PIN_NUMBER('A', 19), 4, 3 }, /* AVB_TXC */ 5687 - { PIN_NUMBER('A', 18), 0, 3 }, /* AVB_TD0 */ 5646 + { PIN_AVB_RXC, 28, 3 }, /* AVB_RXC */ 5647 + { PIN_AVB_RD0, 24, 3 }, /* AVB_RD0 */ 5648 + { PIN_AVB_RD1, 20, 3 }, /* AVB_RD1 */ 5649 + { PIN_AVB_RD2, 16, 3 }, /* AVB_RD2 */ 5650 + { PIN_AVB_RD3, 12, 3 }, /* AVB_RD3 */ 5651 + { PIN_AVB_TX_CTL, 8, 3 }, /* AVB_TX_CTL */ 5652 + { PIN_AVB_TXC, 4, 3 }, /* AVB_TXC */ 5653 + { PIN_AVB_TD0, 0, 3 }, /* AVB_TD0 */ 5688 5654 } }, 5689 5655 { PINMUX_DRIVE_REG("DRVCTRL3", 0xe606030c) { 5690 - { PIN_NUMBER('B', 18), 28, 3 }, /* AVB_TD1 */ 5691 - { PIN_NUMBER('A', 17), 24, 3 }, /* AVB_TD2 */ 5692 - { PIN_NUMBER('B', 17), 20, 3 }, /* AVB_TD3 */ 5693 - { PIN_NUMBER('A', 12), 16, 3 }, /* AVB_TXCREFCLK */ 5694 - { PIN_NUMBER('A', 9), 12, 3 }, /* AVB_MDIO */ 5695 - { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5696 - { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5697 - { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5656 + { PIN_AVB_TD1, 28, 3 }, /* AVB_TD1 */ 5657 + { PIN_AVB_TD2, 24, 3 }, /* AVB_TD2 */ 5658 + { PIN_AVB_TD3, 20, 3 }, /* AVB_TD3 */ 5659 + { PIN_AVB_TXCREFCLK, 16, 3 }, /* AVB_TXCREFCLK */ 5660 + { PIN_AVB_MDIO, 12, 3 }, /* AVB_MDIO */ 5661 + { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5662 + { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5663 + { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5698 5664 } }, 5699 5665 { PINMUX_DRIVE_REG("DRVCTRL4", 0xe6060310) { 5700 5666 { RCAR_GP_PIN(2, 12), 28, 3 }, /* AVB_LINK */ ··· 5748 5714 } }, 5749 5715 { PINMUX_DRIVE_REG("DRVCTRL9", 0xe6060324) { 5750 5716 { RCAR_GP_PIN(1, 27), 28, 3 }, /* EX_WAIT0 */ 5751 - { PIN_NUMBER('C', 1), 24, 3 }, /* PRESETOUT# */ 5717 + { PIN_PRESETOUT_N, 24, 3 }, /* PRESETOUT# */ 5752 5718 { RCAR_GP_PIN(0, 0), 20, 3 }, /* D0 */ 5753 5719 { RCAR_GP_PIN(0, 1), 16, 3 }, /* D1 */ 5754 5720 { RCAR_GP_PIN(0, 2), 12, 3 }, /* D2 */ ··· 5767 5733 { RCAR_GP_PIN(0, 13), 0, 3 }, /* D13 */ 5768 5734 } }, 5769 5735 { PINMUX_DRIVE_REG("DRVCTRL11", 0xe606032c) { 5770 - { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5771 - { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5772 - { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5773 - { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5774 - { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5775 - { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5776 - { PIN_A_NUMBER('P', 7), 4, 2 }, /* DU_DOTCLKIN0 */ 5777 - { PIN_A_NUMBER('P', 8), 0, 2 }, /* DU_DOTCLKIN1 */ 5736 + { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5737 + { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5738 + { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5739 + { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5740 + { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5741 + { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5742 + { PIN_DU_DOTCLKIN0, 4, 2 }, /* DU_DOTCLKIN0 */ 5743 + { PIN_DU_DOTCLKIN1, 0, 2 }, /* DU_DOTCLKIN1 */ 5778 5744 } }, 5779 5745 { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) { 5780 - { PIN_A_NUMBER('R', 7), 28, 2 }, /* DU_DOTCLKIN2 */ 5781 - { PIN_A_NUMBER('R', 8), 24, 2 }, /* DU_DOTCLKIN3 */ 5782 - { PIN_A_NUMBER('D', 38), 20, 2 }, /* FSCLKST# */ 5783 - { PIN_A_NUMBER('R', 30), 4, 2 }, /* TMS */ 5746 + { PIN_DU_DOTCLKIN2, 28, 2 }, /* DU_DOTCLKIN2 */ 5747 + { PIN_DU_DOTCLKIN3, 24, 2 }, /* DU_DOTCLKIN3 */ 5748 + { PIN_FSCLKST_N, 20, 2 }, /* FSCLKST# */ 5749 + { PIN_TMS, 4, 2 }, /* TMS */ 5784 5750 } }, 5785 5751 { PINMUX_DRIVE_REG("DRVCTRL13", 0xe6060334) { 5786 - { PIN_A_NUMBER('T', 28), 28, 2 }, /* TDO */ 5787 - { PIN_A_NUMBER('T', 30), 24, 2 }, /* ASEBRK */ 5788 - { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5789 - { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5790 - { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5791 - { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5792 - { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5793 - { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5752 + { PIN_TDO, 28, 2 }, /* TDO */ 5753 + { PIN_ASEBRK, 24, 2 }, /* ASEBRK */ 5754 + { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5755 + { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5756 + { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5757 + { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5758 + { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5759 + { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5794 5760 } }, 5795 5761 { PINMUX_DRIVE_REG("DRVCTRL14", 0xe6060338) { 5796 5762 { RCAR_GP_PIN(3, 6), 28, 3 }, /* SD1_CLK */ ··· 5859 5825 { RCAR_GP_PIN(5, 23), 16, 3 }, /* MLB_CLK */ 5860 5826 { RCAR_GP_PIN(5, 24), 12, 3 }, /* MLB_SIG */ 5861 5827 { RCAR_GP_PIN(5, 25), 8, 3 }, /* MLB_DAT */ 5862 - { PIN_NUMBER('H', 37), 4, 3 }, /* MLB_REF */ 5828 + { PIN_MLB_REF, 4, 3 }, /* MLB_REF */ 5863 5829 { RCAR_GP_PIN(6, 0), 0, 3 }, /* SSI_SCK01239 */ 5864 5830 } }, 5865 5831 { PINMUX_DRIVE_REG("DRVCTRL21", 0xe6060354) { ··· 5932 5898 5933 5899 static const struct pinmux_bias_reg pinmux_bias_regs[] = { 5934 5900 { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 5935 - [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 5936 - [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 5937 - [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 5938 - [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 5939 - [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 5940 - [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 5941 - [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 5942 - [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 5943 - [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 5944 - [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 5945 - [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 5946 - [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 5947 - [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 5948 - [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 5949 - [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 5950 - [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 5951 - [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 5952 - [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 5953 - [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 5954 - [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 5955 - [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 5956 - [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 5957 - [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 5958 - [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 5959 - [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 5960 - [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 5961 - [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 5962 - [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 5963 - [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 5901 + [ 0] = PIN_QSPI0_SPCLK, /* QSPI0_SPCLK */ 5902 + [ 1] = PIN_QSPI0_MOSI_IO0, /* QSPI0_MOSI_IO0 */ 5903 + [ 2] = PIN_QSPI0_MISO_IO1, /* QSPI0_MISO_IO1 */ 5904 + [ 3] = PIN_QSPI0_IO2, /* QSPI0_IO2 */ 5905 + [ 4] = PIN_QSPI0_IO3, /* QSPI0_IO3 */ 5906 + [ 5] = PIN_QSPI0_SSL, /* QSPI0_SSL */ 5907 + [ 6] = PIN_QSPI1_SPCLK, /* QSPI1_SPCLK */ 5908 + [ 7] = PIN_QSPI1_MOSI_IO0, /* QSPI1_MOSI_IO0 */ 5909 + [ 8] = PIN_QSPI1_MISO_IO1, /* QSPI1_MISO_IO1 */ 5910 + [ 9] = PIN_QSPI1_IO2, /* QSPI1_IO2 */ 5911 + [10] = PIN_QSPI1_IO3, /* QSPI1_IO3 */ 5912 + [11] = PIN_QSPI1_SSL, /* QSPI1_SSL */ 5913 + [12] = PIN_RPC_INT_N, /* RPC_INT# */ 5914 + [13] = PIN_RPC_WP_N, /* RPC_WP# */ 5915 + [14] = PIN_RPC_RESET_N, /* RPC_RESET# */ 5916 + [15] = PIN_AVB_RX_CTL, /* AVB_RX_CTL */ 5917 + [16] = PIN_AVB_RXC, /* AVB_RXC */ 5918 + [17] = PIN_AVB_RD0, /* AVB_RD0 */ 5919 + [18] = PIN_AVB_RD1, /* AVB_RD1 */ 5920 + [19] = PIN_AVB_RD2, /* AVB_RD2 */ 5921 + [20] = PIN_AVB_RD3, /* AVB_RD3 */ 5922 + [21] = PIN_AVB_TX_CTL, /* AVB_TX_CTL */ 5923 + [22] = PIN_AVB_TXC, /* AVB_TXC */ 5924 + [23] = PIN_AVB_TD0, /* AVB_TD0 */ 5925 + [24] = PIN_AVB_TD1, /* AVB_TD1 */ 5926 + [25] = PIN_AVB_TD2, /* AVB_TD2 */ 5927 + [26] = PIN_AVB_TD3, /* AVB_TD3 */ 5928 + [27] = PIN_AVB_TXCREFCLK, /* AVB_TXCREFCLK */ 5929 + [28] = PIN_AVB_MDIO, /* AVB_MDIO */ 5964 5930 [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 5965 5931 [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 5966 5932 [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ ··· 6009 5975 [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 6010 5976 [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 6011 5977 [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 6012 - [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 5978 + [ 9] = PIN_PRESETOUT_N, /* PRESETOUT# */ 6013 5979 [10] = RCAR_GP_PIN(0, 0), /* D0 */ 6014 5980 [11] = RCAR_GP_PIN(0, 1), /* D1 */ 6015 5981 [12] = RCAR_GP_PIN(0, 2), /* D2 */ ··· 6030 5996 [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 6031 5997 [28] = RCAR_GP_PIN(7, 2), /* GP7_02 */ 6032 5998 [29] = RCAR_GP_PIN(7, 3), /* GP7_03 */ 6033 - [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 6034 - [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 5999 + [30] = PIN_DU_DOTCLKIN0, /* DU_DOTCLKIN0 */ 6000 + [31] = PIN_DU_DOTCLKIN1, /* DU_DOTCLKIN1 */ 6035 6001 } }, 6036 6002 { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 6037 - [ 0] = PIN_A_NUMBER('R', 7), /* DU_DOTCLKIN2 */ 6038 - [ 1] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN3 */ 6039 - [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST# */ 6040 - [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 6041 - [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 6042 - [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 6043 - [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 6044 - [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 6045 - [ 8] = PIN_NONE, 6046 - [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 6003 + [ 0] = PIN_DU_DOTCLKIN2, /* DU_DOTCLKIN2 */ 6004 + [ 1] = PIN_DU_DOTCLKIN3, /* DU_DOTCLKIN3 */ 6005 + [ 2] = PIN_FSCLKST_N, /* FSCLKST# */ 6006 + [ 3] = PIN_EXTALR, /* EXTALR*/ 6007 + [ 4] = PIN_TRST_N, /* TRST# */ 6008 + [ 5] = PIN_TCK, /* TCK */ 6009 + [ 6] = PIN_TMS, /* TMS */ 6010 + [ 7] = PIN_TDI, /* TDI */ 6011 + [ 8] = SH_PFC_PIN_NONE, 6012 + [ 9] = PIN_ASEBRK, /* ASEBRK */ 6047 6013 [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 6048 6014 [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 6049 6015 [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ ··· 6108 6074 [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 6109 6075 [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 6110 6076 [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 6111 - [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 6077 + [ 6] = PIN_MLB_REF, /* MLB_REF */ 6112 6078 [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 6113 6079 [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 6114 6080 [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ ··· 6143 6109 [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 6144 6110 [ 5] = RCAR_GP_PIN(6, 30), /* USB2_CH3_PWEN */ 6145 6111 [ 6] = RCAR_GP_PIN(6, 31), /* USB2_CH3_OVC */ 6146 - [ 7] = PIN_NONE, 6147 - [ 8] = PIN_NONE, 6148 - [ 9] = PIN_NONE, 6149 - [10] = PIN_NONE, 6150 - [11] = PIN_NONE, 6151 - [12] = PIN_NONE, 6152 - [13] = PIN_NONE, 6153 - [14] = PIN_NONE, 6154 - [15] = PIN_NONE, 6155 - [16] = PIN_NONE, 6156 - [17] = PIN_NONE, 6157 - [18] = PIN_NONE, 6158 - [19] = PIN_NONE, 6159 - [20] = PIN_NONE, 6160 - [21] = PIN_NONE, 6161 - [22] = PIN_NONE, 6162 - [23] = PIN_NONE, 6163 - [24] = PIN_NONE, 6164 - [25] = PIN_NONE, 6165 - [26] = PIN_NONE, 6166 - [27] = PIN_NONE, 6167 - [28] = PIN_NONE, 6168 - [29] = PIN_NONE, 6169 - [30] = PIN_NONE, 6170 - [31] = PIN_NONE, 6112 + [ 7] = SH_PFC_PIN_NONE, 6113 + [ 8] = SH_PFC_PIN_NONE, 6114 + [ 9] = SH_PFC_PIN_NONE, 6115 + [10] = SH_PFC_PIN_NONE, 6116 + [11] = SH_PFC_PIN_NONE, 6117 + [12] = SH_PFC_PIN_NONE, 6118 + [13] = SH_PFC_PIN_NONE, 6119 + [14] = SH_PFC_PIN_NONE, 6120 + [15] = SH_PFC_PIN_NONE, 6121 + [16] = SH_PFC_PIN_NONE, 6122 + [17] = SH_PFC_PIN_NONE, 6123 + [18] = SH_PFC_PIN_NONE, 6124 + [19] = SH_PFC_PIN_NONE, 6125 + [20] = SH_PFC_PIN_NONE, 6126 + [21] = SH_PFC_PIN_NONE, 6127 + [22] = SH_PFC_PIN_NONE, 6128 + [23] = SH_PFC_PIN_NONE, 6129 + [24] = SH_PFC_PIN_NONE, 6130 + [25] = SH_PFC_PIN_NONE, 6131 + [26] = SH_PFC_PIN_NONE, 6132 + [27] = SH_PFC_PIN_NONE, 6133 + [28] = SH_PFC_PIN_NONE, 6134 + [29] = SH_PFC_PIN_NONE, 6135 + [30] = SH_PFC_PIN_NONE, 6136 + [31] = SH_PFC_PIN_NONE, 6171 6137 } }, 6172 6138 { /* sentinel */ }, 6173 6139 };
+224 -190
drivers/pinctrl/sh-pfc/pfc-r8a7796.c
··· 17 17 #include "core.h" 18 18 #include "sh_pfc.h" 19 19 20 - #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | \ 21 - SH_PFC_PIN_CFG_PULL_UP | \ 22 - SH_PFC_PIN_CFG_PULL_DOWN) 20 + #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) 23 21 24 - #define CPU_ALL_PORT(fn, sfx) \ 22 + #define CPU_ALL_GP(fn, sfx) \ 25 23 PORT_GP_CFG_16(0, fn, sfx, CFG_FLAGS), \ 26 24 PORT_GP_CFG_29(1, fn, sfx, CFG_FLAGS), \ 27 25 PORT_GP_CFG_15(2, fn, sfx, CFG_FLAGS), \ ··· 32 34 PORT_GP_CFG_26(5, fn, sfx, CFG_FLAGS), \ 33 35 PORT_GP_CFG_32(6, fn, sfx, CFG_FLAGS), \ 34 36 PORT_GP_CFG_4(7, fn, sfx, CFG_FLAGS) 37 + 38 + #define CPU_ALL_NOGP(fn) \ 39 + PIN_NOGP_CFG(ASEBRK, "ASEBRK", fn, CFG_FLAGS), \ 40 + PIN_NOGP_CFG(AVB_MDIO, "AVB_MDIO", fn, CFG_FLAGS), \ 41 + PIN_NOGP_CFG(AVB_RD0, "AVB_RD0", fn, CFG_FLAGS), \ 42 + PIN_NOGP_CFG(AVB_RD1, "AVB_RD1", fn, CFG_FLAGS), \ 43 + PIN_NOGP_CFG(AVB_RD2, "AVB_RD2", fn, CFG_FLAGS), \ 44 + PIN_NOGP_CFG(AVB_RD3, "AVB_RD3", fn, CFG_FLAGS), \ 45 + PIN_NOGP_CFG(AVB_RXC, "AVB_RXC", fn, CFG_FLAGS), \ 46 + PIN_NOGP_CFG(AVB_RX_CTL, "AVB_RX_CTL", fn, CFG_FLAGS), \ 47 + PIN_NOGP_CFG(AVB_TD0, "AVB_TD0", fn, CFG_FLAGS), \ 48 + PIN_NOGP_CFG(AVB_TD1, "AVB_TD1", fn, CFG_FLAGS), \ 49 + PIN_NOGP_CFG(AVB_TD2, "AVB_TD2", fn, CFG_FLAGS), \ 50 + PIN_NOGP_CFG(AVB_TD3, "AVB_TD3", fn, CFG_FLAGS), \ 51 + PIN_NOGP_CFG(AVB_TXC, "AVB_TXC", fn, CFG_FLAGS), \ 52 + PIN_NOGP_CFG(AVB_TXCREFCLK, "AVB_TXCREFCLK", fn, CFG_FLAGS), \ 53 + PIN_NOGP_CFG(AVB_TX_CTL, "AVB_TX_CTL", fn, CFG_FLAGS), \ 54 + PIN_NOGP_CFG(DU_DOTCLKIN0, "DU_DOTCLKIN0", fn, CFG_FLAGS), \ 55 + PIN_NOGP_CFG(DU_DOTCLKIN1, "DU_DOTCLKIN1", fn, CFG_FLAGS), \ 56 + PIN_NOGP_CFG(DU_DOTCLKIN2, "DU_DOTCLKIN2", fn, CFG_FLAGS), \ 57 + PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN),\ 58 + PIN_NOGP_CFG(FSCLKST, "FSCLKST", fn, CFG_FLAGS), \ 59 + PIN_NOGP_CFG(MLB_REF, "MLB_REF", fn, CFG_FLAGS), \ 60 + PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, CFG_FLAGS), \ 61 + PIN_NOGP_CFG(QSPI0_IO2, "QSPI0_IO2", fn, CFG_FLAGS), \ 62 + PIN_NOGP_CFG(QSPI0_IO3, "QSPI0_IO3", fn, CFG_FLAGS), \ 63 + PIN_NOGP_CFG(QSPI0_MISO_IO1, "QSPI0_MISO_IO1", fn, CFG_FLAGS), \ 64 + PIN_NOGP_CFG(QSPI0_MOSI_IO0, "QSPI0_MOSI_IO0", fn, CFG_FLAGS), \ 65 + PIN_NOGP_CFG(QSPI0_SPCLK, "QSPI0_SPCLK", fn, CFG_FLAGS), \ 66 + PIN_NOGP_CFG(QSPI0_SSL, "QSPI0_SSL", fn, CFG_FLAGS), \ 67 + PIN_NOGP_CFG(QSPI1_IO2, "QSPI1_IO2", fn, CFG_FLAGS), \ 68 + PIN_NOGP_CFG(QSPI1_IO3, "QSPI1_IO3", fn, CFG_FLAGS), \ 69 + PIN_NOGP_CFG(QSPI1_MISO_IO1, "QSPI1_MISO_IO1", fn, CFG_FLAGS), \ 70 + PIN_NOGP_CFG(QSPI1_MOSI_IO0, "QSPI1_MOSI_IO0", fn, CFG_FLAGS), \ 71 + PIN_NOGP_CFG(QSPI1_SPCLK, "QSPI1_SPCLK", fn, CFG_FLAGS), \ 72 + PIN_NOGP_CFG(QSPI1_SSL, "QSPI1_SSL", fn, CFG_FLAGS), \ 73 + PIN_NOGP_CFG(RPC_INT_N, "RPC_INT#", fn, CFG_FLAGS), \ 74 + PIN_NOGP_CFG(RPC_RESET_N, "RPC_RESET#", fn, CFG_FLAGS), \ 75 + PIN_NOGP_CFG(RPC_WP_N, "RPC_WP#", fn, CFG_FLAGS), \ 76 + PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 77 + PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 78 + PIN_NOGP_CFG(TDO, "TDO", fn, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 79 + PIN_NOGP_CFG(TMS, "TMS", fn, CFG_FLAGS), \ 80 + PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN) 81 + 35 82 /* 36 83 * F_() : just information 37 84 * FM() : macro for FN_xxx / xxx_MARK ··· 1555 1512 }; 1556 1513 1557 1514 /* 1558 - * R8A7796 has 8 banks with 32 GPIOs in each => 256 GPIOs. 1559 - * Physical layout rows: A - AW, cols: 1 - 39. 1515 + * Pins not associated with a GPIO port. 1560 1516 */ 1561 - #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1562 - #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1563 - #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1564 - #define PIN_NONE U16_MAX 1517 + enum { 1518 + GP_ASSIGN_LAST(), 1519 + NOGP_ALL(), 1520 + }; 1565 1521 1566 1522 static const struct sh_pfc_pin pinmux_pins[] = { 1567 1523 PINMUX_GPIO_GP_ALL(), 1568 - 1569 - /* 1570 - * Pins not associated with a GPIO port. 1571 - * 1572 - * The pin positions are different between different r8a7796 1573 - * packages, all that is needed for the pfc driver is a unique 1574 - * number for each pin. To this end use the pin layout from 1575 - * R-Car M3SiP to calculate a unique number for each pin. 1576 - */ 1577 - SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, CFG_FLAGS), 1578 - SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, CFG_FLAGS), 1579 - SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, CFG_FLAGS), 1580 - SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, CFG_FLAGS), 1581 - SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, CFG_FLAGS), 1582 - SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, CFG_FLAGS), 1583 - SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, CFG_FLAGS), 1584 - SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, CFG_FLAGS), 1585 - SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, CFG_FLAGS), 1586 - SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, CFG_FLAGS), 1587 - SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, CFG_FLAGS), 1588 - SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, CFG_FLAGS), 1589 - SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, CFG_FLAGS), 1590 - SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, CFG_FLAGS), 1591 - SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, CFG_FLAGS), 1592 - SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, CFG_FLAGS), 1593 - SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, CFG_FLAGS), 1594 - SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, CFG_FLAGS), 1595 - SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, CFG_FLAGS), 1596 - SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, CFG_FLAGS), 1597 - SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, CFG_FLAGS), 1598 - SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, CFG_FLAGS), 1599 - SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, CFG_FLAGS), 1600 - SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, CFG_FLAGS), 1601 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, CFG_FLAGS), 1602 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, CFG_FLAGS), 1603 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, CFG_FLAGS), 1604 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, CFG_FLAGS), 1605 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, CFG_FLAGS), 1606 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST, CFG_FLAGS), 1607 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 39, EXTALR, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1608 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, CFG_FLAGS), 1609 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, CFG_FLAGS), 1610 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, CFG_FLAGS), 1611 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, CFG_FLAGS), 1612 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN2, CFG_FLAGS), 1613 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 26, TRST#, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1614 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 29, TDI, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1615 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, CFG_FLAGS), 1616 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1617 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1618 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS), 1524 + PINMUX_NOGP_ALL(), 1619 1525 }; 1620 1526 1621 1527 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 1713 1721 }; 1714 1722 static const unsigned int avb_mdio_pins[] = { 1715 1723 /* AVB_MDC, AVB_MDIO */ 1716 - RCAR_GP_PIN(2, 9), PIN_NUMBER('A', 9), 1724 + RCAR_GP_PIN(2, 9), PIN_AVB_MDIO, 1717 1725 }; 1718 1726 static const unsigned int avb_mdio_mux[] = { 1719 1727 AVB_MDC_MARK, AVB_MDIO_MARK, ··· 1726 1734 * AVB_RD1, AVB_RD2, AVB_RD3, 1727 1735 * AVB_TXCREFCLK 1728 1736 */ 1729 - PIN_NUMBER('A', 8), PIN_NUMBER('A', 19), PIN_NUMBER('A', 18), 1730 - PIN_NUMBER('B', 18), PIN_NUMBER('A', 17), PIN_NUMBER('B', 17), 1731 - PIN_NUMBER('A', 16), PIN_NUMBER('B', 19), PIN_NUMBER('A', 13), 1732 - PIN_NUMBER('B', 13), PIN_NUMBER('A', 14), PIN_NUMBER('B', 14), 1733 - PIN_NUMBER('A', 12), 1737 + PIN_AVB_TX_CTL, PIN_AVB_TXC, PIN_AVB_TD0, 1738 + PIN_AVB_TD1, PIN_AVB_TD2, PIN_AVB_TD3, 1739 + PIN_AVB_RX_CTL, PIN_AVB_RXC, PIN_AVB_RD0, 1740 + PIN_AVB_RD1, PIN_AVB_RD2, PIN_AVB_RD3, 1741 + PIN_AVB_TXCREFCLK, 1734 1742 1735 1743 }; 1736 1744 static const unsigned int avb_mii_mux[] = { ··· 3883 3891 TCLK2_B_MARK, 3884 3892 }; 3885 3893 3894 + /* - TPU ------------------------------------------------------------------- */ 3895 + static const unsigned int tpu_to0_pins[] = { 3896 + /* TPU0TO0 */ 3897 + RCAR_GP_PIN(6, 28), 3898 + }; 3899 + static const unsigned int tpu_to0_mux[] = { 3900 + TPU0TO0_MARK, 3901 + }; 3902 + static const unsigned int tpu_to1_pins[] = { 3903 + /* TPU0TO1 */ 3904 + RCAR_GP_PIN(6, 29), 3905 + }; 3906 + static const unsigned int tpu_to1_mux[] = { 3907 + TPU0TO1_MARK, 3908 + }; 3909 + static const unsigned int tpu_to2_pins[] = { 3910 + /* TPU0TO2 */ 3911 + RCAR_GP_PIN(6, 30), 3912 + }; 3913 + static const unsigned int tpu_to2_mux[] = { 3914 + TPU0TO2_MARK, 3915 + }; 3916 + static const unsigned int tpu_to3_pins[] = { 3917 + /* TPU0TO3 */ 3918 + RCAR_GP_PIN(6, 31), 3919 + }; 3920 + static const unsigned int tpu_to3_mux[] = { 3921 + TPU0TO3_MARK, 3922 + }; 3923 + 3886 3924 /* - USB0 ------------------------------------------------------------------- */ 3887 3925 static const unsigned int usb0_pins[] = { 3888 3926 /* PWEN, OVC */ ··· 4132 4110 }; 4133 4111 4134 4112 static const struct { 4135 - struct sh_pfc_pin_group common[312]; 4113 + struct sh_pfc_pin_group common[316]; 4136 4114 struct sh_pfc_pin_group automotive[30]; 4137 4115 } pinmux_groups = { 4138 4116 .common = { ··· 4419 4397 SH_PFC_PIN_GROUP(tmu_tclk1_b), 4420 4398 SH_PFC_PIN_GROUP(tmu_tclk2_a), 4421 4399 SH_PFC_PIN_GROUP(tmu_tclk2_b), 4400 + SH_PFC_PIN_GROUP(tpu_to0), 4401 + SH_PFC_PIN_GROUP(tpu_to1), 4402 + SH_PFC_PIN_GROUP(tpu_to2), 4403 + SH_PFC_PIN_GROUP(tpu_to3), 4422 4404 SH_PFC_PIN_GROUP(usb0), 4423 4405 SH_PFC_PIN_GROUP(usb1), 4424 4406 SH_PFC_PIN_GROUP(usb30), ··· 4944 4918 "tmu_tclk2_b", 4945 4919 }; 4946 4920 4921 + static const char * const tpu_groups[] = { 4922 + "tpu_to0", 4923 + "tpu_to1", 4924 + "tpu_to2", 4925 + "tpu_to3", 4926 + }; 4927 + 4947 4928 static const char * const usb0_groups[] = { 4948 4929 "usb0", 4949 4930 }; ··· 4996 4963 }; 4997 4964 4998 4965 static const struct { 4999 - struct sh_pfc_function common[49]; 4966 + struct sh_pfc_function common[50]; 5000 4967 struct sh_pfc_function automotive[4]; 5001 4968 } pinmux_functions = { 5002 4969 .common = { ··· 5044 5011 SH_PFC_FUNCTION(sdhi3), 5045 5012 SH_PFC_FUNCTION(ssi), 5046 5013 SH_PFC_FUNCTION(tmu), 5014 + SH_PFC_FUNCTION(tpu), 5047 5015 SH_PFC_FUNCTION(usb0), 5048 5016 SH_PFC_FUNCTION(usb1), 5049 5017 SH_PFC_FUNCTION(usb30), ··· 5624 5590 5625 5591 static const struct pinmux_drive_reg pinmux_drive_regs[] = { 5626 5592 { PINMUX_DRIVE_REG("DRVCTRL0", 0xe6060300) { 5627 - { PIN_NUMBER('W', 3), 28, 2 }, /* QSPI0_SPCLK */ 5628 - { PIN_A_NUMBER('C', 5), 24, 2 }, /* QSPI0_MOSI_IO0 */ 5629 - { PIN_A_NUMBER('B', 4), 20, 2 }, /* QSPI0_MISO_IO1 */ 5630 - { PIN_NUMBER('Y', 6), 16, 2 }, /* QSPI0_IO2 */ 5631 - { PIN_A_NUMBER('B', 6), 12, 2 }, /* QSPI0_IO3 */ 5632 - { PIN_NUMBER('Y', 3), 8, 2 }, /* QSPI0_SSL */ 5633 - { PIN_NUMBER('V', 3), 4, 2 }, /* QSPI1_SPCLK */ 5634 - { PIN_A_NUMBER('C', 7), 0, 2 }, /* QSPI1_MOSI_IO0 */ 5593 + { PIN_QSPI0_SPCLK, 28, 2 }, /* QSPI0_SPCLK */ 5594 + { PIN_QSPI0_MOSI_IO0, 24, 2 }, /* QSPI0_MOSI_IO0 */ 5595 + { PIN_QSPI0_MISO_IO1, 20, 2 }, /* QSPI0_MISO_IO1 */ 5596 + { PIN_QSPI0_IO2, 16, 2 }, /* QSPI0_IO2 */ 5597 + { PIN_QSPI0_IO3, 12, 2 }, /* QSPI0_IO3 */ 5598 + { PIN_QSPI0_SSL, 8, 2 }, /* QSPI0_SSL */ 5599 + { PIN_QSPI1_SPCLK, 4, 2 }, /* QSPI1_SPCLK */ 5600 + { PIN_QSPI1_MOSI_IO0, 0, 2 }, /* QSPI1_MOSI_IO0 */ 5635 5601 } }, 5636 5602 { PINMUX_DRIVE_REG("DRVCTRL1", 0xe6060304) { 5637 - { PIN_A_NUMBER('E', 5), 28, 2 }, /* QSPI1_MISO_IO1 */ 5638 - { PIN_A_NUMBER('E', 4), 24, 2 }, /* QSPI1_IO2 */ 5639 - { PIN_A_NUMBER('C', 3), 20, 2 }, /* QSPI1_IO3 */ 5640 - { PIN_NUMBER('V', 5), 16, 2 }, /* QSPI1_SSL */ 5641 - { PIN_NUMBER('Y', 7), 12, 2 }, /* RPC_INT# */ 5642 - { PIN_NUMBER('V', 6), 8, 2 }, /* RPC_WP# */ 5643 - { PIN_NUMBER('V', 7), 4, 2 }, /* RPC_RESET# */ 5644 - { PIN_NUMBER('A', 16), 0, 3 }, /* AVB_RX_CTL */ 5603 + { PIN_QSPI1_MISO_IO1, 28, 2 }, /* QSPI1_MISO_IO1 */ 5604 + { PIN_QSPI1_IO2, 24, 2 }, /* QSPI1_IO2 */ 5605 + { PIN_QSPI1_IO3, 20, 2 }, /* QSPI1_IO3 */ 5606 + { PIN_QSPI1_SSL, 16, 2 }, /* QSPI1_SSL */ 5607 + { PIN_RPC_INT_N, 12, 2 }, /* RPC_INT# */ 5608 + { PIN_RPC_WP_N, 8, 2 }, /* RPC_WP# */ 5609 + { PIN_RPC_RESET_N, 4, 2 }, /* RPC_RESET# */ 5610 + { PIN_AVB_RX_CTL, 0, 3 }, /* AVB_RX_CTL */ 5645 5611 } }, 5646 5612 { PINMUX_DRIVE_REG("DRVCTRL2", 0xe6060308) { 5647 - { PIN_NUMBER('B', 19), 28, 3 }, /* AVB_RXC */ 5648 - { PIN_NUMBER('A', 13), 24, 3 }, /* AVB_RD0 */ 5649 - { PIN_NUMBER('B', 13), 20, 3 }, /* AVB_RD1 */ 5650 - { PIN_NUMBER('A', 14), 16, 3 }, /* AVB_RD2 */ 5651 - { PIN_NUMBER('B', 14), 12, 3 }, /* AVB_RD3 */ 5652 - { PIN_NUMBER('A', 8), 8, 3 }, /* AVB_TX_CTL */ 5653 - { PIN_NUMBER('A', 19), 4, 3 }, /* AVB_TXC */ 5654 - { PIN_NUMBER('A', 18), 0, 3 }, /* AVB_TD0 */ 5613 + { PIN_AVB_RXC, 28, 3 }, /* AVB_RXC */ 5614 + { PIN_AVB_RD0, 24, 3 }, /* AVB_RD0 */ 5615 + { PIN_AVB_RD1, 20, 3 }, /* AVB_RD1 */ 5616 + { PIN_AVB_RD2, 16, 3 }, /* AVB_RD2 */ 5617 + { PIN_AVB_RD3, 12, 3 }, /* AVB_RD3 */ 5618 + { PIN_AVB_TX_CTL, 8, 3 }, /* AVB_TX_CTL */ 5619 + { PIN_AVB_TXC, 4, 3 }, /* AVB_TXC */ 5620 + { PIN_AVB_TD0, 0, 3 }, /* AVB_TD0 */ 5655 5621 } }, 5656 5622 { PINMUX_DRIVE_REG("DRVCTRL3", 0xe606030c) { 5657 - { PIN_NUMBER('B', 18), 28, 3 }, /* AVB_TD1 */ 5658 - { PIN_NUMBER('A', 17), 24, 3 }, /* AVB_TD2 */ 5659 - { PIN_NUMBER('B', 17), 20, 3 }, /* AVB_TD3 */ 5660 - { PIN_NUMBER('A', 12), 16, 3 }, /* AVB_TXCREFCLK */ 5661 - { PIN_NUMBER('A', 9), 12, 3 }, /* AVB_MDIO */ 5662 - { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5663 - { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5664 - { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5623 + { PIN_AVB_TD1, 28, 3 }, /* AVB_TD1 */ 5624 + { PIN_AVB_TD2, 24, 3 }, /* AVB_TD2 */ 5625 + { PIN_AVB_TD3, 20, 3 }, /* AVB_TD3 */ 5626 + { PIN_AVB_TXCREFCLK, 16, 3 }, /* AVB_TXCREFCLK */ 5627 + { PIN_AVB_MDIO, 12, 3 }, /* AVB_MDIO */ 5628 + { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5629 + { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5630 + { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5665 5631 } }, 5666 5632 { PINMUX_DRIVE_REG("DRVCTRL4", 0xe6060310) { 5667 5633 { RCAR_GP_PIN(2, 12), 28, 3 }, /* AVB_LINK */ ··· 5715 5681 } }, 5716 5682 { PINMUX_DRIVE_REG("DRVCTRL9", 0xe6060324) { 5717 5683 { RCAR_GP_PIN(1, 27), 28, 3 }, /* EX_WAIT0 */ 5718 - { PIN_NUMBER('C', 1), 24, 3 }, /* PRESETOUT# */ 5684 + { PIN_PRESETOUT_N, 24, 3 }, /* PRESETOUT# */ 5719 5685 { RCAR_GP_PIN(0, 0), 20, 3 }, /* D0 */ 5720 5686 { RCAR_GP_PIN(0, 1), 16, 3 }, /* D1 */ 5721 5687 { RCAR_GP_PIN(0, 2), 12, 3 }, /* D2 */ ··· 5734 5700 { RCAR_GP_PIN(0, 13), 0, 3 }, /* D13 */ 5735 5701 } }, 5736 5702 { PINMUX_DRIVE_REG("DRVCTRL11", 0xe606032c) { 5737 - { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5738 - { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5739 - { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5740 - { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5741 - { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5742 - { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5743 - { PIN_A_NUMBER('P', 7), 4, 2 }, /* DU_DOTCLKIN0 */ 5744 - { PIN_A_NUMBER('P', 8), 0, 2 }, /* DU_DOTCLKIN1 */ 5703 + { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5704 + { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5705 + { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5706 + { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5707 + { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5708 + { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5709 + { PIN_DU_DOTCLKIN0, 4, 2 }, /* DU_DOTCLKIN0 */ 5710 + { PIN_DU_DOTCLKIN1, 0, 2 }, /* DU_DOTCLKIN1 */ 5745 5711 } }, 5746 5712 { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) { 5747 - { PIN_A_NUMBER('R', 8), 28, 2 }, /* DU_DOTCLKIN2 */ 5748 - { PIN_A_NUMBER('D', 38), 20, 2 }, /* FSCLKST */ 5749 - { PIN_A_NUMBER('R', 30), 4, 2 }, /* TMS */ 5713 + { PIN_DU_DOTCLKIN2, 28, 2 }, /* DU_DOTCLKIN2 */ 5714 + { PIN_FSCLKST, 20, 2 }, /* FSCLKST */ 5715 + { PIN_TMS, 4, 2 }, /* TMS */ 5750 5716 } }, 5751 5717 { PINMUX_DRIVE_REG("DRVCTRL13", 0xe6060334) { 5752 - { PIN_A_NUMBER('T', 28), 28, 2 }, /* TDO */ 5753 - { PIN_A_NUMBER('T', 30), 24, 2 }, /* ASEBRK */ 5754 - { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5755 - { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5756 - { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5757 - { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5758 - { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5759 - { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5718 + { PIN_TDO, 28, 2 }, /* TDO */ 5719 + { PIN_ASEBRK, 24, 2 }, /* ASEBRK */ 5720 + { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5721 + { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5722 + { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5723 + { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5724 + { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5725 + { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5760 5726 } }, 5761 5727 { PINMUX_DRIVE_REG("DRVCTRL14", 0xe6060338) { 5762 5728 { RCAR_GP_PIN(3, 6), 28, 3 }, /* SD1_CLK */ ··· 5825 5791 { RCAR_GP_PIN(5, 23), 16, 3 }, /* MLB_CLK */ 5826 5792 { RCAR_GP_PIN(5, 24), 12, 3 }, /* MLB_SIG */ 5827 5793 { RCAR_GP_PIN(5, 25), 8, 3 }, /* MLB_DAT */ 5828 - { PIN_NUMBER('H', 37), 4, 3 }, /* MLB_REF */ 5794 + { PIN_MLB_REF, 4, 3 }, /* MLB_REF */ 5829 5795 { RCAR_GP_PIN(6, 0), 0, 3 }, /* SSI_SCK01239 */ 5830 5796 } }, 5831 5797 { PINMUX_DRIVE_REG("DRVCTRL21", 0xe6060354) { ··· 5898 5864 5899 5865 static const struct pinmux_bias_reg pinmux_bias_regs[] = { 5900 5866 { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 5901 - [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 5902 - [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 5903 - [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 5904 - [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 5905 - [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 5906 - [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 5907 - [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 5908 - [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 5909 - [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 5910 - [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 5911 - [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 5912 - [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 5913 - [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 5914 - [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 5915 - [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 5916 - [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 5917 - [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 5918 - [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 5919 - [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 5920 - [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 5921 - [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 5922 - [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 5923 - [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 5924 - [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 5925 - [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 5926 - [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 5927 - [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 5928 - [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 5929 - [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 5867 + [ 0] = PIN_QSPI0_SPCLK, /* QSPI0_SPCLK */ 5868 + [ 1] = PIN_QSPI0_MOSI_IO0, /* QSPI0_MOSI_IO0 */ 5869 + [ 2] = PIN_QSPI0_MISO_IO1, /* QSPI0_MISO_IO1 */ 5870 + [ 3] = PIN_QSPI0_IO2, /* QSPI0_IO2 */ 5871 + [ 4] = PIN_QSPI0_IO3, /* QSPI0_IO3 */ 5872 + [ 5] = PIN_QSPI0_SSL, /* QSPI0_SSL */ 5873 + [ 6] = PIN_QSPI1_SPCLK, /* QSPI1_SPCLK */ 5874 + [ 7] = PIN_QSPI1_MOSI_IO0, /* QSPI1_MOSI_IO0 */ 5875 + [ 8] = PIN_QSPI1_MISO_IO1, /* QSPI1_MISO_IO1 */ 5876 + [ 9] = PIN_QSPI1_IO2, /* QSPI1_IO2 */ 5877 + [10] = PIN_QSPI1_IO3, /* QSPI1_IO3 */ 5878 + [11] = PIN_QSPI1_SSL, /* QSPI1_SSL */ 5879 + [12] = PIN_RPC_INT_N, /* RPC_INT# */ 5880 + [13] = PIN_RPC_WP_N, /* RPC_WP# */ 5881 + [14] = PIN_RPC_RESET_N, /* RPC_RESET# */ 5882 + [15] = PIN_AVB_RX_CTL, /* AVB_RX_CTL */ 5883 + [16] = PIN_AVB_RXC, /* AVB_RXC */ 5884 + [17] = PIN_AVB_RD0, /* AVB_RD0 */ 5885 + [18] = PIN_AVB_RD1, /* AVB_RD1 */ 5886 + [19] = PIN_AVB_RD2, /* AVB_RD2 */ 5887 + [20] = PIN_AVB_RD3, /* AVB_RD3 */ 5888 + [21] = PIN_AVB_TX_CTL, /* AVB_TX_CTL */ 5889 + [22] = PIN_AVB_TXC, /* AVB_TXC */ 5890 + [23] = PIN_AVB_TD0, /* AVB_TD0 */ 5891 + [24] = PIN_AVB_TD1, /* AVB_TD1 */ 5892 + [25] = PIN_AVB_TD2, /* AVB_TD2 */ 5893 + [26] = PIN_AVB_TD3, /* AVB_TD3 */ 5894 + [27] = PIN_AVB_TXCREFCLK, /* AVB_TXCREFCLK */ 5895 + [28] = PIN_AVB_MDIO, /* AVB_MDIO */ 5930 5896 [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 5931 5897 [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 5932 5898 [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ ··· 5975 5941 [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 5976 5942 [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 5977 5943 [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 5978 - [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 5944 + [ 9] = PIN_PRESETOUT_N, /* PRESETOUT# */ 5979 5945 [10] = RCAR_GP_PIN(0, 0), /* D0 */ 5980 5946 [11] = RCAR_GP_PIN(0, 1), /* D1 */ 5981 5947 [12] = RCAR_GP_PIN(0, 2), /* D2 */ ··· 5996 5962 [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 5997 5963 [28] = RCAR_GP_PIN(7, 2), /* GP7_02 */ 5998 5964 [29] = RCAR_GP_PIN(7, 3), /* GP7_03 */ 5999 - [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 6000 - [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 5965 + [30] = PIN_DU_DOTCLKIN0, /* DU_DOTCLKIN0 */ 5966 + [31] = PIN_DU_DOTCLKIN1, /* DU_DOTCLKIN1 */ 6001 5967 } }, 6002 5968 { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 6003 - [ 0] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN2 */ 6004 - [ 1] = PIN_NONE, 6005 - [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST */ 6006 - [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 6007 - [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 6008 - [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 6009 - [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 6010 - [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 6011 - [ 8] = PIN_NONE, 6012 - [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 5969 + [ 0] = PIN_DU_DOTCLKIN2, /* DU_DOTCLKIN2 */ 5970 + [ 1] = SH_PFC_PIN_NONE, 5971 + [ 2] = PIN_FSCLKST, /* FSCLKST */ 5972 + [ 3] = PIN_EXTALR, /* EXTALR*/ 5973 + [ 4] = PIN_TRST_N, /* TRST# */ 5974 + [ 5] = PIN_TCK, /* TCK */ 5975 + [ 6] = PIN_TMS, /* TMS */ 5976 + [ 7] = PIN_TDI, /* TDI */ 5977 + [ 8] = SH_PFC_PIN_NONE, 5978 + [ 9] = PIN_ASEBRK, /* ASEBRK */ 6013 5979 [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 6014 5980 [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 6015 5981 [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ ··· 6074 6040 [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 6075 6041 [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 6076 6042 [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 6077 - [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 6043 + [ 6] = PIN_MLB_REF, /* MLB_REF */ 6078 6044 [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 6079 6045 [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 6080 6046 [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ ··· 6109 6075 [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 6110 6076 [ 5] = RCAR_GP_PIN(6, 30), /* GP6_30 */ 6111 6077 [ 6] = RCAR_GP_PIN(6, 31), /* GP6_31 */ 6112 - [ 7] = PIN_NONE, 6113 - [ 8] = PIN_NONE, 6114 - [ 9] = PIN_NONE, 6115 - [10] = PIN_NONE, 6116 - [11] = PIN_NONE, 6117 - [12] = PIN_NONE, 6118 - [13] = PIN_NONE, 6119 - [14] = PIN_NONE, 6120 - [15] = PIN_NONE, 6121 - [16] = PIN_NONE, 6122 - [17] = PIN_NONE, 6123 - [18] = PIN_NONE, 6124 - [19] = PIN_NONE, 6125 - [20] = PIN_NONE, 6126 - [21] = PIN_NONE, 6127 - [22] = PIN_NONE, 6128 - [23] = PIN_NONE, 6129 - [24] = PIN_NONE, 6130 - [25] = PIN_NONE, 6131 - [26] = PIN_NONE, 6132 - [27] = PIN_NONE, 6133 - [28] = PIN_NONE, 6134 - [29] = PIN_NONE, 6135 - [30] = PIN_NONE, 6136 - [31] = PIN_NONE, 6078 + [ 7] = SH_PFC_PIN_NONE, 6079 + [ 8] = SH_PFC_PIN_NONE, 6080 + [ 9] = SH_PFC_PIN_NONE, 6081 + [10] = SH_PFC_PIN_NONE, 6082 + [11] = SH_PFC_PIN_NONE, 6083 + [12] = SH_PFC_PIN_NONE, 6084 + [13] = SH_PFC_PIN_NONE, 6085 + [14] = SH_PFC_PIN_NONE, 6086 + [15] = SH_PFC_PIN_NONE, 6087 + [16] = SH_PFC_PIN_NONE, 6088 + [17] = SH_PFC_PIN_NONE, 6089 + [18] = SH_PFC_PIN_NONE, 6090 + [19] = SH_PFC_PIN_NONE, 6091 + [20] = SH_PFC_PIN_NONE, 6092 + [21] = SH_PFC_PIN_NONE, 6093 + [22] = SH_PFC_PIN_NONE, 6094 + [23] = SH_PFC_PIN_NONE, 6095 + [24] = SH_PFC_PIN_NONE, 6096 + [25] = SH_PFC_PIN_NONE, 6097 + [26] = SH_PFC_PIN_NONE, 6098 + [27] = SH_PFC_PIN_NONE, 6099 + [28] = SH_PFC_PIN_NONE, 6100 + [29] = SH_PFC_PIN_NONE, 6101 + [30] = SH_PFC_PIN_NONE, 6102 + [31] = SH_PFC_PIN_NONE, 6137 6103 } }, 6138 6104 { /* sentinel */ }, 6139 6105 };
+222 -188
drivers/pinctrl/sh-pfc/pfc-r8a77965.c
··· 18 18 #include "core.h" 19 19 #include "sh_pfc.h" 20 20 21 - #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | \ 22 - SH_PFC_PIN_CFG_PULL_UP | \ 23 - SH_PFC_PIN_CFG_PULL_DOWN) 21 + #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) 24 22 25 - #define CPU_ALL_PORT(fn, sfx) \ 23 + #define CPU_ALL_GP(fn, sfx) \ 26 24 PORT_GP_CFG_16(0, fn, sfx, CFG_FLAGS), \ 27 25 PORT_GP_CFG_29(1, fn, sfx, CFG_FLAGS), \ 28 26 PORT_GP_CFG_15(2, fn, sfx, CFG_FLAGS), \ ··· 33 35 PORT_GP_CFG_26(5, fn, sfx, CFG_FLAGS), \ 34 36 PORT_GP_CFG_32(6, fn, sfx, CFG_FLAGS), \ 35 37 PORT_GP_CFG_4(7, fn, sfx, CFG_FLAGS) 38 + 39 + #define CPU_ALL_NOGP(fn) \ 40 + PIN_NOGP_CFG(ASEBRK, "ASEBRK", fn, CFG_FLAGS), \ 41 + PIN_NOGP_CFG(AVB_MDIO, "AVB_MDIO", fn, CFG_FLAGS), \ 42 + PIN_NOGP_CFG(AVB_RD0, "AVB_RD0", fn, CFG_FLAGS), \ 43 + PIN_NOGP_CFG(AVB_RD1, "AVB_RD1", fn, CFG_FLAGS), \ 44 + PIN_NOGP_CFG(AVB_RD2, "AVB_RD2", fn, CFG_FLAGS), \ 45 + PIN_NOGP_CFG(AVB_RD3, "AVB_RD3", fn, CFG_FLAGS), \ 46 + PIN_NOGP_CFG(AVB_RXC, "AVB_RXC", fn, CFG_FLAGS), \ 47 + PIN_NOGP_CFG(AVB_RX_CTL, "AVB_RX_CTL", fn, CFG_FLAGS), \ 48 + PIN_NOGP_CFG(AVB_TD0, "AVB_TD0", fn, CFG_FLAGS), \ 49 + PIN_NOGP_CFG(AVB_TD1, "AVB_TD1", fn, CFG_FLAGS), \ 50 + PIN_NOGP_CFG(AVB_TD2, "AVB_TD2", fn, CFG_FLAGS), \ 51 + PIN_NOGP_CFG(AVB_TD3, "AVB_TD3", fn, CFG_FLAGS), \ 52 + PIN_NOGP_CFG(AVB_TXC, "AVB_TXC", fn, CFG_FLAGS), \ 53 + PIN_NOGP_CFG(AVB_TXCREFCLK, "AVB_TXCREFCLK", fn, CFG_FLAGS), \ 54 + PIN_NOGP_CFG(AVB_TX_CTL, "AVB_TX_CTL", fn, CFG_FLAGS), \ 55 + PIN_NOGP_CFG(DU_DOTCLKIN0, "DU_DOTCLKIN0", fn, CFG_FLAGS), \ 56 + PIN_NOGP_CFG(DU_DOTCLKIN1, "DU_DOTCLKIN1", fn, CFG_FLAGS), \ 57 + PIN_NOGP_CFG(DU_DOTCLKIN3, "DU_DOTCLKIN3", fn, CFG_FLAGS), \ 58 + PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN),\ 59 + PIN_NOGP_CFG(FSCLKST, "FSCLKST", fn, CFG_FLAGS), \ 60 + PIN_NOGP_CFG(MLB_REF, "MLB_REF", fn, CFG_FLAGS), \ 61 + PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT#", fn, CFG_FLAGS), \ 62 + PIN_NOGP_CFG(QSPI0_IO2, "QSPI0_IO2", fn, CFG_FLAGS), \ 63 + PIN_NOGP_CFG(QSPI0_IO3, "QSPI0_IO3", fn, CFG_FLAGS), \ 64 + PIN_NOGP_CFG(QSPI0_MISO_IO1, "QSPI0_MISO_IO1", fn, CFG_FLAGS), \ 65 + PIN_NOGP_CFG(QSPI0_MOSI_IO0, "QSPI0_MOSI_IO0", fn, CFG_FLAGS), \ 66 + PIN_NOGP_CFG(QSPI0_SPCLK, "QSPI0_SPCLK", fn, CFG_FLAGS), \ 67 + PIN_NOGP_CFG(QSPI0_SSL, "QSPI0_SSL", fn, CFG_FLAGS), \ 68 + PIN_NOGP_CFG(QSPI1_IO2, "QSPI1_IO2", fn, CFG_FLAGS), \ 69 + PIN_NOGP_CFG(QSPI1_IO3, "QSPI1_IO3", fn, CFG_FLAGS), \ 70 + PIN_NOGP_CFG(QSPI1_MISO_IO1, "QSPI1_MISO_IO1", fn, CFG_FLAGS), \ 71 + PIN_NOGP_CFG(QSPI1_MOSI_IO0, "QSPI1_MOSI_IO0", fn, CFG_FLAGS), \ 72 + PIN_NOGP_CFG(QSPI1_SPCLK, "QSPI1_SPCLK", fn, CFG_FLAGS), \ 73 + PIN_NOGP_CFG(QSPI1_SSL, "QSPI1_SSL", fn, CFG_FLAGS), \ 74 + PIN_NOGP_CFG(RPC_INT_N, "RPC_INT#", fn, CFG_FLAGS), \ 75 + PIN_NOGP_CFG(RPC_RESET_N, "RPC_RESET#", fn, CFG_FLAGS), \ 76 + PIN_NOGP_CFG(RPC_WP_N, "RPC_WP#", fn, CFG_FLAGS), \ 77 + PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 78 + PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN), \ 79 + PIN_NOGP_CFG(TDO, "TDO", fn, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 80 + PIN_NOGP_CFG(TMS, "TMS", fn, CFG_FLAGS), \ 81 + PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN) 82 + 36 83 /* 37 84 * F_() : just information 38 85 * FM() : macro for FN_xxx / xxx_MARK ··· 1560 1517 }; 1561 1518 1562 1519 /* 1563 - * R8A77965 has 8 banks with 32 GPIOs in each => 256 GPIOs. 1564 - * Physical layout rows: A - AW, cols: 1 - 39. 1520 + * Pins not associated with a GPIO port. 1565 1521 */ 1566 - #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1567 - #define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300) 1568 - #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1569 - #define PIN_NONE U16_MAX 1522 + enum { 1523 + GP_ASSIGN_LAST(), 1524 + NOGP_ALL(), 1525 + }; 1570 1526 1571 1527 static const struct sh_pfc_pin pinmux_pins[] = { 1572 1528 PINMUX_GPIO_GP_ALL(), 1573 - 1574 - /* 1575 - * Pins not associated with a GPIO port. 1576 - * 1577 - * The pin positions are different between different r8a77965 1578 - * packages, all that is needed for the pfc driver is a unique 1579 - * number for each pin. To this end use the pin layout from 1580 - * R-Car M3SiP to calculate a unique number for each pin. 1581 - */ 1582 - SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, CFG_FLAGS), 1583 - SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, CFG_FLAGS), 1584 - SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, CFG_FLAGS), 1585 - SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, CFG_FLAGS), 1586 - SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, CFG_FLAGS), 1587 - SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, CFG_FLAGS), 1588 - SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, CFG_FLAGS), 1589 - SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, CFG_FLAGS), 1590 - SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, CFG_FLAGS), 1591 - SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, CFG_FLAGS), 1592 - SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, CFG_FLAGS), 1593 - SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, CFG_FLAGS), 1594 - SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, CFG_FLAGS), 1595 - SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, CFG_FLAGS), 1596 - SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, CFG_FLAGS), 1597 - SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, CFG_FLAGS), 1598 - SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, CFG_FLAGS), 1599 - SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, CFG_FLAGS), 1600 - SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, CFG_FLAGS), 1601 - SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, CFG_FLAGS), 1602 - SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, CFG_FLAGS), 1603 - SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, CFG_FLAGS), 1604 - SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, CFG_FLAGS), 1605 - SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, CFG_FLAGS), 1606 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, CFG_FLAGS), 1607 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, CFG_FLAGS), 1608 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, CFG_FLAGS), 1609 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, CFG_FLAGS), 1610 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, CFG_FLAGS), 1611 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST, CFG_FLAGS), 1612 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 39, EXTALR, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1613 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, CFG_FLAGS), 1614 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, CFG_FLAGS), 1615 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, CFG_FLAGS), 1616 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, CFG_FLAGS), 1617 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN3, CFG_FLAGS), 1618 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 26, TRST#, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1619 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 29, TDI, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1620 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, CFG_FLAGS), 1621 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN), 1622 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH), 1623 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS), 1529 + PINMUX_NOGP_ALL(), 1624 1530 }; 1625 1531 1626 1532 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 1718 1726 }; 1719 1727 static const unsigned int avb_mdio_pins[] = { 1720 1728 /* AVB_MDC, AVB_MDIO */ 1721 - RCAR_GP_PIN(2, 9), PIN_NUMBER('A', 9), 1729 + RCAR_GP_PIN(2, 9), PIN_AVB_MDIO, 1722 1730 }; 1723 1731 static const unsigned int avb_mdio_mux[] = { 1724 1732 AVB_MDC_MARK, AVB_MDIO_MARK, ··· 1731 1739 * AVB_RD1, AVB_RD2, AVB_RD3, 1732 1740 * AVB_TXCREFCLK 1733 1741 */ 1734 - PIN_NUMBER('A', 8), PIN_NUMBER('A', 19), PIN_NUMBER('A', 18), 1735 - PIN_NUMBER('B', 18), PIN_NUMBER('A', 17), PIN_NUMBER('B', 17), 1736 - PIN_NUMBER('A', 16), PIN_NUMBER('B', 19), PIN_NUMBER('A', 13), 1737 - PIN_NUMBER('B', 13), PIN_NUMBER('A', 14), PIN_NUMBER('B', 14), 1738 - PIN_NUMBER('A', 12), 1742 + PIN_AVB_TX_CTL, PIN_AVB_TXC, PIN_AVB_TD0, 1743 + PIN_AVB_TD1, PIN_AVB_TD2, PIN_AVB_TD3, 1744 + PIN_AVB_RX_CTL, PIN_AVB_RXC, PIN_AVB_RD0, 1745 + PIN_AVB_RD1, PIN_AVB_RD2, PIN_AVB_RD3, 1746 + PIN_AVB_TXCREFCLK, 1739 1747 1740 1748 }; 1741 1749 static const unsigned int avb_mii_mux[] = { ··· 4108 4116 TCLK2_B_MARK, 4109 4117 }; 4110 4118 4119 + /* - TPU ------------------------------------------------------------------- */ 4120 + static const unsigned int tpu_to0_pins[] = { 4121 + /* TPU0TO0 */ 4122 + RCAR_GP_PIN(6, 28), 4123 + }; 4124 + static const unsigned int tpu_to0_mux[] = { 4125 + TPU0TO0_MARK, 4126 + }; 4127 + static const unsigned int tpu_to1_pins[] = { 4128 + /* TPU0TO1 */ 4129 + RCAR_GP_PIN(6, 29), 4130 + }; 4131 + static const unsigned int tpu_to1_mux[] = { 4132 + TPU0TO1_MARK, 4133 + }; 4134 + static const unsigned int tpu_to2_pins[] = { 4135 + /* TPU0TO2 */ 4136 + RCAR_GP_PIN(6, 30), 4137 + }; 4138 + static const unsigned int tpu_to2_mux[] = { 4139 + TPU0TO2_MARK, 4140 + }; 4141 + static const unsigned int tpu_to3_pins[] = { 4142 + /* TPU0TO3 */ 4143 + RCAR_GP_PIN(6, 31), 4144 + }; 4145 + static const unsigned int tpu_to3_mux[] = { 4146 + TPU0TO3_MARK, 4147 + }; 4148 + 4111 4149 /* - USB0 ------------------------------------------------------------------- */ 4112 4150 static const unsigned int usb0_pins[] = { 4113 4151 /* PWEN, OVC */ ··· 4694 4672 SH_PFC_PIN_GROUP(tmu_tclk1_b), 4695 4673 SH_PFC_PIN_GROUP(tmu_tclk2_a), 4696 4674 SH_PFC_PIN_GROUP(tmu_tclk2_b), 4675 + SH_PFC_PIN_GROUP(tpu_to0), 4676 + SH_PFC_PIN_GROUP(tpu_to1), 4677 + SH_PFC_PIN_GROUP(tpu_to2), 4678 + SH_PFC_PIN_GROUP(tpu_to3), 4697 4679 SH_PFC_PIN_GROUP(usb0), 4698 4680 SH_PFC_PIN_GROUP(usb1), 4699 4681 SH_PFC_PIN_GROUP(usb30), ··· 5190 5164 "tmu_tclk2_b", 5191 5165 }; 5192 5166 5167 + static const char * const tpu_groups[] = { 5168 + "tpu_to0", 5169 + "tpu_to1", 5170 + "tpu_to2", 5171 + "tpu_to3", 5172 + }; 5173 + 5193 5174 static const char * const usb0_groups[] = { 5194 5175 "usb0", 5195 5176 }; ··· 5291 5258 SH_PFC_FUNCTION(sdhi3), 5292 5259 SH_PFC_FUNCTION(ssi), 5293 5260 SH_PFC_FUNCTION(tmu), 5261 + SH_PFC_FUNCTION(tpu), 5294 5262 SH_PFC_FUNCTION(usb0), 5295 5263 SH_PFC_FUNCTION(usb1), 5296 5264 SH_PFC_FUNCTION(usb30), ··· 5864 5830 5865 5831 static const struct pinmux_drive_reg pinmux_drive_regs[] = { 5866 5832 { PINMUX_DRIVE_REG("DRVCTRL0", 0xe6060300) { 5867 - { PIN_NUMBER('W', 3), 28, 2 }, /* QSPI0_SPCLK */ 5868 - { PIN_A_NUMBER('C', 5), 24, 2 }, /* QSPI0_MOSI_IO0 */ 5869 - { PIN_A_NUMBER('B', 4), 20, 2 }, /* QSPI0_MISO_IO1 */ 5870 - { PIN_NUMBER('Y', 6), 16, 2 }, /* QSPI0_IO2 */ 5871 - { PIN_A_NUMBER('B', 6), 12, 2 }, /* QSPI0_IO3 */ 5872 - { PIN_NUMBER('Y', 3), 8, 2 }, /* QSPI0_SSL */ 5873 - { PIN_NUMBER('V', 3), 4, 2 }, /* QSPI1_SPCLK */ 5874 - { PIN_A_NUMBER('C', 7), 0, 2 }, /* QSPI1_MOSI_IO0 */ 5833 + { PIN_QSPI0_SPCLK, 28, 2 }, /* QSPI0_SPCLK */ 5834 + { PIN_QSPI0_MOSI_IO0, 24, 2 }, /* QSPI0_MOSI_IO0 */ 5835 + { PIN_QSPI0_MISO_IO1, 20, 2 }, /* QSPI0_MISO_IO1 */ 5836 + { PIN_QSPI0_IO2, 16, 2 }, /* QSPI0_IO2 */ 5837 + { PIN_QSPI0_IO3, 12, 2 }, /* QSPI0_IO3 */ 5838 + { PIN_QSPI0_SSL, 8, 2 }, /* QSPI0_SSL */ 5839 + { PIN_QSPI1_SPCLK, 4, 2 }, /* QSPI1_SPCLK */ 5840 + { PIN_QSPI1_MOSI_IO0, 0, 2 }, /* QSPI1_MOSI_IO0 */ 5875 5841 } }, 5876 5842 { PINMUX_DRIVE_REG("DRVCTRL1", 0xe6060304) { 5877 - { PIN_A_NUMBER('E', 5), 28, 2 }, /* QSPI1_MISO_IO1 */ 5878 - { PIN_A_NUMBER('E', 4), 24, 2 }, /* QSPI1_IO2 */ 5879 - { PIN_A_NUMBER('C', 3), 20, 2 }, /* QSPI1_IO3 */ 5880 - { PIN_NUMBER('V', 5), 16, 2 }, /* QSPI1_SSL */ 5881 - { PIN_NUMBER('Y', 7), 12, 2 }, /* RPC_INT# */ 5882 - { PIN_NUMBER('V', 6), 8, 2 }, /* RPC_WP# */ 5883 - { PIN_NUMBER('V', 7), 4, 2 }, /* RPC_RESET# */ 5884 - { PIN_NUMBER('A', 16), 0, 3 }, /* AVB_RX_CTL */ 5843 + { PIN_QSPI1_MISO_IO1, 28, 2 }, /* QSPI1_MISO_IO1 */ 5844 + { PIN_QSPI1_IO2, 24, 2 }, /* QSPI1_IO2 */ 5845 + { PIN_QSPI1_IO3, 20, 2 }, /* QSPI1_IO3 */ 5846 + { PIN_QSPI1_SSL, 16, 2 }, /* QSPI1_SSL */ 5847 + { PIN_RPC_INT_N, 12, 2 }, /* RPC_INT# */ 5848 + { PIN_RPC_WP_N, 8, 2 }, /* RPC_WP# */ 5849 + { PIN_RPC_RESET_N, 4, 2 }, /* RPC_RESET# */ 5850 + { PIN_AVB_RX_CTL, 0, 3 }, /* AVB_RX_CTL */ 5885 5851 } }, 5886 5852 { PINMUX_DRIVE_REG("DRVCTRL2", 0xe6060308) { 5887 - { PIN_NUMBER('B', 19), 28, 3 }, /* AVB_RXC */ 5888 - { PIN_NUMBER('A', 13), 24, 3 }, /* AVB_RD0 */ 5889 - { PIN_NUMBER('B', 13), 20, 3 }, /* AVB_RD1 */ 5890 - { PIN_NUMBER('A', 14), 16, 3 }, /* AVB_RD2 */ 5891 - { PIN_NUMBER('B', 14), 12, 3 }, /* AVB_RD3 */ 5892 - { PIN_NUMBER('A', 8), 8, 3 }, /* AVB_TX_CTL */ 5893 - { PIN_NUMBER('A', 19), 4, 3 }, /* AVB_TXC */ 5894 - { PIN_NUMBER('A', 18), 0, 3 }, /* AVB_TD0 */ 5853 + { PIN_AVB_RXC, 28, 3 }, /* AVB_RXC */ 5854 + { PIN_AVB_RD0, 24, 3 }, /* AVB_RD0 */ 5855 + { PIN_AVB_RD1, 20, 3 }, /* AVB_RD1 */ 5856 + { PIN_AVB_RD2, 16, 3 }, /* AVB_RD2 */ 5857 + { PIN_AVB_RD3, 12, 3 }, /* AVB_RD3 */ 5858 + { PIN_AVB_TX_CTL, 8, 3 }, /* AVB_TX_CTL */ 5859 + { PIN_AVB_TXC, 4, 3 }, /* AVB_TXC */ 5860 + { PIN_AVB_TD0, 0, 3 }, /* AVB_TD0 */ 5895 5861 } }, 5896 5862 { PINMUX_DRIVE_REG("DRVCTRL3", 0xe606030c) { 5897 - { PIN_NUMBER('B', 18), 28, 3 }, /* AVB_TD1 */ 5898 - { PIN_NUMBER('A', 17), 24, 3 }, /* AVB_TD2 */ 5899 - { PIN_NUMBER('B', 17), 20, 3 }, /* AVB_TD3 */ 5900 - { PIN_NUMBER('A', 12), 16, 3 }, /* AVB_TXCREFCLK */ 5901 - { PIN_NUMBER('A', 9), 12, 3 }, /* AVB_MDIO */ 5902 - { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5903 - { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5904 - { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5863 + { PIN_AVB_TD1, 28, 3 }, /* AVB_TD1 */ 5864 + { PIN_AVB_TD2, 24, 3 }, /* AVB_TD2 */ 5865 + { PIN_AVB_TD3, 20, 3 }, /* AVB_TD3 */ 5866 + { PIN_AVB_TXCREFCLK, 16, 3 }, /* AVB_TXCREFCLK */ 5867 + { PIN_AVB_MDIO, 12, 3 }, /* AVB_MDIO */ 5868 + { RCAR_GP_PIN(2, 9), 8, 3 }, /* AVB_MDC */ 5869 + { RCAR_GP_PIN(2, 10), 4, 3 }, /* AVB_MAGIC */ 5870 + { RCAR_GP_PIN(2, 11), 0, 3 }, /* AVB_PHY_INT */ 5905 5871 } }, 5906 5872 { PINMUX_DRIVE_REG("DRVCTRL4", 0xe6060310) { 5907 5873 { RCAR_GP_PIN(2, 12), 28, 3 }, /* AVB_LINK */ ··· 5955 5921 } }, 5956 5922 { PINMUX_DRIVE_REG("DRVCTRL9", 0xe6060324) { 5957 5923 { RCAR_GP_PIN(1, 27), 28, 3 }, /* EX_WAIT0 */ 5958 - { PIN_NUMBER('C', 1), 24, 3 }, /* PRESETOUT# */ 5924 + { PIN_PRESETOUT_N, 24, 3 }, /* PRESETOUT# */ 5959 5925 { RCAR_GP_PIN(0, 0), 20, 3 }, /* D0 */ 5960 5926 { RCAR_GP_PIN(0, 1), 16, 3 }, /* D1 */ 5961 5927 { RCAR_GP_PIN(0, 2), 12, 3 }, /* D2 */ ··· 5974 5940 { RCAR_GP_PIN(0, 13), 0, 3 }, /* D13 */ 5975 5941 } }, 5976 5942 { PINMUX_DRIVE_REG("DRVCTRL11", 0xe606032c) { 5977 - { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5978 - { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5979 - { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5980 - { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5981 - { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5982 - { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5983 - { PIN_A_NUMBER('P', 7), 4, 2 }, /* DU_DOTCLKIN0 */ 5984 - { PIN_A_NUMBER('P', 8), 0, 2 }, /* DU_DOTCLKIN1 */ 5943 + { RCAR_GP_PIN(0, 14), 28, 3 }, /* D14 */ 5944 + { RCAR_GP_PIN(0, 15), 24, 3 }, /* D15 */ 5945 + { RCAR_GP_PIN(7, 0), 20, 3 }, /* AVS1 */ 5946 + { RCAR_GP_PIN(7, 1), 16, 3 }, /* AVS2 */ 5947 + { RCAR_GP_PIN(7, 2), 12, 3 }, /* GP7_02 */ 5948 + { RCAR_GP_PIN(7, 3), 8, 3 }, /* GP7_03 */ 5949 + { PIN_DU_DOTCLKIN0, 4, 2 }, /* DU_DOTCLKIN0 */ 5950 + { PIN_DU_DOTCLKIN1, 0, 2 }, /* DU_DOTCLKIN1 */ 5985 5951 } }, 5986 5952 { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) { 5987 - { PIN_A_NUMBER('R', 8), 28, 2 }, /* DU_DOTCLKIN3 */ 5988 - { PIN_A_NUMBER('D', 38), 20, 2 }, /* FSCLKST */ 5989 - { PIN_A_NUMBER('R', 30), 4, 2 }, /* TMS */ 5953 + { PIN_DU_DOTCLKIN3, 28, 2 }, /* DU_DOTCLKIN3 */ 5954 + { PIN_FSCLKST, 20, 2 }, /* FSCLKST */ 5955 + { PIN_TMS, 4, 2 }, /* TMS */ 5990 5956 } }, 5991 5957 { PINMUX_DRIVE_REG("DRVCTRL13", 0xe6060334) { 5992 - { PIN_A_NUMBER('T', 28), 28, 2 }, /* TDO */ 5993 - { PIN_A_NUMBER('T', 30), 24, 2 }, /* ASEBRK */ 5994 - { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5995 - { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5996 - { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5997 - { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5998 - { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5999 - { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 5958 + { PIN_TDO, 28, 2 }, /* TDO */ 5959 + { PIN_ASEBRK, 24, 2 }, /* ASEBRK */ 5960 + { RCAR_GP_PIN(3, 0), 20, 3 }, /* SD0_CLK */ 5961 + { RCAR_GP_PIN(3, 1), 16, 3 }, /* SD0_CMD */ 5962 + { RCAR_GP_PIN(3, 2), 12, 3 }, /* SD0_DAT0 */ 5963 + { RCAR_GP_PIN(3, 3), 8, 3 }, /* SD0_DAT1 */ 5964 + { RCAR_GP_PIN(3, 4), 4, 3 }, /* SD0_DAT2 */ 5965 + { RCAR_GP_PIN(3, 5), 0, 3 }, /* SD0_DAT3 */ 6000 5966 } }, 6001 5967 { PINMUX_DRIVE_REG("DRVCTRL14", 0xe6060338) { 6002 5968 { RCAR_GP_PIN(3, 6), 28, 3 }, /* SD1_CLK */ ··· 6065 6031 { RCAR_GP_PIN(5, 23), 16, 3 }, /* MLB_CLK */ 6066 6032 { RCAR_GP_PIN(5, 24), 12, 3 }, /* MLB_SIG */ 6067 6033 { RCAR_GP_PIN(5, 25), 8, 3 }, /* MLB_DAT */ 6068 - { PIN_NUMBER('H', 37), 4, 3 }, /* MLB_REF */ 6034 + { PIN_MLB_REF, 4, 3 }, /* MLB_REF */ 6069 6035 { RCAR_GP_PIN(6, 0), 0, 3 }, /* SSI_SCK01239 */ 6070 6036 } }, 6071 6037 { PINMUX_DRIVE_REG("DRVCTRL21", 0xe6060354) { ··· 6138 6104 6139 6105 static const struct pinmux_bias_reg pinmux_bias_regs[] = { 6140 6106 { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { 6141 - [ 0] = PIN_NUMBER('W', 3), /* QSPI0_SPCLK */ 6142 - [ 1] = PIN_A_NUMBER('C', 5), /* QSPI0_MOSI_IO0 */ 6143 - [ 2] = PIN_A_NUMBER('B', 4), /* QSPI0_MISO_IO1 */ 6144 - [ 3] = PIN_NUMBER('Y', 6), /* QSPI0_IO2 */ 6145 - [ 4] = PIN_A_NUMBER('B', 6), /* QSPI0_IO3 */ 6146 - [ 5] = PIN_NUMBER('Y', 3), /* QSPI0_SSL */ 6147 - [ 6] = PIN_NUMBER('V', 3), /* QSPI1_SPCLK */ 6148 - [ 7] = PIN_A_NUMBER('C', 7), /* QSPI1_MOSI_IO0 */ 6149 - [ 8] = PIN_A_NUMBER('E', 5), /* QSPI1_MISO_IO1 */ 6150 - [ 9] = PIN_A_NUMBER('E', 4), /* QSPI1_IO2 */ 6151 - [10] = PIN_A_NUMBER('C', 3), /* QSPI1_IO3 */ 6152 - [11] = PIN_NUMBER('V', 5), /* QSPI1_SSL */ 6153 - [12] = PIN_NUMBER('Y', 7), /* RPC_INT# */ 6154 - [13] = PIN_NUMBER('V', 6), /* RPC_WP# */ 6155 - [14] = PIN_NUMBER('V', 7), /* RPC_RESET# */ 6156 - [15] = PIN_NUMBER('A', 16), /* AVB_RX_CTL */ 6157 - [16] = PIN_NUMBER('B', 19), /* AVB_RXC */ 6158 - [17] = PIN_NUMBER('A', 13), /* AVB_RD0 */ 6159 - [18] = PIN_NUMBER('B', 13), /* AVB_RD1 */ 6160 - [19] = PIN_NUMBER('A', 14), /* AVB_RD2 */ 6161 - [20] = PIN_NUMBER('B', 14), /* AVB_RD3 */ 6162 - [21] = PIN_NUMBER('A', 8), /* AVB_TX_CTL */ 6163 - [22] = PIN_NUMBER('A', 19), /* AVB_TXC */ 6164 - [23] = PIN_NUMBER('A', 18), /* AVB_TD0 */ 6165 - [24] = PIN_NUMBER('B', 18), /* AVB_TD1 */ 6166 - [25] = PIN_NUMBER('A', 17), /* AVB_TD2 */ 6167 - [26] = PIN_NUMBER('B', 17), /* AVB_TD3 */ 6168 - [27] = PIN_NUMBER('A', 12), /* AVB_TXCREFCLK */ 6169 - [28] = PIN_NUMBER('A', 9), /* AVB_MDIO */ 6107 + [ 0] = PIN_QSPI0_SPCLK, /* QSPI0_SPCLK */ 6108 + [ 1] = PIN_QSPI0_MOSI_IO0, /* QSPI0_MOSI_IO0 */ 6109 + [ 2] = PIN_QSPI0_MISO_IO1, /* QSPI0_MISO_IO1 */ 6110 + [ 3] = PIN_QSPI0_IO2, /* QSPI0_IO2 */ 6111 + [ 4] = PIN_QSPI0_IO3, /* QSPI0_IO3 */ 6112 + [ 5] = PIN_QSPI0_SSL, /* QSPI0_SSL */ 6113 + [ 6] = PIN_QSPI1_SPCLK, /* QSPI1_SPCLK */ 6114 + [ 7] = PIN_QSPI1_MOSI_IO0, /* QSPI1_MOSI_IO0 */ 6115 + [ 8] = PIN_QSPI1_MISO_IO1, /* QSPI1_MISO_IO1 */ 6116 + [ 9] = PIN_QSPI1_IO2, /* QSPI1_IO2 */ 6117 + [10] = PIN_QSPI1_IO3, /* QSPI1_IO3 */ 6118 + [11] = PIN_QSPI1_SSL, /* QSPI1_SSL */ 6119 + [12] = PIN_RPC_INT_N, /* RPC_INT# */ 6120 + [13] = PIN_RPC_WP_N, /* RPC_WP# */ 6121 + [14] = PIN_RPC_RESET_N, /* RPC_RESET# */ 6122 + [15] = PIN_AVB_RX_CTL, /* AVB_RX_CTL */ 6123 + [16] = PIN_AVB_RXC, /* AVB_RXC */ 6124 + [17] = PIN_AVB_RD0, /* AVB_RD0 */ 6125 + [18] = PIN_AVB_RD1, /* AVB_RD1 */ 6126 + [19] = PIN_AVB_RD2, /* AVB_RD2 */ 6127 + [20] = PIN_AVB_RD3, /* AVB_RD3 */ 6128 + [21] = PIN_AVB_TX_CTL, /* AVB_TX_CTL */ 6129 + [22] = PIN_AVB_TXC, /* AVB_TXC */ 6130 + [23] = PIN_AVB_TD0, /* AVB_TD0 */ 6131 + [24] = PIN_AVB_TD1, /* AVB_TD1 */ 6132 + [25] = PIN_AVB_TD2, /* AVB_TD2 */ 6133 + [26] = PIN_AVB_TD3, /* AVB_TD3 */ 6134 + [27] = PIN_AVB_TXCREFCLK, /* AVB_TXCREFCLK */ 6135 + [28] = PIN_AVB_MDIO, /* AVB_MDIO */ 6170 6136 [29] = RCAR_GP_PIN(2, 9), /* AVB_MDC */ 6171 6137 [30] = RCAR_GP_PIN(2, 10), /* AVB_MAGIC */ 6172 6138 [31] = RCAR_GP_PIN(2, 11), /* AVB_PHY_INT */ ··· 6215 6181 [ 6] = RCAR_GP_PIN(1, 25), /* WE0_N */ 6216 6182 [ 7] = RCAR_GP_PIN(1, 26), /* WE1_N */ 6217 6183 [ 8] = RCAR_GP_PIN(1, 27), /* EX_WAIT0_A */ 6218 - [ 9] = PIN_NUMBER('C', 1), /* PRESETOUT# */ 6184 + [ 9] = PIN_PRESETOUT_N, /* PRESETOUT# */ 6219 6185 [10] = RCAR_GP_PIN(0, 0), /* D0 */ 6220 6186 [11] = RCAR_GP_PIN(0, 1), /* D1 */ 6221 6187 [12] = RCAR_GP_PIN(0, 2), /* D2 */ ··· 6236 6202 [27] = RCAR_GP_PIN(7, 1), /* AVS2 */ 6237 6203 [28] = RCAR_GP_PIN(7, 2), /* GP7_02 */ 6238 6204 [29] = RCAR_GP_PIN(7, 3), /* GP7_03 */ 6239 - [30] = PIN_A_NUMBER('P', 7), /* DU_DOTCLKIN0 */ 6240 - [31] = PIN_A_NUMBER('P', 8), /* DU_DOTCLKIN1 */ 6205 + [30] = PIN_DU_DOTCLKIN0, /* DU_DOTCLKIN0 */ 6206 + [31] = PIN_DU_DOTCLKIN1, /* DU_DOTCLKIN1 */ 6241 6207 } }, 6242 6208 { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 6243 - [ 0] = PIN_A_NUMBER('R', 8), /* DU_DOTCLKIN3 */ 6244 - [ 1] = PIN_NONE, 6245 - [ 2] = PIN_A_NUMBER('D', 38), /* FSCLKST */ 6246 - [ 3] = PIN_A_NUMBER('D', 39), /* EXTALR*/ 6247 - [ 4] = PIN_A_NUMBER('R', 26), /* TRST# */ 6248 - [ 5] = PIN_A_NUMBER('T', 27), /* TCK */ 6249 - [ 6] = PIN_A_NUMBER('R', 30), /* TMS */ 6250 - [ 7] = PIN_A_NUMBER('R', 29), /* TDI */ 6251 - [ 8] = PIN_NONE, 6252 - [ 9] = PIN_A_NUMBER('T', 30), /* ASEBRK */ 6209 + [ 0] = PIN_DU_DOTCLKIN3, /* DU_DOTCLKIN3 */ 6210 + [ 1] = SH_PFC_PIN_NONE, 6211 + [ 2] = PIN_FSCLKST, /* FSCLKST */ 6212 + [ 3] = PIN_EXTALR, /* EXTALR*/ 6213 + [ 4] = PIN_TRST_N, /* TRST# */ 6214 + [ 5] = PIN_TCK, /* TCK */ 6215 + [ 6] = PIN_TMS, /* TMS */ 6216 + [ 7] = PIN_TDI, /* TDI */ 6217 + [ 8] = SH_PFC_PIN_NONE, 6218 + [ 9] = PIN_ASEBRK, /* ASEBRK */ 6253 6219 [10] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 6254 6220 [11] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 6255 6221 [12] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */ ··· 6314 6280 [ 3] = RCAR_GP_PIN(5, 23), /* MLB_CLK */ 6315 6281 [ 4] = RCAR_GP_PIN(5, 24), /* MLB_SIG */ 6316 6282 [ 5] = RCAR_GP_PIN(5, 25), /* MLB_DAT */ 6317 - [ 6] = PIN_NUMBER('H', 37), /* MLB_REF */ 6283 + [ 6] = PIN_MLB_REF, /* MLB_REF */ 6318 6284 [ 7] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 6319 6285 [ 8] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 6320 6286 [ 9] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ ··· 6349 6315 [ 4] = RCAR_GP_PIN(6, 29), /* USB30_OVC */ 6350 6316 [ 5] = RCAR_GP_PIN(6, 30), /* GP6_30 */ 6351 6317 [ 6] = RCAR_GP_PIN(6, 31), /* GP6_31 */ 6352 - [ 7] = PIN_NONE, 6353 - [ 8] = PIN_NONE, 6354 - [ 9] = PIN_NONE, 6355 - [10] = PIN_NONE, 6356 - [11] = PIN_NONE, 6357 - [12] = PIN_NONE, 6358 - [13] = PIN_NONE, 6359 - [14] = PIN_NONE, 6360 - [15] = PIN_NONE, 6361 - [16] = PIN_NONE, 6362 - [17] = PIN_NONE, 6363 - [18] = PIN_NONE, 6364 - [19] = PIN_NONE, 6365 - [20] = PIN_NONE, 6366 - [21] = PIN_NONE, 6367 - [22] = PIN_NONE, 6368 - [23] = PIN_NONE, 6369 - [24] = PIN_NONE, 6370 - [25] = PIN_NONE, 6371 - [26] = PIN_NONE, 6372 - [27] = PIN_NONE, 6373 - [28] = PIN_NONE, 6374 - [29] = PIN_NONE, 6375 - [30] = PIN_NONE, 6376 - [31] = PIN_NONE, 6318 + [ 7] = SH_PFC_PIN_NONE, 6319 + [ 8] = SH_PFC_PIN_NONE, 6320 + [ 9] = SH_PFC_PIN_NONE, 6321 + [10] = SH_PFC_PIN_NONE, 6322 + [11] = SH_PFC_PIN_NONE, 6323 + [12] = SH_PFC_PIN_NONE, 6324 + [13] = SH_PFC_PIN_NONE, 6325 + [14] = SH_PFC_PIN_NONE, 6326 + [15] = SH_PFC_PIN_NONE, 6327 + [16] = SH_PFC_PIN_NONE, 6328 + [17] = SH_PFC_PIN_NONE, 6329 + [18] = SH_PFC_PIN_NONE, 6330 + [19] = SH_PFC_PIN_NONE, 6331 + [20] = SH_PFC_PIN_NONE, 6332 + [21] = SH_PFC_PIN_NONE, 6333 + [22] = SH_PFC_PIN_NONE, 6334 + [23] = SH_PFC_PIN_NONE, 6335 + [24] = SH_PFC_PIN_NONE, 6336 + [25] = SH_PFC_PIN_NONE, 6337 + [26] = SH_PFC_PIN_NONE, 6338 + [27] = SH_PFC_PIN_NONE, 6339 + [28] = SH_PFC_PIN_NONE, 6340 + [29] = SH_PFC_PIN_NONE, 6341 + [30] = SH_PFC_PIN_NONE, 6342 + [31] = SH_PFC_PIN_NONE, 6377 6343 } }, 6378 6344 { /* sentinel */ }, 6379 6345 };
+3 -23
drivers/pinctrl/sh-pfc/pfc-r8a77970.c
··· 19 19 #include "core.h" 20 20 #include "sh_pfc.h" 21 21 22 - #define CPU_ALL_PORT(fn, sfx) \ 22 + #define CPU_ALL_GP(fn, sfx) \ 23 23 PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \ 24 24 PORT_GP_28(1, fn, sfx), \ 25 25 PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \ ··· 205 205 #define IP6_19_16 FM(VI1_DATA8) F_(0, 0) FM(CTS4_N) FM(D11) FM(MMC_D5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 206 206 #define IP6_23_20 FM(VI1_DATA9) F_(0, 0) FM(RTS4_N) FM(D12) FM(MMC_D6) FM(SCL3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 207 207 #define IP6_27_24 FM(VI1_DATA10) F_(0, 0) F_(0, 0) FM(D13) FM(MMC_D7) FM(SDA3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 208 - #define IP6_31_28 FM(VI1_DATA11) FM(SCL4) FM(IRQ4) FM(D14) FM(MMC_WP) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 209 - #define IP7_3_0 FM(VI1_FIELD) FM(SDA4) FM(IRQ5) FM(D15) FM(MMC_CD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 208 + #define IP6_31_28 FM(VI1_DATA11) FM(SCL4) FM(IRQ4) FM(D14) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 209 + #define IP7_3_0 FM(VI1_FIELD) FM(SDA4) FM(IRQ5) FM(D15) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 210 210 #define IP7_7_4 FM(SCL0) FM(DU_DR0) FM(TPU0TO0) FM(CLKOUT) F_(0, 0) FM(MSIOF0_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 211 211 #define IP7_11_8 FM(SDA0) FM(DU_DR1) FM(TPU0TO1) FM(BS_N) FM(SCK0) FM(MSIOF0_TXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 212 212 #define IP7_15_12 FM(SCL1) FM(DU_DG0) FM(TPU0TO2) FM(RD_N) FM(CTS0_N) FM(MSIOF0_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) ··· 631 631 PINMUX_IPSR_GPSR(IP6_31_28, SCL4), 632 632 PINMUX_IPSR_GPSR(IP6_31_28, IRQ4), 633 633 PINMUX_IPSR_GPSR(IP6_31_28, D14), 634 - PINMUX_IPSR_GPSR(IP6_31_28, MMC_WP), 635 634 636 635 /* IPSR7 */ 637 636 PINMUX_IPSR_GPSR(IP7_3_0, VI1_FIELD), 638 637 PINMUX_IPSR_GPSR(IP7_3_0, SDA4), 639 638 PINMUX_IPSR_GPSR(IP7_3_0, IRQ5), 640 639 PINMUX_IPSR_GPSR(IP7_3_0, D15), 641 - PINMUX_IPSR_GPSR(IP7_3_0, MMC_CD), 642 640 643 641 PINMUX_IPSR_GPSR(IP7_7_4, SCL0), 644 642 PINMUX_IPSR_GPSR(IP7_7_4, DU_DR0), ··· 1118 1120 }; 1119 1121 static const unsigned int mmc_ctrl_mux[] = { 1120 1122 MMC_CLK_MARK, MMC_CMD_MARK, 1121 - }; 1122 - static const unsigned int mmc_cd_pins[] = { 1123 - /* CD */ 1124 - RCAR_GP_PIN(3, 16), 1125 - }; 1126 - static const unsigned int mmc_cd_mux[] = { 1127 - MMC_CD_MARK, 1128 - }; 1129 - static const unsigned int mmc_wp_pins[] = { 1130 - /* WP */ 1131 - RCAR_GP_PIN(3, 15), 1132 - }; 1133 - static const unsigned int mmc_wp_mux[] = { 1134 - MMC_WP_MARK, 1135 1123 }; 1136 1124 1137 1125 /* - MSIOF0 ----------------------------------------------------------------- */ ··· 1710 1726 SH_PFC_PIN_GROUP(mmc_data4), 1711 1727 SH_PFC_PIN_GROUP(mmc_data8), 1712 1728 SH_PFC_PIN_GROUP(mmc_ctrl), 1713 - SH_PFC_PIN_GROUP(mmc_cd), 1714 - SH_PFC_PIN_GROUP(mmc_wp), 1715 1729 SH_PFC_PIN_GROUP(msiof0_clk), 1716 1730 SH_PFC_PIN_GROUP(msiof0_sync), 1717 1731 SH_PFC_PIN_GROUP(msiof0_ss1), ··· 1879 1897 "mmc_data4", 1880 1898 "mmc_data8", 1881 1899 "mmc_ctrl", 1882 - "mmc_cd", 1883 - "mmc_wp", 1884 1900 }; 1885 1901 1886 1902 static const char * const msiof0_groups[] = {
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a77980.c
··· 19 19 #include "core.h" 20 20 #include "sh_pfc.h" 21 21 22 - #define CPU_ALL_PORT(fn, sfx) \ 22 + #define CPU_ALL_GP(fn, sfx) \ 23 23 PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \ 24 24 PORT_GP_28(1, fn, sfx), \ 25 25 PORT_GP_CFG_30(2, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \
+87 -94
drivers/pinctrl/sh-pfc/pfc-r8a77990.c
··· 17 17 #include "core.h" 18 18 #include "sh_pfc.h" 19 19 20 - #define CFG_FLAGS (SH_PFC_PIN_CFG_PULL_UP | \ 21 - SH_PFC_PIN_CFG_PULL_DOWN) 20 + #define CFG_FLAGS (SH_PFC_PIN_CFG_PULL_UP_DOWN) 22 21 23 - #define CPU_ALL_PORT(fn, sfx) \ 22 + #define CPU_ALL_GP(fn, sfx) \ 24 23 PORT_GP_CFG_18(0, fn, sfx, CFG_FLAGS), \ 25 24 PORT_GP_CFG_23(1, fn, sfx, CFG_FLAGS), \ 26 25 PORT_GP_CFG_26(2, fn, sfx, CFG_FLAGS), \ ··· 40 41 PORT_GP_CFG_1(6, 15, fn, sfx, CFG_FLAGS), \ 41 42 PORT_GP_CFG_1(6, 16, fn, sfx, CFG_FLAGS), \ 42 43 PORT_GP_CFG_1(6, 17, fn, sfx, CFG_FLAGS) 44 + 45 + #define CPU_ALL_NOGP(fn) \ 46 + PIN_NOGP_CFG(ASEBRK, "ASEBRK", fn, CFG_FLAGS), \ 47 + PIN_NOGP_CFG(AVB_MDC, "AVB_MDC", fn, CFG_FLAGS), \ 48 + PIN_NOGP_CFG(AVB_MDIO, "AVB_MDIO", fn, CFG_FLAGS), \ 49 + PIN_NOGP_CFG(AVB_TD0, "AVB_TD0", fn, CFG_FLAGS), \ 50 + PIN_NOGP_CFG(AVB_TD1, "AVB_TD1", fn, CFG_FLAGS), \ 51 + PIN_NOGP_CFG(AVB_TD2, "AVB_TD2", fn, CFG_FLAGS), \ 52 + PIN_NOGP_CFG(AVB_TD3, "AVB_TD3", fn, CFG_FLAGS), \ 53 + PIN_NOGP_CFG(AVB_TXC, "AVB_TXC", fn, CFG_FLAGS), \ 54 + PIN_NOGP_CFG(AVB_TX_CTL, "AVB_TX_CTL", fn, CFG_FLAGS), \ 55 + PIN_NOGP_CFG(FSCLKST_N, "FSCLKST_N", fn, CFG_FLAGS), \ 56 + PIN_NOGP_CFG(MLB_REF, "MLB_REF", fn, CFG_FLAGS), \ 57 + PIN_NOGP_CFG(PRESETOUT_N, "PRESETOUT_N", fn, CFG_FLAGS), \ 58 + PIN_NOGP_CFG(TCK, "TCK", fn, CFG_FLAGS), \ 59 + PIN_NOGP_CFG(TDI, "TDI", fn, CFG_FLAGS), \ 60 + PIN_NOGP_CFG(TMS, "TMS", fn, CFG_FLAGS), \ 61 + PIN_NOGP_CFG(TRST_N, "TRST_N", fn, CFG_FLAGS) 62 + 43 63 /* 44 64 * F_() : just information 45 65 * FM() : macro for FN_xxx / xxx_MARK ··· 1295 1277 }; 1296 1278 1297 1279 /* 1298 - * R8A77990 has 7 banks with 32 GPIOs in each => 224 GPIOs. 1299 - * Physical layout rows: A - AE, cols: 1 - 25. 1280 + * Pins not associated with a GPIO port. 1300 1281 */ 1301 - #define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r)) 1302 - #define PIN_NUMBER(r, c) (((r) - 'A') * 25 + (c) + 300) 1303 - #define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c) 1304 - #define PIN_NONE U16_MAX 1282 + enum { 1283 + GP_ASSIGN_LAST(), 1284 + NOGP_ALL(), 1285 + }; 1305 1286 1306 1287 static const struct sh_pfc_pin pinmux_pins[] = { 1307 1288 PINMUX_GPIO_GP_ALL(), 1308 - 1309 - /* 1310 - * Pins not associated with a GPIO port. 1311 - * 1312 - * The pin positions are different between different R8A77990 1313 - * packages, all that is needed for the pfc driver is a unique 1314 - * number for each pin. To this end use the pin layout from 1315 - * R8A77990 to calculate a unique number for each pin. 1316 - */ 1317 - SH_PFC_PIN_NAMED_CFG('F', 1, TRST_N, CFG_FLAGS), 1318 - SH_PFC_PIN_NAMED_CFG('F', 3, TMS, CFG_FLAGS), 1319 - SH_PFC_PIN_NAMED_CFG('F', 4, TCK, CFG_FLAGS), 1320 - SH_PFC_PIN_NAMED_CFG('G', 2, TDI, CFG_FLAGS), 1321 - SH_PFC_PIN_NAMED_CFG('G', 3, FSCLKST_N, CFG_FLAGS), 1322 - SH_PFC_PIN_NAMED_CFG('H', 1, ASEBRK, CFG_FLAGS), 1323 - SH_PFC_PIN_NAMED_CFG('N', 1, AVB_TXC, CFG_FLAGS), 1324 - SH_PFC_PIN_NAMED_CFG('N', 2, AVB_TD0, CFG_FLAGS), 1325 - SH_PFC_PIN_NAMED_CFG('N', 3, AVB_TD1, CFG_FLAGS), 1326 - SH_PFC_PIN_NAMED_CFG('N', 5, AVB_TD2, CFG_FLAGS), 1327 - SH_PFC_PIN_NAMED_CFG('N', 6, AVB_TD3, CFG_FLAGS), 1328 - SH_PFC_PIN_NAMED_CFG('P', 3, AVB_TX_CTL, CFG_FLAGS), 1329 - SH_PFC_PIN_NAMED_CFG('P', 4, AVB_MDIO, CFG_FLAGS), 1330 - SH_PFC_PIN_NAMED_CFG('P', 5, AVB_MDC, CFG_FLAGS), 1331 - SH_PFC_PIN_NAMED_CFG('T', 21, MLB_REF, CFG_FLAGS), 1332 - SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 3, PRESETOUT_N, CFG_FLAGS), 1289 + PINMUX_NOGP_ALL(), 1333 1290 }; 1334 1291 1335 1292 /* - AUDIO CLOCK ------------------------------------------------------------ */ ··· 5019 5026 [0] = RCAR_GP_PIN(2, 23), /* RD# */ 5020 5027 [1] = RCAR_GP_PIN(2, 22), /* BS# */ 5021 5028 [2] = RCAR_GP_PIN(2, 21), /* AVB_PHY_INT */ 5022 - [3] = PIN_NUMBER('P', 5), /* AVB_MDC */ 5023 - [4] = PIN_NUMBER('P', 4), /* AVB_MDIO */ 5029 + [3] = PIN_AVB_MDC, /* AVB_MDC */ 5030 + [4] = PIN_AVB_MDIO, /* AVB_MDIO */ 5024 5031 [5] = RCAR_GP_PIN(2, 20), /* AVB_TXCREFCLK */ 5025 - [6] = PIN_NUMBER('N', 6), /* AVB_TD3 */ 5026 - [7] = PIN_NUMBER('N', 5), /* AVB_TD2 */ 5027 - [8] = PIN_NUMBER('N', 3), /* AVB_TD1 */ 5028 - [9] = PIN_NUMBER('N', 2), /* AVB_TD0 */ 5029 - [10] = PIN_NUMBER('N', 1), /* AVB_TXC */ 5030 - [11] = PIN_NUMBER('P', 3), /* AVB_TX_CTL */ 5032 + [6] = PIN_AVB_TD3, /* AVB_TD3 */ 5033 + [7] = PIN_AVB_TD2, /* AVB_TD2 */ 5034 + [8] = PIN_AVB_TD1, /* AVB_TD1 */ 5035 + [9] = PIN_AVB_TD0, /* AVB_TD0 */ 5036 + [10] = PIN_AVB_TXC, /* AVB_TXC */ 5037 + [11] = PIN_AVB_TX_CTL, /* AVB_TX_CTL */ 5031 5038 [12] = RCAR_GP_PIN(2, 19), /* AVB_RD3 */ 5032 5039 [13] = RCAR_GP_PIN(2, 18), /* AVB_RD2 */ 5033 5040 [14] = RCAR_GP_PIN(2, 17), /* AVB_RD1 */ ··· 5078 5085 [25] = RCAR_GP_PIN(1, 2), /* A2 */ 5079 5086 [26] = RCAR_GP_PIN(1, 1), /* A1 */ 5080 5087 [27] = RCAR_GP_PIN(1, 0), /* A0 */ 5081 - [28] = PIN_NONE, 5082 - [29] = PIN_NONE, 5088 + [28] = SH_PFC_PIN_NONE, 5089 + [29] = SH_PFC_PIN_NONE, 5083 5090 [30] = RCAR_GP_PIN(2, 25), /* PUEN_EX_WAIT0 */ 5084 5091 [31] = RCAR_GP_PIN(2, 24), /* PUEN_RD/WR# */ 5085 5092 } }, 5086 5093 { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) { 5087 5094 [0] = RCAR_GP_PIN(3, 1), /* SD0_CMD */ 5088 5095 [1] = RCAR_GP_PIN(3, 0), /* SD0_CLK */ 5089 - [2] = PIN_NUMBER('H', 1), /* ASEBRK */ 5090 - [3] = PIN_NONE, 5091 - [4] = PIN_NUMBER('G', 2), /* TDI */ 5092 - [5] = PIN_NUMBER('F', 3), /* TMS */ 5093 - [6] = PIN_NUMBER('F', 4), /* TCK */ 5094 - [7] = PIN_NUMBER('F', 1), /* TRST# */ 5095 - [8] = PIN_NONE, 5096 - [9] = PIN_NONE, 5097 - [10] = PIN_NONE, 5098 - [11] = PIN_NONE, 5099 - [12] = PIN_NONE, 5100 - [13] = PIN_NONE, 5101 - [14] = PIN_NONE, 5102 - [15] = PIN_NUMBER('G', 3), /* FSCLKST# */ 5096 + [2] = PIN_ASEBRK, /* ASEBRK */ 5097 + [3] = SH_PFC_PIN_NONE, 5098 + [4] = PIN_TDI, /* TDI */ 5099 + [5] = PIN_TMS, /* TMS */ 5100 + [6] = PIN_TCK, /* TCK */ 5101 + [7] = PIN_TRST_N, /* TRST# */ 5102 + [8] = SH_PFC_PIN_NONE, 5103 + [9] = SH_PFC_PIN_NONE, 5104 + [10] = SH_PFC_PIN_NONE, 5105 + [11] = SH_PFC_PIN_NONE, 5106 + [12] = SH_PFC_PIN_NONE, 5107 + [13] = SH_PFC_PIN_NONE, 5108 + [14] = SH_PFC_PIN_NONE, 5109 + [15] = PIN_FSCLKST_N, /* FSCLKST# */ 5103 5110 [16] = RCAR_GP_PIN(0, 17), /* SDA4 */ 5104 5111 [17] = RCAR_GP_PIN(0, 16), /* SCL4 */ 5105 - [18] = PIN_NONE, 5106 - [19] = PIN_NONE, 5107 - [20] = PIN_A_NUMBER('D', 3), /* PRESETOUT# */ 5112 + [18] = SH_PFC_PIN_NONE, 5113 + [19] = SH_PFC_PIN_NONE, 5114 + [20] = PIN_PRESETOUT_N, /* PRESETOUT# */ 5108 5115 [21] = RCAR_GP_PIN(0, 15), /* D15 */ 5109 5116 [22] = RCAR_GP_PIN(0, 14), /* D14 */ 5110 5117 [23] = RCAR_GP_PIN(0, 13), /* D13 */ ··· 5123 5130 [2] = RCAR_GP_PIN(5, 3), /* CTS0#_A */ 5124 5131 [3] = RCAR_GP_PIN(5, 2), /* TX0_A */ 5125 5132 [4] = RCAR_GP_PIN(5, 1), /* RX0_A */ 5126 - [5] = PIN_NONE, 5127 - [6] = PIN_NONE, 5133 + [5] = SH_PFC_PIN_NONE, 5134 + [6] = SH_PFC_PIN_NONE, 5128 5135 [7] = RCAR_GP_PIN(3, 15), /* SD1_WP */ 5129 5136 [8] = RCAR_GP_PIN(3, 14), /* SD1_CD */ 5130 5137 [9] = RCAR_GP_PIN(3, 13), /* SD0_WP */ ··· 5168 5175 [13] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */ 5169 5176 [14] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */ 5170 5177 [15] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */ 5171 - [16] = PIN_NUMBER('T', 21), /* MLB_REF */ 5178 + [16] = PIN_MLB_REF, /* MLB_REF */ 5172 5179 [17] = RCAR_GP_PIN(5, 19), /* MLB_DAT */ 5173 5180 [18] = RCAR_GP_PIN(5, 18), /* MLB_SIG */ 5174 5181 [19] = RCAR_GP_PIN(5, 17), /* MLB_CLK */ ··· 5186 5193 [31] = RCAR_GP_PIN(5, 5), /* RX1 */ 5187 5194 } }, 5188 5195 { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) { 5189 - [0] = PIN_NONE, 5190 - [1] = PIN_NONE, 5191 - [2] = PIN_NONE, 5192 - [3] = PIN_NONE, 5193 - [4] = PIN_NONE, 5194 - [5] = PIN_NONE, 5195 - [6] = PIN_NONE, 5196 - [7] = PIN_NONE, 5197 - [8] = PIN_NONE, 5198 - [9] = PIN_NONE, 5199 - [10] = PIN_NONE, 5200 - [11] = PIN_NONE, 5201 - [12] = PIN_NONE, 5202 - [13] = PIN_NONE, 5203 - [14] = PIN_NONE, 5204 - [15] = PIN_NONE, 5205 - [16] = PIN_NONE, 5206 - [17] = PIN_NONE, 5207 - [18] = PIN_NONE, 5208 - [19] = PIN_NONE, 5209 - [20] = PIN_NONE, 5210 - [21] = PIN_NONE, 5211 - [22] = PIN_NONE, 5212 - [23] = PIN_NONE, 5213 - [24] = PIN_NONE, 5214 - [25] = PIN_NONE, 5215 - [26] = PIN_NONE, 5216 - [27] = PIN_NONE, 5217 - [28] = PIN_NONE, 5218 - [29] = PIN_NONE, 5196 + [0] = SH_PFC_PIN_NONE, 5197 + [1] = SH_PFC_PIN_NONE, 5198 + [2] = SH_PFC_PIN_NONE, 5199 + [3] = SH_PFC_PIN_NONE, 5200 + [4] = SH_PFC_PIN_NONE, 5201 + [5] = SH_PFC_PIN_NONE, 5202 + [6] = SH_PFC_PIN_NONE, 5203 + [7] = SH_PFC_PIN_NONE, 5204 + [8] = SH_PFC_PIN_NONE, 5205 + [9] = SH_PFC_PIN_NONE, 5206 + [10] = SH_PFC_PIN_NONE, 5207 + [11] = SH_PFC_PIN_NONE, 5208 + [12] = SH_PFC_PIN_NONE, 5209 + [13] = SH_PFC_PIN_NONE, 5210 + [14] = SH_PFC_PIN_NONE, 5211 + [15] = SH_PFC_PIN_NONE, 5212 + [16] = SH_PFC_PIN_NONE, 5213 + [17] = SH_PFC_PIN_NONE, 5214 + [18] = SH_PFC_PIN_NONE, 5215 + [19] = SH_PFC_PIN_NONE, 5216 + [20] = SH_PFC_PIN_NONE, 5217 + [21] = SH_PFC_PIN_NONE, 5218 + [22] = SH_PFC_PIN_NONE, 5219 + [23] = SH_PFC_PIN_NONE, 5220 + [24] = SH_PFC_PIN_NONE, 5221 + [25] = SH_PFC_PIN_NONE, 5222 + [26] = SH_PFC_PIN_NONE, 5223 + [27] = SH_PFC_PIN_NONE, 5224 + [28] = SH_PFC_PIN_NONE, 5225 + [29] = SH_PFC_PIN_NONE, 5219 5226 [30] = RCAR_GP_PIN(6, 9), /* PUEN_USB30_OVC */ 5220 5227 [31] = RCAR_GP_PIN(6, 17), /* PUEN_USB30_PWEN */ 5221 5228 } },
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a77995.c
··· 17 17 #include "core.h" 18 18 #include "sh_pfc.h" 19 19 20 - #define CPU_ALL_PORT(fn, sfx) \ 20 + #define CPU_ALL_GP(fn, sfx) \ 21 21 PORT_GP_9(0, fn, sfx), \ 22 22 PORT_GP_32(1, fn, sfx), \ 23 23 PORT_GP_32(2, fn, sfx), \
+13 -8
drivers/pinctrl/sh-pfc/pfc-sh73a0.c
··· 43 43 PORT_1(288, fn, pfx##288, sfx), PORT_1(289, fn, pfx##289, sfx), \ 44 44 PORT_10(290, fn, pfx##29, sfx), PORT_10(300, fn, pfx##30, sfx) 45 45 46 + #define CPU_ALL_NOGP(fn) \ 47 + PIN_NOGP(A11, "F26", fn) 48 + 46 49 enum { 47 50 PINMUX_RESERVED = 0, 48 51 ··· 1150 1147 #define __IO (SH_PFC_PIN_CFG_INPUT | SH_PFC_PIN_CFG_OUTPUT) 1151 1148 #define __PD (SH_PFC_PIN_CFG_PULL_DOWN) 1152 1149 #define __PU (SH_PFC_PIN_CFG_PULL_UP) 1153 - #define __PUD (SH_PFC_PIN_CFG_PULL_DOWN | SH_PFC_PIN_CFG_PULL_UP) 1150 + #define __PUD (SH_PFC_PIN_CFG_PULL_UP_DOWN) 1154 1151 1155 1152 #define SH73A0_PIN_I_PD(pin) SH_PFC_PIN_CFG(pin, __I | __PD) 1156 1153 #define SH73A0_PIN_I_PU(pin) SH_PFC_PIN_CFG(pin, __I | __PU) ··· 1161 1158 #define SH73A0_PIN_IO_PU_PD(pin) SH_PFC_PIN_CFG(pin, __IO | __PUD) 1162 1159 #define SH73A0_PIN_O(pin) SH_PFC_PIN_CFG(pin, __O) 1163 1160 1164 - /* Pin numbers for pins without a corresponding GPIO port number are computed 1165 - * from the row and column numbers with a 1000 offset to avoid collisions with 1166 - * GPIO port numbers. 1161 + /* 1162 + * Pins not associated with a GPIO port. 1167 1163 */ 1168 - #define PIN_NUMBER(row, col) (1000+((row)-1)*34+(col)-1) 1164 + enum { 1165 + PORT_ASSIGN_LAST(), 1166 + NOGP_ALL(), 1167 + }; 1169 1168 1170 1169 static const struct sh_pfc_pin pinmux_pins[] = { 1171 1170 /* Table 25-1 (I/O and Pull U/D) */ ··· 1442 1437 SH73A0_PIN_O(309), 1443 1438 1444 1439 /* Pins not associated with a GPIO port */ 1445 - SH_PFC_PIN_NAMED(6, 26, F26), 1440 + PINMUX_NOGP_ALL(), 1446 1441 }; 1447 1442 1448 1443 /* - BSC -------------------------------------------------------------------- */ ··· 1868 1863 }; 1869 1864 static const unsigned int keysc_out8_0_pins[] = { 1870 1865 /* KEYOUT8 */ 1871 - PIN_NUMBER(6, 26), 1866 + PIN_A11, 1872 1867 }; 1873 1868 static const unsigned int keysc_out8_0_mux[] = { 1874 1869 KEYOUT8_MARK, ··· 3078 3073 }; 3079 3074 static const unsigned int tpu4_to3_pins[] = { 3080 3075 /* TO */ 3081 - PIN_NUMBER(6, 26), 3076 + PIN_A11, 3082 3077 }; 3083 3078 static const unsigned int tpu4_to3_mux[] = { 3084 3079 TPU4TO3_MARK,
+1 -1
drivers/pinctrl/sh-pfc/pfc-sh7734.c
··· 11 11 12 12 #include "sh_pfc.h" 13 13 14 - #define CPU_ALL_PORT(fn, sfx) \ 14 + #define CPU_ALL_GP(fn, sfx) \ 15 15 PORT_GP_32(0, fn, sfx), \ 16 16 PORT_GP_32(1, fn, sfx), \ 17 17 PORT_GP_32(2, fn, sfx), \
+1 -2
drivers/pinctrl/sh-pfc/pinctrl.c
··· 569 569 570 570 switch (param) { 571 571 case PIN_CONFIG_BIAS_DISABLE: 572 - return pin->configs & 573 - (SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN); 572 + return pin->configs & SH_PFC_PIN_CFG_PULL_UP_DOWN; 574 573 575 574 case PIN_CONFIG_BIAS_PULL_UP: 576 575 return pin->configs & SH_PFC_PIN_CFG_PULL_UP;
+69 -21
drivers/pinctrl/sh-pfc/sh_pfc.h
··· 21 21 PINMUX_TYPE_INPUT, 22 22 }; 23 23 24 + #define SH_PFC_PIN_NONE U16_MAX 25 + 24 26 #define SH_PFC_PIN_CFG_INPUT (1 << 0) 25 27 #define SH_PFC_PIN_CFG_OUTPUT (1 << 1) 26 28 #define SH_PFC_PIN_CFG_PULL_UP (1 << 2) 27 29 #define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3) 30 + #define SH_PFC_PIN_CFG_PULL_UP_DOWN (SH_PFC_PIN_CFG_PULL_UP | \ 31 + SH_PFC_PIN_CFG_PULL_DOWN) 28 32 #define SH_PFC_PIN_CFG_IO_VOLTAGE (1 << 4) 29 33 #define SH_PFC_PIN_CFG_DRIVE_STRENGTH (1 << 5) 30 34 #define SH_PFC_PIN_CFG_NO_GPIO (1 << 31) ··· 546 542 PORT_GP_CFG_1(bank, 25, fn, sfx, cfg) 547 543 #define PORT_GP_26(bank, fn, sfx) PORT_GP_CFG_26(bank, fn, sfx, 0) 548 544 549 - #define PORT_GP_CFG_28(bank, fn, sfx, cfg) \ 545 + #define PORT_GP_CFG_27(bank, fn, sfx, cfg) \ 550 546 PORT_GP_CFG_26(bank, fn, sfx, cfg), \ 551 - PORT_GP_CFG_1(bank, 26, fn, sfx, cfg), \ 547 + PORT_GP_CFG_1(bank, 26, fn, sfx, cfg) 548 + #define PORT_GP_27(bank, fn, sfx) PORT_GP_CFG_27(bank, fn, sfx, 0) 549 + 550 + #define PORT_GP_CFG_28(bank, fn, sfx, cfg) \ 551 + PORT_GP_CFG_27(bank, fn, sfx, cfg), \ 552 552 PORT_GP_CFG_1(bank, 27, fn, sfx, cfg) 553 553 #define PORT_GP_28(bank, fn, sfx) PORT_GP_CFG_28(bank, fn, sfx, 0) 554 554 ··· 592 584 593 585 /* GP_ALL(suffix) - Expand to a list of GP_#_#_suffix */ 594 586 #define _GP_ALL(bank, pin, name, sfx, cfg) name##_##sfx 595 - #define GP_ALL(str) CPU_ALL_PORT(_GP_ALL, str) 587 + #define GP_ALL(str) CPU_ALL_GP(_GP_ALL, str) 596 588 597 589 /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */ 598 590 #define _GP_GPIO(bank, _pin, _name, sfx, cfg) \ ··· 602 594 .enum_id = _name##_DATA, \ 603 595 .configs = cfg, \ 604 596 } 605 - #define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, unused) 597 + #define PINMUX_GPIO_GP_ALL() CPU_ALL_GP(_GP_GPIO, unused) 606 598 607 599 /* PINMUX_DATA_GP_ALL - Expand to a list of name_DATA, name_FN marks */ 608 600 #define _GP_DATA(bank, pin, name, sfx, cfg) PINMUX_DATA(name##_DATA, name##_FN) 609 - #define PINMUX_DATA_GP_ALL() CPU_ALL_PORT(_GP_DATA, unused) 601 + #define PINMUX_DATA_GP_ALL() CPU_ALL_GP(_GP_DATA, unused) 602 + 603 + /* 604 + * GP_ASSIGN_LAST() - Expand to an enum definition for the last GP pin 605 + * 606 + * The largest GP pin index is obtained by taking the size of a union, 607 + * containing one array per GP pin, sized by the corresponding pin index. 608 + * As the fields in the CPU_ALL_GP() macro definition are separated by commas, 609 + * while the members of a union must be terminated by semicolons, the commas 610 + * are absorbed by wrapping them inside dummy attributes. 611 + */ 612 + #define _GP_ENTRY(bank, pin, name, sfx, cfg) \ 613 + deprecated)); char name[(bank * 32) + pin] __attribute__((deprecated 614 + #define GP_ASSIGN_LAST() \ 615 + GP_LAST = sizeof(union { \ 616 + char dummy[0] __attribute__((deprecated, \ 617 + CPU_ALL_GP(_GP_ENTRY, unused), \ 618 + deprecated)); \ 619 + }) 610 620 611 621 /* 612 622 * PORT style (linear pin space) ··· 667 641 .configs = cfgs, \ 668 642 } 669 643 670 - /* SH_PFC_PIN_NAMED - Expand to a sh_pfc_pin entry with the given name */ 671 - #define SH_PFC_PIN_NAMED(row, col, _name) \ 672 - { \ 673 - .pin = PIN_NUMBER(row, col), \ 674 - .name = __stringify(PIN_##_name), \ 675 - .configs = SH_PFC_PIN_CFG_NO_GPIO, \ 676 - } 677 - 678 - /* SH_PFC_PIN_NAMED_CFG - Expand to a sh_pfc_pin entry with the given name */ 679 - #define SH_PFC_PIN_NAMED_CFG(row, col, _name, cfgs) \ 680 - { \ 681 - .pin = PIN_NUMBER(row, col), \ 682 - .name = __stringify(PIN_##_name), \ 683 - .configs = SH_PFC_PIN_CFG_NO_GPIO | cfgs, \ 684 - } 685 - 686 644 /* PINMUX_DATA_ALL - Expand to a list of PORT_name_DATA, PORT_name_FN0, 687 645 * PORT_name_OUT, PORT_name_IN marks 688 646 */ ··· 674 664 PINMUX_DATA(PORT##pfx##_DATA, PORT##pfx##_FN0, \ 675 665 PORT##pfx##_OUT, PORT##pfx##_IN) 676 666 #define PINMUX_DATA_ALL() CPU_ALL_PORT(_PORT_DATA, , unused) 667 + 668 + /* 669 + * PORT_ASSIGN_LAST() - Expand to an enum definition for the last PORT pin 670 + * 671 + * The largest PORT pin index is obtained by taking the size of a union, 672 + * containing one array per PORT pin, sized by the corresponding pin index. 673 + * As the fields in the CPU_ALL_PORT() macro definition are separated by 674 + * commas, while the members of a union must be terminated by semicolons, the 675 + * commas are absorbed by wrapping them inside dummy attributes. 676 + */ 677 + #define _PORT_ENTRY(pn, pfx, sfx) \ 678 + deprecated)); char pfx[pn] __attribute__((deprecated 679 + #define PORT_ASSIGN_LAST() \ 680 + PORT_LAST = sizeof(union { \ 681 + char dummy[0] __attribute__((deprecated, \ 682 + CPU_ALL_PORT(_PORT_ENTRY, PORT, unused), \ 683 + deprecated)); \ 684 + }) 677 685 678 686 /* GPIO_FN(name) - Expand to a sh_pfc_pin entry for a function GPIO */ 679 687 #define PINMUX_GPIO_FN(gpio, base, data_or_mark) \ ··· 701 673 } 702 674 #define GPIO_FN(str) \ 703 675 PINMUX_GPIO_FN(GPIO_FN_##str, PINMUX_FN_BASE, str##_MARK) 676 + 677 + /* 678 + * Pins not associated with a GPIO port 679 + */ 680 + 681 + #define PIN_NOGP_CFG(pin, name, fn, cfg) fn(pin, name, cfg) 682 + #define PIN_NOGP(pin, name, fn) fn(pin, name, 0) 683 + 684 + /* NOGP_ALL - Expand to a list of PIN_id */ 685 + #define _NOGP_ALL(pin, name, cfg) PIN_##pin 686 + #define NOGP_ALL() CPU_ALL_NOGP(_NOGP_ALL) 687 + 688 + /* PINMUX_NOGP_ALL - Expand to a list of sh_pfc_pin entries */ 689 + #define _NOGP_PINMUX(_pin, _name, cfg) \ 690 + { \ 691 + .pin = PIN_##_pin, \ 692 + .name = "PIN_" _name, \ 693 + .configs = SH_PFC_PIN_CFG_NO_GPIO | cfg, \ 694 + } 695 + #define PINMUX_NOGP_ALL() CPU_ALL_NOGP(_NOGP_PINMUX) 704 696 705 697 /* 706 698 * PORTnCR helper macro for SH-Mobile/R-Mobile
+183 -1
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 44 44 #define STM32_GPIO_AFRL 0x20 45 45 #define STM32_GPIO_AFRH 0x24 46 46 47 + /* custom bitfield to backup pin status */ 48 + #define STM32_GPIO_BKP_MODE_SHIFT 0 49 + #define STM32_GPIO_BKP_MODE_MASK GENMASK(1, 0) 50 + #define STM32_GPIO_BKP_ALT_SHIFT 2 51 + #define STM32_GPIO_BKP_ALT_MASK GENMASK(5, 2) 52 + #define STM32_GPIO_BKP_SPEED_SHIFT 6 53 + #define STM32_GPIO_BKP_SPEED_MASK GENMASK(7, 6) 54 + #define STM32_GPIO_BKP_PUPD_SHIFT 8 55 + #define STM32_GPIO_BKP_PUPD_MASK GENMASK(9, 8) 56 + #define STM32_GPIO_BKP_TYPE 10 57 + #define STM32_GPIO_BKP_VAL 11 58 + 47 59 #define STM32_GPIO_PINS_PER_BANK 16 48 60 #define STM32_GPIO_IRQ_LINE 16 49 61 ··· 91 79 struct irq_domain *domain; 92 80 u32 bank_nr; 93 81 u32 bank_ioport_nr; 82 + u32 pin_backup[STM32_GPIO_PINS_PER_BANK]; 94 83 }; 95 84 96 85 struct stm32_pinctrl { ··· 111 98 struct stm32_desc_pin *pins; 112 99 u32 npins; 113 100 u32 pkg; 101 + u16 irqmux_map; 102 + spinlock_t irqmux_lock; 114 103 }; 115 104 116 105 static inline int stm32_gpio_pin(int gpio) ··· 148 133 return 0; 149 134 } 150 135 136 + static void stm32_gpio_backup_value(struct stm32_gpio_bank *bank, 137 + u32 offset, u32 value) 138 + { 139 + bank->pin_backup[offset] &= ~BIT(STM32_GPIO_BKP_VAL); 140 + bank->pin_backup[offset] |= value << STM32_GPIO_BKP_VAL; 141 + } 142 + 143 + static void stm32_gpio_backup_mode(struct stm32_gpio_bank *bank, u32 offset, 144 + u32 mode, u32 alt) 145 + { 146 + bank->pin_backup[offset] &= ~(STM32_GPIO_BKP_MODE_MASK | 147 + STM32_GPIO_BKP_ALT_MASK); 148 + bank->pin_backup[offset] |= mode << STM32_GPIO_BKP_MODE_SHIFT; 149 + bank->pin_backup[offset] |= alt << STM32_GPIO_BKP_ALT_SHIFT; 150 + } 151 + 152 + static void stm32_gpio_backup_driving(struct stm32_gpio_bank *bank, u32 offset, 153 + u32 drive) 154 + { 155 + bank->pin_backup[offset] &= ~BIT(STM32_GPIO_BKP_TYPE); 156 + bank->pin_backup[offset] |= drive << STM32_GPIO_BKP_TYPE; 157 + } 158 + 159 + static void stm32_gpio_backup_speed(struct stm32_gpio_bank *bank, u32 offset, 160 + u32 speed) 161 + { 162 + bank->pin_backup[offset] &= ~STM32_GPIO_BKP_SPEED_MASK; 163 + bank->pin_backup[offset] |= speed << STM32_GPIO_BKP_SPEED_SHIFT; 164 + } 165 + 166 + static void stm32_gpio_backup_bias(struct stm32_gpio_bank *bank, u32 offset, 167 + u32 bias) 168 + { 169 + bank->pin_backup[offset] &= ~STM32_GPIO_BKP_PUPD_MASK; 170 + bank->pin_backup[offset] |= bias << STM32_GPIO_BKP_PUPD_SHIFT; 171 + } 172 + 151 173 /* GPIO functions */ 152 174 153 175 static inline void __stm32_gpio_set(struct stm32_gpio_bank *bank, 154 176 unsigned offset, int value) 155 177 { 178 + stm32_gpio_backup_value(bank, offset, value); 179 + 156 180 if (!value) 157 181 offset += STM32_GPIO_PINS_PER_BANK; 158 182 ··· 361 307 { 362 308 struct stm32_gpio_bank *bank = d->host_data; 363 309 struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent); 310 + unsigned long flags; 311 + int ret = 0; 312 + 313 + /* 314 + * gpio irq mux is shared between several banks, a lock has to be done 315 + * to avoid overriding. 316 + */ 317 + spin_lock_irqsave(&pctl->irqmux_lock, flags); 318 + if (pctl->hwlock) 319 + ret = hwspin_lock_timeout(pctl->hwlock, HWSPINLOCK_TIMEOUT); 320 + 321 + if (ret) { 322 + dev_err(pctl->dev, "Can't get hwspinlock\n"); 323 + goto unlock; 324 + } 325 + 326 + if (pctl->irqmux_map & BIT(irq_data->hwirq)) { 327 + dev_err(pctl->dev, "irq line %ld already requested.\n", 328 + irq_data->hwirq); 329 + ret = -EBUSY; 330 + if (pctl->hwlock) 331 + hwspin_unlock(pctl->hwlock); 332 + goto unlock; 333 + } else { 334 + pctl->irqmux_map |= BIT(irq_data->hwirq); 335 + } 364 336 365 337 regmap_field_write(pctl->irqmux[irq_data->hwirq], bank->bank_ioport_nr); 366 - return 0; 338 + 339 + if (pctl->hwlock) 340 + hwspin_unlock(pctl->hwlock); 341 + 342 + unlock: 343 + spin_unlock_irqrestore(&pctl->irqmux_lock, flags); 344 + return ret; 345 + } 346 + 347 + static void stm32_gpio_domain_deactivate(struct irq_domain *d, 348 + struct irq_data *irq_data) 349 + { 350 + struct stm32_gpio_bank *bank = d->host_data; 351 + struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent); 352 + unsigned long flags; 353 + 354 + spin_lock_irqsave(&pctl->irqmux_lock, flags); 355 + pctl->irqmux_map &= ~BIT(irq_data->hwirq); 356 + spin_unlock_irqrestore(&pctl->irqmux_lock, flags); 367 357 } 368 358 369 359 static int stm32_gpio_domain_alloc(struct irq_domain *d, ··· 436 338 .alloc = stm32_gpio_domain_alloc, 437 339 .free = irq_domain_free_irqs_common, 438 340 .activate = stm32_gpio_domain_activate, 341 + .deactivate = stm32_gpio_domain_deactivate, 439 342 }; 440 343 441 344 /* Pinctrl functions */ ··· 719 620 if (pctl->hwlock) 720 621 hwspin_unlock(pctl->hwlock); 721 622 623 + stm32_gpio_backup_mode(bank, pin, mode, alt); 624 + 722 625 unlock: 723 626 spin_unlock_irqrestore(&bank->lock, flags); 724 627 clk_disable(bank->clk); ··· 833 732 if (pctl->hwlock) 834 733 hwspin_unlock(pctl->hwlock); 835 734 735 + stm32_gpio_backup_driving(bank, offset, drive); 736 + 836 737 unlock: 837 738 spin_unlock_irqrestore(&bank->lock, flags); 838 739 clk_disable(bank->clk); ··· 887 784 if (pctl->hwlock) 888 785 hwspin_unlock(pctl->hwlock); 889 786 787 + stm32_gpio_backup_speed(bank, offset, speed); 788 + 890 789 unlock: 891 790 spin_unlock_irqrestore(&bank->lock, flags); 892 791 clk_disable(bank->clk); ··· 940 835 941 836 if (pctl->hwlock) 942 837 hwspin_unlock(pctl->hwlock); 838 + 839 + stm32_gpio_backup_bias(bank, offset, bias); 943 840 944 841 unlock: 945 842 spin_unlock_irqrestore(&bank->lock, flags); ··· 1397 1290 pctl->hwlock = hwspin_lock_request_specific(hwlock_id); 1398 1291 } 1399 1292 1293 + spin_lock_init(&pctl->irqmux_lock); 1294 + 1400 1295 pctl->dev = dev; 1401 1296 pctl->match_data = match->data; 1402 1297 ··· 1438 1329 pctl->pctl_desc.owner = THIS_MODULE; 1439 1330 pctl->pctl_desc.pins = pins; 1440 1331 pctl->pctl_desc.npins = pctl->npins; 1332 + pctl->pctl_desc.link_consumers = true; 1441 1333 pctl->pctl_desc.confops = &stm32_pconf_ops; 1442 1334 pctl->pctl_desc.pctlops = &stm32_pctrl_ops; 1443 1335 pctl->pctl_desc.pmxops = &stm32_pmx_ops; ··· 1476 1366 } 1477 1367 1478 1368 dev_info(dev, "Pinctrl STM32 initialized\n"); 1369 + 1370 + return 0; 1371 + } 1372 + 1373 + static int __maybe_unused stm32_pinctrl_restore_gpio_regs( 1374 + struct stm32_pinctrl *pctl, u32 pin) 1375 + { 1376 + const struct pin_desc *desc = pin_desc_get(pctl->pctl_dev, pin); 1377 + u32 val, alt, mode, offset = stm32_gpio_pin(pin); 1378 + struct pinctrl_gpio_range *range; 1379 + struct stm32_gpio_bank *bank; 1380 + bool pin_is_irq; 1381 + int ret; 1382 + 1383 + range = pinctrl_find_gpio_range_from_pin(pctl->pctl_dev, pin); 1384 + if (!range) 1385 + return 0; 1386 + 1387 + pin_is_irq = gpiochip_line_is_irq(range->gc, offset); 1388 + 1389 + if (!desc || (!pin_is_irq && !desc->gpio_owner)) 1390 + return 0; 1391 + 1392 + bank = gpiochip_get_data(range->gc); 1393 + 1394 + alt = bank->pin_backup[offset] & STM32_GPIO_BKP_ALT_MASK; 1395 + alt >>= STM32_GPIO_BKP_ALT_SHIFT; 1396 + mode = bank->pin_backup[offset] & STM32_GPIO_BKP_MODE_MASK; 1397 + mode >>= STM32_GPIO_BKP_MODE_SHIFT; 1398 + 1399 + ret = stm32_pmx_set_mode(bank, offset, mode, alt); 1400 + if (ret) 1401 + return ret; 1402 + 1403 + if (mode == 1) { 1404 + val = bank->pin_backup[offset] & BIT(STM32_GPIO_BKP_VAL); 1405 + val = val >> STM32_GPIO_BKP_VAL; 1406 + __stm32_gpio_set(bank, offset, val); 1407 + } 1408 + 1409 + val = bank->pin_backup[offset] & BIT(STM32_GPIO_BKP_TYPE); 1410 + val >>= STM32_GPIO_BKP_TYPE; 1411 + ret = stm32_pconf_set_driving(bank, offset, val); 1412 + if (ret) 1413 + return ret; 1414 + 1415 + val = bank->pin_backup[offset] & STM32_GPIO_BKP_SPEED_MASK; 1416 + val >>= STM32_GPIO_BKP_SPEED_SHIFT; 1417 + ret = stm32_pconf_set_speed(bank, offset, val); 1418 + if (ret) 1419 + return ret; 1420 + 1421 + val = bank->pin_backup[offset] & STM32_GPIO_BKP_PUPD_MASK; 1422 + val >>= STM32_GPIO_BKP_PUPD_SHIFT; 1423 + ret = stm32_pconf_set_bias(bank, offset, val); 1424 + if (ret) 1425 + return ret; 1426 + 1427 + if (pin_is_irq) 1428 + regmap_field_write(pctl->irqmux[offset], bank->bank_ioport_nr); 1429 + 1430 + return 0; 1431 + } 1432 + 1433 + int __maybe_unused stm32_pinctrl_resume(struct device *dev) 1434 + { 1435 + struct stm32_pinctrl *pctl = dev_get_drvdata(dev); 1436 + struct stm32_pinctrl_group *g = pctl->groups; 1437 + int i; 1438 + 1439 + for (i = g->pin; i < g->pin + pctl->ngroups; i++) 1440 + stm32_pinctrl_restore_gpio_regs(pctl, i); 1479 1441 1480 1442 return 0; 1481 1443 }
+2
drivers/pinctrl/stm32/pinctrl-stm32.h
··· 65 65 int stm32_pctl_probe(struct platform_device *pdev); 66 66 void stm32_pmx_get_mode(struct stm32_gpio_bank *bank, 67 67 int pin, u32 *mode, u32 *alt); 68 + int stm32_pinctrl_resume(struct device *dev); 69 + 68 70 #endif /* __PINCTRL_STM32_H */ 69 71
+5
drivers/pinctrl/stm32/pinctrl-stm32mp157.c
··· 2342 2342 { } 2343 2343 }; 2344 2344 2345 + static const struct dev_pm_ops stm32_pinctrl_dev_pm_ops = { 2346 + SET_LATE_SYSTEM_SLEEP_PM_OPS(NULL, stm32_pinctrl_resume) 2347 + }; 2348 + 2345 2349 static struct platform_driver stm32mp157_pinctrl_driver = { 2346 2350 .probe = stm32_pctl_probe, 2347 2351 .driver = { 2348 2352 .name = "stm32mp157-pinctrl", 2349 2353 .of_match_table = stm32mp157_pctrl_match, 2354 + .pm = &stm32_pinctrl_dev_pm_ops, 2350 2355 }, 2351 2356 }; 2352 2357
+4
drivers/pinctrl/tegra/Kconfig
··· 24 24 bool 25 25 select PINCTRL_TEGRA 26 26 27 + config PINCTRL_TEGRA194 28 + bool 29 + select PINCTRL_TEGRA 30 + 27 31 config PINCTRL_TEGRA_XUSB 28 32 def_bool y if ARCH_TEGRA 29 33 select GENERIC_PHY
+1
drivers/pinctrl/tegra/Makefile
··· 5 5 obj-$(CONFIG_PINCTRL_TEGRA114) += pinctrl-tegra114.o 6 6 obj-$(CONFIG_PINCTRL_TEGRA124) += pinctrl-tegra124.o 7 7 obj-$(CONFIG_PINCTRL_TEGRA210) += pinctrl-tegra210.o 8 + obj-$(CONFIG_PINCTRL_TEGRA194) += pinctrl-tegra194.o 8 9 obj-$(CONFIG_PINCTRL_TEGRA_XUSB) += pinctrl-tegra-xusb.o
+18 -8
drivers/pinctrl/tegra/pinctrl-tegra.c
··· 284 284 const struct tegra_pingroup *g, 285 285 enum tegra_pinconf_param param, 286 286 bool report_err, 287 - s8 *bank, s16 *reg, s8 *bit, s8 *width) 287 + s8 *bank, s32 *reg, s8 *bit, s8 *width) 288 288 { 289 289 switch (param) { 290 290 case TEGRA_PINCONF_PARAM_PULL: ··· 443 443 const struct tegra_pingroup *g; 444 444 int ret; 445 445 s8 bank, bit, width; 446 - s16 reg; 446 + s32 reg; 447 447 u32 val, mask; 448 448 449 449 g = &pmx->soc->groups[group]; ··· 472 472 const struct tegra_pingroup *g; 473 473 int ret, i; 474 474 s8 bank, bit, width; 475 - s16 reg; 475 + s32 reg; 476 476 u32 val, mask; 477 477 478 478 g = &pmx->soc->groups[group]; ··· 540 540 const struct tegra_pingroup *g; 541 541 int i, ret; 542 542 s8 bank, bit, width; 543 - s16 reg; 543 + s32 reg; 544 544 u32 val; 545 545 546 546 g = &pmx->soc->groups[group]; ··· 613 613 614 614 for (i = 0; i < pmx->soc->ngroups; ++i) { 615 615 g = &pmx->soc->groups[i]; 616 - if (g->parked_bit >= 0) { 617 - val = pmx_readl(pmx, g->mux_bank, g->mux_reg); 618 - val &= ~(1 << g->parked_bit); 619 - pmx_writel(pmx, val, g->mux_bank, g->mux_reg); 616 + if (g->parked_bitmask > 0) { 617 + unsigned int bank, reg; 618 + 619 + if (g->mux_reg != -1) { 620 + bank = g->mux_bank; 621 + reg = g->mux_reg; 622 + } else { 623 + bank = g->drv_bank; 624 + reg = g->drv_reg; 625 + } 626 + 627 + val = pmx_readl(pmx, bank, reg); 628 + val &= ~g->parked_bitmask; 629 + pmx_writel(pmx, val, bank, reg); 620 630 } 621 631 } 622 632 }
+6 -6
drivers/pinctrl/tegra/pinctrl-tegra.h
··· 96 96 * @tri_reg: Tri-state register offset. 97 97 * @tri_bank: Tri-state register bank. 98 98 * @tri_bit: Tri-state register bit. 99 - * @parked_bit: Parked register bit. -1 if unsupported. 100 99 * @einput_bit: Enable-input register bit. 101 100 * @odrain_bit: Open-drain register bit. 102 101 * @lock_bit: Lock register bit. ··· 117 118 * @slwf_bit: Slew Falling register bit. 118 119 * @slwf_width: Slew Falling field width. 119 120 * @drvtype_bit: Drive type register bit. 121 + * @parked_bitmask: Parked register mask. 0 if unsupported. 120 122 * 121 123 * -1 in a *_reg field means that feature is unsupported for this group. 122 124 * *_bank and *_reg values are irrelevant when *_reg is -1. ··· 135 135 const unsigned *pins; 136 136 u8 npins; 137 137 u8 funcs[4]; 138 - s16 mux_reg; 139 - s16 pupd_reg; 140 - s16 tri_reg; 141 - s16 drv_reg; 138 + s32 mux_reg; 139 + s32 pupd_reg; 140 + s32 tri_reg; 141 + s32 drv_reg; 142 142 u32 mux_bank:2; 143 143 u32 pupd_bank:2; 144 144 u32 tri_bank:2; ··· 146 146 s32 mux_bit:6; 147 147 s32 pupd_bit:6; 148 148 s32 tri_bit:6; 149 - s32 parked_bit:6; 150 149 s32 einput_bit:6; 151 150 s32 odrain_bit:6; 152 151 s32 lock_bit:6; ··· 163 164 s32 drvup_width:6; 164 165 s32 slwr_width:6; 165 166 s32 slwf_width:6; 167 + u32 parked_bitmask; 166 168 }; 167 169 168 170 /**
+3 -3
drivers/pinctrl/tegra/pinctrl-tegra114.c
··· 1572 1572 .lock_bit = 7, \ 1573 1573 .ioreset_bit = PINGROUP_BIT_##ior(8), \ 1574 1574 .rcv_sel_bit = PINGROUP_BIT_##rcv_sel(9), \ 1575 - .parked_bit = -1, \ 1576 1575 .drv_reg = -1, \ 1576 + .parked_bitmask = 0, \ 1577 1577 } 1578 1578 1579 1579 #define DRV_PINGROUP(pg_name, r, hsm_b, schmitt_b, lpmd_b, drvdn_b, \ ··· 1593 1593 .rcv_sel_bit = -1, \ 1594 1594 .drv_reg = DRV_PINGROUP_REG(r), \ 1595 1595 .drv_bank = 0, \ 1596 - .parked_bit = -1, \ 1597 1596 .hsm_bit = hsm_b, \ 1598 1597 .schmitt_bit = schmitt_b, \ 1599 1598 .lpmd_bit = lpmd_b, \ ··· 1605 1606 .slwf_bit = slwf_b, \ 1606 1607 .slwf_width = slwf_w, \ 1607 1608 .drvtype_bit = PINGROUP_BIT_##drvtype(6), \ 1609 + .parked_bitmask = 0, \ 1608 1610 } 1609 1611 1610 1612 static const struct tegra_pingroup tegra114_groups[] = { ··· 1831 1831 1832 1832 static const struct tegra_pinctrl_soc_data tegra114_pinctrl = { 1833 1833 .ngpios = NUM_GPIOS, 1834 - .gpio_compatible = "nvidia,tegra30-gpio", 1834 + .gpio_compatible = "nvidia,tegra114-gpio", 1835 1835 .pins = tegra114_pins, 1836 1836 .npins = ARRAY_SIZE(tegra114_pins), 1837 1837 .functions = tegra114_functions,
+3 -3
drivers/pinctrl/tegra/pinctrl-tegra124.c
··· 1741 1741 .lock_bit = 7, \ 1742 1742 .ioreset_bit = PINGROUP_BIT_##ior(8), \ 1743 1743 .rcv_sel_bit = PINGROUP_BIT_##rcv_sel(9), \ 1744 - .parked_bit = -1, \ 1745 1744 .drv_reg = -1, \ 1745 + .parked_bitmask = 0, \ 1746 1746 } 1747 1747 1748 1748 #define DRV_PINGROUP(pg_name, r, hsm_b, schmitt_b, lpmd_b, drvdn_b, \ ··· 1762 1762 .rcv_sel_bit = -1, \ 1763 1763 .drv_reg = DRV_PINGROUP_REG(r), \ 1764 1764 .drv_bank = 0, \ 1765 - .parked_bit = -1, \ 1766 1765 .hsm_bit = hsm_b, \ 1767 1766 .schmitt_bit = schmitt_b, \ 1768 1767 .lpmd_bit = lpmd_b, \ ··· 1774 1775 .slwf_bit = slwf_b, \ 1775 1776 .slwf_width = slwf_w, \ 1776 1777 .drvtype_bit = PINGROUP_BIT_##drvtype(6), \ 1778 + .parked_bitmask = 0, \ 1777 1779 } 1778 1780 1779 1781 #define MIPI_PAD_CTRL_PINGROUP(pg_name, r, b, f0, f1) \ ··· 2043 2043 2044 2044 static const struct tegra_pinctrl_soc_data tegra124_pinctrl = { 2045 2045 .ngpios = NUM_GPIOS, 2046 - .gpio_compatible = "nvidia,tegra30-gpio", 2046 + .gpio_compatible = "nvidia,tegra124-gpio", 2047 2047 .pins = tegra124_pins, 2048 2048 .npins = ARRAY_SIZE(tegra124_pins), 2049 2049 .functions = tegra124_functions,
+170
drivers/pinctrl/tegra/pinctrl-tegra194.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Pinctrl data for the NVIDIA Tegra194 pinmux 4 + * 5 + * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 6 + * 7 + * This program is free software; you can redistribute it and/or modify it 8 + * under the terms and conditions of the GNU General Public License, 9 + * version 2, as published by the Free Software Foundation. 10 + * 11 + * This program is distributed in the hope it will be useful, but WITHOUT 12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 + * more details. 15 + */ 16 + 17 + #include <linux/init.h> 18 + #include <linux/of.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/pinctrl/pinctrl.h> 21 + #include <linux/pinctrl/pinmux.h> 22 + 23 + #include "pinctrl-tegra.h" 24 + 25 + /* Define unique ID for each pins */ 26 + enum pin_id { 27 + TEGRA_PIN_PEX_L5_CLKREQ_N_PGG0 = 256, 28 + TEGRA_PIN_PEX_L5_RST_N_PGG1 = 257, 29 + TEGRA_PIN_NUM_GPIOS = 258, 30 + }; 31 + 32 + /* Table for pin descriptor */ 33 + static const struct pinctrl_pin_desc tegra194_pins[] = { 34 + PINCTRL_PIN(TEGRA_PIN_PEX_L5_CLKREQ_N_PGG0, 35 + "TEGRA_PIN_PEX_L5_CLKREQ_N_PGG0"), 36 + PINCTRL_PIN(TEGRA_PIN_PEX_L5_RST_N_PGG1, 37 + "TEGRA_PIN_PEX_L5_RST_N_PGG1"), 38 + }; 39 + 40 + static const unsigned int pex_l5_clkreq_n_pgg0_pins[] = { 41 + TEGRA_PIN_PEX_L5_CLKREQ_N_PGG0, 42 + }; 43 + 44 + static const unsigned int pex_l5_rst_n_pgg1_pins[] = { 45 + TEGRA_PIN_PEX_L5_RST_N_PGG1, 46 + }; 47 + 48 + /* Define unique ID for each function */ 49 + enum tegra_mux_dt { 50 + TEGRA_MUX_RSVD0, 51 + TEGRA_MUX_RSVD1, 52 + TEGRA_MUX_RSVD2, 53 + TEGRA_MUX_RSVD3, 54 + TEGRA_MUX_PE5, 55 + }; 56 + 57 + /* Make list of each function name */ 58 + #define TEGRA_PIN_FUNCTION(lid) \ 59 + { \ 60 + .name = #lid, \ 61 + } 62 + static struct tegra_function tegra194_functions[] = { 63 + TEGRA_PIN_FUNCTION(rsvd0), 64 + TEGRA_PIN_FUNCTION(rsvd1), 65 + TEGRA_PIN_FUNCTION(rsvd2), 66 + TEGRA_PIN_FUNCTION(rsvd3), 67 + TEGRA_PIN_FUNCTION(pe5), 68 + }; 69 + 70 + #define DRV_PINGROUP_ENTRY_Y(r, drvdn_b, drvdn_w, drvup_b, \ 71 + drvup_w, slwr_b, slwr_w, slwf_b, \ 72 + slwf_w, bank) \ 73 + .drv_reg = ((r)), \ 74 + .drv_bank = bank, \ 75 + .drvdn_bit = drvdn_b, \ 76 + .drvdn_width = drvdn_w, \ 77 + .drvup_bit = drvup_b, \ 78 + .drvup_width = drvup_w, \ 79 + .slwr_bit = slwr_b, \ 80 + .slwr_width = slwr_w, \ 81 + .slwf_bit = slwf_b, \ 82 + .slwf_width = slwf_w 83 + 84 + #define PIN_PINGROUP_ENTRY_Y(r, bank, pupd, e_lpbk, e_input, \ 85 + e_od, schmitt_b, drvtype) \ 86 + .mux_reg = ((r)), \ 87 + .lpmd_bit = -1, \ 88 + .lock_bit = -1, \ 89 + .hsm_bit = -1, \ 90 + .mux_bank = bank, \ 91 + .mux_bit = 0, \ 92 + .pupd_reg = ((r)), \ 93 + .pupd_bank = bank, \ 94 + .pupd_bit = 2, \ 95 + .tri_reg = ((r)), \ 96 + .tri_bank = bank, \ 97 + .tri_bit = 4, \ 98 + .einput_bit = e_input, \ 99 + .odrain_bit = e_od, \ 100 + .schmitt_bit = schmitt_b, \ 101 + .drvtype_bit = 13, \ 102 + .drv_reg = -1, \ 103 + .parked_bitmask = 0 104 + 105 + #define drive_pex_l5_clkreq_n_pgg0 \ 106 + DRV_PINGROUP_ENTRY_Y(0x14004, 12, 5, 20, 5, -1, -1, -1, -1, 0) 107 + #define drive_pex_l5_rst_n_pgg1 \ 108 + DRV_PINGROUP_ENTRY_Y(0x1400c, 12, 5, 20, 5, -1, -1, -1, -1, 0) 109 + 110 + #define PINGROUP(pg_name, f0, f1, f2, f3, r, bank, pupd, e_lpbk, \ 111 + e_input, e_lpdr, e_od, schmitt_b, drvtype, io_rail) \ 112 + { \ 113 + .name = #pg_name, \ 114 + .pins = pg_name##_pins, \ 115 + .npins = ARRAY_SIZE(pg_name##_pins), \ 116 + .funcs = { \ 117 + TEGRA_MUX_##f0, \ 118 + TEGRA_MUX_##f1, \ 119 + TEGRA_MUX_##f2, \ 120 + TEGRA_MUX_##f3, \ 121 + }, \ 122 + PIN_PINGROUP_ENTRY_Y(r, bank, pupd, e_lpbk, \ 123 + e_input, e_od, \ 124 + schmitt_b, drvtype), \ 125 + drive_##pg_name, \ 126 + } 127 + 128 + static const struct tegra_pingroup tegra194_groups[] = { 129 + PINGROUP(pex_l5_clkreq_n_pgg0, PE5, RSVD1, RSVD2, RSVD3, 0x14000, 0, 130 + Y, -1, 6, 8, 11, 12, N, "vddio_pex_ctl_2"), 131 + PINGROUP(pex_l5_rst_n_pgg1, PE5, RSVD1, RSVD2, RSVD3, 0x14008, 0, 132 + Y, -1, 6, 8, 11, 12, N, "vddio_pex_ctl_2"), 133 + }; 134 + 135 + static const struct tegra_pinctrl_soc_data tegra194_pinctrl = { 136 + .ngpios = TEGRA_PIN_NUM_GPIOS, 137 + .pins = tegra194_pins, 138 + .npins = ARRAY_SIZE(tegra194_pins), 139 + .functions = tegra194_functions, 140 + .nfunctions = ARRAY_SIZE(tegra194_functions), 141 + .groups = tegra194_groups, 142 + .ngroups = ARRAY_SIZE(tegra194_groups), 143 + .hsm_in_mux = true, 144 + .schmitt_in_mux = true, 145 + .drvtype_in_mux = true, 146 + }; 147 + 148 + static int tegra194_pinctrl_probe(struct platform_device *pdev) 149 + { 150 + return tegra_pinctrl_probe(pdev, &tegra194_pinctrl); 151 + } 152 + 153 + static const struct of_device_id tegra194_pinctrl_of_match[] = { 154 + { .compatible = "nvidia,tegra194-pinmux", }, 155 + { }, 156 + }; 157 + 158 + static struct platform_driver tegra194_pinctrl_driver = { 159 + .driver = { 160 + .name = "tegra194-pinctrl", 161 + .of_match_table = tegra194_pinctrl_of_match, 162 + }, 163 + .probe = tegra194_pinctrl_probe, 164 + }; 165 + 166 + static int __init tegra194_pinctrl_init(void) 167 + { 168 + return platform_driver_register(&tegra194_pinctrl_driver); 169 + } 170 + arch_initcall(tegra194_pinctrl_init);
+3 -3
drivers/pinctrl/tegra/pinctrl-tegra20.c
··· 1989 1989 .tri_reg = ((tri_r) - TRISTATE_REG_A), \ 1990 1990 .tri_bank = 0, \ 1991 1991 .tri_bit = tri_b, \ 1992 - .parked_bit = -1, \ 1993 1992 .einput_bit = -1, \ 1994 1993 .odrain_bit = -1, \ 1995 1994 .lock_bit = -1, \ 1996 1995 .ioreset_bit = -1, \ 1997 1996 .rcv_sel_bit = -1, \ 1998 1997 .drv_reg = -1, \ 1998 + .parked_bitmask = 0, \ 1999 1999 } 2000 2000 2001 2001 /* Pin groups with only pull up and pull down control */ ··· 2009 2009 .pupd_bank = 2, \ 2010 2010 .pupd_bit = pupd_b, \ 2011 2011 .drv_reg = -1, \ 2012 - .parked_bit = -1, \ 2012 + .parked_bitmask = 0, \ 2013 2013 } 2014 2014 2015 2015 /* Pin groups for drive strength registers (configurable version) */ ··· 2025 2025 .tri_reg = -1, \ 2026 2026 .drv_reg = ((r) - PINGROUP_REG_A), \ 2027 2027 .drv_bank = 3, \ 2028 - .parked_bit = -1, \ 2028 + .parked_bitmask = 0, \ 2029 2029 .hsm_bit = hsm_b, \ 2030 2030 .schmitt_bit = schmitt_b, \ 2031 2031 .lpmd_bit = lpmd_b, \
+31 -31
drivers/pinctrl/tegra/pinctrl-tegra210.c
··· 1302 1302 .lock_bit = 7, \ 1303 1303 .ioreset_bit = -1, \ 1304 1304 .rcv_sel_bit = PINGROUP_BIT_##e_io_hv(10), \ 1305 - .parked_bit = 5, \ 1306 1305 .hsm_bit = PINGROUP_BIT_##hsm(9), \ 1307 1306 .schmitt_bit = 12, \ 1308 1307 .drvtype_bit = PINGROUP_BIT_##drvtype(13), \ ··· 1316 1317 .slwr_width = slwr_w, \ 1317 1318 .slwf_bit = slwf_b, \ 1318 1319 .slwf_width = slwf_w, \ 1320 + .parked_bitmask = BIT(5), \ 1319 1321 } 1320 1322 1321 - #define DRV_PINGROUP(pg_name, r, drvdn_b, drvdn_w, drvup_b, drvup_w, \ 1322 - slwr_b, slwr_w, slwf_b, slwf_w) \ 1323 + #define DRV_PINGROUP(pg_name, r, prk_mask, drvdn_b, drvdn_w, drvup_b, \ 1324 + drvup_w, slwr_b, slwr_w, slwf_b, slwf_w) \ 1323 1325 { \ 1324 1326 .name = "drive_" #pg_name, \ 1325 1327 .pins = drive_##pg_name##_pins, \ ··· 1335 1335 .rcv_sel_bit = -1, \ 1336 1336 .drv_reg = DRV_PINGROUP_REG(r), \ 1337 1337 .drv_bank = 0, \ 1338 - .parked_bit = -1, \ 1339 1338 .hsm_bit = -1, \ 1340 1339 .schmitt_bit = -1, \ 1341 1340 .lpmd_bit = -1, \ ··· 1347 1348 .slwf_bit = slwf_b, \ 1348 1349 .slwf_width = slwf_w, \ 1349 1350 .drvtype_bit = -1, \ 1351 + .parked_bitmask = prk_mask, \ 1350 1352 } 1351 1353 1352 1354 static const struct tegra_pingroup tegra210_groups[] = { ··· 1515 1515 PINGROUP(pz4, SDMMC1, RSVD1, RSVD2, RSVD3, 0x328c, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1), 1516 1516 PINGROUP(pz5, SOC, RSVD1, RSVD2, RSVD3, 0x3290, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1), 1517 1517 1518 - /* pg_name, r, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b, slwr_w, slwf_b, slwf_w */ 1519 - DRV_PINGROUP(pa6, 0x9c0, 12, 5, 20, 5, -1, -1, -1, -1), 1520 - DRV_PINGROUP(pcc7, 0x9c4, 12, 5, 20, 5, -1, -1, -1, -1), 1521 - DRV_PINGROUP(pe6, 0x9c8, 12, 5, 20, 5, -1, -1, -1, -1), 1522 - DRV_PINGROUP(pe7, 0x9cc, 12, 5, 20, 5, -1, -1, -1, -1), 1523 - DRV_PINGROUP(ph6, 0x9d0, 12, 5, 20, 5, -1, -1, -1, -1), 1524 - DRV_PINGROUP(pk0, 0x9d4, -1, -1, -1, -1, 28, 2, 30, 2), 1525 - DRV_PINGROUP(pk1, 0x9d8, -1, -1, -1, -1, 28, 2, 30, 2), 1526 - DRV_PINGROUP(pk2, 0x9dc, -1, -1, -1, -1, 28, 2, 30, 2), 1527 - DRV_PINGROUP(pk3, 0x9e0, -1, -1, -1, -1, 28, 2, 30, 2), 1528 - DRV_PINGROUP(pk4, 0x9e4, -1, -1, -1, -1, 28, 2, 30, 2), 1529 - DRV_PINGROUP(pk5, 0x9e8, -1, -1, -1, -1, 28, 2, 30, 2), 1530 - DRV_PINGROUP(pk6, 0x9ec, -1, -1, -1, -1, 28, 2, 30, 2), 1531 - DRV_PINGROUP(pk7, 0x9f0, -1, -1, -1, -1, 28, 2, 30, 2), 1532 - DRV_PINGROUP(pl0, 0x9f4, -1, -1, -1, -1, 28, 2, 30, 2), 1533 - DRV_PINGROUP(pl1, 0x9f8, -1, -1, -1, -1, 28, 2, 30, 2), 1534 - DRV_PINGROUP(pz0, 0x9fc, 12, 7, 20, 7, -1, -1, -1, -1), 1535 - DRV_PINGROUP(pz1, 0xa00, 12, 7, 20, 7, -1, -1, -1, -1), 1536 - DRV_PINGROUP(pz2, 0xa04, 12, 7, 20, 7, -1, -1, -1, -1), 1537 - DRV_PINGROUP(pz3, 0xa08, 12, 7, 20, 7, -1, -1, -1, -1), 1538 - DRV_PINGROUP(pz4, 0xa0c, 12, 7, 20, 7, -1, -1, -1, -1), 1539 - DRV_PINGROUP(pz5, 0xa10, 12, 7, 20, 7, -1, -1, -1, -1), 1540 - DRV_PINGROUP(sdmmc1, 0xa98, 12, 7, 20, 7, 28, 2, 30, 2), 1541 - DRV_PINGROUP(sdmmc2, 0xa9c, 2, 6, 8, 6, 28, 2, 30, 2), 1542 - DRV_PINGROUP(sdmmc3, 0xab0, 12, 7, 20, 7, 28, 2, 30, 2), 1543 - DRV_PINGROUP(sdmmc4, 0xab4, 2, 6, 8, 6, 28, 2, 30, 2), 1518 + /* pg_name, r, prk_mask, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b, slwr_w, slwf_b, slwf_w */ 1519 + DRV_PINGROUP(pa6, 0x9c0, 0x0, 12, 5, 20, 5, -1, -1, -1, -1), 1520 + DRV_PINGROUP(pcc7, 0x9c4, 0x0, 12, 5, 20, 5, -1, -1, -1, -1), 1521 + DRV_PINGROUP(pe6, 0x9c8, 0x0, 12, 5, 20, 5, -1, -1, -1, -1), 1522 + DRV_PINGROUP(pe7, 0x9cc, 0x0, 12, 5, 20, 5, -1, -1, -1, -1), 1523 + DRV_PINGROUP(ph6, 0x9d0, 0x0, 12, 5, 20, 5, -1, -1, -1, -1), 1524 + DRV_PINGROUP(pk0, 0x9d4, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1525 + DRV_PINGROUP(pk1, 0x9d8, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1526 + DRV_PINGROUP(pk2, 0x9dc, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1527 + DRV_PINGROUP(pk3, 0x9e0, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1528 + DRV_PINGROUP(pk4, 0x9e4, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1529 + DRV_PINGROUP(pk5, 0x9e8, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1530 + DRV_PINGROUP(pk6, 0x9ec, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1531 + DRV_PINGROUP(pk7, 0x9f0, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1532 + DRV_PINGROUP(pl0, 0x9f4, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1533 + DRV_PINGROUP(pl1, 0x9f8, 0x0, -1, -1, -1, -1, 28, 2, 30, 2), 1534 + DRV_PINGROUP(pz0, 0x9fc, 0x0, 12, 7, 20, 7, -1, -1, -1, -1), 1535 + DRV_PINGROUP(pz1, 0xa00, 0x0, 12, 7, 20, 7, -1, -1, -1, -1), 1536 + DRV_PINGROUP(pz2, 0xa04, 0x0, 12, 7, 20, 7, -1, -1, -1, -1), 1537 + DRV_PINGROUP(pz3, 0xa08, 0x0, 12, 7, 20, 7, -1, -1, -1, -1), 1538 + DRV_PINGROUP(pz4, 0xa0c, 0x0, 12, 7, 20, 7, -1, -1, -1, -1), 1539 + DRV_PINGROUP(pz5, 0xa10, 0x0, 12, 7, 20, 7, -1, -1, -1, -1), 1540 + DRV_PINGROUP(sdmmc1, 0xa98, 0x0, 12, 7, 20, 7, 28, 2, 30, 2), 1541 + DRV_PINGROUP(sdmmc2, 0xa9c, 0x7ffc000, 2, 6, 8, 6, 28, 2, 30, 2), 1542 + DRV_PINGROUP(sdmmc3, 0xab0, 0x0, 12, 7, 20, 7, 28, 2, 30, 2), 1543 + DRV_PINGROUP(sdmmc4, 0xab4, 0x7ffc000, 2, 6, 8, 6, 28, 2, 30, 2), 1544 1544 }; 1545 1545 1546 1546 static const struct tegra_pinctrl_soc_data tegra210_pinctrl = { 1547 1547 .ngpios = NUM_GPIOS, 1548 - .gpio_compatible = "nvidia,tegra30-gpio", 1548 + .gpio_compatible = "nvidia,tegra210-gpio", 1549 1549 .pins = tegra210_pins, 1550 1550 .npins = ARRAY_SIZE(tegra210_pins), 1551 1551 .functions = tegra210_functions,
+2 -2
drivers/pinctrl/tegra/pinctrl-tegra30.c
··· 2133 2133 .lock_bit = 7, \ 2134 2134 .ioreset_bit = PINGROUP_BIT_##ior(8), \ 2135 2135 .rcv_sel_bit = -1, \ 2136 - .parked_bit = -1, \ 2137 2136 .drv_reg = -1, \ 2137 + .parked_bitmask = 0, \ 2138 2138 } 2139 2139 2140 2140 #define DRV_PINGROUP(pg_name, r, hsm_b, schmitt_b, lpmd_b, drvdn_b, \ ··· 2154 2154 .rcv_sel_bit = -1, \ 2155 2155 .drv_reg = DRV_PINGROUP_REG(r), \ 2156 2156 .drv_bank = 0, \ 2157 - .parked_bit = -1, \ 2158 2157 .hsm_bit = hsm_b, \ 2159 2158 .schmitt_bit = schmitt_b, \ 2160 2159 .lpmd_bit = lpmd_b, \ ··· 2166 2167 .slwf_bit = slwf_b, \ 2167 2168 .slwf_width = slwf_w, \ 2168 2169 .drvtype_bit = -1, \ 2170 + .parked_bitmask = 0, \ 2169 2171 } 2170 2172 2171 2173 static const struct tegra_pingroup tegra30_groups[] = {
+1
include/linux/gpio.h
··· 106 106 107 107 struct device; 108 108 struct gpio_chip; 109 + struct pinctrl_dev; 109 110 110 111 static inline bool gpio_is_valid(int number) 111 112 {
+2
include/linux/gpio/driver.h
··· 586 586 587 587 #else /* ! CONFIG_PINCTRL */ 588 588 589 + struct pinctrl_dev; 590 + 589 591 static inline int 590 592 gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 591 593 unsigned int gpio_offset, unsigned int pin_offset,
+9 -14
include/linux/pinctrl/pinconf-generic.h
··· 11 11 #ifndef __LINUX_PINCTRL_PINCONF_GENERIC_H 12 12 #define __LINUX_PINCTRL_PINCONF_GENERIC_H 13 13 14 + #include <linux/device.h> 15 + #include <linux/pinctrl/machine.h> 16 + 17 + struct pinctrl_dev; 18 + struct pinctrl_map; 19 + 14 20 /** 15 21 * enum pin_config_param - possible pin configuration parameters 16 22 * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it ··· 60 54 * push-pull mode, the argument is ignored. 61 55 * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current 62 56 * passed as argument. The argument is in mA. 57 + * @PIN_CONFIG_DRIVE_STRENGTH_UA: the pin will sink or source at most the current 58 + * passed as argument. The argument is in uA. 63 59 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, 64 60 * which means it will wait for signals to settle when reading inputs. The 65 61 * argument gives the debounce time in usecs. Setting the ··· 119 111 PIN_CONFIG_DRIVE_OPEN_SOURCE, 120 112 PIN_CONFIG_DRIVE_PUSH_PULL, 121 113 PIN_CONFIG_DRIVE_STRENGTH, 114 + PIN_CONFIG_DRIVE_STRENGTH_UA, 122 115 PIN_CONFIG_INPUT_DEBOUNCE, 123 116 PIN_CONFIG_INPUT_ENABLE, 124 117 PIN_CONFIG_INPUT_SCHMITT, ··· 164 155 return PIN_CONF_PACKED(param, argument); 165 156 } 166 157 167 - #ifdef CONFIG_GENERIC_PINCONF 168 - 169 - #ifdef CONFIG_DEBUG_FS 170 158 #define PCONFDUMP(a, b, c, d) { \ 171 159 .param = a, .display = b, .format = c, .has_arg = d \ 172 160 } ··· 174 168 const char * const format; 175 169 bool has_arg; 176 170 }; 177 - #endif /* CONFIG_DEBUG_FS */ 178 - 179 - #ifdef CONFIG_OF 180 - 181 - #include <linux/device.h> 182 - #include <linux/pinctrl/machine.h> 183 - struct pinctrl_dev; 184 - struct pinctrl_map; 185 171 186 172 struct pinconf_generic_params { 187 173 const char * const property; ··· 218 220 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, 219 221 PIN_MAP_TYPE_INVALID); 220 222 } 221 - #endif 222 - 223 - #endif /* CONFIG_GENERIC_PINCONF */ 224 223 225 224 #endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */
+1 -3
include/linux/pinctrl/pinconf.h
··· 11 11 #ifndef __LINUX_PINCTRL_PINCONF_H 12 12 #define __LINUX_PINCTRL_PINCONF_H 13 13 14 - #ifdef CONFIG_PINCONF 14 + #include <linux/types.h> 15 15 16 16 struct pinctrl_dev; 17 17 struct seq_file; ··· 63 63 struct seq_file *s, 64 64 unsigned long config); 65 65 }; 66 - 67 - #endif 68 66 69 67 #endif /* __LINUX_PINCTRL_PINCONF_H */
+5
include/linux/pinctrl/pinctrl-state.h
··· 3 3 * Standard pin control state definitions 4 4 */ 5 5 6 + #ifndef __LINUX_PINCTRL_PINCTRL_STATE_H 7 + #define __LINUX_PINCTRL_PINCTRL_STATE_H 8 + 6 9 /** 7 10 * @PINCTRL_STATE_DEFAULT: the state the pinctrl handle shall be put 8 11 * into as default, usually this means the pins are up and ready to ··· 34 31 #define PINCTRL_STATE_INIT "init" 35 32 #define PINCTRL_STATE_IDLE "idle" 36 33 #define PINCTRL_STATE_SLEEP "sleep" 34 + 35 + #endif /* __LINUX_PINCTRL_PINCTRL_STATE_H */
+5 -14
include/linux/pinctrl/pinctrl.h
··· 11 11 #ifndef __LINUX_PINCTRL_PINCTRL_H 12 12 #define __LINUX_PINCTRL_PINCTRL_H 13 13 14 - #ifdef CONFIG_PINCTRL 15 - 16 14 #include <linux/radix-tree.h> 17 15 #include <linux/list.h> 18 16 #include <linux/seq_file.h> ··· 122 124 * the hardware description 123 125 * @custom_conf_items: Information how to print @params in debugfs, must be 124 126 * the same size as the @custom_params, i.e. @num_custom_params 127 + * @link_consumers: If true create a device link between pinctrl and its 128 + * consumers (i.e. the devices requesting pin control states). This is 129 + * sometimes necessary to ascertain the right suspend/resume order for 130 + * example. 125 131 */ 126 132 struct pinctrl_desc { 127 133 const char *name; ··· 140 138 const struct pinconf_generic_params *custom_params; 141 139 const struct pin_config_item *custom_conf_items; 142 140 #endif 141 + bool link_consumers; 143 142 }; 144 143 145 144 /* External interface to pin controller */ ··· 169 166 extern void devm_pinctrl_unregister(struct device *dev, 170 167 struct pinctrl_dev *pctldev); 171 168 172 - extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin); 173 169 extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, 174 170 struct pinctrl_gpio_range *range); 175 171 extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, ··· 199 197 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 200 198 extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); 201 199 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 202 - #else 203 - 204 - struct pinctrl_dev; 205 - 206 - /* Sufficiently stupid default functions when pinctrl is not in use */ 207 - static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) 208 - { 209 - return pin >= 0; 210 - } 211 - 212 - #endif /* !CONFIG_PINCTRL */ 213 200 214 201 #endif /* __LINUX_PINCTRL_PINCTRL_H */
-4
include/linux/pinctrl/pinmux.h
··· 15 15 #include <linux/seq_file.h> 16 16 #include <linux/pinctrl/pinctrl.h> 17 17 18 - #ifdef CONFIG_PINMUX 19 - 20 18 struct pinctrl_dev; 21 19 22 20 /** ··· 81 83 bool input); 82 84 bool strict; 83 85 }; 84 - 85 - #endif /* CONFIG_PINMUX */ 86 86 87 87 #endif /* __LINUX_PINCTRL_PINMUX_H */