aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-05 14:45:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-05 14:45:33 -0400
commitd16605c9128a498f9b8575b5c43be95c45dbcfab (patch)
tree2df1db4222b7e942ca47517fa4f5ab07b9b31b6e
parentfe9e31383e9a271a9b404488704e00acd1747ee3 (diff)
parentac059e2aa01dcbbd7e0b2609abbef5790486fafe (diff)
Merge tag 'pinctrl-v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij: "This is the big bulk of pin control changes for the v4.14 kernel. There are just a few bigger changes (new drivers mostly) and then a lot of small patches all over the place. Core changes: - Decision to wrap the sleep mode of the Spreadtrum and in the future others into a specially tagged state. The generic DT bindings and the new Spreadtrum driver conforms to this. Others should be moved over if possible. New drivers: - Spreadtrum SoCs especially the SC9860 SoC. - Storlink/Cortina Gemini 3512 and 3516 SoCs. New subdrivers: - Intel Denverton subdriver. - Intel Cannon Lake subdriver. - Intel Lewisburg subdriver. - Allwinner sunxi: R40 subdriver for A10. - Socionext uniphier PXs3 subdriver. - Rockchip RK3128 subdriver. - Renesas SH-PFC R8A77995 subdriver. Miscellaneous: - Qualcomm APQ8064 can handle general purpose clock muxing. - Mediatek MT7623 PCIe mux data fixed up. - Intel GPIO IRQs are disabled during suspend. - Several fixes and addtions to Renesas r8a7796. - Qualcomm SPMI GPIO supports dtest route and LV/MV subtype. - Input schmitt trigger support in Rockchip RV1108. - Aspeed G4 and G5 USB host/device pin control control added. - Qualcomm IPQ4019 has matured with a few missing pin groups and control bits put in place. - Lots of constification, this is the latest in cocinelle fixes" * tag 'pinctrl-v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (147 commits) Revert "pinctrl: sunxi: Don't enforce bias disable (for now)" pinctrl: uniphier: fix members of rmii group for Pro4 pinctrl: Delete an error message pinctrl: core: Delete an error message pinctrl: intel: Read back TX buffer state pinctrl: rockchip: Add rv1108 recalculated iomux support pinctrl: intel: Decrease indentation in intel_gpio_set() pinctrl: rza1: Remove suffix from gpiochip label pinctrl: qcom: spmi-gpio: Correct power_source range check pinctrl: freescale: make mxs_regs const pinctrl: aspeed: Rework strap register write logic for the AST2500 pinctrl: rza1: off by one in rza1_parse_gpiochip() pinctrl: qcom: General Purpose clocks for apq8064 pinctrl: sprd: Add Spreadtrum pin control driver dt-bindings: pinctrl: Add DT bindings for Spreadtrum SC9860 pinctrl: Add sleep related state to indicate sleep related configs pinctrl: mediatek: update PCIe mux data for MT7623 pinctrl: intel: Add Intel Lewisburg GPIO support pinctrl: intel: Add Intel Cannon Lake PCH-H pin controller support pinctrl: aspeed: Fix ast2500 strap register write logic ...
-rw-r--r--Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt59
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,imx7ulp-pinctrl.txt61
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-aspeed.txt8
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt2
-rw-r--r--Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt1
-rw-r--r--Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt3
-rw-r--r--Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt6
-rw-r--r--Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt26
-rw-r--r--Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt1
-rw-r--r--Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt1
-rw-r--r--Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt83
-rw-r--r--Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt70
-rw-r--r--MAINTAINERS5
-rw-r--r--arch/arm/boot/dts/imx7ulp-pinfunc.h468
-rw-r--r--drivers/pinctrl/Kconfig8
-rw-r--r--drivers/pinctrl/Makefile2
-rw-r--r--drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c70
-rw-r--r--drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c64
-rw-r--r--drivers/pinctrl/aspeed/pinctrl-aspeed.c21
-rw-r--r--drivers/pinctrl/aspeed/pinctrl-aspeed.h1
-rw-r--r--drivers/pinctrl/bcm/pinctrl-bcm281xx.c2
-rw-r--r--drivers/pinctrl/bcm/pinctrl-bcm2835.c31
-rw-r--r--drivers/pinctrl/berlin/berlin.c4
-rw-r--r--drivers/pinctrl/core.c17
-rw-r--r--drivers/pinctrl/core.h6
-rw-r--r--drivers/pinctrl/devicetree.c9
-rw-r--r--drivers/pinctrl/freescale/Kconfig7
-rw-r--r--drivers/pinctrl/freescale/Makefile1
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx.c131
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx.h20
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx23.c2
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx28.c2
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx7ulp.c364
-rw-r--r--drivers/pinctrl/freescale/pinctrl-vf610.c25
-rw-r--r--drivers/pinctrl/intel/Kconfig19
-rw-r--r--drivers/pinctrl/intel/Makefile2
-rw-r--r--drivers/pinctrl/intel/pinctrl-baytrail.c4
-rw-r--r--drivers/pinctrl/intel/pinctrl-cannonlake.c424
-rw-r--r--drivers/pinctrl/intel/pinctrl-denverton.c302
-rw-r--r--drivers/pinctrl/intel/pinctrl-intel.c32
-rw-r--r--drivers/pinctrl/intel/pinctrl-lewisburg.c343
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h12
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-37xx.c6
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-abx500.c2
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-nomadik.c2
-rw-r--r--drivers/pinctrl/pinconf-generic.c9
-rw-r--r--drivers/pinctrl/pinconf.c14
-rw-r--r--drivers/pinctrl/pinconf.h24
-rw-r--r--drivers/pinctrl/pinctrl-adi2.c4
-rw-r--r--drivers/pinctrl/pinctrl-amd.c4
-rw-r--r--drivers/pinctrl/pinctrl-artpec6.c2
-rw-r--r--drivers/pinctrl/pinctrl-at91-pio4.c11
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c2
-rw-r--r--drivers/pinctrl/pinctrl-digicolor.c4
-rw-r--r--drivers/pinctrl/pinctrl-gemini.c2359
-rw-r--r--drivers/pinctrl/pinctrl-ingenic.c6
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c315
-rw-r--r--drivers/pinctrl/pinctrl-rza1.c10
-rw-r--r--drivers/pinctrl/pinctrl-st.c12
-rw-r--r--drivers/pinctrl/pinctrl-tb10x.c8
-rw-r--r--drivers/pinctrl/pinctrl-tz1090-pdc.c6
-rw-r--r--drivers/pinctrl/pinctrl-tz1090.c6
-rw-r--r--drivers/pinctrl/pinctrl-zynq.c34
-rw-r--r--drivers/pinctrl/pinmux.c16
-rw-r--r--drivers/pinctrl/pinmux.h29
-rw-r--r--drivers/pinctrl/qcom/pinctrl-apq8064.c42
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ipq4019.c432
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c27
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.h16
-rw-r--r--drivers/pinctrl/qcom/pinctrl-spmi-gpio.c323
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c2
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c2
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos.c32
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos.h1
-rw-r--r--drivers/pinctrl/samsung/pinctrl-s3c24xx.c37
-rw-r--r--drivers/pinctrl/samsung/pinctrl-s3c64xx.c40
-rw-r--r--drivers/pinctrl/samsung/pinctrl-samsung.c18
-rw-r--r--drivers/pinctrl/samsung/pinctrl-samsung.h15
-rw-r--r--drivers/pinctrl/sh-pfc/Kconfig5
-rw-r--r--drivers/pinctrl/sh-pfc/Makefile1
-rw-r--r--drivers/pinctrl/sh-pfc/core.c6
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7791.c15
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7795.c1082
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7796.c146
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77995.c1812
-rw-r--r--drivers/pinctrl/sh-pfc/pinctrl.c11
-rw-r--r--drivers/pinctrl/sh-pfc/sh_pfc.h23
-rw-r--r--drivers/pinctrl/sirf/pinctrl-atlas7.c13
-rw-r--r--drivers/pinctrl/sirf/pinctrl-sirf.c10
-rw-r--r--drivers/pinctrl/sprd/Kconfig17
-rw-r--r--drivers/pinctrl/sprd/Makefile2
-rw-r--r--drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c972
-rw-r--r--drivers/pinctrl/sprd/pinctrl-sprd.c1113
-rw-r--r--drivers/pinctrl/sprd/pinctrl-sprd.h67
-rw-r--r--drivers/pinctrl/stm32/pinctrl-stm32.c2
-rw-r--r--drivers/pinctrl/sunxi/Kconfig2
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c273
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c26
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c6
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c6
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c4
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c1
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sunxi.c3
-rw-r--r--drivers/pinctrl/tegra/pinctrl-tegra-xusb.c2
-rw-r--r--drivers/pinctrl/ti/pinctrl-ti-iodelay.c4
-rw-r--r--drivers/pinctrl/uniphier/Kconfig4
-rw-r--r--drivers/pinctrl/uniphier/Makefile1
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-core.c279
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c665
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c714
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c273
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c386
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c453
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c458
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c386
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c989
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c273
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier.h40
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c8
-rw-r--r--drivers/pinctrl/zte/pinctrl-zx.c7
-rw-r--r--include/dt-bindings/pinctrl/qcom,pmic-gpio.h2
-rw-r--r--include/dt-bindings/pinctrl/samsung.h3
-rw-r--r--include/linux/pinctrl/machine.h4
-rw-r--r--include/linux/pinctrl/pinconf-generic.h2
124 files changed, 13259 insertions, 3903 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt
new file mode 100644
index 000000000000..61466c58faae
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt
@@ -0,0 +1,59 @@
1Cortina Systems Gemini pin controller
2
3This pin controller is found in the Cortina Systems Gemini SoC family,
4see further arm/gemini.txt. It is a purely group-based multiplexing pin
5controller.
6
7The pin controller node must be a subnode of the system controller node.
8
9Required properties:
10- compatible: "cortina,gemini-pinctrl"
11
12Subnodes of the pin controller contain pin control multiplexing set-up.
13Please refer to pinctrl-bindings.txt for generic pin multiplexing nodes.
14
15Example:
16
17
18syscon {
19 compatible = "cortina,gemini-syscon";
20 ...
21 pinctrl {
22 compatible = "cortina,gemini-pinctrl";
23 pinctrl-names = "default";
24 pinctrl-0 = <&dram_default_pins>, <&system_default_pins>,
25 <&vcontrol_default_pins>;
26
27 dram_default_pins: pinctrl-dram {
28 mux {
29 function = "dram";
30 groups = "dramgrp";
31 };
32 };
33 rtc_default_pins: pinctrl-rtc {
34 mux {
35 function = "rtc";
36 groups = "rtcgrp";
37 };
38 };
39 power_default_pins: pinctrl-power {
40 mux {
41 function = "power";
42 groups = "powergrp";
43 };
44 };
45 system_default_pins: pinctrl-system {
46 mux {
47 function = "system";
48 groups = "systemgrp";
49 };
50 };
51 (...)
52 uart_default_pins: pinctrl-uart {
53 mux {
54 function = "uart";
55 groups = "uartrxtxgrp";
56 };
57 };
58 };
59};
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx7ulp-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx7ulp-pinctrl.txt
new file mode 100644
index 000000000000..44ad670ae11e
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx7ulp-pinctrl.txt
@@ -0,0 +1,61 @@
1* Freescale i.MX7ULP IOMUX Controller
2
3i.MX 7ULP has three IOMUXC instances: IOMUXC0 for M4 ports, IOMUXC1 for A7
4ports and IOMUXC DDR for DDR interface.
5
6Note:
7This binding doc is only for the IOMUXC1 support in A7 Domain and it only
8supports generic pin config.
9
10Please also refer pinctrl-bindings.txt in this directory for generic pinctrl
11binding.
12
13=== Pin Controller Node ===
14
15Required properties:
16- compatible: "fsl,imx7ulp-iomuxc1"
17- reg: Should contain the base physical address and size of the iomuxc
18 registers.
19
20=== Pin Configuration Node ===
21- pinmux: One integers array, represents a group of pins mux setting.
22 The format is pinmux = <PIN_FUNC_ID>, PIN_FUNC_ID is a pin working on
23 a specific function.
24
25 NOTE: i.MX7ULP PIN_FUNC_ID consists of 4 integers as it shares one mux
26 and config register as follows:
27 <mux_conf_reg input_reg mux_mode input_val>
28
29 Refer to imx7ulp-pinfunc.h in in device tree source folder for all
30 available imx7ulp PIN_FUNC_ID.
31
32Optional Properties:
33- drive-strength Integer. Controls Drive Strength
34 0: Standard
35 1: Hi Driver
36- drive-push-pull Bool. Enable Pin Push-pull
37- drive-open-drain Bool. Enable Pin Open-drian
38- slew-rate: Integer. Controls Slew Rate
39 0: Standard
40 1: Slow
41- bias-disable: Bool. Pull disabled
42- bias-pull-down: Bool. Pull down on pin
43- bias-pull-up: Bool. Pull up on pin
44
45Examples:
46#include "imx7ulp-pinfunc.h"
47
48/* Pin Controller Node */
49iomuxc1: iomuxc@40ac0000 {
50 compatible = "fsl,imx7ulp-iomuxc1";
51 reg = <0x40ac0000 0x1000>;
52
53 /* Pin Configuration Node */
54 pinctrl_lpuart4: lpuart4grp {
55 pinmux = <
56 IMX7ULP_PAD_PTC3__LPUART4_RX
57 IMX7ULP_PAD_PTC2__LPUART4_TX
58 >;
59 bias-pull-up;
60 };
61};
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-aspeed.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-aspeed.txt
index ca01710ee29a..3b7266c7c438 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-aspeed.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-aspeed.txt
@@ -69,8 +69,9 @@ PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7 RGMII1 RGMII2 RMII1 RMII2 ROM16 ROM8 ROMCS1
69ROMCS2 ROMCS3 ROMCS4 RXD1 RXD2 RXD3 RXD4 SALT1 SALT2 SALT3 SALT4 SD1 SD2 SGPMCK 69ROMCS2 ROMCS3 ROMCS4 RXD1 RXD2 RXD3 RXD4 SALT1 SALT2 SALT3 SALT4 SD1 SD2 SGPMCK
70SGPMI SGPMLD SGPMO SGPSCK SGPSI0 SGPSI1 SGPSLD SIOONCTRL SIOPBI SIOPBO SIOPWREQ 70SGPMI SGPMLD SGPMO SGPSCK SGPSI0 SGPSI1 SGPSLD SIOONCTRL SIOPBI SIOPBO SIOPWREQ
71SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1DEBUG SPI1PASSTHRU SPICS1 TIMER3 TIMER4 71SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1DEBUG SPI1PASSTHRU SPICS1 TIMER3 TIMER4
72TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 TXD3 TXD4 UART6 USBCKI VGABIOS_ROM VGAHS 72TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 TXD3 TXD4 UART6 USB11D1 USB11H2 USB2D1
73VGAVS VPI18 VPI24 VPI30 VPO12 VPO24 WDTRST1 WDTRST2 73USB2H1 USBCKI VGABIOS_ROM VGAHS VGAVS VPI18 VPI24 VPI30 VPO12 VPO24 WDTRST1
74WDTRST2
74 75
75aspeed,ast2500-pinctrl, aspeed,g5-pinctrl: 76aspeed,ast2500-pinctrl, aspeed,g5-pinctrl:
76 77
@@ -86,7 +87,8 @@ SALT11 SALT12 SALT13 SALT14 SALT2 SALT3 SALT4 SALT5 SALT6 SALT7 SALT8 SALT9
86SCL1 SCL2 SD1 SD2 SDA1 SDA2 SGPS1 SGPS2 SIOONCTRL SIOPBI SIOPBO SIOPWREQ 87SCL1 SCL2 SD1 SD2 SDA1 SDA2 SGPS1 SGPS2 SIOONCTRL SIOPBI SIOPBO SIOPWREQ
87SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1CS1 SPI1DEBUG SPI1PASSTHRU SPI2CK SPI2CS0 88SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1CS1 SPI1DEBUG SPI1PASSTHRU SPI2CK SPI2CS0
88SPI2CS1 SPI2MISO SPI2MOSI TIMER3 TIMER4 TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 89SPI2CS1 SPI2MISO SPI2MOSI TIMER3 TIMER4 TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2
89TXD3 TXD4 UART6 USBCKI VGABIOSROM VGAHS VGAVS VPI24 VPO WDTRST1 WDTRST2 90TXD3 TXD4 UART6 USB11BHID USB2AD USB2AH USB2BD USB2BH USBCKI VGABIOSROM VGAHS
91VGAVS VPI24 VPO WDTRST1 WDTRST2
90 92
91Examples 93Examples
92======== 94========
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
index 62d0f33fa65e..4483cc31e531 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
@@ -268,6 +268,8 @@ output-enable - enable output on a pin without actively driving it
268 (such as enabling an output buffer) 268 (such as enabling an output buffer)
269output-low - set the pin to output mode with low level 269output-low - set the pin to output mode with low level
270output-high - set the pin to output mode with high level 270output-high - set the pin to output mode with high level
271sleep-hardware-state - indicate this is sleep related state which will be programmed
272 into the registers for the sleep state.
271slew-rate - set the slew rate 273slew-rate - set the slew rate
272 274
273For example: 275For example:
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
index 17631d0a9af7..37d744750579 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
@@ -5,6 +5,7 @@ The Mediatek's Pin controller is used to control SoC pins.
5Required properties: 5Required properties:
6- compatible: value should be one of the following. 6- compatible: value should be one of the following.
7 "mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl. 7 "mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl.
8 "mediatek,mt2712-pinctrl", compatible with mt2712 pinctrl.
8 "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl. 9 "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl.
9 "mediatek,mt7623-pinctrl", compatible with mt7623 pinctrl. 10 "mediatek,mt7623-pinctrl", compatible with mt7623 pinctrl.
10 "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl. 11 "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl.
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
index a7bde64798c7..a752a4716486 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
@@ -46,7 +46,8 @@ Valid values for pins are:
46 gpio0-gpio89 46 gpio0-gpio89
47 47
48Valid values for function are: 48Valid values for function are:
49 cam_mclk, codec_mic_i2s, codec_spkr_i2s, gpio, gsbi1, gsbi2, gsbi3, gsbi4, 49 cam_mclk, codec_mic_i2s, codec_spkr_i2s, gp_clk_0a, gp_clk_0b, gp_clk_1a,
50 gp_clk_1b, gp_clk_2a, gp_clk_2b, gpio, gsbi1, gsbi2, gsbi3, gsbi4,
50 gsbi4_cam_i2c, gsbi5, gsbi5_spi_cs1, gsbi5_spi_cs2, gsbi5_spi_cs3, gsbi6, 51 gsbi4_cam_i2c, gsbi5, gsbi5_spi_cs1, gsbi5_spi_cs2, gsbi5_spi_cs3, gsbi6,
51 gsbi6_spi_cs1, gsbi6_spi_cs2, gsbi6_spi_cs3, gsbi7, gsbi7_spi_cs1, 52 gsbi6_spi_cs1, gsbi6_spi_cs2, gsbi6_spi_cs3, gsbi7, gsbi7_spi_cs1,
52 gsbi7_spi_cs2, gsbi7_spi_cs3, gsbi_cam_i2c, hdmi, mi2s, riva_bt, riva_fm, 53 gsbi7_spi_cs2, gsbi7_spi_cs3, gsbi_cam_i2c, hdmi, mi2s, riva_bt, riva_fm,
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
index cfb8500dd56b..93374f478b9e 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
@@ -50,7 +50,11 @@ Valid values for qcom,pins are:
50 Supports mux, bias and drive-strength 50 Supports mux, bias and drive-strength
51 51
52Valid values for qcom,function are: 52Valid values for qcom,function are:
53gpio, blsp_uart1, blsp_i2c0, blsp_i2c1, blsp_uart0, blsp_spi1, blsp_spi0 53aud_pin, audio_pwm, blsp_i2c0, blsp_i2c1, blsp_spi0, blsp_spi1, blsp_uart0,
54blsp_uart1, chip_rst, gpio, i2s_rx, i2s_spdif_in, i2s_spdif_out, i2s_td, i2s_tx,
55jtag, led0, led1, led2, led3, led4, led5, led6, led7, led8, led9, led10, led11,
56mdc, mdio, pcie, pmu, prng_rosc, qpic, rgmii, rmii, sdio, smart0, smart1,
57smart2, smart3, tm, wifi0, wifi1
54 58
55Example: 59Example:
56 60
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
index 8d893a874634..5b12c57e7f02 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
@@ -16,6 +16,7 @@ PMIC's from Qualcomm.
16 "qcom,pm8941-gpio" 16 "qcom,pm8941-gpio"
17 "qcom,pm8994-gpio" 17 "qcom,pm8994-gpio"
18 "qcom,pma8084-gpio" 18 "qcom,pma8084-gpio"
19 "qcom,pmi8994-gpio"
19 20
20 And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio" 21 And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio"
21 if the device is on an spmi bus or an ssbi bus respectively 22 if the device is on an spmi bus or an ssbi bus respectively
@@ -85,6 +86,7 @@ to specify in a pin configuration subnode:
85 gpio1-gpio36 for pm8941 86 gpio1-gpio36 for pm8941
86 gpio1-gpio22 for pm8994 87 gpio1-gpio22 for pm8994
87 gpio1-gpio22 for pma8084 88 gpio1-gpio22 for pma8084
89 gpio1-gpio10 for pmi8994
88 90
89- function: 91- function:
90 Usage: required 92 Usage: required
@@ -98,7 +100,10 @@ to specify in a pin configuration subnode:
98 "dtest1", 100 "dtest1",
99 "dtest2", 101 "dtest2",
100 "dtest3", 102 "dtest3",
101 "dtest4" 103 "dtest4",
104 And following values are supported by LV/MV GPIO subtypes:
105 "func3",
106 "func4"
102 107
103- bias-disable: 108- bias-disable:
104 Usage: optional 109 Usage: optional
@@ -183,6 +188,25 @@ to specify in a pin configuration subnode:
183 Value type: <none> 188 Value type: <none>
184 Definition: The specified pins are configured in open-source mode. 189 Definition: The specified pins are configured in open-source mode.
185 190
191- qcom,analog-pass:
192 Usage: optional
193 Value type: <none>
194 Definition: The specified pins are configured in analog-pass-through mode.
195
196- qcom,atest:
197 Usage: optional
198 Value type: <u32>
199 Definition: Selects ATEST rail to route to GPIO when it's configured
200 in analog-pass-through mode.
201 Valid values are 1-4 corresponding to ATEST1 to ATEST4.
202
203- qcom,dtest-buffer:
204 Usage: optional
205 Value type: <u32>
206 Definition: Selects DTEST rail to route to GPIO when it's configured
207 as digital input.
208 Valid values are 1-4 corresponding to DTEST1 to DTEST4.
209
186Example: 210Example:
187 211
188 pm8921_gpio: gpio@150 { 212 pm8921_gpio: gpio@150 {
diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt
index 645082f03259..f4d127df980d 100644
--- a/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt
@@ -24,6 +24,7 @@ Required Properties:
24 - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller. 24 - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller.
25 - "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller. 25 - "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller.
26 - "renesas,pfc-r8a7796": for R8A7796 (R-Car M3-W) compatible pin-controller. 26 - "renesas,pfc-r8a7796": for R8A7796 (R-Car M3-W) compatible pin-controller.
27 - "renesas,pfc-r8a77995": for R8A77995 (R-Car D3) compatible pin-controller.
27 - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller. 28 - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.
28 29
29 - reg: Base address and length of each memory resource used by the pin 30 - reg: Base address and length of each memory resource used by the pin
diff --git a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
index ee01ab58224d..58b7921b4fed 100644
--- a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
@@ -24,6 +24,7 @@ Required properties for iomux controller:
24 "rockchip,rk2928-pinctrl": for Rockchip RK2928 24 "rockchip,rk2928-pinctrl": for Rockchip RK2928
25 "rockchip,rk3066a-pinctrl": for Rockchip RK3066a 25 "rockchip,rk3066a-pinctrl": for Rockchip RK3066a
26 "rockchip,rk3066b-pinctrl": for Rockchip RK3066b 26 "rockchip,rk3066b-pinctrl": for Rockchip RK3066b
27 "rockchip,rk3128-pinctrl": for Rockchip RK3128
27 "rockchip,rk3188-pinctrl": for Rockchip RK3188 28 "rockchip,rk3188-pinctrl": for Rockchip RK3188
28 "rockchip,rk3228-pinctrl": for Rockchip RK3228 29 "rockchip,rk3228-pinctrl": for Rockchip RK3228
29 "rockchip,rk3288-pinctrl": for Rockchip RK3288 30 "rockchip,rk3288-pinctrl": for Rockchip RK3288
diff --git a/Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt
new file mode 100644
index 000000000000..b1cea7a3a071
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt
@@ -0,0 +1,83 @@
1* Spreadtrum Pin Controller
2
3The Spreadtrum pin controller are organized in 3 blocks (types).
4
5The first block comprises some global control registers, and each
6register contains several bit fields with one bit or several bits
7to configure for some global common configuration, such as domain
8pad driving level, system control select and so on ("domain pad
9driving level": One pin can output 3.0v or 1.8v, depending on the
10related domain pad driving selection, if the related domain pad
11slect 3.0v, then the pin can output 3.0v. "system control" is used
12to choose one function (like: UART0) for which system, since we
13have several systems (AP/CP/CM4) on one SoC.).
14
15There are too much various configuration that we can not list all
16of them, so we can not make every Spreadtrum-special configuration
17as one generic configuration, and maybe it will add more strange
18global configuration in future. Then we add one "sprd,control" to
19set these various global control configuration, and we need use
20magic number for this property.
21
22Moreover we recognise every fields comprising one bit or several
23bits in one global control register as one pin, thus we should
24record every pin's bit offset, bit width and register offset to
25configure this field (pin).
26
27The second block comprises some common registers which have unified
28register definition, and each register described one pin is used
29to configure the pin sleep mode, function select and sleep related
30configuration.
31
32Now we have 4 systems for sleep mode on SC9860 SoC: AP system,
33PUBCP system, TGLDSP system and AGDSP system. And the pin sleep
34related configuration are:
35- input-enable
36- input-disable
37- output-high
38- output-low
39- bias-pull-up
40- bias-pull-down
41
42In some situation we need set the pin sleep mode and pin sleep related
43configuration, to set the pin sleep related configuration automatically
44by hardware when the system specified by sleep mode goes into deep
45sleep mode. For example, if we set the pin sleep mode as PUBCP_SLEEP
46and set the pin sleep related configuration as "input-enable", which
47means when PUBCP system goes into deep sleep mode, this pin will be set
48input enable automatically.
49
50Moreover we can not use the "sleep" state, since some systems (like:
51PUBCP system) do not run linux kernel OS (only AP system run linux
52kernel on SC9860 platform), then we can not select "sleep" state
53when the PUBCP system goes into deep sleep mode. Thus we introduce
54"sprd,sleep-mode" property to set pin sleep mode.
55
56The last block comprises some misc registers which also have unified
57register definition, and each register described one pin is used to
58configure drive strength, pull up/down and so on. Especially for pull
59up, we have two kind pull up resistor: 20K and 4.7K.
60
61Required properties for Spreadtrum pin controller:
62- compatible: "sprd,<soc>-pinctrl"
63 Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported SoCs.
64- reg: The register address of pin controller device.
65- pins : An array of pin names.
66
67Optional properties:
68- function: Specified the function name.
69- drive-strength: Drive strength in mA.
70- input-schmitt-disable: Enable schmitt-trigger mode.
71- input-schmitt-enable: Disable schmitt-trigger mode.
72- bias-disable: Disable pin bias.
73- bias-pull-down: Pull down on pin.
74- bias-pull-up: Pull up on pin.
75- input-enable: Enable pin input.
76- input-disable: Enable pin output.
77- output-high: Set the pin as an output level high.
78- output-low: Set the pin as an output level low.
79- sleep-hardware-state: Indicate these configs in this state are sleep related.
80- sprd,control: Control values referring to databook for global control pins.
81- sprd,sleep-mode: Sleep mode selection.
82
83Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported values.
diff --git a/Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt
new file mode 100644
index 000000000000..5a628333d52f
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt
@@ -0,0 +1,70 @@
1* Spreadtrum SC9860 Pin Controller
2
3Please refer to sprd,pinctrl.txt in this directory for common binding part
4and usage.
5
6Required properties:
7- compatible: Must be "sprd,sc9860-pinctrl".
8- reg: The register address of pin controller device.
9- pins : An array of strings, each string containing the name of a pin.
10
11Optional properties:
12- function: A string containing the name of the function, values must be
13 one of: "func1", "func2", "func3" and "func4".
14- drive-strength: Drive strength in mA. Supported values: 2, 4, 6, 8, 10,
15 12, 14, 16, 20, 21, 24, 25, 27, 29, 31 and 33.
16- input-schmitt-disable: Enable schmitt-trigger mode.
17- input-schmitt-enable: Disable schmitt-trigger mode.
18- bias-disable: Disable pin bias.
19- bias-pull-down: Pull down on pin.
20- bias-pull-up: Pull up on pin. Supported values: 20000 for pull-up resistor
21 is 20K and 4700 for pull-up resistor is 4.7K.
22- input-enable: Enable pin input.
23- input-disable: Enable pin output.
24- output-high: Set the pin as an output level high.
25- output-low: Set the pin as an output level low.
26- sleep-hardware-state: Indicate these configs in this state are sleep related.
27- sprd,control: Control values referring to databook for global control pins.
28- sprd,sleep-mode: Choose the pin sleep mode, and supported values are:
29 AP_SLEEP, PUBCP_SLEEP, TGLDSP_SLEEP and AGDSP_SLEEP.
30
31Pin sleep mode definition:
32enum pin_sleep_mode {
33 AP_SLEEP = BIT(0),
34 PUBCP_SLEEP = BIT(1),
35 TGLDSP_SLEEP = BIT(2),
36 AGDSP_SLEEP = BIT(3),
37};
38
39Example:
40pin_controller: pinctrl@402a0000 {
41 compatible = "sprd,sc9860-pinctrl";
42 reg = <0x402a0000 0x10000>;
43
44 grp1: sd0 {
45 pins = "SC9860_VIO_SD2_IRTE", "SC9860_VIO_SD0_IRTE";
46 sprd,control = <0x1>;
47 };
48
49 grp2: rfctl_33 {
50 pins = "SC9860_RFCTL33";
51 function = "func2";
52 sprd,sleep-mode = <AP_SLEEP | PUBCP_SLEEP>;
53 grp2_sleep_mode: rfctl_33_sleep {
54 pins = "SC9860_RFCTL33";
55 sleep-hardware-state;
56 output-low;
57 }
58 };
59
60 grp3: rfctl_misc_20 {
61 pins = "SC9860_RFCTL20_MISC";
62 drive-strength = <10>;
63 bias-pull-up = <4700>;
64 grp3_sleep_mode: rfctl_misc_sleep {
65 pins = "SC9860_RFCTL20_MISC";
66 sleep-hardware-state;
67 bias-pull-up;
68 }
69 };
70};
diff --git a/MAINTAINERS b/MAINTAINERS
index a90fe134ceb1..c8b2c7e798fa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1282,10 +1282,15 @@ S: Maintained
1282 1282
1283ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE 1283ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE
1284M: Hans Ulli Kroll <ulli.kroll@googlemail.com> 1284M: Hans Ulli Kroll <ulli.kroll@googlemail.com>
1285M: Linus Walleij <linus.walleij@linaro.org>
1285L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1286L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1286T: git git://github.com/ulli-kroll/linux.git 1287T: git git://github.com/ulli-kroll/linux.git
1287S: Maintained 1288S: Maintained
1289F: Documentation/devicetree/bindings/arm/gemini.txt
1290F: Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt
1291F: Documentation/devicetree/bindings/rtc/faraday,ftrtc010.txt
1288F: arch/arm/mach-gemini/ 1292F: arch/arm/mach-gemini/
1293F: drivers/pinctrl/pinctrl-gemini.c
1289F: drivers/rtc/rtc-ftrtc010.c 1294F: drivers/rtc/rtc-ftrtc010.c
1290 1295
1291ARM/CSR SIRFPRIMA2 MACHINE SUPPORT 1296ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
diff --git a/arch/arm/boot/dts/imx7ulp-pinfunc.h b/arch/arm/boot/dts/imx7ulp-pinfunc.h
new file mode 100644
index 000000000000..fe511775b518
--- /dev/null
+++ b/arch/arm/boot/dts/imx7ulp-pinfunc.h
@@ -0,0 +1,468 @@
1/*
2 * Copyright 2016 Freescale Semiconductor, Inc.
3 * Copyright 2017 NXP
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
10
11#ifndef __DTS_IMX7ULP_PINFUNC_H
12#define __DTS_IMX7ULP_PINFUNC_H
13
14/*
15 * The pin function ID is a tuple of
16 * <mux_conf_reg input_reg mux_mode input_val>
17 */
18
19#define IMX7ULP_PAD_PTC0__PTC0 0x0000 0x0000 0x1 0x0
20#define IMX7ULP_PAD_PTC0__TRACE_D15 0x0000 0x0000 0xa 0x0
21#define IMX7ULP_PAD_PTC0__LPUART4_CTS_B 0x0000 0x0244 0x4 0x1
22#define IMX7ULP_PAD_PTC0__LPI2C4_SCL 0x0000 0x0278 0x5 0x1
23#define IMX7ULP_PAD_PTC0__TPM4_CLKIN 0x0000 0x0298 0x6 0x1
24#define IMX7ULP_PAD_PTC0__FB_AD0 0x0000 0x0000 0x9 0x0
25#define IMX7ULP_PAD_PTC1__PTC1 0x0004 0x0000 0x1 0x0
26#define IMX7ULP_PAD_PTC1__TRACE_D14 0x0004 0x0000 0xa 0x0
27#define IMX7ULP_PAD_PTC1__LPUART4_RTS_B 0x0004 0x0000 0x4 0x0
28#define IMX7ULP_PAD_PTC1__LPI2C4_SDA 0x0004 0x027c 0x5 0x1
29#define IMX7ULP_PAD_PTC1__TPM4_CH0 0x0004 0x0280 0x6 0x1
30#define IMX7ULP_PAD_PTC1__FB_AD1 0x0004 0x0000 0x9 0x0
31#define IMX7ULP_PAD_PTC2__PTC2 0x0008 0x0000 0x1 0x0
32#define IMX7ULP_PAD_PTC2__TRACE_D13 0x0008 0x0000 0xa 0x0
33#define IMX7ULP_PAD_PTC2__LPUART4_TX 0x0008 0x024c 0x4 0x1
34#define IMX7ULP_PAD_PTC2__LPI2C4_HREQ 0x0008 0x0274 0x5 0x1
35#define IMX7ULP_PAD_PTC2__TPM4_CH1 0x0008 0x0284 0x6 0x1
36#define IMX7ULP_PAD_PTC2__FB_AD2 0x0008 0x0000 0x9 0x0
37#define IMX7ULP_PAD_PTC3__PTC3 0x000c 0x0000 0x1 0x0
38#define IMX7ULP_PAD_PTC3__TRACE_D12 0x000c 0x0000 0xa 0x0
39#define IMX7ULP_PAD_PTC3__LPUART4_RX 0x000c 0x0248 0x4 0x1
40#define IMX7ULP_PAD_PTC3__TPM4_CH2 0x000c 0x0288 0x6 0x1
41#define IMX7ULP_PAD_PTC3__FB_AD3 0x000c 0x0000 0x9 0x0
42#define IMX7ULP_PAD_PTC4__PTC4 0x0010 0x0000 0x1 0x0
43#define IMX7ULP_PAD_PTC4__TRACE_D11 0x0010 0x0000 0xa 0x0
44#define IMX7ULP_PAD_PTC4__FXIO1_D0 0x0010 0x0204 0x2 0x1
45#define IMX7ULP_PAD_PTC4__LPSPI2_PCS1 0x0010 0x02a0 0x3 0x1
46#define IMX7ULP_PAD_PTC4__LPUART5_CTS_B 0x0010 0x0250 0x4 0x1
47#define IMX7ULP_PAD_PTC4__LPI2C5_SCL 0x0010 0x02bc 0x5 0x1
48#define IMX7ULP_PAD_PTC4__TPM4_CH3 0x0010 0x028c 0x6 0x1
49#define IMX7ULP_PAD_PTC4__FB_AD4 0x0010 0x0000 0x9 0x0
50#define IMX7ULP_PAD_PTC5__PTC5 0x0014 0x0000 0x1 0x0
51#define IMX7ULP_PAD_PTC5__TRACE_D10 0x0014 0x0000 0xa 0x0
52#define IMX7ULP_PAD_PTC5__FXIO1_D1 0x0014 0x0208 0x2 0x1
53#define IMX7ULP_PAD_PTC5__LPSPI2_PCS2 0x0014 0x02a4 0x3 0x1
54#define IMX7ULP_PAD_PTC5__LPUART5_RTS_B 0x0014 0x0000 0x4 0x0
55#define IMX7ULP_PAD_PTC5__LPI2C5_SDA 0x0014 0x02c0 0x5 0x1
56#define IMX7ULP_PAD_PTC5__TPM4_CH4 0x0014 0x0290 0x6 0x1
57#define IMX7ULP_PAD_PTC5__FB_AD5 0x0014 0x0000 0x9 0x0
58#define IMX7ULP_PAD_PTC6__PTC6 0x0018 0x0000 0x1 0x0
59#define IMX7ULP_PAD_PTC6__TRACE_D9 0x0018 0x0000 0xa 0x0
60#define IMX7ULP_PAD_PTC6__FXIO1_D2 0x0018 0x020c 0x2 0x1
61#define IMX7ULP_PAD_PTC6__LPSPI2_PCS3 0x0018 0x02a8 0x3 0x1
62#define IMX7ULP_PAD_PTC6__LPUART5_TX 0x0018 0x0258 0x4 0x1
63#define IMX7ULP_PAD_PTC6__LPI2C5_HREQ 0x0018 0x02b8 0x5 0x1
64#define IMX7ULP_PAD_PTC6__TPM4_CH5 0x0018 0x0294 0x6 0x1
65#define IMX7ULP_PAD_PTC6__FB_AD6 0x0018 0x0000 0x9 0x0
66#define IMX7ULP_PAD_PTC7__PTC7 0x001c 0x0000 0x1 0x0
67#define IMX7ULP_PAD_PTC7__TRACE_D8 0x001c 0x0000 0xa 0x0
68#define IMX7ULP_PAD_PTC7__FXIO1_D3 0x001c 0x0210 0x2 0x1
69#define IMX7ULP_PAD_PTC7__LPUART5_RX 0x001c 0x0254 0x4 0x1
70#define IMX7ULP_PAD_PTC7__TPM5_CH1 0x001c 0x02c8 0x6 0x1
71#define IMX7ULP_PAD_PTC7__FB_AD7 0x001c 0x0000 0x9 0x0
72#define IMX7ULP_PAD_PTC8__PTC8 0x0020 0x0000 0x1 0x0
73#define IMX7ULP_PAD_PTC8__TRACE_D7 0x0020 0x0000 0xa 0x0
74#define IMX7ULP_PAD_PTC8__FXIO1_D4 0x0020 0x0214 0x2 0x1
75#define IMX7ULP_PAD_PTC8__LPSPI2_SIN 0x0020 0x02b0 0x3 0x1
76#define IMX7ULP_PAD_PTC8__LPUART6_CTS_B 0x0020 0x025c 0x4 0x1
77#define IMX7ULP_PAD_PTC8__LPI2C6_SCL 0x0020 0x02fc 0x5 0x1
78#define IMX7ULP_PAD_PTC8__TPM5_CLKIN 0x0020 0x02cc 0x6 0x1
79#define IMX7ULP_PAD_PTC8__FB_AD8 0x0020 0x0000 0x9 0x0
80#define IMX7ULP_PAD_PTC9__PTC9 0x0024 0x0000 0x1 0x0
81#define IMX7ULP_PAD_PTC9__TRACE_D6 0x0024 0x0000 0xa 0x0
82#define IMX7ULP_PAD_PTC9__FXIO1_D5 0x0024 0x0218 0x2 0x1
83#define IMX7ULP_PAD_PTC9__LPSPI2_SOUT 0x0024 0x02b4 0x3 0x1
84#define IMX7ULP_PAD_PTC9__LPUART6_RTS_B 0x0024 0x0000 0x4 0x0
85#define IMX7ULP_PAD_PTC9__LPI2C6_SDA 0x0024 0x0300 0x5 0x1
86#define IMX7ULP_PAD_PTC9__TPM5_CH0 0x0024 0x02c4 0x6 0x1
87#define IMX7ULP_PAD_PTC9__FB_AD9 0x0024 0x0000 0x9 0x0
88#define IMX7ULP_PAD_PTC10__PTC10 0x0028 0x0000 0x1 0x0
89#define IMX7ULP_PAD_PTC10__TRACE_D5 0x0028 0x0000 0xa 0x0
90#define IMX7ULP_PAD_PTC10__FXIO1_D6 0x0028 0x021c 0x2 0x1
91#define IMX7ULP_PAD_PTC10__LPSPI2_SCK 0x0028 0x02ac 0x3 0x1
92#define IMX7ULP_PAD_PTC10__LPUART6_TX 0x0028 0x0264 0x4 0x1
93#define IMX7ULP_PAD_PTC10__LPI2C6_HREQ 0x0028 0x02f8 0x5 0x1
94#define IMX7ULP_PAD_PTC10__TPM7_CH3 0x0028 0x02e8 0x6 0x1
95#define IMX7ULP_PAD_PTC10__FB_AD10 0x0028 0x0000 0x9 0x0
96#define IMX7ULP_PAD_PTC11__PTC11 0x002c 0x0000 0x1 0x0
97#define IMX7ULP_PAD_PTC11__TRACE_D4 0x002c 0x0000 0xa 0x0
98#define IMX7ULP_PAD_PTC11__FXIO1_D7 0x002c 0x0220 0x2 0x1
99#define IMX7ULP_PAD_PTC11__LPSPI2_PCS0 0x002c 0x029c 0x3 0x1
100#define IMX7ULP_PAD_PTC11__LPUART6_RX 0x002c 0x0260 0x4 0x1
101#define IMX7ULP_PAD_PTC11__TPM7_CH4 0x002c 0x02ec 0x6 0x1
102#define IMX7ULP_PAD_PTC11__FB_AD11 0x002c 0x0000 0x9 0x0
103#define IMX7ULP_PAD_PTC12__PTC12 0x0030 0x0000 0x1 0x0
104#define IMX7ULP_PAD_PTC12__TRACE_D3 0x0030 0x0000 0xa 0x0
105#define IMX7ULP_PAD_PTC12__FXIO1_D8 0x0030 0x0224 0x2 0x1
106#define IMX7ULP_PAD_PTC12__LPSPI3_PCS1 0x0030 0x0314 0x3 0x1
107#define IMX7ULP_PAD_PTC12__LPUART7_CTS_B 0x0030 0x0268 0x4 0x1
108#define IMX7ULP_PAD_PTC12__LPI2C7_SCL 0x0030 0x0308 0x5 0x1
109#define IMX7ULP_PAD_PTC12__TPM7_CH5 0x0030 0x02f0 0x6 0x1
110#define IMX7ULP_PAD_PTC12__FB_AD12 0x0030 0x0000 0x9 0x0
111#define IMX7ULP_PAD_PTC13__PTC13 0x0034 0x0000 0x1 0x0
112#define IMX7ULP_PAD_PTC13__TRACE_D2 0x0034 0x0000 0xa 0x0
113#define IMX7ULP_PAD_PTC13__FXIO1_D9 0x0034 0x0228 0x2 0x1
114#define IMX7ULP_PAD_PTC13__LPSPI3_PCS2 0x0034 0x0318 0x3 0x1
115#define IMX7ULP_PAD_PTC13__LPUART7_RTS_B 0x0034 0x0000 0x4 0x0
116#define IMX7ULP_PAD_PTC13__LPI2C7_SDA 0x0034 0x030c 0x5 0x1
117#define IMX7ULP_PAD_PTC13__TPM7_CLKIN 0x0034 0x02f4 0x6 0x1
118#define IMX7ULP_PAD_PTC13__FB_AD13 0x0034 0x0000 0x9 0x0
119#define IMX7ULP_PAD_PTC14__PTC14 0x0038 0x0000 0x1 0x0
120#define IMX7ULP_PAD_PTC14__TRACE_D1 0x0038 0x0000 0xa 0x0
121#define IMX7ULP_PAD_PTC14__FXIO1_D10 0x0038 0x022c 0x2 0x1
122#define IMX7ULP_PAD_PTC14__LPSPI3_PCS3 0x0038 0x031c 0x3 0x1
123#define IMX7ULP_PAD_PTC14__LPUART7_TX 0x0038 0x0270 0x4 0x1
124#define IMX7ULP_PAD_PTC14__LPI2C7_HREQ 0x0038 0x0304 0x5 0x1
125#define IMX7ULP_PAD_PTC14__TPM7_CH0 0x0038 0x02dc 0x6 0x1
126#define IMX7ULP_PAD_PTC14__FB_AD14 0x0038 0x0000 0x9 0x0
127#define IMX7ULP_PAD_PTC15__PTC15 0x003c 0x0000 0x1 0x0
128#define IMX7ULP_PAD_PTC15__TRACE_D0 0x003c 0x0000 0xa 0x0
129#define IMX7ULP_PAD_PTC15__FXIO1_D11 0x003c 0x0230 0x2 0x1
130#define IMX7ULP_PAD_PTC15__LPUART7_RX 0x003c 0x026c 0x4 0x1
131#define IMX7ULP_PAD_PTC15__TPM7_CH1 0x003c 0x02e0 0x6 0x1
132#define IMX7ULP_PAD_PTC15__FB_AD15 0x003c 0x0000 0x9 0x0
133#define IMX7ULP_PAD_PTC16__PTC16 0x0040 0x0000 0x1 0x0
134#define IMX7ULP_PAD_PTC16__TRACE_CLKOUT 0x0040 0x0000 0xa 0x0
135#define IMX7ULP_PAD_PTC16__FXIO1_D12 0x0040 0x0234 0x2 0x1
136#define IMX7ULP_PAD_PTC16__LPSPI3_SIN 0x0040 0x0324 0x3 0x1
137#define IMX7ULP_PAD_PTC16__TPM7_CH2 0x0040 0x02e4 0x6 0x1
138#define IMX7ULP_PAD_PTC16__FB_ALE_FB_CS1_B_FB_TS_B 0x0040 0x0000 0x9 0x0
139#define IMX7ULP_PAD_PTC17__PTC17 0x0044 0x0000 0x1 0x0
140#define IMX7ULP_PAD_PTC17__FXIO1_D13 0x0044 0x0238 0x2 0x1
141#define IMX7ULP_PAD_PTC17__LPSPI3_SOUT 0x0044 0x0328 0x3 0x1
142#define IMX7ULP_PAD_PTC17__TPM6_CLKIN 0x0044 0x02d8 0x6 0x1
143#define IMX7ULP_PAD_PTC17__FB_CS0_B 0x0044 0x0000 0x9 0x0
144#define IMX7ULP_PAD_PTC18__PTC18 0x0048 0x0000 0x1 0x0
145#define IMX7ULP_PAD_PTC18__FXIO1_D14 0x0048 0x023c 0x2 0x1
146#define IMX7ULP_PAD_PTC18__LPSPI3_SCK 0x0048 0x0320 0x3 0x1
147#define IMX7ULP_PAD_PTC18__TPM6_CH0 0x0048 0x02d0 0x6 0x1
148#define IMX7ULP_PAD_PTC18__FB_OE_B 0x0048 0x0000 0x9 0x0
149#define IMX7ULP_PAD_PTC19__PTC19 0x004c 0x0000 0x1 0x0
150#define IMX7ULP_PAD_PTC19__FXIO1_D15 0x004c 0x0240 0x2 0x1
151#define IMX7ULP_PAD_PTC19__LPSPI3_PCS0 0x004c 0x0310 0x3 0x1
152#define IMX7ULP_PAD_PTC19__TPM6_CH1 0x004c 0x02d4 0x6 0x1
153#define IMX7ULP_PAD_PTC19__FB_A16 0x004c 0x0000 0x9 0x0
154#define IMX7ULP_PAD_PTD0__PTD0 0x0080 0x0000 0x1 0x0
155#define IMX7ULP_PAD_PTD0__SDHC0_RESET_B 0x0080 0x0000 0x8 0x0
156#define IMX7ULP_PAD_PTD1__PTD1 0x0084 0x0000 0x1 0x0
157#define IMX7ULP_PAD_PTD1__SDHC0_CMD 0x0084 0x0000 0x8 0x0
158#define IMX7ULP_PAD_PTD2__PTD2 0x0088 0x0000 0x1 0x0
159#define IMX7ULP_PAD_PTD2__SDHC0_CLK 0x0088 0x0000 0x8 0x0
160#define IMX7ULP_PAD_PTD3__PTD3 0x008c 0x0000 0x1 0x0
161#define IMX7ULP_PAD_PTD3__SDHC0_D7 0x008c 0x0000 0x8 0x0
162#define IMX7ULP_PAD_PTD4__PTD4 0x0090 0x0000 0x1 0x0
163#define IMX7ULP_PAD_PTD4__SDHC0_D6 0x0090 0x0000 0x8 0x0
164#define IMX7ULP_PAD_PTD5__PTD5 0x0094 0x0000 0x1 0x0
165#define IMX7ULP_PAD_PTD5__SDHC0_D5 0x0094 0x0000 0x8 0x0
166#define IMX7ULP_PAD_PTD6__PTD6 0x0098 0x0000 0x1 0x0
167#define IMX7ULP_PAD_PTD6__SDHC0_D4 0x0098 0x0000 0x8 0x0
168#define IMX7ULP_PAD_PTD7__PTD7 0x009c 0x0000 0x1 0x0
169#define IMX7ULP_PAD_PTD7__SDHC0_D3 0x009c 0x0000 0x8 0x0
170#define IMX7ULP_PAD_PTD8__PTD8 0x00a0 0x0000 0x1 0x0
171#define IMX7ULP_PAD_PTD8__TPM4_CLKIN 0x00a0 0x0298 0x6 0x2
172#define IMX7ULP_PAD_PTD8__SDHC0_D2 0x00a0 0x0000 0x8 0x0
173#define IMX7ULP_PAD_PTD9__PTD9 0x00a4 0x0000 0x1 0x0
174#define IMX7ULP_PAD_PTD9__TPM4_CH0 0x00a4 0x0280 0x6 0x2
175#define IMX7ULP_PAD_PTD9__SDHC0_D1 0x00a4 0x0000 0x8 0x0
176#define IMX7ULP_PAD_PTD10__PTD10 0x00a8 0x0000 0x1 0x0
177#define IMX7ULP_PAD_PTD10__TPM4_CH1 0x00a8 0x0284 0x6 0x2
178#define IMX7ULP_PAD_PTD10__SDHC0_D0 0x00a8 0x0000 0x8 0x0
179#define IMX7ULP_PAD_PTD11__PTD11 0x00ac 0x0000 0x1 0x0
180#define IMX7ULP_PAD_PTD11__TPM4_CH2 0x00ac 0x0288 0x6 0x2
181#define IMX7ULP_PAD_PTD11__SDHC0_DQS 0x00ac 0x0000 0x8 0x0
182#define IMX7ULP_PAD_PTE0__PTE0 0x0100 0x0000 0x1 0x0
183#define IMX7ULP_PAD_PTE0__FXIO1_D31 0x0100 0x0000 0x2 0x0
184#define IMX7ULP_PAD_PTE0__LPSPI2_PCS1 0x0100 0x02a0 0x3 0x2
185#define IMX7ULP_PAD_PTE0__LPUART4_CTS_B 0x0100 0x0244 0x4 0x2
186#define IMX7ULP_PAD_PTE0__LPI2C4_SCL 0x0100 0x0278 0x5 0x2
187#define IMX7ULP_PAD_PTE0__SDHC1_D1 0x0100 0x0000 0x8 0x0
188#define IMX7ULP_PAD_PTE0__FB_A25 0x0100 0x0000 0x9 0x0
189#define IMX7ULP_PAD_PTE1__PTE1 0x0104 0x0000 0x1 0x0
190#define IMX7ULP_PAD_PTE1__FXIO1_D30 0x0104 0x0000 0x2 0x0
191#define IMX7ULP_PAD_PTE1__LPSPI2_PCS2 0x0104 0x02a4 0x3 0x2
192#define IMX7ULP_PAD_PTE1__LPUART4_RTS_B 0x0104 0x0000 0x4 0x0
193#define IMX7ULP_PAD_PTE1__LPI2C4_SDA 0x0104 0x027c 0x5 0x2
194#define IMX7ULP_PAD_PTE1__SDHC1_D0 0x0104 0x0000 0x8 0x0
195#define IMX7ULP_PAD_PTE1__FB_A26 0x0104 0x0000 0x9 0x0
196#define IMX7ULP_PAD_PTE2__PTE2 0x0108 0x0000 0x1 0x0
197#define IMX7ULP_PAD_PTE2__FXIO1_D29 0x0108 0x0000 0x2 0x0
198#define IMX7ULP_PAD_PTE2__LPSPI2_PCS3 0x0108 0x02a8 0x3 0x2
199#define IMX7ULP_PAD_PTE2__LPUART4_TX 0x0108 0x024c 0x4 0x2
200#define IMX7ULP_PAD_PTE2__LPI2C4_HREQ 0x0108 0x0274 0x5 0x2
201#define IMX7ULP_PAD_PTE2__SDHC1_CLK 0x0108 0x0000 0x8 0x0
202#define IMX7ULP_PAD_PTE3__PTE3 0x010c 0x0000 0x1 0x0
203#define IMX7ULP_PAD_PTE3__FXIO1_D28 0x010c 0x0000 0x2 0x0
204#define IMX7ULP_PAD_PTE3__LPUART4_RX 0x010c 0x0248 0x4 0x2
205#define IMX7ULP_PAD_PTE3__TPM5_CH1 0x010c 0x02c8 0x6 0x2
206#define IMX7ULP_PAD_PTE3__SDHC1_CMD 0x010c 0x0000 0x8 0x0
207#define IMX7ULP_PAD_PTE4__PTE4 0x0110 0x0000 0x1 0x0
208#define IMX7ULP_PAD_PTE4__FXIO1_D27 0x0110 0x0000 0x2 0x0
209#define IMX7ULP_PAD_PTE4__LPSPI2_SIN 0x0110 0x02b0 0x3 0x2
210#define IMX7ULP_PAD_PTE4__LPUART5_CTS_B 0x0110 0x0250 0x4 0x2
211#define IMX7ULP_PAD_PTE4__LPI2C5_SCL 0x0110 0x02bc 0x5 0x2
212#define IMX7ULP_PAD_PTE4__TPM5_CLKIN 0x0110 0x02cc 0x6 0x2
213#define IMX7ULP_PAD_PTE4__SDHC1_D3 0x0110 0x0000 0x8 0x0
214#define IMX7ULP_PAD_PTE5__PTE5 0x0114 0x0000 0x1 0x0
215#define IMX7ULP_PAD_PTE5__FXIO1_D26 0x0114 0x0000 0x2 0x0
216#define IMX7ULP_PAD_PTE5__LPSPI2_SOUT 0x0114 0x02b4 0x3 0x2
217#define IMX7ULP_PAD_PTE5__LPUART5_RTS_B 0x0114 0x0000 0x4 0x0
218#define IMX7ULP_PAD_PTE5__LPI2C5_SDA 0x0114 0x02c0 0x5 0x2
219#define IMX7ULP_PAD_PTE5__TPM5_CH0 0x0114 0x02c4 0x6 0x2
220#define IMX7ULP_PAD_PTE5__SDHC1_D2 0x0114 0x0000 0x8 0x0
221#define IMX7ULP_PAD_PTE6__PTE6 0x0118 0x0000 0x1 0x0
222#define IMX7ULP_PAD_PTE6__FXIO1_D25 0x0118 0x0000 0x2 0x0
223#define IMX7ULP_PAD_PTE6__LPSPI2_SCK 0x0118 0x02ac 0x3 0x2
224#define IMX7ULP_PAD_PTE6__LPUART5_TX 0x0118 0x0258 0x4 0x2
225#define IMX7ULP_PAD_PTE6__LPI2C5_HREQ 0x0118 0x02b8 0x5 0x2
226#define IMX7ULP_PAD_PTE6__TPM7_CH3 0x0118 0x02e8 0x6 0x2
227#define IMX7ULP_PAD_PTE6__SDHC1_D4 0x0118 0x0000 0x8 0x0
228#define IMX7ULP_PAD_PTE6__FB_A17 0x0118 0x0000 0x9 0x0
229#define IMX7ULP_PAD_PTE7__PTE7 0x011c 0x0000 0x1 0x0
230#define IMX7ULP_PAD_PTE7__TRACE_D7 0x011c 0x0000 0xa 0x0
231#define IMX7ULP_PAD_PTE7__VIU_FID 0x011c 0x0000 0xc 0x0
232#define IMX7ULP_PAD_PTE7__FXIO1_D24 0x011c 0x0000 0x2 0x0
233#define IMX7ULP_PAD_PTE7__LPSPI2_PCS0 0x011c 0x029c 0x3 0x2
234#define IMX7ULP_PAD_PTE7__LPUART5_RX 0x011c 0x0254 0x4 0x2
235#define IMX7ULP_PAD_PTE7__TPM7_CH4 0x011c 0x02ec 0x6 0x2
236#define IMX7ULP_PAD_PTE7__SDHC1_D5 0x011c 0x0000 0x8 0x0
237#define IMX7ULP_PAD_PTE7__FB_A18 0x011c 0x0000 0x9 0x0
238#define IMX7ULP_PAD_PTE8__PTE8 0x0120 0x0000 0x1 0x0
239#define IMX7ULP_PAD_PTE8__TRACE_D6 0x0120 0x0000 0xa 0x0
240#define IMX7ULP_PAD_PTE8__VIU_D16 0x0120 0x0000 0xc 0x0
241#define IMX7ULP_PAD_PTE8__FXIO1_D23 0x0120 0x0000 0x2 0x0
242#define IMX7ULP_PAD_PTE8__LPSPI3_PCS1 0x0120 0x0314 0x3 0x2
243#define IMX7ULP_PAD_PTE8__LPUART6_CTS_B 0x0120 0x025c 0x4 0x2
244#define IMX7ULP_PAD_PTE8__LPI2C6_SCL 0x0120 0x02fc 0x5 0x2
245#define IMX7ULP_PAD_PTE8__TPM7_CH5 0x0120 0x02f0 0x6 0x2
246#define IMX7ULP_PAD_PTE8__SDHC1_WP 0x0120 0x0200 0x7 0x1
247#define IMX7ULP_PAD_PTE8__SDHC1_D6 0x0120 0x0000 0x8 0x0
248#define IMX7ULP_PAD_PTE8__FB_CS3_B_FB_BE7_0_BLS31_24_B 0x0120 0x0000 0x9 0x0
249#define IMX7ULP_PAD_PTE9__PTE9 0x0124 0x0000 0x1 0x0
250#define IMX7ULP_PAD_PTE9__TRACE_D5 0x0124 0x0000 0xa 0x0
251#define IMX7ULP_PAD_PTE9__VIU_D17 0x0124 0x0000 0xc 0x0
252#define IMX7ULP_PAD_PTE9__FXIO1_D22 0x0124 0x0000 0x2 0x0
253#define IMX7ULP_PAD_PTE9__LPSPI3_PCS2 0x0124 0x0318 0x3 0x2
254#define IMX7ULP_PAD_PTE9__LPUART6_RTS_B 0x0124 0x0000 0x4 0x0
255#define IMX7ULP_PAD_PTE9__LPI2C6_SDA 0x0124 0x0300 0x5 0x2
256#define IMX7ULP_PAD_PTE9__TPM7_CLKIN 0x0124 0x02f4 0x6 0x2
257#define IMX7ULP_PAD_PTE9__SDHC1_CD 0x0124 0x032c 0x7 0x1
258#define IMX7ULP_PAD_PTE9__SDHC1_D7 0x0124 0x0000 0x8 0x0
259#define IMX7ULP_PAD_PTE9__FB_TBST_B_FB_CS2_B_FB_BE15_8_BLS23_16_B 0x0124 0x0000 0x9 0x0
260#define IMX7ULP_PAD_PTE10__PTE10 0x0128 0x0000 0x1 0x0
261#define IMX7ULP_PAD_PTE10__TRACE_D4 0x0128 0x0000 0xa 0x0
262#define IMX7ULP_PAD_PTE10__VIU_D18 0x0128 0x0000 0xc 0x0
263#define IMX7ULP_PAD_PTE10__FXIO1_D21 0x0128 0x0000 0x2 0x0
264#define IMX7ULP_PAD_PTE10__LPSPI3_PCS3 0x0128 0x031c 0x3 0x2
265#define IMX7ULP_PAD_PTE10__LPUART6_TX 0x0128 0x0264 0x4 0x2
266#define IMX7ULP_PAD_PTE10__LPI2C6_HREQ 0x0128 0x02f8 0x5 0x2
267#define IMX7ULP_PAD_PTE10__TPM7_CH0 0x0128 0x02dc 0x6 0x2
268#define IMX7ULP_PAD_PTE10__SDHC1_VS 0x0128 0x0000 0x7 0x0
269#define IMX7ULP_PAD_PTE10__SDHC1_DQS 0x0128 0x0000 0x8 0x0
270#define IMX7ULP_PAD_PTE10__FB_A19 0x0128 0x0000 0x9 0x0
271#define IMX7ULP_PAD_PTE11__PTE11 0x012c 0x0000 0x1 0x0
272#define IMX7ULP_PAD_PTE11__TRACE_D3 0x012c 0x0000 0xa 0x0
273#define IMX7ULP_PAD_PTE11__VIU_D19 0x012c 0x0000 0xc 0x0
274#define IMX7ULP_PAD_PTE11__FXIO1_D20 0x012c 0x0000 0x2 0x0
275#define IMX7ULP_PAD_PTE11__LPUART6_RX 0x012c 0x0260 0x4 0x2
276#define IMX7ULP_PAD_PTE11__TPM7_CH1 0x012c 0x02e0 0x6 0x2
277#define IMX7ULP_PAD_PTE11__SDHC1_RESET_B 0x012c 0x0000 0x8 0x0
278#define IMX7ULP_PAD_PTE11__FB_A20 0x012c 0x0000 0x9 0x0
279#define IMX7ULP_PAD_PTE12__PTE12 0x0130 0x0000 0x1 0x0
280#define IMX7ULP_PAD_PTE12__TRACE_D2 0x0130 0x0000 0xa 0x0
281#define IMX7ULP_PAD_PTE12__VIU_D20 0x0130 0x0000 0xc 0x0
282#define IMX7ULP_PAD_PTE12__FXIO1_D19 0x0130 0x0000 0x2 0x0
283#define IMX7ULP_PAD_PTE12__LPSPI3_SIN 0x0130 0x0324 0x3 0x2
284#define IMX7ULP_PAD_PTE12__LPUART7_CTS_B 0x0130 0x0268 0x4 0x2
285#define IMX7ULP_PAD_PTE12__LPI2C7_SCL 0x0130 0x0308 0x5 0x2
286#define IMX7ULP_PAD_PTE12__TPM7_CH2 0x0130 0x02e4 0x6 0x2
287#define IMX7ULP_PAD_PTE12__SDHC1_WP 0x0130 0x0200 0x8 0x2
288#define IMX7ULP_PAD_PTE12__FB_A21 0x0130 0x0000 0x9 0x0
289#define IMX7ULP_PAD_PTE13__PTE13 0x0134 0x0000 0x1 0x0
290#define IMX7ULP_PAD_PTE13__TRACE_D1 0x0134 0x0000 0xa 0x0
291#define IMX7ULP_PAD_PTE13__VIU_D21 0x0134 0x0000 0xc 0x0
292#define IMX7ULP_PAD_PTE13__FXIO1_D18 0x0134 0x0000 0x2 0x0
293#define IMX7ULP_PAD_PTE13__LPSPI3_SOUT 0x0134 0x0328 0x3 0x2
294#define IMX7ULP_PAD_PTE13__LPUART7_RTS_B 0x0134 0x0000 0x4 0x0
295#define IMX7ULP_PAD_PTE13__LPI2C7_SDA 0x0134 0x030c 0x5 0x2
296#define IMX7ULP_PAD_PTE13__TPM6_CLKIN 0x0134 0x02d8 0x6 0x2
297#define IMX7ULP_PAD_PTE13__SDHC1_CD 0x0134 0x032c 0x8 0x2
298#define IMX7ULP_PAD_PTE13__FB_A22 0x0134 0x0000 0x9 0x0
299#define IMX7ULP_PAD_PTE14__PTE14 0x0138 0x0000 0x1 0x0
300#define IMX7ULP_PAD_PTE14__TRACE_D0 0x0138 0x0000 0xa 0x0
301#define IMX7ULP_PAD_PTE14__VIU_D22 0x0138 0x0000 0xc 0x0
302#define IMX7ULP_PAD_PTE14__FXIO1_D17 0x0138 0x0000 0x2 0x0
303#define IMX7ULP_PAD_PTE14__LPSPI3_SCK 0x0138 0x0320 0x3 0x2
304#define IMX7ULP_PAD_PTE14__LPUART7_TX 0x0138 0x0270 0x4 0x2
305#define IMX7ULP_PAD_PTE14__LPI2C7_HREQ 0x0138 0x0304 0x5 0x2
306#define IMX7ULP_PAD_PTE14__TPM6_CH0 0x0138 0x02d0 0x6 0x2
307#define IMX7ULP_PAD_PTE14__SDHC1_VS 0x0138 0x0000 0x8 0x0
308#define IMX7ULP_PAD_PTE14__FB_A23 0x0138 0x0000 0x9 0x0
309#define IMX7ULP_PAD_PTE15__PTE15 0x013c 0x0000 0x1 0x0
310#define IMX7ULP_PAD_PTE15__TRACE_CLKOUT 0x013c 0x0000 0xa 0x0
311#define IMX7ULP_PAD_PTE15__VIU_D23 0x013c 0x0000 0xc 0x0
312#define IMX7ULP_PAD_PTE15__FXIO1_D16 0x013c 0x0000 0x2 0x0
313#define IMX7ULP_PAD_PTE15__LPSPI3_PCS0 0x013c 0x0310 0x3 0x2
314#define IMX7ULP_PAD_PTE15__LPUART7_RX 0x013c 0x026c 0x4 0x2
315#define IMX7ULP_PAD_PTE15__TPM6_CH1 0x013c 0x02d4 0x6 0x2
316#define IMX7ULP_PAD_PTE15__FB_A24 0x013c 0x0000 0x9 0x0
317#define IMX7ULP_PAD_PTF0__PTF0 0x0180 0x0000 0x1 0x0
318#define IMX7ULP_PAD_PTF0__VIU_DE 0x0180 0x0000 0xc 0x0
319#define IMX7ULP_PAD_PTF0__LPUART4_CTS_B 0x0180 0x0244 0x4 0x3
320#define IMX7ULP_PAD_PTF0__LPI2C4_SCL 0x0180 0x0278 0x5 0x3
321#define IMX7ULP_PAD_PTF0__TPM4_CLKIN 0x0180 0x0298 0x6 0x3
322#define IMX7ULP_PAD_PTF0__FB_RW_B 0x0180 0x0000 0x9 0x0
323#define IMX7ULP_PAD_PTF1__PTF1 0x0184 0x0000 0x1 0x0
324#define IMX7ULP_PAD_PTF1__VIU_HSYNC 0x0184 0x0000 0xc 0x0
325#define IMX7ULP_PAD_PTF1__LPUART4_RTS_B 0x0184 0x0000 0x4 0x0
326#define IMX7ULP_PAD_PTF1__LPI2C4_SDA 0x0184 0x027c 0x5 0x3
327#define IMX7ULP_PAD_PTF1__TPM4_CH0 0x0184 0x0280 0x6 0x3
328#define IMX7ULP_PAD_PTF1__CLKOUT 0x0184 0x0000 0x9 0x0
329#define IMX7ULP_PAD_PTF2__PTF2 0x0188 0x0000 0x1 0x0
330#define IMX7ULP_PAD_PTF2__VIU_VSYNC 0x0188 0x0000 0xc 0x0
331#define IMX7ULP_PAD_PTF2__LPUART4_TX 0x0188 0x024c 0x4 0x3
332#define IMX7ULP_PAD_PTF2__LPI2C4_HREQ 0x0188 0x0274 0x5 0x3
333#define IMX7ULP_PAD_PTF2__TPM4_CH1 0x0188 0x0284 0x6 0x3
334#define IMX7ULP_PAD_PTF2__FB_TSIZ1_FB_CS5_B_FB_BE23_16_BLS15_8_B 0x0188 0x0000 0x9 0x0
335#define IMX7ULP_PAD_PTF3__PTF3 0x018c 0x0000 0x1 0x0
336#define IMX7ULP_PAD_PTF3__VIU_PCLK 0x018c 0x0000 0xc 0x0
337#define IMX7ULP_PAD_PTF3__LPUART4_RX 0x018c 0x0248 0x4 0x3
338#define IMX7ULP_PAD_PTF3__TPM4_CH2 0x018c 0x0288 0x6 0x3
339#define IMX7ULP_PAD_PTF3__FB_AD16 0x018c 0x0000 0x9 0x0
340#define IMX7ULP_PAD_PTF4__PTF4 0x0190 0x0000 0x1 0x0
341#define IMX7ULP_PAD_PTF4__VIU_D0 0x0190 0x0000 0xc 0x0
342#define IMX7ULP_PAD_PTF4__FXIO1_D0 0x0190 0x0204 0x2 0x2
343#define IMX7ULP_PAD_PTF4__LPSPI2_PCS1 0x0190 0x02a0 0x3 0x3
344#define IMX7ULP_PAD_PTF4__LPUART5_CTS_B 0x0190 0x0250 0x4 0x3
345#define IMX7ULP_PAD_PTF4__LPI2C5_SCL 0x0190 0x02bc 0x5 0x3
346#define IMX7ULP_PAD_PTF4__TPM4_CH3 0x0190 0x028c 0x6 0x2
347#define IMX7ULP_PAD_PTF4__FB_AD17 0x0190 0x0000 0x9 0x0
348#define IMX7ULP_PAD_PTF5__PTF5 0x0194 0x0000 0x1 0x0
349#define IMX7ULP_PAD_PTF5__VIU_D1 0x0194 0x0000 0xc 0x0
350#define IMX7ULP_PAD_PTF5__FXIO1_D1 0x0194 0x0208 0x2 0x2
351#define IMX7ULP_PAD_PTF5__LPSPI2_PCS2 0x0194 0x02a4 0x3 0x3
352#define IMX7ULP_PAD_PTF5__LPUART5_RTS_B 0x0194 0x0000 0x4 0x0
353#define IMX7ULP_PAD_PTF5__LPI2C5_SDA 0x0194 0x02c0 0x5 0x3
354#define IMX7ULP_PAD_PTF5__TPM4_CH4 0x0194 0x0290 0x6 0x2
355#define IMX7ULP_PAD_PTF5__FB_AD18 0x0194 0x0000 0x9 0x0
356#define IMX7ULP_PAD_PTF6__PTF6 0x0198 0x0000 0x1 0x0
357#define IMX7ULP_PAD_PTF6__VIU_D2 0x0198 0x0000 0xc 0x0
358#define IMX7ULP_PAD_PTF6__FXIO1_D2 0x0198 0x020c 0x2 0x2
359#define IMX7ULP_PAD_PTF6__LPSPI2_PCS3 0x0198 0x02a8 0x3 0x3
360#define IMX7ULP_PAD_PTF6__LPUART5_TX 0x0198 0x0258 0x4 0x3
361#define IMX7ULP_PAD_PTF6__LPI2C5_HREQ 0x0198 0x02b8 0x5 0x3
362#define IMX7ULP_PAD_PTF6__TPM4_CH5 0x0198 0x0294 0x6 0x2
363#define IMX7ULP_PAD_PTF6__FB_AD19 0x0198 0x0000 0x9 0x0
364#define IMX7ULP_PAD_PTF7__PTF7 0x019c 0x0000 0x1 0x0
365#define IMX7ULP_PAD_PTF7__VIU_D3 0x019c 0x0000 0xc 0x0
366#define IMX7ULP_PAD_PTF7__FXIO1_D3 0x019c 0x0210 0x2 0x2
367#define IMX7ULP_PAD_PTF7__LPUART5_RX 0x019c 0x0254 0x4 0x3
368#define IMX7ULP_PAD_PTF7__TPM5_CH1 0x019c 0x02c8 0x6 0x3
369#define IMX7ULP_PAD_PTF7__FB_AD20 0x019c 0x0000 0x9 0x0
370#define IMX7ULP_PAD_PTF8__PTF8 0x01a0 0x0000 0x1 0x0
371#define IMX7ULP_PAD_PTF8__USB1_ULPI_CLK 0x01a0 0x0000 0xb 0x0
372#define IMX7ULP_PAD_PTF8__VIU_D4 0x01a0 0x0000 0xc 0x0
373#define IMX7ULP_PAD_PTF8__FXIO1_D4 0x01a0 0x0214 0x2 0x2
374#define IMX7ULP_PAD_PTF8__LPSPI2_SIN 0x01a0 0x02b0 0x3 0x3
375#define IMX7ULP_PAD_PTF8__LPUART6_CTS_B 0x01a0 0x025c 0x4 0x3
376#define IMX7ULP_PAD_PTF8__LPI2C6_SCL 0x01a0 0x02fc 0x5 0x3
377#define IMX7ULP_PAD_PTF8__TPM5_CLKIN 0x01a0 0x02cc 0x6 0x3
378#define IMX7ULP_PAD_PTF8__FB_AD21 0x01a0 0x0000 0x9 0x0
379#define IMX7ULP_PAD_PTF9__PTF9 0x01a4 0x0000 0x1 0x0
380#define IMX7ULP_PAD_PTF9__USB1_ULPI_NXT 0x01a4 0x0000 0xb 0x0
381#define IMX7ULP_PAD_PTF9__VIU_D5 0x01a4 0x0000 0xc 0x0
382#define IMX7ULP_PAD_PTF9__FXIO1_D5 0x01a4 0x0218 0x2 0x2
383#define IMX7ULP_PAD_PTF9__LPSPI2_SOUT 0x01a4 0x02b4 0x3 0x3
384#define IMX7ULP_PAD_PTF9__LPUART6_RTS_B 0x01a4 0x0000 0x4 0x0
385#define IMX7ULP_PAD_PTF9__LPI2C6_SDA 0x01a4 0x0300 0x5 0x3
386#define IMX7ULP_PAD_PTF9__TPM5_CH0 0x01a4 0x02c4 0x6 0x3
387#define IMX7ULP_PAD_PTF9__FB_AD22 0x01a4 0x0000 0x9 0x0
388#define IMX7ULP_PAD_PTF10__PTF10 0x01a8 0x0000 0x1 0x0
389#define IMX7ULP_PAD_PTF10__USB1_ULPI_STP 0x01a8 0x0000 0xb 0x0
390#define IMX7ULP_PAD_PTF10__VIU_D6 0x01a8 0x0000 0xc 0x0
391#define IMX7ULP_PAD_PTF10__FXIO1_D6 0x01a8 0x021c 0x2 0x2
392#define IMX7ULP_PAD_PTF10__LPSPI2_SCK 0x01a8 0x02ac 0x3 0x3
393#define IMX7ULP_PAD_PTF10__LPUART6_TX 0x01a8 0x0264 0x4 0x3
394#define IMX7ULP_PAD_PTF10__LPI2C6_HREQ 0x01a8 0x02f8 0x5 0x3
395#define IMX7ULP_PAD_PTF10__TPM7_CH3 0x01a8 0x02e8 0x6 0x3
396#define IMX7ULP_PAD_PTF10__FB_AD23 0x01a8 0x0000 0x9 0x0
397#define IMX7ULP_PAD_PTF11__PTF11 0x01ac 0x0000 0x1 0x0
398#define IMX7ULP_PAD_PTF11__USB1_ULPI_DIR 0x01ac 0x0000 0xb 0x0
399#define IMX7ULP_PAD_PTF11__VIU_D7 0x01ac 0x0000 0xc 0x0
400#define IMX7ULP_PAD_PTF11__FXIO1_D7 0x01ac 0x0220 0x2 0x2
401#define IMX7ULP_PAD_PTF11__LPSPI2_PCS0 0x01ac 0x029c 0x3 0x3
402#define IMX7ULP_PAD_PTF11__LPUART6_RX 0x01ac 0x0260 0x4 0x3
403#define IMX7ULP_PAD_PTF11__TPM7_CH4 0x01ac 0x02ec 0x6 0x3
404#define IMX7ULP_PAD_PTF11__FB_CS4_B_FB_TSIZ0_FB_BE31_24_BLS7_0_B 0x01ac 0x0000 0x9 0x0
405#define IMX7ULP_PAD_PTF12__PTF12 0x01b0 0x0000 0x1 0x0
406#define IMX7ULP_PAD_PTF12__USB1_ULPI_DATA0 0x01b0 0x0000 0xb 0x0
407#define IMX7ULP_PAD_PTF12__VIU_D8 0x01b0 0x0000 0xc 0x0
408#define IMX7ULP_PAD_PTF12__FXIO1_D8 0x01b0 0x0224 0x2 0x2
409#define IMX7ULP_PAD_PTF12__LPSPI3_PCS1 0x01b0 0x0314 0x3 0x3
410#define IMX7ULP_PAD_PTF12__LPUART7_CTS_B 0x01b0 0x0268 0x4 0x3
411#define IMX7ULP_PAD_PTF12__LPI2C7_SCL 0x01b0 0x0308 0x5 0x3
412#define IMX7ULP_PAD_PTF12__TPM7_CH5 0x01b0 0x02f0 0x6 0x3
413#define IMX7ULP_PAD_PTF12__FB_AD24 0x01b0 0x0000 0x9 0x0
414#define IMX7ULP_PAD_PTF13__PTF13 0x01b4 0x0000 0x1 0x0
415#define IMX7ULP_PAD_PTF13__USB1_ULPI_DATA1 0x01b4 0x0000 0xb 0x0
416#define IMX7ULP_PAD_PTF13__VIU_D9 0x01b4 0x0000 0xc 0x0
417#define IMX7ULP_PAD_PTF13__FXIO1_D9 0x01b4 0x0228 0x2 0x2
418#define IMX7ULP_PAD_PTF13__LPSPI3_PCS2 0x01b4 0x0318 0x3 0x3
419#define IMX7ULP_PAD_PTF13__LPUART7_RTS_B 0x01b4 0x0000 0x4 0x0
420#define IMX7ULP_PAD_PTF13__LPI2C7_SDA 0x01b4 0x030c 0x5 0x3
421#define IMX7ULP_PAD_PTF13__TPM7_CLKIN 0x01b4 0x02f4 0x6 0x3
422#define IMX7ULP_PAD_PTF13__FB_AD25 0x01b4 0x0000 0x9 0x0
423#define IMX7ULP_PAD_PTF14__PTF14 0x01b8 0x0000 0x1 0x0
424#define IMX7ULP_PAD_PTF14__USB1_ULPI_DATA2 0x01b8 0x0000 0xb 0x0
425#define IMX7ULP_PAD_PTF14__VIU_D10 0x01b8 0x0000 0xc 0x0
426#define IMX7ULP_PAD_PTF14__FXIO1_D10 0x01b8 0x022c 0x2 0x2
427#define IMX7ULP_PAD_PTF14__LPSPI3_PCS3 0x01b8 0x031c 0x3 0x3
428#define IMX7ULP_PAD_PTF14__LPUART7_TX 0x01b8 0x0270 0x4 0x3
429#define IMX7ULP_PAD_PTF14__LPI2C7_HREQ 0x01b8 0x0304 0x5 0x3
430#define IMX7ULP_PAD_PTF14__TPM7_CH0 0x01b8 0x02dc 0x6 0x3
431#define IMX7ULP_PAD_PTF14__FB_AD26 0x01b8 0x0000 0x9 0x0
432#define IMX7ULP_PAD_PTF15__PTF15 0x01bc 0x0000 0x1 0x0
433#define IMX7ULP_PAD_PTF15__USB1_ULPI_DATA3 0x01bc 0x0000 0xb 0x0
434#define IMX7ULP_PAD_PTF15__VIU_D11 0x01bc 0x0000 0xc 0x0
435#define IMX7ULP_PAD_PTF15__FXIO1_D11 0x01bc 0x0230 0x2 0x2
436#define IMX7ULP_PAD_PTF15__LPUART7_RX 0x01bc 0x026c 0x4 0x3
437#define IMX7ULP_PAD_PTF15__TPM7_CH1 0x01bc 0x02e0 0x6 0x3
438#define IMX7ULP_PAD_PTF15__FB_AD27 0x01bc 0x0000 0x9 0x0
439#define IMX7ULP_PAD_PTF16__PTF16 0x01c0 0x0000 0x1 0x0
440#define IMX7ULP_PAD_PTF16__USB1_ULPI_DATA4 0x01c0 0x0000 0xb 0x0
441#define IMX7ULP_PAD_PTF16__VIU_D12 0x01c0 0x0000 0xc 0x0
442#define IMX7ULP_PAD_PTF16__FXIO1_D12 0x01c0 0x0234 0x2 0x2
443#define IMX7ULP_PAD_PTF16__LPSPI3_SIN 0x01c0 0x0324 0x3 0x3
444#define IMX7ULP_PAD_PTF16__TPM7_CH2 0x01c0 0x02e4 0x6 0x3
445#define IMX7ULP_PAD_PTF16__FB_AD28 0x01c0 0x0000 0x9 0x0
446#define IMX7ULP_PAD_PTF17__PTF17 0x01c4 0x0000 0x1 0x0
447#define IMX7ULP_PAD_PTF17__USB1_ULPI_DATA5 0x01c4 0x0000 0xb 0x0
448#define IMX7ULP_PAD_PTF17__VIU_D13 0x01c4 0x0000 0xc 0x0
449#define IMX7ULP_PAD_PTF17__FXIO1_D13 0x01c4 0x0238 0x2 0x2
450#define IMX7ULP_PAD_PTF17__LPSPI3_SOUT 0x01c4 0x0328 0x3 0x3
451#define IMX7ULP_PAD_PTF17__TPM6_CLKIN 0x01c4 0x02d8 0x6 0x3
452#define IMX7ULP_PAD_PTF17__FB_AD29 0x01c4 0x0000 0x9 0x0
453#define IMX7ULP_PAD_PTF18__PTF18 0x01c8 0x0000 0x1 0x0
454#define IMX7ULP_PAD_PTF18__USB1_ULPI_DATA6 0x01c8 0x0000 0xb 0x0
455#define IMX7ULP_PAD_PTF18__VIU_D14 0x01c8 0x0000 0xc 0x0
456#define IMX7ULP_PAD_PTF18__FXIO1_D14 0x01c8 0x023c 0x2 0x2
457#define IMX7ULP_PAD_PTF18__LPSPI3_SCK 0x01c8 0x0320 0x3 0x3
458#define IMX7ULP_PAD_PTF18__TPM6_CH0 0x01c8 0x02d0 0x6 0x3
459#define IMX7ULP_PAD_PTF18__FB_AD30 0x01c8 0x0000 0x9 0x0
460#define IMX7ULP_PAD_PTF19__PTF19 0x01cc 0x0000 0x1 0x0
461#define IMX7ULP_PAD_PTF19__USB1_ULPI_DATA7 0x01cc 0x0000 0xb 0x0
462#define IMX7ULP_PAD_PTF19__VIU_D15 0x01cc 0x0000 0xc 0x0
463#define IMX7ULP_PAD_PTF19__FXIO1_D15 0x01cc 0x0240 0x2 0x2
464#define IMX7ULP_PAD_PTF19__LPSPI3_PCS0 0x01cc 0x0310 0x3 0x3
465#define IMX7ULP_PAD_PTF19__TPM6_CH1 0x01cc 0x02d4 0x6 0x3
466#define IMX7ULP_PAD_PTF19__FB_AD31 0x01cc 0x0000 0x9 0x0
467
468#endif /* __DTS_IMX7ULP_PINFUNC_H */
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index e14b46c7b37f..34ad10873452 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -146,6 +146,13 @@ config PINCTRL_FALCON
146 depends on SOC_FALCON 146 depends on SOC_FALCON
147 depends on PINCTRL_LANTIQ 147 depends on PINCTRL_LANTIQ
148 148
149config PINCTRL_GEMINI
150 bool
151 depends on ARCH_GEMINI
152 default ARCH_GEMINI
153 select PINMUX
154 select MFD_SYSCON
155
149config PINCTRL_MCP23S08 156config PINCTRL_MCP23S08
150 tristate "Microchip MCP23xxx I/O expander" 157 tristate "Microchip MCP23xxx I/O expander"
151 depends on SPI_MASTER || I2C 158 depends on SPI_MASTER || I2C
@@ -343,6 +350,7 @@ source "drivers/pinctrl/qcom/Kconfig"
343source "drivers/pinctrl/samsung/Kconfig" 350source "drivers/pinctrl/samsung/Kconfig"
344source "drivers/pinctrl/sh-pfc/Kconfig" 351source "drivers/pinctrl/sh-pfc/Kconfig"
345source "drivers/pinctrl/spear/Kconfig" 352source "drivers/pinctrl/spear/Kconfig"
353source "drivers/pinctrl/sprd/Kconfig"
346source "drivers/pinctrl/stm32/Kconfig" 354source "drivers/pinctrl/stm32/Kconfig"
347source "drivers/pinctrl/sunxi/Kconfig" 355source "drivers/pinctrl/sunxi/Kconfig"
348source "drivers/pinctrl/tegra/Kconfig" 356source "drivers/pinctrl/tegra/Kconfig"
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index 2bc641d62400..4c44703ac97f 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_AMD) += pinctrl-amd.o
18obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o 18obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o
19obj-$(CONFIG_PINCTRL_DIGICOLOR) += pinctrl-digicolor.o 19obj-$(CONFIG_PINCTRL_DIGICOLOR) += pinctrl-digicolor.o
20obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o 20obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o
21obj-$(CONFIG_PINCTRL_GEMINI) += pinctrl-gemini.o
21obj-$(CONFIG_PINCTRL_MAX77620) += pinctrl-max77620.o 22obj-$(CONFIG_PINCTRL_MAX77620) += pinctrl-max77620.o
22obj-$(CONFIG_PINCTRL_MCP23S08) += pinctrl-mcp23s08.o 23obj-$(CONFIG_PINCTRL_MCP23S08) += pinctrl-mcp23s08.o
23obj-$(CONFIG_PINCTRL_MESON) += meson/ 24obj-$(CONFIG_PINCTRL_MESON) += meson/
@@ -55,6 +56,7 @@ obj-$(CONFIG_ARCH_QCOM) += qcom/
55obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/ 56obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/
56obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc/ 57obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc/
57obj-$(CONFIG_PINCTRL_SPEAR) += spear/ 58obj-$(CONFIG_PINCTRL_SPEAR) += spear/
59obj-y += sprd/
58obj-$(CONFIG_PINCTRL_STM32) += stm32/ 60obj-$(CONFIG_PINCTRL_STM32) += stm32/
59obj-$(CONFIG_PINCTRL_SUNXI) += sunxi/ 61obj-$(CONFIG_PINCTRL_SUNXI) += sunxi/
60obj-y += ti/ 62obj-y += ti/
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
index cf3106cec048..05b153034517 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
@@ -1006,15 +1006,23 @@ SS_PIN_DECL(H3, GPIOQ5, SDA14);
1006 1006
1007FUNC_GROUP_DECL(I2C14, H4, H3); 1007FUNC_GROUP_DECL(I2C14, H4, H3);
1008 1008
1009#define DASH9028_DESC SIG_DESC_SET(SCU90, 28) 1009/*
1010 * There are several opportunities to document USB port 4 in the datasheet, but
1011 * it is only mentioned in one location. Particularly, the Multi-function Pins
1012 * Mapping and Control table in the datasheet elides the signal names,
1013 * suggesting that port 4 may not actually be functional. As such we define the
1014 * signal names and control bit, but don't export the capability's function or
1015 * group.
1016 */
1017#define USB11H3_DESC SIG_DESC_SET(SCU90, 28)
1010 1018
1011#define H2 134 1019#define H2 134
1012SIG_EXPR_LIST_DECL_SINGLE(DASHH2, DASHH2, DASH9028_DESC); 1020SIG_EXPR_LIST_DECL_SINGLE(USB11HDP3, USB11H3, USB11H3_DESC);
1013SS_PIN_DECL(H2, GPIOQ6, DASHH2); 1021SS_PIN_DECL(H2, GPIOQ6, USB11HDP3);
1014 1022
1015#define H1 135 1023#define H1 135
1016SIG_EXPR_LIST_DECL_SINGLE(DASHH1, DASHH1, DASH9028_DESC); 1024SIG_EXPR_LIST_DECL_SINGLE(USB11HDN3, USB11H3, USB11H3_DESC);
1017SS_PIN_DECL(H1, GPIOQ7, DASHH1); 1025SS_PIN_DECL(H1, GPIOQ7, USB11HDN3);
1018 1026
1019#define V20 136 1027#define V20 136
1020SSSF_PIN_DECL(V20, GPIOR0, ROMCS1, SIG_DESC_SET(SCU88, 24)); 1028SSSF_PIN_DECL(V20, GPIOR0, ROMCS1, SIG_DESC_SET(SCU88, 24));
@@ -1706,10 +1714,42 @@ FUNC_GROUP_DECL(VPO12, U21, T19, V22, U20, R22, P18, P19, P20, P21, P22, M19,
1706FUNC_GROUP_DECL(VPO24, U21, T19, V22, U20, L22, K18, V21, W22, R22, P18, P19, 1714FUNC_GROUP_DECL(VPO24, U21, T19, V22, U20, L22, K18, V21, W22, R22, P18, P19,
1707 P20, P21, P22, M19, M20, M21, M22, L18, L19); 1715 P20, P21, P22, M19, M20, M21, M22, L18, L19);
1708 1716
1717#define USB11H2_DESC SIG_DESC_SET(SCU90, 3)
1718#define USB11D1_DESC SIG_DESC_BIT(SCU90, 3, 0)
1719
1720#define K4 220
1721SIG_EXPR_LIST_DECL_SINGLE(USB11HDP2, USB11H2, USB11H2_DESC);
1722SIG_EXPR_LIST_DECL_SINGLE(USB11DP1, USB11D1, USB11D1_DESC);
1723MS_PIN_DECL_(K4, SIG_EXPR_LIST_PTR(USB11HDP2), SIG_EXPR_LIST_PTR(USB11DP1));
1724
1725#define K3 221
1726SIG_EXPR_LIST_DECL_SINGLE(USB11HDN1, USB11H2, USB11H2_DESC);
1727SIG_EXPR_LIST_DECL_SINGLE(USB11DDN1, USB11D1, USB11D1_DESC);
1728MS_PIN_DECL_(K3, SIG_EXPR_LIST_PTR(USB11HDN1), SIG_EXPR_LIST_PTR(USB11DDN1));
1729
1730FUNC_GROUP_DECL(USB11H2, K4, K3);
1731FUNC_GROUP_DECL(USB11D1, K4, K3);
1732
1733#define USB2H1_DESC SIG_DESC_SET(SCU90, 29)
1734#define USB2D1_DESC SIG_DESC_BIT(SCU90, 29, 0)
1735
1736#define AB21 222
1737SIG_EXPR_LIST_DECL_SINGLE(USB2HDP1, USB2H1, USB2H1_DESC);
1738SIG_EXPR_LIST_DECL_SINGLE(USB2DDP1, USB2D1, USB2D1_DESC);
1739MS_PIN_DECL_(AB21, SIG_EXPR_LIST_PTR(USB2HDP1), SIG_EXPR_LIST_PTR(USB2DDP1));
1740
1741#define AB20 223
1742SIG_EXPR_LIST_DECL_SINGLE(USB2HDN1, USB2H1, USB2H1_DESC);
1743SIG_EXPR_LIST_DECL_SINGLE(USB2DDN1, USB2D1, USB2D1_DESC);
1744MS_PIN_DECL_(AB20, SIG_EXPR_LIST_PTR(USB2HDN1), SIG_EXPR_LIST_PTR(USB2DDN1));
1745
1746FUNC_GROUP_DECL(USB2H1, AB21, AB20);
1747FUNC_GROUP_DECL(USB2D1, AB21, AB20);
1748
1709/* Note we account for GPIOY4-GPIOY7 even though they're not valid, thus 216 1749/* Note we account for GPIOY4-GPIOY7 even though they're not valid, thus 216
1710 * pins becomes 220. 1750 * pins becomes 220. Four additional non-GPIO-capable pins are present for USB.
1711 */ 1751 */
1712#define ASPEED_G4_NR_PINS 220 1752#define ASPEED_G4_NR_PINS 224
1713 1753
1714/* Pins, groups and functions are sort(1):ed alphabetically for sanity */ 1754/* Pins, groups and functions are sort(1):ed alphabetically for sanity */
1715 1755
@@ -1749,6 +1789,8 @@ static struct pinctrl_pin_desc aspeed_g4_pins[ASPEED_G4_NR_PINS] = {
1749 ASPEED_PINCTRL_PIN(AB5), 1789 ASPEED_PINCTRL_PIN(AB5),
1750 ASPEED_PINCTRL_PIN(AB6), 1790 ASPEED_PINCTRL_PIN(AB6),
1751 ASPEED_PINCTRL_PIN(AB7), 1791 ASPEED_PINCTRL_PIN(AB7),
1792 ASPEED_PINCTRL_PIN(AB20),
1793 ASPEED_PINCTRL_PIN(AB21),
1752 ASPEED_PINCTRL_PIN(B1), 1794 ASPEED_PINCTRL_PIN(B1),
1753 ASPEED_PINCTRL_PIN(B10), 1795 ASPEED_PINCTRL_PIN(B10),
1754 ASPEED_PINCTRL_PIN(B11), 1796 ASPEED_PINCTRL_PIN(B11),
@@ -1848,6 +1890,8 @@ static struct pinctrl_pin_desc aspeed_g4_pins[ASPEED_G4_NR_PINS] = {
1848 ASPEED_PINCTRL_PIN(J5), 1890 ASPEED_PINCTRL_PIN(J5),
1849 ASPEED_PINCTRL_PIN(K18), 1891 ASPEED_PINCTRL_PIN(K18),
1850 ASPEED_PINCTRL_PIN(K20), 1892 ASPEED_PINCTRL_PIN(K20),
1893 ASPEED_PINCTRL_PIN(K3),
1894 ASPEED_PINCTRL_PIN(K4),
1851 ASPEED_PINCTRL_PIN(K5), 1895 ASPEED_PINCTRL_PIN(K5),
1852 ASPEED_PINCTRL_PIN(L1), 1896 ASPEED_PINCTRL_PIN(L1),
1853 ASPEED_PINCTRL_PIN(L18), 1897 ASPEED_PINCTRL_PIN(L18),
@@ -2070,6 +2114,10 @@ static const struct aspeed_pin_group aspeed_g4_groups[] = {
2070 ASPEED_PINCTRL_GROUP(TXD3), 2114 ASPEED_PINCTRL_GROUP(TXD3),
2071 ASPEED_PINCTRL_GROUP(TXD4), 2115 ASPEED_PINCTRL_GROUP(TXD4),
2072 ASPEED_PINCTRL_GROUP(UART6), 2116 ASPEED_PINCTRL_GROUP(UART6),
2117 ASPEED_PINCTRL_GROUP(USB11D1),
2118 ASPEED_PINCTRL_GROUP(USB11H2),
2119 ASPEED_PINCTRL_GROUP(USB2D1),
2120 ASPEED_PINCTRL_GROUP(USB2H1),
2073 ASPEED_PINCTRL_GROUP(USBCKI), 2121 ASPEED_PINCTRL_GROUP(USBCKI),
2074 ASPEED_PINCTRL_GROUP(VGABIOS_ROM), 2122 ASPEED_PINCTRL_GROUP(VGABIOS_ROM),
2075 ASPEED_PINCTRL_GROUP(VGAHS), 2123 ASPEED_PINCTRL_GROUP(VGAHS),
@@ -2221,6 +2269,10 @@ static const struct aspeed_pin_function aspeed_g4_functions[] = {
2221 ASPEED_PINCTRL_FUNC(TXD3), 2269 ASPEED_PINCTRL_FUNC(TXD3),
2222 ASPEED_PINCTRL_FUNC(TXD4), 2270 ASPEED_PINCTRL_FUNC(TXD4),
2223 ASPEED_PINCTRL_FUNC(UART6), 2271 ASPEED_PINCTRL_FUNC(UART6),
2272 ASPEED_PINCTRL_FUNC(USB11D1),
2273 ASPEED_PINCTRL_FUNC(USB11H2),
2274 ASPEED_PINCTRL_FUNC(USB2D1),
2275 ASPEED_PINCTRL_FUNC(USB2H1),
2224 ASPEED_PINCTRL_FUNC(USBCKI), 2276 ASPEED_PINCTRL_FUNC(USBCKI),
2225 ASPEED_PINCTRL_FUNC(VGABIOS_ROM), 2277 ASPEED_PINCTRL_FUNC(VGABIOS_ROM),
2226 ASPEED_PINCTRL_FUNC(VGAHS), 2278 ASPEED_PINCTRL_FUNC(VGAHS),
@@ -2349,7 +2401,7 @@ static struct aspeed_pinctrl_data aspeed_g4_pinctrl_data = {
2349 .nconfigs = ARRAY_SIZE(aspeed_g4_configs), 2401 .nconfigs = ARRAY_SIZE(aspeed_g4_configs),
2350}; 2402};
2351 2403
2352static struct pinmux_ops aspeed_g4_pinmux_ops = { 2404static const struct pinmux_ops aspeed_g4_pinmux_ops = {
2353 .get_functions_count = aspeed_pinmux_get_fn_count, 2405 .get_functions_count = aspeed_pinmux_get_fn_count,
2354 .get_function_name = aspeed_pinmux_get_fn_name, 2406 .get_function_name = aspeed_pinmux_get_fn_name,
2355 .get_function_groups = aspeed_pinmux_get_fn_groups, 2407 .get_function_groups = aspeed_pinmux_get_fn_groups,
@@ -2358,7 +2410,7 @@ static struct pinmux_ops aspeed_g4_pinmux_ops = {
2358 .strict = true, 2410 .strict = true,
2359}; 2411};
2360 2412
2361static struct pinctrl_ops aspeed_g4_pinctrl_ops = { 2413static const struct pinctrl_ops aspeed_g4_pinctrl_ops = {
2362 .get_groups_count = aspeed_pinctrl_get_groups_count, 2414 .get_groups_count = aspeed_pinctrl_get_groups_count,
2363 .get_group_name = aspeed_pinctrl_get_group_name, 2415 .get_group_name = aspeed_pinctrl_get_group_name,
2364 .get_group_pins = aspeed_pinctrl_get_group_pins, 2416 .get_group_pins = aspeed_pinctrl_get_group_pins,
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
index 68aa04664a62..187abd7693cf 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
@@ -25,7 +25,7 @@
25#include "../pinctrl-utils.h" 25#include "../pinctrl-utils.h"
26#include "pinctrl-aspeed.h" 26#include "pinctrl-aspeed.h"
27 27
28#define ASPEED_G5_NR_PINS 232 28#define ASPEED_G5_NR_PINS 236
29 29
30#define COND1 { ASPEED_IP_SCU, SCU90, BIT(6), 0, 0 } 30#define COND1 { ASPEED_IP_SCU, SCU90, BIT(6), 0, 0 }
31#define COND2 { ASPEED_IP_SCU, SCU94, GENMASK(1, 0), 0, 0 } 31#define COND2 { ASPEED_IP_SCU, SCU94, GENMASK(1, 0), 0, 0 }
@@ -1724,6 +1724,48 @@ FUNC_GROUP_DECL(LPCRST, G22);
1724 1724
1725FUNC_GROUP_DECL(ESPI, G21, G20, D22, E22, C22, F21, F22, G22); 1725FUNC_GROUP_DECL(ESPI, G21, G20, D22, E22, C22, F21, F22, G22);
1726 1726
1727#define A7 232
1728SIG_EXPR_LIST_DECL_SINGLE(USB2AHDP, USB2AH, SIG_DESC_SET(SCU90, 29));
1729SIG_EXPR_LIST_DECL_SINGLE(USB2ADDP, USB2AD, SIG_DESC_BIT(SCU90, 29, 0));
1730MS_PIN_DECL_(A7, SIG_EXPR_LIST_PTR(USB2AHDP), SIG_EXPR_LIST_PTR(USB2ADDP));
1731
1732#define A8 233
1733SIG_EXPR_LIST_DECL_SINGLE(USB2AHDN, USB2AH, SIG_DESC_SET(SCU90, 29));
1734SIG_EXPR_LIST_DECL_SINGLE(USB2ADDN, USB2AD, SIG_DESC_BIT(SCU90, 29, 0));
1735MS_PIN_DECL_(A8, SIG_EXPR_LIST_PTR(USB2AHDN), SIG_EXPR_LIST_PTR(USB2ADDN));
1736
1737FUNC_GROUP_DECL(USB2AH, A7, A8);
1738FUNC_GROUP_DECL(USB2AD, A7, A8);
1739
1740#define USB11BHID_DESC { ASPEED_IP_SCU, SCU94, GENMASK(14, 13), 0, 0 }
1741#define USB2BD_DESC { ASPEED_IP_SCU, SCU94, GENMASK(14, 13), 1, 0 }
1742#define USB2BH1_DESC { ASPEED_IP_SCU, SCU94, GENMASK(14, 13), 2, 0 }
1743#define USB2BH2_DESC { ASPEED_IP_SCU, SCU94, GENMASK(14, 13), 3, 0 }
1744
1745#define B6 234
1746SIG_EXPR_LIST_DECL_SINGLE(USB11BDP, USB11BHID, USB11BHID_DESC);
1747SIG_EXPR_LIST_DECL_SINGLE(USB2BDDP, USB2BD, USB2BD_DESC);
1748SIG_EXPR_DECL(USB2BHDP1, USB2BH, USB2BH1_DESC);
1749SIG_EXPR_DECL(USB2BHDP2, USB2BH, USB2BH2_DESC);
1750SIG_EXPR_LIST_DECL(USB2BHDP, SIG_EXPR_PTR(USB2BHDP1, USB2BH),
1751 SIG_EXPR_PTR(USB2BHDP2, USB2BH));
1752MS_PIN_DECL_(B6, SIG_EXPR_LIST_PTR(USB11BDP), SIG_EXPR_LIST_PTR(USB2BDDP),
1753 SIG_EXPR_LIST_PTR(USB2BHDP));
1754
1755#define A6 235
1756SIG_EXPR_LIST_DECL_SINGLE(USB11BDN, USB11BHID, USB11BHID_DESC);
1757SIG_EXPR_LIST_DECL_SINGLE(USB2BDN, USB2BD, USB2BD_DESC);
1758SIG_EXPR_DECL(USB2BHDN1, USB2BH, USB2BH1_DESC);
1759SIG_EXPR_DECL(USB2BHDN2, USB2BH, USB2BH2_DESC);
1760SIG_EXPR_LIST_DECL(USB2BHDN, SIG_EXPR_PTR(USB2BHDN1, USB2BH),
1761 SIG_EXPR_PTR(USB2BHDN2, USB2BH));
1762MS_PIN_DECL_(A6, SIG_EXPR_LIST_PTR(USB11BDN), SIG_EXPR_LIST_PTR(USB2BDN),
1763 SIG_EXPR_LIST_PTR(USB2BHDN));
1764
1765FUNC_GROUP_DECL(USB11BHID, B6, A6);
1766FUNC_GROUP_DECL(USB2BD, B6, A6);
1767FUNC_GROUP_DECL(USB2BH, B6, A6);
1768
1727/* Pins, groups and functions are sort(1):ed alphabetically for sanity */ 1769/* Pins, groups and functions are sort(1):ed alphabetically for sanity */
1728 1770
1729static struct pinctrl_pin_desc aspeed_g5_pins[ASPEED_G5_NR_PINS] = { 1771static struct pinctrl_pin_desc aspeed_g5_pins[ASPEED_G5_NR_PINS] = {
@@ -1743,6 +1785,9 @@ static struct pinctrl_pin_desc aspeed_g5_pins[ASPEED_G5_NR_PINS] = {
1743 ASPEED_PINCTRL_PIN(A3), 1785 ASPEED_PINCTRL_PIN(A3),
1744 ASPEED_PINCTRL_PIN(A4), 1786 ASPEED_PINCTRL_PIN(A4),
1745 ASPEED_PINCTRL_PIN(A5), 1787 ASPEED_PINCTRL_PIN(A5),
1788 ASPEED_PINCTRL_PIN(A6),
1789 ASPEED_PINCTRL_PIN(A7),
1790 ASPEED_PINCTRL_PIN(A8),
1746 ASPEED_PINCTRL_PIN(A9), 1791 ASPEED_PINCTRL_PIN(A9),
1747 ASPEED_PINCTRL_PIN(AA1), 1792 ASPEED_PINCTRL_PIN(AA1),
1748 ASPEED_PINCTRL_PIN(AA19), 1793 ASPEED_PINCTRL_PIN(AA19),
@@ -1777,6 +1822,7 @@ static struct pinctrl_pin_desc aspeed_g5_pins[ASPEED_G5_NR_PINS] = {
1777 ASPEED_PINCTRL_PIN(B3), 1822 ASPEED_PINCTRL_PIN(B3),
1778 ASPEED_PINCTRL_PIN(B4), 1823 ASPEED_PINCTRL_PIN(B4),
1779 ASPEED_PINCTRL_PIN(B5), 1824 ASPEED_PINCTRL_PIN(B5),
1825 ASPEED_PINCTRL_PIN(B6),
1780 ASPEED_PINCTRL_PIN(B9), 1826 ASPEED_PINCTRL_PIN(B9),
1781 ASPEED_PINCTRL_PIN(C1), 1827 ASPEED_PINCTRL_PIN(C1),
1782 ASPEED_PINCTRL_PIN(C11), 1828 ASPEED_PINCTRL_PIN(C11),
@@ -2111,6 +2157,11 @@ static const struct aspeed_pin_group aspeed_g5_groups[] = {
2111 ASPEED_PINCTRL_GROUP(TXD3), 2157 ASPEED_PINCTRL_GROUP(TXD3),
2112 ASPEED_PINCTRL_GROUP(TXD4), 2158 ASPEED_PINCTRL_GROUP(TXD4),
2113 ASPEED_PINCTRL_GROUP(UART6), 2159 ASPEED_PINCTRL_GROUP(UART6),
2160 ASPEED_PINCTRL_GROUP(USB11BHID),
2161 ASPEED_PINCTRL_GROUP(USB2AD),
2162 ASPEED_PINCTRL_GROUP(USB2AH),
2163 ASPEED_PINCTRL_GROUP(USB2BD),
2164 ASPEED_PINCTRL_GROUP(USB2BH),
2114 ASPEED_PINCTRL_GROUP(USBCKI), 2165 ASPEED_PINCTRL_GROUP(USBCKI),
2115 ASPEED_PINCTRL_GROUP(VGABIOSROM), 2166 ASPEED_PINCTRL_GROUP(VGABIOSROM),
2116 ASPEED_PINCTRL_GROUP(VGAHS), 2167 ASPEED_PINCTRL_GROUP(VGAHS),
@@ -2275,6 +2326,11 @@ static const struct aspeed_pin_function aspeed_g5_functions[] = {
2275 ASPEED_PINCTRL_FUNC(TXD3), 2326 ASPEED_PINCTRL_FUNC(TXD3),
2276 ASPEED_PINCTRL_FUNC(TXD4), 2327 ASPEED_PINCTRL_FUNC(TXD4),
2277 ASPEED_PINCTRL_FUNC(UART6), 2328 ASPEED_PINCTRL_FUNC(UART6),
2329 ASPEED_PINCTRL_FUNC(USB11BHID),
2330 ASPEED_PINCTRL_FUNC(USB2AD),
2331 ASPEED_PINCTRL_FUNC(USB2AH),
2332 ASPEED_PINCTRL_FUNC(USB2BD),
2333 ASPEED_PINCTRL_FUNC(USB2BH),
2278 ASPEED_PINCTRL_FUNC(USBCKI), 2334 ASPEED_PINCTRL_FUNC(USBCKI),
2279 ASPEED_PINCTRL_FUNC(VGABIOSROM), 2335 ASPEED_PINCTRL_FUNC(VGABIOSROM),
2280 ASPEED_PINCTRL_FUNC(VGAHS), 2336 ASPEED_PINCTRL_FUNC(VGAHS),
@@ -2436,7 +2492,7 @@ static struct aspeed_pinctrl_data aspeed_g5_pinctrl_data = {
2436 .nconfigs = ARRAY_SIZE(aspeed_g5_configs), 2492 .nconfigs = ARRAY_SIZE(aspeed_g5_configs),
2437}; 2493};
2438 2494
2439static struct pinmux_ops aspeed_g5_pinmux_ops = { 2495static const struct pinmux_ops aspeed_g5_pinmux_ops = {
2440 .get_functions_count = aspeed_pinmux_get_fn_count, 2496 .get_functions_count = aspeed_pinmux_get_fn_count,
2441 .get_function_name = aspeed_pinmux_get_fn_name, 2497 .get_function_name = aspeed_pinmux_get_fn_name,
2442 .get_function_groups = aspeed_pinmux_get_fn_groups, 2498 .get_function_groups = aspeed_pinmux_get_fn_groups,
@@ -2445,7 +2501,7 @@ static struct pinmux_ops aspeed_g5_pinmux_ops = {
2445 .strict = true, 2501 .strict = true,
2446}; 2502};
2447 2503
2448static struct pinctrl_ops aspeed_g5_pinctrl_ops = { 2504static const struct pinctrl_ops aspeed_g5_pinctrl_ops = {
2449 .get_groups_count = aspeed_pinctrl_get_groups_count, 2505 .get_groups_count = aspeed_pinctrl_get_groups_count,
2450 .get_group_name = aspeed_pinctrl_get_group_name, 2506 .get_group_name = aspeed_pinctrl_get_group_name,
2451 .get_group_pins = aspeed_pinctrl_get_group_pins, 2507 .get_group_pins = aspeed_pinctrl_get_group_pins,
@@ -2454,7 +2510,7 @@ static struct pinctrl_ops aspeed_g5_pinctrl_ops = {
2454 .dt_free_map = pinctrl_utils_free_map, 2510 .dt_free_map = pinctrl_utils_free_map,
2455}; 2511};
2456 2512
2457static struct pinconf_ops aspeed_g5_conf_ops = { 2513static const struct pinconf_ops aspeed_g5_conf_ops = {
2458 .is_generic = true, 2514 .is_generic = true,
2459 .pin_config_get = aspeed_pin_config_get, 2515 .pin_config_get = aspeed_pin_config_get,
2460 .pin_config_set = aspeed_pin_config_set, 2516 .pin_config_set = aspeed_pin_config_set,
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
index a86a4d66099c..7f13ce8450a3 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
@@ -213,6 +213,27 @@ static int aspeed_sig_expr_set(const struct aspeed_sig_expr *expr,
213 if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP2) 213 if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP2)
214 continue; 214 continue;
215 215
216 /* On AST2500, Set bits in SCU7C are cleared from SCU70 */
217 if (desc->ip == ASPEED_IP_SCU && desc->reg == HW_STRAP1) {
218 unsigned int rev_id;
219
220 ret = regmap_read(maps[ASPEED_IP_SCU],
221 HW_REVISION_ID, &rev_id);
222 if (ret < 0)
223 return ret;
224
225 if (0x04 == (rev_id >> 24)) {
226 u32 value = ~val & desc->mask;
227
228 if (value) {
229 ret = regmap_write(maps[desc->ip],
230 HW_REVISION_ID, value);
231 if (ret < 0)
232 return ret;
233 }
234 }
235 }
236
216 ret = regmap_update_bits(maps[desc->ip], desc->reg, 237 ret = regmap_update_bits(maps[desc->ip], desc->reg,
217 desc->mask, val); 238 desc->mask, val);
218 239
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.h b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
index fa125db828f5..d4d7f032c1da 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.h
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
@@ -251,6 +251,7 @@
251#define SCU3C 0x3C /* System Reset Control/Status Register */ 251#define SCU3C 0x3C /* System Reset Control/Status Register */
252#define SCU48 0x48 /* MAC Interface Clock Delay Setting */ 252#define SCU48 0x48 /* MAC Interface Clock Delay Setting */
253#define HW_STRAP1 0x70 /* AST2400 strapping is 33 bits, is split */ 253#define HW_STRAP1 0x70 /* AST2400 strapping is 33 bits, is split */
254#define HW_REVISION_ID 0x7C /* Silicon revision ID register */
254#define SCU80 0x80 /* Multi-function Pin Control #1 */ 255#define SCU80 0x80 /* Multi-function Pin Control #1 */
255#define SCU84 0x84 /* Multi-function Pin Control #2 */ 256#define SCU84 0x84 /* Multi-function Pin Control #2 */
256#define SCU88 0x88 /* Multi-function Pin Control #3 */ 257#define SCU88 0x88 /* Multi-function Pin Control #3 */
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c
index a7cceffcedfa..bc3b232a727a 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c
@@ -1384,7 +1384,7 @@ static int bcm281xx_pinctrl_pin_config_set(struct pinctrl_dev *pctldev,
1384 return 0; 1384 return 0;
1385} 1385}
1386 1386
1387static struct pinconf_ops bcm281xx_pinctrl_pinconf_ops = { 1387static const struct pinconf_ops bcm281xx_pinctrl_pinconf_ops = {
1388 .pin_config_get = bcm281xx_pinctrl_pin_config_get, 1388 .pin_config_get = bcm281xx_pinctrl_pin_config_get,
1389 .pin_config_set = bcm281xx_pinctrl_pin_config_set, 1389 .pin_config_set = bcm281xx_pinctrl_pin_config_set,
1390}; 1390};
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 230883168e99..0944310225db 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -92,7 +92,6 @@ struct bcm2835_pinctrl {
92 struct gpio_chip gpio_chip; 92 struct gpio_chip gpio_chip;
93 struct pinctrl_gpio_range gpio_range; 93 struct pinctrl_gpio_range gpio_range;
94 94
95 int irq_group[BCM2835_NUM_IRQS];
96 spinlock_t irq_lock[BCM2835_NUM_BANKS]; 95 spinlock_t irq_lock[BCM2835_NUM_BANKS];
97}; 96};
98 97
@@ -353,7 +352,7 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
353 return pinctrl_gpio_direction_output(chip->base + offset); 352 return pinctrl_gpio_direction_output(chip->base + offset);
354} 353}
355 354
356static struct gpio_chip bcm2835_gpio_chip = { 355static const struct gpio_chip bcm2835_gpio_chip = {
357 .label = MODULE_NAME, 356 .label = MODULE_NAME,
358 .owner = THIS_MODULE, 357 .owner = THIS_MODULE,
359 .request = gpiochip_generic_request, 358 .request = gpiochip_generic_request,
@@ -400,7 +399,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
400 399
401 for (i = 0; i < ARRAY_SIZE(pc->irq); i++) { 400 for (i = 0; i < ARRAY_SIZE(pc->irq); i++) {
402 if (pc->irq[i] == irq) { 401 if (pc->irq[i] == irq) {
403 group = pc->irq_group[i]; 402 group = i;
404 break; 403 break;
405 } 404 }
406 } 405 }
@@ -692,8 +691,7 @@ static int bcm2835_pctl_dt_node_to_map_func(struct bcm2835_pinctrl *pc,
692 struct pinctrl_map *map = *maps; 691 struct pinctrl_map *map = *maps;
693 692
694 if (fnum >= ARRAY_SIZE(bcm2835_functions)) { 693 if (fnum >= ARRAY_SIZE(bcm2835_functions)) {
695 dev_err(pc->dev, "%s: invalid brcm,function %d\n", 694 dev_err(pc->dev, "%pOF: invalid brcm,function %d\n", np, fnum);
696 of_node_full_name(np), fnum);
697 return -EINVAL; 695 return -EINVAL;
698 } 696 }
699 697
@@ -713,8 +711,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc,
713 unsigned long *configs; 711 unsigned long *configs;
714 712
715 if (pull > 2) { 713 if (pull > 2) {
716 dev_err(pc->dev, "%s: invalid brcm,pull %d\n", 714 dev_err(pc->dev, "%pOF: invalid brcm,pull %d\n", np, pull);
717 of_node_full_name(np), pull);
718 return -EINVAL; 715 return -EINVAL;
719 } 716 }
720 717
@@ -745,8 +742,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
745 742
746 pins = of_find_property(np, "brcm,pins", NULL); 743 pins = of_find_property(np, "brcm,pins", NULL);
747 if (!pins) { 744 if (!pins) {
748 dev_err(pc->dev, "%s: missing brcm,pins property\n", 745 dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np);
749 of_node_full_name(np));
750 return -EINVAL; 746 return -EINVAL;
751 } 747 }
752 748
@@ -755,8 +751,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
755 751
756 if (!funcs && !pulls) { 752 if (!funcs && !pulls) {
757 dev_err(pc->dev, 753 dev_err(pc->dev,
758 "%s: neither brcm,function nor brcm,pull specified\n", 754 "%pOF: neither brcm,function nor brcm,pull specified\n",
759 of_node_full_name(np)); 755 np);
760 return -EINVAL; 756 return -EINVAL;
761 } 757 }
762 758
@@ -766,15 +762,15 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
766 762
767 if (num_funcs > 1 && num_funcs != num_pins) { 763 if (num_funcs > 1 && num_funcs != num_pins) {
768 dev_err(pc->dev, 764 dev_err(pc->dev,
769 "%s: brcm,function must have 1 or %d entries\n", 765 "%pOF: brcm,function must have 1 or %d entries\n",
770 of_node_full_name(np), num_pins); 766 np, num_pins);
771 return -EINVAL; 767 return -EINVAL;
772 } 768 }
773 769
774 if (num_pulls > 1 && num_pulls != num_pins) { 770 if (num_pulls > 1 && num_pulls != num_pins) {
775 dev_err(pc->dev, 771 dev_err(pc->dev,
776 "%s: brcm,pull must have 1 or %d entries\n", 772 "%pOF: brcm,pull must have 1 or %d entries\n",
777 of_node_full_name(np), num_pins); 773 np, num_pins);
778 return -EINVAL; 774 return -EINVAL;
779 } 775 }
780 776
@@ -793,8 +789,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
793 if (err) 789 if (err)
794 goto out; 790 goto out;
795 if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) { 791 if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) {
796 dev_err(pc->dev, "%s: invalid brcm,pins value %d\n", 792 dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n",
797 of_node_full_name(np), pin); 793 np, pin);
798 err = -EINVAL; 794 err = -EINVAL;
799 goto out; 795 goto out;
800 } 796 }
@@ -1047,7 +1043,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
1047 1043
1048 for (i = 0; i < BCM2835_NUM_IRQS; i++) { 1044 for (i = 0; i < BCM2835_NUM_IRQS; i++) {
1049 pc->irq[i] = irq_of_parse_and_map(np, i); 1045 pc->irq[i] = irq_of_parse_and_map(np, i);
1050 pc->irq_group[i] = i;
1051 1046
1052 if (pc->irq[i] == 0) 1047 if (pc->irq[i] == 0)
1053 continue; 1048 continue;
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index 8f0dc02f7624..cc3bd2efafe3 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -206,8 +206,8 @@ static int berlin_pinctrl_add_function(struct berlin_pinctrl *pctrl,
206static int berlin_pinctrl_build_state(struct platform_device *pdev) 206static int berlin_pinctrl_build_state(struct platform_device *pdev)
207{ 207{
208 struct berlin_pinctrl *pctrl = platform_get_drvdata(pdev); 208 struct berlin_pinctrl *pctrl = platform_get_drvdata(pdev);
209 struct berlin_desc_group const *desc_group; 209 const struct berlin_desc_group *desc_group;
210 struct berlin_desc_function const *desc_function; 210 const struct berlin_desc_function *desc_function;
211 int i, max_functions = 0; 211 int i, max_functions = 0;
212 212
213 pctrl->nfunctions = 0; 213 pctrl->nfunctions = 0;
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index c5e2c5705058..56fbe4c3e800 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -264,7 +264,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
264} 264}
265 265
266static int pinctrl_register_pins(struct pinctrl_dev *pctldev, 266static int pinctrl_register_pins(struct pinctrl_dev *pctldev,
267 struct pinctrl_pin_desc const *pins, 267 const struct pinctrl_pin_desc *pins,
268 unsigned num_descs) 268 unsigned num_descs)
269{ 269{
270 unsigned i; 270 unsigned i;
@@ -686,7 +686,7 @@ EXPORT_SYMBOL_GPL(pinctrl_generic_remove_group);
686static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev) 686static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev)
687{ 687{
688 struct radix_tree_iter iter; 688 struct radix_tree_iter iter;
689 void **slot; 689 void __rcu **slot;
690 690
691 radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0) 691 radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0)
692 radix_tree_delete(&pctldev->pin_group_tree, iter.index); 692 radix_tree_delete(&pctldev->pin_group_tree, iter.index);
@@ -907,7 +907,7 @@ static struct pinctrl_state *create_state(struct pinctrl *p,
907} 907}
908 908
909static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev, 909static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev,
910 struct pinctrl_map const *map) 910 const struct pinctrl_map *map)
911{ 911{
912 struct pinctrl_state *state; 912 struct pinctrl_state *state;
913 struct pinctrl_setting *setting; 913 struct pinctrl_setting *setting;
@@ -995,7 +995,7 @@ static struct pinctrl *create_pinctrl(struct device *dev,
995 const char *devname; 995 const char *devname;
996 struct pinctrl_maps *maps_node; 996 struct pinctrl_maps *maps_node;
997 int i; 997 int i;
998 struct pinctrl_map const *map; 998 const struct pinctrl_map *map;
999 int ret; 999 int ret;
1000 1000
1001 /* 1001 /*
@@ -1321,7 +1321,7 @@ void devm_pinctrl_put(struct pinctrl *p)
1321} 1321}
1322EXPORT_SYMBOL_GPL(devm_pinctrl_put); 1322EXPORT_SYMBOL_GPL(devm_pinctrl_put);
1323 1323
1324int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps, 1324int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
1325 bool dup) 1325 bool dup)
1326{ 1326{
1327 int i, ret; 1327 int i, ret;
@@ -1380,7 +1380,6 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
1380 maps_node->maps = kmemdup(maps, sizeof(*maps) * num_maps, 1380 maps_node->maps = kmemdup(maps, sizeof(*maps) * num_maps,
1381 GFP_KERNEL); 1381 GFP_KERNEL);
1382 if (!maps_node->maps) { 1382 if (!maps_node->maps) {
1383 pr_err("failed to duplicate mapping table\n");
1384 kfree(maps_node); 1383 kfree(maps_node);
1385 return -ENOMEM; 1384 return -ENOMEM;
1386 } 1385 }
@@ -1402,13 +1401,13 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
1402 * function will perform a shallow copy for the mapping entries. 1401 * function will perform a shallow copy for the mapping entries.
1403 * @num_maps: the number of maps in the mapping table 1402 * @num_maps: the number of maps in the mapping table
1404 */ 1403 */
1405int pinctrl_register_mappings(struct pinctrl_map const *maps, 1404int pinctrl_register_mappings(const struct pinctrl_map *maps,
1406 unsigned num_maps) 1405 unsigned num_maps)
1407{ 1406{
1408 return pinctrl_register_map(maps, num_maps, true); 1407 return pinctrl_register_map(maps, num_maps, true);
1409} 1408}
1410 1409
1411void pinctrl_unregister_map(struct pinctrl_map const *map) 1410void pinctrl_unregister_map(const struct pinctrl_map *map)
1412{ 1411{
1413 struct pinctrl_maps *maps_node; 1412 struct pinctrl_maps *maps_node;
1414 1413
@@ -1702,7 +1701,7 @@ static int pinctrl_maps_show(struct seq_file *s, void *what)
1702{ 1701{
1703 struct pinctrl_maps *maps_node; 1702 struct pinctrl_maps *maps_node;
1704 int i; 1703 int i;
1705 struct pinctrl_map const *map; 1704 const struct pinctrl_map *map;
1706 1705
1707 seq_puts(s, "Pinctrl maps:\n"); 1706 seq_puts(s, "Pinctrl maps:\n");
1708 1707
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 1c35de59a658..7880c3adc450 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -179,7 +179,7 @@ struct pin_desc {
179 */ 179 */
180struct pinctrl_maps { 180struct pinctrl_maps {
181 struct list_head node; 181 struct list_head node;
182 struct pinctrl_map const *maps; 182 const struct pinctrl_map *maps;
183 unsigned num_maps; 183 unsigned num_maps;
184}; 184};
185 185
@@ -243,9 +243,9 @@ extern struct pinctrl_gpio_range *
243pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev, 243pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev,
244 unsigned int pin); 244 unsigned int pin);
245 245
246int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps, 246int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
247 bool dup); 247 bool dup);
248void pinctrl_unregister_map(struct pinctrl_map const *map); 248void pinctrl_unregister_map(const struct pinctrl_map *map);
249 249
250extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev); 250extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);
251extern int pinctrl_force_default(struct pinctrl_dev *pctldev); 251extern int pinctrl_force_default(struct pinctrl_dev *pctldev);
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index 0e5c9f14a706..1ff6c3573493 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -83,7 +83,6 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
83 /* Remember the converted mapping table entries */ 83 /* Remember the converted mapping table entries */
84 dt_map = kzalloc(sizeof(*dt_map), GFP_KERNEL); 84 dt_map = kzalloc(sizeof(*dt_map), GFP_KERNEL);
85 if (!dt_map) { 85 if (!dt_map) {
86 dev_err(p->dev, "failed to alloc struct pinctrl_dt_map\n");
87 dt_free_map(pctldev, map, num_maps); 86 dt_free_map(pctldev, map, num_maps);
88 return -ENOMEM; 87 return -ENOMEM;
89 } 88 }
@@ -117,8 +116,8 @@ static int dt_to_map_one_config(struct pinctrl *p,
117 for (;;) { 116 for (;;) {
118 np_pctldev = of_get_next_parent(np_pctldev); 117 np_pctldev = of_get_next_parent(np_pctldev);
119 if (!np_pctldev || of_node_is_root(np_pctldev)) { 118 if (!np_pctldev || of_node_is_root(np_pctldev)) {
120 dev_info(p->dev, "could not find pctldev for node %s, deferring probe\n", 119 dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n",
121 np_config->full_name); 120 np_config);
122 of_node_put(np_pctldev); 121 of_node_put(np_pctldev);
123 /* OK let's just assume this will appear later then */ 122 /* OK let's just assume this will appear later then */
124 return -EPROBE_DEFER; 123 return -EPROBE_DEFER;
@@ -158,10 +157,8 @@ static int dt_remember_dummy_state(struct pinctrl *p, const char *statename)
158 struct pinctrl_map *map; 157 struct pinctrl_map *map;
159 158
160 map = kzalloc(sizeof(*map), GFP_KERNEL); 159 map = kzalloc(sizeof(*map), GFP_KERNEL);
161 if (!map) { 160 if (!map)
162 dev_err(p->dev, "failed to alloc struct pinctrl_map\n");
163 return -ENOMEM; 161 return -ENOMEM;
164 }
165 162
166 /* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */ 163 /* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */
167 map->type = PIN_MAP_TYPE_DUMMY_STATE; 164 map->type = PIN_MAP_TYPE_DUMMY_STATE;
diff --git a/drivers/pinctrl/freescale/Kconfig b/drivers/pinctrl/freescale/Kconfig
index 0b266b2aecd4..4dbc576ae27c 100644
--- a/drivers/pinctrl/freescale/Kconfig
+++ b/drivers/pinctrl/freescale/Kconfig
@@ -103,6 +103,13 @@ config PINCTRL_IMX7D
103 help 103 help
104 Say Y here to enable the imx7d pinctrl driver 104 Say Y here to enable the imx7d pinctrl driver
105 105
106config PINCTRL_IMX7ULP
107 bool "IMX7ULP pinctrl driver"
108 depends on SOC_IMX7ULP
109 select PINCTRL_IMX
110 help
111 Say Y here to enable the imx7ulp pinctrl driver
112
106config PINCTRL_VF610 113config PINCTRL_VF610
107 bool "Freescale Vybrid VF610 pinctrl driver" 114 bool "Freescale Vybrid VF610 pinctrl driver"
108 depends on SOC_VF610 115 depends on SOC_VF610
diff --git a/drivers/pinctrl/freescale/Makefile b/drivers/pinctrl/freescale/Makefile
index d44c9e253f21..525a5ff5dcb4 100644
--- a/drivers/pinctrl/freescale/Makefile
+++ b/drivers/pinctrl/freescale/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_PINCTRL_IMX6SL) += pinctrl-imx6sl.o
14obj-$(CONFIG_PINCTRL_IMX6SX) += pinctrl-imx6sx.o 14obj-$(CONFIG_PINCTRL_IMX6SX) += pinctrl-imx6sx.o
15obj-$(CONFIG_PINCTRL_IMX6UL) += pinctrl-imx6ul.o 15obj-$(CONFIG_PINCTRL_IMX6UL) += pinctrl-imx6ul.o
16obj-$(CONFIG_PINCTRL_IMX7D) += pinctrl-imx7d.o 16obj-$(CONFIG_PINCTRL_IMX7D) += pinctrl-imx7d.o
17obj-$(CONFIG_PINCTRL_IMX7ULP) += pinctrl-imx7ulp.o
17obj-$(CONFIG_PINCTRL_VF610) += pinctrl-vf610.o 18obj-$(CONFIG_PINCTRL_VF610) += pinctrl-vf610.o
18obj-$(CONFIG_PINCTRL_MXS) += pinctrl-mxs.o 19obj-$(CONFIG_PINCTRL_MXS) += pinctrl-mxs.o
19obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o 20obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 72aca758f4c6..6e472691d8ee 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -35,18 +35,6 @@
35#define IMX_NO_PAD_CTL 0x80000000 /* no pin config need */ 35#define IMX_NO_PAD_CTL 0x80000000 /* no pin config need */
36#define IMX_PAD_SION 0x40000000 /* set SION */ 36#define IMX_PAD_SION 0x40000000 /* set SION */
37 37
38/**
39 * @dev: a pointer back to containing device
40 * @base: the offset to the controller in virtual memory
41 */
42struct imx_pinctrl {
43 struct device *dev;
44 struct pinctrl_dev *pctl;
45 void __iomem *base;
46 void __iomem *input_sel_base;
47 struct imx_pinctrl_soc_info *info;
48};
49
50static inline const struct group_desc *imx_pinctrl_find_group_by_name( 38static inline const struct group_desc *imx_pinctrl_find_group_by_name(
51 struct pinctrl_dev *pctldev, 39 struct pinctrl_dev *pctldev,
52 const char *name) 40 const char *name)
@@ -255,111 +243,11 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
255 return 0; 243 return 0;
256} 244}
257 245
258static int imx_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, 246struct pinmux_ops imx_pmx_ops = {
259 struct pinctrl_gpio_range *range, unsigned offset)
260{
261 struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
262 struct imx_pinctrl_soc_info *info = ipctl->info;
263 const struct imx_pin_reg *pin_reg;
264 struct group_desc *grp;
265 struct imx_pin *imx_pin;
266 unsigned int pin, group;
267 u32 reg;
268
269 /* Currently implementation only for shared mux/conf register */
270 if (!(info->flags & SHARE_MUX_CONF_REG))
271 return 0;
272
273 pin_reg = &info->pin_regs[offset];
274 if (pin_reg->mux_reg == -1)
275 return -EINVAL;
276
277 /* Find the pinctrl config with GPIO mux mode for the requested pin */
278 for (group = 0; group < pctldev->num_groups; group++) {
279 grp = pinctrl_generic_get_group(pctldev, group);
280 if (!grp)
281 continue;
282 for (pin = 0; pin < grp->num_pins; pin++) {
283 imx_pin = &((struct imx_pin *)(grp->data))[pin];
284 if (imx_pin->pin == offset && !imx_pin->mux_mode)
285 goto mux_pin;
286 }
287 }
288
289 return -EINVAL;
290
291mux_pin:
292 reg = readl(ipctl->base + pin_reg->mux_reg);
293 reg &= ~info->mux_mask;
294 reg |= imx_pin->config;
295 writel(reg, ipctl->base + pin_reg->mux_reg);
296
297 return 0;
298}
299
300static void imx_pmx_gpio_disable_free(struct pinctrl_dev *pctldev,
301 struct pinctrl_gpio_range *range, unsigned offset)
302{
303 struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
304 struct imx_pinctrl_soc_info *info = ipctl->info;
305 const struct imx_pin_reg *pin_reg;
306 u32 reg;
307
308 /*
309 * Only Vybrid has the input/output buffer enable flags (IBE/OBE)
310 * They are part of the shared mux/conf register.
311 */
312 if (!(info->flags & SHARE_MUX_CONF_REG))
313 return;
314
315 pin_reg = &info->pin_regs[offset];
316 if (pin_reg->mux_reg == -1)
317 return;
318
319 /* Clear IBE/OBE/PUE to disable the pin (Hi-Z) */
320 reg = readl(ipctl->base + pin_reg->mux_reg);
321 reg &= ~0x7;
322 writel(reg, ipctl->base + pin_reg->mux_reg);
323}
324
325static int imx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
326 struct pinctrl_gpio_range *range, unsigned offset, bool input)
327{
328 struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
329 struct imx_pinctrl_soc_info *info = ipctl->info;
330 const struct imx_pin_reg *pin_reg;
331 u32 reg;
332
333 /*
334 * Only Vybrid has the input/output buffer enable flags (IBE/OBE)
335 * They are part of the shared mux/conf register.
336 */
337 if (!(info->flags & SHARE_MUX_CONF_REG))
338 return 0;
339
340 pin_reg = &info->pin_regs[offset];
341 if (pin_reg->mux_reg == -1)
342 return -EINVAL;
343
344 /* IBE always enabled allows us to read the value "on the wire" */
345 reg = readl(ipctl->base + pin_reg->mux_reg);
346 if (input)
347 reg &= ~0x2;
348 else
349 reg |= 0x2;
350 writel(reg, ipctl->base + pin_reg->mux_reg);
351
352 return 0;
353}
354
355static const struct pinmux_ops imx_pmx_ops = {
356 .get_functions_count = pinmux_generic_get_function_count, 247 .get_functions_count = pinmux_generic_get_function_count,
357 .get_function_name = pinmux_generic_get_function_name, 248 .get_function_name = pinmux_generic_get_function_name,
358 .get_function_groups = pinmux_generic_get_function_groups, 249 .get_function_groups = pinmux_generic_get_function_groups,
359 .set_mux = imx_pmx_set, 250 .set_mux = imx_pmx_set,
360 .gpio_request_enable = imx_pmx_gpio_request_enable,
361 .gpio_disable_free = imx_pmx_gpio_disable_free,
362 .gpio_set_direction = imx_pmx_gpio_set_direction,
363}; 251};
364 252
365/* decode generic config into raw register values */ 253/* decode generic config into raw register values */
@@ -563,26 +451,24 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
563 * do sanity check and calculate pins number 451 * do sanity check and calculate pins number
564 * 452 *
565 * First try legacy 'fsl,pins' property, then fall back to the 453 * First try legacy 'fsl,pins' property, then fall back to the
566 * generic 'pins'. 454 * generic 'pinmux'.
567 * 455 *
568 * Note: for generic 'pins' case, there's no CONFIG part in 456 * Note: for generic 'pinmux' case, there's no CONFIG part in
569 * the binding format. 457 * the binding format.
570 */ 458 */
571 list = of_get_property(np, "fsl,pins", &size); 459 list = of_get_property(np, "fsl,pins", &size);
572 if (!list) { 460 if (!list) {
573 list = of_get_property(np, "pins", &size); 461 list = of_get_property(np, "pinmux", &size);
574 if (!list) { 462 if (!list) {
575 dev_err(info->dev, 463 dev_err(info->dev,
576 "no fsl,pins and pins property in node %s\n", 464 "no fsl,pins and pins property in node %pOF\n", np);
577 np->full_name);
578 return -EINVAL; 465 return -EINVAL;
579 } 466 }
580 } 467 }
581 468
582 /* we do not check return since it's safe node passed down */ 469 /* we do not check return since it's safe node passed down */
583 if (!size || size % pin_size) { 470 if (!size || size % pin_size) {
584 dev_err(info->dev, "Invalid fsl,pins or pins property in node %s\n", 471 dev_err(info->dev, "Invalid fsl,pins or pins property in node %pOF\n", np);
585 np->full_name);
586 return -EINVAL; 472 return -EINVAL;
587 } 473 }
588 474
@@ -666,7 +552,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
666 func->name = np->name; 552 func->name = np->name;
667 func->num_group_names = of_get_child_count(np); 553 func->num_group_names = of_get_child_count(np);
668 if (func->num_group_names == 0) { 554 if (func->num_group_names == 0) {
669 dev_err(info->dev, "no groups defined in %s\n", np->full_name); 555 dev_err(info->dev, "no groups defined in %pOF\n", np);
670 return -EINVAL; 556 return -EINVAL;
671 } 557 }
672 func->group_names = devm_kcalloc(info->dev, func->num_group_names, 558 func->group_names = devm_kcalloc(info->dev, func->num_group_names,
@@ -862,6 +748,9 @@ int imx_pinctrl_probe(struct platform_device *pdev,
862 imx_pinctrl_desc->custom_params = info->custom_params; 748 imx_pinctrl_desc->custom_params = info->custom_params;
863 imx_pinctrl_desc->num_custom_params = info->num_custom_params; 749 imx_pinctrl_desc->num_custom_params = info->num_custom_params;
864 750
751 /* platform specific callback */
752 imx_pmx_ops.gpio_set_direction = info->gpio_set_direction;
753
865 mutex_init(&info->mutex); 754 mutex_init(&info->mutex);
866 755
867 ipctl->info = info; 756 ipctl->info = info;
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 880bba7fd1ab..5aa22b52c1d4 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -16,9 +16,12 @@
16#define __DRIVERS_PINCTRL_IMX_H 16#define __DRIVERS_PINCTRL_IMX_H
17 17
18#include <linux/pinctrl/pinconf-generic.h> 18#include <linux/pinctrl/pinconf-generic.h>
19#include <linux/pinctrl/pinmux.h>
19 20
20struct platform_device; 21struct platform_device;
21 22
23extern struct pinmux_ops imx_pmx_ops;
24
22/** 25/**
23 * struct imx_pin - describes a single i.MX pin 26 * struct imx_pin - describes a single i.MX pin
24 * @pin: the pin_id of this pin 27 * @pin: the pin_id of this pin
@@ -76,6 +79,23 @@ struct imx_pinctrl_soc_info {
76 unsigned int num_decodes; 79 unsigned int num_decodes;
77 void (*fixup)(unsigned long *configs, unsigned int num_configs, 80 void (*fixup)(unsigned long *configs, unsigned int num_configs,
78 u32 *raw_config); 81 u32 *raw_config);
82
83 int (*gpio_set_direction)(struct pinctrl_dev *pctldev,
84 struct pinctrl_gpio_range *range,
85 unsigned offset,
86 bool input);
87};
88
89/**
90 * @dev: a pointer back to containing device
91 * @base: the offset to the controller in virtual memory
92 */
93struct imx_pinctrl {
94 struct device *dev;
95 struct pinctrl_dev *pctl;
96 void __iomem *base;
97 void __iomem *input_sel_base;
98 struct imx_pinctrl_soc_info *info;
79}; 99};
80 100
81#define IMX_CFG_PARAMS_DECODE(p, m, o) \ 101#define IMX_CFG_PARAMS_DECODE(p, m, o) \
diff --git a/drivers/pinctrl/freescale/pinctrl-imx23.c b/drivers/pinctrl/freescale/pinctrl-imx23.c
index 89b4f160138f..c9405685971b 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx23.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx23.c
@@ -257,7 +257,7 @@ static const struct pinctrl_pin_desc imx23_pins[] = {
257 MXS_PINCTRL_PIN(EMI_CLKN), 257 MXS_PINCTRL_PIN(EMI_CLKN),
258}; 258};
259 259
260static struct mxs_regs imx23_regs = { 260static const struct mxs_regs imx23_regs = {
261 .muxsel = 0x100, 261 .muxsel = 0x100,
262 .drive = 0x200, 262 .drive = 0x200,
263 .pull = 0x400, 263 .pull = 0x400,
diff --git a/drivers/pinctrl/freescale/pinctrl-imx28.c b/drivers/pinctrl/freescale/pinctrl-imx28.c
index 295236dfb0bc..87deb9ec938a 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx28.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx28.c
@@ -373,7 +373,7 @@ static const struct pinctrl_pin_desc imx28_pins[] = {
373 MXS_PINCTRL_PIN(EMI_CKE), 373 MXS_PINCTRL_PIN(EMI_CKE),
374}; 374};
375 375
376static struct mxs_regs imx28_regs = { 376static const struct mxs_regs imx28_regs = {
377 .muxsel = 0x100, 377 .muxsel = 0x100,
378 .drive = 0x300, 378 .drive = 0x300,
379 .pull = 0x600, 379 .pull = 0x600,
diff --git a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
new file mode 100644
index 000000000000..b7bebb292f37
--- /dev/null
+++ b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
@@ -0,0 +1,364 @@
1/*
2 * Copyright (C) 2016 Freescale Semiconductor, Inc.
3 * Copyright (C) 2017 NXP
4 *
5 * Author: Dong Aisheng <aisheng.dong@nxp.com>
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 version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/err.h>
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/module.h>
17#include <linux/of.h>
18#include <linux/of_device.h>
19#include <linux/pinctrl/pinctrl.h>
20
21#include "pinctrl-imx.h"
22
23enum imx7ulp_pads {
24 IMX7ULP_PAD_PTC0 = 0,
25 IMX7ULP_PAD_PTC1,
26 IMX7ULP_PAD_PTC2,
27 IMX7ULP_PAD_PTC3,
28 IMX7ULP_PAD_PTC4,
29 IMX7ULP_PAD_PTC5,
30 IMX7ULP_PAD_PTC6,
31 IMX7ULP_PAD_PTC7,
32 IMX7ULP_PAD_PTC8,
33 IMX7ULP_PAD_PTC9,
34 IMX7ULP_PAD_PTC10,
35 IMX7ULP_PAD_PTC11,
36 IMX7ULP_PAD_PTC12,
37 IMX7ULP_PAD_PTC13,
38 IMX7ULP_PAD_PTC14,
39 IMX7ULP_PAD_PTC15,
40 IMX7ULP_PAD_PTC16,
41 IMX7ULP_PAD_PTC17,
42 IMX7ULP_PAD_PTC18,
43 IMX7ULP_PAD_PTC19,
44 IMX7ULP_PAD_RESERVE0,
45 IMX7ULP_PAD_RESERVE1,
46 IMX7ULP_PAD_RESERVE2,
47 IMX7ULP_PAD_RESERVE3,
48 IMX7ULP_PAD_RESERVE4,
49 IMX7ULP_PAD_RESERVE5,
50 IMX7ULP_PAD_RESERVE6,
51 IMX7ULP_PAD_RESERVE7,
52 IMX7ULP_PAD_RESERVE8,
53 IMX7ULP_PAD_RESERVE9,
54 IMX7ULP_PAD_RESERVE10,
55 IMX7ULP_PAD_RESERVE11,
56 IMX7ULP_PAD_PTD0,
57 IMX7ULP_PAD_PTD1,
58 IMX7ULP_PAD_PTD2,
59 IMX7ULP_PAD_PTD3,
60 IMX7ULP_PAD_PTD4,
61 IMX7ULP_PAD_PTD5,
62 IMX7ULP_PAD_PTD6,
63 IMX7ULP_PAD_PTD7,
64 IMX7ULP_PAD_PTD8,
65 IMX7ULP_PAD_PTD9,
66 IMX7ULP_PAD_PTD10,
67 IMX7ULP_PAD_PTD11,
68 IMX7ULP_PAD_RESERVE12,
69 IMX7ULP_PAD_RESERVE13,
70 IMX7ULP_PAD_RESERVE14,
71 IMX7ULP_PAD_RESERVE15,
72 IMX7ULP_PAD_RESERVE16,
73 IMX7ULP_PAD_RESERVE17,
74 IMX7ULP_PAD_RESERVE18,
75 IMX7ULP_PAD_RESERVE19,
76 IMX7ULP_PAD_RESERVE20,
77 IMX7ULP_PAD_RESERVE21,
78 IMX7ULP_PAD_RESERVE22,
79 IMX7ULP_PAD_RESERVE23,
80 IMX7ULP_PAD_RESERVE24,
81 IMX7ULP_PAD_RESERVE25,
82 IMX7ULP_PAD_RESERVE26,
83 IMX7ULP_PAD_RESERVE27,
84 IMX7ULP_PAD_RESERVE28,
85 IMX7ULP_PAD_RESERVE29,
86 IMX7ULP_PAD_RESERVE30,
87 IMX7ULP_PAD_RESERVE31,
88 IMX7ULP_PAD_PTE0,
89 IMX7ULP_PAD_PTE1,
90 IMX7ULP_PAD_PTE2,
91 IMX7ULP_PAD_PTE3,
92 IMX7ULP_PAD_PTE4,
93 IMX7ULP_PAD_PTE5,
94 IMX7ULP_PAD_PTE6,
95 IMX7ULP_PAD_PTE7,
96 IMX7ULP_PAD_PTE8,
97 IMX7ULP_PAD_PTE9,
98 IMX7ULP_PAD_PTE10,
99 IMX7ULP_PAD_PTE11,
100 IMX7ULP_PAD_PTE12,
101 IMX7ULP_PAD_PTE13,
102 IMX7ULP_PAD_PTE14,
103 IMX7ULP_PAD_PTE15,
104 IMX7ULP_PAD_RESERVE32,
105 IMX7ULP_PAD_RESERVE33,
106 IMX7ULP_PAD_RESERVE34,
107 IMX7ULP_PAD_RESERVE35,
108 IMX7ULP_PAD_RESERVE36,
109 IMX7ULP_PAD_RESERVE37,
110 IMX7ULP_PAD_RESERVE38,
111 IMX7ULP_PAD_RESERVE39,
112 IMX7ULP_PAD_RESERVE40,
113 IMX7ULP_PAD_RESERVE41,
114 IMX7ULP_PAD_RESERVE42,
115 IMX7ULP_PAD_RESERVE43,
116 IMX7ULP_PAD_RESERVE44,
117 IMX7ULP_PAD_RESERVE45,
118 IMX7ULP_PAD_RESERVE46,
119 IMX7ULP_PAD_RESERVE47,
120 IMX7ULP_PAD_PTF0,
121 IMX7ULP_PAD_PTF1,
122 IMX7ULP_PAD_PTF2,
123 IMX7ULP_PAD_PTF3,
124 IMX7ULP_PAD_PTF4,
125 IMX7ULP_PAD_PTF5,
126 IMX7ULP_PAD_PTF6,
127 IMX7ULP_PAD_PTF7,
128 IMX7ULP_PAD_PTF8,
129 IMX7ULP_PAD_PTF9,
130 IMX7ULP_PAD_PTF10,
131 IMX7ULP_PAD_PTF11,
132 IMX7ULP_PAD_PTF12,
133 IMX7ULP_PAD_PTF13,
134 IMX7ULP_PAD_PTF14,
135 IMX7ULP_PAD_PTF15,
136 IMX7ULP_PAD_PTF16,
137 IMX7ULP_PAD_PTF17,
138 IMX7ULP_PAD_PTF18,
139 IMX7ULP_PAD_PTF19,
140};
141
142/* Pad names for the pinmux subsystem */
143static const struct pinctrl_pin_desc imx7ulp_pinctrl_pads[] = {
144 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC0),
145 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC1),
146 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC2),
147 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC3),
148 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC4),
149 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC5),
150 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC6),
151 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC7),
152 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC8),
153 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC9),
154 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC10),
155 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC11),
156 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC12),
157 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC13),
158 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC14),
159 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC15),
160 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC16),
161 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC17),
162 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC18),
163 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTC19),
164 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE0),
165 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE1),
166 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE2),
167 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE3),
168 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE4),
169 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE5),
170 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE6),
171 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE7),
172 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE8),
173 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE9),
174 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE10),
175 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE11),
176 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD0),
177 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD1),
178 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD2),
179 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD3),
180 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD4),
181 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD5),
182 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD6),
183 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD7),
184 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD8),
185 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD9),
186 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD10),
187 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTD11),
188 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE12),
189 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE13),
190 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE14),
191 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE15),
192 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE16),
193 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE17),
194 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE18),
195 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE19),
196 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE20),
197 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE21),
198 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE22),
199 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE23),
200 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE24),
201 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE25),
202 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE26),
203 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE27),
204 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE28),
205 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE29),
206 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE30),
207 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE31),
208 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE0),
209 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE1),
210 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE2),
211 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE3),
212 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE4),
213 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE5),
214 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE6),
215 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE7),
216 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE8),
217 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE9),
218 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE10),
219 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE11),
220 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE12),
221 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE13),
222 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE14),
223 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTE15),
224 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE32),
225 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE33),
226 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE34),
227 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE35),
228 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE36),
229 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE37),
230 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE38),
231 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE39),
232 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE40),
233 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE41),
234 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE42),
235 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE43),
236 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE44),
237 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE45),
238 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE46),
239 IMX_PINCTRL_PIN(IMX7ULP_PAD_RESERVE47),
240 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF0),
241 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF1),
242 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF2),
243 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF3),
244 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF4),
245 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF5),
246 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF6),
247 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF7),
248 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF8),
249 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF9),
250 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF10),
251 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF11),
252 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF12),
253 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF13),
254 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF14),
255 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF15),
256 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF16),
257 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF17),
258 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF18),
259 IMX_PINCTRL_PIN(IMX7ULP_PAD_PTF19),
260};
261
262#define BM_OBE_ENABLED BIT(17)
263#define BM_IBE_ENABLED BIT(16)
264#define BM_LK_ENABLED BIT(15)
265#define BM_MUX_MODE 0xf00
266#define BP_MUX_MODE 8
267#define BM_PULL_ENABLED BIT(1)
268
269struct imx_cfg_params_decode imx7ulp_cfg_decodes[] = {
270 IMX_CFG_PARAMS_DECODE(PIN_CONFIG_DRIVE_STRENGTH, BIT(6), 6),
271 IMX_CFG_PARAMS_DECODE(PIN_CONFIG_DRIVE_PUSH_PULL, BIT(5), 5),
272 IMX_CFG_PARAMS_DECODE(PIN_CONFIG_SLEW_RATE, BIT(2), 2),
273 IMX_CFG_PARAMS_DECODE(PIN_CONFIG_BIAS_DISABLE, BIT(1), 1),
274 IMX_CFG_PARAMS_DECODE(PIN_CONFIG_BIAS_PULL_UP, BIT(0), 0),
275
276 IMX_CFG_PARAMS_DECODE_INVERT(PIN_CONFIG_DRIVE_OPEN_DRAIN, BIT(5), 5),
277 IMX_CFG_PARAMS_DECODE_INVERT(PIN_CONFIG_BIAS_PULL_DOWN, BIT(0), 0),
278};
279
280static void imx7ulp_cfg_params_fixup(unsigned long *configs,
281 unsigned int num_configs,
282 u32 *raw_config)
283{
284 enum pin_config_param param;
285 u32 param_val;
286 int i;
287
288 /* lock field disabled */
289 *raw_config &= ~BM_LK_ENABLED;
290
291 for (i = 0; i < num_configs; i++) {
292 param = pinconf_to_config_param(configs[i]);
293 param_val = pinconf_to_config_argument(configs[i]);
294
295 if ((param == PIN_CONFIG_BIAS_PULL_UP) ||
296 (param == PIN_CONFIG_BIAS_PULL_DOWN)) {
297 /* pull enabled */
298 *raw_config |= BM_PULL_ENABLED;
299
300 return;
301 }
302 }
303}
304
305static int imx7ulp_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
306 struct pinctrl_gpio_range *range,
307 unsigned offset, bool input)
308{
309 struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
310 struct imx_pinctrl_soc_info *info = ipctl->info;
311 const struct imx_pin_reg *pin_reg;
312 u32 reg;
313
314 pin_reg = &info->pin_regs[offset];
315 if (pin_reg->mux_reg == -1)
316 return -EINVAL;
317
318 reg = readl(ipctl->base + pin_reg->mux_reg);
319 if (input)
320 reg = (reg & ~BM_OBE_ENABLED) | BM_IBE_ENABLED;
321 else
322 reg = (reg & ~BM_IBE_ENABLED) | BM_OBE_ENABLED;
323 writel(reg, ipctl->base + pin_reg->mux_reg);
324
325 return 0;
326}
327
328static struct imx_pinctrl_soc_info imx7ulp_pinctrl_info = {
329 .pins = imx7ulp_pinctrl_pads,
330 .npins = ARRAY_SIZE(imx7ulp_pinctrl_pads),
331 .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG,
332 .gpio_set_direction = imx7ulp_pmx_gpio_set_direction,
333 .mux_mask = BM_MUX_MODE,
334 .mux_shift = BP_MUX_MODE,
335 .generic_pinconf = true,
336 .decodes = imx7ulp_cfg_decodes,
337 .num_decodes = ARRAY_SIZE(imx7ulp_cfg_decodes),
338 .fixup = imx7ulp_cfg_params_fixup,
339};
340
341static const struct of_device_id imx7ulp_pinctrl_of_match[] = {
342 { .compatible = "fsl,imx7ulp-iomuxc1", },
343 { /* sentinel */ }
344};
345
346static int imx7ulp_pinctrl_probe(struct platform_device *pdev)
347{
348 return imx_pinctrl_probe(pdev, &imx7ulp_pinctrl_info);
349}
350
351static struct platform_driver imx7ulp_pinctrl_driver = {
352 .driver = {
353 .name = "imx7ulp-pinctrl",
354 .of_match_table = of_match_ptr(imx7ulp_pinctrl_of_match),
355 .suppress_bind_attrs = true,
356 },
357 .probe = imx7ulp_pinctrl_probe,
358};
359
360static int __init imx7ulp_pinctrl_init(void)
361{
362 return platform_driver_register(&imx7ulp_pinctrl_driver);
363}
364arch_initcall(imx7ulp_pinctrl_init);
diff --git a/drivers/pinctrl/freescale/pinctrl-vf610.c b/drivers/pinctrl/freescale/pinctrl-vf610.c
index 3bd85564d1e4..ac18bb6d6d5e 100644
--- a/drivers/pinctrl/freescale/pinctrl-vf610.c
+++ b/drivers/pinctrl/freescale/pinctrl-vf610.c
@@ -295,10 +295,35 @@ static const struct pinctrl_pin_desc vf610_pinctrl_pads[] = {
295 IMX_PINCTRL_PIN(VF610_PAD_PTA7), 295 IMX_PINCTRL_PIN(VF610_PAD_PTA7),
296}; 296};
297 297
298static int vf610_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
299 struct pinctrl_gpio_range *range,
300 unsigned offset, bool input)
301{
302 struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
303 struct imx_pinctrl_soc_info *info = ipctl->info;
304 const struct imx_pin_reg *pin_reg;
305 u32 reg;
306
307 pin_reg = &info->pin_regs[offset];
308 if (pin_reg->mux_reg == -1)
309 return -EINVAL;
310
311 /* IBE always enabled allows us to read the value "on the wire" */
312 reg = readl(ipctl->base + pin_reg->mux_reg);
313 if (input)
314 reg &= ~0x2;
315 else
316 reg |= 0x2;
317 writel(reg, ipctl->base + pin_reg->mux_reg);
318
319 return 0;
320}
321
298static struct imx_pinctrl_soc_info vf610_pinctrl_info = { 322static struct imx_pinctrl_soc_info vf610_pinctrl_info = {
299 .pins = vf610_pinctrl_pads, 323 .pins = vf610_pinctrl_pads,
300 .npins = ARRAY_SIZE(vf610_pinctrl_pads), 324 .npins = ARRAY_SIZE(vf610_pinctrl_pads),
301 .flags = SHARE_MUX_CONF_REG | ZERO_OFFSET_VALID, 325 .flags = SHARE_MUX_CONF_REG | ZERO_OFFSET_VALID,
326 .gpio_set_direction = vf610_pmx_gpio_set_direction,
302 .mux_mask = 0x700000, 327 .mux_mask = 0x700000,
303 .mux_shift = 20, 328 .mux_shift = 20,
304}; 329};
diff --git a/drivers/pinctrl/intel/Kconfig b/drivers/pinctrl/intel/Kconfig
index b82d6ff3116f..f30720a752f3 100644
--- a/drivers/pinctrl/intel/Kconfig
+++ b/drivers/pinctrl/intel/Kconfig
@@ -1,6 +1,7 @@
1# 1#
2# Intel pin control drivers 2# Intel pin control drivers
3# 3#
4if (X86 || COMPILE_TEST)
4 5
5config PINCTRL_BAYTRAIL 6config PINCTRL_BAYTRAIL
6 bool "Intel Baytrail GPIO pin control" 7 bool "Intel Baytrail GPIO pin control"
@@ -64,6 +65,14 @@ config PINCTRL_CANNONLAKE
64 This pinctrl driver provides an interface that allows configuring 65 This pinctrl driver provides an interface that allows configuring
65 of Intel Cannon Lake PCH pins and using them as GPIOs. 66 of Intel Cannon Lake PCH pins and using them as GPIOs.
66 67
68config PINCTRL_DENVERTON
69 tristate "Intel Denverton pinctrl and GPIO driver"
70 depends on ACPI
71 select PINCTRL_INTEL
72 help
73 This pinctrl driver provides an interface that allows configuring
74 of Intel Denverton SoC pins and using them as GPIOs.
75
67config PINCTRL_GEMINILAKE 76config PINCTRL_GEMINILAKE
68 tristate "Intel Gemini Lake SoC pinctrl and GPIO driver" 77 tristate "Intel Gemini Lake SoC pinctrl and GPIO driver"
69 depends on ACPI 78 depends on ACPI
@@ -72,6 +81,14 @@ config PINCTRL_GEMINILAKE
72 This pinctrl driver provides an interface that allows configuring 81 This pinctrl driver provides an interface that allows configuring
73 of Intel Gemini Lake SoC pins and using them as GPIOs. 82 of Intel Gemini Lake SoC pins and using them as GPIOs.
74 83
84config PINCTRL_LEWISBURG
85 tristate "Intel Lewisburg pinctrl and GPIO driver"
86 depends on ACPI
87 select PINCTRL_INTEL
88 help
89 This pinctrl driver provides an interface that allows configuring
90 of Intel Lewisburg pins and using them as GPIOs.
91
75config PINCTRL_SUNRISEPOINT 92config PINCTRL_SUNRISEPOINT
76 tristate "Intel Sunrisepoint pinctrl and GPIO driver" 93 tristate "Intel Sunrisepoint pinctrl and GPIO driver"
77 depends on ACPI 94 depends on ACPI
@@ -80,3 +97,5 @@ config PINCTRL_SUNRISEPOINT
80 Sunrisepoint is the PCH of Intel Skylake. This pinctrl driver 97 Sunrisepoint is the PCH of Intel Skylake. This pinctrl driver
81 provides an interface that allows configuring of PCH pins and 98 provides an interface that allows configuring of PCH pins and
82 using them as GPIOs. 99 using them as GPIOs.
100
101endif
diff --git a/drivers/pinctrl/intel/Makefile b/drivers/pinctrl/intel/Makefile
index 81df3cf408e3..c12874da5992 100644
--- a/drivers/pinctrl/intel/Makefile
+++ b/drivers/pinctrl/intel/Makefile
@@ -6,5 +6,7 @@ obj-$(CONFIG_PINCTRL_MERRIFIELD) += pinctrl-merrifield.o
6obj-$(CONFIG_PINCTRL_INTEL) += pinctrl-intel.o 6obj-$(CONFIG_PINCTRL_INTEL) += pinctrl-intel.o
7obj-$(CONFIG_PINCTRL_BROXTON) += pinctrl-broxton.o 7obj-$(CONFIG_PINCTRL_BROXTON) += pinctrl-broxton.o
8obj-$(CONFIG_PINCTRL_CANNONLAKE) += pinctrl-cannonlake.o 8obj-$(CONFIG_PINCTRL_CANNONLAKE) += pinctrl-cannonlake.o
9obj-$(CONFIG_PINCTRL_DENVERTON) += pinctrl-denverton.o
9obj-$(CONFIG_PINCTRL_GEMINILAKE) += pinctrl-geminilake.o 10obj-$(CONFIG_PINCTRL_GEMINILAKE) += pinctrl-geminilake.o
11obj-$(CONFIG_PINCTRL_LEWISBURG) += pinctrl-lewisburg.o
10obj-$(CONFIG_PINCTRL_SUNRISEPOINT) += pinctrl-sunrisepoint.o 12obj-$(CONFIG_PINCTRL_SUNRISEPOINT) += pinctrl-sunrisepoint.o
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index fa3c5758ac67..0f3a02495aeb 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -981,12 +981,12 @@ static int byt_gpio_request_enable(struct pinctrl_dev *pctl_dev,
981 */ 981 */
982 value = readl(reg) & BYT_PIN_MUX; 982 value = readl(reg) & BYT_PIN_MUX;
983 gpio_mux = byt_get_gpio_mux(vg, offset); 983 gpio_mux = byt_get_gpio_mux(vg, offset);
984 if (WARN_ON(gpio_mux != value)) { 984 if (gpio_mux != value) {
985 value = readl(reg) & ~BYT_PIN_MUX; 985 value = readl(reg) & ~BYT_PIN_MUX;
986 value |= gpio_mux; 986 value |= gpio_mux;
987 writel(value, reg); 987 writel(value, reg);
988 988
989 dev_warn(&vg->pdev->dev, 989 dev_warn(&vg->pdev->dev, FW_BUG
990 "pin %u forcibly re-configured as GPIO\n", offset); 990 "pin %u forcibly re-configured as GPIO\n", offset);
991 } 991 }
992 992
diff --git a/drivers/pinctrl/intel/pinctrl-cannonlake.c b/drivers/pinctrl/intel/pinctrl-cannonlake.c
index 3bc609b67dc2..e130599be571 100644
--- a/drivers/pinctrl/intel/pinctrl-cannonlake.c
+++ b/drivers/pinctrl/intel/pinctrl-cannonlake.c
@@ -2,7 +2,8 @@
2 * Intel Cannon Lake PCH pinctrl/GPIO driver 2 * Intel Cannon Lake PCH pinctrl/GPIO driver
3 * 3 *
4 * Copyright (C) 2017, Intel Corporation 4 * Copyright (C) 2017, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 5 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
6 * Mika Westerberg <mika.westerberg@linux.intel.com>
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -42,6 +43,426 @@
42 .ngpps = ARRAY_SIZE(g), \ 43 .ngpps = ARRAY_SIZE(g), \
43 } 44 }
44 45
46/* Cannon Lake-H */
47static const struct pinctrl_pin_desc cnlh_pins[] = {
48 /* GPP_A */
49 PINCTRL_PIN(0, "RCINB"),
50 PINCTRL_PIN(1, "LAD_0"),
51 PINCTRL_PIN(2, "LAD_1"),
52 PINCTRL_PIN(3, "LAD_2"),
53 PINCTRL_PIN(4, "LAD_3"),
54 PINCTRL_PIN(5, "LFRAMEB"),
55 PINCTRL_PIN(6, "SERIRQ"),
56 PINCTRL_PIN(7, "PIRQAB"),
57 PINCTRL_PIN(8, "CLKRUNB"),
58 PINCTRL_PIN(9, "CLKOUT_LPC_0"),
59 PINCTRL_PIN(10, "CLKOUT_LPC_1"),
60 PINCTRL_PIN(11, "PMEB"),
61 PINCTRL_PIN(12, "BM_BUSYB"),
62 PINCTRL_PIN(13, "SUSWARNB_SUSPWRDNACK"),
63 PINCTRL_PIN(14, "SUS_STATB"),
64 PINCTRL_PIN(15, "SUSACKB"),
65 PINCTRL_PIN(16, "CLKOUT_48"),
66 PINCTRL_PIN(17, "SD_VDD1_PWR_EN_B"),
67 PINCTRL_PIN(18, "ISH_GP_0"),
68 PINCTRL_PIN(19, "ISH_GP_1"),
69 PINCTRL_PIN(20, "ISH_GP_2"),
70 PINCTRL_PIN(21, "ISH_GP_3"),
71 PINCTRL_PIN(22, "ISH_GP_4"),
72 PINCTRL_PIN(23, "ISH_GP_5"),
73 PINCTRL_PIN(24, "ESPI_CLK_LOOPBK"),
74 /* GPP_B */
75 PINCTRL_PIN(25, "GSPI0_CS1B"),
76 PINCTRL_PIN(26, "GSPI1_CS1B"),
77 PINCTRL_PIN(27, "VRALERTB"),
78 PINCTRL_PIN(28, "CPU_GP_2"),
79 PINCTRL_PIN(29, "CPU_GP_3"),
80 PINCTRL_PIN(30, "SRCCLKREQB_0"),
81 PINCTRL_PIN(31, "SRCCLKREQB_1"),
82 PINCTRL_PIN(32, "SRCCLKREQB_2"),
83 PINCTRL_PIN(33, "SRCCLKREQB_3"),
84 PINCTRL_PIN(34, "SRCCLKREQB_4"),
85 PINCTRL_PIN(35, "SRCCLKREQB_5"),
86 PINCTRL_PIN(36, "SSP_MCLK"),
87 PINCTRL_PIN(37, "SLP_S0B"),
88 PINCTRL_PIN(38, "PLTRSTB"),
89 PINCTRL_PIN(39, "SPKR"),
90 PINCTRL_PIN(40, "GSPI0_CS0B"),
91 PINCTRL_PIN(41, "GSPI0_CLK"),
92 PINCTRL_PIN(42, "GSPI0_MISO"),
93 PINCTRL_PIN(43, "GSPI0_MOSI"),
94 PINCTRL_PIN(44, "GSPI1_CS0B"),
95 PINCTRL_PIN(45, "GSPI1_CLK"),
96 PINCTRL_PIN(46, "GSPI1_MISO"),
97 PINCTRL_PIN(47, "GSPI1_MOSI"),
98 PINCTRL_PIN(48, "SML1ALERTB"),
99 PINCTRL_PIN(49, "GSPI0_CLK_LOOPBK"),
100 PINCTRL_PIN(50, "GSPI1_CLK_LOOPBK"),
101 /* GPP_C */
102 PINCTRL_PIN(51, "SMBCLK"),
103 PINCTRL_PIN(52, "SMBDATA"),
104 PINCTRL_PIN(53, "SMBALERTB"),
105 PINCTRL_PIN(54, "SML0CLK"),
106 PINCTRL_PIN(55, "SML0DATA"),
107 PINCTRL_PIN(56, "SML0ALERTB"),
108 PINCTRL_PIN(57, "SML1CLK"),
109 PINCTRL_PIN(58, "SML1DATA"),
110 PINCTRL_PIN(59, "UART0_RXD"),
111 PINCTRL_PIN(60, "UART0_TXD"),
112 PINCTRL_PIN(61, "UART0_RTSB"),
113 PINCTRL_PIN(62, "UART0_CTSB"),
114 PINCTRL_PIN(63, "UART1_RXD"),
115 PINCTRL_PIN(64, "UART1_TXD"),
116 PINCTRL_PIN(65, "UART1_RTSB"),
117 PINCTRL_PIN(66, "UART1_CTSB"),
118 PINCTRL_PIN(67, "I2C0_SDA"),
119 PINCTRL_PIN(68, "I2C0_SCL"),
120 PINCTRL_PIN(69, "I2C1_SDA"),
121 PINCTRL_PIN(70, "I2C1_SCL"),
122 PINCTRL_PIN(71, "UART2_RXD"),
123 PINCTRL_PIN(72, "UART2_TXD"),
124 PINCTRL_PIN(73, "UART2_RTSB"),
125 PINCTRL_PIN(74, "UART2_CTSB"),
126 /* GPP_D */
127 PINCTRL_PIN(75, "SPI1_CSB"),
128 PINCTRL_PIN(76, "SPI1_CLK"),
129 PINCTRL_PIN(77, "SPI1_MISO_IO_1"),
130 PINCTRL_PIN(78, "SPI1_MOSI_IO_0"),
131 PINCTRL_PIN(79, "ISH_I2C2_SDA"),
132 PINCTRL_PIN(80, "SSP2_SFRM"),
133 PINCTRL_PIN(81, "SSP2_TXD"),
134 PINCTRL_PIN(82, "SSP2_RXD"),
135 PINCTRL_PIN(83, "SSP2_SCLK"),
136 PINCTRL_PIN(84, "ISH_SPI_CSB"),
137 PINCTRL_PIN(85, "ISH_SPI_CLK"),
138 PINCTRL_PIN(86, "ISH_SPI_MISO"),
139 PINCTRL_PIN(87, "ISH_SPI_MOSI"),
140 PINCTRL_PIN(88, "ISH_UART0_RXD"),
141 PINCTRL_PIN(89, "ISH_UART0_TXD"),
142 PINCTRL_PIN(90, "ISH_UART0_RTSB"),
143 PINCTRL_PIN(91, "ISH_UART0_CTSB"),
144 PINCTRL_PIN(92, "DMIC_CLK_1"),
145 PINCTRL_PIN(93, "DMIC_DATA_1"),
146 PINCTRL_PIN(94, "DMIC_CLK_0"),
147 PINCTRL_PIN(95, "DMIC_DATA_0"),
148 PINCTRL_PIN(96, "SPI1_IO_2"),
149 PINCTRL_PIN(97, "SPI1_IO_3"),
150 PINCTRL_PIN(98, "ISH_I2C2_SCL"),
151 /* GPP_G */
152 PINCTRL_PIN(99, "SD3_CMD"),
153 PINCTRL_PIN(100, "SD3_D0"),
154 PINCTRL_PIN(101, "SD3_D1"),
155 PINCTRL_PIN(102, "SD3_D2"),
156 PINCTRL_PIN(103, "SD3_D3"),
157 PINCTRL_PIN(104, "SD3_CDB"),
158 PINCTRL_PIN(105, "SD3_CLK"),
159 PINCTRL_PIN(106, "SD3_WP"),
160 /* AZA */
161 PINCTRL_PIN(107, "HDA_BCLK"),
162 PINCTRL_PIN(108, "HDA_RSTB"),
163 PINCTRL_PIN(109, "HDA_SYNC"),
164 PINCTRL_PIN(110, "HDA_SDO"),
165 PINCTRL_PIN(111, "HDA_SDI_0"),
166 PINCTRL_PIN(112, "HDA_SDI_1"),
167 PINCTRL_PIN(113, "SSP1_SFRM"),
168 PINCTRL_PIN(114, "SSP1_TXD"),
169 /* vGPIO */
170 PINCTRL_PIN(115, "CNV_BTEN"),
171 PINCTRL_PIN(116, "CNV_GNEN"),
172 PINCTRL_PIN(117, "CNV_WFEN"),
173 PINCTRL_PIN(118, "CNV_WCEN"),
174 PINCTRL_PIN(119, "CNV_BT_HOST_WAKEB"),
175 PINCTRL_PIN(120, "vCNV_GNSS_HOST_WAKEB"),
176 PINCTRL_PIN(121, "vSD3_CD_B"),
177 PINCTRL_PIN(122, "CNV_BT_IF_SELECT"),
178 PINCTRL_PIN(123, "vCNV_BT_UART_TXD"),
179 PINCTRL_PIN(124, "vCNV_BT_UART_RXD"),
180 PINCTRL_PIN(125, "vCNV_BT_UART_CTS_B"),
181 PINCTRL_PIN(126, "vCNV_BT_UART_RTS_B"),
182 PINCTRL_PIN(127, "vCNV_MFUART1_TXD"),
183 PINCTRL_PIN(128, "vCNV_MFUART1_RXD"),
184 PINCTRL_PIN(129, "vCNV_MFUART1_CTS_B"),
185 PINCTRL_PIN(130, "vCNV_MFUART1_RTS_B"),
186 PINCTRL_PIN(131, "vCNV_GNSS_UART_TXD"),
187 PINCTRL_PIN(132, "vCNV_GNSS_UART_RXD"),
188 PINCTRL_PIN(133, "vCNV_GNSS_UART_CTS_B"),
189 PINCTRL_PIN(134, "vCNV_GNSS_UART_RTS_B"),
190 PINCTRL_PIN(135, "vUART0_TXD"),
191 PINCTRL_PIN(136, "vUART0_RXD"),
192 PINCTRL_PIN(137, "vUART0_CTS_B"),
193 PINCTRL_PIN(138, "vUART0_RTSB"),
194 PINCTRL_PIN(139, "vISH_UART0_TXD"),
195 PINCTRL_PIN(140, "vISH_UART0_RXD"),
196 PINCTRL_PIN(141, "vISH_UART0_CTS_B"),
197 PINCTRL_PIN(142, "vISH_UART0_RTSB"),
198 PINCTRL_PIN(143, "vISH_UART1_TXD"),
199 PINCTRL_PIN(144, "vISH_UART1_RXD"),
200 PINCTRL_PIN(145, "vISH_UART1_CTS_B"),
201 PINCTRL_PIN(146, "vISH_UART1_RTS_B"),
202 PINCTRL_PIN(147, "vCNV_BT_I2S_BCLK"),
203 PINCTRL_PIN(148, "vCNV_BT_I2S_WS_SYNC"),
204 PINCTRL_PIN(149, "vCNV_BT_I2S_SDO"),
205 PINCTRL_PIN(150, "vCNV_BT_I2S_SDI"),
206 PINCTRL_PIN(151, "vSSP2_SCLK"),
207 PINCTRL_PIN(152, "vSSP2_SFRM"),
208 PINCTRL_PIN(153, "vSSP2_TXD"),
209 PINCTRL_PIN(154, "vSSP2_RXD"),
210 /* GPP_K */
211 PINCTRL_PIN(155, "FAN_TACH_0"),
212 PINCTRL_PIN(156, "FAN_TACH_1"),
213 PINCTRL_PIN(157, "FAN_TACH_2"),
214 PINCTRL_PIN(158, "FAN_TACH_3"),
215 PINCTRL_PIN(159, "FAN_TACH_4"),
216 PINCTRL_PIN(160, "FAN_TACH_5"),
217 PINCTRL_PIN(161, "FAN_TACH_6"),
218 PINCTRL_PIN(162, "FAN_TACH_7"),
219 PINCTRL_PIN(163, "FAN_PWM_0"),
220 PINCTRL_PIN(164, "FAN_PWM_1"),
221 PINCTRL_PIN(165, "FAN_PWM_2"),
222 PINCTRL_PIN(166, "FAN_PWM_3"),
223 PINCTRL_PIN(167, "GSXDOUT"),
224 PINCTRL_PIN(168, "GSXSLOAD"),
225 PINCTRL_PIN(169, "GSXDIN"),
226 PINCTRL_PIN(170, "GSXSRESETB"),
227 PINCTRL_PIN(171, "GSXCLK"),
228 PINCTRL_PIN(172, "ADR_COMPLETE"),
229 PINCTRL_PIN(173, "NMIB"),
230 PINCTRL_PIN(174, "SMIB"),
231 PINCTRL_PIN(175, "CORE_VID_0"),
232 PINCTRL_PIN(176, "CORE_VID_1"),
233 PINCTRL_PIN(177, "IMGCLKOUT_0"),
234 PINCTRL_PIN(178, "IMGCLKOUT_1"),
235 /* GPP_H */
236 PINCTRL_PIN(179, "SRCCLKREQB_6"),
237 PINCTRL_PIN(180, "SRCCLKREQB_7"),
238 PINCTRL_PIN(181, "SRCCLKREQB_8"),
239 PINCTRL_PIN(182, "SRCCLKREQB_9"),
240 PINCTRL_PIN(183, "SRCCLKREQB_10"),
241 PINCTRL_PIN(184, "SRCCLKREQB_11"),
242 PINCTRL_PIN(185, "SRCCLKREQB_12"),
243 PINCTRL_PIN(186, "SRCCLKREQB_13"),
244 PINCTRL_PIN(187, "SRCCLKREQB_14"),
245 PINCTRL_PIN(188, "SRCCLKREQB_15"),
246 PINCTRL_PIN(189, "SML2CLK"),
247 PINCTRL_PIN(190, "SML2DATA"),
248 PINCTRL_PIN(191, "SML2ALERTB"),
249 PINCTRL_PIN(192, "SML3CLK"),
250 PINCTRL_PIN(193, "SML3DATA"),
251 PINCTRL_PIN(194, "SML3ALERTB"),
252 PINCTRL_PIN(195, "SML4CLK"),
253 PINCTRL_PIN(196, "SML4DATA"),
254 PINCTRL_PIN(197, "SML4ALERTB"),
255 PINCTRL_PIN(198, "ISH_I2C0_SDA"),
256 PINCTRL_PIN(199, "ISH_I2C0_SCL"),
257 PINCTRL_PIN(200, "ISH_I2C1_SDA"),
258 PINCTRL_PIN(201, "ISH_I2C1_SCL"),
259 PINCTRL_PIN(202, "TIME_SYNC_0"),
260 /* GPP_E */
261 PINCTRL_PIN(203, "SATAXPCIE_0"),
262 PINCTRL_PIN(204, "SATAXPCIE_1"),
263 PINCTRL_PIN(205, "SATAXPCIE_2"),
264 PINCTRL_PIN(206, "CPU_GP_0"),
265 PINCTRL_PIN(207, "SATA_DEVSLP_0"),
266 PINCTRL_PIN(208, "SATA_DEVSLP_1"),
267 PINCTRL_PIN(209, "SATA_DEVSLP_2"),
268 PINCTRL_PIN(210, "CPU_GP_1"),
269 PINCTRL_PIN(211, "SATA_LEDB"),
270 PINCTRL_PIN(212, "USB2_OCB_0"),
271 PINCTRL_PIN(213, "USB2_OCB_1"),
272 PINCTRL_PIN(214, "USB2_OCB_2"),
273 PINCTRL_PIN(215, "USB2_OCB_3"),
274 /* GPP_F */
275 PINCTRL_PIN(216, "SATAXPCIE_3"),
276 PINCTRL_PIN(217, "SATAXPCIE_4"),
277 PINCTRL_PIN(218, "SATAXPCIE_5"),
278 PINCTRL_PIN(219, "SATAXPCIE_6"),
279 PINCTRL_PIN(220, "SATAXPCIE_7"),
280 PINCTRL_PIN(221, "SATA_DEVSLP_3"),
281 PINCTRL_PIN(222, "SATA_DEVSLP_4"),
282 PINCTRL_PIN(223, "SATA_DEVSLP_5"),
283 PINCTRL_PIN(224, "SATA_DEVSLP_6"),
284 PINCTRL_PIN(225, "SATA_DEVSLP_7"),
285 PINCTRL_PIN(226, "SATA_SCLOCK"),
286 PINCTRL_PIN(227, "SATA_SLOAD"),
287 PINCTRL_PIN(228, "SATA_SDATAOUT1"),
288 PINCTRL_PIN(229, "SATA_SDATAOUT0"),
289 PINCTRL_PIN(230, "EXT_PWR_GATEB"),
290 PINCTRL_PIN(231, "USB2_OCB_4"),
291 PINCTRL_PIN(232, "USB2_OCB_5"),
292 PINCTRL_PIN(233, "USB2_OCB_6"),
293 PINCTRL_PIN(234, "USB2_OCB_7"),
294 PINCTRL_PIN(235, "L_VDDEN"),
295 PINCTRL_PIN(236, "L_BKLTEN"),
296 PINCTRL_PIN(237, "L_BKLTCTL"),
297 PINCTRL_PIN(238, "DDPF_CTRLCLK"),
298 PINCTRL_PIN(239, "DDPF_CTRLDATA"),
299 /* SPI */
300 PINCTRL_PIN(240, "SPI0_IO_2"),
301 PINCTRL_PIN(241, "SPI0_IO_3"),
302 PINCTRL_PIN(242, "SPI0_MOSI_IO_0"),
303 PINCTRL_PIN(243, "SPI0_MISO_IO_1"),
304 PINCTRL_PIN(244, "SPI0_TPM_CSB"),
305 PINCTRL_PIN(245, "SPI0_FLASH_0_CSB"),
306 PINCTRL_PIN(246, "SPI0_FLASH_1_CSB"),
307 PINCTRL_PIN(247, "SPI0_CLK"),
308 PINCTRL_PIN(248, "SPI0_CLK_LOOPBK"),
309 /* CPU */
310 PINCTRL_PIN(249, "HDACPU_SDI"),
311 PINCTRL_PIN(250, "HDACPU_SDO"),
312 PINCTRL_PIN(251, "HDACPU_SCLK"),
313 PINCTRL_PIN(252, "PM_SYNC"),
314 PINCTRL_PIN(253, "PECI"),
315 PINCTRL_PIN(254, "CPUPWRGD"),
316 PINCTRL_PIN(255, "THRMTRIPB"),
317 PINCTRL_PIN(256, "PLTRST_CPUB"),
318 PINCTRL_PIN(257, "PM_DOWN"),
319 PINCTRL_PIN(258, "TRIGGER_IN"),
320 PINCTRL_PIN(259, "TRIGGER_OUT"),
321 /* JTAG */
322 PINCTRL_PIN(260, "JTAG_TDO"),
323 PINCTRL_PIN(261, "JTAGX"),
324 PINCTRL_PIN(262, "PRDYB"),
325 PINCTRL_PIN(263, "PREQB"),
326 PINCTRL_PIN(264, "CPU_TRSTB"),
327 PINCTRL_PIN(265, "JTAG_TDI"),
328 PINCTRL_PIN(266, "JTAG_TMS"),
329 PINCTRL_PIN(267, "JTAG_TCK"),
330 PINCTRL_PIN(268, "ITP_PMODE"),
331 /* GPP_I */
332 PINCTRL_PIN(269, "DDSP_HPD_0"),
333 PINCTRL_PIN(270, "DDSP_HPD_1"),
334 PINCTRL_PIN(271, "DDSP_HPD_2"),
335 PINCTRL_PIN(272, "DDSP_HPD_3"),
336 PINCTRL_PIN(273, "EDP_HPD"),
337 PINCTRL_PIN(274, "DDPB_CTRLCLK"),
338 PINCTRL_PIN(275, "DDPB_CTRLDATA"),
339 PINCTRL_PIN(276, "DDPC_CTRLCLK"),
340 PINCTRL_PIN(277, "DDPC_CTRLDATA"),
341 PINCTRL_PIN(278, "DDPD_CTRLCLK"),
342 PINCTRL_PIN(279, "DDPD_CTRLDATA"),
343 PINCTRL_PIN(280, "M2_SKT2_CFG_0"),
344 PINCTRL_PIN(281, "M2_SKT2_CFG_1"),
345 PINCTRL_PIN(282, "M2_SKT2_CFG_2"),
346 PINCTRL_PIN(283, "M2_SKT2_CFG_3"),
347 PINCTRL_PIN(284, "SYS_PWROK"),
348 PINCTRL_PIN(285, "SYS_RESETB"),
349 PINCTRL_PIN(286, "MLK_RSTB"),
350 /* GPP_J */
351 PINCTRL_PIN(287, "CNV_PA_BLANKING"),
352 PINCTRL_PIN(288, "CNV_GNSS_FTA"),
353 PINCTRL_PIN(289, "CNV_GNSS_SYSCK"),
354 PINCTRL_PIN(290, "CNV_RF_RESET_B"),
355 PINCTRL_PIN(291, "CNV_BRI_DT"),
356 PINCTRL_PIN(292, "CNV_BRI_RSP"),
357 PINCTRL_PIN(293, "CNV_RGI_DT"),
358 PINCTRL_PIN(294, "CNV_RGI_RSP"),
359 PINCTRL_PIN(295, "CNV_MFUART2_RXD"),
360 PINCTRL_PIN(296, "CNV_MFUART2_TXD"),
361 PINCTRL_PIN(297, "CNV_MODEM_CLKREQ"),
362 PINCTRL_PIN(298, "A4WP_PRESENT"),
363};
364
365static const struct intel_padgroup cnlh_community0_gpps[] = {
366 CNL_GPP(0, 0, 24), /* GPP_A */
367 CNL_GPP(1, 25, 50), /* GPP_B */
368};
369
370static const struct intel_padgroup cnlh_community1_gpps[] = {
371 CNL_GPP(0, 51, 74), /* GPP_C */
372 CNL_GPP(1, 75, 98), /* GPP_D */
373 CNL_GPP(2, 99, 106), /* GPP_G */
374 CNL_GPP(3, 107, 114), /* AZA */
375 CNL_GPP(4, 115, 146), /* vGPIO_0 */
376 CNL_GPP(5, 147, 154), /* vGPIO_1 */
377};
378
379static const struct intel_padgroup cnlh_community3_gpps[] = {
380 CNL_GPP(0, 155, 178), /* GPP_K */
381 CNL_GPP(1, 179, 202), /* GPP_H */
382 CNL_GPP(2, 203, 215), /* GPP_E */
383 CNL_GPP(3, 216, 239), /* GPP_F */
384 CNL_GPP(4, 240, 248), /* SPI */
385};
386
387static const struct intel_padgroup cnlh_community4_gpps[] = {
388 CNL_GPP(0, 249, 259), /* CPU */
389 CNL_GPP(1, 260, 268), /* JTAG */
390 CNL_GPP(2, 269, 286), /* GPP_I */
391 CNL_GPP(3, 287, 298), /* GPP_J */
392};
393
394static const unsigned int cnlh_spi0_pins[] = { 40, 41, 42, 43 };
395static const unsigned int cnlh_spi1_pins[] = { 44, 45, 46, 47 };
396static const unsigned int cnlh_spi2_pins[] = { 84, 85, 86, 87 };
397
398static const unsigned int cnlh_uart0_pins[] = { 59, 60, 61, 62 };
399static const unsigned int cnlh_uart1_pins[] = { 63, 64, 65, 66 };
400static const unsigned int cnlh_uart2_pins[] = { 71, 72, 73, 74 };
401
402static const unsigned int cnlh_i2c0_pins[] = { 67, 68 };
403static const unsigned int cnlh_i2c1_pins[] = { 69, 70 };
404static const unsigned int cnlh_i2c2_pins[] = { 88, 89 };
405static const unsigned int cnlh_i2c3_pins[] = { 79, 98 };
406
407static const struct intel_pingroup cnlh_groups[] = {
408 PIN_GROUP("spi0_grp", cnlh_spi0_pins, 1),
409 PIN_GROUP("spi1_grp", cnlh_spi1_pins, 1),
410 PIN_GROUP("spi2_grp", cnlh_spi2_pins, 3),
411 PIN_GROUP("uart0_grp", cnlh_uart0_pins, 1),
412 PIN_GROUP("uart1_grp", cnlh_uart1_pins, 1),
413 PIN_GROUP("uart2_grp", cnlh_uart2_pins, 1),
414 PIN_GROUP("i2c0_grp", cnlh_i2c0_pins, 1),
415 PIN_GROUP("i2c1_grp", cnlh_i2c1_pins, 1),
416 PIN_GROUP("i2c2_grp", cnlh_i2c2_pins, 3),
417 PIN_GROUP("i2c3_grp", cnlh_i2c3_pins, 2),
418};
419
420static const char * const cnlh_spi0_groups[] = { "spi0_grp" };
421static const char * const cnlh_spi1_groups[] = { "spi1_grp" };
422static const char * const cnlh_spi2_groups[] = { "spi2_grp" };
423static const char * const cnlh_uart0_groups[] = { "uart0_grp" };
424static const char * const cnlh_uart1_groups[] = { "uart1_grp" };
425static const char * const cnlh_uart2_groups[] = { "uart2_grp" };
426static const char * const cnlh_i2c0_groups[] = { "i2c0_grp" };
427static const char * const cnlh_i2c1_groups[] = { "i2c1_grp" };
428static const char * const cnlh_i2c2_groups[] = { "i2c2_grp" };
429static const char * const cnlh_i2c3_groups[] = { "i2c3_grp" };
430
431static const struct intel_function cnlh_functions[] = {
432 FUNCTION("spi0", cnlh_spi0_groups),
433 FUNCTION("spi1", cnlh_spi1_groups),
434 FUNCTION("spi2", cnlh_spi2_groups),
435 FUNCTION("uart0", cnlh_uart0_groups),
436 FUNCTION("uart1", cnlh_uart1_groups),
437 FUNCTION("uart2", cnlh_uart2_groups),
438 FUNCTION("i2c0", cnlh_i2c0_groups),
439 FUNCTION("i2c1", cnlh_i2c1_groups),
440 FUNCTION("i2c2", cnlh_i2c2_groups),
441 FUNCTION("i2c3", cnlh_i2c3_groups),
442};
443
444static const struct intel_community cnlh_communities[] = {
445 CNL_COMMUNITY(0, 0, 50, cnlh_community0_gpps),
446 CNL_COMMUNITY(1, 51, 154, cnlh_community1_gpps),
447 /*
448 * ACPI MMIO resources are returned in reverse order for
449 * communities 3 and 4.
450 */
451 CNL_COMMUNITY(3, 155, 248, cnlh_community3_gpps),
452 CNL_COMMUNITY(2, 249, 298, cnlh_community4_gpps),
453};
454
455static const struct intel_pinctrl_soc_data cnlh_soc_data = {
456 .pins = cnlh_pins,
457 .npins = ARRAY_SIZE(cnlh_pins),
458 .groups = cnlh_groups,
459 .ngroups = ARRAY_SIZE(cnlh_groups),
460 .functions = cnlh_functions,
461 .nfunctions = ARRAY_SIZE(cnlh_functions),
462 .communities = cnlh_communities,
463 .ncommunities = ARRAY_SIZE(cnlh_communities),
464};
465
45/* Cannon Lake-LP */ 466/* Cannon Lake-LP */
46static const struct pinctrl_pin_desc cnllp_pins[] = { 467static const struct pinctrl_pin_desc cnllp_pins[] = {
47 /* GPP_A */ 468 /* GPP_A */
@@ -403,6 +824,7 @@ static const struct intel_pinctrl_soc_data cnllp_soc_data = {
403}; 824};
404 825
405static const struct acpi_device_id cnl_pinctrl_acpi_match[] = { 826static const struct acpi_device_id cnl_pinctrl_acpi_match[] = {
827 { "INT3450", (kernel_ulong_t)&cnlh_soc_data },
406 { "INT34BB", (kernel_ulong_t)&cnllp_soc_data }, 828 { "INT34BB", (kernel_ulong_t)&cnllp_soc_data },
407 { }, 829 { },
408}; 830};
diff --git a/drivers/pinctrl/intel/pinctrl-denverton.c b/drivers/pinctrl/intel/pinctrl-denverton.c
new file mode 100644
index 000000000000..4500880240f2
--- /dev/null
+++ b/drivers/pinctrl/intel/pinctrl-denverton.c
@@ -0,0 +1,302 @@
1/*
2 * Intel Denverton SoC pinctrl/GPIO driver
3 *
4 * Copyright (C) 2017, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/acpi.h>
13#include <linux/module.h>
14#include <linux/platform_device.h>
15#include <linux/pm.h>
16#include <linux/pinctrl/pinctrl.h>
17
18#include "pinctrl-intel.h"
19
20#define DNV_PAD_OWN 0x020
21#define DNV_HOSTSW_OWN 0x0C0
22#define DNV_PADCFGLOCK 0x090
23#define DNV_GPI_IE 0x120
24
25#define DNV_GPP(n, s, e) \
26 { \
27 .reg_num = (n), \
28 .base = (s), \
29 .size = ((e) - (s) + 1), \
30 }
31
32#define DNV_COMMUNITY(b, s, e, g) \
33 { \
34 .barno = (b), \
35 .padown_offset = DNV_PAD_OWN, \
36 .padcfglock_offset = DNV_PADCFGLOCK, \
37 .hostown_offset = DNV_HOSTSW_OWN, \
38 .ie_offset = DNV_GPI_IE, \
39 .pin_base = (s), \
40 .npins = ((e) - (s) + 1), \
41 .gpps = (g), \
42 .ngpps = ARRAY_SIZE(g), \
43 }
44
45static const struct pinctrl_pin_desc dnv_pins[] = {
46 /* North ALL */
47 PINCTRL_PIN(0, "GBE0_SDP0"),
48 PINCTRL_PIN(1, "GBE1_SDP0"),
49 PINCTRL_PIN(2, "GBE0_SDP1"),
50 PINCTRL_PIN(3, "GBE1_SDP1"),
51 PINCTRL_PIN(4, "GBE0_SDP2"),
52 PINCTRL_PIN(5, "GBE1_SDP2"),
53 PINCTRL_PIN(6, "GBE0_SDP3"),
54 PINCTRL_PIN(7, "GBE1_SDP3"),
55 PINCTRL_PIN(8, "GBE2_LED0"),
56 PINCTRL_PIN(9, "GBE2_LED1"),
57 PINCTRL_PIN(10, "GBE0_I2C_CLK"),
58 PINCTRL_PIN(11, "GBE0_I2C_DATA"),
59 PINCTRL_PIN(12, "GBE1_I2C_CLK"),
60 PINCTRL_PIN(13, "GBE1_I2C_DATA"),
61 PINCTRL_PIN(14, "NCSI_RXD0"),
62 PINCTRL_PIN(15, "NCSI_CLK_IN"),
63 PINCTRL_PIN(16, "NCSI_RXD1"),
64 PINCTRL_PIN(17, "NCSI_CRS_DV"),
65 PINCTRL_PIN(18, "NCSI_ARB_IN"),
66 PINCTRL_PIN(19, "NCSI_TX_EN"),
67 PINCTRL_PIN(20, "NCSI_TXD0"),
68 PINCTRL_PIN(21, "NCSI_TXD1"),
69 PINCTRL_PIN(22, "NCSI_ARB_OUT"),
70 PINCTRL_PIN(23, "GBE0_LED0"),
71 PINCTRL_PIN(24, "GBE0_LED1"),
72 PINCTRL_PIN(25, "GBE1_LED0"),
73 PINCTRL_PIN(26, "GBE1_LED1"),
74 PINCTRL_PIN(27, "GPIO_0"),
75 PINCTRL_PIN(28, "PCIE_CLKREQ0_N"),
76 PINCTRL_PIN(29, "PCIE_CLKREQ1_N"),
77 PINCTRL_PIN(30, "PCIE_CLKREQ2_N"),
78 PINCTRL_PIN(31, "PCIE_CLKREQ3_N"),
79 PINCTRL_PIN(32, "PCIE_CLKREQ4_N"),
80 PINCTRL_PIN(33, "GPIO_1"),
81 PINCTRL_PIN(34, "GPIO_2"),
82 PINCTRL_PIN(35, "SVID_ALERT_N"),
83 PINCTRL_PIN(36, "SVID_DATA"),
84 PINCTRL_PIN(37, "SVID_CLK"),
85 PINCTRL_PIN(38, "THERMTRIP_N"),
86 PINCTRL_PIN(39, "PROCHOT_N"),
87 PINCTRL_PIN(40, "MEMHOT_N"),
88 /* South DFX */
89 PINCTRL_PIN(41, "DFX_PORT_CLK0"),
90 PINCTRL_PIN(42, "DFX_PORT_CLK1"),
91 PINCTRL_PIN(43, "DFX_PORT0"),
92 PINCTRL_PIN(44, "DFX_PORT1"),
93 PINCTRL_PIN(45, "DFX_PORT2"),
94 PINCTRL_PIN(46, "DFX_PORT3"),
95 PINCTRL_PIN(47, "DFX_PORT4"),
96 PINCTRL_PIN(48, "DFX_PORT5"),
97 PINCTRL_PIN(49, "DFX_PORT6"),
98 PINCTRL_PIN(50, "DFX_PORT7"),
99 PINCTRL_PIN(51, "DFX_PORT8"),
100 PINCTRL_PIN(52, "DFX_PORT9"),
101 PINCTRL_PIN(53, "DFX_PORT10"),
102 PINCTRL_PIN(54, "DFX_PORT11"),
103 PINCTRL_PIN(55, "DFX_PORT12"),
104 PINCTRL_PIN(56, "DFX_PORT13"),
105 PINCTRL_PIN(57, "DFX_PORT14"),
106 PINCTRL_PIN(58, "DFX_PORT15"),
107 /* South GPP0 */
108 PINCTRL_PIN(59, "GPIO_12"),
109 PINCTRL_PIN(60, "SMB5_GBE_ALRT_N"),
110 PINCTRL_PIN(61, "PCIE_CLKREQ5_N"),
111 PINCTRL_PIN(62, "PCIE_CLKREQ6_N"),
112 PINCTRL_PIN(63, "PCIE_CLKREQ7_N"),
113 PINCTRL_PIN(64, "UART0_RXD"),
114 PINCTRL_PIN(65, "UART0_TXD"),
115 PINCTRL_PIN(66, "SMB5_GBE_CLK"),
116 PINCTRL_PIN(67, "SMB5_GBE_DATA"),
117 PINCTRL_PIN(68, "ERROR2_N"),
118 PINCTRL_PIN(69, "ERROR1_N"),
119 PINCTRL_PIN(70, "ERROR0_N"),
120 PINCTRL_PIN(71, "IERR_N"),
121 PINCTRL_PIN(72, "MCERR_N"),
122 PINCTRL_PIN(73, "SMB0_LEG_CLK"),
123 PINCTRL_PIN(74, "SMB0_LEG_DATA"),
124 PINCTRL_PIN(75, "SMB0_LEG_ALRT_N"),
125 PINCTRL_PIN(76, "SMB1_HOST_DATA"),
126 PINCTRL_PIN(77, "SMB1_HOST_CLK"),
127 PINCTRL_PIN(78, "SMB2_PECI_DATA"),
128 PINCTRL_PIN(79, "SMB2_PECI_CLK"),
129 PINCTRL_PIN(80, "SMB4_CSME0_DATA"),
130 PINCTRL_PIN(81, "SMB4_CSME0_CLK"),
131 PINCTRL_PIN(82, "SMB4_CSME0_ALRT_N"),
132 PINCTRL_PIN(83, "USB_OC0_N"),
133 PINCTRL_PIN(84, "FLEX_CLK_SE0"),
134 PINCTRL_PIN(85, "FLEX_CLK_SE1"),
135 PINCTRL_PIN(86, "GPIO_4"),
136 PINCTRL_PIN(87, "GPIO_5"),
137 PINCTRL_PIN(88, "GPIO_6"),
138 PINCTRL_PIN(89, "GPIO_7"),
139 PINCTRL_PIN(90, "SATA0_LED_N"),
140 PINCTRL_PIN(91, "SATA1_LED_N"),
141 PINCTRL_PIN(92, "SATA_PDETECT0"),
142 PINCTRL_PIN(93, "SATA_PDETECT1"),
143 PINCTRL_PIN(94, "SATA0_SDOUT"),
144 PINCTRL_PIN(95, "SATA1_SDOUT"),
145 PINCTRL_PIN(96, "UART1_RXD"),
146 PINCTRL_PIN(97, "UART1_TXD"),
147 PINCTRL_PIN(98, "GPIO_8"),
148 PINCTRL_PIN(99, "GPIO_9"),
149 PINCTRL_PIN(100, "TCK"),
150 PINCTRL_PIN(101, "TRST_N"),
151 PINCTRL_PIN(102, "TMS"),
152 PINCTRL_PIN(103, "TDI"),
153 PINCTRL_PIN(104, "TDO"),
154 PINCTRL_PIN(105, "CX_PRDY_N"),
155 PINCTRL_PIN(106, "CX_PREQ_N"),
156 PINCTRL_PIN(107, "CTBTRIGINOUT"),
157 PINCTRL_PIN(108, "CTBTRIGOUT"),
158 PINCTRL_PIN(109, "DFX_SPARE2"),
159 PINCTRL_PIN(110, "DFX_SPARE3"),
160 PINCTRL_PIN(111, "DFX_SPARE4"),
161 /* South GPP1 */
162 PINCTRL_PIN(112, "SUSPWRDNACK"),
163 PINCTRL_PIN(113, "PMU_SUSCLK"),
164 PINCTRL_PIN(114, "ADR_TRIGGER"),
165 PINCTRL_PIN(115, "PMU_SLP_S45_N"),
166 PINCTRL_PIN(116, "PMU_SLP_S3_N"),
167 PINCTRL_PIN(117, "PMU_WAKE_N"),
168 PINCTRL_PIN(118, "PMU_PWRBTN_N"),
169 PINCTRL_PIN(119, "PMU_RESETBUTTON_N"),
170 PINCTRL_PIN(120, "PMU_PLTRST_N"),
171 PINCTRL_PIN(121, "SUS_STAT_N"),
172 PINCTRL_PIN(122, "SLP_S0IX_N"),
173 PINCTRL_PIN(123, "SPI_CS0_N"),
174 PINCTRL_PIN(124, "SPI_CS1_N"),
175 PINCTRL_PIN(125, "SPI_MOSI_IO0"),
176 PINCTRL_PIN(126, "SPI_MISO_IO1"),
177 PINCTRL_PIN(127, "SPI_IO2"),
178 PINCTRL_PIN(128, "SPI_IO3"),
179 PINCTRL_PIN(129, "SPI_CLK"),
180 PINCTRL_PIN(130, "SPI_CLK_LOOPBK"),
181 PINCTRL_PIN(131, "ESPI_IO0"),
182 PINCTRL_PIN(132, "ESPI_IO1"),
183 PINCTRL_PIN(133, "ESPI_IO2"),
184 PINCTRL_PIN(134, "ESPI_IO3"),
185 PINCTRL_PIN(135, "ESPI_CS0_N"),
186 PINCTRL_PIN(136, "ESPI_CLK"),
187 PINCTRL_PIN(137, "ESPI_RST_N"),
188 PINCTRL_PIN(138, "ESPI_ALRT0_N"),
189 PINCTRL_PIN(139, "GPIO_10"),
190 PINCTRL_PIN(140, "GPIO_11"),
191 PINCTRL_PIN(141, "ESPI_CLK_LOOPBK"),
192 PINCTRL_PIN(142, "EMMC_CMD"),
193 PINCTRL_PIN(143, "EMMC_STROBE"),
194 PINCTRL_PIN(144, "EMMC_CLK"),
195 PINCTRL_PIN(145, "EMMC_D0"),
196 PINCTRL_PIN(146, "EMMC_D1"),
197 PINCTRL_PIN(147, "EMMC_D2"),
198 PINCTRL_PIN(148, "EMMC_D3"),
199 PINCTRL_PIN(149, "EMMC_D4"),
200 PINCTRL_PIN(150, "EMMC_D5"),
201 PINCTRL_PIN(151, "EMMC_D6"),
202 PINCTRL_PIN(152, "EMMC_D7"),
203 PINCTRL_PIN(153, "GPIO_3"),
204};
205
206static const unsigned int dnv_uart0_pins[] = { 60, 61, 64, 65 };
207static const unsigned int dnv_uart0_modes[] = { 2, 3, 1, 1 };
208static const unsigned int dnv_uart1_pins[] = { 94, 95, 96, 97 };
209static const unsigned int dnv_uart2_pins[] = { 60, 61, 62, 63 };
210static const unsigned int dnv_uart2_modes[] = { 1, 1, 2, 2 };
211static const unsigned int dnv_emmc_pins[] = {
212 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
213};
214
215static const struct intel_pingroup dnv_groups[] = {
216 PIN_GROUP("uart0_grp", dnv_uart0_pins, dnv_uart0_modes),
217 PIN_GROUP("uart1_grp", dnv_uart1_pins, 1),
218 PIN_GROUP("uart2_grp", dnv_uart2_pins, dnv_uart2_modes),
219 PIN_GROUP("emmc_grp", dnv_emmc_pins, 1),
220};
221
222static const char * const dnv_uart0_groups[] = { "uart0_grp" };
223static const char * const dnv_uart1_groups[] = { "uart1_grp" };
224static const char * const dnv_uart2_groups[] = { "uart2_grp" };
225static const char * const dnv_emmc_groups[] = { "emmc_grp" };
226
227static const struct intel_function dnv_functions[] = {
228 FUNCTION("uart0", dnv_uart0_groups),
229 FUNCTION("uart1", dnv_uart1_groups),
230 FUNCTION("uart2", dnv_uart2_groups),
231 FUNCTION("emmc", dnv_emmc_groups),
232};
233
234static const struct intel_padgroup dnv_north_gpps[] = {
235 DNV_GPP(0, 0, 31), /* North ALL_0 */
236 DNV_GPP(1, 32, 40), /* North ALL_1 */
237};
238
239static const struct intel_padgroup dnv_south_gpps[] = {
240 DNV_GPP(0, 41, 58), /* South DFX */
241 DNV_GPP(1, 59, 90), /* South GPP0_0 */
242 DNV_GPP(2, 91, 111), /* South GPP0_1 */
243 DNV_GPP(3, 112, 143), /* South GPP1_0 */
244 DNV_GPP(4, 144, 153), /* South GPP1_1 */
245};
246
247static const struct intel_community dnv_communities[] = {
248 DNV_COMMUNITY(0, 0, 40, dnv_north_gpps),
249 DNV_COMMUNITY(1, 41, 153, dnv_south_gpps),
250};
251
252static const struct intel_pinctrl_soc_data dnv_soc_data = {
253 .pins = dnv_pins,
254 .npins = ARRAY_SIZE(dnv_pins),
255 .groups = dnv_groups,
256 .ngroups = ARRAY_SIZE(dnv_groups),
257 .functions = dnv_functions,
258 .nfunctions = ARRAY_SIZE(dnv_functions),
259 .communities = dnv_communities,
260 .ncommunities = ARRAY_SIZE(dnv_communities),
261};
262
263static int dnv_pinctrl_probe(struct platform_device *pdev)
264{
265 return intel_pinctrl_probe(pdev, &dnv_soc_data);
266}
267
268static const struct dev_pm_ops dnv_pinctrl_pm_ops = {
269 SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend,
270 intel_pinctrl_resume)
271};
272
273static const struct acpi_device_id dnv_pinctrl_acpi_match[] = {
274 { "INTC3000" },
275 { }
276};
277MODULE_DEVICE_TABLE(acpi, dnv_pinctrl_acpi_match);
278
279static struct platform_driver dnv_pinctrl_driver = {
280 .probe = dnv_pinctrl_probe,
281 .driver = {
282 .name = "denverton-pinctrl",
283 .acpi_match_table = dnv_pinctrl_acpi_match,
284 .pm = &dnv_pinctrl_pm_ops,
285 },
286};
287
288static int __init dnv_pinctrl_init(void)
289{
290 return platform_driver_register(&dnv_pinctrl_driver);
291}
292subsys_initcall(dnv_pinctrl_init);
293
294static void __exit dnv_pinctrl_exit(void)
295{
296 platform_driver_unregister(&dnv_pinctrl_driver);
297}
298module_exit(dnv_pinctrl_exit);
299
300MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
301MODULE_DESCRIPTION("Intel Denverton SoC pinctrl/GPIO driver");
302MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 6dc1096d3d34..71df0f70b61f 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -751,33 +751,38 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned offset)
751{ 751{
752 struct intel_pinctrl *pctrl = gpiochip_get_data(chip); 752 struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
753 void __iomem *reg; 753 void __iomem *reg;
754 u32 padcfg0;
754 755
755 reg = intel_get_padcfg(pctrl, offset, PADCFG0); 756 reg = intel_get_padcfg(pctrl, offset, PADCFG0);
756 if (!reg) 757 if (!reg)
757 return -EINVAL; 758 return -EINVAL;
758 759
759 return !!(readl(reg) & PADCFG0_GPIORXSTATE); 760 padcfg0 = readl(reg);
761 if (!(padcfg0 & PADCFG0_GPIOTXDIS))
762 return !!(padcfg0 & PADCFG0_GPIOTXSTATE);
763
764 return !!(padcfg0 & PADCFG0_GPIORXSTATE);
760} 765}
761 766
762static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 767static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
763{ 768{
764 struct intel_pinctrl *pctrl = gpiochip_get_data(chip); 769 struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
770 unsigned long flags;
765 void __iomem *reg; 771 void __iomem *reg;
772 u32 padcfg0;
766 773
767 reg = intel_get_padcfg(pctrl, offset, PADCFG0); 774 reg = intel_get_padcfg(pctrl, offset, PADCFG0);
768 if (reg) { 775 if (!reg)
769 unsigned long flags; 776 return;
770 u32 padcfg0;
771 777
772 raw_spin_lock_irqsave(&pctrl->lock, flags); 778 raw_spin_lock_irqsave(&pctrl->lock, flags);
773 padcfg0 = readl(reg); 779 padcfg0 = readl(reg);
774 if (value) 780 if (value)
775 padcfg0 |= PADCFG0_GPIOTXSTATE; 781 padcfg0 |= PADCFG0_GPIOTXSTATE;
776 else 782 else
777 padcfg0 &= ~PADCFG0_GPIOTXSTATE; 783 padcfg0 &= ~PADCFG0_GPIOTXSTATE;
778 writel(padcfg0, reg); 784 writel(padcfg0, reg);
779 raw_spin_unlock_irqrestore(&pctrl->lock, flags); 785 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
780 }
781} 786}
782 787
783static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 788static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -1035,6 +1040,7 @@ static struct irq_chip intel_gpio_irqchip = {
1035 .irq_unmask = intel_gpio_irq_unmask, 1040 .irq_unmask = intel_gpio_irq_unmask,
1036 .irq_set_type = intel_gpio_irq_type, 1041 .irq_set_type = intel_gpio_irq_type,
1037 .irq_set_wake = intel_gpio_irq_wake, 1042 .irq_set_wake = intel_gpio_irq_wake,
1043 .flags = IRQCHIP_MASK_ON_SUSPEND,
1038}; 1044};
1039 1045
1040static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) 1046static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
diff --git a/drivers/pinctrl/intel/pinctrl-lewisburg.c b/drivers/pinctrl/intel/pinctrl-lewisburg.c
new file mode 100644
index 000000000000..14d56ea6cfdc
--- /dev/null
+++ b/drivers/pinctrl/intel/pinctrl-lewisburg.c
@@ -0,0 +1,343 @@
1/*
2 * Intel Lewisburg pinctrl/GPIO driver
3 *
4 * Copyright (C) 2017, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/acpi.h>
13#include <linux/module.h>
14#include <linux/platform_device.h>
15#include <linux/pm.h>
16#include <linux/pinctrl/pinctrl.h>
17
18#include "pinctrl-intel.h"
19
20#define LBG_PAD_OWN 0x020
21#define LBG_PADCFGLOCK 0x060
22#define LBG_HOSTSW_OWN 0x080
23#define LBG_GPI_IE 0x110
24
25#define LBG_COMMUNITY(b, s, e) \
26 { \
27 .barno = (b), \
28 .padown_offset = LBG_PAD_OWN, \
29 .padcfglock_offset = LBG_PADCFGLOCK, \
30 .hostown_offset = LBG_HOSTSW_OWN, \
31 .ie_offset = LBG_GPI_IE, \
32 .gpp_size = 24, \
33 .pin_base = (s), \
34 .npins = ((e) - (s) + 1), \
35 }
36
37static const struct pinctrl_pin_desc lbg_pins[] = {
38 /* GPP_A */
39 PINCTRL_PIN(0, "RCINB"),
40 PINCTRL_PIN(1, "LAD_0"),
41 PINCTRL_PIN(2, "LAD_1"),
42 PINCTRL_PIN(3, "LAD_2"),
43 PINCTRL_PIN(4, "LAD_3"),
44 PINCTRL_PIN(5, "LFRAMEB"),
45 PINCTRL_PIN(6, "SERIRQ"),
46 PINCTRL_PIN(7, "PIRQAB"),
47 PINCTRL_PIN(8, "CLKRUNB"),
48 PINCTRL_PIN(9, "CLKOUT_LPC_0"),
49 PINCTRL_PIN(10, "CLKOUT_LPC_1"),
50 PINCTRL_PIN(11, "PMEB"),
51 PINCTRL_PIN(12, "BM_BUSYB"),
52 PINCTRL_PIN(13, "SUSWARNB_SUSPWRDNACK"),
53 PINCTRL_PIN(14, "ESPI_RESETB"),
54 PINCTRL_PIN(15, "SUSACKB"),
55 PINCTRL_PIN(16, "CLKOUT_LPC_2"),
56 PINCTRL_PIN(17, "GPP_A_17"),
57 PINCTRL_PIN(18, "GPP_A_18"),
58 PINCTRL_PIN(19, "GPP_A_19"),
59 PINCTRL_PIN(20, "GPP_A_20"),
60 PINCTRL_PIN(21, "GPP_A_21"),
61 PINCTRL_PIN(22, "GPP_A_22"),
62 PINCTRL_PIN(23, "GPP_A_23"),
63 /* GPP_B */
64 PINCTRL_PIN(24, "CORE_VID_0"),
65 PINCTRL_PIN(25, "CORE_VID_1"),
66 PINCTRL_PIN(26, "VRALERTB"),
67 PINCTRL_PIN(27, "CPU_GP_2"),
68 PINCTRL_PIN(28, "CPU_GP_3"),
69 PINCTRL_PIN(29, "SRCCLKREQB_0"),
70 PINCTRL_PIN(30, "SRCCLKREQB_1"),
71 PINCTRL_PIN(31, "SRCCLKREQB_2"),
72 PINCTRL_PIN(32, "SRCCLKREQB_3"),
73 PINCTRL_PIN(33, "SRCCLKREQB_4"),
74 PINCTRL_PIN(34, "SRCCLKREQB_5"),
75 PINCTRL_PIN(35, "GPP_B_11"),
76 PINCTRL_PIN(36, "GLB_RST_WARN_N"),
77 PINCTRL_PIN(37, "PLTRSTB"),
78 PINCTRL_PIN(38, "SPKR"),
79 PINCTRL_PIN(39, "GPP_B_15"),
80 PINCTRL_PIN(40, "GPP_B_16"),
81 PINCTRL_PIN(41, "GPP_B_17"),
82 PINCTRL_PIN(42, "GPP_B_18"),
83 PINCTRL_PIN(43, "GPP_B_19"),
84 PINCTRL_PIN(44, "GPP_B_20"),
85 PINCTRL_PIN(45, "GPP_B_21"),
86 PINCTRL_PIN(46, "GPP_B_22"),
87 PINCTRL_PIN(47, "SML1ALERTB"),
88 /* GPP_F */
89 PINCTRL_PIN(48, "SATAXPCIE_3"),
90 PINCTRL_PIN(49, "SATAXPCIE_4"),
91 PINCTRL_PIN(50, "SATAXPCIE_5"),
92 PINCTRL_PIN(51, "SATAXPCIE_6"),
93 PINCTRL_PIN(52, "SATAXPCIE_7"),
94 PINCTRL_PIN(53, "SATA_DEVSLP_3"),
95 PINCTRL_PIN(54, "SATA_DEVSLP_4"),
96 PINCTRL_PIN(55, "SATA_DEVSLP_5"),
97 PINCTRL_PIN(56, "SATA_DEVSLP_6"),
98 PINCTRL_PIN(57, "SATA_DEVSLP_7"),
99 PINCTRL_PIN(58, "SATA_SCLOCK"),
100 PINCTRL_PIN(59, "SATA_SLOAD"),
101 PINCTRL_PIN(60, "SATA_SDATAOUT1"),
102 PINCTRL_PIN(61, "SATA_SDATAOUT0"),
103 PINCTRL_PIN(62, "SSATA_LEDB"),
104 PINCTRL_PIN(63, "USB2_OCB_4"),
105 PINCTRL_PIN(64, "USB2_OCB_5"),
106 PINCTRL_PIN(65, "USB2_OCB_6"),
107 PINCTRL_PIN(66, "USB2_OCB_7"),
108 PINCTRL_PIN(67, "GBE_SMBUS_CLK"),
109 PINCTRL_PIN(68, "GBE_SMBDATA"),
110 PINCTRL_PIN(69, "GBE_SMBALRTN"),
111 PINCTRL_PIN(70, "SSATA_SCLOCK"),
112 PINCTRL_PIN(71, "SSATA_SLOAD"),
113 /* GPP_C */
114 PINCTRL_PIN(72, "SMBCLK"),
115 PINCTRL_PIN(73, "SMBDATA"),
116 PINCTRL_PIN(74, "SMBALERTB"),
117 PINCTRL_PIN(75, "SML0CLK"),
118 PINCTRL_PIN(76, "SML0DATA"),
119 PINCTRL_PIN(77, "SML0ALERTB"),
120 PINCTRL_PIN(78, "SML1CLK"),
121 PINCTRL_PIN(79, "SML1DATA"),
122 PINCTRL_PIN(80, "GPP_C_8"),
123 PINCTRL_PIN(81, "GPP_C_9"),
124 PINCTRL_PIN(82, "GPP_C_10"),
125 PINCTRL_PIN(83, "GPP_C_11"),
126 PINCTRL_PIN(84, "GPP_C_12"),
127 PINCTRL_PIN(85, "GPP_C_13"),
128 PINCTRL_PIN(86, "GPP_C_14"),
129 PINCTRL_PIN(87, "GPP_C_15"),
130 PINCTRL_PIN(88, "GPP_C_16"),
131 PINCTRL_PIN(89, "GPP_C_17"),
132 PINCTRL_PIN(90, "GPP_C_18"),
133 PINCTRL_PIN(91, "GPP_C_19"),
134 PINCTRL_PIN(92, "GPP_C_20"),
135 PINCTRL_PIN(93, "GPP_C_21"),
136 PINCTRL_PIN(94, "GPP_C_22"),
137 PINCTRL_PIN(95, "GPP_C_23"),
138 /* GPP_D */
139 PINCTRL_PIN(96, "GPP_D_0"),
140 PINCTRL_PIN(97, "GPP_D_1"),
141 PINCTRL_PIN(98, "GPP_D_2"),
142 PINCTRL_PIN(99, "GPP_D_3"),
143 PINCTRL_PIN(100, "GPP_D_4"),
144 PINCTRL_PIN(101, "SSP0_SFRM"),
145 PINCTRL_PIN(102, "SSP0_TXD"),
146 PINCTRL_PIN(103, "SSP0_RXD"),
147 PINCTRL_PIN(104, "SSP0_SCLK"),
148 PINCTRL_PIN(105, "SSATA_DEVSLP_3"),
149 PINCTRL_PIN(106, "SSATA_DEVSLP_4"),
150 PINCTRL_PIN(107, "SSATA_DEVSLP_5"),
151 PINCTRL_PIN(108, "SSATA_SDATAOUT1"),
152 PINCTRL_PIN(109, "SML0BCLK_SML0BCLKIE"),
153 PINCTRL_PIN(110, "SML0BDATA_SML0BDATAIE"),
154 PINCTRL_PIN(111, "SSATA_SDATAOUT0"),
155 PINCTRL_PIN(112, "SML0BALERTB_SML0BALERTBIE"),
156 PINCTRL_PIN(113, "DMIC_CLK_1"),
157 PINCTRL_PIN(114, "DMIC_DATA_1"),
158 PINCTRL_PIN(115, "DMIC_CLK_0"),
159 PINCTRL_PIN(116, "DMIC_DATA_0"),
160 PINCTRL_PIN(117, "IE_UART_RXD"),
161 PINCTRL_PIN(118, "IE_UART_TXD"),
162 PINCTRL_PIN(119, "GPP_D_23"),
163 /* GPP_E */
164 PINCTRL_PIN(120, "SATAXPCIE_0"),
165 PINCTRL_PIN(121, "SATAXPCIE_1"),
166 PINCTRL_PIN(122, "SATAXPCIE_2"),
167 PINCTRL_PIN(123, "CPU_GP_0"),
168 PINCTRL_PIN(124, "SATA_DEVSLP_0"),
169 PINCTRL_PIN(125, "SATA_DEVSLP_1"),
170 PINCTRL_PIN(126, "SATA_DEVSLP_2"),
171 PINCTRL_PIN(127, "CPU_GP_1"),
172 PINCTRL_PIN(128, "SATA_LEDB"),
173 PINCTRL_PIN(129, "USB2_OCB_0"),
174 PINCTRL_PIN(130, "USB2_OCB_1"),
175 PINCTRL_PIN(131, "USB2_OCB_2"),
176 PINCTRL_PIN(132, "USB2_OCB_3"),
177 /* GPP_I */
178 PINCTRL_PIN(133, "GBE_TDO"),
179 PINCTRL_PIN(134, "GBE_TCK"),
180 PINCTRL_PIN(135, "GBE_TMS"),
181 PINCTRL_PIN(136, "GBE_TDI"),
182 PINCTRL_PIN(137, "DO_RESET_INB"),
183 PINCTRL_PIN(138, "DO_RESET_OUTB"),
184 PINCTRL_PIN(139, "RESET_DONE"),
185 PINCTRL_PIN(140, "GBE_TRST_N"),
186 PINCTRL_PIN(141, "GBE_PCI_DIS"),
187 PINCTRL_PIN(142, "GBE_LAN_DIS"),
188 PINCTRL_PIN(143, "GPP_I_10"),
189 PINCTRL_PIN(144, "GPIO_RCOMP_3P3"),
190 /* GPP_J */
191 PINCTRL_PIN(145, "GBE_LED_0_0"),
192 PINCTRL_PIN(146, "GBE_LED_0_1"),
193 PINCTRL_PIN(147, "GBE_LED_1_0"),
194 PINCTRL_PIN(148, "GBE_LED_1_1"),
195 PINCTRL_PIN(149, "GBE_LED_2_0"),
196 PINCTRL_PIN(150, "GBE_LED_2_1"),
197 PINCTRL_PIN(151, "GBE_LED_3_0"),
198 PINCTRL_PIN(152, "GBE_LED_3_1"),
199 PINCTRL_PIN(153, "GBE_SCL_0"),
200 PINCTRL_PIN(154, "GBE_SDA_0"),
201 PINCTRL_PIN(155, "GBE_SCL_1"),
202 PINCTRL_PIN(156, "GBE_SDA_1"),
203 PINCTRL_PIN(157, "GBE_SCL_2"),
204 PINCTRL_PIN(158, "GBE_SDA_2"),
205 PINCTRL_PIN(159, "GBE_SCL_3"),
206 PINCTRL_PIN(160, "GBE_SDA_3"),
207 PINCTRL_PIN(161, "GBE_SDP_0_0"),
208 PINCTRL_PIN(162, "GBE_SDP_0_1"),
209 PINCTRL_PIN(163, "GBE_SDP_1_0"),
210 PINCTRL_PIN(164, "GBE_SDP_1_1"),
211 PINCTRL_PIN(165, "GBE_SDP_2_0"),
212 PINCTRL_PIN(166, "GBE_SDP_2_1"),
213 PINCTRL_PIN(167, "GBE_SDP_3_0"),
214 PINCTRL_PIN(168, "GBE_SDP_3_1"),
215 /* GPP_K */
216 PINCTRL_PIN(169, "GBE_RMIICLK"),
217 PINCTRL_PIN(170, "GBE_RMII_TXD_0"),
218 PINCTRL_PIN(171, "GBE_RMII_TXD_1"),
219 PINCTRL_PIN(172, "GBE_RMII_TX_EN"),
220 PINCTRL_PIN(173, "GBE_RMII_CRS_DV"),
221 PINCTRL_PIN(174, "GBE_RMII_RXD_0"),
222 PINCTRL_PIN(175, "GBE_RMII_RXD_1"),
223 PINCTRL_PIN(176, "GBE_RMII_RX_ER"),
224 PINCTRL_PIN(177, "GBE_RMII_ARBIN"),
225 PINCTRL_PIN(178, "GBE_RMII_ARB_OUT"),
226 PINCTRL_PIN(179, "PE_RST_N"),
227 PINCTRL_PIN(180, "GPIO_RCOMP_1P8_3P3"),
228 /* GPP_G */
229 PINCTRL_PIN(181, "FAN_TACH_0"),
230 PINCTRL_PIN(182, "FAN_TACH_1"),
231 PINCTRL_PIN(183, "FAN_TACH_2"),
232 PINCTRL_PIN(184, "FAN_TACH_3"),
233 PINCTRL_PIN(185, "FAN_TACH_4"),
234 PINCTRL_PIN(186, "FAN_TACH_5"),
235 PINCTRL_PIN(187, "FAN_TACH_6"),
236 PINCTRL_PIN(188, "FAN_TACH_7"),
237 PINCTRL_PIN(189, "FAN_PWM_0"),
238 PINCTRL_PIN(190, "FAN_PWM_1"),
239 PINCTRL_PIN(191, "FAN_PWM_2"),
240 PINCTRL_PIN(192, "FAN_PWM_3"),
241 PINCTRL_PIN(193, "GSXDOUT"),
242 PINCTRL_PIN(194, "GSXSLOAD"),
243 PINCTRL_PIN(195, "GSXDIN"),
244 PINCTRL_PIN(196, "GSXSRESETB"),
245 PINCTRL_PIN(197, "GSXCLK"),
246 PINCTRL_PIN(198, "ADR_COMPLETE"),
247 PINCTRL_PIN(199, "NMIB"),
248 PINCTRL_PIN(200, "SMIB"),
249 PINCTRL_PIN(201, "SSATA_DEVSLP_0"),
250 PINCTRL_PIN(202, "SSATA_DEVSLP_1"),
251 PINCTRL_PIN(203, "SSATA_DEVSLP_2"),
252 PINCTRL_PIN(204, "SSATAXPCIE0_SSATAGP0"),
253 /* GPP_H */
254 PINCTRL_PIN(205, "SRCCLKREQB_6"),
255 PINCTRL_PIN(206, "SRCCLKREQB_7"),
256 PINCTRL_PIN(207, "SRCCLKREQB_8"),
257 PINCTRL_PIN(208, "SRCCLKREQB_9"),
258 PINCTRL_PIN(209, "SRCCLKREQB_10"),
259 PINCTRL_PIN(210, "SRCCLKREQB_11"),
260 PINCTRL_PIN(211, "SRCCLKREQB_12"),
261 PINCTRL_PIN(212, "SRCCLKREQB_13"),
262 PINCTRL_PIN(213, "SRCCLKREQB_14"),
263 PINCTRL_PIN(214, "SRCCLKREQB_15"),
264 PINCTRL_PIN(215, "SML2CLK"),
265 PINCTRL_PIN(216, "SML2DATA"),
266 PINCTRL_PIN(217, "SML2ALERTB"),
267 PINCTRL_PIN(218, "SML3CLK"),
268 PINCTRL_PIN(219, "SML3DATA"),
269 PINCTRL_PIN(220, "SML3ALERTB"),
270 PINCTRL_PIN(221, "SML4CLK"),
271 PINCTRL_PIN(222, "SML4DATA"),
272 PINCTRL_PIN(223, "SML4ALERTB"),
273 PINCTRL_PIN(224, "SSATAXPCIE1_SSATAGP1"),
274 PINCTRL_PIN(225, "SSATAXPCIE2_SSATAGP2"),
275 PINCTRL_PIN(226, "SSATAXPCIE3_SSATAGP3"),
276 PINCTRL_PIN(227, "SSATAXPCIE4_SSATAGP4"),
277 PINCTRL_PIN(228, "SSATAXPCIE5_SSATAGP5"),
278 /* GPP_L */
279 PINCTRL_PIN(229, "VISA2CH0_D0"),
280 PINCTRL_PIN(230, "VISA2CH0_D1"),
281 PINCTRL_PIN(231, "VISA2CH0_D2"),
282 PINCTRL_PIN(232, "VISA2CH0_D3"),
283 PINCTRL_PIN(233, "VISA2CH0_D4"),
284 PINCTRL_PIN(234, "VISA2CH0_D5"),
285 PINCTRL_PIN(235, "VISA2CH0_D6"),
286 PINCTRL_PIN(236, "VISA2CH0_D7"),
287 PINCTRL_PIN(237, "VISA2CH0_CLK"),
288 PINCTRL_PIN(238, "VISA2CH1_D0"),
289 PINCTRL_PIN(239, "VISA2CH1_D1"),
290 PINCTRL_PIN(240, "VISA2CH1_D2"),
291 PINCTRL_PIN(241, "VISA2CH1_D3"),
292 PINCTRL_PIN(242, "VISA2CH1_D4"),
293 PINCTRL_PIN(243, "VISA2CH1_D5"),
294 PINCTRL_PIN(244, "VISA2CH1_D6"),
295 PINCTRL_PIN(245, "VISA2CH1_D7"),
296 PINCTRL_PIN(246, "VISA2CH1_CLK"),
297};
298
299static const struct intel_community lbg_communities[] = {
300 LBG_COMMUNITY(0, 0, 71),
301 LBG_COMMUNITY(1, 72, 132),
302 LBG_COMMUNITY(3, 133, 144),
303 LBG_COMMUNITY(4, 145, 180),
304 LBG_COMMUNITY(5, 181, 246),
305};
306
307static const struct intel_pinctrl_soc_data lbg_soc_data = {
308 .pins = lbg_pins,
309 .npins = ARRAY_SIZE(lbg_pins),
310 .communities = lbg_communities,
311 .ncommunities = ARRAY_SIZE(lbg_communities),
312};
313
314static int lbg_pinctrl_probe(struct platform_device *pdev)
315{
316 return intel_pinctrl_probe(pdev, &lbg_soc_data);
317}
318
319static const struct dev_pm_ops lbg_pinctrl_pm_ops = {
320 SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend,
321 intel_pinctrl_resume)
322};
323
324static const struct acpi_device_id lbg_pinctrl_acpi_match[] = {
325 { "INT3536" },
326 { }
327};
328MODULE_DEVICE_TABLE(acpi, lbg_pinctrl_acpi_match);
329
330static struct platform_driver lbg_pinctrl_driver = {
331 .probe = lbg_pinctrl_probe,
332 .driver = {
333 .name = "lewisburg-pinctrl",
334 .acpi_match_table = lbg_pinctrl_acpi_match,
335 .pm = &lbg_pinctrl_pm_ops,
336 },
337};
338
339module_platform_driver(lbg_pinctrl_driver);
340
341MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
342MODULE_DESCRIPTION("Intel Lewisburg pinctrl/GPIO driver");
343MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h b/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h
index f90642078c31..1035df49301f 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h
@@ -223,6 +223,8 @@ static const struct mtk_desc_pin mtk_pins_mt2701[] = {
223 MTK_EINT_FUNCTION(0, 0), 223 MTK_EINT_FUNCTION(0, 0),
224 MTK_FUNCTION(0, "GPIO22"), 224 MTK_FUNCTION(0, "GPIO22"),
225 MTK_FUNCTION(1, "UCTS0"), 225 MTK_FUNCTION(1, "UCTS0"),
226 /* MT7623 take function 2 as PCIE0_PERST_N */
227 MTK_FUNCTION(2, "PCIE0_PERST_N"),
226 MTK_FUNCTION(3, "KCOL3"), 228 MTK_FUNCTION(3, "KCOL3"),
227 MTK_FUNCTION(4, "CONN_DSP_JDO"), 229 MTK_FUNCTION(4, "CONN_DSP_JDO"),
228 MTK_FUNCTION(5, "EXT_FRAME_SYNC"), 230 MTK_FUNCTION(5, "EXT_FRAME_SYNC"),
@@ -235,6 +237,8 @@ static const struct mtk_desc_pin mtk_pins_mt2701[] = {
235 MTK_EINT_FUNCTION(0, 1), 237 MTK_EINT_FUNCTION(0, 1),
236 MTK_FUNCTION(0, "GPIO23"), 238 MTK_FUNCTION(0, "GPIO23"),
237 MTK_FUNCTION(1, "URTS0"), 239 MTK_FUNCTION(1, "URTS0"),
240 /* MT7623 take function 2 as PCIE1_PERST_N */
241 MTK_FUNCTION(2, "PCIE1_PERST_N"),
238 MTK_FUNCTION(3, "KCOL2"), 242 MTK_FUNCTION(3, "KCOL2"),
239 MTK_FUNCTION(4, "CONN_MCU_TDO"), 243 MTK_FUNCTION(4, "CONN_MCU_TDO"),
240 MTK_FUNCTION(5, "EXT_FRAME_SYNC"), 244 MTK_FUNCTION(5, "EXT_FRAME_SYNC"),
@@ -247,6 +251,8 @@ static const struct mtk_desc_pin mtk_pins_mt2701[] = {
247 MTK_EINT_FUNCTION(0, 2), 251 MTK_EINT_FUNCTION(0, 2),
248 MTK_FUNCTION(0, "GPIO24"), 252 MTK_FUNCTION(0, "GPIO24"),
249 MTK_FUNCTION(1, "UCTS1"), 253 MTK_FUNCTION(1, "UCTS1"),
254 /* MT7623 take function 2 as PCIE2_PERST_N */
255 MTK_FUNCTION(2, "PCIE2_PERST_N"),
250 MTK_FUNCTION(3, "KCOL1"), 256 MTK_FUNCTION(3, "KCOL1"),
251 MTK_FUNCTION(4, "CONN_MCU_DBGACK_N"), 257 MTK_FUNCTION(4, "CONN_MCU_DBGACK_N"),
252 MTK_FUNCTION(7, "DBG_MON_A[28]"), 258 MTK_FUNCTION(7, "DBG_MON_A[28]"),
@@ -308,6 +314,8 @@ static const struct mtk_desc_pin mtk_pins_mt2701[] = {
308 MTK_FUNCTION(3, "KROW0"), 314 MTK_FUNCTION(3, "KROW0"),
309 MTK_FUNCTION(4, "CONN_MCU_TMS"), 315 MTK_FUNCTION(4, "CONN_MCU_TMS"),
310 MTK_FUNCTION(5, "CONN_MCU_AICE_JMSC"), 316 MTK_FUNCTION(5, "CONN_MCU_AICE_JMSC"),
317 /* MT7623 take function 6 as PCIE2_PERST_N */
318 MTK_FUNCTION(6, "PCIE2_PERST_N"),
311 MTK_FUNCTION(7, "DBG_MON_A[23]"), 319 MTK_FUNCTION(7, "DBG_MON_A[23]"),
312 MTK_FUNCTION(14, "PCIE2_PERST_N") 320 MTK_FUNCTION(14, "PCIE2_PERST_N")
313 ), 321 ),
@@ -1787,6 +1795,8 @@ static const struct mtk_desc_pin mtk_pins_mt2701[] = {
1787 MTK_FUNCTION(0, "GPIO208"), 1795 MTK_FUNCTION(0, "GPIO208"),
1788 MTK_FUNCTION(1, "AUD_EXT_CK1"), 1796 MTK_FUNCTION(1, "AUD_EXT_CK1"),
1789 MTK_FUNCTION(2, "PWM0"), 1797 MTK_FUNCTION(2, "PWM0"),
1798 /* MT7623 take function 3 as PCIE0_PERST_N */
1799 MTK_FUNCTION(3, "PCIE0_PERST_N"),
1790 MTK_FUNCTION(4, "ANT_SEL5"), 1800 MTK_FUNCTION(4, "ANT_SEL5"),
1791 MTK_FUNCTION(5, "DISP_PWM"), 1801 MTK_FUNCTION(5, "DISP_PWM"),
1792 MTK_FUNCTION(7, "DBG_MON_A[31]"), 1802 MTK_FUNCTION(7, "DBG_MON_A[31]"),
@@ -1799,6 +1809,8 @@ static const struct mtk_desc_pin mtk_pins_mt2701[] = {
1799 MTK_FUNCTION(0, "GPIO209"), 1809 MTK_FUNCTION(0, "GPIO209"),
1800 MTK_FUNCTION(1, "AUD_EXT_CK2"), 1810 MTK_FUNCTION(1, "AUD_EXT_CK2"),
1801 MTK_FUNCTION(2, "MSDC1_WP"), 1811 MTK_FUNCTION(2, "MSDC1_WP"),
1812 /* MT7623 take function 3 as PCIE1_PERST_N */
1813 MTK_FUNCTION(3, "PCIE1_PERST_N"),
1802 MTK_FUNCTION(5, "PWM1"), 1814 MTK_FUNCTION(5, "PWM1"),
1803 MTK_FUNCTION(7, "DBG_MON_A[32]"), 1815 MTK_FUNCTION(7, "DBG_MON_A[32]"),
1804 MTK_FUNCTION(11, "PCIE1_PERST_N") 1816 MTK_FUNCTION(11, "PCIE1_PERST_N")
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 0c6d7812d6fd..b8b6ab072cd0 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -190,14 +190,14 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {
190 "mii", "mii_err"), 190 "mii", "mii_err"),
191}; 191};
192 192
193const struct armada_37xx_pin_data armada_37xx_pin_nb = { 193static const struct armada_37xx_pin_data armada_37xx_pin_nb = {
194 .nr_pins = 36, 194 .nr_pins = 36,
195 .name = "GPIO1", 195 .name = "GPIO1",
196 .groups = armada_37xx_nb_groups, 196 .groups = armada_37xx_nb_groups,
197 .ngroups = ARRAY_SIZE(armada_37xx_nb_groups), 197 .ngroups = ARRAY_SIZE(armada_37xx_nb_groups),
198}; 198};
199 199
200const struct armada_37xx_pin_data armada_37xx_pin_sb = { 200static const struct armada_37xx_pin_data armada_37xx_pin_sb = {
201 .nr_pins = 30, 201 .nr_pins = 30,
202 .name = "GPIO2", 202 .name = "GPIO2",
203 .groups = armada_37xx_sb_groups, 203 .groups = armada_37xx_sb_groups,
@@ -254,7 +254,7 @@ static int armada_37xx_pin_config_group_set(struct pinctrl_dev *pctldev,
254 return -ENOTSUPP; 254 return -ENOTSUPP;
255} 255}
256 256
257static struct pinconf_ops armada_37xx_pinconf_ops = { 257static const struct pinconf_ops armada_37xx_pinconf_ops = {
258 .is_generic = true, 258 .is_generic = true,
259 .pin_config_group_get = armada_37xx_pin_config_group_get, 259 .pin_config_group_get = armada_37xx_pin_config_group_get,
260 .pin_config_group_set = armada_37xx_pin_config_group_set, 260 .pin_config_group_set = armada_37xx_pin_config_group_set,
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index f95001bc1d58..b32c0d602024 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -647,7 +647,7 @@ static inline void abx500_gpio_dbg_show_one(struct seq_file *s,
647#define abx500_gpio_dbg_show NULL 647#define abx500_gpio_dbg_show NULL
648#endif 648#endif
649 649
650static struct gpio_chip abx500gpio_chip = { 650static const struct gpio_chip abx500gpio_chip = {
651 .label = "abx500-gpio", 651 .label = "abx500-gpio",
652 .owner = THIS_MODULE, 652 .owner = THIS_MODULE,
653 .request = gpiochip_generic_request, 653 .request = gpiochip_generic_request,
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index d318ca055489..a53f1a9b1ed2 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1078,7 +1078,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,
1078 res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0); 1078 res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0);
1079 base = devm_ioremap_resource(&pdev->dev, res); 1079 base = devm_ioremap_resource(&pdev->dev, res);
1080 if (IS_ERR(base)) 1080 if (IS_ERR(base))
1081 return base; 1081 return ERR_CAST(base);
1082 nmk_chip->addr = base; 1082 nmk_chip->addr = base;
1083 1083
1084 clk = clk_get(&gpio_pdev->dev, NULL); 1084 clk = clk_get(&gpio_pdev->dev, NULL);
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index fc0c230aa11f..8eaa25c3384f 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -47,6 +47,7 @@ static const struct pin_config_item conf_items[] = {
47 PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false), 47 PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false),
48 PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), 48 PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true),
49 PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), 49 PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true),
50 PCONFDUMP(PIN_CONFIG_SLEEP_HARDWARE_STATE, "sleep hardware state", NULL, false),
50 PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), 51 PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true),
51}; 52};
52 53
@@ -178,6 +179,7 @@ static const struct pinconf_generic_params dt_params[] = {
178 { "output-high", PIN_CONFIG_OUTPUT, 1, }, 179 { "output-high", PIN_CONFIG_OUTPUT, 1, },
179 { "output-low", PIN_CONFIG_OUTPUT, 0, }, 180 { "output-low", PIN_CONFIG_OUTPUT, 0, },
180 { "power-source", PIN_CONFIG_POWER_SOURCE, 0 }, 181 { "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
182 { "sleep-hardware-state", PIN_CONFIG_SLEEP_HARDWARE_STATE, 0 },
181 { "slew-rate", PIN_CONFIG_SLEW_RATE, 0 }, 183 { "slew-rate", PIN_CONFIG_SLEW_RATE, 0 },
182}; 184};
183 185
@@ -316,16 +318,15 @@ int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
316 if (ret < 0) { 318 if (ret < 0) {
317 /* EINVAL=missing, which is fine since it's optional */ 319 /* EINVAL=missing, which is fine since it's optional */
318 if (ret != -EINVAL) 320 if (ret != -EINVAL)
319 dev_err(dev, "%s: could not parse property function\n", 321 dev_err(dev, "%pOF: could not parse property function\n",
320 of_node_full_name(np)); 322 np);
321 function = NULL; 323 function = NULL;
322 } 324 }
323 325
324 ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, 326 ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
325 &num_configs); 327 &num_configs);
326 if (ret < 0) { 328 if (ret < 0) {
327 dev_err(dev, "%s: could not parse node property\n", 329 dev_err(dev, "%pOF: could not parse node property\n", np);
328 of_node_full_name(np));
329 return ret; 330 return ret;
330 } 331 }
331 332
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 7fc417e4ae96..d3fe14394b73 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -37,7 +37,7 @@ int pinconf_check_ops(struct pinctrl_dev *pctldev)
37 return 0; 37 return 0;
38} 38}
39 39
40int pinconf_validate_map(struct pinctrl_map const *map, int i) 40int pinconf_validate_map(const struct pinctrl_map *map, int i)
41{ 41{
42 if (!map->data.configs.group_or_pin) { 42 if (!map->data.configs.group_or_pin) {
43 pr_err("failed to register map %s (%d): no group/pin given\n", 43 pr_err("failed to register map %s (%d): no group/pin given\n",
@@ -106,7 +106,7 @@ unlock:
106 return ret; 106 return ret;
107} 107}
108 108
109int pinconf_map_to_setting(struct pinctrl_map const *map, 109int pinconf_map_to_setting(const struct pinctrl_map *map,
110 struct pinctrl_setting *setting) 110 struct pinctrl_setting *setting)
111{ 111{
112 struct pinctrl_dev *pctldev = setting->pctldev; 112 struct pinctrl_dev *pctldev = setting->pctldev;
@@ -143,11 +143,11 @@ int pinconf_map_to_setting(struct pinctrl_map const *map,
143 return 0; 143 return 0;
144} 144}
145 145
146void pinconf_free_setting(struct pinctrl_setting const *setting) 146void pinconf_free_setting(const struct pinctrl_setting *setting)
147{ 147{
148} 148}
149 149
150int pinconf_apply_setting(struct pinctrl_setting const *setting) 150int pinconf_apply_setting(const struct pinctrl_setting *setting)
151{ 151{
152 struct pinctrl_dev *pctldev = setting->pctldev; 152 struct pinctrl_dev *pctldev = setting->pctldev;
153 const struct pinconf_ops *ops = pctldev->desc->confops; 153 const struct pinconf_ops *ops = pctldev->desc->confops;
@@ -205,7 +205,7 @@ int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
205 const struct pinconf_ops *ops; 205 const struct pinconf_ops *ops;
206 206
207 ops = pctldev->desc->confops; 207 ops = pctldev->desc->confops;
208 if (!ops) 208 if (!ops || !ops->pin_config_set)
209 return -ENOTSUPP; 209 return -ENOTSUPP;
210 210
211 return ops->pin_config_set(pctldev, pin, configs, nconfigs); 211 return ops->pin_config_set(pctldev, pin, configs, nconfigs);
@@ -235,7 +235,7 @@ static void pinconf_show_config(struct seq_file *s, struct pinctrl_dev *pctldev,
235 } 235 }
236} 236}
237 237
238void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map) 238void pinconf_show_map(struct seq_file *s, const struct pinctrl_map *map)
239{ 239{
240 struct pinctrl_dev *pctldev; 240 struct pinctrl_dev *pctldev;
241 241
@@ -259,7 +259,7 @@ void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map)
259} 259}
260 260
261void pinconf_show_setting(struct seq_file *s, 261void pinconf_show_setting(struct seq_file *s,
262 struct pinctrl_setting const *setting) 262 const struct pinctrl_setting *setting)
263{ 263{
264 struct pinctrl_dev *pctldev = setting->pctldev; 264 struct pinctrl_dev *pctldev = setting->pctldev;
265 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; 265 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h
index bf8aff9abf32..6c722505f893 100644
--- a/drivers/pinctrl/pinconf.h
+++ b/drivers/pinctrl/pinconf.h
@@ -14,11 +14,11 @@
14#ifdef CONFIG_PINCONF 14#ifdef CONFIG_PINCONF
15 15
16int pinconf_check_ops(struct pinctrl_dev *pctldev); 16int pinconf_check_ops(struct pinctrl_dev *pctldev);
17int pinconf_validate_map(struct pinctrl_map const *map, int i); 17int pinconf_validate_map(const struct pinctrl_map *map, int i);
18int pinconf_map_to_setting(struct pinctrl_map const *map, 18int pinconf_map_to_setting(const struct pinctrl_map *map,
19 struct pinctrl_setting *setting); 19 struct pinctrl_setting *setting);
20void pinconf_free_setting(struct pinctrl_setting const *setting); 20void pinconf_free_setting(const struct pinctrl_setting *setting);
21int pinconf_apply_setting(struct pinctrl_setting const *setting); 21int pinconf_apply_setting(const struct pinctrl_setting *setting);
22 22
23int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin, 23int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
24 unsigned long *configs, size_t nconfigs); 24 unsigned long *configs, size_t nconfigs);
@@ -39,22 +39,22 @@ static inline int pinconf_check_ops(struct pinctrl_dev *pctldev)
39 return 0; 39 return 0;
40} 40}
41 41
42static inline int pinconf_validate_map(struct pinctrl_map const *map, int i) 42static inline int pinconf_validate_map(const struct pinctrl_map *map, int i)
43{ 43{
44 return 0; 44 return 0;
45} 45}
46 46
47static inline int pinconf_map_to_setting(struct pinctrl_map const *map, 47static inline int pinconf_map_to_setting(const struct pinctrl_map *map,
48 struct pinctrl_setting *setting) 48 struct pinctrl_setting *setting)
49{ 49{
50 return 0; 50 return 0;
51} 51}
52 52
53static inline void pinconf_free_setting(struct pinctrl_setting const *setting) 53static inline void pinconf_free_setting(const struct pinctrl_setting *setting)
54{ 54{
55} 55}
56 56
57static inline int pinconf_apply_setting(struct pinctrl_setting const *setting) 57static inline int pinconf_apply_setting(const struct pinctrl_setting *setting)
58{ 58{
59 return 0; 59 return 0;
60} 60}
@@ -69,21 +69,21 @@ static inline int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
69 69
70#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS) 70#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)
71 71
72void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map); 72void pinconf_show_map(struct seq_file *s, const struct pinctrl_map *map);
73void pinconf_show_setting(struct seq_file *s, 73void pinconf_show_setting(struct seq_file *s,
74 struct pinctrl_setting const *setting); 74 const struct pinctrl_setting *setting);
75void pinconf_init_device_debugfs(struct dentry *devroot, 75void pinconf_init_device_debugfs(struct dentry *devroot,
76 struct pinctrl_dev *pctldev); 76 struct pinctrl_dev *pctldev);
77 77
78#else 78#else
79 79
80static inline void pinconf_show_map(struct seq_file *s, 80static inline void pinconf_show_map(struct seq_file *s,
81 struct pinctrl_map const *map) 81 const struct pinctrl_map *map)
82{ 82{
83} 83}
84 84
85static inline void pinconf_show_setting(struct seq_file *s, 85static inline void pinconf_show_setting(struct seq_file *s,
86 struct pinctrl_setting const *setting) 86 const struct pinctrl_setting *setting)
87{ 87{
88} 88}
89 89
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index 54569a7eac59..56aa181084ac 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -612,7 +612,7 @@ static int adi_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector,
612 return 0; 612 return 0;
613} 613}
614 614
615static struct pinctrl_ops adi_pctrl_ops = { 615static const struct pinctrl_ops adi_pctrl_ops = {
616 .get_groups_count = adi_get_groups_count, 616 .get_groups_count = adi_get_groups_count,
617 .get_group_name = adi_get_group_name, 617 .get_group_name = adi_get_group_name,
618 .get_group_pins = adi_get_group_pins, 618 .get_group_pins = adi_get_group_pins,
@@ -696,7 +696,7 @@ static int adi_pinmux_request_gpio(struct pinctrl_dev *pctldev,
696 return 0; 696 return 0;
697} 697}
698 698
699static struct pinmux_ops adi_pinmux_ops = { 699static const struct pinmux_ops adi_pinmux_ops = {
700 .set_mux = adi_pinmux_set, 700 .set_mux = adi_pinmux_set,
701 .get_functions_count = adi_pinmux_get_funcs_count, 701 .get_functions_count = adi_pinmux_get_funcs_count,
702 .get_function_name = adi_pinmux_get_func_name, 702 .get_function_name = adi_pinmux_get_func_name,
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index e6779d4352a2..38af1ec2df0c 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -760,8 +760,8 @@ static int amd_gpio_probe(struct platform_device *pdev)
760 760
761 irq_base = platform_get_irq(pdev, 0); 761 irq_base = platform_get_irq(pdev, 0);
762 if (irq_base < 0) { 762 if (irq_base < 0) {
763 dev_err(&pdev->dev, "Failed to get gpio IRQ.\n"); 763 dev_err(&pdev->dev, "Failed to get gpio IRQ: %d\n", irq_base);
764 return -EINVAL; 764 return irq_base;
765 } 765 }
766 766
767 gpio_dev->pdev = pdev; 767 gpio_dev->pdev = pdev;
diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index 357516d524bd..e33781cd0a05 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -445,7 +445,7 @@ static unsigned int artpec6_pconf_drive_field_to_mA(int field)
445 } 445 }
446} 446}
447 447
448static struct pinctrl_ops artpec6_pctrl_ops = { 448static const struct pinctrl_ops artpec6_pctrl_ops = {
449 .get_group_pins = artpec6_get_group_pins, 449 .get_group_pins = artpec6_get_group_pins,
450 .get_groups_count = artpec6_get_groups_count, 450 .get_groups_count = artpec6_get_groups_count,
451 .get_group_name = artpec6_get_group_name, 451 .get_group_name = artpec6_get_group_name,
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index dc8591543dee..b1ca838dd80a 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -494,8 +494,8 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
494 ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, 494 ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
495 &num_configs); 495 &num_configs);
496 if (ret < 0) { 496 if (ret < 0) {
497 dev_err(pctldev->dev, "%s: could not parse node property\n", 497 dev_err(pctldev->dev, "%pOF: could not parse node property\n",
498 of_node_full_name(np)); 498 np);
499 return ret; 499 return ret;
500 } 500 }
501 501
@@ -504,8 +504,7 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
504 504
505 num_pins = pins->length / sizeof(u32); 505 num_pins = pins->length / sizeof(u32);
506 if (!num_pins) { 506 if (!num_pins) {
507 dev_err(pctldev->dev, "no pins found in node %s\n", 507 dev_err(pctldev->dev, "no pins found in node %pOF\n", np);
508 of_node_full_name(np));
509 ret = -EINVAL; 508 ret = -EINVAL;
510 goto exit; 509 goto exit;
511 } 510 }
@@ -584,8 +583,8 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
584 583
585 if (ret < 0) { 584 if (ret < 0) {
586 pinctrl_utils_free_map(pctldev, *map, *num_maps); 585 pinctrl_utils_free_map(pctldev, *map, *num_maps);
587 dev_err(pctldev->dev, "can't create maps for node %s\n", 586 dev_err(pctldev->dev, "can't create maps for node %pOF\n",
588 np_config->full_name); 587 np_config);
589 } 588 }
590 589
591 return ret; 590 return ret;
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index 741b39eaeb8b..ac155e7d3412 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -387,7 +387,7 @@ int u300_gpio_config_set(struct gpio_chip *chip, unsigned offset,
387 return 0; 387 return 0;
388} 388}
389 389
390static struct gpio_chip u300_gpio_chip = { 390static const struct gpio_chip u300_gpio_chip = {
391 .label = "u300-gpio-chip", 391 .label = "u300-gpio-chip",
392 .owner = THIS_MODULE, 392 .owner = THIS_MODULE,
393 .request = gpiochip_generic_request, 393 .request = gpiochip_generic_request,
diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
index 639a57ecc7c2..ce269ced4d49 100644
--- a/drivers/pinctrl/pinctrl-digicolor.c
+++ b/drivers/pinctrl/pinctrl-digicolor.c
@@ -79,7 +79,7 @@ static int dc_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector,
79 return 0; 79 return 0;
80} 80}
81 81
82static struct pinctrl_ops dc_pinctrl_ops = { 82static const struct pinctrl_ops dc_pinctrl_ops = {
83 .get_groups_count = dc_get_groups_count, 83 .get_groups_count = dc_get_groups_count,
84 .get_group_name = dc_get_group_name, 84 .get_group_name = dc_get_group_name,
85 .get_group_pins = dc_get_group_pins, 85 .get_group_pins = dc_get_group_pins,
@@ -161,7 +161,7 @@ static int dc_pmx_request_gpio(struct pinctrl_dev *pcdev,
161 return 0; 161 return 0;
162} 162}
163 163
164static struct pinmux_ops dc_pmxops = { 164static const struct pinmux_ops dc_pmxops = {
165 .get_functions_count = dc_get_functions_count, 165 .get_functions_count = dc_get_functions_count,
166 .get_function_name = dc_get_fname, 166 .get_function_name = dc_get_fname,
167 .get_function_groups = dc_get_groups, 167 .get_function_groups = dc_get_groups,
diff --git a/drivers/pinctrl/pinctrl-gemini.c b/drivers/pinctrl/pinctrl-gemini.c
new file mode 100644
index 000000000000..39e6221e7100
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-gemini.c
@@ -0,0 +1,2359 @@
1/*
2 * Driver for the Gemini pin controller
3 *
4 * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org>
5 *
6 * This is a group-only pin controller.
7 */
8#include <linux/err.h>
9#include <linux/init.h>
10#include <linux/io.h>
11#include <linux/mfd/syscon.h>
12#include <linux/of.h>
13#include <linux/pinctrl/machine.h>
14#include <linux/pinctrl/pinctrl.h>
15#include <linux/pinctrl/pinmux.h>
16#include <linux/platform_device.h>
17#include <linux/slab.h>
18#include <linux/regmap.h>
19
20#include "pinctrl-utils.h"
21
22#define DRIVER_NAME "pinctrl-gemini"
23
24/**
25 * @dev: a pointer back to containing device
26 * @virtbase: the offset to the controller in virtual memory
27 * @map: regmap to access registers
28 * @is_3512: whether the SoC/package is the 3512 variant
29 * @is_3516: whether the SoC/package is the 3516 variant
30 * @flash_pin: whether the flash pin (extended pins for parallel
31 * flash) is set
32 */
33struct gemini_pmx {
34 struct device *dev;
35 struct pinctrl_dev *pctl;
36 struct regmap *map;
37 bool is_3512;
38 bool is_3516;
39 bool flash_pin;
40};
41
42/**
43 * struct gemini_pin_group - describes a Gemini pin group
44 * @name: the name of this specific pin group
45 * @pins: an array of discrete physical pins used in this group, taken
46 * from the driver-local pin enumeration space
47 * @num_pins: the number of pins in this group array, i.e. the number of
48 * elements in .pins so we can iterate over that array
49 * @mask: bits to clear to enable this when doing pin muxing
50 * @value: bits to set to enable this when doing pin muxing
51 */
52struct gemini_pin_group {
53 const char *name;
54 const unsigned int *pins;
55 const unsigned int num_pins;
56 u32 mask;
57 u32 value;
58};
59
60/*
61 * Global Miscellaneous Control Register
62 * This register controls all Gemini pad/pin multiplexing
63 *
64 * It is a tricky register though:
65 * - For the bits named *_ENABLE, once you DISABLE something, it simply cannot
66 * be brought back online, so it means permanent disablement of the
67 * corresponding pads.
68 * - For the bits named *_DISABLE, once you enable something, it cannot be
69 * DISABLED again. So you select a flash configuration once, and then
70 * you are stuck with it.
71 */
72#define GLOBAL_WORD_ID 0x00
73#define GLOBAL_STATUS 0x04
74#define GLOBAL_STATUS_FLPIN BIT(20)
75#define GLOBAL_MISC_CTRL 0x30
76#define TVC_CLK_PAD_ENABLE BIT(20)
77#define PCI_CLK_PAD_ENABLE BIT(17)
78#define LPC_CLK_PAD_ENABLE BIT(16)
79#define TVC_PADS_ENABLE BIT(9)
80#define SSP_PADS_ENABLE BIT(8)
81#define LCD_PADS_ENABLE BIT(7)
82#define LPC_PADS_ENABLE BIT(6)
83#define PCI_PADS_ENABLE BIT(5)
84#define IDE_PADS_ENABLE BIT(4)
85#define DRAM_PADS_POWERDOWN BIT(3)
86#define NAND_PADS_DISABLE BIT(2)
87#define PFLASH_PADS_DISABLE BIT(1)
88#define SFLASH_PADS_DISABLE BIT(0)
89#define PADS_MASK (GENMASK(9, 0) | BIT(16) | BIT(17) | BIT(20))
90#define PADS_MAXBIT 20
91
92/* Ordered by bit index */
93static const char * const gemini_padgroups[] = {
94 "serial flash",
95 "parallel flash",
96 "NAND flash",
97 "DRAM",
98 "IDE",
99 "PCI",
100 "LPC",
101 "LCD",
102 "SSP",
103 "TVC",
104 NULL, NULL, NULL, NULL, NULL, NULL,
105 "LPC CLK",
106 "PCI CLK",
107 NULL, NULL,
108 "TVC CLK",
109};
110
111static const struct pinctrl_pin_desc gemini_3512_pins[] = {
112 /* Row A */
113 PINCTRL_PIN(0, "A1 VREF CTRL"),
114 PINCTRL_PIN(1, "A2 VCC2IO CTRL"),
115 PINCTRL_PIN(2, "A3 DRAM CK"),
116 PINCTRL_PIN(3, "A4 DRAM CK N"),
117 PINCTRL_PIN(4, "A5 DRAM A5"),
118 PINCTRL_PIN(5, "A6 DRAM CKE"),
119 PINCTRL_PIN(6, "A7 DRAM DQ11"),
120 PINCTRL_PIN(7, "A8 DRAM DQ0"),
121 PINCTRL_PIN(8, "A9 DRAM DQ5"),
122 PINCTRL_PIN(9, "A10 DRAM DQ6"),
123 PINCTRL_PIN(10, "A11 DRAM DRAM VREF"),
124 PINCTRL_PIN(11, "A12 DRAM BA1"),
125 PINCTRL_PIN(12, "A13 DRAM A2"),
126 PINCTRL_PIN(13, "A14 PCI GNT1 N"),
127 PINCTRL_PIN(14, "A15 PCI REQ9 N"),
128 PINCTRL_PIN(15, "A16 PCI REQ2 N"),
129 PINCTRL_PIN(16, "A17 PCI REQ3 N"),
130 PINCTRL_PIN(17, "A18 PCI AD31"),
131 /* Row B */
132 PINCTRL_PIN(18, "B1 VCCK CTRL"),
133 PINCTRL_PIN(19, "B2 PWR EN"),
134 PINCTRL_PIN(20, "B3 RTC CLKI"),
135 PINCTRL_PIN(21, "B4 DRAM A4"),
136 PINCTRL_PIN(22, "B5 DRAM A6"),
137 PINCTRL_PIN(23, "B6 DRAM A12"),
138 PINCTRL_PIN(24, "B7 DRAM DQS1"),
139 PINCTRL_PIN(25, "B8 DRAM DQ15"),
140 PINCTRL_PIN(26, "B9 DRAM DQ4"),
141 PINCTRL_PIN(27, "B10 DRAM DQS0"),
142 PINCTRL_PIN(28, "B11 DRAM WE N"),
143 PINCTRL_PIN(29, "B12 DRAM A10"),
144 PINCTRL_PIN(30, "B13 DRAM A3"),
145 PINCTRL_PIN(31, "B14 PCI GNT0 N"),
146 PINCTRL_PIN(32, "B15 PCI GNT3 N"),
147 PINCTRL_PIN(33, "B16 PCI REQ1 N"),
148 PINCTRL_PIN(34, "B17 PCI AD30"),
149 PINCTRL_PIN(35, "B18 PCI AD29"),
150 /* Row C */
151 PINCTRL_PIN(36, "C1 CIR RST N"), /* REALLY? CIR is not in 3512... */
152 PINCTRL_PIN(37, "C2 XTALI"),
153 PINCTRL_PIN(38, "C3 PWR BTN"),
154 PINCTRL_PIN(39, "C4 RTC CLKO"),
155 PINCTRL_PIN(40, "C5 DRAM A7"),
156 PINCTRL_PIN(41, "C6 DRAM A11"),
157 PINCTRL_PIN(42, "C7 DRAM DQ10"),
158 PINCTRL_PIN(43, "C8 DRAM DQ14"),
159 PINCTRL_PIN(44, "C9 DRAM DQ3"),
160 PINCTRL_PIN(45, "C10 DRAM DQ7"),
161 PINCTRL_PIN(46, "C11 DRAM CAS N"),
162 PINCTRL_PIN(47, "C12 DRAM A0"),
163 PINCTRL_PIN(48, "C13 PCI INT0 N"),
164 PINCTRL_PIN(49, "C14 EXT RESET N"),
165 PINCTRL_PIN(50, "C15 PCI GNT2 N"),
166 PINCTRL_PIN(51, "C16 PCI AD28"),
167 PINCTRL_PIN(52, "C17 PCI AD27"),
168 PINCTRL_PIN(53, "C18 PCI AD26"),
169 /* Row D */
170 PINCTRL_PIN(54, "D1 AVCCKHA"),
171 PINCTRL_PIN(55, "D2 AGNDIOHA"),
172 PINCTRL_PIN(56, "D3 XTALO"),
173 PINCTRL_PIN(57, "D4 AVCC3IOHA"),
174 PINCTRL_PIN(58, "D5 DRAM A8"),
175 PINCTRL_PIN(59, "D6 DRAM A9"),
176 PINCTRL_PIN(60, "D7 DRAM DQ9"),
177 PINCTRL_PIN(61, "D8 DRAM DQ13"),
178 PINCTRL_PIN(62, "D9 DRAM DQ2"),
179 PINCTRL_PIN(63, "D10 DRAM A13"),
180 PINCTRL_PIN(64, "D11 DRAM RAS N"),
181 PINCTRL_PIN(65, "D12 DRAM A1"),
182 PINCTRL_PIN(66, "D13 PCI INTC N"),
183 PINCTRL_PIN(67, "D14 PCI CLK"),
184 PINCTRL_PIN(68, "D15 PCI AD25"),
185 PINCTRL_PIN(69, "D16 PCI AD24"),
186 PINCTRL_PIN(70, "D17 PCI CBE3 N"),
187 PINCTRL_PIN(71, "D18 PCI AD23"),
188 /* Row E */
189 PINCTRL_PIN(72, "E1 AVCC3IOHA"),
190 PINCTRL_PIN(73, "E2 EBG"),
191 PINCTRL_PIN(74, "E3 AVCC3IOHB"),
192 PINCTRL_PIN(75, "E4 REXT"),
193 PINCTRL_PIN(76, "E5 GND"),
194 PINCTRL_PIN(77, "E6 DRAM DQM1"),
195 PINCTRL_PIN(78, "E7 DRAM DQ8"),
196 PINCTRL_PIN(79, "E8 DRAM DQ12"),
197 PINCTRL_PIN(80, "E9 DRAM DQ1"),
198 PINCTRL_PIN(81, "E10 DRAM DQM0"),
199 PINCTRL_PIN(82, "E11 DRAM BA0"),
200 PINCTRL_PIN(83, "E12 PCI INTA N"),
201 PINCTRL_PIN(84, "E13 PCI INTB N"),
202 PINCTRL_PIN(85, "E14 GND"),
203 PINCTRL_PIN(86, "E15 PCI AD22"),
204 PINCTRL_PIN(87, "E16 PCI AD21"),
205 PINCTRL_PIN(88, "E17 PCI AD20"),
206 PINCTRL_PIN(89, "E18 PCI AD19"),
207 /* Row F */
208 PINCTRL_PIN(90, "F1 SATA0 RXDP"),
209 PINCTRL_PIN(91, "F2 SATA0 RXDN"),
210 PINCTRL_PIN(92, "F3 AGNDK 0"),
211 PINCTRL_PIN(93, "F4 AVCC3 S"),
212 PINCTRL_PIN(94, "F5 AVCCK P"),
213 PINCTRL_PIN(95, "F6 GND"),
214 PINCTRL_PIN(96, "F7 VCC2IOHA 2"),
215 PINCTRL_PIN(97, "F8 VCC2IOHA 2"),
216 PINCTRL_PIN(98, "F9 V1"),
217 PINCTRL_PIN(99, "F10 V1"),
218 PINCTRL_PIN(100, "F11 VCC2IOHA 2"),
219 PINCTRL_PIN(101, "F12 VCC2IOHA 2"),
220 PINCTRL_PIN(102, "F13 GND"),
221 PINCTRL_PIN(103, "F14 PCI AD18"),
222 PINCTRL_PIN(104, "F15 PCI AD17"),
223 PINCTRL_PIN(105, "F16 PCI AD16"),
224 PINCTRL_PIN(106, "F17 PCI CBE2 N"),
225 PINCTRL_PIN(107, "F18 PCI FRAME N"),
226 /* Row G */
227 PINCTRL_PIN(108, "G1 SATA0 TXDP"),
228 PINCTRL_PIN(109, "G2 SATA0 TXDN"),
229 PINCTRL_PIN(110, "G3 AGNDK 1"),
230 PINCTRL_PIN(111, "G4 AVCCK 0"),
231 PINCTRL_PIN(112, "G5 TEST CLKOUT"),
232 PINCTRL_PIN(113, "G6 AGND"),
233 PINCTRL_PIN(114, "G7 GND"),
234 PINCTRL_PIN(115, "G8 VCC2IOHA 2"),
235 PINCTRL_PIN(116, "G9 V1"),
236 PINCTRL_PIN(117, "G10 V1"),
237 PINCTRL_PIN(118, "G11 VCC2IOHA 2"),
238 PINCTRL_PIN(119, "G12 GND"),
239 PINCTRL_PIN(120, "G13 VCC3IOHA"),
240 PINCTRL_PIN(121, "G14 PCI IRDY N"),
241 PINCTRL_PIN(122, "G15 PCI TRDY N"),
242 PINCTRL_PIN(123, "G16 PCI DEVSEL N"),
243 PINCTRL_PIN(124, "G17 PCI STOP N"),
244 PINCTRL_PIN(125, "G18 PCI PAR"),
245 /* Row H */
246 PINCTRL_PIN(126, "H1 SATA1 TXDP"),
247 PINCTRL_PIN(127, "H2 SATA1 TXDN"),
248 PINCTRL_PIN(128, "H3 AGNDK 2"),
249 PINCTRL_PIN(129, "H4 AVCCK 1"),
250 PINCTRL_PIN(130, "H5 AVCCK S"),
251 PINCTRL_PIN(131, "H6 AVCCKHB"),
252 PINCTRL_PIN(132, "H7 AGND"),
253 PINCTRL_PIN(133, "H8 GND"),
254 PINCTRL_PIN(134, "H9 GND"),
255 PINCTRL_PIN(135, "H10 GND"),
256 PINCTRL_PIN(136, "H11 GND"),
257 PINCTRL_PIN(137, "H12 VCC3IOHA"),
258 PINCTRL_PIN(138, "H13 VCC3IOHA"),
259 PINCTRL_PIN(139, "H14 PCI CBE1 N"),
260 PINCTRL_PIN(140, "H15 PCI AD15"),
261 PINCTRL_PIN(141, "H16 PCI AD14"),
262 PINCTRL_PIN(142, "H17 PCI AD13"),
263 PINCTRL_PIN(143, "H18 PCI AD12"),
264 /* Row J (for some reason I is skipped) */
265 PINCTRL_PIN(144, "J1 SATA1 RXDP"),
266 PINCTRL_PIN(145, "J2 SATA1 RXDN"),
267 PINCTRL_PIN(146, "J3 AGNDK 3"),
268 PINCTRL_PIN(147, "J4 AVCCK 2"),
269 PINCTRL_PIN(148, "J5 IDE DA1"),
270 PINCTRL_PIN(149, "J6 V1"),
271 PINCTRL_PIN(150, "J7 V1"),
272 PINCTRL_PIN(151, "J8 GND"),
273 PINCTRL_PIN(152, "J9 GND"),
274 PINCTRL_PIN(153, "J10 GND"),
275 PINCTRL_PIN(154, "J11 GND"),
276 PINCTRL_PIN(155, "J12 V1"),
277 PINCTRL_PIN(156, "J13 V1"),
278 PINCTRL_PIN(157, "J14 PCI AD11"),
279 PINCTRL_PIN(158, "J15 PCI AD10"),
280 PINCTRL_PIN(159, "J16 PCI AD9"),
281 PINCTRL_PIN(160, "J17 PCI AD8"),
282 PINCTRL_PIN(161, "J18 PCI CBE0 N"),
283 /* Row K */
284 PINCTRL_PIN(162, "K1 IDE CS1 N"),
285 PINCTRL_PIN(163, "K2 IDE CS0 N"),
286 PINCTRL_PIN(164, "K3 AVCCK 3"),
287 PINCTRL_PIN(165, "K4 IDE DA2"),
288 PINCTRL_PIN(166, "K5 IDE DA0"),
289 PINCTRL_PIN(167, "K6 V1"),
290 PINCTRL_PIN(168, "K7 V1"),
291 PINCTRL_PIN(169, "K8 GND"),
292 PINCTRL_PIN(170, "K9 GND"),
293 PINCTRL_PIN(171, "K10 GND"),
294 PINCTRL_PIN(172, "K11 GND"),
295 PINCTRL_PIN(173, "K12 V1"),
296 PINCTRL_PIN(174, "K13 V1"),
297 PINCTRL_PIN(175, "K14 PCI AD3"),
298 PINCTRL_PIN(176, "K15 PCI AD4"),
299 PINCTRL_PIN(177, "K16 PCI AD5"),
300 PINCTRL_PIN(178, "K17 PCI AD6"),
301 PINCTRL_PIN(179, "K18 PCI AD7"),
302 /* Row L */
303 PINCTRL_PIN(180, "L1 IDE INTRQ"),
304 PINCTRL_PIN(181, "L2 IDE DMACK N"),
305 PINCTRL_PIN(182, "L3 IDE IORDY"),
306 PINCTRL_PIN(183, "L4 IDE DIOR N"),
307 PINCTRL_PIN(184, "L5 IDE DIOW N"),
308 PINCTRL_PIN(185, "L6 VCC3IOHA"),
309 PINCTRL_PIN(186, "L7 VCC3IOHA"),
310 PINCTRL_PIN(187, "L8 GND"),
311 PINCTRL_PIN(188, "L9 GND"),
312 PINCTRL_PIN(189, "L10 GND"),
313 PINCTRL_PIN(190, "L11 GND"),
314 PINCTRL_PIN(191, "L12 VCC3IOHA"),
315 PINCTRL_PIN(192, "L13 VCC3IOHA"),
316 PINCTRL_PIN(193, "L14 GPIO0 30"),
317 PINCTRL_PIN(194, "L15 GPIO0 31"),
318 PINCTRL_PIN(195, "L16 PCI AD0"),
319 PINCTRL_PIN(196, "L17 PCI AD1"),
320 PINCTRL_PIN(197, "L18 PCI AD2"),
321 /* Row M */
322 PINCTRL_PIN(198, "M1 IDE DMARQ"),
323 PINCTRL_PIN(199, "M2 IDE DD15"),
324 PINCTRL_PIN(200, "M3 IDE DD0"),
325 PINCTRL_PIN(201, "M4 IDE DD14"),
326 PINCTRL_PIN(202, "M5 IDE DD1"),
327 PINCTRL_PIN(203, "M6 VCC3IOHA"),
328 PINCTRL_PIN(204, "M7 GND"),
329 PINCTRL_PIN(205, "M8 VCC2IOHA 1"),
330 PINCTRL_PIN(206, "M9 V1"),
331 PINCTRL_PIN(207, "M10 V1"),
332 PINCTRL_PIN(208, "M11 VCC3IOHA"),
333 PINCTRL_PIN(209, "M12 GND"),
334 PINCTRL_PIN(210, "M13 VCC3IOHA"),
335 PINCTRL_PIN(211, "M14 GPIO0 25"),
336 PINCTRL_PIN(212, "M15 GPIO0 26"),
337 PINCTRL_PIN(213, "M16 GPIO0 27"),
338 PINCTRL_PIN(214, "M17 GPIO0 28"),
339 PINCTRL_PIN(215, "M18 GPIO0 29"),
340 /* Row N */
341 PINCTRL_PIN(216, "N1 IDE DD13"),
342 PINCTRL_PIN(217, "N2 IDE DD2"),
343 PINCTRL_PIN(218, "N3 IDE DD12"),
344 PINCTRL_PIN(219, "N4 IDE DD3"),
345 PINCTRL_PIN(220, "N5 IDE DD11"),
346 PINCTRL_PIN(221, "N6 GND"),
347 PINCTRL_PIN(222, "N7 VCC2IOHA 1"),
348 PINCTRL_PIN(223, "N8 VCC2IOHA 1"),
349 PINCTRL_PIN(224, "N9 V1"),
350 PINCTRL_PIN(225, "N10 V1"),
351 PINCTRL_PIN(226, "N11 VCC3IOHA"),
352 PINCTRL_PIN(227, "N12 VCC3IOHA"),
353 PINCTRL_PIN(228, "N13 GND"),
354 PINCTRL_PIN(229, "N14 GPIO0 20"),
355 PINCTRL_PIN(230, "N15 GPIO0 21"),
356 PINCTRL_PIN(231, "N16 GPIO0 22"),
357 PINCTRL_PIN(232, "N17 GPIO0 23"),
358 PINCTRL_PIN(233, "N18 GPIO0 24"),
359 /* Row P (for some reason O is skipped) */
360 PINCTRL_PIN(234, "P1 IDE DD4"),
361 PINCTRL_PIN(235, "P2 IDE DD10"),
362 PINCTRL_PIN(236, "P3 IDE DD5"),
363 PINCTRL_PIN(237, "P4 IDE DD9"),
364 PINCTRL_PIN(238, "P5 GND"),
365 PINCTRL_PIN(239, "P6 USB XSCO"),
366 PINCTRL_PIN(240, "P7 GMAC0 TXD3"),
367 PINCTRL_PIN(241, "P8 GMAC0 TXEN"),
368 PINCTRL_PIN(242, "P9 GMAC0 RXD2"),
369 PINCTRL_PIN(243, "P10 GMAC1 TXC"),
370 PINCTRL_PIN(244, "P11 GMAC1 RXD1"),
371 PINCTRL_PIN(245, "P12 MODE SEL 1"),
372 PINCTRL_PIN(246, "P13 GPIO1 28"),
373 PINCTRL_PIN(247, "P14 GND"),
374 PINCTRL_PIN(248, "P15 GPIO0 5"),
375 PINCTRL_PIN(249, "P16 GPIO0 17"),
376 PINCTRL_PIN(250, "P17 GPIO0 18"),
377 PINCTRL_PIN(251, "P18 GPIO0 19"),
378 /* Row R (for some reason Q us skipped) */
379 PINCTRL_PIN(252, "R1 IDE DD6"),
380 PINCTRL_PIN(253, "R2 IDE DD8"),
381 PINCTRL_PIN(254, "R3 IDE DD7"),
382 PINCTRL_PIN(255, "R4 IDE RESET N"),
383 PINCTRL_PIN(256, "R5 ICE0 DBGACK"),
384 PINCTRL_PIN(257, "R6 USB XSCI"),
385 PINCTRL_PIN(258, "R7 GMAC0 TXD2"),
386 PINCTRL_PIN(259, "R8 GMAC0 RXDV"),
387 PINCTRL_PIN(260, "R9 GMAC0 RXD3"),
388 PINCTRL_PIN(261, "R10 GMAC1 TXD0"),
389 PINCTRL_PIN(262, "R11 GMAC1 RXD0"),
390 PINCTRL_PIN(263, "R12 MODE SEL 0"),
391 PINCTRL_PIN(264, "R13 MODE SEL 3"),
392 PINCTRL_PIN(265, "R14 GPIO0 0"),
393 PINCTRL_PIN(266, "R15 GPIO0 4"),
394 PINCTRL_PIN(267, "R16 GPIO0 9"),
395 PINCTRL_PIN(268, "R17 GPIO0 15"),
396 PINCTRL_PIN(269, "R18 GPIO0 16"),
397 /* Row T (for some reason S is skipped) */
398 PINCTRL_PIN(270, "T1 ICE0 DBGRQ"),
399 PINCTRL_PIN(271, "T2 ICE0 IDO"),
400 PINCTRL_PIN(272, "T3 ICE0 ICK"),
401 PINCTRL_PIN(273, "T4 ICE0 IMS"),
402 PINCTRL_PIN(274, "T5 ICE0 IDI"),
403 PINCTRL_PIN(275, "T6 USB RREF"),
404 PINCTRL_PIN(276, "T7 GMAC0 TXD1"),
405 PINCTRL_PIN(277, "T8 GMAC0 RXC"),
406 PINCTRL_PIN(278, "T9 GMAC0 CRS"),
407 PINCTRL_PIN(279, "T10 GMAC1 TXD1"),
408 PINCTRL_PIN(280, "T11 GMAC1 RXC"),
409 PINCTRL_PIN(281, "T12 GMAC1 CRS"),
410 PINCTRL_PIN(282, "T13 EXT CLK"),
411 PINCTRL_PIN(283, "T14 GPIO1 31"),
412 PINCTRL_PIN(284, "T15 GPIO0 3"),
413 PINCTRL_PIN(285, "T16 GPIO0 8"),
414 PINCTRL_PIN(286, "T17 GPIO0 12"),
415 PINCTRL_PIN(287, "T18 GPIO0 14"),
416 /* Row U */
417 PINCTRL_PIN(288, "U1 ICE0 IRST N"),
418 PINCTRL_PIN(289, "U2 USB0 VCCHSRT"),
419 PINCTRL_PIN(290, "U3 USB0 DP"),
420 PINCTRL_PIN(291, "U4 USB VCCA U20"),
421 PINCTRL_PIN(292, "U5 USB1 DP"),
422 PINCTRL_PIN(293, "U6 USB1 GNDHSRT 1"),
423 PINCTRL_PIN(294, "U7 GMAC0 TXD0"),
424 PINCTRL_PIN(295, "U8 GMAC0 RXD0"),
425 PINCTRL_PIN(296, "U9 GMAC1 COL"),
426 PINCTRL_PIN(297, "U10 GMAC1 TXD2"),
427 PINCTRL_PIN(298, "U11 GMAC1 RXDV"),
428 PINCTRL_PIN(299, "U12 GMAC1 RXD3"),
429 PINCTRL_PIN(300, "U13 MODE SEL 2"),
430 PINCTRL_PIN(301, "U14 GPIO1 30"),
431 PINCTRL_PIN(302, "U15 GPIO0 2"),
432 PINCTRL_PIN(303, "U16 GPIO0 7"),
433 PINCTRL_PIN(304, "U17 GPIO0 11"),
434 PINCTRL_PIN(305, "U18 GPIO0 13"),
435 /* Row V */
436 PINCTRL_PIN(306, "V1 USB0 GNDHSRT"),
437 PINCTRL_PIN(307, "V2 USB0 DM"),
438 PINCTRL_PIN(308, "V3 USB GNDA U20"),
439 PINCTRL_PIN(309, "V4 USB1 DM"),
440 PINCTRL_PIN(310, "V5 USB1 VCCHSRT1"),
441 PINCTRL_PIN(311, "V6 GMAC0 COL"),
442 PINCTRL_PIN(312, "V7 GMAC0 TXC"),
443 PINCTRL_PIN(313, "V8 GMAC0 RXD1"),
444 PINCTRL_PIN(314, "V9 REF CLK"),
445 PINCTRL_PIN(315, "V10 GMAC1 TXD3"),
446 PINCTRL_PIN(316, "V11 GMAC1 TXEN"),
447 PINCTRL_PIN(317, "V12 GMAC1 RXD2"),
448 PINCTRL_PIN(318, "V13 M30 CLK"),
449 PINCTRL_PIN(319, "V14 GPIO1 29"),
450 PINCTRL_PIN(320, "V15 GPIO0 1"),
451 PINCTRL_PIN(321, "V16 GPIO0 6"),
452 PINCTRL_PIN(322, "V17 GPIO0 10"),
453 PINCTRL_PIN(323, "V18 SYS RESET N"),
454};
455
456
457/* Digital ground */
458static const unsigned int gnd_3512_pins[] = {
459 76, 85, 95, 102, 114, 119, 133, 134, 135, 136, 151, 152, 153, 154, 169,
460 170, 171, 172, 187, 188, 189, 190, 204, 209, 221, 228, 238, 247
461};
462
463static const unsigned int dram_3512_pins[] = {
464 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 22, 23, 24, 25, 26, 27, 28, 29,
465 30, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 64, 65, 77,
466 78, 79, 80, 81, 82
467};
468
469static const unsigned int rtc_3512_pins[] = { 57, 20, 39 };
470
471static const unsigned int power_3512_pins[] = { 19, 38, 36, 55, 37, 56, 54, 72 };
472
473static const unsigned int system_3512_pins[] = {
474 318, 264, 300, 245, 263, 282, 314, 323, 49,
475};
476
477static const unsigned int vcontrol_3512_pins[] = { 18, 0, 1 };
478
479static const unsigned int ice_3512_pins[] = { 256, 270, 271, 272, 273, 274, 288 };
480
481static const unsigned int ide_3512_pins[] = {
482 162, 163, 165, 166, 148, 180, 181, 182, 183, 184, 198, 199, 200, 201, 202,
483 216, 217, 218, 219, 220, 234, 235, 236, 237, 252, 253, 254, 255
484};
485
486static const unsigned int sata_3512_pins[] = {
487 75, 74, 73, 93, 94, 131, 112, 130, 92, 91, 90, 111, 110, 109, 108, 129,
488 128, 127, 126, 147, 146, 145, 144, 164
489};
490
491static const unsigned int usb_3512_pins[] = {
492 306, 289, 307, 290, 239, 257, 275, 308, 291, 309, 292, 310, 293
493};
494
495/* GMII, ethernet pins */
496static const unsigned int gmii_3512_pins[] = {
497 311, 240, 258, 276, 294, 312, 241, 259, 277, 295, 313, 242, 260, 278, 296,
498 315, 297, 279, 261, 243, 316, 298, 280, 262, 244, 317, 299, 281
499};
500
501static const unsigned int pci_3512_pins[] = {
502 13, 14, 15, 16, 17, 31, 32, 33, 34, 35, 48, 50, 51, 52, 53, 66, 67, 68, 69,
503 70, 71, 83, 84, 86, 87, 88, 89, 103, 104, 105, 106, 107, 121, 122, 123,
504 124, 125, 139, 140, 141, 142, 143, 157, 158, 159, 160, 161, 175, 176, 177,
505 178, 179, 195, 196, 197
506};
507
508/*
509 * Apparently the LPC interface is using the PCICLK for the clocking so
510 * PCI needs to be active at the same time.
511 */
512static const unsigned int lpc_3512_pins[] = {
513 285, /* LPC_LAD[0] */
514 304, /* LPC_SERIRQ */
515 286, /* LPC_LAD[2] */
516 305, /* LPC_LFRAME# */
517 287, /* LPC_LAD[3] */
518 268, /* LPC_LAD[1] */
519};
520
521/* Character LCD */
522static const unsigned int lcd_3512_pins[] = {
523 262, 244, 317, 299, 246, 319, 301, 283, 269, 233, 211
524};
525
526static const unsigned int ssp_3512_pins[] = {
527 285, /* SSP_97RST# SSP AC97 Reset, active low */
528 304, /* SSP_FSC */
529 286, /* SSP_ECLK */
530 305, /* SSP_TXD */
531 287, /* SSP_RXD */
532 268, /* SSP_SCLK */
533};
534
535static const unsigned int uart_rxtx_3512_pins[] = {
536 267, /* UART_SIN serial input, RX */
537 322, /* UART_SOUT serial output, TX */
538};
539
540static const unsigned int uart_modem_3512_pins[] = {
541 285, /* UART_NDCD DCD carrier detect */
542 304, /* UART_NDTR DTR data terminal ready */
543 286, /* UART_NDSR DSR data set ready */
544 305, /* UART_NRTS RTS request to send */
545 287, /* UART_NCTS CTS clear to send */
546 268, /* UART_NRI RI ring indicator */
547};
548
549static const unsigned int tvc_3512_pins[] = {
550 246, /* TVC_DATA[0] */
551 319, /* TVC_DATA[1] */
552 301, /* TVC_DATA[2] */
553 283, /* TVC_DATA[3] */
554 265, /* TVC_CLK */
555 320, /* TVC_DATA[4] */
556 302, /* TVC_DATA[5] */
557 284, /* TVC_DATA[6] */
558 266, /* TVC_DATA[7] */
559};
560
561/* NAND flash pins */
562static const unsigned int nflash_3512_pins[] = {
563 199, 200, 201, 202, 216, 217, 218, 219, 220, 234, 235, 236, 237, 252,
564 253, 254, 249, 250, 232, 233, 211, 193, 194
565};
566
567/* Parallel (NOR) flash pins, D[0-15], A[16-25], CE0, CE1, RB, WE, OE, ALE */
568static const unsigned int pflash_3512_pins[] = {
569 162, 163, 165, 166, 148, 199, 200, 201, 202, 216, 217, 218, 219, 220,
570 234, 235, 236, 237, 252, 253, 254, 251, 229, 232, 233, 211, 212, 213,
571 214, 215, 193, 194
572};
573
574/*
575 * The parallel flash can be set up in a 26-bit address bus mode exposing
576 * A[0-15] (A[15] takes the place of ALE), but it has the
577 * side effect of stealing pins from GMAC1 and TVC so these blocks cannot be
578 * used at the same time.
579 */
580static const unsigned int pflash_3512_pins_extended[] = {
581 162, 163, 165, 166, 148, 199, 200, 201, 202, 216, 217, 218, 219, 220,
582 234, 235, 236, 237, 252, 253, 254, 251, 229, 232, 233, 211, 212, 213,
583 214, 215, 193, 194,
584 /* The extra pins */
585 296, 315, 297, 279, 261, 243, 316, 298, 280, 262, 244, 317, 299, 281,
586 265,
587};
588
589/* Serial flash pins CE0, CE1, DI, DO, CK */
590static const unsigned int sflash_3512_pins[] = { 230, 231, 232, 233, 211 };
591
592/* The GPIO0A (0) pin overlap with TVC and extended parallel flash */
593static const unsigned int gpio0a_3512_pins[] = { 265 };
594
595/* The GPIO0B (1-4) pins overlap with TVC and ICE */
596static const unsigned int gpio0b_3512_pins[] = { 320, 302, 284, 266 };
597
598/* The GPIO0C (5-7) pins overlap with ICE */
599static const unsigned int gpio0c_3512_pins[] = { 248, 321, 303 };
600
601/* The GPIO0D (9,10) pins overlap with UART RX/TX */
602static const unsigned int gpio0d_3512_pins[] = { 267, 322 };
603
604/* The GPIO0E (8,11-15) pins overlap with LPC, UART modem pins, SSP */
605static const unsigned int gpio0e_3512_pins[] = { 285, 304, 286, 305, 287, 268 };
606
607/* The GPIO0F (16) pins overlap with LCD */
608static const unsigned int gpio0f_3512_pins[] = { 269 };
609
610/* The GPIO0G (17,18) pins overlap with NAND flash CE0, CE1 */
611static const unsigned int gpio0g_3512_pins[] = { 249, 250 };
612
613/* The GPIO0H (19,20) pins overlap with parallel flash CE0, CE1 */
614static const unsigned int gpio0h_3512_pins[] = { 251, 229 };
615
616/* The GPIO0I (21,22) pins overlap with serial flash CE0, CE1 */
617static const unsigned int gpio0i_3512_pins[] = { 230, 231 };
618
619/* The GPIO0J (23) pins overlap with all flash */
620static const unsigned int gpio0j_3512_pins[] = { 232 };
621
622/* The GPIO0K (24,25) pins overlap with all flash and LCD */
623static const unsigned int gpio0k_3512_pins[] = { 233, 211 };
624
625/* The GPIO0L (26-29) pins overlap with parallel flash */
626static const unsigned int gpio0l_3512_pins[] = { 212, 213, 214, 215 };
627
628/* The GPIO0M (30,31) pins overlap with parallel flash and NAND flash */
629static const unsigned int gpio0m_3512_pins[] = { 193, 194 };
630
631/* The GPIO1A (0-4) pins that overlap with IDE and parallel flash */
632static const unsigned int gpio1a_3512_pins[] = { 162, 163, 165, 166, 148 };
633
634/* The GPIO1B (5-10, 27) pins overlap with just IDE */
635static const unsigned int gpio1b_3512_pins[] = {
636 180, 181, 182, 183, 184, 198, 255
637};
638
639/* The GPIO1C (11-26) pins overlap with IDE, parallel flash and NAND flash */
640static const unsigned int gpio1c_3512_pins[] = {
641 199, 200, 201, 202, 216, 217, 218, 219, 220, 234, 235, 236, 237,
642 252, 253, 254
643};
644
645/* The GPIO1D (28-31) pins overlap with LCD and TVC */
646static const unsigned int gpio1d_3512_pins[] = { 246, 319, 301, 283 };
647
648/* The GPIO2A (0-3) pins overlap with GMII and extended parallel flash */
649static const unsigned int gpio2a_3512_pins[] = { 315, 297, 279, 261 };
650
651/* The GPIO2B (4-7) pins overlap with GMII, extended parallel flash and LCD */
652static const unsigned int gpio2b_3512_pins[] = { 262, 244, 317, 299 };
653
654/* The GPIO2C (8-31) pins overlap with PCI */
655static const unsigned int gpio2c_3512_pins[] = {
656 17, 34, 35, 51, 52, 53, 68, 69, 71, 86, 87, 88, 89, 103, 104, 105,
657 140, 141, 142, 143, 157, 158, 159, 160
658};
659
660/* Groups for the 3512 SoC/package */
661static const struct gemini_pin_group gemini_3512_pin_groups[] = {
662 {
663 .name = "gndgrp",
664 .pins = gnd_3512_pins,
665 .num_pins = ARRAY_SIZE(gnd_3512_pins),
666 },
667 {
668 .name = "dramgrp",
669 .pins = dram_3512_pins,
670 .num_pins = ARRAY_SIZE(dram_3512_pins),
671 .mask = DRAM_PADS_POWERDOWN,
672 },
673 {
674 .name = "rtcgrp",
675 .pins = rtc_3512_pins,
676 .num_pins = ARRAY_SIZE(rtc_3512_pins),
677 },
678 {
679 .name = "powergrp",
680 .pins = power_3512_pins,
681 .num_pins = ARRAY_SIZE(power_3512_pins),
682 },
683 {
684 .name = "systemgrp",
685 .pins = system_3512_pins,
686 .num_pins = ARRAY_SIZE(system_3512_pins),
687 },
688 {
689 .name = "vcontrolgrp",
690 .pins = vcontrol_3512_pins,
691 .num_pins = ARRAY_SIZE(vcontrol_3512_pins),
692 },
693 {
694 .name = "icegrp",
695 .pins = ice_3512_pins,
696 .num_pins = ARRAY_SIZE(ice_3512_pins),
697 /* Conflict with some GPIO groups */
698 },
699 {
700 .name = "idegrp",
701 .pins = ide_3512_pins,
702 .num_pins = ARRAY_SIZE(ide_3512_pins),
703 /* Conflict with all flash usage */
704 .value = IDE_PADS_ENABLE | NAND_PADS_DISABLE |
705 PFLASH_PADS_DISABLE | SFLASH_PADS_DISABLE,
706 },
707 {
708 .name = "satagrp",
709 .pins = sata_3512_pins,
710 .num_pins = ARRAY_SIZE(sata_3512_pins),
711 },
712 {
713 .name = "usbgrp",
714 .pins = usb_3512_pins,
715 .num_pins = ARRAY_SIZE(usb_3512_pins),
716 },
717 {
718 .name = "gmiigrp",
719 .pins = gmii_3512_pins,
720 .num_pins = ARRAY_SIZE(gmii_3512_pins),
721 },
722 {
723 .name = "pcigrp",
724 .pins = pci_3512_pins,
725 .num_pins = ARRAY_SIZE(pci_3512_pins),
726 /* Conflict only with GPIO2 */
727 .value = PCI_PADS_ENABLE | PCI_CLK_PAD_ENABLE,
728 },
729 {
730 .name = "lpcgrp",
731 .pins = lpc_3512_pins,
732 .num_pins = ARRAY_SIZE(lpc_3512_pins),
733 /* Conflict with SSP and UART modem pins */
734 .mask = SSP_PADS_ENABLE,
735 .value = LPC_PADS_ENABLE | LPC_CLK_PAD_ENABLE,
736 },
737 {
738 .name = "lcdgrp",
739 .pins = lcd_3512_pins,
740 .num_pins = ARRAY_SIZE(lcd_3512_pins),
741 /* Conflict with TVC and ICE */
742 .mask = TVC_PADS_ENABLE,
743 .value = LCD_PADS_ENABLE,
744 },
745 {
746 .name = "sspgrp",
747 .pins = ssp_3512_pins,
748 .num_pins = ARRAY_SIZE(ssp_3512_pins),
749 /* Conflict with LPC and UART modem pins */
750 .mask = LPC_PADS_ENABLE,
751 .value = SSP_PADS_ENABLE,
752 },
753 {
754 .name = "uartrxtxgrp",
755 .pins = uart_rxtx_3512_pins,
756 .num_pins = ARRAY_SIZE(uart_rxtx_3512_pins),
757 /* No conflicts except GPIO */
758 },
759 {
760 .name = "uartmodemgrp",
761 .pins = uart_modem_3512_pins,
762 .num_pins = ARRAY_SIZE(uart_modem_3512_pins),
763 /*
764 * Conflict with LPC and SSP,
765 * so when those are both disabled, modem UART can thrive.
766 */
767 .mask = LPC_PADS_ENABLE | SSP_PADS_ENABLE,
768 },
769 {
770 .name = "tvcgrp",
771 .pins = tvc_3512_pins,
772 .num_pins = ARRAY_SIZE(tvc_3512_pins),
773 /* Conflict with character LCD and ICE */
774 .mask = LCD_PADS_ENABLE,
775 .value = TVC_PADS_ENABLE | TVC_CLK_PAD_ENABLE,
776 },
777 /*
778 * The construction is done such that it is possible to use a serial
779 * flash together with a NAND or parallel (NOR) flash, but it is not
780 * possible to use NAND and parallel flash together. To use serial
781 * flash with one of the two others, the muxbits need to be flipped
782 * around before any access.
783 */
784 {
785 .name = "nflashgrp",
786 .pins = nflash_3512_pins,
787 .num_pins = ARRAY_SIZE(nflash_3512_pins),
788 /* Conflict with IDE, parallel and serial flash */
789 .mask = NAND_PADS_DISABLE | IDE_PADS_ENABLE,
790 .value = PFLASH_PADS_DISABLE | SFLASH_PADS_DISABLE,
791 },
792 {
793 .name = "pflashgrp",
794 .pins = pflash_3512_pins,
795 .num_pins = ARRAY_SIZE(pflash_3512_pins),
796 /* Conflict with IDE, NAND and serial flash */
797 .mask = PFLASH_PADS_DISABLE | IDE_PADS_ENABLE,
798 .value = NAND_PADS_DISABLE | SFLASH_PADS_DISABLE,
799 },
800 {
801 .name = "sflashgrp",
802 .pins = sflash_3512_pins,
803 .num_pins = ARRAY_SIZE(sflash_3512_pins),
804 /* Conflict with IDE, NAND and parallel flash */
805 .mask = SFLASH_PADS_DISABLE | IDE_PADS_ENABLE,
806 .value = NAND_PADS_DISABLE | PFLASH_PADS_DISABLE,
807 },
808 {
809 .name = "gpio0agrp",
810 .pins = gpio0a_3512_pins,
811 .num_pins = ARRAY_SIZE(gpio0a_3512_pins),
812 /* Conflict with TVC */
813 .mask = TVC_PADS_ENABLE,
814 },
815 {
816 .name = "gpio0bgrp",
817 .pins = gpio0b_3512_pins,
818 .num_pins = ARRAY_SIZE(gpio0b_3512_pins),
819 /* Conflict with TVC and ICE */
820 .mask = TVC_PADS_ENABLE,
821 },
822 {
823 .name = "gpio0cgrp",
824 .pins = gpio0c_3512_pins,
825 .num_pins = ARRAY_SIZE(gpio0c_3512_pins),
826 /* Conflict with ICE */
827 },
828 {
829 .name = "gpio0dgrp",
830 .pins = gpio0d_3512_pins,
831 .num_pins = ARRAY_SIZE(gpio0d_3512_pins),
832 /* Conflict with UART RX/TX */
833 },
834 {
835 .name = "gpio0egrp",
836 .pins = gpio0e_3512_pins,
837 .num_pins = ARRAY_SIZE(gpio0e_3512_pins),
838 /* Conflict with LPC, UART modem pins, SSP */
839 .mask = LPC_PADS_ENABLE | SSP_PADS_ENABLE,
840 },
841 {
842 .name = "gpio0fgrp",
843 .pins = gpio0f_3512_pins,
844 .num_pins = ARRAY_SIZE(gpio0f_3512_pins),
845 /* Conflict with LCD */
846 .mask = LCD_PADS_ENABLE,
847 },
848 {
849 .name = "gpio0ggrp",
850 .pins = gpio0g_3512_pins,
851 .num_pins = ARRAY_SIZE(gpio0g_3512_pins),
852 /* Conflict with NAND flash */
853 .value = NAND_PADS_DISABLE,
854 },
855 {
856 .name = "gpio0hgrp",
857 .pins = gpio0h_3512_pins,
858 .num_pins = ARRAY_SIZE(gpio0h_3512_pins),
859 /* Conflict with parallel flash */
860 .value = PFLASH_PADS_DISABLE,
861 },
862 {
863 .name = "gpio0igrp",
864 .pins = gpio0i_3512_pins,
865 .num_pins = ARRAY_SIZE(gpio0i_3512_pins),
866 /* Conflict with serial flash */
867 .value = SFLASH_PADS_DISABLE,
868 },
869 {
870 .name = "gpio0jgrp",
871 .pins = gpio0j_3512_pins,
872 .num_pins = ARRAY_SIZE(gpio0j_3512_pins),
873 /* Conflict with all flash */
874 .value = PFLASH_PADS_DISABLE | NAND_PADS_DISABLE |
875 SFLASH_PADS_DISABLE,
876 },
877 {
878 .name = "gpio0kgrp",
879 .pins = gpio0k_3512_pins,
880 .num_pins = ARRAY_SIZE(gpio0k_3512_pins),
881 /* Conflict with all flash and LCD */
882 .mask = LCD_PADS_ENABLE,
883 .value = PFLASH_PADS_DISABLE | NAND_PADS_DISABLE |
884 SFLASH_PADS_DISABLE,
885 },
886 {
887 .name = "gpio0lgrp",
888 .pins = gpio0l_3512_pins,
889 .num_pins = ARRAY_SIZE(gpio0l_3512_pins),
890 /* Conflict with parallel flash */
891 .value = PFLASH_PADS_DISABLE,
892 },
893 {
894 .name = "gpio0mgrp",
895 .pins = gpio0m_3512_pins,
896 .num_pins = ARRAY_SIZE(gpio0m_3512_pins),
897 /* Conflict with parallel and NAND flash */
898 .value = PFLASH_PADS_DISABLE | NAND_PADS_DISABLE,
899 },
900 {
901 .name = "gpio1agrp",
902 .pins = gpio1a_3512_pins,
903 .num_pins = ARRAY_SIZE(gpio1a_3512_pins),
904 /* Conflict with IDE and parallel flash */
905 .mask = IDE_PADS_ENABLE,
906 .value = PFLASH_PADS_DISABLE,
907 },
908 {
909 .name = "gpio1bgrp",
910 .pins = gpio1b_3512_pins,
911 .num_pins = ARRAY_SIZE(gpio1b_3512_pins),
912 /* Conflict with IDE only */
913 .mask = IDE_PADS_ENABLE,
914 },
915 {
916 .name = "gpio1cgrp",
917 .pins = gpio1c_3512_pins,
918 .num_pins = ARRAY_SIZE(gpio1c_3512_pins),
919 /* Conflict with IDE, parallel and NAND flash */
920 .mask = IDE_PADS_ENABLE,
921 .value = NAND_PADS_DISABLE | PFLASH_PADS_DISABLE,
922 },
923 {
924 .name = "gpio1dgrp",
925 .pins = gpio1d_3512_pins,
926 .num_pins = ARRAY_SIZE(gpio1d_3512_pins),
927 /* Conflict with LCD and TVC */
928 .mask = LCD_PADS_ENABLE | TVC_PADS_ENABLE,
929 },
930 {
931 .name = "gpio2agrp",
932 .pins = gpio2a_3512_pins,
933 .num_pins = ARRAY_SIZE(gpio2a_3512_pins),
934 /* Conflict with GMII and extended parallel flash */
935 },
936 {
937 .name = "gpio2bgrp",
938 .pins = gpio2b_3512_pins,
939 .num_pins = ARRAY_SIZE(gpio2b_3512_pins),
940 /* Conflict with GMII, extended parallel flash and LCD */
941 .mask = LCD_PADS_ENABLE,
942 },
943 {
944 .name = "gpio2cgrp",
945 .pins = gpio2c_3512_pins,
946 .num_pins = ARRAY_SIZE(gpio2c_3512_pins),
947 /* Conflict with PCI */
948 .mask = PCI_PADS_ENABLE,
949 },
950};
951
952/* Pin names for the pinmux subsystem, 3516 variant */
953static const struct pinctrl_pin_desc gemini_3516_pins[] = {
954 /* Row A */
955 PINCTRL_PIN(0, "A1 AVCC3IOHA"),
956 PINCTRL_PIN(1, "A2 DRAM CK N"),
957 PINCTRL_PIN(2, "A3 DRAM CK"),
958 PINCTRL_PIN(3, "A4 DRAM DQM1"),
959 PINCTRL_PIN(4, "A5 DRAM DQ9"),
960 PINCTRL_PIN(5, "A6 DRAM DQ13"),
961 PINCTRL_PIN(6, "A7 DRAM DQ1"),
962 PINCTRL_PIN(7, "A8 DRAM DQ2"),
963 PINCTRL_PIN(8, "A9 DRAM DQ4"),
964 PINCTRL_PIN(9, "A10 DRAM VREF"),
965 PINCTRL_PIN(10, "A11 DRAM DQ24"),
966 PINCTRL_PIN(11, "A12 DRAM DQ28"),
967 PINCTRL_PIN(12, "A13 DRAM DQ30"),
968 PINCTRL_PIN(13, "A14 DRAM DQ18"),
969 PINCTRL_PIN(14, "A15 DRAM DQ21"),
970 PINCTRL_PIN(15, "A16 DRAM CAS_N"),
971 PINCTRL_PIN(16, "A17 DRAM BA1"),
972 PINCTRL_PIN(17, "A18 PCI INTA N"),
973 PINCTRL_PIN(18, "A19 PCI INTB N"),
974 PINCTRL_PIN(19, "A20 PCI INTC N"),
975 /* Row B */
976 PINCTRL_PIN(20, "B1 PWR EN"),
977 PINCTRL_PIN(21, "B2 GND"),
978 PINCTRL_PIN(22, "B3 RTC CLKO"),
979 PINCTRL_PIN(23, "B4 DRAM A5"),
980 PINCTRL_PIN(24, "B5 DRAM A6"),
981 PINCTRL_PIN(25, "B6 DRAM DQS1"),
982 PINCTRL_PIN(26, "B7 DRAM DQ11"),
983 PINCTRL_PIN(27, "B8 DRAM DQ0"),
984 PINCTRL_PIN(28, "B9 DRAM DQS0"),
985 PINCTRL_PIN(29, "B10 DRAM DQ7"),
986 PINCTRL_PIN(30, "B11 DRAM DQS3"),
987 PINCTRL_PIN(31, "B12 DRAM DQ27"),
988 PINCTRL_PIN(32, "B13 DRAM DQ31"),
989 PINCTRL_PIN(33, "B14 DRAM DQ20"),
990 PINCTRL_PIN(34, "B15 DRAM DQS2"),
991 PINCTRL_PIN(35, "B16 DRAM WE N"),
992 PINCTRL_PIN(36, "B17 DRAM A10"),
993 PINCTRL_PIN(37, "B18 DRAM A2"),
994 PINCTRL_PIN(38, "B19 GND"),
995 PINCTRL_PIN(39, "B20 PCI GNT0 N"),
996 /* Row C */
997 PINCTRL_PIN(40, "C1 AGNDIOHA"),
998 PINCTRL_PIN(41, "C2 XTALI"),
999 PINCTRL_PIN(42, "C3 GND"),
1000 PINCTRL_PIN(43, "C4 RTC CLKI"),
1001 PINCTRL_PIN(44, "C5 DRAM A12"),
1002 PINCTRL_PIN(45, "C6 DRAM A11"),
1003 PINCTRL_PIN(46, "C7 DRAM DQ8"),
1004 PINCTRL_PIN(47, "C8 DRAM DQ10"),
1005 PINCTRL_PIN(48, "C9 DRAM DQ3"),
1006 PINCTRL_PIN(49, "C10 DRAM DQ6"),
1007 PINCTRL_PIN(50, "C11 DRAM DQM0"),
1008 PINCTRL_PIN(51, "C12 DRAM DQ26"),
1009 PINCTRL_PIN(52, "C13 DRAM DQ16"),
1010 PINCTRL_PIN(53, "C14 DRAM DQ22"),
1011 PINCTRL_PIN(54, "C15 DRAM DQM2"),
1012 PINCTRL_PIN(55, "C16 DRAM BA0"),
1013 PINCTRL_PIN(56, "C17 DRAM A3"),
1014 PINCTRL_PIN(57, "C18 GND"),
1015 PINCTRL_PIN(58, "C19 PCI GNT1 N"),
1016 PINCTRL_PIN(59, "C20 PCI REQ2 N"),
1017 /* Row D */
1018 PINCTRL_PIN(60, "D1 AVCC3IOAHA"),
1019 PINCTRL_PIN(61, "D2 AVCCKHA"),
1020 PINCTRL_PIN(62, "D3 XTALO"),
1021 PINCTRL_PIN(63, "D4 GND"),
1022 PINCTRL_PIN(64, "D5 CIR RXD"),
1023 PINCTRL_PIN(65, "D6 DRAM A7"),
1024 PINCTRL_PIN(66, "D7 DRAM A4"),
1025 PINCTRL_PIN(67, "D8 DRAM A8"),
1026 PINCTRL_PIN(68, "D9 DRAM CKE"),
1027 PINCTRL_PIN(69, "D10 DRAM DQ14"),
1028 PINCTRL_PIN(70, "D11 DRAM DQ5"),
1029 PINCTRL_PIN(71, "D12 DRAM DQ25"),
1030 PINCTRL_PIN(72, "D13 DRAM DQ17"),
1031 PINCTRL_PIN(73, "D14 DRAM DQ23"),
1032 PINCTRL_PIN(74, "D15 DRAM RAS N"),
1033 PINCTRL_PIN(75, "D16 DRAM A1"),
1034 PINCTRL_PIN(76, "D17 GND"),
1035 PINCTRL_PIN(77, "D18 EXT RESET N"),
1036 PINCTRL_PIN(78, "D19 PCI REQ1 N"),
1037 PINCTRL_PIN(79, "D20 PCI REQ3 N"),
1038 /* Row E */
1039 PINCTRL_PIN(80, "E1 VCC2IO CTRL"),
1040 PINCTRL_PIN(81, "E2 VREF CTRL"),
1041 PINCTRL_PIN(82, "E3 CIR RST N"),
1042 PINCTRL_PIN(83, "E4 PWR BTN"),
1043 PINCTRL_PIN(84, "E5 GND"),
1044 PINCTRL_PIN(85, "E6 CIR TXD"),
1045 PINCTRL_PIN(86, "E7 VCCK CTRL"),
1046 PINCTRL_PIN(87, "E8 DRAM A9"),
1047 PINCTRL_PIN(88, "E9 DRAM DQ12"),
1048 PINCTRL_PIN(89, "E10 DRAM DQ15"),
1049 PINCTRL_PIN(90, "E11 DRAM DQM3"),
1050 PINCTRL_PIN(91, "E12 DRAM DQ29"),
1051 PINCTRL_PIN(92, "E13 DRAM DQ19"),
1052 PINCTRL_PIN(93, "E14 DRAM A13"),
1053 PINCTRL_PIN(94, "E15 DRAM A0"),
1054 PINCTRL_PIN(95, "E16 GND"),
1055 PINCTRL_PIN(96, "E17 PCI INTD N"),
1056 PINCTRL_PIN(97, "E18 PCI GNT3 N"),
1057 PINCTRL_PIN(98, "E19 PCI AD29"),
1058 PINCTRL_PIN(99, "E20 PCI AD28"),
1059 /* Row F */
1060 PINCTRL_PIN(100, "F1 AVCCKHB"),
1061 PINCTRL_PIN(101, "F2 AVCCK P"),
1062 PINCTRL_PIN(102, "F3 EBG"),
1063 PINCTRL_PIN(103, "F4 REXT"),
1064 PINCTRL_PIN(104, "F5 AVCC3IOHB"),
1065 PINCTRL_PIN(105, "F6 GND"),
1066 PINCTRL_PIN(106, "F7 VCC2IOHA 2"),
1067 PINCTRL_PIN(107, "F8 VCC2IOHA 2"),
1068 PINCTRL_PIN(108, "F9 VCC2IOHA 2"),
1069 PINCTRL_PIN(109, "F10 V1"),
1070 PINCTRL_PIN(110, "F11 V1"),
1071 PINCTRL_PIN(111, "F12 VCC2IOHA 2"),
1072 PINCTRL_PIN(112, "F13 VCC2IOHA 2"),
1073 PINCTRL_PIN(113, "F14 VCC2IOHA 2"),
1074 PINCTRL_PIN(114, "F15 GND"),
1075 PINCTRL_PIN(115, "F16 PCI CLK"),
1076 PINCTRL_PIN(116, "F17 PCI GNT2 N"),
1077 PINCTRL_PIN(117, "F18 PCI AD31"),
1078 PINCTRL_PIN(118, "F19 PCI AD26"),
1079 PINCTRL_PIN(119, "F20 PCI CBE3 N"),
1080 /* Row G */
1081 PINCTRL_PIN(120, "G1 SATA0 RXDP"),
1082 PINCTRL_PIN(121, "G2 SATA0 RXDN"),
1083 PINCTRL_PIN(122, "G3 AGNDK 0"),
1084 PINCTRL_PIN(123, "G4 AVCCK S"),
1085 PINCTRL_PIN(124, "G5 AVCC3 S"),
1086 PINCTRL_PIN(125, "G6 VCC2IOHA 2"),
1087 PINCTRL_PIN(126, "G7 GND"),
1088 PINCTRL_PIN(127, "G8 VCC2IOHA 2"),
1089 PINCTRL_PIN(128, "G9 V1"),
1090 PINCTRL_PIN(129, "G10 V1"),
1091 PINCTRL_PIN(130, "G11 V1"),
1092 PINCTRL_PIN(131, "G12 V1"),
1093 PINCTRL_PIN(132, "G13 VCC2IOHA 2"),
1094 PINCTRL_PIN(133, "G14 GND"),
1095 PINCTRL_PIN(134, "G15 VCC3IOHA"),
1096 PINCTRL_PIN(135, "G16 PCI REQ0 N"),
1097 PINCTRL_PIN(136, "G17 PCI AD30"),
1098 PINCTRL_PIN(137, "G18 PCI AD24"),
1099 PINCTRL_PIN(138, "G19 PCI AD23"),
1100 PINCTRL_PIN(139, "G20 PCI AD21"),
1101 /* Row H */
1102 PINCTRL_PIN(140, "H1 SATA0 TXDP"),
1103 PINCTRL_PIN(141, "H2 SATA0 TXDN"),
1104 PINCTRL_PIN(142, "H3 AGNDK 1"),
1105 PINCTRL_PIN(143, "H4 AVCCK 0"),
1106 PINCTRL_PIN(144, "H5 TEST CLKOUT"),
1107 PINCTRL_PIN(145, "H6 AGND"),
1108 PINCTRL_PIN(146, "H7 VCC2IOHA 2"),
1109 PINCTRL_PIN(147, "H8 GND"),
1110 PINCTRL_PIN(148, "H9 GND"),
1111 PINCTRL_PIN(149, "H10 GDN"),
1112 PINCTRL_PIN(150, "H11 GND"),
1113 PINCTRL_PIN(151, "H12 GND"),
1114 PINCTRL_PIN(152, "H13 GND"),
1115 PINCTRL_PIN(153, "H14 VCC3IOHA"),
1116 PINCTRL_PIN(154, "H15 VCC3IOHA"),
1117 PINCTRL_PIN(155, "H16 PCI AD27"),
1118 PINCTRL_PIN(156, "H17 PCI AD25"),
1119 PINCTRL_PIN(157, "H18 PCI AD22"),
1120 PINCTRL_PIN(158, "H19 PCI AD18"),
1121 PINCTRL_PIN(159, "H20 PCI AD17"),
1122 /* Row J (for some reason I is skipped) */
1123 PINCTRL_PIN(160, "J1 SATA1 TXDP"),
1124 PINCTRL_PIN(161, "J2 SATA1 TXDN"),
1125 PINCTRL_PIN(162, "J3 AGNDK 2"),
1126 PINCTRL_PIN(163, "J4 AVCCK 1"),
1127 PINCTRL_PIN(164, "J5 AGND"),
1128 PINCTRL_PIN(165, "J6 AGND"),
1129 PINCTRL_PIN(166, "J7 V1"),
1130 PINCTRL_PIN(167, "J8 GND"),
1131 PINCTRL_PIN(168, "J9 GND"),
1132 PINCTRL_PIN(169, "J10 GND"),
1133 PINCTRL_PIN(170, "J11 GND"),
1134 PINCTRL_PIN(171, "J12 GND"),
1135 PINCTRL_PIN(172, "J13 GND"),
1136 PINCTRL_PIN(173, "J14 V1"),
1137 PINCTRL_PIN(174, "J15 VCC3IOHA"),
1138 PINCTRL_PIN(175, "J16 PCI AD19"),
1139 PINCTRL_PIN(176, "J17 PCI AD20"),
1140 PINCTRL_PIN(177, "J18 PCI AD16"),
1141 PINCTRL_PIN(178, "J19 PCI CBE2 N"),
1142 PINCTRL_PIN(179, "J20 PCI FRAME N"),
1143 /* Row K */
1144 PINCTRL_PIN(180, "K1 SATA1 RXDP"),
1145 PINCTRL_PIN(181, "K2 SATA1 RXDN"),
1146 PINCTRL_PIN(182, "K3 AGNDK 3"),
1147 PINCTRL_PIN(183, "K4 AVCCK 2"),
1148 PINCTRL_PIN(184, "K5 AGND"),
1149 PINCTRL_PIN(185, "K6 V1"),
1150 PINCTRL_PIN(186, "K7 V1"),
1151 PINCTRL_PIN(187, "K8 GND"),
1152 PINCTRL_PIN(188, "K9 GND"),
1153 PINCTRL_PIN(189, "K10 GND"),
1154 PINCTRL_PIN(190, "K11 GND"),
1155 PINCTRL_PIN(191, "K12 GND"),
1156 PINCTRL_PIN(192, "K13 GND"),
1157 PINCTRL_PIN(193, "K14 V1"),
1158 PINCTRL_PIN(194, "K15 V1"),
1159 PINCTRL_PIN(195, "K16 PCI TRDY N"),
1160 PINCTRL_PIN(196, "K17 PCI IRDY N"),
1161 PINCTRL_PIN(197, "K18 PCI DEVSEL N"),
1162 PINCTRL_PIN(198, "K19 PCI STOP N"),
1163 PINCTRL_PIN(199, "K20 PCI PAR"),
1164 /* Row L */
1165 PINCTRL_PIN(200, "L1 IDE CS0 N"),
1166 PINCTRL_PIN(201, "L2 IDE DA0"),
1167 PINCTRL_PIN(202, "L3 AVCCK 3"),
1168 PINCTRL_PIN(203, "L4 AGND"),
1169 PINCTRL_PIN(204, "L5 IDE DIOR N"),
1170 PINCTRL_PIN(205, "L6 V1"),
1171 PINCTRL_PIN(206, "L7 V1"),
1172 PINCTRL_PIN(207, "L8 GND"),
1173 PINCTRL_PIN(208, "L9 GND"),
1174 PINCTRL_PIN(209, "L10 GND"),
1175 PINCTRL_PIN(210, "L11 GND"),
1176 PINCTRL_PIN(211, "L12 GND"),
1177 PINCTRL_PIN(212, "L13 GND"),
1178 PINCTRL_PIN(213, "L14 V1"),
1179 PINCTRL_PIN(214, "L15 V1"),
1180 PINCTRL_PIN(215, "L16 PCI AD12"),
1181 PINCTRL_PIN(216, "L17 PCI AD13"),
1182 PINCTRL_PIN(217, "L18 PCI AD14"),
1183 PINCTRL_PIN(218, "L19 PCI AD15"),
1184 PINCTRL_PIN(219, "L20 PCI CBE1 N"),
1185 /* Row M */
1186 PINCTRL_PIN(220, "M1 IDE DA1"),
1187 PINCTRL_PIN(221, "M2 IDE CS1 N"),
1188 PINCTRL_PIN(222, "M3 IDE DA2"),
1189 PINCTRL_PIN(223, "M4 IDE DMACK N"),
1190 PINCTRL_PIN(224, "M5 IDE DD1"),
1191 PINCTRL_PIN(225, "M6 VCC3IOHA"),
1192 PINCTRL_PIN(226, "M7 V1"),
1193 PINCTRL_PIN(227, "M8 GND"),
1194 PINCTRL_PIN(228, "M9 GND"),
1195 PINCTRL_PIN(229, "M10 GND"),
1196 PINCTRL_PIN(230, "M11 GND"),
1197 PINCTRL_PIN(231, "M12 GND"),
1198 PINCTRL_PIN(232, "M13 GND"),
1199 PINCTRL_PIN(233, "M14 V1"),
1200 PINCTRL_PIN(234, "M15 VCC3IOHA"),
1201 PINCTRL_PIN(235, "M16 PCI AD7"),
1202 PINCTRL_PIN(236, "M17 PCI AD6"),
1203 PINCTRL_PIN(237, "M18 PCI AD9"),
1204 PINCTRL_PIN(238, "M19 PCI AD10"),
1205 PINCTRL_PIN(239, "M20 PCI AD11"),
1206 /* Row N */
1207 PINCTRL_PIN(240, "N1 IDE IORDY"),
1208 PINCTRL_PIN(241, "N2 IDE INTRQ"),
1209 PINCTRL_PIN(242, "N3 IDE DIOW N"),
1210 PINCTRL_PIN(243, "N4 IDE DD15"),
1211 PINCTRL_PIN(244, "N5 IDE DMARQ"),
1212 PINCTRL_PIN(245, "N6 VCC3IOHA"),
1213 PINCTRL_PIN(246, "N7 VCC3IOHA"),
1214 PINCTRL_PIN(247, "N8 GND"),
1215 PINCTRL_PIN(248, "N9 GND"),
1216 PINCTRL_PIN(249, "N10 GND"),
1217 PINCTRL_PIN(250, "N11 GND"),
1218 PINCTRL_PIN(251, "N12 GND"),
1219 PINCTRL_PIN(252, "N13 GND"),
1220 PINCTRL_PIN(253, "N14 VCC3IOHA"),
1221 PINCTRL_PIN(254, "N15 VCC3IOHA"),
1222 PINCTRL_PIN(255, "N16 PCI CLKRUN N"),
1223 PINCTRL_PIN(256, "N17 PCI AD0"),
1224 PINCTRL_PIN(257, "N18 PCI AD4"),
1225 PINCTRL_PIN(258, "N19 PCI CBE0 N"),
1226 PINCTRL_PIN(259, "N20 PCI AD8"),
1227 /* Row P (for some reason O is skipped) */
1228 PINCTRL_PIN(260, "P1 IDE DD0"),
1229 PINCTRL_PIN(261, "P2 IDE DD14"),
1230 PINCTRL_PIN(262, "P3 IDE DD2"),
1231 PINCTRL_PIN(263, "P4 IDE DD4"),
1232 PINCTRL_PIN(264, "P5 IDE DD3"),
1233 PINCTRL_PIN(265, "P6 VCC3IOHA"),
1234 PINCTRL_PIN(266, "P7 GND"),
1235 PINCTRL_PIN(267, "P8 VCC2IOHA 1"),
1236 PINCTRL_PIN(268, "P9 V1"),
1237 PINCTRL_PIN(269, "P10 V1"),
1238 PINCTRL_PIN(270, "P11 V1"),
1239 PINCTRL_PIN(271, "P12 V1"),
1240 PINCTRL_PIN(272, "P13 VCC3IOHA"),
1241 PINCTRL_PIN(273, "P14 GND"),
1242 PINCTRL_PIN(274, "P15 VCC3IOHA"),
1243 PINCTRL_PIN(275, "P16 GPIO0 30"),
1244 PINCTRL_PIN(276, "P17 GPIO0 28"),
1245 PINCTRL_PIN(277, "P18 PCI AD1"),
1246 PINCTRL_PIN(278, "P19 PCI AD3"),
1247 PINCTRL_PIN(279, "P20 PCI AD5"),
1248 /* Row R (for some reason Q us skipped) */
1249 PINCTRL_PIN(280, "R1 IDE DD13"),
1250 PINCTRL_PIN(281, "R2 IDE DD12"),
1251 PINCTRL_PIN(282, "R3 IDE DD10"),
1252 PINCTRL_PIN(283, "R4 IDE DD6"),
1253 PINCTRL_PIN(284, "R5 ICE0 IDI"),
1254 PINCTRL_PIN(285, "R6 GND"),
1255 PINCTRL_PIN(286, "R7 VCC2IOHA 1"),
1256 PINCTRL_PIN(287, "R8 VCC2IOHA 1"),
1257 PINCTRL_PIN(288, "R9 VCC2IOHA 1"),
1258 PINCTRL_PIN(289, "R10 V1"),
1259 PINCTRL_PIN(290, "R11 V1"),
1260 PINCTRL_PIN(291, "R12 VCC3IOHA"),
1261 PINCTRL_PIN(292, "R13 VCC3IOHA"),
1262 PINCTRL_PIN(293, "R14 VCC3IOHA"),
1263 PINCTRL_PIN(294, "R15 GND"),
1264 PINCTRL_PIN(295, "R16 GPIO0 23"),
1265 PINCTRL_PIN(296, "R17 GPIO0 21"),
1266 PINCTRL_PIN(297, "R18 GPIO0 26"),
1267 PINCTRL_PIN(298, "R19 GPIO0 31"),
1268 PINCTRL_PIN(299, "R20 PCI AD2"),
1269 /* Row T (for some reason S is skipped) */
1270 PINCTRL_PIN(300, "T1 IDE DD11"),
1271 PINCTRL_PIN(301, "T2 IDE DD5"),
1272 PINCTRL_PIN(302, "T3 IDE DD8"),
1273 PINCTRL_PIN(303, "T4 ICE0 IDO"),
1274 PINCTRL_PIN(304, "T5 GND"),
1275 PINCTRL_PIN(305, "T6 USB GNDA U20"),
1276 PINCTRL_PIN(306, "T7 GMAC0 TXD0"),
1277 PINCTRL_PIN(307, "T8 GMAC0 TXEN"),
1278 PINCTRL_PIN(308, "T9 GMAC1 TXD3"),
1279 PINCTRL_PIN(309, "T10 GMAC1 RXDV"),
1280 PINCTRL_PIN(310, "T11 GMAC1 RXD2"),
1281 PINCTRL_PIN(311, "T12 GPIO1 29"),
1282 PINCTRL_PIN(312, "T13 GPIO0 3"),
1283 PINCTRL_PIN(313, "T14 GPIO0 9"),
1284 PINCTRL_PIN(314, "T15 GPIO0 16"),
1285 PINCTRL_PIN(315, "T16 GND"),
1286 PINCTRL_PIN(316, "T17 GPIO0 14"),
1287 PINCTRL_PIN(317, "T18 GPIO0 19"),
1288 PINCTRL_PIN(318, "T19 GPIO0 27"),
1289 PINCTRL_PIN(319, "T20 GPIO0 29"),
1290 /* Row U */
1291 PINCTRL_PIN(320, "U1 IDE DD9"),
1292 PINCTRL_PIN(321, "U2 IDE DD7"),
1293 PINCTRL_PIN(322, "U3 ICE0 ICK"),
1294 PINCTRL_PIN(323, "U4 GND"),
1295 PINCTRL_PIN(324, "U5 USB XSCO"),
1296 PINCTRL_PIN(325, "U6 GMAC0 TXD1"),
1297 PINCTRL_PIN(326, "U7 GMAC0 TXD3"),
1298 PINCTRL_PIN(327, "U8 GMAC0 TXC"),
1299 PINCTRL_PIN(328, "U9 GMAC0 RXD3"),
1300 PINCTRL_PIN(329, "U10 GMAC1 TXD0"),
1301 PINCTRL_PIN(330, "U11 GMAC1 CRS"),
1302 PINCTRL_PIN(331, "U12 EXT CLK"),
1303 PINCTRL_PIN(332, "U13 DEV DEF"),
1304 PINCTRL_PIN(333, "U14 GPIO0 0"),
1305 PINCTRL_PIN(334, "U15 GPIO0 4"),
1306 PINCTRL_PIN(335, "U16 GPIO0 10"),
1307 PINCTRL_PIN(336, "U17 GND"),
1308 PINCTRL_PIN(337, "U18 GPIO0 17"),
1309 PINCTRL_PIN(338, "U19 GPIO0 22"),
1310 PINCTRL_PIN(339, "U20 GPIO0 25"),
1311 /* Row V */
1312 PINCTRL_PIN(340, "V1 ICE0 DBGACK"),
1313 PINCTRL_PIN(341, "V2 ICE0 DBGRQ"),
1314 PINCTRL_PIN(342, "V3 GND"),
1315 PINCTRL_PIN(343, "V4 ICE0 IRST N"),
1316 PINCTRL_PIN(344, "V5 USB XSCI"),
1317 PINCTRL_PIN(345, "V6 GMAC0 COL"),
1318 PINCTRL_PIN(346, "V7 GMAC0 TXD2"),
1319 PINCTRL_PIN(347, "V8 GMAC0 RXDV"),
1320 PINCTRL_PIN(348, "V9 GMAC0 RXD1"),
1321 PINCTRL_PIN(349, "V10 GMAC1 COL"),
1322 PINCTRL_PIN(350, "V11 GMAC1 TXC"),
1323 PINCTRL_PIN(351, "V12 GMAC1 RXD1"),
1324 PINCTRL_PIN(352, "V13 MODE SEL1"),
1325 PINCTRL_PIN(353, "V14 GPIO1 28"),
1326 PINCTRL_PIN(354, "V15 GPIO0 1"),
1327 PINCTRL_PIN(355, "V16 GPIO0 8"),
1328 PINCTRL_PIN(356, "V17 GPIO0 11"),
1329 PINCTRL_PIN(357, "V18 GND"),
1330 PINCTRL_PIN(358, "V19 GPIO0 18"),
1331 PINCTRL_PIN(359, "V20 GPIO0 24"),
1332 /* Row W */
1333 PINCTRL_PIN(360, "W1 IDE RESET N"),
1334 PINCTRL_PIN(361, "W2 GND"),
1335 PINCTRL_PIN(362, "W3 USB0 VCCHSRT"),
1336 PINCTRL_PIN(363, "W4 USB0 DP"),
1337 PINCTRL_PIN(364, "W5 USB VCCA U20"),
1338 PINCTRL_PIN(365, "W6 USB1 DP"),
1339 PINCTRL_PIN(366, "W7 USB1 GNDHSRT"),
1340 PINCTRL_PIN(367, "W8 GMAC0 RXD0"),
1341 PINCTRL_PIN(368, "W9 GMAC0 CRS"),
1342 PINCTRL_PIN(369, "W10 GMAC1 TXD2"),
1343 PINCTRL_PIN(370, "W11 GMAC1 TXEN"),
1344 PINCTRL_PIN(371, "W12 GMAC1 RXD3"),
1345 PINCTRL_PIN(372, "W13 MODE SEL0"),
1346 PINCTRL_PIN(373, "W14 MODE SEL3"),
1347 PINCTRL_PIN(374, "W15 GPIO1 31"),
1348 PINCTRL_PIN(375, "W16 GPIO0 5"),
1349 PINCTRL_PIN(376, "W17 GPIO0 7"),
1350 PINCTRL_PIN(377, "W18 GPIO0 12"),
1351 PINCTRL_PIN(378, "W19 GND"),
1352 PINCTRL_PIN(379, "W20 GPIO0 20"),
1353 /* Row Y */
1354 PINCTRL_PIN(380, "Y1 ICE0 IMS"),
1355 PINCTRL_PIN(381, "Y2 USB0 GNDHSRT"),
1356 PINCTRL_PIN(382, "Y3 USB0 DM"),
1357 PINCTRL_PIN(383, "Y4 USB RREF"),
1358 PINCTRL_PIN(384, "Y5 USB1 DM"),
1359 PINCTRL_PIN(385, "Y6 USB1 VCCHSRT"),
1360 PINCTRL_PIN(386, "Y7 GMAC0 RXC"),
1361 PINCTRL_PIN(387, "Y8 GMAC0 RXD2"),
1362 PINCTRL_PIN(388, "Y9 REF CLK"),
1363 PINCTRL_PIN(389, "Y10 GMAC1 TXD1"),
1364 PINCTRL_PIN(390, "Y11 GMAC1 RXC"),
1365 PINCTRL_PIN(391, "Y12 GMAC1 RXD0"),
1366 PINCTRL_PIN(392, "Y13 M30 CLK"),
1367 PINCTRL_PIN(393, "Y14 MODE SEL2"),
1368 PINCTRL_PIN(394, "Y15 GPIO1 30"),
1369 PINCTRL_PIN(395, "Y16 GPIO0 2"),
1370 PINCTRL_PIN(396, "Y17 GPIO0 6"),
1371 PINCTRL_PIN(397, "Y18 SYS RESET N"),
1372 PINCTRL_PIN(398, "Y19 GPIO0 13"),
1373 PINCTRL_PIN(399, "Y20 GPIO0 15"),
1374};
1375
1376/* Digital ground */
1377static const unsigned int gnd_3516_pins[] = {
1378 21, 38, 42, 57, 63, 76, 84, 95, 105, 114, 126, 133, 147, 148, 149, 150,
1379 151, 152, 167, 168, 169, 170, 171, 172, 187, 188, 189, 190, 191, 192,
1380 207, 208, 209, 210, 211, 212, 227, 228, 229, 230, 231, 232, 247, 248,
1381 249, 250, 251, 252, 266, 273, 285, 294, 304, 315, 323, 336, 342, 357,
1382 361, 378
1383};
1384
1385static const unsigned int dram_3516_pins[] = {
1386 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 23, 24, 25, 26,
1387 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 44, 45, 46, 47, 48, 49, 50,
1388 51, 52, 53, 54, 55, 56, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1389 87, 88, 89, 90, 91, 92, 93, 94
1390};
1391
1392static const unsigned int rtc_3516_pins[] = { 0, 43, 22 };
1393
1394static const unsigned int power_3516_pins[] = { 20, 83, 40, 41, 60, 61, 62 };
1395
1396static const unsigned int cir_3516_pins[] = { 85, 64, 82 };
1397
1398static const unsigned int system_3516_pins[] = {
1399 332, 392, 372, 373, 393, 352, 331, 388, 397, 77
1400};
1401
1402static const unsigned int vcontrol_3516_pins[] = { 86, 81, 80 };
1403
1404static const unsigned int ice_3516_pins[] = { 340, 341, 303, 322, 380, 284, 343 };
1405
1406static const unsigned int ide_3516_pins[] = {
1407 200, 201, 204, 220, 221, 222, 223, 224, 240, 241, 242, 243, 244, 260,
1408 261, 262, 263, 264, 280, 281, 282, 283, 300, 301, 302, 320, 321, 360
1409};
1410
1411static const unsigned int sata_3516_pins[] = {
1412 100, 101, 102, 103, 104, 120, 121, 122, 123, 124, 140, 141, 142, 143,
1413 144, 160, 161, 162, 163, 180, 181, 182, 183, 202
1414};
1415
1416static const unsigned int usb_3516_pins[] = {
1417 305, 324, 344, 362, 363, 364, 365, 366, 381, 382, 383, 384, 385
1418};
1419
1420/* GMII, ethernet pins */
1421static const unsigned int gmii_3516_pins[] = {
1422 306, 307, 308, 309, 310, 325, 326, 327, 328, 329, 330, 345, 346, 347,
1423 348, 349, 350, 351, 367, 368, 369, 370, 371, 386, 387, 389, 390, 391
1424};
1425
1426static const unsigned int pci_3516_pins[] = {
1427 17, 18, 19, 39, 58, 59, 78, 79, 96, 97, 98, 99, 115, 116, 117, 118,
1428 119, 135, 136, 137, 138, 139, 155, 156, 157, 158, 159, 175, 176, 177,
1429 178, 179, 195, 196, 197, 198, 199, 215, 216, 217, 218, 219, 235, 236,
1430 237, 238, 239, 255, 256, 257, 258, 259, 277, 278, 279, 299
1431};
1432
1433/*
1434 * Apparently the LPC interface is using the PCICLK for the clocking so
1435 * PCI needs to be active at the same time.
1436 */
1437static const unsigned int lpc_3516_pins[] = {
1438 355, /* LPC_LAD[0] */
1439 356, /* LPC_SERIRQ */
1440 377, /* LPC_LAD[2] */
1441 398, /* LPC_LFRAME# */
1442 316, /* LPC_LAD[3] */
1443 399, /* LPC_LAD[1] */
1444};
1445
1446/* Character LCD */
1447static const unsigned int lcd_3516_pins[] = {
1448 391, 351, 310, 371, 353, 311, 394, 374, 314, 359, 339
1449};
1450
1451static const unsigned int ssp_3516_pins[] = {
1452 355, /* SSP_97RST# SSP AC97 Reset, active low */
1453 356, /* SSP_FSC */
1454 377, /* SSP_ECLK */
1455 398, /* SSP_TXD */
1456 316, /* SSP_RXD */
1457 399, /* SSP_SCLK */
1458};
1459
1460static const unsigned int uart_rxtx_3516_pins[] = {
1461 313, /* UART_SIN serial input, RX */
1462 335, /* UART_SOUT serial output, TX */
1463};
1464
1465static const unsigned int uart_modem_3516_pins[] = {
1466 355, /* UART_NDCD DCD carrier detect */
1467 356, /* UART_NDTR DTR data terminal ready */
1468 377, /* UART_NDSR DSR data set ready */
1469 398, /* UART_NRTS RTS request to send */
1470 316, /* UART_NCTS CTS clear to send */
1471 399, /* UART_NRI RI ring indicator */
1472};
1473
1474static const unsigned int tvc_3516_pins[] = {
1475 353, /* TVC_DATA[0] */
1476 311, /* TVC_DATA[1] */
1477 394, /* TVC_DATA[2] */
1478 374, /* TVC_DATA[3] */
1479 333, /* TVC_CLK */
1480 354, /* TVC_DATA[4] */
1481 395, /* TVC_DATA[5] */
1482 312, /* TVC_DATA[6] */
1483 334, /* TVC_DATA[7] */
1484};
1485
1486/* NAND flash pins */
1487static const unsigned int nflash_3516_pins[] = {
1488 243, 260, 261, 224, 280, 262, 281, 264, 300, 263, 282, 301, 320, 283,
1489 302, 321, 337, 358, 295, 359, 339, 275, 298
1490};
1491
1492/* Parallel (NOR) flash pins, D[0-15], A[16-25], CE0, CE1, RB, WE, OE, ALE */
1493static const unsigned int pflash_3516_pins[] = {
1494 221, 200, 222, 201, 220, 243, 260, 261, 224, 280, 262, 281, 264, 300,
1495 263, 282, 301, 320, 283, 302, 321, 317, 379, 295, 359, 339, 297, 318,
1496 276, 319, 275, 298
1497};
1498
1499/*
1500 * The parallel flash can be set up in a 26-bit address bus mode exposing
1501 * A[0-15] (A[15] takes the place of ALE), but it has the
1502 * side effect of stealing pins from GMAC1 and TVC so these blocks cannot be
1503 * used at the same time.
1504 */
1505static const unsigned int pflash_3516_pins_extended[] = {
1506 221, 200, 222, 201, 220, 243, 260, 261, 224, 280, 262, 281, 264, 300,
1507 263, 282, 301, 320, 283, 302, 321, 317, 379, 295, 359, 339, 297, 318,
1508 276, 319, 275, 298,
1509 /* The extra pins */
1510 349, 308, 369, 389, 329, 350, 370, 309, 390, 391, 351, 310, 371, 330,
1511 333
1512};
1513
1514/* Serial flash pins CE0, CE1, DI, DO, CK */
1515static const unsigned int sflash_3516_pins[] = { 296, 338, 295, 359, 339 };
1516
1517/* The GPIO0A (0-4) pins overlap with TVC and extended parallel flash */
1518static const unsigned int gpio0a_3516_pins[] = { 333, 354, 395, 312, 334 };
1519
1520/* The GPIO0B (5-7) pins overlap with ICE */
1521static const unsigned int gpio0b_3516_pins[] = { 375, 396, 376 };
1522
1523/* The GPIO0C (8,11-15) pins overlap with LPC, UART and SSP */
1524static const unsigned int gpio0c_3516_pins[] = { 355, 356, 377, 398, 316, 399 };
1525
1526/* The GPIO0D (9,10) pins overlap with UART RX/TX */
1527static const unsigned int gpio0d_3516_pins[] = { 313, 335 };
1528
1529/* The GPIO0E (16) pins overlap with LCD */
1530static const unsigned int gpio0e_3516_pins[] = { 314 };
1531
1532/* The GPIO0F (17,18) pins overlap with NAND flash CE0, CE1 */
1533static const unsigned int gpio0f_3516_pins[] = { 337, 358 };
1534
1535/* The GPIO0G (19,20,26-29) pins overlap with parallel flash */
1536static const unsigned int gpio0g_3516_pins[] = { 317, 379, 297, 318, 276, 319 };
1537
1538/* The GPIO0H (21,22) pins overlap with serial flash CE0, CE1 */
1539static const unsigned int gpio0h_3516_pins[] = { 296, 338 };
1540
1541/* The GPIO0I (23) pins overlap with all flash */
1542static const unsigned int gpio0i_3516_pins[] = { 295 };
1543
1544/* The GPIO0J (24,25) pins overlap with all flash and LCD */
1545static const unsigned int gpio0j_3516_pins[] = { 359, 339 };
1546
1547/* The GPIO0K (30,31) pins overlap with NAND flash */
1548static const unsigned int gpio0k_3516_pins[] = { 275, 298 };
1549
1550/* The GPIO1A (0-4) pins that overlap with IDE and parallel flash */
1551static const unsigned int gpio1a_3516_pins[] = { 221, 200, 222, 201, 220 };
1552
1553/* The GPIO1B (5-10,27) pins overlap with just IDE */
1554static const unsigned int gpio1b_3516_pins[] = { 241, 223, 240, 204, 242, 244, 360 };
1555
1556/* The GPIO1C (11-26) pins overlap with IDE, parallel flash and NAND flash */
1557static const unsigned int gpio1c_3516_pins[] = {
1558 243, 260, 261, 224, 280, 262, 281, 264, 300, 263, 282, 301, 320, 283,
1559 302, 321
1560};
1561
1562/* The GPIO1D (28-31) pins overlap with TVC */
1563static const unsigned int gpio1d_3516_pins[] = { 353, 311, 394, 374 };
1564
1565/* The GPIO2A (0-3) pins overlap with GMII and extended parallel flash */
1566static const unsigned int gpio2a_3516_pins[] = { 308, 369, 389, 329 };
1567
1568/* The GPIO2B (4-7) pins overlap with GMII, extended parallel flash and LCD */
1569static const unsigned int gpio2b_3516_pins[] = { 391, 351, 310, 371 };
1570
1571/* The GPIO2C (8-31) pins overlap with PCI */
1572static const unsigned int gpio2c_3516_pins[] = {
1573 259, 237, 238, 239, 215, 216, 217, 218, 177, 159, 158, 175, 176, 139,
1574 157, 138, 137, 156, 118, 155, 99, 98, 136, 117
1575};
1576
1577/* Groups for the 3516 SoC/package */
1578static const struct gemini_pin_group gemini_3516_pin_groups[] = {
1579 {
1580 .name = "gndgrp",
1581 .pins = gnd_3516_pins,
1582 .num_pins = ARRAY_SIZE(gnd_3516_pins),
1583 },
1584 {
1585 .name = "dramgrp",
1586 .pins = dram_3516_pins,
1587 .num_pins = ARRAY_SIZE(dram_3516_pins),
1588 .mask = DRAM_PADS_POWERDOWN,
1589 },
1590 {
1591 .name = "rtcgrp",
1592 .pins = rtc_3516_pins,
1593 .num_pins = ARRAY_SIZE(rtc_3516_pins),
1594 },
1595 {
1596 .name = "powergrp",
1597 .pins = power_3516_pins,
1598 .num_pins = ARRAY_SIZE(power_3516_pins),
1599 },
1600 {
1601 .name = "cirgrp",
1602 .pins = cir_3516_pins,
1603 .num_pins = ARRAY_SIZE(cir_3516_pins),
1604 },
1605 {
1606 .name = "systemgrp",
1607 .pins = system_3516_pins,
1608 .num_pins = ARRAY_SIZE(system_3516_pins),
1609 },
1610 {
1611 .name = "vcontrolgrp",
1612 .pins = vcontrol_3516_pins,
1613 .num_pins = ARRAY_SIZE(vcontrol_3516_pins),
1614 },
1615 {
1616 .name = "icegrp",
1617 .pins = ice_3516_pins,
1618 .num_pins = ARRAY_SIZE(ice_3516_pins),
1619 /* Conflict with some GPIO groups */
1620 },
1621 {
1622 .name = "idegrp",
1623 .pins = ide_3516_pins,
1624 .num_pins = ARRAY_SIZE(ide_3516_pins),
1625 /* Conflict with all flash usage */
1626 .value = IDE_PADS_ENABLE | NAND_PADS_DISABLE |
1627 PFLASH_PADS_DISABLE | SFLASH_PADS_DISABLE,
1628 },
1629 {
1630 .name = "satagrp",
1631 .pins = sata_3516_pins,
1632 .num_pins = ARRAY_SIZE(sata_3516_pins),
1633 },
1634 {
1635 .name = "usbgrp",
1636 .pins = usb_3516_pins,
1637 .num_pins = ARRAY_SIZE(usb_3516_pins),
1638 },
1639 {
1640 .name = "gmiigrp",
1641 .pins = gmii_3516_pins,
1642 .num_pins = ARRAY_SIZE(gmii_3516_pins),
1643 },
1644 {
1645 .name = "pcigrp",
1646 .pins = pci_3516_pins,
1647 .num_pins = ARRAY_SIZE(pci_3516_pins),
1648 /* Conflict only with GPIO2 */
1649 .value = PCI_PADS_ENABLE | PCI_CLK_PAD_ENABLE,
1650 },
1651 {
1652 .name = "lpcgrp",
1653 .pins = lpc_3516_pins,
1654 .num_pins = ARRAY_SIZE(lpc_3516_pins),
1655 /* Conflict with SSP */
1656 .mask = SSP_PADS_ENABLE,
1657 .value = LPC_PADS_ENABLE | LPC_CLK_PAD_ENABLE,
1658 },
1659 {
1660 .name = "lcdgrp",
1661 .pins = lcd_3516_pins,
1662 .num_pins = ARRAY_SIZE(lcd_3516_pins),
1663 .mask = TVC_PADS_ENABLE,
1664 .value = LCD_PADS_ENABLE,
1665 },
1666 {
1667 .name = "sspgrp",
1668 .pins = ssp_3516_pins,
1669 .num_pins = ARRAY_SIZE(ssp_3516_pins),
1670 /* Conflict with LPC */
1671 .mask = LPC_PADS_ENABLE,
1672 .value = SSP_PADS_ENABLE,
1673 },
1674 {
1675 .name = "uartrxtxgrp",
1676 .pins = uart_rxtx_3516_pins,
1677 .num_pins = ARRAY_SIZE(uart_rxtx_3516_pins),
1678 /* No conflicts except GPIO */
1679 },
1680 {
1681 .name = "uartmodemgrp",
1682 .pins = uart_modem_3516_pins,
1683 .num_pins = ARRAY_SIZE(uart_modem_3516_pins),
1684 /*
1685 * Conflict with LPC and SSP,
1686 * so when those are both disabled, modem UART can thrive.
1687 */
1688 .mask = LPC_PADS_ENABLE | SSP_PADS_ENABLE,
1689 },
1690 {
1691 .name = "tvcgrp",
1692 .pins = tvc_3516_pins,
1693 .num_pins = ARRAY_SIZE(tvc_3516_pins),
1694 /* Conflict with character LCD */
1695 .mask = LCD_PADS_ENABLE,
1696 .value = TVC_PADS_ENABLE | TVC_CLK_PAD_ENABLE,
1697 },
1698 /*
1699 * The construction is done such that it is possible to use a serial
1700 * flash together with a NAND or parallel (NOR) flash, but it is not
1701 * possible to use NAND and parallel flash together. To use serial
1702 * flash with one of the two others, the muxbits need to be flipped
1703 * around before any access.
1704 */
1705 {
1706 .name = "nflashgrp",
1707 .pins = nflash_3516_pins,
1708 .num_pins = ARRAY_SIZE(nflash_3516_pins),
1709 /* Conflict with IDE, parallel and serial flash */
1710 .mask = NAND_PADS_DISABLE | IDE_PADS_ENABLE,
1711 .value = PFLASH_PADS_DISABLE | SFLASH_PADS_DISABLE,
1712 },
1713 {
1714 .name = "pflashgrp",
1715 .pins = pflash_3516_pins,
1716 .num_pins = ARRAY_SIZE(pflash_3516_pins),
1717 /* Conflict with IDE, NAND and serial flash */
1718 .mask = PFLASH_PADS_DISABLE | IDE_PADS_ENABLE,
1719 .value = NAND_PADS_DISABLE | SFLASH_PADS_DISABLE,
1720 },
1721 {
1722 .name = "sflashgrp",
1723 .pins = sflash_3516_pins,
1724 .num_pins = ARRAY_SIZE(sflash_3516_pins),
1725 /* Conflict with IDE, NAND and parallel flash */
1726 .mask = SFLASH_PADS_DISABLE | IDE_PADS_ENABLE,
1727 .value = NAND_PADS_DISABLE | PFLASH_PADS_DISABLE,
1728 },
1729 {
1730 .name = "gpio0agrp",
1731 .pins = gpio0a_3516_pins,
1732 .num_pins = ARRAY_SIZE(gpio0a_3516_pins),
1733 /* Conflict with TVC and ICE */
1734 .mask = TVC_PADS_ENABLE,
1735 },
1736 {
1737 .name = "gpio0bgrp",
1738 .pins = gpio0b_3516_pins,
1739 .num_pins = ARRAY_SIZE(gpio0b_3516_pins),
1740 /* Conflict with ICE */
1741 },
1742 {
1743 .name = "gpio0cgrp",
1744 .pins = gpio0c_3516_pins,
1745 .num_pins = ARRAY_SIZE(gpio0c_3516_pins),
1746 /* Conflict with LPC, UART and SSP */
1747 .mask = LPC_PADS_ENABLE | SSP_PADS_ENABLE,
1748 },
1749 {
1750 .name = "gpio0dgrp",
1751 .pins = gpio0d_3516_pins,
1752 .num_pins = ARRAY_SIZE(gpio0d_3516_pins),
1753 /* Conflict with UART */
1754 },
1755 {
1756 .name = "gpio0egrp",
1757 .pins = gpio0e_3516_pins,
1758 .num_pins = ARRAY_SIZE(gpio0e_3516_pins),
1759 /* Conflict with LCD */
1760 .mask = LCD_PADS_ENABLE,
1761 },
1762 {
1763 .name = "gpio0fgrp",
1764 .pins = gpio0f_3516_pins,
1765 .num_pins = ARRAY_SIZE(gpio0f_3516_pins),
1766 /* Conflict with NAND flash */
1767 .value = NAND_PADS_DISABLE,
1768 },
1769 {
1770 .name = "gpio0ggrp",
1771 .pins = gpio0g_3516_pins,
1772 .num_pins = ARRAY_SIZE(gpio0g_3516_pins),
1773 /* Conflict with parallel flash */
1774 .value = PFLASH_PADS_DISABLE,
1775 },
1776 {
1777 .name = "gpio0hgrp",
1778 .pins = gpio0h_3516_pins,
1779 .num_pins = ARRAY_SIZE(gpio0h_3516_pins),
1780 /* Conflict with serial flash */
1781 .value = SFLASH_PADS_DISABLE,
1782 },
1783 {
1784 .name = "gpio0igrp",
1785 .pins = gpio0i_3516_pins,
1786 .num_pins = ARRAY_SIZE(gpio0i_3516_pins),
1787 /* Conflict with all flash */
1788 .value = PFLASH_PADS_DISABLE | NAND_PADS_DISABLE |
1789 SFLASH_PADS_DISABLE,
1790 },
1791 {
1792 .name = "gpio0jgrp",
1793 .pins = gpio0j_3516_pins,
1794 .num_pins = ARRAY_SIZE(gpio0j_3516_pins),
1795 /* Conflict with all flash and LCD */
1796 .mask = LCD_PADS_ENABLE,
1797 .value = PFLASH_PADS_DISABLE | NAND_PADS_DISABLE |
1798 SFLASH_PADS_DISABLE,
1799 },
1800 {
1801 .name = "gpio0kgrp",
1802 .pins = gpio0k_3516_pins,
1803 .num_pins = ARRAY_SIZE(gpio0k_3516_pins),
1804 /* Conflict with parallel and NAND flash */
1805 .value = PFLASH_PADS_DISABLE | NAND_PADS_DISABLE,
1806 },
1807 {
1808 .name = "gpio1agrp",
1809 .pins = gpio1a_3516_pins,
1810 .num_pins = ARRAY_SIZE(gpio1a_3516_pins),
1811 /* Conflict with IDE and parallel flash */
1812 .mask = IDE_PADS_ENABLE,
1813 .value = PFLASH_PADS_DISABLE,
1814 },
1815 {
1816 .name = "gpio1bgrp",
1817 .pins = gpio1b_3516_pins,
1818 .num_pins = ARRAY_SIZE(gpio1b_3516_pins),
1819 /* Conflict with IDE only */
1820 .mask = IDE_PADS_ENABLE,
1821 },
1822 {
1823 .name = "gpio1cgrp",
1824 .pins = gpio1c_3516_pins,
1825 .num_pins = ARRAY_SIZE(gpio1c_3516_pins),
1826 /* Conflict with IDE, parallel and NAND flash */
1827 .mask = IDE_PADS_ENABLE,
1828 .value = NAND_PADS_DISABLE | PFLASH_PADS_DISABLE,
1829 },
1830 {
1831 .name = "gpio1dgrp",
1832 .pins = gpio1d_3516_pins,
1833 .num_pins = ARRAY_SIZE(gpio1d_3516_pins),
1834 /* Conflict with TVC */
1835 .mask = TVC_PADS_ENABLE,
1836 },
1837 {
1838 .name = "gpio2agrp",
1839 .pins = gpio2a_3516_pins,
1840 .num_pins = ARRAY_SIZE(gpio2a_3516_pins),
1841 /* Conflict with GMII and extended parallel flash */
1842 },
1843 {
1844 .name = "gpio2bgrp",
1845 .pins = gpio2b_3516_pins,
1846 .num_pins = ARRAY_SIZE(gpio2b_3516_pins),
1847 /* Conflict with GMII, extended parallel flash and LCD */
1848 .mask = LCD_PADS_ENABLE,
1849 },
1850 {
1851 .name = "gpio2cgrp",
1852 .pins = gpio2c_3516_pins,
1853 .num_pins = ARRAY_SIZE(gpio2c_3516_pins),
1854 /* Conflict with PCI */
1855 .mask = PCI_PADS_ENABLE,
1856 },
1857};
1858
1859static int gemini_get_groups_count(struct pinctrl_dev *pctldev)
1860{
1861 struct gemini_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
1862
1863 if (pmx->is_3512)
1864 return ARRAY_SIZE(gemini_3512_pin_groups);
1865 if (pmx->is_3516)
1866 return ARRAY_SIZE(gemini_3516_pin_groups);
1867 return 0;
1868}
1869
1870static const char *gemini_get_group_name(struct pinctrl_dev *pctldev,
1871 unsigned int selector)
1872{
1873 struct gemini_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
1874
1875 if (pmx->is_3512)
1876 return gemini_3512_pin_groups[selector].name;
1877 if (pmx->is_3516)
1878 return gemini_3516_pin_groups[selector].name;
1879 return NULL;
1880}
1881
1882static int gemini_get_group_pins(struct pinctrl_dev *pctldev,
1883 unsigned int selector,
1884 const unsigned int **pins,
1885 unsigned int *num_pins)
1886{
1887 struct gemini_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
1888
1889 /* The special case with the 3516 flash pin */
1890 if (pmx->flash_pin &&
1891 pmx->is_3512 &&
1892 !strcmp(gemini_3512_pin_groups[selector].name, "pflashgrp")) {
1893 *pins = pflash_3512_pins_extended;
1894 *num_pins = ARRAY_SIZE(pflash_3512_pins_extended);
1895 return 0;
1896 }
1897 if (pmx->flash_pin &&
1898 pmx->is_3516 &&
1899 !strcmp(gemini_3516_pin_groups[selector].name, "pflashgrp")) {
1900 *pins = pflash_3516_pins_extended;
1901 *num_pins = ARRAY_SIZE(pflash_3516_pins_extended);
1902 return 0;
1903 }
1904 if (pmx->is_3512) {
1905 *pins = gemini_3512_pin_groups[selector].pins;
1906 *num_pins = gemini_3512_pin_groups[selector].num_pins;
1907 }
1908 if (pmx->is_3516) {
1909 *pins = gemini_3516_pin_groups[selector].pins;
1910 *num_pins = gemini_3516_pin_groups[selector].num_pins;
1911 }
1912 return 0;
1913}
1914
1915static void gemini_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
1916 unsigned int offset)
1917{
1918 seq_printf(s, " " DRIVER_NAME);
1919}
1920
1921static int gemini_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
1922 struct device_node *np,
1923 struct pinctrl_map **map,
1924 unsigned int *reserved_maps,
1925 unsigned int *num_maps)
1926{
1927 int ret;
1928 const char *function = NULL;
1929 const char *group;
1930 struct property *prop;
1931
1932 ret = of_property_read_string(np, "function", &function);
1933 if (ret < 0)
1934 return ret;
1935
1936 ret = of_property_count_strings(np, "groups");
1937 if (ret < 0)
1938 return ret;
1939
1940 ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps,
1941 num_maps, ret);
1942 if (ret < 0)
1943 return ret;
1944
1945 of_property_for_each_string(np, "groups", prop, group) {
1946 ret = pinctrl_utils_add_map_mux(pctldev, map, reserved_maps,
1947 num_maps, group, function);
1948 if (ret < 0)
1949 return ret;
1950 pr_debug("ADDED FUNCTION %s <-> GROUP %s\n",
1951 function, group);
1952 }
1953
1954 return 0;
1955}
1956
1957static int gemini_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
1958 struct device_node *np_config,
1959 struct pinctrl_map **map,
1960 unsigned int *num_maps)
1961{
1962 unsigned int reserved_maps = 0;
1963 struct device_node *np;
1964 int ret;
1965
1966 *map = NULL;
1967 *num_maps = 0;
1968
1969 for_each_child_of_node(np_config, np) {
1970 ret = gemini_pinctrl_dt_subnode_to_map(pctldev, np, map,
1971 &reserved_maps, num_maps);
1972 if (ret < 0) {
1973 pinctrl_utils_free_map(pctldev, *map, *num_maps);
1974 return ret;
1975 }
1976 }
1977
1978 return 0;
1979};
1980
1981static const struct pinctrl_ops gemini_pctrl_ops = {
1982 .get_groups_count = gemini_get_groups_count,
1983 .get_group_name = gemini_get_group_name,
1984 .get_group_pins = gemini_get_group_pins,
1985 .pin_dbg_show = gemini_pin_dbg_show,
1986 .dt_node_to_map = gemini_pinctrl_dt_node_to_map,
1987 .dt_free_map = pinctrl_utils_free_map,
1988};
1989
1990/**
1991 * struct gemini_pmx_func - describes Gemini pinmux functions
1992 * @name: the name of this specific function
1993 * @groups: corresponding pin groups
1994 */
1995struct gemini_pmx_func {
1996 const char *name;
1997 const char * const *groups;
1998 const unsigned int num_groups;
1999};
2000
2001static const char * const dramgrps[] = { "dramgrp" };
2002static const char * const rtcgrps[] = { "rtcgrp" };
2003static const char * const powergrps[] = { "powergrp" };
2004static const char * const cirgrps[] = { "cirgrp" };
2005static const char * const systemgrps[] = { "systemgrp" };
2006static const char * const vcontrolgrps[] = { "vcontrolgrp" };
2007static const char * const icegrps[] = { "icegrp" };
2008static const char * const idegrps[] = { "idegrp" };
2009static const char * const satagrps[] = { "satagrp" };
2010static const char * const usbgrps[] = { "usbgrp" };
2011static const char * const gmiigrps[] = { "gmiigrp" };
2012static const char * const pcigrps[] = { "pcigrp" };
2013static const char * const lpcgrps[] = { "lpcgrp" };
2014static const char * const lcdgrps[] = { "lcdgrp" };
2015static const char * const sspgrps[] = { "sspgrp" };
2016static const char * const uartgrps[] = { "uartrxtxgrp", "uartmodemgrp" };
2017static const char * const tvcgrps[] = { "tvcgrp" };
2018static const char * const nflashgrps[] = { "nflashgrp" };
2019static const char * const pflashgrps[] = { "pflashgrp", "pflashextgrp" };
2020static const char * const sflashgrps[] = { "sflashgrp" };
2021static const char * const gpio0grps[] = { "gpio0agrp", "gpio0bgrp", "gpio0cgrp",
2022 "gpio0dgrp", "gpio0egrp", "gpio0fgrp",
2023 "gpio0ggrp", "gpio0hgrp", "gpio0igrp",
2024 "gpio0jgrp", "gpio0kgrp" };
2025static const char * const gpio1grps[] = { "gpio1agrp", "gpio1bgrp", "gpio1cgrp",
2026 "gpio1dgrp" };
2027static const char * const gpio2grps[] = { "gpio2agrp", "gpio2bgrp", "gpio2cgrp" };
2028
2029static const struct gemini_pmx_func gemini_pmx_functions[] = {
2030 {
2031 .name = "dram",
2032 .groups = dramgrps,
2033 .num_groups = ARRAY_SIZE(idegrps),
2034 },
2035 {
2036 .name = "rtc",
2037 .groups = rtcgrps,
2038 .num_groups = ARRAY_SIZE(rtcgrps),
2039 },
2040 {
2041 .name = "power",
2042 .groups = powergrps,
2043 .num_groups = ARRAY_SIZE(powergrps),
2044 },
2045 {
2046 /* This function is strictly unavailable on 3512 */
2047 .name = "cir",
2048 .groups = cirgrps,
2049 .num_groups = ARRAY_SIZE(cirgrps),
2050 },
2051 {
2052 .name = "system",
2053 .groups = systemgrps,
2054 .num_groups = ARRAY_SIZE(systemgrps),
2055 },
2056 {
2057 .name = "vcontrol",
2058 .groups = vcontrolgrps,
2059 .num_groups = ARRAY_SIZE(vcontrolgrps),
2060 },
2061 {
2062 .name = "ice",
2063 .groups = icegrps,
2064 .num_groups = ARRAY_SIZE(icegrps),
2065 },
2066 {
2067 .name = "ide",
2068 .groups = idegrps,
2069 .num_groups = ARRAY_SIZE(idegrps),
2070 },
2071 {
2072 .name = "sata",
2073 .groups = satagrps,
2074 .num_groups = ARRAY_SIZE(satagrps),
2075 },
2076 {
2077 .name = "pci",
2078 .groups = pcigrps,
2079 .num_groups = ARRAY_SIZE(pcigrps),
2080 },
2081 {
2082 .name = "lpc",
2083 .groups = lpcgrps,
2084 .num_groups = ARRAY_SIZE(lpcgrps),
2085 },
2086 {
2087 .name = "lcd",
2088 .groups = lcdgrps,
2089 .num_groups = ARRAY_SIZE(lcdgrps),
2090 },
2091 {
2092 .name = "ssp",
2093 .groups = sspgrps,
2094 .num_groups = ARRAY_SIZE(sspgrps),
2095 },
2096 {
2097 .name = "uart",
2098 .groups = uartgrps,
2099 .num_groups = ARRAY_SIZE(uartgrps),
2100 },
2101 {
2102 .name = "tvc",
2103 .groups = tvcgrps,
2104 .num_groups = ARRAY_SIZE(tvcgrps),
2105 },
2106 {
2107 .name = "nflash",
2108 .groups = nflashgrps,
2109 .num_groups = ARRAY_SIZE(nflashgrps),
2110 },
2111 {
2112 .name = "pflash",
2113 .groups = pflashgrps,
2114 .num_groups = ARRAY_SIZE(pflashgrps),
2115 },
2116 {
2117 .name = "sflash",
2118 .groups = sflashgrps,
2119 .num_groups = ARRAY_SIZE(sflashgrps),
2120 },
2121 {
2122 .name = "gpio0",
2123 .groups = gpio0grps,
2124 .num_groups = ARRAY_SIZE(gpio0grps),
2125 },
2126 {
2127 .name = "gpio1",
2128 .groups = gpio1grps,
2129 .num_groups = ARRAY_SIZE(gpio1grps),
2130 },
2131 {
2132 .name = "gpio2",
2133 .groups = gpio2grps,
2134 .num_groups = ARRAY_SIZE(gpio2grps),
2135 },
2136};
2137
2138
2139static int gemini_pmx_set_mux(struct pinctrl_dev *pctldev,
2140 unsigned int selector,
2141 unsigned int group)
2142{
2143 struct gemini_pmx *pmx;
2144 const struct gemini_pmx_func *func;
2145 const struct gemini_pin_group *grp;
2146 u32 before, after, expected;
2147 unsigned long tmp;
2148 int i;
2149
2150 pmx = pinctrl_dev_get_drvdata(pctldev);
2151
2152 func = &gemini_pmx_functions[selector];
2153 if (pmx->is_3512)
2154 grp = &gemini_3512_pin_groups[group];
2155 else if (pmx->is_3516)
2156 grp = &gemini_3516_pin_groups[group];
2157 else {
2158 dev_err(pmx->dev, "invalid SoC type\n");
2159 return -ENODEV;
2160 }
2161
2162 dev_info(pmx->dev,
2163 "ACTIVATE function \"%s\" with group \"%s\"\n",
2164 func->name, grp->name);
2165
2166 regmap_read(pmx->map, GLOBAL_MISC_CTRL, &before);
2167 regmap_update_bits(pmx->map, GLOBAL_MISC_CTRL, grp->mask,
2168 grp->value);
2169 regmap_read(pmx->map, GLOBAL_MISC_CTRL, &after);
2170
2171 /* Which bits changed */
2172 before &= PADS_MASK;
2173 after &= PADS_MASK;
2174 expected = before &= ~grp->mask;
2175 expected |= grp->value;
2176 expected &= PADS_MASK;
2177
2178 /* Print changed states */
2179 tmp = grp->mask;
2180 for_each_set_bit(i, &tmp, PADS_MAXBIT) {
2181 bool enabled = !(i > 3);
2182
2183 /* Did not go low though it should */
2184 if (after & BIT(i)) {
2185 dev_err(pmx->dev,
2186 "pin group %s could not be %s: "
2187 "probably a hardware limitation\n",
2188 gemini_padgroups[i],
2189 enabled ? "enabled" : "disabled");
2190 dev_err(pmx->dev,
2191 "GLOBAL MISC CTRL before: %08x, after %08x, expected %08x\n",
2192 before, after, expected);
2193 } else {
2194 dev_info(pmx->dev,
2195 "padgroup %s %s\n",
2196 gemini_padgroups[i],
2197 enabled ? "enabled" : "disabled");
2198 }
2199 }
2200
2201 tmp = grp->value;
2202 for_each_set_bit(i, &tmp, PADS_MAXBIT) {
2203 bool enabled = (i > 3);
2204
2205 /* Did not go high though it should */
2206 if (!(after & BIT(i))) {
2207 dev_err(pmx->dev,
2208 "pin group %s could not be %s: "
2209 "probably a hardware limitation\n",
2210 gemini_padgroups[i],
2211 enabled ? "enabled" : "disabled");
2212 dev_err(pmx->dev,
2213 "GLOBAL MISC CTRL before: %08x, after %08x, expected %08x\n",
2214 before, after, expected);
2215 } else {
2216 dev_info(pmx->dev,
2217 "padgroup %s %s\n",
2218 gemini_padgroups[i],
2219 enabled ? "enabled" : "disabled");
2220 }
2221 }
2222
2223 return 0;
2224}
2225
2226static int gemini_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
2227{
2228 return ARRAY_SIZE(gemini_pmx_functions);
2229}
2230
2231static const char *gemini_pmx_get_func_name(struct pinctrl_dev *pctldev,
2232 unsigned int selector)
2233{
2234 return gemini_pmx_functions[selector].name;
2235}
2236
2237static int gemini_pmx_get_groups(struct pinctrl_dev *pctldev,
2238 unsigned int selector,
2239 const char * const **groups,
2240 unsigned int * const num_groups)
2241{
2242 *groups = gemini_pmx_functions[selector].groups;
2243 *num_groups = gemini_pmx_functions[selector].num_groups;
2244 return 0;
2245}
2246
2247static const struct pinmux_ops gemini_pmx_ops = {
2248 .get_functions_count = gemini_pmx_get_funcs_count,
2249 .get_function_name = gemini_pmx_get_func_name,
2250 .get_function_groups = gemini_pmx_get_groups,
2251 .set_mux = gemini_pmx_set_mux,
2252};
2253
2254static struct pinctrl_desc gemini_pmx_desc = {
2255 .name = DRIVER_NAME,
2256 .pctlops = &gemini_pctrl_ops,
2257 .pmxops = &gemini_pmx_ops,
2258 .owner = THIS_MODULE,
2259};
2260
2261static int gemini_pmx_probe(struct platform_device *pdev)
2262{
2263 struct gemini_pmx *pmx;
2264 struct regmap *map;
2265 struct device *dev = &pdev->dev;
2266 struct device *parent;
2267 unsigned long tmp;
2268 u32 val;
2269 int ret;
2270 int i;
2271
2272 /* Create state holders etc for this driver */
2273 pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
2274 if (!pmx)
2275 return -ENOMEM;
2276
2277 pmx->dev = &pdev->dev;
2278 parent = dev->parent;
2279 if (!parent) {
2280 dev_err(dev, "no parent to pin controller\n");
2281 return -ENODEV;
2282 }
2283 map = syscon_node_to_regmap(parent->of_node);
2284 if (IS_ERR(map)) {
2285 dev_err(dev, "no syscon regmap\n");
2286 return PTR_ERR(map);
2287 }
2288 pmx->map = map;
2289
2290 /* Check that regmap works at first call, then no more */
2291 ret = regmap_read(map, GLOBAL_WORD_ID, &val);
2292 if (ret) {
2293 dev_err(dev, "cannot access regmap\n");
2294 return ret;
2295 }
2296 val >>= 8;
2297 val &= 0xffff;
2298 if (val == 0x3512) {
2299 pmx->is_3512 = true;
2300 gemini_pmx_desc.pins = gemini_3512_pins;
2301 gemini_pmx_desc.npins = ARRAY_SIZE(gemini_3512_pins);
2302 dev_info(dev, "detected 3512 chip variant\n");
2303 } else if (val == 0x3516) {
2304 pmx->is_3516 = true;
2305 gemini_pmx_desc.pins = gemini_3516_pins;
2306 gemini_pmx_desc.npins = ARRAY_SIZE(gemini_3516_pins);
2307 dev_info(dev, "detected 3516 chip variant\n");
2308 } else {
2309 dev_err(dev, "unknown chip ID: %04x\n", val);
2310 return -ENODEV;
2311 }
2312
2313 ret = regmap_read(map, GLOBAL_MISC_CTRL, &val);
2314 dev_info(dev, "GLOBAL MISC CTRL at boot: 0x%08x\n", val);
2315 /* Mask off relevant pads */
2316 val &= PADS_MASK;
2317 /* Invert the meaning of the DRAM+flash pads */
2318 val ^= 0x0f;
2319 /* Print initial state */
2320 tmp = val;
2321 for_each_set_bit(i, &tmp, PADS_MAXBIT) {
2322 dev_info(dev, "pad group %s %s\n", gemini_padgroups[i],
2323 (val & BIT(i)) ? "enabled" : "disabled");
2324 }
2325
2326 /* Check if flash pin is set */
2327 regmap_read(map, GLOBAL_STATUS, &val);
2328 pmx->flash_pin = !!(val & GLOBAL_STATUS_FLPIN);
2329 dev_info(dev, "flash pin is %s\n", pmx->flash_pin ? "set" : "not set");
2330
2331 pmx->pctl = devm_pinctrl_register(dev, &gemini_pmx_desc, pmx);
2332 if (IS_ERR(pmx->pctl)) {
2333 dev_err(dev, "could not register pinmux driver\n");
2334 return PTR_ERR(pmx->pctl);
2335 }
2336
2337 dev_info(dev, "initialized Gemini pin control driver\n");
2338
2339 return 0;
2340}
2341
2342static const struct of_device_id gemini_pinctrl_match[] = {
2343 { .compatible = "cortina,gemini-pinctrl" },
2344 {},
2345};
2346
2347static struct platform_driver gemini_pmx_driver = {
2348 .driver = {
2349 .name = DRIVER_NAME,
2350 .of_match_table = gemini_pinctrl_match,
2351 },
2352 .probe = gemini_pmx_probe,
2353};
2354
2355static int __init gemini_pmx_init(void)
2356{
2357 return platform_driver_register(&gemini_pmx_driver);
2358}
2359arch_initcall(gemini_pmx_init);
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index d8e8842967d6..d84761822243 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -460,7 +460,7 @@ static inline bool ingenic_get_pin_config(struct ingenic_pinctrl *jzpc,
460 return val & BIT(idx); 460 return val & BIT(idx);
461} 461}
462 462
463static struct pinctrl_ops ingenic_pctlops = { 463static const struct pinctrl_ops ingenic_pctlops = {
464 .get_groups_count = pinctrl_generic_get_group_count, 464 .get_groups_count = pinctrl_generic_get_group_count,
465 .get_group_name = pinctrl_generic_get_group_name, 465 .get_group_name = pinctrl_generic_get_group_name,
466 .get_group_pins = pinctrl_generic_get_group_pins, 466 .get_group_pins = pinctrl_generic_get_group_pins,
@@ -543,7 +543,7 @@ static int ingenic_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
543 return 0; 543 return 0;
544} 544}
545 545
546static struct pinmux_ops ingenic_pmxops = { 546static const struct pinmux_ops ingenic_pmxops = {
547 .get_functions_count = pinmux_generic_get_function_count, 547 .get_functions_count = pinmux_generic_get_function_count,
548 .get_function_name = pinmux_generic_get_function_name, 548 .get_function_name = pinmux_generic_get_function_name,
549 .get_function_groups = pinmux_generic_get_function_groups, 549 .get_function_groups = pinmux_generic_get_function_groups,
@@ -696,7 +696,7 @@ static int ingenic_pinconf_group_set(struct pinctrl_dev *pctldev,
696 return 0; 696 return 0;
697} 697}
698 698
699static struct pinconf_ops ingenic_confops = { 699static const struct pinconf_ops ingenic_confops = {
700 .is_generic = true, 700 .is_generic = true,
701 .pin_config_get = ingenic_pinconf_get, 701 .pin_config_get = ingenic_pinconf_get,
702 .pin_config_set = ingenic_pinconf_set, 702 .pin_config_set = ingenic_pinconf_set,
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index e831647c56a6..b5cb7858ffdc 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -62,6 +62,7 @@ enum rockchip_pinctrl_type {
62 RV1108, 62 RV1108,
63 RK2928, 63 RK2928,
64 RK3066B, 64 RK3066B,
65 RK3128,
65 RK3188, 66 RK3188,
66 RK3288, 67 RK3288,
67 RK3368, 68 RK3368,
@@ -76,7 +77,6 @@ enum rockchip_pinctrl_type {
76#define IOMUX_SOURCE_PMU BIT(2) 77#define IOMUX_SOURCE_PMU BIT(2)
77#define IOMUX_UNROUTED BIT(3) 78#define IOMUX_UNROUTED BIT(3)
78#define IOMUX_WIDTH_3BIT BIT(4) 79#define IOMUX_WIDTH_3BIT BIT(4)
79#define IOMUX_RECALCED BIT(5)
80 80
81/** 81/**
82 * @type: iomux variant using IOMUX_* constants 82 * @type: iomux variant using IOMUX_* constants
@@ -166,6 +166,7 @@ struct rockchip_pin_bank {
166 struct pinctrl_gpio_range grange; 166 struct pinctrl_gpio_range grange;
167 raw_spinlock_t slock; 167 raw_spinlock_t slock;
168 u32 toggle_edge_mode; 168 u32 toggle_edge_mode;
169 u32 recalced_mask;
169 u32 route_mask; 170 u32 route_mask;
170}; 171};
171 172
@@ -291,6 +292,22 @@ struct rockchip_pin_bank {
291 292
292/** 293/**
293 * struct rockchip_mux_recalced_data: represent a pin iomux data. 294 * struct rockchip_mux_recalced_data: represent a pin iomux data.
295 * @num: bank number.
296 * @pin: pin number.
297 * @bit: index at register.
298 * @reg: register offset.
299 * @mask: mask bit
300 */
301struct rockchip_mux_recalced_data {
302 u8 num;
303 u8 pin;
304 u32 reg;
305 u8 bit;
306 u8 mask;
307};
308
309/**
310 * struct rockchip_mux_recalced_data: represent a pin iomux data.
294 * @bank_num: bank number. 311 * @bank_num: bank number.
295 * @pin: index at register or used to calc index. 312 * @pin: index at register or used to calc index.
296 * @func: the min pin. 313 * @func: the min pin.
@@ -317,6 +334,8 @@ struct rockchip_pin_ctrl {
317 int pmu_mux_offset; 334 int pmu_mux_offset;
318 int grf_drv_offset; 335 int grf_drv_offset;
319 int pmu_drv_offset; 336 int pmu_drv_offset;
337 struct rockchip_mux_recalced_data *iomux_recalced;
338 u32 niomux_recalced;
320 struct rockchip_mux_route_data *iomux_routes; 339 struct rockchip_mux_route_data *iomux_routes;
321 u32 niomux_routes; 340 u32 niomux_routes;
322 341
@@ -326,8 +345,6 @@ struct rockchip_pin_ctrl {
326 void (*drv_calc_reg)(struct rockchip_pin_bank *bank, 345 void (*drv_calc_reg)(struct rockchip_pin_bank *bank,
327 int pin_num, struct regmap **regmap, 346 int pin_num, struct regmap **regmap,
328 int *reg, u8 *bit); 347 int *reg, u8 *bit);
329 void (*iomux_recalc)(u8 bank_num, int pin, int *reg,
330 u8 *bit, int *mask);
331 int (*schmitt_calc_reg)(struct rockchip_pin_bank *bank, 348 int (*schmitt_calc_reg)(struct rockchip_pin_bank *bank,
332 int pin_num, struct regmap **regmap, 349 int pin_num, struct regmap **regmap,
333 int *reg, u8 *bit); 350 int *reg, u8 *bit);
@@ -382,22 +399,6 @@ struct rockchip_pinctrl {
382 unsigned int nfunctions; 399 unsigned int nfunctions;
383}; 400};
384 401
385/**
386 * struct rockchip_mux_recalced_data: represent a pin iomux data.
387 * @num: bank number.
388 * @pin: pin number.
389 * @bit: index at register.
390 * @reg: register offset.
391 * @mask: mask bit
392 */
393struct rockchip_mux_recalced_data {
394 u8 num;
395 u8 pin;
396 u8 reg;
397 u8 bit;
398 u8 mask;
399};
400
401static struct regmap_config rockchip_regmap_config = { 402static struct regmap_config rockchip_regmap_config = {
402 .reg_bits = 32, 403 .reg_bits = 32,
403 .val_bits = 32, 404 .val_bits = 32,
@@ -557,7 +558,105 @@ static const struct pinctrl_ops rockchip_pctrl_ops = {
557 * Hardware access 558 * Hardware access
558 */ 559 */
559 560
560static const struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = { 561static struct rockchip_mux_recalced_data rv1108_mux_recalced_data[] = {
562 {
563 .num = 1,
564 .pin = 0,
565 .reg = 0x418,
566 .bit = 0,
567 .mask = 0x3
568 }, {
569 .num = 1,
570 .pin = 1,
571 .reg = 0x418,
572 .bit = 2,
573 .mask = 0x3
574 }, {
575 .num = 1,
576 .pin = 2,
577 .reg = 0x418,
578 .bit = 4,
579 .mask = 0x3
580 }, {
581 .num = 1,
582 .pin = 3,
583 .reg = 0x418,
584 .bit = 6,
585 .mask = 0x3
586 }, {
587 .num = 1,
588 .pin = 4,
589 .reg = 0x418,
590 .bit = 8,
591 .mask = 0x3
592 }, {
593 .num = 1,
594 .pin = 5,
595 .reg = 0x418,
596 .bit = 10,
597 .mask = 0x3
598 }, {
599 .num = 1,
600 .pin = 6,
601 .reg = 0x418,
602 .bit = 12,
603 .mask = 0x3
604 }, {
605 .num = 1,
606 .pin = 7,
607 .reg = 0x418,
608 .bit = 14,
609 .mask = 0x3
610 }, {
611 .num = 1,
612 .pin = 8,
613 .reg = 0x41c,
614 .bit = 0,
615 .mask = 0x3
616 }, {
617 .num = 1,
618 .pin = 9,
619 .reg = 0x41c,
620 .bit = 2,
621 .mask = 0x3
622 },
623};
624
625static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
626 {
627 .num = 2,
628 .pin = 20,
629 .reg = 0xe8,
630 .bit = 0,
631 .mask = 0x7
632 }, {
633 .num = 2,
634 .pin = 21,
635 .reg = 0xe8,
636 .bit = 4,
637 .mask = 0x7
638 }, {
639 .num = 2,
640 .pin = 22,
641 .reg = 0xe8,
642 .bit = 8,
643 .mask = 0x7
644 }, {
645 .num = 2,
646 .pin = 23,
647 .reg = 0xe8,
648 .bit = 12,
649 .mask = 0x7
650 }, {
651 .num = 2,
652 .pin = 24,
653 .reg = 0xd4,
654 .bit = 12,
655 .mask = 0x7
656 },
657};
658
659static struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = {
561 { 660 {
562 .num = 2, 661 .num = 2,
563 .pin = 12, 662 .pin = 12,
@@ -579,20 +678,22 @@ static const struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = {
579 }, 678 },
580}; 679};
581 680
582static void rk3328_recalc_mux(u8 bank_num, int pin, int *reg, 681static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin,
583 u8 *bit, int *mask) 682 int *reg, u8 *bit, int *mask)
584{ 683{
585 const struct rockchip_mux_recalced_data *data = NULL; 684 struct rockchip_pinctrl *info = bank->drvdata;
685 struct rockchip_pin_ctrl *ctrl = info->ctrl;
686 struct rockchip_mux_recalced_data *data;
586 int i; 687 int i;
587 688
588 for (i = 0; i < ARRAY_SIZE(rk3328_mux_recalced_data); i++) 689 for (i = 0; i < ctrl->niomux_recalced; i++) {
589 if (rk3328_mux_recalced_data[i].num == bank_num && 690 data = &ctrl->iomux_recalced[i];
590 rk3328_mux_recalced_data[i].pin == pin) { 691 if (data->num == bank->bank_num &&
591 data = &rk3328_mux_recalced_data[i]; 692 data->pin == pin)
592 break; 693 break;
593 } 694 }
594 695
595 if (!data) 696 if (i >= ctrl->niomux_recalced)
596 return; 697 return;
597 698
598 *reg = data->reg; 699 *reg = data->reg;
@@ -600,6 +701,59 @@ static void rk3328_recalc_mux(u8 bank_num, int pin, int *reg,
600 *bit = data->bit; 701 *bit = data->bit;
601} 702}
602 703
704static struct rockchip_mux_route_data rk3128_mux_route_data[] = {
705 {
706 /* spi-0 */
707 .bank_num = 1,
708 .pin = 10,
709 .func = 1,
710 .route_offset = 0x144,
711 .route_val = BIT(16 + 3) | BIT(16 + 4),
712 }, {
713 /* spi-1 */
714 .bank_num = 1,
715 .pin = 27,
716 .func = 3,
717 .route_offset = 0x144,
718 .route_val = BIT(16 + 3) | BIT(16 + 4) | BIT(3),
719 }, {
720 /* spi-2 */
721 .bank_num = 0,
722 .pin = 13,
723 .func = 2,
724 .route_offset = 0x144,
725 .route_val = BIT(16 + 3) | BIT(16 + 4) | BIT(4),
726 }, {
727 /* i2s-0 */
728 .bank_num = 1,
729 .pin = 5,
730 .func = 1,
731 .route_offset = 0x144,
732 .route_val = BIT(16 + 5),
733 }, {
734 /* i2s-1 */
735 .bank_num = 0,
736 .pin = 14,
737 .func = 1,
738 .route_offset = 0x144,
739 .route_val = BIT(16 + 5) | BIT(5),
740 }, {
741 /* emmc-0 */
742 .bank_num = 1,
743 .pin = 22,
744 .func = 2,
745 .route_offset = 0x144,
746 .route_val = BIT(16 + 6),
747 }, {
748 /* emmc-1 */
749 .bank_num = 2,
750 .pin = 4,
751 .func = 2,
752 .route_offset = 0x144,
753 .route_val = BIT(16 + 6) | BIT(6),
754 },
755};
756
603static struct rockchip_mux_route_data rk3228_mux_route_data[] = { 757static struct rockchip_mux_route_data rk3228_mux_route_data[] = {
604 { 758 {
605 /* pwm0-0 */ 759 /* pwm0-0 */
@@ -877,7 +1031,6 @@ static bool rockchip_get_mux_route(struct rockchip_pin_bank *bank, int pin,
877static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin) 1031static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin)
878{ 1032{
879 struct rockchip_pinctrl *info = bank->drvdata; 1033 struct rockchip_pinctrl *info = bank->drvdata;
880 struct rockchip_pin_ctrl *ctrl = info->ctrl;
881 int iomux_num = (pin / 8); 1034 int iomux_num = (pin / 8);
882 struct regmap *regmap; 1035 struct regmap *regmap;
883 unsigned int val; 1036 unsigned int val;
@@ -916,8 +1069,8 @@ static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin)
916 mask = 0x3; 1069 mask = 0x3;
917 } 1070 }
918 1071
919 if (ctrl->iomux_recalc && (mux_type & IOMUX_RECALCED)) 1072 if (bank->recalced_mask & BIT(pin))
920 ctrl->iomux_recalc(bank->bank_num, pin, &reg, &bit, &mask); 1073 rockchip_get_recalced_mux(bank, pin, &reg, &bit, &mask);
921 1074
922 ret = regmap_read(regmap, reg, &val); 1075 ret = regmap_read(regmap, reg, &val);
923 if (ret) 1076 if (ret)
@@ -967,7 +1120,6 @@ static int rockchip_verify_mux(struct rockchip_pin_bank *bank,
967static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) 1120static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)
968{ 1121{
969 struct rockchip_pinctrl *info = bank->drvdata; 1122 struct rockchip_pinctrl *info = bank->drvdata;
970 struct rockchip_pin_ctrl *ctrl = info->ctrl;
971 int iomux_num = (pin / 8); 1123 int iomux_num = (pin / 8);
972 struct regmap *regmap; 1124 struct regmap *regmap;
973 int reg, ret, mask, mux_type; 1125 int reg, ret, mask, mux_type;
@@ -1005,8 +1157,8 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)
1005 mask = 0x3; 1157 mask = 0x3;
1006 } 1158 }
1007 1159
1008 if (ctrl->iomux_recalc && (mux_type & IOMUX_RECALCED)) 1160 if (bank->recalced_mask & BIT(pin))
1009 ctrl->iomux_recalc(bank->bank_num, pin, &reg, &bit, &mask); 1161 rockchip_get_recalced_mux(bank, pin, &reg, &bit, &mask);
1010 1162
1011 if (bank->route_mask & BIT(pin)) { 1163 if (bank->route_mask & BIT(pin)) {
1012 if (rockchip_get_mux_route(bank, pin, mux, &route_reg, 1164 if (rockchip_get_mux_route(bank, pin, mux, &route_reg,
@@ -1084,6 +1236,36 @@ static void rv1108_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank,
1084 *bit *= RV1108_DRV_BITS_PER_PIN; 1236 *bit *= RV1108_DRV_BITS_PER_PIN;
1085} 1237}
1086 1238
1239#define RV1108_SCHMITT_PMU_OFFSET 0x30
1240#define RV1108_SCHMITT_GRF_OFFSET 0x388
1241#define RV1108_SCHMITT_BANK_STRIDE 8
1242#define RV1108_SCHMITT_PINS_PER_GRF_REG 16
1243#define RV1108_SCHMITT_PINS_PER_PMU_REG 8
1244
1245static int rv1108_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
1246 int pin_num,
1247 struct regmap **regmap,
1248 int *reg, u8 *bit)
1249{
1250 struct rockchip_pinctrl *info = bank->drvdata;
1251 int pins_per_reg;
1252
1253 if (bank->bank_num == 0) {
1254 *regmap = info->regmap_pmu;
1255 *reg = RV1108_SCHMITT_PMU_OFFSET;
1256 pins_per_reg = RV1108_SCHMITT_PINS_PER_PMU_REG;
1257 } else {
1258 *regmap = info->regmap_base;
1259 *reg = RV1108_SCHMITT_GRF_OFFSET;
1260 pins_per_reg = RV1108_SCHMITT_PINS_PER_GRF_REG;
1261 *reg += (bank->bank_num - 1) * RV1108_SCHMITT_BANK_STRIDE;
1262 }
1263 *reg += ((pin_num / pins_per_reg) * 4);
1264 *bit = pin_num % pins_per_reg;
1265
1266 return 0;
1267}
1268
1087#define RK2928_PULL_OFFSET 0x118 1269#define RK2928_PULL_OFFSET 0x118
1088#define RK2928_PULL_PINS_PER_REG 16 1270#define RK2928_PULL_PINS_PER_REG 16
1089#define RK2928_PULL_BANK_STRIDE 8 1271#define RK2928_PULL_BANK_STRIDE 8
@@ -1102,6 +1284,22 @@ static void rk2928_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank,
1102 *bit = pin_num % RK2928_PULL_PINS_PER_REG; 1284 *bit = pin_num % RK2928_PULL_PINS_PER_REG;
1103}; 1285};
1104 1286
1287#define RK3128_PULL_OFFSET 0x118
1288
1289static void rk3128_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank,
1290 int pin_num, struct regmap **regmap,
1291 int *reg, u8 *bit)
1292{
1293 struct rockchip_pinctrl *info = bank->drvdata;
1294
1295 *regmap = info->regmap_base;
1296 *reg = RK3128_PULL_OFFSET;
1297 *reg += bank->bank_num * RK2928_PULL_BANK_STRIDE;
1298 *reg += ((pin_num / RK2928_PULL_PINS_PER_REG) * 4);
1299
1300 *bit = pin_num % RK2928_PULL_PINS_PER_REG;
1301}
1302
1105#define RK3188_PULL_OFFSET 0x164 1303#define RK3188_PULL_OFFSET 0x164
1106#define RK3188_PULL_BITS_PER_PIN 2 1304#define RK3188_PULL_BITS_PER_PIN 2
1107#define RK3188_PULL_PINS_PER_REG 8 1305#define RK3188_PULL_PINS_PER_REG 8
@@ -1571,6 +1769,7 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
1571 1769
1572 switch (ctrl->type) { 1770 switch (ctrl->type) {
1573 case RK2928: 1771 case RK2928:
1772 case RK3128:
1574 return !(data & BIT(bit)) 1773 return !(data & BIT(bit))
1575 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT 1774 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT
1576 : PIN_CONFIG_BIAS_DISABLE; 1775 : PIN_CONFIG_BIAS_DISABLE;
@@ -1611,6 +1810,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
1611 1810
1612 switch (ctrl->type) { 1811 switch (ctrl->type) {
1613 case RK2928: 1812 case RK2928:
1813 case RK3128:
1614 data = BIT(bit + 16); 1814 data = BIT(bit + 16);
1615 if (pull == PIN_CONFIG_BIAS_DISABLE) 1815 if (pull == PIN_CONFIG_BIAS_DISABLE)
1616 data |= BIT(bit); 1816 data |= BIT(bit);
@@ -1865,6 +2065,7 @@ static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl,
1865{ 2065{
1866 switch (ctrl->type) { 2066 switch (ctrl->type) {
1867 case RK2928: 2067 case RK2928:
2068 case RK3128:
1868 return (pull == PIN_CONFIG_BIAS_PULL_PIN_DEFAULT || 2069 return (pull == PIN_CONFIG_BIAS_PULL_PIN_DEFAULT ||
1869 pull == PIN_CONFIG_BIAS_DISABLE); 2070 pull == PIN_CONFIG_BIAS_DISABLE);
1870 case RK3066B: 2071 case RK3066B:
@@ -2853,6 +3054,16 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
2853 bank_pins += 8; 3054 bank_pins += 8;
2854 } 3055 }
2855 3056
3057 /* calculate the per-bank recalced_mask */
3058 for (j = 0; j < ctrl->niomux_recalced; j++) {
3059 int pin = 0;
3060
3061 if (ctrl->iomux_recalced[j].num == bank->bank_num) {
3062 pin = ctrl->iomux_recalced[j].pin;
3063 bank->recalced_mask |= BIT(pin);
3064 }
3065 }
3066
2856 /* calculate the per-bank route_mask */ 3067 /* calculate the per-bank route_mask */
2857 for (j = 0; j < ctrl->niomux_routes; j++) { 3068 for (j = 0; j < ctrl->niomux_routes; j++) {
2858 int pin = 0; 3069 int pin = 0;
@@ -3015,8 +3226,11 @@ static struct rockchip_pin_ctrl rv1108_pin_ctrl = {
3015 .type = RV1108, 3226 .type = RV1108,
3016 .grf_mux_offset = 0x10, 3227 .grf_mux_offset = 0x10,
3017 .pmu_mux_offset = 0x0, 3228 .pmu_mux_offset = 0x0,
3229 .iomux_recalced = rv1108_mux_recalced_data,
3230 .niomux_recalced = ARRAY_SIZE(rv1108_mux_recalced_data),
3018 .pull_calc_reg = rv1108_calc_pull_reg_and_bit, 3231 .pull_calc_reg = rv1108_calc_pull_reg_and_bit,
3019 .drv_calc_reg = rv1108_calc_drv_reg_and_bit, 3232 .drv_calc_reg = rv1108_calc_drv_reg_and_bit,
3233 .schmitt_calc_reg = rv1108_calc_schmitt_reg_and_bit,
3020}; 3234};
3021 3235
3022static struct rockchip_pin_bank rk2928_pin_banks[] = { 3236static struct rockchip_pin_bank rk2928_pin_banks[] = {
@@ -3083,6 +3297,26 @@ static struct rockchip_pin_ctrl rk3066b_pin_ctrl = {
3083 .grf_mux_offset = 0x60, 3297 .grf_mux_offset = 0x60,
3084}; 3298};
3085 3299
3300static struct rockchip_pin_bank rk3128_pin_banks[] = {
3301 PIN_BANK(0, 32, "gpio0"),
3302 PIN_BANK(1, 32, "gpio1"),
3303 PIN_BANK(2, 32, "gpio2"),
3304 PIN_BANK(3, 32, "gpio3"),
3305};
3306
3307static struct rockchip_pin_ctrl rk3128_pin_ctrl = {
3308 .pin_banks = rk3128_pin_banks,
3309 .nr_banks = ARRAY_SIZE(rk3128_pin_banks),
3310 .label = "RK3128-GPIO",
3311 .type = RK3128,
3312 .grf_mux_offset = 0xa8,
3313 .iomux_recalced = rk3128_mux_recalced_data,
3314 .niomux_recalced = ARRAY_SIZE(rk3128_mux_recalced_data),
3315 .iomux_routes = rk3128_mux_route_data,
3316 .niomux_routes = ARRAY_SIZE(rk3128_mux_route_data),
3317 .pull_calc_reg = rk3128_calc_pull_reg_and_bit,
3318};
3319
3086static struct rockchip_pin_bank rk3188_pin_banks[] = { 3320static struct rockchip_pin_bank rk3188_pin_banks[] = {
3087 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_GPIO_ONLY, 0, 0, 0), 3321 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_GPIO_ONLY, 0, 0, 0),
3088 PIN_BANK(1, 32, "gpio1"), 3322 PIN_BANK(1, 32, "gpio1"),
@@ -3165,12 +3399,12 @@ static struct rockchip_pin_bank rk3328_pin_banks[] = {
3165 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", 0, 0, 0, 0), 3399 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", 0, 0, 0, 0),
3166 PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", 0, 0, 0, 0), 3400 PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", 0, 0, 0, 0),
3167 PIN_BANK_IOMUX_FLAGS(2, 32, "gpio2", 0, 3401 PIN_BANK_IOMUX_FLAGS(2, 32, "gpio2", 0,
3168 IOMUX_WIDTH_3BIT | IOMUX_RECALCED, 3402 IOMUX_WIDTH_3BIT,
3169 IOMUX_WIDTH_3BIT | IOMUX_RECALCED, 3403 IOMUX_WIDTH_3BIT,
3170 0), 3404 0),
3171 PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3", 3405 PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3",
3172 IOMUX_WIDTH_3BIT, 3406 IOMUX_WIDTH_3BIT,
3173 IOMUX_WIDTH_3BIT | IOMUX_RECALCED, 3407 IOMUX_WIDTH_3BIT,
3174 0, 3408 0,
3175 0), 3409 0),
3176}; 3410};
@@ -3181,11 +3415,12 @@ static struct rockchip_pin_ctrl rk3328_pin_ctrl = {
3181 .label = "RK3328-GPIO", 3415 .label = "RK3328-GPIO",
3182 .type = RK3288, 3416 .type = RK3288,
3183 .grf_mux_offset = 0x0, 3417 .grf_mux_offset = 0x0,
3418 .iomux_recalced = rk3328_mux_recalced_data,
3419 .niomux_recalced = ARRAY_SIZE(rk3328_mux_recalced_data),
3184 .iomux_routes = rk3328_mux_route_data, 3420 .iomux_routes = rk3328_mux_route_data,
3185 .niomux_routes = ARRAY_SIZE(rk3328_mux_route_data), 3421 .niomux_routes = ARRAY_SIZE(rk3328_mux_route_data),
3186 .pull_calc_reg = rk3228_calc_pull_reg_and_bit, 3422 .pull_calc_reg = rk3228_calc_pull_reg_and_bit,
3187 .drv_calc_reg = rk3228_calc_drv_reg_and_bit, 3423 .drv_calc_reg = rk3228_calc_drv_reg_and_bit,
3188 .iomux_recalc = rk3328_recalc_mux,
3189 .schmitt_calc_reg = rk3328_calc_schmitt_reg_and_bit, 3424 .schmitt_calc_reg = rk3328_calc_schmitt_reg_and_bit,
3190}; 3425};
3191 3426
@@ -3290,6 +3525,8 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
3290 .data = &rk3066a_pin_ctrl }, 3525 .data = &rk3066a_pin_ctrl },
3291 { .compatible = "rockchip,rk3066b-pinctrl", 3526 { .compatible = "rockchip,rk3066b-pinctrl",
3292 .data = &rk3066b_pin_ctrl }, 3527 .data = &rk3066b_pin_ctrl },
3528 { .compatible = "rockchip,rk3128-pinctrl",
3529 .data = (void *)&rk3128_pin_ctrl },
3293 { .compatible = "rockchip,rk3188-pinctrl", 3530 { .compatible = "rockchip,rk3188-pinctrl",
3294 .data = &rk3188_pin_ctrl }, 3531 .data = &rk3188_pin_ctrl },
3295 { .compatible = "rockchip,rk3228-pinctrl", 3532 { .compatible = "rockchip,rk3228-pinctrl",
diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
index dc164da10446..04d058706b80 100644
--- a/drivers/pinctrl/pinctrl-rza1.c
+++ b/drivers/pinctrl/pinctrl-rza1.c
@@ -723,7 +723,7 @@ static void rza1_gpio_set(struct gpio_chip *chip, unsigned int gpio,
723 rza1_pin_set(port, gpio, value); 723 rza1_pin_set(port, gpio, value);
724} 724}
725 725
726static struct gpio_chip rza1_gpiochip_template = { 726static const struct gpio_chip rza1_gpiochip_template = {
727 .request = rza1_gpio_request, 727 .request = rza1_gpio_request,
728 .free = rza1_gpio_free, 728 .free = rza1_gpio_free,
729 .get_direction = rza1_gpio_get_direction, 729 .get_direction = rza1_gpio_get_direction,
@@ -1026,7 +1026,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
1026 return 0; 1026 return 0;
1027} 1027}
1028 1028
1029static struct pinmux_ops rza1_pinmux_ops = { 1029static const struct pinmux_ops rza1_pinmux_ops = {
1030 .get_functions_count = pinmux_generic_get_function_count, 1030 .get_functions_count = pinmux_generic_get_function_count,
1031 .get_function_name = pinmux_generic_get_function_name, 1031 .get_function_name = pinmux_generic_get_function_name,
1032 .get_function_groups = pinmux_generic_get_function_groups, 1032 .get_function_groups = pinmux_generic_get_function_groups,
@@ -1088,7 +1088,7 @@ static int rza1_parse_gpiochip(struct rza1_pinctrl *rza1_pctl,
1088 */ 1088 */
1089 pinctrl_base = of_args.args[1]; 1089 pinctrl_base = of_args.args[1];
1090 gpioport = RZA1_PIN_ID_TO_PORT(pinctrl_base); 1090 gpioport = RZA1_PIN_ID_TO_PORT(pinctrl_base);
1091 if (gpioport > RZA1_NPORTS) { 1091 if (gpioport >= RZA1_NPORTS) {
1092 dev_err(rza1_pctl->dev, 1092 dev_err(rza1_pctl->dev,
1093 "Invalid values in property %s\n", list_name); 1093 "Invalid values in property %s\n", list_name);
1094 return -EINVAL; 1094 return -EINVAL;
@@ -1096,8 +1096,8 @@ static int rza1_parse_gpiochip(struct rza1_pinctrl *rza1_pctl,
1096 1096
1097 *chip = rza1_gpiochip_template; 1097 *chip = rza1_gpiochip_template;
1098 chip->base = -1; 1098 chip->base = -1;
1099 chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%s-%u", 1099 chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%s",
1100 np->name, gpioport); 1100 np->name);
1101 chip->ngpio = of_args.args[2]; 1101 chip->ngpio = of_args.args[2];
1102 chip->of_node = np; 1102 chip->of_node = np;
1103 chip->parent = rza1_pctl->dev; 1103 chip->parent = rza1_pctl->dev;
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 3ae8066bc127..a5205b94b2e6 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -861,7 +861,7 @@ static void st_pctl_dt_free_map(struct pinctrl_dev *pctldev,
861{ 861{
862} 862}
863 863
864static struct pinctrl_ops st_pctlops = { 864static const struct pinctrl_ops st_pctlops = {
865 .get_groups_count = st_pctl_get_groups_count, 865 .get_groups_count = st_pctl_get_groups_count,
866 .get_group_pins = st_pctl_get_group_pins, 866 .get_group_pins = st_pctl_get_group_pins,
867 .get_group_name = st_pctl_get_group_name, 867 .get_group_name = st_pctl_get_group_name,
@@ -928,7 +928,7 @@ static int st_pmx_set_gpio_direction(struct pinctrl_dev *pctldev,
928 return 0; 928 return 0;
929} 929}
930 930
931static struct pinmux_ops st_pmxops = { 931static const struct pinmux_ops st_pmxops = {
932 .get_functions_count = st_pmx_get_funcs_count, 932 .get_functions_count = st_pmx_get_funcs_count,
933 .get_function_name = st_pmx_get_fname, 933 .get_function_name = st_pmx_get_fname,
934 .get_function_groups = st_pmx_get_groups, 934 .get_function_groups = st_pmx_get_groups,
@@ -1025,7 +1025,7 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
1025 ST_PINCONF_UNPACK_RT_DELAY(config)); 1025 ST_PINCONF_UNPACK_RT_DELAY(config));
1026} 1026}
1027 1027
1028static struct pinconf_ops st_confops = { 1028static const struct pinconf_ops st_confops = {
1029 .pin_config_get = st_pinconf_get, 1029 .pin_config_get = st_pinconf_get,
1030 .pin_config_set = st_pinconf_set, 1030 .pin_config_set = st_pinconf_set,
1031 .pin_config_dbg_show = st_pinconf_dbg_show, 1031 .pin_config_dbg_show = st_pinconf_dbg_show,
@@ -1442,7 +1442,7 @@ static void st_gpio_irqmux_handler(struct irq_desc *desc)
1442 chained_irq_exit(chip, desc); 1442 chained_irq_exit(chip, desc);
1443} 1443}
1444 1444
1445static struct gpio_chip st_gpio_template = { 1445static const struct gpio_chip st_gpio_template = {
1446 .request = gpiochip_generic_request, 1446 .request = gpiochip_generic_request,
1447 .free = gpiochip_generic_free, 1447 .free = gpiochip_generic_free,
1448 .get = st_gpio_get, 1448 .get = st_gpio_get,
@@ -1521,7 +1521,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
1521 * [irqN]----> [gpio-bank (n)] 1521 * [irqN]----> [gpio-bank (n)]
1522 */ 1522 */
1523 1523
1524 if (of_irq_to_resource(np, 0, &irq_res)) { 1524 if (of_irq_to_resource(np, 0, &irq_res) > 0) {
1525 gpio_irq = irq_res.start; 1525 gpio_irq = irq_res.start;
1526 gpiochip_set_chained_irqchip(&bank->gpio_chip, &st_gpio_irqchip, 1526 gpiochip_set_chained_irqchip(&bank->gpio_chip, &st_gpio_irqchip,
1527 gpio_irq, st_gpio_irq_handler); 1527 gpio_irq, st_gpio_irq_handler);
@@ -1537,7 +1537,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
1537 return err; 1537 return err;
1538 } 1538 }
1539 } else { 1539 } else {
1540 dev_info(dev, "No IRQ support for %s bank\n", np->full_name); 1540 dev_info(dev, "No IRQ support for %pOF bank\n", np);
1541 } 1541 }
1542 1542
1543 return 0; 1543 return 0;
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c
index edfba506e958..2e90a6d8fb3b 100644
--- a/drivers/pinctrl/pinctrl-tb10x.c
+++ b/drivers/pinctrl/pinctrl-tb10x.c
@@ -557,8 +557,8 @@ static int tb10x_dt_node_to_map(struct pinctrl_dev *pctl,
557 int ret = 0; 557 int ret = 0;
558 558
559 if (of_property_read_string(np_config, "abilis,function", &string)) { 559 if (of_property_read_string(np_config, "abilis,function", &string)) {
560 pr_err("%s: No abilis,function property in device tree.\n", 560 pr_err("%pOF: No abilis,function property in device tree.\n",
561 np_config->full_name); 561 np_config);
562 return -EINVAL; 562 return -EINVAL;
563 } 563 }
564 564
@@ -577,7 +577,7 @@ out:
577 return ret; 577 return ret;
578} 578}
579 579
580static struct pinctrl_ops tb10x_pinctrl_ops = { 580static const struct pinctrl_ops tb10x_pinctrl_ops = {
581 .get_groups_count = tb10x_get_groups_count, 581 .get_groups_count = tb10x_get_groups_count,
582 .get_group_name = tb10x_get_group_name, 582 .get_group_name = tb10x_get_group_name,
583 .get_group_pins = tb10x_get_group_pins, 583 .get_group_pins = tb10x_get_group_pins,
@@ -738,7 +738,7 @@ static int tb10x_pctl_set_mux(struct pinctrl_dev *pctl,
738 return 0; 738 return 0;
739} 739}
740 740
741static struct pinmux_ops tb10x_pinmux_ops = { 741static const struct pinmux_ops tb10x_pinmux_ops = {
742 .get_functions_count = tb10x_get_functions_count, 742 .get_functions_count = tb10x_get_functions_count,
743 .get_function_name = tb10x_get_function_name, 743 .get_function_name = tb10x_get_function_name,
744 .get_function_groups = tb10x_get_function_groups, 744 .get_function_groups = tb10x_get_function_groups,
diff --git a/drivers/pinctrl/pinctrl-tz1090-pdc.c b/drivers/pinctrl/pinctrl-tz1090-pdc.c
index e70e36283b3b..5cfa93cecf73 100644
--- a/drivers/pinctrl/pinctrl-tz1090-pdc.c
+++ b/drivers/pinctrl/pinctrl-tz1090-pdc.c
@@ -486,7 +486,7 @@ static int tz1090_pdc_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
486 return 0; 486 return 0;
487} 487}
488 488
489static struct pinctrl_ops tz1090_pdc_pinctrl_ops = { 489static const struct pinctrl_ops tz1090_pdc_pinctrl_ops = {
490 .get_groups_count = tz1090_pdc_pinctrl_get_groups_count, 490 .get_groups_count = tz1090_pdc_pinctrl_get_groups_count,
491 .get_group_name = tz1090_pdc_pinctrl_get_group_name, 491 .get_group_name = tz1090_pdc_pinctrl_get_group_name,
492 .get_group_pins = tz1090_pdc_pinctrl_get_group_pins, 492 .get_group_pins = tz1090_pdc_pinctrl_get_group_pins,
@@ -631,7 +631,7 @@ static void tz1090_pdc_pinctrl_gpio_disable_free(
631 } 631 }
632} 632}
633 633
634static struct pinmux_ops tz1090_pdc_pinmux_ops = { 634static const struct pinmux_ops tz1090_pdc_pinmux_ops = {
635 .get_functions_count = tz1090_pdc_pinctrl_get_funcs_count, 635 .get_functions_count = tz1090_pdc_pinctrl_get_funcs_count,
636 .get_function_name = tz1090_pdc_pinctrl_get_func_name, 636 .get_function_name = tz1090_pdc_pinctrl_get_func_name,
637 .get_function_groups = tz1090_pdc_pinctrl_get_func_groups, 637 .get_function_groups = tz1090_pdc_pinctrl_get_func_groups,
@@ -905,7 +905,7 @@ next_config:
905 return 0; 905 return 0;
906} 906}
907 907
908static struct pinconf_ops tz1090_pdc_pinconf_ops = { 908static const struct pinconf_ops tz1090_pdc_pinconf_ops = {
909 .is_generic = true, 909 .is_generic = true,
910 .pin_config_get = tz1090_pdc_pinconf_get, 910 .pin_config_get = tz1090_pdc_pinconf_get,
911 .pin_config_set = tz1090_pdc_pinconf_set, 911 .pin_config_set = tz1090_pdc_pinconf_set,
diff --git a/drivers/pinctrl/pinctrl-tz1090.c b/drivers/pinctrl/pinctrl-tz1090.c
index 04cbe530bf29..74d1ffcc2199 100644
--- a/drivers/pinctrl/pinctrl-tz1090.c
+++ b/drivers/pinctrl/pinctrl-tz1090.c
@@ -1201,7 +1201,7 @@ static int tz1090_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
1201 return 0; 1201 return 0;
1202} 1202}
1203 1203
1204static struct pinctrl_ops tz1090_pinctrl_ops = { 1204static const struct pinctrl_ops tz1090_pinctrl_ops = {
1205 .get_groups_count = tz1090_pinctrl_get_groups_count, 1205 .get_groups_count = tz1090_pinctrl_get_groups_count,
1206 .get_group_name = tz1090_pinctrl_get_group_name, 1206 .get_group_name = tz1090_pinctrl_get_group_name,
1207 .get_group_pins = tz1090_pinctrl_get_group_pins, 1207 .get_group_pins = tz1090_pinctrl_get_group_pins,
@@ -1513,7 +1513,7 @@ static void tz1090_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
1513 tz1090_pinctrl_gpio_select(pmx, pin, false); 1513 tz1090_pinctrl_gpio_select(pmx, pin, false);
1514} 1514}
1515 1515
1516static struct pinmux_ops tz1090_pinmux_ops = { 1516static const struct pinmux_ops tz1090_pinmux_ops = {
1517 .get_functions_count = tz1090_pinctrl_get_funcs_count, 1517 .get_functions_count = tz1090_pinctrl_get_funcs_count,
1518 .get_function_name = tz1090_pinctrl_get_func_name, 1518 .get_function_name = tz1090_pinctrl_get_func_name,
1519 .get_function_groups = tz1090_pinctrl_get_func_groups, 1519 .get_function_groups = tz1090_pinctrl_get_func_groups,
@@ -1920,7 +1920,7 @@ next_config:
1920 return 0; 1920 return 0;
1921} 1921}
1922 1922
1923static struct pinconf_ops tz1090_pinconf_ops = { 1923static const struct pinconf_ops tz1090_pinconf_ops = {
1924 .is_generic = true, 1924 .is_generic = true,
1925 .pin_config_get = tz1090_pinconf_get, 1925 .pin_config_get = tz1090_pinconf_get,
1926 .pin_config_set = tz1090_pinconf_set, 1926 .pin_config_set = tz1090_pinconf_set,
diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
index b51a46dfdcc3..a0daf27042bd 100644
--- a/drivers/pinctrl/pinctrl-zynq.c
+++ b/drivers/pinctrl/pinctrl-zynq.c
@@ -45,7 +45,7 @@
45 * @syscon: Syscon regmap 45 * @syscon: Syscon regmap
46 * @pctrl_offset: Offset for pinctrl into the @syscon space 46 * @pctrl_offset: Offset for pinctrl into the @syscon space
47 * @groups: Pingroups 47 * @groups: Pingroups
48 * @ngroupos: Number of @groups 48 * @ngroups: Number of @groups
49 * @funcs: Pinmux functions 49 * @funcs: Pinmux functions
50 * @nfuncs: Number of @funcs 50 * @nfuncs: Number of @funcs
51 */ 51 */
@@ -62,7 +62,7 @@ struct zynq_pinctrl {
62struct zynq_pctrl_group { 62struct zynq_pctrl_group {
63 const char *name; 63 const char *name;
64 const unsigned int *pins; 64 const unsigned int *pins;
65 const unsigned npins; 65 const unsigned int npins;
66}; 66};
67 67
68/** 68/**
@@ -841,7 +841,7 @@ static int zynq_pctrl_get_groups_count(struct pinctrl_dev *pctldev)
841} 841}
842 842
843static const char *zynq_pctrl_get_group_name(struct pinctrl_dev *pctldev, 843static const char *zynq_pctrl_get_group_name(struct pinctrl_dev *pctldev,
844 unsigned selector) 844 unsigned int selector)
845{ 845{
846 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 846 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
847 847
@@ -849,9 +849,9 @@ static const char *zynq_pctrl_get_group_name(struct pinctrl_dev *pctldev,
849} 849}
850 850
851static int zynq_pctrl_get_group_pins(struct pinctrl_dev *pctldev, 851static int zynq_pctrl_get_group_pins(struct pinctrl_dev *pctldev,
852 unsigned selector, 852 unsigned int selector,
853 const unsigned **pins, 853 const unsigned int **pins,
854 unsigned *num_pins) 854 unsigned int *num_pins)
855{ 855{
856 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 856 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
857 857
@@ -878,7 +878,7 @@ static int zynq_pmux_get_functions_count(struct pinctrl_dev *pctldev)
878} 878}
879 879
880static const char *zynq_pmux_get_function_name(struct pinctrl_dev *pctldev, 880static const char *zynq_pmux_get_function_name(struct pinctrl_dev *pctldev,
881 unsigned selector) 881 unsigned int selector)
882{ 882{
883 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 883 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
884 884
@@ -886,7 +886,7 @@ static const char *zynq_pmux_get_function_name(struct pinctrl_dev *pctldev,
886} 886}
887 887
888static int zynq_pmux_get_function_groups(struct pinctrl_dev *pctldev, 888static int zynq_pmux_get_function_groups(struct pinctrl_dev *pctldev,
889 unsigned selector, 889 unsigned int selector,
890 const char * const **groups, 890 const char * const **groups,
891 unsigned * const num_groups) 891 unsigned * const num_groups)
892{ 892{
@@ -898,8 +898,8 @@ static int zynq_pmux_get_function_groups(struct pinctrl_dev *pctldev,
898} 898}
899 899
900static int zynq_pinmux_set_mux(struct pinctrl_dev *pctldev, 900static int zynq_pinmux_set_mux(struct pinctrl_dev *pctldev,
901 unsigned function, 901 unsigned int function,
902 unsigned group) 902 unsigned int group)
903{ 903{
904 int i, ret; 904 int i, ret;
905 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 905 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
@@ -986,8 +986,8 @@ static const struct pinconf_generic_params zynq_dt_params[] = {
986}; 986};
987 987
988#ifdef CONFIG_DEBUG_FS 988#ifdef CONFIG_DEBUG_FS
989static const struct pin_config_item zynq_conf_items[ARRAY_SIZE(zynq_dt_params)] = { 989static const struct pin_config_item zynq_conf_items[ARRAY_SIZE(zynq_dt_params)]
990 PCONFDUMP(PIN_CONFIG_IOSTANDARD, "IO-standard", NULL, true), 990 = { PCONFDUMP(PIN_CONFIG_IOSTANDARD, "IO-standard", NULL, true),
991}; 991};
992#endif 992#endif
993 993
@@ -997,7 +997,7 @@ static unsigned int zynq_pinconf_iostd_get(u32 reg)
997} 997}
998 998
999static int zynq_pinconf_cfg_get(struct pinctrl_dev *pctldev, 999static int zynq_pinconf_cfg_get(struct pinctrl_dev *pctldev,
1000 unsigned pin, 1000 unsigned int pin,
1001 unsigned long *config) 1001 unsigned long *config)
1002{ 1002{
1003 u32 reg; 1003 u32 reg;
@@ -1054,9 +1054,9 @@ static int zynq_pinconf_cfg_get(struct pinctrl_dev *pctldev,
1054} 1054}
1055 1055
1056static int zynq_pinconf_cfg_set(struct pinctrl_dev *pctldev, 1056static int zynq_pinconf_cfg_set(struct pinctrl_dev *pctldev,
1057 unsigned pin, 1057 unsigned int pin,
1058 unsigned long *configs, 1058 unsigned long *configs,
1059 unsigned num_configs) 1059 unsigned int num_configs)
1060{ 1060{
1061 int i, ret; 1061 int i, ret;
1062 u32 reg; 1062 u32 reg;
@@ -1130,9 +1130,9 @@ static int zynq_pinconf_cfg_set(struct pinctrl_dev *pctldev,
1130} 1130}
1131 1131
1132static int zynq_pinconf_group_set(struct pinctrl_dev *pctldev, 1132static int zynq_pinconf_group_set(struct pinctrl_dev *pctldev,
1133 unsigned selector, 1133 unsigned int selector,
1134 unsigned long *configs, 1134 unsigned long *configs,
1135 unsigned num_configs) 1135 unsigned int num_configs)
1136{ 1136{
1137 int i, ret; 1137 int i, ret;
1138 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 1138 struct zynq_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 16b3ae5e4f44..55502fc4479c 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -61,7 +61,7 @@ int pinmux_check_ops(struct pinctrl_dev *pctldev)
61 return 0; 61 return 0;
62} 62}
63 63
64int pinmux_validate_map(struct pinctrl_map const *map, int i) 64int pinmux_validate_map(const struct pinctrl_map *map, int i)
65{ 65{
66 if (!map->data.mux.function) { 66 if (!map->data.mux.function) {
67 pr_err("failed to register map %s (%d): no function given\n", 67 pr_err("failed to register map %s (%d): no function given\n",
@@ -312,7 +312,7 @@ static int pinmux_func_name_to_selector(struct pinctrl_dev *pctldev,
312 return -EINVAL; 312 return -EINVAL;
313} 313}
314 314
315int pinmux_map_to_setting(struct pinctrl_map const *map, 315int pinmux_map_to_setting(const struct pinctrl_map *map,
316 struct pinctrl_setting *setting) 316 struct pinctrl_setting *setting)
317{ 317{
318 struct pinctrl_dev *pctldev = setting->pctldev; 318 struct pinctrl_dev *pctldev = setting->pctldev;
@@ -372,12 +372,12 @@ int pinmux_map_to_setting(struct pinctrl_map const *map,
372 return 0; 372 return 0;
373} 373}
374 374
375void pinmux_free_setting(struct pinctrl_setting const *setting) 375void pinmux_free_setting(const struct pinctrl_setting *setting)
376{ 376{
377 /* This function is currently unused */ 377 /* This function is currently unused */
378} 378}
379 379
380int pinmux_enable_setting(struct pinctrl_setting const *setting) 380int pinmux_enable_setting(const struct pinctrl_setting *setting)
381{ 381{
382 struct pinctrl_dev *pctldev = setting->pctldev; 382 struct pinctrl_dev *pctldev = setting->pctldev;
383 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; 383 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
@@ -458,7 +458,7 @@ err_pin_request:
458 return ret; 458 return ret;
459} 459}
460 460
461void pinmux_disable_setting(struct pinctrl_setting const *setting) 461void pinmux_disable_setting(const struct pinctrl_setting *setting)
462{ 462{
463 struct pinctrl_dev *pctldev = setting->pctldev; 463 struct pinctrl_dev *pctldev = setting->pctldev;
464 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; 464 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
@@ -627,7 +627,7 @@ static int pinmux_pins_show(struct seq_file *s, void *what)
627 return 0; 627 return 0;
628} 628}
629 629
630void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map) 630void pinmux_show_map(struct seq_file *s, const struct pinctrl_map *map)
631{ 631{
632 seq_printf(s, "group %s\nfunction %s\n", 632 seq_printf(s, "group %s\nfunction %s\n",
633 map->data.mux.group ? map->data.mux.group : "(default)", 633 map->data.mux.group ? map->data.mux.group : "(default)",
@@ -635,7 +635,7 @@ void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map)
635} 635}
636 636
637void pinmux_show_setting(struct seq_file *s, 637void pinmux_show_setting(struct seq_file *s,
638 struct pinctrl_setting const *setting) 638 const struct pinctrl_setting *setting)
639{ 639{
640 struct pinctrl_dev *pctldev = setting->pctldev; 640 struct pinctrl_dev *pctldev = setting->pctldev;
641 const struct pinmux_ops *pmxops = pctldev->desc->pmxops; 641 const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
@@ -833,7 +833,7 @@ EXPORT_SYMBOL_GPL(pinmux_generic_remove_function);
833void pinmux_generic_free_functions(struct pinctrl_dev *pctldev) 833void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)
834{ 834{
835 struct radix_tree_iter iter; 835 struct radix_tree_iter iter;
836 void **slot; 836 void __rcu **slot;
837 837
838 radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0) 838 radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0)
839 radix_tree_delete(&pctldev->pin_function_tree, iter.index); 839 radix_tree_delete(&pctldev->pin_function_tree, iter.index);
diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h
index 248d8ea30e26..a331fcdbedd9 100644
--- a/drivers/pinctrl/pinmux.h
+++ b/drivers/pinctrl/pinmux.h
@@ -14,7 +14,7 @@
14 14
15int pinmux_check_ops(struct pinctrl_dev *pctldev); 15int pinmux_check_ops(struct pinctrl_dev *pctldev);
16 16
17int pinmux_validate_map(struct pinctrl_map const *map, int i); 17int pinmux_validate_map(const struct pinctrl_map *map, int i);
18 18
19int pinmux_request_gpio(struct pinctrl_dev *pctldev, 19int pinmux_request_gpio(struct pinctrl_dev *pctldev,
20 struct pinctrl_gpio_range *range, 20 struct pinctrl_gpio_range *range,
@@ -25,11 +25,11 @@ int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
25 struct pinctrl_gpio_range *range, 25 struct pinctrl_gpio_range *range,
26 unsigned pin, bool input); 26 unsigned pin, bool input);
27 27
28int pinmux_map_to_setting(struct pinctrl_map const *map, 28int pinmux_map_to_setting(const struct pinctrl_map *map,
29 struct pinctrl_setting *setting); 29 struct pinctrl_setting *setting);
30void pinmux_free_setting(struct pinctrl_setting const *setting); 30void pinmux_free_setting(const struct pinctrl_setting *setting);
31int pinmux_enable_setting(struct pinctrl_setting const *setting); 31int pinmux_enable_setting(const struct pinctrl_setting *setting);
32void pinmux_disable_setting(struct pinctrl_setting const *setting); 32void pinmux_disable_setting(const struct pinctrl_setting *setting);
33 33
34#else 34#else
35 35
@@ -38,7 +38,7 @@ static inline int pinmux_check_ops(struct pinctrl_dev *pctldev)
38 return 0; 38 return 0;
39} 39}
40 40
41static inline int pinmux_validate_map(struct pinctrl_map const *map, int i) 41static inline int pinmux_validate_map(const struct pinctrl_map *map, int i)
42{ 42{
43 return 0; 43 return 0;
44} 44}
@@ -63,23 +63,22 @@ static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
63 return 0; 63 return 0;
64} 64}
65 65
66static inline int pinmux_map_to_setting(struct pinctrl_map const *map, 66static inline int pinmux_map_to_setting(const struct pinctrl_map *map,
67 struct pinctrl_setting *setting) 67 struct pinctrl_setting *setting)
68{ 68{
69 return 0; 69 return 0;
70} 70}
71 71
72static inline void pinmux_free_setting(struct pinctrl_setting const *setting) 72static inline void pinmux_free_setting(const struct pinctrl_setting *setting)
73{ 73{
74} 74}
75 75
76static inline int pinmux_enable_setting(struct pinctrl_setting const *setting) 76static inline int pinmux_enable_setting(const struct pinctrl_setting *setting)
77{ 77{
78 return 0; 78 return 0;
79} 79}
80 80
81static inline void pinmux_disable_setting( 81static inline void pinmux_disable_setting(const struct pinctrl_setting *setting)
82 struct pinctrl_setting const *setting)
83{ 82{
84} 83}
85 84
@@ -87,21 +86,21 @@ static inline void pinmux_disable_setting(
87 86
88#if defined(CONFIG_PINMUX) && defined(CONFIG_DEBUG_FS) 87#if defined(CONFIG_PINMUX) && defined(CONFIG_DEBUG_FS)
89 88
90void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map); 89void pinmux_show_map(struct seq_file *s, const struct pinctrl_map *map);
91void pinmux_show_setting(struct seq_file *s, 90void pinmux_show_setting(struct seq_file *s,
92 struct pinctrl_setting const *setting); 91 const struct pinctrl_setting *setting);
93void pinmux_init_device_debugfs(struct dentry *devroot, 92void pinmux_init_device_debugfs(struct dentry *devroot,
94 struct pinctrl_dev *pctldev); 93 struct pinctrl_dev *pctldev);
95 94
96#else 95#else
97 96
98static inline void pinmux_show_map(struct seq_file *s, 97static inline void pinmux_show_map(struct seq_file *s,
99 struct pinctrl_map const *map) 98 const struct pinctrl_map *map)
100{ 99{
101} 100}
102 101
103static inline void pinmux_show_setting(struct seq_file *s, 102static inline void pinmux_show_setting(struct seq_file *s,
104 struct pinctrl_setting const *setting) 103 const struct pinctrl_setting *setting)
105{ 104{
106} 105}
107 106
diff --git a/drivers/pinctrl/qcom/pinctrl-apq8064.c b/drivers/pinctrl/qcom/pinctrl-apq8064.c
index cd96699b1929..bcf9e615ff61 100644
--- a/drivers/pinctrl/qcom/pinctrl-apq8064.c
+++ b/drivers/pinctrl/qcom/pinctrl-apq8064.c
@@ -295,6 +295,12 @@ enum apq8064_functions {
295 APQ_MUX_cam_mclk, 295 APQ_MUX_cam_mclk,
296 APQ_MUX_codec_mic_i2s, 296 APQ_MUX_codec_mic_i2s,
297 APQ_MUX_codec_spkr_i2s, 297 APQ_MUX_codec_spkr_i2s,
298 APQ_MUX_gp_clk_0a,
299 APQ_MUX_gp_clk_0b,
300 APQ_MUX_gp_clk_1a,
301 APQ_MUX_gp_clk_1b,
302 APQ_MUX_gp_clk_2a,
303 APQ_MUX_gp_clk_2b,
298 APQ_MUX_gpio, 304 APQ_MUX_gpio,
299 APQ_MUX_gsbi1, 305 APQ_MUX_gsbi1,
300 APQ_MUX_gsbi2, 306 APQ_MUX_gsbi2,
@@ -354,6 +360,24 @@ static const char * const gpio_groups[] = {
354 "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 360 "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
355 "gpio85", "gpio86", "gpio87", "gpio88", "gpio89" 361 "gpio85", "gpio86", "gpio87", "gpio88", "gpio89"
356}; 362};
363static const char * const gp_clk_0a_groups[] = {
364 "gpio3"
365};
366static const char * const gp_clk_0b_groups[] = {
367 "gpio34"
368};
369static const char * const gp_clk_1a_groups[] = {
370 "gpio4"
371};
372static const char * const gp_clk_1b_groups[] = {
373 "gpio50"
374};
375static const char * const gp_clk_2a_groups[] = {
376 "gpio32"
377};
378static const char * const gp_clk_2b_groups[] = {
379 "gpio25"
380};
357static const char * const ps_hold_groups[] = { 381static const char * const ps_hold_groups[] = {
358 "gpio78" 382 "gpio78"
359}; 383};
@@ -452,6 +476,12 @@ static const struct msm_function apq8064_functions[] = {
452 FUNCTION(cam_mclk), 476 FUNCTION(cam_mclk),
453 FUNCTION(codec_mic_i2s), 477 FUNCTION(codec_mic_i2s),
454 FUNCTION(codec_spkr_i2s), 478 FUNCTION(codec_spkr_i2s),
479 FUNCTION(gp_clk_0a),
480 FUNCTION(gp_clk_0b),
481 FUNCTION(gp_clk_1a),
482 FUNCTION(gp_clk_1b),
483 FUNCTION(gp_clk_2a),
484 FUNCTION(gp_clk_2b),
455 FUNCTION(gpio), 485 FUNCTION(gpio),
456 FUNCTION(gsbi1), 486 FUNCTION(gsbi1),
457 FUNCTION(gsbi2), 487 FUNCTION(gsbi2),
@@ -490,8 +520,8 @@ static const struct msm_pingroup apq8064_groups[] = {
490 PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 520 PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
491 PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 521 PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
492 PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 522 PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
493 PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 523 PINGROUP(3, NA, gp_clk_0a, NA, NA, NA, NA, NA, NA, NA, NA),
494 PINGROUP(4, NA, NA, cam_mclk, NA, NA, NA, NA, NA, NA, NA), 524 PINGROUP(4, NA, NA, cam_mclk, gp_clk_1a, NA, NA, NA, NA, NA, NA),
495 PINGROUP(5, NA, cam_mclk, NA, NA, NA, NA, NA, NA, NA, NA), 525 PINGROUP(5, NA, cam_mclk, NA, NA, NA, NA, NA, NA, NA, NA),
496 PINGROUP(6, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA), 526 PINGROUP(6, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA),
497 PINGROUP(7, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA), 527 PINGROUP(7, gsbi3, NA, NA, NA, NA, NA, NA, NA, NA, NA),
@@ -512,16 +542,16 @@ static const struct msm_pingroup apq8064_groups[] = {
512 PINGROUP(22, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA), 542 PINGROUP(22, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
513 PINGROUP(23, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA), 543 PINGROUP(23, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
514 PINGROUP(24, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA), 544 PINGROUP(24, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA),
515 PINGROUP(25, gsbi2, NA, NA, NA, NA, NA, NA, NA, NA, NA), 545 PINGROUP(25, gsbi2, gp_clk_2b, NA, NA, NA, NA, NA, NA, NA, NA),
516 PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 546 PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
517 PINGROUP(27, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 547 PINGROUP(27, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
518 PINGROUP(28, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 548 PINGROUP(28, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
519 PINGROUP(29, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 549 PINGROUP(29, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
520 PINGROUP(30, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 550 PINGROUP(30, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
521 PINGROUP(31, mi2s, NA, gsbi5_spi_cs2, gsbi6_spi_cs2, gsbi7_spi_cs2, NA, NA, NA, NA, NA), 551 PINGROUP(31, mi2s, NA, gsbi5_spi_cs2, gsbi6_spi_cs2, gsbi7_spi_cs2, NA, NA, NA, NA, NA),
522 PINGROUP(32, mi2s, NA, NA, NA, NA, gsbi5_spi_cs3, gsbi6_spi_cs3, gsbi7_spi_cs3, NA, NA), 552 PINGROUP(32, mi2s, gp_clk_2a, NA, NA, NA, gsbi5_spi_cs3, gsbi6_spi_cs3, gsbi7_spi_cs3, NA, NA),
523 PINGROUP(33, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 553 PINGROUP(33, mi2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
524 PINGROUP(34, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 554 PINGROUP(34, codec_mic_i2s, gp_clk_0b, NA, NA, NA, NA, NA, NA, NA, NA),
525 PINGROUP(35, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 555 PINGROUP(35, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
526 PINGROUP(36, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 556 PINGROUP(36, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
527 PINGROUP(37, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 557 PINGROUP(37, codec_mic_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
@@ -537,7 +567,7 @@ static const struct msm_pingroup apq8064_groups[] = {
537 PINGROUP(47, spkr_i2s, gsbi5_spi_cs1, gsbi6_spi_cs1, gsbi7_spi_cs1, NA, NA, NA, NA, NA, NA), 567 PINGROUP(47, spkr_i2s, gsbi5_spi_cs1, gsbi6_spi_cs1, gsbi7_spi_cs1, NA, NA, NA, NA, NA, NA),
538 PINGROUP(48, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 568 PINGROUP(48, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
539 PINGROUP(49, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 569 PINGROUP(49, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA),
540 PINGROUP(50, spkr_i2s, NA, NA, NA, NA, NA, NA, NA, NA, NA), 570 PINGROUP(50, spkr_i2s, gp_clk_1b, NA, NA, NA, NA, NA, NA, NA, NA),
541 PINGROUP(51, NA, gsbi5, NA, NA, NA, NA, NA, NA, NA, NA), 571 PINGROUP(51, NA, gsbi5, NA, NA, NA, NA, NA, NA, NA, NA),
542 PINGROUP(52, NA, gsbi5, NA, NA, NA, NA, NA, NA, NA, NA), 572 PINGROUP(52, NA, gsbi5, NA, NA, NA, NA, NA, NA, NA, NA),
543 PINGROUP(53, NA, gsbi5, NA, NA, NA, NA, NA, NA, NA, NA), 573 PINGROUP(53, NA, gsbi5, NA, NA, NA, NA, NA, NA, NA, NA),
diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c b/drivers/pinctrl/qcom/pinctrl-ipq4019.c
index 743d1f458205..1979b14b6fc3 100644
--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c
+++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c
@@ -277,12 +277,49 @@ DECLARE_QCA_GPIO_PINS(99);
277 277
278enum ipq4019_functions { 278enum ipq4019_functions {
279 qca_mux_gpio, 279 qca_mux_gpio,
280 qca_mux_blsp_uart1, 280 qca_mux_aud_pin,
281 qca_mux_audio_pwm,
281 qca_mux_blsp_i2c0, 282 qca_mux_blsp_i2c0,
282 qca_mux_blsp_i2c1, 283 qca_mux_blsp_i2c1,
283 qca_mux_blsp_uart0,
284 qca_mux_blsp_spi1,
285 qca_mux_blsp_spi0, 284 qca_mux_blsp_spi0,
285 qca_mux_blsp_spi1,
286 qca_mux_blsp_uart0,
287 qca_mux_blsp_uart1,
288 qca_mux_chip_rst,
289 qca_mux_i2s_rx,
290 qca_mux_i2s_spdif_in,
291 qca_mux_i2s_spdif_out,
292 qca_mux_i2s_td,
293 qca_mux_i2s_tx,
294 qca_mux_jtag,
295 qca_mux_led0,
296 qca_mux_led1,
297 qca_mux_led2,
298 qca_mux_led3,
299 qca_mux_led4,
300 qca_mux_led5,
301 qca_mux_led6,
302 qca_mux_led7,
303 qca_mux_led8,
304 qca_mux_led9,
305 qca_mux_led10,
306 qca_mux_led11,
307 qca_mux_mdc,
308 qca_mux_mdio,
309 qca_mux_pcie,
310 qca_mux_pmu,
311 qca_mux_prng_rosc,
312 qca_mux_qpic,
313 qca_mux_rgmii,
314 qca_mux_rmii,
315 qca_mux_sdio,
316 qca_mux_smart0,
317 qca_mux_smart1,
318 qca_mux_smart2,
319 qca_mux_smart3,
320 qca_mux_tm,
321 qca_mux_wifi0,
322 qca_mux_wifi1,
286 qca_mux_NA, 323 qca_mux_NA,
287}; 324};
288 325
@@ -303,108 +340,331 @@ static const char * const gpio_groups[] = {
303 "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 340 "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
304 "gpio99", 341 "gpio99",
305}; 342};
306 343static const char * const aud_pin_groups[] = {
307static const char * const blsp_uart1_groups[] = { 344 "gpio48", "gpio49", "gpio50", "gpio51",
308 "gpio8", "gpio9", "gpio10", "gpio11", 345};
346static const char * const audio_pwm_groups[] = {
347 "gpio30", "gpio31", "gpio32", "gpio33", "gpio64", "gpio65", "gpio66",
348 "gpio67",
309}; 349};
310static const char * const blsp_i2c0_groups[] = { 350static const char * const blsp_i2c0_groups[] = {
311 "gpio10", "gpio11", "gpio20", "gpio21", "gpio58", "gpio59", 351 "gpio10", "gpio11", "gpio20", "gpio21", "gpio58", "gpio59",
312}; 352};
313static const char * const blsp_spi0_groups[] = {
314 "gpio12", "gpio13", "gpio14", "gpio15", "gpio45",
315 "gpio54", "gpio55", "gpio56", "gpio57",
316};
317static const char * const blsp_i2c1_groups[] = { 353static const char * const blsp_i2c1_groups[] = {
318 "gpio12", "gpio13", "gpio34", "gpio35", 354 "gpio12", "gpio13", "gpio34", "gpio35",
319}; 355};
320static const char * const blsp_uart0_groups[] = { 356static const char * const blsp_spi0_groups[] = {
321 "gpio16", "gpio17", "gpio60", "gpio61", 357 "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", "gpio54", "gpio55",
358 "gpio56", "gpio57",
322}; 359};
323static const char * const blsp_spi1_groups[] = { 360static const char * const blsp_spi1_groups[] = {
324 "gpio44", "gpio45", "gpio46", "gpio47", 361 "gpio44", "gpio45", "gpio46", "gpio47",
325}; 362};
363static const char * const blsp_uart0_groups[] = {
364 "gpio16", "gpio17", "gpio60", "gpio61",
365};
366static const char * const blsp_uart1_groups[] = {
367 "gpio8", "gpio9", "gpio10", "gpio11",
368};
369static const char * const chip_rst_groups[] = {
370 "gpio62",
371};
372static const char * const i2s_rx_groups[] = {
373 "gpio0", "gpio1", "gpio2", "gpio20", "gpio21", "gpio22", "gpio23",
374 "gpio58", "gpio60", "gpio61", "gpio63",
375};
376static const char * const i2s_spdif_in_groups[] = {
377 "gpio34", "gpio59", "gpio63",
378};
379static const char * const i2s_spdif_out_groups[] = {
380 "gpio35", "gpio62", "gpio63",
381};
382static const char * const i2s_td_groups[] = {
383 "gpio27", "gpio28", "gpio29", "gpio54", "gpio55", "gpio56", "gpio63",
384};
385static const char * const i2s_tx_groups[] = {
386 "gpio24", "gpio25", "gpio26", "gpio52", "gpio53", "gpio57", "gpio60",
387 "gpio61",
388};
389static const char * const jtag_groups[] = {
390 "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5",
391};
392static const char * const led0_groups[] = {
393 "gpio16", "gpio36", "gpio60",
394};
395static const char * const led1_groups[] = {
396 "gpio17", "gpio37", "gpio61",
397};
398static const char * const led2_groups[] = {
399 "gpio36", "gpio38", "gpio58",
400};
401static const char * const led3_groups[] = {
402 "gpio39",
403};
404static const char * const led4_groups[] = {
405 "gpio40",
406};
407static const char * const led5_groups[] = {
408 "gpio44",
409};
410static const char * const led6_groups[] = {
411 "gpio45",
412};
413static const char * const led7_groups[] = {
414 "gpio46",
415};
416static const char * const led8_groups[] = {
417 "gpio47",
418};
419static const char * const led9_groups[] = {
420 "gpio48",
421};
422static const char * const led10_groups[] = {
423 "gpio49",
424};
425static const char * const led11_groups[] = {
426 "gpio50",
427};
428static const char * const mdc_groups[] = {
429 "gpio7", "gpio52",
430};
431static const char * const mdio_groups[] = {
432 "gpio6", "gpio53",
433};
434static const char * const pcie_groups[] = {
435 "gpio39", "gpio52",
436};
437static const char * const pmu_groups[] = {
438 "gpio54", "gpio55",
439};
440static const char * const prng_rosc_groups[] = {
441 "gpio53",
442};
443static const char * const qpic_groups[] = {
444 "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58",
445 "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65",
446 "gpio66", "gpio67", "gpio68", "gpio69",
447};
448static const char * const rgmii_groups[] = {
449 "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
450 "gpio29", "gpio30", "gpio31", "gpio32", "gpio33",
451};
452static const char * const rmii_groups[] = {
453 "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
454 "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
455 "gpio50", "gpio51",
456};
457static const char * const sdio_groups[] = {
458 "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29",
459 "gpio30", "gpio31", "gpio32",
460};
461static const char * const smart0_groups[] = {
462 "gpio0", "gpio1", "gpio2", "gpio5", "gpio44", "gpio45", "gpio46",
463 "gpio47",
464};
465static const char * const smart1_groups[] = {
466 "gpio8", "gpio9", "gpio16", "gpio17", "gpio58", "gpio59", "gpio60",
467 "gpio61",
468};
469static const char * const smart2_groups[] = {
470 "gpio40", "gpio41", "gpio48", "gpio49",
471};
472static const char * const smart3_groups[] = {
473 "gpio58", "gpio59", "gpio60", "gpio61",
474};
475static const char * const tm_groups[] = {
476 "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58",
477 "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
478};
479static const char * const wifi0_groups[] = {
480 "gpio37", "gpio40", "gpio41", "gpio42", "gpio50", "gpio51", "gpio52",
481 "gpio53", "gpio56", "gpio57", "gpio58", "gpio98",
482};
483static const char * const wifi1_groups[] = {
484 "gpio37", "gpio40", "gpio41", "gpio43", "gpio50", "gpio51", "gpio52",
485 "gpio53", "gpio56", "gpio57", "gpio58", "gpio98",
486};
326 487
327static const struct msm_function ipq4019_functions[] = { 488static const struct msm_function ipq4019_functions[] = {
328 FUNCTION(gpio), 489 FUNCTION(aud_pin),
329 FUNCTION(blsp_uart1), 490 FUNCTION(audio_pwm),
330 FUNCTION(blsp_i2c0), 491 FUNCTION(blsp_i2c0),
331 FUNCTION(blsp_i2c1), 492 FUNCTION(blsp_i2c1),
332 FUNCTION(blsp_uart0),
333 FUNCTION(blsp_spi1),
334 FUNCTION(blsp_spi0), 493 FUNCTION(blsp_spi0),
494 FUNCTION(blsp_spi1),
495 FUNCTION(blsp_uart0),
496 FUNCTION(blsp_uart1),
497 FUNCTION(chip_rst),
498 FUNCTION(gpio),
499 FUNCTION(i2s_rx),
500 FUNCTION(i2s_spdif_in),
501 FUNCTION(i2s_spdif_out),
502 FUNCTION(i2s_td),
503 FUNCTION(i2s_tx),
504 FUNCTION(jtag),
505 FUNCTION(led0),
506 FUNCTION(led1),
507 FUNCTION(led2),
508 FUNCTION(led3),
509 FUNCTION(led4),
510 FUNCTION(led5),
511 FUNCTION(led6),
512 FUNCTION(led7),
513 FUNCTION(led8),
514 FUNCTION(led9),
515 FUNCTION(led10),
516 FUNCTION(led11),
517 FUNCTION(mdc),
518 FUNCTION(mdio),
519 FUNCTION(pcie),
520 FUNCTION(pmu),
521 FUNCTION(prng_rosc),
522 FUNCTION(qpic),
523 FUNCTION(rgmii),
524 FUNCTION(rmii),
525 FUNCTION(sdio),
526 FUNCTION(smart0),
527 FUNCTION(smart1),
528 FUNCTION(smart2),
529 FUNCTION(smart3),
530 FUNCTION(tm),
531 FUNCTION(wifi0),
532 FUNCTION(wifi1),
335}; 533};
336 534
337static const struct msm_pingroup ipq4019_groups[] = { 535static const struct msm_pingroup ipq4019_groups[] = {
338 PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 536 PINGROUP(0, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
339 PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 537 NA, NA),
340 PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 538 PINGROUP(1, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
341 PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 539 NA, NA),
342 PINGROUP(4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 540 PINGROUP(2, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
343 PINGROUP(5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 541 NA, NA),
344 PINGROUP(6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 542 PINGROUP(3, jtag, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
345 PINGROUP(7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 543 PINGROUP(4, jtag, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
346 PINGROUP(8, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 544 PINGROUP(5, jtag, smart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
347 PINGROUP(9, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 545 NA),
348 PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 546 PINGROUP(6, mdio, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
349 PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 547 PINGROUP(7, mdc, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
350 PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 548 PINGROUP(8, blsp_uart1, NA, NA, smart1, NA, NA, NA, NA, NA, NA, NA,
351 PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 549 NA, NA, NA),
352 PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 550 PINGROUP(9, blsp_uart1, NA, NA, smart1, NA, NA, NA, NA, NA, NA, NA,
353 PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 551 NA, NA, NA),
354 PINGROUP(16, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 552 PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA,
355 PINGROUP(17, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 553 NA, NA, NA),
554 PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA,
555 NA, NA, NA),
556 PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA,
557 NA, NA, NA),
558 PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA,
559 NA, NA, NA),
560 PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
561 NA),
562 PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
563 NA),
564 PINGROUP(16, blsp_uart0, led0, smart1, NA, NA, NA, NA, NA, NA, NA, NA,
565 NA, NA, NA),
566 PINGROUP(17, blsp_uart0, led1, smart1, NA, NA, NA, NA, NA, NA, NA, NA,
567 NA, NA, NA),
356 PINGROUP(18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 568 PINGROUP(18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
357 PINGROUP(19, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 569 PINGROUP(19, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
358 PINGROUP(20, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 570 PINGROUP(20, blsp_i2c0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
359 PINGROUP(21, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 571 NA, NA),
360 PINGROUP(22, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 572 PINGROUP(21, blsp_i2c0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
361 PINGROUP(23, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 573 NA, NA),
362 PINGROUP(24, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 574 PINGROUP(22, rgmii, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
363 PINGROUP(25, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 575 NA),
364 PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 576 PINGROUP(23, sdio, rgmii, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
365 PINGROUP(27, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 577 NA, NA),
366 PINGROUP(28, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 578 PINGROUP(24, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
367 PINGROUP(29, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 579 NA, NA),
368 PINGROUP(30, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 580 PINGROUP(25, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
369 PINGROUP(31, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 581 NA, NA),
370 PINGROUP(32, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 582 PINGROUP(26, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA,
371 PINGROUP(33, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 583 NA, NA),
372 PINGROUP(34, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 584 PINGROUP(27, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA,
373 PINGROUP(35, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 585 NA, NA),
374 PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 586 PINGROUP(28, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA,
375 PINGROUP(37, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 587 NA, NA),
376 PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 588 PINGROUP(29, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA,
377 PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 589 NA, NA),
378 PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 590 PINGROUP(30, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA,
379 PINGROUP(41, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 591 NA, NA, NA),
380 PINGROUP(42, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 592 PINGROUP(31, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA,
381 PINGROUP(43, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 593 NA, NA, NA),
382 PINGROUP(44, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 594 PINGROUP(32, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA,
383 PINGROUP(45, NA, blsp_spi1, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 595 NA, NA, NA),
384 PINGROUP(46, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 596 PINGROUP(33, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
385 PINGROUP(47, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 597 NA, NA),
386 PINGROUP(48, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 598 PINGROUP(34, blsp_i2c1, i2s_spdif_in, NA, NA, NA, NA, NA, NA, NA, NA,
387 PINGROUP(49, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 599 NA, NA, NA, NA),
388 PINGROUP(50, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 600 PINGROUP(35, blsp_i2c1, i2s_spdif_out, NA, NA, NA, NA, NA, NA, NA, NA,
389 PINGROUP(51, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 601 NA, NA, NA, NA),
390 PINGROUP(52, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 602 PINGROUP(36, rmii, led2, led0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
391 PINGROUP(53, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 603 NA),
392 PINGROUP(54, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 604 PINGROUP(37, rmii, wifi0, wifi1, led1, NA, NA, NA, NA, NA, NA, NA, NA,
393 PINGROUP(55, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 605 NA, NA),
394 PINGROUP(56, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 606 PINGROUP(38, rmii, led2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
395 PINGROUP(57, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 607 NA),
396 PINGROUP(58, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 608 PINGROUP(39, rmii, pcie, led3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
397 PINGROUP(59, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 609 NA),
398 PINGROUP(60, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 610 PINGROUP(40, rmii, wifi0, wifi1, smart2, led4, NA, NA, NA, NA, NA, NA,
399 PINGROUP(61, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 611 NA, NA, NA),
400 PINGROUP(62, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 612 PINGROUP(41, rmii, wifi0, wifi1, smart2, NA, NA, NA, NA, NA, NA, NA,
401 PINGROUP(63, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 613 NA, NA, NA),
402 PINGROUP(64, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 614 PINGROUP(42, rmii, wifi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
403 PINGROUP(65, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 615 NA),
404 PINGROUP(66, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 616 PINGROUP(43, rmii, wifi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
405 PINGROUP(67, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 617 NA),
406 PINGROUP(68, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 618 PINGROUP(44, rmii, blsp_spi1, smart0, led5, NA, NA, NA, NA, NA, NA, NA,
407 PINGROUP(69, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 619 NA, NA, NA),
620 PINGROUP(45, rmii, blsp_spi1, blsp_spi0, smart0, led6, NA, NA, NA, NA,
621 NA, NA, NA, NA, NA),
622 PINGROUP(46, rmii, blsp_spi1, smart0, led7, NA, NA, NA, NA, NA, NA, NA,
623 NA, NA, NA),
624 PINGROUP(47, rmii, blsp_spi1, smart0, led8, NA, NA, NA, NA, NA, NA, NA,
625 NA, NA, NA),
626 PINGROUP(48, rmii, aud_pin, smart2, led9, NA, NA, NA, NA, NA, NA, NA,
627 NA, NA, NA),
628 PINGROUP(49, rmii, aud_pin, smart2, led10, NA, NA, NA, NA, NA, NA, NA,
629 NA, NA, NA),
630 PINGROUP(50, rmii, aud_pin, wifi0, wifi1, led11, NA, NA, NA, NA, NA,
631 NA, NA, NA, NA),
632 PINGROUP(51, rmii, aud_pin, wifi0, wifi1, NA, NA, NA, NA, NA, NA, NA,
633 NA, NA, NA),
634 PINGROUP(52, qpic, mdc, pcie, i2s_tx, NA, NA, NA, tm, wifi0, wifi1, NA,
635 NA, NA, NA),
636 PINGROUP(53, qpic, mdio, i2s_tx, prng_rosc, NA, tm, wifi0, wifi1, NA,
637 NA, NA, NA, NA, NA),
638 PINGROUP(54, qpic, blsp_spi0, i2s_td, NA, pmu, NA, NA, NA, tm, NA, NA,
639 NA, NA, NA),
640 PINGROUP(55, qpic, blsp_spi0, i2s_td, NA, pmu, NA, NA, NA, tm, NA, NA,
641 NA, NA, NA),
642 PINGROUP(56, qpic, blsp_spi0, i2s_td, NA, NA, tm, wifi0, wifi1, NA, NA,
643 NA, NA, NA, NA),
644 PINGROUP(57, qpic, blsp_spi0, i2s_tx, NA, NA, tm, wifi0, wifi1, NA, NA,
645 NA, NA, NA, NA),
646 PINGROUP(58, qpic, led2, blsp_i2c0, smart3, smart1, i2s_rx, NA, NA, tm,
647 wifi0, wifi1, NA, NA, NA),
648 PINGROUP(59, qpic, blsp_i2c0, smart3, smart1, i2s_spdif_in, NA, NA, NA,
649 NA, NA, tm, NA, NA, NA),
650 PINGROUP(60, qpic, blsp_uart0, smart1, smart3, led0, i2s_tx, i2s_rx,
651 NA, NA, NA, NA, NA, tm, NA),
652 PINGROUP(61, qpic, blsp_uart0, smart1, smart3, led1, i2s_tx, i2s_rx,
653 NA, NA, NA, NA, NA, tm, NA),
654 PINGROUP(62, qpic, chip_rst, NA, NA, i2s_spdif_out, NA, NA, NA, NA, NA,
655 tm, NA, NA, NA),
656 PINGROUP(63, qpic, NA, NA, NA, i2s_td, i2s_rx, i2s_spdif_out,
657 i2s_spdif_in, NA, NA, NA, NA, tm, NA),
658 PINGROUP(64, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
659 NA, NA),
660 PINGROUP(65, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
661 NA, NA),
662 PINGROUP(66, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
663 NA, NA),
664 PINGROUP(67, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
665 NA, NA),
666 PINGROUP(68, qpic, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
667 PINGROUP(69, qpic, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
408 PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 668 PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
409 PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 669 PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
410 PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 670 PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
@@ -433,7 +693,8 @@ static const struct msm_pingroup ipq4019_groups[] = {
433 PINGROUP(95, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 693 PINGROUP(95, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
434 PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 694 PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
435 PINGROUP(97, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 695 PINGROUP(97, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
436 PINGROUP(98, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 696 PINGROUP(98, wifi0, wifi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
697 NA),
437 PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 698 PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA),
438}; 699};
439 700
@@ -445,6 +706,7 @@ static const struct msm_pinctrl_soc_data ipq4019_pinctrl = {
445 .groups = ipq4019_groups, 706 .groups = ipq4019_groups,
446 .ngroups = ARRAY_SIZE(ipq4019_groups), 707 .ngroups = ARRAY_SIZE(ipq4019_groups),
447 .ngpios = 100, 708 .ngpios = 100,
709 .pull_no_keeper = true,
448}; 710};
449 711
450static int ipq4019_pinctrl_probe(struct platform_device *pdev) 712static int ipq4019_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 273badd92561..ff491da64dab 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -202,10 +202,11 @@ static int msm_config_reg(struct msm_pinctrl *pctrl,
202 return 0; 202 return 0;
203} 203}
204 204
205#define MSM_NO_PULL 0 205#define MSM_NO_PULL 0
206#define MSM_PULL_DOWN 1 206#define MSM_PULL_DOWN 1
207#define MSM_KEEPER 2 207#define MSM_KEEPER 2
208#define MSM_PULL_UP 3 208#define MSM_PULL_UP_NO_KEEPER 2
209#define MSM_PULL_UP 3
209 210
210static unsigned msm_regval_to_drive(u32 val) 211static unsigned msm_regval_to_drive(u32 val)
211{ 212{
@@ -243,10 +244,16 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev,
243 arg = arg == MSM_PULL_DOWN; 244 arg = arg == MSM_PULL_DOWN;
244 break; 245 break;
245 case PIN_CONFIG_BIAS_BUS_HOLD: 246 case PIN_CONFIG_BIAS_BUS_HOLD:
247 if (pctrl->soc->pull_no_keeper)
248 return -ENOTSUPP;
249
246 arg = arg == MSM_KEEPER; 250 arg = arg == MSM_KEEPER;
247 break; 251 break;
248 case PIN_CONFIG_BIAS_PULL_UP: 252 case PIN_CONFIG_BIAS_PULL_UP:
249 arg = arg == MSM_PULL_UP; 253 if (pctrl->soc->pull_no_keeper)
254 arg = arg == MSM_PULL_UP_NO_KEEPER;
255 else
256 arg = arg == MSM_PULL_UP;
250 break; 257 break;
251 case PIN_CONFIG_DRIVE_STRENGTH: 258 case PIN_CONFIG_DRIVE_STRENGTH:
252 arg = msm_regval_to_drive(arg); 259 arg = msm_regval_to_drive(arg);
@@ -309,10 +316,16 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
309 arg = MSM_PULL_DOWN; 316 arg = MSM_PULL_DOWN;
310 break; 317 break;
311 case PIN_CONFIG_BIAS_BUS_HOLD: 318 case PIN_CONFIG_BIAS_BUS_HOLD:
319 if (pctrl->soc->pull_no_keeper)
320 return -ENOTSUPP;
321
312 arg = MSM_KEEPER; 322 arg = MSM_KEEPER;
313 break; 323 break;
314 case PIN_CONFIG_BIAS_PULL_UP: 324 case PIN_CONFIG_BIAS_PULL_UP:
315 arg = MSM_PULL_UP; 325 if (pctrl->soc->pull_no_keeper)
326 arg = MSM_PULL_UP_NO_KEEPER;
327 else
328 arg = MSM_PULL_UP;
316 break; 329 break;
317 case PIN_CONFIG_DRIVE_STRENGTH: 330 case PIN_CONFIG_DRIVE_STRENGTH:
318 /* Check for invalid values */ 331 /* Check for invalid values */
@@ -521,7 +534,7 @@ static void msm_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
521#define msm_gpio_dbg_show NULL 534#define msm_gpio_dbg_show NULL
522#endif 535#endif
523 536
524static struct gpio_chip msm_gpio_template = { 537static const struct gpio_chip msm_gpio_template = {
525 .direction_input = msm_gpio_direction_input, 538 .direction_input = msm_gpio_direction_input,
526 .direction_output = msm_gpio_direction_output, 539 .direction_output = msm_gpio_direction_output,
527 .get_direction = msm_gpio_get_direction, 540 .get_direction = msm_gpio_get_direction,
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinctrl-msm.h
index 54fdd04ce9d5..9b9feea540ff 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.h
+++ b/drivers/pinctrl/qcom/pinctrl-msm.h
@@ -99,13 +99,14 @@ struct msm_pingroup {
99 99
100/** 100/**
101 * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration 101 * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration
102 * @pins: An array describing all pins the pin controller affects. 102 * @pins: An array describing all pins the pin controller affects.
103 * @npins: The number of entries in @pins. 103 * @npins: The number of entries in @pins.
104 * @functions: An array describing all mux functions the SoC supports. 104 * @functions: An array describing all mux functions the SoC supports.
105 * @nfunctions: The number of entries in @functions. 105 * @nfunctions: The number of entries in @functions.
106 * @groups: An array describing all pin groups the pin SoC supports. 106 * @groups: An array describing all pin groups the pin SoC supports.
107 * @ngroups: The numbmer of entries in @groups. 107 * @ngroups: The numbmer of entries in @groups.
108 * @ngpio: The number of pingroups the driver should expose as GPIOs. 108 * @ngpio: The number of pingroups the driver should expose as GPIOs.
109 * @pull_no_keeper: The SoC does not support keeper bias.
109 */ 110 */
110struct msm_pinctrl_soc_data { 111struct msm_pinctrl_soc_data {
111 const struct pinctrl_pin_desc *pins; 112 const struct pinctrl_pin_desc *pins;
@@ -115,6 +116,7 @@ struct msm_pinctrl_soc_data {
115 const struct msm_pingroup *groups; 116 const struct msm_pingroup *groups;
116 unsigned ngroups; 117 unsigned ngroups;
117 unsigned ngpios; 118 unsigned ngpios;
119 bool pull_no_keeper;
118}; 120};
119 121
120int msm_pinctrl_probe(struct platform_device *pdev, 122int msm_pinctrl_probe(struct platform_device *pdev,
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index 664b641fd776..c2c0bab04257 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -40,6 +40,8 @@
40#define PMIC_GPIO_SUBTYPE_GPIOC_4CH 0x5 40#define PMIC_GPIO_SUBTYPE_GPIOC_4CH 0x5
41#define PMIC_GPIO_SUBTYPE_GPIO_8CH 0x9 41#define PMIC_GPIO_SUBTYPE_GPIO_8CH 0x9
42#define PMIC_GPIO_SUBTYPE_GPIOC_8CH 0xd 42#define PMIC_GPIO_SUBTYPE_GPIOC_8CH 0xd
43#define PMIC_GPIO_SUBTYPE_GPIO_LV 0x10
44#define PMIC_GPIO_SUBTYPE_GPIO_MV 0x11
43 45
44#define PMIC_MPP_REG_RT_STS 0x10 46#define PMIC_MPP_REG_RT_STS 0x10
45#define PMIC_MPP_REG_RT_STS_VAL_MASK 0x1 47#define PMIC_MPP_REG_RT_STS_VAL_MASK 0x1
@@ -48,8 +50,11 @@
48#define PMIC_GPIO_REG_MODE_CTL 0x40 50#define PMIC_GPIO_REG_MODE_CTL 0x40
49#define PMIC_GPIO_REG_DIG_VIN_CTL 0x41 51#define PMIC_GPIO_REG_DIG_VIN_CTL 0x41
50#define PMIC_GPIO_REG_DIG_PULL_CTL 0x42 52#define PMIC_GPIO_REG_DIG_PULL_CTL 0x42
53#define PMIC_GPIO_REG_LV_MV_DIG_OUT_SOURCE_CTL 0x44
54#define PMIC_GPIO_REG_DIG_IN_CTL 0x43
51#define PMIC_GPIO_REG_DIG_OUT_CTL 0x45 55#define PMIC_GPIO_REG_DIG_OUT_CTL 0x45
52#define PMIC_GPIO_REG_EN_CTL 0x46 56#define PMIC_GPIO_REG_EN_CTL 0x46
57#define PMIC_GPIO_REG_LV_MV_ANA_PASS_THRU_SEL 0x4A
53 58
54/* PMIC_GPIO_REG_MODE_CTL */ 59/* PMIC_GPIO_REG_MODE_CTL */
55#define PMIC_GPIO_REG_MODE_VALUE_SHIFT 0x1 60#define PMIC_GPIO_REG_MODE_VALUE_SHIFT 0x1
@@ -58,6 +63,12 @@
58#define PMIC_GPIO_REG_MODE_DIR_SHIFT 4 63#define PMIC_GPIO_REG_MODE_DIR_SHIFT 4
59#define PMIC_GPIO_REG_MODE_DIR_MASK 0x7 64#define PMIC_GPIO_REG_MODE_DIR_MASK 0x7
60 65
66#define PMIC_GPIO_MODE_DIGITAL_INPUT 0
67#define PMIC_GPIO_MODE_DIGITAL_OUTPUT 1
68#define PMIC_GPIO_MODE_DIGITAL_INPUT_OUTPUT 2
69#define PMIC_GPIO_MODE_ANALOG_PASS_THRU 3
70#define PMIC_GPIO_REG_LV_MV_MODE_DIR_MASK 0x3
71
61/* PMIC_GPIO_REG_DIG_VIN_CTL */ 72/* PMIC_GPIO_REG_DIG_VIN_CTL */
62#define PMIC_GPIO_REG_VIN_SHIFT 0 73#define PMIC_GPIO_REG_VIN_SHIFT 0
63#define PMIC_GPIO_REG_VIN_MASK 0x7 74#define PMIC_GPIO_REG_VIN_MASK 0x7
@@ -69,6 +80,16 @@
69#define PMIC_GPIO_PULL_DOWN 4 80#define PMIC_GPIO_PULL_DOWN 4
70#define PMIC_GPIO_PULL_DISABLE 5 81#define PMIC_GPIO_PULL_DISABLE 5
71 82
83/* PMIC_GPIO_REG_LV_MV_DIG_OUT_SOURCE_CTL for LV/MV */
84#define PMIC_GPIO_LV_MV_OUTPUT_INVERT 0x80
85#define PMIC_GPIO_LV_MV_OUTPUT_INVERT_SHIFT 7
86#define PMIC_GPIO_LV_MV_OUTPUT_SOURCE_SEL_MASK 0xF
87
88/* PMIC_GPIO_REG_DIG_IN_CTL */
89#define PMIC_GPIO_LV_MV_DIG_IN_DTEST_EN 0x80
90#define PMIC_GPIO_LV_MV_DIG_IN_DTEST_SEL_MASK 0x7
91#define PMIC_GPIO_DIG_IN_DTEST_SEL_MASK 0xf
92
72/* PMIC_GPIO_REG_DIG_OUT_CTL */ 93/* PMIC_GPIO_REG_DIG_OUT_CTL */
73#define PMIC_GPIO_REG_OUT_STRENGTH_SHIFT 0 94#define PMIC_GPIO_REG_OUT_STRENGTH_SHIFT 0
74#define PMIC_GPIO_REG_OUT_STRENGTH_MASK 0x3 95#define PMIC_GPIO_REG_OUT_STRENGTH_MASK 0x3
@@ -88,9 +109,29 @@
88 109
89#define PMIC_GPIO_PHYSICAL_OFFSET 1 110#define PMIC_GPIO_PHYSICAL_OFFSET 1
90 111
112/* PMIC_GPIO_REG_LV_MV_ANA_PASS_THRU_SEL */
113#define PMIC_GPIO_LV_MV_ANA_MUX_SEL_MASK 0x3
114
91/* Qualcomm specific pin configurations */ 115/* Qualcomm specific pin configurations */
92#define PMIC_GPIO_CONF_PULL_UP (PIN_CONFIG_END + 1) 116#define PMIC_GPIO_CONF_PULL_UP (PIN_CONFIG_END + 1)
93#define PMIC_GPIO_CONF_STRENGTH (PIN_CONFIG_END + 2) 117#define PMIC_GPIO_CONF_STRENGTH (PIN_CONFIG_END + 2)
118#define PMIC_GPIO_CONF_ATEST (PIN_CONFIG_END + 3)
119#define PMIC_GPIO_CONF_ANALOG_PASS (PIN_CONFIG_END + 4)
120#define PMIC_GPIO_CONF_DTEST_BUFFER (PIN_CONFIG_END + 5)
121
122/* The index of each function in pmic_gpio_functions[] array */
123enum pmic_gpio_func_index {
124 PMIC_GPIO_FUNC_INDEX_NORMAL,
125 PMIC_GPIO_FUNC_INDEX_PAIRED,
126 PMIC_GPIO_FUNC_INDEX_FUNC1,
127 PMIC_GPIO_FUNC_INDEX_FUNC2,
128 PMIC_GPIO_FUNC_INDEX_FUNC3,
129 PMIC_GPIO_FUNC_INDEX_FUNC4,
130 PMIC_GPIO_FUNC_INDEX_DTEST1,
131 PMIC_GPIO_FUNC_INDEX_DTEST2,
132 PMIC_GPIO_FUNC_INDEX_DTEST3,
133 PMIC_GPIO_FUNC_INDEX_DTEST4,
134};
94 135
95/** 136/**
96 * struct pmic_gpio_pad - keep current GPIO settings 137 * struct pmic_gpio_pad - keep current GPIO settings
@@ -102,12 +143,16 @@
102 * open-drain or open-source mode. 143 * open-drain or open-source mode.
103 * @output_enabled: Set to true if GPIO output logic is enabled. 144 * @output_enabled: Set to true if GPIO output logic is enabled.
104 * @input_enabled: Set to true if GPIO input buffer logic is enabled. 145 * @input_enabled: Set to true if GPIO input buffer logic is enabled.
146 * @analog_pass: Set to true if GPIO is in analog-pass-through mode.
147 * @lv_mv_type: Set to true if GPIO subtype is GPIO_LV(0x10) or GPIO_MV(0x11).
105 * @num_sources: Number of power-sources supported by this GPIO. 148 * @num_sources: Number of power-sources supported by this GPIO.
106 * @power_source: Current power-source used. 149 * @power_source: Current power-source used.
107 * @buffer_type: Push-pull, open-drain or open-source. 150 * @buffer_type: Push-pull, open-drain or open-source.
108 * @pullup: Constant current which flow trough GPIO output buffer. 151 * @pullup: Constant current which flow trough GPIO output buffer.
109 * @strength: No, Low, Medium, High 152 * @strength: No, Low, Medium, High
110 * @function: See pmic_gpio_functions[] 153 * @function: See pmic_gpio_functions[]
154 * @atest: the ATEST selection for GPIO analog-pass-through mode
155 * @dtest_buffer: the DTEST buffer selection for digital input mode.
111 */ 156 */
112struct pmic_gpio_pad { 157struct pmic_gpio_pad {
113 u16 base; 158 u16 base;
@@ -117,12 +162,16 @@ struct pmic_gpio_pad {
117 bool have_buffer; 162 bool have_buffer;
118 bool output_enabled; 163 bool output_enabled;
119 bool input_enabled; 164 bool input_enabled;
165 bool analog_pass;
166 bool lv_mv_type;
120 unsigned int num_sources; 167 unsigned int num_sources;
121 unsigned int power_source; 168 unsigned int power_source;
122 unsigned int buffer_type; 169 unsigned int buffer_type;
123 unsigned int pullup; 170 unsigned int pullup;
124 unsigned int strength; 171 unsigned int strength;
125 unsigned int function; 172 unsigned int function;
173 unsigned int atest;
174 unsigned int dtest_buffer;
126}; 175};
127 176
128struct pmic_gpio_state { 177struct pmic_gpio_state {
@@ -135,12 +184,18 @@ struct pmic_gpio_state {
135static const struct pinconf_generic_params pmic_gpio_bindings[] = { 184static const struct pinconf_generic_params pmic_gpio_bindings[] = {
136 {"qcom,pull-up-strength", PMIC_GPIO_CONF_PULL_UP, 0}, 185 {"qcom,pull-up-strength", PMIC_GPIO_CONF_PULL_UP, 0},
137 {"qcom,drive-strength", PMIC_GPIO_CONF_STRENGTH, 0}, 186 {"qcom,drive-strength", PMIC_GPIO_CONF_STRENGTH, 0},
187 {"qcom,atest", PMIC_GPIO_CONF_ATEST, 0},
188 {"qcom,analog-pass", PMIC_GPIO_CONF_ANALOG_PASS, 0},
189 {"qcom,dtest-buffer", PMIC_GPIO_CONF_DTEST_BUFFER, 0},
138}; 190};
139 191
140#ifdef CONFIG_DEBUG_FS 192#ifdef CONFIG_DEBUG_FS
141static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = { 193static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = {
142 PCONFDUMP(PMIC_GPIO_CONF_PULL_UP, "pull up strength", NULL, true), 194 PCONFDUMP(PMIC_GPIO_CONF_PULL_UP, "pull up strength", NULL, true),
143 PCONFDUMP(PMIC_GPIO_CONF_STRENGTH, "drive-strength", NULL, true), 195 PCONFDUMP(PMIC_GPIO_CONF_STRENGTH, "drive-strength", NULL, true),
196 PCONFDUMP(PMIC_GPIO_CONF_ATEST, "atest", NULL, true),
197 PCONFDUMP(PMIC_GPIO_CONF_ANALOG_PASS, "analog-pass", NULL, true),
198 PCONFDUMP(PMIC_GPIO_CONF_DTEST_BUFFER, "dtest-buffer", NULL, true),
144}; 199};
145#endif 200#endif
146 201
@@ -153,10 +208,16 @@ static const char *const pmic_gpio_groups[] = {
153}; 208};
154 209
155static const char *const pmic_gpio_functions[] = { 210static const char *const pmic_gpio_functions[] = {
156 PMIC_GPIO_FUNC_NORMAL, PMIC_GPIO_FUNC_PAIRED, 211 [PMIC_GPIO_FUNC_INDEX_NORMAL] = PMIC_GPIO_FUNC_NORMAL,
157 PMIC_GPIO_FUNC_FUNC1, PMIC_GPIO_FUNC_FUNC2, 212 [PMIC_GPIO_FUNC_INDEX_PAIRED] = PMIC_GPIO_FUNC_PAIRED,
158 PMIC_GPIO_FUNC_DTEST1, PMIC_GPIO_FUNC_DTEST2, 213 [PMIC_GPIO_FUNC_INDEX_FUNC1] = PMIC_GPIO_FUNC_FUNC1,
159 PMIC_GPIO_FUNC_DTEST3, PMIC_GPIO_FUNC_DTEST4, 214 [PMIC_GPIO_FUNC_INDEX_FUNC2] = PMIC_GPIO_FUNC_FUNC2,
215 [PMIC_GPIO_FUNC_INDEX_FUNC3] = PMIC_GPIO_FUNC_FUNC3,
216 [PMIC_GPIO_FUNC_INDEX_FUNC4] = PMIC_GPIO_FUNC_FUNC4,
217 [PMIC_GPIO_FUNC_INDEX_DTEST1] = PMIC_GPIO_FUNC_DTEST1,
218 [PMIC_GPIO_FUNC_INDEX_DTEST2] = PMIC_GPIO_FUNC_DTEST2,
219 [PMIC_GPIO_FUNC_INDEX_DTEST3] = PMIC_GPIO_FUNC_DTEST3,
220 [PMIC_GPIO_FUNC_INDEX_DTEST4] = PMIC_GPIO_FUNC_DTEST4,
160}; 221};
161 222
162static int pmic_gpio_read(struct pmic_gpio_state *state, 223static int pmic_gpio_read(struct pmic_gpio_state *state,
@@ -244,25 +305,67 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function,
244 unsigned int val; 305 unsigned int val;
245 int ret; 306 int ret;
246 307
308 if (function > PMIC_GPIO_FUNC_INDEX_DTEST4) {
309 pr_err("function: %d is not defined\n", function);
310 return -EINVAL;
311 }
312
247 pad = pctldev->desc->pins[pin].drv_data; 313 pad = pctldev->desc->pins[pin].drv_data;
314 /*
315 * Non-LV/MV subtypes only support 2 special functions,
316 * offsetting the dtestx function values by 2
317 */
318 if (!pad->lv_mv_type) {
319 if (function == PMIC_GPIO_FUNC_INDEX_FUNC3 ||
320 function == PMIC_GPIO_FUNC_INDEX_FUNC4) {
321 pr_err("LV/MV subtype doesn't have func3/func4\n");
322 return -EINVAL;
323 }
324 if (function >= PMIC_GPIO_FUNC_INDEX_DTEST1)
325 function -= (PMIC_GPIO_FUNC_INDEX_DTEST1 -
326 PMIC_GPIO_FUNC_INDEX_FUNC3);
327 }
248 328
249 pad->function = function; 329 pad->function = function;
250 330
251 val = 0; 331 if (pad->analog_pass)
252 if (pad->output_enabled) { 332 val = PMIC_GPIO_MODE_ANALOG_PASS_THRU;
253 if (pad->input_enabled) 333 else if (pad->output_enabled && pad->input_enabled)
254 val = 2; 334 val = PMIC_GPIO_MODE_DIGITAL_INPUT_OUTPUT;
255 else 335 else if (pad->output_enabled)
256 val = 1; 336 val = PMIC_GPIO_MODE_DIGITAL_OUTPUT;
257 } 337 else
338 val = PMIC_GPIO_MODE_DIGITAL_INPUT;
258 339
259 val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT; 340 if (pad->lv_mv_type) {
260 val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT; 341 ret = pmic_gpio_write(state, pad,
261 val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT; 342 PMIC_GPIO_REG_MODE_CTL, val);
343 if (ret < 0)
344 return ret;
262 345
263 ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_MODE_CTL, val); 346 val = pad->atest - 1;
264 if (ret < 0) 347 ret = pmic_gpio_write(state, pad,
265 return ret; 348 PMIC_GPIO_REG_LV_MV_ANA_PASS_THRU_SEL, val);
349 if (ret < 0)
350 return ret;
351
352 val = pad->out_value
353 << PMIC_GPIO_LV_MV_OUTPUT_INVERT_SHIFT;
354 val |= pad->function
355 & PMIC_GPIO_LV_MV_OUTPUT_SOURCE_SEL_MASK;
356 ret = pmic_gpio_write(state, pad,
357 PMIC_GPIO_REG_LV_MV_DIG_OUT_SOURCE_CTL, val);
358 if (ret < 0)
359 return ret;
360 } else {
361 val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT;
362 val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
363 val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT;
364
365 ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_MODE_CTL, val);
366 if (ret < 0)
367 return ret;
368 }
266 369
267 val = pad->is_enabled << PMIC_GPIO_REG_MASTER_EN_SHIFT; 370 val = pad->is_enabled << PMIC_GPIO_REG_MASTER_EN_SHIFT;
268 371
@@ -322,6 +425,15 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev,
322 case PMIC_GPIO_CONF_STRENGTH: 425 case PMIC_GPIO_CONF_STRENGTH:
323 arg = pad->strength; 426 arg = pad->strength;
324 break; 427 break;
428 case PMIC_GPIO_CONF_ATEST:
429 arg = pad->atest;
430 break;
431 case PMIC_GPIO_CONF_ANALOG_PASS:
432 arg = pad->analog_pass;
433 break;
434 case PMIC_GPIO_CONF_DTEST_BUFFER:
435 arg = pad->dtest_buffer;
436 break;
325 default: 437 default:
326 return -EINVAL; 438 return -EINVAL;
327 } 439 }
@@ -375,7 +487,7 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
375 pad->is_enabled = false; 487 pad->is_enabled = false;
376 break; 488 break;
377 case PIN_CONFIG_POWER_SOURCE: 489 case PIN_CONFIG_POWER_SOURCE:
378 if (arg > pad->num_sources) 490 if (arg >= pad->num_sources)
379 return -EINVAL; 491 return -EINVAL;
380 pad->power_source = arg; 492 pad->power_source = arg;
381 break; 493 break;
@@ -396,6 +508,21 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
396 return -EINVAL; 508 return -EINVAL;
397 pad->strength = arg; 509 pad->strength = arg;
398 break; 510 break;
511 case PMIC_GPIO_CONF_ATEST:
512 if (!pad->lv_mv_type || arg > 4)
513 return -EINVAL;
514 pad->atest = arg;
515 break;
516 case PMIC_GPIO_CONF_ANALOG_PASS:
517 if (!pad->lv_mv_type)
518 return -EINVAL;
519 pad->analog_pass = true;
520 break;
521 case PMIC_GPIO_CONF_DTEST_BUFFER:
522 if (arg > 4)
523 return -EINVAL;
524 pad->dtest_buffer = arg;
525 break;
399 default: 526 default:
400 return -EINVAL; 527 return -EINVAL;
401 } 528 }
@@ -420,19 +547,60 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
420 if (ret < 0) 547 if (ret < 0)
421 return ret; 548 return ret;
422 549
423 val = 0; 550 if (pad->dtest_buffer == 0) {
424 if (pad->output_enabled) { 551 val = 0;
425 if (pad->input_enabled) 552 } else {
426 val = 2; 553 if (pad->lv_mv_type) {
427 else 554 val = pad->dtest_buffer - 1;
428 val = 1; 555 val |= PMIC_GPIO_LV_MV_DIG_IN_DTEST_EN;
556 } else {
557 val = BIT(pad->dtest_buffer - 1);
558 }
429 } 559 }
560 ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_DIG_IN_CTL, val);
561 if (ret < 0)
562 return ret;
563
564 if (pad->analog_pass)
565 val = PMIC_GPIO_MODE_ANALOG_PASS_THRU;
566 else if (pad->output_enabled && pad->input_enabled)
567 val = PMIC_GPIO_MODE_DIGITAL_INPUT_OUTPUT;
568 else if (pad->output_enabled)
569 val = PMIC_GPIO_MODE_DIGITAL_OUTPUT;
570 else
571 val = PMIC_GPIO_MODE_DIGITAL_INPUT;
430 572
431 val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT; 573 if (pad->lv_mv_type) {
432 val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT; 574 ret = pmic_gpio_write(state, pad,
433 val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT; 575 PMIC_GPIO_REG_MODE_CTL, val);
576 if (ret < 0)
577 return ret;
434 578
435 return pmic_gpio_write(state, pad, PMIC_GPIO_REG_MODE_CTL, val); 579 val = pad->atest - 1;
580 ret = pmic_gpio_write(state, pad,
581 PMIC_GPIO_REG_LV_MV_ANA_PASS_THRU_SEL, val);
582 if (ret < 0)
583 return ret;
584
585 val = pad->out_value
586 << PMIC_GPIO_LV_MV_OUTPUT_INVERT_SHIFT;
587 val |= pad->function
588 & PMIC_GPIO_LV_MV_OUTPUT_SOURCE_SEL_MASK;
589 ret = pmic_gpio_write(state, pad,
590 PMIC_GPIO_REG_LV_MV_DIG_OUT_SOURCE_CTL, val);
591 if (ret < 0)
592 return ret;
593 } else {
594 val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT;
595 val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
596 val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT;
597
598 ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_MODE_CTL, val);
599 if (ret < 0)
600 return ret;
601 }
602
603 return ret;
436} 604}
437 605
438static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev, 606static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
@@ -440,7 +608,7 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
440{ 608{
441 struct pmic_gpio_state *state = pinctrl_dev_get_drvdata(pctldev); 609 struct pmic_gpio_state *state = pinctrl_dev_get_drvdata(pctldev);
442 struct pmic_gpio_pad *pad; 610 struct pmic_gpio_pad *pad;
443 int ret, val; 611 int ret, val, function;
444 612
445 static const char *const biases[] = { 613 static const char *const biases[] = {
446 "pull-up 30uA", "pull-up 1.5uA", "pull-up 31.5uA", 614 "pull-up 30uA", "pull-up 1.5uA", "pull-up 31.5uA",
@@ -462,7 +630,6 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
462 if (val < 0 || !(val >> PMIC_GPIO_REG_MASTER_EN_SHIFT)) { 630 if (val < 0 || !(val >> PMIC_GPIO_REG_MASTER_EN_SHIFT)) {
463 seq_puts(s, " ---"); 631 seq_puts(s, " ---");
464 } else { 632 } else {
465
466 if (pad->input_enabled) { 633 if (pad->input_enabled) {
467 ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS); 634 ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS);
468 if (ret < 0) 635 if (ret < 0)
@@ -471,14 +638,29 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
471 ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; 638 ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
472 pad->out_value = ret; 639 pad->out_value = ret;
473 } 640 }
474 641 /*
475 seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in"); 642 * For the non-LV/MV subtypes only 2 special functions are
476 seq_printf(s, " %-7s", pmic_gpio_functions[pad->function]); 643 * available, offsetting the dtest function values by 2.
644 */
645 function = pad->function;
646 if (!pad->lv_mv_type &&
647 pad->function >= PMIC_GPIO_FUNC_INDEX_FUNC3)
648 function += PMIC_GPIO_FUNC_INDEX_DTEST1 -
649 PMIC_GPIO_FUNC_INDEX_FUNC3;
650
651 if (pad->analog_pass)
652 seq_puts(s, " analog-pass");
653 else
654 seq_printf(s, " %-4s",
655 pad->output_enabled ? "out" : "in");
656 seq_printf(s, " %-7s", pmic_gpio_functions[function]);
477 seq_printf(s, " vin-%d", pad->power_source); 657 seq_printf(s, " vin-%d", pad->power_source);
478 seq_printf(s, " %-27s", biases[pad->pullup]); 658 seq_printf(s, " %-27s", biases[pad->pullup]);
479 seq_printf(s, " %-10s", buffer_types[pad->buffer_type]); 659 seq_printf(s, " %-10s", buffer_types[pad->buffer_type]);
480 seq_printf(s, " %-4s", pad->out_value ? "high" : "low"); 660 seq_printf(s, " %-4s", pad->out_value ? "high" : "low");
481 seq_printf(s, " %-7s", strengths[pad->strength]); 661 seq_printf(s, " %-7s", strengths[pad->strength]);
662 seq_printf(s, " atest-%d", pad->atest);
663 seq_printf(s, " dtest-%d", pad->dtest_buffer);
482 } 664 }
483} 665}
484 666
@@ -618,40 +800,71 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state,
618 case PMIC_GPIO_SUBTYPE_GPIOC_8CH: 800 case PMIC_GPIO_SUBTYPE_GPIOC_8CH:
619 pad->num_sources = 8; 801 pad->num_sources = 8;
620 break; 802 break;
803 case PMIC_GPIO_SUBTYPE_GPIO_LV:
804 pad->num_sources = 1;
805 pad->have_buffer = true;
806 pad->lv_mv_type = true;
807 break;
808 case PMIC_GPIO_SUBTYPE_GPIO_MV:
809 pad->num_sources = 2;
810 pad->have_buffer = true;
811 pad->lv_mv_type = true;
812 break;
621 default: 813 default:
622 dev_err(state->dev, "unknown GPIO type 0x%x\n", subtype); 814 dev_err(state->dev, "unknown GPIO type 0x%x\n", subtype);
623 return -ENODEV; 815 return -ENODEV;
624 } 816 }
625 817
626 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_MODE_CTL); 818 if (pad->lv_mv_type) {
627 if (val < 0) 819 val = pmic_gpio_read(state, pad,
628 return val; 820 PMIC_GPIO_REG_LV_MV_DIG_OUT_SOURCE_CTL);
821 if (val < 0)
822 return val;
823
824 pad->out_value = !!(val & PMIC_GPIO_LV_MV_OUTPUT_INVERT);
825 pad->function = val & PMIC_GPIO_LV_MV_OUTPUT_SOURCE_SEL_MASK;
826
827 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_MODE_CTL);
828 if (val < 0)
829 return val;
830
831 dir = val & PMIC_GPIO_REG_LV_MV_MODE_DIR_MASK;
832 } else {
833 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_MODE_CTL);
834 if (val < 0)
835 return val;
836
837 pad->out_value = val & PMIC_GPIO_REG_MODE_VALUE_SHIFT;
629 838
630 pad->out_value = val & PMIC_GPIO_REG_MODE_VALUE_SHIFT; 839 dir = val >> PMIC_GPIO_REG_MODE_DIR_SHIFT;
840 dir &= PMIC_GPIO_REG_MODE_DIR_MASK;
841 pad->function = val >> PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
842 pad->function &= PMIC_GPIO_REG_MODE_FUNCTION_MASK;
843 }
631 844
632 dir = val >> PMIC_GPIO_REG_MODE_DIR_SHIFT;
633 dir &= PMIC_GPIO_REG_MODE_DIR_MASK;
634 switch (dir) { 845 switch (dir) {
635 case 0: 846 case PMIC_GPIO_MODE_DIGITAL_INPUT:
636 pad->input_enabled = true; 847 pad->input_enabled = true;
637 pad->output_enabled = false; 848 pad->output_enabled = false;
638 break; 849 break;
639 case 1: 850 case PMIC_GPIO_MODE_DIGITAL_OUTPUT:
640 pad->input_enabled = false; 851 pad->input_enabled = false;
641 pad->output_enabled = true; 852 pad->output_enabled = true;
642 break; 853 break;
643 case 2: 854 case PMIC_GPIO_MODE_DIGITAL_INPUT_OUTPUT:
644 pad->input_enabled = true; 855 pad->input_enabled = true;
645 pad->output_enabled = true; 856 pad->output_enabled = true;
646 break; 857 break;
858 case PMIC_GPIO_MODE_ANALOG_PASS_THRU:
859 if (!pad->lv_mv_type)
860 return -ENODEV;
861 pad->analog_pass = true;
862 break;
647 default: 863 default:
648 dev_err(state->dev, "unknown GPIO direction\n"); 864 dev_err(state->dev, "unknown GPIO direction\n");
649 return -ENODEV; 865 return -ENODEV;
650 } 866 }
651 867
652 pad->function = val >> PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
653 pad->function &= PMIC_GPIO_REG_MODE_FUNCTION_MASK;
654
655 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_DIG_VIN_CTL); 868 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_DIG_VIN_CTL);
656 if (val < 0) 869 if (val < 0)
657 return val; 870 return val;
@@ -666,6 +879,18 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state,
666 pad->pullup = val >> PMIC_GPIO_REG_PULL_SHIFT; 879 pad->pullup = val >> PMIC_GPIO_REG_PULL_SHIFT;
667 pad->pullup &= PMIC_GPIO_REG_PULL_MASK; 880 pad->pullup &= PMIC_GPIO_REG_PULL_MASK;
668 881
882 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_DIG_IN_CTL);
883 if (val < 0)
884 return val;
885
886 if (pad->lv_mv_type && (val & PMIC_GPIO_LV_MV_DIG_IN_DTEST_EN))
887 pad->dtest_buffer =
888 (val & PMIC_GPIO_LV_MV_DIG_IN_DTEST_SEL_MASK) + 1;
889 else if (!pad->lv_mv_type)
890 pad->dtest_buffer = ffs(val);
891 else
892 pad->dtest_buffer = 0;
893
669 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_DIG_OUT_CTL); 894 val = pmic_gpio_read(state, pad, PMIC_GPIO_REG_DIG_OUT_CTL);
670 if (val < 0) 895 if (val < 0)
671 return val; 896 return val;
@@ -676,6 +901,14 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state,
676 pad->buffer_type = val >> PMIC_GPIO_REG_OUT_TYPE_SHIFT; 901 pad->buffer_type = val >> PMIC_GPIO_REG_OUT_TYPE_SHIFT;
677 pad->buffer_type &= PMIC_GPIO_REG_OUT_TYPE_MASK; 902 pad->buffer_type &= PMIC_GPIO_REG_OUT_TYPE_MASK;
678 903
904 if (pad->lv_mv_type) {
905 val = pmic_gpio_read(state, pad,
906 PMIC_GPIO_REG_LV_MV_ANA_PASS_THRU_SEL);
907 if (val < 0)
908 return val;
909 pad->atest = (val & PMIC_GPIO_LV_MV_ANA_MUX_SEL_MASK) + 1;
910 }
911
679 /* Pin could be disabled with PIN_CONFIG_BIAS_HIGH_IMPEDANCE */ 912 /* Pin could be disabled with PIN_CONFIG_BIAS_HIGH_IMPEDANCE */
680 pad->is_enabled = true; 913 pad->is_enabled = true;
681 return 0; 914 return 0;
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index d3f5501d17ee..f53e32a9d8fc 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -588,7 +588,7 @@ static void pm8xxx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
588#define pm8xxx_gpio_dbg_show NULL 588#define pm8xxx_gpio_dbg_show NULL
589#endif 589#endif
590 590
591static struct gpio_chip pm8xxx_gpio_template = { 591static const struct gpio_chip pm8xxx_gpio_template = {
592 .direction_input = pm8xxx_gpio_direction_input, 592 .direction_input = pm8xxx_gpio_direction_input,
593 .direction_output = pm8xxx_gpio_direction_output, 593 .direction_output = pm8xxx_gpio_direction_output,
594 .get = pm8xxx_gpio_get, 594 .get = pm8xxx_gpio_get,
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
index 0d1392fc32dd..1e513bd6d0a9 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
@@ -643,7 +643,7 @@ static void pm8xxx_mpp_dbg_show(struct seq_file *s, struct gpio_chip *chip)
643#define pm8xxx_mpp_dbg_show NULL 643#define pm8xxx_mpp_dbg_show NULL
644#endif 644#endif
645 645
646static struct gpio_chip pm8xxx_mpp_template = { 646static const struct gpio_chip pm8xxx_mpp_template = {
647 .direction_input = pm8xxx_mpp_direction_input, 647 .direction_input = pm8xxx_mpp_direction_input,
648 .direction_output = pm8xxx_mpp_direction_output, 648 .direction_output = pm8xxx_mpp_direction_output,
649 .get = pm8xxx_mpp_get, 649 .get = pm8xxx_mpp_get,
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 731530a9ce38..c8d0de7ea160 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -31,6 +31,8 @@
31#include <linux/err.h> 31#include <linux/err.h>
32#include <linux/soc/samsung/exynos-pmu.h> 32#include <linux/soc/samsung/exynos-pmu.h>
33 33
34#include <dt-bindings/pinctrl/samsung.h>
35
34#include "pinctrl-samsung.h" 36#include "pinctrl-samsung.h"
35#include "pinctrl-exynos.h" 37#include "pinctrl-exynos.h"
36 38
@@ -149,15 +151,10 @@ static int exynos_irq_set_type(struct irq_data *irqd, unsigned int type)
149 151
150static int exynos_irq_request_resources(struct irq_data *irqd) 152static int exynos_irq_request_resources(struct irq_data *irqd)
151{ 153{
152 struct irq_chip *chip = irq_data_get_irq_chip(irqd);
153 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
154 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 154 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
155 const struct samsung_pin_bank_type *bank_type = bank->type; 155 const struct samsung_pin_bank_type *bank_type = bank->type;
156 unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; 156 unsigned long reg_con, flags;
157 unsigned long reg_con = our_chip->eint_con + bank->eint_offset; 157 unsigned int shift, mask, con;
158 unsigned long flags;
159 unsigned int mask;
160 unsigned int con;
161 int ret; 158 int ret;
162 159
163 ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq); 160 ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq);
@@ -174,10 +171,10 @@ static int exynos_irq_request_resources(struct irq_data *irqd)
174 171
175 spin_lock_irqsave(&bank->slock, flags); 172 spin_lock_irqsave(&bank->slock, flags);
176 173
177 con = readl(bank->eint_base + reg_con); 174 con = readl(bank->pctl_base + reg_con);
178 con &= ~(mask << shift); 175 con &= ~(mask << shift);
179 con |= EXYNOS_EINT_FUNC << shift; 176 con |= EXYNOS_PIN_FUNC_EINT << shift;
180 writel(con, bank->eint_base + reg_con); 177 writel(con, bank->pctl_base + reg_con);
181 178
182 spin_unlock_irqrestore(&bank->slock, flags); 179 spin_unlock_irqrestore(&bank->slock, flags);
183 180
@@ -186,15 +183,10 @@ static int exynos_irq_request_resources(struct irq_data *irqd)
186 183
187static void exynos_irq_release_resources(struct irq_data *irqd) 184static void exynos_irq_release_resources(struct irq_data *irqd)
188{ 185{
189 struct irq_chip *chip = irq_data_get_irq_chip(irqd);
190 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
191 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 186 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
192 const struct samsung_pin_bank_type *bank_type = bank->type; 187 const struct samsung_pin_bank_type *bank_type = bank->type;
193 unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; 188 unsigned long reg_con, flags;
194 unsigned long reg_con = our_chip->eint_con + bank->eint_offset; 189 unsigned int shift, mask, con;
195 unsigned long flags;
196 unsigned int mask;
197 unsigned int con;
198 190
199 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC]; 191 reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC];
200 shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC]; 192 shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC];
@@ -202,10 +194,10 @@ static void exynos_irq_release_resources(struct irq_data *irqd)
202 194
203 spin_lock_irqsave(&bank->slock, flags); 195 spin_lock_irqsave(&bank->slock, flags);
204 196
205 con = readl(bank->eint_base + reg_con); 197 con = readl(bank->pctl_base + reg_con);
206 con &= ~(mask << shift); 198 con &= ~(mask << shift);
207 con |= FUNC_INPUT << shift; 199 con |= EXYNOS_PIN_FUNC_INPUT << shift;
208 writel(con, bank->eint_base + reg_con); 200 writel(con, bank->pctl_base + reg_con);
209 201
210 spin_unlock_irqrestore(&bank->slock, flags); 202 spin_unlock_irqrestore(&bank->slock, flags);
211 203
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h
index b90139715c8f..7639b926c5c1 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.h
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.h
@@ -32,7 +32,6 @@
32#define EXYNOS7_WKUP_EMASK_OFFSET 0x900 32#define EXYNOS7_WKUP_EMASK_OFFSET 0x900
33#define EXYNOS7_WKUP_EPEND_OFFSET 0xA00 33#define EXYNOS7_WKUP_EPEND_OFFSET 0xA00
34#define EXYNOS_SVC_OFFSET 0xB08 34#define EXYNOS_SVC_OFFSET 0xB08
35#define EXYNOS_EINT_FUNC 0xF
36 35
37/* helpers to access interrupt service register */ 36/* helpers to access interrupt service register */
38#define EXYNOS_SVC_GROUP_SHIFT 3 37#define EXYNOS_SVC_GROUP_SHIFT 3
diff --git a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
index 49774851e84a..edf27264b603 100644
--- a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
+++ b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
@@ -151,7 +151,7 @@ static void s3c24xx_eint_set_function(struct samsung_pinctrl_drv_data *d,
151 u32 val; 151 u32 val;
152 152
153 /* Make sure that pin is configured as interrupt */ 153 /* Make sure that pin is configured as interrupt */
154 reg = bank->pctl_base + bank->pctl_offset; 154 reg = d->virt_base + bank->pctl_offset;
155 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC]; 155 shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC];
156 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; 156 mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1;
157 157
@@ -184,7 +184,7 @@ static int s3c24xx_eint_type(struct irq_data *data, unsigned int type)
184 s3c24xx_eint_set_handler(data, type); 184 s3c24xx_eint_set_handler(data, type);
185 185
186 /* Set up interrupt trigger */ 186 /* Set up interrupt trigger */
187 reg = bank->eint_base + EINT_REG(index); 187 reg = d->virt_base + EINT_REG(index);
188 shift = EINT_OFFS(index); 188 shift = EINT_OFFS(index);
189 189
190 val = readl(reg); 190 val = readl(reg);
@@ -259,29 +259,32 @@ static void s3c2410_demux_eint0_3(struct irq_desc *desc)
259static void s3c2412_eint0_3_ack(struct irq_data *data) 259static void s3c2412_eint0_3_ack(struct irq_data *data)
260{ 260{
261 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 261 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data);
262 struct samsung_pinctrl_drv_data *d = bank->drvdata;
262 263
263 unsigned long bitval = 1UL << data->hwirq; 264 unsigned long bitval = 1UL << data->hwirq;
264 writel(bitval, bank->eint_base + EINTPEND_REG); 265 writel(bitval, d->virt_base + EINTPEND_REG);
265} 266}
266 267
267static void s3c2412_eint0_3_mask(struct irq_data *data) 268static void s3c2412_eint0_3_mask(struct irq_data *data)
268{ 269{
269 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 270 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data);
271 struct samsung_pinctrl_drv_data *d = bank->drvdata;
270 unsigned long mask; 272 unsigned long mask;
271 273
272 mask = readl(bank->eint_base + EINTMASK_REG); 274 mask = readl(d->virt_base + EINTMASK_REG);
273 mask |= (1UL << data->hwirq); 275 mask |= (1UL << data->hwirq);
274 writel(mask, bank->eint_base + EINTMASK_REG); 276 writel(mask, d->virt_base + EINTMASK_REG);
275} 277}
276 278
277static void s3c2412_eint0_3_unmask(struct irq_data *data) 279static void s3c2412_eint0_3_unmask(struct irq_data *data)
278{ 280{
279 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 281 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data);
282 struct samsung_pinctrl_drv_data *d = bank->drvdata;
280 unsigned long mask; 283 unsigned long mask;
281 284
282 mask = readl(bank->eint_base + EINTMASK_REG); 285 mask = readl(d->virt_base + EINTMASK_REG);
283 mask &= ~(1UL << data->hwirq); 286 mask &= ~(1UL << data->hwirq);
284 writel(mask, bank->eint_base + EINTMASK_REG); 287 writel(mask, d->virt_base + EINTMASK_REG);
285} 288}
286 289
287static struct irq_chip s3c2412_eint0_3_chip = { 290static struct irq_chip s3c2412_eint0_3_chip = {
@@ -316,31 +319,34 @@ static void s3c2412_demux_eint0_3(struct irq_desc *desc)
316static void s3c24xx_eint_ack(struct irq_data *data) 319static void s3c24xx_eint_ack(struct irq_data *data)
317{ 320{
318 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 321 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data);
322 struct samsung_pinctrl_drv_data *d = bank->drvdata;
319 unsigned char index = bank->eint_offset + data->hwirq; 323 unsigned char index = bank->eint_offset + data->hwirq;
320 324
321 writel(1UL << index, bank->eint_base + EINTPEND_REG); 325 writel(1UL << index, d->virt_base + EINTPEND_REG);
322} 326}
323 327
324static void s3c24xx_eint_mask(struct irq_data *data) 328static void s3c24xx_eint_mask(struct irq_data *data)
325{ 329{
326 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 330 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data);
331 struct samsung_pinctrl_drv_data *d = bank->drvdata;
327 unsigned char index = bank->eint_offset + data->hwirq; 332 unsigned char index = bank->eint_offset + data->hwirq;
328 unsigned long mask; 333 unsigned long mask;
329 334
330 mask = readl(bank->eint_base + EINTMASK_REG); 335 mask = readl(d->virt_base + EINTMASK_REG);
331 mask |= (1UL << index); 336 mask |= (1UL << index);
332 writel(mask, bank->eint_base + EINTMASK_REG); 337 writel(mask, d->virt_base + EINTMASK_REG);
333} 338}
334 339
335static void s3c24xx_eint_unmask(struct irq_data *data) 340static void s3c24xx_eint_unmask(struct irq_data *data)
336{ 341{
337 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 342 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data);
343 struct samsung_pinctrl_drv_data *d = bank->drvdata;
338 unsigned char index = bank->eint_offset + data->hwirq; 344 unsigned char index = bank->eint_offset + data->hwirq;
339 unsigned long mask; 345 unsigned long mask;
340 346
341 mask = readl(bank->eint_base + EINTMASK_REG); 347 mask = readl(d->virt_base + EINTMASK_REG);
342 mask &= ~(1UL << index); 348 mask &= ~(1UL << index);
343 writel(mask, bank->eint_base + EINTMASK_REG); 349 writel(mask, d->virt_base + EINTMASK_REG);
344} 350}
345 351
346static struct irq_chip s3c24xx_eint_chip = { 352static struct irq_chip s3c24xx_eint_chip = {
@@ -356,14 +362,13 @@ static inline void s3c24xx_demux_eint(struct irq_desc *desc,
356{ 362{
357 struct s3c24xx_eint_data *data = irq_desc_get_handler_data(desc); 363 struct s3c24xx_eint_data *data = irq_desc_get_handler_data(desc);
358 struct irq_chip *chip = irq_desc_get_chip(desc); 364 struct irq_chip *chip = irq_desc_get_chip(desc);
359 struct irq_data *irqd = irq_desc_get_irq_data(desc); 365 struct samsung_pinctrl_drv_data *d = data->drvdata;
360 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
361 unsigned int pend, mask; 366 unsigned int pend, mask;
362 367
363 chained_irq_enter(chip, desc); 368 chained_irq_enter(chip, desc);
364 369
365 pend = readl(bank->eint_base + EINTPEND_REG); 370 pend = readl(d->virt_base + EINTPEND_REG);
366 mask = readl(bank->eint_base + EINTMASK_REG); 371 mask = readl(d->virt_base + EINTMASK_REG);
367 372
368 pend &= ~mask; 373 pend &= ~mask;
369 pend &= range; 374 pend &= range;
diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
index 4a88d7446e87..e63663b32907 100644
--- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
+++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
@@ -280,7 +280,7 @@ static void s3c64xx_irq_set_function(struct samsung_pinctrl_drv_data *d,
280 u32 val; 280 u32 val;
281 281
282 /* Make sure that pin is configured as interrupt */ 282 /* Make sure that pin is configured as interrupt */
283 reg = bank->pctl_base + bank->pctl_offset; 283 reg = d->virt_base + bank->pctl_offset;
284 shift = pin; 284 shift = pin;
285 if (bank_type->fld_width[PINCFG_TYPE_FUNC] * shift >= 32) { 285 if (bank_type->fld_width[PINCFG_TYPE_FUNC] * shift >= 32) {
286 /* 4-bit bank type with 2 con regs */ 286 /* 4-bit bank type with 2 con regs */
@@ -308,8 +308,9 @@ static void s3c64xx_irq_set_function(struct samsung_pinctrl_drv_data *d,
308static inline void s3c64xx_gpio_irq_set_mask(struct irq_data *irqd, bool mask) 308static inline void s3c64xx_gpio_irq_set_mask(struct irq_data *irqd, bool mask)
309{ 309{
310 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 310 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
311 struct samsung_pinctrl_drv_data *d = bank->drvdata;
311 unsigned char index = EINT_OFFS(bank->eint_offset) + irqd->hwirq; 312 unsigned char index = EINT_OFFS(bank->eint_offset) + irqd->hwirq;
312 void __iomem *reg = bank->eint_base + EINTMASK_REG(bank->eint_offset); 313 void __iomem *reg = d->virt_base + EINTMASK_REG(bank->eint_offset);
313 u32 val; 314 u32 val;
314 315
315 val = readl(reg); 316 val = readl(reg);
@@ -333,8 +334,9 @@ static void s3c64xx_gpio_irq_mask(struct irq_data *irqd)
333static void s3c64xx_gpio_irq_ack(struct irq_data *irqd) 334static void s3c64xx_gpio_irq_ack(struct irq_data *irqd)
334{ 335{
335 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 336 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
337 struct samsung_pinctrl_drv_data *d = bank->drvdata;
336 unsigned char index = EINT_OFFS(bank->eint_offset) + irqd->hwirq; 338 unsigned char index = EINT_OFFS(bank->eint_offset) + irqd->hwirq;
337 void __iomem *reg = bank->eint_base + EINTPEND_REG(bank->eint_offset); 339 void __iomem *reg = d->virt_base + EINTPEND_REG(bank->eint_offset);
338 340
339 writel(1 << index, reg); 341 writel(1 << index, reg);
340} 342}
@@ -357,7 +359,7 @@ static int s3c64xx_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
357 s3c64xx_irq_set_handler(irqd, type); 359 s3c64xx_irq_set_handler(irqd, type);
358 360
359 /* Set up interrupt trigger */ 361 /* Set up interrupt trigger */
360 reg = bank->eint_base + EINTCON_REG(bank->eint_offset); 362 reg = d->virt_base + EINTCON_REG(bank->eint_offset);
361 shift = EINT_OFFS(bank->eint_offset) + irqd->hwirq; 363 shift = EINT_OFFS(bank->eint_offset) + irqd->hwirq;
362 shift = 4 * (shift / 4); /* 4 EINTs per trigger selector */ 364 shift = 4 * (shift / 4); /* 4 EINTs per trigger selector */
363 365
@@ -409,8 +411,7 @@ static void s3c64xx_eint_gpio_irq(struct irq_desc *desc)
409{ 411{
410 struct irq_chip *chip = irq_desc_get_chip(desc); 412 struct irq_chip *chip = irq_desc_get_chip(desc);
411 struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc); 413 struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc);
412 struct irq_data *irqd = irq_desc_get_irq_data(desc); 414 struct samsung_pinctrl_drv_data *drvdata = data->drvdata;
413 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
414 415
415 chained_irq_enter(chip, desc); 416 chained_irq_enter(chip, desc);
416 417
@@ -420,7 +421,7 @@ static void s3c64xx_eint_gpio_irq(struct irq_desc *desc)
420 unsigned int pin; 421 unsigned int pin;
421 unsigned int virq; 422 unsigned int virq;
422 423
423 svc = readl(bank->eint_base + SERVICE_REG); 424 svc = readl(drvdata->virt_base + SERVICE_REG);
424 group = SVC_GROUP(svc); 425 group = SVC_GROUP(svc);
425 pin = svc & SVC_NUM_MASK; 426 pin = svc & SVC_NUM_MASK;
426 427
@@ -515,15 +516,15 @@ static inline void s3c64xx_eint0_irq_set_mask(struct irq_data *irqd, bool mask)
515{ 516{
516 struct s3c64xx_eint0_domain_data *ddata = 517 struct s3c64xx_eint0_domain_data *ddata =
517 irq_data_get_irq_chip_data(irqd); 518 irq_data_get_irq_chip_data(irqd);
518 struct samsung_pin_bank *bank = ddata->bank; 519 struct samsung_pinctrl_drv_data *d = ddata->bank->drvdata;
519 u32 val; 520 u32 val;
520 521
521 val = readl(bank->eint_base + EINT0MASK_REG); 522 val = readl(d->virt_base + EINT0MASK_REG);
522 if (mask) 523 if (mask)
523 val |= 1 << ddata->eints[irqd->hwirq]; 524 val |= 1 << ddata->eints[irqd->hwirq];
524 else 525 else
525 val &= ~(1 << ddata->eints[irqd->hwirq]); 526 val &= ~(1 << ddata->eints[irqd->hwirq]);
526 writel(val, bank->eint_base + EINT0MASK_REG); 527 writel(val, d->virt_base + EINT0MASK_REG);
527} 528}
528 529
529static void s3c64xx_eint0_irq_unmask(struct irq_data *irqd) 530static void s3c64xx_eint0_irq_unmask(struct irq_data *irqd)
@@ -540,10 +541,10 @@ static void s3c64xx_eint0_irq_ack(struct irq_data *irqd)
540{ 541{
541 struct s3c64xx_eint0_domain_data *ddata = 542 struct s3c64xx_eint0_domain_data *ddata =
542 irq_data_get_irq_chip_data(irqd); 543 irq_data_get_irq_chip_data(irqd);
543 struct samsung_pin_bank *bank = ddata->bank; 544 struct samsung_pinctrl_drv_data *d = ddata->bank->drvdata;
544 545
545 writel(1 << ddata->eints[irqd->hwirq], 546 writel(1 << ddata->eints[irqd->hwirq],
546 bank->eint_base + EINT0PEND_REG); 547 d->virt_base + EINT0PEND_REG);
547} 548}
548 549
549static int s3c64xx_eint0_irq_set_type(struct irq_data *irqd, unsigned int type) 550static int s3c64xx_eint0_irq_set_type(struct irq_data *irqd, unsigned int type)
@@ -551,7 +552,7 @@ static int s3c64xx_eint0_irq_set_type(struct irq_data *irqd, unsigned int type)
551 struct s3c64xx_eint0_domain_data *ddata = 552 struct s3c64xx_eint0_domain_data *ddata =
552 irq_data_get_irq_chip_data(irqd); 553 irq_data_get_irq_chip_data(irqd);
553 struct samsung_pin_bank *bank = ddata->bank; 554 struct samsung_pin_bank *bank = ddata->bank;
554 struct samsung_pinctrl_drv_data *d = ddata->bank->drvdata; 555 struct samsung_pinctrl_drv_data *d = bank->drvdata;
555 void __iomem *reg; 556 void __iomem *reg;
556 int trigger; 557 int trigger;
557 u8 shift; 558 u8 shift;
@@ -566,7 +567,7 @@ static int s3c64xx_eint0_irq_set_type(struct irq_data *irqd, unsigned int type)
566 s3c64xx_irq_set_handler(irqd, type); 567 s3c64xx_irq_set_handler(irqd, type);
567 568
568 /* Set up interrupt trigger */ 569 /* Set up interrupt trigger */
569 reg = bank->eint_base + EINT0CON0_REG; 570 reg = d->virt_base + EINT0CON0_REG;
570 shift = ddata->eints[irqd->hwirq]; 571 shift = ddata->eints[irqd->hwirq];
571 if (shift >= EINT_MAX_PER_REG) { 572 if (shift >= EINT_MAX_PER_REG) {
572 reg += 4; 573 reg += 4;
@@ -598,19 +599,14 @@ static struct irq_chip s3c64xx_eint0_irq_chip = {
598static inline void s3c64xx_irq_demux_eint(struct irq_desc *desc, u32 range) 599static inline void s3c64xx_irq_demux_eint(struct irq_desc *desc, u32 range)
599{ 600{
600 struct irq_chip *chip = irq_desc_get_chip(desc); 601 struct irq_chip *chip = irq_desc_get_chip(desc);
601 struct irq_data *irqd = irq_desc_get_irq_data(desc);
602 struct s3c64xx_eint0_domain_data *ddata =
603 irq_data_get_irq_chip_data(irqd);
604 struct samsung_pin_bank *bank = ddata->bank;
605
606 struct s3c64xx_eint0_data *data = irq_desc_get_handler_data(desc); 602 struct s3c64xx_eint0_data *data = irq_desc_get_handler_data(desc);
607 603 struct samsung_pinctrl_drv_data *drvdata = data->drvdata;
608 unsigned int pend, mask; 604 unsigned int pend, mask;
609 605
610 chained_irq_enter(chip, desc); 606 chained_irq_enter(chip, desc);
611 607
612 pend = readl(bank->eint_base + EINT0PEND_REG); 608 pend = readl(drvdata->virt_base + EINT0PEND_REG);
613 mask = readl(bank->eint_base + EINT0MASK_REG); 609 mask = readl(drvdata->virt_base + EINT0MASK_REG);
614 610
615 pend = pend & range & ~mask; 611 pend = pend & range & ~mask;
616 pend &= range; 612 pend &= range;
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index f542642eed8d..e04f7fe0a65d 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -30,6 +30,8 @@
30#include <linux/of_device.h> 30#include <linux/of_device.h>
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
32 32
33#include <dt-bindings/pinctrl/samsung.h>
34
33#include "../core.h" 35#include "../core.h"
34#include "pinctrl-samsung.h" 36#include "pinctrl-samsung.h"
35 37
@@ -586,7 +588,7 @@ static int samsung_gpio_set_direction(struct gpio_chip *gc,
586 data = readl(reg); 588 data = readl(reg);
587 data &= ~(mask << shift); 589 data &= ~(mask << shift);
588 if (!input) 590 if (!input)
589 data |= FUNC_OUTPUT << shift; 591 data |= EXYNOS_PIN_FUNC_OUTPUT << shift;
590 writel(data, reg); 592 writel(data, reg);
591 593
592 return 0; 594 return 0;
@@ -679,7 +681,7 @@ static int samsung_pinctrl_create_function(struct device *dev,
679 681
680 npins = of_property_count_strings(func_np, "samsung,pins"); 682 npins = of_property_count_strings(func_np, "samsung,pins");
681 if (npins < 1) { 683 if (npins < 1) {
682 dev_err(dev, "invalid pin list in %s node", func_np->name); 684 dev_err(dev, "invalid pin list in %pOFn node", func_np);
683 return -EINVAL; 685 return -EINVAL;
684 } 686 }
685 687
@@ -696,8 +698,8 @@ static int samsung_pinctrl_create_function(struct device *dev,
696 i, &gname); 698 i, &gname);
697 if (ret) { 699 if (ret) {
698 dev_err(dev, 700 dev_err(dev,
699 "failed to read pin name %d from %s node\n", 701 "failed to read pin name %d from %pOFn node\n",
700 i, func_np->name); 702 i, func_np);
701 return ret; 703 return ret;
702 } 704 }
703 705
@@ -958,7 +960,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
958 struct samsung_pin_bank *bank; 960 struct samsung_pin_bank *bank;
959 struct resource *res; 961 struct resource *res;
960 void __iomem *virt_base[SAMSUNG_PINCTRL_NUM_RESOURCES]; 962 void __iomem *virt_base[SAMSUNG_PINCTRL_NUM_RESOURCES];
961 int i; 963 unsigned int i;
962 964
963 id = of_alias_get_id(node, "pinctrl"); 965 id = of_alias_get_id(node, "pinctrl");
964 if (id < 0) { 966 if (id < 0) {
@@ -1013,6 +1015,12 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
1013 bank->eint_base = virt_base[0]; 1015 bank->eint_base = virt_base[0];
1014 bank->pctl_base = virt_base[bdata->pctl_res_idx]; 1016 bank->pctl_base = virt_base[bdata->pctl_res_idx];
1015 } 1017 }
1018 /*
1019 * Legacy platforms should provide only one resource with IO memory.
1020 * Store it as virt_base because legacy driver needs to access it
1021 * through samsung_pinctrl_drv_data.
1022 */
1023 d->virt_base = virt_base[0];
1016 1024
1017 for_each_child_of_node(node, np) { 1025 for_each_child_of_node(node, np) {
1018 if (!of_find_property(np, "gpio-controller", NULL)) 1026 if (!of_find_property(np, "gpio-controller", NULL))
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h
index 515a61035e54..9af07af6cad6 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.h
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.h
@@ -25,10 +25,6 @@
25 25
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27 27
28/* pinmux function number for pin as gpio output line */
29#define FUNC_INPUT 0x0
30#define FUNC_OUTPUT 0x1
31
32/** 28/**
33 * enum pincfg_type - possible pin configuration types supported. 29 * enum pincfg_type - possible pin configuration types supported.
34 * @PINCFG_TYPE_FUNC: Function configuration. 30 * @PINCFG_TYPE_FUNC: Function configuration.
@@ -234,8 +230,8 @@ struct samsung_retention_data {
234 */ 230 */
235struct samsung_pin_ctrl { 231struct samsung_pin_ctrl {
236 const struct samsung_pin_bank_data *pin_banks; 232 const struct samsung_pin_bank_data *pin_banks;
237 u32 nr_banks; 233 unsigned int nr_banks;
238 int nr_ext_resources; 234 unsigned int nr_ext_resources;
239 const struct samsung_retention_data *retention_data; 235 const struct samsung_retention_data *retention_data;
240 236
241 int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); 237 int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *);
@@ -247,6 +243,10 @@ struct samsung_pin_ctrl {
247/** 243/**
248 * struct samsung_pinctrl_drv_data: wrapper for holding driver data together. 244 * struct samsung_pinctrl_drv_data: wrapper for holding driver data together.
249 * @node: global list node 245 * @node: global list node
246 * @virt_base: register base address of the controller; this will be equal
247 * to each bank samsung_pin_bank->pctl_base and used on legacy
248 * platforms (like S3C24XX or S3C64XX) which has to access the base
249 * through samsung_pinctrl_drv_data, not samsung_pin_bank).
250 * @dev: device instance representing the controller. 250 * @dev: device instance representing the controller.
251 * @irq: interrpt number used by the controller to notify gpio interrupts. 251 * @irq: interrpt number used by the controller to notify gpio interrupts.
252 * @ctrl: pin controller instance managed by the driver. 252 * @ctrl: pin controller instance managed by the driver.
@@ -262,6 +262,7 @@ struct samsung_pin_ctrl {
262 */ 262 */
263struct samsung_pinctrl_drv_data { 263struct samsung_pinctrl_drv_data {
264 struct list_head node; 264 struct list_head node;
265 void __iomem *virt_base;
265 struct device *dev; 266 struct device *dev;
266 int irq; 267 int irq;
267 268
@@ -274,7 +275,7 @@ struct samsung_pinctrl_drv_data {
274 unsigned int nr_functions; 275 unsigned int nr_functions;
275 276
276 struct samsung_pin_bank *pin_banks; 277 struct samsung_pin_bank *pin_banks;
277 u32 nr_banks; 278 unsigned int nr_banks;
278 unsigned int pin_base; 279 unsigned int pin_base;
279 unsigned int nr_pins; 280 unsigned int nr_pins;
280 281
diff --git a/drivers/pinctrl/sh-pfc/Kconfig b/drivers/pinctrl/sh-pfc/Kconfig
index 24f76a05a5a9..5d5312eb7102 100644
--- a/drivers/pinctrl/sh-pfc/Kconfig
+++ b/drivers/pinctrl/sh-pfc/Kconfig
@@ -89,6 +89,11 @@ config PINCTRL_PFC_R8A7796
89 depends on ARCH_R8A7796 89 depends on ARCH_R8A7796
90 select PINCTRL_SH_PFC 90 select PINCTRL_SH_PFC
91 91
92config PINCTRL_PFC_R8A77995
93 def_bool y
94 depends on ARCH_R8A77995
95 select PINCTRL_SH_PFC
96
92config PINCTRL_PFC_SH7203 97config PINCTRL_PFC_SH7203
93 def_bool y 98 def_bool y
94 depends on CPU_SUBTYPE_SH7203 99 depends on CPU_SUBTYPE_SH7203
diff --git a/drivers/pinctrl/sh-pfc/Makefile b/drivers/pinctrl/sh-pfc/Makefile
index 33d28eed9ba3..1d4f05a96bd4 100644
--- a/drivers/pinctrl/sh-pfc/Makefile
+++ b/drivers/pinctrl/sh-pfc/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o
15obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o 15obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o
16obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795-es1.o 16obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795-es1.o
17obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o 17obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o
18obj-$(CONFIG_PINCTRL_PFC_R8A77995) += pfc-r8a77995.o
18obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o 19obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o
19obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o 20obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o
20obj-$(CONFIG_PINCTRL_PFC_SH7269) += pfc-sh7269.o 21obj-$(CONFIG_PINCTRL_PFC_SH7269) += pfc-sh7269.o
diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index e72391d5e57d..0c5e952461fd 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -551,6 +551,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
551 .data = &r8a7796_pinmux_info, 551 .data = &r8a7796_pinmux_info,
552 }, 552 },
553#endif 553#endif
554#ifdef CONFIG_PINCTRL_PFC_R8A77995
555 {
556 .compatible = "renesas,pfc-r8a77995",
557 .data = &r8a77995_pinmux_info,
558 },
559#endif
554#ifdef CONFIG_PINCTRL_PFC_SH73A0 560#ifdef CONFIG_PINCTRL_PFC_SH73A0
555 { 561 {
556 .compatible = "renesas,pfc-sh73a0", 562 .compatible = "renesas,pfc-sh73a0",
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
index 4c5ffbd75be7..10bd35f8c894 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -2589,6 +2589,17 @@ static const unsigned int mmc_data8_mux[] = {
2589 MMC_D0_MARK, MMC_D1_MARK, MMC_D2_MARK, MMC_D3_MARK, 2589 MMC_D0_MARK, MMC_D1_MARK, MMC_D2_MARK, MMC_D3_MARK,
2590 MMC_D4_MARK, MMC_D5_MARK, MMC_D6_MARK, MMC_D7_MARK, 2590 MMC_D4_MARK, MMC_D5_MARK, MMC_D6_MARK, MMC_D7_MARK,
2591}; 2591};
2592static const unsigned int mmc_data8_b_pins[] = {
2593 /* D[0:7] */
2594 RCAR_GP_PIN(6, 18), RCAR_GP_PIN(6, 19),
2595 RCAR_GP_PIN(6, 20), RCAR_GP_PIN(6, 21),
2596 RCAR_GP_PIN(6, 22), RCAR_GP_PIN(6, 23),
2597 RCAR_GP_PIN(6, 6), RCAR_GP_PIN(6, 7),
2598};
2599static const unsigned int mmc_data8_b_mux[] = {
2600 MMC_D0_MARK, MMC_D1_MARK, MMC_D2_MARK, MMC_D3_MARK,
2601 MMC_D4_MARK, MMC_D5_MARK, MMC_D6_B_MARK, MMC_D7_B_MARK,
2602};
2592static const unsigned int mmc_ctrl_pins[] = { 2603static const unsigned int mmc_ctrl_pins[] = {
2593 /* CLK, CMD */ 2604 /* CLK, CMD */
2594 RCAR_GP_PIN(6, 16), RCAR_GP_PIN(6, 17), 2605 RCAR_GP_PIN(6, 16), RCAR_GP_PIN(6, 17),
@@ -4420,7 +4431,7 @@ static const unsigned int vin2_clk_mux[] = {
4420}; 4431};
4421 4432
4422static const struct { 4433static const struct {
4423 struct sh_pfc_pin_group common[341]; 4434 struct sh_pfc_pin_group common[342];
4424 struct sh_pfc_pin_group r8a779x[9]; 4435 struct sh_pfc_pin_group r8a779x[9];
4425} pinmux_groups = { 4436} pinmux_groups = {
4426 .common = { 4437 .common = {
@@ -4523,6 +4534,7 @@ static const struct {
4523 SH_PFC_PIN_GROUP(mmc_data1), 4534 SH_PFC_PIN_GROUP(mmc_data1),
4524 SH_PFC_PIN_GROUP(mmc_data4), 4535 SH_PFC_PIN_GROUP(mmc_data4),
4525 SH_PFC_PIN_GROUP(mmc_data8), 4536 SH_PFC_PIN_GROUP(mmc_data8),
4537 SH_PFC_PIN_GROUP(mmc_data8_b),
4526 SH_PFC_PIN_GROUP(mmc_ctrl), 4538 SH_PFC_PIN_GROUP(mmc_ctrl),
4527 SH_PFC_PIN_GROUP(msiof0_clk), 4539 SH_PFC_PIN_GROUP(msiof0_clk),
4528 SH_PFC_PIN_GROUP(msiof0_sync), 4540 SH_PFC_PIN_GROUP(msiof0_sync),
@@ -4955,6 +4967,7 @@ static const char * const mmc_groups[] = {
4955 "mmc_data1", 4967 "mmc_data1",
4956 "mmc_data4", 4968 "mmc_data4",
4957 "mmc_data8", 4969 "mmc_data8",
4970 "mmc_data8_b",
4958 "mmc_ctrl", 4971 "mmc_ctrl",
4959}; 4972};
4960 4973
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
index 1656295af2b0..8b35772cda98 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
@@ -61,7 +61,7 @@
61#define GPSR1_24 F_(RD_WR_N, IP4_31_28) 61#define GPSR1_24 F_(RD_WR_N, IP4_31_28)
62#define GPSR1_23 F_(RD_N, IP4_27_24) 62#define GPSR1_23 F_(RD_N, IP4_27_24)
63#define GPSR1_22 F_(BS_N, IP4_23_20) 63#define GPSR1_22 F_(BS_N, IP4_23_20)
64#define GPSR1_21 F_(CS1_N_A26, IP4_19_16) 64#define GPSR1_21 F_(CS1_N, IP4_19_16)
65#define GPSR1_20 F_(CS0_N, IP4_15_12) 65#define GPSR1_20 F_(CS0_N, IP4_15_12)
66#define GPSR1_19 F_(A19, IP4_11_8) 66#define GPSR1_19 F_(A19, IP4_11_8)
67#define GPSR1_18 F_(A18, IP4_7_4) 67#define GPSR1_18 F_(A18, IP4_7_4)
@@ -168,8 +168,8 @@
168#define GPSR5_0 F_(SCK0, IP11_27_24) 168#define GPSR5_0 F_(SCK0, IP11_27_24)
169 169
170/* GPSR6 */ 170/* GPSR6 */
171#define GPSR6_31 F_(USB3_OVC, IP18_7_4) 171#define GPSR6_31 F_(USB2_CH3_OVC, IP18_7_4)
172#define GPSR6_30 F_(USB3_PWEN, IP18_3_0) 172#define GPSR6_30 F_(USB2_CH3_PWEN, IP18_3_0)
173#define GPSR6_29 F_(USB30_OVC, IP17_31_28) 173#define GPSR6_29 F_(USB30_OVC, IP17_31_28)
174#define GPSR6_28 F_(USB30_PWEN, IP17_27_24) 174#define GPSR6_28 F_(USB30_PWEN, IP17_27_24)
175#define GPSR6_27 F_(USB1_OVC, IP17_23_20) 175#define GPSR6_27 F_(USB1_OVC, IP17_23_20)
@@ -215,8 +215,8 @@
215#define IP0_15_12 FM(AVB_LINK) F_(0, 0) FM(MSIOF2_SCK_C) FM(TX4_A) 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) 215#define IP0_15_12 FM(AVB_LINK) F_(0, 0) FM(MSIOF2_SCK_C) FM(TX4_A) 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)
216#define IP0_19_16 FM(AVB_AVTP_MATCH_A) F_(0, 0) FM(MSIOF2_RXD_C) FM(CTS4_N_A) F_(0, 0) FM(FSCLKST2_N_A) 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) 216#define IP0_19_16 FM(AVB_AVTP_MATCH_A) F_(0, 0) FM(MSIOF2_RXD_C) FM(CTS4_N_A) F_(0, 0) FM(FSCLKST2_N_A) 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)
217#define IP0_23_20 FM(AVB_AVTP_CAPTURE_A) F_(0, 0) FM(MSIOF2_TXD_C) FM(RTS4_N_TANS_A) 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) 217#define IP0_23_20 FM(AVB_AVTP_CAPTURE_A) F_(0, 0) FM(MSIOF2_TXD_C) FM(RTS4_N_TANS_A) 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)
218#define IP0_27_24 FM(IRQ0) FM(QPOLB) F_(0, 0) FM(DU_CDE) FM(VI4_DATA0_B) FM(CAN0_TX_B) FM(CANFD0_TX_B) FM(MSIOF3_SS1_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 218#define IP0_27_24 FM(IRQ0) FM(QPOLB) F_(0, 0) FM(DU_CDE) FM(VI4_DATA0_B) FM(CAN0_TX_B) FM(CANFD0_TX_B) FM(MSIOF3_SS2_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
219#define IP0_31_28 FM(IRQ1) FM(QPOLA) F_(0, 0) FM(DU_DISP) FM(VI4_DATA1_B) FM(CAN0_RX_B) FM(CANFD0_RX_B) FM(MSIOF3_SS2_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 219#define IP0_31_28 FM(IRQ1) FM(QPOLA) F_(0, 0) FM(DU_DISP) FM(VI4_DATA1_B) FM(CAN0_RX_B) FM(CANFD0_RX_B) FM(MSIOF3_SS1_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
220#define IP1_3_0 FM(IRQ2) FM(QCPV_QDE) F_(0, 0) FM(DU_EXODDF_DU_ODDF_DISP_CDE) FM(VI4_DATA2_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SYNC_E) F_(0, 0) FM(PWM3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 220#define IP1_3_0 FM(IRQ2) FM(QCPV_QDE) F_(0, 0) FM(DU_EXODDF_DU_ODDF_DISP_CDE) FM(VI4_DATA2_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SYNC_E) F_(0, 0) FM(PWM3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
221#define IP1_7_4 FM(IRQ3) FM(QSTVB_QVE) FM(A25) FM(DU_DOTCLKOUT1) FM(VI4_DATA3_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SCK_E) F_(0, 0) FM(PWM4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 221#define IP1_7_4 FM(IRQ3) FM(QSTVB_QVE) FM(A25) FM(DU_DOTCLKOUT1) FM(VI4_DATA3_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SCK_E) F_(0, 0) FM(PWM4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
222#define IP1_11_8 FM(IRQ4) FM(QSTH_QHS) FM(A24) FM(DU_EXHSYNC_DU_HSYNC) FM(VI4_DATA4_B) F_(0, 0) F_(0, 0) FM(MSIOF3_RXD_E) F_(0, 0) FM(PWM5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 222#define IP1_11_8 FM(IRQ4) FM(QSTH_QHS) FM(A24) FM(DU_EXHSYNC_DU_HSYNC) FM(VI4_DATA4_B) F_(0, 0) F_(0, 0) FM(MSIOF3_RXD_E) F_(0, 0) FM(PWM5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -247,7 +247,7 @@
247#define IP4_7_4 FM(A18) FM(LCDOUT10) F_(0, 0) F_(0, 0) FM(VI4_HSYNC_N) F_(0, 0) FM(DU_DG2) 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) 247#define IP4_7_4 FM(A18) FM(LCDOUT10) F_(0, 0) F_(0, 0) FM(VI4_HSYNC_N) F_(0, 0) FM(DU_DG2) 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)
248#define IP4_11_8 FM(A19) FM(LCDOUT11) F_(0, 0) F_(0, 0) FM(VI4_CLKENB) F_(0, 0) FM(DU_DG3) 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) 248#define IP4_11_8 FM(A19) FM(LCDOUT11) F_(0, 0) F_(0, 0) FM(VI4_CLKENB) F_(0, 0) FM(DU_DG3) 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)
249#define IP4_15_12 FM(CS0_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLKENB) 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) 249#define IP4_15_12 FM(CS0_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLKENB) 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)
250#define IP4_19_16 FM(CS1_N_A26) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLK) F_(0, 0) FM(EX_WAIT0_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) 250#define IP4_19_16 FM(CS1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLK) F_(0, 0) FM(EX_WAIT0_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)
251#define IP4_23_20 FM(BS_N) FM(QSTVA_QVS) FM(MSIOF3_SCK_D) FM(SCK3) FM(HSCK3) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN1_TX) FM(CANFD1_TX) FM(IETX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 251#define IP4_23_20 FM(BS_N) FM(QSTVA_QVS) FM(MSIOF3_SCK_D) FM(SCK3) FM(HSCK3) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN1_TX) FM(CANFD1_TX) FM(IETX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
252#define IP4_27_24 FM(RD_N) F_(0, 0) FM(MSIOF3_SYNC_D) FM(RX3_A) FM(HRX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_TX_A) FM(CANFD0_TX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 252#define IP4_27_24 FM(RD_N) F_(0, 0) FM(MSIOF3_SYNC_D) FM(RX3_A) FM(HRX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_TX_A) FM(CANFD0_TX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
253#define IP4_31_28 FM(RD_WR_N) F_(0, 0) FM(MSIOF3_RXD_D) FM(TX3_A) FM(HTX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_RX_A) FM(CANFD0_RX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 253#define IP4_31_28 FM(RD_WR_N) F_(0, 0) FM(MSIOF3_RXD_D) FM(TX3_A) FM(HTX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_RX_A) FM(CANFD0_RX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -270,7 +270,6 @@
270#define IP7_3_0 FM(D13) FM(LCDOUT5) FM(MSIOF2_SS2_D) FM(TX4_C) FM(VI4_DATA5_A) F_(0, 0) FM(DU_DR5) 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) 270#define IP7_3_0 FM(D13) FM(LCDOUT5) FM(MSIOF2_SS2_D) FM(TX4_C) FM(VI4_DATA5_A) F_(0, 0) FM(DU_DR5) 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)
271#define IP7_7_4 FM(D14) FM(LCDOUT6) FM(MSIOF3_SS1_A) FM(HRX3_C) FM(VI4_DATA6_A) F_(0, 0) FM(DU_DR6) FM(SCL6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 271#define IP7_7_4 FM(D14) FM(LCDOUT6) FM(MSIOF3_SS1_A) FM(HRX3_C) FM(VI4_DATA6_A) F_(0, 0) FM(DU_DR6) FM(SCL6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
272#define IP7_11_8 FM(D15) FM(LCDOUT7) FM(MSIOF3_SS2_A) FM(HTX3_C) FM(VI4_DATA7_A) F_(0, 0) FM(DU_DR7) FM(SDA6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 272#define IP7_11_8 FM(D15) FM(LCDOUT7) FM(MSIOF3_SS2_A) FM(HTX3_C) FM(VI4_DATA7_A) F_(0, 0) FM(DU_DR7) FM(SDA6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
273#define IP7_15_12 FM(FSCLKST) 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) F_(0, 0) F_(0, 0) F_(0, 0)
274#define IP7_19_16 FM(SD0_CLK) F_(0, 0) FM(MSIOF1_SCK_E) F_(0, 0) F_(0, 0) F_(0, 0) FM(STP_OPWM_0_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) 273#define IP7_19_16 FM(SD0_CLK) F_(0, 0) FM(MSIOF1_SCK_E) F_(0, 0) F_(0, 0) F_(0, 0) FM(STP_OPWM_0_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)
275 274
276/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* A */ /* B */ /* C - F */ 275/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* A */ /* B */ /* C - F */
@@ -285,24 +284,24 @@
285#define IP8_23_20 FM(SD1_DAT1) FM(SD2_DAT5) FM(MSIOF1_TXD_G) FM(NFDATA14_B) F_(0, 0) FM(TS_SPSYNC1_B)FM(STP_ISSYNC_1_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) 284#define IP8_23_20 FM(SD1_DAT1) FM(SD2_DAT5) FM(MSIOF1_TXD_G) FM(NFDATA14_B) F_(0, 0) FM(TS_SPSYNC1_B)FM(STP_ISSYNC_1_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)
286#define IP8_27_24 FM(SD1_DAT2) FM(SD2_DAT6) FM(MSIOF1_SS1_G) FM(NFDATA15_B) F_(0, 0) FM(TS_SDAT1_B) FM(STP_ISD_1_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) 285#define IP8_27_24 FM(SD1_DAT2) FM(SD2_DAT6) FM(MSIOF1_SS1_G) FM(NFDATA15_B) F_(0, 0) FM(TS_SDAT1_B) FM(STP_ISD_1_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)
287#define IP8_31_28 FM(SD1_DAT3) FM(SD2_DAT7) FM(MSIOF1_SS2_G) FM(NFRB_N_B) F_(0, 0) FM(TS_SDEN1_B) FM(STP_ISEN_1_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) 286#define IP8_31_28 FM(SD1_DAT3) FM(SD2_DAT7) FM(MSIOF1_SS2_G) FM(NFRB_N_B) F_(0, 0) FM(TS_SDEN1_B) FM(STP_ISEN_1_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)
288#define IP9_3_0 FM(SD2_CLK) F_(0, 0) F_(0, 0) FM(NFDATA8) 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) 287#define IP9_3_0 FM(SD2_CLK) F_(0, 0) FM(NFDATA8) 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) F_(0, 0)
289#define IP9_7_4 FM(SD2_CMD) F_(0, 0) F_(0, 0) FM(NFDATA9) 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) 288#define IP9_7_4 FM(SD2_CMD) F_(0, 0) FM(NFDATA9) 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) F_(0, 0)
290#define IP9_11_8 FM(SD2_DAT0) F_(0, 0) F_(0, 0) FM(NFDATA10) 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) 289#define IP9_11_8 FM(SD2_DAT0) F_(0, 0) FM(NFDATA10) 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) F_(0, 0)
291#define IP9_15_12 FM(SD2_DAT1) F_(0, 0) F_(0, 0) FM(NFDATA11) 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) 290#define IP9_15_12 FM(SD2_DAT1) F_(0, 0) FM(NFDATA11) 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) F_(0, 0)
292#define IP9_19_16 FM(SD2_DAT2) F_(0, 0) F_(0, 0) FM(NFDATA12) 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) 291#define IP9_19_16 FM(SD2_DAT2) F_(0, 0) FM(NFDATA12) 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) F_(0, 0)
293#define IP9_23_20 FM(SD2_DAT3) F_(0, 0) F_(0, 0) FM(NFDATA13) 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) 292#define IP9_23_20 FM(SD2_DAT3) F_(0, 0) FM(NFDATA13) 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) F_(0, 0)
294#define IP9_27_24 FM(SD2_DS) F_(0, 0) F_(0, 0) FM(NFALE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(SATA_DEVSLP_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 293#define IP9_27_24 FM(SD2_DS) F_(0, 0) FM(NFALE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(SATA_DEVSLP_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
295#define IP9_31_28 FM(SD3_CLK) F_(0, 0) F_(0, 0) FM(NFWE_N) 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) 294#define IP9_31_28 FM(SD3_CLK) F_(0, 0) FM(NFWE_N) 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) F_(0, 0)
296#define IP10_3_0 FM(SD3_CMD) F_(0, 0) F_(0, 0) FM(NFRE_N) 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) 295#define IP10_3_0 FM(SD3_CMD) F_(0, 0) FM(NFRE_N) 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) F_(0, 0)
297#define IP10_7_4 FM(SD3_DAT0) F_(0, 0) F_(0, 0) FM(NFDATA0) 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) 296#define IP10_7_4 FM(SD3_DAT0) F_(0, 0) FM(NFDATA0) 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) F_(0, 0)
298#define IP10_11_8 FM(SD3_DAT1) F_(0, 0) F_(0, 0) FM(NFDATA1) 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) 297#define IP10_11_8 FM(SD3_DAT1) F_(0, 0) FM(NFDATA1) 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) F_(0, 0)
299#define IP10_15_12 FM(SD3_DAT2) F_(0, 0) F_(0, 0) FM(NFDATA2) 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) 298#define IP10_15_12 FM(SD3_DAT2) F_(0, 0) FM(NFDATA2) 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) F_(0, 0)
300#define IP10_19_16 FM(SD3_DAT3) F_(0, 0) F_(0, 0) FM(NFDATA3) 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) 299#define IP10_19_16 FM(SD3_DAT3) F_(0, 0) FM(NFDATA3) 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) F_(0, 0)
301#define IP10_23_20 FM(SD3_DAT4) FM(SD2_CD_A) F_(0, 0) FM(NFDATA4) 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) 300#define IP10_23_20 FM(SD3_DAT4) FM(SD2_CD_A) FM(NFDATA4) 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) F_(0, 0)
302#define IP10_27_24 FM(SD3_DAT5) FM(SD2_WP_A) F_(0, 0) FM(NFDATA5) 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) 301#define IP10_27_24 FM(SD3_DAT5) FM(SD2_WP_A) FM(NFDATA5) 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) F_(0, 0)
303#define IP10_31_28 FM(SD3_DAT6) FM(SD3_CD) F_(0, 0) FM(NFDATA6) 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) 302#define IP10_31_28 FM(SD3_DAT6) FM(SD3_CD) FM(NFDATA6) 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) F_(0, 0)
304#define IP11_3_0 FM(SD3_DAT7) FM(SD3_WP) F_(0, 0) FM(NFDATA7) 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) 303#define IP11_3_0 FM(SD3_DAT7) FM(SD3_WP) FM(NFDATA7) 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) F_(0, 0)
305#define IP11_7_4 FM(SD3_DS) F_(0, 0) F_(0, 0) FM(NFCLE) 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) 304#define IP11_7_4 FM(SD3_DS) F_(0, 0) FM(NFCLE) 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) F_(0, 0)
306#define IP11_11_8 FM(SD0_CD) F_(0, 0) FM(NFDATA14_A) F_(0, 0) FM(SCL2_B) FM(SIM0_RST_A) 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) 305#define IP11_11_8 FM(SD0_CD) F_(0, 0) FM(NFDATA14_A) F_(0, 0) FM(SCL2_B) FM(SIM0_RST_A) 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)
307 306
308/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* A */ /* B */ /* C - F */ 307/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* A */ /* B */ /* C - F */
@@ -361,8 +360,8 @@
361#define IP17_23_20 FM(USB1_OVC) F_(0, 0) FM(MSIOF1_SS2_C) F_(0, 0) FM(SSI_WS1_A) FM(TS_SDAT0_E) FM(STP_ISD_0_E) FM(FMIN_B) FM(RIF2_SYNC_B) F_(0, 0) FM(REMOCON_B) F_(0, 0) F_(0, 0) FM(HCTS2_N_C) F_(0, 0) F_(0, 0) 360#define IP17_23_20 FM(USB1_OVC) F_(0, 0) FM(MSIOF1_SS2_C) F_(0, 0) FM(SSI_WS1_A) FM(TS_SDAT0_E) FM(STP_ISD_0_E) FM(FMIN_B) FM(RIF2_SYNC_B) F_(0, 0) FM(REMOCON_B) F_(0, 0) F_(0, 0) FM(HCTS2_N_C) F_(0, 0) F_(0, 0)
362#define IP17_27_24 FM(USB30_PWEN) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT_B) FM(SSI_SCK2_B) FM(TS_SDEN1_D) FM(STP_ISEN_1_D) FM(STP_OPWM_0_E)FM(RIF3_D0_B) F_(0, 0) FM(TCLK2_B) FM(TPU0TO0) FM(BPFCLK_C) FM(HRTS2_N_C) F_(0, 0) F_(0, 0) 361#define IP17_27_24 FM(USB30_PWEN) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT_B) FM(SSI_SCK2_B) FM(TS_SDEN1_D) FM(STP_ISEN_1_D) FM(STP_OPWM_0_E)FM(RIF3_D0_B) F_(0, 0) FM(TCLK2_B) FM(TPU0TO0) FM(BPFCLK_C) FM(HRTS2_N_C) F_(0, 0) F_(0, 0)
363#define IP17_31_28 FM(USB30_OVC) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT1_B) FM(SSI_WS2_B) FM(TS_SPSYNC1_D)FM(STP_ISSYNC_1_D) FM(STP_IVCXO27_0_E)FM(RIF3_D1_B) F_(0, 0) FM(FSO_TOE_N) FM(TPU0TO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 362#define IP17_31_28 FM(USB30_OVC) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT1_B) FM(SSI_WS2_B) FM(TS_SPSYNC1_D)FM(STP_ISSYNC_1_D) FM(STP_IVCXO27_0_E)FM(RIF3_D1_B) F_(0, 0) FM(FSO_TOE_N) FM(TPU0TO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
364#define IP18_3_0 FM(USB3_PWEN) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT2_B) FM(SSI_SCK9_B) FM(TS_SDEN0_E) FM(STP_ISEN_0_E) F_(0, 0) FM(RIF2_D0_B) F_(0, 0) F_(0, 0) FM(TPU0TO2) F_(0, 0) FM(FMCLK_C) FM(FMCLK_D) F_(0, 0) 363#define IP18_3_0 FM(USB2_CH3_PWEN) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT2_B) FM(SSI_SCK9_B) FM(TS_SDEN0_E) FM(STP_ISEN_0_E) F_(0, 0) FM(RIF2_D0_B) F_(0, 0) F_(0, 0) FM(TPU0TO2) FM(FMCLK_C) FM(FMCLK_D) F_(0, 0) F_(0, 0)
365#define IP18_7_4 FM(USB3_OVC) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT3_B) FM(SSI_WS9_B) FM(TS_SPSYNC0_E)FM(STP_ISSYNC_0_E) F_(0, 0) FM(RIF2_D1_B) F_(0, 0) F_(0, 0) FM(TPU0TO3) F_(0, 0) FM(FMIN_C) FM(FMIN_D) F_(0, 0) 364#define IP18_7_4 FM(USB2_CH3_OVC) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT3_B) FM(SSI_WS9_B) FM(TS_SPSYNC0_E)FM(STP_ISSYNC_0_E) F_(0, 0) FM(RIF2_D1_B) F_(0, 0) F_(0, 0) FM(TPU0TO3) FM(FMIN_C) FM(FMIN_D) F_(0, 0) F_(0, 0)
366 365
367#define PINMUX_GPSR \ 366#define PINMUX_GPSR \
368\ 367\
@@ -413,7 +412,7 @@ FM(IP0_31_28) IP0_31_28 FM(IP1_31_28) IP1_31_28 FM(IP2_31_28) IP2_31_28 FM(IP3_3
413FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \ 412FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \
414FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \ 413FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \
415FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \ 414FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \
416FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 FM(IP7_15_12) IP7_15_12 \ 415FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 \
417FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \ 416FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \
418FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \ 417FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \
419FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \ 418FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \
@@ -469,7 +468,7 @@ FM(IP16_31_28) IP16_31_28 FM(IP17_31_28) IP17_31_28
469/* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ 468/* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */
470#define MOD_SEL1_31_30 FM(SEL_TSIF1_0) FM(SEL_TSIF1_1) FM(SEL_TSIF1_2) FM(SEL_TSIF1_3) 469#define MOD_SEL1_31_30 FM(SEL_TSIF1_0) FM(SEL_TSIF1_1) FM(SEL_TSIF1_2) FM(SEL_TSIF1_3)
471#define MOD_SEL1_29_28_27 FM(SEL_TSIF0_0) FM(SEL_TSIF0_1) FM(SEL_TSIF0_2) FM(SEL_TSIF0_3) FM(SEL_TSIF0_4) F_(0, 0) F_(0, 0) F_(0, 0) 470#define MOD_SEL1_29_28_27 FM(SEL_TSIF0_0) FM(SEL_TSIF0_1) FM(SEL_TSIF0_2) FM(SEL_TSIF0_3) FM(SEL_TSIF0_4) F_(0, 0) F_(0, 0) F_(0, 0)
472#define MOD_SEL1_26 FM(SEL_TIMER_TMU_0) FM(SEL_TIMER_TMU_1) 471#define MOD_SEL1_26 FM(SEL_TIMER_TMU1_0) FM(SEL_TIMER_TMU1_1)
473#define MOD_SEL1_25_24 FM(SEL_SSP1_1_0) FM(SEL_SSP1_1_1) FM(SEL_SSP1_1_2) FM(SEL_SSP1_1_3) 472#define MOD_SEL1_25_24 FM(SEL_SSP1_1_0) FM(SEL_SSP1_1_1) FM(SEL_SSP1_1_2) FM(SEL_SSP1_1_3)
474#define MOD_SEL1_23_22_21 FM(SEL_SSP1_0_0) FM(SEL_SSP1_0_1) FM(SEL_SSP1_0_2) FM(SEL_SSP1_0_3) FM(SEL_SSP1_0_4) F_(0, 0) F_(0, 0) F_(0, 0) 473#define MOD_SEL1_23_22_21 FM(SEL_SSP1_0_0) FM(SEL_SSP1_0_1) FM(SEL_SSP1_0_2) FM(SEL_SSP1_0_3) FM(SEL_SSP1_0_4) F_(0, 0) F_(0, 0) F_(0, 0)
475#define MOD_SEL1_20 FM(SEL_SSI_0) FM(SEL_SSI_1) 474#define MOD_SEL1_20 FM(SEL_SSI_0) FM(SEL_SSI_1)
@@ -480,7 +479,7 @@ FM(IP16_31_28) IP16_31_28 FM(IP17_31_28) IP17_31_28
480#define MOD_SEL1_13 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1) 479#define MOD_SEL1_13 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1)
481#define MOD_SEL1_12 FM(SEL_SCIF2_0) FM(SEL_SCIF2_1) 480#define MOD_SEL1_12 FM(SEL_SCIF2_0) FM(SEL_SCIF2_1)
482#define MOD_SEL1_11 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1) 481#define MOD_SEL1_11 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1)
483#define MOD_SEL1_10 FM(SEL_SATA_0) FM(SEL_SATA_1) 482#define MOD_SEL1_10 FM(SEL_SCIF_0) FM(SEL_SCIF_1)
484#define MOD_SEL1_9 FM(SEL_REMOCON_0) FM(SEL_REMOCON_1) 483#define MOD_SEL1_9 FM(SEL_REMOCON_0) FM(SEL_REMOCON_1)
485#define MOD_SEL1_6 FM(SEL_RCAN0_0) FM(SEL_RCAN0_1) 484#define MOD_SEL1_6 FM(SEL_RCAN0_0) FM(SEL_RCAN0_1)
486#define MOD_SEL1_5 FM(SEL_PWM6_0) FM(SEL_PWM6_1) 485#define MOD_SEL1_5 FM(SEL_PWM6_0) FM(SEL_PWM6_1)
@@ -497,7 +496,6 @@ FM(IP16_31_28) IP16_31_28 FM(IP17_31_28) IP17_31_28
497#define MOD_SEL2_28_27 FM(SEL_FM_0) FM(SEL_FM_1) FM(SEL_FM_2) FM(SEL_FM_3) 496#define MOD_SEL2_28_27 FM(SEL_FM_0) FM(SEL_FM_1) FM(SEL_FM_2) FM(SEL_FM_3)
498#define MOD_SEL2_26 FM(SEL_SCIF5_0) FM(SEL_SCIF5_1) 497#define MOD_SEL2_26 FM(SEL_SCIF5_0) FM(SEL_SCIF5_1)
499#define MOD_SEL2_25_24_23 FM(SEL_I2C6_0) FM(SEL_I2C6_1) FM(SEL_I2C6_2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 498#define MOD_SEL2_25_24_23 FM(SEL_I2C6_0) FM(SEL_I2C6_1) FM(SEL_I2C6_2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
500#define MOD_SEL2_22 FM(SEL_NDF_0) FM(SEL_NDF_1)
501#define MOD_SEL2_21 FM(SEL_SSI2_0) FM(SEL_SSI2_1) 499#define MOD_SEL2_21 FM(SEL_SSI2_0) FM(SEL_SSI2_1)
502#define MOD_SEL2_20 FM(SEL_SSI9_0) FM(SEL_SSI9_1) 500#define MOD_SEL2_20 FM(SEL_SSI9_0) FM(SEL_SSI9_1)
503#define MOD_SEL2_19 FM(SEL_TIMER_TMU2_0) FM(SEL_TIMER_TMU2_1) 501#define MOD_SEL2_19 FM(SEL_TIMER_TMU2_0) FM(SEL_TIMER_TMU2_1)
@@ -514,7 +512,7 @@ MOD_SEL0_28_27 MOD_SEL2_28_27 \
514MOD_SEL0_26_25_24 MOD_SEL1_26 MOD_SEL2_26 \ 512MOD_SEL0_26_25_24 MOD_SEL1_26 MOD_SEL2_26 \
515 MOD_SEL1_25_24 MOD_SEL2_25_24_23 \ 513 MOD_SEL1_25_24 MOD_SEL2_25_24_23 \
516MOD_SEL0_23 MOD_SEL1_23_22_21 \ 514MOD_SEL0_23 MOD_SEL1_23_22_21 \
517MOD_SEL0_22 MOD_SEL2_22 \ 515MOD_SEL0_22 \
518MOD_SEL0_21 MOD_SEL2_21 \ 516MOD_SEL0_21 MOD_SEL2_21 \
519MOD_SEL0_20 MOD_SEL1_20 MOD_SEL2_20 \ 517MOD_SEL0_20 MOD_SEL1_20 MOD_SEL2_20 \
520MOD_SEL0_19 MOD_SEL1_19 MOD_SEL2_19 \ 518MOD_SEL0_19 MOD_SEL1_19 MOD_SEL2_19 \
@@ -833,7 +831,7 @@ static const u16 pinmux_data[] = {
833 PINMUX_IPSR_GPSR(IP4_15_12, CS0_N), 831 PINMUX_IPSR_GPSR(IP4_15_12, CS0_N),
834 PINMUX_IPSR_GPSR(IP4_15_12, VI5_CLKENB), 832 PINMUX_IPSR_GPSR(IP4_15_12, VI5_CLKENB),
835 833
836 PINMUX_IPSR_GPSR(IP4_19_16, CS1_N_A26), 834 PINMUX_IPSR_GPSR(IP4_19_16, CS1_N),
837 PINMUX_IPSR_GPSR(IP4_19_16, VI5_CLK), 835 PINMUX_IPSR_GPSR(IP4_19_16, VI5_CLK),
838 PINMUX_IPSR_MSEL(IP4_19_16, EX_WAIT0_B, SEL_LBSC_1), 836 PINMUX_IPSR_MSEL(IP4_19_16, EX_WAIT0_B, SEL_LBSC_1),
839 837
@@ -986,8 +984,6 @@ static const u16 pinmux_data[] = {
986 PINMUX_IPSR_GPSR(IP7_11_8, DU_DR7), 984 PINMUX_IPSR_GPSR(IP7_11_8, DU_DR7),
987 PINMUX_IPSR_MSEL(IP7_11_8, SDA6_C, SEL_I2C6_2), 985 PINMUX_IPSR_MSEL(IP7_11_8, SDA6_C, SEL_I2C6_2),
988 986
989 PINMUX_IPSR_GPSR(IP7_15_12, FSCLKST),
990
991 PINMUX_IPSR_GPSR(IP7_19_16, SD0_CLK), 987 PINMUX_IPSR_GPSR(IP7_19_16, SD0_CLK),
992 PINMUX_IPSR_MSEL(IP7_19_16, MSIOF1_SCK_E, SEL_MSIOF1_4), 988 PINMUX_IPSR_MSEL(IP7_19_16, MSIOF1_SCK_E, SEL_MSIOF1_4),
993 PINMUX_IPSR_MSEL(IP7_19_16, STP_OPWM_0_B, SEL_SSP1_0_1), 989 PINMUX_IPSR_MSEL(IP7_19_16, STP_OPWM_0_B, SEL_SSP1_0_1),
@@ -1023,35 +1019,35 @@ static const u16 pinmux_data[] = {
1023 1019
1024 PINMUX_IPSR_GPSR(IP8_15_12, SD1_CMD), 1020 PINMUX_IPSR_GPSR(IP8_15_12, SD1_CMD),
1025 PINMUX_IPSR_MSEL(IP8_15_12, MSIOF1_SYNC_G, SEL_MSIOF1_6), 1021 PINMUX_IPSR_MSEL(IP8_15_12, MSIOF1_SYNC_G, SEL_MSIOF1_6),
1026 PINMUX_IPSR_MSEL(IP8_15_12, NFCE_N_B, SEL_NDF_1), 1022 PINMUX_IPSR_GPSR(IP8_15_12, NFCE_N_B),
1027 PINMUX_IPSR_MSEL(IP8_15_12, SIM0_D_A, SEL_SIMCARD_0), 1023 PINMUX_IPSR_MSEL(IP8_15_12, SIM0_D_A, SEL_SIMCARD_0),
1028 PINMUX_IPSR_MSEL(IP8_15_12, STP_IVCXO27_1_B, SEL_SSP1_1_1), 1024 PINMUX_IPSR_MSEL(IP8_15_12, STP_IVCXO27_1_B, SEL_SSP1_1_1),
1029 1025
1030 PINMUX_IPSR_GPSR(IP8_19_16, SD1_DAT0), 1026 PINMUX_IPSR_GPSR(IP8_19_16, SD1_DAT0),
1031 PINMUX_IPSR_GPSR(IP8_19_16, SD2_DAT4), 1027 PINMUX_IPSR_GPSR(IP8_19_16, SD2_DAT4),
1032 PINMUX_IPSR_MSEL(IP8_19_16, MSIOF1_RXD_G, SEL_MSIOF1_6), 1028 PINMUX_IPSR_MSEL(IP8_19_16, MSIOF1_RXD_G, SEL_MSIOF1_6),
1033 PINMUX_IPSR_MSEL(IP8_19_16, NFWP_N_B, SEL_NDF_1), 1029 PINMUX_IPSR_GPSR(IP8_19_16, NFWP_N_B),
1034 PINMUX_IPSR_MSEL(IP8_19_16, TS_SCK1_B, SEL_TSIF1_1), 1030 PINMUX_IPSR_MSEL(IP8_19_16, TS_SCK1_B, SEL_TSIF1_1),
1035 PINMUX_IPSR_MSEL(IP8_19_16, STP_ISCLK_1_B, SEL_SSP1_1_1), 1031 PINMUX_IPSR_MSEL(IP8_19_16, STP_ISCLK_1_B, SEL_SSP1_1_1),
1036 1032
1037 PINMUX_IPSR_GPSR(IP8_23_20, SD1_DAT1), 1033 PINMUX_IPSR_GPSR(IP8_23_20, SD1_DAT1),
1038 PINMUX_IPSR_GPSR(IP8_23_20, SD2_DAT5), 1034 PINMUX_IPSR_GPSR(IP8_23_20, SD2_DAT5),
1039 PINMUX_IPSR_MSEL(IP8_23_20, MSIOF1_TXD_G, SEL_MSIOF1_6), 1035 PINMUX_IPSR_MSEL(IP8_23_20, MSIOF1_TXD_G, SEL_MSIOF1_6),
1040 PINMUX_IPSR_MSEL(IP8_23_20, NFDATA14_B, SEL_NDF_1), 1036 PINMUX_IPSR_GPSR(IP8_23_20, NFDATA14_B),
1041 PINMUX_IPSR_MSEL(IP8_23_20, TS_SPSYNC1_B, SEL_TSIF1_1), 1037 PINMUX_IPSR_MSEL(IP8_23_20, TS_SPSYNC1_B, SEL_TSIF1_1),
1042 PINMUX_IPSR_MSEL(IP8_23_20, STP_ISSYNC_1_B, SEL_SSP1_1_1), 1038 PINMUX_IPSR_MSEL(IP8_23_20, STP_ISSYNC_1_B, SEL_SSP1_1_1),
1043 1039
1044 PINMUX_IPSR_GPSR(IP8_27_24, SD1_DAT2), 1040 PINMUX_IPSR_GPSR(IP8_27_24, SD1_DAT2),
1045 PINMUX_IPSR_GPSR(IP8_27_24, SD2_DAT6), 1041 PINMUX_IPSR_GPSR(IP8_27_24, SD2_DAT6),
1046 PINMUX_IPSR_MSEL(IP8_27_24, MSIOF1_SS1_G, SEL_MSIOF1_6), 1042 PINMUX_IPSR_MSEL(IP8_27_24, MSIOF1_SS1_G, SEL_MSIOF1_6),
1047 PINMUX_IPSR_MSEL(IP8_27_24, NFDATA15_B, SEL_NDF_1), 1043 PINMUX_IPSR_GPSR(IP8_27_24, NFDATA15_B),
1048 PINMUX_IPSR_MSEL(IP8_27_24, TS_SDAT1_B, SEL_TSIF1_1), 1044 PINMUX_IPSR_MSEL(IP8_27_24, TS_SDAT1_B, SEL_TSIF1_1),
1049 PINMUX_IPSR_MSEL(IP8_27_24, STP_ISD_1_B, SEL_SSP1_1_1), 1045 PINMUX_IPSR_MSEL(IP8_27_24, STP_ISD_1_B, SEL_SSP1_1_1),
1050 1046
1051 PINMUX_IPSR_GPSR(IP8_31_28, SD1_DAT3), 1047 PINMUX_IPSR_GPSR(IP8_31_28, SD1_DAT3),
1052 PINMUX_IPSR_GPSR(IP8_31_28, SD2_DAT7), 1048 PINMUX_IPSR_GPSR(IP8_31_28, SD2_DAT7),
1053 PINMUX_IPSR_MSEL(IP8_31_28, MSIOF1_SS2_G, SEL_MSIOF1_6), 1049 PINMUX_IPSR_MSEL(IP8_31_28, MSIOF1_SS2_G, SEL_MSIOF1_6),
1054 PINMUX_IPSR_MSEL(IP8_31_28, NFRB_N_B, SEL_NDF_1), 1050 PINMUX_IPSR_GPSR(IP8_31_28, NFRB_N_B),
1055 PINMUX_IPSR_MSEL(IP8_31_28, TS_SDEN1_B, SEL_TSIF1_1), 1051 PINMUX_IPSR_MSEL(IP8_31_28, TS_SDEN1_B, SEL_TSIF1_1),
1056 PINMUX_IPSR_MSEL(IP8_31_28, STP_ISEN_1_B, SEL_SSP1_1_1), 1052 PINMUX_IPSR_MSEL(IP8_31_28, STP_ISEN_1_B, SEL_SSP1_1_1),
1057 1053
@@ -1201,7 +1197,7 @@ static const u16 pinmux_data[] = {
1201 PINMUX_IPSR_GPSR(IP12_27_24, ADICHS0), 1197 PINMUX_IPSR_GPSR(IP12_27_24, ADICHS0),
1202 1198
1203 PINMUX_IPSR_GPSR(IP12_31_28, SCK2), 1199 PINMUX_IPSR_GPSR(IP12_31_28, SCK2),
1204 PINMUX_IPSR_MSEL(IP12_31_28, SCIF_CLK_B, SEL_SCIF1_1), 1200 PINMUX_IPSR_MSEL(IP12_31_28, SCIF_CLK_B, SEL_SCIF_1),
1205 PINMUX_IPSR_MSEL(IP12_31_28, MSIOF1_SCK_B, SEL_MSIOF1_1), 1201 PINMUX_IPSR_MSEL(IP12_31_28, MSIOF1_SCK_B, SEL_MSIOF1_1),
1206 PINMUX_IPSR_MSEL(IP12_31_28, TS_SCK1_C, SEL_TSIF1_2), 1202 PINMUX_IPSR_MSEL(IP12_31_28, TS_SCK1_C, SEL_TSIF1_2),
1207 PINMUX_IPSR_MSEL(IP12_31_28, STP_ISCLK_1_C, SEL_SSP1_1_2), 1203 PINMUX_IPSR_MSEL(IP12_31_28, STP_ISCLK_1_C, SEL_SSP1_1_2),
@@ -1271,12 +1267,12 @@ static const u16 pinmux_data[] = {
1271 /* IPSR14 */ 1267 /* IPSR14 */
1272 PINMUX_IPSR_GPSR(IP14_3_0, MSIOF0_SS1), 1268 PINMUX_IPSR_GPSR(IP14_3_0, MSIOF0_SS1),
1273 PINMUX_IPSR_MSEL(IP14_3_0, RX5_A, SEL_SCIF5_0), 1269 PINMUX_IPSR_MSEL(IP14_3_0, RX5_A, SEL_SCIF5_0),
1274 PINMUX_IPSR_MSEL(IP14_3_0, NFWP_N_A, SEL_NDF_0), 1270 PINMUX_IPSR_GPSR(IP14_3_0, NFWP_N_A),
1275 PINMUX_IPSR_MSEL(IP14_3_0, AUDIO_CLKA_C, SEL_ADG_A_2), 1271 PINMUX_IPSR_MSEL(IP14_3_0, AUDIO_CLKA_C, SEL_ADG_A_2),
1276 PINMUX_IPSR_MSEL(IP14_3_0, SSI_SCK2_A, SEL_SSI_0), 1272 PINMUX_IPSR_MSEL(IP14_3_0, SSI_SCK2_A, SEL_SSI_0),
1277 PINMUX_IPSR_MSEL(IP14_3_0, STP_IVCXO27_0_C, SEL_SSP1_0_2), 1273 PINMUX_IPSR_MSEL(IP14_3_0, STP_IVCXO27_0_C, SEL_SSP1_0_2),
1278 PINMUX_IPSR_GPSR(IP14_3_0, AUDIO_CLKOUT3_A), 1274 PINMUX_IPSR_GPSR(IP14_3_0, AUDIO_CLKOUT3_A),
1279 PINMUX_IPSR_MSEL(IP14_3_0, TCLK1_B, SEL_TIMER_TMU_1), 1275 PINMUX_IPSR_MSEL(IP14_3_0, TCLK1_B, SEL_TIMER_TMU1_1),
1280 1276
1281 PINMUX_IPSR_GPSR(IP14_7_4, MSIOF0_SS2), 1277 PINMUX_IPSR_GPSR(IP14_7_4, MSIOF0_SS2),
1282 PINMUX_IPSR_MSEL(IP14_7_4, TX5_A, SEL_SCIF5_0), 1278 PINMUX_IPSR_MSEL(IP14_7_4, TX5_A, SEL_SCIF5_0),
@@ -1392,7 +1388,7 @@ static const u16 pinmux_data[] = {
1392 PINMUX_IPSR_MSEL(IP16_23_20, STP_ISEN_1_A, SEL_SSP1_1_0), 1388 PINMUX_IPSR_MSEL(IP16_23_20, STP_ISEN_1_A, SEL_SSP1_1_0),
1393 PINMUX_IPSR_MSEL(IP16_23_20, RIF1_D0_A, SEL_DRIF1_0), 1389 PINMUX_IPSR_MSEL(IP16_23_20, RIF1_D0_A, SEL_DRIF1_0),
1394 PINMUX_IPSR_MSEL(IP16_23_20, RIF3_D0_A, SEL_DRIF3_0), 1390 PINMUX_IPSR_MSEL(IP16_23_20, RIF3_D0_A, SEL_DRIF3_0),
1395 PINMUX_IPSR_MSEL(IP16_23_20, TCLK2_A, SEL_TIMER_TMU_0), 1391 PINMUX_IPSR_MSEL(IP16_23_20, TCLK2_A, SEL_TIMER_TMU2_0),
1396 1392
1397 PINMUX_IPSR_GPSR(IP16_27_24, SSI_SDATA8), 1393 PINMUX_IPSR_GPSR(IP16_27_24, SSI_SDATA8),
1398 PINMUX_IPSR_MSEL(IP16_27_24, HRTS2_N_B, SEL_HSCIF2_1), 1394 PINMUX_IPSR_MSEL(IP16_27_24, HRTS2_N_B, SEL_HSCIF2_1),
@@ -1409,17 +1405,17 @@ static const u16 pinmux_data[] = {
1409 PINMUX_IPSR_MSEL(IP16_31_28, SSI_WS1_B, SEL_SSI_1), 1405 PINMUX_IPSR_MSEL(IP16_31_28, SSI_WS1_B, SEL_SSI_1),
1410 PINMUX_IPSR_GPSR(IP16_31_28, SCK1), 1406 PINMUX_IPSR_GPSR(IP16_31_28, SCK1),
1411 PINMUX_IPSR_MSEL(IP16_31_28, STP_IVCXO27_1_A, SEL_SSP1_1_0), 1407 PINMUX_IPSR_MSEL(IP16_31_28, STP_IVCXO27_1_A, SEL_SSP1_1_0),
1412 PINMUX_IPSR_GPSR(IP16_31_28, SCK5_A), 1408 PINMUX_IPSR_MSEL(IP16_31_28, SCK5_A, SEL_SCIF5_0),
1413 1409
1414 /* IPSR17 */ 1410 /* IPSR17 */
1415 PINMUX_IPSR_MSEL(IP17_3_0, AUDIO_CLKA_A, SEL_ADG_A_0), 1411 PINMUX_IPSR_MSEL(IP17_3_0, AUDIO_CLKA_A, SEL_ADG_A_0),
1416 PINMUX_IPSR_GPSR(IP17_3_0, CC5_OSCOUT), 1412 PINMUX_IPSR_GPSR(IP17_3_0, CC5_OSCOUT),
1417 1413
1418 PINMUX_IPSR_MSEL(IP17_7_4, AUDIO_CLKB_B, SEL_ADG_B_1), 1414 PINMUX_IPSR_MSEL(IP17_7_4, AUDIO_CLKB_B, SEL_ADG_B_1),
1419 PINMUX_IPSR_MSEL(IP17_7_4, SCIF_CLK_A, SEL_SCIF1_0), 1415 PINMUX_IPSR_MSEL(IP17_7_4, SCIF_CLK_A, SEL_SCIF_0),
1420 PINMUX_IPSR_MSEL(IP17_7_4, STP_IVCXO27_1_D, SEL_SSP1_1_3), 1416 PINMUX_IPSR_MSEL(IP17_7_4, STP_IVCXO27_1_D, SEL_SSP1_1_3),
1421 PINMUX_IPSR_MSEL(IP17_7_4, REMOCON_A, SEL_REMOCON_0), 1417 PINMUX_IPSR_MSEL(IP17_7_4, REMOCON_A, SEL_REMOCON_0),
1422 PINMUX_IPSR_MSEL(IP17_7_4, TCLK1_A, SEL_TIMER_TMU_0), 1418 PINMUX_IPSR_MSEL(IP17_7_4, TCLK1_A, SEL_TIMER_TMU1_0),
1423 1419
1424 PINMUX_IPSR_GPSR(IP17_11_8, USB0_PWEN), 1420 PINMUX_IPSR_GPSR(IP17_11_8, USB0_PWEN),
1425 PINMUX_IPSR_MSEL(IP17_11_8, SIM0_RST_C, SEL_SIMCARD_2), 1421 PINMUX_IPSR_MSEL(IP17_11_8, SIM0_RST_C, SEL_SIMCARD_2),
@@ -1460,10 +1456,10 @@ static const u16 pinmux_data[] = {
1460 PINMUX_IPSR_GPSR(IP17_27_24, AUDIO_CLKOUT_B), 1456 PINMUX_IPSR_GPSR(IP17_27_24, AUDIO_CLKOUT_B),
1461 PINMUX_IPSR_MSEL(IP17_27_24, SSI_SCK2_B, SEL_SSI_1), 1457 PINMUX_IPSR_MSEL(IP17_27_24, SSI_SCK2_B, SEL_SSI_1),
1462 PINMUX_IPSR_MSEL(IP17_27_24, TS_SDEN1_D, SEL_TSIF1_3), 1458 PINMUX_IPSR_MSEL(IP17_27_24, TS_SDEN1_D, SEL_TSIF1_3),
1463 PINMUX_IPSR_MSEL(IP17_27_24, STP_ISEN_1_D, SEL_SSP1_1_2), 1459 PINMUX_IPSR_MSEL(IP17_27_24, STP_ISEN_1_D, SEL_SSP1_1_3),
1464 PINMUX_IPSR_MSEL(IP17_27_24, STP_OPWM_0_E, SEL_SSP1_0_4), 1460 PINMUX_IPSR_MSEL(IP17_27_24, STP_OPWM_0_E, SEL_SSP1_0_4),
1465 PINMUX_IPSR_MSEL(IP17_27_24, RIF3_D0_B, SEL_DRIF3_1), 1461 PINMUX_IPSR_MSEL(IP17_27_24, RIF3_D0_B, SEL_DRIF3_1),
1466 PINMUX_IPSR_MSEL(IP17_27_24, TCLK2_B, SEL_TIMER_TMU_1), 1462 PINMUX_IPSR_MSEL(IP17_27_24, TCLK2_B, SEL_TIMER_TMU2_1),
1467 PINMUX_IPSR_GPSR(IP17_27_24, TPU0TO0), 1463 PINMUX_IPSR_GPSR(IP17_27_24, TPU0TO0),
1468 PINMUX_IPSR_MSEL(IP17_27_24, BPFCLK_C, SEL_FM_2), 1464 PINMUX_IPSR_MSEL(IP17_27_24, BPFCLK_C, SEL_FM_2),
1469 PINMUX_IPSR_MSEL(IP17_27_24, HRTS2_N_C, SEL_HSCIF2_2), 1465 PINMUX_IPSR_MSEL(IP17_27_24, HRTS2_N_C, SEL_HSCIF2_2),
@@ -1479,7 +1475,7 @@ static const u16 pinmux_data[] = {
1479 PINMUX_IPSR_GPSR(IP17_31_28, TPU0TO1), 1475 PINMUX_IPSR_GPSR(IP17_31_28, TPU0TO1),
1480 1476
1481 /* IPSR18 */ 1477 /* IPSR18 */
1482 PINMUX_IPSR_GPSR(IP18_3_0, USB3_PWEN), 1478 PINMUX_IPSR_GPSR(IP18_3_0, USB2_CH3_PWEN),
1483 PINMUX_IPSR_GPSR(IP18_3_0, AUDIO_CLKOUT2_B), 1479 PINMUX_IPSR_GPSR(IP18_3_0, AUDIO_CLKOUT2_B),
1484 PINMUX_IPSR_MSEL(IP18_3_0, SSI_SCK9_B, SEL_SSI_1), 1480 PINMUX_IPSR_MSEL(IP18_3_0, SSI_SCK9_B, SEL_SSI_1),
1485 PINMUX_IPSR_MSEL(IP18_3_0, TS_SDEN0_E, SEL_TSIF0_4), 1481 PINMUX_IPSR_MSEL(IP18_3_0, TS_SDEN0_E, SEL_TSIF0_4),
@@ -1489,7 +1485,7 @@ static const u16 pinmux_data[] = {
1489 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_C, SEL_FM_2), 1485 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_C, SEL_FM_2),
1490 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_D, SEL_FM_3), 1486 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_D, SEL_FM_3),
1491 1487
1492 PINMUX_IPSR_GPSR(IP18_7_4, USB3_OVC), 1488 PINMUX_IPSR_GPSR(IP18_7_4, USB2_CH3_OVC),
1493 PINMUX_IPSR_GPSR(IP18_7_4, AUDIO_CLKOUT3_B), 1489 PINMUX_IPSR_GPSR(IP18_7_4, AUDIO_CLKOUT3_B),
1494 PINMUX_IPSR_MSEL(IP18_7_4, SSI_WS9_B, SEL_SSI_1), 1490 PINMUX_IPSR_MSEL(IP18_7_4, SSI_WS9_B, SEL_SSI_1),
1495 PINMUX_IPSR_MSEL(IP18_7_4, TS_SPSYNC0_E, SEL_TSIF0_4), 1491 PINMUX_IPSR_MSEL(IP18_7_4, TS_SPSYNC0_E, SEL_TSIF0_4),
@@ -1744,6 +1740,704 @@ static const unsigned int du_disp_mux[] = {
1744 DU_DISP_MARK, 1740 DU_DISP_MARK,
1745}; 1741};
1746 1742
1743/* - MSIOF0 ----------------------------------------------------------------- */
1744static const unsigned int msiof0_clk_pins[] = {
1745 /* SCK */
1746 RCAR_GP_PIN(5, 17),
1747};
1748static const unsigned int msiof0_clk_mux[] = {
1749 MSIOF0_SCK_MARK,
1750};
1751static const unsigned int msiof0_sync_pins[] = {
1752 /* SYNC */
1753 RCAR_GP_PIN(5, 18),
1754};
1755static const unsigned int msiof0_sync_mux[] = {
1756 MSIOF0_SYNC_MARK,
1757};
1758static const unsigned int msiof0_ss1_pins[] = {
1759 /* SS1 */
1760 RCAR_GP_PIN(5, 19),
1761};
1762static const unsigned int msiof0_ss1_mux[] = {
1763 MSIOF0_SS1_MARK,
1764};
1765static const unsigned int msiof0_ss2_pins[] = {
1766 /* SS2 */
1767 RCAR_GP_PIN(5, 21),
1768};
1769static const unsigned int msiof0_ss2_mux[] = {
1770 MSIOF0_SS2_MARK,
1771};
1772static const unsigned int msiof0_txd_pins[] = {
1773 /* TXD */
1774 RCAR_GP_PIN(5, 20),
1775};
1776static const unsigned int msiof0_txd_mux[] = {
1777 MSIOF0_TXD_MARK,
1778};
1779static const unsigned int msiof0_rxd_pins[] = {
1780 /* RXD */
1781 RCAR_GP_PIN(5, 22),
1782};
1783static const unsigned int msiof0_rxd_mux[] = {
1784 MSIOF0_RXD_MARK,
1785};
1786/* - MSIOF1 ----------------------------------------------------------------- */
1787static const unsigned int msiof1_clk_a_pins[] = {
1788 /* SCK */
1789 RCAR_GP_PIN(6, 8),
1790};
1791static const unsigned int msiof1_clk_a_mux[] = {
1792 MSIOF1_SCK_A_MARK,
1793};
1794static const unsigned int msiof1_sync_a_pins[] = {
1795 /* SYNC */
1796 RCAR_GP_PIN(6, 9),
1797};
1798static const unsigned int msiof1_sync_a_mux[] = {
1799 MSIOF1_SYNC_A_MARK,
1800};
1801static const unsigned int msiof1_ss1_a_pins[] = {
1802 /* SS1 */
1803 RCAR_GP_PIN(6, 5),
1804};
1805static const unsigned int msiof1_ss1_a_mux[] = {
1806 MSIOF1_SS1_A_MARK,
1807};
1808static const unsigned int msiof1_ss2_a_pins[] = {
1809 /* SS2 */
1810 RCAR_GP_PIN(6, 6),
1811};
1812static const unsigned int msiof1_ss2_a_mux[] = {
1813 MSIOF1_SS2_A_MARK,
1814};
1815static const unsigned int msiof1_txd_a_pins[] = {
1816 /* TXD */
1817 RCAR_GP_PIN(6, 7),
1818};
1819static const unsigned int msiof1_txd_a_mux[] = {
1820 MSIOF1_TXD_A_MARK,
1821};
1822static const unsigned int msiof1_rxd_a_pins[] = {
1823 /* RXD */
1824 RCAR_GP_PIN(6, 10),
1825};
1826static const unsigned int msiof1_rxd_a_mux[] = {
1827 MSIOF1_RXD_A_MARK,
1828};
1829static const unsigned int msiof1_clk_b_pins[] = {
1830 /* SCK */
1831 RCAR_GP_PIN(5, 9),
1832};
1833static const unsigned int msiof1_clk_b_mux[] = {
1834 MSIOF1_SCK_B_MARK,
1835};
1836static const unsigned int msiof1_sync_b_pins[] = {
1837 /* SYNC */
1838 RCAR_GP_PIN(5, 3),
1839};
1840static const unsigned int msiof1_sync_b_mux[] = {
1841 MSIOF1_SYNC_B_MARK,
1842};
1843static const unsigned int msiof1_ss1_b_pins[] = {
1844 /* SS1 */
1845 RCAR_GP_PIN(5, 4),
1846};
1847static const unsigned int msiof1_ss1_b_mux[] = {
1848 MSIOF1_SS1_B_MARK,
1849};
1850static const unsigned int msiof1_ss2_b_pins[] = {
1851 /* SS2 */
1852 RCAR_GP_PIN(5, 0),
1853};
1854static const unsigned int msiof1_ss2_b_mux[] = {
1855 MSIOF1_SS2_B_MARK,
1856};
1857static const unsigned int msiof1_txd_b_pins[] = {
1858 /* TXD */
1859 RCAR_GP_PIN(5, 8),
1860};
1861static const unsigned int msiof1_txd_b_mux[] = {
1862 MSIOF1_TXD_B_MARK,
1863};
1864static const unsigned int msiof1_rxd_b_pins[] = {
1865 /* RXD */
1866 RCAR_GP_PIN(5, 7),
1867};
1868static const unsigned int msiof1_rxd_b_mux[] = {
1869 MSIOF1_RXD_B_MARK,
1870};
1871static const unsigned int msiof1_clk_c_pins[] = {
1872 /* SCK */
1873 RCAR_GP_PIN(6, 17),
1874};
1875static const unsigned int msiof1_clk_c_mux[] = {
1876 MSIOF1_SCK_C_MARK,
1877};
1878static const unsigned int msiof1_sync_c_pins[] = {
1879 /* SYNC */
1880 RCAR_GP_PIN(6, 18),
1881};
1882static const unsigned int msiof1_sync_c_mux[] = {
1883 MSIOF1_SYNC_C_MARK,
1884};
1885static const unsigned int msiof1_ss1_c_pins[] = {
1886 /* SS1 */
1887 RCAR_GP_PIN(6, 21),
1888};
1889static const unsigned int msiof1_ss1_c_mux[] = {
1890 MSIOF1_SS1_C_MARK,
1891};
1892static const unsigned int msiof1_ss2_c_pins[] = {
1893 /* SS2 */
1894 RCAR_GP_PIN(6, 27),
1895};
1896static const unsigned int msiof1_ss2_c_mux[] = {
1897 MSIOF1_SS2_C_MARK,
1898};
1899static const unsigned int msiof1_txd_c_pins[] = {
1900 /* TXD */
1901 RCAR_GP_PIN(6, 20),
1902};
1903static const unsigned int msiof1_txd_c_mux[] = {
1904 MSIOF1_TXD_C_MARK,
1905};
1906static const unsigned int msiof1_rxd_c_pins[] = {
1907 /* RXD */
1908 RCAR_GP_PIN(6, 19),
1909};
1910static const unsigned int msiof1_rxd_c_mux[] = {
1911 MSIOF1_RXD_C_MARK,
1912};
1913static const unsigned int msiof1_clk_d_pins[] = {
1914 /* SCK */
1915 RCAR_GP_PIN(5, 12),
1916};
1917static const unsigned int msiof1_clk_d_mux[] = {
1918 MSIOF1_SCK_D_MARK,
1919};
1920static const unsigned int msiof1_sync_d_pins[] = {
1921 /* SYNC */
1922 RCAR_GP_PIN(5, 15),
1923};
1924static const unsigned int msiof1_sync_d_mux[] = {
1925 MSIOF1_SYNC_D_MARK,
1926};
1927static const unsigned int msiof1_ss1_d_pins[] = {
1928 /* SS1 */
1929 RCAR_GP_PIN(5, 16),
1930};
1931static const unsigned int msiof1_ss1_d_mux[] = {
1932 MSIOF1_SS1_D_MARK,
1933};
1934static const unsigned int msiof1_ss2_d_pins[] = {
1935 /* SS2 */
1936 RCAR_GP_PIN(5, 21),
1937};
1938static const unsigned int msiof1_ss2_d_mux[] = {
1939 MSIOF1_SS2_D_MARK,
1940};
1941static const unsigned int msiof1_txd_d_pins[] = {
1942 /* TXD */
1943 RCAR_GP_PIN(5, 14),
1944};
1945static const unsigned int msiof1_txd_d_mux[] = {
1946 MSIOF1_TXD_D_MARK,
1947};
1948static const unsigned int msiof1_rxd_d_pins[] = {
1949 /* RXD */
1950 RCAR_GP_PIN(5, 13),
1951};
1952static const unsigned int msiof1_rxd_d_mux[] = {
1953 MSIOF1_RXD_D_MARK,
1954};
1955static const unsigned int msiof1_clk_e_pins[] = {
1956 /* SCK */
1957 RCAR_GP_PIN(3, 0),
1958};
1959static const unsigned int msiof1_clk_e_mux[] = {
1960 MSIOF1_SCK_E_MARK,
1961};
1962static const unsigned int msiof1_sync_e_pins[] = {
1963 /* SYNC */
1964 RCAR_GP_PIN(3, 1),
1965};
1966static const unsigned int msiof1_sync_e_mux[] = {
1967 MSIOF1_SYNC_E_MARK,
1968};
1969static const unsigned int msiof1_ss1_e_pins[] = {
1970 /* SS1 */
1971 RCAR_GP_PIN(3, 4),
1972};
1973static const unsigned int msiof1_ss1_e_mux[] = {
1974 MSIOF1_SS1_E_MARK,
1975};
1976static const unsigned int msiof1_ss2_e_pins[] = {
1977 /* SS2 */
1978 RCAR_GP_PIN(3, 5),
1979};
1980static const unsigned int msiof1_ss2_e_mux[] = {
1981 MSIOF1_SS2_E_MARK,
1982};
1983static const unsigned int msiof1_txd_e_pins[] = {
1984 /* TXD */
1985 RCAR_GP_PIN(3, 3),
1986};
1987static const unsigned int msiof1_txd_e_mux[] = {
1988 MSIOF1_TXD_E_MARK,
1989};
1990static const unsigned int msiof1_rxd_e_pins[] = {
1991 /* RXD */
1992 RCAR_GP_PIN(3, 2),
1993};
1994static const unsigned int msiof1_rxd_e_mux[] = {
1995 MSIOF1_RXD_E_MARK,
1996};
1997static const unsigned int msiof1_clk_f_pins[] = {
1998 /* SCK */
1999 RCAR_GP_PIN(5, 23),
2000};
2001static const unsigned int msiof1_clk_f_mux[] = {
2002 MSIOF1_SCK_F_MARK,
2003};
2004static const unsigned int msiof1_sync_f_pins[] = {
2005 /* SYNC */
2006 RCAR_GP_PIN(5, 24),
2007};
2008static const unsigned int msiof1_sync_f_mux[] = {
2009 MSIOF1_SYNC_F_MARK,
2010};
2011static const unsigned int msiof1_ss1_f_pins[] = {
2012 /* SS1 */
2013 RCAR_GP_PIN(6, 1),
2014};
2015static const unsigned int msiof1_ss1_f_mux[] = {
2016 MSIOF1_SS1_F_MARK,
2017};
2018static const unsigned int msiof1_ss2_f_pins[] = {
2019 /* SS2 */
2020 RCAR_GP_PIN(6, 2),
2021};
2022static const unsigned int msiof1_ss2_f_mux[] = {
2023 MSIOF1_SS2_F_MARK,
2024};
2025static const unsigned int msiof1_txd_f_pins[] = {
2026 /* TXD */
2027 RCAR_GP_PIN(6, 0),
2028};
2029static const unsigned int msiof1_txd_f_mux[] = {
2030 MSIOF1_TXD_F_MARK,
2031};
2032static const unsigned int msiof1_rxd_f_pins[] = {
2033 /* RXD */
2034 RCAR_GP_PIN(5, 25),
2035};
2036static const unsigned int msiof1_rxd_f_mux[] = {
2037 MSIOF1_RXD_F_MARK,
2038};
2039static const unsigned int msiof1_clk_g_pins[] = {
2040 /* SCK */
2041 RCAR_GP_PIN(3, 6),
2042};
2043static const unsigned int msiof1_clk_g_mux[] = {
2044 MSIOF1_SCK_G_MARK,
2045};
2046static const unsigned int msiof1_sync_g_pins[] = {
2047 /* SYNC */
2048 RCAR_GP_PIN(3, 7),
2049};
2050static const unsigned int msiof1_sync_g_mux[] = {
2051 MSIOF1_SYNC_G_MARK,
2052};
2053static const unsigned int msiof1_ss1_g_pins[] = {
2054 /* SS1 */
2055 RCAR_GP_PIN(3, 10),
2056};
2057static const unsigned int msiof1_ss1_g_mux[] = {
2058 MSIOF1_SS1_G_MARK,
2059};
2060static const unsigned int msiof1_ss2_g_pins[] = {
2061 /* SS2 */
2062 RCAR_GP_PIN(3, 11),
2063};
2064static const unsigned int msiof1_ss2_g_mux[] = {
2065 MSIOF1_SS2_G_MARK,
2066};
2067static const unsigned int msiof1_txd_g_pins[] = {
2068 /* TXD */
2069 RCAR_GP_PIN(3, 9),
2070};
2071static const unsigned int msiof1_txd_g_mux[] = {
2072 MSIOF1_TXD_G_MARK,
2073};
2074static const unsigned int msiof1_rxd_g_pins[] = {
2075 /* RXD */
2076 RCAR_GP_PIN(3, 8),
2077};
2078static const unsigned int msiof1_rxd_g_mux[] = {
2079 MSIOF1_RXD_G_MARK,
2080};
2081/* - MSIOF2 ----------------------------------------------------------------- */
2082static const unsigned int msiof2_clk_a_pins[] = {
2083 /* SCK */
2084 RCAR_GP_PIN(1, 9),
2085};
2086static const unsigned int msiof2_clk_a_mux[] = {
2087 MSIOF2_SCK_A_MARK,
2088};
2089static const unsigned int msiof2_sync_a_pins[] = {
2090 /* SYNC */
2091 RCAR_GP_PIN(1, 8),
2092};
2093static const unsigned int msiof2_sync_a_mux[] = {
2094 MSIOF2_SYNC_A_MARK,
2095};
2096static const unsigned int msiof2_ss1_a_pins[] = {
2097 /* SS1 */
2098 RCAR_GP_PIN(1, 6),
2099};
2100static const unsigned int msiof2_ss1_a_mux[] = {
2101 MSIOF2_SS1_A_MARK,
2102};
2103static const unsigned int msiof2_ss2_a_pins[] = {
2104 /* SS2 */
2105 RCAR_GP_PIN(1, 7),
2106};
2107static const unsigned int msiof2_ss2_a_mux[] = {
2108 MSIOF2_SS2_A_MARK,
2109};
2110static const unsigned int msiof2_txd_a_pins[] = {
2111 /* TXD */
2112 RCAR_GP_PIN(1, 11),
2113};
2114static const unsigned int msiof2_txd_a_mux[] = {
2115 MSIOF2_TXD_A_MARK,
2116};
2117static const unsigned int msiof2_rxd_a_pins[] = {
2118 /* RXD */
2119 RCAR_GP_PIN(1, 10),
2120};
2121static const unsigned int msiof2_rxd_a_mux[] = {
2122 MSIOF2_RXD_A_MARK,
2123};
2124static const unsigned int msiof2_clk_b_pins[] = {
2125 /* SCK */
2126 RCAR_GP_PIN(0, 4),
2127};
2128static const unsigned int msiof2_clk_b_mux[] = {
2129 MSIOF2_SCK_B_MARK,
2130};
2131static const unsigned int msiof2_sync_b_pins[] = {
2132 /* SYNC */
2133 RCAR_GP_PIN(0, 5),
2134};
2135static const unsigned int msiof2_sync_b_mux[] = {
2136 MSIOF2_SYNC_B_MARK,
2137};
2138static const unsigned int msiof2_ss1_b_pins[] = {
2139 /* SS1 */
2140 RCAR_GP_PIN(0, 0),
2141};
2142static const unsigned int msiof2_ss1_b_mux[] = {
2143 MSIOF2_SS1_B_MARK,
2144};
2145static const unsigned int msiof2_ss2_b_pins[] = {
2146 /* SS2 */
2147 RCAR_GP_PIN(0, 1),
2148};
2149static const unsigned int msiof2_ss2_b_mux[] = {
2150 MSIOF2_SS2_B_MARK,
2151};
2152static const unsigned int msiof2_txd_b_pins[] = {
2153 /* TXD */
2154 RCAR_GP_PIN(0, 7),
2155};
2156static const unsigned int msiof2_txd_b_mux[] = {
2157 MSIOF2_TXD_B_MARK,
2158};
2159static const unsigned int msiof2_rxd_b_pins[] = {
2160 /* RXD */
2161 RCAR_GP_PIN(0, 6),
2162};
2163static const unsigned int msiof2_rxd_b_mux[] = {
2164 MSIOF2_RXD_B_MARK,
2165};
2166static const unsigned int msiof2_clk_c_pins[] = {
2167 /* SCK */
2168 RCAR_GP_PIN(2, 12),
2169};
2170static const unsigned int msiof2_clk_c_mux[] = {
2171 MSIOF2_SCK_C_MARK,
2172};
2173static const unsigned int msiof2_sync_c_pins[] = {
2174 /* SYNC */
2175 RCAR_GP_PIN(2, 11),
2176};
2177static const unsigned int msiof2_sync_c_mux[] = {
2178 MSIOF2_SYNC_C_MARK,
2179};
2180static const unsigned int msiof2_ss1_c_pins[] = {
2181 /* SS1 */
2182 RCAR_GP_PIN(2, 10),
2183};
2184static const unsigned int msiof2_ss1_c_mux[] = {
2185 MSIOF2_SS1_C_MARK,
2186};
2187static const unsigned int msiof2_ss2_c_pins[] = {
2188 /* SS2 */
2189 RCAR_GP_PIN(2, 9),
2190};
2191static const unsigned int msiof2_ss2_c_mux[] = {
2192 MSIOF2_SS2_C_MARK,
2193};
2194static const unsigned int msiof2_txd_c_pins[] = {
2195 /* TXD */
2196 RCAR_GP_PIN(2, 14),
2197};
2198static const unsigned int msiof2_txd_c_mux[] = {
2199 MSIOF2_TXD_C_MARK,
2200};
2201static const unsigned int msiof2_rxd_c_pins[] = {
2202 /* RXD */
2203 RCAR_GP_PIN(2, 13),
2204};
2205static const unsigned int msiof2_rxd_c_mux[] = {
2206 MSIOF2_RXD_C_MARK,
2207};
2208static const unsigned int msiof2_clk_d_pins[] = {
2209 /* SCK */
2210 RCAR_GP_PIN(0, 8),
2211};
2212static const unsigned int msiof2_clk_d_mux[] = {
2213 MSIOF2_SCK_D_MARK,
2214};
2215static const unsigned int msiof2_sync_d_pins[] = {
2216 /* SYNC */
2217 RCAR_GP_PIN(0, 9),
2218};
2219static const unsigned int msiof2_sync_d_mux[] = {
2220 MSIOF2_SYNC_D_MARK,
2221};
2222static const unsigned int msiof2_ss1_d_pins[] = {
2223 /* SS1 */
2224 RCAR_GP_PIN(0, 12),
2225};
2226static const unsigned int msiof2_ss1_d_mux[] = {
2227 MSIOF2_SS1_D_MARK,
2228};
2229static const unsigned int msiof2_ss2_d_pins[] = {
2230 /* SS2 */
2231 RCAR_GP_PIN(0, 13),
2232};
2233static const unsigned int msiof2_ss2_d_mux[] = {
2234 MSIOF2_SS2_D_MARK,
2235};
2236static const unsigned int msiof2_txd_d_pins[] = {
2237 /* TXD */
2238 RCAR_GP_PIN(0, 11),
2239};
2240static const unsigned int msiof2_txd_d_mux[] = {
2241 MSIOF2_TXD_D_MARK,
2242};
2243static const unsigned int msiof2_rxd_d_pins[] = {
2244 /* RXD */
2245 RCAR_GP_PIN(0, 10),
2246};
2247static const unsigned int msiof2_rxd_d_mux[] = {
2248 MSIOF2_RXD_D_MARK,
2249};
2250/* - MSIOF3 ----------------------------------------------------------------- */
2251static const unsigned int msiof3_clk_a_pins[] = {
2252 /* SCK */
2253 RCAR_GP_PIN(0, 0),
2254};
2255static const unsigned int msiof3_clk_a_mux[] = {
2256 MSIOF3_SCK_A_MARK,
2257};
2258static const unsigned int msiof3_sync_a_pins[] = {
2259 /* SYNC */
2260 RCAR_GP_PIN(0, 1),
2261};
2262static const unsigned int msiof3_sync_a_mux[] = {
2263 MSIOF3_SYNC_A_MARK,
2264};
2265static const unsigned int msiof3_ss1_a_pins[] = {
2266 /* SS1 */
2267 RCAR_GP_PIN(0, 14),
2268};
2269static const unsigned int msiof3_ss1_a_mux[] = {
2270 MSIOF3_SS1_A_MARK,
2271};
2272static const unsigned int msiof3_ss2_a_pins[] = {
2273 /* SS2 */
2274 RCAR_GP_PIN(0, 15),
2275};
2276static const unsigned int msiof3_ss2_a_mux[] = {
2277 MSIOF3_SS2_A_MARK,
2278};
2279static const unsigned int msiof3_txd_a_pins[] = {
2280 /* TXD */
2281 RCAR_GP_PIN(0, 3),
2282};
2283static const unsigned int msiof3_txd_a_mux[] = {
2284 MSIOF3_TXD_A_MARK,
2285};
2286static const unsigned int msiof3_rxd_a_pins[] = {
2287 /* RXD */
2288 RCAR_GP_PIN(0, 2),
2289};
2290static const unsigned int msiof3_rxd_a_mux[] = {
2291 MSIOF3_RXD_A_MARK,
2292};
2293static const unsigned int msiof3_clk_b_pins[] = {
2294 /* SCK */
2295 RCAR_GP_PIN(1, 2),
2296};
2297static const unsigned int msiof3_clk_b_mux[] = {
2298 MSIOF3_SCK_B_MARK,
2299};
2300static const unsigned int msiof3_sync_b_pins[] = {
2301 /* SYNC */
2302 RCAR_GP_PIN(1, 0),
2303};
2304static const unsigned int msiof3_sync_b_mux[] = {
2305 MSIOF3_SYNC_B_MARK,
2306};
2307static const unsigned int msiof3_ss1_b_pins[] = {
2308 /* SS1 */
2309 RCAR_GP_PIN(1, 4),
2310};
2311static const unsigned int msiof3_ss1_b_mux[] = {
2312 MSIOF3_SS1_B_MARK,
2313};
2314static const unsigned int msiof3_ss2_b_pins[] = {
2315 /* SS2 */
2316 RCAR_GP_PIN(1, 5),
2317};
2318static const unsigned int msiof3_ss2_b_mux[] = {
2319 MSIOF3_SS2_B_MARK,
2320};
2321static const unsigned int msiof3_txd_b_pins[] = {
2322 /* TXD */
2323 RCAR_GP_PIN(1, 1),
2324};
2325static const unsigned int msiof3_txd_b_mux[] = {
2326 MSIOF3_TXD_B_MARK,
2327};
2328static const unsigned int msiof3_rxd_b_pins[] = {
2329 /* RXD */
2330 RCAR_GP_PIN(1, 3),
2331};
2332static const unsigned int msiof3_rxd_b_mux[] = {
2333 MSIOF3_RXD_B_MARK,
2334};
2335static const unsigned int msiof3_clk_c_pins[] = {
2336 /* SCK */
2337 RCAR_GP_PIN(1, 12),
2338};
2339static const unsigned int msiof3_clk_c_mux[] = {
2340 MSIOF3_SCK_C_MARK,
2341};
2342static const unsigned int msiof3_sync_c_pins[] = {
2343 /* SYNC */
2344 RCAR_GP_PIN(1, 13),
2345};
2346static const unsigned int msiof3_sync_c_mux[] = {
2347 MSIOF3_SYNC_C_MARK,
2348};
2349static const unsigned int msiof3_txd_c_pins[] = {
2350 /* TXD */
2351 RCAR_GP_PIN(1, 15),
2352};
2353static const unsigned int msiof3_txd_c_mux[] = {
2354 MSIOF3_TXD_C_MARK,
2355};
2356static const unsigned int msiof3_rxd_c_pins[] = {
2357 /* RXD */
2358 RCAR_GP_PIN(1, 14),
2359};
2360static const unsigned int msiof3_rxd_c_mux[] = {
2361 MSIOF3_RXD_C_MARK,
2362};
2363static const unsigned int msiof3_clk_d_pins[] = {
2364 /* SCK */
2365 RCAR_GP_PIN(1, 22),
2366};
2367static const unsigned int msiof3_clk_d_mux[] = {
2368 MSIOF3_SCK_D_MARK,
2369};
2370static const unsigned int msiof3_sync_d_pins[] = {
2371 /* SYNC */
2372 RCAR_GP_PIN(1, 23),
2373};
2374static const unsigned int msiof3_sync_d_mux[] = {
2375 MSIOF3_SYNC_D_MARK,
2376};
2377static const unsigned int msiof3_ss1_d_pins[] = {
2378 /* SS1 */
2379 RCAR_GP_PIN(1, 26),
2380};
2381static const unsigned int msiof3_ss1_d_mux[] = {
2382 MSIOF3_SS1_D_MARK,
2383};
2384static const unsigned int msiof3_txd_d_pins[] = {
2385 /* TXD */
2386 RCAR_GP_PIN(1, 25),
2387};
2388static const unsigned int msiof3_txd_d_mux[] = {
2389 MSIOF3_TXD_D_MARK,
2390};
2391static const unsigned int msiof3_rxd_d_pins[] = {
2392 /* RXD */
2393 RCAR_GP_PIN(1, 24),
2394};
2395static const unsigned int msiof3_rxd_d_mux[] = {
2396 MSIOF3_RXD_D_MARK,
2397};
2398static const unsigned int msiof3_clk_e_pins[] = {
2399 /* SCK */
2400 RCAR_GP_PIN(2, 3),
2401};
2402static const unsigned int msiof3_clk_e_mux[] = {
2403 MSIOF3_SCK_E_MARK,
2404};
2405static const unsigned int msiof3_sync_e_pins[] = {
2406 /* SYNC */
2407 RCAR_GP_PIN(2, 2),
2408};
2409static const unsigned int msiof3_sync_e_mux[] = {
2410 MSIOF3_SYNC_E_MARK,
2411};
2412static const unsigned int msiof3_ss1_e_pins[] = {
2413 /* SS1 */
2414 RCAR_GP_PIN(2, 1),
2415};
2416static const unsigned int msiof3_ss1_e_mux[] = {
2417 MSIOF3_SS1_E_MARK,
2418};
2419static const unsigned int msiof3_ss2_e_pins[] = {
2420 /* SS1 */
2421 RCAR_GP_PIN(2, 0),
2422};
2423static const unsigned int msiof3_ss2_e_mux[] = {
2424 MSIOF3_SS2_E_MARK,
2425};
2426static const unsigned int msiof3_txd_e_pins[] = {
2427 /* TXD */
2428 RCAR_GP_PIN(2, 5),
2429};
2430static const unsigned int msiof3_txd_e_mux[] = {
2431 MSIOF3_TXD_E_MARK,
2432};
2433static const unsigned int msiof3_rxd_e_pins[] = {
2434 /* RXD */
2435 RCAR_GP_PIN(2, 4),
2436};
2437static const unsigned int msiof3_rxd_e_mux[] = {
2438 MSIOF3_RXD_E_MARK,
2439};
2440
1747/* - PWM0 --------------------------------------------------------------------*/ 2441/* - PWM0 --------------------------------------------------------------------*/
1748static const unsigned int pwm0_pins[] = { 2442static const unsigned int pwm0_pins[] = {
1749 /* PWM */ 2443 /* PWM */
@@ -2056,6 +2750,39 @@ static const unsigned int scif_clk_b_mux[] = {
2056 SCIF_CLK_B_MARK, 2750 SCIF_CLK_B_MARK,
2057}; 2751};
2058 2752
2753/* - USB0 ------------------------------------------------------------------- */
2754static const unsigned int usb0_pins[] = {
2755 /* PWEN, OVC */
2756 RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
2757};
2758static const unsigned int usb0_mux[] = {
2759 USB0_PWEN_MARK, USB0_OVC_MARK,
2760};
2761/* - USB1 ------------------------------------------------------------------- */
2762static const unsigned int usb1_pins[] = {
2763 /* PWEN, OVC */
2764 RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
2765};
2766static const unsigned int usb1_mux[] = {
2767 USB1_PWEN_MARK, USB1_OVC_MARK,
2768};
2769/* - USB2 ------------------------------------------------------------------- */
2770static const unsigned int usb2_pins[] = {
2771 /* PWEN, OVC */
2772 RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15),
2773};
2774static const unsigned int usb2_mux[] = {
2775 USB2_PWEN_MARK, USB2_OVC_MARK,
2776};
2777/* - USB2_CH3 --------------------------------------------------------------- */
2778static const unsigned int usb2_ch3_pins[] = {
2779 /* PWEN, OVC */
2780 RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
2781};
2782static const unsigned int usb2_ch3_mux[] = {
2783 USB2_CH3_PWEN_MARK, USB2_CH3_OVC_MARK,
2784};
2785
2059static const struct sh_pfc_pin_group pinmux_groups[] = { 2786static const struct sh_pfc_pin_group pinmux_groups[] = {
2060 SH_PFC_PIN_GROUP(avb_link), 2787 SH_PFC_PIN_GROUP(avb_link),
2061 SH_PFC_PIN_GROUP(avb_magic), 2788 SH_PFC_PIN_GROUP(avb_magic),
@@ -2075,6 +2802,105 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
2075 SH_PFC_PIN_GROUP(du_oddf), 2802 SH_PFC_PIN_GROUP(du_oddf),
2076 SH_PFC_PIN_GROUP(du_cde), 2803 SH_PFC_PIN_GROUP(du_cde),
2077 SH_PFC_PIN_GROUP(du_disp), 2804 SH_PFC_PIN_GROUP(du_disp),
2805 SH_PFC_PIN_GROUP(msiof0_clk),
2806 SH_PFC_PIN_GROUP(msiof0_sync),
2807 SH_PFC_PIN_GROUP(msiof0_ss1),
2808 SH_PFC_PIN_GROUP(msiof0_ss2),
2809 SH_PFC_PIN_GROUP(msiof0_txd),
2810 SH_PFC_PIN_GROUP(msiof0_rxd),
2811 SH_PFC_PIN_GROUP(msiof1_clk_a),
2812 SH_PFC_PIN_GROUP(msiof1_sync_a),
2813 SH_PFC_PIN_GROUP(msiof1_ss1_a),
2814 SH_PFC_PIN_GROUP(msiof1_ss2_a),
2815 SH_PFC_PIN_GROUP(msiof1_txd_a),
2816 SH_PFC_PIN_GROUP(msiof1_rxd_a),
2817 SH_PFC_PIN_GROUP(msiof1_clk_b),
2818 SH_PFC_PIN_GROUP(msiof1_sync_b),
2819 SH_PFC_PIN_GROUP(msiof1_ss1_b),
2820 SH_PFC_PIN_GROUP(msiof1_ss2_b),
2821 SH_PFC_PIN_GROUP(msiof1_txd_b),
2822 SH_PFC_PIN_GROUP(msiof1_rxd_b),
2823 SH_PFC_PIN_GROUP(msiof1_clk_c),
2824 SH_PFC_PIN_GROUP(msiof1_sync_c),
2825 SH_PFC_PIN_GROUP(msiof1_ss1_c),
2826 SH_PFC_PIN_GROUP(msiof1_ss2_c),
2827 SH_PFC_PIN_GROUP(msiof1_txd_c),
2828 SH_PFC_PIN_GROUP(msiof1_rxd_c),
2829 SH_PFC_PIN_GROUP(msiof1_clk_d),
2830 SH_PFC_PIN_GROUP(msiof1_sync_d),
2831 SH_PFC_PIN_GROUP(msiof1_ss1_d),
2832 SH_PFC_PIN_GROUP(msiof1_ss2_d),
2833 SH_PFC_PIN_GROUP(msiof1_txd_d),
2834 SH_PFC_PIN_GROUP(msiof1_rxd_d),
2835 SH_PFC_PIN_GROUP(msiof1_clk_e),
2836 SH_PFC_PIN_GROUP(msiof1_sync_e),
2837 SH_PFC_PIN_GROUP(msiof1_ss1_e),
2838 SH_PFC_PIN_GROUP(msiof1_ss2_e),
2839 SH_PFC_PIN_GROUP(msiof1_txd_e),
2840 SH_PFC_PIN_GROUP(msiof1_rxd_e),
2841 SH_PFC_PIN_GROUP(msiof1_clk_f),
2842 SH_PFC_PIN_GROUP(msiof1_sync_f),
2843 SH_PFC_PIN_GROUP(msiof1_ss1_f),
2844 SH_PFC_PIN_GROUP(msiof1_ss2_f),
2845 SH_PFC_PIN_GROUP(msiof1_txd_f),
2846 SH_PFC_PIN_GROUP(msiof1_rxd_f),
2847 SH_PFC_PIN_GROUP(msiof1_clk_g),
2848 SH_PFC_PIN_GROUP(msiof1_sync_g),
2849 SH_PFC_PIN_GROUP(msiof1_ss1_g),
2850 SH_PFC_PIN_GROUP(msiof1_ss2_g),
2851 SH_PFC_PIN_GROUP(msiof1_txd_g),
2852 SH_PFC_PIN_GROUP(msiof1_rxd_g),
2853 SH_PFC_PIN_GROUP(msiof2_clk_a),
2854 SH_PFC_PIN_GROUP(msiof2_sync_a),
2855 SH_PFC_PIN_GROUP(msiof2_ss1_a),
2856 SH_PFC_PIN_GROUP(msiof2_ss2_a),
2857 SH_PFC_PIN_GROUP(msiof2_txd_a),
2858 SH_PFC_PIN_GROUP(msiof2_rxd_a),
2859 SH_PFC_PIN_GROUP(msiof2_clk_b),
2860 SH_PFC_PIN_GROUP(msiof2_sync_b),
2861 SH_PFC_PIN_GROUP(msiof2_ss1_b),
2862 SH_PFC_PIN_GROUP(msiof2_ss2_b),
2863 SH_PFC_PIN_GROUP(msiof2_txd_b),
2864 SH_PFC_PIN_GROUP(msiof2_rxd_b),
2865 SH_PFC_PIN_GROUP(msiof2_clk_c),
2866 SH_PFC_PIN_GROUP(msiof2_sync_c),
2867 SH_PFC_PIN_GROUP(msiof2_ss1_c),
2868 SH_PFC_PIN_GROUP(msiof2_ss2_c),
2869 SH_PFC_PIN_GROUP(msiof2_txd_c),
2870 SH_PFC_PIN_GROUP(msiof2_rxd_c),
2871 SH_PFC_PIN_GROUP(msiof2_clk_d),
2872 SH_PFC_PIN_GROUP(msiof2_sync_d),
2873 SH_PFC_PIN_GROUP(msiof2_ss1_d),
2874 SH_PFC_PIN_GROUP(msiof2_ss2_d),
2875 SH_PFC_PIN_GROUP(msiof2_txd_d),
2876 SH_PFC_PIN_GROUP(msiof2_rxd_d),
2877 SH_PFC_PIN_GROUP(msiof3_clk_a),
2878 SH_PFC_PIN_GROUP(msiof3_sync_a),
2879 SH_PFC_PIN_GROUP(msiof3_ss1_a),
2880 SH_PFC_PIN_GROUP(msiof3_ss2_a),
2881 SH_PFC_PIN_GROUP(msiof3_txd_a),
2882 SH_PFC_PIN_GROUP(msiof3_rxd_a),
2883 SH_PFC_PIN_GROUP(msiof3_clk_b),
2884 SH_PFC_PIN_GROUP(msiof3_sync_b),
2885 SH_PFC_PIN_GROUP(msiof3_ss1_b),
2886 SH_PFC_PIN_GROUP(msiof3_ss2_b),
2887 SH_PFC_PIN_GROUP(msiof3_txd_b),
2888 SH_PFC_PIN_GROUP(msiof3_rxd_b),
2889 SH_PFC_PIN_GROUP(msiof3_clk_c),
2890 SH_PFC_PIN_GROUP(msiof3_sync_c),
2891 SH_PFC_PIN_GROUP(msiof3_txd_c),
2892 SH_PFC_PIN_GROUP(msiof3_rxd_c),
2893 SH_PFC_PIN_GROUP(msiof3_clk_d),
2894 SH_PFC_PIN_GROUP(msiof3_sync_d),
2895 SH_PFC_PIN_GROUP(msiof3_ss1_d),
2896 SH_PFC_PIN_GROUP(msiof3_txd_d),
2897 SH_PFC_PIN_GROUP(msiof3_rxd_d),
2898 SH_PFC_PIN_GROUP(msiof3_clk_e),
2899 SH_PFC_PIN_GROUP(msiof3_sync_e),
2900 SH_PFC_PIN_GROUP(msiof3_ss1_e),
2901 SH_PFC_PIN_GROUP(msiof3_ss2_e),
2902 SH_PFC_PIN_GROUP(msiof3_txd_e),
2903 SH_PFC_PIN_GROUP(msiof3_rxd_e),
2078 SH_PFC_PIN_GROUP(pwm0), 2904 SH_PFC_PIN_GROUP(pwm0),
2079 SH_PFC_PIN_GROUP(pwm1_a), 2905 SH_PFC_PIN_GROUP(pwm1_a),
2080 SH_PFC_PIN_GROUP(pwm1_b), 2906 SH_PFC_PIN_GROUP(pwm1_b),
@@ -2117,6 +2943,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
2117 SH_PFC_PIN_GROUP(scif5_clk_b), 2943 SH_PFC_PIN_GROUP(scif5_clk_b),
2118 SH_PFC_PIN_GROUP(scif_clk_a), 2944 SH_PFC_PIN_GROUP(scif_clk_a),
2119 SH_PFC_PIN_GROUP(scif_clk_b), 2945 SH_PFC_PIN_GROUP(scif_clk_b),
2946 SH_PFC_PIN_GROUP(usb0),
2947 SH_PFC_PIN_GROUP(usb1),
2948 SH_PFC_PIN_GROUP(usb2),
2949 SH_PFC_PIN_GROUP(usb2_ch3),
2120}; 2950};
2121 2951
2122static const char * const avb_groups[] = { 2952static const char * const avb_groups[] = {
@@ -2143,6 +2973,117 @@ static const char * const du_groups[] = {
2143 "du_disp", 2973 "du_disp",
2144}; 2974};
2145 2975
2976static const char * const msiof0_groups[] = {
2977 "msiof0_clk",
2978 "msiof0_sync",
2979 "msiof0_ss1",
2980 "msiof0_ss2",
2981 "msiof0_txd",
2982 "msiof0_rxd",
2983};
2984
2985static const char * const msiof1_groups[] = {
2986 "msiof1_clk_a",
2987 "msiof1_sync_a",
2988 "msiof1_ss1_a",
2989 "msiof1_ss2_a",
2990 "msiof1_txd_a",
2991 "msiof1_rxd_a",
2992 "msiof1_clk_b",
2993 "msiof1_sync_b",
2994 "msiof1_ss1_b",
2995 "msiof1_ss2_b",
2996 "msiof1_txd_b",
2997 "msiof1_rxd_b",
2998 "msiof1_clk_c",
2999 "msiof1_sync_c",
3000 "msiof1_ss1_c",
3001 "msiof1_ss2_c",
3002 "msiof1_txd_c",
3003 "msiof1_rxd_c",
3004 "msiof1_clk_d",
3005 "msiof1_sync_d",
3006 "msiof1_ss1_d",
3007 "msiof1_ss2_d",
3008 "msiof1_txd_d",
3009 "msiof1_rxd_d",
3010 "msiof1_clk_e",
3011 "msiof1_sync_e",
3012 "msiof1_ss1_e",
3013 "msiof1_ss2_e",
3014 "msiof1_txd_e",
3015 "msiof1_rxd_e",
3016 "msiof1_clk_f",
3017 "msiof1_sync_f",
3018 "msiof1_ss1_f",
3019 "msiof1_ss2_f",
3020 "msiof1_txd_f",
3021 "msiof1_rxd_f",
3022 "msiof1_clk_g",
3023 "msiof1_sync_g",
3024 "msiof1_ss1_g",
3025 "msiof1_ss2_g",
3026 "msiof1_txd_g",
3027 "msiof1_rxd_g",
3028};
3029
3030static const char * const msiof2_groups[] = {
3031 "msiof2_clk_a",
3032 "msiof2_sync_a",
3033 "msiof2_ss1_a",
3034 "msiof2_ss2_a",
3035 "msiof2_txd_a",
3036 "msiof2_rxd_a",
3037 "msiof2_clk_b",
3038 "msiof2_sync_b",
3039 "msiof2_ss1_b",
3040 "msiof2_ss2_b",
3041 "msiof2_txd_b",
3042 "msiof2_rxd_b",
3043 "msiof2_clk_c",
3044 "msiof2_sync_c",
3045 "msiof2_ss1_c",
3046 "msiof2_ss2_c",
3047 "msiof2_txd_c",
3048 "msiof2_rxd_c",
3049 "msiof2_clk_d",
3050 "msiof2_sync_d",
3051 "msiof2_ss1_d",
3052 "msiof2_ss2_d",
3053 "msiof2_txd_d",
3054 "msiof2_rxd_d",
3055};
3056
3057static const char * const msiof3_groups[] = {
3058 "msiof3_clk_a",
3059 "msiof3_sync_a",
3060 "msiof3_ss1_a",
3061 "msiof3_ss2_a",
3062 "msiof3_txd_a",
3063 "msiof3_rxd_a",
3064 "msiof3_clk_b",
3065 "msiof3_sync_b",
3066 "msiof3_ss1_b",
3067 "msiof3_ss2_b",
3068 "msiof3_txd_b",
3069 "msiof3_rxd_b",
3070 "msiof3_clk_c",
3071 "msiof3_sync_c",
3072 "msiof3_txd_c",
3073 "msiof3_rxd_c",
3074 "msiof3_clk_d",
3075 "msiof3_sync_d",
3076 "msiof3_ss1_d",
3077 "msiof3_txd_d",
3078 "msiof3_rxd_d",
3079 "msiof3_clk_e",
3080 "msiof3_sync_e",
3081 "msiof3_ss1_e",
3082 "msiof3_ss2_e",
3083 "msiof3_txd_e",
3084 "msiof3_rxd_e",
3085};
3086
2146static const char * const pwm0_groups[] = { 3087static const char * const pwm0_groups[] = {
2147 "pwm0", 3088 "pwm0",
2148}; 3089};
@@ -2227,9 +3168,29 @@ static const char * const scif_clk_groups[] = {
2227 "scif_clk_b", 3168 "scif_clk_b",
2228}; 3169};
2229 3170
3171static const char * const usb0_groups[] = {
3172 "usb0",
3173};
3174
3175static const char * const usb1_groups[] = {
3176 "usb1",
3177};
3178
3179static const char * const usb2_groups[] = {
3180 "usb2",
3181};
3182
3183static const char * const usb2_ch3_groups[] = {
3184 "usb2_ch3",
3185};
3186
2230static const struct sh_pfc_function pinmux_functions[] = { 3187static const struct sh_pfc_function pinmux_functions[] = {
2231 SH_PFC_FUNCTION(avb), 3188 SH_PFC_FUNCTION(avb),
2232 SH_PFC_FUNCTION(du), 3189 SH_PFC_FUNCTION(du),
3190 SH_PFC_FUNCTION(msiof0),
3191 SH_PFC_FUNCTION(msiof1),
3192 SH_PFC_FUNCTION(msiof2),
3193 SH_PFC_FUNCTION(msiof3),
2233 SH_PFC_FUNCTION(pwm0), 3194 SH_PFC_FUNCTION(pwm0),
2234 SH_PFC_FUNCTION(pwm1), 3195 SH_PFC_FUNCTION(pwm1),
2235 SH_PFC_FUNCTION(pwm2), 3196 SH_PFC_FUNCTION(pwm2),
@@ -2244,6 +3205,10 @@ static const struct sh_pfc_function pinmux_functions[] = {
2244 SH_PFC_FUNCTION(scif4), 3205 SH_PFC_FUNCTION(scif4),
2245 SH_PFC_FUNCTION(scif5), 3206 SH_PFC_FUNCTION(scif5),
2246 SH_PFC_FUNCTION(scif_clk), 3207 SH_PFC_FUNCTION(scif_clk),
3208 SH_PFC_FUNCTION(usb0),
3209 SH_PFC_FUNCTION(usb1),
3210 SH_PFC_FUNCTION(usb2),
3211 SH_PFC_FUNCTION(usb2_ch3),
2247}; 3212};
2248 3213
2249static const struct pinmux_cfg_reg pinmux_config_regs[] = { 3214static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -2601,7 +3566,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
2601 IP7_27_24 3566 IP7_27_24
2602 IP7_23_20 3567 IP7_23_20
2603 IP7_19_16 3568 IP7_19_16
2604 IP7_15_12 3569 /* IP7_15_12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2605 IP7_11_8 3570 IP7_11_8
2606 IP7_7_4 3571 IP7_7_4
2607 IP7_3_0 } 3572 IP7_3_0 }
@@ -2782,7 +3747,8 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
2782 MOD_SEL2_28_27 3747 MOD_SEL2_28_27
2783 MOD_SEL2_26 3748 MOD_SEL2_26
2784 MOD_SEL2_25_24_23 3749 MOD_SEL2_25_24_23
2785 MOD_SEL2_22 3750 /* RESERVED 22 */
3751 0, 0,
2786 MOD_SEL2_21 3752 MOD_SEL2_21
2787 MOD_SEL2_20 3753 MOD_SEL2_20
2788 MOD_SEL2_19 3754 MOD_SEL2_19
@@ -3049,8 +4015,8 @@ static const struct pinmux_drive_reg pinmux_drive_regs[] = {
3049 { RCAR_GP_PIN(6, 27), 20, 3 }, /* USB1_OVC */ 4015 { RCAR_GP_PIN(6, 27), 20, 3 }, /* USB1_OVC */
3050 { RCAR_GP_PIN(6, 28), 16, 3 }, /* USB30_PWEN */ 4016 { RCAR_GP_PIN(6, 28), 16, 3 }, /* USB30_PWEN */
3051 { RCAR_GP_PIN(6, 29), 12, 3 }, /* USB30_OVC */ 4017 { RCAR_GP_PIN(6, 29), 12, 3 }, /* USB30_OVC */
3052 { RCAR_GP_PIN(6, 30), 8, 3 }, /* USB3_PWEN */ 4018 { RCAR_GP_PIN(6, 30), 8, 3 }, /* USB2_CH3_PWEN */
3053 { RCAR_GP_PIN(6, 31), 4, 3 }, /* USB3_OVC */ 4019 { RCAR_GP_PIN(6, 31), 4, 3 }, /* USB2_CH3_OVC */
3054 } }, 4020 } },
3055 { }, 4021 { },
3056}; 4022};
@@ -3177,7 +4143,7 @@ static const struct sh_pfc_bias_info bias_info[] = {
3177 { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */ 4143 { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */
3178 { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */ 4144 { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */
3179 { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */ 4145 { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */
3180 { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N_A26 */ 4146 { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N */
3181 { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */ 4147 { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */
3182 { PIN_NUMBER('F', 1), PU2, 0 }, /* CLKOUT */ 4148 { PIN_NUMBER('F', 1), PU2, 0 }, /* CLKOUT */
3183 4149
@@ -3280,8 +4246,8 @@ static const struct sh_pfc_bias_info bias_info[] = {
3280 { RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */ 4246 { RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */
3281 { RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */ 4247 { RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */
3282 4248
3283 { RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB3_OVC */ 4249 { RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB2_CH3_OVC */
3284 { RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB3_PWEN */ 4250 { RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB2_CH3_PWEN */
3285 { RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */ 4251 { RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */
3286 { RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */ 4252 { RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */
3287 { RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */ 4253 { RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
index 98bf5d0e078e..200e1f4f6db9 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
@@ -67,7 +67,7 @@
67#define GPSR1_24 F_(RD_WR_N, IP4_31_28) 67#define GPSR1_24 F_(RD_WR_N, IP4_31_28)
68#define GPSR1_23 F_(RD_N, IP4_27_24) 68#define GPSR1_23 F_(RD_N, IP4_27_24)
69#define GPSR1_22 F_(BS_N, IP4_23_20) 69#define GPSR1_22 F_(BS_N, IP4_23_20)
70#define GPSR1_21 F_(CS1_N_A26, IP4_19_16) 70#define GPSR1_21 F_(CS1_N, IP4_19_16)
71#define GPSR1_20 F_(CS0_N, IP4_15_12) 71#define GPSR1_20 F_(CS0_N, IP4_15_12)
72#define GPSR1_19 F_(A19, IP4_11_8) 72#define GPSR1_19 F_(A19, IP4_11_8)
73#define GPSR1_18 F_(A18, IP4_7_4) 73#define GPSR1_18 F_(A18, IP4_7_4)
@@ -221,8 +221,8 @@
221#define IP0_15_12 FM(AVB_LINK) F_(0, 0) FM(MSIOF2_SCK_C) FM(TX4_A) 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) 221#define IP0_15_12 FM(AVB_LINK) F_(0, 0) FM(MSIOF2_SCK_C) FM(TX4_A) 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)
222#define IP0_19_16 FM(AVB_AVTP_MATCH_A) F_(0, 0) FM(MSIOF2_RXD_C) FM(CTS4_N_A) 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) 222#define IP0_19_16 FM(AVB_AVTP_MATCH_A) F_(0, 0) FM(MSIOF2_RXD_C) FM(CTS4_N_A) 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)
223#define IP0_23_20 FM(AVB_AVTP_CAPTURE_A) F_(0, 0) FM(MSIOF2_TXD_C) FM(RTS4_N_TANS_A) 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) 223#define IP0_23_20 FM(AVB_AVTP_CAPTURE_A) F_(0, 0) FM(MSIOF2_TXD_C) FM(RTS4_N_TANS_A) 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)
224#define IP0_27_24 FM(IRQ0) FM(QPOLB) F_(0, 0) FM(DU_CDE) FM(VI4_DATA0_B) FM(CAN0_TX_B) FM(CANFD0_TX_B) FM(MSIOF3_SS1_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 224#define IP0_27_24 FM(IRQ0) FM(QPOLB) F_(0, 0) FM(DU_CDE) FM(VI4_DATA0_B) FM(CAN0_TX_B) FM(CANFD0_TX_B) FM(MSIOF3_SS2_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
225#define IP0_31_28 FM(IRQ1) FM(QPOLA) F_(0, 0) FM(DU_DISP) FM(VI4_DATA1_B) FM(CAN0_RX_B) FM(CANFD0_RX_B) FM(MSIOF3_SS2_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 225#define IP0_31_28 FM(IRQ1) FM(QPOLA) F_(0, 0) FM(DU_DISP) FM(VI4_DATA1_B) FM(CAN0_RX_B) FM(CANFD0_RX_B) FM(MSIOF3_SS1_E) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
226#define IP1_3_0 FM(IRQ2) FM(QCPV_QDE) F_(0, 0) FM(DU_EXODDF_DU_ODDF_DISP_CDE) FM(VI4_DATA2_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SYNC_E) F_(0, 0) FM(PWM3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 226#define IP1_3_0 FM(IRQ2) FM(QCPV_QDE) F_(0, 0) FM(DU_EXODDF_DU_ODDF_DISP_CDE) FM(VI4_DATA2_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SYNC_E) F_(0, 0) FM(PWM3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
227#define IP1_7_4 FM(IRQ3) FM(QSTVB_QVE) FM(A25) FM(DU_DOTCLKOUT1) FM(VI4_DATA3_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SCK_E) F_(0, 0) FM(PWM4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 227#define IP1_7_4 FM(IRQ3) FM(QSTVB_QVE) FM(A25) FM(DU_DOTCLKOUT1) FM(VI4_DATA3_B) F_(0, 0) F_(0, 0) FM(MSIOF3_SCK_E) F_(0, 0) FM(PWM4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
228#define IP1_11_8 FM(IRQ4) FM(QSTH_QHS) FM(A24) FM(DU_EXHSYNC_DU_HSYNC) FM(VI4_DATA4_B) F_(0, 0) F_(0, 0) FM(MSIOF3_RXD_E) F_(0, 0) FM(PWM5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 228#define IP1_11_8 FM(IRQ4) FM(QSTH_QHS) FM(A24) FM(DU_EXHSYNC_DU_HSYNC) FM(VI4_DATA4_B) F_(0, 0) F_(0, 0) FM(MSIOF3_RXD_E) F_(0, 0) FM(PWM5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -253,7 +253,7 @@
253#define IP4_7_4 FM(A18) FM(LCDOUT10) F_(0, 0) F_(0, 0) FM(VI4_HSYNC_N) F_(0, 0) FM(DU_DG2) 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) 253#define IP4_7_4 FM(A18) FM(LCDOUT10) F_(0, 0) F_(0, 0) FM(VI4_HSYNC_N) F_(0, 0) FM(DU_DG2) 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)
254#define IP4_11_8 FM(A19) FM(LCDOUT11) F_(0, 0) F_(0, 0) FM(VI4_CLKENB) F_(0, 0) FM(DU_DG3) 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) 254#define IP4_11_8 FM(A19) FM(LCDOUT11) F_(0, 0) F_(0, 0) FM(VI4_CLKENB) F_(0, 0) FM(DU_DG3) 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)
255#define IP4_15_12 FM(CS0_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLKENB) 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) 255#define IP4_15_12 FM(CS0_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLKENB) 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)
256#define IP4_19_16 FM(CS1_N_A26) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLK) F_(0, 0) FM(EX_WAIT0_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) 256#define IP4_19_16 FM(CS1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI5_CLK) F_(0, 0) FM(EX_WAIT0_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)
257#define IP4_23_20 FM(BS_N) FM(QSTVA_QVS) FM(MSIOF3_SCK_D) FM(SCK3) FM(HSCK3) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN1_TX) FM(CANFD1_TX) FM(IETX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 257#define IP4_23_20 FM(BS_N) FM(QSTVA_QVS) FM(MSIOF3_SCK_D) FM(SCK3) FM(HSCK3) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN1_TX) FM(CANFD1_TX) FM(IETX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
258#define IP4_27_24 FM(RD_N) F_(0, 0) FM(MSIOF3_SYNC_D) FM(RX3_A) FM(HRX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_TX_A) FM(CANFD0_TX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 258#define IP4_27_24 FM(RD_N) F_(0, 0) FM(MSIOF3_SYNC_D) FM(RX3_A) FM(HRX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_TX_A) FM(CANFD0_TX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
259#define IP4_31_28 FM(RD_WR_N) F_(0, 0) FM(MSIOF3_RXD_D) FM(TX3_A) FM(HTX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_RX_A) FM(CANFD0_RX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 259#define IP4_31_28 FM(RD_WR_N) F_(0, 0) FM(MSIOF3_RXD_D) FM(TX3_A) FM(HTX3_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(CAN0_RX_A) FM(CANFD0_RX_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -278,7 +278,6 @@
278#define IP7_3_0 FM(D13) FM(LCDOUT5) FM(MSIOF2_SS2_D) FM(TX4_C) FM(VI4_DATA5_A) F_(0, 0) FM(DU_DR5) 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) 278#define IP7_3_0 FM(D13) FM(LCDOUT5) FM(MSIOF2_SS2_D) FM(TX4_C) FM(VI4_DATA5_A) F_(0, 0) FM(DU_DR5) 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)
279#define IP7_7_4 FM(D14) FM(LCDOUT6) FM(MSIOF3_SS1_A) FM(HRX3_C) FM(VI4_DATA6_A) F_(0, 0) FM(DU_DR6) FM(SCL6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 279#define IP7_7_4 FM(D14) FM(LCDOUT6) FM(MSIOF3_SS1_A) FM(HRX3_C) FM(VI4_DATA6_A) F_(0, 0) FM(DU_DR6) FM(SCL6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
280#define IP7_11_8 FM(D15) FM(LCDOUT7) FM(MSIOF3_SS2_A) FM(HTX3_C) FM(VI4_DATA7_A) F_(0, 0) FM(DU_DR7) FM(SDA6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 280#define IP7_11_8 FM(D15) FM(LCDOUT7) FM(MSIOF3_SS2_A) FM(HTX3_C) FM(VI4_DATA7_A) F_(0, 0) FM(DU_DR7) FM(SDA6_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
281#define IP7_15_12 FM(FSCLKST) 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) F_(0, 0) F_(0, 0) F_(0, 0)
282#define IP7_19_16 FM(SD0_CLK) F_(0, 0) FM(MSIOF1_SCK_E) F_(0, 0) F_(0, 0) F_(0, 0) FM(STP_OPWM_0_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) 281#define IP7_19_16 FM(SD0_CLK) F_(0, 0) FM(MSIOF1_SCK_E) F_(0, 0) F_(0, 0) F_(0, 0) FM(STP_OPWM_0_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)
283#define IP7_23_20 FM(SD0_CMD) F_(0, 0) FM(MSIOF1_SYNC_E) F_(0, 0) F_(0, 0) F_(0, 0) FM(STP_IVCXO27_0_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) 282#define IP7_23_20 FM(SD0_CMD) F_(0, 0) FM(MSIOF1_SYNC_E) F_(0, 0) F_(0, 0) F_(0, 0) FM(STP_IVCXO27_0_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)
284#define IP7_27_24 FM(SD0_DAT0) F_(0, 0) FM(MSIOF1_RXD_E) F_(0, 0) F_(0, 0) FM(TS_SCK0_B) FM(STP_ISCLK_0_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) 283#define IP7_27_24 FM(SD0_DAT0) F_(0, 0) FM(MSIOF1_RXD_E) F_(0, 0) F_(0, 0) FM(TS_SCK0_B) FM(STP_ISCLK_0_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)
@@ -291,24 +290,24 @@
291#define IP8_23_20 FM(SD1_DAT1) FM(SD2_DAT5) FM(MSIOF1_TXD_G) FM(NFDATA14_B) F_(0, 0) FM(TS_SPSYNC1_B)FM(STP_ISSYNC_1_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) 290#define IP8_23_20 FM(SD1_DAT1) FM(SD2_DAT5) FM(MSIOF1_TXD_G) FM(NFDATA14_B) F_(0, 0) FM(TS_SPSYNC1_B)FM(STP_ISSYNC_1_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)
292#define IP8_27_24 FM(SD1_DAT2) FM(SD2_DAT6) FM(MSIOF1_SS1_G) FM(NFDATA15_B) F_(0, 0) FM(TS_SDAT1_B) FM(STP_ISD_1_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) 291#define IP8_27_24 FM(SD1_DAT2) FM(SD2_DAT6) FM(MSIOF1_SS1_G) FM(NFDATA15_B) F_(0, 0) FM(TS_SDAT1_B) FM(STP_ISD_1_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)
293#define IP8_31_28 FM(SD1_DAT3) FM(SD2_DAT7) FM(MSIOF1_SS2_G) FM(NFRB_N_B) F_(0, 0) FM(TS_SDEN1_B) FM(STP_ISEN_1_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) 292#define IP8_31_28 FM(SD1_DAT3) FM(SD2_DAT7) FM(MSIOF1_SS2_G) FM(NFRB_N_B) F_(0, 0) FM(TS_SDEN1_B) FM(STP_ISEN_1_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)
294#define IP9_3_0 FM(SD2_CLK) F_(0, 0) F_(0, 0) FM(NFDATA8) 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) 293#define IP9_3_0 FM(SD2_CLK) F_(0, 0) FM(NFDATA8) 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) F_(0, 0)
295#define IP9_7_4 FM(SD2_CMD) F_(0, 0) F_(0, 0) FM(NFDATA9) 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) 294#define IP9_7_4 FM(SD2_CMD) F_(0, 0) FM(NFDATA9) 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) F_(0, 0)
296#define IP9_11_8 FM(SD2_DAT0) F_(0, 0) F_(0, 0) FM(NFDATA10) 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) 295#define IP9_11_8 FM(SD2_DAT0) F_(0, 0) FM(NFDATA10) 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) F_(0, 0)
297#define IP9_15_12 FM(SD2_DAT1) F_(0, 0) F_(0, 0) FM(NFDATA11) 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) 296#define IP9_15_12 FM(SD2_DAT1) F_(0, 0) FM(NFDATA11) 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) F_(0, 0)
298#define IP9_19_16 FM(SD2_DAT2) F_(0, 0) F_(0, 0) FM(NFDATA12) 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) 297#define IP9_19_16 FM(SD2_DAT2) F_(0, 0) FM(NFDATA12) 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) F_(0, 0)
299#define IP9_23_20 FM(SD2_DAT3) F_(0, 0) F_(0, 0) FM(NFDATA13) 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) 298#define IP9_23_20 FM(SD2_DAT3) F_(0, 0) FM(NFDATA13) 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) F_(0, 0)
300#define IP9_27_24 FM(SD2_DS) F_(0, 0) F_(0, 0) FM(NFALE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(SATA_DEVSLP_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 299#define IP9_27_24 FM(SD2_DS) F_(0, 0) FM(NFALE) 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) F_(0, 0)
301#define IP9_31_28 FM(SD3_CLK) F_(0, 0) F_(0, 0) FM(NFWE_N) 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) 300#define IP9_31_28 FM(SD3_CLK) F_(0, 0) FM(NFWE_N) 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) F_(0, 0)
302#define IP10_3_0 FM(SD3_CMD) F_(0, 0) F_(0, 0) FM(NFRE_N) 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) 301#define IP10_3_0 FM(SD3_CMD) F_(0, 0) FM(NFRE_N) 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) F_(0, 0)
303#define IP10_7_4 FM(SD3_DAT0) F_(0, 0) F_(0, 0) FM(NFDATA0) 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) 302#define IP10_7_4 FM(SD3_DAT0) F_(0, 0) FM(NFDATA0) 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) F_(0, 0)
304#define IP10_11_8 FM(SD3_DAT1) F_(0, 0) F_(0, 0) FM(NFDATA1) 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) 303#define IP10_11_8 FM(SD3_DAT1) F_(0, 0) FM(NFDATA1) 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) F_(0, 0)
305#define IP10_15_12 FM(SD3_DAT2) F_(0, 0) F_(0, 0) FM(NFDATA2) 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) 304#define IP10_15_12 FM(SD3_DAT2) F_(0, 0) FM(NFDATA2) 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) F_(0, 0)
306#define IP10_19_16 FM(SD3_DAT3) F_(0, 0) F_(0, 0) FM(NFDATA3) 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) 305#define IP10_19_16 FM(SD3_DAT3) F_(0, 0) FM(NFDATA3) 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) F_(0, 0)
307#define IP10_23_20 FM(SD3_DAT4) FM(SD2_CD_A) F_(0, 0) FM(NFDATA4) 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) 306#define IP10_23_20 FM(SD3_DAT4) FM(SD2_CD_A) FM(NFDATA4) 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) F_(0, 0)
308#define IP10_27_24 FM(SD3_DAT5) FM(SD2_WP_A) F_(0, 0) FM(NFDATA5) 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) 307#define IP10_27_24 FM(SD3_DAT5) FM(SD2_WP_A) FM(NFDATA5) 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) F_(0, 0)
309#define IP10_31_28 FM(SD3_DAT6) FM(SD3_CD) F_(0, 0) FM(NFDATA6) 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) 308#define IP10_31_28 FM(SD3_DAT6) FM(SD3_CD) FM(NFDATA6) 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) F_(0, 0)
310#define IP11_3_0 FM(SD3_DAT7) FM(SD3_WP) F_(0, 0) FM(NFDATA7) 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) 309#define IP11_3_0 FM(SD3_DAT7) FM(SD3_WP) FM(NFDATA7) 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) F_(0, 0)
311#define IP11_7_4 FM(SD3_DS) F_(0, 0) F_(0, 0) FM(NFCLE) 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) 310#define IP11_7_4 FM(SD3_DS) F_(0, 0) FM(NFCLE) 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) F_(0, 0)
312#define IP11_11_8 FM(SD0_CD) F_(0, 0) FM(NFDATA14_A) F_(0, 0) FM(SCL2_B) FM(SIM0_RST_A) 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) 311#define IP11_11_8 FM(SD0_CD) F_(0, 0) FM(NFDATA14_A) F_(0, 0) FM(SCL2_B) FM(SIM0_RST_A) 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)
313 312
314/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* A */ /* B */ /* C - F */ 313/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* A */ /* B */ /* C - F */
@@ -319,14 +318,14 @@
319#define IP11_31_28 FM(RX0) FM(HRX1_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SCK0_C) FM(STP_ISCLK_0_C) FM(RIF0_D0_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) 318#define IP11_31_28 FM(RX0) FM(HRX1_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SCK0_C) FM(STP_ISCLK_0_C) FM(RIF0_D0_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)
320#define IP12_3_0 FM(TX0) FM(HTX1_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SPSYNC0_C)FM(STP_ISSYNC_0_C) FM(RIF0_D1_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) 319#define IP12_3_0 FM(TX0) FM(HTX1_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SPSYNC0_C)FM(STP_ISSYNC_0_C) FM(RIF0_D1_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)
321#define IP12_7_4 FM(CTS0_N) FM(HCTS1_N_B) FM(MSIOF1_SYNC_B) F_(0, 0) F_(0, 0) FM(TS_SPSYNC1_C)FM(STP_ISSYNC_1_C) FM(RIF1_SYNC_B) FM(AUDIO_CLKOUT_C) FM(ADICS_SAMP) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 320#define IP12_7_4 FM(CTS0_N) FM(HCTS1_N_B) FM(MSIOF1_SYNC_B) F_(0, 0) F_(0, 0) FM(TS_SPSYNC1_C)FM(STP_ISSYNC_1_C) FM(RIF1_SYNC_B) FM(AUDIO_CLKOUT_C) FM(ADICS_SAMP) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
322#define IP12_11_8 FM(RTS0_N_TANS) FM(HRTS1_N_B) FM(MSIOF1_SS1_B) FM(AUDIO_CLKA_B) FM(SCL2_A) F_(0, 0) FM(STP_IVCXO27_1_C) FM(RIF0_SYNC_B) FM(FSO_TOE_A) FM(ADICHS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 321#define IP12_11_8 FM(RTS0_N_TANS) FM(HRTS1_N_B) FM(MSIOF1_SS1_B) FM(AUDIO_CLKA_B) FM(SCL2_A) F_(0, 0) FM(STP_IVCXO27_1_C) FM(RIF0_SYNC_B) F_(0, 0) FM(ADICHS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
323#define IP12_15_12 FM(RX1_A) FM(HRX1_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDAT0_C) FM(STP_ISD_0_C) FM(RIF1_CLK_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 322#define IP12_15_12 FM(RX1_A) FM(HRX1_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDAT0_C) FM(STP_ISD_0_C) FM(RIF1_CLK_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
324#define IP12_19_16 FM(TX1_A) FM(HTX1_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDEN0_C) FM(STP_ISEN_0_C) FM(RIF1_D0_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 323#define IP12_19_16 FM(TX1_A) FM(HTX1_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDEN0_C) FM(STP_ISEN_0_C) FM(RIF1_D0_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
325#define IP12_23_20 FM(CTS1_N) FM(HCTS1_N_A) FM(MSIOF1_RXD_B) F_(0, 0) F_(0, 0) FM(TS_SDEN1_C) FM(STP_ISEN_1_C) FM(RIF1_D0_B) F_(0, 0) FM(ADIDATA) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 324#define IP12_23_20 FM(CTS1_N) FM(HCTS1_N_A) FM(MSIOF1_RXD_B) F_(0, 0) F_(0, 0) FM(TS_SDEN1_C) FM(STP_ISEN_1_C) FM(RIF1_D0_B) F_(0, 0) FM(ADIDATA) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
326#define IP12_27_24 FM(RTS1_N_TANS) FM(HRTS1_N_A) FM(MSIOF1_TXD_B) F_(0, 0) F_(0, 0) FM(TS_SDAT1_C) FM(STP_ISD_1_C) FM(RIF1_D1_B) F_(0, 0) FM(ADICHS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 325#define IP12_27_24 FM(RTS1_N_TANS) FM(HRTS1_N_A) FM(MSIOF1_TXD_B) F_(0, 0) F_(0, 0) FM(TS_SDAT1_C) FM(STP_ISD_1_C) FM(RIF1_D1_B) F_(0, 0) FM(ADICHS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
327#define IP12_31_28 FM(SCK2) FM(SCIF_CLK_B) FM(MSIOF1_SCK_B) F_(0, 0) F_(0, 0) FM(TS_SCK1_C) FM(STP_ISCLK_1_C) FM(RIF1_CLK_B) F_(0, 0) FM(ADICLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 326#define IP12_31_28 FM(SCK2) FM(SCIF_CLK_B) FM(MSIOF1_SCK_B) F_(0, 0) F_(0, 0) FM(TS_SCK1_C) FM(STP_ISCLK_1_C) FM(RIF1_CLK_B) F_(0, 0) FM(ADICLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
328#define IP13_3_0 FM(TX2_A) F_(0, 0) F_(0, 0) FM(SD2_CD_B) FM(SCL1_A) F_(0, 0) FM(FMCLK_A) FM(RIF1_D1_C) F_(0, 0) FM(FSO_CFE_0_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 327#define IP13_3_0 FM(TX2_A) F_(0, 0) F_(0, 0) FM(SD2_CD_B) FM(SCL1_A) F_(0, 0) FM(FMCLK_A) FM(RIF1_D1_C) F_(0, 0) FM(FSO_CFE_0_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
329#define IP13_7_4 FM(RX2_A) F_(0, 0) F_(0, 0) FM(SD2_WP_B) FM(SDA1_A) F_(0, 0) FM(FMIN_A) FM(RIF1_SYNC_C) F_(0, 0) FM(FSO_CFE_1_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 328#define IP13_7_4 FM(RX2_A) F_(0, 0) F_(0, 0) FM(SD2_WP_B) FM(SDA1_A) F_(0, 0) FM(FMIN_A) FM(RIF1_SYNC_C) F_(0, 0) FM(FSO_CFE_1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
330#define IP13_11_8 FM(HSCK0) F_(0, 0) FM(MSIOF1_SCK_D) FM(AUDIO_CLKB_A) FM(SSI_SDATA1_B)FM(TS_SCK0_D) FM(STP_ISCLK_0_D) FM(RIF0_CLK_C) F_(0, 0) F_(0, 0) FM(RX5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 329#define IP13_11_8 FM(HSCK0) F_(0, 0) FM(MSIOF1_SCK_D) FM(AUDIO_CLKB_A) FM(SSI_SDATA1_B)FM(TS_SCK0_D) FM(STP_ISCLK_0_D) FM(RIF0_CLK_C) F_(0, 0) F_(0, 0) FM(RX5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
331#define IP13_15_12 FM(HRX0) F_(0, 0) FM(MSIOF1_RXD_D) F_(0, 0) FM(SSI_SDATA2_B)FM(TS_SDEN0_D) FM(STP_ISEN_0_D) FM(RIF0_D0_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 330#define IP13_15_12 FM(HRX0) F_(0, 0) FM(MSIOF1_RXD_D) F_(0, 0) FM(SSI_SDATA2_B)FM(TS_SDEN0_D) FM(STP_ISEN_0_D) FM(RIF0_D0_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
332#define IP13_19_16 FM(HTX0) F_(0, 0) FM(MSIOF1_TXD_D) F_(0, 0) FM(SSI_SDATA9_B)FM(TS_SDAT0_D) FM(STP_ISD_0_D) FM(RIF0_D1_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 331#define IP13_19_16 FM(HTX0) F_(0, 0) FM(MSIOF1_TXD_D) F_(0, 0) FM(SSI_SDATA9_B)FM(TS_SDAT0_D) FM(STP_ISD_0_D) FM(RIF0_D1_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -366,9 +365,9 @@
366#define IP17_19_16 FM(USB1_PWEN) F_(0, 0) F_(0, 0) FM(SIM0_CLK_C) FM(SSI_SCK1_A) FM(TS_SCK0_E) FM(STP_ISCLK_0_E) FM(FMCLK_B) FM(RIF2_CLK_B) F_(0, 0) FM(SPEEDIN_A) F_(0, 0) F_(0, 0) FM(HTX2_C) F_(0, 0) F_(0, 0) 365#define IP17_19_16 FM(USB1_PWEN) F_(0, 0) F_(0, 0) FM(SIM0_CLK_C) FM(SSI_SCK1_A) FM(TS_SCK0_E) FM(STP_ISCLK_0_E) FM(FMCLK_B) FM(RIF2_CLK_B) F_(0, 0) FM(SPEEDIN_A) F_(0, 0) F_(0, 0) FM(HTX2_C) F_(0, 0) F_(0, 0)
367#define IP17_23_20 FM(USB1_OVC) F_(0, 0) FM(MSIOF1_SS2_C) F_(0, 0) FM(SSI_WS1_A) FM(TS_SDAT0_E) FM(STP_ISD_0_E) FM(FMIN_B) FM(RIF2_SYNC_B) F_(0, 0) FM(REMOCON_B) F_(0, 0) F_(0, 0) FM(HCTS2_N_C) F_(0, 0) F_(0, 0) 366#define IP17_23_20 FM(USB1_OVC) F_(0, 0) FM(MSIOF1_SS2_C) F_(0, 0) FM(SSI_WS1_A) FM(TS_SDAT0_E) FM(STP_ISD_0_E) FM(FMIN_B) FM(RIF2_SYNC_B) F_(0, 0) FM(REMOCON_B) F_(0, 0) F_(0, 0) FM(HCTS2_N_C) F_(0, 0) F_(0, 0)
368#define IP17_27_24 FM(USB30_PWEN) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT_B) FM(SSI_SCK2_B) FM(TS_SDEN1_D) FM(STP_ISEN_1_D) FM(STP_OPWM_0_E)FM(RIF3_D0_B) F_(0, 0) FM(TCLK2_B) FM(TPU0TO0) FM(BPFCLK_C) FM(HRTS2_N_C) F_(0, 0) F_(0, 0) 367#define IP17_27_24 FM(USB30_PWEN) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT_B) FM(SSI_SCK2_B) FM(TS_SDEN1_D) FM(STP_ISEN_1_D) FM(STP_OPWM_0_E)FM(RIF3_D0_B) F_(0, 0) FM(TCLK2_B) FM(TPU0TO0) FM(BPFCLK_C) FM(HRTS2_N_C) F_(0, 0) F_(0, 0)
369#define IP17_31_28 FM(USB30_OVC) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT1_B) FM(SSI_WS2_B) FM(TS_SPSYNC1_D)FM(STP_ISSYNC_1_D) FM(STP_IVCXO27_0_E)FM(RIF3_D1_B) F_(0, 0) FM(FSO_TOE_B) FM(TPU0TO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 368#define IP17_31_28 FM(USB30_OVC) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT1_B) FM(SSI_WS2_B) FM(TS_SPSYNC1_D)FM(STP_ISSYNC_1_D) FM(STP_IVCXO27_0_E)FM(RIF3_D1_B) F_(0, 0) FM(FSO_TOE_N) FM(TPU0TO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
370#define IP18_3_0 FM(GP6_30) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT2_B) FM(SSI_SCK9_B) FM(TS_SDEN0_E) FM(STP_ISEN_0_E) F_(0, 0) FM(RIF2_D0_B) F_(0, 0) FM(FSO_CFE_0_A) FM(TPU0TO2) F_(0, 0) FM(FMCLK_C) FM(FMCLK_D) F_(0, 0) 369#define IP18_3_0 FM(GP6_30) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT2_B) FM(SSI_SCK9_B) FM(TS_SDEN0_E) FM(STP_ISEN_0_E) F_(0, 0) FM(RIF2_D0_B) F_(0, 0) F_(0, 0) FM(TPU0TO2) FM(FMCLK_C) FM(FMCLK_D) F_(0, 0) F_(0, 0)
371#define IP18_7_4 FM(GP6_31) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT3_B) FM(SSI_WS9_B) FM(TS_SPSYNC0_E)FM(STP_ISSYNC_0_E) F_(0, 0) FM(RIF2_D1_B) F_(0, 0) FM(FSO_CFE_1_A) FM(TPU0TO3) F_(0, 0) FM(FMIN_C) FM(FMIN_D) F_(0, 0) 370#define IP18_7_4 FM(GP6_31) F_(0, 0) F_(0, 0) FM(AUDIO_CLKOUT3_B) FM(SSI_WS9_B) FM(TS_SPSYNC0_E)FM(STP_ISSYNC_0_E) F_(0, 0) FM(RIF2_D1_B) F_(0, 0) F_(0, 0) FM(TPU0TO3) FM(FMIN_C) FM(FMIN_D) F_(0, 0) F_(0, 0)
372 371
373#define PINMUX_GPSR \ 372#define PINMUX_GPSR \
374\ 373\
@@ -419,7 +418,7 @@ FM(IP0_31_28) IP0_31_28 FM(IP1_31_28) IP1_31_28 FM(IP2_31_28) IP2_31_28 FM(IP3_3
419FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \ 418FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \
420FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \ 419FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \
421FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \ 420FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \
422FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 FM(IP7_15_12) IP7_15_12 \ 421FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 \
423FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \ 422FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \
424FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \ 423FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \
425FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \ 424FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \
@@ -463,7 +462,6 @@ FM(IP16_31_28) IP16_31_28 FM(IP17_31_28) IP17_31_28
463#define MOD_SEL0_19 FM(SEL_HSCIF4_0) FM(SEL_HSCIF4_1) 462#define MOD_SEL0_19 FM(SEL_HSCIF4_0) FM(SEL_HSCIF4_1)
464#define MOD_SEL0_18_17 FM(SEL_HSCIF3_0) FM(SEL_HSCIF3_1) FM(SEL_HSCIF3_2) FM(SEL_HSCIF3_3) 463#define MOD_SEL0_18_17 FM(SEL_HSCIF3_0) FM(SEL_HSCIF3_1) FM(SEL_HSCIF3_2) FM(SEL_HSCIF3_3)
465#define MOD_SEL0_16 FM(SEL_HSCIF1_0) FM(SEL_HSCIF1_1) 464#define MOD_SEL0_16 FM(SEL_HSCIF1_0) FM(SEL_HSCIF1_1)
466#define MOD_SEL0_15 FM(SEL_FSO_0) FM(SEL_FSO_1)
467#define MOD_SEL0_14_13 FM(SEL_HSCIF2_0) FM(SEL_HSCIF2_1) FM(SEL_HSCIF2_2) F_(0, 0) 465#define MOD_SEL0_14_13 FM(SEL_HSCIF2_0) FM(SEL_HSCIF2_1) FM(SEL_HSCIF2_2) F_(0, 0)
468#define MOD_SEL0_12 FM(SEL_ETHERAVB_0) FM(SEL_ETHERAVB_1) 466#define MOD_SEL0_12 FM(SEL_ETHERAVB_0) FM(SEL_ETHERAVB_1)
469#define MOD_SEL0_11 FM(SEL_DRIF3_0) FM(SEL_DRIF3_1) 467#define MOD_SEL0_11 FM(SEL_DRIF3_0) FM(SEL_DRIF3_1)
@@ -472,7 +470,6 @@ FM(IP16_31_28) IP16_31_28 FM(IP17_31_28) IP17_31_28
472#define MOD_SEL0_7_6 FM(SEL_DRIF0_0) FM(SEL_DRIF0_1) FM(SEL_DRIF0_2) F_(0, 0) 470#define MOD_SEL0_7_6 FM(SEL_DRIF0_0) FM(SEL_DRIF0_1) FM(SEL_DRIF0_2) F_(0, 0)
473#define MOD_SEL0_5 FM(SEL_CANFD0_0) FM(SEL_CANFD0_1) 471#define MOD_SEL0_5 FM(SEL_CANFD0_0) FM(SEL_CANFD0_1)
474#define MOD_SEL0_4_3 FM(SEL_ADG_A_0) FM(SEL_ADG_A_1) FM(SEL_ADG_A_2) FM(SEL_ADG_A_3) 472#define MOD_SEL0_4_3 FM(SEL_ADG_A_0) FM(SEL_ADG_A_1) FM(SEL_ADG_A_2) FM(SEL_ADG_A_3)
475#define MOD_SEL0_2 FM(SEL_5LINE_0) FM(SEL_5LINE_1)
476 473
477/* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ 474/* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */
478#define MOD_SEL1_31_30 FM(SEL_TSIF1_0) FM(SEL_TSIF1_1) FM(SEL_TSIF1_2) FM(SEL_TSIF1_3) 475#define MOD_SEL1_31_30 FM(SEL_TSIF1_0) FM(SEL_TSIF1_1) FM(SEL_TSIF1_2) FM(SEL_TSIF1_3)
@@ -488,7 +485,7 @@ FM(IP16_31_28) IP16_31_28 FM(IP17_31_28) IP17_31_28
488#define MOD_SEL1_13 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1) 485#define MOD_SEL1_13 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1)
489#define MOD_SEL1_12 FM(SEL_SCIF2_0) FM(SEL_SCIF2_1) 486#define MOD_SEL1_12 FM(SEL_SCIF2_0) FM(SEL_SCIF2_1)
490#define MOD_SEL1_11 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1) 487#define MOD_SEL1_11 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1)
491#define MOD_SEL1_10 FM(SEL_SATA_0) FM(SEL_SATA_1) 488#define MOD_SEL1_10 FM(SEL_SCIF_0) FM(SEL_SCIF_1)
492#define MOD_SEL1_9 FM(SEL_REMOCON_0) FM(SEL_REMOCON_1) 489#define MOD_SEL1_9 FM(SEL_REMOCON_0) FM(SEL_REMOCON_1)
493#define MOD_SEL1_6 FM(SEL_RCAN0_0) FM(SEL_RCAN0_1) 490#define MOD_SEL1_6 FM(SEL_RCAN0_0) FM(SEL_RCAN0_1)
494#define MOD_SEL1_5 FM(SEL_PWM6_0) FM(SEL_PWM6_1) 491#define MOD_SEL1_5 FM(SEL_PWM6_0) FM(SEL_PWM6_1)
@@ -529,7 +526,7 @@ MOD_SEL0_19 MOD_SEL1_19 MOD_SEL2_19 \
529MOD_SEL0_18_17 MOD_SEL1_18_17 MOD_SEL2_18 \ 526MOD_SEL0_18_17 MOD_SEL1_18_17 MOD_SEL2_18 \
530 MOD_SEL2_17 \ 527 MOD_SEL2_17 \
531MOD_SEL0_16 MOD_SEL1_16 \ 528MOD_SEL0_16 MOD_SEL1_16 \
532MOD_SEL0_15 MOD_SEL1_15_14 \ 529 MOD_SEL1_15_14 \
533MOD_SEL0_14_13 \ 530MOD_SEL0_14_13 \
534 MOD_SEL1_13 \ 531 MOD_SEL1_13 \
535MOD_SEL0_12 MOD_SEL1_12 \ 532MOD_SEL0_12 MOD_SEL1_12 \
@@ -541,7 +538,7 @@ MOD_SEL0_7_6 \
541MOD_SEL0_5 MOD_SEL1_5 \ 538MOD_SEL0_5 MOD_SEL1_5 \
542MOD_SEL0_4_3 MOD_SEL1_4 \ 539MOD_SEL0_4_3 MOD_SEL1_4 \
543 MOD_SEL1_3 \ 540 MOD_SEL1_3 \
544MOD_SEL0_2 MOD_SEL1_2 \ 541 MOD_SEL1_2 \
545 MOD_SEL1_1 \ 542 MOD_SEL1_1 \
546 MOD_SEL1_0 MOD_SEL2_0 543 MOD_SEL1_0 MOD_SEL2_0
547 544
@@ -645,7 +642,7 @@ static const u16 pinmux_data[] = {
645 PINMUX_IPSR_MSEL(IP0_31_28, VI4_DATA1_B, SEL_VIN4_1), 642 PINMUX_IPSR_MSEL(IP0_31_28, VI4_DATA1_B, SEL_VIN4_1),
646 PINMUX_IPSR_MSEL(IP0_31_28, CAN0_RX_B, SEL_RCAN0_1), 643 PINMUX_IPSR_MSEL(IP0_31_28, CAN0_RX_B, SEL_RCAN0_1),
647 PINMUX_IPSR_MSEL(IP0_31_28, CANFD0_RX_B, SEL_CANFD0_1), 644 PINMUX_IPSR_MSEL(IP0_31_28, CANFD0_RX_B, SEL_CANFD0_1),
648 PINMUX_IPSR_MSEL(IP0_27_24, MSIOF3_SS1_E, SEL_MSIOF3_4), 645 PINMUX_IPSR_MSEL(IP0_31_28, MSIOF3_SS1_E, SEL_MSIOF3_4),
649 646
650 /* IPSR1 */ 647 /* IPSR1 */
651 PINMUX_IPSR_GPSR(IP1_3_0, IRQ2), 648 PINMUX_IPSR_GPSR(IP1_3_0, IRQ2),
@@ -837,7 +834,7 @@ static const u16 pinmux_data[] = {
837 PINMUX_IPSR_GPSR(IP4_15_12, CS0_N), 834 PINMUX_IPSR_GPSR(IP4_15_12, CS0_N),
838 PINMUX_IPSR_GPSR(IP4_15_12, VI5_CLKENB), 835 PINMUX_IPSR_GPSR(IP4_15_12, VI5_CLKENB),
839 836
840 PINMUX_IPSR_GPSR(IP4_19_16, CS1_N_A26), 837 PINMUX_IPSR_GPSR(IP4_19_16, CS1_N),
841 PINMUX_IPSR_GPSR(IP4_19_16, VI5_CLK), 838 PINMUX_IPSR_GPSR(IP4_19_16, VI5_CLK),
842 PINMUX_IPSR_MSEL(IP4_19_16, EX_WAIT0_B, SEL_LBSC_1), 839 PINMUX_IPSR_MSEL(IP4_19_16, EX_WAIT0_B, SEL_LBSC_1),
843 840
@@ -990,8 +987,6 @@ static const u16 pinmux_data[] = {
990 PINMUX_IPSR_GPSR(IP7_11_8, DU_DR7), 987 PINMUX_IPSR_GPSR(IP7_11_8, DU_DR7),
991 PINMUX_IPSR_MSEL(IP7_11_8, SDA6_C, SEL_I2C6_2), 988 PINMUX_IPSR_MSEL(IP7_11_8, SDA6_C, SEL_I2C6_2),
992 989
993 PINMUX_IPSR_GPSR(IP7_15_12, FSCLKST),
994
995 PINMUX_IPSR_GPSR(IP7_19_16, SD0_CLK), 990 PINMUX_IPSR_GPSR(IP7_19_16, SD0_CLK),
996 PINMUX_IPSR_MSEL(IP7_19_16, MSIOF1_SCK_E, SEL_MSIOF1_4), 991 PINMUX_IPSR_MSEL(IP7_19_16, MSIOF1_SCK_E, SEL_MSIOF1_4),
997 PINMUX_IPSR_MSEL(IP7_19_16, STP_OPWM_0_B, SEL_SSP1_0_1), 992 PINMUX_IPSR_MSEL(IP7_19_16, STP_OPWM_0_B, SEL_SSP1_0_1),
@@ -1173,7 +1168,6 @@ static const u16 pinmux_data[] = {
1173 PINMUX_IPSR_MSEL(IP12_11_8, SCL2_A, SEL_I2C2_0), 1168 PINMUX_IPSR_MSEL(IP12_11_8, SCL2_A, SEL_I2C2_0),
1174 PINMUX_IPSR_MSEL(IP12_11_8, STP_IVCXO27_1_C, SEL_SSP1_1_2), 1169 PINMUX_IPSR_MSEL(IP12_11_8, STP_IVCXO27_1_C, SEL_SSP1_1_2),
1175 PINMUX_IPSR_MSEL(IP12_11_8, RIF0_SYNC_B, SEL_DRIF0_1), 1170 PINMUX_IPSR_MSEL(IP12_11_8, RIF0_SYNC_B, SEL_DRIF0_1),
1176 PINMUX_IPSR_MSEL(IP12_11_8, FSO_TOE_A, SEL_FSO_0),
1177 PINMUX_IPSR_GPSR(IP12_11_8, ADICHS1), 1171 PINMUX_IPSR_GPSR(IP12_11_8, ADICHS1),
1178 1172
1179 PINMUX_IPSR_MSEL(IP12_15_12, RX1_A, SEL_SCIF1_0), 1173 PINMUX_IPSR_MSEL(IP12_15_12, RX1_A, SEL_SCIF1_0),
@@ -1205,7 +1199,7 @@ static const u16 pinmux_data[] = {
1205 PINMUX_IPSR_GPSR(IP12_27_24, ADICHS0), 1199 PINMUX_IPSR_GPSR(IP12_27_24, ADICHS0),
1206 1200
1207 PINMUX_IPSR_GPSR(IP12_31_28, SCK2), 1201 PINMUX_IPSR_GPSR(IP12_31_28, SCK2),
1208 PINMUX_IPSR_MSEL(IP12_31_28, SCIF_CLK_B, SEL_SCIF1_1), 1202 PINMUX_IPSR_MSEL(IP12_31_28, SCIF_CLK_B, SEL_SCIF_1),
1209 PINMUX_IPSR_MSEL(IP12_31_28, MSIOF1_SCK_B, SEL_MSIOF1_1), 1203 PINMUX_IPSR_MSEL(IP12_31_28, MSIOF1_SCK_B, SEL_MSIOF1_1),
1210 PINMUX_IPSR_MSEL(IP12_31_28, TS_SCK1_C, SEL_TSIF1_2), 1204 PINMUX_IPSR_MSEL(IP12_31_28, TS_SCK1_C, SEL_TSIF1_2),
1211 PINMUX_IPSR_MSEL(IP12_31_28, STP_ISCLK_1_C, SEL_SSP1_1_2), 1205 PINMUX_IPSR_MSEL(IP12_31_28, STP_ISCLK_1_C, SEL_SSP1_1_2),
@@ -1218,14 +1212,14 @@ static const u16 pinmux_data[] = {
1218 PINMUX_IPSR_MSEL(IP13_3_0, SCL1_A, SEL_I2C1_0), 1212 PINMUX_IPSR_MSEL(IP13_3_0, SCL1_A, SEL_I2C1_0),
1219 PINMUX_IPSR_MSEL(IP13_3_0, FMCLK_A, SEL_FM_0), 1213 PINMUX_IPSR_MSEL(IP13_3_0, FMCLK_A, SEL_FM_0),
1220 PINMUX_IPSR_MSEL(IP13_3_0, RIF1_D1_C, SEL_DRIF1_2), 1214 PINMUX_IPSR_MSEL(IP13_3_0, RIF1_D1_C, SEL_DRIF1_2),
1221 PINMUX_IPSR_MSEL(IP13_3_0, FSO_CFE_0_B, SEL_FSO_1), 1215 PINMUX_IPSR_GPSR(IP13_3_0, FSO_CFE_0_N),
1222 1216
1223 PINMUX_IPSR_MSEL(IP13_7_4, RX2_A, SEL_SCIF2_0), 1217 PINMUX_IPSR_MSEL(IP13_7_4, RX2_A, SEL_SCIF2_0),
1224 PINMUX_IPSR_MSEL(IP13_7_4, SD2_WP_B, SEL_SDHI2_1), 1218 PINMUX_IPSR_MSEL(IP13_7_4, SD2_WP_B, SEL_SDHI2_1),
1225 PINMUX_IPSR_MSEL(IP13_7_4, SDA1_A, SEL_I2C1_0), 1219 PINMUX_IPSR_MSEL(IP13_7_4, SDA1_A, SEL_I2C1_0),
1226 PINMUX_IPSR_MSEL(IP13_7_4, FMIN_A, SEL_FM_0), 1220 PINMUX_IPSR_MSEL(IP13_7_4, FMIN_A, SEL_FM_0),
1227 PINMUX_IPSR_MSEL(IP13_7_4, RIF1_SYNC_C, SEL_DRIF1_2), 1221 PINMUX_IPSR_MSEL(IP13_7_4, RIF1_SYNC_C, SEL_DRIF1_2),
1228 PINMUX_IPSR_MSEL(IP13_7_4, FSO_CFE_1_B, SEL_FSO_1), 1222 PINMUX_IPSR_GPSR(IP13_7_4, FSO_CFE_1_N),
1229 1223
1230 PINMUX_IPSR_GPSR(IP13_11_8, HSCK0), 1224 PINMUX_IPSR_GPSR(IP13_11_8, HSCK0),
1231 PINMUX_IPSR_MSEL(IP13_11_8, MSIOF1_SCK_D, SEL_MSIOF1_3), 1225 PINMUX_IPSR_MSEL(IP13_11_8, MSIOF1_SCK_D, SEL_MSIOF1_3),
@@ -1393,7 +1387,7 @@ static const u16 pinmux_data[] = {
1393 PINMUX_IPSR_MSEL(IP16_23_20, STP_ISEN_1_A, SEL_SSP1_1_0), 1387 PINMUX_IPSR_MSEL(IP16_23_20, STP_ISEN_1_A, SEL_SSP1_1_0),
1394 PINMUX_IPSR_MSEL(IP16_23_20, RIF1_D0_A, SEL_DRIF1_0), 1388 PINMUX_IPSR_MSEL(IP16_23_20, RIF1_D0_A, SEL_DRIF1_0),
1395 PINMUX_IPSR_MSEL(IP16_23_20, RIF3_D0_A, SEL_DRIF3_0), 1389 PINMUX_IPSR_MSEL(IP16_23_20, RIF3_D0_A, SEL_DRIF3_0),
1396 PINMUX_IPSR_MSEL(IP16_23_20, TCLK2_A, SEL_TIMER_TMU_0), 1390 PINMUX_IPSR_MSEL(IP16_23_20, TCLK2_A, SEL_TIMER_TMU2_0),
1397 1391
1398 PINMUX_IPSR_GPSR(IP16_27_24, SSI_SDATA8), 1392 PINMUX_IPSR_GPSR(IP16_27_24, SSI_SDATA8),
1399 PINMUX_IPSR_MSEL(IP16_27_24, HRTS2_N_B, SEL_HSCIF2_1), 1393 PINMUX_IPSR_MSEL(IP16_27_24, HRTS2_N_B, SEL_HSCIF2_1),
@@ -1410,14 +1404,14 @@ static const u16 pinmux_data[] = {
1410 PINMUX_IPSR_MSEL(IP16_31_28, SSI_WS1_B, SEL_SSI_1), 1404 PINMUX_IPSR_MSEL(IP16_31_28, SSI_WS1_B, SEL_SSI_1),
1411 PINMUX_IPSR_GPSR(IP16_31_28, SCK1), 1405 PINMUX_IPSR_GPSR(IP16_31_28, SCK1),
1412 PINMUX_IPSR_MSEL(IP16_31_28, STP_IVCXO27_1_A, SEL_SSP1_1_0), 1406 PINMUX_IPSR_MSEL(IP16_31_28, STP_IVCXO27_1_A, SEL_SSP1_1_0),
1413 PINMUX_IPSR_GPSR(IP16_31_28, SCK5_A), 1407 PINMUX_IPSR_MSEL(IP16_31_28, SCK5_A, SEL_SCIF5_0),
1414 1408
1415 /* IPSR17 */ 1409 /* IPSR17 */
1416 PINMUX_IPSR_MSEL(IP17_3_0, AUDIO_CLKA_A, SEL_ADG_A_0), 1410 PINMUX_IPSR_MSEL(IP17_3_0, AUDIO_CLKA_A, SEL_ADG_A_0),
1417 PINMUX_IPSR_GPSR(IP17_3_0, CC5_OSCOUT), 1411 PINMUX_IPSR_GPSR(IP17_3_0, CC5_OSCOUT),
1418 1412
1419 PINMUX_IPSR_MSEL(IP17_7_4, AUDIO_CLKB_B, SEL_ADG_B_1), 1413 PINMUX_IPSR_MSEL(IP17_7_4, AUDIO_CLKB_B, SEL_ADG_B_1),
1420 PINMUX_IPSR_MSEL(IP17_7_4, SCIF_CLK_A, SEL_SCIF1_0), 1414 PINMUX_IPSR_MSEL(IP17_7_4, SCIF_CLK_A, SEL_SCIF_0),
1421 PINMUX_IPSR_MSEL(IP17_7_4, STP_IVCXO27_1_D, SEL_SSP1_1_3), 1415 PINMUX_IPSR_MSEL(IP17_7_4, STP_IVCXO27_1_D, SEL_SSP1_1_3),
1422 PINMUX_IPSR_MSEL(IP17_7_4, REMOCON_A, SEL_REMOCON_0), 1416 PINMUX_IPSR_MSEL(IP17_7_4, REMOCON_A, SEL_REMOCON_0),
1423 PINMUX_IPSR_MSEL(IP17_7_4, TCLK1_A, SEL_TIMER_TMU_0), 1417 PINMUX_IPSR_MSEL(IP17_7_4, TCLK1_A, SEL_TIMER_TMU_0),
@@ -1461,10 +1455,10 @@ static const u16 pinmux_data[] = {
1461 PINMUX_IPSR_GPSR(IP17_27_24, AUDIO_CLKOUT_B), 1455 PINMUX_IPSR_GPSR(IP17_27_24, AUDIO_CLKOUT_B),
1462 PINMUX_IPSR_MSEL(IP17_27_24, SSI_SCK2_B, SEL_SSI_1), 1456 PINMUX_IPSR_MSEL(IP17_27_24, SSI_SCK2_B, SEL_SSI_1),
1463 PINMUX_IPSR_MSEL(IP17_27_24, TS_SDEN1_D, SEL_TSIF1_3), 1457 PINMUX_IPSR_MSEL(IP17_27_24, TS_SDEN1_D, SEL_TSIF1_3),
1464 PINMUX_IPSR_MSEL(IP17_27_24, STP_ISEN_1_D, SEL_SSP1_1_2), 1458 PINMUX_IPSR_MSEL(IP17_27_24, STP_ISEN_1_D, SEL_SSP1_1_3),
1465 PINMUX_IPSR_MSEL(IP17_27_24, STP_OPWM_0_E, SEL_SSP1_0_4), 1459 PINMUX_IPSR_MSEL(IP17_27_24, STP_OPWM_0_E, SEL_SSP1_0_4),
1466 PINMUX_IPSR_MSEL(IP17_27_24, RIF3_D0_B, SEL_DRIF3_1), 1460 PINMUX_IPSR_MSEL(IP17_27_24, RIF3_D0_B, SEL_DRIF3_1),
1467 PINMUX_IPSR_MSEL(IP17_27_24, TCLK2_B, SEL_TIMER_TMU_1), 1461 PINMUX_IPSR_MSEL(IP17_27_24, TCLK2_B, SEL_TIMER_TMU2_1),
1468 PINMUX_IPSR_GPSR(IP17_27_24, TPU0TO0), 1462 PINMUX_IPSR_GPSR(IP17_27_24, TPU0TO0),
1469 PINMUX_IPSR_MSEL(IP17_27_24, BPFCLK_C, SEL_FM_2), 1463 PINMUX_IPSR_MSEL(IP17_27_24, BPFCLK_C, SEL_FM_2),
1470 PINMUX_IPSR_MSEL(IP17_27_24, HRTS2_N_C, SEL_HSCIF2_2), 1464 PINMUX_IPSR_MSEL(IP17_27_24, HRTS2_N_C, SEL_HSCIF2_2),
@@ -1476,7 +1470,7 @@ static const u16 pinmux_data[] = {
1476 PINMUX_IPSR_MSEL(IP17_31_28, STP_ISSYNC_1_D, SEL_SSP1_1_3), 1470 PINMUX_IPSR_MSEL(IP17_31_28, STP_ISSYNC_1_D, SEL_SSP1_1_3),
1477 PINMUX_IPSR_MSEL(IP17_31_28, STP_IVCXO27_0_E, SEL_SSP1_0_4), 1471 PINMUX_IPSR_MSEL(IP17_31_28, STP_IVCXO27_0_E, SEL_SSP1_0_4),
1478 PINMUX_IPSR_MSEL(IP17_31_28, RIF3_D1_B, SEL_DRIF3_1), 1472 PINMUX_IPSR_MSEL(IP17_31_28, RIF3_D1_B, SEL_DRIF3_1),
1479 PINMUX_IPSR_MSEL(IP17_31_28, FSO_TOE_B, SEL_FSO_1), 1473 PINMUX_IPSR_GPSR(IP17_31_28, FSO_TOE_N),
1480 PINMUX_IPSR_GPSR(IP17_31_28, TPU0TO1), 1474 PINMUX_IPSR_GPSR(IP17_31_28, TPU0TO1),
1481 1475
1482 /* IPSR18 */ 1476 /* IPSR18 */
@@ -1487,7 +1481,6 @@ static const u16 pinmux_data[] = {
1487 PINMUX_IPSR_MSEL(IP18_3_0, STP_ISEN_0_E, SEL_SSP1_0_4), 1481 PINMUX_IPSR_MSEL(IP18_3_0, STP_ISEN_0_E, SEL_SSP1_0_4),
1488 PINMUX_IPSR_MSEL(IP18_3_0, RIF2_D0_B, SEL_DRIF2_1), 1482 PINMUX_IPSR_MSEL(IP18_3_0, RIF2_D0_B, SEL_DRIF2_1),
1489 PINMUX_IPSR_GPSR(IP18_3_0, TPU0TO2), 1483 PINMUX_IPSR_GPSR(IP18_3_0, TPU0TO2),
1490 PINMUX_IPSR_MSEL(IP18_3_0, FSO_CFE_0_A, SEL_FSO_0),
1491 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_C, SEL_FM_2), 1484 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_C, SEL_FM_2),
1492 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_D, SEL_FM_3), 1485 PINMUX_IPSR_MSEL(IP18_3_0, FMCLK_D, SEL_FM_3),
1493 1486
@@ -1498,7 +1491,6 @@ static const u16 pinmux_data[] = {
1498 PINMUX_IPSR_MSEL(IP18_7_4, STP_ISSYNC_0_E, SEL_SSP1_0_4), 1491 PINMUX_IPSR_MSEL(IP18_7_4, STP_ISSYNC_0_E, SEL_SSP1_0_4),
1499 PINMUX_IPSR_MSEL(IP18_7_4, RIF2_D1_B, SEL_DRIF2_1), 1492 PINMUX_IPSR_MSEL(IP18_7_4, RIF2_D1_B, SEL_DRIF2_1),
1500 PINMUX_IPSR_GPSR(IP18_7_4, TPU0TO3), 1493 PINMUX_IPSR_GPSR(IP18_7_4, TPU0TO3),
1501 PINMUX_IPSR_MSEL(IP18_7_4, FSO_CFE_1_A, SEL_FSO_0),
1502 PINMUX_IPSR_MSEL(IP18_7_4, FMIN_C, SEL_FM_2), 1494 PINMUX_IPSR_MSEL(IP18_7_4, FMIN_C, SEL_FM_2),
1503 PINMUX_IPSR_MSEL(IP18_7_4, FMIN_D, SEL_FM_3), 1495 PINMUX_IPSR_MSEL(IP18_7_4, FMIN_D, SEL_FM_3),
1504 1496
@@ -3082,7 +3074,7 @@ static const unsigned int msiof3_ss2_e_pins[] = {
3082 RCAR_GP_PIN(2, 0), 3074 RCAR_GP_PIN(2, 0),
3083}; 3075};
3084static const unsigned int msiof3_ss2_e_mux[] = { 3076static const unsigned int msiof3_ss2_e_mux[] = {
3085 MSIOF3_SS1_E_MARK, 3077 MSIOF3_SS2_E_MARK,
3086}; 3078};
3087static const unsigned int msiof3_txd_e_pins[] = { 3079static const unsigned int msiof3_txd_e_pins[] = {
3088 /* TXD */ 3080 /* TXD */
@@ -3796,6 +3788,32 @@ static const unsigned int ssi9_ctrl_b_mux[] = {
3796 SSI_SCK9_B_MARK, SSI_WS9_B_MARK, 3788 SSI_SCK9_B_MARK, SSI_WS9_B_MARK,
3797}; 3789};
3798 3790
3791/* - USB0 ------------------------------------------------------------------- */
3792static const unsigned int usb0_pins[] = {
3793 /* PWEN, OVC */
3794 RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
3795};
3796static const unsigned int usb0_mux[] = {
3797 USB0_PWEN_MARK, USB0_OVC_MARK,
3798};
3799/* - USB1 ------------------------------------------------------------------- */
3800static const unsigned int usb1_pins[] = {
3801 /* PWEN, OVC */
3802 RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
3803};
3804static const unsigned int usb1_mux[] = {
3805 USB1_PWEN_MARK, USB1_OVC_MARK,
3806};
3807
3808/* - USB30 ------------------------------------------------------------------ */
3809static const unsigned int usb30_pins[] = {
3810 /* PWEN, OVC */
3811 RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
3812};
3813static const unsigned int usb30_mux[] = {
3814 USB30_PWEN_MARK, USB30_OVC_MARK,
3815};
3816
3799static const struct sh_pfc_pin_group pinmux_groups[] = { 3817static const struct sh_pfc_pin_group pinmux_groups[] = {
3800 SH_PFC_PIN_GROUP(audio_clk_a_a), 3818 SH_PFC_PIN_GROUP(audio_clk_a_a),
3801 SH_PFC_PIN_GROUP(audio_clk_a_b), 3819 SH_PFC_PIN_GROUP(audio_clk_a_b),
@@ -4096,6 +4114,9 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
4096 SH_PFC_PIN_GROUP(ssi9_data_b), 4114 SH_PFC_PIN_GROUP(ssi9_data_b),
4097 SH_PFC_PIN_GROUP(ssi9_ctrl_a), 4115 SH_PFC_PIN_GROUP(ssi9_ctrl_a),
4098 SH_PFC_PIN_GROUP(ssi9_ctrl_b), 4116 SH_PFC_PIN_GROUP(ssi9_ctrl_b),
4117 SH_PFC_PIN_GROUP(usb0),
4118 SH_PFC_PIN_GROUP(usb1),
4119 SH_PFC_PIN_GROUP(usb30),
4099}; 4120};
4100 4121
4101static const char * const audio_clk_groups[] = { 4122static const char * const audio_clk_groups[] = {
@@ -4526,6 +4547,18 @@ static const char * const ssi_groups[] = {
4526 "ssi9_ctrl_b", 4547 "ssi9_ctrl_b",
4527}; 4548};
4528 4549
4550static const char * const usb0_groups[] = {
4551 "usb0",
4552};
4553
4554static const char * const usb1_groups[] = {
4555 "usb1",
4556};
4557
4558static const char * const usb30_groups[] = {
4559 "usb30",
4560};
4561
4529static const struct sh_pfc_function pinmux_functions[] = { 4562static const struct sh_pfc_function pinmux_functions[] = {
4530 SH_PFC_FUNCTION(audio_clk), 4563 SH_PFC_FUNCTION(audio_clk),
4531 SH_PFC_FUNCTION(avb), 4564 SH_PFC_FUNCTION(avb),
@@ -4570,6 +4603,9 @@ static const struct sh_pfc_function pinmux_functions[] = {
4570 SH_PFC_FUNCTION(sdhi2), 4603 SH_PFC_FUNCTION(sdhi2),
4571 SH_PFC_FUNCTION(sdhi3), 4604 SH_PFC_FUNCTION(sdhi3),
4572 SH_PFC_FUNCTION(ssi), 4605 SH_PFC_FUNCTION(ssi),
4606 SH_PFC_FUNCTION(usb0),
4607 SH_PFC_FUNCTION(usb1),
4608 SH_PFC_FUNCTION(usb30),
4573}; 4609};
4574 4610
4575static const struct pinmux_cfg_reg pinmux_config_regs[] = { 4611static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -4927,7 +4963,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
4927 IP7_27_24 4963 IP7_27_24
4928 IP7_23_20 4964 IP7_23_20
4929 IP7_19_16 4965 IP7_19_16
4930 IP7_15_12 4966 /* IP7_15_12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4931 IP7_11_8 4967 IP7_11_8
4932 IP7_7_4 4968 IP7_7_4
4933 IP7_3_0 } 4969 IP7_3_0 }
@@ -5060,7 +5096,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
5060 MOD_SEL0_19 5096 MOD_SEL0_19
5061 MOD_SEL0_18_17 5097 MOD_SEL0_18_17
5062 MOD_SEL0_16 5098 MOD_SEL0_16
5063 MOD_SEL0_15 5099 0, 0, /* RESERVED 15 */
5064 MOD_SEL0_14_13 5100 MOD_SEL0_14_13
5065 MOD_SEL0_12 5101 MOD_SEL0_12
5066 MOD_SEL0_11 5102 MOD_SEL0_11
@@ -5502,7 +5538,7 @@ static const struct sh_pfc_bias_info bias_info[] = {
5502 { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */ 5538 { RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */
5503 { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */ 5539 { RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */
5504 { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */ 5540 { RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */
5505 { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N_A26 */ 5541 { RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N */
5506 { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */ 5542 { RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */
5507 { RCAR_GP_PIN(1, 28), PU2, 0 }, /* CLKOUT */ 5543 { RCAR_GP_PIN(1, 28), PU2, 0 }, /* CLKOUT */
5508 5544
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
new file mode 100644
index 000000000000..4f5ee1d7317d
--- /dev/null
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
@@ -0,0 +1,1812 @@
1/*
2 * R8A77995 processor support - PFC hardware block.
3 *
4 * Copyright (C) 2017 Renesas Electronics Corp.
5 *
6 * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7796.c
7 *
8 * R-Car Gen3 processor support - PFC hardware block.
9 *
10 * Copyright (C) 2015 Renesas Electronics Corporation
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2 of the License.
15 */
16
17#include <linux/kernel.h>
18
19#include "core.h"
20#include "sh_pfc.h"
21
22#define CPU_ALL_PORT(fn, sfx) \
23 PORT_GP_9(0, fn, sfx), \
24 PORT_GP_32(1, fn, sfx), \
25 PORT_GP_32(2, fn, sfx), \
26 PORT_GP_CFG_10(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \
27 PORT_GP_32(4, fn, sfx), \
28 PORT_GP_21(5, fn, sfx), \
29 PORT_GP_14(6, fn, sfx)
30
31/*
32 * F_() : just information
33 * FM() : macro for FN_xxx / xxx_MARK
34 */
35
36/* GPSR0 */
37#define GPSR0_8 F_(MLB_SIG, IP0_27_24)
38#define GPSR0_7 F_(MLB_DAT, IP0_23_20)
39#define GPSR0_6 F_(MLB_CLK, IP0_19_16)
40#define GPSR0_5 F_(MSIOF2_RXD, IP0_15_12)
41#define GPSR0_4 F_(MSIOF2_TXD, IP0_11_8)
42#define GPSR0_3 F_(MSIOF2_SCK, IP0_7_4)
43#define GPSR0_2 F_(IRQ0_A, IP0_3_0)
44#define GPSR0_1 FM(USB0_OVC)
45#define GPSR0_0 FM(USB0_PWEN)
46
47/* GPSR1 */
48#define GPSR1_31 F_(QPOLB, IP4_27_24)
49#define GPSR1_30 F_(QPOLA, IP4_23_20)
50#define GPSR1_29 F_(DU_CDE, IP4_19_16)
51#define GPSR1_28 F_(DU_DISP_CDE, IP4_15_12)
52#define GPSR1_27 F_(DU_DISP, IP4_11_8)
53#define GPSR1_26 F_(DU_VSYNC, IP4_7_4)
54#define GPSR1_25 F_(DU_HSYNC, IP4_3_0)
55#define GPSR1_24 F_(DU_DOTCLKOUT0, IP3_31_28)
56#define GPSR1_23 F_(DU_DR7, IP3_27_24)
57#define GPSR1_22 F_(DU_DR6, IP3_23_20)
58#define GPSR1_21 F_(DU_DR5, IP3_19_16)
59#define GPSR1_20 F_(DU_DR4, IP3_15_12)
60#define GPSR1_19 F_(DU_DR3, IP3_11_8)
61#define GPSR1_18 F_(DU_DR2, IP3_7_4)
62#define GPSR1_17 F_(DU_DR1, IP3_3_0)
63#define GPSR1_16 F_(DU_DR0, IP2_31_28)
64#define GPSR1_15 F_(DU_DG7, IP2_27_24)
65#define GPSR1_14 F_(DU_DG6, IP2_23_20)
66#define GPSR1_13 F_(DU_DG5, IP2_19_16)
67#define GPSR1_12 F_(DU_DG4, IP2_15_12)
68#define GPSR1_11 F_(DU_DG3, IP2_11_8)
69#define GPSR1_10 F_(DU_DG2, IP2_7_4)
70#define GPSR1_9 F_(DU_DG1, IP2_3_0)
71#define GPSR1_8 F_(DU_DG0, IP1_31_28)
72#define GPSR1_7 F_(DU_DB7, IP1_27_24)
73#define GPSR1_6 F_(DU_DB6, IP1_23_20)
74#define GPSR1_5 F_(DU_DB5, IP1_19_16)
75#define GPSR1_4 F_(DU_DB4, IP1_15_12)
76#define GPSR1_3 F_(DU_DB3, IP1_11_8)
77#define GPSR1_2 F_(DU_DB2, IP1_7_4)
78#define GPSR1_1 F_(DU_DB1, IP1_3_0)
79#define GPSR1_0 F_(DU_DB0, IP0_31_28)
80
81/* GPSR2 */
82#define GPSR2_31 F_(NFCE_N, IP8_19_16)
83#define GPSR2_30 F_(NFCLE, IP8_15_12)
84#define GPSR2_29 F_(NFALE, IP8_11_8)
85#define GPSR2_28 F_(VI4_CLKENB, IP8_7_4)
86#define GPSR2_27 F_(VI4_FIELD, IP8_3_0)
87#define GPSR2_26 F_(VI4_HSYNC_N, IP7_31_28)
88#define GPSR2_25 F_(VI4_VSYNC_N, IP7_27_24)
89#define GPSR2_24 F_(VI4_DATA23, IP7_23_20)
90#define GPSR2_23 F_(VI4_DATA22, IP7_19_16)
91#define GPSR2_22 F_(VI4_DATA21, IP7_15_12)
92#define GPSR2_21 F_(VI4_DATA20, IP7_11_8)
93#define GPSR2_20 F_(VI4_DATA19, IP7_7_4)
94#define GPSR2_19 F_(VI4_DATA18, IP7_3_0)
95#define GPSR2_18 F_(VI4_DATA17, IP6_31_28)
96#define GPSR2_17 F_(VI4_DATA16, IP6_27_24)
97#define GPSR2_16 F_(VI4_DATA15, IP6_23_20)
98#define GPSR2_15 F_(VI4_DATA14, IP6_19_16)
99#define GPSR2_14 F_(VI4_DATA13, IP6_15_12)
100#define GPSR2_13 F_(VI4_DATA12, IP6_11_8)
101#define GPSR2_12 F_(VI4_DATA11, IP6_7_4)
102#define GPSR2_11 F_(VI4_DATA10, IP6_3_0)
103#define GPSR2_10 F_(VI4_DATA9, IP5_31_28)
104#define GPSR2_9 F_(VI4_DATA8, IP5_27_24)
105#define GPSR2_8 F_(VI4_DATA7, IP5_23_20)
106#define GPSR2_7 F_(VI4_DATA6, IP5_19_16)
107#define GPSR2_6 F_(VI4_DATA5, IP5_15_12)
108#define GPSR2_5 FM(VI4_DATA4)
109#define GPSR2_4 F_(VI4_DATA3, IP5_11_8)
110#define GPSR2_3 F_(VI4_DATA2, IP5_7_4)
111#define GPSR2_2 F_(VI4_DATA1, IP5_3_0)
112#define GPSR2_1 F_(VI4_DATA0, IP4_31_28)
113#define GPSR2_0 FM(VI4_CLK)
114
115/* GPSR3 */
116#define GPSR3_9 F_(NFDATA7, IP9_31_28)
117#define GPSR3_8 F_(NFDATA6, IP9_27_24)
118#define GPSR3_7 F_(NFDATA5, IP9_23_20)
119#define GPSR3_6 F_(NFDATA4, IP9_19_16)
120#define GPSR3_5 F_(NFDATA3, IP9_15_12)
121#define GPSR3_4 F_(NFDATA2, IP9_11_8)
122#define GPSR3_3 F_(NFDATA1, IP9_7_4)
123#define GPSR3_2 F_(NFDATA0, IP9_3_0)
124#define GPSR3_1 F_(NFWE_N, IP8_31_28)
125#define GPSR3_0 F_(NFRE_N, IP8_27_24)
126
127/* GPSR4 */
128#define GPSR4_31 F_(CAN0_RX_A, IP12_27_24)
129#define GPSR4_30 F_(CAN1_TX_A, IP13_7_4)
130#define GPSR4_29 F_(CAN1_RX_A, IP13_3_0)
131#define GPSR4_28 F_(CAN0_TX_A, IP12_31_28)
132#define GPSR4_27 FM(TX2)
133#define GPSR4_26 FM(RX2)
134#define GPSR4_25 F_(SCK2, IP12_11_8)
135#define GPSR4_24 F_(TX1_A, IP12_7_4)
136#define GPSR4_23 F_(RX1_A, IP12_3_0)
137#define GPSR4_22 F_(SCK1_A, IP11_31_28)
138#define GPSR4_21 F_(TX0_A, IP11_27_24)
139#define GPSR4_20 F_(RX0_A, IP11_23_20)
140#define GPSR4_19 F_(SCK0_A, IP11_19_16)
141#define GPSR4_18 F_(MSIOF1_RXD, IP11_15_12)
142#define GPSR4_17 F_(MSIOF1_TXD, IP11_11_8)
143#define GPSR4_16 F_(MSIOF1_SCK, IP11_7_4)
144#define GPSR4_15 FM(MSIOF0_RXD)
145#define GPSR4_14 FM(MSIOF0_TXD)
146#define GPSR4_13 FM(MSIOF0_SYNC)
147#define GPSR4_12 FM(MSIOF0_SCK)
148#define GPSR4_11 F_(SDA1, IP11_3_0)
149#define GPSR4_10 F_(SCL1, IP10_31_28)
150#define GPSR4_9 FM(SDA0)
151#define GPSR4_8 FM(SCL0)
152#define GPSR4_7 F_(SSI_WS4_A, IP10_27_24)
153#define GPSR4_6 F_(SSI_SDATA4_A, IP10_23_20)
154#define GPSR4_5 F_(SSI_SCK4_A, IP10_19_16)
155#define GPSR4_4 F_(SSI_WS34, IP10_15_12)
156#define GPSR4_3 F_(SSI_SDATA3, IP10_11_8)
157#define GPSR4_2 F_(SSI_SCK34, IP10_7_4)
158#define GPSR4_1 F_(AUDIO_CLKA, IP10_3_0)
159#define GPSR4_0 F_(NFRB_N, IP8_23_20)
160
161/* GPSR5 */
162#define GPSR5_20 FM(AVB0_LINK)
163#define GPSR5_19 FM(AVB0_PHY_INT)
164#define GPSR5_18 FM(AVB0_MAGIC)
165#define GPSR5_17 FM(AVB0_MDC)
166#define GPSR5_16 FM(AVB0_MDIO)
167#define GPSR5_15 FM(AVB0_TXCREFCLK)
168#define GPSR5_14 FM(AVB0_TD3)
169#define GPSR5_13 FM(AVB0_TD2)
170#define GPSR5_12 FM(AVB0_TD1)
171#define GPSR5_11 FM(AVB0_TD0)
172#define GPSR5_10 FM(AVB0_TXC)
173#define GPSR5_9 FM(AVB0_TX_CTL)
174#define GPSR5_8 FM(AVB0_RD3)
175#define GPSR5_7 FM(AVB0_RD2)
176#define GPSR5_6 FM(AVB0_RD1)
177#define GPSR5_5 FM(AVB0_RD0)
178#define GPSR5_4 FM(AVB0_RXC)
179#define GPSR5_3 FM(AVB0_RX_CTL)
180#define GPSR5_2 F_(CAN_CLK, IP12_23_20)
181#define GPSR5_1 F_(TPU0TO1_A, IP12_19_16)
182#define GPSR5_0 F_(TPU0TO0_A, IP12_15_12)
183
184/* GPSR6 */
185#define GPSR6_13 FM(RPC_INT_N)
186#define GPSR6_12 FM(RPC_RESET_N)
187#define GPSR6_11 FM(QSPI1_SSL)
188#define GPSR6_10 FM(QSPI1_IO3)
189#define GPSR6_9 FM(QSPI1_IO2)
190#define GPSR6_8 FM(QSPI1_MISO_IO1)
191#define GPSR6_7 FM(QSPI1_MOSI_IO0)
192#define GPSR6_6 FM(QSPI1_SPCLK)
193#define GPSR6_5 FM(QSPI0_SSL)
194#define GPSR6_4 FM(QSPI0_IO3)
195#define GPSR6_3 FM(QSPI0_IO2)
196#define GPSR6_2 FM(QSPI0_MISO_IO1)
197#define GPSR6_1 FM(QSPI0_MOSI_IO0)
198#define GPSR6_0 FM(QSPI0_SPCLK)
199
200/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 - F */
201#define IP0_3_0 FM(IRQ0_A) FM(MSIOF2_SYNC_B) FM(USB0_IDIN) 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) F_(0, 0)
202#define IP0_7_4 FM(MSIOF2_SCK) F_(0, 0) FM(USB0_IDPU) 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) F_(0, 0)
203#define IP0_11_8 FM(MSIOF2_TXD) FM(SCL3_A) 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) F_(0, 0) F_(0, 0)
204#define IP0_15_12 FM(MSIOF2_RXD) FM(SDA3_A) 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) F_(0, 0) F_(0, 0)
205#define IP0_19_16 FM(MLB_CLK) FM(MSIOF2_SYNC_A) FM(SCK5_A) 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) F_(0, 0)
206#define IP0_23_20 FM(MLB_DAT) FM(MSIOF2_SS1) FM(RX5_A) 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) F_(0, 0) F_(0, 0)
207#define IP0_27_24 FM(MLB_SIG) FM(MSIOF2_SS2) FM(TX5_A) 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) F_(0, 0) F_(0, 0)
208#define IP0_31_28 FM(DU_DB0) FM(LCDOUT0) FM(MSIOF3_TXD_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) F_(0, 0) F_(0, 0) F_(0, 0)
209#define IP1_3_0 FM(DU_DB1) FM(LCDOUT1) FM(MSIOF3_RXD_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) F_(0, 0) F_(0, 0) F_(0, 0)
210#define IP1_7_4 FM(DU_DB2) FM(LCDOUT2) FM(IRQ0_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) F_(0, 0) F_(0, 0) F_(0, 0)
211#define IP1_11_8 FM(DU_DB3) FM(LCDOUT3) FM(SCK5_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) F_(0, 0) F_(0, 0) F_(0, 0)
212#define IP1_15_12 FM(DU_DB4) FM(LCDOUT4) FM(RX5_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) F_(0, 0) F_(0, 0) F_(0, 0)
213#define IP1_19_16 FM(DU_DB5) FM(LCDOUT5) FM(TX5_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) F_(0, 0) F_(0, 0) F_(0, 0)
214#define IP1_23_20 FM(DU_DB6) FM(LCDOUT6) FM(MSIOF3_SS1_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) F_(0, 0) F_(0, 0) F_(0, 0)
215#define IP1_27_24 FM(DU_DB7) FM(LCDOUT7) FM(MSIOF3_SS2_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) F_(0, 0) F_(0, 0) F_(0, 0)
216#define IP1_31_28 FM(DU_DG0) FM(LCDOUT8) FM(MSIOF3_SCK_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) F_(0, 0) F_(0, 0) F_(0, 0)
217#define IP2_3_0 FM(DU_DG1) FM(LCDOUT9) FM(MSIOF3_SYNC_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) F_(0, 0) F_(0, 0) F_(0, 0)
218#define IP2_7_4 FM(DU_DG2) FM(LCDOUT10) 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) F_(0, 0) F_(0, 0)
219#define IP2_11_8 FM(DU_DG3) FM(LCDOUT11) FM(IRQ1_A) 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) F_(0, 0)
220#define IP2_15_12 FM(DU_DG4) FM(LCDOUT12) FM(HSCK3_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) F_(0, 0) F_(0, 0) F_(0, 0)
221#define IP2_19_16 FM(DU_DG5) FM(LCDOUT13) FM(HTX3_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) F_(0, 0) F_(0, 0) F_(0, 0)
222#define IP2_23_20 FM(DU_DG6) FM(LCDOUT14) FM(HRX3_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) F_(0, 0) F_(0, 0) F_(0, 0)
223#define IP2_27_24 FM(DU_DG7) FM(LCDOUT15) FM(SCK4_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) F_(0, 0) F_(0, 0) F_(0, 0)
224#define IP2_31_28 FM(DU_DR0) FM(LCDOUT16) FM(RX4_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) F_(0, 0) F_(0, 0) F_(0, 0)
225#define IP3_3_0 FM(DU_DR1) FM(LCDOUT17) FM(TX4_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) F_(0, 0) F_(0, 0) F_(0, 0)
226#define IP3_7_4 FM(DU_DR2) FM(LCDOUT18) FM(PWM0_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) F_(0, 0) F_(0, 0) F_(0, 0)
227#define IP3_11_8 FM(DU_DR3) FM(LCDOUT19) FM(PWM1_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) F_(0, 0) F_(0, 0) F_(0, 0)
228#define IP3_15_12 FM(DU_DR4) FM(LCDOUT20) FM(TCLK2_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) F_(0, 0) F_(0, 0) F_(0, 0)
229#define IP3_19_16 FM(DU_DR5) FM(LCDOUT21) FM(NMI) 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) F_(0, 0)
230#define IP3_23_20 FM(DU_DR6) FM(LCDOUT22) FM(PWM2_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) F_(0, 0) F_(0, 0) F_(0, 0)
231#define IP3_27_24 FM(DU_DR7) FM(LCDOUT23) FM(TCLK1_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) F_(0, 0) F_(0, 0) F_(0, 0)
232#define IP3_31_28 FM(DU_DOTCLKOUT0) FM(QCLK) 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) F_(0, 0) F_(0, 0)
233
234/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 - F */
235#define IP4_3_0 FM(DU_HSYNC) FM(QSTH_QHS) FM(IRQ3_A) 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) F_(0, 0)
236#define IP4_7_4 FM(DU_VSYNC) FM(QSTVA_QVS) FM(IRQ4_A) 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) F_(0, 0)
237#define IP4_11_8 FM(DU_DISP) FM(QSTVB_QVE) FM(PWM3_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) F_(0, 0) F_(0, 0) F_(0, 0)
238#define IP4_15_12 FM(DU_DISP_CDE) FM(QCPV_QDE) FM(IRQ2_B) FM(DU_DOTCLKIN1)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)
239#define IP4_19_16 FM(DU_CDE) FM(QSTB_QHE) FM(SCK3_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) F_(0, 0) F_(0, 0) F_(0, 0)
240#define IP4_23_20 FM(QPOLA) F_(0, 0) FM(RX3_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) F_(0, 0) F_(0, 0) F_(0, 0)
241#define IP4_27_24 FM(QPOLB) F_(0, 0) FM(TX3_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) F_(0, 0) F_(0, 0) F_(0, 0)
242#define IP4_31_28 FM(VI4_DATA0) FM(PWM0_A) 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) F_(0, 0) F_(0, 0)
243#define IP5_3_0 FM(VI4_DATA1) FM(PWM1_A) 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) F_(0, 0) F_(0, 0)
244#define IP5_7_4 FM(VI4_DATA2) FM(PWM2_A) 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) F_(0, 0) F_(0, 0)
245#define IP5_11_8 FM(VI4_DATA3) FM(PWM3_A) 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) F_(0, 0) F_(0, 0)
246#define IP5_15_12 FM(VI4_DATA5) FM(SCK4_A) 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) F_(0, 0) F_(0, 0)
247#define IP5_19_16 FM(VI4_DATA6) FM(IRQ2_A) 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) F_(0, 0) F_(0, 0)
248#define IP5_23_20 FM(VI4_DATA7) FM(TCLK2_A) 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) F_(0, 0) F_(0, 0)
249#define IP5_27_24 FM(VI4_DATA8) 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) F_(0, 0) F_(0, 0) F_(0, 0)
250#define IP5_31_28 FM(VI4_DATA9) FM(MSIOF3_SS2_A) FM(IRQ1_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) F_(0, 0) F_(0, 0) F_(0, 0)
251#define IP6_3_0 FM(VI4_DATA10) FM(RX4_A) 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) F_(0, 0) F_(0, 0)
252#define IP6_7_4 FM(VI4_DATA11) FM(TX4_A) 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) F_(0, 0) F_(0, 0)
253#define IP6_11_8 FM(VI4_DATA12) FM(TCLK1_A) 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) F_(0, 0) F_(0, 0)
254#define IP6_15_12 FM(VI4_DATA13) FM(MSIOF3_SS1_A) FM(HCTS3_N) 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) F_(0, 0)
255#define IP6_19_16 FM(VI4_DATA14) FM(SSI_SCK4_B) FM(HRTS3_N) 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) F_(0, 0)
256#define IP6_23_20 FM(VI4_DATA15) FM(SSI_SDATA4_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) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
257#define IP6_27_24 FM(VI4_DATA16) FM(HRX3_A) 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) F_(0, 0) F_(0, 0)
258#define IP6_31_28 FM(VI4_DATA17) FM(HTX3_A) 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) F_(0, 0) F_(0, 0)
259#define IP7_3_0 FM(VI4_DATA18) FM(HSCK3_A) 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) F_(0, 0) F_(0, 0)
260#define IP7_7_4 FM(VI4_DATA19) FM(SSI_WS4_B) F_(0, 0) F_(0, 0) FM(NFDATA15) 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)
261#define IP7_11_8 FM(VI4_DATA20) FM(MSIOF3_SYNC_A) F_(0, 0) F_(0, 0) FM(NFDATA14) 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)
262#define IP7_15_12 FM(VI4_DATA21) FM(MSIOF3_TXD_A) F_(0, 0) F_(0, 0) FM(NFDATA13) 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)
263#define IP7_19_16 FM(VI4_DATA22) FM(MSIOF3_RXD_A) F_(0, 0) F_(0, 0) FM(NFDATA12) 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)
264#define IP7_23_20 FM(VI4_DATA23) FM(MSIOF3_SCK_A) F_(0, 0) F_(0, 0) FM(NFDATA11) 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)
265#define IP7_27_24 FM(VI4_VSYNC_N) FM(SCK1_B) F_(0, 0) F_(0, 0) FM(NFDATA10) 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)
266#define IP7_31_28 FM(VI4_HSYNC_N) FM(RX1_B) F_(0, 0) F_(0, 0) FM(NFDATA9) 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)
267
268/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 - F */
269#define IP8_3_0 FM(VI4_FIELD) FM(AUDIO_CLKB) FM(IRQ5_A) FM(SCIF_CLK) FM(NFDATA8) 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)
270#define IP8_7_4 FM(VI4_CLKENB) FM(TX1_B) F_(0, 0) F_(0, 0) FM(NFWP_N) FM(DVC_MUTE_A) 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)
271#define IP8_11_8 FM(NFALE) FM(SCL2_B) FM(IRQ3_B) FM(PWM0_C) 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)
272#define IP8_15_12 FM(NFCLE) FM(SDA2_B) FM(SCK3_A) FM(PWM1_C) 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)
273#define IP8_19_16 FM(NFCE_N) F_(0, 0) FM(RX3_A) FM(PWM2_C) 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)
274#define IP8_23_20 FM(NFRB_N) F_(0, 0) FM(TX3_A) FM(PWM3_C) 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)
275#define IP8_27_24 FM(NFRE_N) FM(MMC_CMD) 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) F_(0, 0) F_(0, 0)
276#define IP8_31_28 FM(NFWE_N) FM(MMC_CLK) 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) F_(0, 0) F_(0, 0)
277#define IP9_3_0 FM(NFDATA0) FM(MMC_D0) 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) F_(0, 0) F_(0, 0)
278#define IP9_7_4 FM(NFDATA1) FM(MMC_D1) 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) F_(0, 0) F_(0, 0)
279#define IP9_11_8 FM(NFDATA2) FM(MMC_D2) 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) F_(0, 0) F_(0, 0)
280#define IP9_15_12 FM(NFDATA3) FM(MMC_D3) 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) F_(0, 0) F_(0, 0)
281#define IP9_19_16 FM(NFDATA4) FM(MMC_D4) 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) F_(0, 0) F_(0, 0)
282#define IP9_23_20 FM(NFDATA5) 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) F_(0, 0) F_(0, 0) F_(0, 0)
283#define IP9_27_24 FM(NFDATA6) FM(MMC_D6) 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) F_(0, 0) F_(0, 0)
284#define IP9_31_28 FM(NFDATA7) FM(MMC_D7) 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) F_(0, 0) F_(0, 0)
285#define IP10_3_0 FM(AUDIO_CLKA) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(DVC_MUTE_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)
286#define IP10_7_4 FM(SSI_SCK34) FM(FSO_CFE_0_N_A) 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) F_(0, 0) F_(0, 0)
287#define IP10_11_8 FM(SSI_SDATA3) FM(FSO_CFE_1_N_A) 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) F_(0, 0) F_(0, 0)
288#define IP10_15_12 FM(SSI_WS34) FM(FSO_TOE_N_A) 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) F_(0, 0) F_(0, 0)
289#define IP10_19_16 FM(SSI_SCK4_A) FM(HSCK0) FM(AUDIO_CLKOUT) FM(CAN0_RX_B) FM(IRQ4_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) F_(0, 0)
290#define IP10_23_20 FM(SSI_SDATA4_A) FM(HTX0) FM(SCL2_A) FM(CAN1_RX_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) F_(0, 0) F_(0, 0)
291#define IP10_27_24 FM(SSI_WS4_A) FM(HRX0) FM(SDA2_A) FM(CAN1_TX_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) F_(0, 0) F_(0, 0)
292#define IP10_31_28 FM(SCL1) FM(CTS1_N) 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) F_(0, 0) F_(0, 0)
293#define IP11_3_0 FM(SDA1) FM(RTS1_N_TANS) 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) F_(0, 0) F_(0, 0)
294#define IP11_7_4 FM(MSIOF1_SCK) FM(AVB0_AVTP_PPS_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) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
295#define IP11_11_8 FM(MSIOF1_TXD) FM(AVB0_AVTP_CAPTURE_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) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
296#define IP11_15_12 FM(MSIOF1_RXD) FM(AVB0_AVTP_MATCH_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) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
297#define IP11_19_16 FM(SCK0_A) FM(MSIOF1_SYNC) FM(FSO_CFE_0_N_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) F_(0, 0) F_(0, 0) F_(0, 0)
298#define IP11_23_20 FM(RX0_A) FM(MSIOF0_SS1) FM(FSO_CFE_1_N_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) F_(0, 0) F_(0, 0) F_(0, 0)
299#define IP11_27_24 FM(TX0_A) FM(MSIOF0_SS2) FM(FSO_TOE_N_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) F_(0, 0) F_(0, 0) F_(0, 0)
300#define IP11_31_28 FM(SCK1_A) FM(MSIOF1_SS2) FM(TPU0TO2_B) FM(CAN0_TX_B) FM(AUDIO_CLKOUT1) 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)
301
302/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 - F */
303#define IP12_3_0 FM(RX1_A) FM(CTS0_N) FM(TPU0TO0_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) F_(0, 0) F_(0, 0) F_(0, 0)
304#define IP12_7_4 FM(TX1_A) FM(RTS0_N_TANS) FM(TPU0TO1_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) F_(0, 0) F_(0, 0) F_(0, 0)
305#define IP12_11_8 FM(SCK2) FM(MSIOF1_SS1) FM(TPU0TO3_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) F_(0, 0) F_(0, 0) F_(0, 0)
306#define IP12_15_12 FM(TPU0TO0_A) FM(AVB0_AVTP_CAPTURE_A) FM(HCTS0_N) 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) F_(0, 0)
307#define IP12_19_16 FM(TPU0TO1_A) FM(AVB0_AVTP_MATCH_A) FM(HRTS0_N) 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) F_(0, 0)
308#define IP12_23_20 FM(CAN_CLK) FM(AVB0_AVTP_PPS_A) FM(SCK0_B) FM(IRQ5_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) F_(0, 0) F_(0, 0)
309#define IP12_27_24 FM(CAN0_RX_A) FM(CANFD0_RX) FM(RX0_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) F_(0, 0) F_(0, 0) F_(0, 0)
310#define IP12_31_28 FM(CAN0_TX_A) FM(CANFD0_TX) FM(TX0_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) F_(0, 0) F_(0, 0) F_(0, 0)
311#define IP13_3_0 FM(CAN1_RX_A) FM(CANFD1_RX) FM(TPU0TO2_A) 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) F_(0, 0)
312#define IP13_7_4 FM(CAN1_TX_A) FM(CANFD1_TX) FM(TPU0TO3_A) 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) F_(0, 0)
313
314#define PINMUX_GPSR \
315\
316 GPSR1_31 GPSR2_31 GPSR4_31 \
317 GPSR1_30 GPSR2_30 GPSR4_30 \
318 GPSR1_29 GPSR2_29 GPSR4_29 \
319 GPSR1_28 GPSR2_28 GPSR4_28 \
320 GPSR1_27 GPSR2_27 GPSR4_27 \
321 GPSR1_26 GPSR2_26 GPSR4_26 \
322 GPSR1_25 GPSR2_25 GPSR4_25 \
323 GPSR1_24 GPSR2_24 GPSR4_24 \
324 GPSR1_23 GPSR2_23 GPSR4_23 \
325 GPSR1_22 GPSR2_22 GPSR4_22 \
326 GPSR1_21 GPSR2_21 GPSR4_21 \
327 GPSR1_20 GPSR2_20 GPSR4_20 GPSR5_20 \
328 GPSR1_19 GPSR2_19 GPSR4_19 GPSR5_19 \
329 GPSR1_18 GPSR2_18 GPSR4_18 GPSR5_18 \
330 GPSR1_17 GPSR2_17 GPSR4_17 GPSR5_17 \
331 GPSR1_16 GPSR2_16 GPSR4_16 GPSR5_16 \
332 GPSR1_15 GPSR2_15 GPSR4_15 GPSR5_15 \
333 GPSR1_14 GPSR2_14 GPSR4_14 GPSR5_14 \
334 GPSR1_13 GPSR2_13 GPSR4_13 GPSR5_13 GPSR6_13 \
335 GPSR1_12 GPSR2_12 GPSR4_12 GPSR5_12 GPSR6_12 \
336 GPSR1_11 GPSR2_11 GPSR4_11 GPSR5_11 GPSR6_11 \
337 GPSR1_10 GPSR2_10 GPSR4_10 GPSR5_10 GPSR6_10 \
338 GPSR1_9 GPSR2_9 GPSR3_9 GPSR4_9 GPSR5_9 GPSR6_9 \
339GPSR0_8 GPSR1_8 GPSR2_8 GPSR3_8 GPSR4_8 GPSR5_8 GPSR6_8 \
340GPSR0_7 GPSR1_7 GPSR2_7 GPSR3_7 GPSR4_7 GPSR5_7 GPSR6_7 \
341GPSR0_6 GPSR1_6 GPSR2_6 GPSR3_6 GPSR4_6 GPSR5_6 GPSR6_6 \
342GPSR0_5 GPSR1_5 GPSR2_5 GPSR3_5 GPSR4_5 GPSR5_5 GPSR6_5 \
343GPSR0_4 GPSR1_4 GPSR2_4 GPSR3_4 GPSR4_4 GPSR5_4 GPSR6_4 \
344GPSR0_3 GPSR1_3 GPSR2_3 GPSR3_3 GPSR4_3 GPSR5_3 GPSR6_3 \
345GPSR0_2 GPSR1_2 GPSR2_2 GPSR3_2 GPSR4_2 GPSR5_2 GPSR6_2 \
346GPSR0_1 GPSR1_1 GPSR2_1 GPSR3_1 GPSR4_1 GPSR5_1 GPSR6_1 \
347GPSR0_0 GPSR1_0 GPSR2_0 GPSR3_0 GPSR4_0 GPSR5_0 GPSR6_0
348
349#define PINMUX_IPSR \
350\
351FM(IP0_3_0) IP0_3_0 FM(IP1_3_0) IP1_3_0 FM(IP2_3_0) IP2_3_0 FM(IP3_3_0) IP3_3_0 \
352FM(IP0_7_4) IP0_7_4 FM(IP1_7_4) IP1_7_4 FM(IP2_7_4) IP2_7_4 FM(IP3_7_4) IP3_7_4 \
353FM(IP0_11_8) IP0_11_8 FM(IP1_11_8) IP1_11_8 FM(IP2_11_8) IP2_11_8 FM(IP3_11_8) IP3_11_8 \
354FM(IP0_15_12) IP0_15_12 FM(IP1_15_12) IP1_15_12 FM(IP2_15_12) IP2_15_12 FM(IP3_15_12) IP3_15_12 \
355FM(IP0_19_16) IP0_19_16 FM(IP1_19_16) IP1_19_16 FM(IP2_19_16) IP2_19_16 FM(IP3_19_16) IP3_19_16 \
356FM(IP0_23_20) IP0_23_20 FM(IP1_23_20) IP1_23_20 FM(IP2_23_20) IP2_23_20 FM(IP3_23_20) IP3_23_20 \
357FM(IP0_27_24) IP0_27_24 FM(IP1_27_24) IP1_27_24 FM(IP2_27_24) IP2_27_24 FM(IP3_27_24) IP3_27_24 \
358FM(IP0_31_28) IP0_31_28 FM(IP1_31_28) IP1_31_28 FM(IP2_31_28) IP2_31_28 FM(IP3_31_28) IP3_31_28 \
359\
360FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \
361FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \
362FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \
363FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 FM(IP7_15_12) IP7_15_12 \
364FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \
365FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \
366FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \
367FM(IP4_31_28) IP4_31_28 FM(IP5_31_28) IP5_31_28 FM(IP6_31_28) IP6_31_28 FM(IP7_31_28) IP7_31_28 \
368\
369FM(IP8_3_0) IP8_3_0 FM(IP9_3_0) IP9_3_0 FM(IP10_3_0) IP10_3_0 FM(IP11_3_0) IP11_3_0 \
370FM(IP8_7_4) IP8_7_4 FM(IP9_7_4) IP9_7_4 FM(IP10_7_4) IP10_7_4 FM(IP11_7_4) IP11_7_4 \
371FM(IP8_11_8) IP8_11_8 FM(IP9_11_8) IP9_11_8 FM(IP10_11_8) IP10_11_8 FM(IP11_11_8) IP11_11_8 \
372FM(IP8_15_12) IP8_15_12 FM(IP9_15_12) IP9_15_12 FM(IP10_15_12) IP10_15_12 FM(IP11_15_12) IP11_15_12 \
373FM(IP8_19_16) IP8_19_16 FM(IP9_19_16) IP9_19_16 FM(IP10_19_16) IP10_19_16 FM(IP11_19_16) IP11_19_16 \
374FM(IP8_23_20) IP8_23_20 FM(IP9_23_20) IP9_23_20 FM(IP10_23_20) IP10_23_20 FM(IP11_23_20) IP11_23_20 \
375FM(IP8_27_24) IP8_27_24 FM(IP9_27_24) IP9_27_24 FM(IP10_27_24) IP10_27_24 FM(IP11_27_24) IP11_27_24 \
376FM(IP8_31_28) IP8_31_28 FM(IP9_31_28) IP9_31_28 FM(IP10_31_28) IP10_31_28 FM(IP11_31_28) IP11_31_28 \
377\
378FM(IP12_3_0) IP12_3_0 FM(IP13_3_0) IP13_3_0 \
379FM(IP12_7_4) IP12_7_4 FM(IP13_7_4) IP13_7_4 \
380FM(IP12_11_8) IP12_11_8 \
381FM(IP12_15_12) IP12_15_12 \
382FM(IP12_19_16) IP12_19_16 \
383FM(IP12_23_20) IP12_23_20 \
384FM(IP12_27_24) IP12_27_24 \
385FM(IP12_31_28) IP12_31_28 \
386
387/* MOD_SEL0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */
388#define MOD_SEL0_30 FM(SEL_MSIOF2_0) FM(SEL_MSIOF2_1)
389#define MOD_SEL0_29 FM(SEL_I2C3_0) FM(SEL_I2C3_1)
390#define MOD_SEL0_28 FM(SEL_SCIF5_0) FM(SEL_SCIF5_1)
391#define MOD_SEL0_27 FM(SEL_MSIOF3_0) FM(SEL_MSIOF3_1)
392#define MOD_SEL0_26 FM(SEL_HSCIF3_0) FM(SEL_HSCIF3_1)
393#define MOD_SEL0_25 FM(SEL_SCIF4_0) FM(SEL_SCIF4_1)
394#define MOD_SEL0_24_23 FM(SEL_PWM0_0) FM(SEL_PWM0_1) FM(SEL_PWM0_2) FM(SEL_PWM0_3)
395#define MOD_SEL0_22_21 FM(SEL_PWM1_0) FM(SEL_PWM1_1) FM(SEL_PWM1_2) FM(SEL_PWM1_3)
396#define MOD_SEL0_20_19 FM(SEL_PWM2_0) FM(SEL_PWM2_1) FM(SEL_PWM2_2) FM(SEL_PWM2_3)
397#define MOD_SEL0_18_17 FM(SEL_PWM3_0) FM(SEL_PWM3_1) FM(SEL_PWM3_2) FM(SEL_PWM3_3)
398#define MOD_SEL0_15 FM(SEL_IRQ_0_0) FM(SEL_IRQ_0_1)
399#define MOD_SEL0_14 FM(SEL_IRQ_1_0) FM(SEL_IRQ_1_1)
400#define MOD_SEL0_13 FM(SEL_IRQ_2_0) FM(SEL_IRQ_2_1)
401#define MOD_SEL0_12 FM(SEL_IRQ_3_0) FM(SEL_IRQ_3_1)
402#define MOD_SEL0_11 FM(SEL_IRQ_4_0) FM(SEL_IRQ_4_1)
403#define MOD_SEL0_10 FM(SEL_IRQ_5_0) FM(SEL_IRQ_5_1)
404#define MOD_SEL0_5 FM(SEL_TMU_0_0) FM(SEL_TMU_0_1)
405#define MOD_SEL0_4 FM(SEL_TMU_1_0) FM(SEL_TMU_1_1)
406#define MOD_SEL0_3 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1)
407#define MOD_SEL0_2 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1)
408#define MOD_SEL0_1 FM(SEL_SCU_0) FM(SEL_SCU_1)
409#define MOD_SEL0_0 FM(SEL_RFSO_0) FM(SEL_RFSO_1)
410
411#define MOD_SEL1_31 FM(SEL_CAN0_0) FM(SEL_CAN0_1)
412#define MOD_SEL1_30 FM(SEL_CAN1_0) FM(SEL_CAN1_1)
413#define MOD_SEL1_29 FM(SEL_I2C2_0) FM(SEL_I2C2_1)
414#define MOD_SEL1_28 FM(SEL_ETHERAVB_0) FM(SEL_ETHERAVB_1)
415#define MOD_SEL1_27 FM(SEL_SCIF0_0) FM(SEL_SCIF0_1)
416#define MOD_SEL1_26 FM(SEL_SSIF4_0) FM(SEL_SSIF4_1)
417
418
419#define PINMUX_MOD_SELS \
420\
421 MOD_SEL1_31 \
422MOD_SEL0_30 MOD_SEL1_30 \
423MOD_SEL0_29 MOD_SEL1_29 \
424MOD_SEL0_28 MOD_SEL1_28 \
425MOD_SEL0_27 MOD_SEL1_27 \
426MOD_SEL0_26 MOD_SEL1_26 \
427MOD_SEL0_25 \
428MOD_SEL0_24_23 \
429MOD_SEL0_22_21 \
430MOD_SEL0_20_19 \
431MOD_SEL0_18_17 \
432MOD_SEL0_15 \
433MOD_SEL0_14 \
434MOD_SEL0_13 \
435MOD_SEL0_12 \
436MOD_SEL0_11 \
437MOD_SEL0_10 \
438MOD_SEL0_5 \
439MOD_SEL0_4 \
440MOD_SEL0_3 \
441MOD_SEL0_2 \
442MOD_SEL0_1 \
443MOD_SEL0_0
444
445enum {
446 PINMUX_RESERVED = 0,
447
448 PINMUX_DATA_BEGIN,
449 GP_ALL(DATA),
450 PINMUX_DATA_END,
451
452#define F_(x, y)
453#define FM(x) FN_##x,
454 PINMUX_FUNCTION_BEGIN,
455 GP_ALL(FN),
456 PINMUX_GPSR
457 PINMUX_IPSR
458 PINMUX_MOD_SELS
459 PINMUX_FUNCTION_END,
460#undef F_
461#undef FM
462
463#define F_(x, y)
464#define FM(x) x##_MARK,
465 PINMUX_MARK_BEGIN,
466 PINMUX_GPSR
467 PINMUX_IPSR
468 PINMUX_MOD_SELS
469 PINMUX_MARK_END,
470#undef F_
471#undef FM
472};
473
474#define PINMUX_IPSR_MSEL2(ipsr, fn, msel1, msel2) \
475 PINMUX_DATA(fn##_MARK, FN_##msel1, FN_##msel2, FN_##fn, FN_##ipsr)
476
477#define PINMUX_IPSR_PHYS(ipsr, fn, msel) \
478 PINMUX_DATA(fn##_MARK, FN_##msel)
479
480static const u16 pinmux_data[] = {
481 PINMUX_DATA_GP_ALL(),
482
483 PINMUX_SINGLE(USB0_OVC),
484 PINMUX_SINGLE(USB0_PWEN),
485 PINMUX_SINGLE(VI4_DATA4),
486 PINMUX_SINGLE(VI4_CLK),
487 PINMUX_SINGLE(TX2),
488 PINMUX_SINGLE(RX2),
489 PINMUX_SINGLE(AVB0_LINK),
490 PINMUX_SINGLE(AVB0_PHY_INT),
491 PINMUX_SINGLE(AVB0_MAGIC),
492 PINMUX_SINGLE(AVB0_MDC),
493 PINMUX_SINGLE(AVB0_MDIO),
494 PINMUX_SINGLE(AVB0_TXCREFCLK),
495 PINMUX_SINGLE(AVB0_TD3),
496 PINMUX_SINGLE(AVB0_TD2),
497 PINMUX_SINGLE(AVB0_TD1),
498 PINMUX_SINGLE(AVB0_TD0),
499 PINMUX_SINGLE(AVB0_TXC),
500 PINMUX_SINGLE(AVB0_TX_CTL),
501 PINMUX_SINGLE(AVB0_RD3),
502 PINMUX_SINGLE(AVB0_RD2),
503 PINMUX_SINGLE(AVB0_RD1),
504 PINMUX_SINGLE(AVB0_RD0),
505 PINMUX_SINGLE(AVB0_RXC),
506 PINMUX_SINGLE(AVB0_RX_CTL),
507 PINMUX_SINGLE(RPC_INT_N),
508 PINMUX_SINGLE(RPC_RESET_N),
509 PINMUX_SINGLE(QSPI1_SSL),
510 PINMUX_SINGLE(QSPI1_IO3),
511 PINMUX_SINGLE(QSPI1_IO2),
512 PINMUX_SINGLE(QSPI1_MISO_IO1),
513 PINMUX_SINGLE(QSPI1_MOSI_IO0),
514 PINMUX_SINGLE(QSPI1_SPCLK),
515 PINMUX_SINGLE(QSPI0_SSL),
516 PINMUX_SINGLE(QSPI0_IO3),
517 PINMUX_SINGLE(QSPI0_IO2),
518 PINMUX_SINGLE(QSPI0_MISO_IO1),
519 PINMUX_SINGLE(QSPI0_MOSI_IO0),
520 PINMUX_SINGLE(QSPI0_SPCLK),
521
522 /* IPSR0 */
523 PINMUX_IPSR_MSEL(IP0_3_0, IRQ0_A, SEL_IRQ_0_0),
524 PINMUX_IPSR_MSEL(IP0_3_0, MSIOF2_SYNC_B, SEL_MSIOF2_1),
525 PINMUX_IPSR_GPSR(IP0_3_0, USB0_IDIN),
526
527 PINMUX_IPSR_GPSR(IP0_7_4, MSIOF2_SCK),
528 PINMUX_IPSR_GPSR(IP0_7_4, USB0_IDPU),
529
530 PINMUX_IPSR_GPSR(IP0_11_8, MSIOF2_TXD),
531 PINMUX_IPSR_MSEL(IP0_11_8, SCL3_A, SEL_I2C3_0),
532
533 PINMUX_IPSR_GPSR(IP0_15_12, MSIOF2_RXD),
534 PINMUX_IPSR_MSEL(IP0_15_12, SDA3_A, SEL_I2C3_0),
535
536 PINMUX_IPSR_GPSR(IP0_19_16, MLB_CLK),
537 PINMUX_IPSR_MSEL(IP0_19_16, MSIOF2_SYNC_A, SEL_MSIOF2_0),
538 PINMUX_IPSR_MSEL(IP0_19_16, SCK5_A, SEL_SCIF5_0),
539
540 PINMUX_IPSR_GPSR(IP0_23_20, MLB_DAT),
541 PINMUX_IPSR_GPSR(IP0_23_20, MSIOF2_SS1),
542 PINMUX_IPSR_MSEL(IP0_23_20, RX5_A, SEL_SCIF5_0),
543 PINMUX_IPSR_MSEL(IP0_23_20, SCL3_B, SEL_I2C3_1),
544
545 PINMUX_IPSR_GPSR(IP0_27_24, MLB_SIG),
546 PINMUX_IPSR_GPSR(IP0_27_24, MSIOF2_SS2),
547 PINMUX_IPSR_MSEL(IP0_27_24, TX5_A, SEL_SCIF5_0),
548 PINMUX_IPSR_MSEL(IP0_27_24, SDA3_B, SEL_I2C3_1),
549
550 PINMUX_IPSR_GPSR(IP0_31_28, DU_DB0),
551 PINMUX_IPSR_GPSR(IP0_31_28, LCDOUT0),
552 PINMUX_IPSR_MSEL(IP0_31_28, MSIOF3_TXD_B, SEL_MSIOF3_1),
553
554 /* IPSR1 */
555 PINMUX_IPSR_GPSR(IP1_3_0, DU_DB1),
556 PINMUX_IPSR_GPSR(IP1_3_0, LCDOUT1),
557 PINMUX_IPSR_MSEL(IP1_3_0, MSIOF3_RXD_B, SEL_MSIOF3_1),
558
559 PINMUX_IPSR_GPSR(IP1_7_4, DU_DB2),
560 PINMUX_IPSR_GPSR(IP1_7_4, LCDOUT2),
561 PINMUX_IPSR_MSEL(IP1_7_4, IRQ0_B, SEL_IRQ_0_1),
562
563 PINMUX_IPSR_GPSR(IP1_11_8, DU_DB3),
564 PINMUX_IPSR_GPSR(IP1_11_8, LCDOUT3),
565 PINMUX_IPSR_MSEL(IP1_11_8, SCK5_B, SEL_SCIF5_1),
566
567 PINMUX_IPSR_GPSR(IP1_15_12, DU_DB4),
568 PINMUX_IPSR_GPSR(IP1_15_12, LCDOUT4),
569 PINMUX_IPSR_MSEL(IP1_15_12, RX5_B, SEL_SCIF5_1),
570
571 PINMUX_IPSR_GPSR(IP1_19_16, DU_DB5),
572 PINMUX_IPSR_GPSR(IP1_19_16, LCDOUT5),
573 PINMUX_IPSR_MSEL(IP1_19_16, TX5_B, SEL_SCIF5_1),
574
575 PINMUX_IPSR_GPSR(IP1_23_20, DU_DB6),
576 PINMUX_IPSR_GPSR(IP1_23_20, LCDOUT6),
577 PINMUX_IPSR_MSEL(IP1_23_20, MSIOF3_SS1_B, SEL_MSIOF3_1),
578
579 PINMUX_IPSR_GPSR(IP1_27_24, DU_DB7),
580 PINMUX_IPSR_GPSR(IP1_27_24, LCDOUT7),
581 PINMUX_IPSR_MSEL(IP1_27_24, MSIOF3_SS2_B, SEL_MSIOF3_1),
582
583 PINMUX_IPSR_GPSR(IP1_31_28, DU_DG0),
584 PINMUX_IPSR_GPSR(IP1_31_28, LCDOUT8),
585 PINMUX_IPSR_MSEL(IP1_31_28, MSIOF3_SCK_B, SEL_MSIOF3_1),
586
587 /* IPSR2 */
588 PINMUX_IPSR_GPSR(IP2_3_0, DU_DG1),
589 PINMUX_IPSR_GPSR(IP2_3_0, LCDOUT9),
590 PINMUX_IPSR_MSEL(IP2_3_0, MSIOF3_SYNC_B, SEL_MSIOF3_1),
591
592 PINMUX_IPSR_GPSR(IP2_7_4, DU_DG2),
593 PINMUX_IPSR_GPSR(IP2_7_4, LCDOUT10),
594
595 PINMUX_IPSR_GPSR(IP2_11_8, DU_DG3),
596 PINMUX_IPSR_GPSR(IP2_11_8, LCDOUT11),
597 PINMUX_IPSR_MSEL(IP2_11_8, IRQ1_A, SEL_IRQ_1_0),
598
599 PINMUX_IPSR_GPSR(IP2_15_12, DU_DG4),
600 PINMUX_IPSR_GPSR(IP2_15_12, LCDOUT12),
601 PINMUX_IPSR_MSEL(IP2_15_12, HSCK3_B, SEL_HSCIF3_1),
602
603 PINMUX_IPSR_GPSR(IP2_19_16, DU_DG5),
604 PINMUX_IPSR_GPSR(IP2_19_16, LCDOUT13),
605 PINMUX_IPSR_MSEL(IP2_19_16, HTX3_B, SEL_HSCIF3_1),
606
607 PINMUX_IPSR_GPSR(IP2_23_20, DU_DG6),
608 PINMUX_IPSR_GPSR(IP2_23_20, LCDOUT14),
609 PINMUX_IPSR_MSEL(IP2_23_20, HRX3_B, SEL_HSCIF3_1),
610
611 PINMUX_IPSR_GPSR(IP2_27_24, DU_DG7),
612 PINMUX_IPSR_GPSR(IP2_27_24, LCDOUT15),
613 PINMUX_IPSR_MSEL(IP2_27_24, SCK4_B, SEL_SCIF4_1),
614
615 PINMUX_IPSR_GPSR(IP2_31_28, DU_DR0),
616 PINMUX_IPSR_GPSR(IP2_31_28, LCDOUT16),
617 PINMUX_IPSR_MSEL(IP2_31_28, RX4_B, SEL_SCIF4_1),
618
619 /* IPSR3 */
620 PINMUX_IPSR_GPSR(IP3_3_0, DU_DR1),
621 PINMUX_IPSR_GPSR(IP3_3_0, LCDOUT17),
622 PINMUX_IPSR_MSEL(IP3_3_0, TX4_B, SEL_SCIF4_1),
623
624 PINMUX_IPSR_GPSR(IP3_7_4, DU_DR2),
625 PINMUX_IPSR_GPSR(IP3_7_4, LCDOUT18),
626 PINMUX_IPSR_MSEL(IP3_7_4, PWM0_B, SEL_PWM0_2),
627
628 PINMUX_IPSR_GPSR(IP3_11_8, DU_DR3),
629 PINMUX_IPSR_GPSR(IP3_11_8, LCDOUT19),
630 PINMUX_IPSR_MSEL(IP3_11_8, PWM1_B, SEL_PWM1_2),
631
632 PINMUX_IPSR_GPSR(IP3_15_12, DU_DR4),
633 PINMUX_IPSR_GPSR(IP3_15_12, LCDOUT20),
634 PINMUX_IPSR_MSEL(IP3_15_12, TCLK2_B, SEL_TMU_0_1),
635
636 PINMUX_IPSR_GPSR(IP3_19_16, DU_DR5),
637 PINMUX_IPSR_GPSR(IP3_19_16, LCDOUT21),
638 PINMUX_IPSR_GPSR(IP3_19_16, NMI),
639
640 PINMUX_IPSR_GPSR(IP3_23_20, DU_DR6),
641 PINMUX_IPSR_GPSR(IP3_23_20, LCDOUT22),
642 PINMUX_IPSR_MSEL(IP3_23_20, PWM2_B, SEL_PWM2_2),
643
644 PINMUX_IPSR_GPSR(IP3_27_24, DU_DR7),
645 PINMUX_IPSR_GPSR(IP3_27_24, LCDOUT23),
646 PINMUX_IPSR_MSEL(IP3_27_24, TCLK1_B, SEL_TMU_1_1),
647
648 PINMUX_IPSR_GPSR(IP3_31_28, DU_DOTCLKOUT0),
649 PINMUX_IPSR_GPSR(IP3_31_28, QCLK),
650
651 /* IPSR4 */
652 PINMUX_IPSR_GPSR(IP4_3_0, DU_HSYNC),
653 PINMUX_IPSR_GPSR(IP4_3_0, QSTH_QHS),
654 PINMUX_IPSR_MSEL(IP4_3_0, IRQ3_A, SEL_IRQ_3_0),
655
656 PINMUX_IPSR_GPSR(IP4_7_4, DU_VSYNC),
657 PINMUX_IPSR_GPSR(IP4_7_4, QSTVA_QVS),
658 PINMUX_IPSR_MSEL(IP4_7_4, IRQ4_A, SEL_IRQ_4_0),
659
660 PINMUX_IPSR_GPSR(IP4_11_8, DU_DISP),
661 PINMUX_IPSR_GPSR(IP4_11_8, QSTVB_QVE),
662 PINMUX_IPSR_MSEL(IP4_11_8, PWM3_B, SEL_PWM3_2),
663
664 PINMUX_IPSR_GPSR(IP4_15_12, DU_DISP_CDE),
665 PINMUX_IPSR_GPSR(IP4_15_12, QCPV_QDE),
666 PINMUX_IPSR_MSEL(IP4_15_12, IRQ2_B, SEL_IRQ_2_1),
667 PINMUX_IPSR_GPSR(IP4_15_12, DU_DOTCLKIN1),
668
669 PINMUX_IPSR_GPSR(IP4_19_16, DU_CDE),
670 PINMUX_IPSR_GPSR(IP4_19_16, QSTB_QHE),
671 PINMUX_IPSR_MSEL(IP4_19_16, SCK3_B, SEL_SCIF3_1),
672
673 PINMUX_IPSR_GPSR(IP4_23_20, QPOLA),
674 PINMUX_IPSR_MSEL(IP4_23_20, RX3_B, SEL_SCIF3_1),
675
676 PINMUX_IPSR_GPSR(IP4_27_24, QPOLB),
677 PINMUX_IPSR_MSEL(IP4_27_24, TX3_B, SEL_SCIF3_1),
678
679 PINMUX_IPSR_GPSR(IP4_31_28, VI4_DATA0),
680 PINMUX_IPSR_MSEL(IP4_31_28, PWM0_A, SEL_PWM0_0),
681
682 /* IPSR5 */
683 PINMUX_IPSR_GPSR(IP5_3_0, VI4_DATA1),
684 PINMUX_IPSR_MSEL(IP5_3_0, PWM1_A, SEL_PWM1_0),
685
686 PINMUX_IPSR_GPSR(IP5_7_4, VI4_DATA2),
687 PINMUX_IPSR_MSEL(IP5_7_4, PWM2_A, SEL_PWM2_0),
688
689 PINMUX_IPSR_GPSR(IP5_11_8, VI4_DATA3),
690 PINMUX_IPSR_MSEL(IP5_11_8, PWM3_A, SEL_PWM3_0),
691
692 PINMUX_IPSR_GPSR(IP5_15_12, VI4_DATA5),
693 PINMUX_IPSR_MSEL(IP5_15_12, SCK4_A, SEL_SCIF4_0),
694
695 PINMUX_IPSR_GPSR(IP5_19_16, VI4_DATA6),
696 PINMUX_IPSR_MSEL(IP5_19_16, IRQ2_A, SEL_IRQ_2_0),
697
698 PINMUX_IPSR_GPSR(IP5_23_20, VI4_DATA7),
699 PINMUX_IPSR_MSEL(IP5_23_20, TCLK2_A, SEL_TMU_0_0),
700
701 PINMUX_IPSR_GPSR(IP5_27_24, VI4_DATA8),
702
703 PINMUX_IPSR_GPSR(IP5_31_28, VI4_DATA9),
704 PINMUX_IPSR_MSEL(IP5_31_28, MSIOF3_SS2_A, SEL_MSIOF3_0),
705 PINMUX_IPSR_MSEL(IP5_31_28, IRQ1_B, SEL_IRQ_1_1),
706
707 /* IPSR6 */
708 PINMUX_IPSR_GPSR(IP6_3_0, VI4_DATA10),
709 PINMUX_IPSR_MSEL(IP6_3_0, RX4_A, SEL_SCIF4_0),
710
711 PINMUX_IPSR_GPSR(IP6_7_4, VI4_DATA11),
712 PINMUX_IPSR_MSEL(IP6_7_4, TX4_A, SEL_SCIF4_0),
713
714 PINMUX_IPSR_GPSR(IP6_11_8, VI4_DATA12),
715 PINMUX_IPSR_MSEL(IP6_11_8, TCLK1_A, SEL_TMU_1_0),
716
717 PINMUX_IPSR_GPSR(IP6_15_12, VI4_DATA13),
718 PINMUX_IPSR_MSEL(IP6_15_12, MSIOF3_SS1_A, SEL_MSIOF3_0),
719 PINMUX_IPSR_GPSR(IP6_15_12, HCTS3_N),
720
721 PINMUX_IPSR_GPSR(IP6_19_16, VI4_DATA14),
722 PINMUX_IPSR_MSEL(IP6_19_16, SSI_SCK4_B, SEL_SSIF4_1),
723 PINMUX_IPSR_GPSR(IP6_19_16, HRTS3_N),
724
725 PINMUX_IPSR_GPSR(IP6_23_20, VI4_DATA15),
726 PINMUX_IPSR_MSEL(IP6_23_20, SSI_SDATA4_B, SEL_SSIF4_1),
727
728 PINMUX_IPSR_GPSR(IP6_27_24, VI4_DATA16),
729 PINMUX_IPSR_MSEL(IP6_27_24, HRX3_A, SEL_HSCIF3_0),
730
731 PINMUX_IPSR_GPSR(IP6_31_28, VI4_DATA17),
732 PINMUX_IPSR_MSEL(IP6_31_28, HTX3_A, SEL_HSCIF3_0),
733
734 /* IPSR7 */
735 PINMUX_IPSR_GPSR(IP7_3_0, VI4_DATA18),
736 PINMUX_IPSR_MSEL(IP7_3_0, HSCK3_A, SEL_HSCIF3_0),
737
738 PINMUX_IPSR_GPSR(IP7_7_4, VI4_DATA19),
739 PINMUX_IPSR_MSEL(IP7_7_4, SSI_WS4_B, SEL_SSIF4_1),
740 PINMUX_IPSR_GPSR(IP7_7_4, NFDATA15),
741
742 PINMUX_IPSR_GPSR(IP7_11_8, VI4_DATA20),
743 PINMUX_IPSR_MSEL(IP7_11_8, MSIOF3_SYNC_A, SEL_MSIOF3_0),
744 PINMUX_IPSR_GPSR(IP7_11_8, NFDATA14),
745
746 PINMUX_IPSR_GPSR(IP7_15_12, VI4_DATA21),
747 PINMUX_IPSR_MSEL(IP7_15_12, MSIOF3_TXD_A, SEL_MSIOF3_0),
748
749 PINMUX_IPSR_GPSR(IP7_15_12, NFDATA13),
750 PINMUX_IPSR_GPSR(IP7_19_16, VI4_DATA22),
751 PINMUX_IPSR_MSEL(IP7_19_16, MSIOF3_RXD_A, SEL_MSIOF3_0),
752
753 PINMUX_IPSR_GPSR(IP7_19_16, NFDATA12),
754 PINMUX_IPSR_GPSR(IP7_23_20, VI4_DATA23),
755 PINMUX_IPSR_MSEL(IP7_23_20, MSIOF3_SCK_A, SEL_MSIOF3_0),
756
757 PINMUX_IPSR_GPSR(IP7_23_20, NFDATA11),
758
759 PINMUX_IPSR_GPSR(IP7_27_24, VI4_VSYNC_N),
760 PINMUX_IPSR_MSEL(IP7_27_24, SCK1_B, SEL_SCIF1_1),
761 PINMUX_IPSR_GPSR(IP7_27_24, NFDATA10),
762
763 PINMUX_IPSR_GPSR(IP7_31_28, VI4_HSYNC_N),
764 PINMUX_IPSR_MSEL(IP7_31_28, RX1_B, SEL_SCIF1_1),
765 PINMUX_IPSR_GPSR(IP7_31_28, NFDATA9),
766
767 /* IPSR8 */
768 PINMUX_IPSR_GPSR(IP8_3_0, VI4_FIELD),
769 PINMUX_IPSR_GPSR(IP8_3_0, AUDIO_CLKB),
770 PINMUX_IPSR_MSEL(IP8_3_0, IRQ5_A, SEL_IRQ_5_0),
771 PINMUX_IPSR_GPSR(IP8_3_0, SCIF_CLK),
772 PINMUX_IPSR_GPSR(IP8_3_0, NFDATA8),
773
774 PINMUX_IPSR_GPSR(IP8_7_4, VI4_CLKENB),
775 PINMUX_IPSR_MSEL(IP8_7_4, TX1_B, SEL_SCIF1_1),
776 PINMUX_IPSR_GPSR(IP8_7_4, NFWP_N),
777 PINMUX_IPSR_MSEL(IP8_7_4, DVC_MUTE_A, SEL_SCU_0),
778
779 PINMUX_IPSR_GPSR(IP8_11_8, NFALE),
780 PINMUX_IPSR_MSEL(IP8_11_8, SCL2_B, SEL_I2C2_1),
781 PINMUX_IPSR_MSEL(IP8_11_8, IRQ3_B, SEL_IRQ_3_1),
782 PINMUX_IPSR_MSEL(IP8_11_8, PWM0_C, SEL_PWM0_1),
783
784 PINMUX_IPSR_GPSR(IP8_15_12, NFCLE),
785 PINMUX_IPSR_MSEL(IP8_15_12, SDA2_B, SEL_I2C2_1),
786 PINMUX_IPSR_MSEL(IP8_15_12, SCK3_A, SEL_SCIF3_0),
787 PINMUX_IPSR_MSEL(IP8_15_12, PWM1_C, SEL_PWM1_1),
788
789 PINMUX_IPSR_GPSR(IP8_19_16, NFCE_N),
790 PINMUX_IPSR_MSEL(IP8_19_16, RX3_A, SEL_SCIF3_0),
791 PINMUX_IPSR_MSEL(IP8_19_16, PWM2_C, SEL_PWM2_1),
792
793 PINMUX_IPSR_GPSR(IP8_23_20, NFRB_N),
794 PINMUX_IPSR_MSEL(IP8_23_20, TX3_A, SEL_SCIF3_0),
795 PINMUX_IPSR_MSEL(IP8_23_20, PWM3_C, SEL_PWM3_1),
796
797 PINMUX_IPSR_GPSR(IP8_27_24, NFRE_N),
798 PINMUX_IPSR_GPSR(IP8_27_24, MMC_CMD),
799
800 PINMUX_IPSR_GPSR(IP8_31_28, NFWE_N),
801 PINMUX_IPSR_GPSR(IP8_31_28, MMC_CLK),
802
803 /* IPSR9 */
804 PINMUX_IPSR_GPSR(IP9_3_0, NFDATA0),
805 PINMUX_IPSR_GPSR(IP9_3_0, MMC_D0),
806
807 PINMUX_IPSR_GPSR(IP9_7_4, NFDATA1),
808 PINMUX_IPSR_GPSR(IP9_7_4, MMC_D1),
809
810 PINMUX_IPSR_GPSR(IP9_11_8, NFDATA2),
811 PINMUX_IPSR_GPSR(IP9_11_8, MMC_D2),
812
813 PINMUX_IPSR_GPSR(IP9_15_12, NFDATA3),
814 PINMUX_IPSR_GPSR(IP9_15_12, MMC_D3),
815
816 PINMUX_IPSR_GPSR(IP9_19_16, NFDATA4),
817 PINMUX_IPSR_GPSR(IP9_19_16, MMC_D4),
818
819 PINMUX_IPSR_GPSR(IP9_23_20, NFDATA5),
820 PINMUX_IPSR_GPSR(IP9_23_20, MMC_D5),
821
822 PINMUX_IPSR_GPSR(IP9_27_24, NFDATA6),
823 PINMUX_IPSR_GPSR(IP9_27_24, MMC_D6),
824
825 PINMUX_IPSR_GPSR(IP9_31_28, NFDATA7),
826 PINMUX_IPSR_GPSR(IP9_31_28, MMC_D7),
827
828 /* IPSR10 */
829 PINMUX_IPSR_GPSR(IP10_3_0, AUDIO_CLKA),
830 PINMUX_IPSR_MSEL(IP10_3_0, DVC_MUTE_B, SEL_SCU_1),
831
832 PINMUX_IPSR_GPSR(IP10_7_4, SSI_SCK34),
833 PINMUX_IPSR_MSEL(IP10_7_4, FSO_CFE_0_N_A, SEL_RFSO_0),
834
835 PINMUX_IPSR_GPSR(IP10_11_8, SSI_SDATA3),
836 PINMUX_IPSR_MSEL(IP10_11_8, FSO_CFE_1_N_A, SEL_RFSO_0),
837
838 PINMUX_IPSR_GPSR(IP10_15_12, SSI_WS34),
839 PINMUX_IPSR_MSEL(IP10_15_12, FSO_TOE_N_A, SEL_RFSO_0),
840
841 PINMUX_IPSR_MSEL(IP10_19_16, SSI_SCK4_A, SEL_SSIF4_0),
842 PINMUX_IPSR_GPSR(IP10_19_16, HSCK0),
843 PINMUX_IPSR_GPSR(IP10_19_16, AUDIO_CLKOUT),
844 PINMUX_IPSR_MSEL(IP10_19_16, CAN0_RX_B, SEL_CAN0_1),
845 PINMUX_IPSR_MSEL(IP10_19_16, IRQ4_B, SEL_IRQ_4_1),
846
847 PINMUX_IPSR_MSEL(IP10_23_20, SSI_SDATA4_A, SEL_SSIF4_0),
848 PINMUX_IPSR_GPSR(IP10_23_20, HTX0),
849 PINMUX_IPSR_MSEL(IP10_23_20, SCL2_A, SEL_I2C2_0),
850 PINMUX_IPSR_MSEL(IP10_23_20, CAN1_RX_B, SEL_CAN1_1),
851
852 PINMUX_IPSR_MSEL(IP10_27_24, SSI_WS4_A, SEL_SSIF4_0),
853 PINMUX_IPSR_GPSR(IP10_27_24, HRX0),
854 PINMUX_IPSR_MSEL(IP10_27_24, SDA2_A, SEL_I2C2_0),
855 PINMUX_IPSR_MSEL(IP10_27_24, CAN1_TX_B, SEL_CAN1_1),
856
857 PINMUX_IPSR_GPSR(IP10_31_28, SCL1),
858 PINMUX_IPSR_GPSR(IP10_31_28, CTS1_N),
859
860 /* IPSR11 */
861 PINMUX_IPSR_GPSR(IP11_3_0, SDA1),
862 PINMUX_IPSR_GPSR(IP11_3_0, RTS1_N_TANS),
863
864 PINMUX_IPSR_GPSR(IP11_7_4, MSIOF1_SCK),
865 PINMUX_IPSR_MSEL(IP11_7_4, AVB0_AVTP_PPS_B, SEL_ETHERAVB_1),
866
867 PINMUX_IPSR_GPSR(IP11_11_8, MSIOF1_TXD),
868 PINMUX_IPSR_MSEL(IP11_11_8, AVB0_AVTP_CAPTURE_B, SEL_ETHERAVB_1),
869
870 PINMUX_IPSR_GPSR(IP11_15_12, MSIOF1_RXD),
871 PINMUX_IPSR_MSEL(IP11_15_12, AVB0_AVTP_MATCH_B, SEL_ETHERAVB_1),
872
873 PINMUX_IPSR_MSEL(IP11_19_16, SCK0_A, SEL_SCIF0_0),
874 PINMUX_IPSR_GPSR(IP11_19_16, MSIOF1_SYNC),
875 PINMUX_IPSR_MSEL(IP11_19_16, FSO_CFE_0_N_B, SEL_RFSO_1),
876
877 PINMUX_IPSR_MSEL(IP11_23_20, RX0_A, SEL_SCIF0_0),
878 PINMUX_IPSR_GPSR(IP11_23_20, MSIOF0_SS1),
879 PINMUX_IPSR_MSEL(IP11_23_20, FSO_CFE_1_N_B, SEL_RFSO_1),
880
881 PINMUX_IPSR_MSEL(IP11_27_24, TX0_A, SEL_SCIF0_0),
882 PINMUX_IPSR_GPSR(IP11_27_24, MSIOF0_SS2),
883 PINMUX_IPSR_MSEL(IP11_27_24, FSO_TOE_N_B, SEL_RFSO_1),
884
885 PINMUX_IPSR_MSEL(IP11_31_28, SCK1_A, SEL_SCIF1_0),
886 PINMUX_IPSR_GPSR(IP11_31_28, MSIOF1_SS2),
887 PINMUX_IPSR_GPSR(IP11_31_28, TPU0TO2_B),
888 PINMUX_IPSR_MSEL(IP11_31_28, CAN0_TX_B, SEL_CAN0_1),
889 PINMUX_IPSR_GPSR(IP11_31_28, AUDIO_CLKOUT1),
890
891 /* IPSR12 */
892 PINMUX_IPSR_MSEL(IP12_3_0, RX1_A, SEL_SCIF1_0),
893 PINMUX_IPSR_GPSR(IP12_3_0, CTS0_N),
894 PINMUX_IPSR_GPSR(IP12_3_0, TPU0TO0_B),
895
896 PINMUX_IPSR_MSEL(IP12_7_4, TX1_A, SEL_SCIF1_0),
897 PINMUX_IPSR_GPSR(IP12_7_4, RTS0_N_TANS),
898 PINMUX_IPSR_GPSR(IP12_7_4, TPU0TO1_B),
899
900 PINMUX_IPSR_GPSR(IP12_11_8, SCK2),
901 PINMUX_IPSR_GPSR(IP12_11_8, MSIOF1_SS1),
902 PINMUX_IPSR_GPSR(IP12_11_8, TPU0TO3_B),
903
904 PINMUX_IPSR_GPSR(IP12_15_12, TPU0TO0_A),
905 PINMUX_IPSR_MSEL(IP12_15_12, AVB0_AVTP_CAPTURE_A, SEL_ETHERAVB_0),
906 PINMUX_IPSR_GPSR(IP12_15_12, HCTS0_N),
907
908 PINMUX_IPSR_GPSR(IP12_19_16, TPU0TO1_A),
909 PINMUX_IPSR_MSEL(IP12_19_16, AVB0_AVTP_MATCH_A, SEL_ETHERAVB_0),
910 PINMUX_IPSR_GPSR(IP12_19_16, HRTS0_N),
911
912 PINMUX_IPSR_GPSR(IP12_23_20, CAN_CLK),
913 PINMUX_IPSR_MSEL(IP12_23_20, AVB0_AVTP_PPS_A, SEL_ETHERAVB_0),
914 PINMUX_IPSR_MSEL(IP12_23_20, SCK0_B, SEL_SCIF0_1),
915 PINMUX_IPSR_MSEL(IP12_23_20, IRQ5_B, SEL_IRQ_5_1),
916
917 PINMUX_IPSR_MSEL(IP12_27_24, CAN0_RX_A, SEL_CAN0_0),
918 PINMUX_IPSR_GPSR(IP12_27_24, CANFD0_RX),
919 PINMUX_IPSR_MSEL(IP12_27_24, RX0_B, SEL_SCIF0_1),
920
921 PINMUX_IPSR_MSEL(IP12_31_28, CAN0_TX_A, SEL_CAN0_0),
922 PINMUX_IPSR_GPSR(IP12_31_28, CANFD0_TX),
923 PINMUX_IPSR_MSEL(IP12_31_28, TX0_B, SEL_SCIF0_1),
924
925 /* IPSR13 */
926 PINMUX_IPSR_MSEL(IP13_3_0, CAN1_RX_A, SEL_CAN1_0),
927 PINMUX_IPSR_GPSR(IP13_3_0, CANFD1_RX),
928 PINMUX_IPSR_GPSR(IP13_3_0, TPU0TO2_A),
929
930 PINMUX_IPSR_MSEL(IP13_7_4, CAN1_TX_A, SEL_CAN1_0),
931 PINMUX_IPSR_GPSR(IP13_7_4, CANFD1_TX),
932 PINMUX_IPSR_GPSR(IP13_7_4, TPU0TO3_A),
933};
934
935static const struct sh_pfc_pin pinmux_pins[] = {
936 PINMUX_GPIO_GP_ALL(),
937};
938
939/* - I2C -------------------------------------------------------------------- */
940static const unsigned int i2c0_pins[] = {
941 /* SCL, SDA */
942 RCAR_GP_PIN(4, 8), RCAR_GP_PIN(4, 9),
943};
944static const unsigned int i2c0_mux[] = {
945 SCL0_MARK, SDA0_MARK,
946};
947static const unsigned int i2c1_pins[] = {
948 /* SCL, SDA */
949 RCAR_GP_PIN(4, 10), RCAR_GP_PIN(4, 11),
950};
951static const unsigned int i2c1_mux[] = {
952 SCL1_MARK, SDA1_MARK,
953};
954static const unsigned int i2c2_a_pins[] = {
955 /* SCL, SDA */
956 RCAR_GP_PIN(4, 6), RCAR_GP_PIN(4, 7),
957};
958static const unsigned int i2c2_a_mux[] = {
959 SCL2_A_MARK, SDA2_A_MARK,
960};
961static const unsigned int i2c2_b_pins[] = {
962 /* SCL, SDA */
963 RCAR_GP_PIN(2, 29), RCAR_GP_PIN(2, 30),
964};
965static const unsigned int i2c2_b_mux[] = {
966 SCL2_B_MARK, SDA2_B_MARK,
967};
968static const unsigned int i2c3_a_pins[] = {
969 /* SCL, SDA */
970 RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
971};
972static const unsigned int i2c3_a_mux[] = {
973 SCL3_A_MARK, SDA3_A_MARK,
974};
975static const unsigned int i2c3_b_pins[] = {
976 /* SCL, SDA */
977 RCAR_GP_PIN(0, 7), RCAR_GP_PIN(0, 8),
978};
979static const unsigned int i2c3_b_mux[] = {
980 SCL3_B_MARK, SDA3_B_MARK,
981};
982
983/* - MMC ------------------------------------------------------------------- */
984static const unsigned int mmc_data1_pins[] = {
985 /* D0 */
986 RCAR_GP_PIN(3, 2),
987};
988static const unsigned int mmc_data1_mux[] = {
989 MMC_D0_MARK,
990};
991static const unsigned int mmc_data4_pins[] = {
992 /* D[0:3] */
993 RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3),
994 RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
995};
996static const unsigned int mmc_data4_mux[] = {
997 MMC_D0_MARK, MMC_D1_MARK,
998 MMC_D2_MARK, MMC_D3_MARK,
999};
1000static const unsigned int mmc_data8_pins[] = {
1001 /* D[0:7] */
1002 RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3),
1003 RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
1004 RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
1005 RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
1006};
1007static const unsigned int mmc_data8_mux[] = {
1008 MMC_D0_MARK, MMC_D1_MARK,
1009 MMC_D2_MARK, MMC_D3_MARK,
1010 MMC_D4_MARK, MMC_D5_MARK,
1011 MMC_D6_MARK, MMC_D7_MARK,
1012};
1013static const unsigned int mmc_ctrl_pins[] = {
1014 /* CLK, CMD */
1015 RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 0),
1016};
1017static const unsigned int mmc_ctrl_mux[] = {
1018 MMC_CLK_MARK, MMC_CMD_MARK,
1019};
1020
1021/* - SCIF0 ------------------------------------------------------------------ */
1022static const unsigned int scif0_data_a_pins[] = {
1023 /* RX, TX */
1024 RCAR_GP_PIN(4, 20), RCAR_GP_PIN(4, 21),
1025};
1026static const unsigned int scif0_data_a_mux[] = {
1027 RX0_A_MARK, TX0_A_MARK,
1028};
1029static const unsigned int scif0_clk_a_pins[] = {
1030 /* SCK */
1031 RCAR_GP_PIN(4, 19),
1032};
1033static const unsigned int scif0_clk_a_mux[] = {
1034 SCK0_A_MARK,
1035};
1036static const unsigned int scif0_data_b_pins[] = {
1037 /* RX, TX */
1038 RCAR_GP_PIN(4, 31), RCAR_GP_PIN(4, 28),
1039};
1040static const unsigned int scif0_data_b_mux[] = {
1041 RX0_B_MARK, TX0_B_MARK,
1042};
1043static const unsigned int scif0_clk_b_pins[] = {
1044 /* SCK */
1045 RCAR_GP_PIN(5, 2),
1046};
1047static const unsigned int scif0_clk_b_mux[] = {
1048 SCK0_B_MARK,
1049};
1050static const unsigned int scif0_ctrl_pins[] = {
1051 /* RTS, CTS */
1052 RCAR_GP_PIN(4, 24), RCAR_GP_PIN(4, 23),
1053};
1054static const unsigned int scif0_ctrl_mux[] = {
1055 RTS0_N_TANS_MARK, CTS0_N_MARK,
1056};
1057/* - SCIF1 ------------------------------------------------------------------ */
1058static const unsigned int scif1_data_a_pins[] = {
1059 /* RX, TX */
1060 RCAR_GP_PIN(4, 23), RCAR_GP_PIN(4, 24),
1061};
1062static const unsigned int scif1_data_a_mux[] = {
1063 RX1_A_MARK, TX1_A_MARK,
1064};
1065static const unsigned int scif1_clk_a_pins[] = {
1066 /* SCK */
1067 RCAR_GP_PIN(4, 22),
1068};
1069static const unsigned int scif1_clk_a_mux[] = {
1070 SCK1_A_MARK,
1071};
1072static const unsigned int scif1_data_b_pins[] = {
1073 /* RX, TX */
1074 RCAR_GP_PIN(2, 26), RCAR_GP_PIN(2, 28),
1075};
1076static const unsigned int scif1_data_b_mux[] = {
1077 RX1_B_MARK, TX1_B_MARK,
1078};
1079static const unsigned int scif1_clk_b_pins[] = {
1080 /* SCK */
1081 RCAR_GP_PIN(2, 25),
1082};
1083static const unsigned int scif1_clk_b_mux[] = {
1084 SCK1_B_MARK,
1085};
1086static const unsigned int scif1_ctrl_pins[] = {
1087 /* RTS, CTS */
1088 RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 10),
1089};
1090static const unsigned int scif1_ctrl_mux[] = {
1091 RTS1_N_TANS_MARK, CTS1_N_MARK,
1092};
1093
1094/* - SCIF2 ------------------------------------------------------------------ */
1095static const unsigned int scif2_data_pins[] = {
1096 /* RX, TX */
1097 RCAR_GP_PIN(4, 26), RCAR_GP_PIN(4, 27),
1098};
1099static const unsigned int scif2_data_mux[] = {
1100 RX2_MARK, TX2_MARK,
1101};
1102static const unsigned int scif2_clk_pins[] = {
1103 /* SCK */
1104 RCAR_GP_PIN(4, 25),
1105};
1106static const unsigned int scif2_clk_mux[] = {
1107 SCK2_MARK,
1108};
1109/* - SCIF3 ------------------------------------------------------------------ */
1110static const unsigned int scif3_data_a_pins[] = {
1111 /* RX, TX */
1112 RCAR_GP_PIN(2, 31), RCAR_GP_PIN(4, 00),
1113};
1114static const unsigned int scif3_data_a_mux[] = {
1115 RX3_A_MARK, TX3_A_MARK,
1116};
1117static const unsigned int scif3_clk_a_pins[] = {
1118 /* SCK */
1119 RCAR_GP_PIN(2, 30),
1120};
1121static const unsigned int scif3_clk_a_mux[] = {
1122 SCK3_A_MARK,
1123};
1124static const unsigned int scif3_data_b_pins[] = {
1125 /* RX, TX */
1126 RCAR_GP_PIN(1, 30), RCAR_GP_PIN(1, 31),
1127};
1128static const unsigned int scif3_data_b_mux[] = {
1129 RX3_B_MARK, TX3_B_MARK,
1130};
1131static const unsigned int scif3_clk_b_pins[] = {
1132 /* SCK */
1133 RCAR_GP_PIN(1, 29),
1134};
1135static const unsigned int scif3_clk_b_mux[] = {
1136 SCK3_B_MARK,
1137};
1138/* - SCIF4 ------------------------------------------------------------------ */
1139static const unsigned int scif4_data_a_pins[] = {
1140 /* RX, TX */
1141 RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
1142};
1143static const unsigned int scif4_data_a_mux[] = {
1144 RX4_A_MARK, TX4_A_MARK,
1145};
1146static const unsigned int scif4_clk_a_pins[] = {
1147 /* SCK */
1148 RCAR_GP_PIN(2, 6),
1149};
1150static const unsigned int scif4_clk_a_mux[] = {
1151 SCK4_A_MARK,
1152};
1153static const unsigned int scif4_data_b_pins[] = {
1154 /* RX, TX */
1155 RCAR_GP_PIN(1, 16), RCAR_GP_PIN(1, 17),
1156};
1157static const unsigned int scif4_data_b_mux[] = {
1158 RX4_B_MARK, TX4_B_MARK,
1159};
1160static const unsigned int scif4_clk_b_pins[] = {
1161 /* SCK */
1162 RCAR_GP_PIN(1, 15),
1163};
1164static const unsigned int scif4_clk_b_mux[] = {
1165 SCK4_B_MARK,
1166};
1167/* - SCIF5 ------------------------------------------------------------------ */
1168static const unsigned int scif5_data_a_pins[] = {
1169 /* RX, TX */
1170 RCAR_GP_PIN(0, 7), RCAR_GP_PIN(0, 8),
1171};
1172static const unsigned int scif5_data_a_mux[] = {
1173 RX5_A_MARK, TX5_A_MARK,
1174};
1175static const unsigned int scif5_clk_a_pins[] = {
1176 /* SCK */
1177 RCAR_GP_PIN(0, 6),
1178};
1179static const unsigned int scif5_clk_a_mux[] = {
1180 SCK5_A_MARK,
1181};
1182static const unsigned int scif5_data_b_pins[] = {
1183 /* RX, TX */
1184 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
1185};
1186static const unsigned int scif5_data_b_mux[] = {
1187 RX5_B_MARK, TX5_B_MARK,
1188};
1189static const unsigned int scif5_clk_b_pins[] = {
1190 /* SCK */
1191 RCAR_GP_PIN(1, 3),
1192};
1193static const unsigned int scif5_clk_b_mux[] = {
1194 SCK5_B_MARK,
1195};
1196/* - SCIF Clock ------------------------------------------------------------- */
1197static const unsigned int scif_clk_pins[] = {
1198 /* SCIF_CLK */
1199 RCAR_GP_PIN(2, 27),
1200};
1201static const unsigned int scif_clk_mux[] = {
1202 SCIF_CLK_MARK,
1203};
1204
1205static const struct sh_pfc_pin_group pinmux_groups[] = {
1206 SH_PFC_PIN_GROUP(i2c0),
1207 SH_PFC_PIN_GROUP(i2c1),
1208 SH_PFC_PIN_GROUP(i2c2_a),
1209 SH_PFC_PIN_GROUP(i2c2_b),
1210 SH_PFC_PIN_GROUP(i2c3_a),
1211 SH_PFC_PIN_GROUP(i2c3_b),
1212 SH_PFC_PIN_GROUP(mmc_data1),
1213 SH_PFC_PIN_GROUP(mmc_data4),
1214 SH_PFC_PIN_GROUP(mmc_data8),
1215 SH_PFC_PIN_GROUP(mmc_ctrl),
1216 SH_PFC_PIN_GROUP(scif0_data_a),
1217 SH_PFC_PIN_GROUP(scif0_clk_a),
1218 SH_PFC_PIN_GROUP(scif0_data_b),
1219 SH_PFC_PIN_GROUP(scif0_clk_b),
1220 SH_PFC_PIN_GROUP(scif0_ctrl),
1221 SH_PFC_PIN_GROUP(scif1_data_a),
1222 SH_PFC_PIN_GROUP(scif1_clk_a),
1223 SH_PFC_PIN_GROUP(scif1_data_b),
1224 SH_PFC_PIN_GROUP(scif1_clk_b),
1225 SH_PFC_PIN_GROUP(scif1_ctrl),
1226 SH_PFC_PIN_GROUP(scif2_data),
1227 SH_PFC_PIN_GROUP(scif2_clk),
1228 SH_PFC_PIN_GROUP(scif3_data_a),
1229 SH_PFC_PIN_GROUP(scif3_clk_a),
1230 SH_PFC_PIN_GROUP(scif3_data_b),
1231 SH_PFC_PIN_GROUP(scif3_clk_b),
1232 SH_PFC_PIN_GROUP(scif4_data_a),
1233 SH_PFC_PIN_GROUP(scif4_clk_a),
1234 SH_PFC_PIN_GROUP(scif4_data_b),
1235 SH_PFC_PIN_GROUP(scif4_clk_b),
1236 SH_PFC_PIN_GROUP(scif5_data_a),
1237 SH_PFC_PIN_GROUP(scif5_clk_a),
1238 SH_PFC_PIN_GROUP(scif5_data_b),
1239 SH_PFC_PIN_GROUP(scif5_clk_b),
1240 SH_PFC_PIN_GROUP(scif_clk),
1241};
1242
1243static const char * const i2c0_groups[] = {
1244 "i2c0",
1245};
1246static const char * const i2c1_groups[] = {
1247 "i2c1",
1248};
1249
1250static const char * const i2c2_groups[] = {
1251 "i2c2_a",
1252 "i2c2_b",
1253};
1254
1255static const char * const i2c3_groups[] = {
1256 "i2c3_a",
1257 "i2c3_b",
1258};
1259
1260static const char * const mmc_groups[] = {
1261 "mmc_data1",
1262 "mmc_data4",
1263 "mmc_data8",
1264 "mmc_ctrl",
1265};
1266
1267static const char * const scif0_groups[] = {
1268 "scif0_data_a",
1269 "scif0_clk_a",
1270 "scif0_data_b",
1271 "scif0_clk_b",
1272 "scif0_ctrl",
1273};
1274
1275static const char * const scif1_groups[] = {
1276 "scif1_data_a",
1277 "scif1_clk_a",
1278 "scif1_data_b",
1279 "scif1_clk_b",
1280 "scif1_ctrl",
1281};
1282
1283static const char * const scif2_groups[] = {
1284 "scif2_data",
1285 "scif2_clk",
1286};
1287
1288static const char * const scif3_groups[] = {
1289 "scif3_data_a",
1290 "scif3_clk_a",
1291 "scif3_data_b",
1292 "scif3_clk_b",
1293};
1294
1295static const char * const scif4_groups[] = {
1296 "scif4_data_a",
1297 "scif4_clk_a",
1298 "scif4_data_b",
1299 "scif4_clk_b",
1300};
1301
1302static const char * const scif5_groups[] = {
1303 "scif5_data_a",
1304 "scif5_clk_a",
1305 "scif5_data_b",
1306 "scif5_clk_b",
1307};
1308
1309static const char * const scif_clk_groups[] = {
1310 "scif_clk",
1311};
1312
1313static const struct sh_pfc_function pinmux_functions[] = {
1314 SH_PFC_FUNCTION(i2c0),
1315 SH_PFC_FUNCTION(i2c1),
1316 SH_PFC_FUNCTION(i2c2),
1317 SH_PFC_FUNCTION(i2c3),
1318 SH_PFC_FUNCTION(mmc),
1319 SH_PFC_FUNCTION(scif0),
1320 SH_PFC_FUNCTION(scif1),
1321 SH_PFC_FUNCTION(scif2),
1322 SH_PFC_FUNCTION(scif3),
1323 SH_PFC_FUNCTION(scif4),
1324 SH_PFC_FUNCTION(scif5),
1325 SH_PFC_FUNCTION(scif_clk),
1326};
1327
1328static const struct pinmux_cfg_reg pinmux_config_regs[] = {
1329#define F_(x, y) FN_##y
1330#define FM(x) FN_##x
1331 { PINMUX_CFG_REG("GPSR0", 0xe6060100, 32, 1) {
1332 0, 0,
1333 0, 0,
1334 0, 0,
1335 0, 0,
1336 0, 0,
1337 0, 0,
1338 0, 0,
1339 0, 0,
1340 0, 0,
1341 0, 0,
1342 0, 0,
1343 0, 0,
1344 0, 0,
1345 0, 0,
1346 0, 0,
1347 0, 0,
1348 0, 0,
1349 0, 0,
1350 0, 0,
1351 0, 0,
1352 0, 0,
1353 0, 0,
1354 0, 0,
1355 GP_0_8_FN, GPSR0_8,
1356 GP_0_7_FN, GPSR0_7,
1357 GP_0_6_FN, GPSR0_6,
1358 GP_0_5_FN, GPSR0_5,
1359 GP_0_4_FN, GPSR0_4,
1360 GP_0_3_FN, GPSR0_3,
1361 GP_0_2_FN, GPSR0_2,
1362 GP_0_1_FN, GPSR0_1,
1363 GP_0_0_FN, GPSR0_0, }
1364 },
1365 { PINMUX_CFG_REG("GPSR1", 0xe6060104, 32, 1) {
1366 GP_1_31_FN, GPSR1_31,
1367 GP_1_30_FN, GPSR1_30,
1368 GP_1_29_FN, GPSR1_29,
1369 GP_1_28_FN, GPSR1_28,
1370 GP_1_27_FN, GPSR1_27,
1371 GP_1_26_FN, GPSR1_26,
1372 GP_1_25_FN, GPSR1_25,
1373 GP_1_24_FN, GPSR1_24,
1374 GP_1_23_FN, GPSR1_23,
1375 GP_1_22_FN, GPSR1_22,
1376 GP_1_21_FN, GPSR1_21,
1377 GP_1_20_FN, GPSR1_20,
1378 GP_1_19_FN, GPSR1_19,
1379 GP_1_18_FN, GPSR1_18,
1380 GP_1_17_FN, GPSR1_17,
1381 GP_1_16_FN, GPSR1_16,
1382 GP_1_15_FN, GPSR1_15,
1383 GP_1_14_FN, GPSR1_14,
1384 GP_1_13_FN, GPSR1_13,
1385 GP_1_12_FN, GPSR1_12,
1386 GP_1_11_FN, GPSR1_11,
1387 GP_1_10_FN, GPSR1_10,
1388 GP_1_9_FN, GPSR1_9,
1389 GP_1_8_FN, GPSR1_8,
1390 GP_1_7_FN, GPSR1_7,
1391 GP_1_6_FN, GPSR1_6,
1392 GP_1_5_FN, GPSR1_5,
1393 GP_1_4_FN, GPSR1_4,
1394 GP_1_3_FN, GPSR1_3,
1395 GP_1_2_FN, GPSR1_2,
1396 GP_1_1_FN, GPSR1_1,
1397 GP_1_0_FN, GPSR1_0, }
1398 },
1399 { PINMUX_CFG_REG("GPSR2", 0xe6060108, 32, 1) {
1400 GP_2_31_FN, GPSR2_31,
1401 GP_2_30_FN, GPSR2_30,
1402 GP_2_29_FN, GPSR2_29,
1403 GP_2_28_FN, GPSR2_28,
1404 GP_2_27_FN, GPSR2_27,
1405 GP_2_26_FN, GPSR2_26,
1406 GP_2_25_FN, GPSR2_25,
1407 GP_2_24_FN, GPSR2_24,
1408 GP_2_23_FN, GPSR2_23,
1409 GP_2_22_FN, GPSR2_22,
1410 GP_2_21_FN, GPSR2_21,
1411 GP_2_20_FN, GPSR2_20,
1412 GP_2_19_FN, GPSR2_19,
1413 GP_2_18_FN, GPSR2_18,
1414 GP_2_17_FN, GPSR2_17,
1415 GP_2_16_FN, GPSR2_16,
1416 GP_2_15_FN, GPSR2_15,
1417 GP_2_14_FN, GPSR2_14,
1418 GP_2_13_FN, GPSR2_13,
1419 GP_2_12_FN, GPSR2_12,
1420 GP_2_11_FN, GPSR2_11,
1421 GP_2_10_FN, GPSR2_10,
1422 GP_2_9_FN, GPSR2_9,
1423 GP_2_8_FN, GPSR2_8,
1424 GP_2_7_FN, GPSR2_7,
1425 GP_2_6_FN, GPSR2_6,
1426 GP_2_5_FN, GPSR2_5,
1427 GP_2_4_FN, GPSR2_4,
1428 GP_2_3_FN, GPSR2_3,
1429 GP_2_2_FN, GPSR2_2,
1430 GP_2_1_FN, GPSR2_1,
1431 GP_2_0_FN, GPSR2_0, }
1432 },
1433 { PINMUX_CFG_REG("GPSR3", 0xe606010c, 32, 1) {
1434 0, 0,
1435 0, 0,
1436 0, 0,
1437 0, 0,
1438 0, 0,
1439 0, 0,
1440 0, 0,
1441 0, 0,
1442 0, 0,
1443 0, 0,
1444 0, 0,
1445 0, 0,
1446 0, 0,
1447 0, 0,
1448 0, 0,
1449 0, 0,
1450 0, 0,
1451 0, 0,
1452 0, 0,
1453 0, 0,
1454 0, 0,
1455 0, 0,
1456 GP_3_9_FN, GPSR3_9,
1457 GP_3_8_FN, GPSR3_8,
1458 GP_3_7_FN, GPSR3_7,
1459 GP_3_6_FN, GPSR3_6,
1460 GP_3_5_FN, GPSR3_5,
1461 GP_3_4_FN, GPSR3_4,
1462 GP_3_3_FN, GPSR3_3,
1463 GP_3_2_FN, GPSR3_2,
1464 GP_3_1_FN, GPSR3_1,
1465 GP_3_0_FN, GPSR3_0, }
1466 },
1467 { PINMUX_CFG_REG("GPSR4", 0xe6060110, 32, 1) {
1468 GP_4_31_FN, GPSR4_31,
1469 GP_4_30_FN, GPSR4_30,
1470 GP_4_29_FN, GPSR4_29,
1471 GP_4_28_FN, GPSR4_28,
1472 GP_4_27_FN, GPSR4_27,
1473 GP_4_26_FN, GPSR4_26,
1474 GP_4_25_FN, GPSR4_25,
1475 GP_4_24_FN, GPSR4_24,
1476 GP_4_23_FN, GPSR4_23,
1477 GP_4_22_FN, GPSR4_22,
1478 GP_4_21_FN, GPSR4_21,
1479 GP_4_20_FN, GPSR4_20,
1480 GP_4_19_FN, GPSR4_19,
1481 GP_4_18_FN, GPSR4_18,
1482 GP_4_17_FN, GPSR4_17,
1483 GP_4_16_FN, GPSR4_16,
1484 GP_4_15_FN, GPSR4_15,
1485 GP_4_14_FN, GPSR4_14,
1486 GP_4_13_FN, GPSR4_13,
1487 GP_4_12_FN, GPSR4_12,
1488 GP_4_11_FN, GPSR4_11,
1489 GP_4_10_FN, GPSR4_10,
1490 GP_4_9_FN, GPSR4_9,
1491 GP_4_8_FN, GPSR4_8,
1492 GP_4_7_FN, GPSR4_7,
1493 GP_4_6_FN, GPSR4_6,
1494 GP_4_5_FN, GPSR4_5,
1495 GP_4_4_FN, GPSR4_4,
1496 GP_4_3_FN, GPSR4_3,
1497 GP_4_2_FN, GPSR4_2,
1498 GP_4_1_FN, GPSR4_1,
1499 GP_4_0_FN, GPSR4_0, }
1500 },
1501 { PINMUX_CFG_REG("GPSR5", 0xe6060114, 32, 1) {
1502 0, 0,
1503 0, 0,
1504 0, 0,
1505 0, 0,
1506 0, 0,
1507 0, 0,
1508 0, 0,
1509 0, 0,
1510 0, 0,
1511 0, 0,
1512 0, 0,
1513 GP_5_20_FN, GPSR5_20,
1514 GP_5_19_FN, GPSR5_19,
1515 GP_5_18_FN, GPSR5_18,
1516 GP_5_17_FN, GPSR5_17,
1517 GP_5_16_FN, GPSR5_16,
1518 GP_5_15_FN, GPSR5_15,
1519 GP_5_14_FN, GPSR5_14,
1520 GP_5_13_FN, GPSR5_13,
1521 GP_5_12_FN, GPSR5_12,
1522 GP_5_11_FN, GPSR5_11,
1523 GP_5_10_FN, GPSR5_10,
1524 GP_5_9_FN, GPSR5_9,
1525 GP_5_8_FN, GPSR5_8,
1526 GP_5_7_FN, GPSR5_7,
1527 GP_5_6_FN, GPSR5_6,
1528 GP_5_5_FN, GPSR5_5,
1529 GP_5_4_FN, GPSR5_4,
1530 GP_5_3_FN, GPSR5_3,
1531 GP_5_2_FN, GPSR5_2,
1532 GP_5_1_FN, GPSR5_1,
1533 GP_5_0_FN, GPSR5_0, }
1534 },
1535 { PINMUX_CFG_REG("GPSR6", 0xe6060118, 32, 1) {
1536 0, 0,
1537 0, 0,
1538 0, 0,
1539 0, 0,
1540 0, 0,
1541 0, 0,
1542 0, 0,
1543 0, 0,
1544 0, 0,
1545 0, 0,
1546 0, 0,
1547 0, 0,
1548 0, 0,
1549 0, 0,
1550 0, 0,
1551 0, 0,
1552 0, 0,
1553 0, 0,
1554 GP_6_13_FN, GPSR6_13,
1555 GP_6_12_FN, GPSR6_12,
1556 GP_6_11_FN, GPSR6_11,
1557 GP_6_10_FN, GPSR6_10,
1558 GP_6_9_FN, GPSR6_9,
1559 GP_6_8_FN, GPSR6_8,
1560 GP_6_7_FN, GPSR6_7,
1561 GP_6_6_FN, GPSR6_6,
1562 GP_6_5_FN, GPSR6_5,
1563 GP_6_4_FN, GPSR6_4,
1564 GP_6_3_FN, GPSR6_3,
1565 GP_6_2_FN, GPSR6_2,
1566 GP_6_1_FN, GPSR6_1,
1567 GP_6_0_FN, GPSR6_0, }
1568 },
1569#undef F_
1570#undef FM
1571
1572#define F_(x, y) x,
1573#define FM(x) FN_##x,
1574 { PINMUX_CFG_REG("IPSR0", 0xe6060200, 32, 4) {
1575 IP0_31_28
1576 IP0_27_24
1577 IP0_23_20
1578 IP0_19_16
1579 IP0_15_12
1580 IP0_11_8
1581 IP0_7_4
1582 IP0_3_0 }
1583 },
1584 { PINMUX_CFG_REG("IPSR1", 0xe6060204, 32, 4) {
1585 IP1_31_28
1586 IP1_27_24
1587 IP1_23_20
1588 IP1_19_16
1589 IP1_15_12
1590 IP1_11_8
1591 IP1_7_4
1592 IP1_3_0 }
1593 },
1594 { PINMUX_CFG_REG("IPSR2", 0xe6060208, 32, 4) {
1595 IP2_31_28
1596 IP2_27_24
1597 IP2_23_20
1598 IP2_19_16
1599 IP2_15_12
1600 IP2_11_8
1601 IP2_7_4
1602 IP2_3_0 }
1603 },
1604 { PINMUX_CFG_REG("IPSR3", 0xe606020c, 32, 4) {
1605 IP3_31_28
1606 IP3_27_24
1607 IP3_23_20
1608 IP3_19_16
1609 IP3_15_12
1610 IP3_11_8
1611 IP3_7_4
1612 IP3_3_0 }
1613 },
1614 { PINMUX_CFG_REG("IPSR4", 0xe6060210, 32, 4) {
1615 IP4_31_28
1616 IP4_27_24
1617 IP4_23_20
1618 IP4_19_16
1619 IP4_15_12
1620 IP4_11_8
1621 IP4_7_4
1622 IP4_3_0 }
1623 },
1624 { PINMUX_CFG_REG("IPSR5", 0xe6060214, 32, 4) {
1625 IP5_31_28
1626 IP5_27_24
1627 IP5_23_20
1628 IP5_19_16
1629 IP5_15_12
1630 IP5_11_8
1631 IP5_7_4
1632 IP5_3_0 }
1633 },
1634 { PINMUX_CFG_REG("IPSR6", 0xe6060218, 32, 4) {
1635 IP6_31_28
1636 IP6_27_24
1637 IP6_23_20
1638 IP6_19_16
1639 IP6_15_12
1640 IP6_11_8
1641 IP6_7_4
1642 IP6_3_0 }
1643 },
1644 { PINMUX_CFG_REG("IPSR7", 0xe606021c, 32, 4) {
1645 IP7_31_28
1646 IP7_27_24
1647 IP7_23_20
1648 IP7_19_16
1649 IP7_15_12
1650 IP7_11_8
1651 IP7_7_4
1652 IP7_3_0 }
1653 },
1654 { PINMUX_CFG_REG("IPSR8", 0xe6060220, 32, 4) {
1655 IP8_31_28
1656 IP8_27_24
1657 IP8_23_20
1658 IP8_19_16
1659 IP8_15_12
1660 IP8_11_8
1661 IP8_7_4
1662 IP8_3_0 }
1663 },
1664 { PINMUX_CFG_REG("IPSR9", 0xe6060224, 32, 4) {
1665 IP9_31_28
1666 IP9_27_24
1667 IP9_23_20
1668 IP9_19_16
1669 IP9_15_12
1670 IP9_11_8
1671 IP9_7_4
1672 IP9_3_0 }
1673 },
1674 { PINMUX_CFG_REG("IPSR10", 0xe6060228, 32, 4) {
1675 IP10_31_28
1676 IP10_27_24
1677 IP10_23_20
1678 IP10_19_16
1679 IP10_15_12
1680 IP10_11_8
1681 IP10_7_4
1682 IP10_3_0 }
1683 },
1684 { PINMUX_CFG_REG("IPSR11", 0xe606022c, 32, 4) {
1685 IP11_31_28
1686 IP11_27_24
1687 IP11_23_20
1688 IP11_19_16
1689 IP11_15_12
1690 IP11_11_8
1691 IP11_7_4
1692 IP11_3_0 }
1693 },
1694 { PINMUX_CFG_REG("IPSR12", 0xe6060230, 32, 4) {
1695 IP12_31_28
1696 IP12_27_24
1697 IP12_23_20
1698 IP12_19_16
1699 IP12_15_12
1700 IP12_11_8
1701 IP12_7_4
1702 IP12_3_0 }
1703 },
1704 { PINMUX_CFG_REG("IPSR13", 0xe6060234, 32, 4) {
1705 /* IP13_31_28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1706 /* IP13_27_24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1707 /* IP13_23_20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1708 /* IP13_19_16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1709 /* IP13_15_12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1710 /* IP13_11_8 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1711 IP13_7_4
1712 IP13_3_0 }
1713 },
1714#undef F_
1715#undef FM
1716
1717#define F_(x, y) x,
1718#define FM(x) FN_##x,
1719 { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xe6060500, 32,
1720 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1,
1721 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1) {
1722 /* RESERVED 31 */
1723 0, 0,
1724 MOD_SEL0_30
1725 MOD_SEL0_29
1726 MOD_SEL0_28
1727 MOD_SEL0_27
1728 MOD_SEL0_26
1729 MOD_SEL0_25
1730 MOD_SEL0_24_23
1731 MOD_SEL0_22_21
1732 MOD_SEL0_20_19
1733 MOD_SEL0_18_17
1734 /* RESERVED 16 */
1735 0, 0,
1736 MOD_SEL0_15
1737 MOD_SEL0_14
1738 MOD_SEL0_13
1739 MOD_SEL0_12
1740 MOD_SEL0_11
1741 MOD_SEL0_10
1742 /* RESERVED 9, 8, 7, 6 */
1743 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1744 MOD_SEL0_5
1745 MOD_SEL0_4
1746 MOD_SEL0_3
1747 MOD_SEL0_2
1748 MOD_SEL0_1
1749 MOD_SEL0_0 }
1750 },
1751 { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xe6060504, 32,
1752 1, 1, 1, 1, 1, 1, 2, 4, 4,
1753 4, 4, 4, 4) {
1754 MOD_SEL1_31
1755 MOD_SEL1_30
1756 MOD_SEL1_29
1757 MOD_SEL1_28
1758 MOD_SEL1_27
1759 MOD_SEL1_26
1760 /* RESERVED 25, 24 */
1761 0, 0, 0, 0,
1762 /* RESERVED 23, 22, 21, 20 */
1763 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1764 /* RESERVED 19, 18, 17, 16 */
1765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1766 /* RESERVED 15, 14, 13, 12 */
1767 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1768 /* RESERVED 11, 10, 9, 8 */
1769 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1770 /* RESERVED 7, 6, 5, 4 */
1771 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1772 /* RESERVED 3, 2, 1, 0 */
1773 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
1774 },
1775 { },
1776};
1777
1778static int r8a77995_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl)
1779{
1780 int bit = -EINVAL;
1781
1782 *pocctrl = 0xe6060380;
1783
1784 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 9))
1785 bit = 29 - (pin - RCAR_GP_PIN(3, 0));
1786
1787 return bit;
1788}
1789
1790static const struct sh_pfc_soc_operations r8a77995_pinmux_ops = {
1791 .pin_to_pocctrl = r8a77995_pin_to_pocctrl,
1792};
1793
1794const struct sh_pfc_soc_info r8a77995_pinmux_info = {
1795 .name = "r8a77995_pfc",
1796 .ops = &r8a77995_pinmux_ops,
1797 .unlock_reg = 0xe6060000, /* PMMR */
1798
1799 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1800
1801 .pins = pinmux_pins,
1802 .nr_pins = ARRAY_SIZE(pinmux_pins),
1803 .groups = pinmux_groups,
1804 .nr_groups = ARRAY_SIZE(pinmux_groups),
1805 .functions = pinmux_functions,
1806 .nr_functions = ARRAY_SIZE(pinmux_functions),
1807
1808 .cfg_regs = pinmux_config_regs,
1809
1810 .pinmux_data = pinmux_data,
1811 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
1812};
diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index a70157f0acf4..5c9d79981e6d 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -290,7 +290,7 @@ static int sh_pfc_dt_node_to_map(struct pinctrl_dev *pctldev,
290 if (*num_maps) 290 if (*num_maps)
291 return 0; 291 return 0;
292 292
293 dev_err(dev, "no mapping found in node %s\n", np->full_name); 293 dev_err(dev, "no mapping found in node %pOF\n", np);
294 ret = -EINVAL; 294 ret = -EINVAL;
295 295
296done: 296done:
@@ -742,13 +742,16 @@ static int sh_pfc_pinconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
742 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); 742 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
743 const unsigned int *pins; 743 const unsigned int *pins;
744 unsigned int num_pins; 744 unsigned int num_pins;
745 unsigned int i; 745 unsigned int i, ret;
746 746
747 pins = pmx->pfc->info->groups[group].pins; 747 pins = pmx->pfc->info->groups[group].pins;
748 num_pins = pmx->pfc->info->groups[group].nr_pins; 748 num_pins = pmx->pfc->info->groups[group].nr_pins;
749 749
750 for (i = 0; i < num_pins; ++i) 750 for (i = 0; i < num_pins; ++i) {
751 sh_pfc_pinconf_set(pctldev, pins[i], configs, num_configs); 751 ret = sh_pfc_pinconf_set(pctldev, pins[i], configs, num_configs);
752 if (ret)
753 return ret;
754 }
752 755
753 return 0; 756 return 0;
754} 757}
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 4376397123de..8688b405e081 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -271,6 +271,7 @@ extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
271extern const struct sh_pfc_soc_info r8a7795_pinmux_info; 271extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
272extern const struct sh_pfc_soc_info r8a7795es1_pinmux_info; 272extern const struct sh_pfc_soc_info r8a7795es1_pinmux_info;
273extern const struct sh_pfc_soc_info r8a7796_pinmux_info; 273extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
274extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
274extern const struct sh_pfc_soc_info sh7203_pinmux_info; 275extern const struct sh_pfc_soc_info sh7203_pinmux_info;
275extern const struct sh_pfc_soc_info sh7264_pinmux_info; 276extern const struct sh_pfc_soc_info sh7264_pinmux_info;
276extern const struct sh_pfc_soc_info sh7269_pinmux_info; 277extern const struct sh_pfc_soc_info sh7269_pinmux_info;
@@ -389,9 +390,13 @@ extern const struct sh_pfc_soc_info shx3_pinmux_info;
389 PORT_GP_CFG_1(bank, 8, fn, sfx, cfg) 390 PORT_GP_CFG_1(bank, 8, fn, sfx, cfg)
390#define PORT_GP_9(bank, fn, sfx) PORT_GP_CFG_9(bank, fn, sfx, 0) 391#define PORT_GP_9(bank, fn, sfx) PORT_GP_CFG_9(bank, fn, sfx, 0)
391 392
392#define PORT_GP_CFG_12(bank, fn, sfx, cfg) \ 393#define PORT_GP_CFG_10(bank, fn, sfx, cfg) \
393 PORT_GP_CFG_9(bank, fn, sfx, cfg), \ 394 PORT_GP_CFG_9(bank, fn, sfx, cfg), \
394 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg), \ 395 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg)
396#define PORT_GP_10(bank, fn, sfx) PORT_GP_CFG_10(bank, fn, sfx, 0)
397
398#define PORT_GP_CFG_12(bank, fn, sfx, cfg) \
399 PORT_GP_CFG_10(bank, fn, sfx, cfg), \
395 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg), \ 400 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg), \
396 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg) 401 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg)
397#define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0) 402#define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0)
@@ -422,11 +427,19 @@ extern const struct sh_pfc_soc_info shx3_pinmux_info;
422 PORT_GP_CFG_1(bank, 17, fn, sfx, cfg) 427 PORT_GP_CFG_1(bank, 17, fn, sfx, cfg)
423#define PORT_GP_18(bank, fn, sfx) PORT_GP_CFG_18(bank, fn, sfx, 0) 428#define PORT_GP_18(bank, fn, sfx) PORT_GP_CFG_18(bank, fn, sfx, 0)
424 429
425#define PORT_GP_CFG_23(bank, fn, sfx, cfg) \ 430#define PORT_GP_CFG_20(bank, fn, sfx, cfg) \
426 PORT_GP_CFG_18(bank, fn, sfx, cfg), \ 431 PORT_GP_CFG_18(bank, fn, sfx, cfg), \
427 PORT_GP_CFG_1(bank, 18, fn, sfx, cfg), \ 432 PORT_GP_CFG_1(bank, 18, fn, sfx, cfg), \
428 PORT_GP_CFG_1(bank, 19, fn, sfx, cfg), \ 433 PORT_GP_CFG_1(bank, 19, fn, sfx, cfg)
429 PORT_GP_CFG_1(bank, 20, fn, sfx, cfg), \ 434#define PORT_GP_20(bank, fn, sfx) PORT_GP_CFG_20(bank, fn, sfx, 0)
435
436#define PORT_GP_CFG_21(bank, fn, sfx, cfg) \
437 PORT_GP_CFG_20(bank, fn, sfx, cfg), \
438 PORT_GP_CFG_1(bank, 20, fn, sfx, cfg)
439#define PORT_GP_21(bank, fn, sfx) PORT_GP_CFG_21(bank, fn, sfx, 0)
440
441#define PORT_GP_CFG_23(bank, fn, sfx, cfg) \
442 PORT_GP_CFG_21(bank, fn, sfx, cfg), \
430 PORT_GP_CFG_1(bank, 21, fn, sfx, cfg), \ 443 PORT_GP_CFG_1(bank, 21, fn, sfx, cfg), \
431 PORT_GP_CFG_1(bank, 22, fn, sfx, cfg) 444 PORT_GP_CFG_1(bank, 22, fn, sfx, cfg)
432#define PORT_GP_23(bank, fn, sfx) PORT_GP_CFG_23(bank, fn, sfx, 0) 445#define PORT_GP_23(bank, fn, sfx) PORT_GP_CFG_23(bank, fn, sfx, 0)
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
index 1efa315a7dbe..4db9323251e3 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
@@ -549,7 +549,7 @@ static const struct pinctrl_pin_desc atlas7_ioc_pads[] = {
549 PINCTRL_PIN(163, "jtag_trstn"), 549 PINCTRL_PIN(163, "jtag_trstn"),
550}; 550};
551 551
552struct atlas7_pad_config atlas7_ioc_pad_confs[] = { 552static struct atlas7_pad_config atlas7_ioc_pad_confs[] = {
553 /* The Configuration of IOC_RTC Pads */ 553 /* The Configuration of IOC_RTC Pads */
554 PADCONF(0, 3, 0x0, 0x100, 0x200, -1, 0, 0, 0, 0), 554 PADCONF(0, 3, 0x0, 0x100, 0x200, -1, 0, 0, 0, 0),
555 PADCONF(1, 3, 0x0, 0x100, 0x200, -1, 4, 2, 2, 0), 555 PADCONF(1, 3, 0x0, 0x100, 0x200, -1, 4, 2, 2, 0),
@@ -1002,7 +1002,7 @@ static const unsigned int vi_vip1_high8bit_pins[] = { 82, 83, 84, 103, 104,
1002 105, 106, 107, 102, 97, 98, }; 1002 105, 106, 107, 102, 97, 98, };
1003 1003
1004/* definition of pin group table */ 1004/* definition of pin group table */
1005struct atlas7_pin_group altas7_pin_groups[] = { 1005static struct atlas7_pin_group altas7_pin_groups[] = {
1006 GROUP("gnss_gpio_grp", gnss_gpio_pins), 1006 GROUP("gnss_gpio_grp", gnss_gpio_pins),
1007 GROUP("lcd_vip_gpio_grp", lcd_vip_gpio_pins), 1007 GROUP("lcd_vip_gpio_grp", lcd_vip_gpio_pins),
1008 GROUP("sdio_i2s_gpio_grp", sdio_i2s_gpio_pins), 1008 GROUP("sdio_i2s_gpio_grp", sdio_i2s_gpio_pins),
@@ -4764,7 +4764,7 @@ static struct atlas7_pmx_func atlas7_pmx_functions[] = {
4764 &vi_vip1_high8bit_grp_mux), 4764 &vi_vip1_high8bit_grp_mux),
4765}; 4765};
4766 4766
4767struct atlas7_pinctrl_data atlas7_ioc_data = { 4767static struct atlas7_pinctrl_data atlas7_ioc_data = {
4768 .pads = (struct pinctrl_pin_desc *)atlas7_ioc_pads, 4768 .pads = (struct pinctrl_pin_desc *)atlas7_ioc_pads,
4769 .pads_cnt = ARRAY_SIZE(atlas7_ioc_pads), 4769 .pads_cnt = ARRAY_SIZE(atlas7_ioc_pads),
4770 .grps = (struct atlas7_pin_group *)altas7_pin_groups, 4770 .grps = (struct atlas7_pin_group *)altas7_pin_groups,
@@ -5261,7 +5261,7 @@ static int atlas7_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
5261 return 0; 5261 return 0;
5262} 5262}
5263 5263
5264static struct pinmux_ops atlas7_pinmux_ops = { 5264static const struct pinmux_ops atlas7_pinmux_ops = {
5265 .get_functions_count = atlas7_pmx_get_funcs_count, 5265 .get_functions_count = atlas7_pmx_get_funcs_count,
5266 .get_function_name = atlas7_pmx_get_func_name, 5266 .get_function_name = atlas7_pmx_get_func_name,
5267 .get_function_groups = atlas7_pmx_get_func_groups, 5267 .get_function_groups = atlas7_pmx_get_func_groups,
@@ -6078,12 +6078,15 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
6078 bank = &a7gc->banks[idx]; 6078 bank = &a7gc->banks[idx];
6079 /* Set ctrl registers' base of this bank */ 6079 /* Set ctrl registers' base of this bank */
6080 bank->base = ATLAS7_GPIO_BASE(a7gc, idx); 6080 bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
6081 bank->gpio_offset = idx * NGPIO_OF_BANK;
6081 6082
6082 /* Get interrupt number from DTS */ 6083 /* Get interrupt number from DTS */
6083 ret = of_irq_get(np, idx); 6084 ret = of_irq_get(np, idx);
6084 if (ret == -EPROBE_DEFER) { 6085 if (ret <= 0) {
6085 dev_err(&pdev->dev, 6086 dev_err(&pdev->dev,
6086 "Unable to find IRQ number. ret=%d\n", ret); 6087 "Unable to find IRQ number. ret=%d\n", ret);
6088 if (!ret)
6089 ret = -ENXIO;
6087 goto failed; 6090 goto failed;
6088 } 6091 }
6089 bank->irq = ret; 6092 bank->irq = ret;
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 0df72be60704..d3ef05973901 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -133,7 +133,7 @@ static void sirfsoc_dt_free_map(struct pinctrl_dev *pctldev,
133 kfree(map); 133 kfree(map);
134} 134}
135 135
136static struct pinctrl_ops sirfsoc_pctrl_ops = { 136static const struct pinctrl_ops sirfsoc_pctrl_ops = {
137 .get_groups_count = sirfsoc_get_groups_count, 137 .get_groups_count = sirfsoc_get_groups_count,
138 .get_group_name = sirfsoc_get_group_name, 138 .get_group_name = sirfsoc_get_group_name,
139 .get_group_pins = sirfsoc_get_group_pins, 139 .get_group_pins = sirfsoc_get_group_pins,
@@ -229,7 +229,7 @@ static int sirfsoc_pinmux_request_gpio(struct pinctrl_dev *pmxdev,
229 return 0; 229 return 0;
230} 230}
231 231
232static struct pinmux_ops sirfsoc_pinmux_ops = { 232static const struct pinmux_ops sirfsoc_pinmux_ops = {
233 .set_mux = sirfsoc_pinmux_set_mux, 233 .set_mux = sirfsoc_pinmux_set_mux,
234 .get_functions_count = sirfsoc_pinmux_get_funcs_count, 234 .get_functions_count = sirfsoc_pinmux_get_funcs_count,
235 .get_function_name = sirfsoc_pinmux_get_func_name, 235 .get_function_name = sirfsoc_pinmux_get_func_name,
@@ -810,7 +810,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
810 sgpio->chip.gc.set = sirfsoc_gpio_set_value; 810 sgpio->chip.gc.set = sirfsoc_gpio_set_value;
811 sgpio->chip.gc.base = 0; 811 sgpio->chip.gc.base = 0;
812 sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS; 812 sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS;
813 sgpio->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); 813 sgpio->chip.gc.label = kasprintf(GFP_KERNEL, "%pOF", np);
814 sgpio->chip.gc.of_node = np; 814 sgpio->chip.gc.of_node = np;
815 sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; 815 sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate;
816 sgpio->chip.gc.of_gpio_n_cells = 2; 816 sgpio->chip.gc.of_gpio_n_cells = 2;
@@ -819,8 +819,8 @@ static int sirfsoc_gpio_probe(struct device_node *np)
819 819
820 err = gpiochip_add_data(&sgpio->chip.gc, sgpio); 820 err = gpiochip_add_data(&sgpio->chip.gc, sgpio);
821 if (err) { 821 if (err) {
822 dev_err(&pdev->dev, "%s: error in probe function with status %d\n", 822 dev_err(&pdev->dev, "%pOF: error in probe function with status %d\n",
823 np->full_name, err); 823 np, err);
824 goto out; 824 goto out;
825 } 825 }
826 826
diff --git a/drivers/pinctrl/sprd/Kconfig b/drivers/pinctrl/sprd/Kconfig
new file mode 100644
index 000000000000..6f4a7f9ac6fd
--- /dev/null
+++ b/drivers/pinctrl/sprd/Kconfig
@@ -0,0 +1,17 @@
1#
2# Spreadtrum pin control drivers
3#
4
5config PINCTRL_SPRD
6 bool "Spreadtrum pinctrl driver"
7 select PINMUX
8 select PINCONF
9 select GENERIC_PINCONF
10 select GENERIC_PINMUX_FUNCTIONS
11 help
12 Say Y here to enable Spreadtrum pinctrl driver
13
14config PINCTRL_SPRD_SC9860
15 bool "Spreadtrum SC9860 pinctrl driver"
16 help
17 Say Y here to enable Spreadtrum SC9860 pinctrl driver
diff --git a/drivers/pinctrl/sprd/Makefile b/drivers/pinctrl/sprd/Makefile
new file mode 100644
index 000000000000..b6caa8cbc6dd
--- /dev/null
+++ b/drivers/pinctrl/sprd/Makefile
@@ -0,0 +1,2 @@
1obj-$(CONFIG_PINCTRL_SPRD) += pinctrl-sprd.o
2obj-$(CONFIG_PINCTRL_SPRD_SC9860) += pinctrl-sprd-sc9860.o
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
new file mode 100644
index 000000000000..3cdad8bc8f93
--- /dev/null
+++ b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
@@ -0,0 +1,972 @@
1/*
2 * Spreadtrum pin controller driver
3 * Copyright (C) 2017 Spreadtrum - http://www.spreadtrum.com
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 */
14
15#include <linux/module.h>
16#include <linux/platform_device.h>
17
18#include "pinctrl-sprd.h"
19
20enum sprd_sc9860_pins {
21 /* pin global control register 0 */
22 SC9860_VIO28_0_IRTE = SPRD_PIN_INFO(0, GLOBAL_CTRL_PIN, 11, 1, 0),
23 SC9860_VIO_SD2_IRTE = SPRD_PIN_INFO(1, GLOBAL_CTRL_PIN, 10, 1, 0),
24 SC9860_VIO_SD0_IRTE = SPRD_PIN_INFO(2, GLOBAL_CTRL_PIN, 9, 1, 0),
25 SC9860_VIO_SIM2_IRTE = SPRD_PIN_INFO(3, GLOBAL_CTRL_PIN, 8, 1, 0),
26 SC9860_VIO_SIM1_IRTE = SPRD_PIN_INFO(4, GLOBAL_CTRL_PIN, 7, 1, 0),
27 SC9860_VIO_SIM0_IRTE = SPRD_PIN_INFO(5, GLOBAL_CTRL_PIN, 6, 1, 0),
28 SC9860_VIO28_0_MS = SPRD_PIN_INFO(6, GLOBAL_CTRL_PIN, 5, 1, 0),
29 SC9860_VIO_SD2_MS = SPRD_PIN_INFO(7, GLOBAL_CTRL_PIN, 4, 1, 0),
30 SC9860_VIO_SD0_MS = SPRD_PIN_INFO(8, GLOBAL_CTRL_PIN, 3, 1, 0),
31 SC9860_VIO_SIM2_MS = SPRD_PIN_INFO(9, GLOBAL_CTRL_PIN, 2, 1, 0),
32 SC9860_VIO_SIM1_MS = SPRD_PIN_INFO(10, GLOBAL_CTRL_PIN, 1, 1, 0),
33 SC9860_VIO_SIM0_MS = SPRD_PIN_INFO(11, GLOBAL_CTRL_PIN, 0, 1, 0),
34
35 /* pin global control register 2 */
36 SC9860_SPSPI_PIN_IN_SEL = SPRD_PIN_INFO(12, GLOBAL_CTRL_PIN, 31, 1, 2),
37 SC9860_UART1_USB30_PHY_SEL = SPRD_PIN_INFO(13, GLOBAL_CTRL_PIN, 30, 1, 2),
38 SC9860_USB30_PHY_DM_OE = SPRD_PIN_INFO(14, GLOBAL_CTRL_PIN, 29, 1, 2),
39 SC9860_USB30_PHY_DP_OE = SPRD_PIN_INFO(15, GLOBAL_CTRL_PIN, 28, 1, 2),
40 SC9860_UART5_SYS_SEL = SPRD_PIN_INFO(16, GLOBAL_CTRL_PIN, 25, 3, 2),
41 SC9860_ORP_URXD_PIN_IN_SEL = SPRD_PIN_INFO(17, GLOBAL_CTRL_PIN, 24, 1, 2),
42 SC9860_SIM2_SYS_SEL = SPRD_PIN_INFO(18, GLOBAL_CTRL_PIN, 23, 1, 2),
43 SC9860_SIM1_SYS_SEL = SPRD_PIN_INFO(19, GLOBAL_CTRL_PIN, 22, 1, 2),
44 SC9860_SIM0_SYS_SEL = SPRD_PIN_INFO(20, GLOBAL_CTRL_PIN, 21, 1, 2),
45 SC9860_CLK26MHZ_BUF_OUT_SEL = SPRD_PIN_INFO(21, GLOBAL_CTRL_PIN, 20, 1, 2),
46 SC9860_UART4_SYS_SEL = SPRD_PIN_INFO(22, GLOBAL_CTRL_PIN, 16, 3, 2),
47 SC9860_UART3_SYS_SEL = SPRD_PIN_INFO(23, GLOBAL_CTRL_PIN, 13, 3, 2),
48 SC9860_UART2_SYS_SEL = SPRD_PIN_INFO(24, GLOBAL_CTRL_PIN, 10, 3, 2),
49 SC9860_UART1_SYS_SEL = SPRD_PIN_INFO(25, GLOBAL_CTRL_PIN, 7, 3, 2),
50 SC9860_UART0_SYS_SEL = SPRD_PIN_INFO(26, GLOBAL_CTRL_PIN, 4, 3, 2),
51 SC9860_UART24_LOOP_SEL = SPRD_PIN_INFO(27, GLOBAL_CTRL_PIN, 3, 1, 2),
52 SC9860_UART23_LOOP_SEL = SPRD_PIN_INFO(28, GLOBAL_CTRL_PIN, 2, 1, 2),
53 SC9860_UART14_LOOP_SEL = SPRD_PIN_INFO(29, GLOBAL_CTRL_PIN, 1, 1, 2),
54 SC9860_UART13_LOOP_SEL = SPRD_PIN_INFO(30, GLOBAL_CTRL_PIN, 0, 1, 2),
55
56 /* pin global control register 3 */
57 SC9860_IIS3_SYS_SEL = SPRD_PIN_INFO(31, GLOBAL_CTRL_PIN, 18, 4, 3),
58 SC9860_IIS2_SYS_SEL = SPRD_PIN_INFO(32, GLOBAL_CTRL_PIN, 14, 4, 3),
59 SC9860_IIS1_SYS_SEL = SPRD_PIN_INFO(33, GLOBAL_CTRL_PIN, 10, 4, 3),
60 SC9860_IIS0_SYS_SEL = SPRD_PIN_INFO(34, GLOBAL_CTRL_PIN, 6, 4, 3),
61 SC9860_IIS23_LOOP_SEL = SPRD_PIN_INFO(35, GLOBAL_CTRL_PIN, 5, 1, 3),
62 SC9860_IIS13_LOOP_SEL = SPRD_PIN_INFO(36, GLOBAL_CTRL_PIN, 4, 1, 3),
63 SC9860_IIS12_LOOP_SEL = SPRD_PIN_INFO(37, GLOBAL_CTRL_PIN, 3, 1, 3),
64 SC9860_IIS03_LOOP_SEL = SPRD_PIN_INFO(38, GLOBAL_CTRL_PIN, 2, 1, 3),
65 SC9860_IIS02_LOOP_SEL = SPRD_PIN_INFO(39, GLOBAL_CTRL_PIN, 1, 1, 3),
66 SC9860_IIS01_LOOP_SEL = SPRD_PIN_INFO(40, GLOBAL_CTRL_PIN, 0, 1, 3),
67
68 /* pin global control register 4 */
69 SC9860_IIS6_SYS_SEL = SPRD_PIN_INFO(41, GLOBAL_CTRL_PIN, 27, 4, 4),
70 SC9860_IIS5_SYS_SEL = SPRD_PIN_INFO(42, GLOBAL_CTRL_PIN, 23, 4, 4),
71 SC9860_IIS4_SYS_SEL = SPRD_PIN_INFO(43, GLOBAL_CTRL_PIN, 19, 4, 4),
72 SC9860_I2C_INF6_SYS_SEL = SPRD_PIN_INFO(44, GLOBAL_CTRL_PIN, 8, 2, 4),
73 SC9860_I2C_INF4_SYS_SEL = SPRD_PIN_INFO(45, GLOBAL_CTRL_PIN, 6, 2, 4),
74 SC9860_I2C_INF2_SYS_SEL = SPRD_PIN_INFO(46, GLOBAL_CTRL_PIN, 4, 2, 4),
75 SC9860_I2C_INF1_SYS_SEL = SPRD_PIN_INFO(47, GLOBAL_CTRL_PIN, 2, 2, 4),
76 SC9860_I2C_INF0_SYS_SEL = SPRD_PIN_INFO(48, GLOBAL_CTRL_PIN, 0, 2, 4),
77
78 /* pin global control register 5 */
79 SC9860_GPIO_INF7_SYS_SEL = SPRD_PIN_INFO(49, GLOBAL_CTRL_PIN, 27, 1, 5),
80 SC9860_GPIO_INF6_SYS_SEL = SPRD_PIN_INFO(50, GLOBAL_CTRL_PIN, 26, 1, 5),
81 SC9860_GPIO_INF5_SYS_SEL = SPRD_PIN_INFO(51, GLOBAL_CTRL_PIN, 25, 1, 5),
82 SC9860_GPIO_INF4_SYS_SEL = SPRD_PIN_INFO(52, GLOBAL_CTRL_PIN, 24, 1, 5),
83 SC9860_GPIO_INF3_SYS_SEL = SPRD_PIN_INFO(53, GLOBAL_CTRL_PIN, 23, 1, 5),
84 SC9860_GPIO_INF2_SYS_SEL = SPRD_PIN_INFO(54, GLOBAL_CTRL_PIN, 22, 1, 5),
85 SC9860_GPIO_INF1_SYS_SEL = SPRD_PIN_INFO(55, GLOBAL_CTRL_PIN, 21, 1, 5),
86 SC9860_GPIO_INF0_SYS_SEL = SPRD_PIN_INFO(56, GLOBAL_CTRL_PIN, 20, 1, 5),
87 SC9860_WDRST_OUT_SEL = SPRD_PIN_INFO(57, GLOBAL_CTRL_PIN, 16, 3, 5),
88 SC9860_ADI_SYNC_PIN_OUT_SEL = SPRD_PIN_INFO(58, GLOBAL_CTRL_PIN, 14, 1, 5),
89 SC9860_CMRST_SEL = SPRD_PIN_INFO(59, GLOBAL_CTRL_PIN, 13, 1, 5),
90 SC9860_CMPD_SEL = SPRD_PIN_INFO(60, GLOBAL_CTRL_PIN, 12, 1, 5),
91 SC9860_TEST_DBG_MODE11 = SPRD_PIN_INFO(61, GLOBAL_CTRL_PIN, 11, 1, 5),
92 SC9860_TEST_DBG_MODE10 = SPRD_PIN_INFO(62, GLOBAL_CTRL_PIN, 10, 1, 5),
93 SC9860_TEST_DBG_MODE9 = SPRD_PIN_INFO(63, GLOBAL_CTRL_PIN, 9, 1, 5),
94 SC9860_TEST_DBG_MODE8 = SPRD_PIN_INFO(64, GLOBAL_CTRL_PIN, 8, 1, 5),
95 SC9860_TEST_DBG_MODE7 = SPRD_PIN_INFO(65, GLOBAL_CTRL_PIN, 7, 1, 5),
96 SC9860_TEST_DBG_MODE6 = SPRD_PIN_INFO(66, GLOBAL_CTRL_PIN, 6, 1, 5),
97 SC9860_TEST_DBG_MODE5 = SPRD_PIN_INFO(67, GLOBAL_CTRL_PIN, 5, 1, 5),
98 SC9860_TEST_DBG_MODE4 = SPRD_PIN_INFO(68, GLOBAL_CTRL_PIN, 4, 1, 5),
99 SC9860_TEST_DBG_MODE3 = SPRD_PIN_INFO(69, GLOBAL_CTRL_PIN, 3, 1, 5),
100 SC9860_TEST_DBG_MODE2 = SPRD_PIN_INFO(70, GLOBAL_CTRL_PIN, 2, 1, 5),
101 SC9860_TEST_DBG_MODE1 = SPRD_PIN_INFO(71, GLOBAL_CTRL_PIN, 1, 1, 5),
102 SC9860_TEST_DBG_MODE0 = SPRD_PIN_INFO(72, GLOBAL_CTRL_PIN, 0, 1, 5),
103
104 /* pin global control register 6 */
105 SC9860_SP_EIC_DPAD3_SEL = SPRD_PIN_INFO(73, GLOBAL_CTRL_PIN, 24, 8, 6),
106 SC9860_SP_EIC_DPAD2_SEL = SPRD_PIN_INFO(74, GLOBAL_CTRL_PIN, 16, 8, 6),
107 SC9860_SP_EIC_DPAD1_SEL = SPRD_PIN_INFO(75, GLOBAL_CTRL_PIN, 8, 8, 6),
108 SC9860_SP_EIC_DPAD0_SEL = SPRD_PIN_INFO(76, GLOBAL_CTRL_PIN, 0, 8, 6),
109
110 /* pin global control register 7 */
111 SC9860_SP_EIC_DPAD7_SEL = SPRD_PIN_INFO(77, GLOBAL_CTRL_PIN, 24, 8, 7),
112 SC9860_SP_EIC_DPAD6_SEL = SPRD_PIN_INFO(78, GLOBAL_CTRL_PIN, 16, 8, 7),
113 SC9860_SP_EIC_DPAD5_SEL = SPRD_PIN_INFO(79, GLOBAL_CTRL_PIN, 8, 8, 7),
114 SC9860_SP_EIC_DPAD4_SEL = SPRD_PIN_INFO(80, GLOBAL_CTRL_PIN, 0, 8, 7),
115
116 /* common pin registers definitions */
117 SC9860_RFCTL20 = SPRD_PIN_INFO(81, COMMON_PIN, 0, 0, 0),
118 SC9860_RFCTL21 = SPRD_PIN_INFO(83, COMMON_PIN, 0, 0, 0),
119 SC9860_RFCTL30 = SPRD_PIN_INFO(85, COMMON_PIN, 0, 0, 0),
120 SC9860_RFCTL31 = SPRD_PIN_INFO(87, COMMON_PIN, 0, 0, 0),
121 SC9860_RFCTL32 = SPRD_PIN_INFO(89, COMMON_PIN, 0, 0, 0),
122 SC9860_RFCTL33 = SPRD_PIN_INFO(91, COMMON_PIN, 0, 0, 0),
123 SC9860_RFCTL34 = SPRD_PIN_INFO(93, COMMON_PIN, 0, 0, 0),
124 SC9860_RFCTL35 = SPRD_PIN_INFO(95, COMMON_PIN, 0, 0, 0),
125 SC9860_RFCTL36 = SPRD_PIN_INFO(97, COMMON_PIN, 0, 0, 0),
126 SC9860_RFCTL37 = SPRD_PIN_INFO(99, COMMON_PIN, 0, 0, 0),
127 SC9860_RFCTL22 = SPRD_PIN_INFO(101, COMMON_PIN, 0, 0, 0),
128 SC9860_RFCTL23 = SPRD_PIN_INFO(103, COMMON_PIN, 0, 0, 0),
129 SC9860_RFCTL24 = SPRD_PIN_INFO(105, COMMON_PIN, 0, 0, 0),
130 SC9860_RFCTL25 = SPRD_PIN_INFO(107, COMMON_PIN, 0, 0, 0),
131 SC9860_RFCTL26 = SPRD_PIN_INFO(109, COMMON_PIN, 0, 0, 0),
132 SC9860_RFCTL27 = SPRD_PIN_INFO(111, COMMON_PIN, 0, 0, 0),
133 SC9860_RFCTL28 = SPRD_PIN_INFO(113, COMMON_PIN, 0, 0, 0),
134 SC9860_RFCTL29 = SPRD_PIN_INFO(115, COMMON_PIN, 0, 0, 0),
135 SC9860_SCL2 = SPRD_PIN_INFO(117, COMMON_PIN, 0, 0, 0),
136 SC9860_SDA2 = SPRD_PIN_INFO(119, COMMON_PIN, 0, 0, 0),
137 SC9860_MTCK_ARM = SPRD_PIN_INFO(121, COMMON_PIN, 0, 0, 0),
138 SC9860_MTMS_ARM = SPRD_PIN_INFO(123, COMMON_PIN, 0, 0, 0),
139 SC9860_XTL_EN0 = SPRD_PIN_INFO(125, COMMON_PIN, 0, 0, 0),
140 SC9860_PTEST = SPRD_PIN_INFO(127, COMMON_PIN, 0, 0, 0),
141 SC9860_AUD_DAD1 = SPRD_PIN_INFO(129, COMMON_PIN, 0, 0, 0),
142 SC9860_AUD_ADD0 = SPRD_PIN_INFO(131, COMMON_PIN, 0, 0, 0),
143 SC9860_AUD_ADSYNC = SPRD_PIN_INFO(133, COMMON_PIN, 0, 0, 0),
144 SC9860_AUD_SCLK = SPRD_PIN_INFO(135, COMMON_PIN, 0, 0, 0),
145 SC9860_CHIP_SLEEP = SPRD_PIN_INFO(137, COMMON_PIN, 0, 0, 0),
146 SC9860_CLK_32K = SPRD_PIN_INFO(139, COMMON_PIN, 0, 0, 0),
147 SC9860_DCDC_ARM_EN = SPRD_PIN_INFO(141, COMMON_PIN, 0, 0, 0),
148 SC9860_EXT_RST_B = SPRD_PIN_INFO(143, COMMON_PIN, 0, 0, 0),
149 SC9860_ADI_D = SPRD_PIN_INFO(145, COMMON_PIN, 0, 0, 0),
150 SC9860_ADI_SCLK = SPRD_PIN_INFO(147, COMMON_PIN, 0, 0, 0),
151 SC9860_XTL_EN1 = SPRD_PIN_INFO(149, COMMON_PIN, 0, 0, 0),
152 SC9860_ANA_INT = SPRD_PIN_INFO(151, COMMON_PIN, 0, 0, 0),
153 SC9860_AUD_DAD0 = SPRD_PIN_INFO(153, COMMON_PIN, 0, 0, 0),
154 SC9860_AUD_DASYNC = SPRD_PIN_INFO(155, COMMON_PIN, 0, 0, 0),
155 SC9860_LCM_RSTN = SPRD_PIN_INFO(157, COMMON_PIN, 0, 0, 0),
156 SC9860_DSI_TE = SPRD_PIN_INFO(159, COMMON_PIN, 0, 0, 0),
157 SC9860_PWMA = SPRD_PIN_INFO(161, COMMON_PIN, 0, 0, 0),
158 SC9860_EXTINT0 = SPRD_PIN_INFO(163, COMMON_PIN, 0, 0, 0),
159 SC9860_EXTINT1 = SPRD_PIN_INFO(165, COMMON_PIN, 0, 0, 0),
160 SC9860_SDA1 = SPRD_PIN_INFO(167, COMMON_PIN, 0, 0, 0),
161 SC9860_SCL1 = SPRD_PIN_INFO(169, COMMON_PIN, 0, 0, 0),
162 SC9860_SIMCLK2 = SPRD_PIN_INFO(171, COMMON_PIN, 0, 0, 0),
163 SC9860_SIMDA2 = SPRD_PIN_INFO(173, COMMON_PIN, 0, 0, 0),
164 SC9860_SIMRST2 = SPRD_PIN_INFO(175, COMMON_PIN, 0, 0, 0),
165 SC9860_SIMCLK1 = SPRD_PIN_INFO(177, COMMON_PIN, 0, 0, 0),
166 SC9860_SIMDA1 = SPRD_PIN_INFO(179, COMMON_PIN, 0, 0, 0),
167 SC9860_SIMRST1 = SPRD_PIN_INFO(181, COMMON_PIN, 0, 0, 0),
168 SC9860_SIMCLK0 = SPRD_PIN_INFO(183, COMMON_PIN, 0, 0, 0),
169 SC9860_SIMDA0 = SPRD_PIN_INFO(185, COMMON_PIN, 0, 0, 0),
170 SC9860_SIMRST0 = SPRD_PIN_INFO(187, COMMON_PIN, 0, 0, 0),
171 SC9860_SD2_CMD = SPRD_PIN_INFO(189, COMMON_PIN, 0, 0, 0),
172 SC9860_SD2_D0 = SPRD_PIN_INFO(191, COMMON_PIN, 0, 0, 0),
173 SC9860_SD2_D1 = SPRD_PIN_INFO(193, COMMON_PIN, 0, 0, 0),
174 SC9860_SD2_CLK = SPRD_PIN_INFO(195, COMMON_PIN, 0, 0, 0),
175 SC9860_SD2_D2 = SPRD_PIN_INFO(197, COMMON_PIN, 0, 0, 0),
176 SC9860_SD2_D3 = SPRD_PIN_INFO(199, COMMON_PIN, 0, 0, 0),
177 SC9860_SD0_D3 = SPRD_PIN_INFO(201, COMMON_PIN, 0, 0, 0),
178 SC9860_SD0_D2 = SPRD_PIN_INFO(203, COMMON_PIN, 0, 0, 0),
179 SC9860_SD0_CMD = SPRD_PIN_INFO(205, COMMON_PIN, 0, 0, 0),
180 SC9860_SD0_D0 = SPRD_PIN_INFO(207, COMMON_PIN, 0, 0, 0),
181 SC9860_SD0_D1 = SPRD_PIN_INFO(209, COMMON_PIN, 0, 0, 0),
182 SC9860_SD0_CLK = SPRD_PIN_INFO(211, COMMON_PIN, 0, 0, 0),
183 SC9860_EMMC_CMD_reserved = SPRD_PIN_INFO(213, COMMON_PIN, 0, 0, 0),
184 SC9860_EMMC_CMD = SPRD_PIN_INFO(215, COMMON_PIN, 0, 0, 0),
185 SC9860_EMMC_D6 = SPRD_PIN_INFO(217, COMMON_PIN, 0, 0, 0),
186 SC9860_EMMC_D7 = SPRD_PIN_INFO(219, COMMON_PIN, 0, 0, 0),
187 SC9860_EMMC_CLK = SPRD_PIN_INFO(221, COMMON_PIN, 0, 0, 0),
188 SC9860_EMMC_D5 = SPRD_PIN_INFO(223, COMMON_PIN, 0, 0, 0),
189 SC9860_EMMC_D4 = SPRD_PIN_INFO(225, COMMON_PIN, 0, 0, 0),
190 SC9860_EMMC_DS = SPRD_PIN_INFO(227, COMMON_PIN, 0, 0, 0),
191 SC9860_EMMC_D3_reserved = SPRD_PIN_INFO(229, COMMON_PIN, 0, 0, 0),
192 SC9860_EMMC_D3 = SPRD_PIN_INFO(231, COMMON_PIN, 0, 0, 0),
193 SC9860_EMMC_RST = SPRD_PIN_INFO(233, COMMON_PIN, 0, 0, 0),
194 SC9860_EMMC_D1 = SPRD_PIN_INFO(235, COMMON_PIN, 0, 0, 0),
195 SC9860_EMMC_D2 = SPRD_PIN_INFO(237, COMMON_PIN, 0, 0, 0),
196 SC9860_EMMC_D0 = SPRD_PIN_INFO(239, COMMON_PIN, 0, 0, 0),
197 SC9860_IIS0DI = SPRD_PIN_INFO(241, COMMON_PIN, 0, 0, 0),
198 SC9860_IIS0DO = SPRD_PIN_INFO(243, COMMON_PIN, 0, 0, 0),
199 SC9860_IIS0CLK = SPRD_PIN_INFO(245, COMMON_PIN, 0, 0, 0),
200 SC9860_IIS0LRCK = SPRD_PIN_INFO(247, COMMON_PIN, 0, 0, 0),
201 SC9860_SD1_CLK = SPRD_PIN_INFO(249, COMMON_PIN, 0, 0, 0),
202 SC9860_SD1_CMD = SPRD_PIN_INFO(251, COMMON_PIN, 0, 0, 0),
203 SC9860_SD1_D0 = SPRD_PIN_INFO(253, COMMON_PIN, 0, 0, 0),
204 SC9860_SD1_D1 = SPRD_PIN_INFO(255, COMMON_PIN, 0, 0, 0),
205 SC9860_SD1_D2 = SPRD_PIN_INFO(257, COMMON_PIN, 0, 0, 0),
206 SC9860_SD1_D3 = SPRD_PIN_INFO(259, COMMON_PIN, 0, 0, 0),
207 SC9860_CLK_AUX0 = SPRD_PIN_INFO(261, COMMON_PIN, 0, 0, 0),
208 SC9860_WIFI_COEXIST = SPRD_PIN_INFO(263, COMMON_PIN, 0, 0, 0),
209 SC9860_BEIDOU_COEXIST = SPRD_PIN_INFO(265, COMMON_PIN, 0, 0, 0),
210 SC9860_U3TXD = SPRD_PIN_INFO(267, COMMON_PIN, 0, 0, 0),
211 SC9860_U3RXD = SPRD_PIN_INFO(269, COMMON_PIN, 0, 0, 0),
212 SC9860_U3CTS = SPRD_PIN_INFO(271, COMMON_PIN, 0, 0, 0),
213 SC9860_U3RTS = SPRD_PIN_INFO(273, COMMON_PIN, 0, 0, 0),
214 SC9860_U0TXD = SPRD_PIN_INFO(275, COMMON_PIN, 0, 0, 0),
215 SC9860_U0RXD = SPRD_PIN_INFO(277, COMMON_PIN, 0, 0, 0),
216 SC9860_U0CTS = SPRD_PIN_INFO(279, COMMON_PIN, 0, 0, 0),
217 SC9860_U0RTS = SPRD_PIN_INFO(281, COMMON_PIN, 0, 0, 0),
218 SC9860_IIS1DI = SPRD_PIN_INFO(283, COMMON_PIN, 0, 0, 0),
219 SC9860_IIS1DO = SPRD_PIN_INFO(285, COMMON_PIN, 0, 0, 0),
220 SC9860_IIS1CLK = SPRD_PIN_INFO(287, COMMON_PIN, 0, 0, 0),
221 SC9860_IIS1LRCK = SPRD_PIN_INFO(289, COMMON_PIN, 0, 0, 0),
222 SC9860_SPI0_CSN = SPRD_PIN_INFO(291, COMMON_PIN, 0, 0, 0),
223 SC9860_SPI0_DO = SPRD_PIN_INFO(293, COMMON_PIN, 0, 0, 0),
224 SC9860_SPI0_DI = SPRD_PIN_INFO(295, COMMON_PIN, 0, 0, 0),
225 SC9860_SPI0_CLK = SPRD_PIN_INFO(297, COMMON_PIN, 0, 0, 0),
226 SC9860_U2TXD = SPRD_PIN_INFO(299, COMMON_PIN, 0, 0, 0),
227 SC9860_U2RXD = SPRD_PIN_INFO(301, COMMON_PIN, 0, 0, 0),
228 SC9860_U4TXD = SPRD_PIN_INFO(303, COMMON_PIN, 0, 0, 0),
229 SC9860_U4RXD = SPRD_PIN_INFO(305, COMMON_PIN, 0, 0, 0),
230 SC9860_CMMCLK1 = SPRD_PIN_INFO(307, COMMON_PIN, 0, 0, 0),
231 SC9860_CMRST1 = SPRD_PIN_INFO(309, COMMON_PIN, 0, 0, 0),
232 SC9860_CMMCLK0 = SPRD_PIN_INFO(311, COMMON_PIN, 0, 0, 0),
233 SC9860_CMRST0 = SPRD_PIN_INFO(313, COMMON_PIN, 0, 0, 0),
234 SC9860_CMPD0 = SPRD_PIN_INFO(315, COMMON_PIN, 0, 0, 0),
235 SC9860_CMPD1 = SPRD_PIN_INFO(317, COMMON_PIN, 0, 0, 0),
236 SC9860_SCL0 = SPRD_PIN_INFO(319, COMMON_PIN, 0, 0, 0),
237 SC9860_SDA0 = SPRD_PIN_INFO(321, COMMON_PIN, 0, 0, 0),
238 SC9860_SDA6 = SPRD_PIN_INFO(323, COMMON_PIN, 0, 0, 0),
239 SC9860_SCL6 = SPRD_PIN_INFO(325, COMMON_PIN, 0, 0, 0),
240 SC9860_U1TXD = SPRD_PIN_INFO(327, COMMON_PIN, 0, 0, 0),
241 SC9860_U1RXD = SPRD_PIN_INFO(329, COMMON_PIN, 0, 0, 0),
242 SC9860_KEYOUT0 = SPRD_PIN_INFO(331, COMMON_PIN, 0, 0, 0),
243 SC9860_KEYOUT1 = SPRD_PIN_INFO(333, COMMON_PIN, 0, 0, 0),
244 SC9860_KEYOUT2 = SPRD_PIN_INFO(335, COMMON_PIN, 0, 0, 0),
245 SC9860_KEYIN0 = SPRD_PIN_INFO(337, COMMON_PIN, 0, 0, 0),
246 SC9860_KEYIN1 = SPRD_PIN_INFO(339, COMMON_PIN, 0, 0, 0),
247 SC9860_KEYIN2 = SPRD_PIN_INFO(341, COMMON_PIN, 0, 0, 0),
248 SC9860_IIS3DI = SPRD_PIN_INFO(343, COMMON_PIN, 0, 0, 0),
249 SC9860_IIS3DO = SPRD_PIN_INFO(345, COMMON_PIN, 0, 0, 0),
250 SC9860_IIS3CLK = SPRD_PIN_INFO(347, COMMON_PIN, 0, 0, 0),
251 SC9860_IIS3LRCK = SPRD_PIN_INFO(349, COMMON_PIN, 0, 0, 0),
252 SC9860_RFCTL0 = SPRD_PIN_INFO(351, COMMON_PIN, 0, 0, 0),
253 SC9860_RFCTL1 = SPRD_PIN_INFO(353, COMMON_PIN, 0, 0, 0),
254 SC9860_RFCTL10 = SPRD_PIN_INFO(355, COMMON_PIN, 0, 0, 0),
255 SC9860_RFCTL11 = SPRD_PIN_INFO(357, COMMON_PIN, 0, 0, 0),
256 SC9860_RFCTL12 = SPRD_PIN_INFO(359, COMMON_PIN, 0, 0, 0),
257 SC9860_RFCTL13 = SPRD_PIN_INFO(361, COMMON_PIN, 0, 0, 0),
258 SC9860_RFCTL14 = SPRD_PIN_INFO(363, COMMON_PIN, 0, 0, 0),
259 SC9860_RFCTL15 = SPRD_PIN_INFO(365, COMMON_PIN, 0, 0, 0),
260 SC9860_RFCTL16 = SPRD_PIN_INFO(367, COMMON_PIN, 0, 0, 0),
261 SC9860_RFCTL17 = SPRD_PIN_INFO(369, COMMON_PIN, 0, 0, 0),
262 SC9860_RFCTL18 = SPRD_PIN_INFO(371, COMMON_PIN, 0, 0, 0),
263 SC9860_RFCTL19 = SPRD_PIN_INFO(373, COMMON_PIN, 0, 0, 0),
264 SC9860_RFCTL2 = SPRD_PIN_INFO(375, COMMON_PIN, 0, 0, 0),
265 SC9860_EXTINT5 = SPRD_PIN_INFO(377, COMMON_PIN, 0, 0, 0),
266 SC9860_EXTINT6 = SPRD_PIN_INFO(379, COMMON_PIN, 0, 0, 0),
267 SC9860_EXTINT7 = SPRD_PIN_INFO(381, COMMON_PIN, 0, 0, 0),
268 SC9860_GPIO30 = SPRD_PIN_INFO(383, COMMON_PIN, 0, 0, 0),
269 SC9860_GPIO31 = SPRD_PIN_INFO(385, COMMON_PIN, 0, 0, 0),
270 SC9860_GPIO32 = SPRD_PIN_INFO(387, COMMON_PIN, 0, 0, 0),
271 SC9860_GPIO33 = SPRD_PIN_INFO(389, COMMON_PIN, 0, 0, 0),
272 SC9860_GPIO34 = SPRD_PIN_INFO(391, COMMON_PIN, 0, 0, 0),
273 SC9860_RFCTL3 = SPRD_PIN_INFO(393, COMMON_PIN, 0, 0, 0),
274 SC9860_RFCTL4 = SPRD_PIN_INFO(395, COMMON_PIN, 0, 0, 0),
275 SC9860_RFCTL5 = SPRD_PIN_INFO(397, COMMON_PIN, 0, 0, 0),
276 SC9860_RFCTL6 = SPRD_PIN_INFO(399, COMMON_PIN, 0, 0, 0),
277 SC9860_RFCTL7 = SPRD_PIN_INFO(401, COMMON_PIN, 0, 0, 0),
278 SC9860_RFCTL8 = SPRD_PIN_INFO(403, COMMON_PIN, 0, 0, 0),
279 SC9860_RFCTL9 = SPRD_PIN_INFO(405, COMMON_PIN, 0, 0, 0),
280 SC9860_RFFE0_SCK0 = SPRD_PIN_INFO(407, COMMON_PIN, 0, 0, 0),
281 SC9860_GPIO38 = SPRD_PIN_INFO(409, COMMON_PIN, 0, 0, 0),
282 SC9860_RFFE0_SDA0 = SPRD_PIN_INFO(411, COMMON_PIN, 0, 0, 0),
283 SC9860_GPIO39 = SPRD_PIN_INFO(413, COMMON_PIN, 0, 0, 0),
284 SC9860_RFFE1_SCK0 = SPRD_PIN_INFO(415, COMMON_PIN, 0, 0, 0),
285 SC9860_GPIO181 = SPRD_PIN_INFO(417, COMMON_PIN, 0, 0, 0),
286 SC9860_RFFE1_SDA0 = SPRD_PIN_INFO(419, COMMON_PIN, 0, 0, 0),
287 SC9860_GPIO182 = SPRD_PIN_INFO(421, COMMON_PIN, 0, 0, 0),
288 SC9860_RF_LVDS0_ADC_ON = SPRD_PIN_INFO(423, COMMON_PIN, 0, 0, 0),
289 SC9860_RF_LVDS0_DAC_ON = SPRD_PIN_INFO(425, COMMON_PIN, 0, 0, 0),
290 SC9860_RFSCK0 = SPRD_PIN_INFO(427, COMMON_PIN, 0, 0, 0),
291 SC9860_RFSDA0 = SPRD_PIN_INFO(429, COMMON_PIN, 0, 0, 0),
292 SC9860_RFSEN0 = SPRD_PIN_INFO(431, COMMON_PIN, 0, 0, 0),
293 SC9860_RF_LVDS1_ADC_ON = SPRD_PIN_INFO(433, COMMON_PIN, 0, 0, 0),
294 SC9860_RF_LVDS1_DAC_ON = SPRD_PIN_INFO(435, COMMON_PIN, 0, 0, 0),
295 SC9860_RFSCK1 = SPRD_PIN_INFO(437, COMMON_PIN, 0, 0, 0),
296 SC9860_RFSDA1 = SPRD_PIN_INFO(439, COMMON_PIN, 0, 0, 0),
297 SC9860_RFSEN1 = SPRD_PIN_INFO(441, COMMON_PIN, 0, 0, 0),
298 SC9860_RFCTL38 = SPRD_PIN_INFO(443, COMMON_PIN, 0, 0, 0),
299 SC9860_RFCTL39 = SPRD_PIN_INFO(445, COMMON_PIN, 0, 0, 0),
300
301 /* MSIC pin registers definitions */
302 SC9860_RFCTL20_MISC = SPRD_PIN_INFO(82, MISC_PIN, 0, 0, 0),
303 SC9860_RFCTL21_MISC = SPRD_PIN_INFO(84, MISC_PIN, 0, 0, 0),
304 SC9860_RFCTL30_MISC = SPRD_PIN_INFO(86, MISC_PIN, 0, 0, 0),
305 SC9860_RFCTL31_MISC = SPRD_PIN_INFO(88, MISC_PIN, 0, 0, 0),
306 SC9860_RFCTL32_MISC = SPRD_PIN_INFO(90, MISC_PIN, 0, 0, 0),
307 SC9860_RFCTL33_MISC = SPRD_PIN_INFO(92, MISC_PIN, 0, 0, 0),
308 SC9860_RFCTL34_MISC = SPRD_PIN_INFO(94, MISC_PIN, 0, 0, 0),
309 SC9860_RFCTL35_MISC = SPRD_PIN_INFO(96, MISC_PIN, 0, 0, 0),
310 SC9860_RFCTL36_MISC = SPRD_PIN_INFO(98, MISC_PIN, 0, 0, 0),
311 SC9860_RFCTL37_MISC = SPRD_PIN_INFO(100, MISC_PIN, 0, 0, 0),
312 SC9860_RFCTL22_MISC = SPRD_PIN_INFO(102, MISC_PIN, 0, 0, 0),
313 SC9860_RFCTL23_MISC = SPRD_PIN_INFO(104, MISC_PIN, 0, 0, 0),
314 SC9860_RFCTL24_MISC = SPRD_PIN_INFO(106, MISC_PIN, 0, 0, 0),
315 SC9860_RFCTL25_MISC = SPRD_PIN_INFO(108, MISC_PIN, 0, 0, 0),
316 SC9860_RFCTL26_MISC = SPRD_PIN_INFO(110, MISC_PIN, 0, 0, 0),
317 SC9860_RFCTL27_MISC = SPRD_PIN_INFO(112, MISC_PIN, 0, 0, 0),
318 SC9860_RFCTL28_MISC = SPRD_PIN_INFO(114, MISC_PIN, 0, 0, 0),
319 SC9860_RFCTL29_MISC = SPRD_PIN_INFO(116, MISC_PIN, 0, 0, 0),
320 SC9860_SCL2_MISC = SPRD_PIN_INFO(118, MISC_PIN, 0, 0, 0),
321 SC9860_SDA2_MISC = SPRD_PIN_INFO(120, MISC_PIN, 0, 0, 0),
322 SC9860_MTCK_ARM_MISC = SPRD_PIN_INFO(122, MISC_PIN, 0, 0, 0),
323 SC9860_MTMS_ARM_MISC = SPRD_PIN_INFO(124, MISC_PIN, 0, 0, 0),
324 SC9860_XTL_EN0_MISC = SPRD_PIN_INFO(126, MISC_PIN, 0, 0, 0),
325 SC9860_PTEST_MISC = SPRD_PIN_INFO(128, MISC_PIN, 0, 0, 0),
326 SC9860_AUD_DAD1_MISC = SPRD_PIN_INFO(130, MISC_PIN, 0, 0, 0),
327 SC9860_AUD_ADD0_MISC = SPRD_PIN_INFO(132, MISC_PIN, 0, 0, 0),
328 SC9860_AUD_ADSYNC_MISC = SPRD_PIN_INFO(134, MISC_PIN, 0, 0, 0),
329 SC9860_AUD_SCLK_MISC = SPRD_PIN_INFO(136, MISC_PIN, 0, 0, 0),
330 SC9860_CHIP_SLEEP_MISC = SPRD_PIN_INFO(138, MISC_PIN, 0, 0, 0),
331 SC9860_CLK_32K_MISC = SPRD_PIN_INFO(140, MISC_PIN, 0, 0, 0),
332 SC9860_DCDC_ARM_EN_MISC = SPRD_PIN_INFO(142, MISC_PIN, 0, 0, 0),
333 SC9860_EXT_RST_B_MISC = SPRD_PIN_INFO(144, MISC_PIN, 0, 0, 0),
334 SC9860_ADI_D_MISC = SPRD_PIN_INFO(146, MISC_PIN, 0, 0, 0),
335 SC9860_ADI_SCLK_MISC = SPRD_PIN_INFO(148, MISC_PIN, 0, 0, 0),
336 SC9860_XTL_EN1_MISC = SPRD_PIN_INFO(150, MISC_PIN, 0, 0, 0),
337 SC9860_ANA_INT_MISC = SPRD_PIN_INFO(152, MISC_PIN, 0, 0, 0),
338 SC9860_AUD_DAD0_MISC = SPRD_PIN_INFO(154, MISC_PIN, 0, 0, 0),
339 SC9860_AUD_DASYNC_MISC = SPRD_PIN_INFO(156, MISC_PIN, 0, 0, 0),
340 SC9860_LCM_RSTN_MISC = SPRD_PIN_INFO(158, MISC_PIN, 0, 0, 0),
341 SC9860_DSI_TE_MISC = SPRD_PIN_INFO(160, MISC_PIN, 0, 0, 0),
342 SC9860_PWMA_MISC = SPRD_PIN_INFO(162, MISC_PIN, 0, 0, 0),
343 SC9860_EXTINT0_MISC = SPRD_PIN_INFO(164, MISC_PIN, 0, 0, 0),
344 SC9860_EXTINT1_MISC = SPRD_PIN_INFO(166, MISC_PIN, 0, 0, 0),
345 SC9860_SDA1_MISC = SPRD_PIN_INFO(168, MISC_PIN, 0, 0, 0),
346 SC9860_SCL1_MISC = SPRD_PIN_INFO(170, MISC_PIN, 0, 0, 0),
347 SC9860_SIMCLK2_MISC = SPRD_PIN_INFO(172, MISC_PIN, 0, 0, 0),
348 SC9860_SIMDA2_MISC = SPRD_PIN_INFO(174, MISC_PIN, 0, 0, 0),
349 SC9860_SIMRST2_MISC = SPRD_PIN_INFO(176, MISC_PIN, 0, 0, 0),
350 SC9860_SIMCLK1_MISC = SPRD_PIN_INFO(178, MISC_PIN, 0, 0, 0),
351 SC9860_SIMDA1_MISC = SPRD_PIN_INFO(180, MISC_PIN, 0, 0, 0),
352 SC9860_SIMRST1_MISC = SPRD_PIN_INFO(182, MISC_PIN, 0, 0, 0),
353 SC9860_SIMCLK0_MISC = SPRD_PIN_INFO(184, MISC_PIN, 0, 0, 0),
354 SC9860_SIMDA0_MISC = SPRD_PIN_INFO(186, MISC_PIN, 0, 0, 0),
355 SC9860_SIMRST0_MISC = SPRD_PIN_INFO(188, MISC_PIN, 0, 0, 0),
356 SC9860_SD2_CMD_MISC = SPRD_PIN_INFO(190, MISC_PIN, 0, 0, 0),
357 SC9860_SD2_D0_MISC = SPRD_PIN_INFO(192, MISC_PIN, 0, 0, 0),
358 SC9860_SD2_D1_MISC = SPRD_PIN_INFO(194, MISC_PIN, 0, 0, 0),
359 SC9860_SD2_CLK_MISC = SPRD_PIN_INFO(196, MISC_PIN, 0, 0, 0),
360 SC9860_SD2_D2_MISC = SPRD_PIN_INFO(198, MISC_PIN, 0, 0, 0),
361 SC9860_SD2_D3_MISC = SPRD_PIN_INFO(200, MISC_PIN, 0, 0, 0),
362 SC9860_SD0_D3_MISC = SPRD_PIN_INFO(202, MISC_PIN, 0, 0, 0),
363 SC9860_SD0_D2_MISC = SPRD_PIN_INFO(204, MISC_PIN, 0, 0, 0),
364 SC9860_SD0_CMD_MISC = SPRD_PIN_INFO(206, MISC_PIN, 0, 0, 0),
365 SC9860_SD0_D0_MISC = SPRD_PIN_INFO(208, MISC_PIN, 0, 0, 0),
366 SC9860_SD0_D1_MISC = SPRD_PIN_INFO(210, MISC_PIN, 0, 0, 0),
367 SC9860_SD0_CLK_MISC = SPRD_PIN_INFO(212, MISC_PIN, 0, 0, 0),
368 SC9860_EMMC_CMD_reserved_MISC = SPRD_PIN_INFO(214, MISC_PIN, 0, 0, 0),
369 SC9860_EMMC_CMD_MISC = SPRD_PIN_INFO(216, MISC_PIN, 0, 0, 0),
370 SC9860_EMMC_D6_MISC = SPRD_PIN_INFO(218, MISC_PIN, 0, 0, 0),
371 SC9860_EMMC_D7_MISC = SPRD_PIN_INFO(220, MISC_PIN, 0, 0, 0),
372 SC9860_EMMC_CLK_MISC = SPRD_PIN_INFO(222, MISC_PIN, 0, 0, 0),
373 SC9860_EMMC_D5_MISC = SPRD_PIN_INFO(224, MISC_PIN, 0, 0, 0),
374 SC9860_EMMC_D4_MISC = SPRD_PIN_INFO(226, MISC_PIN, 0, 0, 0),
375 SC9860_EMMC_DS_MISC = SPRD_PIN_INFO(228, MISC_PIN, 0, 0, 0),
376 SC9860_EMMC_D3_reserved_MISC = SPRD_PIN_INFO(230, MISC_PIN, 0, 0, 0),
377 SC9860_EMMC_D3_MISC = SPRD_PIN_INFO(232, MISC_PIN, 0, 0, 0),
378 SC9860_EMMC_RST_MISC = SPRD_PIN_INFO(234, MISC_PIN, 0, 0, 0),
379 SC9860_EMMC_D1_MISC = SPRD_PIN_INFO(236, MISC_PIN, 0, 0, 0),
380 SC9860_EMMC_D2_MISC = SPRD_PIN_INFO(238, MISC_PIN, 0, 0, 0),
381 SC9860_EMMC_D0_MISC = SPRD_PIN_INFO(240, MISC_PIN, 0, 0, 0),
382 SC9860_IIS0DI_MISC = SPRD_PIN_INFO(242, MISC_PIN, 0, 0, 0),
383 SC9860_IIS0DO_MISC = SPRD_PIN_INFO(244, MISC_PIN, 0, 0, 0),
384 SC9860_IIS0CLK_MISC = SPRD_PIN_INFO(246, MISC_PIN, 0, 0, 0),
385 SC9860_IIS0LRCK_MISC = SPRD_PIN_INFO(248, MISC_PIN, 0, 0, 0),
386 SC9860_SD1_CLK_MISC = SPRD_PIN_INFO(250, MISC_PIN, 0, 0, 0),
387 SC9860_SD1_CMD_MISC = SPRD_PIN_INFO(252, MISC_PIN, 0, 0, 0),
388 SC9860_SD1_D0_MISC = SPRD_PIN_INFO(254, MISC_PIN, 0, 0, 0),
389 SC9860_SD1_D1_MISC = SPRD_PIN_INFO(256, MISC_PIN, 0, 0, 0),
390 SC9860_SD1_D2_MISC = SPRD_PIN_INFO(258, MISC_PIN, 0, 0, 0),
391 SC9860_SD1_D3_MISC = SPRD_PIN_INFO(260, MISC_PIN, 0, 0, 0),
392 SC9860_CLK_AUX0_MISC = SPRD_PIN_INFO(262, MISC_PIN, 0, 0, 0),
393 SC9860_WIFI_COEXIST_MISC = SPRD_PIN_INFO(264, MISC_PIN, 0, 0, 0),
394 SC9860_BEIDOU_COEXIST_MISC = SPRD_PIN_INFO(266, MISC_PIN, 0, 0, 0),
395 SC9860_U3TXD_MISC = SPRD_PIN_INFO(268, MISC_PIN, 0, 0, 0),
396 SC9860_U3RXD_MISC = SPRD_PIN_INFO(270, MISC_PIN, 0, 0, 0),
397 SC9860_U3CTS_MISC = SPRD_PIN_INFO(272, MISC_PIN, 0, 0, 0),
398 SC9860_U3RTS_MISC = SPRD_PIN_INFO(274, MISC_PIN, 0, 0, 0),
399 SC9860_U0TXD_MISC = SPRD_PIN_INFO(276, MISC_PIN, 0, 0, 0),
400 SC9860_U0RXD_MISC = SPRD_PIN_INFO(278, MISC_PIN, 0, 0, 0),
401 SC9860_U0CTS_MISC = SPRD_PIN_INFO(280, MISC_PIN, 0, 0, 0),
402 SC9860_U0RTS_MISC = SPRD_PIN_INFO(282, MISC_PIN, 0, 0, 0),
403 SC9860_IIS1DI_MISC = SPRD_PIN_INFO(284, MISC_PIN, 0, 0, 0),
404 SC9860_IIS1DO_MISC = SPRD_PIN_INFO(286, MISC_PIN, 0, 0, 0),
405 SC9860_IIS1CLK_MISC = SPRD_PIN_INFO(288, MISC_PIN, 0, 0, 0),
406 SC9860_IIS1LRCK_MISC = SPRD_PIN_INFO(290, MISC_PIN, 0, 0, 0),
407 SC9860_SPI0_CSN_MISC = SPRD_PIN_INFO(292, MISC_PIN, 0, 0, 0),
408 SC9860_SPI0_DO_MISC = SPRD_PIN_INFO(294, MISC_PIN, 0, 0, 0),
409 SC9860_SPI0_DI_MISC = SPRD_PIN_INFO(296, MISC_PIN, 0, 0, 0),
410 SC9860_SPI0_CLK_MISC = SPRD_PIN_INFO(298, MISC_PIN, 0, 0, 0),
411 SC9860_U2TXD_MISC = SPRD_PIN_INFO(300, MISC_PIN, 0, 0, 0),
412 SC9860_U2RXD_MISC = SPRD_PIN_INFO(302, MISC_PIN, 0, 0, 0),
413 SC9860_U4TXD_MISC = SPRD_PIN_INFO(304, MISC_PIN, 0, 0, 0),
414 SC9860_U4RXD_MISC = SPRD_PIN_INFO(306, MISC_PIN, 0, 0, 0),
415 SC9860_CMMCLK1_MISC = SPRD_PIN_INFO(308, MISC_PIN, 0, 0, 0),
416 SC9860_CMRST1_MISC = SPRD_PIN_INFO(310, MISC_PIN, 0, 0, 0),
417 SC9860_CMMCLK0_MISC = SPRD_PIN_INFO(312, MISC_PIN, 0, 0, 0),
418 SC9860_CMRST0_MISC = SPRD_PIN_INFO(314, MISC_PIN, 0, 0, 0),
419 SC9860_CMPD0_MISC = SPRD_PIN_INFO(316, MISC_PIN, 0, 0, 0),
420 SC9860_CMPD1_MISC = SPRD_PIN_INFO(318, MISC_PIN, 0, 0, 0),
421 SC9860_SCL0_MISC = SPRD_PIN_INFO(320, MISC_PIN, 0, 0, 0),
422 SC9860_SDA0_MISC = SPRD_PIN_INFO(322, MISC_PIN, 0, 0, 0),
423 SC9860_SDA6_MISC = SPRD_PIN_INFO(324, MISC_PIN, 0, 0, 0),
424 SC9860_SCL6_MISC = SPRD_PIN_INFO(326, MISC_PIN, 0, 0, 0),
425 SC9860_U1TXD_MISC = SPRD_PIN_INFO(328, MISC_PIN, 0, 0, 0),
426 SC9860_U1RXD_MISC = SPRD_PIN_INFO(330, MISC_PIN, 0, 0, 0),
427 SC9860_KEYOUT0_MISC = SPRD_PIN_INFO(332, MISC_PIN, 0, 0, 0),
428 SC9860_KEYOUT1_MISC = SPRD_PIN_INFO(334, MISC_PIN, 0, 0, 0),
429 SC9860_KEYOUT2_MISC = SPRD_PIN_INFO(336, MISC_PIN, 0, 0, 0),
430 SC9860_KEYIN0_MISC = SPRD_PIN_INFO(338, MISC_PIN, 0, 0, 0),
431 SC9860_KEYIN1_MISC = SPRD_PIN_INFO(340, MISC_PIN, 0, 0, 0),
432 SC9860_KEYIN2_MISC = SPRD_PIN_INFO(342, MISC_PIN, 0, 0, 0),
433 SC9860_IIS3DI_MISC = SPRD_PIN_INFO(344, MISC_PIN, 0, 0, 0),
434 SC9860_IIS3DO_MISC = SPRD_PIN_INFO(346, MISC_PIN, 0, 0, 0),
435 SC9860_IIS3CLK_MISC = SPRD_PIN_INFO(348, MISC_PIN, 0, 0, 0),
436 SC9860_IIS3LRCK_MISC = SPRD_PIN_INFO(350, MISC_PIN, 0, 0, 0),
437 SC9860_RFCTL0_MISC = SPRD_PIN_INFO(352, MISC_PIN, 0, 0, 0),
438 SC9860_RFCTL1_MISC = SPRD_PIN_INFO(354, MISC_PIN, 0, 0, 0),
439 SC9860_RFCTL10_MISC = SPRD_PIN_INFO(356, MISC_PIN, 0, 0, 0),
440 SC9860_RFCTL11_MISC = SPRD_PIN_INFO(358, MISC_PIN, 0, 0, 0),
441 SC9860_RFCTL12_MISC = SPRD_PIN_INFO(360, MISC_PIN, 0, 0, 0),
442 SC9860_RFCTL13_MISC = SPRD_PIN_INFO(362, MISC_PIN, 0, 0, 0),
443 SC9860_RFCTL14_MISC = SPRD_PIN_INFO(364, MISC_PIN, 0, 0, 0),
444 SC9860_RFCTL15_MISC = SPRD_PIN_INFO(366, MISC_PIN, 0, 0, 0),
445 SC9860_RFCTL16_MISC = SPRD_PIN_INFO(368, MISC_PIN, 0, 0, 0),
446 SC9860_RFCTL17_MISC = SPRD_PIN_INFO(370, MISC_PIN, 0, 0, 0),
447 SC9860_RFCTL18_MISC = SPRD_PIN_INFO(372, MISC_PIN, 0, 0, 0),
448 SC9860_RFCTL19_MISC = SPRD_PIN_INFO(374, MISC_PIN, 0, 0, 0),
449 SC9860_RFCTL2_MISC = SPRD_PIN_INFO(376, MISC_PIN, 0, 0, 0),
450 SC9860_EXTINT5_MISC = SPRD_PIN_INFO(378, MISC_PIN, 0, 0, 0),
451 SC9860_EXTINT6_MISC = SPRD_PIN_INFO(380, MISC_PIN, 0, 0, 0),
452 SC9860_EXTINT7_MISC = SPRD_PIN_INFO(382, MISC_PIN, 0, 0, 0),
453 SC9860_GPIO30_MISC = SPRD_PIN_INFO(384, MISC_PIN, 0, 0, 0),
454 SC9860_GPIO31_MISC = SPRD_PIN_INFO(386, MISC_PIN, 0, 0, 0),
455 SC9860_GPIO32_MISC = SPRD_PIN_INFO(388, MISC_PIN, 0, 0, 0),
456 SC9860_GPIO33_MISC = SPRD_PIN_INFO(390, MISC_PIN, 0, 0, 0),
457 SC9860_GPIO34_MISC = SPRD_PIN_INFO(392, MISC_PIN, 0, 0, 0),
458 SC9860_RFCTL3_MISC = SPRD_PIN_INFO(394, MISC_PIN, 0, 0, 0),
459 SC9860_RFCTL4_MISC = SPRD_PIN_INFO(396, MISC_PIN, 0, 0, 0),
460 SC9860_RFCTL5_MISC = SPRD_PIN_INFO(398, MISC_PIN, 0, 0, 0),
461 SC9860_RFCTL6_MISC = SPRD_PIN_INFO(400, MISC_PIN, 0, 0, 0),
462 SC9860_RFCTL7_MISC = SPRD_PIN_INFO(402, MISC_PIN, 0, 0, 0),
463 SC9860_RFCTL8_MISC = SPRD_PIN_INFO(404, MISC_PIN, 0, 0, 0),
464 SC9860_RFCTL9_MISC = SPRD_PIN_INFO(406, MISC_PIN, 0, 0, 0),
465 SC9860_RFFE0_SCK0_MISC = SPRD_PIN_INFO(408, MISC_PIN, 0, 0, 0),
466 SC9860_GPIO38_MISC = SPRD_PIN_INFO(410, MISC_PIN, 0, 0, 0),
467 SC9860_RFFE0_SDA0_MISC = SPRD_PIN_INFO(412, MISC_PIN, 0, 0, 0),
468 SC9860_GPIO39_MISC = SPRD_PIN_INFO(414, MISC_PIN, 0, 0, 0),
469 SC9860_RFFE1_SCK0_MISC = SPRD_PIN_INFO(416, MISC_PIN, 0, 0, 0),
470 SC9860_GPIO181_MISC = SPRD_PIN_INFO(418, MISC_PIN, 0, 0, 0),
471 SC9860_RFFE1_SDA0_MISC = SPRD_PIN_INFO(420, MISC_PIN, 0, 0, 0),
472 SC9860_GPIO182_MISC = SPRD_PIN_INFO(422, MISC_PIN, 0, 0, 0),
473 SC9860_RF_LVDS0_ADC_ON_MISC = SPRD_PIN_INFO(424, MISC_PIN, 0, 0, 0),
474 SC9860_RF_LVDS0_DAC_ON_MISC = SPRD_PIN_INFO(426, MISC_PIN, 0, 0, 0),
475 SC9860_RFSCK0_MISC = SPRD_PIN_INFO(428, MISC_PIN, 0, 0, 0),
476 SC9860_RFSDA0_MISC = SPRD_PIN_INFO(430, MISC_PIN, 0, 0, 0),
477 SC9860_RFSEN0_MISC = SPRD_PIN_INFO(432, MISC_PIN, 0, 0, 0),
478 SC9860_RF_LVDS1_ADC_ON_MISC = SPRD_PIN_INFO(434, MISC_PIN, 0, 0, 0),
479 SC9860_RF_LVDS1_DAC_ON_MISC = SPRD_PIN_INFO(436, MISC_PIN, 0, 0, 0),
480 SC9860_RFSCK1_MISC = SPRD_PIN_INFO(438, MISC_PIN, 0, 0, 0),
481 SC9860_RFSDA1_MISC = SPRD_PIN_INFO(440, MISC_PIN, 0, 0, 0),
482 SC9860_RFSEN1_MISC = SPRD_PIN_INFO(442, MISC_PIN, 0, 0, 0),
483 SC9860_RFCTL38_MISC = SPRD_PIN_INFO(444, MISC_PIN, 0, 0, 0),
484 SC9860_RFCTL39_MISC = SPRD_PIN_INFO(446, MISC_PIN, 0, 0, 0),
485};
486
487static struct sprd_pins_info sprd_sc9860_pins_info[] = {
488 SPRD_PINCTRL_PIN(SC9860_VIO28_0_IRTE),
489 SPRD_PINCTRL_PIN(SC9860_VIO_SD2_IRTE),
490 SPRD_PINCTRL_PIN(SC9860_VIO_SD0_IRTE),
491 SPRD_PINCTRL_PIN(SC9860_VIO_SIM2_IRTE),
492 SPRD_PINCTRL_PIN(SC9860_VIO_SIM1_IRTE),
493 SPRD_PINCTRL_PIN(SC9860_VIO_SIM0_IRTE),
494 SPRD_PINCTRL_PIN(SC9860_VIO28_0_MS),
495 SPRD_PINCTRL_PIN(SC9860_VIO_SD2_MS),
496 SPRD_PINCTRL_PIN(SC9860_VIO_SD0_MS),
497 SPRD_PINCTRL_PIN(SC9860_VIO_SIM2_MS),
498 SPRD_PINCTRL_PIN(SC9860_VIO_SIM1_MS),
499 SPRD_PINCTRL_PIN(SC9860_VIO_SIM0_MS),
500 SPRD_PINCTRL_PIN(SC9860_SPSPI_PIN_IN_SEL),
501 SPRD_PINCTRL_PIN(SC9860_UART1_USB30_PHY_SEL),
502 SPRD_PINCTRL_PIN(SC9860_USB30_PHY_DM_OE),
503 SPRD_PINCTRL_PIN(SC9860_USB30_PHY_DP_OE),
504 SPRD_PINCTRL_PIN(SC9860_UART5_SYS_SEL),
505 SPRD_PINCTRL_PIN(SC9860_ORP_URXD_PIN_IN_SEL),
506 SPRD_PINCTRL_PIN(SC9860_SIM2_SYS_SEL),
507 SPRD_PINCTRL_PIN(SC9860_SIM1_SYS_SEL),
508 SPRD_PINCTRL_PIN(SC9860_SIM0_SYS_SEL),
509 SPRD_PINCTRL_PIN(SC9860_CLK26MHZ_BUF_OUT_SEL),
510 SPRD_PINCTRL_PIN(SC9860_UART4_SYS_SEL),
511 SPRD_PINCTRL_PIN(SC9860_UART3_SYS_SEL),
512 SPRD_PINCTRL_PIN(SC9860_UART2_SYS_SEL),
513 SPRD_PINCTRL_PIN(SC9860_UART1_SYS_SEL),
514 SPRD_PINCTRL_PIN(SC9860_UART0_SYS_SEL),
515 SPRD_PINCTRL_PIN(SC9860_UART24_LOOP_SEL),
516 SPRD_PINCTRL_PIN(SC9860_UART23_LOOP_SEL),
517 SPRD_PINCTRL_PIN(SC9860_UART14_LOOP_SEL),
518 SPRD_PINCTRL_PIN(SC9860_UART13_LOOP_SEL),
519 SPRD_PINCTRL_PIN(SC9860_IIS3_SYS_SEL),
520 SPRD_PINCTRL_PIN(SC9860_IIS2_SYS_SEL),
521 SPRD_PINCTRL_PIN(SC9860_IIS1_SYS_SEL),
522 SPRD_PINCTRL_PIN(SC9860_IIS0_SYS_SEL),
523 SPRD_PINCTRL_PIN(SC9860_IIS23_LOOP_SEL),
524 SPRD_PINCTRL_PIN(SC9860_IIS13_LOOP_SEL),
525 SPRD_PINCTRL_PIN(SC9860_IIS12_LOOP_SEL),
526 SPRD_PINCTRL_PIN(SC9860_IIS03_LOOP_SEL),
527 SPRD_PINCTRL_PIN(SC9860_IIS02_LOOP_SEL),
528 SPRD_PINCTRL_PIN(SC9860_IIS01_LOOP_SEL),
529 SPRD_PINCTRL_PIN(SC9860_IIS6_SYS_SEL),
530 SPRD_PINCTRL_PIN(SC9860_IIS5_SYS_SEL),
531 SPRD_PINCTRL_PIN(SC9860_IIS4_SYS_SEL),
532 SPRD_PINCTRL_PIN(SC9860_I2C_INF6_SYS_SEL),
533 SPRD_PINCTRL_PIN(SC9860_I2C_INF4_SYS_SEL),
534 SPRD_PINCTRL_PIN(SC9860_I2C_INF2_SYS_SEL),
535 SPRD_PINCTRL_PIN(SC9860_I2C_INF1_SYS_SEL),
536 SPRD_PINCTRL_PIN(SC9860_I2C_INF0_SYS_SEL),
537 SPRD_PINCTRL_PIN(SC9860_GPIO_INF7_SYS_SEL),
538 SPRD_PINCTRL_PIN(SC9860_GPIO_INF6_SYS_SEL),
539 SPRD_PINCTRL_PIN(SC9860_GPIO_INF5_SYS_SEL),
540 SPRD_PINCTRL_PIN(SC9860_GPIO_INF4_SYS_SEL),
541 SPRD_PINCTRL_PIN(SC9860_GPIO_INF3_SYS_SEL),
542 SPRD_PINCTRL_PIN(SC9860_GPIO_INF2_SYS_SEL),
543 SPRD_PINCTRL_PIN(SC9860_GPIO_INF1_SYS_SEL),
544 SPRD_PINCTRL_PIN(SC9860_GPIO_INF0_SYS_SEL),
545 SPRD_PINCTRL_PIN(SC9860_WDRST_OUT_SEL),
546 SPRD_PINCTRL_PIN(SC9860_ADI_SYNC_PIN_OUT_SEL),
547 SPRD_PINCTRL_PIN(SC9860_CMRST_SEL),
548 SPRD_PINCTRL_PIN(SC9860_CMPD_SEL),
549 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE11),
550 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE10),
551 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE9),
552 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE8),
553 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE7),
554 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE6),
555 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE5),
556 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE4),
557 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE3),
558 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE2),
559 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE1),
560 SPRD_PINCTRL_PIN(SC9860_TEST_DBG_MODE0),
561 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD3_SEL),
562 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD2_SEL),
563 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD1_SEL),
564 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD0_SEL),
565 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD7_SEL),
566 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD6_SEL),
567 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD5_SEL),
568 SPRD_PINCTRL_PIN(SC9860_SP_EIC_DPAD4_SEL),
569 SPRD_PINCTRL_PIN(SC9860_RFCTL20),
570 SPRD_PINCTRL_PIN(SC9860_RFCTL21),
571 SPRD_PINCTRL_PIN(SC9860_RFCTL30),
572 SPRD_PINCTRL_PIN(SC9860_RFCTL31),
573 SPRD_PINCTRL_PIN(SC9860_RFCTL32),
574 SPRD_PINCTRL_PIN(SC9860_RFCTL33),
575 SPRD_PINCTRL_PIN(SC9860_RFCTL34),
576 SPRD_PINCTRL_PIN(SC9860_RFCTL35),
577 SPRD_PINCTRL_PIN(SC9860_RFCTL36),
578 SPRD_PINCTRL_PIN(SC9860_RFCTL37),
579 SPRD_PINCTRL_PIN(SC9860_RFCTL22),
580 SPRD_PINCTRL_PIN(SC9860_RFCTL23),
581 SPRD_PINCTRL_PIN(SC9860_RFCTL24),
582 SPRD_PINCTRL_PIN(SC9860_RFCTL25),
583 SPRD_PINCTRL_PIN(SC9860_RFCTL26),
584 SPRD_PINCTRL_PIN(SC9860_RFCTL27),
585 SPRD_PINCTRL_PIN(SC9860_RFCTL28),
586 SPRD_PINCTRL_PIN(SC9860_RFCTL29),
587 SPRD_PINCTRL_PIN(SC9860_SCL2),
588 SPRD_PINCTRL_PIN(SC9860_SDA2),
589 SPRD_PINCTRL_PIN(SC9860_MTCK_ARM),
590 SPRD_PINCTRL_PIN(SC9860_MTMS_ARM),
591 SPRD_PINCTRL_PIN(SC9860_XTL_EN0),
592 SPRD_PINCTRL_PIN(SC9860_PTEST),
593 SPRD_PINCTRL_PIN(SC9860_AUD_DAD1),
594 SPRD_PINCTRL_PIN(SC9860_AUD_ADD0),
595 SPRD_PINCTRL_PIN(SC9860_AUD_ADSYNC),
596 SPRD_PINCTRL_PIN(SC9860_AUD_SCLK),
597 SPRD_PINCTRL_PIN(SC9860_CHIP_SLEEP),
598 SPRD_PINCTRL_PIN(SC9860_CLK_32K),
599 SPRD_PINCTRL_PIN(SC9860_DCDC_ARM_EN),
600 SPRD_PINCTRL_PIN(SC9860_EXT_RST_B),
601 SPRD_PINCTRL_PIN(SC9860_ADI_D),
602 SPRD_PINCTRL_PIN(SC9860_ADI_SCLK),
603 SPRD_PINCTRL_PIN(SC9860_XTL_EN1),
604 SPRD_PINCTRL_PIN(SC9860_ANA_INT),
605 SPRD_PINCTRL_PIN(SC9860_AUD_DAD0),
606 SPRD_PINCTRL_PIN(SC9860_AUD_DASYNC),
607 SPRD_PINCTRL_PIN(SC9860_LCM_RSTN),
608 SPRD_PINCTRL_PIN(SC9860_DSI_TE),
609 SPRD_PINCTRL_PIN(SC9860_PWMA),
610 SPRD_PINCTRL_PIN(SC9860_EXTINT0),
611 SPRD_PINCTRL_PIN(SC9860_EXTINT1),
612 SPRD_PINCTRL_PIN(SC9860_SDA1),
613 SPRD_PINCTRL_PIN(SC9860_SCL1),
614 SPRD_PINCTRL_PIN(SC9860_SIMCLK2),
615 SPRD_PINCTRL_PIN(SC9860_SIMDA2),
616 SPRD_PINCTRL_PIN(SC9860_SIMRST2),
617 SPRD_PINCTRL_PIN(SC9860_SIMCLK1),
618 SPRD_PINCTRL_PIN(SC9860_SIMDA1),
619 SPRD_PINCTRL_PIN(SC9860_SIMRST1),
620 SPRD_PINCTRL_PIN(SC9860_SIMCLK0),
621 SPRD_PINCTRL_PIN(SC9860_SIMDA0),
622 SPRD_PINCTRL_PIN(SC9860_SIMRST0),
623 SPRD_PINCTRL_PIN(SC9860_SD2_CMD),
624 SPRD_PINCTRL_PIN(SC9860_SD2_D0),
625 SPRD_PINCTRL_PIN(SC9860_SD2_D1),
626 SPRD_PINCTRL_PIN(SC9860_SD2_CLK),
627 SPRD_PINCTRL_PIN(SC9860_SD2_D2),
628 SPRD_PINCTRL_PIN(SC9860_SD2_D3),
629 SPRD_PINCTRL_PIN(SC9860_SD0_D3),
630 SPRD_PINCTRL_PIN(SC9860_SD0_D2),
631 SPRD_PINCTRL_PIN(SC9860_SD0_CMD),
632 SPRD_PINCTRL_PIN(SC9860_SD0_D0),
633 SPRD_PINCTRL_PIN(SC9860_SD0_D1),
634 SPRD_PINCTRL_PIN(SC9860_SD0_CLK),
635 SPRD_PINCTRL_PIN(SC9860_EMMC_CMD),
636 SPRD_PINCTRL_PIN(SC9860_EMMC_D6),
637 SPRD_PINCTRL_PIN(SC9860_EMMC_D7),
638 SPRD_PINCTRL_PIN(SC9860_EMMC_CLK),
639 SPRD_PINCTRL_PIN(SC9860_EMMC_D5),
640 SPRD_PINCTRL_PIN(SC9860_EMMC_D4),
641 SPRD_PINCTRL_PIN(SC9860_EMMC_DS),
642 SPRD_PINCTRL_PIN(SC9860_EMMC_D3),
643 SPRD_PINCTRL_PIN(SC9860_EMMC_RST),
644 SPRD_PINCTRL_PIN(SC9860_EMMC_D1),
645 SPRD_PINCTRL_PIN(SC9860_EMMC_D2),
646 SPRD_PINCTRL_PIN(SC9860_EMMC_D0),
647 SPRD_PINCTRL_PIN(SC9860_IIS0DI),
648 SPRD_PINCTRL_PIN(SC9860_IIS0DO),
649 SPRD_PINCTRL_PIN(SC9860_IIS0CLK),
650 SPRD_PINCTRL_PIN(SC9860_IIS0LRCK),
651 SPRD_PINCTRL_PIN(SC9860_SD1_CLK),
652 SPRD_PINCTRL_PIN(SC9860_SD1_CMD),
653 SPRD_PINCTRL_PIN(SC9860_SD1_D0),
654 SPRD_PINCTRL_PIN(SC9860_SD1_D1),
655 SPRD_PINCTRL_PIN(SC9860_SD1_D2),
656 SPRD_PINCTRL_PIN(SC9860_SD1_D3),
657 SPRD_PINCTRL_PIN(SC9860_CLK_AUX0),
658 SPRD_PINCTRL_PIN(SC9860_WIFI_COEXIST),
659 SPRD_PINCTRL_PIN(SC9860_BEIDOU_COEXIST),
660 SPRD_PINCTRL_PIN(SC9860_U3TXD),
661 SPRD_PINCTRL_PIN(SC9860_U3RXD),
662 SPRD_PINCTRL_PIN(SC9860_U3CTS),
663 SPRD_PINCTRL_PIN(SC9860_U3RTS),
664 SPRD_PINCTRL_PIN(SC9860_U0TXD),
665 SPRD_PINCTRL_PIN(SC9860_U0RXD),
666 SPRD_PINCTRL_PIN(SC9860_U0CTS),
667 SPRD_PINCTRL_PIN(SC9860_U0RTS),
668 SPRD_PINCTRL_PIN(SC9860_IIS1DI),
669 SPRD_PINCTRL_PIN(SC9860_IIS1DO),
670 SPRD_PINCTRL_PIN(SC9860_IIS1CLK),
671 SPRD_PINCTRL_PIN(SC9860_IIS1LRCK),
672 SPRD_PINCTRL_PIN(SC9860_SPI0_CSN),
673 SPRD_PINCTRL_PIN(SC9860_SPI0_DO),
674 SPRD_PINCTRL_PIN(SC9860_SPI0_DI),
675 SPRD_PINCTRL_PIN(SC9860_SPI0_CLK),
676 SPRD_PINCTRL_PIN(SC9860_U2TXD),
677 SPRD_PINCTRL_PIN(SC9860_U2RXD),
678 SPRD_PINCTRL_PIN(SC9860_U4TXD),
679 SPRD_PINCTRL_PIN(SC9860_U4RXD),
680 SPRD_PINCTRL_PIN(SC9860_CMMCLK1),
681 SPRD_PINCTRL_PIN(SC9860_CMRST1),
682 SPRD_PINCTRL_PIN(SC9860_CMMCLK0),
683 SPRD_PINCTRL_PIN(SC9860_CMRST0),
684 SPRD_PINCTRL_PIN(SC9860_CMPD0),
685 SPRD_PINCTRL_PIN(SC9860_CMPD1),
686 SPRD_PINCTRL_PIN(SC9860_SCL0),
687 SPRD_PINCTRL_PIN(SC9860_SDA0),
688 SPRD_PINCTRL_PIN(SC9860_SDA6),
689 SPRD_PINCTRL_PIN(SC9860_SCL6),
690 SPRD_PINCTRL_PIN(SC9860_U1TXD),
691 SPRD_PINCTRL_PIN(SC9860_U1RXD),
692 SPRD_PINCTRL_PIN(SC9860_KEYOUT0),
693 SPRD_PINCTRL_PIN(SC9860_KEYOUT1),
694 SPRD_PINCTRL_PIN(SC9860_KEYOUT2),
695 SPRD_PINCTRL_PIN(SC9860_KEYIN0),
696 SPRD_PINCTRL_PIN(SC9860_KEYIN1),
697 SPRD_PINCTRL_PIN(SC9860_KEYIN2),
698 SPRD_PINCTRL_PIN(SC9860_IIS3DI),
699 SPRD_PINCTRL_PIN(SC9860_IIS3DO),
700 SPRD_PINCTRL_PIN(SC9860_IIS3CLK),
701 SPRD_PINCTRL_PIN(SC9860_IIS3LRCK),
702 SPRD_PINCTRL_PIN(SC9860_RFCTL0),
703 SPRD_PINCTRL_PIN(SC9860_RFCTL1),
704 SPRD_PINCTRL_PIN(SC9860_RFCTL10),
705 SPRD_PINCTRL_PIN(SC9860_RFCTL11),
706 SPRD_PINCTRL_PIN(SC9860_RFCTL12),
707 SPRD_PINCTRL_PIN(SC9860_RFCTL13),
708 SPRD_PINCTRL_PIN(SC9860_RFCTL14),
709 SPRD_PINCTRL_PIN(SC9860_RFCTL15),
710 SPRD_PINCTRL_PIN(SC9860_RFCTL16),
711 SPRD_PINCTRL_PIN(SC9860_RFCTL17),
712 SPRD_PINCTRL_PIN(SC9860_RFCTL18),
713 SPRD_PINCTRL_PIN(SC9860_RFCTL19),
714 SPRD_PINCTRL_PIN(SC9860_RFCTL2),
715 SPRD_PINCTRL_PIN(SC9860_EXTINT5),
716 SPRD_PINCTRL_PIN(SC9860_EXTINT6),
717 SPRD_PINCTRL_PIN(SC9860_EXTINT7),
718 SPRD_PINCTRL_PIN(SC9860_GPIO30),
719 SPRD_PINCTRL_PIN(SC9860_GPIO31),
720 SPRD_PINCTRL_PIN(SC9860_GPIO32),
721 SPRD_PINCTRL_PIN(SC9860_GPIO33),
722 SPRD_PINCTRL_PIN(SC9860_GPIO34),
723 SPRD_PINCTRL_PIN(SC9860_RFCTL3),
724 SPRD_PINCTRL_PIN(SC9860_RFCTL4),
725 SPRD_PINCTRL_PIN(SC9860_RFCTL5),
726 SPRD_PINCTRL_PIN(SC9860_RFCTL6),
727 SPRD_PINCTRL_PIN(SC9860_RFCTL7),
728 SPRD_PINCTRL_PIN(SC9860_RFCTL8),
729 SPRD_PINCTRL_PIN(SC9860_RFCTL9),
730 SPRD_PINCTRL_PIN(SC9860_RFFE0_SCK0),
731 SPRD_PINCTRL_PIN(SC9860_GPIO38),
732 SPRD_PINCTRL_PIN(SC9860_RFFE0_SDA0),
733 SPRD_PINCTRL_PIN(SC9860_GPIO39),
734 SPRD_PINCTRL_PIN(SC9860_RFFE1_SCK0),
735 SPRD_PINCTRL_PIN(SC9860_GPIO181),
736 SPRD_PINCTRL_PIN(SC9860_RFFE1_SDA0),
737 SPRD_PINCTRL_PIN(SC9860_GPIO182),
738 SPRD_PINCTRL_PIN(SC9860_RF_LVDS0_ADC_ON),
739 SPRD_PINCTRL_PIN(SC9860_RF_LVDS0_DAC_ON),
740 SPRD_PINCTRL_PIN(SC9860_RFSCK0),
741 SPRD_PINCTRL_PIN(SC9860_RFSDA0),
742 SPRD_PINCTRL_PIN(SC9860_RFSEN0),
743 SPRD_PINCTRL_PIN(SC9860_RF_LVDS1_ADC_ON),
744 SPRD_PINCTRL_PIN(SC9860_RF_LVDS1_DAC_ON),
745 SPRD_PINCTRL_PIN(SC9860_RFSCK1),
746 SPRD_PINCTRL_PIN(SC9860_RFSDA1),
747 SPRD_PINCTRL_PIN(SC9860_RFSEN1),
748 SPRD_PINCTRL_PIN(SC9860_RFCTL38),
749 SPRD_PINCTRL_PIN(SC9860_RFCTL39),
750 SPRD_PINCTRL_PIN(SC9860_RFCTL20_MISC),
751 SPRD_PINCTRL_PIN(SC9860_RFCTL21_MISC),
752 SPRD_PINCTRL_PIN(SC9860_RFCTL30_MISC),
753 SPRD_PINCTRL_PIN(SC9860_RFCTL31_MISC),
754 SPRD_PINCTRL_PIN(SC9860_RFCTL32_MISC),
755 SPRD_PINCTRL_PIN(SC9860_RFCTL33_MISC),
756 SPRD_PINCTRL_PIN(SC9860_RFCTL34_MISC),
757 SPRD_PINCTRL_PIN(SC9860_RFCTL35_MISC),
758 SPRD_PINCTRL_PIN(SC9860_RFCTL36_MISC),
759 SPRD_PINCTRL_PIN(SC9860_RFCTL37_MISC),
760 SPRD_PINCTRL_PIN(SC9860_RFCTL22_MISC),
761 SPRD_PINCTRL_PIN(SC9860_RFCTL23_MISC),
762 SPRD_PINCTRL_PIN(SC9860_RFCTL24_MISC),
763 SPRD_PINCTRL_PIN(SC9860_RFCTL25_MISC),
764 SPRD_PINCTRL_PIN(SC9860_RFCTL26_MISC),
765 SPRD_PINCTRL_PIN(SC9860_RFCTL27_MISC),
766 SPRD_PINCTRL_PIN(SC9860_RFCTL28_MISC),
767 SPRD_PINCTRL_PIN(SC9860_RFCTL29_MISC),
768 SPRD_PINCTRL_PIN(SC9860_SCL2_MISC),
769 SPRD_PINCTRL_PIN(SC9860_SDA2_MISC),
770 SPRD_PINCTRL_PIN(SC9860_MTCK_ARM_MISC),
771 SPRD_PINCTRL_PIN(SC9860_MTMS_ARM_MISC),
772 SPRD_PINCTRL_PIN(SC9860_XTL_EN0_MISC),
773 SPRD_PINCTRL_PIN(SC9860_PTEST_MISC),
774 SPRD_PINCTRL_PIN(SC9860_AUD_DAD1_MISC),
775 SPRD_PINCTRL_PIN(SC9860_AUD_ADD0_MISC),
776 SPRD_PINCTRL_PIN(SC9860_AUD_ADSYNC_MISC),
777 SPRD_PINCTRL_PIN(SC9860_AUD_SCLK_MISC),
778 SPRD_PINCTRL_PIN(SC9860_CHIP_SLEEP_MISC),
779 SPRD_PINCTRL_PIN(SC9860_CLK_32K_MISC),
780 SPRD_PINCTRL_PIN(SC9860_DCDC_ARM_EN_MISC),
781 SPRD_PINCTRL_PIN(SC9860_EXT_RST_B_MISC),
782 SPRD_PINCTRL_PIN(SC9860_ADI_D_MISC),
783 SPRD_PINCTRL_PIN(SC9860_ADI_SCLK_MISC),
784 SPRD_PINCTRL_PIN(SC9860_XTL_EN1_MISC),
785 SPRD_PINCTRL_PIN(SC9860_ANA_INT_MISC),
786 SPRD_PINCTRL_PIN(SC9860_AUD_DAD0_MISC),
787 SPRD_PINCTRL_PIN(SC9860_AUD_DASYNC_MISC),
788 SPRD_PINCTRL_PIN(SC9860_LCM_RSTN_MISC),
789 SPRD_PINCTRL_PIN(SC9860_DSI_TE_MISC),
790 SPRD_PINCTRL_PIN(SC9860_PWMA_MISC),
791 SPRD_PINCTRL_PIN(SC9860_EXTINT0_MISC),
792 SPRD_PINCTRL_PIN(SC9860_EXTINT1_MISC),
793 SPRD_PINCTRL_PIN(SC9860_SDA1_MISC),
794 SPRD_PINCTRL_PIN(SC9860_SCL1_MISC),
795 SPRD_PINCTRL_PIN(SC9860_SIMCLK2_MISC),
796 SPRD_PINCTRL_PIN(SC9860_SIMDA2_MISC),
797 SPRD_PINCTRL_PIN(SC9860_SIMRST2_MISC),
798 SPRD_PINCTRL_PIN(SC9860_SIMCLK1_MISC),
799 SPRD_PINCTRL_PIN(SC9860_SIMDA1_MISC),
800 SPRD_PINCTRL_PIN(SC9860_SIMRST1_MISC),
801 SPRD_PINCTRL_PIN(SC9860_SIMCLK0_MISC),
802 SPRD_PINCTRL_PIN(SC9860_SIMDA0_MISC),
803 SPRD_PINCTRL_PIN(SC9860_SIMRST0_MISC),
804 SPRD_PINCTRL_PIN(SC9860_SD2_CMD_MISC),
805 SPRD_PINCTRL_PIN(SC9860_SD2_D0_MISC),
806 SPRD_PINCTRL_PIN(SC9860_SD2_D1_MISC),
807 SPRD_PINCTRL_PIN(SC9860_SD2_CLK_MISC),
808 SPRD_PINCTRL_PIN(SC9860_SD2_D2_MISC),
809 SPRD_PINCTRL_PIN(SC9860_SD2_D3_MISC),
810 SPRD_PINCTRL_PIN(SC9860_SD0_D3_MISC),
811 SPRD_PINCTRL_PIN(SC9860_SD0_D2_MISC),
812 SPRD_PINCTRL_PIN(SC9860_SD0_CMD_MISC),
813 SPRD_PINCTRL_PIN(SC9860_SD0_D0_MISC),
814 SPRD_PINCTRL_PIN(SC9860_SD0_D1_MISC),
815 SPRD_PINCTRL_PIN(SC9860_SD0_CLK_MISC),
816 SPRD_PINCTRL_PIN(SC9860_EMMC_CMD_MISC),
817 SPRD_PINCTRL_PIN(SC9860_EMMC_D6_MISC),
818 SPRD_PINCTRL_PIN(SC9860_EMMC_D7_MISC),
819 SPRD_PINCTRL_PIN(SC9860_EMMC_CLK_MISC),
820 SPRD_PINCTRL_PIN(SC9860_EMMC_D5_MISC),
821 SPRD_PINCTRL_PIN(SC9860_EMMC_D4_MISC),
822 SPRD_PINCTRL_PIN(SC9860_EMMC_DS_MISC),
823 SPRD_PINCTRL_PIN(SC9860_EMMC_D3_MISC),
824 SPRD_PINCTRL_PIN(SC9860_EMMC_RST_MISC),
825 SPRD_PINCTRL_PIN(SC9860_EMMC_D1_MISC),
826 SPRD_PINCTRL_PIN(SC9860_EMMC_D2_MISC),
827 SPRD_PINCTRL_PIN(SC9860_EMMC_D0_MISC),
828 SPRD_PINCTRL_PIN(SC9860_IIS0DI_MISC),
829 SPRD_PINCTRL_PIN(SC9860_IIS0DO_MISC),
830 SPRD_PINCTRL_PIN(SC9860_IIS0CLK_MISC),
831 SPRD_PINCTRL_PIN(SC9860_IIS0LRCK_MISC),
832 SPRD_PINCTRL_PIN(SC9860_SD1_CLK_MISC),
833 SPRD_PINCTRL_PIN(SC9860_SD1_CMD_MISC),
834 SPRD_PINCTRL_PIN(SC9860_SD1_D0_MISC),
835 SPRD_PINCTRL_PIN(SC9860_SD1_D1_MISC),
836 SPRD_PINCTRL_PIN(SC9860_SD1_D2_MISC),
837 SPRD_PINCTRL_PIN(SC9860_SD1_D3_MISC),
838 SPRD_PINCTRL_PIN(SC9860_CLK_AUX0_MISC),
839 SPRD_PINCTRL_PIN(SC9860_WIFI_COEXIST_MISC),
840 SPRD_PINCTRL_PIN(SC9860_BEIDOU_COEXIST_MISC),
841 SPRD_PINCTRL_PIN(SC9860_U3TXD_MISC),
842 SPRD_PINCTRL_PIN(SC9860_U3RXD_MISC),
843 SPRD_PINCTRL_PIN(SC9860_U3CTS_MISC),
844 SPRD_PINCTRL_PIN(SC9860_U3RTS_MISC),
845 SPRD_PINCTRL_PIN(SC9860_U0TXD_MISC),
846 SPRD_PINCTRL_PIN(SC9860_U0RXD_MISC),
847 SPRD_PINCTRL_PIN(SC9860_U0CTS_MISC),
848 SPRD_PINCTRL_PIN(SC9860_U0RTS_MISC),
849 SPRD_PINCTRL_PIN(SC9860_IIS1DI_MISC),
850 SPRD_PINCTRL_PIN(SC9860_IIS1DO_MISC),
851 SPRD_PINCTRL_PIN(SC9860_IIS1CLK_MISC),
852 SPRD_PINCTRL_PIN(SC9860_IIS1LRCK_MISC),
853 SPRD_PINCTRL_PIN(SC9860_SPI0_CSN_MISC),
854 SPRD_PINCTRL_PIN(SC9860_SPI0_DO_MISC),
855 SPRD_PINCTRL_PIN(SC9860_SPI0_DI_MISC),
856 SPRD_PINCTRL_PIN(SC9860_SPI0_CLK_MISC),
857 SPRD_PINCTRL_PIN(SC9860_U2TXD_MISC),
858 SPRD_PINCTRL_PIN(SC9860_U2RXD_MISC),
859 SPRD_PINCTRL_PIN(SC9860_U4TXD_MISC),
860 SPRD_PINCTRL_PIN(SC9860_U4RXD_MISC),
861 SPRD_PINCTRL_PIN(SC9860_CMMCLK1_MISC),
862 SPRD_PINCTRL_PIN(SC9860_CMRST1_MISC),
863 SPRD_PINCTRL_PIN(SC9860_CMMCLK0_MISC),
864 SPRD_PINCTRL_PIN(SC9860_CMRST0_MISC),
865 SPRD_PINCTRL_PIN(SC9860_CMPD0_MISC),
866 SPRD_PINCTRL_PIN(SC9860_CMPD1_MISC),
867 SPRD_PINCTRL_PIN(SC9860_SCL0_MISC),
868 SPRD_PINCTRL_PIN(SC9860_SDA0_MISC),
869 SPRD_PINCTRL_PIN(SC9860_SDA6_MISC),
870 SPRD_PINCTRL_PIN(SC9860_SCL6_MISC),
871 SPRD_PINCTRL_PIN(SC9860_U1TXD_MISC),
872 SPRD_PINCTRL_PIN(SC9860_U1RXD_MISC),
873 SPRD_PINCTRL_PIN(SC9860_KEYOUT0_MISC),
874 SPRD_PINCTRL_PIN(SC9860_KEYOUT1_MISC),
875 SPRD_PINCTRL_PIN(SC9860_KEYOUT2_MISC),
876 SPRD_PINCTRL_PIN(SC9860_KEYIN0_MISC),
877 SPRD_PINCTRL_PIN(SC9860_KEYIN1_MISC),
878 SPRD_PINCTRL_PIN(SC9860_KEYIN2_MISC),
879 SPRD_PINCTRL_PIN(SC9860_IIS3DI_MISC),
880 SPRD_PINCTRL_PIN(SC9860_IIS3DO_MISC),
881 SPRD_PINCTRL_PIN(SC9860_IIS3CLK_MISC),
882 SPRD_PINCTRL_PIN(SC9860_IIS3LRCK_MISC),
883 SPRD_PINCTRL_PIN(SC9860_RFCTL0_MISC),
884 SPRD_PINCTRL_PIN(SC9860_RFCTL1_MISC),
885 SPRD_PINCTRL_PIN(SC9860_RFCTL10_MISC),
886 SPRD_PINCTRL_PIN(SC9860_RFCTL11_MISC),
887 SPRD_PINCTRL_PIN(SC9860_RFCTL12_MISC),
888 SPRD_PINCTRL_PIN(SC9860_RFCTL13_MISC),
889 SPRD_PINCTRL_PIN(SC9860_RFCTL14_MISC),
890 SPRD_PINCTRL_PIN(SC9860_RFCTL15_MISC),
891 SPRD_PINCTRL_PIN(SC9860_RFCTL16_MISC),
892 SPRD_PINCTRL_PIN(SC9860_RFCTL17_MISC),
893 SPRD_PINCTRL_PIN(SC9860_RFCTL18_MISC),
894 SPRD_PINCTRL_PIN(SC9860_RFCTL19_MISC),
895 SPRD_PINCTRL_PIN(SC9860_RFCTL2_MISC),
896 SPRD_PINCTRL_PIN(SC9860_EXTINT5_MISC),
897 SPRD_PINCTRL_PIN(SC9860_EXTINT6_MISC),
898 SPRD_PINCTRL_PIN(SC9860_EXTINT7_MISC),
899 SPRD_PINCTRL_PIN(SC9860_GPIO30_MISC),
900 SPRD_PINCTRL_PIN(SC9860_GPIO31_MISC),
901 SPRD_PINCTRL_PIN(SC9860_GPIO32_MISC),
902 SPRD_PINCTRL_PIN(SC9860_GPIO33_MISC),
903 SPRD_PINCTRL_PIN(SC9860_GPIO34_MISC),
904 SPRD_PINCTRL_PIN(SC9860_RFCTL3_MISC),
905 SPRD_PINCTRL_PIN(SC9860_RFCTL4_MISC),
906 SPRD_PINCTRL_PIN(SC9860_RFCTL5_MISC),
907 SPRD_PINCTRL_PIN(SC9860_RFCTL6_MISC),
908 SPRD_PINCTRL_PIN(SC9860_RFCTL7_MISC),
909 SPRD_PINCTRL_PIN(SC9860_RFCTL8_MISC),
910 SPRD_PINCTRL_PIN(SC9860_RFCTL9_MISC),
911 SPRD_PINCTRL_PIN(SC9860_RFFE0_SCK0_MISC),
912 SPRD_PINCTRL_PIN(SC9860_GPIO38_MISC),
913 SPRD_PINCTRL_PIN(SC9860_RFFE0_SDA0_MISC),
914 SPRD_PINCTRL_PIN(SC9860_GPIO39_MISC),
915 SPRD_PINCTRL_PIN(SC9860_RFFE1_SCK0_MISC),
916 SPRD_PINCTRL_PIN(SC9860_GPIO181_MISC),
917 SPRD_PINCTRL_PIN(SC9860_RFFE1_SDA0_MISC),
918 SPRD_PINCTRL_PIN(SC9860_GPIO182_MISC),
919 SPRD_PINCTRL_PIN(SC9860_RF_LVDS0_ADC_ON_MISC),
920 SPRD_PINCTRL_PIN(SC9860_RF_LVDS0_DAC_ON_MISC),
921 SPRD_PINCTRL_PIN(SC9860_RFSCK0_MISC),
922 SPRD_PINCTRL_PIN(SC9860_RFSDA0_MISC),
923 SPRD_PINCTRL_PIN(SC9860_RFSEN0_MISC),
924 SPRD_PINCTRL_PIN(SC9860_RF_LVDS1_ADC_ON_MISC),
925 SPRD_PINCTRL_PIN(SC9860_RF_LVDS1_DAC_ON_MISC),
926 SPRD_PINCTRL_PIN(SC9860_RFSCK1_MISC),
927 SPRD_PINCTRL_PIN(SC9860_RFSDA1_MISC),
928 SPRD_PINCTRL_PIN(SC9860_RFSEN1_MISC),
929 SPRD_PINCTRL_PIN(SC9860_RFCTL38_MISC),
930 SPRD_PINCTRL_PIN(SC9860_RFCTL39_MISC),
931};
932
933static int sprd_pinctrl_probe(struct platform_device *pdev)
934{
935 return sprd_pinctrl_core_probe(pdev, sprd_sc9860_pins_info,
936 ARRAY_SIZE(sprd_sc9860_pins_info));
937}
938
939static const struct of_device_id sprd_pinctrl_of_match[] = {
940 {
941 .compatible = "sprd,sc9860-pinctrl",
942 },
943 { },
944};
945MODULE_DEVICE_TABLE(of, sprd_pinctrl_of_match);
946
947static struct platform_driver sprd_pinctrl_driver = {
948 .driver = {
949 .name = "sprd-pinctrl",
950 .owner = THIS_MODULE,
951 .of_match_table = sprd_pinctrl_of_match,
952 },
953 .probe = sprd_pinctrl_probe,
954 .remove = sprd_pinctrl_remove,
955 .shutdown = sprd_pinctrl_shutdown,
956};
957
958static int sprd_pinctrl_init(void)
959{
960 return platform_driver_register(&sprd_pinctrl_driver);
961}
962module_init(sprd_pinctrl_init);
963
964static void sprd_pinctrl_exit(void)
965{
966 platform_driver_unregister(&sprd_pinctrl_driver);
967}
968module_exit(sprd_pinctrl_exit);
969
970MODULE_DESCRIPTION("SPREADTRUM Pin Controller Driver");
971MODULE_AUTHOR("Baolin Wang <baolin.wang@spreadtrum.com>");
972MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
new file mode 100644
index 000000000000..7e7b9ac7e836
--- /dev/null
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -0,0 +1,1113 @@
1/*
2 * Spreadtrum pin controller driver
3 * Copyright (C) 2017 Spreadtrum - http://www.spreadtrum.com
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 */
14
15#include <linux/debugfs.h>
16#include <linux/err.h>
17#include <linux/init.h>
18#include <linux/io.h>
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/of.h>
22#include <linux/of_device.h>
23#include <linux/platform_device.h>
24#include <linux/pinctrl/machine.h>
25#include <linux/pinctrl/pinconf.h>
26#include <linux/pinctrl/pinconf-generic.h>
27#include <linux/pinctrl/pinctrl.h>
28#include <linux/pinctrl/pinmux.h>
29#include <linux/slab.h>
30
31#include "../core.h"
32#include "../pinmux.h"
33#include "../pinconf.h"
34#include "../pinctrl-utils.h"
35#include "pinctrl-sprd.h"
36
37#define PINCTRL_BIT_MASK(width) (~(~0UL << (width)))
38#define PINCTRL_REG_OFFSET 0x20
39#define PINCTRL_REG_MISC_OFFSET 0x4020
40#define PINCTRL_REG_LEN 0x4
41
42#define PIN_FUNC_MASK (BIT(4) | BIT(5))
43#define PIN_FUNC_SEL_1 ~PIN_FUNC_MASK
44#define PIN_FUNC_SEL_2 BIT(4)
45#define PIN_FUNC_SEL_3 BIT(5)
46#define PIN_FUNC_SEL_4 PIN_FUNC_MASK
47
48#define AP_SLEEP_MODE BIT(13)
49#define PUBCP_SLEEP_MODE BIT(14)
50#define TGLDSP_SLEEP_MODE BIT(15)
51#define AGDSP_SLEEP_MODE BIT(16)
52#define SLEEP_MODE_MASK GENMASK(3, 0)
53#define SLEEP_MODE_SHIFT 13
54
55#define SLEEP_INPUT BIT(1)
56#define SLEEP_INPUT_MASK 0x1
57#define SLEEP_INPUT_SHIFT 1
58
59#define SLEEP_OUTPUT BIT(0)
60#define SLEEP_OUTPUT_MASK 0x1
61#define SLEEP_OUTPUT_SHIFT 0
62
63#define DRIVE_STRENGTH_MASK GENMASK(3, 0)
64#define DRIVE_STRENGTH_SHIFT 19
65
66#define SLEEP_PULL_DOWN BIT(2)
67#define SLEEP_PULL_DOWN_MASK 0x1
68#define SLEEP_PULL_DOWN_SHIFT 2
69
70#define PULL_DOWN BIT(6)
71#define PULL_DOWN_MASK 0x1
72#define PULL_DOWN_SHIFT 6
73
74#define SLEEP_PULL_UP BIT(3)
75#define SLEEP_PULL_UP_MASK 0x1
76#define SLEEP_PULL_UP_SHIFT 3
77
78#define PULL_UP_20K (BIT(12) | BIT(7))
79#define PULL_UP_4_7K BIT(12)
80#define PULL_UP_MASK 0x21
81#define PULL_UP_SHIFT 7
82
83#define INPUT_SCHMITT BIT(11)
84#define INPUT_SCHMITT_MASK 0x1
85#define INPUT_SCHMITT_SHIFT 11
86
87enum pin_sleep_mode {
88 AP_SLEEP = BIT(0),
89 PUBCP_SLEEP = BIT(1),
90 TGLDSP_SLEEP = BIT(2),
91 AGDSP_SLEEP = BIT(3),
92};
93
94enum pin_func_sel {
95 PIN_FUNC_1,
96 PIN_FUNC_2,
97 PIN_FUNC_3,
98 PIN_FUNC_4,
99 PIN_FUNC_MAX,
100};
101
102/**
103 * struct sprd_pin: represent one pin's description
104 * @name: pin name
105 * @number: pin number
106 * @type: pin type, can be GLOBAL_CTRL_PIN/COMMON_PIN/MISC_PIN
107 * @reg: pin register address
108 * @bit_offset: bit offset in pin register
109 * @bit_width: bit width in pin register
110 */
111struct sprd_pin {
112 const char *name;
113 unsigned int number;
114 enum pin_type type;
115 unsigned long reg;
116 unsigned long bit_offset;
117 unsigned long bit_width;
118};
119
120/**
121 * struct sprd_pin_group: represent one group's description
122 * @name: group name
123 * @npins: pin numbers of this group
124 * @pins: pointer to pins array
125 */
126struct sprd_pin_group {
127 const char *name;
128 unsigned int npins;
129 unsigned int *pins;
130};
131
132/**
133 * struct sprd_pinctrl_soc_info: represent the SoC's pins description
134 * @groups: pointer to groups of pins
135 * @ngroups: group numbers of the whole SoC
136 * @pins: pointer to pins description
137 * @npins: pin numbers of the whole SoC
138 * @grp_names: pointer to group names array
139 */
140struct sprd_pinctrl_soc_info {
141 struct sprd_pin_group *groups;
142 unsigned int ngroups;
143 struct sprd_pin *pins;
144 unsigned int npins;
145 const char **grp_names;
146};
147
148/**
149 * struct sprd_pinctrl: represent the pin controller device
150 * @dev: pointer to the device structure
151 * @pctl: pointer to the pinctrl handle
152 * @base: base address of the controller
153 * @info: pointer to SoC's pins description information
154 */
155struct sprd_pinctrl {
156 struct device *dev;
157 struct pinctrl_dev *pctl;
158 void __iomem *base;
159 struct sprd_pinctrl_soc_info *info;
160};
161
162enum sprd_pinconf_params {
163 SPRD_PIN_CONFIG_CONTROL = PIN_CONFIG_END + 1,
164 SPRD_PIN_CONFIG_SLEEP_MODE = PIN_CONFIG_END + 2,
165};
166
167static int sprd_pinctrl_get_id_by_name(struct sprd_pinctrl *sprd_pctl,
168 const char *name)
169{
170 struct sprd_pinctrl_soc_info *info = sprd_pctl->info;
171 int i;
172
173 for (i = 0; i < info->npins; i++) {
174 if (!strcmp(info->pins[i].name, name))
175 return info->pins[i].number;
176 }
177
178 return -ENODEV;
179}
180
181static struct sprd_pin *
182sprd_pinctrl_get_pin_by_id(struct sprd_pinctrl *sprd_pctl, unsigned int id)
183{
184 struct sprd_pinctrl_soc_info *info = sprd_pctl->info;
185 struct sprd_pin *pin = NULL;
186 int i;
187
188 for (i = 0; i < info->npins; i++) {
189 if (info->pins[i].number == id) {
190 pin = &info->pins[i];
191 break;
192 }
193 }
194
195 return pin;
196}
197
198static const struct sprd_pin_group *
199sprd_pinctrl_find_group_by_name(struct sprd_pinctrl *sprd_pctl,
200 const char *name)
201{
202 struct sprd_pinctrl_soc_info *info = sprd_pctl->info;
203 const struct sprd_pin_group *grp = NULL;
204 int i;
205
206 for (i = 0; i < info->ngroups; i++) {
207 if (!strcmp(info->groups[i].name, name)) {
208 grp = &info->groups[i];
209 break;
210 }
211 }
212
213 return grp;
214}
215
216static int sprd_pctrl_group_count(struct pinctrl_dev *pctldev)
217{
218 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
219 struct sprd_pinctrl_soc_info *info = pctl->info;
220
221 return info->ngroups;
222}
223
224static const char *sprd_pctrl_group_name(struct pinctrl_dev *pctldev,
225 unsigned int selector)
226{
227 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
228 struct sprd_pinctrl_soc_info *info = pctl->info;
229
230 return info->groups[selector].name;
231}
232
233static int sprd_pctrl_group_pins(struct pinctrl_dev *pctldev,
234 unsigned int selector,
235 const unsigned int **pins,
236 unsigned int *npins)
237{
238 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
239 struct sprd_pinctrl_soc_info *info = pctl->info;
240
241 if (selector >= info->ngroups)
242 return -EINVAL;
243
244 *pins = info->groups[selector].pins;
245 *npins = info->groups[selector].npins;
246
247 return 0;
248}
249
250static int sprd_dt_node_to_map(struct pinctrl_dev *pctldev,
251 struct device_node *np,
252 struct pinctrl_map **map,
253 unsigned int *num_maps)
254{
255 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
256 const struct sprd_pin_group *grp;
257 unsigned long *configs = NULL;
258 unsigned int num_configs = 0;
259 unsigned int reserved_maps = 0;
260 unsigned int reserve = 0;
261 const char *function;
262 enum pinctrl_map_type type;
263 int ret;
264
265 grp = sprd_pinctrl_find_group_by_name(pctl, np->name);
266 if (!grp) {
267 dev_err(pctl->dev, "unable to find group for node %s\n",
268 of_node_full_name(np));
269 return -EINVAL;
270 }
271
272 ret = of_property_count_strings(np, "pins");
273 if (ret < 0)
274 return ret;
275
276 if (ret == 1)
277 type = PIN_MAP_TYPE_CONFIGS_PIN;
278 else
279 type = PIN_MAP_TYPE_CONFIGS_GROUP;
280
281 ret = of_property_read_string(np, "function", &function);
282 if (ret < 0) {
283 if (ret != -EINVAL)
284 dev_err(pctl->dev,
285 "%s: could not parse property function\n",
286 of_node_full_name(np));
287 function = NULL;
288 }
289
290 ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
291 &num_configs);
292 if (ret < 0) {
293 dev_err(pctl->dev, "%s: could not parse node property\n",
294 of_node_full_name(np));
295 return ret;
296 }
297
298 *map = NULL;
299 *num_maps = 0;
300
301 if (function != NULL)
302 reserve++;
303 if (num_configs)
304 reserve++;
305
306 ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps,
307 num_maps, reserve);
308 if (ret < 0)
309 goto out;
310
311 if (function) {
312 ret = pinctrl_utils_add_map_mux(pctldev, map,
313 &reserved_maps, num_maps,
314 grp->name, function);
315 if (ret < 0)
316 goto out;
317 }
318
319 if (num_configs) {
320 const char *group_or_pin;
321 unsigned int pin_id;
322
323 if (type == PIN_MAP_TYPE_CONFIGS_PIN) {
324 pin_id = grp->pins[0];
325 group_or_pin = pin_get_name(pctldev, pin_id);
326 } else {
327 group_or_pin = grp->name;
328 }
329
330 ret = pinctrl_utils_add_map_configs(pctldev, map,
331 &reserved_maps, num_maps,
332 group_or_pin, configs,
333 num_configs, type);
334 }
335
336out:
337 kfree(configs);
338 return ret;
339}
340
341static void sprd_pctrl_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
342 unsigned int offset)
343{
344 seq_printf(s, "%s", dev_name(pctldev->dev));
345}
346
347static const struct pinctrl_ops sprd_pctrl_ops = {
348 .get_groups_count = sprd_pctrl_group_count,
349 .get_group_name = sprd_pctrl_group_name,
350 .get_group_pins = sprd_pctrl_group_pins,
351 .pin_dbg_show = sprd_pctrl_dbg_show,
352 .dt_node_to_map = sprd_dt_node_to_map,
353 .dt_free_map = pinctrl_utils_free_map,
354};
355
356int sprd_pmx_get_function_count(struct pinctrl_dev *pctldev)
357{
358 return PIN_FUNC_MAX;
359}
360
361const char *sprd_pmx_get_function_name(struct pinctrl_dev *pctldev,
362 unsigned int selector)
363{
364 switch (selector) {
365 case PIN_FUNC_1:
366 return "func1";
367 case PIN_FUNC_2:
368 return "func2";
369 case PIN_FUNC_3:
370 return "func3";
371 case PIN_FUNC_4:
372 return "func4";
373 default:
374 return "null";
375 }
376}
377
378int sprd_pmx_get_function_groups(struct pinctrl_dev *pctldev,
379 unsigned int selector,
380 const char * const **groups,
381 unsigned int * const num_groups)
382{
383 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
384 struct sprd_pinctrl_soc_info *info = pctl->info;
385
386 *groups = info->grp_names;
387 *num_groups = info->ngroups;
388
389 return 0;
390}
391
392static int sprd_pmx_set_mux(struct pinctrl_dev *pctldev,
393 unsigned int func_selector,
394 unsigned int group_selector)
395{
396 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
397 struct sprd_pinctrl_soc_info *info = pctl->info;
398 struct sprd_pin_group *grp = &info->groups[group_selector];
399 unsigned int i, grp_pins = grp->npins;
400 unsigned long reg;
401 unsigned int val = 0;
402
403 if (group_selector > info->ngroups)
404 return -EINVAL;
405
406 switch (func_selector) {
407 case PIN_FUNC_1:
408 val &= PIN_FUNC_SEL_1;
409 break;
410 case PIN_FUNC_2:
411 val |= PIN_FUNC_SEL_2;
412 break;
413 case PIN_FUNC_3:
414 val |= PIN_FUNC_SEL_3;
415 break;
416 case PIN_FUNC_4:
417 val |= PIN_FUNC_SEL_4;
418 break;
419 default:
420 break;
421 }
422
423 for (i = 0; i < grp_pins; i++) {
424 unsigned int pin_id = grp->pins[i];
425 struct sprd_pin *pin = sprd_pinctrl_get_pin_by_id(pctl, pin_id);
426
427 if (!pin || pin->type != COMMON_PIN)
428 continue;
429
430 reg = readl((void __iomem *)pin->reg);
431 reg &= ~PIN_FUNC_MASK;
432 reg |= val;
433 writel(reg, (void __iomem *)pin->reg);
434 }
435
436 return 0;
437}
438
439static const struct pinmux_ops sprd_pmx_ops = {
440 .get_functions_count = sprd_pmx_get_function_count,
441 .get_function_name = sprd_pmx_get_function_name,
442 .get_function_groups = sprd_pmx_get_function_groups,
443 .set_mux = sprd_pmx_set_mux,
444};
445
446static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id,
447 unsigned long *config)
448{
449 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
450 struct sprd_pin *pin = sprd_pinctrl_get_pin_by_id(pctl, pin_id);
451 unsigned int param = pinconf_to_config_param(*config);
452 unsigned int reg, arg;
453
454 if (!pin)
455 return -EINVAL;
456
457 if (pin->type == GLOBAL_CTRL_PIN) {
458 reg = (readl((void __iomem *)pin->reg) >>
459 pin->bit_offset) & PINCTRL_BIT_MASK(pin->bit_width);
460 } else {
461 reg = readl((void __iomem *)pin->reg);
462 }
463
464 if (pin->type == GLOBAL_CTRL_PIN &&
465 param == SPRD_PIN_CONFIG_CONTROL) {
466 arg = reg;
467 } else if (pin->type == COMMON_PIN) {
468 switch (param) {
469 case SPRD_PIN_CONFIG_SLEEP_MODE:
470 arg = (reg >> SLEEP_MODE_SHIFT) & SLEEP_MODE_MASK;
471 break;
472 case PIN_CONFIG_INPUT_ENABLE:
473 arg = (reg >> SLEEP_INPUT_SHIFT) & SLEEP_INPUT_MASK;
474 break;
475 case PIN_CONFIG_OUTPUT:
476 arg = reg & SLEEP_OUTPUT_MASK;
477 break;
478 case PIN_CONFIG_SLEEP_HARDWARE_STATE:
479 arg = 0;
480 break;
481 default:
482 return -ENOTSUPP;
483 }
484 } else if (pin->type == MISC_PIN) {
485 switch (param) {
486 case PIN_CONFIG_DRIVE_STRENGTH:
487 arg = (reg >> DRIVE_STRENGTH_SHIFT) &
488 DRIVE_STRENGTH_MASK;
489 break;
490 case PIN_CONFIG_BIAS_PULL_DOWN:
491 /* combine sleep pull down and pull down config */
492 arg = ((reg >> SLEEP_PULL_DOWN_SHIFT) &
493 SLEEP_PULL_DOWN_MASK) << 16;
494 arg |= (reg >> PULL_DOWN_SHIFT) & PULL_DOWN_MASK;
495 break;
496 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
497 arg = (reg >> INPUT_SCHMITT_SHIFT) & INPUT_SCHMITT_MASK;
498 break;
499 case PIN_CONFIG_BIAS_PULL_UP:
500 /* combine sleep pull up and pull up config */
501 arg = ((reg >> SLEEP_PULL_UP_SHIFT) &
502 SLEEP_PULL_UP_MASK) << 16;
503 arg |= (reg >> PULL_UP_SHIFT) & PULL_UP_MASK;
504 break;
505 case PIN_CONFIG_SLEEP_HARDWARE_STATE:
506 arg = 0;
507 break;
508 default:
509 return -ENOTSUPP;
510 }
511 } else {
512 return -ENOTSUPP;
513 }
514
515 *config = pinconf_to_config_packed(param, arg);
516 return 0;
517}
518
519static unsigned int sprd_pinconf_drive(unsigned int mA)
520{
521 unsigned int val = 0;
522
523 switch (mA) {
524 case 2:
525 break;
526 case 4:
527 val |= BIT(19);
528 break;
529 case 6:
530 val |= BIT(20);
531 break;
532 case 8:
533 val |= BIT(19) | BIT(20);
534 break;
535 case 10:
536 val |= BIT(21);
537 break;
538 case 12:
539 val |= BIT(21) | BIT(19);
540 break;
541 case 14:
542 val |= BIT(21) | BIT(20);
543 break;
544 case 16:
545 val |= BIT(19) | BIT(20) | BIT(21);
546 break;
547 case 20:
548 val |= BIT(22);
549 break;
550 case 21:
551 val |= BIT(22) | BIT(19);
552 break;
553 case 24:
554 val |= BIT(22) | BIT(20);
555 break;
556 case 25:
557 val |= BIT(22) | BIT(20) | BIT(19);
558 break;
559 case 27:
560 val |= BIT(22) | BIT(21);
561 break;
562 case 29:
563 val |= BIT(22) | BIT(21) | BIT(19);
564 break;
565 case 31:
566 val |= BIT(22) | BIT(21) | BIT(20);
567 break;
568 case 33:
569 val |= BIT(22) | BIT(21) | BIT(20) | BIT(19);
570 break;
571 default:
572 break;
573 }
574
575 return val;
576}
577
578static bool sprd_pinctrl_check_sleep_config(unsigned long *configs,
579 unsigned int num_configs)
580{
581 unsigned int param;
582 int i;
583
584 for (i = 0; i < num_configs; i++) {
585 param = pinconf_to_config_param(configs[i]);
586 if (param == PIN_CONFIG_SLEEP_HARDWARE_STATE)
587 return true;
588 }
589
590 return false;
591}
592
593static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
594 unsigned long *configs, unsigned int num_configs)
595{
596 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
597 struct sprd_pin *pin = sprd_pinctrl_get_pin_by_id(pctl, pin_id);
598 bool is_sleep_config;
599 unsigned long reg;
600 int i;
601
602 if (!pin)
603 return -EINVAL;
604
605 is_sleep_config = sprd_pinctrl_check_sleep_config(configs, num_configs);
606
607 for (i = 0; i < num_configs; i++) {
608 unsigned int param, arg, shift, mask, val;
609
610 param = pinconf_to_config_param(configs[i]);
611 arg = pinconf_to_config_argument(configs[i]);
612
613 val = 0;
614 shift = 0;
615 mask = 0;
616 if (pin->type == GLOBAL_CTRL_PIN &&
617 param == SPRD_PIN_CONFIG_CONTROL) {
618 val = arg;
619 } else if (pin->type == COMMON_PIN) {
620 switch (param) {
621 case SPRD_PIN_CONFIG_SLEEP_MODE:
622 if (arg & AP_SLEEP)
623 val |= AP_SLEEP_MODE;
624 if (arg & PUBCP_SLEEP)
625 val |= PUBCP_SLEEP_MODE;
626 if (arg & TGLDSP_SLEEP)
627 val |= TGLDSP_SLEEP_MODE;
628 if (arg & AGDSP_SLEEP)
629 val |= AGDSP_SLEEP_MODE;
630
631 mask = SLEEP_MODE_MASK;
632 shift = SLEEP_MODE_SHIFT;
633 break;
634 case PIN_CONFIG_INPUT_ENABLE:
635 if (is_sleep_config == true) {
636 if (arg > 0)
637 val |= SLEEP_INPUT;
638 else
639 val &= ~SLEEP_INPUT;
640
641 mask = SLEEP_INPUT_MASK;
642 shift = SLEEP_INPUT_SHIFT;
643 }
644 break;
645 case PIN_CONFIG_OUTPUT:
646 if (is_sleep_config == true) {
647 val |= SLEEP_OUTPUT;
648 mask = SLEEP_OUTPUT_MASK;
649 shift = SLEEP_OUTPUT_SHIFT;
650 }
651 break;
652 case PIN_CONFIG_SLEEP_HARDWARE_STATE:
653 continue;
654 default:
655 return -ENOTSUPP;
656 }
657 } else if (pin->type == MISC_PIN) {
658 switch (param) {
659 case PIN_CONFIG_DRIVE_STRENGTH:
660 if (arg < 2 || arg > 60)
661 return -EINVAL;
662
663 val = sprd_pinconf_drive(arg);
664 mask = DRIVE_STRENGTH_MASK;
665 shift = DRIVE_STRENGTH_SHIFT;
666 break;
667 case PIN_CONFIG_BIAS_PULL_DOWN:
668 if (is_sleep_config == true) {
669 val |= SLEEP_PULL_DOWN;
670 mask = SLEEP_PULL_DOWN_MASK;
671 shift = SLEEP_PULL_DOWN_SHIFT;
672 } else {
673 val |= PULL_DOWN;
674 mask = PULL_DOWN_MASK;
675 shift = PULL_DOWN_SHIFT;
676 }
677 break;
678 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
679 if (arg > 0)
680 val |= INPUT_SCHMITT;
681 else
682 val &= ~INPUT_SCHMITT;
683
684 mask = INPUT_SCHMITT_MASK;
685 shift = INPUT_SCHMITT_SHIFT;
686 break;
687 case PIN_CONFIG_BIAS_PULL_UP:
688 if (is_sleep_config == true) {
689 val |= SLEEP_PULL_UP;
690 mask = SLEEP_PULL_UP_MASK;
691 shift = SLEEP_PULL_UP_SHIFT;
692 } else {
693 if (arg == 20000)
694 val |= PULL_UP_20K;
695 else if (arg == 4700)
696 val |= PULL_UP_4_7K;
697
698 mask = PULL_UP_MASK;
699 shift = PULL_UP_SHIFT;
700 }
701 break;
702 case PIN_CONFIG_SLEEP_HARDWARE_STATE:
703 continue;
704 default:
705 return -ENOTSUPP;
706 }
707 } else {
708 return -ENOTSUPP;
709 }
710
711 if (pin->type == GLOBAL_CTRL_PIN) {
712 reg = readl((void __iomem *)pin->reg);
713 reg &= ~(PINCTRL_BIT_MASK(pin->bit_width)
714 << pin->bit_offset);
715 reg |= (val & PINCTRL_BIT_MASK(pin->bit_width))
716 << pin->bit_offset;
717 writel(reg, (void __iomem *)pin->reg);
718 } else {
719 reg = readl((void __iomem *)pin->reg);
720 reg &= ~(mask << shift);
721 reg |= val;
722 writel(reg, (void __iomem *)pin->reg);
723 }
724 }
725
726 return 0;
727}
728
729static int sprd_pinconf_group_get(struct pinctrl_dev *pctldev,
730 unsigned int selector, unsigned long *config)
731{
732 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
733 struct sprd_pinctrl_soc_info *info = pctl->info;
734 struct sprd_pin_group *grp;
735 unsigned int pin_id;
736
737 if (selector > info->ngroups)
738 return -EINVAL;
739
740 grp = &info->groups[selector];
741 pin_id = grp->pins[0];
742
743 return sprd_pinconf_get(pctldev, pin_id, config);
744}
745
746static int sprd_pinconf_group_set(struct pinctrl_dev *pctldev,
747 unsigned int selector,
748 unsigned long *configs,
749 unsigned int num_configs)
750{
751 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
752 struct sprd_pinctrl_soc_info *info = pctl->info;
753 struct sprd_pin_group *grp;
754 int ret, i;
755
756 if (selector > info->ngroups)
757 return -EINVAL;
758
759 grp = &info->groups[selector];
760
761 for (i = 0; i < grp->npins; i++) {
762 unsigned int pin_id = grp->pins[i];
763
764 ret = sprd_pinconf_set(pctldev, pin_id, configs, num_configs);
765 if (ret)
766 return ret;
767 }
768
769 return 0;
770}
771
772static int sprd_pinconf_get_config(struct pinctrl_dev *pctldev,
773 unsigned int pin_id,
774 unsigned long *config)
775{
776 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
777 struct sprd_pin *pin = sprd_pinctrl_get_pin_by_id(pctl, pin_id);
778
779 if (!pin)
780 return -EINVAL;
781
782 if (pin->type == GLOBAL_CTRL_PIN) {
783 *config = (readl((void __iomem *)pin->reg) >>
784 pin->bit_offset) & PINCTRL_BIT_MASK(pin->bit_width);
785 } else {
786 *config = readl((void __iomem *)pin->reg);
787 }
788
789 return 0;
790}
791
792static void sprd_pinconf_dbg_show(struct pinctrl_dev *pctldev,
793 struct seq_file *s, unsigned int pin_id)
794{
795 unsigned long config;
796 int ret;
797
798 ret = sprd_pinconf_get_config(pctldev, pin_id, &config);
799 if (ret)
800 return;
801
802 seq_printf(s, "0x%lx", config);
803}
804
805static void sprd_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
806 struct seq_file *s,
807 unsigned int selector)
808{
809 struct sprd_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
810 struct sprd_pinctrl_soc_info *info = pctl->info;
811 struct sprd_pin_group *grp;
812 unsigned long config;
813 const char *name;
814 int i, ret;
815
816 if (selector > info->ngroups)
817 return;
818
819 grp = &info->groups[selector];
820
821 seq_printf(s, "\n");
822 for (i = 0; i < grp->npins; i++, config++) {
823 unsigned int pin_id = grp->pins[i];
824
825 name = pin_get_name(pctldev, pin_id);
826 ret = sprd_pinconf_get_config(pctldev, pin_id, &config);
827 if (ret)
828 return;
829
830 seq_printf(s, "%s: 0x%lx ", name, config);
831 }
832}
833
834static const struct pinconf_ops sprd_pinconf_ops = {
835 .is_generic = true,
836 .pin_config_get = sprd_pinconf_get,
837 .pin_config_set = sprd_pinconf_set,
838 .pin_config_group_get = sprd_pinconf_group_get,
839 .pin_config_group_set = sprd_pinconf_group_set,
840 .pin_config_dbg_show = sprd_pinconf_dbg_show,
841 .pin_config_group_dbg_show = sprd_pinconf_group_dbg_show,
842};
843
844static const struct pinconf_generic_params sprd_dt_params[] = {
845 {"sprd,control", SPRD_PIN_CONFIG_CONTROL, 0},
846 {"sprd,sleep-mode", SPRD_PIN_CONFIG_SLEEP_MODE, 0},
847};
848
849#ifdef CONFIG_DEBUG_FS
850static const struct pin_config_item sprd_conf_items[] = {
851 PCONFDUMP(SPRD_PIN_CONFIG_CONTROL, "global control", NULL, true),
852 PCONFDUMP(SPRD_PIN_CONFIG_SLEEP_MODE, "sleep mode", NULL, true),
853};
854#endif
855
856static struct pinctrl_desc sprd_pinctrl_desc = {
857 .pctlops = &sprd_pctrl_ops,
858 .pmxops = &sprd_pmx_ops,
859 .confops = &sprd_pinconf_ops,
860 .num_custom_params = ARRAY_SIZE(sprd_dt_params),
861 .custom_params = sprd_dt_params,
862#ifdef CONFIG_DEBUG_FS
863 .custom_conf_items = sprd_conf_items,
864#endif
865 .owner = THIS_MODULE,
866};
867
868static int sprd_pinctrl_parse_groups(struct device_node *np,
869 struct sprd_pinctrl *sprd_pctl,
870 struct sprd_pin_group *grp)
871{
872 struct property *prop;
873 const char *pin_name;
874 int ret, i = 0;
875
876 ret = of_property_count_strings(np, "pins");
877 if (ret < 0)
878 return ret;
879
880 grp->name = np->name;
881 grp->npins = ret;
882 grp->pins = devm_kzalloc(sprd_pctl->dev, grp->npins *
883 sizeof(unsigned int), GFP_KERNEL);
884 if (!grp->pins)
885 return -ENOMEM;
886
887 of_property_for_each_string(np, "pins", prop, pin_name) {
888 ret = sprd_pinctrl_get_id_by_name(sprd_pctl, pin_name);
889 if (ret >= 0)
890 grp->pins[i++] = ret;
891 }
892
893 for (i = 0; i < grp->npins; i++) {
894 dev_dbg(sprd_pctl->dev,
895 "Group[%s] contains [%d] pins: id = %d\n",
896 grp->name, grp->npins, grp->pins[i]);
897 }
898
899 return 0;
900}
901
902static unsigned int sprd_pinctrl_get_groups(struct device_node *np)
903{
904 struct device_node *child;
905 unsigned int group_cnt, cnt;
906
907 group_cnt = of_get_child_count(np);
908
909 for_each_child_of_node(np, child) {
910 cnt = of_get_child_count(child);
911 if (cnt > 0)
912 group_cnt += cnt;
913 }
914
915 return group_cnt;
916}
917
918static int sprd_pinctrl_parse_dt(struct sprd_pinctrl *sprd_pctl)
919{
920 struct sprd_pinctrl_soc_info *info = sprd_pctl->info;
921 struct device_node *np = sprd_pctl->dev->of_node;
922 struct device_node *child, *sub_child;
923 struct sprd_pin_group *grp;
924 const char **temp;
925 int ret;
926
927 if (!np)
928 return -ENODEV;
929
930 info->ngroups = sprd_pinctrl_get_groups(np);
931 if (!info->ngroups)
932 return 0;
933
934 info->groups = devm_kzalloc(sprd_pctl->dev, info->ngroups *
935 sizeof(struct sprd_pin_group),
936 GFP_KERNEL);
937 if (!info->groups)
938 return -ENOMEM;
939
940 info->grp_names = devm_kzalloc(sprd_pctl->dev,
941 info->ngroups * sizeof(char *),
942 GFP_KERNEL);
943 if (!info->grp_names)
944 return -ENOMEM;
945
946 temp = info->grp_names;
947 grp = info->groups;
948
949 for_each_child_of_node(np, child) {
950 ret = sprd_pinctrl_parse_groups(child, sprd_pctl, grp);
951 if (ret)
952 return ret;
953
954 *temp++ = grp->name;
955 grp++;
956
957 if (of_get_child_count(child) > 0) {
958 for_each_child_of_node(child, sub_child) {
959 ret = sprd_pinctrl_parse_groups(sub_child,
960 sprd_pctl, grp);
961 if (ret)
962 return ret;
963
964 *temp++ = grp->name;
965 grp++;
966 }
967 }
968 }
969
970 return 0;
971}
972
973static int sprd_pinctrl_add_pins(struct sprd_pinctrl *sprd_pctl,
974 struct sprd_pins_info *sprd_soc_pin_info,
975 int pins_cnt)
976{
977 struct sprd_pinctrl_soc_info *info = sprd_pctl->info;
978 unsigned int ctrl_pin = 0, com_pin = 0;
979 struct sprd_pin *pin;
980 int i;
981
982 info->npins = pins_cnt;
983 info->pins = devm_kzalloc(sprd_pctl->dev,
984 info->npins * sizeof(struct sprd_pin),
985 GFP_KERNEL);
986 if (!info->pins)
987 return -ENOMEM;
988
989 for (i = 0, pin = info->pins; i < info->npins; i++, pin++) {
990 unsigned int reg;
991
992 pin->name = sprd_soc_pin_info[i].name;
993 pin->type = sprd_soc_pin_info[i].type;
994 pin->number = sprd_soc_pin_info[i].num;
995 reg = sprd_soc_pin_info[i].reg;
996 if (pin->type == GLOBAL_CTRL_PIN) {
997 pin->reg = (unsigned long)sprd_pctl->base +
998 PINCTRL_REG_LEN * reg;
999 pin->bit_offset = sprd_soc_pin_info[i].bit_offset;
1000 pin->bit_width = sprd_soc_pin_info[i].bit_width;
1001 ctrl_pin++;
1002 } else if (pin->type == COMMON_PIN) {
1003 pin->reg = (unsigned long)sprd_pctl->base +
1004 PINCTRL_REG_OFFSET + PINCTRL_REG_LEN *
1005 (i - ctrl_pin);
1006 com_pin++;
1007 } else if (pin->type == MISC_PIN) {
1008 pin->reg = (unsigned long)sprd_pctl->base +
1009 PINCTRL_REG_MISC_OFFSET + PINCTRL_REG_LEN *
1010 (i - ctrl_pin - com_pin);
1011 }
1012 }
1013
1014 for (i = 0, pin = info->pins; i < info->npins; pin++, i++) {
1015 dev_dbg(sprd_pctl->dev, "pin name[%s-%d], type = %d, "
1016 "bit offset = %ld, bit width = %ld, reg = 0x%lx\n",
1017 pin->name, pin->number, pin->type,
1018 pin->bit_offset, pin->bit_width, pin->reg);
1019 }
1020
1021 return 0;
1022}
1023
1024int sprd_pinctrl_core_probe(struct platform_device *pdev,
1025 struct sprd_pins_info *sprd_soc_pin_info,
1026 int pins_cnt)
1027{
1028 struct sprd_pinctrl *sprd_pctl;
1029 struct sprd_pinctrl_soc_info *pinctrl_info;
1030 struct pinctrl_pin_desc *pin_desc;
1031 struct resource *res;
1032 int ret, i;
1033
1034 sprd_pctl = devm_kzalloc(&pdev->dev, sizeof(struct sprd_pinctrl),
1035 GFP_KERNEL);
1036 if (!sprd_pctl)
1037 return -ENOMEM;
1038
1039 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1040 sprd_pctl->base = devm_ioremap_resource(&pdev->dev, res);
1041 if (IS_ERR(sprd_pctl->base))
1042 return PTR_ERR(sprd_pctl->base);
1043
1044 pinctrl_info = devm_kzalloc(&pdev->dev,
1045 sizeof(struct sprd_pinctrl_soc_info),
1046 GFP_KERNEL);
1047 if (!pinctrl_info)
1048 return -ENOMEM;
1049
1050 sprd_pctl->info = pinctrl_info;
1051 sprd_pctl->dev = &pdev->dev;
1052 platform_set_drvdata(pdev, sprd_pctl);
1053
1054 ret = sprd_pinctrl_add_pins(sprd_pctl, sprd_soc_pin_info, pins_cnt);
1055 if (ret) {
1056 dev_err(&pdev->dev, "fail to add pins information\n");
1057 return ret;
1058 }
1059
1060 pin_desc = devm_kzalloc(&pdev->dev, pinctrl_info->npins *
1061 sizeof(struct pinctrl_pin_desc),
1062 GFP_KERNEL);
1063 if (!pin_desc)
1064 return -ENOMEM;
1065
1066 for (i = 0; i < pinctrl_info->npins; i++) {
1067 pin_desc[i].number = pinctrl_info->pins[i].number;
1068 pin_desc[i].name = pinctrl_info->pins[i].name;
1069 pin_desc[i].drv_data = pinctrl_info;
1070 }
1071
1072 sprd_pinctrl_desc.pins = pin_desc;
1073 sprd_pinctrl_desc.name = dev_name(&pdev->dev);
1074 sprd_pinctrl_desc.npins = pinctrl_info->npins;
1075
1076 sprd_pctl->pctl = pinctrl_register(&sprd_pinctrl_desc,
1077 &pdev->dev, (void *)sprd_pctl);
1078 if (IS_ERR(sprd_pctl->pctl)) {
1079 dev_err(&pdev->dev, "could not register pinctrl driver\n");
1080 return PTR_ERR(sprd_pctl->pctl);
1081 }
1082
1083 ret = sprd_pinctrl_parse_dt(sprd_pctl);
1084 if (ret) {
1085 dev_err(&pdev->dev, "fail to parse dt properties\n");
1086 pinctrl_unregister(sprd_pctl->pctl);
1087 return ret;
1088 }
1089
1090 return 0;
1091}
1092
1093int sprd_pinctrl_remove(struct platform_device *pdev)
1094{
1095 struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev);
1096
1097 pinctrl_unregister(sprd_pctl->pctl);
1098 return 0;
1099}
1100
1101void sprd_pinctrl_shutdown(struct platform_device *pdev)
1102{
1103 struct pinctrl *pinctl = devm_pinctrl_get(&pdev->dev);
1104 struct pinctrl_state *state;
1105
1106 state = pinctrl_lookup_state(pinctl, "shutdown");
1107 if (!IS_ERR(state))
1108 pinctrl_select_state(pinctl, state);
1109}
1110
1111MODULE_DESCRIPTION("SPREADTRUM Pin Controller Driver");
1112MODULE_AUTHOR("Baolin Wang <baolin.wang@spreadtrum.com>");
1113MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.h b/drivers/pinctrl/sprd/pinctrl-sprd.h
new file mode 100644
index 000000000000..31a43fec38c4
--- /dev/null
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.h
@@ -0,0 +1,67 @@
1/*
2 * Driver header file for pin controller driver
3 * Copyright (C) 2017 Spreadtrum - http://www.spreadtrum.com
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 */
14
15#ifndef __PINCTRL_SPRD_H__
16#define __PINCTRL_SPRD_H__
17
18struct platform_device;
19
20#define NUM_OFFSET (20)
21#define TYPE_OFFSET (16)
22#define BIT_OFFSET (8)
23#define WIDTH_OFFSET (4)
24
25#define SPRD_PIN_INFO(num, type, offset, width, reg) \
26 (((num) & 0xFFF) << NUM_OFFSET | \
27 ((type) & 0xF) << TYPE_OFFSET | \
28 ((offset) & 0xFF) << BIT_OFFSET | \
29 ((width) & 0xF) << WIDTH_OFFSET | \
30 ((reg) & 0xF))
31
32#define SPRD_PINCTRL_PIN(pin) SPRD_PINCTRL_PIN_DATA(pin, #pin)
33
34#define SPRD_PINCTRL_PIN_DATA(a, b) \
35 { \
36 .name = b, \
37 .num = (((a) >> NUM_OFFSET) & 0xfff), \
38 .type = (((a) >> TYPE_OFFSET) & 0xf), \
39 .bit_offset = (((a) >> BIT_OFFSET) & 0xff), \
40 .bit_width = ((a) >> WIDTH_OFFSET & 0xf), \
41 .reg = ((a) & 0xf) \
42 }
43
44enum pin_type {
45 GLOBAL_CTRL_PIN,
46 COMMON_PIN,
47 MISC_PIN,
48};
49
50struct sprd_pins_info {
51 const char *name;
52 unsigned int num;
53 enum pin_type type;
54
55 /* for global control pins configuration */
56 unsigned long bit_offset;
57 unsigned long bit_width;
58 unsigned int reg;
59};
60
61int sprd_pinctrl_core_probe(struct platform_device *pdev,
62 struct sprd_pins_info *sprd_soc_pin_info,
63 int pins_cnt);
64int sprd_pinctrl_remove(struct platform_device *pdev);
65void sprd_pinctrl_shutdown(struct platform_device *pdev);
66
67#endif /* __PINCTRL_SPRD_H__ */
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 06431ff49ffb..50299ad96659 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -952,7 +952,7 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl,
952 int npins = STM32_GPIO_PINS_PER_BANK; 952 int npins = STM32_GPIO_PINS_PER_BANK;
953 int bank_nr, err; 953 int bank_nr, err;
954 954
955 rstc = of_reset_control_get(np, NULL); 955 rstc = of_reset_control_get_exclusive(np, NULL);
956 if (!IS_ERR(rstc)) 956 if (!IS_ERR(rstc))
957 reset_control_deassert(rstc); 957 reset_control_deassert(rstc);
958 958
diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig
index 31f85ca92669..bfce99d86dfc 100644
--- a/drivers/pinctrl/sunxi/Kconfig
+++ b/drivers/pinctrl/sunxi/Kconfig
@@ -7,7 +7,7 @@ config PINCTRL_SUNXI
7 select GPIOLIB 7 select GPIOLIB
8 8
9config PINCTRL_SUN4I_A10 9config PINCTRL_SUN4I_A10
10 def_bool MACH_SUN4I || MACH_SUN7I 10 def_bool MACH_SUN4I || MACH_SUN7I || MACH_SUN8I
11 select PINCTRL_SUNXI 11 select PINCTRL_SUNXI
12 12
13config PINCTRL_SUN5I 13config PINCTRL_SUN5I
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c
index 47a392bc73c8..f763d8d62d6e 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c
@@ -26,7 +26,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
26 SUNXI_FUNCTION(0x3, "spi1"), /* CS0 */ 26 SUNXI_FUNCTION(0x3, "spi1"), /* CS0 */
27 SUNXI_FUNCTION(0x4, "uart2"), /* RTS */ 27 SUNXI_FUNCTION(0x4, "uart2"), /* RTS */
28 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD3 */ 28 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD3 */
29 PINCTRL_SUN7I_A20)), 29 PINCTRL_SUN7I_A20 |
30 PINCTRL_SUN8I_R40)),
30 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1), 31 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
31 SUNXI_FUNCTION(0x0, "gpio_in"), 32 SUNXI_FUNCTION(0x0, "gpio_in"),
32 SUNXI_FUNCTION(0x1, "gpio_out"), 33 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -34,7 +35,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
34 SUNXI_FUNCTION(0x3, "spi1"), /* CLK */ 35 SUNXI_FUNCTION(0x3, "spi1"), /* CLK */
35 SUNXI_FUNCTION(0x4, "uart2"), /* CTS */ 36 SUNXI_FUNCTION(0x4, "uart2"), /* CTS */
36 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD2 */ 37 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD2 */
37 PINCTRL_SUN7I_A20)), 38 PINCTRL_SUN7I_A20 |
39 PINCTRL_SUN8I_R40)),
38 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2), 40 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
39 SUNXI_FUNCTION(0x0, "gpio_in"), 41 SUNXI_FUNCTION(0x0, "gpio_in"),
40 SUNXI_FUNCTION(0x1, "gpio_out"), 42 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -42,7 +44,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
42 SUNXI_FUNCTION(0x3, "spi1"), /* MOSI */ 44 SUNXI_FUNCTION(0x3, "spi1"), /* MOSI */
43 SUNXI_FUNCTION(0x4, "uart2"), /* TX */ 45 SUNXI_FUNCTION(0x4, "uart2"), /* TX */
44 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD1 */ 46 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD1 */
45 PINCTRL_SUN7I_A20)), 47 PINCTRL_SUN7I_A20 |
48 PINCTRL_SUN8I_R40)),
46 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3), 49 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
47 SUNXI_FUNCTION(0x0, "gpio_in"), 50 SUNXI_FUNCTION(0x0, "gpio_in"),
48 SUNXI_FUNCTION(0x1, "gpio_out"), 51 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -50,65 +53,75 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
50 SUNXI_FUNCTION(0x3, "spi1"), /* MISO */ 53 SUNXI_FUNCTION(0x3, "spi1"), /* MISO */
51 SUNXI_FUNCTION(0x4, "uart2"), /* RX */ 54 SUNXI_FUNCTION(0x4, "uart2"), /* RX */
52 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD0 */ 55 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXD0 */
53 PINCTRL_SUN7I_A20)), 56 PINCTRL_SUN7I_A20 |
57 PINCTRL_SUN8I_R40)),
54 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4), 58 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
55 SUNXI_FUNCTION(0x0, "gpio_in"), 59 SUNXI_FUNCTION(0x0, "gpio_in"),
56 SUNXI_FUNCTION(0x1, "gpio_out"), 60 SUNXI_FUNCTION(0x1, "gpio_out"),
57 SUNXI_FUNCTION(0x2, "emac"), /* ETXD3 */ 61 SUNXI_FUNCTION(0x2, "emac"), /* ETXD3 */
58 SUNXI_FUNCTION(0x3, "spi1"), /* CS1 */ 62 SUNXI_FUNCTION(0x3, "spi1"), /* CS1 */
59 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD3 */ 63 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD3 */
60 PINCTRL_SUN7I_A20)), 64 PINCTRL_SUN7I_A20 |
65 PINCTRL_SUN8I_R40)),
61 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5), 66 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
62 SUNXI_FUNCTION(0x0, "gpio_in"), 67 SUNXI_FUNCTION(0x0, "gpio_in"),
63 SUNXI_FUNCTION(0x1, "gpio_out"), 68 SUNXI_FUNCTION(0x1, "gpio_out"),
64 SUNXI_FUNCTION(0x2, "emac"), /* ETXD2 */ 69 SUNXI_FUNCTION(0x2, "emac"), /* ETXD2 */
65 SUNXI_FUNCTION(0x3, "spi3"), /* CS0 */ 70 SUNXI_FUNCTION(0x3, "spi3"), /* CS0 */
66 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD2 */ 71 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD2 */
67 PINCTRL_SUN7I_A20)), 72 PINCTRL_SUN7I_A20 |
73 PINCTRL_SUN8I_R40)),
68 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6), 74 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
69 SUNXI_FUNCTION(0x0, "gpio_in"), 75 SUNXI_FUNCTION(0x0, "gpio_in"),
70 SUNXI_FUNCTION(0x1, "gpio_out"), 76 SUNXI_FUNCTION(0x1, "gpio_out"),
71 SUNXI_FUNCTION(0x2, "emac"), /* ETXD1 */ 77 SUNXI_FUNCTION(0x2, "emac"), /* ETXD1 */
72 SUNXI_FUNCTION(0x3, "spi3"), /* CLK */ 78 SUNXI_FUNCTION(0x3, "spi3"), /* CLK */
73 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD1 */ 79 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD1 */
74 PINCTRL_SUN7I_A20)), 80 PINCTRL_SUN7I_A20 |
81 PINCTRL_SUN8I_R40)),
75 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7), 82 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
76 SUNXI_FUNCTION(0x0, "gpio_in"), 83 SUNXI_FUNCTION(0x0, "gpio_in"),
77 SUNXI_FUNCTION(0x1, "gpio_out"), 84 SUNXI_FUNCTION(0x1, "gpio_out"),
78 SUNXI_FUNCTION(0x2, "emac"), /* ETXD0 */ 85 SUNXI_FUNCTION(0x2, "emac"), /* ETXD0 */
79 SUNXI_FUNCTION(0x3, "spi3"), /* MOSI */ 86 SUNXI_FUNCTION(0x3, "spi3"), /* MOSI */
80 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD0 */ 87 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXD0 */
81 PINCTRL_SUN7I_A20)), 88 PINCTRL_SUN7I_A20 |
89 PINCTRL_SUN8I_R40)),
82 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8), 90 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
83 SUNXI_FUNCTION(0x0, "gpio_in"), 91 SUNXI_FUNCTION(0x0, "gpio_in"),
84 SUNXI_FUNCTION(0x1, "gpio_out"), 92 SUNXI_FUNCTION(0x1, "gpio_out"),
85 SUNXI_FUNCTION(0x2, "emac"), /* ERXCK */ 93 SUNXI_FUNCTION(0x2, "emac"), /* ERXCK */
86 SUNXI_FUNCTION(0x3, "spi3"), /* MISO */ 94 SUNXI_FUNCTION(0x3, "spi3"), /* MISO */
87 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXCK */ 95 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXCK */
88 PINCTRL_SUN7I_A20)), 96 PINCTRL_SUN7I_A20 |
97 PINCTRL_SUN8I_R40)),
89 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9), 98 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
90 SUNXI_FUNCTION(0x0, "gpio_in"), 99 SUNXI_FUNCTION(0x0, "gpio_in"),
91 SUNXI_FUNCTION(0x1, "gpio_out"), 100 SUNXI_FUNCTION(0x1, "gpio_out"),
92 SUNXI_FUNCTION(0x2, "emac"), /* ERXERR */ 101 SUNXI_FUNCTION(0x2, "emac"), /* ERXERR */
93 SUNXI_FUNCTION(0x3, "spi3"), /* CS1 */ 102 SUNXI_FUNCTION(0x3, "spi3"), /* CS1 */
94 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ERXERR */ 103 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ERXERR */
95 PINCTRL_SUN7I_A20), 104 PINCTRL_SUN7I_A20 |
105 PINCTRL_SUN8I_R40),
96 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* MCLK */ 106 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* MCLK */
97 PINCTRL_SUN7I_A20)), 107 PINCTRL_SUN7I_A20 |
108 PINCTRL_SUN8I_R40)),
98 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10), 109 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
99 SUNXI_FUNCTION(0x0, "gpio_in"), 110 SUNXI_FUNCTION(0x0, "gpio_in"),
100 SUNXI_FUNCTION(0x1, "gpio_out"), 111 SUNXI_FUNCTION(0x1, "gpio_out"),
101 SUNXI_FUNCTION(0x2, "emac"), /* ERXDV */ 112 SUNXI_FUNCTION(0x2, "emac"), /* ERXDV */
102 SUNXI_FUNCTION(0x4, "uart1"), /* TX */ 113 SUNXI_FUNCTION(0x4, "uart1"), /* TX */
103 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXDV */ 114 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GRXDV */
104 PINCTRL_SUN7I_A20)), 115 PINCTRL_SUN7I_A20 |
116 PINCTRL_SUN8I_R40)),
105 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11), 117 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
106 SUNXI_FUNCTION(0x0, "gpio_in"), 118 SUNXI_FUNCTION(0x0, "gpio_in"),
107 SUNXI_FUNCTION(0x1, "gpio_out"), 119 SUNXI_FUNCTION(0x1, "gpio_out"),
108 SUNXI_FUNCTION(0x2, "emac"), /* EMDC */ 120 SUNXI_FUNCTION(0x2, "emac"), /* EMDC */
109 SUNXI_FUNCTION(0x4, "uart1"), /* RX */ 121 SUNXI_FUNCTION(0x4, "uart1"), /* RX */
110 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* EMDC */ 122 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* EMDC */
111 PINCTRL_SUN7I_A20)), 123 PINCTRL_SUN7I_A20 |
124 PINCTRL_SUN8I_R40)),
112 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12), 125 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
113 SUNXI_FUNCTION(0x0, "gpio_in"), 126 SUNXI_FUNCTION(0x0, "gpio_in"),
114 SUNXI_FUNCTION(0x1, "gpio_out"), 127 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -116,7 +129,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
116 SUNXI_FUNCTION(0x3, "uart6"), /* TX */ 129 SUNXI_FUNCTION(0x3, "uart6"), /* TX */
117 SUNXI_FUNCTION(0x4, "uart1"), /* RTS */ 130 SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
118 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* EMDIO */ 131 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* EMDIO */
119 PINCTRL_SUN7I_A20)), 132 PINCTRL_SUN7I_A20 |
133 PINCTRL_SUN8I_R40)),
120 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13), 134 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
121 SUNXI_FUNCTION(0x0, "gpio_in"), 135 SUNXI_FUNCTION(0x0, "gpio_in"),
122 SUNXI_FUNCTION(0x1, "gpio_out"), 136 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -124,7 +138,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
124 SUNXI_FUNCTION(0x3, "uart6"), /* RX */ 138 SUNXI_FUNCTION(0x3, "uart6"), /* RX */
125 SUNXI_FUNCTION(0x4, "uart1"), /* CTS */ 139 SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
126 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXCTL / ETXEN */ 140 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXCTL / ETXEN */
127 PINCTRL_SUN7I_A20)), 141 PINCTRL_SUN7I_A20 |
142 PINCTRL_SUN8I_R40)),
128 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14), 143 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
129 SUNXI_FUNCTION(0x0, "gpio_in"), 144 SUNXI_FUNCTION(0x0, "gpio_in"),
130 SUNXI_FUNCTION(0x1, "gpio_out"), 145 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -132,9 +147,11 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
132 SUNXI_FUNCTION(0x3, "uart7"), /* TX */ 147 SUNXI_FUNCTION(0x3, "uart7"), /* TX */
133 SUNXI_FUNCTION(0x4, "uart1"), /* DTR */ 148 SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
134 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ETXCK */ 149 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ETXCK */
135 PINCTRL_SUN7I_A20), 150 PINCTRL_SUN7I_A20 |
151 PINCTRL_SUN8I_R40),
136 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* BCLK */ 152 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* BCLK */
137 PINCTRL_SUN7I_A20)), 153 PINCTRL_SUN7I_A20 |
154 PINCTRL_SUN8I_R40)),
138 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15), 155 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
139 SUNXI_FUNCTION(0x0, "gpio_in"), 156 SUNXI_FUNCTION(0x0, "gpio_in"),
140 SUNXI_FUNCTION(0x1, "gpio_out"), 157 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -142,9 +159,11 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
142 SUNXI_FUNCTION(0x3, "uart7"), /* RX */ 159 SUNXI_FUNCTION(0x3, "uart7"), /* RX */
143 SUNXI_FUNCTION(0x4, "uart1"), /* DSR */ 160 SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
144 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXCK / ECRS */ 161 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GTXCK / ECRS */
145 PINCTRL_SUN7I_A20), 162 PINCTRL_SUN7I_A20 |
163 PINCTRL_SUN8I_R40),
146 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* LRCK */ 164 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* LRCK */
147 PINCTRL_SUN7I_A20)), 165 PINCTRL_SUN7I_A20 |
166 PINCTRL_SUN8I_R40)),
148 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16), 167 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
149 SUNXI_FUNCTION(0x0, "gpio_in"), 168 SUNXI_FUNCTION(0x0, "gpio_in"),
150 SUNXI_FUNCTION(0x1, "gpio_out"), 169 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -152,9 +171,11 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
152 SUNXI_FUNCTION(0x3, "can"), /* TX */ 171 SUNXI_FUNCTION(0x3, "can"), /* TX */
153 SUNXI_FUNCTION(0x4, "uart1"), /* DCD */ 172 SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
154 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GCLKIN / ECOL */ 173 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GCLKIN / ECOL */
155 PINCTRL_SUN7I_A20), 174 PINCTRL_SUN7I_A20 |
175 PINCTRL_SUN8I_R40),
156 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* DO */ 176 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* DO */
157 PINCTRL_SUN7I_A20)), 177 PINCTRL_SUN7I_A20 |
178 PINCTRL_SUN8I_R40)),
158 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17), 179 SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
159 SUNXI_FUNCTION(0x0, "gpio_in"), 180 SUNXI_FUNCTION(0x0, "gpio_in"),
160 SUNXI_FUNCTION(0x1, "gpio_out"), 181 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -162,14 +183,18 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
162 SUNXI_FUNCTION(0x3, "can"), /* RX */ 183 SUNXI_FUNCTION(0x3, "can"), /* RX */
163 SUNXI_FUNCTION(0x4, "uart1"), /* RING */ 184 SUNXI_FUNCTION(0x4, "uart1"), /* RING */
164 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ETXERR */ 185 SUNXI_FUNCTION_VARIANT(0x5, "gmac", /* GNULL / ETXERR */
165 PINCTRL_SUN7I_A20), 186 PINCTRL_SUN7I_A20 |
187 PINCTRL_SUN8I_R40),
166 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* DI */ 188 SUNXI_FUNCTION_VARIANT(0x6, "i2s1", /* DI */
167 PINCTRL_SUN7I_A20)), 189 PINCTRL_SUN7I_A20 |
190 PINCTRL_SUN8I_R40)),
168 /* Hole */ 191 /* Hole */
169 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0), 192 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
170 SUNXI_FUNCTION(0x0, "gpio_in"), 193 SUNXI_FUNCTION(0x0, "gpio_in"),
171 SUNXI_FUNCTION(0x1, "gpio_out"), 194 SUNXI_FUNCTION(0x1, "gpio_out"),
172 SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */ 195 SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */
196 SUNXI_FUNCTION_VARIANT(0x3, "pll_lock_dbg",
197 PINCTRL_SUN8I_R40)),
173 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1), 198 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
174 SUNXI_FUNCTION(0x0, "gpio_in"), 199 SUNXI_FUNCTION(0x0, "gpio_in"),
175 SUNXI_FUNCTION(0x1, "gpio_out"), 200 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -177,11 +202,19 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
177 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2), 202 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
178 SUNXI_FUNCTION(0x0, "gpio_in"), 203 SUNXI_FUNCTION(0x0, "gpio_in"),
179 SUNXI_FUNCTION(0x1, "gpio_out"), 204 SUNXI_FUNCTION(0x1, "gpio_out"),
180 SUNXI_FUNCTION(0x2, "pwm")), /* PWM0 */ 205 SUNXI_FUNCTION_VARIANT(0x2, "pwm", /* PWM0 */
206 PINCTRL_SUN4I_A10 |
207 PINCTRL_SUN7I_A20),
208 SUNXI_FUNCTION_VARIANT(0x3, "pwm", /* PWM0 */
209 PINCTRL_SUN8I_R40)),
181 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3), 210 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
182 SUNXI_FUNCTION(0x0, "gpio_in"), 211 SUNXI_FUNCTION(0x0, "gpio_in"),
183 SUNXI_FUNCTION(0x1, "gpio_out"), 212 SUNXI_FUNCTION(0x1, "gpio_out"),
184 SUNXI_FUNCTION(0x2, "ir0"), /* TX */ 213 SUNXI_FUNCTION_VARIANT(0x2, "ir0", /* TX */
214 PINCTRL_SUN4I_A10 |
215 PINCTRL_SUN7I_A20),
216 SUNXI_FUNCTION_VARIANT(0x3, "pwm", /* PWM1 */
217 PINCTRL_SUN8I_R40),
185 /* 218 /*
186 * The SPDIF block is not referenced at all in the A10 user 219 * The SPDIF block is not referenced at all in the A10 user
187 * manual. However it is described in the code leaked and the 220 * manual. However it is described in the code leaked and the
@@ -205,7 +238,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
205 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* MCLK */ 238 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* MCLK */
206 PINCTRL_SUN4I_A10), 239 PINCTRL_SUN4I_A10),
207 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* MCLK */ 240 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* MCLK */
208 PINCTRL_SUN7I_A20), 241 PINCTRL_SUN7I_A20 |
242 PINCTRL_SUN8I_R40),
209 SUNXI_FUNCTION(0x3, "ac97")), /* MCLK */ 243 SUNXI_FUNCTION(0x3, "ac97")), /* MCLK */
210 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6), 244 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
211 SUNXI_FUNCTION(0x0, "gpio_in"), 245 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -213,7 +247,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
213 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* BCLK */ 247 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* BCLK */
214 PINCTRL_SUN4I_A10), 248 PINCTRL_SUN4I_A10),
215 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* BCLK */ 249 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* BCLK */
216 PINCTRL_SUN7I_A20), 250 PINCTRL_SUN7I_A20 |
251 PINCTRL_SUN8I_R40),
217 SUNXI_FUNCTION(0x3, "ac97")), /* BCLK */ 252 SUNXI_FUNCTION(0x3, "ac97")), /* BCLK */
218 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7), 253 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
219 SUNXI_FUNCTION(0x0, "gpio_in"), 254 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -221,7 +256,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
221 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* LRCK */ 256 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* LRCK */
222 PINCTRL_SUN4I_A10), 257 PINCTRL_SUN4I_A10),
223 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* LRCK */ 258 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* LRCK */
224 PINCTRL_SUN7I_A20), 259 PINCTRL_SUN7I_A20 |
260 PINCTRL_SUN8I_R40),
225 SUNXI_FUNCTION(0x3, "ac97")), /* SYNC */ 261 SUNXI_FUNCTION(0x3, "ac97")), /* SYNC */
226 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8), 262 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
227 SUNXI_FUNCTION(0x0, "gpio_in"), 263 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -229,7 +265,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
229 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO0 */ 265 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO0 */
230 PINCTRL_SUN4I_A10), 266 PINCTRL_SUN4I_A10),
231 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO0 */ 267 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO0 */
232 PINCTRL_SUN7I_A20), 268 PINCTRL_SUN7I_A20 |
269 PINCTRL_SUN8I_R40),
233 SUNXI_FUNCTION(0x3, "ac97")), /* DO */ 270 SUNXI_FUNCTION(0x3, "ac97")), /* DO */
234 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9), 271 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
235 SUNXI_FUNCTION(0x0, "gpio_in"), 272 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -237,31 +274,41 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
237 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO1 */ 274 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO1 */
238 PINCTRL_SUN4I_A10), 275 PINCTRL_SUN4I_A10),
239 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO1 */ 276 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO1 */
240 PINCTRL_SUN7I_A20)), 277 PINCTRL_SUN7I_A20 |
278 PINCTRL_SUN8I_R40),
279 SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM6 */
280 PINCTRL_SUN8I_R40)),
241 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10), 281 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
242 SUNXI_FUNCTION(0x0, "gpio_in"), 282 SUNXI_FUNCTION(0x0, "gpio_in"),
243 SUNXI_FUNCTION(0x1, "gpio_out"), 283 SUNXI_FUNCTION(0x1, "gpio_out"),
244 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO2 */ 284 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO2 */
245 PINCTRL_SUN4I_A10), 285 PINCTRL_SUN4I_A10),
246 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO2 */ 286 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO2 */
247 PINCTRL_SUN7I_A20)), 287 PINCTRL_SUN7I_A20 |
288 PINCTRL_SUN8I_R40),
289 SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM7 */
290 PINCTRL_SUN8I_R40)),
248 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11), 291 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
249 SUNXI_FUNCTION(0x0, "gpio_in"), 292 SUNXI_FUNCTION(0x0, "gpio_in"),
250 SUNXI_FUNCTION(0x1, "gpio_out"), 293 SUNXI_FUNCTION(0x1, "gpio_out"),
251 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO3 */ 294 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DO3 */
252 PINCTRL_SUN4I_A10), 295 PINCTRL_SUN4I_A10),
253 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO3 */ 296 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DO3 */
254 PINCTRL_SUN7I_A20)), 297 PINCTRL_SUN7I_A20 |
298 PINCTRL_SUN8I_R40)),
255 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12), 299 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
256 SUNXI_FUNCTION(0x0, "gpio_in"), 300 SUNXI_FUNCTION(0x0, "gpio_in"),
257 SUNXI_FUNCTION(0x1, "gpio_out"), 301 SUNXI_FUNCTION(0x1, "gpio_out"),
258 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DI */ 302 SUNXI_FUNCTION_VARIANT(0x2, "i2s", /* DI */
259 PINCTRL_SUN4I_A10), 303 PINCTRL_SUN4I_A10),
260 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DI */ 304 SUNXI_FUNCTION_VARIANT(0x2, "i2s0", /* DI */
261 PINCTRL_SUN7I_A20), 305 PINCTRL_SUN7I_A20 |
306 PINCTRL_SUN8I_R40),
262 SUNXI_FUNCTION(0x3, "ac97"), /* DI */ 307 SUNXI_FUNCTION(0x3, "ac97"), /* DI */
263 /* Undocumented mux function on A10 - See SPDIF MCLK above */ 308 /* Undocumented mux function on A10 - See SPDIF MCLK above */
264 SUNXI_FUNCTION(0x4, "spdif")), /* SPDIF IN */ 309 SUNXI_FUNCTION_VARIANT(0x4, "spdif", /* SPDIF IN */
310 PINCTRL_SUN4I_A10 |
311 PINCTRL_SUN7I_A20)),
265 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13), 312 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
266 SUNXI_FUNCTION(0x0, "gpio_in"), 313 SUNXI_FUNCTION(0x0, "gpio_in"),
267 SUNXI_FUNCTION(0x1, "gpio_out"), 314 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -299,16 +346,22 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
299 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 20), 346 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 20),
300 SUNXI_FUNCTION(0x0, "gpio_in"), 347 SUNXI_FUNCTION(0x0, "gpio_in"),
301 SUNXI_FUNCTION(0x1, "gpio_out"), 348 SUNXI_FUNCTION(0x1, "gpio_out"),
302 SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */ 349 SUNXI_FUNCTION(0x2, "i2c2"), /* SCK */
350 SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM4 */
351 PINCTRL_SUN8I_R40)),
303 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 21), 352 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 21),
304 SUNXI_FUNCTION(0x0, "gpio_in"), 353 SUNXI_FUNCTION(0x0, "gpio_in"),
305 SUNXI_FUNCTION(0x1, "gpio_out"), 354 SUNXI_FUNCTION(0x1, "gpio_out"),
306 SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */ 355 SUNXI_FUNCTION(0x2, "i2c2"), /* SDA */
356 SUNXI_FUNCTION_VARIANT(0x4, "pwm", /* PWM5 */
357 PINCTRL_SUN8I_R40)),
307 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 22), 358 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 22),
308 SUNXI_FUNCTION(0x0, "gpio_in"), 359 SUNXI_FUNCTION(0x0, "gpio_in"),
309 SUNXI_FUNCTION(0x1, "gpio_out"), 360 SUNXI_FUNCTION(0x1, "gpio_out"),
310 SUNXI_FUNCTION(0x2, "uart0"), /* TX */ 361 SUNXI_FUNCTION(0x2, "uart0"), /* TX */
311 SUNXI_FUNCTION(0x3, "ir1")), /* TX */ 362 SUNXI_FUNCTION_VARIANT(0x3, "ir1", /* TX */
363 PINCTRL_SUN4I_A10 |
364 PINCTRL_SUN7I_A20)),
312 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 23), 365 SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 23),
313 SUNXI_FUNCTION(0x0, "gpio_in"), 366 SUNXI_FUNCTION(0x0, "gpio_in"),
314 SUNXI_FUNCTION(0x1, "gpio_out"), 367 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -341,7 +394,9 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
341 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5), 394 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
342 SUNXI_FUNCTION(0x0, "gpio_in"), 395 SUNXI_FUNCTION(0x0, "gpio_in"),
343 SUNXI_FUNCTION(0x1, "gpio_out"), 396 SUNXI_FUNCTION(0x1, "gpio_out"),
344 SUNXI_FUNCTION(0x2, "nand0")), /* NRE# */ 397 SUNXI_FUNCTION(0x2, "nand0"), /* NRE# */
398 SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* DS */
399 PINCTRL_SUN8I_R40)),
345 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6), 400 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
346 SUNXI_FUNCTION(0x0, "gpio_in"), 401 SUNXI_FUNCTION(0x0, "gpio_in"),
347 SUNXI_FUNCTION(0x1, "gpio_out"), 402 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -375,19 +430,27 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
375 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12), 430 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
376 SUNXI_FUNCTION(0x0, "gpio_in"), 431 SUNXI_FUNCTION(0x0, "gpio_in"),
377 SUNXI_FUNCTION(0x1, "gpio_out"), 432 SUNXI_FUNCTION(0x1, "gpio_out"),
378 SUNXI_FUNCTION(0x2, "nand0")), /* NDQ4 */ 433 SUNXI_FUNCTION(0x2, "nand0"), /* NDQ4 */
434 SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D4 */
435 PINCTRL_SUN8I_R40)),
379 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13), 436 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
380 SUNXI_FUNCTION(0x0, "gpio_in"), 437 SUNXI_FUNCTION(0x0, "gpio_in"),
381 SUNXI_FUNCTION(0x1, "gpio_out"), 438 SUNXI_FUNCTION(0x1, "gpio_out"),
382 SUNXI_FUNCTION(0x2, "nand0")), /* NDQ5 */ 439 SUNXI_FUNCTION(0x2, "nand0"), /* NDQ5 */
440 SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D5 */
441 PINCTRL_SUN8I_R40)),
383 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14), 442 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
384 SUNXI_FUNCTION(0x0, "gpio_in"), 443 SUNXI_FUNCTION(0x0, "gpio_in"),
385 SUNXI_FUNCTION(0x1, "gpio_out"), 444 SUNXI_FUNCTION(0x1, "gpio_out"),
386 SUNXI_FUNCTION(0x2, "nand0")), /* NDQ6 */ 445 SUNXI_FUNCTION(0x2, "nand0"), /* NDQ6 */
446 SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D6 */
447 PINCTRL_SUN8I_R40)),
387 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15), 448 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
388 SUNXI_FUNCTION(0x0, "gpio_in"), 449 SUNXI_FUNCTION(0x0, "gpio_in"),
389 SUNXI_FUNCTION(0x1, "gpio_out"), 450 SUNXI_FUNCTION(0x1, "gpio_out"),
390 SUNXI_FUNCTION(0x2, "nand0")), /* NDQ7 */ 451 SUNXI_FUNCTION(0x2, "nand0"), /* NDQ7 */
452 SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* D7 */
453 PINCTRL_SUN8I_R40)),
391 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16), 454 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
392 SUNXI_FUNCTION(0x0, "gpio_in"), 455 SUNXI_FUNCTION(0x0, "gpio_in"),
393 SUNXI_FUNCTION(0x1, "gpio_out"), 456 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -427,7 +490,9 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
427 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 24), 490 SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 24),
428 SUNXI_FUNCTION(0x0, "gpio_in"), 491 SUNXI_FUNCTION(0x0, "gpio_in"),
429 SUNXI_FUNCTION(0x1, "gpio_out"), 492 SUNXI_FUNCTION(0x1, "gpio_out"),
430 SUNXI_FUNCTION(0x2, "nand0")), /* NDQS */ 493 SUNXI_FUNCTION(0x2, "nand0"), /* NDQS */
494 SUNXI_FUNCTION_VARIANT(0x3, "mmc2", /* RST */
495 PINCTRL_SUN8I_R40)),
431 /* Hole */ 496 /* Hole */
432 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0), 497 SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
433 SUNXI_FUNCTION(0x0, "gpio_in"), 498 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -728,14 +793,18 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
728 SUNXI_FUNCTION(0x2, "ts1"), /* D5 */ 793 SUNXI_FUNCTION(0x2, "ts1"), /* D5 */
729 SUNXI_FUNCTION(0x3, "csi1"), /* D5 */ 794 SUNXI_FUNCTION(0x3, "csi1"), /* D5 */
730 SUNXI_FUNCTION(0x4, "uart3"), /* CTS */ 795 SUNXI_FUNCTION(0x4, "uart3"), /* CTS */
731 SUNXI_FUNCTION(0x5, "csi0")), /* D13 */ 796 SUNXI_FUNCTION(0x5, "csi0"), /* D13 */
797 SUNXI_FUNCTION_VARIANT(0x6, "bist", /* RESULT0 */
798 PINCTRL_SUN8I_R40)),
732 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), 799 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
733 SUNXI_FUNCTION(0x0, "gpio_in"), 800 SUNXI_FUNCTION(0x0, "gpio_in"),
734 SUNXI_FUNCTION(0x1, "gpio_out"), 801 SUNXI_FUNCTION(0x1, "gpio_out"),
735 SUNXI_FUNCTION(0x2, "ts1"), /* D6 */ 802 SUNXI_FUNCTION(0x2, "ts1"), /* D6 */
736 SUNXI_FUNCTION(0x3, "csi1"), /* D6 */ 803 SUNXI_FUNCTION(0x3, "csi1"), /* D6 */
737 SUNXI_FUNCTION(0x4, "uart4"), /* TX */ 804 SUNXI_FUNCTION(0x4, "uart4"), /* TX */
738 SUNXI_FUNCTION(0x5, "csi0")), /* D14 */ 805 SUNXI_FUNCTION(0x5, "csi0"), /* D14 */
806 SUNXI_FUNCTION_VARIANT(0x6, "bist", /* RESULT1 */
807 PINCTRL_SUN8I_R40)),
739 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11), 808 SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
740 SUNXI_FUNCTION(0x0, "gpio_in"), 809 SUNXI_FUNCTION(0x0, "gpio_in"),
741 SUNXI_FUNCTION(0x1, "gpio_out"), 810 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -805,7 +874,9 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
805 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD2 */ 874 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD2 */
806 PINCTRL_SUN4I_A10), 875 PINCTRL_SUN4I_A10),
807 SUNXI_FUNCTION(0x4, "uart5"), /* TX */ 876 SUNXI_FUNCTION(0x4, "uart5"), /* TX */
808 SUNXI_FUNCTION(0x5, "ms"), /* BS */ 877 SUNXI_FUNCTION_VARIANT(0x5, "ms", /* BS */
878 PINCTRL_SUN4I_A10 |
879 PINCTRL_SUN7I_A20),
809 SUNXI_FUNCTION_IRQ(0x6, 6), /* EINT6 */ 880 SUNXI_FUNCTION_IRQ(0x6, 6), /* EINT6 */
810 SUNXI_FUNCTION(0x7, "csi1")), /* D6 */ 881 SUNXI_FUNCTION(0x7, "csi1")), /* D6 */
811 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7), 882 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
@@ -815,7 +886,9 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
815 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD3 */ 886 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD3 */
816 PINCTRL_SUN4I_A10), 887 PINCTRL_SUN4I_A10),
817 SUNXI_FUNCTION(0x4, "uart5"), /* RX */ 888 SUNXI_FUNCTION(0x4, "uart5"), /* RX */
818 SUNXI_FUNCTION(0x5, "ms"), /* CLK */ 889 SUNXI_FUNCTION_VARIANT(0x5, "ms", /* CLK */
890 PINCTRL_SUN4I_A10 |
891 PINCTRL_SUN7I_A20),
819 SUNXI_FUNCTION_IRQ(0x6, 7), /* EINT7 */ 892 SUNXI_FUNCTION_IRQ(0x6, 7), /* EINT7 */
820 SUNXI_FUNCTION(0x7, "csi1")), /* D7 */ 893 SUNXI_FUNCTION(0x7, "csi1")), /* D7 */
821 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8), 894 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
@@ -825,9 +898,12 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
825 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD4 */ 898 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD4 */
826 PINCTRL_SUN4I_A10), 899 PINCTRL_SUN4I_A10),
827 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD3 */ 900 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD3 */
828 PINCTRL_SUN7I_A20), 901 PINCTRL_SUN7I_A20 |
902 PINCTRL_SUN8I_R40),
829 SUNXI_FUNCTION(0x4, "keypad"), /* IN0 */ 903 SUNXI_FUNCTION(0x4, "keypad"), /* IN0 */
830 SUNXI_FUNCTION(0x5, "ms"), /* D0 */ 904 SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D0 */
905 PINCTRL_SUN4I_A10 |
906 PINCTRL_SUN7I_A20),
831 SUNXI_FUNCTION_IRQ(0x6, 8), /* EINT8 */ 907 SUNXI_FUNCTION_IRQ(0x6, 8), /* EINT8 */
832 SUNXI_FUNCTION(0x7, "csi1")), /* D8 */ 908 SUNXI_FUNCTION(0x7, "csi1")), /* D8 */
833 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9), 909 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
@@ -837,9 +913,12 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
837 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD5 */ 913 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD5 */
838 PINCTRL_SUN4I_A10), 914 PINCTRL_SUN4I_A10),
839 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD2 */ 915 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD2 */
840 PINCTRL_SUN7I_A20), 916 PINCTRL_SUN7I_A20 |
917 PINCTRL_SUN8I_R40),
841 SUNXI_FUNCTION(0x4, "keypad"), /* IN1 */ 918 SUNXI_FUNCTION(0x4, "keypad"), /* IN1 */
842 SUNXI_FUNCTION(0x5, "ms"), /* D1 */ 919 SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D1 */
920 PINCTRL_SUN4I_A10 |
921 PINCTRL_SUN7I_A20),
843 SUNXI_FUNCTION_IRQ(0x6, 9), /* EINT9 */ 922 SUNXI_FUNCTION_IRQ(0x6, 9), /* EINT9 */
844 SUNXI_FUNCTION(0x7, "csi1")), /* D9 */ 923 SUNXI_FUNCTION(0x7, "csi1")), /* D9 */
845 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10), 924 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
@@ -849,9 +928,12 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
849 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD6 */ 928 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD6 */
850 PINCTRL_SUN4I_A10), 929 PINCTRL_SUN4I_A10),
851 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD1 */ 930 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD1 */
852 PINCTRL_SUN7I_A20), 931 PINCTRL_SUN7I_A20 |
932 PINCTRL_SUN8I_R40),
853 SUNXI_FUNCTION(0x4, "keypad"), /* IN2 */ 933 SUNXI_FUNCTION(0x4, "keypad"), /* IN2 */
854 SUNXI_FUNCTION(0x5, "ms"), /* D2 */ 934 SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D2 */
935 PINCTRL_SUN4I_A10 |
936 PINCTRL_SUN7I_A20),
855 SUNXI_FUNCTION_IRQ(0x6, 10), /* EINT10 */ 937 SUNXI_FUNCTION_IRQ(0x6, 10), /* EINT10 */
856 SUNXI_FUNCTION(0x7, "csi1")), /* D10 */ 938 SUNXI_FUNCTION(0x7, "csi1")), /* D10 */
857 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11), 939 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
@@ -861,9 +943,12 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
861 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD7 */ 943 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD7 */
862 PINCTRL_SUN4I_A10), 944 PINCTRL_SUN4I_A10),
863 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD0 */ 945 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXD0 */
864 PINCTRL_SUN7I_A20), 946 PINCTRL_SUN7I_A20 |
947 PINCTRL_SUN8I_R40),
865 SUNXI_FUNCTION(0x4, "keypad"), /* IN3 */ 948 SUNXI_FUNCTION(0x4, "keypad"), /* IN3 */
866 SUNXI_FUNCTION(0x5, "ms"), /* D3 */ 949 SUNXI_FUNCTION_VARIANT(0x5, "ms", /* D3 */
950 PINCTRL_SUN4I_A10 |
951 PINCTRL_SUN7I_A20),
867 SUNXI_FUNCTION_IRQ(0x6, 11), /* EINT11 */ 952 SUNXI_FUNCTION_IRQ(0x6, 11), /* EINT11 */
868 SUNXI_FUNCTION(0x7, "csi1")), /* D11 */ 953 SUNXI_FUNCTION(0x7, "csi1")), /* D11 */
869 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12), 954 SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12),
@@ -892,7 +977,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
892 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD10 */ 977 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD10 */
893 PINCTRL_SUN4I_A10), 978 PINCTRL_SUN4I_A10),
894 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD3 */ 979 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD3 */
895 PINCTRL_SUN7I_A20), 980 PINCTRL_SUN7I_A20 |
981 PINCTRL_SUN8I_R40),
896 SUNXI_FUNCTION(0x4, "keypad"), /* IN4 */ 982 SUNXI_FUNCTION(0x4, "keypad"), /* IN4 */
897 SUNXI_FUNCTION(0x5, "sim"), /* VPPEN */ 983 SUNXI_FUNCTION(0x5, "sim"), /* VPPEN */
898 SUNXI_FUNCTION_IRQ(0x6, 14), /* EINT14 */ 984 SUNXI_FUNCTION_IRQ(0x6, 14), /* EINT14 */
@@ -904,7 +990,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
904 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD11 */ 990 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD11 */
905 PINCTRL_SUN4I_A10), 991 PINCTRL_SUN4I_A10),
906 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD2 */ 992 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD2 */
907 PINCTRL_SUN7I_A20), 993 PINCTRL_SUN7I_A20 |
994 PINCTRL_SUN8I_R40),
908 SUNXI_FUNCTION(0x4, "keypad"), /* IN5 */ 995 SUNXI_FUNCTION(0x4, "keypad"), /* IN5 */
909 SUNXI_FUNCTION(0x5, "sim"), /* VPPPP */ 996 SUNXI_FUNCTION(0x5, "sim"), /* VPPPP */
910 SUNXI_FUNCTION_IRQ(0x6, 15), /* EINT15 */ 997 SUNXI_FUNCTION_IRQ(0x6, 15), /* EINT15 */
@@ -916,7 +1003,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
916 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD12 */ 1003 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD12 */
917 PINCTRL_SUN4I_A10), 1004 PINCTRL_SUN4I_A10),
918 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD1 */ 1005 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD1 */
919 PINCTRL_SUN7I_A20), 1006 PINCTRL_SUN7I_A20 |
1007 PINCTRL_SUN8I_R40),
920 SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */ 1008 SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */
921 SUNXI_FUNCTION(0x5, "sim"), /* DET */ 1009 SUNXI_FUNCTION(0x5, "sim"), /* DET */
922 SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */ 1010 SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */
@@ -928,7 +1016,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
928 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD13 */ 1016 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD13 */
929 PINCTRL_SUN4I_A10), 1017 PINCTRL_SUN4I_A10),
930 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD0 */ 1018 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD0 */
931 PINCTRL_SUN7I_A20), 1019 PINCTRL_SUN7I_A20 |
1020 PINCTRL_SUN8I_R40),
932 SUNXI_FUNCTION(0x4, "keypad"), /* IN7 */ 1021 SUNXI_FUNCTION(0x4, "keypad"), /* IN7 */
933 SUNXI_FUNCTION(0x5, "sim"), /* VCCEN */ 1022 SUNXI_FUNCTION(0x5, "sim"), /* VCCEN */
934 SUNXI_FUNCTION_IRQ(0x6, 17), /* EINT17 */ 1023 SUNXI_FUNCTION_IRQ(0x6, 17), /* EINT17 */
@@ -940,7 +1029,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
940 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD14 */ 1029 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD14 */
941 PINCTRL_SUN4I_A10), 1030 PINCTRL_SUN4I_A10),
942 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXCK */ 1031 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXCK */
943 PINCTRL_SUN7I_A20), 1032 PINCTRL_SUN7I_A20 |
1033 PINCTRL_SUN8I_R40),
944 SUNXI_FUNCTION(0x4, "keypad"), /* OUT0 */ 1034 SUNXI_FUNCTION(0x4, "keypad"), /* OUT0 */
945 SUNXI_FUNCTION(0x5, "sim"), /* SCK */ 1035 SUNXI_FUNCTION(0x5, "sim"), /* SCK */
946 SUNXI_FUNCTION_IRQ(0x6, 18), /* EINT18 */ 1036 SUNXI_FUNCTION_IRQ(0x6, 18), /* EINT18 */
@@ -952,7 +1042,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
952 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD15 */ 1042 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAD15 */
953 PINCTRL_SUN4I_A10), 1043 PINCTRL_SUN4I_A10),
954 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXERR */ 1044 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXERR */
955 PINCTRL_SUN7I_A20), 1045 PINCTRL_SUN7I_A20 |
1046 PINCTRL_SUN8I_R40),
956 SUNXI_FUNCTION(0x4, "keypad"), /* OUT1 */ 1047 SUNXI_FUNCTION(0x4, "keypad"), /* OUT1 */
957 SUNXI_FUNCTION(0x5, "sim"), /* SDA */ 1048 SUNXI_FUNCTION(0x5, "sim"), /* SDA */
958 SUNXI_FUNCTION_IRQ(0x6, 19), /* EINT19 */ 1049 SUNXI_FUNCTION_IRQ(0x6, 19), /* EINT19 */
@@ -964,7 +1055,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
964 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAOE */ 1055 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAOE */
965 PINCTRL_SUN4I_A10), 1056 PINCTRL_SUN4I_A10),
966 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXDV */ 1057 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ERXDV */
967 PINCTRL_SUN7I_A20), 1058 PINCTRL_SUN7I_A20 |
1059 PINCTRL_SUN8I_R40),
968 SUNXI_FUNCTION(0x4, "can"), /* TX */ 1060 SUNXI_FUNCTION(0x4, "can"), /* TX */
969 SUNXI_FUNCTION_IRQ(0x6, 20), /* EINT20 */ 1061 SUNXI_FUNCTION_IRQ(0x6, 20), /* EINT20 */
970 SUNXI_FUNCTION(0x7, "csi1")), /* D20 */ 1062 SUNXI_FUNCTION(0x7, "csi1")), /* D20 */
@@ -975,7 +1067,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
975 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATADREQ */ 1067 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATADREQ */
976 PINCTRL_SUN4I_A10), 1068 PINCTRL_SUN4I_A10),
977 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* EMDC */ 1069 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* EMDC */
978 PINCTRL_SUN7I_A20), 1070 PINCTRL_SUN7I_A20 |
1071 PINCTRL_SUN8I_R40),
979 SUNXI_FUNCTION(0x4, "can"), /* RX */ 1072 SUNXI_FUNCTION(0x4, "can"), /* RX */
980 SUNXI_FUNCTION_IRQ(0x6, 21), /* EINT21 */ 1073 SUNXI_FUNCTION_IRQ(0x6, 21), /* EINT21 */
981 SUNXI_FUNCTION(0x7, "csi1")), /* D21 */ 1074 SUNXI_FUNCTION(0x7, "csi1")), /* D21 */
@@ -986,7 +1079,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
986 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATADACK */ 1079 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATADACK */
987 PINCTRL_SUN4I_A10), 1080 PINCTRL_SUN4I_A10),
988 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* EMDIO */ 1081 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* EMDIO */
989 PINCTRL_SUN7I_A20), 1082 PINCTRL_SUN7I_A20 |
1083 PINCTRL_SUN8I_R40),
990 SUNXI_FUNCTION(0x4, "keypad"), /* OUT2 */ 1084 SUNXI_FUNCTION(0x4, "keypad"), /* OUT2 */
991 SUNXI_FUNCTION(0x5, "mmc1"), /* CMD */ 1085 SUNXI_FUNCTION(0x5, "mmc1"), /* CMD */
992 SUNXI_FUNCTION(0x7, "csi1")), /* D22 */ 1086 SUNXI_FUNCTION(0x7, "csi1")), /* D22 */
@@ -997,7 +1091,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
997 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATACS0 */ 1091 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATACS0 */
998 PINCTRL_SUN4I_A10), 1092 PINCTRL_SUN4I_A10),
999 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXEN */ 1093 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXEN */
1000 PINCTRL_SUN7I_A20), 1094 PINCTRL_SUN7I_A20 |
1095 PINCTRL_SUN8I_R40),
1001 SUNXI_FUNCTION(0x4, "keypad"), /* OUT3 */ 1096 SUNXI_FUNCTION(0x4, "keypad"), /* OUT3 */
1002 SUNXI_FUNCTION(0x5, "mmc1"), /* CLK */ 1097 SUNXI_FUNCTION(0x5, "mmc1"), /* CLK */
1003 SUNXI_FUNCTION(0x7, "csi1")), /* D23 */ 1098 SUNXI_FUNCTION(0x7, "csi1")), /* D23 */
@@ -1008,7 +1103,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1008 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATACS1 */ 1103 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATACS1 */
1009 PINCTRL_SUN4I_A10), 1104 PINCTRL_SUN4I_A10),
1010 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXCK */ 1105 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXCK */
1011 PINCTRL_SUN7I_A20), 1106 PINCTRL_SUN7I_A20 |
1107 PINCTRL_SUN8I_R40),
1012 SUNXI_FUNCTION(0x4, "keypad"), /* OUT4 */ 1108 SUNXI_FUNCTION(0x4, "keypad"), /* OUT4 */
1013 SUNXI_FUNCTION(0x5, "mmc1"), /* D0 */ 1109 SUNXI_FUNCTION(0x5, "mmc1"), /* D0 */
1014 SUNXI_FUNCTION(0x7, "csi1")), /* PCLK */ 1110 SUNXI_FUNCTION(0x7, "csi1")), /* PCLK */
@@ -1019,7 +1115,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1019 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIORDY */ 1115 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIORDY */
1020 PINCTRL_SUN4I_A10), 1116 PINCTRL_SUN4I_A10),
1021 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ECRS */ 1117 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ECRS */
1022 PINCTRL_SUN7I_A20), 1118 PINCTRL_SUN7I_A20 |
1119 PINCTRL_SUN8I_R40),
1023 SUNXI_FUNCTION(0x4, "keypad"), /* OUT5 */ 1120 SUNXI_FUNCTION(0x4, "keypad"), /* OUT5 */
1024 SUNXI_FUNCTION(0x5, "mmc1"), /* D1 */ 1121 SUNXI_FUNCTION(0x5, "mmc1"), /* D1 */
1025 SUNXI_FUNCTION(0x7, "csi1")), /* FIELD */ 1122 SUNXI_FUNCTION(0x7, "csi1")), /* FIELD */
@@ -1030,7 +1127,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1030 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIOR */ 1127 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIOR */
1031 PINCTRL_SUN4I_A10), 1128 PINCTRL_SUN4I_A10),
1032 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ECOL */ 1129 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ECOL */
1033 PINCTRL_SUN7I_A20), 1130 PINCTRL_SUN7I_A20 |
1131 PINCTRL_SUN8I_R40),
1034 SUNXI_FUNCTION(0x4, "keypad"), /* OUT6 */ 1132 SUNXI_FUNCTION(0x4, "keypad"), /* OUT6 */
1035 SUNXI_FUNCTION(0x5, "mmc1"), /* D2 */ 1133 SUNXI_FUNCTION(0x5, "mmc1"), /* D2 */
1036 SUNXI_FUNCTION(0x7, "csi1")), /* HSYNC */ 1134 SUNXI_FUNCTION(0x7, "csi1")), /* HSYNC */
@@ -1041,7 +1139,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1041 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIOW */ 1139 SUNXI_FUNCTION_VARIANT(0x3, "pata", /* ATAIOW */
1042 PINCTRL_SUN4I_A10), 1140 PINCTRL_SUN4I_A10),
1043 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXERR */ 1141 SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXERR */
1044 PINCTRL_SUN7I_A20), 1142 PINCTRL_SUN7I_A20 |
1143 PINCTRL_SUN8I_R40),
1045 SUNXI_FUNCTION(0x4, "keypad"), /* OUT7 */ 1144 SUNXI_FUNCTION(0x4, "keypad"), /* OUT7 */
1046 SUNXI_FUNCTION(0x5, "mmc1"), /* D3 */ 1145 SUNXI_FUNCTION(0x5, "mmc1"), /* D3 */
1047 SUNXI_FUNCTION(0x7, "csi1")), /* VSYNC */ 1146 SUNXI_FUNCTION(0x7, "csi1")), /* VSYNC */
@@ -1050,23 +1149,27 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1050 SUNXI_FUNCTION(0x0, "gpio_in"), 1149 SUNXI_FUNCTION(0x0, "gpio_in"),
1051 SUNXI_FUNCTION(0x1, "gpio_out"), 1150 SUNXI_FUNCTION(0x1, "gpio_out"),
1052 SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SCK */ 1151 SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SCK */
1053 PINCTRL_SUN7I_A20)), 1152 PINCTRL_SUN7I_A20 |
1153 PINCTRL_SUN8I_R40)),
1054 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 1), 1154 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 1),
1055 SUNXI_FUNCTION(0x0, "gpio_in"), 1155 SUNXI_FUNCTION(0x0, "gpio_in"),
1056 SUNXI_FUNCTION(0x1, "gpio_out"), 1156 SUNXI_FUNCTION(0x1, "gpio_out"),
1057 SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SDA */ 1157 SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SDA */
1058 PINCTRL_SUN7I_A20)), 1158 PINCTRL_SUN7I_A20 |
1159 PINCTRL_SUN8I_R40)),
1059 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 2), 1160 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 2),
1060 SUNXI_FUNCTION(0x0, "gpio_in"), 1161 SUNXI_FUNCTION(0x0, "gpio_in"),
1061 SUNXI_FUNCTION(0x1, "gpio_out"), 1162 SUNXI_FUNCTION(0x1, "gpio_out"),
1062 SUNXI_FUNCTION_VARIANT(0x3, "i2c4", /* SCK */ 1163 SUNXI_FUNCTION_VARIANT(0x3, "i2c4", /* SCK */
1063 PINCTRL_SUN7I_A20)), 1164 PINCTRL_SUN7I_A20 |
1165 PINCTRL_SUN8I_R40)),
1064 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 3), 1166 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 3),
1065 SUNXI_FUNCTION(0x0, "gpio_in"), 1167 SUNXI_FUNCTION(0x0, "gpio_in"),
1066 SUNXI_FUNCTION(0x1, "gpio_out"), 1168 SUNXI_FUNCTION(0x1, "gpio_out"),
1067 SUNXI_FUNCTION(0x2, "pwm"), /* PWM1 */ 1169 SUNXI_FUNCTION(0x2, "pwm"), /* PWM1 */
1068 SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SDA */ 1170 SUNXI_FUNCTION_VARIANT(0x3, "i2c3", /* SDA */
1069 PINCTRL_SUN7I_A20)), 1171 PINCTRL_SUN7I_A20 |
1172 PINCTRL_SUN8I_R40)),
1070 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 4), 1173 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 4),
1071 SUNXI_FUNCTION(0x0, "gpio_in"), 1174 SUNXI_FUNCTION(0x0, "gpio_in"),
1072 SUNXI_FUNCTION(0x1, "gpio_out"), 1175 SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -1109,7 +1212,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1109 SUNXI_FUNCTION(0x2, "spi0"), /* MOSI */ 1212 SUNXI_FUNCTION(0x2, "spi0"), /* MOSI */
1110 SUNXI_FUNCTION(0x3, "uart6"), /* TX */ 1213 SUNXI_FUNCTION(0x3, "uart6"), /* TX */
1111 SUNXI_FUNCTION_VARIANT(0x4, "clk_out_a", 1214 SUNXI_FUNCTION_VARIANT(0x4, "clk_out_a",
1112 PINCTRL_SUN7I_A20), 1215 PINCTRL_SUN7I_A20 |
1216 PINCTRL_SUN8I_R40),
1113 SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */ 1217 SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
1114 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 13), 1218 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 13),
1115 SUNXI_FUNCTION(0x0, "gpio_in"), 1219 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -1117,7 +1221,8 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1117 SUNXI_FUNCTION(0x2, "spi0"), /* MISO */ 1221 SUNXI_FUNCTION(0x2, "spi0"), /* MISO */
1118 SUNXI_FUNCTION(0x3, "uart6"), /* RX */ 1222 SUNXI_FUNCTION(0x3, "uart6"), /* RX */
1119 SUNXI_FUNCTION_VARIANT(0x4, "clk_out_b", 1223 SUNXI_FUNCTION_VARIANT(0x4, "clk_out_b",
1120 PINCTRL_SUN7I_A20), 1224 PINCTRL_SUN7I_A20 |
1225 PINCTRL_SUN8I_R40),
1121 SUNXI_FUNCTION_IRQ(0x6, 25)), /* EINT25 */ 1226 SUNXI_FUNCTION_IRQ(0x6, 25)), /* EINT25 */
1122 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 14), 1227 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 14),
1123 SUNXI_FUNCTION(0x0, "gpio_in"), 1228 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -1162,13 +1267,21 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
1162 SUNXI_FUNCTION(0x1, "gpio_out"), 1267 SUNXI_FUNCTION(0x1, "gpio_out"),
1163 SUNXI_FUNCTION(0x2, "ps2"), /* SCK0 */ 1268 SUNXI_FUNCTION(0x2, "ps2"), /* SCK0 */
1164 SUNXI_FUNCTION(0x3, "uart7"), /* TX */ 1269 SUNXI_FUNCTION(0x3, "uart7"), /* TX */
1165 SUNXI_FUNCTION(0x4, "hdmi")), /* HSCL */ 1270 SUNXI_FUNCTION_VARIANT(0x4, "hdmi", /* HSCL */
1271 PINCTRL_SUN4I_A10 |
1272 PINCTRL_SUN7I_A20),
1273 SUNXI_FUNCTION_VARIANT(0x6, "pwm", /* PWM2 */
1274 PINCTRL_SUN8I_R40)),
1166 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 21), 1275 SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 21),
1167 SUNXI_FUNCTION(0x0, "gpio_in"), 1276 SUNXI_FUNCTION(0x0, "gpio_in"),
1168 SUNXI_FUNCTION(0x1, "gpio_out"), 1277 SUNXI_FUNCTION(0x1, "gpio_out"),
1169 SUNXI_FUNCTION(0x2, "ps2"), /* SDA0 */ 1278 SUNXI_FUNCTION(0x2, "ps2"), /* SDA0 */
1170 SUNXI_FUNCTION(0x3, "uart7"), /* RX */ 1279 SUNXI_FUNCTION(0x3, "uart7"), /* RX */
1171 SUNXI_FUNCTION(0x4, "hdmi")), /* HSDA */ 1280 SUNXI_FUNCTION_VARIANT(0x4, "hdmi", /* HSDA */
1281 PINCTRL_SUN4I_A10 |
1282 PINCTRL_SUN7I_A20),
1283 SUNXI_FUNCTION_VARIANT(0x6, "pwm", /* PWM3 */
1284 PINCTRL_SUN8I_R40)),
1172}; 1285};
1173 1286
1174static const struct sunxi_pinctrl_desc sun4i_a10_pinctrl_data = { 1287static const struct sunxi_pinctrl_desc sun4i_a10_pinctrl_data = {
@@ -1195,6 +1308,10 @@ static const struct of_device_id sun4i_a10_pinctrl_match[] = {
1195 .compatible = "allwinner,sun7i-a20-pinctrl", 1308 .compatible = "allwinner,sun7i-a20-pinctrl",
1196 .data = (void *)PINCTRL_SUN7I_A20 1309 .data = (void *)PINCTRL_SUN7I_A20
1197 }, 1310 },
1311 {
1312 .compatible = "allwinner,sun8i-r40-pinctrl",
1313 .data = (void *)PINCTRL_SUN8I_R40
1314 },
1198 {} 1315 {}
1199}; 1316};
1200 1317
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
index ccf9419e9418..97b48336f84a 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
@@ -19,6 +19,7 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/of.h> 20#include <linux/of.h>
21#include <linux/of_device.h> 21#include <linux/of_device.h>
22#include <linux/of_irq.h>
22#include <linux/pinctrl/pinctrl.h> 23#include <linux/pinctrl/pinctrl.h>
23 24
24#include "pinctrl-sunxi.h" 25#include "pinctrl-sunxi.h"
@@ -530,17 +531,36 @@ static const struct sunxi_desc_pin sun50i_h5_pins[] = {
530 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PG_EINT13 */ 531 SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PG_EINT13 */
531}; 532};
532 533
533static const struct sunxi_pinctrl_desc sun50i_h5_pinctrl_data = { 534static const struct sunxi_pinctrl_desc sun50i_h5_pinctrl_data_broken = {
534 .pins = sun50i_h5_pins, 535 .pins = sun50i_h5_pins,
535 .npins = ARRAY_SIZE(sun50i_h5_pins), 536 .npins = ARRAY_SIZE(sun50i_h5_pins),
536 .irq_banks = 2, 537 .irq_banks = 2,
537 .irq_read_needs_mux = true 538 .irq_read_needs_mux = true
538}; 539};
539 540
541static const struct sunxi_pinctrl_desc sun50i_h5_pinctrl_data = {
542 .pins = sun50i_h5_pins,
543 .npins = ARRAY_SIZE(sun50i_h5_pins),
544 .irq_banks = 3,
545 .irq_read_needs_mux = true
546};
547
540static int sun50i_h5_pinctrl_probe(struct platform_device *pdev) 548static int sun50i_h5_pinctrl_probe(struct platform_device *pdev)
541{ 549{
542 return sunxi_pinctrl_init(pdev, 550 switch (of_irq_count(pdev->dev.of_node)) {
543 &sun50i_h5_pinctrl_data); 551 case 2:
552 dev_warn(&pdev->dev,
553 "Your device tree's pinctrl node is broken, which has no IRQ of PG bank routed.\n");
554 dev_warn(&pdev->dev,
555 "Please update the device tree, otherwise PG bank IRQ won't work.\n");
556 return sunxi_pinctrl_init(pdev,
557 &sun50i_h5_pinctrl_data_broken);
558 case 3:
559 return sunxi_pinctrl_init(pdev,
560 &sun50i_h5_pinctrl_data);
561 default:
562 return -EINVAL;
563 }
544} 564}
545 565
546static const struct of_device_id sun50i_h5_pinctrl_match[] = { 566static const struct of_device_id sun50i_h5_pinctrl_match[] = {
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c
index a22bd88a1f03..49a1deb97bb7 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c
@@ -25,12 +25,12 @@ static const struct sunxi_desc_pin sun6i_a31_r_pins[] = {
25 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0), 25 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
26 SUNXI_FUNCTION(0x0, "gpio_in"), 26 SUNXI_FUNCTION(0x0, "gpio_in"),
27 SUNXI_FUNCTION(0x1, "gpio_out"), 27 SUNXI_FUNCTION(0x1, "gpio_out"),
28 SUNXI_FUNCTION(0x2, "s_twi"), /* SCK */ 28 SUNXI_FUNCTION(0x2, "s_i2c"), /* SCK */
29 SUNXI_FUNCTION(0x3, "s_p2wi")), /* SCK */ 29 SUNXI_FUNCTION(0x3, "s_p2wi")), /* SCK */
30 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1), 30 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
31 SUNXI_FUNCTION(0x0, "gpio_in"), 31 SUNXI_FUNCTION(0x0, "gpio_in"),
32 SUNXI_FUNCTION(0x1, "gpio_out"), 32 SUNXI_FUNCTION(0x1, "gpio_out"),
33 SUNXI_FUNCTION(0x2, "s_twi"), /* SDA */ 33 SUNXI_FUNCTION(0x2, "s_i2c"), /* SDA */
34 SUNXI_FUNCTION(0x3, "s_p2wi")), /* SDA */ 34 SUNXI_FUNCTION(0x3, "s_p2wi")), /* SDA */
35 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2), 35 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2),
36 SUNXI_FUNCTION(0x0, "gpio_in"), 36 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -113,7 +113,7 @@ static int sun6i_a31_r_pinctrl_probe(struct platform_device *pdev)
113 struct reset_control *rstc; 113 struct reset_control *rstc;
114 int ret; 114 int ret;
115 115
116 rstc = devm_reset_control_get(&pdev->dev, NULL); 116 rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
117 if (IS_ERR(rstc)) { 117 if (IS_ERR(rstc)) {
118 dev_err(&pdev->dev, "Reset controller missing\n"); 118 dev_err(&pdev->dev, "Reset controller missing\n");
119 return PTR_ERR(rstc); 119 return PTR_ERR(rstc);
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c
index 2292e05a397b..67ee6f9b3b68 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c
@@ -29,13 +29,13 @@ static const struct sunxi_desc_pin sun8i_a23_r_pins[] = {
29 SUNXI_FUNCTION(0x0, "gpio_in"), 29 SUNXI_FUNCTION(0x0, "gpio_in"),
30 SUNXI_FUNCTION(0x1, "gpio_out"), 30 SUNXI_FUNCTION(0x1, "gpio_out"),
31 SUNXI_FUNCTION(0x2, "s_rsb"), /* SCK */ 31 SUNXI_FUNCTION(0x2, "s_rsb"), /* SCK */
32 SUNXI_FUNCTION(0x3, "s_twi"), /* SCK */ 32 SUNXI_FUNCTION(0x3, "s_i2c"), /* SCK */
33 SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 0)), /* PL_EINT0 */ 33 SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 0)), /* PL_EINT0 */
34 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1), 34 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
35 SUNXI_FUNCTION(0x0, "gpio_in"), 35 SUNXI_FUNCTION(0x0, "gpio_in"),
36 SUNXI_FUNCTION(0x1, "gpio_out"), 36 SUNXI_FUNCTION(0x1, "gpio_out"),
37 SUNXI_FUNCTION(0x2, "s_rsb"), /* SDA */ 37 SUNXI_FUNCTION(0x2, "s_rsb"), /* SDA */
38 SUNXI_FUNCTION(0x3, "s_twi"), /* SDA */ 38 SUNXI_FUNCTION(0x3, "s_i2c"), /* SDA */
39 SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 1)), /* PL_EINT1 */ 39 SUNXI_FUNCTION_IRQ_BANK(0x4, 0, 1)), /* PL_EINT1 */
40 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2), 40 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2),
41 SUNXI_FUNCTION(0x0, "gpio_in"), 41 SUNXI_FUNCTION(0x0, "gpio_in"),
@@ -100,7 +100,7 @@ static int sun8i_a23_r_pinctrl_probe(struct platform_device *pdev)
100 struct reset_control *rstc; 100 struct reset_control *rstc;
101 int ret; 101 int ret;
102 102
103 rstc = devm_reset_control_get(&pdev->dev, NULL); 103 rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
104 if (IS_ERR(rstc)) { 104 if (IS_ERR(rstc)) {
105 dev_err(&pdev->dev, "Reset controller missing\n"); 105 dev_err(&pdev->dev, "Reset controller missing\n");
106 return PTR_ERR(rstc); 106 return PTR_ERR(rstc);
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c
index 686ec212120b..ebfd9a26628c 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c
@@ -20,12 +20,12 @@ static const struct sunxi_desc_pin sun8i_h3_r_pins[] = {
20 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0), 20 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
21 SUNXI_FUNCTION(0x0, "gpio_in"), 21 SUNXI_FUNCTION(0x0, "gpio_in"),
22 SUNXI_FUNCTION(0x1, "gpio_out"), 22 SUNXI_FUNCTION(0x1, "gpio_out"),
23 SUNXI_FUNCTION(0x2, "s_twi"), /* SCK */ 23 SUNXI_FUNCTION(0x2, "s_i2c"), /* SCK */
24 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PL_EINT0 */ 24 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PL_EINT0 */
25 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1), 25 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
26 SUNXI_FUNCTION(0x0, "gpio_in"), 26 SUNXI_FUNCTION(0x0, "gpio_in"),
27 SUNXI_FUNCTION(0x1, "gpio_out"), 27 SUNXI_FUNCTION(0x1, "gpio_out"),
28 SUNXI_FUNCTION(0x2, "s_twi"), /* SDA */ 28 SUNXI_FUNCTION(0x2, "s_i2c"), /* SDA */
29 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PL_EINT1 */ 29 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PL_EINT1 */
30 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2), 30 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2),
31 SUNXI_FUNCTION(0x0, "gpio_in"), 31 SUNXI_FUNCTION(0x0, "gpio_in"),
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
index c86d3c42a905..496ba34e1f5f 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
@@ -297,6 +297,7 @@ static const struct sunxi_pinctrl_desc sun8i_v3s_pinctrl_data = {
297 .pins = sun8i_v3s_pins, 297 .pins = sun8i_v3s_pins,
298 .npins = ARRAY_SIZE(sun8i_v3s_pins), 298 .npins = ARRAY_SIZE(sun8i_v3s_pins),
299 .irq_banks = 2, 299 .irq_banks = 2,
300 .irq_bank_base = 1,
300 .irq_read_needs_mux = true 301 .irq_read_needs_mux = true
301}; 302};
302 303
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 0dfd7fa66c48..52edf3b5988d 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -564,7 +564,8 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
564 val = arg / 10 - 1; 564 val = arg / 10 - 1;
565 break; 565 break;
566 case PIN_CONFIG_BIAS_DISABLE: 566 case PIN_CONFIG_BIAS_DISABLE:
567 continue; 567 val = 0;
568 break;
568 case PIN_CONFIG_BIAS_PULL_UP: 569 case PIN_CONFIG_BIAS_PULL_UP:
569 if (arg == 0) 570 if (arg == 0)
570 return -EINVAL; 571 return -EINVAL;
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
index ebedc2d32411..9d653c24219c 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
@@ -901,7 +901,7 @@ int tegra_xusb_padctl_legacy_probe(struct platform_device *pdev)
901 if (IS_ERR(padctl->regs)) 901 if (IS_ERR(padctl->regs))
902 return PTR_ERR(padctl->regs); 902 return PTR_ERR(padctl->regs);
903 903
904 padctl->rst = devm_reset_control_get(&pdev->dev, NULL); 904 padctl->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
905 if (IS_ERR(padctl->rst)) 905 if (IS_ERR(padctl->rst))
906 return PTR_ERR(padctl->rst); 906 return PTR_ERR(padctl->rst);
907 907
diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 362c50918c13..5c1b6325d80d 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -716,7 +716,7 @@ static void ti_iodelay_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
716} 716}
717#endif 717#endif
718 718
719static struct pinctrl_ops ti_iodelay_pinctrl_ops = { 719static const struct pinctrl_ops ti_iodelay_pinctrl_ops = {
720 .get_groups_count = pinctrl_generic_get_group_count, 720 .get_groups_count = pinctrl_generic_get_group_count,
721 .get_group_name = pinctrl_generic_get_group_name, 721 .get_group_name = pinctrl_generic_get_group_name,
722 .get_group_pins = pinctrl_generic_get_group_pins, 722 .get_group_pins = pinctrl_generic_get_group_pins,
@@ -726,7 +726,7 @@ static struct pinctrl_ops ti_iodelay_pinctrl_ops = {
726 .dt_node_to_map = ti_iodelay_dt_node_to_map, 726 .dt_node_to_map = ti_iodelay_dt_node_to_map,
727}; 727};
728 728
729static struct pinconf_ops ti_iodelay_pinctrl_pinconf_ops = { 729static const struct pinconf_ops ti_iodelay_pinctrl_pinconf_ops = {
730 .pin_config_group_get = ti_iodelay_pinconf_group_get, 730 .pin_config_group_get = ti_iodelay_pinconf_group_get,
731 .pin_config_group_set = ti_iodelay_pinconf_group_set, 731 .pin_config_group_set = ti_iodelay_pinconf_group_set,
732#ifdef CONFIG_DEBUG_FS 732#ifdef CONFIG_DEBUG_FS
diff --git a/drivers/pinctrl/uniphier/Kconfig b/drivers/pinctrl/uniphier/Kconfig
index e5826eaa7170..9f2a1c666def 100644
--- a/drivers/pinctrl/uniphier/Kconfig
+++ b/drivers/pinctrl/uniphier/Kconfig
@@ -40,4 +40,8 @@ config PINCTRL_UNIPHIER_LD20
40 bool "UniPhier LD20 SoC pinctrl driver" 40 bool "UniPhier LD20 SoC pinctrl driver"
41 default ARM64 41 default ARM64
42 42
43config PINCTRL_UNIPHIER_PXS3
44 bool "UniPhier PXs3 SoC pinctrl driver"
45 default ARM64
46
43endif 47endif
diff --git a/drivers/pinctrl/uniphier/Makefile b/drivers/pinctrl/uniphier/Makefile
index 9f4bc8aa6f68..d592ff77d60f 100644
--- a/drivers/pinctrl/uniphier/Makefile
+++ b/drivers/pinctrl/uniphier/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_PINCTRL_UNIPHIER_PXS2) += pinctrl-uniphier-pxs2.o
8obj-$(CONFIG_PINCTRL_UNIPHIER_LD6B) += pinctrl-uniphier-ld6b.o 8obj-$(CONFIG_PINCTRL_UNIPHIER_LD6B) += pinctrl-uniphier-ld6b.o
9obj-$(CONFIG_PINCTRL_UNIPHIER_LD11) += pinctrl-uniphier-ld11.o 9obj-$(CONFIG_PINCTRL_UNIPHIER_LD11) += pinctrl-uniphier-ld11.o
10obj-$(CONFIG_PINCTRL_UNIPHIER_LD20) += pinctrl-uniphier-ld20.o 10obj-$(CONFIG_PINCTRL_UNIPHIER_LD20) += pinctrl-uniphier-ld20.o
11obj-$(CONFIG_PINCTRL_UNIPHIER_PXS3) += pinctrl-uniphier-pxs3.o
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
index 30dec0ee7f35..f9267fabe6b0 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
@@ -13,7 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 */ 14 */
15 15
16#include <linux/export.h> 16#include <linux/list.h>
17#include <linux/mfd/syscon.h> 17#include <linux/mfd/syscon.h>
18#include <linux/of.h> 18#include <linux/of.h>
19#include <linux/pinctrl/pinconf.h> 19#include <linux/pinctrl/pinconf.h>
@@ -33,13 +33,21 @@
33#define UNIPHIER_PINCTRL_DRV2CTRL_BASE 0x1900 33#define UNIPHIER_PINCTRL_DRV2CTRL_BASE 0x1900
34#define UNIPHIER_PINCTRL_DRV3CTRL_BASE 0x1980 34#define UNIPHIER_PINCTRL_DRV3CTRL_BASE 0x1980
35#define UNIPHIER_PINCTRL_PUPDCTRL_BASE 0x1a00 35#define UNIPHIER_PINCTRL_PUPDCTRL_BASE 0x1a00
36#define UNIPHIER_PINCTRL_IECTRL 0x1d00 36#define UNIPHIER_PINCTRL_IECTRL_BASE 0x1d00
37
38struct uniphier_pinctrl_reg_region {
39 struct list_head node;
40 unsigned int base;
41 unsigned int nregs;
42 u32 vals[0];
43};
37 44
38struct uniphier_pinctrl_priv { 45struct uniphier_pinctrl_priv {
39 struct pinctrl_desc pctldesc; 46 struct pinctrl_desc pctldesc;
40 struct pinctrl_dev *pctldev; 47 struct pinctrl_dev *pctldev;
41 struct regmap *regmap; 48 struct regmap *regmap;
42 struct uniphier_pinctrl_socdata *socdata; 49 struct uniphier_pinctrl_socdata *socdata;
50 struct list_head reg_regions;
43}; 51};
44 52
45static int uniphier_pctl_get_groups_count(struct pinctrl_dev *pctldev) 53static int uniphier_pctl_get_groups_count(struct pinctrl_dev *pctldev)
@@ -139,10 +147,11 @@ static const struct pinctrl_ops uniphier_pctlops = {
139}; 147};
140 148
141static int uniphier_conf_pin_bias_get(struct pinctrl_dev *pctldev, 149static int uniphier_conf_pin_bias_get(struct pinctrl_dev *pctldev,
142 const struct pin_desc *desc, 150 unsigned int pin,
143 enum pin_config_param param) 151 enum pin_config_param param)
144{ 152{
145 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 153 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
154 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
146 enum uniphier_pin_pull_dir pull_dir = 155 enum uniphier_pin_pull_dir pull_dir =
147 uniphier_pin_get_pull_dir(desc->drv_data); 156 uniphier_pin_get_pull_dir(desc->drv_data);
148 unsigned int pupdctrl, reg, shift, val; 157 unsigned int pupdctrl, reg, shift, val;
@@ -189,10 +198,10 @@ static int uniphier_conf_pin_bias_get(struct pinctrl_dev *pctldev,
189} 198}
190 199
191static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev, 200static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev,
192 const struct pin_desc *desc, 201 unsigned int pin, u32 *strength)
193 u16 *strength)
194{ 202{
195 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 203 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
204 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
196 enum uniphier_pin_drv_type type = 205 enum uniphier_pin_drv_type type =
197 uniphier_pin_get_drv_type(desc->drv_data); 206 uniphier_pin_get_drv_type(desc->drv_data);
198 const unsigned int strength_1bit[] = {4, 8}; 207 const unsigned int strength_1bit[] = {4, 8};
@@ -249,46 +258,52 @@ static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev,
249} 258}
250 259
251static int uniphier_conf_pin_input_enable_get(struct pinctrl_dev *pctldev, 260static int uniphier_conf_pin_input_enable_get(struct pinctrl_dev *pctldev,
252 const struct pin_desc *desc) 261 unsigned int pin)
253{ 262{
254 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 263 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
264 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
255 unsigned int iectrl = uniphier_pin_get_iectrl(desc->drv_data); 265 unsigned int iectrl = uniphier_pin_get_iectrl(desc->drv_data);
256 unsigned int val; 266 unsigned int reg, mask, val;
257 int ret; 267 int ret;
258 268
259 if (iectrl == UNIPHIER_PIN_IECTRL_NONE) 269 if (iectrl == UNIPHIER_PIN_IECTRL_NONE)
260 /* This pin is always input-enabled. */ 270 /* This pin is always input-enabled. */
261 return 0; 271 return 0;
262 272
263 ret = regmap_read(priv->regmap, UNIPHIER_PINCTRL_IECTRL, &val); 273 if (priv->socdata->caps & UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL)
274 iectrl = pin;
275
276 reg = UNIPHIER_PINCTRL_IECTRL_BASE + iectrl / 32 * 4;
277 mask = BIT(iectrl % 32);
278
279 ret = regmap_read(priv->regmap, reg, &val);
264 if (ret) 280 if (ret)
265 return ret; 281 return ret;
266 282
267 return val & BIT(iectrl) ? 0 : -EINVAL; 283 return val & mask ? 0 : -EINVAL;
268} 284}
269 285
270static int uniphier_conf_pin_config_get(struct pinctrl_dev *pctldev, 286static int uniphier_conf_pin_config_get(struct pinctrl_dev *pctldev,
271 unsigned pin, 287 unsigned pin,
272 unsigned long *configs) 288 unsigned long *configs)
273{ 289{
274 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
275 enum pin_config_param param = pinconf_to_config_param(*configs); 290 enum pin_config_param param = pinconf_to_config_param(*configs);
276 bool has_arg = false; 291 bool has_arg = false;
277 u16 arg; 292 u32 arg;
278 int ret; 293 int ret;
279 294
280 switch (param) { 295 switch (param) {
281 case PIN_CONFIG_BIAS_DISABLE: 296 case PIN_CONFIG_BIAS_DISABLE:
282 case PIN_CONFIG_BIAS_PULL_UP: 297 case PIN_CONFIG_BIAS_PULL_UP:
283 case PIN_CONFIG_BIAS_PULL_DOWN: 298 case PIN_CONFIG_BIAS_PULL_DOWN:
284 ret = uniphier_conf_pin_bias_get(pctldev, desc, param); 299 ret = uniphier_conf_pin_bias_get(pctldev, pin, param);
285 break; 300 break;
286 case PIN_CONFIG_DRIVE_STRENGTH: 301 case PIN_CONFIG_DRIVE_STRENGTH:
287 ret = uniphier_conf_pin_drive_get(pctldev, desc, &arg); 302 ret = uniphier_conf_pin_drive_get(pctldev, pin, &arg);
288 has_arg = true; 303 has_arg = true;
289 break; 304 break;
290 case PIN_CONFIG_INPUT_ENABLE: 305 case PIN_CONFIG_INPUT_ENABLE:
291 ret = uniphier_conf_pin_input_enable_get(pctldev, desc); 306 ret = uniphier_conf_pin_input_enable_get(pctldev, pin);
292 break; 307 break;
293 default: 308 default:
294 /* unsupported parameter */ 309 /* unsupported parameter */
@@ -303,10 +318,11 @@ static int uniphier_conf_pin_config_get(struct pinctrl_dev *pctldev,
303} 318}
304 319
305static int uniphier_conf_pin_bias_set(struct pinctrl_dev *pctldev, 320static int uniphier_conf_pin_bias_set(struct pinctrl_dev *pctldev,
306 const struct pin_desc *desc, 321 unsigned int pin,
307 enum pin_config_param param, u32 arg) 322 enum pin_config_param param, u32 arg)
308{ 323{
309 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 324 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
325 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
310 enum uniphier_pin_pull_dir pull_dir = 326 enum uniphier_pin_pull_dir pull_dir =
311 uniphier_pin_get_pull_dir(desc->drv_data); 327 uniphier_pin_get_pull_dir(desc->drv_data);
312 unsigned int pupdctrl, reg, shift; 328 unsigned int pupdctrl, reg, shift;
@@ -377,10 +393,10 @@ static int uniphier_conf_pin_bias_set(struct pinctrl_dev *pctldev,
377} 393}
378 394
379static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev, 395static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
380 const struct pin_desc *desc, 396 unsigned int pin, u32 strength)
381 u16 strength)
382{ 397{
383 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 398 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
399 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
384 enum uniphier_pin_drv_type type = 400 enum uniphier_pin_drv_type type =
385 uniphier_pin_get_drv_type(desc->drv_data); 401 uniphier_pin_get_drv_type(desc->drv_data);
386 const unsigned int strength_1bit[] = {4, 8, -1}; 402 const unsigned int strength_1bit[] = {4, 8, -1};
@@ -438,10 +454,10 @@ static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
438} 454}
439 455
440static int uniphier_conf_pin_input_enable(struct pinctrl_dev *pctldev, 456static int uniphier_conf_pin_input_enable(struct pinctrl_dev *pctldev,
441 const struct pin_desc *desc, 457 unsigned int pin, u32 enable)
442 u16 enable)
443{ 458{
444 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 459 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
460 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
445 unsigned int iectrl = uniphier_pin_get_iectrl(desc->drv_data); 461 unsigned int iectrl = uniphier_pin_get_iectrl(desc->drv_data);
446 unsigned int reg, mask; 462 unsigned int reg, mask;
447 463
@@ -457,7 +473,10 @@ static int uniphier_conf_pin_input_enable(struct pinctrl_dev *pctldev,
457 if (iectrl == UNIPHIER_PIN_IECTRL_NONE) 473 if (iectrl == UNIPHIER_PIN_IECTRL_NONE)
458 return enable ? 0 : -EINVAL; 474 return enable ? 0 : -EINVAL;
459 475
460 reg = UNIPHIER_PINCTRL_IECTRL + iectrl / 32 * 4; 476 if (priv->socdata->caps & UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL)
477 iectrl = pin;
478
479 reg = UNIPHIER_PINCTRL_IECTRL_BASE + iectrl / 32 * 4;
461 mask = BIT(iectrl % 32); 480 mask = BIT(iectrl % 32);
462 481
463 return regmap_update_bits(priv->regmap, reg, mask, enable ? mask : 0); 482 return regmap_update_bits(priv->regmap, reg, mask, enable ? mask : 0);
@@ -468,7 +487,6 @@ static int uniphier_conf_pin_config_set(struct pinctrl_dev *pctldev,
468 unsigned long *configs, 487 unsigned long *configs,
469 unsigned num_configs) 488 unsigned num_configs)
470{ 489{
471 const struct pin_desc *desc = pin_desc_get(pctldev, pin);
472 int i, ret; 490 int i, ret;
473 491
474 for (i = 0; i < num_configs; i++) { 492 for (i = 0; i < num_configs; i++) {
@@ -481,15 +499,14 @@ static int uniphier_conf_pin_config_set(struct pinctrl_dev *pctldev,
481 case PIN_CONFIG_BIAS_PULL_UP: 499 case PIN_CONFIG_BIAS_PULL_UP:
482 case PIN_CONFIG_BIAS_PULL_DOWN: 500 case PIN_CONFIG_BIAS_PULL_DOWN:
483 case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: 501 case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
484 ret = uniphier_conf_pin_bias_set(pctldev, desc, 502 ret = uniphier_conf_pin_bias_set(pctldev, pin,
485 param, arg); 503 param, arg);
486 break; 504 break;
487 case PIN_CONFIG_DRIVE_STRENGTH: 505 case PIN_CONFIG_DRIVE_STRENGTH:
488 ret = uniphier_conf_pin_drive_set(pctldev, desc, arg); 506 ret = uniphier_conf_pin_drive_set(pctldev, pin, arg);
489 break; 507 break;
490 case PIN_CONFIG_INPUT_ENABLE: 508 case PIN_CONFIG_INPUT_ENABLE:
491 ret = uniphier_conf_pin_input_enable(pctldev, desc, 509 ret = uniphier_conf_pin_input_enable(pctldev, pin, arg);
492 arg);
493 break; 510 break;
494 default: 511 default:
495 dev_err(pctldev->dev, 512 dev_err(pctldev->dev,
@@ -569,8 +586,7 @@ static int uniphier_pmx_set_one_mux(struct pinctrl_dev *pctldev, unsigned pin,
569 int ret; 586 int ret;
570 587
571 /* some pins need input-enabling */ 588 /* some pins need input-enabling */
572 ret = uniphier_conf_pin_input_enable(pctldev, 589 ret = uniphier_conf_pin_input_enable(pctldev, pin, 1);
573 pin_desc_get(pctldev, pin), 1);
574 if (ret) 590 if (ret)
575 return ret; 591 return ret;
576 592
@@ -649,30 +665,27 @@ static int uniphier_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
649 unsigned offset) 665 unsigned offset)
650{ 666{
651 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev); 667 struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
652 const struct uniphier_pinctrl_group *groups = priv->socdata->groups; 668 unsigned int gpio_offset;
653 int groups_count = priv->socdata->groups_count; 669 int muxval, i;
654 enum uniphier_pinmux_gpio_range_type range_type; 670
655 int i, j; 671 if (range->pins) {
656 672 for (i = 0; i < range->npins; i++)
657 if (strstr(range->name, "irq")) 673 if (range->pins[i] == offset)
658 range_type = UNIPHIER_PINMUX_GPIO_RANGE_IRQ; 674 break;
659 else 675
660 range_type = UNIPHIER_PINMUX_GPIO_RANGE_PORT; 676 if (WARN_ON(i == range->npins))
661 677 return -EINVAL;
662 for (i = 0; i < groups_count; i++) { 678
663 if (groups[i].range_type != range_type) 679 gpio_offset = i;
664 continue; 680 } else {
665 681 gpio_offset = offset - range->pin_base;
666 for (j = 0; j < groups[i].num_pins; j++)
667 if (groups[i].pins[j] == offset)
668 goto found;
669 } 682 }
670 683
671 dev_err(pctldev->dev, "pin %u does not support GPIO\n", offset); 684 gpio_offset += range->id;
672 return -EINVAL; 685
686 muxval = priv->socdata->get_gpio_muxval(offset, gpio_offset);
673 687
674found: 688 return uniphier_pmx_set_one_mux(pctldev, offset, muxval);
675 return uniphier_pmx_set_one_mux(pctldev, offset, groups[i].muxvals[j]);
676} 689}
677 690
678static const struct pinmux_ops uniphier_pmxops = { 691static const struct pinmux_ops uniphier_pmxops = {
@@ -684,12 +697,177 @@ static const struct pinmux_ops uniphier_pmxops = {
684 .strict = true, 697 .strict = true,
685}; 698};
686 699
700#ifdef CONFIG_PM_SLEEP
701static int uniphier_pinctrl_suspend(struct device *dev)
702{
703 struct uniphier_pinctrl_priv *priv = dev_get_drvdata(dev);
704 struct uniphier_pinctrl_reg_region *r;
705 int ret;
706
707 list_for_each_entry(r, &priv->reg_regions, node) {
708 ret = regmap_bulk_read(priv->regmap, r->base, r->vals,
709 r->nregs);
710 if (ret)
711 return ret;
712 }
713
714 return 0;
715}
716
717static int uniphier_pinctrl_resume(struct device *dev)
718{
719 struct uniphier_pinctrl_priv *priv = dev_get_drvdata(dev);
720 struct uniphier_pinctrl_reg_region *r;
721 int ret;
722
723 list_for_each_entry(r, &priv->reg_regions, node) {
724 ret = regmap_bulk_write(priv->regmap, r->base, r->vals,
725 r->nregs);
726 if (ret)
727 return ret;
728 }
729
730 if (priv->socdata->caps & UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE) {
731 ret = regmap_write(priv->regmap,
732 UNIPHIER_PINCTRL_LOAD_PINMUX, 1);
733 if (ret)
734 return ret;
735 }
736
737 return 0;
738}
739
740static int uniphier_pinctrl_add_reg_region(struct device *dev,
741 struct uniphier_pinctrl_priv *priv,
742 unsigned int base,
743 unsigned int count,
744 unsigned int width)
745{
746 struct uniphier_pinctrl_reg_region *region;
747 unsigned int nregs;
748
749 if (!count)
750 return 0;
751
752 nregs = DIV_ROUND_UP(count * width, 32);
753
754 region = devm_kzalloc(dev,
755 sizeof(*region) + sizeof(region->vals[0]) * nregs,
756 GFP_KERNEL);
757 if (!region)
758 return -ENOMEM;
759
760 region->base = base;
761 region->nregs = nregs;
762
763 list_add_tail(&region->node, &priv->reg_regions);
764
765 return 0;
766}
767#endif
768
769static int uniphier_pinctrl_pm_init(struct device *dev,
770 struct uniphier_pinctrl_priv *priv)
771{
772#ifdef CONFIG_PM_SLEEP
773 const struct uniphier_pinctrl_socdata *socdata = priv->socdata;
774 unsigned int num_drvctrl = 0;
775 unsigned int num_drv2ctrl = 0;
776 unsigned int num_drv3ctrl = 0;
777 unsigned int num_pupdctrl = 0;
778 unsigned int num_iectrl = 0;
779 unsigned int iectrl, drvctrl, pupdctrl;
780 enum uniphier_pin_drv_type drv_type;
781 enum uniphier_pin_pull_dir pull_dir;
782 int i, ret;
783
784 for (i = 0; i < socdata->npins; i++) {
785 void *drv_data = socdata->pins[i].drv_data;
786
787 drvctrl = uniphier_pin_get_drvctrl(drv_data);
788 drv_type = uniphier_pin_get_drv_type(drv_data);
789 pupdctrl = uniphier_pin_get_pupdctrl(drv_data);
790 pull_dir = uniphier_pin_get_pull_dir(drv_data);
791 iectrl = uniphier_pin_get_iectrl(drv_data);
792
793 switch (drv_type) {
794 case UNIPHIER_PIN_DRV_1BIT:
795 num_drvctrl = max(num_drvctrl, drvctrl + 1);
796 break;
797 case UNIPHIER_PIN_DRV_2BIT:
798 num_drv2ctrl = max(num_drv2ctrl, drvctrl + 1);
799 break;
800 case UNIPHIER_PIN_DRV_3BIT:
801 num_drv3ctrl = max(num_drv3ctrl, drvctrl + 1);
802 break;
803 default:
804 break;
805 }
806
807 if (pull_dir == UNIPHIER_PIN_PULL_UP ||
808 pull_dir == UNIPHIER_PIN_PULL_DOWN)
809 num_pupdctrl = max(num_pupdctrl, pupdctrl + 1);
810
811 if (iectrl != UNIPHIER_PIN_IECTRL_NONE) {
812 if (socdata->caps & UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL)
813 iectrl = i;
814 num_iectrl = max(num_iectrl, iectrl + 1);
815 }
816 }
817
818 INIT_LIST_HEAD(&priv->reg_regions);
819
820 ret = uniphier_pinctrl_add_reg_region(dev, priv,
821 UNIPHIER_PINCTRL_PINMUX_BASE,
822 socdata->npins, 8);
823 if (ret)
824 return ret;
825
826 ret = uniphier_pinctrl_add_reg_region(dev, priv,
827 UNIPHIER_PINCTRL_DRVCTRL_BASE,
828 num_drvctrl, 1);
829 if (ret)
830 return ret;
831
832 ret = uniphier_pinctrl_add_reg_region(dev, priv,
833 UNIPHIER_PINCTRL_DRV2CTRL_BASE,
834 num_drv2ctrl, 2);
835 if (ret)
836 return ret;
837
838 ret = uniphier_pinctrl_add_reg_region(dev, priv,
839 UNIPHIER_PINCTRL_DRV3CTRL_BASE,
840 num_drv3ctrl, 3);
841 if (ret)
842 return ret;
843
844 ret = uniphier_pinctrl_add_reg_region(dev, priv,
845 UNIPHIER_PINCTRL_PUPDCTRL_BASE,
846 num_pupdctrl, 1);
847 if (ret)
848 return ret;
849
850 ret = uniphier_pinctrl_add_reg_region(dev, priv,
851 UNIPHIER_PINCTRL_IECTRL_BASE,
852 num_iectrl, 1);
853 if (ret)
854 return ret;
855#endif
856 return 0;
857}
858
859const struct dev_pm_ops uniphier_pinctrl_pm_ops = {
860 SET_LATE_SYSTEM_SLEEP_PM_OPS(uniphier_pinctrl_suspend,
861 uniphier_pinctrl_resume)
862};
863
687int uniphier_pinctrl_probe(struct platform_device *pdev, 864int uniphier_pinctrl_probe(struct platform_device *pdev,
688 struct uniphier_pinctrl_socdata *socdata) 865 struct uniphier_pinctrl_socdata *socdata)
689{ 866{
690 struct device *dev = &pdev->dev; 867 struct device *dev = &pdev->dev;
691 struct uniphier_pinctrl_priv *priv; 868 struct uniphier_pinctrl_priv *priv;
692 struct device_node *parent; 869 struct device_node *parent;
870 int ret;
693 871
694 if (!socdata || 872 if (!socdata ||
695 !socdata->pins || !socdata->npins || 873 !socdata->pins || !socdata->npins ||
@@ -721,6 +899,10 @@ int uniphier_pinctrl_probe(struct platform_device *pdev,
721 priv->pctldesc.confops = &uniphier_confops; 899 priv->pctldesc.confops = &uniphier_confops;
722 priv->pctldesc.owner = dev->driver->owner; 900 priv->pctldesc.owner = dev->driver->owner;
723 901
902 ret = uniphier_pinctrl_pm_init(dev, priv);
903 if (ret)
904 return ret;
905
724 priv->pctldev = devm_pinctrl_register(dev, &priv->pctldesc, priv); 906 priv->pctldev = devm_pinctrl_register(dev, &priv->pctldesc, priv);
725 if (IS_ERR(priv->pctldev)) { 907 if (IS_ERR(priv->pctldev)) {
726 dev_err(dev, "failed to register UniPhier pinctrl driver\n"); 908 dev_err(dev, "failed to register UniPhier pinctrl driver\n");
@@ -731,4 +913,3 @@ int uniphier_pinctrl_probe(struct platform_device *pdev,
731 913
732 return 0; 914 return 0;
733} 915}
734EXPORT_SYMBOL_GPL(uniphier_pinctrl_probe);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
index ad73db8d067b..9c5e359a63de 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
@@ -21,7 +21,7 @@
21#include "pinctrl-uniphier.h" 21#include "pinctrl-uniphier.h"
22 22
23static const struct pinctrl_pin_desc uniphier_ld11_pins[] = { 23static const struct pinctrl_pin_desc uniphier_ld11_pins[] = {
24 UNIPHIER_PINCTRL_PIN(0, "XECS1", 0, 24 UNIPHIER_PINCTRL_PIN(0, "XECS1", UNIPHIER_PIN_IECTRL_EXIST,
25 0, UNIPHIER_PIN_DRV_1BIT, 25 0, UNIPHIER_PIN_DRV_1BIT,
26 0, UNIPHIER_PIN_PULL_UP), 26 0, UNIPHIER_PIN_PULL_UP),
27 UNIPHIER_PINCTRL_PIN(1, "ERXW", UNIPHIER_PIN_IECTRL_NONE, 27 UNIPHIER_PINCTRL_PIN(1, "ERXW", UNIPHIER_PIN_IECTRL_NONE,
@@ -30,13 +30,13 @@ static const struct pinctrl_pin_desc uniphier_ld11_pins[] = {
30 UNIPHIER_PINCTRL_PIN(2, "XERWE1", UNIPHIER_PIN_IECTRL_NONE, 30 UNIPHIER_PINCTRL_PIN(2, "XERWE1", UNIPHIER_PIN_IECTRL_NONE,
31 2, UNIPHIER_PIN_DRV_1BIT, 31 2, UNIPHIER_PIN_DRV_1BIT,
32 2, UNIPHIER_PIN_PULL_UP), 32 2, UNIPHIER_PIN_PULL_UP),
33 UNIPHIER_PINCTRL_PIN(3, "XNFWP", 3, 33 UNIPHIER_PINCTRL_PIN(3, "XNFWP", UNIPHIER_PIN_IECTRL_EXIST,
34 3, UNIPHIER_PIN_DRV_1BIT, 34 3, UNIPHIER_PIN_DRV_1BIT,
35 3, UNIPHIER_PIN_PULL_DOWN), 35 3, UNIPHIER_PIN_PULL_DOWN),
36 UNIPHIER_PINCTRL_PIN(4, "XNFCE0", 4, 36 UNIPHIER_PINCTRL_PIN(4, "XNFCE0", UNIPHIER_PIN_IECTRL_EXIST,
37 4, UNIPHIER_PIN_DRV_1BIT, 37 4, UNIPHIER_PIN_DRV_1BIT,
38 4, UNIPHIER_PIN_PULL_UP), 38 4, UNIPHIER_PIN_PULL_UP),
39 UNIPHIER_PINCTRL_PIN(5, "NFRYBY0", 5, 39 UNIPHIER_PINCTRL_PIN(5, "NFRYBY0", UNIPHIER_PIN_IECTRL_EXIST,
40 5, UNIPHIER_PIN_DRV_1BIT, 40 5, UNIPHIER_PIN_DRV_1BIT,
41 5, UNIPHIER_PIN_PULL_UP), 41 5, UNIPHIER_PIN_PULL_UP),
42 UNIPHIER_PINCTRL_PIN(6, "XNFRE", UNIPHIER_PIN_IECTRL_NONE, 42 UNIPHIER_PINCTRL_PIN(6, "XNFRE", UNIPHIER_PIN_IECTRL_NONE,
@@ -51,425 +51,427 @@ static const struct pinctrl_pin_desc uniphier_ld11_pins[] = {
51 UNIPHIER_PINCTRL_PIN(9, "NFCLE", UNIPHIER_PIN_IECTRL_NONE, 51 UNIPHIER_PINCTRL_PIN(9, "NFCLE", UNIPHIER_PIN_IECTRL_NONE,
52 9, UNIPHIER_PIN_DRV_1BIT, 52 9, UNIPHIER_PIN_DRV_1BIT,
53 9, UNIPHIER_PIN_PULL_UP), 53 9, UNIPHIER_PIN_PULL_UP),
54 UNIPHIER_PINCTRL_PIN(10, "NFD0", 10, 54 UNIPHIER_PINCTRL_PIN(10, "NFD0", UNIPHIER_PIN_IECTRL_EXIST,
55 10, UNIPHIER_PIN_DRV_1BIT, 55 10, UNIPHIER_PIN_DRV_1BIT,
56 10, UNIPHIER_PIN_PULL_UP), 56 10, UNIPHIER_PIN_PULL_UP),
57 UNIPHIER_PINCTRL_PIN(11, "NFD1", 11, 57 UNIPHIER_PINCTRL_PIN(11, "NFD1", UNIPHIER_PIN_IECTRL_EXIST,
58 11, UNIPHIER_PIN_DRV_1BIT, 58 11, UNIPHIER_PIN_DRV_1BIT,
59 11, UNIPHIER_PIN_PULL_UP), 59 11, UNIPHIER_PIN_PULL_UP),
60 UNIPHIER_PINCTRL_PIN(12, "NFD2", 12, 60 UNIPHIER_PINCTRL_PIN(12, "NFD2", UNIPHIER_PIN_IECTRL_EXIST,
61 12, UNIPHIER_PIN_DRV_1BIT, 61 12, UNIPHIER_PIN_DRV_1BIT,
62 12, UNIPHIER_PIN_PULL_UP), 62 12, UNIPHIER_PIN_PULL_UP),
63 UNIPHIER_PINCTRL_PIN(13, "NFD3", 13, 63 UNIPHIER_PINCTRL_PIN(13, "NFD3", UNIPHIER_PIN_IECTRL_EXIST,
64 13, UNIPHIER_PIN_DRV_1BIT, 64 13, UNIPHIER_PIN_DRV_1BIT,
65 13, UNIPHIER_PIN_PULL_UP), 65 13, UNIPHIER_PIN_PULL_UP),
66 UNIPHIER_PINCTRL_PIN(14, "NFD4", 14, 66 UNIPHIER_PINCTRL_PIN(14, "NFD4", UNIPHIER_PIN_IECTRL_EXIST,
67 14, UNIPHIER_PIN_DRV_1BIT, 67 14, UNIPHIER_PIN_DRV_1BIT,
68 14, UNIPHIER_PIN_PULL_UP), 68 14, UNIPHIER_PIN_PULL_UP),
69 UNIPHIER_PINCTRL_PIN(15, "NFD5", 15, 69 UNIPHIER_PINCTRL_PIN(15, "NFD5", UNIPHIER_PIN_IECTRL_EXIST,
70 15, UNIPHIER_PIN_DRV_1BIT, 70 15, UNIPHIER_PIN_DRV_1BIT,
71 15, UNIPHIER_PIN_PULL_UP), 71 15, UNIPHIER_PIN_PULL_UP),
72 UNIPHIER_PINCTRL_PIN(16, "NFD6", 16, 72 UNIPHIER_PINCTRL_PIN(16, "NFD6", UNIPHIER_PIN_IECTRL_EXIST,
73 16, UNIPHIER_PIN_DRV_1BIT, 73 16, UNIPHIER_PIN_DRV_1BIT,
74 16, UNIPHIER_PIN_PULL_UP), 74 16, UNIPHIER_PIN_PULL_UP),
75 UNIPHIER_PINCTRL_PIN(17, "NFD7", 17, 75 UNIPHIER_PINCTRL_PIN(17, "NFD7", UNIPHIER_PIN_IECTRL_EXIST,
76 17, UNIPHIER_PIN_DRV_1BIT, 76 17, UNIPHIER_PIN_DRV_1BIT,
77 17, UNIPHIER_PIN_PULL_UP), 77 17, UNIPHIER_PIN_PULL_UP),
78 UNIPHIER_PINCTRL_PIN(18, "XERST", 18, 78 UNIPHIER_PINCTRL_PIN(18, "XERST", UNIPHIER_PIN_IECTRL_EXIST,
79 0, UNIPHIER_PIN_DRV_2BIT, 79 0, UNIPHIER_PIN_DRV_2BIT,
80 18, UNIPHIER_PIN_PULL_UP), 80 18, UNIPHIER_PIN_PULL_UP),
81 UNIPHIER_PINCTRL_PIN(19, "MMCCLK", 19, 81 UNIPHIER_PINCTRL_PIN(19, "MMCCLK", UNIPHIER_PIN_IECTRL_EXIST,
82 1, UNIPHIER_PIN_DRV_2BIT, 82 1, UNIPHIER_PIN_DRV_2BIT,
83 19, UNIPHIER_PIN_PULL_UP), 83 19, UNIPHIER_PIN_PULL_UP),
84 UNIPHIER_PINCTRL_PIN(20, "MMCCMD", 20, 84 UNIPHIER_PINCTRL_PIN(20, "MMCCMD", UNIPHIER_PIN_IECTRL_EXIST,
85 2, UNIPHIER_PIN_DRV_2BIT, 85 2, UNIPHIER_PIN_DRV_2BIT,
86 20, UNIPHIER_PIN_PULL_UP), 86 20, UNIPHIER_PIN_PULL_UP),
87 UNIPHIER_PINCTRL_PIN(21, "MMCDS", 21, 87 UNIPHIER_PINCTRL_PIN(21, "MMCDS", UNIPHIER_PIN_IECTRL_EXIST,
88 3, UNIPHIER_PIN_DRV_2BIT, 88 3, UNIPHIER_PIN_DRV_2BIT,
89 21, UNIPHIER_PIN_PULL_UP), 89 21, UNIPHIER_PIN_PULL_UP),
90 UNIPHIER_PINCTRL_PIN(22, "MMCDAT0", 22, 90 UNIPHIER_PINCTRL_PIN(22, "MMCDAT0", UNIPHIER_PIN_IECTRL_EXIST,
91 4, UNIPHIER_PIN_DRV_2BIT, 91 4, UNIPHIER_PIN_DRV_2BIT,
92 22, UNIPHIER_PIN_PULL_UP), 92 22, UNIPHIER_PIN_PULL_UP),
93 UNIPHIER_PINCTRL_PIN(23, "MMCDAT1", 23, 93 UNIPHIER_PINCTRL_PIN(23, "MMCDAT1", UNIPHIER_PIN_IECTRL_EXIST,
94 5, UNIPHIER_PIN_DRV_2BIT, 94 5, UNIPHIER_PIN_DRV_2BIT,
95 23, UNIPHIER_PIN_PULL_UP), 95 23, UNIPHIER_PIN_PULL_UP),
96 UNIPHIER_PINCTRL_PIN(24, "MMCDAT2", 24, 96 UNIPHIER_PINCTRL_PIN(24, "MMCDAT2", UNIPHIER_PIN_IECTRL_EXIST,
97 6, UNIPHIER_PIN_DRV_2BIT, 97 6, UNIPHIER_PIN_DRV_2BIT,
98 24, UNIPHIER_PIN_PULL_UP), 98 24, UNIPHIER_PIN_PULL_UP),
99 UNIPHIER_PINCTRL_PIN(25, "MMCDAT3", 25, 99 UNIPHIER_PINCTRL_PIN(25, "MMCDAT3", UNIPHIER_PIN_IECTRL_EXIST,
100 7, UNIPHIER_PIN_DRV_2BIT, 100 7, UNIPHIER_PIN_DRV_2BIT,
101 25, UNIPHIER_PIN_PULL_UP), 101 25, UNIPHIER_PIN_PULL_UP),
102 UNIPHIER_PINCTRL_PIN(26, "MMCDAT4", 26, 102 UNIPHIER_PINCTRL_PIN(26, "MMCDAT4", UNIPHIER_PIN_IECTRL_EXIST,
103 8, UNIPHIER_PIN_DRV_2BIT, 103 8, UNIPHIER_PIN_DRV_2BIT,
104 26, UNIPHIER_PIN_PULL_UP), 104 26, UNIPHIER_PIN_PULL_UP),
105 UNIPHIER_PINCTRL_PIN(27, "MMCDAT5", 27, 105 UNIPHIER_PINCTRL_PIN(27, "MMCDAT5", UNIPHIER_PIN_IECTRL_EXIST,
106 9, UNIPHIER_PIN_DRV_2BIT, 106 9, UNIPHIER_PIN_DRV_2BIT,
107 27, UNIPHIER_PIN_PULL_UP), 107 27, UNIPHIER_PIN_PULL_UP),
108 UNIPHIER_PINCTRL_PIN(28, "MMCDAT6", 28, 108 UNIPHIER_PINCTRL_PIN(28, "MMCDAT6", UNIPHIER_PIN_IECTRL_EXIST,
109 10, UNIPHIER_PIN_DRV_2BIT, 109 10, UNIPHIER_PIN_DRV_2BIT,
110 28, UNIPHIER_PIN_PULL_UP), 110 28, UNIPHIER_PIN_PULL_UP),
111 UNIPHIER_PINCTRL_PIN(29, "MMCDAT7", 29, 111 UNIPHIER_PINCTRL_PIN(29, "MMCDAT7", UNIPHIER_PIN_IECTRL_EXIST,
112 11, UNIPHIER_PIN_DRV_2BIT, 112 11, UNIPHIER_PIN_DRV_2BIT,
113 29, UNIPHIER_PIN_PULL_UP), 113 29, UNIPHIER_PIN_PULL_UP),
114 UNIPHIER_PINCTRL_PIN(46, "USB0VBUS", 46, 114 UNIPHIER_PINCTRL_PIN(46, "USB0VBUS", UNIPHIER_PIN_IECTRL_EXIST,
115 46, UNIPHIER_PIN_DRV_1BIT, 115 46, UNIPHIER_PIN_DRV_1BIT,
116 46, UNIPHIER_PIN_PULL_DOWN), 116 46, UNIPHIER_PIN_PULL_DOWN),
117 UNIPHIER_PINCTRL_PIN(47, "USB0OD", UNIPHIER_PIN_IECTRL_NONE, 117 UNIPHIER_PINCTRL_PIN(47, "USB0OD", UNIPHIER_PIN_IECTRL_NONE,
118 47, UNIPHIER_PIN_DRV_1BIT, 118 47, UNIPHIER_PIN_DRV_1BIT,
119 47, UNIPHIER_PIN_PULL_UP), 119 47, UNIPHIER_PIN_PULL_UP),
120 UNIPHIER_PINCTRL_PIN(48, "USB1VBUS", 48, 120 UNIPHIER_PINCTRL_PIN(48, "USB1VBUS", UNIPHIER_PIN_IECTRL_EXIST,
121 48, UNIPHIER_PIN_DRV_1BIT, 121 48, UNIPHIER_PIN_DRV_1BIT,
122 48, UNIPHIER_PIN_PULL_DOWN), 122 48, UNIPHIER_PIN_PULL_DOWN),
123 UNIPHIER_PINCTRL_PIN(49, "USB1OD", 49, 123 UNIPHIER_PINCTRL_PIN(49, "USB1OD", UNIPHIER_PIN_IECTRL_EXIST,
124 49, UNIPHIER_PIN_DRV_1BIT, 124 49, UNIPHIER_PIN_DRV_1BIT,
125 49, UNIPHIER_PIN_PULL_UP), 125 49, UNIPHIER_PIN_PULL_UP),
126 UNIPHIER_PINCTRL_PIN(50, "USB2VBUS", 50, 126 UNIPHIER_PINCTRL_PIN(50, "USB2VBUS", UNIPHIER_PIN_IECTRL_EXIST,
127 50, UNIPHIER_PIN_DRV_1BIT, 127 50, UNIPHIER_PIN_DRV_1BIT,
128 50, UNIPHIER_PIN_PULL_DOWN), 128 50, UNIPHIER_PIN_PULL_DOWN),
129 UNIPHIER_PINCTRL_PIN(51, "USB2OD", 51, 129 UNIPHIER_PINCTRL_PIN(51, "USB2OD", UNIPHIER_PIN_IECTRL_EXIST,
130 51, UNIPHIER_PIN_DRV_1BIT, 130 51, UNIPHIER_PIN_DRV_1BIT,
131 51, UNIPHIER_PIN_PULL_UP), 131 51, UNIPHIER_PIN_PULL_UP),
132 UNIPHIER_PINCTRL_PIN(54, "TXD0", 54, 132 UNIPHIER_PINCTRL_PIN(54, "TXD0", UNIPHIER_PIN_IECTRL_EXIST,
133 54, UNIPHIER_PIN_DRV_1BIT, 133 54, UNIPHIER_PIN_DRV_1BIT,
134 54, UNIPHIER_PIN_PULL_UP), 134 54, UNIPHIER_PIN_PULL_UP),
135 UNIPHIER_PINCTRL_PIN(55, "RXD0", 55, 135 UNIPHIER_PINCTRL_PIN(55, "RXD0", UNIPHIER_PIN_IECTRL_EXIST,
136 55, UNIPHIER_PIN_DRV_1BIT, 136 55, UNIPHIER_PIN_DRV_1BIT,
137 55, UNIPHIER_PIN_PULL_UP), 137 55, UNIPHIER_PIN_PULL_UP),
138 UNIPHIER_PINCTRL_PIN(56, "SPISYNC0", 56, 138 UNIPHIER_PINCTRL_PIN(56, "SPISYNC0", UNIPHIER_PIN_IECTRL_EXIST,
139 56, UNIPHIER_PIN_DRV_1BIT, 139 56, UNIPHIER_PIN_DRV_1BIT,
140 56, UNIPHIER_PIN_PULL_DOWN), 140 56, UNIPHIER_PIN_PULL_DOWN),
141 UNIPHIER_PINCTRL_PIN(57, "SPISCLK0", 57, 141 UNIPHIER_PINCTRL_PIN(57, "SPISCLK0", UNIPHIER_PIN_IECTRL_EXIST,
142 57, UNIPHIER_PIN_DRV_1BIT, 142 57, UNIPHIER_PIN_DRV_1BIT,
143 57, UNIPHIER_PIN_PULL_DOWN), 143 57, UNIPHIER_PIN_PULL_DOWN),
144 UNIPHIER_PINCTRL_PIN(58, "SPITXD0", 58, 144 UNIPHIER_PINCTRL_PIN(58, "SPITXD0", UNIPHIER_PIN_IECTRL_EXIST,
145 58, UNIPHIER_PIN_DRV_1BIT, 145 58, UNIPHIER_PIN_DRV_1BIT,
146 58, UNIPHIER_PIN_PULL_DOWN), 146 58, UNIPHIER_PIN_PULL_DOWN),
147 UNIPHIER_PINCTRL_PIN(59, "SPIRXD0", 59, 147 UNIPHIER_PINCTRL_PIN(59, "SPIRXD0", UNIPHIER_PIN_IECTRL_EXIST,
148 59, UNIPHIER_PIN_DRV_1BIT, 148 59, UNIPHIER_PIN_DRV_1BIT,
149 59, UNIPHIER_PIN_PULL_DOWN), 149 59, UNIPHIER_PIN_PULL_DOWN),
150 UNIPHIER_PINCTRL_PIN(60, "AGCI", 60, 150 UNIPHIER_PINCTRL_PIN(60, "AGCI", UNIPHIER_PIN_IECTRL_EXIST,
151 60, UNIPHIER_PIN_DRV_1BIT, 151 60, UNIPHIER_PIN_DRV_1BIT,
152 60, UNIPHIER_PIN_PULL_DOWN), 152 60, UNIPHIER_PIN_PULL_DOWN),
153 UNIPHIER_PINCTRL_PIN(61, "DMDSDA0", 61, 153 UNIPHIER_PINCTRL_PIN(61, "DMDSDA0", UNIPHIER_PIN_IECTRL_EXIST,
154 -1, UNIPHIER_PIN_DRV_FIXED4, 154 -1, UNIPHIER_PIN_DRV_FIXED4,
155 -1, UNIPHIER_PIN_PULL_NONE), 155 -1, UNIPHIER_PIN_PULL_NONE),
156 UNIPHIER_PINCTRL_PIN(62, "DMDSCL0", 62, 156 UNIPHIER_PINCTRL_PIN(62, "DMDSCL0", UNIPHIER_PIN_IECTRL_EXIST,
157 -1, UNIPHIER_PIN_DRV_FIXED4, 157 -1, UNIPHIER_PIN_DRV_FIXED4,
158 -1, UNIPHIER_PIN_PULL_NONE), 158 -1, UNIPHIER_PIN_PULL_NONE),
159 UNIPHIER_PINCTRL_PIN(63, "SDA0", 63, 159 UNIPHIER_PINCTRL_PIN(63, "SDA0", UNIPHIER_PIN_IECTRL_EXIST,
160 -1, UNIPHIER_PIN_DRV_FIXED4, 160 -1, UNIPHIER_PIN_DRV_FIXED4,
161 -1, UNIPHIER_PIN_PULL_NONE), 161 -1, UNIPHIER_PIN_PULL_NONE),
162 UNIPHIER_PINCTRL_PIN(64, "SCL0", 64, 162 UNIPHIER_PINCTRL_PIN(64, "SCL0", UNIPHIER_PIN_IECTRL_EXIST,
163 -1, UNIPHIER_PIN_DRV_FIXED4, 163 -1, UNIPHIER_PIN_DRV_FIXED4,
164 -1, UNIPHIER_PIN_PULL_NONE), 164 -1, UNIPHIER_PIN_PULL_NONE),
165 UNIPHIER_PINCTRL_PIN(65, "SDA1", 65, 165 UNIPHIER_PINCTRL_PIN(65, "SDA1", UNIPHIER_PIN_IECTRL_EXIST,
166 -1, UNIPHIER_PIN_DRV_FIXED4, 166 -1, UNIPHIER_PIN_DRV_FIXED4,
167 -1, UNIPHIER_PIN_PULL_NONE), 167 -1, UNIPHIER_PIN_PULL_NONE),
168 UNIPHIER_PINCTRL_PIN(66, "SCL1", 66, 168 UNIPHIER_PINCTRL_PIN(66, "SCL1", UNIPHIER_PIN_IECTRL_EXIST,
169 -1, UNIPHIER_PIN_DRV_FIXED4, 169 -1, UNIPHIER_PIN_DRV_FIXED4,
170 -1, UNIPHIER_PIN_PULL_NONE), 170 -1, UNIPHIER_PIN_PULL_NONE),
171 UNIPHIER_PINCTRL_PIN(67, "HIN", 67, 171 UNIPHIER_PINCTRL_PIN(67, "HIN", UNIPHIER_PIN_IECTRL_EXIST,
172 -1, UNIPHIER_PIN_DRV_FIXED5, 172 -1, UNIPHIER_PIN_DRV_FIXED5,
173 -1, UNIPHIER_PIN_PULL_NONE), 173 -1, UNIPHIER_PIN_PULL_NONE),
174 UNIPHIER_PINCTRL_PIN(68, "VIN", 68, 174 UNIPHIER_PINCTRL_PIN(68, "VIN", UNIPHIER_PIN_IECTRL_EXIST,
175 -1, UNIPHIER_PIN_DRV_FIXED5, 175 -1, UNIPHIER_PIN_DRV_FIXED5,
176 -1, UNIPHIER_PIN_PULL_NONE), 176 -1, UNIPHIER_PIN_PULL_NONE),
177 UNIPHIER_PINCTRL_PIN(69, "PCA00", 69, 177 UNIPHIER_PINCTRL_PIN(69, "PCA00", UNIPHIER_PIN_IECTRL_EXIST,
178 69, UNIPHIER_PIN_DRV_1BIT, 178 69, UNIPHIER_PIN_DRV_1BIT,
179 69, UNIPHIER_PIN_PULL_DOWN), 179 69, UNIPHIER_PIN_PULL_DOWN),
180 UNIPHIER_PINCTRL_PIN(70, "PCA01", 70, 180 UNIPHIER_PINCTRL_PIN(70, "PCA01", UNIPHIER_PIN_IECTRL_EXIST,
181 70, UNIPHIER_PIN_DRV_1BIT, 181 70, UNIPHIER_PIN_DRV_1BIT,
182 70, UNIPHIER_PIN_PULL_DOWN), 182 70, UNIPHIER_PIN_PULL_DOWN),
183 UNIPHIER_PINCTRL_PIN(71, "PCA02", 71, 183 UNIPHIER_PINCTRL_PIN(71, "PCA02", UNIPHIER_PIN_IECTRL_EXIST,
184 71, UNIPHIER_PIN_DRV_1BIT, 184 71, UNIPHIER_PIN_DRV_1BIT,
185 71, UNIPHIER_PIN_PULL_DOWN), 185 71, UNIPHIER_PIN_PULL_DOWN),
186 UNIPHIER_PINCTRL_PIN(72, "PCA03", 72, 186 UNIPHIER_PINCTRL_PIN(72, "PCA03", UNIPHIER_PIN_IECTRL_EXIST,
187 72, UNIPHIER_PIN_DRV_1BIT, 187 72, UNIPHIER_PIN_DRV_1BIT,
188 72, UNIPHIER_PIN_PULL_DOWN), 188 72, UNIPHIER_PIN_PULL_DOWN),
189 UNIPHIER_PINCTRL_PIN(73, "PCA04", 73, 189 UNIPHIER_PINCTRL_PIN(73, "PCA04", UNIPHIER_PIN_IECTRL_EXIST,
190 73, UNIPHIER_PIN_DRV_1BIT, 190 73, UNIPHIER_PIN_DRV_1BIT,
191 73, UNIPHIER_PIN_PULL_DOWN), 191 73, UNIPHIER_PIN_PULL_DOWN),
192 UNIPHIER_PINCTRL_PIN(74, "PCA05", 74, 192 UNIPHIER_PINCTRL_PIN(74, "PCA05", UNIPHIER_PIN_IECTRL_EXIST,
193 74, UNIPHIER_PIN_DRV_1BIT, 193 74, UNIPHIER_PIN_DRV_1BIT,
194 74, UNIPHIER_PIN_PULL_DOWN), 194 74, UNIPHIER_PIN_PULL_DOWN),
195 UNIPHIER_PINCTRL_PIN(75, "PCA06", 75, 195 UNIPHIER_PINCTRL_PIN(75, "PCA06", UNIPHIER_PIN_IECTRL_EXIST,
196 75, UNIPHIER_PIN_DRV_1BIT, 196 75, UNIPHIER_PIN_DRV_1BIT,
197 75, UNIPHIER_PIN_PULL_DOWN), 197 75, UNIPHIER_PIN_PULL_DOWN),
198 UNIPHIER_PINCTRL_PIN(76, "PCA07", 76, 198 UNIPHIER_PINCTRL_PIN(76, "PCA07", UNIPHIER_PIN_IECTRL_EXIST,
199 76, UNIPHIER_PIN_DRV_1BIT, 199 76, UNIPHIER_PIN_DRV_1BIT,
200 76, UNIPHIER_PIN_PULL_DOWN), 200 76, UNIPHIER_PIN_PULL_DOWN),
201 UNIPHIER_PINCTRL_PIN(77, "PCA08", 77, 201 UNIPHIER_PINCTRL_PIN(77, "PCA08", UNIPHIER_PIN_IECTRL_EXIST,
202 77, UNIPHIER_PIN_DRV_1BIT, 202 77, UNIPHIER_PIN_DRV_1BIT,
203 77, UNIPHIER_PIN_PULL_DOWN), 203 77, UNIPHIER_PIN_PULL_DOWN),
204 UNIPHIER_PINCTRL_PIN(78, "PCA09", 78, 204 UNIPHIER_PINCTRL_PIN(78, "PCA09", UNIPHIER_PIN_IECTRL_EXIST,
205 78, UNIPHIER_PIN_DRV_1BIT, 205 78, UNIPHIER_PIN_DRV_1BIT,
206 78, UNIPHIER_PIN_PULL_DOWN), 206 78, UNIPHIER_PIN_PULL_DOWN),
207 UNIPHIER_PINCTRL_PIN(79, "PCA10", 79, 207 UNIPHIER_PINCTRL_PIN(79, "PCA10", UNIPHIER_PIN_IECTRL_EXIST,
208 79, UNIPHIER_PIN_DRV_1BIT, 208 79, UNIPHIER_PIN_DRV_1BIT,
209 79, UNIPHIER_PIN_PULL_DOWN), 209 79, UNIPHIER_PIN_PULL_DOWN),
210 UNIPHIER_PINCTRL_PIN(80, "PCA11", 80, 210 UNIPHIER_PINCTRL_PIN(80, "PCA11", UNIPHIER_PIN_IECTRL_EXIST,
211 80, UNIPHIER_PIN_DRV_1BIT, 211 80, UNIPHIER_PIN_DRV_1BIT,
212 80, UNIPHIER_PIN_PULL_DOWN), 212 80, UNIPHIER_PIN_PULL_DOWN),
213 UNIPHIER_PINCTRL_PIN(81, "PCA12", 81, 213 UNIPHIER_PINCTRL_PIN(81, "PCA12", UNIPHIER_PIN_IECTRL_EXIST,
214 81, UNIPHIER_PIN_DRV_1BIT, 214 81, UNIPHIER_PIN_DRV_1BIT,
215 81, UNIPHIER_PIN_PULL_DOWN), 215 81, UNIPHIER_PIN_PULL_DOWN),
216 UNIPHIER_PINCTRL_PIN(82, "PCA13", 82, 216 UNIPHIER_PINCTRL_PIN(82, "PCA13", UNIPHIER_PIN_IECTRL_EXIST,
217 82, UNIPHIER_PIN_DRV_1BIT, 217 82, UNIPHIER_PIN_DRV_1BIT,
218 82, UNIPHIER_PIN_PULL_DOWN), 218 82, UNIPHIER_PIN_PULL_DOWN),
219 UNIPHIER_PINCTRL_PIN(83, "PCA14", 83, 219 UNIPHIER_PINCTRL_PIN(83, "PCA14", UNIPHIER_PIN_IECTRL_EXIST,
220 83, UNIPHIER_PIN_DRV_1BIT, 220 83, UNIPHIER_PIN_DRV_1BIT,
221 83, UNIPHIER_PIN_PULL_DOWN), 221 83, UNIPHIER_PIN_PULL_DOWN),
222 UNIPHIER_PINCTRL_PIN(84, "PC0READY", 84, 222 UNIPHIER_PINCTRL_PIN(84, "PC0READY", UNIPHIER_PIN_IECTRL_EXIST,
223 84, UNIPHIER_PIN_DRV_1BIT, 223 84, UNIPHIER_PIN_DRV_1BIT,
224 84, UNIPHIER_PIN_PULL_DOWN), 224 84, UNIPHIER_PIN_PULL_DOWN),
225 UNIPHIER_PINCTRL_PIN(85, "PC0CD1", 85, 225 UNIPHIER_PINCTRL_PIN(85, "PC0CD1", UNIPHIER_PIN_IECTRL_EXIST,
226 85, UNIPHIER_PIN_DRV_1BIT, 226 85, UNIPHIER_PIN_DRV_1BIT,
227 85, UNIPHIER_PIN_PULL_DOWN), 227 85, UNIPHIER_PIN_PULL_DOWN),
228 UNIPHIER_PINCTRL_PIN(86, "PC0CD2", 86, 228 UNIPHIER_PINCTRL_PIN(86, "PC0CD2", UNIPHIER_PIN_IECTRL_EXIST,
229 86, UNIPHIER_PIN_DRV_1BIT, 229 86, UNIPHIER_PIN_DRV_1BIT,
230 86, UNIPHIER_PIN_PULL_DOWN), 230 86, UNIPHIER_PIN_PULL_DOWN),
231 UNIPHIER_PINCTRL_PIN(87, "PC0WAIT", 87, 231 UNIPHIER_PINCTRL_PIN(87, "PC0WAIT", UNIPHIER_PIN_IECTRL_EXIST,
232 87, UNIPHIER_PIN_DRV_1BIT, 232 87, UNIPHIER_PIN_DRV_1BIT,
233 87, UNIPHIER_PIN_PULL_DOWN), 233 87, UNIPHIER_PIN_PULL_DOWN),
234 UNIPHIER_PINCTRL_PIN(88, "PC0RESET", 88, 234 UNIPHIER_PINCTRL_PIN(88, "PC0RESET", UNIPHIER_PIN_IECTRL_EXIST,
235 88, UNIPHIER_PIN_DRV_1BIT, 235 88, UNIPHIER_PIN_DRV_1BIT,
236 88, UNIPHIER_PIN_PULL_DOWN), 236 88, UNIPHIER_PIN_PULL_DOWN),
237 UNIPHIER_PINCTRL_PIN(89, "PC0CE1", 89, 237 UNIPHIER_PINCTRL_PIN(89, "PC0CE1", UNIPHIER_PIN_IECTRL_EXIST,
238 89, UNIPHIER_PIN_DRV_1BIT, 238 89, UNIPHIER_PIN_DRV_1BIT,
239 89, UNIPHIER_PIN_PULL_DOWN), 239 89, UNIPHIER_PIN_PULL_DOWN),
240 UNIPHIER_PINCTRL_PIN(90, "PC0WE", 90, 240 UNIPHIER_PINCTRL_PIN(90, "PC0WE", UNIPHIER_PIN_IECTRL_EXIST,
241 90, UNIPHIER_PIN_DRV_1BIT, 241 90, UNIPHIER_PIN_DRV_1BIT,
242 90, UNIPHIER_PIN_PULL_DOWN), 242 90, UNIPHIER_PIN_PULL_DOWN),
243 UNIPHIER_PINCTRL_PIN(91, "PC0OE", 91, 243 UNIPHIER_PINCTRL_PIN(91, "PC0OE", UNIPHIER_PIN_IECTRL_EXIST,
244 91, UNIPHIER_PIN_DRV_1BIT, 244 91, UNIPHIER_PIN_DRV_1BIT,
245 91, UNIPHIER_PIN_PULL_DOWN), 245 91, UNIPHIER_PIN_PULL_DOWN),
246 UNIPHIER_PINCTRL_PIN(92, "PC0IOWR", 92, 246 UNIPHIER_PINCTRL_PIN(92, "PC0IOWR", UNIPHIER_PIN_IECTRL_EXIST,
247 92, UNIPHIER_PIN_DRV_1BIT, 247 92, UNIPHIER_PIN_DRV_1BIT,
248 92, UNIPHIER_PIN_PULL_DOWN), 248 92, UNIPHIER_PIN_PULL_DOWN),
249 UNIPHIER_PINCTRL_PIN(93, "PC0IORD", 93, 249 UNIPHIER_PINCTRL_PIN(93, "PC0IORD", UNIPHIER_PIN_IECTRL_EXIST,
250 93, UNIPHIER_PIN_DRV_1BIT, 250 93, UNIPHIER_PIN_DRV_1BIT,
251 93, UNIPHIER_PIN_PULL_DOWN), 251 93, UNIPHIER_PIN_PULL_DOWN),
252 UNIPHIER_PINCTRL_PIN(94, "PCD00", 94, 252 UNIPHIER_PINCTRL_PIN(94, "PCD00", UNIPHIER_PIN_IECTRL_EXIST,
253 94, UNIPHIER_PIN_DRV_1BIT, 253 94, UNIPHIER_PIN_DRV_1BIT,
254 94, UNIPHIER_PIN_PULL_DOWN), 254 94, UNIPHIER_PIN_PULL_DOWN),
255 UNIPHIER_PINCTRL_PIN(95, "PCD01", 95, 255 UNIPHIER_PINCTRL_PIN(95, "PCD01", UNIPHIER_PIN_IECTRL_EXIST,
256 95, UNIPHIER_PIN_DRV_1BIT, 256 95, UNIPHIER_PIN_DRV_1BIT,
257 95, UNIPHIER_PIN_PULL_DOWN), 257 95, UNIPHIER_PIN_PULL_DOWN),
258 UNIPHIER_PINCTRL_PIN(96, "PCD02", 96, 258 UNIPHIER_PINCTRL_PIN(96, "PCD02", UNIPHIER_PIN_IECTRL_EXIST,
259 96, UNIPHIER_PIN_DRV_1BIT, 259 96, UNIPHIER_PIN_DRV_1BIT,
260 96, UNIPHIER_PIN_PULL_DOWN), 260 96, UNIPHIER_PIN_PULL_DOWN),
261 UNIPHIER_PINCTRL_PIN(97, "PCD03", 97, 261 UNIPHIER_PINCTRL_PIN(97, "PCD03", UNIPHIER_PIN_IECTRL_EXIST,
262 97, UNIPHIER_PIN_DRV_1BIT, 262 97, UNIPHIER_PIN_DRV_1BIT,
263 97, UNIPHIER_PIN_PULL_DOWN), 263 97, UNIPHIER_PIN_PULL_DOWN),
264 UNIPHIER_PINCTRL_PIN(98, "PCD04", 98, 264 UNIPHIER_PINCTRL_PIN(98, "PCD04", UNIPHIER_PIN_IECTRL_EXIST,
265 98, UNIPHIER_PIN_DRV_1BIT, 265 98, UNIPHIER_PIN_DRV_1BIT,
266 98, UNIPHIER_PIN_PULL_DOWN), 266 98, UNIPHIER_PIN_PULL_DOWN),
267 UNIPHIER_PINCTRL_PIN(99, "PCD05", 99, 267 UNIPHIER_PINCTRL_PIN(99, "PCD05", UNIPHIER_PIN_IECTRL_EXIST,
268 99, UNIPHIER_PIN_DRV_1BIT, 268 99, UNIPHIER_PIN_DRV_1BIT,
269 99, UNIPHIER_PIN_PULL_DOWN), 269 99, UNIPHIER_PIN_PULL_DOWN),
270 UNIPHIER_PINCTRL_PIN(100, "PCD06", 100, 270 UNIPHIER_PINCTRL_PIN(100, "PCD06", UNIPHIER_PIN_IECTRL_EXIST,
271 100, UNIPHIER_PIN_DRV_1BIT, 271 100, UNIPHIER_PIN_DRV_1BIT,
272 100, UNIPHIER_PIN_PULL_DOWN), 272 100, UNIPHIER_PIN_PULL_DOWN),
273 UNIPHIER_PINCTRL_PIN(101, "PCD07", 101, 273 UNIPHIER_PINCTRL_PIN(101, "PCD07", UNIPHIER_PIN_IECTRL_EXIST,
274 101, UNIPHIER_PIN_DRV_1BIT, 274 101, UNIPHIER_PIN_DRV_1BIT,
275 101, UNIPHIER_PIN_PULL_DOWN), 275 101, UNIPHIER_PIN_PULL_DOWN),
276 UNIPHIER_PINCTRL_PIN(102, "HS0BCLKIN", 102, 276 UNIPHIER_PINCTRL_PIN(102, "HS0BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
277 102, UNIPHIER_PIN_DRV_1BIT, 277 102, UNIPHIER_PIN_DRV_1BIT,
278 102, UNIPHIER_PIN_PULL_DOWN), 278 102, UNIPHIER_PIN_PULL_DOWN),
279 UNIPHIER_PINCTRL_PIN(103, "HS0SYNCIN", 103, 279 UNIPHIER_PINCTRL_PIN(103, "HS0SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
280 103, UNIPHIER_PIN_DRV_1BIT, 280 103, UNIPHIER_PIN_DRV_1BIT,
281 103, UNIPHIER_PIN_PULL_DOWN), 281 103, UNIPHIER_PIN_PULL_DOWN),
282 UNIPHIER_PINCTRL_PIN(104, "HS0VALIN", 104, 282 UNIPHIER_PINCTRL_PIN(104, "HS0VALIN", UNIPHIER_PIN_IECTRL_EXIST,
283 104, UNIPHIER_PIN_DRV_1BIT, 283 104, UNIPHIER_PIN_DRV_1BIT,
284 104, UNIPHIER_PIN_PULL_DOWN), 284 104, UNIPHIER_PIN_PULL_DOWN),
285 UNIPHIER_PINCTRL_PIN(105, "HS0DIN0", 105, 285 UNIPHIER_PINCTRL_PIN(105, "HS0DIN0", UNIPHIER_PIN_IECTRL_EXIST,
286 105, UNIPHIER_PIN_DRV_1BIT, 286 105, UNIPHIER_PIN_DRV_1BIT,
287 105, UNIPHIER_PIN_PULL_DOWN), 287 105, UNIPHIER_PIN_PULL_DOWN),
288 UNIPHIER_PINCTRL_PIN(106, "HS0DIN1", 106, 288 UNIPHIER_PINCTRL_PIN(106, "HS0DIN1", UNIPHIER_PIN_IECTRL_EXIST,
289 106, UNIPHIER_PIN_DRV_1BIT, 289 106, UNIPHIER_PIN_DRV_1BIT,
290 106, UNIPHIER_PIN_PULL_DOWN), 290 106, UNIPHIER_PIN_PULL_DOWN),
291 UNIPHIER_PINCTRL_PIN(107, "HS0DIN2", 107, 291 UNIPHIER_PINCTRL_PIN(107, "HS0DIN2", UNIPHIER_PIN_IECTRL_EXIST,
292 107, UNIPHIER_PIN_DRV_1BIT, 292 107, UNIPHIER_PIN_DRV_1BIT,
293 107, UNIPHIER_PIN_PULL_DOWN), 293 107, UNIPHIER_PIN_PULL_DOWN),
294 UNIPHIER_PINCTRL_PIN(108, "HS0DIN3", 108, 294 UNIPHIER_PINCTRL_PIN(108, "HS0DIN3", UNIPHIER_PIN_IECTRL_EXIST,
295 108, UNIPHIER_PIN_DRV_1BIT, 295 108, UNIPHIER_PIN_DRV_1BIT,
296 108, UNIPHIER_PIN_PULL_DOWN), 296 108, UNIPHIER_PIN_PULL_DOWN),
297 UNIPHIER_PINCTRL_PIN(109, "HS0DIN4", 109, 297 UNIPHIER_PINCTRL_PIN(109, "HS0DIN4", UNIPHIER_PIN_IECTRL_EXIST,
298 109, UNIPHIER_PIN_DRV_1BIT, 298 109, UNIPHIER_PIN_DRV_1BIT,
299 109, UNIPHIER_PIN_PULL_DOWN), 299 109, UNIPHIER_PIN_PULL_DOWN),
300 UNIPHIER_PINCTRL_PIN(110, "HS0DIN5", 110, 300 UNIPHIER_PINCTRL_PIN(110, "HS0DIN5", UNIPHIER_PIN_IECTRL_EXIST,
301 110, UNIPHIER_PIN_DRV_1BIT, 301 110, UNIPHIER_PIN_DRV_1BIT,
302 110, UNIPHIER_PIN_PULL_DOWN), 302 110, UNIPHIER_PIN_PULL_DOWN),
303 UNIPHIER_PINCTRL_PIN(111, "HS0DIN6", 111, 303 UNIPHIER_PINCTRL_PIN(111, "HS0DIN6", UNIPHIER_PIN_IECTRL_EXIST,
304 111, UNIPHIER_PIN_DRV_1BIT, 304 111, UNIPHIER_PIN_DRV_1BIT,
305 111, UNIPHIER_PIN_PULL_DOWN), 305 111, UNIPHIER_PIN_PULL_DOWN),
306 UNIPHIER_PINCTRL_PIN(112, "HS0DIN7", 112, 306 UNIPHIER_PINCTRL_PIN(112, "HS0DIN7", UNIPHIER_PIN_IECTRL_EXIST,
307 112, UNIPHIER_PIN_DRV_1BIT, 307 112, UNIPHIER_PIN_DRV_1BIT,
308 112, UNIPHIER_PIN_PULL_DOWN), 308 112, UNIPHIER_PIN_PULL_DOWN),
309 UNIPHIER_PINCTRL_PIN(113, "HS0BCLKOUT", 113, 309 UNIPHIER_PINCTRL_PIN(113, "HS0BCLKOUT", UNIPHIER_PIN_IECTRL_EXIST,
310 113, UNIPHIER_PIN_DRV_1BIT, 310 113, UNIPHIER_PIN_DRV_1BIT,
311 113, UNIPHIER_PIN_PULL_DOWN), 311 113, UNIPHIER_PIN_PULL_DOWN),
312 UNIPHIER_PINCTRL_PIN(114, "HS0SYNCOUT", 114, 312 UNIPHIER_PINCTRL_PIN(114, "HS0SYNCOUT", UNIPHIER_PIN_IECTRL_EXIST,
313 114, UNIPHIER_PIN_DRV_1BIT, 313 114, UNIPHIER_PIN_DRV_1BIT,
314 114, UNIPHIER_PIN_PULL_DOWN), 314 114, UNIPHIER_PIN_PULL_DOWN),
315 UNIPHIER_PINCTRL_PIN(115, "HS0VALOUT", 115, 315 UNIPHIER_PINCTRL_PIN(115, "HS0VALOUT", UNIPHIER_PIN_IECTRL_EXIST,
316 115, UNIPHIER_PIN_DRV_1BIT, 316 115, UNIPHIER_PIN_DRV_1BIT,
317 115, UNIPHIER_PIN_PULL_DOWN), 317 115, UNIPHIER_PIN_PULL_DOWN),
318 UNIPHIER_PINCTRL_PIN(116, "HS0DOUT0", 116, 318 UNIPHIER_PINCTRL_PIN(116, "HS0DOUT0", UNIPHIER_PIN_IECTRL_EXIST,
319 116, UNIPHIER_PIN_DRV_1BIT, 319 116, UNIPHIER_PIN_DRV_1BIT,
320 116, UNIPHIER_PIN_PULL_DOWN), 320 116, UNIPHIER_PIN_PULL_DOWN),
321 UNIPHIER_PINCTRL_PIN(117, "HS0DOUT1", 117, 321 UNIPHIER_PINCTRL_PIN(117, "HS0DOUT1", UNIPHIER_PIN_IECTRL_EXIST,
322 117, UNIPHIER_PIN_DRV_1BIT, 322 117, UNIPHIER_PIN_DRV_1BIT,
323 117, UNIPHIER_PIN_PULL_DOWN), 323 117, UNIPHIER_PIN_PULL_DOWN),
324 UNIPHIER_PINCTRL_PIN(118, "HS0DOUT2", 118, 324 UNIPHIER_PINCTRL_PIN(118, "HS0DOUT2", UNIPHIER_PIN_IECTRL_EXIST,
325 118, UNIPHIER_PIN_DRV_1BIT, 325 118, UNIPHIER_PIN_DRV_1BIT,
326 118, UNIPHIER_PIN_PULL_DOWN), 326 118, UNIPHIER_PIN_PULL_DOWN),
327 UNIPHIER_PINCTRL_PIN(119, "HS0DOUT3", 119, 327 UNIPHIER_PINCTRL_PIN(119, "HS0DOUT3", UNIPHIER_PIN_IECTRL_EXIST,
328 119, UNIPHIER_PIN_DRV_1BIT, 328 119, UNIPHIER_PIN_DRV_1BIT,
329 119, UNIPHIER_PIN_PULL_DOWN), 329 119, UNIPHIER_PIN_PULL_DOWN),
330 UNIPHIER_PINCTRL_PIN(120, "HS0DOUT4", 120, 330 UNIPHIER_PINCTRL_PIN(120, "HS0DOUT4", UNIPHIER_PIN_IECTRL_EXIST,
331 120, UNIPHIER_PIN_DRV_1BIT, 331 120, UNIPHIER_PIN_DRV_1BIT,
332 120, UNIPHIER_PIN_PULL_DOWN), 332 120, UNIPHIER_PIN_PULL_DOWN),
333 UNIPHIER_PINCTRL_PIN(121, "HS0DOUT5", 121, 333 UNIPHIER_PINCTRL_PIN(121, "HS0DOUT5", UNIPHIER_PIN_IECTRL_EXIST,
334 121, UNIPHIER_PIN_DRV_1BIT, 334 121, UNIPHIER_PIN_DRV_1BIT,
335 121, UNIPHIER_PIN_PULL_DOWN), 335 121, UNIPHIER_PIN_PULL_DOWN),
336 UNIPHIER_PINCTRL_PIN(122, "HS0DOUT6", 122, 336 UNIPHIER_PINCTRL_PIN(122, "HS0DOUT6", UNIPHIER_PIN_IECTRL_EXIST,
337 122, UNIPHIER_PIN_DRV_1BIT, 337 122, UNIPHIER_PIN_DRV_1BIT,
338 122, UNIPHIER_PIN_PULL_DOWN), 338 122, UNIPHIER_PIN_PULL_DOWN),
339 UNIPHIER_PINCTRL_PIN(123, "HS0DOUT7", 123, 339 UNIPHIER_PINCTRL_PIN(123, "HS0DOUT7", UNIPHIER_PIN_IECTRL_EXIST,
340 123, UNIPHIER_PIN_DRV_1BIT, 340 123, UNIPHIER_PIN_DRV_1BIT,
341 123, UNIPHIER_PIN_PULL_DOWN), 341 123, UNIPHIER_PIN_PULL_DOWN),
342 UNIPHIER_PINCTRL_PIN(124, "HS1BCLKIN", 124, 342 UNIPHIER_PINCTRL_PIN(124, "HS1BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
343 124, UNIPHIER_PIN_DRV_1BIT, 343 124, UNIPHIER_PIN_DRV_1BIT,
344 124, UNIPHIER_PIN_PULL_DOWN), 344 124, UNIPHIER_PIN_PULL_DOWN),
345 UNIPHIER_PINCTRL_PIN(125, "HS1SYNCIN", 125, 345 UNIPHIER_PINCTRL_PIN(125, "HS1SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
346 125, UNIPHIER_PIN_DRV_1BIT, 346 125, UNIPHIER_PIN_DRV_1BIT,
347 125, UNIPHIER_PIN_PULL_DOWN), 347 125, UNIPHIER_PIN_PULL_DOWN),
348 UNIPHIER_PINCTRL_PIN(126, "HS1VALIN", 126, 348 UNIPHIER_PINCTRL_PIN(126, "HS1VALIN", UNIPHIER_PIN_IECTRL_EXIST,
349 126, UNIPHIER_PIN_DRV_1BIT, 349 126, UNIPHIER_PIN_DRV_1BIT,
350 126, UNIPHIER_PIN_PULL_DOWN), 350 126, UNIPHIER_PIN_PULL_DOWN),
351 UNIPHIER_PINCTRL_PIN(127, "HS1DIN0", 127, 351 UNIPHIER_PINCTRL_PIN(127, "HS1DIN0", UNIPHIER_PIN_IECTRL_EXIST,
352 127, UNIPHIER_PIN_DRV_1BIT, 352 127, UNIPHIER_PIN_DRV_1BIT,
353 127, UNIPHIER_PIN_PULL_DOWN), 353 127, UNIPHIER_PIN_PULL_DOWN),
354 UNIPHIER_PINCTRL_PIN(128, "HS1DIN1", 128, 354 UNIPHIER_PINCTRL_PIN(128, "HS1DIN1", UNIPHIER_PIN_IECTRL_EXIST,
355 128, UNIPHIER_PIN_DRV_1BIT, 355 128, UNIPHIER_PIN_DRV_1BIT,
356 128, UNIPHIER_PIN_PULL_DOWN), 356 128, UNIPHIER_PIN_PULL_DOWN),
357 UNIPHIER_PINCTRL_PIN(129, "HS1DIN2", 129, 357 UNIPHIER_PINCTRL_PIN(129, "HS1DIN2", UNIPHIER_PIN_IECTRL_EXIST,
358 129, UNIPHIER_PIN_DRV_1BIT, 358 129, UNIPHIER_PIN_DRV_1BIT,
359 129, UNIPHIER_PIN_PULL_DOWN), 359 129, UNIPHIER_PIN_PULL_DOWN),
360 UNIPHIER_PINCTRL_PIN(130, "HS1DIN3", 130, 360 UNIPHIER_PINCTRL_PIN(130, "HS1DIN3", UNIPHIER_PIN_IECTRL_EXIST,
361 130, UNIPHIER_PIN_DRV_1BIT, 361 130, UNIPHIER_PIN_DRV_1BIT,
362 130, UNIPHIER_PIN_PULL_DOWN), 362 130, UNIPHIER_PIN_PULL_DOWN),
363 UNIPHIER_PINCTRL_PIN(131, "HS1DIN4", 131, 363 UNIPHIER_PINCTRL_PIN(131, "HS1DIN4", UNIPHIER_PIN_IECTRL_EXIST,
364 131, UNIPHIER_PIN_DRV_1BIT, 364 131, UNIPHIER_PIN_DRV_1BIT,
365 131, UNIPHIER_PIN_PULL_DOWN), 365 131, UNIPHIER_PIN_PULL_DOWN),
366 UNIPHIER_PINCTRL_PIN(132, "HS1DIN5", 132, 366 UNIPHIER_PINCTRL_PIN(132, "HS1DIN5", UNIPHIER_PIN_IECTRL_EXIST,
367 132, UNIPHIER_PIN_DRV_1BIT, 367 132, UNIPHIER_PIN_DRV_1BIT,
368 132, UNIPHIER_PIN_PULL_DOWN), 368 132, UNIPHIER_PIN_PULL_DOWN),
369 UNIPHIER_PINCTRL_PIN(133, "HS1DIN6", 133, 369 UNIPHIER_PINCTRL_PIN(133, "HS1DIN6", UNIPHIER_PIN_IECTRL_EXIST,
370 133, UNIPHIER_PIN_DRV_1BIT, 370 133, UNIPHIER_PIN_DRV_1BIT,
371 133, UNIPHIER_PIN_PULL_DOWN), 371 133, UNIPHIER_PIN_PULL_DOWN),
372 UNIPHIER_PINCTRL_PIN(134, "HS1DIN7", 134, 372 UNIPHIER_PINCTRL_PIN(134, "HS1DIN7", UNIPHIER_PIN_IECTRL_EXIST,
373 134, UNIPHIER_PIN_DRV_1BIT, 373 134, UNIPHIER_PIN_DRV_1BIT,
374 134, UNIPHIER_PIN_PULL_DOWN), 374 134, UNIPHIER_PIN_PULL_DOWN),
375 UNIPHIER_PINCTRL_PIN(135, "AO1IEC", 135, 375 UNIPHIER_PINCTRL_PIN(135, "AO1IEC", UNIPHIER_PIN_IECTRL_EXIST,
376 135, UNIPHIER_PIN_DRV_1BIT, 376 135, UNIPHIER_PIN_DRV_1BIT,
377 135, UNIPHIER_PIN_PULL_DOWN), 377 135, UNIPHIER_PIN_PULL_DOWN),
378 UNIPHIER_PINCTRL_PIN(136, "AO1ARC", 136, 378 UNIPHIER_PINCTRL_PIN(136, "AO1ARC", UNIPHIER_PIN_IECTRL_EXIST,
379 136, UNIPHIER_PIN_DRV_1BIT, 379 136, UNIPHIER_PIN_DRV_1BIT,
380 136, UNIPHIER_PIN_PULL_DOWN), 380 136, UNIPHIER_PIN_PULL_DOWN),
381 UNIPHIER_PINCTRL_PIN(137, "AO1DACCK", 137, 381 UNIPHIER_PINCTRL_PIN(137, "AO1DACCK", UNIPHIER_PIN_IECTRL_EXIST,
382 137, UNIPHIER_PIN_DRV_1BIT, 382 137, UNIPHIER_PIN_DRV_1BIT,
383 137, UNIPHIER_PIN_PULL_DOWN), 383 137, UNIPHIER_PIN_PULL_DOWN),
384 UNIPHIER_PINCTRL_PIN(138, "AO1BCK", 138, 384 UNIPHIER_PINCTRL_PIN(138, "AO1BCK", UNIPHIER_PIN_IECTRL_EXIST,
385 138, UNIPHIER_PIN_DRV_1BIT, 385 138, UNIPHIER_PIN_DRV_1BIT,
386 138, UNIPHIER_PIN_PULL_DOWN), 386 138, UNIPHIER_PIN_PULL_DOWN),
387 UNIPHIER_PINCTRL_PIN(139, "AO1LRCK", 139, 387 UNIPHIER_PINCTRL_PIN(139, "AO1LRCK", UNIPHIER_PIN_IECTRL_EXIST,
388 139, UNIPHIER_PIN_DRV_1BIT, 388 139, UNIPHIER_PIN_DRV_1BIT,
389 139, UNIPHIER_PIN_PULL_DOWN), 389 139, UNIPHIER_PIN_PULL_DOWN),
390 UNIPHIER_PINCTRL_PIN(140, "AO1D0", 140, 390 UNIPHIER_PINCTRL_PIN(140, "AO1D0", UNIPHIER_PIN_IECTRL_EXIST,
391 140, UNIPHIER_PIN_DRV_1BIT, 391 140, UNIPHIER_PIN_DRV_1BIT,
392 140, UNIPHIER_PIN_PULL_DOWN), 392 140, UNIPHIER_PIN_PULL_DOWN),
393 UNIPHIER_PINCTRL_PIN(141, "AO1D1", 141, 393 UNIPHIER_PINCTRL_PIN(141, "AO1D1", UNIPHIER_PIN_IECTRL_EXIST,
394 141, UNIPHIER_PIN_DRV_1BIT, 394 141, UNIPHIER_PIN_DRV_1BIT,
395 141, UNIPHIER_PIN_PULL_DOWN), 395 141, UNIPHIER_PIN_PULL_DOWN),
396 UNIPHIER_PINCTRL_PIN(142, "AO1D2", 142, 396 UNIPHIER_PINCTRL_PIN(142, "AO1D2", UNIPHIER_PIN_IECTRL_EXIST,
397 142, UNIPHIER_PIN_DRV_1BIT, 397 142, UNIPHIER_PIN_DRV_1BIT,
398 142, UNIPHIER_PIN_PULL_DOWN), 398 142, UNIPHIER_PIN_PULL_DOWN),
399 UNIPHIER_PINCTRL_PIN(143, "XIRQ9", 143, 399 UNIPHIER_PINCTRL_PIN(143, "XIRQ9", UNIPHIER_PIN_IECTRL_EXIST,
400 143, UNIPHIER_PIN_DRV_1BIT, 400 143, UNIPHIER_PIN_DRV_1BIT,
401 143, UNIPHIER_PIN_PULL_DOWN), 401 143, UNIPHIER_PIN_PULL_DOWN),
402 UNIPHIER_PINCTRL_PIN(144, "XIRQ10", 144, 402 UNIPHIER_PINCTRL_PIN(144, "XIRQ10", UNIPHIER_PIN_IECTRL_EXIST,
403 144, UNIPHIER_PIN_DRV_1BIT, 403 144, UNIPHIER_PIN_DRV_1BIT,
404 144, UNIPHIER_PIN_PULL_DOWN), 404 144, UNIPHIER_PIN_PULL_DOWN),
405 UNIPHIER_PINCTRL_PIN(145, "XIRQ11", 145, 405 UNIPHIER_PINCTRL_PIN(145, "XIRQ11", UNIPHIER_PIN_IECTRL_EXIST,
406 145, UNIPHIER_PIN_DRV_1BIT, 406 145, UNIPHIER_PIN_DRV_1BIT,
407 145, UNIPHIER_PIN_PULL_DOWN), 407 145, UNIPHIER_PIN_PULL_DOWN),
408 UNIPHIER_PINCTRL_PIN(146, "XIRQ13", 146, 408 UNIPHIER_PINCTRL_PIN(146, "XIRQ13", UNIPHIER_PIN_IECTRL_EXIST,
409 146, UNIPHIER_PIN_DRV_1BIT, 409 146, UNIPHIER_PIN_DRV_1BIT,
410 146, UNIPHIER_PIN_PULL_DOWN), 410 146, UNIPHIER_PIN_PULL_DOWN),
411 UNIPHIER_PINCTRL_PIN(147, "PWMA", 147, 411 UNIPHIER_PINCTRL_PIN(147, "PWMA", UNIPHIER_PIN_IECTRL_EXIST,
412 147, UNIPHIER_PIN_DRV_1BIT, 412 147, UNIPHIER_PIN_DRV_1BIT,
413 147, UNIPHIER_PIN_PULL_DOWN), 413 147, UNIPHIER_PIN_PULL_DOWN),
414 UNIPHIER_PINCTRL_PIN(148, "LR_GOUT", 148, 414 UNIPHIER_PINCTRL_PIN(148, "LR_GOUT", UNIPHIER_PIN_IECTRL_EXIST,
415 148, UNIPHIER_PIN_DRV_1BIT, 415 148, UNIPHIER_PIN_DRV_1BIT,
416 148, UNIPHIER_PIN_PULL_DOWN), 416 148, UNIPHIER_PIN_PULL_DOWN),
417 UNIPHIER_PINCTRL_PIN(149, "XIRQ0", 149, 417 UNIPHIER_PINCTRL_PIN(149, "XIRQ0", UNIPHIER_PIN_IECTRL_EXIST,
418 149, UNIPHIER_PIN_DRV_1BIT, 418 149, UNIPHIER_PIN_DRV_1BIT,
419 149, UNIPHIER_PIN_PULL_DOWN), 419 149, UNIPHIER_PIN_PULL_DOWN),
420 UNIPHIER_PINCTRL_PIN(150, "XIRQ1", 150, 420 UNIPHIER_PINCTRL_PIN(150, "XIRQ1", UNIPHIER_PIN_IECTRL_EXIST,
421 150, UNIPHIER_PIN_DRV_1BIT, 421 150, UNIPHIER_PIN_DRV_1BIT,
422 150, UNIPHIER_PIN_PULL_DOWN), 422 150, UNIPHIER_PIN_PULL_DOWN),
423 UNIPHIER_PINCTRL_PIN(151, "XIRQ2", 151, 423 UNIPHIER_PINCTRL_PIN(151, "XIRQ2", UNIPHIER_PIN_IECTRL_EXIST,
424 151, UNIPHIER_PIN_DRV_1BIT, 424 151, UNIPHIER_PIN_DRV_1BIT,
425 151, UNIPHIER_PIN_PULL_DOWN), 425 151, UNIPHIER_PIN_PULL_DOWN),
426 UNIPHIER_PINCTRL_PIN(152, "XIRQ3", 152, 426 UNIPHIER_PINCTRL_PIN(152, "XIRQ3", UNIPHIER_PIN_IECTRL_EXIST,
427 152, UNIPHIER_PIN_DRV_1BIT, 427 152, UNIPHIER_PIN_DRV_1BIT,
428 152, UNIPHIER_PIN_PULL_DOWN), 428 152, UNIPHIER_PIN_PULL_DOWN),
429 UNIPHIER_PINCTRL_PIN(153, "XIRQ4", 153, 429 UNIPHIER_PINCTRL_PIN(153, "XIRQ4", UNIPHIER_PIN_IECTRL_EXIST,
430 153, UNIPHIER_PIN_DRV_1BIT, 430 153, UNIPHIER_PIN_DRV_1BIT,
431 153, UNIPHIER_PIN_PULL_DOWN), 431 153, UNIPHIER_PIN_PULL_DOWN),
432 UNIPHIER_PINCTRL_PIN(154, "XIRQ5", 154, 432 UNIPHIER_PINCTRL_PIN(154, "XIRQ5", UNIPHIER_PIN_IECTRL_EXIST,
433 154, UNIPHIER_PIN_DRV_1BIT, 433 154, UNIPHIER_PIN_DRV_1BIT,
434 154, UNIPHIER_PIN_PULL_DOWN), 434 154, UNIPHIER_PIN_PULL_DOWN),
435 UNIPHIER_PINCTRL_PIN(155, "XIRQ6", 155, 435 UNIPHIER_PINCTRL_PIN(155, "XIRQ6", UNIPHIER_PIN_IECTRL_EXIST,
436 155, UNIPHIER_PIN_DRV_1BIT, 436 155, UNIPHIER_PIN_DRV_1BIT,
437 155, UNIPHIER_PIN_PULL_DOWN), 437 155, UNIPHIER_PIN_PULL_DOWN),
438 UNIPHIER_PINCTRL_PIN(156, "XIRQ7", 156, 438 UNIPHIER_PINCTRL_PIN(156, "XIRQ7", UNIPHIER_PIN_IECTRL_EXIST,
439 156, UNIPHIER_PIN_DRV_1BIT, 439 156, UNIPHIER_PIN_DRV_1BIT,
440 156, UNIPHIER_PIN_PULL_DOWN), 440 156, UNIPHIER_PIN_PULL_DOWN),
441 UNIPHIER_PINCTRL_PIN(157, "XIRQ8", 157, 441 UNIPHIER_PINCTRL_PIN(157, "XIRQ8", UNIPHIER_PIN_IECTRL_EXIST,
442 157, UNIPHIER_PIN_DRV_1BIT, 442 157, UNIPHIER_PIN_DRV_1BIT,
443 157, UNIPHIER_PIN_PULL_DOWN), 443 157, UNIPHIER_PIN_PULL_DOWN),
444 UNIPHIER_PINCTRL_PIN(158, "AGCBS", 158, 444 UNIPHIER_PINCTRL_PIN(158, "AGCBS", UNIPHIER_PIN_IECTRL_EXIST,
445 158, UNIPHIER_PIN_DRV_1BIT, 445 158, UNIPHIER_PIN_DRV_1BIT,
446 158, UNIPHIER_PIN_PULL_DOWN), 446 158, UNIPHIER_PIN_PULL_DOWN),
447 UNIPHIER_PINCTRL_PIN(159, "XIRQ21", 159, 447 UNIPHIER_PINCTRL_PIN(159, "XIRQ21", UNIPHIER_PIN_IECTRL_EXIST,
448 159, UNIPHIER_PIN_DRV_1BIT, 448 159, UNIPHIER_PIN_DRV_1BIT,
449 159, UNIPHIER_PIN_PULL_DOWN), 449 159, UNIPHIER_PIN_PULL_DOWN),
450 UNIPHIER_PINCTRL_PIN(160, "XIRQ22", 160, 450 UNIPHIER_PINCTRL_PIN(160, "XIRQ22", UNIPHIER_PIN_IECTRL_EXIST,
451 160, UNIPHIER_PIN_DRV_1BIT, 451 160, UNIPHIER_PIN_DRV_1BIT,
452 160, UNIPHIER_PIN_PULL_DOWN), 452 160, UNIPHIER_PIN_PULL_DOWN),
453 UNIPHIER_PINCTRL_PIN(161, "XIRQ23", 161, 453 UNIPHIER_PINCTRL_PIN(161, "XIRQ23", UNIPHIER_PIN_IECTRL_EXIST,
454 161, UNIPHIER_PIN_DRV_1BIT, 454 161, UNIPHIER_PIN_DRV_1BIT,
455 161, UNIPHIER_PIN_PULL_DOWN), 455 161, UNIPHIER_PIN_PULL_DOWN),
456 UNIPHIER_PINCTRL_PIN(162, "CH2CLK", 162, 456 UNIPHIER_PINCTRL_PIN(162, "CH2CLK", UNIPHIER_PIN_IECTRL_EXIST,
457 162, UNIPHIER_PIN_DRV_1BIT, 457 162, UNIPHIER_PIN_DRV_1BIT,
458 162, UNIPHIER_PIN_PULL_DOWN), 458 162, UNIPHIER_PIN_PULL_DOWN),
459 UNIPHIER_PINCTRL_PIN(163, "CH2PSYNC", 163, 459 UNIPHIER_PINCTRL_PIN(163, "CH2PSYNC", UNIPHIER_PIN_IECTRL_EXIST,
460 163, UNIPHIER_PIN_DRV_1BIT, 460 163, UNIPHIER_PIN_DRV_1BIT,
461 163, UNIPHIER_PIN_PULL_DOWN), 461 163, UNIPHIER_PIN_PULL_DOWN),
462 UNIPHIER_PINCTRL_PIN(164, "CH2VAL", 164, 462 UNIPHIER_PINCTRL_PIN(164, "CH2VAL", UNIPHIER_PIN_IECTRL_EXIST,
463 164, UNIPHIER_PIN_DRV_1BIT, 463 164, UNIPHIER_PIN_DRV_1BIT,
464 164, UNIPHIER_PIN_PULL_DOWN), 464 164, UNIPHIER_PIN_PULL_DOWN),
465 UNIPHIER_PINCTRL_PIN(165, "CH2DATA", 165, 465 UNIPHIER_PINCTRL_PIN(165, "CH2DATA", UNIPHIER_PIN_IECTRL_EXIST,
466 165, UNIPHIER_PIN_DRV_1BIT, 466 165, UNIPHIER_PIN_DRV_1BIT,
467 165, UNIPHIER_PIN_PULL_DOWN), 467 165, UNIPHIER_PIN_PULL_DOWN),
468 UNIPHIER_PINCTRL_PIN(166, "CK25O", 166, 468 UNIPHIER_PINCTRL_PIN(166, "CK25O", UNIPHIER_PIN_IECTRL_EXIST,
469 166, UNIPHIER_PIN_DRV_1BIT, 469 166, UNIPHIER_PIN_DRV_1BIT,
470 166, UNIPHIER_PIN_PULL_DOWN), 470 166, UNIPHIER_PIN_PULL_DOWN),
471}; 471};
472 472
473static const unsigned aout_pins[] = {135, 136, 137, 138, 139, 140, 141, 142};
474static const int aout_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0};
473static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25}; 475static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25};
474static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 476static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0};
475static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29}; 477static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29};
@@ -508,102 +510,44 @@ static const unsigned usb1_pins[] = {48, 49};
508static const int usb1_muxvals[] = {0, 0}; 510static const int usb1_muxvals[] = {0, 0};
509static const unsigned usb2_pins[] = {50, 51}; 511static const unsigned usb2_pins[] = {50, 51};
510static const int usb2_muxvals[] = {0, 0}; 512static const int usb2_muxvals[] = {0, 0};
511static const unsigned port_range0_pins[] = { 513static const unsigned int gpio_range0_pins[] = {
512 159, 160, 161, 162, 163, 164, 165, 166, /* PORT0x */ 514 159, 160, 161, 162, 163, 164, 165, 166, /* PORT0x */
513 0, 1, 2, 3, 4, 5, 6, 7, /* PORT1x */ 515 0, 1, 2, 3, 4, 5, 6, 7, /* PORT1x */
514 8, 9, 10, 11, 12, 13, 14, 15, /* PORT2x */ 516 8, 9, 10, 11, 12, 13, 14, 15, /* PORT2x */
515 16, 17, 18, /* PORT30-32 */ 517 16, 17, 18, /* PORT30-32 */
516}; 518};
517static const int port_range0_muxvals[] = { 519static const unsigned int gpio_range1_pins[] = {
518 15, 15, 15, 15, 15, 15, 15, 15, /* PORT0x */
519 15, 15, 15, 15, 15, 15, 15, 15, /* PORT1x */
520 15, 15, 15, 15, 15, 15, 15, 15, /* PORT2x */
521 15, 15, 15, /* PORT30-32 */
522};
523static const unsigned port_range1_pins[] = {
524 46, 47, 48, 49, 50, /* PORT53-57 */ 520 46, 47, 48, 49, 50, /* PORT53-57 */
525 51, /* PORT60 */ 521 51, /* PORT60 */
526}; 522};
527static const int port_range1_muxvals[] = { 523static const unsigned int gpio_range2_pins[] = {
528 15, 15, 15, 15, 15, /* PORT53-57 */
529 15, /* PORT60 */
530};
531static const unsigned port_range2_pins[] = {
532 54, 55, 56, 57, 58, /* PORT63-67 */ 524 54, 55, 56, 57, 58, /* PORT63-67 */
533 59, 60, 69, 70, 71, 72, 73, 74, /* PORT7x */ 525 59, 60, 69, 70, 71, 72, 73, 74, /* PORT7x */
534 75, 76, 77, 78, 79, 80, 81, 82, /* PORT8x */ 526 75, 76, 77, 78, 79, 80, 81, 82, /* PORT8x */
535 83, 84, 85, 86, 87, 88, 89, 90, /* PORT9x */ 527 83, 84, 85, 86, 87, 88, 89, 90, /* PORT9x */
536 91, 92, 93, 94, 95, 96, 97, 98, /* PORT10x */ 528 91, 92, 93, 94, 95, 96, 97, 98, /* PORT10x */
537}; 529};
538static const int port_range2_muxvals[] = { 530static const unsigned int gpio_range3_pins[] = {
539 15, 15, 15, 15, 15, /* PORT63-67 */
540 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */
541 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */
542 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */
543 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */
544};
545static const unsigned port_range3_pins[] = {
546 99, 100, 101, 102, 103, 104, 105, 106, /* PORT12x */ 531 99, 100, 101, 102, 103, 104, 105, 106, /* PORT12x */
547 107, 108, 109, 110, 111, 112, 113, 114, /* PORT13x */ 532 107, 108, 109, 110, 111, 112, 113, 114, /* PORT13x */
548 115, 116, 117, 118, 119, 120, 121, 122, /* PORT14x */ 533 115, 116, 117, 118, 119, 120, 121, 122, /* PORT14x */
549}; 534 149, 150, 151, 152, 153, 154, 155, 156, /* XIRQ0-7 */
550static const int port_range3_muxvals[] = { 535 157, 143, 144, 145, 85, 146, 158, 84, /* XIRQ8-15 */
551 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */ 536 141, 142, 148, 50, 51, 159, 160, 161, /* XIRQ16-23 */
552 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */
553 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
554};
555static const unsigned port_range4_pins[] = {
556 61, 62, 63, 64, 65, 66, 67, 68, /* PORT18x */ 537 61, 62, 63, 64, 65, 66, 67, 68, /* PORT18x */
557}; 538};
558static const int port_range4_muxvals[] = { 539static const unsigned int gpio_range4_pins[] = {
559 15, 15, 15, 15, 15, 15, 15, 15, /* PORT18x */
560};
561static const unsigned port_range5_pins[] = {
562 123, 124, 125, 126, 127, 128, 129, 130, /* PORT20x */ 540 123, 124, 125, 126, 127, 128, 129, 130, /* PORT20x */
563 131, 132, 133, 134, 135, 136, 137, 138, /* PORT21x */ 541 131, 132, 133, 134, 135, 136, 137, 138, /* PORT21x */
564 139, 140, 141, 142, /* PORT220-223 */ 542 139, 140, 141, 142, /* PORT220-223 */
565}; 543};
566static const int port_range5_muxvals[] = { 544static const unsigned int gpio_range5_pins[] = {
567 15, 15, 15, 15, 15, 15, 15, 15, /* PORT20x */
568 15, 15, 15, 15, 15, 15, 15, 15, /* PORT21x */
569 15, 15, 15, 15, /* PORT220-223 */
570};
571static const unsigned port_range6_pins[] = {
572 147, 148, 149, 150, 151, 152, 153, 154, /* PORT23x */ 545 147, 148, 149, 150, 151, 152, 153, 154, /* PORT23x */
573 155, 156, 157, 143, 144, 145, 146, 158, /* PORT24x */ 546 155, 156, 157, 143, 144, 145, 146, 158, /* PORT24x */
574}; 547};
575static const int port_range6_muxvals[] = {
576 15, 15, 15, 15, 15, 15, 15, 15, /* PORT23x */
577 15, 15, 15, 15, 15, 15, 15, 15, /* PORT24x */
578};
579static const unsigned xirq_pins[] = {
580 149, 150, 151, 152, 153, 154, 155, 156, /* XIRQ0-7 */
581 157, 143, 144, 145, 85, 146, 158, 84, /* XIRQ8-15 */
582 141, 142, 148, 50, 51, 159, 160, 161, /* XIRQ16-23 */
583};
584static const int xirq_muxvals[] = {
585 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
586 14, 14, 14, 14, 13, 14, 14, 13, /* XIRQ8-15 */
587 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ16-23 */
588};
589static const unsigned xirq_alternatives_pins[] = {
590 94, 95, 96, 97, 98, 99, 100, 101, /* XIRQ0-7 */
591 102, 103, 104, 105, 106, 107, /* XIRQ8-11,13,14 */
592 108, 109, 110, 111, 112, 113, 114, 115, /* XIRQ16-23 */
593 9, 10, 11, 12, 13, 14, 15, 16, /* XIRQ4-11 */
594 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, /* XIRQ13,14,16-23 */
595 139, 140, 135, 147, /* XIRQ17,18,21,22 */
596};
597static const int xirq_alternatives_muxvals[] = {
598 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
599 14, 14, 14, 14, 14, 14, /* XIRQ8-11,13,14 */
600 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ16-23 */
601 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ4-11 */
602 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ13,14,16-23 */
603 14, 14, 14, 14, /* XIRQ17,18,21,22 */
604};
605 548
606static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = { 549static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
550 UNIPHIER_PINCTRL_GROUP(aout),
607 UNIPHIER_PINCTRL_GROUP(emmc), 551 UNIPHIER_PINCTRL_GROUP(emmc),
608 UNIPHIER_PINCTRL_GROUP(emmc_dat8), 552 UNIPHIER_PINCTRL_GROUP(emmc_dat8),
609 UNIPHIER_PINCTRL_GROUP(ether_rmii), 553 UNIPHIER_PINCTRL_GROUP(ether_rmii),
@@ -621,223 +565,15 @@ static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
621 UNIPHIER_PINCTRL_GROUP(usb0), 565 UNIPHIER_PINCTRL_GROUP(usb0),
622 UNIPHIER_PINCTRL_GROUP(usb1), 566 UNIPHIER_PINCTRL_GROUP(usb1),
623 UNIPHIER_PINCTRL_GROUP(usb2), 567 UNIPHIER_PINCTRL_GROUP(usb2),
624 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 568 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
625 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1), 569 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
626 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range2), 570 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
627 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range3), 571 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range3),
628 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range4), 572 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range4),
629 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range5), 573 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range5),
630 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range6),
631 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
632 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_alternatives),
633 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
634 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
635 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
636 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
637 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
638 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
639 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
640 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
641 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
642 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
643 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
644 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
645 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
646 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
647 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
648 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
649 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
650 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
651 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
652 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
653 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
654 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
655 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
656 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
657 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
658 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
659 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
660 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range1, 0),
661 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range1, 1),
662 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range1, 2),
663 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range1, 3),
664 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range1, 4),
665 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range1, 5),
666 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range2, 0),
667 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range2, 1),
668 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range2, 2),
669 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range2, 3),
670 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range2, 4),
671 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range2, 5),
672 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range2, 6),
673 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range2, 7),
674 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range2, 8),
675 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range2, 9),
676 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range2, 10),
677 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range2, 11),
678 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range2, 12),
679 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range2, 13),
680 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range2, 14),
681 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range2, 15),
682 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range2, 16),
683 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range2, 17),
684 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range2, 18),
685 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range2, 19),
686 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range2, 20),
687 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range2, 21),
688 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range2, 22),
689 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range2, 23),
690 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range2, 24),
691 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range2, 25),
692 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range2, 26),
693 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range2, 27),
694 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range2, 28),
695 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range2, 29),
696 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range2, 30),
697 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range2, 31),
698 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range2, 32),
699 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range2, 33),
700 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range2, 34),
701 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range2, 35),
702 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range2, 36),
703 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range3, 0),
704 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range3, 1),
705 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range3, 2),
706 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range3, 3),
707 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range3, 4),
708 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range3, 5),
709 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range3, 6),
710 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range3, 7),
711 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range3, 8),
712 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range3, 9),
713 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range3, 10),
714 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range3, 11),
715 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range3, 12),
716 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range3, 13),
717 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range3, 14),
718 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range3, 15),
719 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range3, 16),
720 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range3, 17),
721 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range3, 18),
722 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range3, 19),
723 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range3, 20),
724 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range3, 21),
725 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range3, 22),
726 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range3, 23),
727 UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range4, 0),
728 UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range4, 1),
729 UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range4, 2),
730 UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range4, 3),
731 UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range4, 4),
732 UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range4, 5),
733 UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range4, 6),
734 UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range4, 7),
735 UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range5, 0),
736 UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range5, 1),
737 UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range5, 2),
738 UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range5, 3),
739 UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range5, 4),
740 UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range5, 5),
741 UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range5, 6),
742 UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range5, 7),
743 UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range5, 8),
744 UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range5, 9),
745 UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range5, 10),
746 UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range5, 11),
747 UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range5, 12),
748 UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range5, 13),
749 UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range5, 14),
750 UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range5, 15),
751 UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range5, 16),
752 UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range5, 17),
753 UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range5, 18),
754 UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range5, 19),
755 UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range6, 0),
756 UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range6, 1),
757 UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range6, 2),
758 UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range6, 3),
759 UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range6, 4),
760 UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range6, 5),
761 UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range6, 6),
762 UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range6, 7),
763 UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range6, 8),
764 UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range6, 9),
765 UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range6, 10),
766 UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range6, 11),
767 UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range6, 12),
768 UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range6, 13),
769 UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range6, 14),
770 UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range6, 15),
771 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
772 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
773 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
774 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
775 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
776 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
777 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
778 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
779 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
780 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
781 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
782 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
783 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
784 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
785 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
786 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
787 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
788 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
789 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
790 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
791 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
792 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21, xirq, 21),
793 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22, xirq, 22),
794 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23, xirq, 23),
795 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0b, xirq_alternatives, 0),
796 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1b, xirq_alternatives, 1),
797 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2b, xirq_alternatives, 2),
798 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3b, xirq_alternatives, 3),
799 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4b, xirq_alternatives, 4),
800 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5b, xirq_alternatives, 5),
801 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6b, xirq_alternatives, 6),
802 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7b, xirq_alternatives, 7),
803 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8b, xirq_alternatives, 8),
804 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9b, xirq_alternatives, 9),
805 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10b, xirq_alternatives, 10),
806 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11b, xirq_alternatives, 11),
807 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13b, xirq_alternatives, 12),
808 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14b, xirq_alternatives, 13),
809 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16b, xirq_alternatives, 14),
810 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17b, xirq_alternatives, 15),
811 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18b, xirq_alternatives, 16),
812 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19b, xirq_alternatives, 17),
813 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20b, xirq_alternatives, 18),
814 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21b, xirq_alternatives, 19),
815 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22b, xirq_alternatives, 20),
816 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23b, xirq_alternatives, 21),
817 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4c, xirq_alternatives, 22),
818 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5c, xirq_alternatives, 23),
819 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6c, xirq_alternatives, 24),
820 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7c, xirq_alternatives, 25),
821 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8c, xirq_alternatives, 26),
822 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9c, xirq_alternatives, 27),
823 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10c, xirq_alternatives, 28),
824 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11c, xirq_alternatives, 29),
825 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13c, xirq_alternatives, 30),
826 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14c, xirq_alternatives, 31),
827 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16c, xirq_alternatives, 32),
828 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17c, xirq_alternatives, 33),
829 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18c, xirq_alternatives, 34),
830 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19c, xirq_alternatives, 35),
831 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20c, xirq_alternatives, 36),
832 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21c, xirq_alternatives, 37),
833 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22c, xirq_alternatives, 38),
834 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23c, xirq_alternatives, 39),
835 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17d, xirq_alternatives, 40),
836 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18d, xirq_alternatives, 41),
837 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21d, xirq_alternatives, 42),
838 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22d, xirq_alternatives, 43),
839}; 574};
840 575
576static const char * const aout_groups[] = {"aout"};
841static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 577static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
842static const char * const ether_rmii_groups[] = {"ether_rmii"}; 578static const char * const ether_rmii_groups[] = {"ether_rmii"};
843static const char * const i2c0_groups[] = {"i2c0"}; 579static const char * const i2c0_groups[] = {"i2c0"};
@@ -854,70 +590,9 @@ static const char * const uart3_groups[] = {"uart3"};
854static const char * const usb0_groups[] = {"usb0"}; 590static const char * const usb0_groups[] = {"usb0"};
855static const char * const usb1_groups[] = {"usb1"}; 591static const char * const usb1_groups[] = {"usb1"};
856static const char * const usb2_groups[] = {"usb2"}; 592static const char * const usb2_groups[] = {"usb2"};
857static const char * const port_groups[] = {
858 "port00", "port01", "port02", "port03",
859 "port04", "port05", "port06", "port07",
860 "port10", "port11", "port12", "port13",
861 "port14", "port15", "port16", "port17",
862 "port20", "port21", "port22", "port23",
863 "port24", "port25", "port26", "port27",
864 "port30", "port31", "port32",
865 /* port33-52 missing */ "port53",
866 "port54", "port55", "port56", "port57",
867 "port60", /* port61-62 missing*/ "port63",
868 "port64", "port65", "port66", "port67",
869 "port70", "port71", "port72", "port73",
870 "port74", "port75", "port76", "port77",
871 "port80", "port81", "port82", "port83",
872 "port84", "port85", "port86", "port87",
873 "port90", "port91", "port92", "port93",
874 "port94", "port95", "port96", "port97",
875 "port100", "port101", "port102", "port103",
876 "port104", "port105", "port106", "port107",
877 /* port110-117 missing */
878 "port120", "port121", "port122", "port123",
879 "port124", "port125", "port126", "port127",
880 "port130", "port131", "port132", "port133",
881 "port134", "port135", "port136", "port137",
882 "port140", "port141", "port142", "port143",
883 "port144", "port145", "port146", "port147",
884 /* port150-177 missing */
885 "port180", "port181", "port182", "port183",
886 "port184", "port185", "port186", "port187",
887 /* port190-197 missing */
888 "port200", "port201", "port202", "port203",
889 "port204", "port205", "port206", "port207",
890 "port210", "port211", "port212", "port213",
891 "port214", "port215", "port216", "port217",
892 "port220", "port221", "port222", "port223",
893 /* port224-227 missing */
894 "port230", "port231", "port232", "port233",
895 "port234", "port235", "port236", "port237",
896 "port240", "port241", "port242", "port243",
897 "port244", "port245", "port246", "port247",
898};
899static const char * const xirq_groups[] = {
900 "xirq0", "xirq1", "xirq2", "xirq3",
901 "xirq4", "xirq5", "xirq6", "xirq7",
902 "xirq8", "xirq9", "xirq10", "xirq11",
903 "xirq12", "xirq13", "xirq14", "xirq15",
904 "xirq16", "xirq17", "xirq18", "xirq19",
905 "xirq20", "xirq21", "xirq22", "xirq23",
906 "xirq0b", "xirq1b", "xirq2b", "xirq3b",
907 "xirq4b", "xirq5b", "xirq6b", "xirq7b",
908 "xirq8b", "xirq9b", "xirq10b", "xirq11b",
909 /* none */ "xirq13b", "xirq14b", /* none */
910 "xirq16b", "xirq17b", "xirq18b", "xirq19b",
911 "xirq20b", "xirq21b", "xirq22b", "xirq23b",
912 "xirq4c", "xirq5c", "xirq6c", "xirq7c",
913 "xirq8c", "xirq9c", "xirq10c", "xirq11c",
914 /* none */ "xirq13c", "xirq14c", /* none */
915 "xirq16c", "xirq17c", "xirq18c", "xirq19c",
916 "xirq20c", "xirq21c", "xirq22c", "xirq23c",
917 "xirq17d", "xirq18d", "xirq21d", "xirq22d",
918};
919 593
920static const struct uniphier_pinmux_function uniphier_ld11_functions[] = { 594static const struct uniphier_pinmux_function uniphier_ld11_functions[] = {
595 UNIPHIER_PINMUX_FUNCTION(aout),
921 UNIPHIER_PINMUX_FUNCTION(emmc), 596 UNIPHIER_PINMUX_FUNCTION(emmc),
922 UNIPHIER_PINMUX_FUNCTION(ether_rmii), 597 UNIPHIER_PINMUX_FUNCTION(ether_rmii),
923 UNIPHIER_PINMUX_FUNCTION(i2c0), 598 UNIPHIER_PINMUX_FUNCTION(i2c0),
@@ -933,10 +608,20 @@ static const struct uniphier_pinmux_function uniphier_ld11_functions[] = {
933 UNIPHIER_PINMUX_FUNCTION(usb0), 608 UNIPHIER_PINMUX_FUNCTION(usb0),
934 UNIPHIER_PINMUX_FUNCTION(usb1), 609 UNIPHIER_PINMUX_FUNCTION(usb1),
935 UNIPHIER_PINMUX_FUNCTION(usb2), 610 UNIPHIER_PINMUX_FUNCTION(usb2),
936 UNIPHIER_PINMUX_FUNCTION(port),
937 UNIPHIER_PINMUX_FUNCTION(xirq),
938}; 611};
939 612
613static int uniphier_ld11_get_gpio_muxval(unsigned int pin,
614 unsigned int gpio_offset)
615{
616 if (gpio_offset == 132 || gpio_offset == 135) /* XIRQ12, 15 */
617 return 13;
618
619 if (gpio_offset >= 120 && gpio_offset <= 143) /* XIRQx */
620 return 14;
621
622 return 15;
623}
624
940static struct uniphier_pinctrl_socdata uniphier_ld11_pindata = { 625static struct uniphier_pinctrl_socdata uniphier_ld11_pindata = {
941 .pins = uniphier_ld11_pins, 626 .pins = uniphier_ld11_pins,
942 .npins = ARRAY_SIZE(uniphier_ld11_pins), 627 .npins = ARRAY_SIZE(uniphier_ld11_pins),
@@ -944,6 +629,7 @@ static struct uniphier_pinctrl_socdata uniphier_ld11_pindata = {
944 .groups_count = ARRAY_SIZE(uniphier_ld11_groups), 629 .groups_count = ARRAY_SIZE(uniphier_ld11_groups),
945 .functions = uniphier_ld11_functions, 630 .functions = uniphier_ld11_functions,
946 .functions_count = ARRAY_SIZE(uniphier_ld11_functions), 631 .functions_count = ARRAY_SIZE(uniphier_ld11_functions),
632 .get_gpio_muxval = uniphier_ld11_get_gpio_muxval,
947 .caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL, 633 .caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
948}; 634};
949 635
@@ -962,6 +648,7 @@ static struct platform_driver uniphier_ld11_pinctrl_driver = {
962 .driver = { 648 .driver = {
963 .name = "uniphier-ld11-pinctrl", 649 .name = "uniphier-ld11-pinctrl",
964 .of_match_table = uniphier_ld11_pinctrl_match, 650 .of_match_table = uniphier_ld11_pinctrl_match,
651 .pm = &uniphier_pinctrl_pm_ops,
965 }, 652 },
966}; 653};
967builtin_platform_driver(uniphier_ld11_pinctrl_driver); 654builtin_platform_driver(uniphier_ld11_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
index 93006626028d..83341284dc44 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
@@ -21,536 +21,538 @@
21#include "pinctrl-uniphier.h" 21#include "pinctrl-uniphier.h"
22 22
23static const struct pinctrl_pin_desc uniphier_ld20_pins[] = { 23static const struct pinctrl_pin_desc uniphier_ld20_pins[] = {
24 UNIPHIER_PINCTRL_PIN(0, "XECS1", 0, 24 UNIPHIER_PINCTRL_PIN(0, "XECS1", UNIPHIER_PIN_IECTRL_EXIST,
25 0, UNIPHIER_PIN_DRV_3BIT, 25 0, UNIPHIER_PIN_DRV_3BIT,
26 0, UNIPHIER_PIN_PULL_UP), 26 0, UNIPHIER_PIN_PULL_UP),
27 UNIPHIER_PINCTRL_PIN(1, "ERXW", 1, 27 UNIPHIER_PINCTRL_PIN(1, "ERXW", UNIPHIER_PIN_IECTRL_EXIST,
28 1, UNIPHIER_PIN_DRV_3BIT, 28 1, UNIPHIER_PIN_DRV_3BIT,
29 1, UNIPHIER_PIN_PULL_UP), 29 1, UNIPHIER_PIN_PULL_UP),
30 UNIPHIER_PINCTRL_PIN(2, "XERWE1", 2, 30 UNIPHIER_PINCTRL_PIN(2, "XERWE1", UNIPHIER_PIN_IECTRL_EXIST,
31 2, UNIPHIER_PIN_DRV_3BIT, 31 2, UNIPHIER_PIN_DRV_3BIT,
32 2, UNIPHIER_PIN_PULL_UP), 32 2, UNIPHIER_PIN_PULL_UP),
33 UNIPHIER_PINCTRL_PIN(3, "XNFWP", 3, 33 UNIPHIER_PINCTRL_PIN(3, "XNFWP", UNIPHIER_PIN_IECTRL_EXIST,
34 3, UNIPHIER_PIN_DRV_3BIT, 34 3, UNIPHIER_PIN_DRV_3BIT,
35 3, UNIPHIER_PIN_PULL_DOWN), 35 3, UNIPHIER_PIN_PULL_DOWN),
36 UNIPHIER_PINCTRL_PIN(4, "XNFCE0", 4, 36 UNIPHIER_PINCTRL_PIN(4, "XNFCE0", UNIPHIER_PIN_IECTRL_EXIST,
37 4, UNIPHIER_PIN_DRV_3BIT, 37 4, UNIPHIER_PIN_DRV_3BIT,
38 4, UNIPHIER_PIN_PULL_UP), 38 4, UNIPHIER_PIN_PULL_UP),
39 UNIPHIER_PINCTRL_PIN(5, "NFRYBY0", 5, 39 UNIPHIER_PINCTRL_PIN(5, "NFRYBY0", UNIPHIER_PIN_IECTRL_EXIST,
40 5, UNIPHIER_PIN_DRV_3BIT, 40 5, UNIPHIER_PIN_DRV_3BIT,
41 5, UNIPHIER_PIN_PULL_UP), 41 5, UNIPHIER_PIN_PULL_UP),
42 UNIPHIER_PINCTRL_PIN(6, "XNFRE", 6, 42 UNIPHIER_PINCTRL_PIN(6, "XNFRE", UNIPHIER_PIN_IECTRL_EXIST,
43 6, UNIPHIER_PIN_DRV_3BIT, 43 6, UNIPHIER_PIN_DRV_3BIT,
44 6, UNIPHIER_PIN_PULL_UP), 44 6, UNIPHIER_PIN_PULL_UP),
45 UNIPHIER_PINCTRL_PIN(7, "XNFWE", 7, 45 UNIPHIER_PINCTRL_PIN(7, "XNFWE", UNIPHIER_PIN_IECTRL_EXIST,
46 7, UNIPHIER_PIN_DRV_3BIT, 46 7, UNIPHIER_PIN_DRV_3BIT,
47 7, UNIPHIER_PIN_PULL_UP), 47 7, UNIPHIER_PIN_PULL_UP),
48 UNIPHIER_PINCTRL_PIN(8, "NFALE", 8, 48 UNIPHIER_PINCTRL_PIN(8, "NFALE", UNIPHIER_PIN_IECTRL_EXIST,
49 8, UNIPHIER_PIN_DRV_3BIT, 49 8, UNIPHIER_PIN_DRV_3BIT,
50 8, UNIPHIER_PIN_PULL_UP), 50 8, UNIPHIER_PIN_PULL_UP),
51 UNIPHIER_PINCTRL_PIN(9, "NFCLE", 9, 51 UNIPHIER_PINCTRL_PIN(9, "NFCLE", UNIPHIER_PIN_IECTRL_EXIST,
52 9, UNIPHIER_PIN_DRV_3BIT, 52 9, UNIPHIER_PIN_DRV_3BIT,
53 9, UNIPHIER_PIN_PULL_UP), 53 9, UNIPHIER_PIN_PULL_UP),
54 UNIPHIER_PINCTRL_PIN(10, "NFD0", 10, 54 UNIPHIER_PINCTRL_PIN(10, "NFD0", UNIPHIER_PIN_IECTRL_EXIST,
55 10, UNIPHIER_PIN_DRV_3BIT, 55 10, UNIPHIER_PIN_DRV_3BIT,
56 10, UNIPHIER_PIN_PULL_UP), 56 10, UNIPHIER_PIN_PULL_UP),
57 UNIPHIER_PINCTRL_PIN(11, "NFD1", 11, 57 UNIPHIER_PINCTRL_PIN(11, "NFD1", UNIPHIER_PIN_IECTRL_EXIST,
58 11, UNIPHIER_PIN_DRV_3BIT, 58 11, UNIPHIER_PIN_DRV_3BIT,
59 11, UNIPHIER_PIN_PULL_UP), 59 11, UNIPHIER_PIN_PULL_UP),
60 UNIPHIER_PINCTRL_PIN(12, "NFD2", 12, 60 UNIPHIER_PINCTRL_PIN(12, "NFD2", UNIPHIER_PIN_IECTRL_EXIST,
61 12, UNIPHIER_PIN_DRV_3BIT, 61 12, UNIPHIER_PIN_DRV_3BIT,
62 12, UNIPHIER_PIN_PULL_UP), 62 12, UNIPHIER_PIN_PULL_UP),
63 UNIPHIER_PINCTRL_PIN(13, "NFD3", 13, 63 UNIPHIER_PINCTRL_PIN(13, "NFD3", UNIPHIER_PIN_IECTRL_EXIST,
64 13, UNIPHIER_PIN_DRV_3BIT, 64 13, UNIPHIER_PIN_DRV_3BIT,
65 13, UNIPHIER_PIN_PULL_UP), 65 13, UNIPHIER_PIN_PULL_UP),
66 UNIPHIER_PINCTRL_PIN(14, "NFD4", 14, 66 UNIPHIER_PINCTRL_PIN(14, "NFD4", UNIPHIER_PIN_IECTRL_EXIST,
67 14, UNIPHIER_PIN_DRV_3BIT, 67 14, UNIPHIER_PIN_DRV_3BIT,
68 14, UNIPHIER_PIN_PULL_UP), 68 14, UNIPHIER_PIN_PULL_UP),
69 UNIPHIER_PINCTRL_PIN(15, "NFD5", 15, 69 UNIPHIER_PINCTRL_PIN(15, "NFD5", UNIPHIER_PIN_IECTRL_EXIST,
70 15, UNIPHIER_PIN_DRV_3BIT, 70 15, UNIPHIER_PIN_DRV_3BIT,
71 15, UNIPHIER_PIN_PULL_UP), 71 15, UNIPHIER_PIN_PULL_UP),
72 UNIPHIER_PINCTRL_PIN(16, "NFD6", 16, 72 UNIPHIER_PINCTRL_PIN(16, "NFD6", UNIPHIER_PIN_IECTRL_EXIST,
73 16, UNIPHIER_PIN_DRV_3BIT, 73 16, UNIPHIER_PIN_DRV_3BIT,
74 16, UNIPHIER_PIN_PULL_UP), 74 16, UNIPHIER_PIN_PULL_UP),
75 UNIPHIER_PINCTRL_PIN(17, "NFD7", 17, 75 UNIPHIER_PINCTRL_PIN(17, "NFD7", UNIPHIER_PIN_IECTRL_EXIST,
76 17, UNIPHIER_PIN_DRV_3BIT, 76 17, UNIPHIER_PIN_DRV_3BIT,
77 17, UNIPHIER_PIN_PULL_UP), 77 17, UNIPHIER_PIN_PULL_UP),
78 UNIPHIER_PINCTRL_PIN(18, "XERST", 18, 78 UNIPHIER_PINCTRL_PIN(18, "XERST", UNIPHIER_PIN_IECTRL_EXIST,
79 0, UNIPHIER_PIN_DRV_2BIT, 79 0, UNIPHIER_PIN_DRV_2BIT,
80 18, UNIPHIER_PIN_PULL_UP), 80 18, UNIPHIER_PIN_PULL_UP),
81 UNIPHIER_PINCTRL_PIN(19, "MMCCLK", 19, 81 UNIPHIER_PINCTRL_PIN(19, "MMCCLK", UNIPHIER_PIN_IECTRL_EXIST,
82 1, UNIPHIER_PIN_DRV_2BIT, 82 1, UNIPHIER_PIN_DRV_2BIT,
83 19, UNIPHIER_PIN_PULL_UP), 83 19, UNIPHIER_PIN_PULL_UP),
84 UNIPHIER_PINCTRL_PIN(20, "MMCCMD", 20, 84 UNIPHIER_PINCTRL_PIN(20, "MMCCMD", UNIPHIER_PIN_IECTRL_EXIST,
85 2, UNIPHIER_PIN_DRV_2BIT, 85 2, UNIPHIER_PIN_DRV_2BIT,
86 20, UNIPHIER_PIN_PULL_UP), 86 20, UNIPHIER_PIN_PULL_UP),
87 UNIPHIER_PINCTRL_PIN(21, "MMCDS", 21, 87 UNIPHIER_PINCTRL_PIN(21, "MMCDS", UNIPHIER_PIN_IECTRL_EXIST,
88 3, UNIPHIER_PIN_DRV_2BIT, 88 3, UNIPHIER_PIN_DRV_2BIT,
89 21, UNIPHIER_PIN_PULL_UP), 89 21, UNIPHIER_PIN_PULL_UP),
90 UNIPHIER_PINCTRL_PIN(22, "MMCDAT0", 22, 90 UNIPHIER_PINCTRL_PIN(22, "MMCDAT0", UNIPHIER_PIN_IECTRL_EXIST,
91 4, UNIPHIER_PIN_DRV_2BIT, 91 4, UNIPHIER_PIN_DRV_2BIT,
92 22, UNIPHIER_PIN_PULL_UP), 92 22, UNIPHIER_PIN_PULL_UP),
93 UNIPHIER_PINCTRL_PIN(23, "MMCDAT1", 23, 93 UNIPHIER_PINCTRL_PIN(23, "MMCDAT1", UNIPHIER_PIN_IECTRL_EXIST,
94 5, UNIPHIER_PIN_DRV_2BIT, 94 5, UNIPHIER_PIN_DRV_2BIT,
95 23, UNIPHIER_PIN_PULL_UP), 95 23, UNIPHIER_PIN_PULL_UP),
96 UNIPHIER_PINCTRL_PIN(24, "MMCDAT2", 24, 96 UNIPHIER_PINCTRL_PIN(24, "MMCDAT2", UNIPHIER_PIN_IECTRL_EXIST,
97 6, UNIPHIER_PIN_DRV_2BIT, 97 6, UNIPHIER_PIN_DRV_2BIT,
98 24, UNIPHIER_PIN_PULL_UP), 98 24, UNIPHIER_PIN_PULL_UP),
99 UNIPHIER_PINCTRL_PIN(25, "MMCDAT3", 25, 99 UNIPHIER_PINCTRL_PIN(25, "MMCDAT3", UNIPHIER_PIN_IECTRL_EXIST,
100 7, UNIPHIER_PIN_DRV_2BIT, 100 7, UNIPHIER_PIN_DRV_2BIT,
101 25, UNIPHIER_PIN_PULL_UP), 101 25, UNIPHIER_PIN_PULL_UP),
102 UNIPHIER_PINCTRL_PIN(26, "MMCDAT4", 26, 102 UNIPHIER_PINCTRL_PIN(26, "MMCDAT4", UNIPHIER_PIN_IECTRL_EXIST,
103 8, UNIPHIER_PIN_DRV_2BIT, 103 8, UNIPHIER_PIN_DRV_2BIT,
104 26, UNIPHIER_PIN_PULL_UP), 104 26, UNIPHIER_PIN_PULL_UP),
105 UNIPHIER_PINCTRL_PIN(27, "MMCDAT5", 27, 105 UNIPHIER_PINCTRL_PIN(27, "MMCDAT5", UNIPHIER_PIN_IECTRL_EXIST,
106 9, UNIPHIER_PIN_DRV_2BIT, 106 9, UNIPHIER_PIN_DRV_2BIT,
107 27, UNIPHIER_PIN_PULL_UP), 107 27, UNIPHIER_PIN_PULL_UP),
108 UNIPHIER_PINCTRL_PIN(28, "MMCDAT6", 28, 108 UNIPHIER_PINCTRL_PIN(28, "MMCDAT6", UNIPHIER_PIN_IECTRL_EXIST,
109 10, UNIPHIER_PIN_DRV_2BIT, 109 10, UNIPHIER_PIN_DRV_2BIT,
110 28, UNIPHIER_PIN_PULL_UP), 110 28, UNIPHIER_PIN_PULL_UP),
111 UNIPHIER_PINCTRL_PIN(29, "MMCDAT7", 29, 111 UNIPHIER_PINCTRL_PIN(29, "MMCDAT7", UNIPHIER_PIN_IECTRL_EXIST,
112 11, UNIPHIER_PIN_DRV_2BIT, 112 11, UNIPHIER_PIN_DRV_2BIT,
113 29, UNIPHIER_PIN_PULL_UP), 113 29, UNIPHIER_PIN_PULL_UP),
114 UNIPHIER_PINCTRL_PIN(30, "MDC", 30, 114 UNIPHIER_PINCTRL_PIN(30, "MDC", UNIPHIER_PIN_IECTRL_EXIST,
115 18, UNIPHIER_PIN_DRV_3BIT, 115 18, UNIPHIER_PIN_DRV_3BIT,
116 30, UNIPHIER_PIN_PULL_DOWN), 116 30, UNIPHIER_PIN_PULL_DOWN),
117 UNIPHIER_PINCTRL_PIN(31, "MDIO", 31, 117 UNIPHIER_PINCTRL_PIN(31, "MDIO", UNIPHIER_PIN_IECTRL_EXIST,
118 19, UNIPHIER_PIN_DRV_3BIT, 118 19, UNIPHIER_PIN_DRV_3BIT,
119 31, UNIPHIER_PIN_PULL_DOWN), 119 31, UNIPHIER_PIN_PULL_DOWN),
120 UNIPHIER_PINCTRL_PIN(32, "MDIO_INTL", 32, 120 UNIPHIER_PINCTRL_PIN(32, "MDIO_INTL", UNIPHIER_PIN_IECTRL_EXIST,
121 20, UNIPHIER_PIN_DRV_3BIT, 121 20, UNIPHIER_PIN_DRV_3BIT,
122 32, UNIPHIER_PIN_PULL_DOWN), 122 32, UNIPHIER_PIN_PULL_DOWN),
123 UNIPHIER_PINCTRL_PIN(33, "PHYRSTL", 33, 123 UNIPHIER_PINCTRL_PIN(33, "PHYRSTL", UNIPHIER_PIN_IECTRL_EXIST,
124 21, UNIPHIER_PIN_DRV_3BIT, 124 21, UNIPHIER_PIN_DRV_3BIT,
125 33, UNIPHIER_PIN_PULL_DOWN), 125 33, UNIPHIER_PIN_PULL_DOWN),
126 UNIPHIER_PINCTRL_PIN(34, "RGMII_RXCLK", 34, 126 UNIPHIER_PINCTRL_PIN(34, "RGMII_RXCLK", UNIPHIER_PIN_IECTRL_EXIST,
127 22, UNIPHIER_PIN_DRV_3BIT, 127 22, UNIPHIER_PIN_DRV_3BIT,
128 34, UNIPHIER_PIN_PULL_DOWN), 128 34, UNIPHIER_PIN_PULL_DOWN),
129 UNIPHIER_PINCTRL_PIN(35, "RGMII_RXD0", 35, 129 UNIPHIER_PINCTRL_PIN(35, "RGMII_RXD0", UNIPHIER_PIN_IECTRL_EXIST,
130 23, UNIPHIER_PIN_DRV_3BIT, 130 23, UNIPHIER_PIN_DRV_3BIT,
131 35, UNIPHIER_PIN_PULL_DOWN), 131 35, UNIPHIER_PIN_PULL_DOWN),
132 UNIPHIER_PINCTRL_PIN(36, "RGMII_RXD1", 36, 132 UNIPHIER_PINCTRL_PIN(36, "RGMII_RXD1", UNIPHIER_PIN_IECTRL_EXIST,
133 24, UNIPHIER_PIN_DRV_3BIT, 133 24, UNIPHIER_PIN_DRV_3BIT,
134 36, UNIPHIER_PIN_PULL_DOWN), 134 36, UNIPHIER_PIN_PULL_DOWN),
135 UNIPHIER_PINCTRL_PIN(37, "RGMII_RXD2", 37, 135 UNIPHIER_PINCTRL_PIN(37, "RGMII_RXD2", UNIPHIER_PIN_IECTRL_EXIST,
136 25, UNIPHIER_PIN_DRV_3BIT, 136 25, UNIPHIER_PIN_DRV_3BIT,
137 37, UNIPHIER_PIN_PULL_DOWN), 137 37, UNIPHIER_PIN_PULL_DOWN),
138 UNIPHIER_PINCTRL_PIN(38, "RGMII_RXD3", 38, 138 UNIPHIER_PINCTRL_PIN(38, "RGMII_RXD3", UNIPHIER_PIN_IECTRL_EXIST,
139 26, UNIPHIER_PIN_DRV_3BIT, 139 26, UNIPHIER_PIN_DRV_3BIT,
140 38, UNIPHIER_PIN_PULL_DOWN), 140 38, UNIPHIER_PIN_PULL_DOWN),
141 UNIPHIER_PINCTRL_PIN(39, "RGMII_RXCTL", 39, 141 UNIPHIER_PINCTRL_PIN(39, "RGMII_RXCTL", UNIPHIER_PIN_IECTRL_EXIST,
142 27, UNIPHIER_PIN_DRV_3BIT, 142 27, UNIPHIER_PIN_DRV_3BIT,
143 39, UNIPHIER_PIN_PULL_DOWN), 143 39, UNIPHIER_PIN_PULL_DOWN),
144 UNIPHIER_PINCTRL_PIN(40, "RGMII_TXCLK", 40, 144 UNIPHIER_PINCTRL_PIN(40, "RGMII_TXCLK", UNIPHIER_PIN_IECTRL_EXIST,
145 28, UNIPHIER_PIN_DRV_3BIT, 145 28, UNIPHIER_PIN_DRV_3BIT,
146 40, UNIPHIER_PIN_PULL_DOWN), 146 40, UNIPHIER_PIN_PULL_DOWN),
147 UNIPHIER_PINCTRL_PIN(41, "RGMII_TXD0", 41, 147 UNIPHIER_PINCTRL_PIN(41, "RGMII_TXD0", UNIPHIER_PIN_IECTRL_EXIST,
148 29, UNIPHIER_PIN_DRV_3BIT, 148 29, UNIPHIER_PIN_DRV_3BIT,
149 41, UNIPHIER_PIN_PULL_DOWN), 149 41, UNIPHIER_PIN_PULL_DOWN),
150 UNIPHIER_PINCTRL_PIN(42, "RGMII_TXD1", 42, 150 UNIPHIER_PINCTRL_PIN(42, "RGMII_TXD1", UNIPHIER_PIN_IECTRL_EXIST,
151 30, UNIPHIER_PIN_DRV_3BIT, 151 30, UNIPHIER_PIN_DRV_3BIT,
152 42, UNIPHIER_PIN_PULL_DOWN), 152 42, UNIPHIER_PIN_PULL_DOWN),
153 UNIPHIER_PINCTRL_PIN(43, "RGMII_TXD2", 43, 153 UNIPHIER_PINCTRL_PIN(43, "RGMII_TXD2", UNIPHIER_PIN_IECTRL_EXIST,
154 31, UNIPHIER_PIN_DRV_3BIT, 154 31, UNIPHIER_PIN_DRV_3BIT,
155 43, UNIPHIER_PIN_PULL_DOWN), 155 43, UNIPHIER_PIN_PULL_DOWN),
156 UNIPHIER_PINCTRL_PIN(44, "RGMII_TXD3", 44, 156 UNIPHIER_PINCTRL_PIN(44, "RGMII_TXD3", UNIPHIER_PIN_IECTRL_EXIST,
157 32, UNIPHIER_PIN_DRV_3BIT, 157 32, UNIPHIER_PIN_DRV_3BIT,
158 44, UNIPHIER_PIN_PULL_DOWN), 158 44, UNIPHIER_PIN_PULL_DOWN),
159 UNIPHIER_PINCTRL_PIN(45, "RGMII_TXCTL", 45, 159 UNIPHIER_PINCTRL_PIN(45, "RGMII_TXCTL", UNIPHIER_PIN_IECTRL_EXIST,
160 33, UNIPHIER_PIN_DRV_3BIT, 160 33, UNIPHIER_PIN_DRV_3BIT,
161 45, UNIPHIER_PIN_PULL_DOWN), 161 45, UNIPHIER_PIN_PULL_DOWN),
162 UNIPHIER_PINCTRL_PIN(46, "USB0VBUS", 46, 162 UNIPHIER_PINCTRL_PIN(46, "USB0VBUS", UNIPHIER_PIN_IECTRL_EXIST,
163 34, UNIPHIER_PIN_DRV_3BIT, 163 34, UNIPHIER_PIN_DRV_3BIT,
164 46, UNIPHIER_PIN_PULL_DOWN), 164 46, UNIPHIER_PIN_PULL_DOWN),
165 UNIPHIER_PINCTRL_PIN(47, "USB0OD", 47, 165 UNIPHIER_PINCTRL_PIN(47, "USB0OD", UNIPHIER_PIN_IECTRL_EXIST,
166 35, UNIPHIER_PIN_DRV_3BIT, 166 35, UNIPHIER_PIN_DRV_3BIT,
167 47, UNIPHIER_PIN_PULL_UP), 167 47, UNIPHIER_PIN_PULL_UP),
168 UNIPHIER_PINCTRL_PIN(48, "USB1VBUS", 48, 168 UNIPHIER_PINCTRL_PIN(48, "USB1VBUS", UNIPHIER_PIN_IECTRL_EXIST,
169 36, UNIPHIER_PIN_DRV_3BIT, 169 36, UNIPHIER_PIN_DRV_3BIT,
170 48, UNIPHIER_PIN_PULL_DOWN), 170 48, UNIPHIER_PIN_PULL_DOWN),
171 UNIPHIER_PINCTRL_PIN(49, "USB1OD", 49, 171 UNIPHIER_PINCTRL_PIN(49, "USB1OD", UNIPHIER_PIN_IECTRL_EXIST,
172 37, UNIPHIER_PIN_DRV_3BIT, 172 37, UNIPHIER_PIN_DRV_3BIT,
173 49, UNIPHIER_PIN_PULL_UP), 173 49, UNIPHIER_PIN_PULL_UP),
174 UNIPHIER_PINCTRL_PIN(50, "USB2VBUS", 50, 174 UNIPHIER_PINCTRL_PIN(50, "USB2VBUS", UNIPHIER_PIN_IECTRL_EXIST,
175 38, UNIPHIER_PIN_DRV_3BIT, 175 38, UNIPHIER_PIN_DRV_3BIT,
176 50, UNIPHIER_PIN_PULL_DOWN), 176 50, UNIPHIER_PIN_PULL_DOWN),
177 UNIPHIER_PINCTRL_PIN(51, "USB2OD", 51, 177 UNIPHIER_PINCTRL_PIN(51, "USB2OD", UNIPHIER_PIN_IECTRL_EXIST,
178 39, UNIPHIER_PIN_DRV_3BIT, 178 39, UNIPHIER_PIN_DRV_3BIT,
179 51, UNIPHIER_PIN_PULL_UP), 179 51, UNIPHIER_PIN_PULL_UP),
180 UNIPHIER_PINCTRL_PIN(52, "USB3VBUS", 52, 180 UNIPHIER_PINCTRL_PIN(52, "USB3VBUS", UNIPHIER_PIN_IECTRL_EXIST,
181 40, UNIPHIER_PIN_DRV_3BIT, 181 40, UNIPHIER_PIN_DRV_3BIT,
182 52, UNIPHIER_PIN_PULL_DOWN), 182 52, UNIPHIER_PIN_PULL_DOWN),
183 UNIPHIER_PINCTRL_PIN(53, "USB3OD", 53, 183 UNIPHIER_PINCTRL_PIN(53, "USB3OD", UNIPHIER_PIN_IECTRL_EXIST,
184 41, UNIPHIER_PIN_DRV_3BIT, 184 41, UNIPHIER_PIN_DRV_3BIT,
185 53, UNIPHIER_PIN_PULL_UP), 185 53, UNIPHIER_PIN_PULL_UP),
186 UNIPHIER_PINCTRL_PIN(54, "TXD0", 54, 186 UNIPHIER_PINCTRL_PIN(54, "TXD0", UNIPHIER_PIN_IECTRL_EXIST,
187 42, UNIPHIER_PIN_DRV_3BIT, 187 42, UNIPHIER_PIN_DRV_3BIT,
188 54, UNIPHIER_PIN_PULL_UP), 188 54, UNIPHIER_PIN_PULL_UP),
189 UNIPHIER_PINCTRL_PIN(55, "RXD0", 55, 189 UNIPHIER_PINCTRL_PIN(55, "RXD0", UNIPHIER_PIN_IECTRL_EXIST,
190 43, UNIPHIER_PIN_DRV_3BIT, 190 43, UNIPHIER_PIN_DRV_3BIT,
191 55, UNIPHIER_PIN_PULL_UP), 191 55, UNIPHIER_PIN_PULL_UP),
192 UNIPHIER_PINCTRL_PIN(56, "SPISYNC0", 56, 192 UNIPHIER_PINCTRL_PIN(56, "SPISYNC0", UNIPHIER_PIN_IECTRL_EXIST,
193 44, UNIPHIER_PIN_DRV_3BIT, 193 44, UNIPHIER_PIN_DRV_3BIT,
194 56, UNIPHIER_PIN_PULL_DOWN), 194 56, UNIPHIER_PIN_PULL_DOWN),
195 UNIPHIER_PINCTRL_PIN(57, "SPISCLK0", 57, 195 UNIPHIER_PINCTRL_PIN(57, "SPISCLK0", UNIPHIER_PIN_IECTRL_EXIST,
196 45, UNIPHIER_PIN_DRV_3BIT, 196 45, UNIPHIER_PIN_DRV_3BIT,
197 57, UNIPHIER_PIN_PULL_DOWN), 197 57, UNIPHIER_PIN_PULL_DOWN),
198 UNIPHIER_PINCTRL_PIN(58, "SPITXD0", 58, 198 UNIPHIER_PINCTRL_PIN(58, "SPITXD0", UNIPHIER_PIN_IECTRL_EXIST,
199 46, UNIPHIER_PIN_DRV_3BIT, 199 46, UNIPHIER_PIN_DRV_3BIT,
200 58, UNIPHIER_PIN_PULL_DOWN), 200 58, UNIPHIER_PIN_PULL_DOWN),
201 UNIPHIER_PINCTRL_PIN(59, "SPIRXD0", 59, 201 UNIPHIER_PINCTRL_PIN(59, "SPIRXD0", UNIPHIER_PIN_IECTRL_EXIST,
202 47, UNIPHIER_PIN_DRV_3BIT, 202 47, UNIPHIER_PIN_DRV_3BIT,
203 59, UNIPHIER_PIN_PULL_DOWN), 203 59, UNIPHIER_PIN_PULL_DOWN),
204 UNIPHIER_PINCTRL_PIN(60, "AGCI", 60, 204 UNIPHIER_PINCTRL_PIN(60, "AGCI", UNIPHIER_PIN_IECTRL_EXIST,
205 48, UNIPHIER_PIN_DRV_3BIT, 205 48, UNIPHIER_PIN_DRV_3BIT,
206 60, UNIPHIER_PIN_PULL_DOWN), 206 60, UNIPHIER_PIN_PULL_DOWN),
207 UNIPHIER_PINCTRL_PIN(61, "DMDSDA0", 61, 207 UNIPHIER_PINCTRL_PIN(61, "DMDSDA0", UNIPHIER_PIN_IECTRL_EXIST,
208 -1, UNIPHIER_PIN_DRV_FIXED4, 208 -1, UNIPHIER_PIN_DRV_FIXED4,
209 -1, UNIPHIER_PIN_PULL_NONE), 209 -1, UNIPHIER_PIN_PULL_NONE),
210 UNIPHIER_PINCTRL_PIN(62, "DMDSCL0", 62, 210 UNIPHIER_PINCTRL_PIN(62, "DMDSCL0", UNIPHIER_PIN_IECTRL_EXIST,
211 -1, UNIPHIER_PIN_DRV_FIXED4, 211 -1, UNIPHIER_PIN_DRV_FIXED4,
212 -1, UNIPHIER_PIN_PULL_NONE), 212 -1, UNIPHIER_PIN_PULL_NONE),
213 UNIPHIER_PINCTRL_PIN(63, "SDA0", 63, 213 UNIPHIER_PINCTRL_PIN(63, "SDA0", UNIPHIER_PIN_IECTRL_EXIST,
214 -1, UNIPHIER_PIN_DRV_FIXED4, 214 -1, UNIPHIER_PIN_DRV_FIXED4,
215 -1, UNIPHIER_PIN_PULL_NONE), 215 -1, UNIPHIER_PIN_PULL_NONE),
216 UNIPHIER_PINCTRL_PIN(64, "SCL0", 64, 216 UNIPHIER_PINCTRL_PIN(64, "SCL0", UNIPHIER_PIN_IECTRL_EXIST,
217 -1, UNIPHIER_PIN_DRV_FIXED4, 217 -1, UNIPHIER_PIN_DRV_FIXED4,
218 -1, UNIPHIER_PIN_PULL_NONE), 218 -1, UNIPHIER_PIN_PULL_NONE),
219 UNIPHIER_PINCTRL_PIN(65, "SDA1", 65, 219 UNIPHIER_PINCTRL_PIN(65, "SDA1", UNIPHIER_PIN_IECTRL_EXIST,
220 -1, UNIPHIER_PIN_DRV_FIXED4, 220 -1, UNIPHIER_PIN_DRV_FIXED4,
221 -1, UNIPHIER_PIN_PULL_NONE), 221 -1, UNIPHIER_PIN_PULL_NONE),
222 UNIPHIER_PINCTRL_PIN(66, "SCL1", 66, 222 UNIPHIER_PINCTRL_PIN(66, "SCL1", UNIPHIER_PIN_IECTRL_EXIST,
223 -1, UNIPHIER_PIN_DRV_FIXED4, 223 -1, UNIPHIER_PIN_DRV_FIXED4,
224 -1, UNIPHIER_PIN_PULL_NONE), 224 -1, UNIPHIER_PIN_PULL_NONE),
225 UNIPHIER_PINCTRL_PIN(67, "HIN", 67, 225 UNIPHIER_PINCTRL_PIN(67, "HIN", UNIPHIER_PIN_IECTRL_EXIST,
226 -1, UNIPHIER_PIN_DRV_FIXED4, 226 -1, UNIPHIER_PIN_DRV_FIXED4,
227 -1, UNIPHIER_PIN_PULL_NONE), 227 -1, UNIPHIER_PIN_PULL_NONE),
228 UNIPHIER_PINCTRL_PIN(68, "VIN", 68, 228 UNIPHIER_PINCTRL_PIN(68, "VIN", UNIPHIER_PIN_IECTRL_EXIST,
229 -1, UNIPHIER_PIN_DRV_FIXED4, 229 -1, UNIPHIER_PIN_DRV_FIXED4,
230 -1, UNIPHIER_PIN_PULL_NONE), 230 -1, UNIPHIER_PIN_PULL_NONE),
231 UNIPHIER_PINCTRL_PIN(69, "PCA00", 69, 231 UNIPHIER_PINCTRL_PIN(69, "PCA00", UNIPHIER_PIN_IECTRL_EXIST,
232 49, UNIPHIER_PIN_DRV_3BIT, 232 49, UNIPHIER_PIN_DRV_3BIT,
233 69, UNIPHIER_PIN_PULL_DOWN), 233 69, UNIPHIER_PIN_PULL_DOWN),
234 UNIPHIER_PINCTRL_PIN(70, "PCA01", 70, 234 UNIPHIER_PINCTRL_PIN(70, "PCA01", UNIPHIER_PIN_IECTRL_EXIST,
235 50, UNIPHIER_PIN_DRV_3BIT, 235 50, UNIPHIER_PIN_DRV_3BIT,
236 70, UNIPHIER_PIN_PULL_DOWN), 236 70, UNIPHIER_PIN_PULL_DOWN),
237 UNIPHIER_PINCTRL_PIN(71, "PCA02", 71, 237 UNIPHIER_PINCTRL_PIN(71, "PCA02", UNIPHIER_PIN_IECTRL_EXIST,
238 51, UNIPHIER_PIN_DRV_3BIT, 238 51, UNIPHIER_PIN_DRV_3BIT,
239 71, UNIPHIER_PIN_PULL_DOWN), 239 71, UNIPHIER_PIN_PULL_DOWN),
240 UNIPHIER_PINCTRL_PIN(72, "PCA03", 72, 240 UNIPHIER_PINCTRL_PIN(72, "PCA03", UNIPHIER_PIN_IECTRL_EXIST,
241 52, UNIPHIER_PIN_DRV_3BIT, 241 52, UNIPHIER_PIN_DRV_3BIT,
242 72, UNIPHIER_PIN_PULL_DOWN), 242 72, UNIPHIER_PIN_PULL_DOWN),
243 UNIPHIER_PINCTRL_PIN(73, "PCA04", 73, 243 UNIPHIER_PINCTRL_PIN(73, "PCA04", UNIPHIER_PIN_IECTRL_EXIST,
244 53, UNIPHIER_PIN_DRV_3BIT, 244 53, UNIPHIER_PIN_DRV_3BIT,
245 73, UNIPHIER_PIN_PULL_DOWN), 245 73, UNIPHIER_PIN_PULL_DOWN),
246 UNIPHIER_PINCTRL_PIN(74, "PCA05", 74, 246 UNIPHIER_PINCTRL_PIN(74, "PCA05", UNIPHIER_PIN_IECTRL_EXIST,
247 54, UNIPHIER_PIN_DRV_3BIT, 247 54, UNIPHIER_PIN_DRV_3BIT,
248 74, UNIPHIER_PIN_PULL_DOWN), 248 74, UNIPHIER_PIN_PULL_DOWN),
249 UNIPHIER_PINCTRL_PIN(75, "PCA06", 75, 249 UNIPHIER_PINCTRL_PIN(75, "PCA06", UNIPHIER_PIN_IECTRL_EXIST,
250 55, UNIPHIER_PIN_DRV_3BIT, 250 55, UNIPHIER_PIN_DRV_3BIT,
251 75, UNIPHIER_PIN_PULL_DOWN), 251 75, UNIPHIER_PIN_PULL_DOWN),
252 UNIPHIER_PINCTRL_PIN(76, "PCA07", 76, 252 UNIPHIER_PINCTRL_PIN(76, "PCA07", UNIPHIER_PIN_IECTRL_EXIST,
253 56, UNIPHIER_PIN_DRV_3BIT, 253 56, UNIPHIER_PIN_DRV_3BIT,
254 76, UNIPHIER_PIN_PULL_DOWN), 254 76, UNIPHIER_PIN_PULL_DOWN),
255 UNIPHIER_PINCTRL_PIN(77, "PCA08", 77, 255 UNIPHIER_PINCTRL_PIN(77, "PCA08", UNIPHIER_PIN_IECTRL_EXIST,
256 57, UNIPHIER_PIN_DRV_3BIT, 256 57, UNIPHIER_PIN_DRV_3BIT,
257 77, UNIPHIER_PIN_PULL_DOWN), 257 77, UNIPHIER_PIN_PULL_DOWN),
258 UNIPHIER_PINCTRL_PIN(78, "PCA09", 78, 258 UNIPHIER_PINCTRL_PIN(78, "PCA09", UNIPHIER_PIN_IECTRL_EXIST,
259 58, UNIPHIER_PIN_DRV_3BIT, 259 58, UNIPHIER_PIN_DRV_3BIT,
260 78, UNIPHIER_PIN_PULL_DOWN), 260 78, UNIPHIER_PIN_PULL_DOWN),
261 UNIPHIER_PINCTRL_PIN(79, "PCA10", 79, 261 UNIPHIER_PINCTRL_PIN(79, "PCA10", UNIPHIER_PIN_IECTRL_EXIST,
262 59, UNIPHIER_PIN_DRV_3BIT, 262 59, UNIPHIER_PIN_DRV_3BIT,
263 79, UNIPHIER_PIN_PULL_DOWN), 263 79, UNIPHIER_PIN_PULL_DOWN),
264 UNIPHIER_PINCTRL_PIN(80, "PCA11", 80, 264 UNIPHIER_PINCTRL_PIN(80, "PCA11", UNIPHIER_PIN_IECTRL_EXIST,
265 60, UNIPHIER_PIN_DRV_3BIT, 265 60, UNIPHIER_PIN_DRV_3BIT,
266 80, UNIPHIER_PIN_PULL_DOWN), 266 80, UNIPHIER_PIN_PULL_DOWN),
267 UNIPHIER_PINCTRL_PIN(81, "PCA12", 81, 267 UNIPHIER_PINCTRL_PIN(81, "PCA12", UNIPHIER_PIN_IECTRL_EXIST,
268 61, UNIPHIER_PIN_DRV_3BIT, 268 61, UNIPHIER_PIN_DRV_3BIT,
269 81, UNIPHIER_PIN_PULL_DOWN), 269 81, UNIPHIER_PIN_PULL_DOWN),
270 UNIPHIER_PINCTRL_PIN(82, "PCA13", 82, 270 UNIPHIER_PINCTRL_PIN(82, "PCA13", UNIPHIER_PIN_IECTRL_EXIST,
271 62, UNIPHIER_PIN_DRV_3BIT, 271 62, UNIPHIER_PIN_DRV_3BIT,
272 82, UNIPHIER_PIN_PULL_DOWN), 272 82, UNIPHIER_PIN_PULL_DOWN),
273 UNIPHIER_PINCTRL_PIN(83, "PCA14", 83, 273 UNIPHIER_PINCTRL_PIN(83, "PCA14", UNIPHIER_PIN_IECTRL_EXIST,
274 63, UNIPHIER_PIN_DRV_3BIT, 274 63, UNIPHIER_PIN_DRV_3BIT,
275 83, UNIPHIER_PIN_PULL_DOWN), 275 83, UNIPHIER_PIN_PULL_DOWN),
276 UNIPHIER_PINCTRL_PIN(84, "PC0READY", 84, 276 UNIPHIER_PINCTRL_PIN(84, "PC0READY", UNIPHIER_PIN_IECTRL_EXIST,
277 0, UNIPHIER_PIN_DRV_1BIT, 277 0, UNIPHIER_PIN_DRV_1BIT,
278 84, UNIPHIER_PIN_PULL_DOWN), 278 84, UNIPHIER_PIN_PULL_DOWN),
279 UNIPHIER_PINCTRL_PIN(85, "PC0CD1", 85, 279 UNIPHIER_PINCTRL_PIN(85, "PC0CD1", UNIPHIER_PIN_IECTRL_EXIST,
280 1, UNIPHIER_PIN_DRV_1BIT, 280 1, UNIPHIER_PIN_DRV_1BIT,
281 85, UNIPHIER_PIN_PULL_DOWN), 281 85, UNIPHIER_PIN_PULL_DOWN),
282 UNIPHIER_PINCTRL_PIN(86, "PC0CD2", 86, 282 UNIPHIER_PINCTRL_PIN(86, "PC0CD2", UNIPHIER_PIN_IECTRL_EXIST,
283 2, UNIPHIER_PIN_DRV_1BIT, 283 2, UNIPHIER_PIN_DRV_1BIT,
284 86, UNIPHIER_PIN_PULL_DOWN), 284 86, UNIPHIER_PIN_PULL_DOWN),
285 UNIPHIER_PINCTRL_PIN(87, "PC0WAIT", 87, 285 UNIPHIER_PINCTRL_PIN(87, "PC0WAIT", UNIPHIER_PIN_IECTRL_EXIST,
286 3, UNIPHIER_PIN_DRV_1BIT, 286 3, UNIPHIER_PIN_DRV_1BIT,
287 87, UNIPHIER_PIN_PULL_DOWN), 287 87, UNIPHIER_PIN_PULL_DOWN),
288 UNIPHIER_PINCTRL_PIN(88, "PC0RESET", 88, 288 UNIPHIER_PINCTRL_PIN(88, "PC0RESET", UNIPHIER_PIN_IECTRL_EXIST,
289 4, UNIPHIER_PIN_DRV_1BIT, 289 4, UNIPHIER_PIN_DRV_1BIT,
290 88, UNIPHIER_PIN_PULL_DOWN), 290 88, UNIPHIER_PIN_PULL_DOWN),
291 UNIPHIER_PINCTRL_PIN(89, "PC0CE1", 89, 291 UNIPHIER_PINCTRL_PIN(89, "PC0CE1", UNIPHIER_PIN_IECTRL_EXIST,
292 5, UNIPHIER_PIN_DRV_1BIT, 292 5, UNIPHIER_PIN_DRV_1BIT,
293 89, UNIPHIER_PIN_PULL_DOWN), 293 89, UNIPHIER_PIN_PULL_DOWN),
294 UNIPHIER_PINCTRL_PIN(90, "PC0WE", 90, 294 UNIPHIER_PINCTRL_PIN(90, "PC0WE", UNIPHIER_PIN_IECTRL_EXIST,
295 6, UNIPHIER_PIN_DRV_1BIT, 295 6, UNIPHIER_PIN_DRV_1BIT,
296 90, UNIPHIER_PIN_PULL_DOWN), 296 90, UNIPHIER_PIN_PULL_DOWN),
297 UNIPHIER_PINCTRL_PIN(91, "PC0OE", 91, 297 UNIPHIER_PINCTRL_PIN(91, "PC0OE", UNIPHIER_PIN_IECTRL_EXIST,
298 7, UNIPHIER_PIN_DRV_1BIT, 298 7, UNIPHIER_PIN_DRV_1BIT,
299 91, UNIPHIER_PIN_PULL_DOWN), 299 91, UNIPHIER_PIN_PULL_DOWN),
300 UNIPHIER_PINCTRL_PIN(92, "PC0IOWR", 92, 300 UNIPHIER_PINCTRL_PIN(92, "PC0IOWR", UNIPHIER_PIN_IECTRL_EXIST,
301 8, UNIPHIER_PIN_DRV_1BIT, 301 8, UNIPHIER_PIN_DRV_1BIT,
302 92, UNIPHIER_PIN_PULL_DOWN), 302 92, UNIPHIER_PIN_PULL_DOWN),
303 UNIPHIER_PINCTRL_PIN(93, "PC0IORD", 93, 303 UNIPHIER_PINCTRL_PIN(93, "PC0IORD", UNIPHIER_PIN_IECTRL_EXIST,
304 9, UNIPHIER_PIN_DRV_1BIT, 304 9, UNIPHIER_PIN_DRV_1BIT,
305 93, UNIPHIER_PIN_PULL_DOWN), 305 93, UNIPHIER_PIN_PULL_DOWN),
306 UNIPHIER_PINCTRL_PIN(94, "PCD00", 94, 306 UNIPHIER_PINCTRL_PIN(94, "PCD00", UNIPHIER_PIN_IECTRL_EXIST,
307 10, UNIPHIER_PIN_DRV_1BIT, 307 10, UNIPHIER_PIN_DRV_1BIT,
308 94, UNIPHIER_PIN_PULL_DOWN), 308 94, UNIPHIER_PIN_PULL_DOWN),
309 UNIPHIER_PINCTRL_PIN(95, "PCD01", 95, 309 UNIPHIER_PINCTRL_PIN(95, "PCD01", UNIPHIER_PIN_IECTRL_EXIST,
310 11, UNIPHIER_PIN_DRV_1BIT, 310 11, UNIPHIER_PIN_DRV_1BIT,
311 95, UNIPHIER_PIN_PULL_DOWN), 311 95, UNIPHIER_PIN_PULL_DOWN),
312 UNIPHIER_PINCTRL_PIN(96, "PCD02", 96, 312 UNIPHIER_PINCTRL_PIN(96, "PCD02", UNIPHIER_PIN_IECTRL_EXIST,
313 12, UNIPHIER_PIN_DRV_1BIT, 313 12, UNIPHIER_PIN_DRV_1BIT,
314 96, UNIPHIER_PIN_PULL_DOWN), 314 96, UNIPHIER_PIN_PULL_DOWN),
315 UNIPHIER_PINCTRL_PIN(97, "PCD03", 97, 315 UNIPHIER_PINCTRL_PIN(97, "PCD03", UNIPHIER_PIN_IECTRL_EXIST,
316 13, UNIPHIER_PIN_DRV_1BIT, 316 13, UNIPHIER_PIN_DRV_1BIT,
317 97, UNIPHIER_PIN_PULL_DOWN), 317 97, UNIPHIER_PIN_PULL_DOWN),
318 UNIPHIER_PINCTRL_PIN(98, "PCD04", 98, 318 UNIPHIER_PINCTRL_PIN(98, "PCD04", UNIPHIER_PIN_IECTRL_EXIST,
319 14, UNIPHIER_PIN_DRV_1BIT, 319 14, UNIPHIER_PIN_DRV_1BIT,
320 98, UNIPHIER_PIN_PULL_DOWN), 320 98, UNIPHIER_PIN_PULL_DOWN),
321 UNIPHIER_PINCTRL_PIN(99, "PCD05", 99, 321 UNIPHIER_PINCTRL_PIN(99, "PCD05", UNIPHIER_PIN_IECTRL_EXIST,
322 15, UNIPHIER_PIN_DRV_1BIT, 322 15, UNIPHIER_PIN_DRV_1BIT,
323 99, UNIPHIER_PIN_PULL_DOWN), 323 99, UNIPHIER_PIN_PULL_DOWN),
324 UNIPHIER_PINCTRL_PIN(100, "PCD06", 100, 324 UNIPHIER_PINCTRL_PIN(100, "PCD06", UNIPHIER_PIN_IECTRL_EXIST,
325 16, UNIPHIER_PIN_DRV_1BIT, 325 16, UNIPHIER_PIN_DRV_1BIT,
326 100, UNIPHIER_PIN_PULL_DOWN), 326 100, UNIPHIER_PIN_PULL_DOWN),
327 UNIPHIER_PINCTRL_PIN(101, "PCD07", 101, 327 UNIPHIER_PINCTRL_PIN(101, "PCD07", UNIPHIER_PIN_IECTRL_EXIST,
328 17, UNIPHIER_PIN_DRV_1BIT, 328 17, UNIPHIER_PIN_DRV_1BIT,
329 101, UNIPHIER_PIN_PULL_DOWN), 329 101, UNIPHIER_PIN_PULL_DOWN),
330 UNIPHIER_PINCTRL_PIN(102, "HS0BCLKIN", 102, 330 UNIPHIER_PINCTRL_PIN(102, "HS0BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
331 18, UNIPHIER_PIN_DRV_1BIT, 331 18, UNIPHIER_PIN_DRV_1BIT,
332 102, UNIPHIER_PIN_PULL_DOWN), 332 102, UNIPHIER_PIN_PULL_DOWN),
333 UNIPHIER_PINCTRL_PIN(103, "HS0SYNCIN", 103, 333 UNIPHIER_PINCTRL_PIN(103, "HS0SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
334 19, UNIPHIER_PIN_DRV_1BIT, 334 19, UNIPHIER_PIN_DRV_1BIT,
335 103, UNIPHIER_PIN_PULL_DOWN), 335 103, UNIPHIER_PIN_PULL_DOWN),
336 UNIPHIER_PINCTRL_PIN(104, "HS0VALIN", 104, 336 UNIPHIER_PINCTRL_PIN(104, "HS0VALIN", UNIPHIER_PIN_IECTRL_EXIST,
337 20, UNIPHIER_PIN_DRV_1BIT, 337 20, UNIPHIER_PIN_DRV_1BIT,
338 104, UNIPHIER_PIN_PULL_DOWN), 338 104, UNIPHIER_PIN_PULL_DOWN),
339 UNIPHIER_PINCTRL_PIN(105, "HS0DIN0", 105, 339 UNIPHIER_PINCTRL_PIN(105, "HS0DIN0", UNIPHIER_PIN_IECTRL_EXIST,
340 21, UNIPHIER_PIN_DRV_1BIT, 340 21, UNIPHIER_PIN_DRV_1BIT,
341 105, UNIPHIER_PIN_PULL_DOWN), 341 105, UNIPHIER_PIN_PULL_DOWN),
342 UNIPHIER_PINCTRL_PIN(106, "HS0DIN1", 106, 342 UNIPHIER_PINCTRL_PIN(106, "HS0DIN1", UNIPHIER_PIN_IECTRL_EXIST,
343 22, UNIPHIER_PIN_DRV_1BIT, 343 22, UNIPHIER_PIN_DRV_1BIT,
344 106, UNIPHIER_PIN_PULL_DOWN), 344 106, UNIPHIER_PIN_PULL_DOWN),
345 UNIPHIER_PINCTRL_PIN(107, "HS0DIN2", 107, 345 UNIPHIER_PINCTRL_PIN(107, "HS0DIN2", UNIPHIER_PIN_IECTRL_EXIST,
346 23, UNIPHIER_PIN_DRV_1BIT, 346 23, UNIPHIER_PIN_DRV_1BIT,
347 107, UNIPHIER_PIN_PULL_DOWN), 347 107, UNIPHIER_PIN_PULL_DOWN),
348 UNIPHIER_PINCTRL_PIN(108, "HS0DIN3", 108, 348 UNIPHIER_PINCTRL_PIN(108, "HS0DIN3", UNIPHIER_PIN_IECTRL_EXIST,
349 24, UNIPHIER_PIN_DRV_1BIT, 349 24, UNIPHIER_PIN_DRV_1BIT,
350 108, UNIPHIER_PIN_PULL_DOWN), 350 108, UNIPHIER_PIN_PULL_DOWN),
351 UNIPHIER_PINCTRL_PIN(109, "HS0DIN4", 109, 351 UNIPHIER_PINCTRL_PIN(109, "HS0DIN4", UNIPHIER_PIN_IECTRL_EXIST,
352 25, UNIPHIER_PIN_DRV_1BIT, 352 25, UNIPHIER_PIN_DRV_1BIT,
353 109, UNIPHIER_PIN_PULL_DOWN), 353 109, UNIPHIER_PIN_PULL_DOWN),
354 UNIPHIER_PINCTRL_PIN(110, "HS0DIN5", 110, 354 UNIPHIER_PINCTRL_PIN(110, "HS0DIN5", UNIPHIER_PIN_IECTRL_EXIST,
355 26, UNIPHIER_PIN_DRV_1BIT, 355 26, UNIPHIER_PIN_DRV_1BIT,
356 110, UNIPHIER_PIN_PULL_DOWN), 356 110, UNIPHIER_PIN_PULL_DOWN),
357 UNIPHIER_PINCTRL_PIN(111, "HS0DIN6", 111, 357 UNIPHIER_PINCTRL_PIN(111, "HS0DIN6", UNIPHIER_PIN_IECTRL_EXIST,
358 27, UNIPHIER_PIN_DRV_1BIT, 358 27, UNIPHIER_PIN_DRV_1BIT,
359 111, UNIPHIER_PIN_PULL_DOWN), 359 111, UNIPHIER_PIN_PULL_DOWN),
360 UNIPHIER_PINCTRL_PIN(112, "HS0DIN7", 112, 360 UNIPHIER_PINCTRL_PIN(112, "HS0DIN7", UNIPHIER_PIN_IECTRL_EXIST,
361 28, UNIPHIER_PIN_DRV_1BIT, 361 28, UNIPHIER_PIN_DRV_1BIT,
362 112, UNIPHIER_PIN_PULL_DOWN), 362 112, UNIPHIER_PIN_PULL_DOWN),
363 UNIPHIER_PINCTRL_PIN(113, "HS0BCLKOUT", 113, 363 UNIPHIER_PINCTRL_PIN(113, "HS0BCLKOUT", UNIPHIER_PIN_IECTRL_EXIST,
364 64, UNIPHIER_PIN_DRV_3BIT, 364 64, UNIPHIER_PIN_DRV_3BIT,
365 113, UNIPHIER_PIN_PULL_DOWN), 365 113, UNIPHIER_PIN_PULL_DOWN),
366 UNIPHIER_PINCTRL_PIN(114, "HS0SYNCOUT", 114, 366 UNIPHIER_PINCTRL_PIN(114, "HS0SYNCOUT", UNIPHIER_PIN_IECTRL_EXIST,
367 65, UNIPHIER_PIN_DRV_3BIT, 367 65, UNIPHIER_PIN_DRV_3BIT,
368 114, UNIPHIER_PIN_PULL_DOWN), 368 114, UNIPHIER_PIN_PULL_DOWN),
369 UNIPHIER_PINCTRL_PIN(115, "HS0VALOUT", 115, 369 UNIPHIER_PINCTRL_PIN(115, "HS0VALOUT", UNIPHIER_PIN_IECTRL_EXIST,
370 66, UNIPHIER_PIN_DRV_3BIT, 370 66, UNIPHIER_PIN_DRV_3BIT,
371 115, UNIPHIER_PIN_PULL_DOWN), 371 115, UNIPHIER_PIN_PULL_DOWN),
372 UNIPHIER_PINCTRL_PIN(116, "HS0DOUT0", 116, 372 UNIPHIER_PINCTRL_PIN(116, "HS0DOUT0", UNIPHIER_PIN_IECTRL_EXIST,
373 67, UNIPHIER_PIN_DRV_3BIT, 373 67, UNIPHIER_PIN_DRV_3BIT,
374 116, UNIPHIER_PIN_PULL_DOWN), 374 116, UNIPHIER_PIN_PULL_DOWN),
375 UNIPHIER_PINCTRL_PIN(117, "HS0DOUT1", 117, 375 UNIPHIER_PINCTRL_PIN(117, "HS0DOUT1", UNIPHIER_PIN_IECTRL_EXIST,
376 68, UNIPHIER_PIN_DRV_3BIT, 376 68, UNIPHIER_PIN_DRV_3BIT,
377 117, UNIPHIER_PIN_PULL_DOWN), 377 117, UNIPHIER_PIN_PULL_DOWN),
378 UNIPHIER_PINCTRL_PIN(118, "HS0DOUT2", 118, 378 UNIPHIER_PINCTRL_PIN(118, "HS0DOUT2", UNIPHIER_PIN_IECTRL_EXIST,
379 69, UNIPHIER_PIN_DRV_3BIT, 379 69, UNIPHIER_PIN_DRV_3BIT,
380 118, UNIPHIER_PIN_PULL_DOWN), 380 118, UNIPHIER_PIN_PULL_DOWN),
381 UNIPHIER_PINCTRL_PIN(119, "HS0DOUT3", 119, 381 UNIPHIER_PINCTRL_PIN(119, "HS0DOUT3", UNIPHIER_PIN_IECTRL_EXIST,
382 70, UNIPHIER_PIN_DRV_3BIT, 382 70, UNIPHIER_PIN_DRV_3BIT,
383 119, UNIPHIER_PIN_PULL_DOWN), 383 119, UNIPHIER_PIN_PULL_DOWN),
384 UNIPHIER_PINCTRL_PIN(120, "HS0DOUT4", 120, 384 UNIPHIER_PINCTRL_PIN(120, "HS0DOUT4", UNIPHIER_PIN_IECTRL_EXIST,
385 71, UNIPHIER_PIN_DRV_3BIT, 385 71, UNIPHIER_PIN_DRV_3BIT,
386 120, UNIPHIER_PIN_PULL_DOWN), 386 120, UNIPHIER_PIN_PULL_DOWN),
387 UNIPHIER_PINCTRL_PIN(121, "HS0DOUT5", 121, 387 UNIPHIER_PINCTRL_PIN(121, "HS0DOUT5", UNIPHIER_PIN_IECTRL_EXIST,
388 72, UNIPHIER_PIN_DRV_3BIT, 388 72, UNIPHIER_PIN_DRV_3BIT,
389 121, UNIPHIER_PIN_PULL_DOWN), 389 121, UNIPHIER_PIN_PULL_DOWN),
390 UNIPHIER_PINCTRL_PIN(122, "HS0DOUT6", 122, 390 UNIPHIER_PINCTRL_PIN(122, "HS0DOUT6", UNIPHIER_PIN_IECTRL_EXIST,
391 73, UNIPHIER_PIN_DRV_3BIT, 391 73, UNIPHIER_PIN_DRV_3BIT,
392 122, UNIPHIER_PIN_PULL_DOWN), 392 122, UNIPHIER_PIN_PULL_DOWN),
393 UNIPHIER_PINCTRL_PIN(123, "HS0DOUT7", 123, 393 UNIPHIER_PINCTRL_PIN(123, "HS0DOUT7", UNIPHIER_PIN_IECTRL_EXIST,
394 74, UNIPHIER_PIN_DRV_3BIT, 394 74, UNIPHIER_PIN_DRV_3BIT,
395 123, UNIPHIER_PIN_PULL_DOWN), 395 123, UNIPHIER_PIN_PULL_DOWN),
396 UNIPHIER_PINCTRL_PIN(124, "HS1BCLKIN", 124, 396 UNIPHIER_PINCTRL_PIN(124, "HS1BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
397 75, UNIPHIER_PIN_DRV_3BIT, 397 75, UNIPHIER_PIN_DRV_3BIT,
398 124, UNIPHIER_PIN_PULL_DOWN), 398 124, UNIPHIER_PIN_PULL_DOWN),
399 UNIPHIER_PINCTRL_PIN(125, "HS1SYNCIN", 125, 399 UNIPHIER_PINCTRL_PIN(125, "HS1SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
400 76, UNIPHIER_PIN_DRV_3BIT, 400 76, UNIPHIER_PIN_DRV_3BIT,
401 125, UNIPHIER_PIN_PULL_DOWN), 401 125, UNIPHIER_PIN_PULL_DOWN),
402 UNIPHIER_PINCTRL_PIN(126, "HS1VALIN", 126, 402 UNIPHIER_PINCTRL_PIN(126, "HS1VALIN", UNIPHIER_PIN_IECTRL_EXIST,
403 77, UNIPHIER_PIN_DRV_3BIT, 403 77, UNIPHIER_PIN_DRV_3BIT,
404 126, UNIPHIER_PIN_PULL_DOWN), 404 126, UNIPHIER_PIN_PULL_DOWN),
405 UNIPHIER_PINCTRL_PIN(127, "HS1DIN0", 127, 405 UNIPHIER_PINCTRL_PIN(127, "HS1DIN0", UNIPHIER_PIN_IECTRL_EXIST,
406 78, UNIPHIER_PIN_DRV_3BIT, 406 78, UNIPHIER_PIN_DRV_3BIT,
407 127, UNIPHIER_PIN_PULL_DOWN), 407 127, UNIPHIER_PIN_PULL_DOWN),
408 UNIPHIER_PINCTRL_PIN(128, "HS1DIN1", 128, 408 UNIPHIER_PINCTRL_PIN(128, "HS1DIN1", UNIPHIER_PIN_IECTRL_EXIST,
409 79, UNIPHIER_PIN_DRV_3BIT, 409 79, UNIPHIER_PIN_DRV_3BIT,
410 128, UNIPHIER_PIN_PULL_DOWN), 410 128, UNIPHIER_PIN_PULL_DOWN),
411 UNIPHIER_PINCTRL_PIN(129, "HS1DIN2", 129, 411 UNIPHIER_PINCTRL_PIN(129, "HS1DIN2", UNIPHIER_PIN_IECTRL_EXIST,
412 80, UNIPHIER_PIN_DRV_3BIT, 412 80, UNIPHIER_PIN_DRV_3BIT,
413 129, UNIPHIER_PIN_PULL_DOWN), 413 129, UNIPHIER_PIN_PULL_DOWN),
414 UNIPHIER_PINCTRL_PIN(130, "HS1DIN3", 130, 414 UNIPHIER_PINCTRL_PIN(130, "HS1DIN3", UNIPHIER_PIN_IECTRL_EXIST,
415 81, UNIPHIER_PIN_DRV_3BIT, 415 81, UNIPHIER_PIN_DRV_3BIT,
416 130, UNIPHIER_PIN_PULL_DOWN), 416 130, UNIPHIER_PIN_PULL_DOWN),
417 UNIPHIER_PINCTRL_PIN(131, "HS1DIN4", 131, 417 UNIPHIER_PINCTRL_PIN(131, "HS1DIN4", UNIPHIER_PIN_IECTRL_EXIST,
418 82, UNIPHIER_PIN_DRV_3BIT, 418 82, UNIPHIER_PIN_DRV_3BIT,
419 131, UNIPHIER_PIN_PULL_DOWN), 419 131, UNIPHIER_PIN_PULL_DOWN),
420 UNIPHIER_PINCTRL_PIN(132, "HS1DIN5", 132, 420 UNIPHIER_PINCTRL_PIN(132, "HS1DIN5", UNIPHIER_PIN_IECTRL_EXIST,
421 83, UNIPHIER_PIN_DRV_3BIT, 421 83, UNIPHIER_PIN_DRV_3BIT,
422 132, UNIPHIER_PIN_PULL_DOWN), 422 132, UNIPHIER_PIN_PULL_DOWN),
423 UNIPHIER_PINCTRL_PIN(133, "HS1DIN6", 133, 423 UNIPHIER_PINCTRL_PIN(133, "HS1DIN6", UNIPHIER_PIN_IECTRL_EXIST,
424 84, UNIPHIER_PIN_DRV_3BIT, 424 84, UNIPHIER_PIN_DRV_3BIT,
425 133, UNIPHIER_PIN_PULL_DOWN), 425 133, UNIPHIER_PIN_PULL_DOWN),
426 UNIPHIER_PINCTRL_PIN(134, "HS1DIN7", 134, 426 UNIPHIER_PINCTRL_PIN(134, "HS1DIN7", UNIPHIER_PIN_IECTRL_EXIST,
427 85, UNIPHIER_PIN_DRV_3BIT, 427 85, UNIPHIER_PIN_DRV_3BIT,
428 134, UNIPHIER_PIN_PULL_DOWN), 428 134, UNIPHIER_PIN_PULL_DOWN),
429 UNIPHIER_PINCTRL_PIN(135, "AO1IEC", 135, 429 UNIPHIER_PINCTRL_PIN(135, "AO1IEC", UNIPHIER_PIN_IECTRL_EXIST,
430 86, UNIPHIER_PIN_DRV_3BIT, 430 86, UNIPHIER_PIN_DRV_3BIT,
431 135, UNIPHIER_PIN_PULL_DOWN), 431 135, UNIPHIER_PIN_PULL_DOWN),
432 UNIPHIER_PINCTRL_PIN(136, "AO1ARC", 136, 432 UNIPHIER_PINCTRL_PIN(136, "AO1ARC", UNIPHIER_PIN_IECTRL_EXIST,
433 87, UNIPHIER_PIN_DRV_3BIT, 433 87, UNIPHIER_PIN_DRV_3BIT,
434 136, UNIPHIER_PIN_PULL_DOWN), 434 136, UNIPHIER_PIN_PULL_DOWN),
435 UNIPHIER_PINCTRL_PIN(137, "AO1DACCK", 137, 435 UNIPHIER_PINCTRL_PIN(137, "AO1DACCK", UNIPHIER_PIN_IECTRL_EXIST,
436 88, UNIPHIER_PIN_DRV_3BIT, 436 88, UNIPHIER_PIN_DRV_3BIT,
437 137, UNIPHIER_PIN_PULL_DOWN), 437 137, UNIPHIER_PIN_PULL_DOWN),
438 UNIPHIER_PINCTRL_PIN(138, "AO1BCK", 138, 438 UNIPHIER_PINCTRL_PIN(138, "AO1BCK", UNIPHIER_PIN_IECTRL_EXIST,
439 89, UNIPHIER_PIN_DRV_3BIT, 439 89, UNIPHIER_PIN_DRV_3BIT,
440 138, UNIPHIER_PIN_PULL_DOWN), 440 138, UNIPHIER_PIN_PULL_DOWN),
441 UNIPHIER_PINCTRL_PIN(139, "AO1LRCK", 139, 441 UNIPHIER_PINCTRL_PIN(139, "AO1LRCK", UNIPHIER_PIN_IECTRL_EXIST,
442 90, UNIPHIER_PIN_DRV_3BIT, 442 90, UNIPHIER_PIN_DRV_3BIT,
443 139, UNIPHIER_PIN_PULL_DOWN), 443 139, UNIPHIER_PIN_PULL_DOWN),
444 UNIPHIER_PINCTRL_PIN(140, "AO1D0", 140, 444 UNIPHIER_PINCTRL_PIN(140, "AO1D0", UNIPHIER_PIN_IECTRL_EXIST,
445 91, UNIPHIER_PIN_DRV_3BIT, 445 91, UNIPHIER_PIN_DRV_3BIT,
446 140, UNIPHIER_PIN_PULL_DOWN), 446 140, UNIPHIER_PIN_PULL_DOWN),
447 UNIPHIER_PINCTRL_PIN(141, "AO1D1", 141, 447 UNIPHIER_PINCTRL_PIN(141, "AO1D1", UNIPHIER_PIN_IECTRL_EXIST,
448 92, UNIPHIER_PIN_DRV_3BIT, 448 92, UNIPHIER_PIN_DRV_3BIT,
449 141, UNIPHIER_PIN_PULL_DOWN), 449 141, UNIPHIER_PIN_PULL_DOWN),
450 UNIPHIER_PINCTRL_PIN(142, "AO1D2", 142, 450 UNIPHIER_PINCTRL_PIN(142, "AO1D2", UNIPHIER_PIN_IECTRL_EXIST,
451 93, UNIPHIER_PIN_DRV_3BIT, 451 93, UNIPHIER_PIN_DRV_3BIT,
452 142, UNIPHIER_PIN_PULL_DOWN), 452 142, UNIPHIER_PIN_PULL_DOWN),
453 UNIPHIER_PINCTRL_PIN(143, "HTPDN0", 143, 453 UNIPHIER_PINCTRL_PIN(143, "HTPDN0", UNIPHIER_PIN_IECTRL_EXIST,
454 94, UNIPHIER_PIN_DRV_3BIT, 454 94, UNIPHIER_PIN_DRV_3BIT,
455 143, UNIPHIER_PIN_PULL_DOWN), 455 143, UNIPHIER_PIN_PULL_DOWN),
456 UNIPHIER_PINCTRL_PIN(144, "LOCKN0", 144, 456 UNIPHIER_PINCTRL_PIN(144, "LOCKN0", UNIPHIER_PIN_IECTRL_EXIST,
457 95, UNIPHIER_PIN_DRV_3BIT, 457 95, UNIPHIER_PIN_DRV_3BIT,
458 144, UNIPHIER_PIN_PULL_DOWN), 458 144, UNIPHIER_PIN_PULL_DOWN),
459 UNIPHIER_PINCTRL_PIN(145, "HTPDN1", 145, 459 UNIPHIER_PINCTRL_PIN(145, "HTPDN1", UNIPHIER_PIN_IECTRL_EXIST,
460 96, UNIPHIER_PIN_DRV_3BIT, 460 96, UNIPHIER_PIN_DRV_3BIT,
461 145, UNIPHIER_PIN_PULL_DOWN), 461 145, UNIPHIER_PIN_PULL_DOWN),
462 UNIPHIER_PINCTRL_PIN(146, "LOCKN1", 146, 462 UNIPHIER_PINCTRL_PIN(146, "LOCKN1", UNIPHIER_PIN_IECTRL_EXIST,
463 97, UNIPHIER_PIN_DRV_3BIT, 463 97, UNIPHIER_PIN_DRV_3BIT,
464 146, UNIPHIER_PIN_PULL_DOWN), 464 146, UNIPHIER_PIN_PULL_DOWN),
465 UNIPHIER_PINCTRL_PIN(147, "PWMA", 147, 465 UNIPHIER_PINCTRL_PIN(147, "PWMA", UNIPHIER_PIN_IECTRL_EXIST,
466 98, UNIPHIER_PIN_DRV_3BIT, 466 98, UNIPHIER_PIN_DRV_3BIT,
467 147, UNIPHIER_PIN_PULL_DOWN), 467 147, UNIPHIER_PIN_PULL_DOWN),
468 UNIPHIER_PINCTRL_PIN(148, "LR_GOUT", 148, 468 UNIPHIER_PINCTRL_PIN(148, "LR_GOUT", UNIPHIER_PIN_IECTRL_EXIST,
469 99, UNIPHIER_PIN_DRV_3BIT, 469 99, UNIPHIER_PIN_DRV_3BIT,
470 148, UNIPHIER_PIN_PULL_DOWN), 470 148, UNIPHIER_PIN_PULL_DOWN),
471 UNIPHIER_PINCTRL_PIN(149, "XIRQ0", 149, 471 UNIPHIER_PINCTRL_PIN(149, "XIRQ0", UNIPHIER_PIN_IECTRL_EXIST,
472 100, UNIPHIER_PIN_DRV_3BIT, 472 100, UNIPHIER_PIN_DRV_3BIT,
473 149, UNIPHIER_PIN_PULL_DOWN), 473 149, UNIPHIER_PIN_PULL_DOWN),
474 UNIPHIER_PINCTRL_PIN(150, "XIRQ1", 150, 474 UNIPHIER_PINCTRL_PIN(150, "XIRQ1", UNIPHIER_PIN_IECTRL_EXIST,
475 101, UNIPHIER_PIN_DRV_3BIT, 475 101, UNIPHIER_PIN_DRV_3BIT,
476 150, UNIPHIER_PIN_PULL_DOWN), 476 150, UNIPHIER_PIN_PULL_DOWN),
477 UNIPHIER_PINCTRL_PIN(151, "XIRQ2", 151, 477 UNIPHIER_PINCTRL_PIN(151, "XIRQ2", UNIPHIER_PIN_IECTRL_EXIST,
478 102, UNIPHIER_PIN_DRV_3BIT, 478 102, UNIPHIER_PIN_DRV_3BIT,
479 151, UNIPHIER_PIN_PULL_DOWN), 479 151, UNIPHIER_PIN_PULL_DOWN),
480 UNIPHIER_PINCTRL_PIN(152, "XIRQ3", 152, 480 UNIPHIER_PINCTRL_PIN(152, "XIRQ3", UNIPHIER_PIN_IECTRL_EXIST,
481 103, UNIPHIER_PIN_DRV_3BIT, 481 103, UNIPHIER_PIN_DRV_3BIT,
482 152, UNIPHIER_PIN_PULL_DOWN), 482 152, UNIPHIER_PIN_PULL_DOWN),
483 UNIPHIER_PINCTRL_PIN(153, "XIRQ4", 153, 483 UNIPHIER_PINCTRL_PIN(153, "XIRQ4", UNIPHIER_PIN_IECTRL_EXIST,
484 104, UNIPHIER_PIN_DRV_3BIT, 484 104, UNIPHIER_PIN_DRV_3BIT,
485 153, UNIPHIER_PIN_PULL_DOWN), 485 153, UNIPHIER_PIN_PULL_DOWN),
486 UNIPHIER_PINCTRL_PIN(154, "XIRQ5", 154, 486 UNIPHIER_PINCTRL_PIN(154, "XIRQ5", UNIPHIER_PIN_IECTRL_EXIST,
487 105, UNIPHIER_PIN_DRV_3BIT, 487 105, UNIPHIER_PIN_DRV_3BIT,
488 154, UNIPHIER_PIN_PULL_DOWN), 488 154, UNIPHIER_PIN_PULL_DOWN),
489 UNIPHIER_PINCTRL_PIN(155, "XIRQ6", 155, 489 UNIPHIER_PINCTRL_PIN(155, "XIRQ6", UNIPHIER_PIN_IECTRL_EXIST,
490 106, UNIPHIER_PIN_DRV_3BIT, 490 106, UNIPHIER_PIN_DRV_3BIT,
491 155, UNIPHIER_PIN_PULL_DOWN), 491 155, UNIPHIER_PIN_PULL_DOWN),
492 UNIPHIER_PINCTRL_PIN(156, "XIRQ7", 156, 492 UNIPHIER_PINCTRL_PIN(156, "XIRQ7", UNIPHIER_PIN_IECTRL_EXIST,
493 107, UNIPHIER_PIN_DRV_3BIT, 493 107, UNIPHIER_PIN_DRV_3BIT,
494 156, UNIPHIER_PIN_PULL_DOWN), 494 156, UNIPHIER_PIN_PULL_DOWN),
495 UNIPHIER_PINCTRL_PIN(157, "XIRQ8", 157, 495 UNIPHIER_PINCTRL_PIN(157, "XIRQ8", UNIPHIER_PIN_IECTRL_EXIST,
496 108, UNIPHIER_PIN_DRV_3BIT, 496 108, UNIPHIER_PIN_DRV_3BIT,
497 157, UNIPHIER_PIN_PULL_DOWN), 497 157, UNIPHIER_PIN_PULL_DOWN),
498 UNIPHIER_PINCTRL_PIN(158, "XIRQ9", 158, 498 UNIPHIER_PINCTRL_PIN(158, "XIRQ9", UNIPHIER_PIN_IECTRL_EXIST,
499 109, UNIPHIER_PIN_DRV_3BIT, 499 109, UNIPHIER_PIN_DRV_3BIT,
500 158, UNIPHIER_PIN_PULL_DOWN), 500 158, UNIPHIER_PIN_PULL_DOWN),
501 UNIPHIER_PINCTRL_PIN(159, "XIRQ10", 159, 501 UNIPHIER_PINCTRL_PIN(159, "XIRQ10", UNIPHIER_PIN_IECTRL_EXIST,
502 110, UNIPHIER_PIN_DRV_3BIT, 502 110, UNIPHIER_PIN_DRV_3BIT,
503 159, UNIPHIER_PIN_PULL_DOWN), 503 159, UNIPHIER_PIN_PULL_DOWN),
504 UNIPHIER_PINCTRL_PIN(160, "XIRQ11", 160, 504 UNIPHIER_PINCTRL_PIN(160, "XIRQ11", UNIPHIER_PIN_IECTRL_EXIST,
505 111, UNIPHIER_PIN_DRV_3BIT, 505 111, UNIPHIER_PIN_DRV_3BIT,
506 160, UNIPHIER_PIN_PULL_DOWN), 506 160, UNIPHIER_PIN_PULL_DOWN),
507 UNIPHIER_PINCTRL_PIN(161, "XIRQ13", 161, 507 UNIPHIER_PINCTRL_PIN(161, "XIRQ13", UNIPHIER_PIN_IECTRL_EXIST,
508 112, UNIPHIER_PIN_DRV_3BIT, 508 112, UNIPHIER_PIN_DRV_3BIT,
509 161, UNIPHIER_PIN_PULL_DOWN), 509 161, UNIPHIER_PIN_PULL_DOWN),
510 UNIPHIER_PINCTRL_PIN(162, "XIRQ14", 162, 510 UNIPHIER_PINCTRL_PIN(162, "XIRQ14", UNIPHIER_PIN_IECTRL_EXIST,
511 113, UNIPHIER_PIN_DRV_3BIT, 511 113, UNIPHIER_PIN_DRV_3BIT,
512 162, UNIPHIER_PIN_PULL_DOWN), 512 162, UNIPHIER_PIN_PULL_DOWN),
513 UNIPHIER_PINCTRL_PIN(163, "XIRQ16", 163, 513 UNIPHIER_PINCTRL_PIN(163, "XIRQ16", UNIPHIER_PIN_IECTRL_EXIST,
514 114, UNIPHIER_PIN_DRV_3BIT, 514 114, UNIPHIER_PIN_DRV_3BIT,
515 163, UNIPHIER_PIN_PULL_DOWN), 515 163, UNIPHIER_PIN_PULL_DOWN),
516 UNIPHIER_PINCTRL_PIN(164, "XIRQ17", 164, 516 UNIPHIER_PINCTRL_PIN(164, "XIRQ17", UNIPHIER_PIN_IECTRL_EXIST,
517 115, UNIPHIER_PIN_DRV_3BIT, 517 115, UNIPHIER_PIN_DRV_3BIT,
518 164, UNIPHIER_PIN_PULL_DOWN), 518 164, UNIPHIER_PIN_PULL_DOWN),
519 UNIPHIER_PINCTRL_PIN(165, "XIRQ18", 165, 519 UNIPHIER_PINCTRL_PIN(165, "XIRQ18", UNIPHIER_PIN_IECTRL_EXIST,
520 116, UNIPHIER_PIN_DRV_3BIT, 520 116, UNIPHIER_PIN_DRV_3BIT,
521 165, UNIPHIER_PIN_PULL_DOWN), 521 165, UNIPHIER_PIN_PULL_DOWN),
522 UNIPHIER_PINCTRL_PIN(166, "XIRQ19", 166, 522 UNIPHIER_PINCTRL_PIN(166, "XIRQ19", UNIPHIER_PIN_IECTRL_EXIST,
523 117, UNIPHIER_PIN_DRV_3BIT, 523 117, UNIPHIER_PIN_DRV_3BIT,
524 166, UNIPHIER_PIN_PULL_DOWN), 524 166, UNIPHIER_PIN_PULL_DOWN),
525 UNIPHIER_PINCTRL_PIN(167, "XIRQ20", 167, 525 UNIPHIER_PINCTRL_PIN(167, "XIRQ20", UNIPHIER_PIN_IECTRL_EXIST,
526 118, UNIPHIER_PIN_DRV_3BIT, 526 118, UNIPHIER_PIN_DRV_3BIT,
527 167, UNIPHIER_PIN_PULL_DOWN), 527 167, UNIPHIER_PIN_PULL_DOWN),
528 UNIPHIER_PINCTRL_PIN(168, "PORT00", 168, 528 UNIPHIER_PINCTRL_PIN(168, "PORT00", UNIPHIER_PIN_IECTRL_EXIST,
529 119, UNIPHIER_PIN_DRV_3BIT, 529 119, UNIPHIER_PIN_DRV_3BIT,
530 168, UNIPHIER_PIN_PULL_DOWN), 530 168, UNIPHIER_PIN_PULL_DOWN),
531 UNIPHIER_PINCTRL_PIN(169, "PORT01", 169, 531 UNIPHIER_PINCTRL_PIN(169, "PORT01", UNIPHIER_PIN_IECTRL_EXIST,
532 120, UNIPHIER_PIN_DRV_3BIT, 532 120, UNIPHIER_PIN_DRV_3BIT,
533 169, UNIPHIER_PIN_PULL_DOWN), 533 169, UNIPHIER_PIN_PULL_DOWN),
534 UNIPHIER_PINCTRL_PIN(170, "PORT02", 170, 534 UNIPHIER_PINCTRL_PIN(170, "PORT02", UNIPHIER_PIN_IECTRL_EXIST,
535 121, UNIPHIER_PIN_DRV_3BIT, 535 121, UNIPHIER_PIN_DRV_3BIT,
536 170, UNIPHIER_PIN_PULL_DOWN), 536 170, UNIPHIER_PIN_PULL_DOWN),
537 UNIPHIER_PINCTRL_PIN(171, "PORT03", 171, 537 UNIPHIER_PINCTRL_PIN(171, "PORT03", UNIPHIER_PIN_IECTRL_EXIST,
538 122, UNIPHIER_PIN_DRV_3BIT, 538 122, UNIPHIER_PIN_DRV_3BIT,
539 171, UNIPHIER_PIN_PULL_DOWN), 539 171, UNIPHIER_PIN_PULL_DOWN),
540 UNIPHIER_PINCTRL_PIN(172, "PORT04", 172, 540 UNIPHIER_PINCTRL_PIN(172, "PORT04", UNIPHIER_PIN_IECTRL_EXIST,
541 123, UNIPHIER_PIN_DRV_3BIT, 541 123, UNIPHIER_PIN_DRV_3BIT,
542 172, UNIPHIER_PIN_PULL_DOWN), 542 172, UNIPHIER_PIN_PULL_DOWN),
543 UNIPHIER_PINCTRL_PIN(173, "CK27FO", 173, 543 UNIPHIER_PINCTRL_PIN(173, "CK27FO", UNIPHIER_PIN_IECTRL_EXIST,
544 124, UNIPHIER_PIN_DRV_3BIT, 544 124, UNIPHIER_PIN_DRV_3BIT,
545 173, UNIPHIER_PIN_PULL_DOWN), 545 173, UNIPHIER_PIN_PULL_DOWN),
546 UNIPHIER_PINCTRL_PIN(174, "PHSYNCO", 174, 546 UNIPHIER_PINCTRL_PIN(174, "PHSYNCO", UNIPHIER_PIN_IECTRL_EXIST,
547 125, UNIPHIER_PIN_DRV_3BIT, 547 125, UNIPHIER_PIN_DRV_3BIT,
548 174, UNIPHIER_PIN_PULL_DOWN), 548 174, UNIPHIER_PIN_PULL_DOWN),
549 UNIPHIER_PINCTRL_PIN(175, "PVSYNCO", 175, 549 UNIPHIER_PINCTRL_PIN(175, "PVSYNCO", UNIPHIER_PIN_IECTRL_EXIST,
550 126, UNIPHIER_PIN_DRV_3BIT, 550 126, UNIPHIER_PIN_DRV_3BIT,
551 175, UNIPHIER_PIN_PULL_DOWN), 551 175, UNIPHIER_PIN_PULL_DOWN),
552}; 552};
553 553
554static const unsigned aout_pins[] = {135, 136, 137, 138, 139, 140, 141, 142};
555static const int aout_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0};
554static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25}; 556static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25};
555static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; 557static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0};
556static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29}; 558static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29};
@@ -597,7 +599,7 @@ static const unsigned usb2_pins[] = {50, 51};
597static const int usb2_muxvals[] = {0, 0}; 599static const int usb2_muxvals[] = {0, 0};
598static const unsigned usb3_pins[] = {52, 53}; 600static const unsigned usb3_pins[] = {52, 53};
599static const int usb3_muxvals[] = {0, 0}; 601static const int usb3_muxvals[] = {0, 0};
600static const unsigned port_range0_pins[] = { 602static const unsigned int gpio_range0_pins[] = {
601 168, 169, 170, 171, 172, 173, 174, 175, /* PORT0x */ 603 168, 169, 170, 171, 172, 173, 174, 175, /* PORT0x */
602 0, 1, 2, 3, 4, 5, 6, 7, /* PORT1x */ 604 0, 1, 2, 3, 4, 5, 6, 7, /* PORT1x */
603 8, 9, 10, 11, 12, 13, 14, 15, /* PORT2x */ 605 8, 9, 10, 11, 12, 13, 14, 15, /* PORT2x */
@@ -610,36 +612,16 @@ static const unsigned port_range0_pins[] = {
610 83, 84, 85, 86, 87, 88, 89, 90, /* PORT9x */ 612 83, 84, 85, 86, 87, 88, 89, 90, /* PORT9x */
611 91, 92, 93, 94, 95, 96, 97, 98, /* PORT10x */ 613 91, 92, 93, 94, 95, 96, 97, 98, /* PORT10x */
612}; 614};
613static const int port_range0_muxvals[] = { 615static const unsigned int gpio_range1_pins[] = {
614 15, 15, 15, 15, 15, 15, 15, 15, /* PORT0x */
615 15, 15, 15, 15, 15, 15, 15, 15, /* PORT1x */
616 15, 15, 15, 15, 15, 15, 15, 15, /* PORT2x */
617 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */
618 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */
619 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */
620 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */
621 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */
622 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */
623 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */
624 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */
625};
626static const unsigned port_range1_pins[] = {
627 99, 100, 101, 102, 103, 104, 105, 106, /* PORT12x */ 616 99, 100, 101, 102, 103, 104, 105, 106, /* PORT12x */
628 107, 108, 109, 110, 111, 112, 113, 114, /* PORT13x */ 617 107, 108, 109, 110, 111, 112, 113, 114, /* PORT13x */
629 115, 116, 117, 118, 119, 120, 121, 122, /* PORT14x */ 618 115, 116, 117, 118, 119, 120, 121, 122, /* PORT14x */
630}; 619 149, 150, 151, 152, 153, 154, 155, 156, /* XIRQ0-7 */
631static const int port_range1_muxvals[] = { 620 157, 158, 159, 160, 85, 161, 162, 84, /* XIRQ8-15 */
632 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */ 621 163, 164, 165, 166, 167, 146, 52, 53, /* XIRQ16-23 */
633 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */
634 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
635};
636static const unsigned port_range2_pins[] = {
637 61, 62, 63, 64, 65, 66, 67, 68, /* PORT18x */ 622 61, 62, 63, 64, 65, 66, 67, 68, /* PORT18x */
638}; 623};
639static const int port_range2_muxvals[] = { 624static const unsigned int gpio_range2_pins[] = {
640 15, 15, 15, 15, 15, 15, 15, 15, /* PORT18x */
641};
642static const unsigned port_range3_pins[] = {
643 123, 124, 125, 126, 127, 128, 129, 130, /* PORT20x */ 625 123, 124, 125, 126, 127, 128, 129, 130, /* PORT20x */
644 131, 132, 133, 134, 135, 136, 137, 138, /* PORT21x */ 626 131, 132, 133, 134, 135, 136, 137, 138, /* PORT21x */
645 139, 140, 141, 142, 143, 144, 145, 146, /* PORT22x */ 627 139, 140, 141, 142, 143, 144, 145, 146, /* PORT22x */
@@ -647,36 +629,9 @@ static const unsigned port_range3_pins[] = {
647 155, 156, 157, 158, 159, 160, 161, 162, /* PORT24x */ 629 155, 156, 157, 158, 159, 160, 161, 162, /* PORT24x */
648 163, 164, 165, 166, 167, /* PORT250-254 */ 630 163, 164, 165, 166, 167, /* PORT250-254 */
649}; 631};
650static const int port_range3_muxvals[] = {
651 15, 15, 15, 15, 15, 15, 15, 15, /* PORT20x */
652 15, 15, 15, 15, 15, 15, 15, 15, /* PORT21x */
653 15, 15, 15, 15, 15, 15, 15, 15, /* PORT22x */
654 15, 15, 15, 15, 15, 15, 15, 15, /* PORT23x */
655 15, 15, 15, 15, 15, 15, 15, 15, /* PORT24x */
656 15, 15, 15, 15, 15, /* PORT250-254 */
657};
658static const unsigned xirq_pins[] = {
659 149, 150, 151, 152, 153, 154, 155, 156, /* XIRQ0-7 */
660 157, 158, 159, 160, 85, 161, 162, 84, /* XIRQ8-15 */
661 163, 164, 165, 166, 167, 146, 52, 53, /* XIRQ16-23 */
662};
663static const int xirq_muxvals[] = {
664 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
665 14, 14, 14, 14, 13, 14, 14, 13, /* XIRQ8-15 */
666 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ16-23 */
667};
668static const unsigned xirq_alternatives_pins[] = {
669 94, 95, 96, 97, 98, 99, 100, 101, /* XIRQ0-7 */
670 102, 103, 104, 105, 106, 107, /* XIRQ8-11,13,14 */
671 108, 109, 110, 111, 112, 147, 141, 142, /* XIRQ16-23 */
672};
673static const int xirq_alternatives_muxvals[] = {
674 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
675 14, 14, 14, 14, 14, 14, /* XIRQ8-11,13,14 */
676 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ16-23 */
677};
678 632
679static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = { 633static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
634 UNIPHIER_PINCTRL_GROUP(aout),
680 UNIPHIER_PINCTRL_GROUP(emmc), 635 UNIPHIER_PINCTRL_GROUP(emmc),
681 UNIPHIER_PINCTRL_GROUP(emmc_dat8), 636 UNIPHIER_PINCTRL_GROUP(emmc_dat8),
682 UNIPHIER_PINCTRL_GROUP(ether_rgmii), 637 UNIPHIER_PINCTRL_GROUP(ether_rgmii),
@@ -697,225 +652,12 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
697 UNIPHIER_PINCTRL_GROUP(usb1), 652 UNIPHIER_PINCTRL_GROUP(usb1),
698 UNIPHIER_PINCTRL_GROUP(usb2), 653 UNIPHIER_PINCTRL_GROUP(usb2),
699 UNIPHIER_PINCTRL_GROUP(usb3), 654 UNIPHIER_PINCTRL_GROUP(usb3),
700 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 655 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
701 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1), 656 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
702 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range2), 657 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
703 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range3),
704 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
705 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_alternatives),
706 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
707 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
708 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
709 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
710 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
711 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
712 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
713 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
714 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
715 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
716 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
717 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
718 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
719 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
720 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
721 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
722 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
723 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
724 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
725 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
726 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
727 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
728 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
729 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
730 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
731 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
732 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
733 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
734 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
735 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
736 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
737 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
738 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
739 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
740 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
741 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
742 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
743 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
744 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
745 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
746 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
747 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
748 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
749 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
750 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
751 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
752 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
753 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
754 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
755 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
756 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
757 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
758 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
759 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
760 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
761 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
762 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
763 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
764 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
765 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
766 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
767 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
768 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
769 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
770 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
771 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
772 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
773 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
774 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
775 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
776 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
777 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
778 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
779 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
780 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
781 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
782 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
783 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
784 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
785 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
786 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
787 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
788 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
789 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
790 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
791 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
792 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
793 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
794 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range1, 0),
795 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range1, 1),
796 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range1, 2),
797 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range1, 3),
798 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range1, 4),
799 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range1, 5),
800 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range1, 6),
801 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range1, 7),
802 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range1, 8),
803 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range1, 9),
804 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range1, 10),
805 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range1, 11),
806 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range1, 12),
807 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range1, 13),
808 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range1, 14),
809 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range1, 15),
810 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range1, 16),
811 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range1, 17),
812 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range1, 18),
813 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range1, 19),
814 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range1, 20),
815 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range1, 21),
816 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range1, 22),
817 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range1, 23),
818 UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range2, 0),
819 UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range2, 1),
820 UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range2, 2),
821 UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range2, 3),
822 UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range2, 4),
823 UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range2, 5),
824 UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range2, 6),
825 UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range2, 7),
826 UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range3, 0),
827 UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range3, 1),
828 UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range3, 2),
829 UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range3, 3),
830 UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range3, 4),
831 UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range3, 5),
832 UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range3, 6),
833 UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range3, 7),
834 UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range3, 8),
835 UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range3, 9),
836 UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range3, 10),
837 UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range3, 11),
838 UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range3, 12),
839 UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range3, 13),
840 UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range3, 14),
841 UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range3, 15),
842 UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range3, 16),
843 UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range3, 17),
844 UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range3, 18),
845 UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range3, 19),
846 UNIPHIER_PINCTRL_GROUP_SINGLE(port224, port_range3, 20),
847 UNIPHIER_PINCTRL_GROUP_SINGLE(port225, port_range3, 21),
848 UNIPHIER_PINCTRL_GROUP_SINGLE(port226, port_range3, 22),
849 UNIPHIER_PINCTRL_GROUP_SINGLE(port227, port_range3, 23),
850 UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range3, 24),
851 UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range3, 25),
852 UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range3, 26),
853 UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range3, 27),
854 UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range3, 28),
855 UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range3, 29),
856 UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range3, 30),
857 UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range3, 31),
858 UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range3, 32),
859 UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range3, 33),
860 UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range3, 34),
861 UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range3, 35),
862 UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range3, 36),
863 UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range3, 37),
864 UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range3, 38),
865 UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range3, 39),
866 UNIPHIER_PINCTRL_GROUP_SINGLE(port250, port_range3, 40),
867 UNIPHIER_PINCTRL_GROUP_SINGLE(port251, port_range3, 41),
868 UNIPHIER_PINCTRL_GROUP_SINGLE(port252, port_range3, 42),
869 UNIPHIER_PINCTRL_GROUP_SINGLE(port253, port_range3, 43),
870 UNIPHIER_PINCTRL_GROUP_SINGLE(port254, port_range3, 44),
871 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
872 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
873 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
874 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
875 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
876 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
877 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
878 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
879 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
880 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
881 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
882 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
883 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
884 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
885 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
886 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
887 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
888 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
889 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
890 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
891 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
892 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21, xirq, 21),
893 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22, xirq, 22),
894 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23, xirq, 23),
895 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0b, xirq_alternatives, 0),
896 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1b, xirq_alternatives, 1),
897 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2b, xirq_alternatives, 2),
898 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3b, xirq_alternatives, 3),
899 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4b, xirq_alternatives, 4),
900 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5b, xirq_alternatives, 5),
901 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6b, xirq_alternatives, 6),
902 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7b, xirq_alternatives, 7),
903 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8b, xirq_alternatives, 8),
904 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9b, xirq_alternatives, 9),
905 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10b, xirq_alternatives, 10),
906 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11b, xirq_alternatives, 11),
907 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13b, xirq_alternatives, 12),
908 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14b, xirq_alternatives, 13),
909 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16b, xirq_alternatives, 14),
910 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17b, xirq_alternatives, 15),
911 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18b, xirq_alternatives, 16),
912 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19b, xirq_alternatives, 17),
913 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20b, xirq_alternatives, 18),
914 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21b, xirq_alternatives, 19),
915 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22b, xirq_alternatives, 20),
916 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23b, xirq_alternatives, 21),
917}; 658};
918 659
660static const char * const aout_groups[] = {"aout"};
919static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 661static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
920static const char * const ether_rgmii_groups[] = {"ether_rgmii"}; 662static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
921static const char * const ether_rmii_groups[] = {"ether_rmii"}; 663static const char * const ether_rmii_groups[] = {"ether_rmii"};
@@ -935,69 +677,9 @@ static const char * const usb0_groups[] = {"usb0"};
935static const char * const usb1_groups[] = {"usb1"}; 677static const char * const usb1_groups[] = {"usb1"};
936static const char * const usb2_groups[] = {"usb2"}; 678static const char * const usb2_groups[] = {"usb2"};
937static const char * const usb3_groups[] = {"usb3"}; 679static const char * const usb3_groups[] = {"usb3"};
938static const char * const port_groups[] = {
939 "port00", "port01", "port02", "port03",
940 "port04", "port05", "port06", "port07",
941 "port10", "port11", "port12", "port13",
942 "port14", "port15", "port16", "port17",
943 "port20", "port21", "port22", "port23",
944 "port24", "port25", "port26", "port27",
945 "port30", "port31", "port32", "port33",
946 "port34", "port35", "port36", "port37",
947 "port40", "port41", "port42", "port43",
948 "port44", "port45", "port46", "port47",
949 "port50", "port51", "port52", "port53",
950 "port54", "port55", "port56", "port57",
951 "port60", "port61", "port62", "port63",
952 "port64", "port65", "port66", "port67",
953 "port70", "port71", "port72", "port73",
954 "port74", "port75", "port76", "port77",
955 "port80", "port81", "port82", "port83",
956 "port84", "port85", "port86", "port87",
957 "port90", "port91", "port92", "port93",
958 "port94", "port95", "port96", "port97",
959 "port100", "port101", "port102", "port103",
960 "port104", "port105", "port106", "port107",
961 /* port110-117 missing */
962 "port120", "port121", "port122", "port123",
963 "port124", "port125", "port126", "port127",
964 "port130", "port131", "port132", "port133",
965 "port134", "port135", "port136", "port137",
966 "port140", "port141", "port142", "port143",
967 "port144", "port145", "port146", "port147",
968 /* port150-177 missing */
969 "port180", "port181", "port182", "port183",
970 "port184", "port185", "port186", "port187",
971 /* port190-197 missing */
972 "port200", "port201", "port202", "port203",
973 "port204", "port205", "port206", "port207",
974 "port210", "port211", "port212", "port213",
975 "port214", "port215", "port216", "port217",
976 "port220", "port221", "port222", "port223",
977 "port224", "port225", "port226", "port227",
978 "port230", "port231", "port232", "port233",
979 "port234", "port235", "port236", "port237",
980 "port240", "port241", "port242", "port243",
981 "port244", "port245", "port246", "port247",
982 "port250", "port251", "port252", "port253",
983 "port254",
984};
985static const char * const xirq_groups[] = {
986 "xirq0", "xirq1", "xirq2", "xirq3",
987 "xirq4", "xirq5", "xirq6", "xirq7",
988 "xirq8", "xirq9", "xirq10", "xirq11",
989 "xirq12", "xirq13", "xirq14", "xirq15",
990 "xirq16", "xirq17", "xirq18", "xirq19",
991 "xirq20", "xirq21", "xirq22", "xirq23",
992 "xirq0b", "xirq1b", "xirq2b", "xirq3b",
993 "xirq4b", "xirq5b", "xirq6b", "xirq7b",
994 "xirq8b", "xirq9b", "xirq10b", "xirq11b",
995 /* none */ "xirq13b", "xirq14b", /* none */
996 "xirq16b", "xirq17b", "xirq18b", "xirq19b",
997 "xirq20b", "xirq21b", "xirq22b", "xirq23b",
998};
999 680
1000static const struct uniphier_pinmux_function uniphier_ld20_functions[] = { 681static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
682 UNIPHIER_PINMUX_FUNCTION(aout),
1001 UNIPHIER_PINMUX_FUNCTION(emmc), 683 UNIPHIER_PINMUX_FUNCTION(emmc),
1002 UNIPHIER_PINMUX_FUNCTION(ether_rgmii), 684 UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
1003 UNIPHIER_PINMUX_FUNCTION(ether_rmii), 685 UNIPHIER_PINMUX_FUNCTION(ether_rmii),
@@ -1016,10 +698,20 @@ static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
1016 UNIPHIER_PINMUX_FUNCTION(usb1), 698 UNIPHIER_PINMUX_FUNCTION(usb1),
1017 UNIPHIER_PINMUX_FUNCTION(usb2), 699 UNIPHIER_PINMUX_FUNCTION(usb2),
1018 UNIPHIER_PINMUX_FUNCTION(usb3), 700 UNIPHIER_PINMUX_FUNCTION(usb3),
1019 UNIPHIER_PINMUX_FUNCTION(port),
1020 UNIPHIER_PINMUX_FUNCTION(xirq),
1021}; 701};
1022 702
703static int uniphier_ld20_get_gpio_muxval(unsigned int pin,
704 unsigned int gpio_offset)
705{
706 if (gpio_offset == 132 || gpio_offset == 135) /* XIRQ12, 15 */
707 return 13;
708
709 if (gpio_offset >= 120 && gpio_offset <= 143) /* XIRQx */
710 return 14;
711
712 return 15;
713}
714
1023static struct uniphier_pinctrl_socdata uniphier_ld20_pindata = { 715static struct uniphier_pinctrl_socdata uniphier_ld20_pindata = {
1024 .pins = uniphier_ld20_pins, 716 .pins = uniphier_ld20_pins,
1025 .npins = ARRAY_SIZE(uniphier_ld20_pins), 717 .npins = ARRAY_SIZE(uniphier_ld20_pins),
@@ -1027,6 +719,7 @@ static struct uniphier_pinctrl_socdata uniphier_ld20_pindata = {
1027 .groups_count = ARRAY_SIZE(uniphier_ld20_groups), 719 .groups_count = ARRAY_SIZE(uniphier_ld20_groups),
1028 .functions = uniphier_ld20_functions, 720 .functions = uniphier_ld20_functions,
1029 .functions_count = ARRAY_SIZE(uniphier_ld20_functions), 721 .functions_count = ARRAY_SIZE(uniphier_ld20_functions),
722 .get_gpio_muxval = uniphier_ld20_get_gpio_muxval,
1030 .caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL, 723 .caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
1031}; 724};
1032 725
@@ -1045,6 +738,7 @@ static struct platform_driver uniphier_ld20_pinctrl_driver = {
1045 .driver = { 738 .driver = {
1046 .name = "uniphier-ld20-pinctrl", 739 .name = "uniphier-ld20-pinctrl",
1047 .of_match_table = uniphier_ld20_pinctrl_match, 740 .of_match_table = uniphier_ld20_pinctrl_match,
741 .pm = &uniphier_pinctrl_pm_ops,
1048 }, 742 },
1049}; 743};
1050builtin_platform_driver(uniphier_ld20_pinctrl_driver); 744builtin_platform_driver(uniphier_ld20_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
index 8f2ad1c4c6f4..840382847212 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
@@ -606,59 +606,24 @@ static const unsigned usb2_pins[] = {155, 156};
606static const int usb2_muxvals[] = {4, 4}; 606static const int usb2_muxvals[] = {4, 4};
607static const unsigned usb2b_pins[] = {67, 68}; 607static const unsigned usb2b_pins[] = {67, 68};
608static const int usb2b_muxvals[] = {23, 23}; 608static const int usb2b_muxvals[] = {23, 23};
609static const unsigned port_range0_pins[] = { 609static const unsigned int gpio_range_pins[] = {
610 135, 136, 137, 138, 139, 140, 141, 142, /* PORT0x */ 610 135, 136, 137, 138, 139, 140, 141, 142, /* PORT0x */
611 143, 144, 145, 146, 147, 148, 149, 150, /* PORT1x */ 611 143, 144, 145, 146, 147, 148, 149, 150, /* PORT1x */
612 151, 152, 153, 154, 155, 156, 157, 0, /* PORT2x */ 612 151, 152, 153, 154, 155, 156, 157, 0, /* PORT2x */
613 1, 2, 3, 4, 5, 120, 121, 122, /* PORT3x */ 613 1, 2, 3, 4, 5, 120, 121, 122, /* PORT3x */
614 24, 25, 26, 27, 28, 29, 30, 31, /* PORT4x */ 614 24, 25, 26, 27, 28, 29, 30, 31, /* PORT4x */
615 40, 41, 42, 43, 44, 45, 46, 47, /* PORT5x */ 615 40, 41, 42, 43, 44, 45, 46, 47, /* PORT5x */
616 48, 49, 50, 51, 52, 53, 54, 55, /* PORT6x */ 616 48, 49, 50, 51, 52, 53, 54, 55, /* PORT6x */
617 56, 85, 84, 59, 82, 61, 64, 65, /* PORT7x */ 617 56, 85, 84, 59, 82, 61, 64, 65, /* PORT7x */
618 8, 9, 10, 11, 12, 13, 14, 15, /* PORT8x */ 618 8, 9, 10, 11, 12, 13, 14, 15, /* PORT8x */
619 66, 67, 68, 69, 70, 71, 72, 73, /* PORT9x */ 619 66, 67, 68, 69, 70, 71, 72, 73, /* PORT9x */
620 74, 75, 89, 86, 78, 79, 80, 81, /* PORT10x */ 620 74, 75, 89, 86, 78, 79, 80, 81, /* PORT10x */
621 60, 83, 58, 57, 88, 87, 77, 76, /* PORT11x */ 621 60, 83, 58, 57, 88, 87, 77, 76, /* PORT11x */
622 90, 91, 92, 93, 94, 95, 96, 97, /* PORT12x */ 622 90, 91, 92, 93, 94, 95, 96, 97, /* PORT12x */
623 98, 99, 100, 6, 101, 114, 115, 116, /* PORT13x */ 623 98, 99, 100, 6, 101, 114, 115, 116, /* PORT13x */
624 103, 108, 21, 22, 23, 117, 118, 119, /* PORT14x */ 624 103, 108, 21, 22, 23, 117, 118, 119, /* PORT14x */
625}; 625 151, 123, 124, 125, 126, 127, 128, 129, /* XIRQ0-7 */
626static const int port_range0_muxvals[] = { 626 130, 131, 132, 133, 62, 7, 134, 63, /* XIRQ8-12, PORT165, XIRQ14-15 */
627 0, 0, 0, 0, 0, 0, 0, 0, /* PORT0x */
628 0, 0, 0, 0, 0, 0, 0, 0, /* PORT1x */
629 0, 0, 0, 0, 0, 0, 0, 15, /* PORT2x */
630 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */
631 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */
632 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */
633 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */
634 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */
635 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */
636 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */
637 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */
638 15, 15, 15, 15, 15, 15, 15, 15, /* PORT11x */
639 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */
640 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */
641 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
642};
643static const unsigned port_range1_pins[] = {
644 7, /* PORT166 */
645};
646static const int port_range1_muxvals[] = {
647 15, /* PORT166 */
648};
649static const unsigned xirq_range0_pins[] = {
650 151, 123, 124, 125, 126, 127, 128, 129, /* XIRQ0-7 */
651 130, 131, 132, 133, 62, /* XIRQ8-12 */
652};
653static const int xirq_range0_muxvals[] = {
654 14, 0, 0, 0, 0, 0, 0, 0, /* XIRQ0-7 */
655 0, 0, 0, 0, 14, /* XIRQ8-12 */
656};
657static const unsigned xirq_range1_pins[] = {
658 134, 63, /* XIRQ14-15 */
659};
660static const int xirq_range1_muxvals[] = {
661 0, 14, /* XIRQ14-15 */
662}; 627};
663 628
664static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = { 629static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
@@ -687,146 +652,7 @@ static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
687 UNIPHIER_PINCTRL_GROUP(usb1), 652 UNIPHIER_PINCTRL_GROUP(usb1),
688 UNIPHIER_PINCTRL_GROUP(usb2), 653 UNIPHIER_PINCTRL_GROUP(usb2),
689 UNIPHIER_PINCTRL_GROUP(usb2b), 654 UNIPHIER_PINCTRL_GROUP(usb2b),
690 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 655 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range),
691 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1),
692 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_range0),
693 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_range1),
694 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
695 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
696 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
697 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
698 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
699 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
700 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
701 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
702 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
703 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
704 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
705 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
706 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
707 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
708 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
709 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
710 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
711 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
712 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
713 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
714 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
715 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
716 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
717 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
718 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
719 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
720 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
721 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
722 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
723 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
724 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
725 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
726 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
727 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
728 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
729 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
730 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
731 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
732 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
733 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
734 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
735 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
736 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
737 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
738 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
739 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
740 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
741 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
742 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
743 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
744 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
745 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
746 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
747 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
748 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
749 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
750 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
751 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
752 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
753 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
754 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
755 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
756 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
757 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
758 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
759 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
760 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
761 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
762 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
763 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
764 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
765 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
766 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
767 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
768 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
769 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
770 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
771 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
772 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
773 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
774 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
775 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
776 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
777 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
778 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
779 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
780 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
781 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
782 UNIPHIER_PINCTRL_GROUP_SINGLE(port110, port_range0, 88),
783 UNIPHIER_PINCTRL_GROUP_SINGLE(port111, port_range0, 89),
784 UNIPHIER_PINCTRL_GROUP_SINGLE(port112, port_range0, 90),
785 UNIPHIER_PINCTRL_GROUP_SINGLE(port113, port_range0, 91),
786 UNIPHIER_PINCTRL_GROUP_SINGLE(port114, port_range0, 92),
787 UNIPHIER_PINCTRL_GROUP_SINGLE(port115, port_range0, 93),
788 UNIPHIER_PINCTRL_GROUP_SINGLE(port116, port_range0, 94),
789 UNIPHIER_PINCTRL_GROUP_SINGLE(port117, port_range0, 95),
790 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range0, 96),
791 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range0, 97),
792 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range0, 98),
793 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range0, 99),
794 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range0, 100),
795 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range0, 101),
796 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range0, 102),
797 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range0, 103),
798 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range0, 104),
799 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range0, 105),
800 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range0, 106),
801 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range0, 107),
802 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range0, 108),
803 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range0, 109),
804 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range0, 110),
805 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range0, 111),
806 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range0, 112),
807 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range0, 113),
808 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range0, 114),
809 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range0, 115),
810 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range0, 116),
811 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range0, 117),
812 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range0, 118),
813 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range0, 119),
814 UNIPHIER_PINCTRL_GROUP_SINGLE(port165, port_range1, 0),
815 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq_range0, 0),
816 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq_range0, 1),
817 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq_range0, 2),
818 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq_range0, 3),
819 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq_range0, 4),
820 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq_range0, 5),
821 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq_range0, 6),
822 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq_range0, 7),
823 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq_range0, 8),
824 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq_range0, 9),
825 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq_range0, 10),
826 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq_range0, 11),
827 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq_range0, 12),
828 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq_range1, 0),
829 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq_range1, 1),
830}; 656};
831 657
832static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 658static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
@@ -850,46 +676,6 @@ static const char * const uart3_groups[] = {"uart3"};
850static const char * const usb0_groups[] = {"usb0"}; 676static const char * const usb0_groups[] = {"usb0"};
851static const char * const usb1_groups[] = {"usb1"}; 677static const char * const usb1_groups[] = {"usb1"};
852static const char * const usb2_groups[] = {"usb2", "usb2b"}; 678static const char * const usb2_groups[] = {"usb2", "usb2b"};
853static const char * const port_groups[] = {
854 "port00", "port01", "port02", "port03",
855 "port04", "port05", "port06", "port07",
856 "port10", "port11", "port12", "port13",
857 "port14", "port15", "port16", "port17",
858 "port20", "port21", "port22", "port23",
859 "port24", "port25", "port26", "port27",
860 "port30", "port31", "port32", "port33",
861 "port34", "port35", "port36", "port37",
862 "port40", "port41", "port42", "port43",
863 "port44", "port45", "port46", "port47",
864 "port50", "port51", "port52", "port53",
865 "port54", "port55", "port56", "port57",
866 "port60", "port61", "port62", "port63",
867 "port64", "port65", "port66", "port67",
868 "port70", "port71", "port72", "port73",
869 "port74", "port75", "port76", "port77",
870 "port80", "port81", "port82", "port83",
871 "port84", "port85", "port86", "port87",
872 "port90", "port91", "port92", "port93",
873 "port94", "port95", "port96", "port97",
874 "port100", "port101", "port102", "port103",
875 "port104", "port105", "port106", "port107",
876 "port110", "port111", "port112", "port113",
877 "port114", "port115", "port116", "port117",
878 "port120", "port121", "port122", "port123",
879 "port124", "port125", "port126", "port127",
880 "port130", "port131", "port132", "port133",
881 "port134", "port135", "port136", "port137",
882 "port140", "port141", "port142", "port143",
883 "port144", "port145", "port146", "port147",
884 /* port150-164 missing */
885 /* none */ "port165",
886};
887static const char * const xirq_groups[] = {
888 "xirq0", "xirq1", "xirq2", "xirq3",
889 "xirq4", "xirq5", "xirq6", "xirq7",
890 "xirq8", "xirq9", "xirq10", "xirq11",
891 "xirq12", /* none*/ "xirq14", "xirq15",
892};
893 679
894static const struct uniphier_pinmux_function uniphier_ld4_functions[] = { 680static const struct uniphier_pinmux_function uniphier_ld4_functions[] = {
895 UNIPHIER_PINMUX_FUNCTION(emmc), 681 UNIPHIER_PINMUX_FUNCTION(emmc),
@@ -909,10 +695,25 @@ static const struct uniphier_pinmux_function uniphier_ld4_functions[] = {
909 UNIPHIER_PINMUX_FUNCTION(usb0), 695 UNIPHIER_PINMUX_FUNCTION(usb0),
910 UNIPHIER_PINMUX_FUNCTION(usb1), 696 UNIPHIER_PINMUX_FUNCTION(usb1),
911 UNIPHIER_PINMUX_FUNCTION(usb2), 697 UNIPHIER_PINMUX_FUNCTION(usb2),
912 UNIPHIER_PINMUX_FUNCTION(port),
913 UNIPHIER_PINMUX_FUNCTION(xirq),
914}; 698};
915 699
700static int uniphier_ld4_get_gpio_muxval(unsigned int pin,
701 unsigned int gpio_offset)
702{
703 switch (gpio_offset) {
704 case 0 ... 22: /* PORT00-PORT26 */
705 case 121 ... 131: /* XIRQ1-XIRQ11 */
706 case 134: /* XIRQ14 */
707 return 0;
708 case 120: /* XIRQ0 */
709 case 132: /* XIRQ12 */
710 case 135: /* XIRQ15 */
711 return 14;
712 default:
713 return 15;
714 }
715}
716
916static struct uniphier_pinctrl_socdata uniphier_ld4_pindata = { 717static struct uniphier_pinctrl_socdata uniphier_ld4_pindata = {
917 .pins = uniphier_ld4_pins, 718 .pins = uniphier_ld4_pins,
918 .npins = ARRAY_SIZE(uniphier_ld4_pins), 719 .npins = ARRAY_SIZE(uniphier_ld4_pins),
@@ -920,6 +721,7 @@ static struct uniphier_pinctrl_socdata uniphier_ld4_pindata = {
920 .groups_count = ARRAY_SIZE(uniphier_ld4_groups), 721 .groups_count = ARRAY_SIZE(uniphier_ld4_groups),
921 .functions = uniphier_ld4_functions, 722 .functions = uniphier_ld4_functions,
922 .functions_count = ARRAY_SIZE(uniphier_ld4_functions), 723 .functions_count = ARRAY_SIZE(uniphier_ld4_functions),
724 .get_gpio_muxval = uniphier_ld4_get_gpio_muxval,
923 .caps = 0, 725 .caps = 0,
924}; 726};
925 727
@@ -938,6 +740,7 @@ static struct platform_driver uniphier_ld4_pinctrl_driver = {
938 .driver = { 740 .driver = {
939 .name = "uniphier-ld4-pinctrl", 741 .name = "uniphier-ld4-pinctrl",
940 .of_match_table = uniphier_ld4_pinctrl_match, 742 .of_match_table = uniphier_ld4_pinctrl_match,
743 .pm = &uniphier_pinctrl_pm_ops,
941 }, 744 },
942}; 745};
943builtin_platform_driver(uniphier_ld4_pinctrl_driver); 746builtin_platform_driver(uniphier_ld4_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
index 8a0da937b670..493a90c6d733 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
@@ -803,7 +803,7 @@ static const unsigned usb2_pins[] = {60, 61};
803static const int usb2_muxvals[] = {0, 0}; 803static const int usb2_muxvals[] = {0, 0};
804static const unsigned usb3_pins[] = {62, 63}; 804static const unsigned usb3_pins[] = {62, 63};
805static const int usb3_muxvals[] = {0, 0}; 805static const int usb3_muxvals[] = {0, 0};
806static const unsigned port_range0_pins[] = { 806static const unsigned int gpio_range0_pins[] = {
807 127, 128, 129, 130, 131, 132, 133, 134, /* PORT0x */ 807 127, 128, 129, 130, 131, 132, 133, 134, /* PORT0x */
808 135, 136, 137, 138, 139, 140, 141, 142, /* PORT1x */ 808 135, 136, 137, 138, 139, 140, 141, 142, /* PORT1x */
809 0, 1, 2, 3, 4, 5, 6, 7, /* PORT2x */ 809 0, 1, 2, 3, 4, 5, 6, 7, /* PORT2x */
@@ -816,26 +816,13 @@ static const unsigned port_range0_pins[] = {
816 61, 62, 63, 64, 65, 66, 67, 68, /* PORT9x */ 816 61, 62, 63, 64, 65, 66, 67, 68, /* PORT9x */
817 69, 70, 71, 76, 77, 78, 79, 80, /* PORT10x */ 817 69, 70, 71, 76, 77, 78, 79, 80, /* PORT10x */
818}; 818};
819static const int port_range0_muxvals[] = { 819static const unsigned int gpio_range1_pins[] = {
820 15, 15, 15, 15, 15, 15, 15, 15, /* PORT0x */
821 15, 15, 15, 15, 15, 15, 15, 15, /* PORT1x */
822 15, 15, 15, 15, 15, 15, 15, 15, /* PORT2x */
823 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */
824 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */
825 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */
826 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */
827 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */
828 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */
829 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */
830 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */
831};
832static const unsigned port_range1_pins[] = {
833 81, 82, 83, 84, 85, 86, 87, 88, /* PORT12x */ 820 81, 82, 83, 84, 85, 86, 87, 88, /* PORT12x */
834 89, 90, 95, 96, 97, 98, 99, 100, /* PORT13x */ 821 89, 90, 95, 96, 97, 98, 99, 100, /* PORT13x */
835 101, 102, 103, 104, 105, 106, 107, 108, /* PORT14x */ 822 101, 102, 103, 104, 105, 106, 107, 108, /* PORT14x */
836 118, 119, 120, 121, 122, 123, 124, 125, /* PORT15x */ 823 118, 119, 120, 121, 122, 123, 124, 125, /* XIRQ0-7 */
837 126, 72, 73, 92, 177, 93, 94, 176, /* PORT16x */ 824 126, 72, 73, 92, 177, 93, 94, 176, /* XIRQ8-15 */
838 74, 91, 27, 28, 29, 75, 20, 26, /* PORT17x */ 825 74, 91, 27, 28, 29, 75, 20, 26, /* XIRQ16-23 */
839 109, 110, 111, 112, 113, 114, 115, 116, /* PORT18x */ 826 109, 110, 111, 112, 113, 114, 115, 116, /* PORT18x */
840 117, 143, 144, 145, 146, 147, 148, 149, /* PORT19x */ 827 117, 143, 144, 145, 146, 147, 148, 149, /* PORT19x */
841 150, 151, 152, 153, 154, 155, 156, 157, /* PORT20x */ 828 150, 151, 152, 153, 154, 155, 156, 157, /* PORT20x */
@@ -848,35 +835,6 @@ static const unsigned port_range1_pins[] = {
848 218, 219, 220, 221, 223, 224, 225, 226, /* PORT27x */ 835 218, 219, 220, 221, 223, 224, 225, 226, /* PORT27x */
849 227, 228, 229, 230, 231, 232, 233, 234, /* PORT28x */ 836 227, 228, 229, 230, 231, 232, 233, 234, /* PORT28x */
850}; 837};
851static const int port_range1_muxvals[] = {
852 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */
853 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */
854 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
855 15, 15, 15, 15, 15, 15, 15, 15, /* PORT15x */
856 15, 15, 15, 15, 15, 15, 15, 15, /* PORT16x */
857 15, 15, 15, 15, 15, 15, 15, 15, /* PORT17x */
858 15, 15, 15, 15, 15, 15, 15, 15, /* PORT18x */
859 15, 15, 15, 15, 15, 15, 15, 15, /* PORT19x */
860 15, 15, 15, 15, 15, 15, 15, 15, /* PORT20x */
861 15, 15, 15, 15, 15, 15, 15, 15, /* PORT21x */
862 15, 15, 15, 15, 15, 15, 15, 15, /* PORT22x */
863 15, 15, 15, 15, 15, 15, 15, 15, /* PORT23x */
864 15, 15, 15, 15, 15, 15, 15, 15, /* PORT24x */
865 15, 15, 15, 15, 15, 15, 15, 15, /* PORT25x */
866 15, 15, 15, 15, 15, 15, 15, 15, /* PORT26x */
867 15, 15, 15, 15, 15, 15, 15, 15, /* PORT27x */
868 15, 15, 15, 15, 15, 15, 15, 15, /* PORT28x */
869};
870static const unsigned xirq_pins[] = {
871 118, 119, 120, 121, 122, 123, 124, 125, /* XIRQ0-7 */
872 126, 72, 73, 92, 177, 93, 94, 176, /* XIRQ8-15 */
873 74, 91, 27, 28, 29, 75, 20, 26, /* XIRQ16-23 */
874};
875static const int xirq_muxvals[] = {
876 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
877 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ8-15 */
878 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ16-23 */
879};
880 838
881static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = { 839static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
882 UNIPHIER_PINCTRL_GROUP(adinter), 840 UNIPHIER_PINCTRL_GROUP(adinter),
@@ -907,257 +865,8 @@ static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
907 UNIPHIER_PINCTRL_GROUP(usb1), 865 UNIPHIER_PINCTRL_GROUP(usb1),
908 UNIPHIER_PINCTRL_GROUP(usb2), 866 UNIPHIER_PINCTRL_GROUP(usb2),
909 UNIPHIER_PINCTRL_GROUP(usb3), 867 UNIPHIER_PINCTRL_GROUP(usb3),
910 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 868 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
911 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1), 869 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
912 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
913 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
914 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
915 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
916 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
917 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
918 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
919 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
920 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
921 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
922 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
923 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
924 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
925 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
926 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
927 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
928 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
929 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
930 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
931 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
932 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
933 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
934 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
935 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
936 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
937 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
938 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
939 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
940 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
941 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
942 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
943 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
944 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
945 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
946 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
947 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
948 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
949 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
950 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
951 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
952 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
953 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
954 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
955 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
956 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
957 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
958 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
959 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
960 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
961 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
962 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
963 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
964 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
965 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
966 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
967 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
968 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
969 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
970 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
971 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
972 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
973 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
974 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
975 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
976 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
977 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
978 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
979 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
980 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
981 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
982 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
983 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
984 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
985 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
986 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
987 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
988 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
989 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
990 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
991 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
992 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
993 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
994 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
995 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
996 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
997 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
998 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
999 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
1000 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
1001 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range1, 0),
1002 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range1, 1),
1003 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range1, 2),
1004 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range1, 3),
1005 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range1, 4),
1006 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range1, 5),
1007 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range1, 6),
1008 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range1, 7),
1009 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range1, 8),
1010 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range1, 9),
1011 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range1, 10),
1012 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range1, 11),
1013 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range1, 12),
1014 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range1, 13),
1015 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range1, 14),
1016 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range1, 15),
1017 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range1, 16),
1018 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range1, 17),
1019 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range1, 18),
1020 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range1, 19),
1021 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range1, 20),
1022 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range1, 21),
1023 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range1, 22),
1024 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range1, 23),
1025 UNIPHIER_PINCTRL_GROUP_SINGLE(port150, port_range1, 24),
1026 UNIPHIER_PINCTRL_GROUP_SINGLE(port151, port_range1, 25),
1027 UNIPHIER_PINCTRL_GROUP_SINGLE(port152, port_range1, 26),
1028 UNIPHIER_PINCTRL_GROUP_SINGLE(port153, port_range1, 27),
1029 UNIPHIER_PINCTRL_GROUP_SINGLE(port154, port_range1, 28),
1030 UNIPHIER_PINCTRL_GROUP_SINGLE(port155, port_range1, 29),
1031 UNIPHIER_PINCTRL_GROUP_SINGLE(port156, port_range1, 30),
1032 UNIPHIER_PINCTRL_GROUP_SINGLE(port157, port_range1, 31),
1033 UNIPHIER_PINCTRL_GROUP_SINGLE(port160, port_range1, 32),
1034 UNIPHIER_PINCTRL_GROUP_SINGLE(port161, port_range1, 33),
1035 UNIPHIER_PINCTRL_GROUP_SINGLE(port162, port_range1, 34),
1036 UNIPHIER_PINCTRL_GROUP_SINGLE(port163, port_range1, 35),
1037 UNIPHIER_PINCTRL_GROUP_SINGLE(port164, port_range1, 36),
1038 UNIPHIER_PINCTRL_GROUP_SINGLE(port165, port_range1, 37),
1039 UNIPHIER_PINCTRL_GROUP_SINGLE(port166, port_range1, 38),
1040 UNIPHIER_PINCTRL_GROUP_SINGLE(port167, port_range1, 39),
1041 UNIPHIER_PINCTRL_GROUP_SINGLE(port170, port_range1, 40),
1042 UNIPHIER_PINCTRL_GROUP_SINGLE(port171, port_range1, 41),
1043 UNIPHIER_PINCTRL_GROUP_SINGLE(port172, port_range1, 42),
1044 UNIPHIER_PINCTRL_GROUP_SINGLE(port173, port_range1, 43),
1045 UNIPHIER_PINCTRL_GROUP_SINGLE(port174, port_range1, 44),
1046 UNIPHIER_PINCTRL_GROUP_SINGLE(port175, port_range1, 45),
1047 UNIPHIER_PINCTRL_GROUP_SINGLE(port176, port_range1, 46),
1048 UNIPHIER_PINCTRL_GROUP_SINGLE(port177, port_range1, 47),
1049 UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range1, 48),
1050 UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range1, 49),
1051 UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range1, 50),
1052 UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range1, 51),
1053 UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range1, 52),
1054 UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range1, 53),
1055 UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range1, 54),
1056 UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range1, 55),
1057 UNIPHIER_PINCTRL_GROUP_SINGLE(port190, port_range1, 56),
1058 UNIPHIER_PINCTRL_GROUP_SINGLE(port191, port_range1, 57),
1059 UNIPHIER_PINCTRL_GROUP_SINGLE(port192, port_range1, 58),
1060 UNIPHIER_PINCTRL_GROUP_SINGLE(port193, port_range1, 59),
1061 UNIPHIER_PINCTRL_GROUP_SINGLE(port194, port_range1, 60),
1062 UNIPHIER_PINCTRL_GROUP_SINGLE(port195, port_range1, 61),
1063 UNIPHIER_PINCTRL_GROUP_SINGLE(port196, port_range1, 62),
1064 UNIPHIER_PINCTRL_GROUP_SINGLE(port197, port_range1, 63),
1065 UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range1, 64),
1066 UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range1, 65),
1067 UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range1, 66),
1068 UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range1, 67),
1069 UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range1, 68),
1070 UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range1, 69),
1071 UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range1, 70),
1072 UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range1, 71),
1073 UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range1, 72),
1074 UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range1, 73),
1075 UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range1, 74),
1076 UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range1, 75),
1077 UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range1, 76),
1078 UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range1, 77),
1079 UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range1, 78),
1080 UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range1, 79),
1081 UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range1, 80),
1082 UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range1, 81),
1083 UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range1, 82),
1084 UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range1, 83),
1085 UNIPHIER_PINCTRL_GROUP_SINGLE(port224, port_range1, 84),
1086 UNIPHIER_PINCTRL_GROUP_SINGLE(port225, port_range1, 85),
1087 UNIPHIER_PINCTRL_GROUP_SINGLE(port226, port_range1, 86),
1088 UNIPHIER_PINCTRL_GROUP_SINGLE(port227, port_range1, 87),
1089 UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range1, 88),
1090 UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range1, 89),
1091 UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range1, 90),
1092 UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range1, 91),
1093 UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range1, 92),
1094 UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range1, 93),
1095 UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range1, 94),
1096 UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range1, 95),
1097 UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range1, 96),
1098 UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range1, 97),
1099 UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range1, 98),
1100 UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range1, 99),
1101 UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range1, 100),
1102 UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range1, 101),
1103 UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range1, 102),
1104 UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range1, 103),
1105 UNIPHIER_PINCTRL_GROUP_SINGLE(port250, port_range1, 104),
1106 UNIPHIER_PINCTRL_GROUP_SINGLE(port251, port_range1, 105),
1107 UNIPHIER_PINCTRL_GROUP_SINGLE(port252, port_range1, 106),
1108 UNIPHIER_PINCTRL_GROUP_SINGLE(port253, port_range1, 107),
1109 UNIPHIER_PINCTRL_GROUP_SINGLE(port254, port_range1, 108),
1110 UNIPHIER_PINCTRL_GROUP_SINGLE(port255, port_range1, 109),
1111 UNIPHIER_PINCTRL_GROUP_SINGLE(port256, port_range1, 110),
1112 UNIPHIER_PINCTRL_GROUP_SINGLE(port257, port_range1, 111),
1113 UNIPHIER_PINCTRL_GROUP_SINGLE(port260, port_range1, 112),
1114 UNIPHIER_PINCTRL_GROUP_SINGLE(port261, port_range1, 113),
1115 UNIPHIER_PINCTRL_GROUP_SINGLE(port262, port_range1, 114),
1116 UNIPHIER_PINCTRL_GROUP_SINGLE(port263, port_range1, 115),
1117 UNIPHIER_PINCTRL_GROUP_SINGLE(port264, port_range1, 116),
1118 UNIPHIER_PINCTRL_GROUP_SINGLE(port265, port_range1, 117),
1119 UNIPHIER_PINCTRL_GROUP_SINGLE(port266, port_range1, 118),
1120 UNIPHIER_PINCTRL_GROUP_SINGLE(port267, port_range1, 119),
1121 UNIPHIER_PINCTRL_GROUP_SINGLE(port270, port_range1, 120),
1122 UNIPHIER_PINCTRL_GROUP_SINGLE(port271, port_range1, 121),
1123 UNIPHIER_PINCTRL_GROUP_SINGLE(port272, port_range1, 122),
1124 UNIPHIER_PINCTRL_GROUP_SINGLE(port273, port_range1, 123),
1125 UNIPHIER_PINCTRL_GROUP_SINGLE(port274, port_range1, 124),
1126 UNIPHIER_PINCTRL_GROUP_SINGLE(port275, port_range1, 125),
1127 UNIPHIER_PINCTRL_GROUP_SINGLE(port276, port_range1, 126),
1128 UNIPHIER_PINCTRL_GROUP_SINGLE(port277, port_range1, 127),
1129 UNIPHIER_PINCTRL_GROUP_SINGLE(port280, port_range1, 128),
1130 UNIPHIER_PINCTRL_GROUP_SINGLE(port281, port_range1, 129),
1131 UNIPHIER_PINCTRL_GROUP_SINGLE(port282, port_range1, 130),
1132 UNIPHIER_PINCTRL_GROUP_SINGLE(port283, port_range1, 131),
1133 UNIPHIER_PINCTRL_GROUP_SINGLE(port284, port_range1, 132),
1134 UNIPHIER_PINCTRL_GROUP_SINGLE(port285, port_range1, 133),
1135 UNIPHIER_PINCTRL_GROUP_SINGLE(port286, port_range1, 134),
1136 UNIPHIER_PINCTRL_GROUP_SINGLE(port287, port_range1, 135),
1137 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
1138 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
1139 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
1140 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
1141 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
1142 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
1143 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
1144 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
1145 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
1146 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
1147 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
1148 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
1149 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
1150 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
1151 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
1152 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
1153 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
1154 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
1155 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
1156 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
1157 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
1158 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21, xirq, 21),
1159 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22, xirq, 22),
1160 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23, xirq, 23),
1161}; 870};
1162 871
1163static const char * const adinter_groups[] = {"adinter"}; 872static const char * const adinter_groups[] = {"adinter"};
@@ -1183,73 +892,6 @@ static const char * const usb0_groups[] = {"usb0"};
1183static const char * const usb1_groups[] = {"usb1"}; 892static const char * const usb1_groups[] = {"usb1"};
1184static const char * const usb2_groups[] = {"usb2"}; 893static const char * const usb2_groups[] = {"usb2"};
1185static const char * const usb3_groups[] = {"usb3"}; 894static const char * const usb3_groups[] = {"usb3"};
1186static const char * const port_groups[] = {
1187 "port00", "port01", "port02", "port03",
1188 "port04", "port05", "port06", "port07",
1189 "port10", "port11", "port12", "port13",
1190 "port14", "port15", "port16", "port17",
1191 "port20", "port21", "port22", "port23",
1192 "port24", "port25", "port26", "port27",
1193 "port30", "port31", "port32", "port33",
1194 "port34", "port35", "port36", "port37",
1195 "port40", "port41", "port42", "port43",
1196 "port44", "port45", "port46", "port47",
1197 "port50", "port51", "port52", "port53",
1198 "port54", "port55", "port56", "port57",
1199 "port60", "port61", "port62", "port63",
1200 "port64", "port65", "port66", "port67",
1201 "port70", "port71", "port72", "port73",
1202 "port74", "port75", "port76", "port77",
1203 "port80", "port81", "port82", "port83",
1204 "port84", "port85", "port86", "port87",
1205 "port90", "port91", "port92", "port93",
1206 "port94", "port95", "port96", "port97",
1207 "port100", "port101", "port102", "port103",
1208 "port104", "port105", "port106", "port107",
1209 /* port110-117 missing */
1210 "port120", "port121", "port122", "port123",
1211 "port124", "port125", "port126", "port127",
1212 "port130", "port131", "port132", "port133",
1213 "port134", "port135", "port136", "port137",
1214 "port140", "port141", "port142", "port143",
1215 "port144", "port145", "port146", "port147",
1216 "port150", "port151", "port152", "port153",
1217 "port154", "port155", "port156", "port157",
1218 "port160", "port161", "port162", "port163",
1219 "port164", "port165", "port166", "port167",
1220 "port170", "port171", "port172", "port173",
1221 "port174", "port175", "port176", "port177",
1222 "port180", "port181", "port182", "port183",
1223 "port184", "port185", "port186", "port187",
1224 "port190", "port191", "port192", "port193",
1225 "port194", "port195", "port196", "port197",
1226 "port200", "port201", "port202", "port203",
1227 "port204", "port205", "port206", "port207",
1228 "port210", "port211", "port212", "port213",
1229 "port214", "port215", "port216", "port217",
1230 "port220", "port221", "port222", "port223",
1231 "port224", "port225", "port226", "port227",
1232 "port230", "port231", "port232", "port233",
1233 "port234", "port235", "port236", "port237",
1234 "port240", "port241", "port242", "port243",
1235 "port244", "port245", "port246", "port247",
1236 "port250", "port251", "port252", "port253",
1237 "port254", "port255", "port256", "port257",
1238 "port260", "port261", "port262", "port263",
1239 "port264", "port265", "port266", "port267",
1240 "port270", "port271", "port272", "port273",
1241 "port274", "port275", "port276", "port277",
1242 "port280", "port281", "port282", "port283",
1243 "port284", "port285", "port286", "port287",
1244};
1245static const char * const xirq_groups[] = {
1246 "xirq0", "xirq1", "xirq2", "xirq3",
1247 "xirq4", "xirq5", "xirq6", "xirq7",
1248 "xirq8", "xirq9", "xirq10", "xirq11",
1249 "xirq12", "xirq13", "xirq14", "xirq15",
1250 "xirq16", "xirq17", "xirq18", "xirq19",
1251 "xirq20", "xirq21", "xirq22", "xirq23",
1252};
1253 895
1254static const struct uniphier_pinmux_function uniphier_ld6b_functions[] = { 896static const struct uniphier_pinmux_function uniphier_ld6b_functions[] = {
1255 UNIPHIER_PINMUX_FUNCTION(adinter), /* Achip-Dchip interconnect */ 897 UNIPHIER_PINMUX_FUNCTION(adinter), /* Achip-Dchip interconnect */
@@ -1270,10 +912,18 @@ static const struct uniphier_pinmux_function uniphier_ld6b_functions[] = {
1270 UNIPHIER_PINMUX_FUNCTION(usb1), 912 UNIPHIER_PINMUX_FUNCTION(usb1),
1271 UNIPHIER_PINMUX_FUNCTION(usb2), 913 UNIPHIER_PINMUX_FUNCTION(usb2),
1272 UNIPHIER_PINMUX_FUNCTION(usb3), 914 UNIPHIER_PINMUX_FUNCTION(usb3),
1273 UNIPHIER_PINMUX_FUNCTION(port),
1274 UNIPHIER_PINMUX_FUNCTION(xirq),
1275}; 915};
1276 916
917static int uniphier_ld6b_get_gpio_muxval(unsigned int pin,
918 unsigned int gpio_offset)
919{
920 if (gpio_offset >= 120 && gpio_offset <= 143) /* XIRQx */
921 /* 15 will do because XIRQ0-23 are aliases of PORT150-177. */
922 return 14;
923
924 return 15;
925}
926
1277static struct uniphier_pinctrl_socdata uniphier_ld6b_pindata = { 927static struct uniphier_pinctrl_socdata uniphier_ld6b_pindata = {
1278 .pins = uniphier_ld6b_pins, 928 .pins = uniphier_ld6b_pins,
1279 .npins = ARRAY_SIZE(uniphier_ld6b_pins), 929 .npins = ARRAY_SIZE(uniphier_ld6b_pins),
@@ -1281,6 +931,7 @@ static struct uniphier_pinctrl_socdata uniphier_ld6b_pindata = {
1281 .groups_count = ARRAY_SIZE(uniphier_ld6b_groups), 931 .groups_count = ARRAY_SIZE(uniphier_ld6b_groups),
1282 .functions = uniphier_ld6b_functions, 932 .functions = uniphier_ld6b_functions,
1283 .functions_count = ARRAY_SIZE(uniphier_ld6b_functions), 933 .functions_count = ARRAY_SIZE(uniphier_ld6b_functions),
934 .get_gpio_muxval = uniphier_ld6b_get_gpio_muxval,
1284 .caps = 0, 935 .caps = 0,
1285}; 936};
1286 937
@@ -1299,6 +950,7 @@ static struct platform_driver uniphier_ld6b_pinctrl_driver = {
1299 .driver = { 950 .driver = {
1300 .name = "uniphier-ld6b-pinctrl", 951 .name = "uniphier-ld6b-pinctrl",
1301 .of_match_table = uniphier_ld6b_pinctrl_match, 952 .of_match_table = uniphier_ld6b_pinctrl_match,
953 .pm = &uniphier_pinctrl_pm_ops,
1302 }, 954 },
1303}; 955};
1304builtin_platform_driver(uniphier_ld6b_pinctrl_driver); 956builtin_platform_driver(uniphier_ld6b_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
index c75e094b2d90..603204a00213 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
@@ -1086,87 +1086,38 @@ static const unsigned usb2_pins[] = {184, 185};
1086static const int usb2_muxvals[] = {0, 0}; 1086static const int usb2_muxvals[] = {0, 0};
1087static const unsigned usb3_pins[] = {187, 188}; 1087static const unsigned usb3_pins[] = {187, 188};
1088static const int usb3_muxvals[] = {0, 0}; 1088static const int usb3_muxvals[] = {0, 0};
1089static const unsigned port_range0_pins[] = { 1089static const unsigned int gpio_range_pins[] = {
1090 300, 301, 302, 303, 304, 305, 306, 307, /* PORT0x */ 1090 300, 301, 302, 303, 304, 305, 306, 307, /* PORT0x */
1091 308, 309, 310, 311, 312, 313, 314, 315, /* PORT1x */ 1091 308, 309, 310, 311, 312, 313, 314, 315, /* PORT1x */
1092 316, 317, 318, 16, 17, 18, 19, 20, /* PORT2x */ 1092 316, 317, 318, 16, 17, 18, 19, 20, /* PORT2x */
1093 21, 22, 23, 4, 93, 94, 95, 63, /* PORT3x */ 1093 21, 22, 23, 4, 93, 94, 95, 63, /* PORT3x */
1094 123, 122, 124, 125, 126, 141, 202, 203, /* PORT4x */ 1094 123, 122, 124, 125, 126, 141, 202, 203, /* PORT4x */
1095 204, 226, 227, 290, 291, 233, 280, 281, /* PORT5x */ 1095 204, 226, 227, 290, 291, 233, 280, 281, /* PORT5x */
1096 8, 7, 10, 29, 30, 48, 49, 50, /* PORT6x */ 1096 8, 7, 10, 29, 30, 48, 49, 50, /* PORT6x */
1097 40, 41, 42, 43, 44, 45, 46, 47, /* PORT7x */ 1097 40, 41, 42, 43, 44, 45, 46, 47, /* PORT7x */
1098 54, 51, 52, 53, 127, 128, 129, 130, /* PORT8x */ 1098 54, 51, 52, 53, 127, 128, 129, 130, /* PORT8x */
1099 131, 132, 57, 60, 134, 133, 135, 136, /* PORT9x */ 1099 131, 132, 57, 60, 134, 133, 135, 136, /* PORT9x */
1100 138, 137, 140, 139, 64, 65, 66, 67, /* PORT10x */ 1100 138, 137, 140, 139, 64, 65, 66, 67, /* PORT10x */
1101 107, 106, 105, 104, 113, 112, 111, 110, /* PORT11x */ 1101 107, 106, 105, 104, 113, 112, 111, 110, /* PORT11x */
1102 68, 69, 70, 71, 72, 73, 74, 75, /* PORT12x */ 1102 68, 69, 70, 71, 72, 73, 74, 75, /* PORT12x */
1103 76, 77, 78, 79, 80, 81, 82, 83, /* PORT13x */ 1103 76, 77, 78, 79, 80, 81, 82, 83, /* PORT13x */
1104 84, 85, 86, 87, 88, 89, 90, 91, /* PORT14x */ 1104 84, 85, 86, 87, 88, 89, 90, 91, /* PORT14x */
1105}; 1105 11, 9, 12, 96, 97, 98, 108, 114, /* XIRQ0-7 */
1106static const int port_range0_muxvals[] = { 1106 234, 186, 99, 100, 101, 102, 300, 301, /* XIRQ8-15 */
1107 7, 7, 7, 7, 7, 7, 7, 7, /* PORT0x */ 1107 302, 303, 304, 305, 306, 13, 14, 15, /* XIRQ16-20, PORT175-177 */
1108 7, 7, 7, 7, 7, 7, 7, 7, /* PORT1x */ 1108 157, 158, 156, 154, 150, 151, 152, 153, /* PORT18x */
1109 7, 7, 7, 7, 7, 7, 7, 7, /* PORT2x */ 1109 326, 327, 325, 323, 319, 320, 321, 322, /* PORT19x */
1110 7, 7, 7, 7, 7, 7, 7, 7, /* PORT3x */ 1110 160, 161, 162, 163, 164, 165, 166, 167, /* PORT20x */
1111 7, 7, 7, 7, 7, 7, 7, 7, /* PORT4x */ 1111 168, 169, 170, 171, 172, 173, 174, 175, /* PORT21x */
1112 7, 7, 7, 7, 7, 7, 7, 7, /* PORT5x */ 1112 180, 181, 182, 183, 184, 185, 187, 188, /* PORT22x */
1113 7, 7, 7, 7, 7, 7, 7, 7, /* PORT6x */ 1113 193, 194, 195, 196, 197, 198, 199, 200, /* PORT23x */
1114 7, 7, 7, 7, 7, 7, 7, 7, /* PORT7x */ 1114 191, 192, 215, 216, 217, 218, 219, 220, /* PORT24x */
1115 7, 7, 7, 7, 7, 7, 7, 7, /* PORT8x */ 1115 222, 223, 224, 225, 228, 229, 230, 231, /* PORT25x */
1116 7, 7, 7, 7, 7, 7, 7, 7, /* PORT9x */ 1116 282, 283, 284, 285, 286, 287, 288, 289, /* PORT26x */
1117 7, 7, 7, 7, 7, 7, 7, 7, /* PORT10x */ 1117 292, 293, 294, 295, 296, 236, 237, 238, /* PORT27x */
1118 7, 7, 7, 7, 7, 7, 7, 7, /* PORT11x */ 1118 275, 276, 277, 278, 239, 240, 249, 250, /* PORT28x */
1119 7, 7, 7, 7, 7, 7, 7, 7, /* PORT12x */ 1119 251, 252, 261, 262, 263, 264, 273, 274, /* PORT29x */
1120 7, 7, 7, 7, 7, 7, 7, 7, /* PORT13x */ 1120 31, 32, 33, 34, 35, 36, 37, 38, /* PORT30x */
1121 7, 7, 7, 7, 7, 7, 7, 7, /* PORT14x */
1122};
1123static const unsigned port_range1_pins[] = {
1124 13, 14, 15, /* PORT175-177 */
1125 157, 158, 156, 154, 150, 151, 152, 153, /* PORT18x */
1126 326, 327, 325, 323, 319, 320, 321, 322, /* PORT19x */
1127 160, 161, 162, 163, 164, 165, 166, 167, /* PORT20x */
1128 168, 169, 170, 171, 172, 173, 174, 175, /* PORT21x */
1129 180, 181, 182, 183, 184, 185, 187, 188, /* PORT22x */
1130 193, 194, 195, 196, 197, 198, 199, 200, /* PORT23x */
1131 191, 192, 215, 216, 217, 218, 219, 220, /* PORT24x */
1132 222, 223, 224, 225, 228, 229, 230, 231, /* PORT25x */
1133 282, 283, 284, 285, 286, 287, 288, 289, /* PORT26x */
1134 292, 293, 294, 295, 296, 236, 237, 238, /* PORT27x */
1135 275, 276, 277, 278, 239, 240, 249, 250, /* PORT28x */
1136 251, 252, 261, 262, 263, 264, 273, 274, /* PORT29x */
1137 31, 32, 33, 34, 35, 36, 37, 38, /* PORT30x */
1138};
1139static const int port_range1_muxvals[] = {
1140 7, 7, 7, /* PORT175-177 */
1141 7, 7, 7, 7, 7, 7, 7, 7, /* PORT18x */
1142 7, 7, 7, 7, 7, 7, 7, 7, /* PORT19x */
1143 7, 7, 7, 7, 7, 7, 7, 7, /* PORT20x */
1144 7, 7, 7, 7, 7, 7, 7, 7, /* PORT21x */
1145 7, 7, 7, 7, 7, 7, 7, 7, /* PORT22x */
1146 7, 7, 7, 7, 7, 7, 7, 7, /* PORT23x */
1147 7, 7, 7, 7, 7, 7, 7, 7, /* PORT24x */
1148 7, 7, 7, 7, 7, 7, 7, 7, /* PORT25x */
1149 7, 7, 7, 7, 7, 7, 7, 7, /* PORT26x */
1150 7, 7, 7, 7, 7, 7, 7, 7, /* PORT27x */
1151 7, 7, 7, 7, 7, 7, 7, 7, /* PORT28x */
1152 7, 7, 7, 7, 7, 7, 7, 7, /* PORT29x */
1153 7, 7, 7, 7, 7, 7, 7, 7, /* PORT30x */
1154};
1155static const unsigned xirq_pins[] = {
1156 11, 9, 12, 96, 97, 98, 108, 114, /* XIRQ0-7 */
1157 234, 186, 99, 100, 101, 102, 184, 301, /* XIRQ8-15 */
1158 302, 303, 304, 305, 306, /* XIRQ16-20 */
1159};
1160static const int xirq_muxvals[] = {
1161 7, 7, 7, 7, 7, 7, 7, 7, /* XIRQ0-7 */
1162 7, 7, 7, 7, 7, 7, 2, 2, /* XIRQ8-15 */
1163 2, 2, 2, 2, 2, /* XIRQ16-20 */
1164};
1165static const unsigned xirq_alternatives_pins[] = {
1166 184, 310, 316,
1167};
1168static const int xirq_alternatives_muxvals[] = {
1169 2, 2, 2,
1170}; 1121};
1171 1122
1172static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = { 1123static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
@@ -1202,267 +1153,13 @@ static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
1202 UNIPHIER_PINCTRL_GROUP(usb1), 1153 UNIPHIER_PINCTRL_GROUP(usb1),
1203 UNIPHIER_PINCTRL_GROUP(usb2), 1154 UNIPHIER_PINCTRL_GROUP(usb2),
1204 UNIPHIER_PINCTRL_GROUP(usb3), 1155 UNIPHIER_PINCTRL_GROUP(usb3),
1205 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 1156 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range),
1206 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1),
1207 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
1208 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_alternatives),
1209 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
1210 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
1211 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
1212 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
1213 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
1214 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
1215 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
1216 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
1217 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
1218 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
1219 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
1220 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
1221 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
1222 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
1223 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
1224 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
1225 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
1226 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
1227 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
1228 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
1229 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
1230 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
1231 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
1232 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
1233 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
1234 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
1235 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
1236 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
1237 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
1238 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
1239 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
1240 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
1241 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
1242 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
1243 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
1244 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
1245 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
1246 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
1247 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
1248 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
1249 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
1250 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
1251 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
1252 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
1253 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
1254 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
1255 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
1256 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
1257 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
1258 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
1259 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
1260 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
1261 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
1262 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
1263 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
1264 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
1265 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
1266 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
1267 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
1268 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
1269 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
1270 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
1271 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
1272 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
1273 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
1274 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
1275 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
1276 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
1277 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
1278 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
1279 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
1280 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
1281 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
1282 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
1283 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
1284 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
1285 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
1286 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
1287 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
1288 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
1289 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
1290 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
1291 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
1292 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
1293 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
1294 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
1295 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
1296 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
1297 UNIPHIER_PINCTRL_GROUP_SINGLE(port110, port_range0, 88),
1298 UNIPHIER_PINCTRL_GROUP_SINGLE(port111, port_range0, 89),
1299 UNIPHIER_PINCTRL_GROUP_SINGLE(port112, port_range0, 90),
1300 UNIPHIER_PINCTRL_GROUP_SINGLE(port113, port_range0, 91),
1301 UNIPHIER_PINCTRL_GROUP_SINGLE(port114, port_range0, 92),
1302 UNIPHIER_PINCTRL_GROUP_SINGLE(port115, port_range0, 93),
1303 UNIPHIER_PINCTRL_GROUP_SINGLE(port116, port_range0, 94),
1304 UNIPHIER_PINCTRL_GROUP_SINGLE(port117, port_range0, 95),
1305 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range0, 96),
1306 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range0, 97),
1307 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range0, 98),
1308 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range0, 99),
1309 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range0, 100),
1310 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range0, 101),
1311 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range0, 102),
1312 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range0, 103),
1313 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range0, 104),
1314 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range0, 105),
1315 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range0, 106),
1316 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range0, 107),
1317 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range0, 108),
1318 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range0, 109),
1319 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range0, 110),
1320 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range0, 111),
1321 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range0, 112),
1322 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range0, 113),
1323 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range0, 114),
1324 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range0, 115),
1325 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range0, 116),
1326 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range0, 117),
1327 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range0, 118),
1328 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range0, 119),
1329 UNIPHIER_PINCTRL_GROUP_SINGLE(port175, port_range1, 0),
1330 UNIPHIER_PINCTRL_GROUP_SINGLE(port176, port_range1, 1),
1331 UNIPHIER_PINCTRL_GROUP_SINGLE(port177, port_range1, 2),
1332 UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range1, 3),
1333 UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range1, 4),
1334 UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range1, 5),
1335 UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range1, 6),
1336 UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range1, 7),
1337 UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range1, 8),
1338 UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range1, 9),
1339 UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range1, 10),
1340 UNIPHIER_PINCTRL_GROUP_SINGLE(port190, port_range1, 11),
1341 UNIPHIER_PINCTRL_GROUP_SINGLE(port191, port_range1, 12),
1342 UNIPHIER_PINCTRL_GROUP_SINGLE(port192, port_range1, 13),
1343 UNIPHIER_PINCTRL_GROUP_SINGLE(port193, port_range1, 14),
1344 UNIPHIER_PINCTRL_GROUP_SINGLE(port194, port_range1, 15),
1345 UNIPHIER_PINCTRL_GROUP_SINGLE(port195, port_range1, 16),
1346 UNIPHIER_PINCTRL_GROUP_SINGLE(port196, port_range1, 17),
1347 UNIPHIER_PINCTRL_GROUP_SINGLE(port197, port_range1, 18),
1348 UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range1, 19),
1349 UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range1, 20),
1350 UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range1, 21),
1351 UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range1, 22),
1352 UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range1, 23),
1353 UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range1, 24),
1354 UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range1, 25),
1355 UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range1, 26),
1356 UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range1, 27),
1357 UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range1, 28),
1358 UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range1, 29),
1359 UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range1, 30),
1360 UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range1, 31),
1361 UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range1, 32),
1362 UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range1, 33),
1363 UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range1, 34),
1364 UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range1, 35),
1365 UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range1, 36),
1366 UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range1, 37),
1367 UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range1, 38),
1368 UNIPHIER_PINCTRL_GROUP_SINGLE(port224, port_range1, 39),
1369 UNIPHIER_PINCTRL_GROUP_SINGLE(port225, port_range1, 40),
1370 UNIPHIER_PINCTRL_GROUP_SINGLE(port226, port_range1, 41),
1371 UNIPHIER_PINCTRL_GROUP_SINGLE(port227, port_range1, 42),
1372 UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range1, 43),
1373 UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range1, 44),
1374 UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range1, 45),
1375 UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range1, 46),
1376 UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range1, 47),
1377 UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range1, 48),
1378 UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range1, 49),
1379 UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range1, 50),
1380 UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range1, 51),
1381 UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range1, 52),
1382 UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range1, 53),
1383 UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range1, 54),
1384 UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range1, 55),
1385 UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range1, 56),
1386 UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range1, 57),
1387 UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range1, 58),
1388 UNIPHIER_PINCTRL_GROUP_SINGLE(port250, port_range1, 59),
1389 UNIPHIER_PINCTRL_GROUP_SINGLE(port251, port_range1, 60),
1390 UNIPHIER_PINCTRL_GROUP_SINGLE(port252, port_range1, 61),
1391 UNIPHIER_PINCTRL_GROUP_SINGLE(port253, port_range1, 62),
1392 UNIPHIER_PINCTRL_GROUP_SINGLE(port254, port_range1, 63),
1393 UNIPHIER_PINCTRL_GROUP_SINGLE(port255, port_range1, 64),
1394 UNIPHIER_PINCTRL_GROUP_SINGLE(port256, port_range1, 65),
1395 UNIPHIER_PINCTRL_GROUP_SINGLE(port257, port_range1, 66),
1396 UNIPHIER_PINCTRL_GROUP_SINGLE(port260, port_range1, 67),
1397 UNIPHIER_PINCTRL_GROUP_SINGLE(port261, port_range1, 68),
1398 UNIPHIER_PINCTRL_GROUP_SINGLE(port262, port_range1, 69),
1399 UNIPHIER_PINCTRL_GROUP_SINGLE(port263, port_range1, 70),
1400 UNIPHIER_PINCTRL_GROUP_SINGLE(port264, port_range1, 71),
1401 UNIPHIER_PINCTRL_GROUP_SINGLE(port265, port_range1, 72),
1402 UNIPHIER_PINCTRL_GROUP_SINGLE(port266, port_range1, 73),
1403 UNIPHIER_PINCTRL_GROUP_SINGLE(port267, port_range1, 74),
1404 UNIPHIER_PINCTRL_GROUP_SINGLE(port270, port_range1, 75),
1405 UNIPHIER_PINCTRL_GROUP_SINGLE(port271, port_range1, 76),
1406 UNIPHIER_PINCTRL_GROUP_SINGLE(port272, port_range1, 77),
1407 UNIPHIER_PINCTRL_GROUP_SINGLE(port273, port_range1, 78),
1408 UNIPHIER_PINCTRL_GROUP_SINGLE(port274, port_range1, 79),
1409 UNIPHIER_PINCTRL_GROUP_SINGLE(port275, port_range1, 80),
1410 UNIPHIER_PINCTRL_GROUP_SINGLE(port276, port_range1, 81),
1411 UNIPHIER_PINCTRL_GROUP_SINGLE(port277, port_range1, 82),
1412 UNIPHIER_PINCTRL_GROUP_SINGLE(port280, port_range1, 83),
1413 UNIPHIER_PINCTRL_GROUP_SINGLE(port281, port_range1, 84),
1414 UNIPHIER_PINCTRL_GROUP_SINGLE(port282, port_range1, 85),
1415 UNIPHIER_PINCTRL_GROUP_SINGLE(port283, port_range1, 86),
1416 UNIPHIER_PINCTRL_GROUP_SINGLE(port284, port_range1, 87),
1417 UNIPHIER_PINCTRL_GROUP_SINGLE(port285, port_range1, 88),
1418 UNIPHIER_PINCTRL_GROUP_SINGLE(port286, port_range1, 89),
1419 UNIPHIER_PINCTRL_GROUP_SINGLE(port287, port_range1, 90),
1420 UNIPHIER_PINCTRL_GROUP_SINGLE(port290, port_range1, 91),
1421 UNIPHIER_PINCTRL_GROUP_SINGLE(port291, port_range1, 92),
1422 UNIPHIER_PINCTRL_GROUP_SINGLE(port292, port_range1, 93),
1423 UNIPHIER_PINCTRL_GROUP_SINGLE(port293, port_range1, 94),
1424 UNIPHIER_PINCTRL_GROUP_SINGLE(port294, port_range1, 95),
1425 UNIPHIER_PINCTRL_GROUP_SINGLE(port295, port_range1, 96),
1426 UNIPHIER_PINCTRL_GROUP_SINGLE(port296, port_range1, 97),
1427 UNIPHIER_PINCTRL_GROUP_SINGLE(port297, port_range1, 98),
1428 UNIPHIER_PINCTRL_GROUP_SINGLE(port300, port_range1, 99),
1429 UNIPHIER_PINCTRL_GROUP_SINGLE(port301, port_range1, 100),
1430 UNIPHIER_PINCTRL_GROUP_SINGLE(port302, port_range1, 101),
1431 UNIPHIER_PINCTRL_GROUP_SINGLE(port303, port_range1, 102),
1432 UNIPHIER_PINCTRL_GROUP_SINGLE(port304, port_range1, 103),
1433 UNIPHIER_PINCTRL_GROUP_SINGLE(port305, port_range1, 104),
1434 UNIPHIER_PINCTRL_GROUP_SINGLE(port306, port_range1, 105),
1435 UNIPHIER_PINCTRL_GROUP_SINGLE(port307, port_range1, 106),
1436 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
1437 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
1438 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
1439 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
1440 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
1441 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
1442 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
1443 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
1444 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
1445 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
1446 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
1447 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
1448 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
1449 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
1450 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
1451 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
1452 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
1453 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
1454 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
1455 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
1456 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
1457 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14b, xirq_alternatives, 0),
1458 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17b, xirq_alternatives, 1),
1459 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18b, xirq_alternatives, 2),
1460}; 1157};
1461 1158
1462static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 1159static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
1463static const char * const ether_mii_groups[] = {"ether_mii"}; 1160static const char * const ether_mii_groups[] = {"ether_mii"};
1464static const char * const ether_rgmii_groups[] = {"ether_rgmii"}; 1161static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
1465static const char * const ether_rmii_groups[] = {"ether_rgmii", "ether_rgmiib"}; 1162static const char * const ether_rmii_groups[] = {"ether_rmii", "ether_rmiib"};
1466static const char * const i2c0_groups[] = {"i2c0"}; 1163static const char * const i2c0_groups[] = {"i2c0"};
1467static const char * const i2c1_groups[] = {"i2c1"}; 1164static const char * const i2c1_groups[] = {"i2c1"};
1468static const char * const i2c2_groups[] = {"i2c2"}; 1165static const char * const i2c2_groups[] = {"i2c2"};
@@ -1488,75 +1185,6 @@ static const char * const usb0_groups[] = {"usb0"};
1488static const char * const usb1_groups[] = {"usb1"}; 1185static const char * const usb1_groups[] = {"usb1"};
1489static const char * const usb2_groups[] = {"usb2"}; 1186static const char * const usb2_groups[] = {"usb2"};
1490static const char * const usb3_groups[] = {"usb3"}; 1187static const char * const usb3_groups[] = {"usb3"};
1491static const char * const port_groups[] = {
1492 "port00", "port01", "port02", "port03",
1493 "port04", "port05", "port06", "port07",
1494 "port10", "port11", "port12", "port13",
1495 "port14", "port15", "port16", "port17",
1496 "port20", "port21", "port22", "port23",
1497 "port24", "port25", "port26", "port27",
1498 "port30", "port31", "port32", "port33",
1499 "port34", "port35", "port36", "port37",
1500 "port40", "port41", "port42", "port43",
1501 "port44", "port45", "port46", "port47",
1502 "port50", "port51", "port52", "port53",
1503 "port54", "port55", "port56", "port57",
1504 "port60", "port61", "port62", "port63",
1505 "port64", "port65", "port66", "port67",
1506 "port70", "port71", "port72", "port73",
1507 "port74", "port75", "port76", "port77",
1508 "port80", "port81", "port82", "port83",
1509 "port84", "port85", "port86", "port87",
1510 "port90", "port91", "port92", "port93",
1511 "port94", "port95", "port96", "port97",
1512 "port100", "port101", "port102", "port103",
1513 "port104", "port105", "port106", "port107",
1514 "port110", "port111", "port112", "port113",
1515 "port114", "port115", "port116", "port117",
1516 "port120", "port121", "port122", "port123",
1517 "port124", "port125", "port126", "port127",
1518 "port130", "port131", "port132", "port133",
1519 "port134", "port135", "port136", "port137",
1520 "port140", "port141", "port142", "port143",
1521 "port144", "port145", "port146", "port147",
1522 /* port150-174 missing */
1523 /* none */ "port175", "port176", "port177",
1524 "port180", "port181", "port182", "port183",
1525 "port184", "port185", "port186", "port187",
1526 "port190", "port191", "port192", "port193",
1527 "port194", "port195", "port196", "port197",
1528 "port200", "port201", "port202", "port203",
1529 "port204", "port205", "port206", "port207",
1530 "port210", "port211", "port212", "port213",
1531 "port214", "port215", "port216", "port217",
1532 "port220", "port221", "port222", "port223",
1533 "port224", "port225", "port226", "port227",
1534 "port230", "port231", "port232", "port233",
1535 "port234", "port235", "port236", "port237",
1536 "port240", "port241", "port242", "port243",
1537 "port244", "port245", "port246", "port247",
1538 "port250", "port251", "port252", "port253",
1539 "port254", "port255", "port256", "port257",
1540 "port260", "port261", "port262", "port263",
1541 "port264", "port265", "port266", "port267",
1542 "port270", "port271", "port272", "port273",
1543 "port274", "port275", "port276", "port277",
1544 "port280", "port281", "port282", "port283",
1545 "port284", "port285", "port286", "port287",
1546 "port290", "port291", "port292", "port293",
1547 "port294", "port295", "port296", "port297",
1548 "port300", "port301", "port302", "port303",
1549 "port304", "port305", "port306", "port307",
1550};
1551static const char * const xirq_groups[] = {
1552 "xirq0", "xirq1", "xirq2", "xirq3",
1553 "xirq4", "xirq5", "xirq6", "xirq7",
1554 "xirq8", "xirq9", "xirq10", "xirq11",
1555 "xirq12", "xirq13", "xirq14", "xirq15",
1556 "xirq16", "xirq17", "xirq18", "xirq19",
1557 "xirq20",
1558 "xirq14b", "xirq17b", "xirq18b",
1559};
1560 1188
1561static const struct uniphier_pinmux_function uniphier_pro4_functions[] = { 1189static const struct uniphier_pinmux_function uniphier_pro4_functions[] = {
1562 UNIPHIER_PINMUX_FUNCTION(emmc), 1190 UNIPHIER_PINMUX_FUNCTION(emmc),
@@ -1580,10 +1208,17 @@ static const struct uniphier_pinmux_function uniphier_pro4_functions[] = {
1580 UNIPHIER_PINMUX_FUNCTION(usb1), 1208 UNIPHIER_PINMUX_FUNCTION(usb1),
1581 UNIPHIER_PINMUX_FUNCTION(usb2), 1209 UNIPHIER_PINMUX_FUNCTION(usb2),
1582 UNIPHIER_PINMUX_FUNCTION(usb3), 1210 UNIPHIER_PINMUX_FUNCTION(usb3),
1583 UNIPHIER_PINMUX_FUNCTION(port),
1584 UNIPHIER_PINMUX_FUNCTION(xirq),
1585}; 1211};
1586 1212
1213static int uniphier_pro4_get_gpio_muxval(unsigned int pin,
1214 unsigned int gpio_offset)
1215{
1216 if (gpio_offset >= 134 && gpio_offset <= 140) /* XIRQ14-20 */
1217 return 2;
1218
1219 return 7;
1220}
1221
1587static struct uniphier_pinctrl_socdata uniphier_pro4_pindata = { 1222static struct uniphier_pinctrl_socdata uniphier_pro4_pindata = {
1588 .pins = uniphier_pro4_pins, 1223 .pins = uniphier_pro4_pins,
1589 .npins = ARRAY_SIZE(uniphier_pro4_pins), 1224 .npins = ARRAY_SIZE(uniphier_pro4_pins),
@@ -1591,6 +1226,7 @@ static struct uniphier_pinctrl_socdata uniphier_pro4_pindata = {
1591 .groups_count = ARRAY_SIZE(uniphier_pro4_groups), 1226 .groups_count = ARRAY_SIZE(uniphier_pro4_groups),
1592 .functions = uniphier_pro4_functions, 1227 .functions = uniphier_pro4_functions,
1593 .functions_count = ARRAY_SIZE(uniphier_pro4_functions), 1228 .functions_count = ARRAY_SIZE(uniphier_pro4_functions),
1229 .get_gpio_muxval = uniphier_pro4_get_gpio_muxval,
1594 .caps = UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE, 1230 .caps = UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE,
1595}; 1231};
1596 1232
@@ -1609,6 +1245,7 @@ static struct platform_driver uniphier_pro4_pinctrl_driver = {
1609 .driver = { 1245 .driver = {
1610 .name = "uniphier-pro4-pinctrl", 1246 .name = "uniphier-pro4-pinctrl",
1611 .of_match_table = uniphier_pro4_pinctrl_match, 1247 .of_match_table = uniphier_pro4_pinctrl_match,
1248 .pm = &uniphier_pinctrl_pm_ops,
1612 }, 1249 },
1613}; 1250};
1614builtin_platform_driver(uniphier_pro4_pinctrl_driver); 1251builtin_platform_driver(uniphier_pro4_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
index 04d00c398eaf..9381a4ff4389 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
@@ -854,87 +854,38 @@ static const unsigned usb1_pins[] = {126, 127};
854static const int usb1_muxvals[] = {0, 0}; 854static const int usb1_muxvals[] = {0, 0};
855static const unsigned usb2_pins[] = {128, 129}; 855static const unsigned usb2_pins[] = {128, 129};
856static const int usb2_muxvals[] = {0, 0}; 856static const int usb2_muxvals[] = {0, 0};
857static const unsigned port_range0_pins[] = { 857static const unsigned int gpio_range_pins[] = {
858 89, 90, 91, 92, 93, 94, 95, 96, /* PORT0x */ 858 89, 90, 91, 92, 93, 94, 95, 96, /* PORT0x */
859 97, 98, 99, 100, 101, 102, 103, 104, /* PORT1x */ 859 97, 98, 99, 100, 101, 102, 103, 104, /* PORT1x */
860 251, 252, 253, 254, 255, 247, 248, 249, /* PORT2x */ 860 251, 252, 253, 254, 255, 247, 248, 249, /* PORT2x */
861 39, 40, 41, 42, 43, 44, 45, 46, /* PORT3x */ 861 39, 40, 41, 42, 43, 44, 45, 46, /* PORT3x */
862 156, 157, 158, 159, 160, 161, 162, 163, /* PORT4x */ 862 156, 157, 158, 159, 160, 161, 162, 163, /* PORT4x */
863 164, 165, 166, 167, 168, 169, 170, 171, /* PORT5x */ 863 164, 165, 166, 167, 168, 169, 170, 171, /* PORT5x */
864 190, 191, 192, 193, 194, 195, 196, 197, /* PORT6x */ 864 190, 191, 192, 193, 194, 195, 196, 197, /* PORT6x */
865 198, 199, 200, 201, 202, 203, 204, 205, /* PORT7x */ 865 198, 199, 200, 201, 202, 203, 204, 205, /* PORT7x */
866 120, 121, 122, 123, 55, 56, 57, 58, /* PORT8x */ 866 120, 121, 122, 123, 55, 56, 57, 58, /* PORT8x */
867 124, 125, 126, 127, 49, 50, 53, 54, /* PORT9x */ 867 124, 125, 126, 127, 49, 50, 53, 54, /* PORT9x */
868 148, 149, 150, 151, 152, 153, 154, 155, /* PORT10x */ 868 148, 149, 150, 151, 152, 153, 154, 155, /* PORT10x */
869 133, 134, 131, 130, 138, 139, 136, 135, /* PORT11x */ 869 133, 134, 131, 130, 138, 139, 136, 135, /* PORT11x */
870 28, 29, 30, 31, 32, 33, 34, 35, /* PORT12x */ 870 28, 29, 30, 31, 32, 33, 34, 35, /* PORT12x */
871 179, 180, 181, 182, 186, 187, 188, 189, /* PORT13x */ 871 179, 180, 181, 182, 186, 187, 188, 189, /* PORT13x */
872 4, 5, 6, 7, 8, 9, 10, 11, /* PORT14x */ 872 4, 5, 6, 7, 8, 9, 10, 11, /* PORT14x */
873}; 873 68, 69, 70, 71, 72, 73, 74, 75, /* XIRQ0-7 */
874static const int port_range0_muxvals[] = { 874 76, 77, 78, 79, 80, 81, 82, 83, /* XIRQ8-15 */
875 15, 15, 15, 15, 15, 15, 15, 15, /* PORT0x */ 875 84, 85, 86, 87, 88, 109, 110, 111, /* XIRQ16-20, PORT175-177 */
876 15, 15, 15, 15, 15, 15, 15, 15, /* PORT1x */ 876 206, 207, 208, 209, 210, 211, 212, 213, /* PORT18x */
877 15, 15, 15, 15, 15, 15, 15, 15, /* PORT2x */ 877 12, 13, 14, 15, 16, 17, 107, 108, /* PORT19x */
878 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */ 878 140, 141, 142, 143, 144, 145, 146, 147, /* PORT20x */
879 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */ 879 59, 60, 61, 62, 63, 64, 65, 66, /* PORT21x */
880 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */ 880 214, 215, 216, 217, 218, 219, 220, 221, /* PORT22x */
881 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */ 881 222, 223, 224, 225, 226, 227, 228, 229, /* PORT23x */
882 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */ 882 19, 20, 21, 22, 23, 24, 25, 26, /* PORT24x */
883 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */ 883 230, 231, 232, 233, 234, 235, 236, 237, /* PORT25x */
884 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */ 884 239, 240, 241, 242, 243, 244, 245, 246, /* PORT26x */
885 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */ 885 172, 173, 174, 175, 176, 177, 178, 129, /* PORT27x */
886 15, 15, 15, 15, 15, 15, 15, 15, /* PORT11x */ 886 0, 1, 2, 67, 85, 86, 87, 88, /* PORT28x */
887 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */ 887 105, 106, 18, 27, 36, 128, 132, 137, /* PORT29x */
888 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */ 888 183, 184, 185, 84, 47, 48, 51, 52, /* PORT30x */
889 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
890};
891static const unsigned port_range1_pins[] = {
892 109, 110, 111, /* PORT175-177 */
893 206, 207, 208, 209, 210, 211, 212, 213, /* PORT18x */
894 12, 13, 14, 15, 16, 17, 107, 108, /* PORT19x */
895 140, 141, 142, 143, 144, 145, 146, 147, /* PORT20x */
896 59, 60, 61, 62, 63, 64, 65, 66, /* PORT21x */
897 214, 215, 216, 217, 218, 219, 220, 221, /* PORT22x */
898 222, 223, 224, 225, 226, 227, 228, 229, /* PORT23x */
899 19, 20, 21, 22, 23, 24, 25, 26, /* PORT24x */
900 230, 231, 232, 233, 234, 235, 236, 237, /* PORT25x */
901 239, 240, 241, 242, 243, 244, 245, 246, /* PORT26x */
902 172, 173, 174, 175, 176, 177, 178, 129, /* PORT27x */
903 0, 1, 2, 67, 85, 86, 87, 88, /* PORT28x */
904 105, 106, 18, 27, 36, 128, 132, 137, /* PORT29x */
905 183, 184, 185, 84, 47, 48, 51, 52, /* PORT30x */
906};
907static const int port_range1_muxvals[] = {
908 15, 15, 15, /* PORT175-177 */
909 15, 15, 15, 15, 15, 15, 15, 15, /* PORT18x */
910 15, 15, 15, 15, 15, 15, 15, 15, /* PORT19x */
911 15, 15, 15, 15, 15, 15, 15, 15, /* PORT20x */
912 15, 15, 15, 15, 15, 15, 15, 15, /* PORT21x */
913 15, 15, 15, 15, 15, 15, 15, 15, /* PORT22x */
914 15, 15, 15, 15, 15, 15, 15, 15, /* PORT23x */
915 15, 15, 15, 15, 15, 15, 15, 15, /* PORT24x */
916 15, 15, 15, 15, 15, 15, 15, 15, /* PORT25x */
917 15, 15, 15, 15, 15, 15, 15, 15, /* PORT26x */
918 15, 15, 15, 15, 15, 15, 15, 15, /* PORT27x */
919 15, 15, 15, 15, 15, 15, 15, 15, /* PORT28x */
920 15, 15, 15, 15, 15, 15, 15, 15, /* PORT29x */
921 15, 15, 15, 15, 15, 15, 15, 15, /* PORT30x */
922};
923static const unsigned xirq_pins[] = {
924 68, 69, 70, 71, 72, 73, 74, 75, /* XIRQ0-7 */
925 76, 77, 78, 79, 80, 81, 82, 83, /* XIRQ8-15 */
926 84, 85, 86, 87, 88, /* XIRQ16-20 */
927};
928static const int xirq_muxvals[] = {
929 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
930 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ8-15 */
931 14, 14, 14, 14, 14, /* XIRQ16-20 */
932};
933static const unsigned xirq_alternatives_pins[] = {
934 91, 92, 239, 144, 240, 156, 241, 106, 128,
935};
936static const int xirq_alternatives_muxvals[] = {
937 14, 14, 14, 14, 14, 14, 14, 14, 14,
938}; 889};
939 890
940static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = { 891static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
@@ -968,267 +919,7 @@ static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
968 UNIPHIER_PINCTRL_GROUP(usb0), 919 UNIPHIER_PINCTRL_GROUP(usb0),
969 UNIPHIER_PINCTRL_GROUP(usb1), 920 UNIPHIER_PINCTRL_GROUP(usb1),
970 UNIPHIER_PINCTRL_GROUP(usb2), 921 UNIPHIER_PINCTRL_GROUP(usb2),
971 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 922 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range),
972 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1),
973 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
974 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_alternatives),
975 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
976 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
977 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
978 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
979 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
980 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
981 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
982 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
983 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
984 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
985 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
986 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
987 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
988 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
989 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
990 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
991 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
992 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
993 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
994 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
995 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
996 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
997 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
998 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
999 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
1000 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
1001 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
1002 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
1003 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
1004 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
1005 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
1006 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
1007 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
1008 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
1009 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
1010 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
1011 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
1012 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
1013 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
1014 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
1015 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
1016 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
1017 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
1018 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
1019 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
1020 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
1021 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
1022 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
1023 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
1024 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
1025 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
1026 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
1027 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
1028 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
1029 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
1030 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
1031 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
1032 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
1033 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
1034 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
1035 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
1036 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
1037 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
1038 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
1039 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
1040 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
1041 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
1042 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
1043 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
1044 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
1045 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
1046 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
1047 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
1048 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
1049 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
1050 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
1051 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
1052 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
1053 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
1054 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
1055 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
1056 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
1057 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
1058 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
1059 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
1060 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
1061 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
1062 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
1063 UNIPHIER_PINCTRL_GROUP_SINGLE(port110, port_range0, 88),
1064 UNIPHIER_PINCTRL_GROUP_SINGLE(port111, port_range0, 89),
1065 UNIPHIER_PINCTRL_GROUP_SINGLE(port112, port_range0, 90),
1066 UNIPHIER_PINCTRL_GROUP_SINGLE(port113, port_range0, 91),
1067 UNIPHIER_PINCTRL_GROUP_SINGLE(port114, port_range0, 92),
1068 UNIPHIER_PINCTRL_GROUP_SINGLE(port115, port_range0, 93),
1069 UNIPHIER_PINCTRL_GROUP_SINGLE(port116, port_range0, 94),
1070 UNIPHIER_PINCTRL_GROUP_SINGLE(port117, port_range0, 95),
1071 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range0, 96),
1072 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range0, 97),
1073 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range0, 98),
1074 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range0, 99),
1075 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range0, 100),
1076 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range0, 101),
1077 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range0, 102),
1078 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range0, 103),
1079 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range0, 104),
1080 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range0, 105),
1081 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range0, 106),
1082 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range0, 107),
1083 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range0, 108),
1084 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range0, 109),
1085 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range0, 110),
1086 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range0, 111),
1087 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range0, 112),
1088 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range0, 113),
1089 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range0, 114),
1090 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range0, 115),
1091 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range0, 116),
1092 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range0, 117),
1093 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range0, 118),
1094 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range0, 119),
1095 UNIPHIER_PINCTRL_GROUP_SINGLE(port175, port_range1, 0),
1096 UNIPHIER_PINCTRL_GROUP_SINGLE(port176, port_range1, 1),
1097 UNIPHIER_PINCTRL_GROUP_SINGLE(port177, port_range1, 2),
1098 UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range1, 3),
1099 UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range1, 4),
1100 UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range1, 5),
1101 UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range1, 6),
1102 UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range1, 7),
1103 UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range1, 8),
1104 UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range1, 9),
1105 UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range1, 10),
1106 UNIPHIER_PINCTRL_GROUP_SINGLE(port190, port_range1, 11),
1107 UNIPHIER_PINCTRL_GROUP_SINGLE(port191, port_range1, 12),
1108 UNIPHIER_PINCTRL_GROUP_SINGLE(port192, port_range1, 13),
1109 UNIPHIER_PINCTRL_GROUP_SINGLE(port193, port_range1, 14),
1110 UNIPHIER_PINCTRL_GROUP_SINGLE(port194, port_range1, 15),
1111 UNIPHIER_PINCTRL_GROUP_SINGLE(port195, port_range1, 16),
1112 UNIPHIER_PINCTRL_GROUP_SINGLE(port196, port_range1, 17),
1113 UNIPHIER_PINCTRL_GROUP_SINGLE(port197, port_range1, 18),
1114 UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range1, 19),
1115 UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range1, 20),
1116 UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range1, 21),
1117 UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range1, 22),
1118 UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range1, 23),
1119 UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range1, 24),
1120 UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range1, 25),
1121 UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range1, 26),
1122 UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range1, 27),
1123 UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range1, 28),
1124 UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range1, 29),
1125 UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range1, 30),
1126 UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range1, 31),
1127 UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range1, 32),
1128 UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range1, 33),
1129 UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range1, 34),
1130 UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range1, 35),
1131 UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range1, 36),
1132 UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range1, 37),
1133 UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range1, 38),
1134 UNIPHIER_PINCTRL_GROUP_SINGLE(port224, port_range1, 39),
1135 UNIPHIER_PINCTRL_GROUP_SINGLE(port225, port_range1, 40),
1136 UNIPHIER_PINCTRL_GROUP_SINGLE(port226, port_range1, 41),
1137 UNIPHIER_PINCTRL_GROUP_SINGLE(port227, port_range1, 42),
1138 UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range1, 43),
1139 UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range1, 44),
1140 UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range1, 45),
1141 UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range1, 46),
1142 UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range1, 47),
1143 UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range1, 48),
1144 UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range1, 49),
1145 UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range1, 50),
1146 UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range1, 51),
1147 UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range1, 52),
1148 UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range1, 53),
1149 UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range1, 54),
1150 UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range1, 55),
1151 UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range1, 56),
1152 UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range1, 57),
1153 UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range1, 58),
1154 UNIPHIER_PINCTRL_GROUP_SINGLE(port250, port_range1, 59),
1155 UNIPHIER_PINCTRL_GROUP_SINGLE(port251, port_range1, 60),
1156 UNIPHIER_PINCTRL_GROUP_SINGLE(port252, port_range1, 61),
1157 UNIPHIER_PINCTRL_GROUP_SINGLE(port253, port_range1, 62),
1158 UNIPHIER_PINCTRL_GROUP_SINGLE(port254, port_range1, 63),
1159 UNIPHIER_PINCTRL_GROUP_SINGLE(port255, port_range1, 64),
1160 UNIPHIER_PINCTRL_GROUP_SINGLE(port256, port_range1, 65),
1161 UNIPHIER_PINCTRL_GROUP_SINGLE(port257, port_range1, 66),
1162 UNIPHIER_PINCTRL_GROUP_SINGLE(port260, port_range1, 67),
1163 UNIPHIER_PINCTRL_GROUP_SINGLE(port261, port_range1, 68),
1164 UNIPHIER_PINCTRL_GROUP_SINGLE(port262, port_range1, 69),
1165 UNIPHIER_PINCTRL_GROUP_SINGLE(port263, port_range1, 70),
1166 UNIPHIER_PINCTRL_GROUP_SINGLE(port264, port_range1, 71),
1167 UNIPHIER_PINCTRL_GROUP_SINGLE(port265, port_range1, 72),
1168 UNIPHIER_PINCTRL_GROUP_SINGLE(port266, port_range1, 73),
1169 UNIPHIER_PINCTRL_GROUP_SINGLE(port267, port_range1, 74),
1170 UNIPHIER_PINCTRL_GROUP_SINGLE(port270, port_range1, 75),
1171 UNIPHIER_PINCTRL_GROUP_SINGLE(port271, port_range1, 76),
1172 UNIPHIER_PINCTRL_GROUP_SINGLE(port272, port_range1, 77),
1173 UNIPHIER_PINCTRL_GROUP_SINGLE(port273, port_range1, 78),
1174 UNIPHIER_PINCTRL_GROUP_SINGLE(port274, port_range1, 79),
1175 UNIPHIER_PINCTRL_GROUP_SINGLE(port275, port_range1, 80),
1176 UNIPHIER_PINCTRL_GROUP_SINGLE(port276, port_range1, 81),
1177 UNIPHIER_PINCTRL_GROUP_SINGLE(port277, port_range1, 82),
1178 UNIPHIER_PINCTRL_GROUP_SINGLE(port280, port_range1, 83),
1179 UNIPHIER_PINCTRL_GROUP_SINGLE(port281, port_range1, 84),
1180 UNIPHIER_PINCTRL_GROUP_SINGLE(port282, port_range1, 85),
1181 UNIPHIER_PINCTRL_GROUP_SINGLE(port283, port_range1, 86),
1182 UNIPHIER_PINCTRL_GROUP_SINGLE(port284, port_range1, 87),
1183 UNIPHIER_PINCTRL_GROUP_SINGLE(port285, port_range1, 88),
1184 UNIPHIER_PINCTRL_GROUP_SINGLE(port286, port_range1, 89),
1185 UNIPHIER_PINCTRL_GROUP_SINGLE(port287, port_range1, 90),
1186 UNIPHIER_PINCTRL_GROUP_SINGLE(port290, port_range1, 91),
1187 UNIPHIER_PINCTRL_GROUP_SINGLE(port291, port_range1, 92),
1188 UNIPHIER_PINCTRL_GROUP_SINGLE(port292, port_range1, 93),
1189 UNIPHIER_PINCTRL_GROUP_SINGLE(port293, port_range1, 94),
1190 UNIPHIER_PINCTRL_GROUP_SINGLE(port294, port_range1, 95),
1191 UNIPHIER_PINCTRL_GROUP_SINGLE(port295, port_range1, 96),
1192 UNIPHIER_PINCTRL_GROUP_SINGLE(port296, port_range1, 97),
1193 UNIPHIER_PINCTRL_GROUP_SINGLE(port297, port_range1, 98),
1194 UNIPHIER_PINCTRL_GROUP_SINGLE(port300, port_range1, 99),
1195 UNIPHIER_PINCTRL_GROUP_SINGLE(port301, port_range1, 100),
1196 UNIPHIER_PINCTRL_GROUP_SINGLE(port302, port_range1, 101),
1197 UNIPHIER_PINCTRL_GROUP_SINGLE(port303, port_range1, 102),
1198 UNIPHIER_PINCTRL_GROUP_SINGLE(port304, port_range1, 103),
1199 UNIPHIER_PINCTRL_GROUP_SINGLE(port305, port_range1, 104),
1200 UNIPHIER_PINCTRL_GROUP_SINGLE(port306, port_range1, 105),
1201 UNIPHIER_PINCTRL_GROUP_SINGLE(port307, port_range1, 106),
1202 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
1203 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
1204 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
1205 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
1206 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
1207 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
1208 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
1209 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
1210 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
1211 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
1212 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
1213 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
1214 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
1215 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
1216 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
1217 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
1218 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
1219 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
1220 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
1221 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
1222 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
1223 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3b, xirq_alternatives, 0),
1224 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4b, xirq_alternatives, 1),
1225 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16b, xirq_alternatives, 2),
1226 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17b, xirq_alternatives, 3),
1227 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17c, xirq_alternatives, 4),
1228 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18b, xirq_alternatives, 5),
1229 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18c, xirq_alternatives, 6),
1230 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19b, xirq_alternatives, 7),
1231 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20b, xirq_alternatives, 8),
1232}; 923};
1233 924
1234static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 925static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
@@ -1256,76 +947,6 @@ static const char * const uart3_groups[] = {"uart3"};
1256static const char * const usb0_groups[] = {"usb0"}; 947static const char * const usb0_groups[] = {"usb0"};
1257static const char * const usb1_groups[] = {"usb1"}; 948static const char * const usb1_groups[] = {"usb1"};
1258static const char * const usb2_groups[] = {"usb2"}; 949static const char * const usb2_groups[] = {"usb2"};
1259static const char * const port_groups[] = {
1260 "port00", "port01", "port02", "port03",
1261 "port04", "port05", "port06", "port07",
1262 "port10", "port11", "port12", "port13",
1263 "port14", "port15", "port16", "port17",
1264 "port20", "port21", "port22", "port23",
1265 "port24", "port25", "port26", "port27",
1266 "port30", "port31", "port32", "port33",
1267 "port34", "port35", "port36", "port37",
1268 "port40", "port41", "port42", "port43",
1269 "port44", "port45", "port46", "port47",
1270 "port50", "port51", "port52", "port53",
1271 "port54", "port55", "port56", "port57",
1272 "port60", "port61", "port62", "port63",
1273 "port64", "port65", "port66", "port67",
1274 "port70", "port71", "port72", "port73",
1275 "port74", "port75", "port76", "port77",
1276 "port80", "port81", "port82", "port83",
1277 "port84", "port85", "port86", "port87",
1278 "port90", "port91", "port92", "port93",
1279 "port94", "port95", "port96", "port97",
1280 "port100", "port101", "port102", "port103",
1281 "port104", "port105", "port106", "port107",
1282 "port110", "port111", "port112", "port113",
1283 "port114", "port115", "port116", "port117",
1284 "port120", "port121", "port122", "port123",
1285 "port124", "port125", "port126", "port127",
1286 "port130", "port131", "port132", "port133",
1287 "port134", "port135", "port136", "port137",
1288 "port140", "port141", "port142", "port143",
1289 "port144", "port145", "port146", "port147",
1290 /* port150-174 missing */
1291 /* none */ "port175", "port176", "port177",
1292 "port180", "port181", "port182", "port183",
1293 "port184", "port185", "port186", "port187",
1294 "port190", "port191", "port192", "port193",
1295 "port194", "port195", "port196", "port197",
1296 "port200", "port201", "port202", "port203",
1297 "port204", "port205", "port206", "port207",
1298 "port210", "port211", "port212", "port213",
1299 "port214", "port215", "port216", "port217",
1300 "port220", "port221", "port222", "port223",
1301 "port224", "port225", "port226", "port227",
1302 "port230", "port231", "port232", "port233",
1303 "port234", "port235", "port236", "port237",
1304 "port240", "port241", "port242", "port243",
1305 "port244", "port245", "port246", "port247",
1306 "port250", "port251", "port252", "port253",
1307 "port254", "port255", "port256", "port257",
1308 "port260", "port261", "port262", "port263",
1309 "port264", "port265", "port266", "port267",
1310 "port270", "port271", "port272", "port273",
1311 "port274", "port275", "port276", "port277",
1312 "port280", "port281", "port282", "port283",
1313 "port284", "port285", "port286", "port287",
1314 "port290", "port291", "port292", "port293",
1315 "port294", "port295", "port296", "port297",
1316 "port300", "port301", "port302", "port303",
1317 "port304", "port305", "port306", "port307",
1318};
1319static const char * const xirq_groups[] = {
1320 "xirq0", "xirq1", "xirq2", "xirq3",
1321 "xirq4", "xirq5", "xirq6", "xirq7",
1322 "xirq8", "xirq9", "xirq10", "xirq11",
1323 "xirq12", "xirq13", "xirq14", "xirq15",
1324 "xirq16", "xirq17", "xirq18", "xirq19",
1325 "xirq20",
1326 "xirq3b", "xirq4b", "xirq16b", "xirq17b", "xirq17c",
1327 "xirq18b", "xirq18c", "xirq19b", "xirq20b",
1328};
1329 950
1330static const struct uniphier_pinmux_function uniphier_pro5_functions[] = { 951static const struct uniphier_pinmux_function uniphier_pro5_functions[] = {
1331 UNIPHIER_PINMUX_FUNCTION(emmc), 952 UNIPHIER_PINMUX_FUNCTION(emmc),
@@ -1345,10 +966,17 @@ static const struct uniphier_pinmux_function uniphier_pro5_functions[] = {
1345 UNIPHIER_PINMUX_FUNCTION(usb0), 966 UNIPHIER_PINMUX_FUNCTION(usb0),
1346 UNIPHIER_PINMUX_FUNCTION(usb1), 967 UNIPHIER_PINMUX_FUNCTION(usb1),
1347 UNIPHIER_PINMUX_FUNCTION(usb2), 968 UNIPHIER_PINMUX_FUNCTION(usb2),
1348 UNIPHIER_PINMUX_FUNCTION(port),
1349 UNIPHIER_PINMUX_FUNCTION(xirq),
1350}; 969};
1351 970
971static int uniphier_pro5_get_gpio_muxval(unsigned int pin,
972 unsigned int gpio_offset)
973{
974 if (gpio_offset >= 120 && gpio_offset <= 141) /* XIRQ0-20 */
975 return 14;
976
977 return 15;
978}
979
1352static struct uniphier_pinctrl_socdata uniphier_pro5_pindata = { 980static struct uniphier_pinctrl_socdata uniphier_pro5_pindata = {
1353 .pins = uniphier_pro5_pins, 981 .pins = uniphier_pro5_pins,
1354 .npins = ARRAY_SIZE(uniphier_pro5_pins), 982 .npins = ARRAY_SIZE(uniphier_pro5_pins),
@@ -1356,6 +984,7 @@ static struct uniphier_pinctrl_socdata uniphier_pro5_pindata = {
1356 .groups_count = ARRAY_SIZE(uniphier_pro5_groups), 984 .groups_count = ARRAY_SIZE(uniphier_pro5_groups),
1357 .functions = uniphier_pro5_functions, 985 .functions = uniphier_pro5_functions,
1358 .functions_count = ARRAY_SIZE(uniphier_pro5_functions), 986 .functions_count = ARRAY_SIZE(uniphier_pro5_functions),
987 .get_gpio_muxval = uniphier_pro5_get_gpio_muxval,
1359 .caps = UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE, 988 .caps = UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE,
1360}; 989};
1361 990
@@ -1374,6 +1003,7 @@ static struct platform_driver uniphier_pro5_pinctrl_driver = {
1374 .driver = { 1003 .driver = {
1375 .name = "uniphier-pro5-pinctrl", 1004 .name = "uniphier-pro5-pinctrl",
1376 .of_match_table = uniphier_pro5_pinctrl_match, 1005 .of_match_table = uniphier_pro5_pinctrl_match,
1006 .pm = &uniphier_pinctrl_pm_ops,
1377 }, 1007 },
1378}; 1008};
1379builtin_platform_driver(uniphier_pro5_pinctrl_driver); 1009builtin_platform_driver(uniphier_pro5_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
index 53b6b774654e..c0ef40ae99a7 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
@@ -790,7 +790,7 @@ static const unsigned usb2_pins[] = {60, 61};
790static const int usb2_muxvals[] = {8, 8}; 790static const int usb2_muxvals[] = {8, 8};
791static const unsigned usb3_pins[] = {62, 63}; 791static const unsigned usb3_pins[] = {62, 63};
792static const int usb3_muxvals[] = {8, 8}; 792static const int usb3_muxvals[] = {8, 8};
793static const unsigned port_range0_pins[] = { 793static const unsigned int gpio_range0_pins[] = {
794 127, 128, 129, 130, 131, 132, 133, 134, /* PORT0x */ 794 127, 128, 129, 130, 131, 132, 133, 134, /* PORT0x */
795 135, 136, 137, 138, 139, 140, 141, 142, /* PORT1x */ 795 135, 136, 137, 138, 139, 140, 141, 142, /* PORT1x */
796 0, 1, 2, 3, 4, 5, 6, 7, /* PORT2x */ 796 0, 1, 2, 3, 4, 5, 6, 7, /* PORT2x */
@@ -803,26 +803,13 @@ static const unsigned port_range0_pins[] = {
803 61, 62, 63, 64, 65, 66, 67, 68, /* PORT9x */ 803 61, 62, 63, 64, 65, 66, 67, 68, /* PORT9x */
804 69, 70, 71, 76, 77, 78, 79, 80, /* PORT10x */ 804 69, 70, 71, 76, 77, 78, 79, 80, /* PORT10x */
805}; 805};
806static const int port_range0_muxvals[] = { 806static const unsigned int gpio_range1_pins[] = {
807 15, 15, 15, 15, 15, 15, 15, 15, /* PORT0x */
808 15, 15, 15, 15, 15, 15, 15, 15, /* PORT1x */
809 15, 15, 15, 15, 15, 15, 15, 15, /* PORT2x */
810 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */
811 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */
812 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */
813 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */
814 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */
815 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */
816 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */
817 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */
818};
819static const unsigned port_range1_pins[] = {
820 81, 82, 83, 84, 85, 86, 87, 88, /* PORT12x */ 807 81, 82, 83, 84, 85, 86, 87, 88, /* PORT12x */
821 89, 90, 95, 96, 97, 98, 99, 100, /* PORT13x */ 808 89, 90, 95, 96, 97, 98, 99, 100, /* PORT13x */
822 101, 102, 103, 104, 105, 106, 107, 108, /* PORT14x */ 809 101, 102, 103, 104, 105, 106, 107, 108, /* PORT14x */
823 118, 119, 120, 121, 122, 123, 124, 125, /* PORT15x */ 810 118, 119, 120, 121, 122, 123, 124, 125, /* XIRQ0-7 */
824 126, 72, 73, 92, 177, 93, 94, 176, /* PORT16x */ 811 126, 72, 73, 92, 177, 93, 94, 176, /* XIRQ8-15 */
825 74, 91, 27, 28, 29, 75, 20, 26, /* PORT17x */ 812 74, 91, 27, 28, 29, 75, 20, 26, /* XIRQ16-23 */
826 109, 110, 111, 112, 113, 114, 115, 116, /* PORT18x */ 813 109, 110, 111, 112, 113, 114, 115, 116, /* PORT18x */
827 117, 143, 144, 145, 146, 147, 148, 149, /* PORT19x */ 814 117, 143, 144, 145, 146, 147, 148, 149, /* PORT19x */
828 150, 151, 152, 153, 154, 155, 156, 157, /* PORT20x */ 815 150, 151, 152, 153, 154, 155, 156, 157, /* PORT20x */
@@ -835,35 +822,6 @@ static const unsigned port_range1_pins[] = {
835 218, 219, 220, 221, 223, 224, 225, 226, /* PORT27x */ 822 218, 219, 220, 221, 223, 224, 225, 226, /* PORT27x */
836 227, 228, 229, 230, 231, 232, 233, 234, /* PORT28x */ 823 227, 228, 229, 230, 231, 232, 233, 234, /* PORT28x */
837}; 824};
838static const int port_range1_muxvals[] = {
839 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */
840 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */
841 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
842 15, 15, 15, 15, 15, 15, 15, 15, /* PORT15x */
843 15, 15, 15, 15, 15, 15, 15, 15, /* PORT16x */
844 15, 15, 15, 15, 15, 15, 15, 15, /* PORT17x */
845 15, 15, 15, 15, 15, 15, 15, 15, /* PORT18x */
846 15, 15, 15, 15, 15, 15, 15, 15, /* PORT19x */
847 15, 15, 15, 15, 15, 15, 15, 15, /* PORT20x */
848 15, 15, 15, 15, 15, 15, 15, 15, /* PORT21x */
849 15, 15, 15, 15, 15, 15, 15, 15, /* PORT22x */
850 15, 15, 15, 15, 15, 15, 15, 15, /* PORT23x */
851 15, 15, 15, 15, 15, 15, 15, 15, /* PORT24x */
852 15, 15, 15, 15, 15, 15, 15, 15, /* PORT25x */
853 15, 15, 15, 15, 15, 15, 15, 15, /* PORT26x */
854 15, 15, 15, 15, 15, 15, 15, 15, /* PORT27x */
855 15, 15, 15, 15, 15, 15, 15, 15, /* PORT28x */
856};
857static const unsigned xirq_pins[] = {
858 118, 119, 120, 121, 122, 123, 124, 125, /* XIRQ0-7 */
859 126, 72, 73, 92, 177, 93, 94, 176, /* XIRQ8-15 */
860 74, 91, 27, 28, 29, 75, 20, 26, /* XIRQ16-23 */
861};
862static const int xirq_muxvals[] = {
863 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ0-7 */
864 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ8-15 */
865 14, 14, 14, 14, 14, 14, 14, 14, /* XIRQ16-23 */
866};
867 825
868static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = { 826static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
869 UNIPHIER_PINCTRL_GROUP(emmc), 827 UNIPHIER_PINCTRL_GROUP(emmc),
@@ -892,257 +850,8 @@ static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
892 UNIPHIER_PINCTRL_GROUP(usb1), 850 UNIPHIER_PINCTRL_GROUP(usb1),
893 UNIPHIER_PINCTRL_GROUP(usb2), 851 UNIPHIER_PINCTRL_GROUP(usb2),
894 UNIPHIER_PINCTRL_GROUP(usb3), 852 UNIPHIER_PINCTRL_GROUP(usb3),
895 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 853 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
896 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1), 854 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
897 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
898 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
899 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
900 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
901 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
902 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
903 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
904 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
905 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
906 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
907 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
908 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
909 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
910 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
911 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
912 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
913 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
914 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
915 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
916 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
917 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
918 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
919 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
920 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
921 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
922 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
923 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
924 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
925 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
926 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
927 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
928 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
929 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
930 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
931 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
932 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
933 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
934 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
935 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
936 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
937 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
938 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
939 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
940 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
941 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
942 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
943 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
944 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
945 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
946 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
947 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
948 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
949 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
950 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
951 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
952 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
953 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
954 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
955 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
956 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
957 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
958 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
959 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
960 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
961 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
962 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
963 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
964 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
965 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
966 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
967 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
968 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
969 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
970 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
971 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
972 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
973 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
974 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
975 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
976 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
977 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
978 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
979 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
980 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
981 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
982 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
983 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
984 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
985 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
986 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range1, 0),
987 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range1, 1),
988 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range1, 2),
989 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range1, 3),
990 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range1, 4),
991 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range1, 5),
992 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range1, 6),
993 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range1, 7),
994 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range1, 8),
995 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range1, 9),
996 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range1, 10),
997 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range1, 11),
998 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range1, 12),
999 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range1, 13),
1000 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range1, 14),
1001 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range1, 15),
1002 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range1, 16),
1003 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range1, 17),
1004 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range1, 18),
1005 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range1, 19),
1006 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range1, 20),
1007 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range1, 21),
1008 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range1, 22),
1009 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range1, 23),
1010 UNIPHIER_PINCTRL_GROUP_SINGLE(port150, port_range1, 24),
1011 UNIPHIER_PINCTRL_GROUP_SINGLE(port151, port_range1, 25),
1012 UNIPHIER_PINCTRL_GROUP_SINGLE(port152, port_range1, 26),
1013 UNIPHIER_PINCTRL_GROUP_SINGLE(port153, port_range1, 27),
1014 UNIPHIER_PINCTRL_GROUP_SINGLE(port154, port_range1, 28),
1015 UNIPHIER_PINCTRL_GROUP_SINGLE(port155, port_range1, 29),
1016 UNIPHIER_PINCTRL_GROUP_SINGLE(port156, port_range1, 30),
1017 UNIPHIER_PINCTRL_GROUP_SINGLE(port157, port_range1, 31),
1018 UNIPHIER_PINCTRL_GROUP_SINGLE(port160, port_range1, 32),
1019 UNIPHIER_PINCTRL_GROUP_SINGLE(port161, port_range1, 33),
1020 UNIPHIER_PINCTRL_GROUP_SINGLE(port162, port_range1, 34),
1021 UNIPHIER_PINCTRL_GROUP_SINGLE(port163, port_range1, 35),
1022 UNIPHIER_PINCTRL_GROUP_SINGLE(port164, port_range1, 36),
1023 UNIPHIER_PINCTRL_GROUP_SINGLE(port165, port_range1, 37),
1024 UNIPHIER_PINCTRL_GROUP_SINGLE(port166, port_range1, 38),
1025 UNIPHIER_PINCTRL_GROUP_SINGLE(port167, port_range1, 39),
1026 UNIPHIER_PINCTRL_GROUP_SINGLE(port170, port_range1, 40),
1027 UNIPHIER_PINCTRL_GROUP_SINGLE(port171, port_range1, 41),
1028 UNIPHIER_PINCTRL_GROUP_SINGLE(port172, port_range1, 42),
1029 UNIPHIER_PINCTRL_GROUP_SINGLE(port173, port_range1, 43),
1030 UNIPHIER_PINCTRL_GROUP_SINGLE(port174, port_range1, 44),
1031 UNIPHIER_PINCTRL_GROUP_SINGLE(port175, port_range1, 45),
1032 UNIPHIER_PINCTRL_GROUP_SINGLE(port176, port_range1, 46),
1033 UNIPHIER_PINCTRL_GROUP_SINGLE(port177, port_range1, 47),
1034 UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range1, 48),
1035 UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range1, 49),
1036 UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range1, 50),
1037 UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range1, 51),
1038 UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range1, 52),
1039 UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range1, 53),
1040 UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range1, 54),
1041 UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range1, 55),
1042 UNIPHIER_PINCTRL_GROUP_SINGLE(port190, port_range1, 56),
1043 UNIPHIER_PINCTRL_GROUP_SINGLE(port191, port_range1, 57),
1044 UNIPHIER_PINCTRL_GROUP_SINGLE(port192, port_range1, 58),
1045 UNIPHIER_PINCTRL_GROUP_SINGLE(port193, port_range1, 59),
1046 UNIPHIER_PINCTRL_GROUP_SINGLE(port194, port_range1, 60),
1047 UNIPHIER_PINCTRL_GROUP_SINGLE(port195, port_range1, 61),
1048 UNIPHIER_PINCTRL_GROUP_SINGLE(port196, port_range1, 62),
1049 UNIPHIER_PINCTRL_GROUP_SINGLE(port197, port_range1, 63),
1050 UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range1, 64),
1051 UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range1, 65),
1052 UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range1, 66),
1053 UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range1, 67),
1054 UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range1, 68),
1055 UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range1, 69),
1056 UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range1, 70),
1057 UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range1, 71),
1058 UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range1, 72),
1059 UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range1, 73),
1060 UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range1, 74),
1061 UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range1, 75),
1062 UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range1, 76),
1063 UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range1, 77),
1064 UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range1, 78),
1065 UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range1, 79),
1066 UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range1, 80),
1067 UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range1, 81),
1068 UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range1, 82),
1069 UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range1, 83),
1070 UNIPHIER_PINCTRL_GROUP_SINGLE(port224, port_range1, 84),
1071 UNIPHIER_PINCTRL_GROUP_SINGLE(port225, port_range1, 85),
1072 UNIPHIER_PINCTRL_GROUP_SINGLE(port226, port_range1, 86),
1073 UNIPHIER_PINCTRL_GROUP_SINGLE(port227, port_range1, 87),
1074 UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range1, 88),
1075 UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range1, 89),
1076 UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range1, 90),
1077 UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range1, 91),
1078 UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range1, 92),
1079 UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range1, 93),
1080 UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range1, 94),
1081 UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range1, 95),
1082 UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range1, 96),
1083 UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range1, 97),
1084 UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range1, 98),
1085 UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range1, 99),
1086 UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range1, 100),
1087 UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range1, 101),
1088 UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range1, 102),
1089 UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range1, 103),
1090 UNIPHIER_PINCTRL_GROUP_SINGLE(port250, port_range1, 104),
1091 UNIPHIER_PINCTRL_GROUP_SINGLE(port251, port_range1, 105),
1092 UNIPHIER_PINCTRL_GROUP_SINGLE(port252, port_range1, 106),
1093 UNIPHIER_PINCTRL_GROUP_SINGLE(port253, port_range1, 107),
1094 UNIPHIER_PINCTRL_GROUP_SINGLE(port254, port_range1, 108),
1095 UNIPHIER_PINCTRL_GROUP_SINGLE(port255, port_range1, 109),
1096 UNIPHIER_PINCTRL_GROUP_SINGLE(port256, port_range1, 110),
1097 UNIPHIER_PINCTRL_GROUP_SINGLE(port257, port_range1, 111),
1098 UNIPHIER_PINCTRL_GROUP_SINGLE(port260, port_range1, 112),
1099 UNIPHIER_PINCTRL_GROUP_SINGLE(port261, port_range1, 113),
1100 UNIPHIER_PINCTRL_GROUP_SINGLE(port262, port_range1, 114),
1101 UNIPHIER_PINCTRL_GROUP_SINGLE(port263, port_range1, 115),
1102 UNIPHIER_PINCTRL_GROUP_SINGLE(port264, port_range1, 116),
1103 UNIPHIER_PINCTRL_GROUP_SINGLE(port265, port_range1, 117),
1104 UNIPHIER_PINCTRL_GROUP_SINGLE(port266, port_range1, 118),
1105 UNIPHIER_PINCTRL_GROUP_SINGLE(port267, port_range1, 119),
1106 UNIPHIER_PINCTRL_GROUP_SINGLE(port270, port_range1, 120),
1107 UNIPHIER_PINCTRL_GROUP_SINGLE(port271, port_range1, 121),
1108 UNIPHIER_PINCTRL_GROUP_SINGLE(port272, port_range1, 122),
1109 UNIPHIER_PINCTRL_GROUP_SINGLE(port273, port_range1, 123),
1110 UNIPHIER_PINCTRL_GROUP_SINGLE(port274, port_range1, 124),
1111 UNIPHIER_PINCTRL_GROUP_SINGLE(port275, port_range1, 125),
1112 UNIPHIER_PINCTRL_GROUP_SINGLE(port276, port_range1, 126),
1113 UNIPHIER_PINCTRL_GROUP_SINGLE(port277, port_range1, 127),
1114 UNIPHIER_PINCTRL_GROUP_SINGLE(port280, port_range1, 128),
1115 UNIPHIER_PINCTRL_GROUP_SINGLE(port281, port_range1, 129),
1116 UNIPHIER_PINCTRL_GROUP_SINGLE(port282, port_range1, 130),
1117 UNIPHIER_PINCTRL_GROUP_SINGLE(port283, port_range1, 131),
1118 UNIPHIER_PINCTRL_GROUP_SINGLE(port284, port_range1, 132),
1119 UNIPHIER_PINCTRL_GROUP_SINGLE(port285, port_range1, 133),
1120 UNIPHIER_PINCTRL_GROUP_SINGLE(port286, port_range1, 134),
1121 UNIPHIER_PINCTRL_GROUP_SINGLE(port287, port_range1, 135),
1122 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
1123 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
1124 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
1125 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
1126 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
1127 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
1128 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
1129 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
1130 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
1131 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
1132 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
1133 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
1134 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
1135 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
1136 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
1137 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
1138 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
1139 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
1140 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
1141 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
1142 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
1143 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21, xirq, 21),
1144 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22, xirq, 22),
1145 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23, xirq, 23),
1146}; 855};
1147 856
1148static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 857static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
@@ -1167,73 +876,6 @@ static const char * const usb0_groups[] = {"usb0"};
1167static const char * const usb1_groups[] = {"usb1"}; 876static const char * const usb1_groups[] = {"usb1"};
1168static const char * const usb2_groups[] = {"usb2"}; 877static const char * const usb2_groups[] = {"usb2"};
1169static const char * const usb3_groups[] = {"usb3"}; 878static const char * const usb3_groups[] = {"usb3"};
1170static const char * const port_groups[] = {
1171 "port00", "port01", "port02", "port03",
1172 "port04", "port05", "port06", "port07",
1173 "port10", "port11", "port12", "port13",
1174 "port14", "port15", "port16", "port17",
1175 "port20", "port21", "port22", "port23",
1176 "port24", "port25", "port26", "port27",
1177 "port30", "port31", "port32", "port33",
1178 "port34", "port35", "port36", "port37",
1179 "port40", "port41", "port42", "port43",
1180 "port44", "port45", "port46", "port47",
1181 "port50", "port51", "port52", "port53",
1182 "port54", "port55", "port56", "port57",
1183 "port60", "port61", "port62", "port63",
1184 "port64", "port65", "port66", "port67",
1185 "port70", "port71", "port72", "port73",
1186 "port74", "port75", "port76", "port77",
1187 "port80", "port81", "port82", "port83",
1188 "port84", "port85", "port86", "port87",
1189 "port90", "port91", "port92", "port93",
1190 "port94", "port95", "port96", "port97",
1191 "port100", "port101", "port102", "port103",
1192 "port104", "port105", "port106", "port107",
1193 /* port110-117 missing */
1194 "port120", "port121", "port122", "port123",
1195 "port124", "port125", "port126", "port127",
1196 "port130", "port131", "port132", "port133",
1197 "port134", "port135", "port136", "port137",
1198 "port140", "port141", "port142", "port143",
1199 "port144", "port145", "port146", "port147",
1200 "port150", "port151", "port152", "port153",
1201 "port154", "port155", "port156", "port157",
1202 "port160", "port161", "port162", "port163",
1203 "port164", "port165", "port166", "port167",
1204 "port170", "port171", "port172", "port173",
1205 "port174", "port175", "port176", "port177",
1206 "port180", "port181", "port182", "port183",
1207 "port184", "port185", "port186", "port187",
1208 "port190", "port191", "port192", "port193",
1209 "port194", "port195", "port196", "port197",
1210 "port200", "port201", "port202", "port203",
1211 "port204", "port205", "port206", "port207",
1212 "port210", "port211", "port212", "port213",
1213 "port214", "port215", "port216", "port217",
1214 "port220", "port221", "port222", "port223",
1215 "port224", "port225", "port226", "port227",
1216 "port230", "port231", "port232", "port233",
1217 "port234", "port235", "port236", "port237",
1218 "port240", "port241", "port242", "port243",
1219 "port244", "port245", "port246", "port247",
1220 "port250", "port251", "port252", "port253",
1221 "port254", "port255", "port256", "port257",
1222 "port260", "port261", "port262", "port263",
1223 "port264", "port265", "port266", "port267",
1224 "port270", "port271", "port272", "port273",
1225 "port274", "port275", "port276", "port277",
1226 "port280", "port281", "port282", "port283",
1227 "port284", "port285", "port286", "port287",
1228};
1229static const char * const xirq_groups[] = {
1230 "xirq0", "xirq1", "xirq2", "xirq3",
1231 "xirq4", "xirq5", "xirq6", "xirq7",
1232 "xirq8", "xirq9", "xirq10", "xirq11",
1233 "xirq12", "xirq13", "xirq14", "xirq15",
1234 "xirq16", "xirq17", "xirq18", "xirq19",
1235 "xirq20", "xirq21", "xirq22", "xirq23",
1236};
1237 879
1238static const struct uniphier_pinmux_function uniphier_pxs2_functions[] = { 880static const struct uniphier_pinmux_function uniphier_pxs2_functions[] = {
1239 UNIPHIER_PINMUX_FUNCTION(emmc), 881 UNIPHIER_PINMUX_FUNCTION(emmc),
@@ -1257,10 +899,18 @@ static const struct uniphier_pinmux_function uniphier_pxs2_functions[] = {
1257 UNIPHIER_PINMUX_FUNCTION(usb1), 899 UNIPHIER_PINMUX_FUNCTION(usb1),
1258 UNIPHIER_PINMUX_FUNCTION(usb2), 900 UNIPHIER_PINMUX_FUNCTION(usb2),
1259 UNIPHIER_PINMUX_FUNCTION(usb3), 901 UNIPHIER_PINMUX_FUNCTION(usb3),
1260 UNIPHIER_PINMUX_FUNCTION(port),
1261 UNIPHIER_PINMUX_FUNCTION(xirq),
1262}; 902};
1263 903
904static int uniphier_pxs2_get_gpio_muxval(unsigned int pin,
905 unsigned int gpio_offset)
906{
907 if (gpio_offset >= 120 && gpio_offset <= 143) /* XIRQx */
908 /* 15 will do because XIRQ0-23 are aliases of PORT150-177. */
909 return 14;
910
911 return 15;
912}
913
1264static struct uniphier_pinctrl_socdata uniphier_pxs2_pindata = { 914static struct uniphier_pinctrl_socdata uniphier_pxs2_pindata = {
1265 .pins = uniphier_pxs2_pins, 915 .pins = uniphier_pxs2_pins,
1266 .npins = ARRAY_SIZE(uniphier_pxs2_pins), 916 .npins = ARRAY_SIZE(uniphier_pxs2_pins),
@@ -1268,6 +918,7 @@ static struct uniphier_pinctrl_socdata uniphier_pxs2_pindata = {
1268 .groups_count = ARRAY_SIZE(uniphier_pxs2_groups), 918 .groups_count = ARRAY_SIZE(uniphier_pxs2_groups),
1269 .functions = uniphier_pxs2_functions, 919 .functions = uniphier_pxs2_functions,
1270 .functions_count = ARRAY_SIZE(uniphier_pxs2_functions), 920 .functions_count = ARRAY_SIZE(uniphier_pxs2_functions),
921 .get_gpio_muxval = uniphier_pxs2_get_gpio_muxval,
1271 .caps = 0, 922 .caps = 0,
1272}; 923};
1273 924
@@ -1286,6 +937,7 @@ static struct platform_driver uniphier_pxs2_pinctrl_driver = {
1286 .driver = { 937 .driver = {
1287 .name = "uniphier-pxs2-pinctrl", 938 .name = "uniphier-pxs2-pinctrl",
1288 .of_match_table = uniphier_pxs2_pinctrl_match, 939 .of_match_table = uniphier_pxs2_pinctrl_match,
940 .pm = &uniphier_pinctrl_pm_ops,
1289 }, 941 },
1290}; 942};
1291builtin_platform_driver(uniphier_pxs2_pinctrl_driver); 943builtin_platform_driver(uniphier_pxs2_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
new file mode 100644
index 000000000000..d9f166f0cc86
--- /dev/null
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
@@ -0,0 +1,989 @@
1/*
2 * Copyright (C) 2017 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/pinctrl/pinctrl.h>
19#include <linux/platform_device.h>
20
21#include "pinctrl-uniphier.h"
22
23static const struct pinctrl_pin_desc uniphier_pxs3_pins[] = {
24 UNIPHIER_PINCTRL_PIN(0, "LPST", UNIPHIER_PIN_IECTRL_EXIST,
25 0, UNIPHIER_PIN_DRV_3BIT,
26 0, UNIPHIER_PIN_PULL_DOWN),
27 UNIPHIER_PINCTRL_PIN(1, "ED0", UNIPHIER_PIN_IECTRL_EXIST,
28 1, UNIPHIER_PIN_DRV_3BIT,
29 1, UNIPHIER_PIN_PULL_DOWN),
30 UNIPHIER_PINCTRL_PIN(2, "ED1", UNIPHIER_PIN_IECTRL_EXIST,
31 2, UNIPHIER_PIN_DRV_3BIT,
32 2, UNIPHIER_PIN_PULL_DOWN),
33 UNIPHIER_PINCTRL_PIN(3, "ED2", UNIPHIER_PIN_IECTRL_EXIST,
34 3, UNIPHIER_PIN_DRV_3BIT,
35 3, UNIPHIER_PIN_PULL_DOWN),
36 UNIPHIER_PINCTRL_PIN(4, "ED3", UNIPHIER_PIN_IECTRL_EXIST,
37 4, UNIPHIER_PIN_DRV_3BIT,
38 4, UNIPHIER_PIN_PULL_DOWN),
39 UNIPHIER_PINCTRL_PIN(5, "ED4", UNIPHIER_PIN_IECTRL_EXIST,
40 5, UNIPHIER_PIN_DRV_3BIT,
41 5, UNIPHIER_PIN_PULL_DOWN),
42 UNIPHIER_PINCTRL_PIN(6, "ED5", UNIPHIER_PIN_IECTRL_EXIST,
43 6, UNIPHIER_PIN_DRV_3BIT,
44 6, UNIPHIER_PIN_PULL_DOWN),
45 UNIPHIER_PINCTRL_PIN(7, "ED6", UNIPHIER_PIN_IECTRL_EXIST,
46 7, UNIPHIER_PIN_DRV_3BIT,
47 7, UNIPHIER_PIN_PULL_DOWN),
48 UNIPHIER_PINCTRL_PIN(8, "ED7", UNIPHIER_PIN_IECTRL_EXIST,
49 8, UNIPHIER_PIN_DRV_3BIT,
50 8, UNIPHIER_PIN_PULL_DOWN),
51 UNIPHIER_PINCTRL_PIN(9, "XERWE0", UNIPHIER_PIN_IECTRL_EXIST,
52 9, UNIPHIER_PIN_DRV_3BIT,
53 9, UNIPHIER_PIN_PULL_DOWN),
54 UNIPHIER_PINCTRL_PIN(10, "XERWE1", UNIPHIER_PIN_IECTRL_EXIST,
55 10, UNIPHIER_PIN_DRV_3BIT,
56 10, UNIPHIER_PIN_PULL_DOWN),
57 UNIPHIER_PINCTRL_PIN(11, "ERXW", UNIPHIER_PIN_IECTRL_EXIST,
58 11, UNIPHIER_PIN_DRV_3BIT,
59 11, UNIPHIER_PIN_PULL_DOWN),
60 UNIPHIER_PINCTRL_PIN(12, "ES0", UNIPHIER_PIN_IECTRL_EXIST,
61 12, UNIPHIER_PIN_DRV_3BIT,
62 12, UNIPHIER_PIN_PULL_DOWN),
63 UNIPHIER_PINCTRL_PIN(13, "ES1", UNIPHIER_PIN_IECTRL_EXIST,
64 13, UNIPHIER_PIN_DRV_3BIT,
65 13, UNIPHIER_PIN_PULL_DOWN),
66 UNIPHIER_PINCTRL_PIN(14, "ES2", UNIPHIER_PIN_IECTRL_EXIST,
67 14, UNIPHIER_PIN_DRV_3BIT,
68 14, UNIPHIER_PIN_PULL_DOWN),
69 UNIPHIER_PINCTRL_PIN(15, "XECS1", UNIPHIER_PIN_IECTRL_EXIST,
70 15, UNIPHIER_PIN_DRV_3BIT,
71 15, UNIPHIER_PIN_PULL_UP),
72 UNIPHIER_PINCTRL_PIN(16, "XNFWP", UNIPHIER_PIN_IECTRL_EXIST,
73 16, UNIPHIER_PIN_DRV_3BIT,
74 16, UNIPHIER_PIN_PULL_DOWN),
75 UNIPHIER_PINCTRL_PIN(17, "XNFCE0", UNIPHIER_PIN_IECTRL_EXIST,
76 17, UNIPHIER_PIN_DRV_3BIT,
77 17, UNIPHIER_PIN_PULL_UP),
78 UNIPHIER_PINCTRL_PIN(18, "NFRYBY0", UNIPHIER_PIN_IECTRL_EXIST,
79 18, UNIPHIER_PIN_DRV_3BIT,
80 18, UNIPHIER_PIN_PULL_UP),
81 UNIPHIER_PINCTRL_PIN(19, "XNFRE", UNIPHIER_PIN_IECTRL_EXIST,
82 19, UNIPHIER_PIN_DRV_3BIT,
83 19, UNIPHIER_PIN_PULL_UP),
84 UNIPHIER_PINCTRL_PIN(20, "XNFWE", UNIPHIER_PIN_IECTRL_EXIST,
85 20, UNIPHIER_PIN_DRV_3BIT,
86 20, UNIPHIER_PIN_PULL_UP),
87 UNIPHIER_PINCTRL_PIN(21, "NFALE", UNIPHIER_PIN_IECTRL_EXIST,
88 21, UNIPHIER_PIN_DRV_3BIT,
89 21, UNIPHIER_PIN_PULL_UP),
90 UNIPHIER_PINCTRL_PIN(22, "NFCLE", UNIPHIER_PIN_IECTRL_EXIST,
91 22, UNIPHIER_PIN_DRV_3BIT,
92 22, UNIPHIER_PIN_PULL_UP),
93 UNIPHIER_PINCTRL_PIN(23, "NFD0", UNIPHIER_PIN_IECTRL_EXIST,
94 23, UNIPHIER_PIN_DRV_3BIT,
95 23, UNIPHIER_PIN_PULL_UP),
96 UNIPHIER_PINCTRL_PIN(24, "NFD1", UNIPHIER_PIN_IECTRL_EXIST,
97 24, UNIPHIER_PIN_DRV_3BIT,
98 24, UNIPHIER_PIN_PULL_UP),
99 UNIPHIER_PINCTRL_PIN(25, "NFD2", UNIPHIER_PIN_IECTRL_EXIST,
100 25, UNIPHIER_PIN_DRV_3BIT,
101 25, UNIPHIER_PIN_PULL_UP),
102 UNIPHIER_PINCTRL_PIN(26, "NFD3", UNIPHIER_PIN_IECTRL_EXIST,
103 26, UNIPHIER_PIN_DRV_3BIT,
104 26, UNIPHIER_PIN_PULL_UP),
105 UNIPHIER_PINCTRL_PIN(27, "NFD4", UNIPHIER_PIN_IECTRL_EXIST,
106 27, UNIPHIER_PIN_DRV_3BIT,
107 27, UNIPHIER_PIN_PULL_UP),
108 UNIPHIER_PINCTRL_PIN(28, "NFD5", UNIPHIER_PIN_IECTRL_EXIST,
109 28, UNIPHIER_PIN_DRV_3BIT,
110 28, UNIPHIER_PIN_PULL_UP),
111 UNIPHIER_PINCTRL_PIN(29, "NFD6", UNIPHIER_PIN_IECTRL_EXIST,
112 29, UNIPHIER_PIN_DRV_3BIT,
113 29, UNIPHIER_PIN_PULL_UP),
114 UNIPHIER_PINCTRL_PIN(30, "NFD7", UNIPHIER_PIN_IECTRL_EXIST,
115 30, UNIPHIER_PIN_DRV_3BIT,
116 30, UNIPHIER_PIN_PULL_UP),
117 UNIPHIER_PINCTRL_PIN(31, "XERST", UNIPHIER_PIN_IECTRL_EXIST,
118 0, UNIPHIER_PIN_DRV_2BIT,
119 31, UNIPHIER_PIN_PULL_DOWN),
120 UNIPHIER_PINCTRL_PIN(32, "MMCCLK", UNIPHIER_PIN_IECTRL_EXIST,
121 1, UNIPHIER_PIN_DRV_2BIT,
122 32, UNIPHIER_PIN_PULL_DOWN),
123 UNIPHIER_PINCTRL_PIN(33, "MMCCMD", UNIPHIER_PIN_IECTRL_EXIST,
124 2, UNIPHIER_PIN_DRV_2BIT,
125 33, UNIPHIER_PIN_PULL_UP),
126 UNIPHIER_PINCTRL_PIN(34, "MMCDS", UNIPHIER_PIN_IECTRL_EXIST,
127 3, UNIPHIER_PIN_DRV_2BIT,
128 34, UNIPHIER_PIN_PULL_DOWN),
129 UNIPHIER_PINCTRL_PIN(35, "MMCDAT0", UNIPHIER_PIN_IECTRL_EXIST,
130 4, UNIPHIER_PIN_DRV_2BIT,
131 35, UNIPHIER_PIN_PULL_UP),
132 UNIPHIER_PINCTRL_PIN(36, "MMCDAT1", UNIPHIER_PIN_IECTRL_EXIST,
133 5, UNIPHIER_PIN_DRV_2BIT,
134 36, UNIPHIER_PIN_PULL_UP),
135 UNIPHIER_PINCTRL_PIN(37, "MMCDAT2", UNIPHIER_PIN_IECTRL_EXIST,
136 6, UNIPHIER_PIN_DRV_2BIT,
137 37, UNIPHIER_PIN_PULL_UP),
138 UNIPHIER_PINCTRL_PIN(38, "MMCDAT3", UNIPHIER_PIN_IECTRL_EXIST,
139 7, UNIPHIER_PIN_DRV_2BIT,
140 38, UNIPHIER_PIN_PULL_UP),
141 UNIPHIER_PINCTRL_PIN(39, "MMCDAT4", UNIPHIER_PIN_IECTRL_EXIST,
142 8, UNIPHIER_PIN_DRV_2BIT,
143 39, UNIPHIER_PIN_PULL_UP),
144 UNIPHIER_PINCTRL_PIN(40, "MMCDAT5", UNIPHIER_PIN_IECTRL_EXIST,
145 9, UNIPHIER_PIN_DRV_2BIT,
146 40, UNIPHIER_PIN_PULL_UP),
147 UNIPHIER_PINCTRL_PIN(41, "MMCDAT6", UNIPHIER_PIN_IECTRL_EXIST,
148 10, UNIPHIER_PIN_DRV_2BIT,
149 41, UNIPHIER_PIN_PULL_UP),
150 UNIPHIER_PINCTRL_PIN(42, "MMCDAT7", UNIPHIER_PIN_IECTRL_EXIST,
151 11, UNIPHIER_PIN_DRV_2BIT,
152 42, UNIPHIER_PIN_PULL_UP),
153 UNIPHIER_PINCTRL_PIN(43, "SDCLK", UNIPHIER_PIN_IECTRL_EXIST,
154 12, UNIPHIER_PIN_DRV_2BIT,
155 43, UNIPHIER_PIN_PULL_UP),
156 UNIPHIER_PINCTRL_PIN(44, "SDCMD", UNIPHIER_PIN_IECTRL_EXIST,
157 13, UNIPHIER_PIN_DRV_2BIT,
158 44, UNIPHIER_PIN_PULL_UP),
159 UNIPHIER_PINCTRL_PIN(45, "SDDAT0", UNIPHIER_PIN_IECTRL_EXIST,
160 14, UNIPHIER_PIN_DRV_2BIT,
161 45, UNIPHIER_PIN_PULL_UP),
162 UNIPHIER_PINCTRL_PIN(46, "SDDAT1", UNIPHIER_PIN_IECTRL_EXIST,
163 15, UNIPHIER_PIN_DRV_2BIT,
164 46, UNIPHIER_PIN_PULL_UP),
165 UNIPHIER_PINCTRL_PIN(47, "SDDAT2", UNIPHIER_PIN_IECTRL_EXIST,
166 16, UNIPHIER_PIN_DRV_2BIT,
167 47, UNIPHIER_PIN_PULL_UP),
168 UNIPHIER_PINCTRL_PIN(48, "SDDAT3", UNIPHIER_PIN_IECTRL_EXIST,
169 17, UNIPHIER_PIN_DRV_2BIT,
170 48, UNIPHIER_PIN_PULL_UP),
171 UNIPHIER_PINCTRL_PIN(49, "SDCD", UNIPHIER_PIN_IECTRL_EXIST,
172 31, UNIPHIER_PIN_DRV_3BIT,
173 49, UNIPHIER_PIN_PULL_UP),
174 UNIPHIER_PINCTRL_PIN(50, "SDWP", UNIPHIER_PIN_IECTRL_EXIST,
175 32, UNIPHIER_PIN_DRV_3BIT,
176 50, UNIPHIER_PIN_PULL_UP),
177 UNIPHIER_PINCTRL_PIN(51, "SDVOLC", UNIPHIER_PIN_IECTRL_EXIST,
178 33, UNIPHIER_PIN_DRV_3BIT,
179 51, UNIPHIER_PIN_PULL_UP),
180 UNIPHIER_PINCTRL_PIN(52, "MDC0", UNIPHIER_PIN_IECTRL_EXIST,
181 18, UNIPHIER_PIN_DRV_2BIT,
182 52, UNIPHIER_PIN_PULL_UP),
183 UNIPHIER_PINCTRL_PIN(53, "MDIO0", UNIPHIER_PIN_IECTRL_EXIST,
184 19, UNIPHIER_PIN_DRV_2BIT,
185 53, UNIPHIER_PIN_PULL_UP),
186 UNIPHIER_PINCTRL_PIN(54, "MDIO0_INTL", UNIPHIER_PIN_IECTRL_EXIST,
187 20, UNIPHIER_PIN_DRV_2BIT,
188 54, UNIPHIER_PIN_PULL_UP),
189 UNIPHIER_PINCTRL_PIN(55, "PHYRSTL0", UNIPHIER_PIN_IECTRL_EXIST,
190 21, UNIPHIER_PIN_DRV_2BIT,
191 55, UNIPHIER_PIN_PULL_UP),
192 UNIPHIER_PINCTRL_PIN(56, "RGMII0_RXCLK", UNIPHIER_PIN_IECTRL_EXIST,
193 22, UNIPHIER_PIN_DRV_2BIT,
194 56, UNIPHIER_PIN_PULL_UP),
195 UNIPHIER_PINCTRL_PIN(57, "RGMII0_RXD0", UNIPHIER_PIN_IECTRL_EXIST,
196 23, UNIPHIER_PIN_DRV_2BIT,
197 57, UNIPHIER_PIN_PULL_UP),
198 UNIPHIER_PINCTRL_PIN(58, "RGMII0_RXD1", UNIPHIER_PIN_IECTRL_EXIST,
199 24, UNIPHIER_PIN_DRV_2BIT,
200 58, UNIPHIER_PIN_PULL_UP),
201 UNIPHIER_PINCTRL_PIN(59, "RGMII0_RXD2", UNIPHIER_PIN_IECTRL_EXIST,
202 25, UNIPHIER_PIN_DRV_2BIT,
203 59, UNIPHIER_PIN_PULL_UP),
204 UNIPHIER_PINCTRL_PIN(60, "RGMII0_RXD3", UNIPHIER_PIN_IECTRL_EXIST,
205 26, UNIPHIER_PIN_DRV_2BIT,
206 60, UNIPHIER_PIN_PULL_UP),
207 UNIPHIER_PINCTRL_PIN(61, "RGMII0_RXCTL", UNIPHIER_PIN_IECTRL_EXIST,
208 27, UNIPHIER_PIN_DRV_2BIT,
209 61, UNIPHIER_PIN_PULL_UP),
210 UNIPHIER_PINCTRL_PIN(62, "RGMII0_TXCLK", UNIPHIER_PIN_IECTRL_EXIST,
211 28, UNIPHIER_PIN_DRV_2BIT,
212 62, UNIPHIER_PIN_PULL_DOWN),
213 UNIPHIER_PINCTRL_PIN(63, "RGMII0_TXD0", UNIPHIER_PIN_IECTRL_EXIST,
214 29, UNIPHIER_PIN_DRV_2BIT,
215 63, UNIPHIER_PIN_PULL_DOWN),
216 UNIPHIER_PINCTRL_PIN(64, "RGMII0_TXD1", UNIPHIER_PIN_IECTRL_EXIST,
217 30, UNIPHIER_PIN_DRV_2BIT,
218 64, UNIPHIER_PIN_PULL_DOWN),
219 UNIPHIER_PINCTRL_PIN(65, "RGMII0_TXD2", UNIPHIER_PIN_IECTRL_EXIST,
220 31, UNIPHIER_PIN_DRV_2BIT,
221 65, UNIPHIER_PIN_PULL_DOWN),
222 UNIPHIER_PINCTRL_PIN(66, "RGMII0_TXD3", UNIPHIER_PIN_IECTRL_EXIST,
223 32, UNIPHIER_PIN_DRV_2BIT,
224 66, UNIPHIER_PIN_PULL_DOWN),
225 UNIPHIER_PINCTRL_PIN(67, "RGMII0_TXCTL", UNIPHIER_PIN_IECTRL_EXIST,
226 33, UNIPHIER_PIN_DRV_2BIT,
227 67, UNIPHIER_PIN_PULL_DOWN),
228 UNIPHIER_PINCTRL_PIN(68, "MDC1", UNIPHIER_PIN_IECTRL_EXIST,
229 34, UNIPHIER_PIN_DRV_2BIT,
230 68, UNIPHIER_PIN_PULL_UP),
231 UNIPHIER_PINCTRL_PIN(69, "MDIO1", UNIPHIER_PIN_IECTRL_EXIST,
232 35, UNIPHIER_PIN_DRV_2BIT,
233 69, UNIPHIER_PIN_PULL_UP),
234 UNIPHIER_PINCTRL_PIN(70, "MDIO1_INTL", UNIPHIER_PIN_IECTRL_EXIST,
235 36, UNIPHIER_PIN_DRV_2BIT,
236 70, UNIPHIER_PIN_PULL_UP),
237 UNIPHIER_PINCTRL_PIN(71, "PHYRSTL1", UNIPHIER_PIN_IECTRL_EXIST,
238 37, UNIPHIER_PIN_DRV_2BIT,
239 71, UNIPHIER_PIN_PULL_UP),
240 UNIPHIER_PINCTRL_PIN(72, "RGMII1_RXCLK", UNIPHIER_PIN_IECTRL_EXIST,
241 38, UNIPHIER_PIN_DRV_2BIT,
242 72, UNIPHIER_PIN_PULL_UP),
243 UNIPHIER_PINCTRL_PIN(73, "RGMII1_RXD0", UNIPHIER_PIN_IECTRL_EXIST,
244 39, UNIPHIER_PIN_DRV_2BIT,
245 73, UNIPHIER_PIN_PULL_UP),
246 UNIPHIER_PINCTRL_PIN(74, "RGMII1_RXD1", UNIPHIER_PIN_IECTRL_EXIST,
247 40, UNIPHIER_PIN_DRV_2BIT,
248 74, UNIPHIER_PIN_PULL_UP),
249 UNIPHIER_PINCTRL_PIN(75, "RGMII1_RXD2", UNIPHIER_PIN_IECTRL_EXIST,
250 41, UNIPHIER_PIN_DRV_2BIT,
251 75, UNIPHIER_PIN_PULL_UP),
252 UNIPHIER_PINCTRL_PIN(76, "RGMII1_RXD3", UNIPHIER_PIN_IECTRL_EXIST,
253 42, UNIPHIER_PIN_DRV_2BIT,
254 76, UNIPHIER_PIN_PULL_UP),
255 UNIPHIER_PINCTRL_PIN(77, "RGMII1_RXCTL", UNIPHIER_PIN_IECTRL_EXIST,
256 43, UNIPHIER_PIN_DRV_2BIT,
257 77, UNIPHIER_PIN_PULL_UP),
258 UNIPHIER_PINCTRL_PIN(78, "RGMII1_TXCLK", UNIPHIER_PIN_IECTRL_EXIST,
259 44, UNIPHIER_PIN_DRV_2BIT,
260 78, UNIPHIER_PIN_PULL_DOWN),
261 UNIPHIER_PINCTRL_PIN(79, "RGMII1_TXD0", UNIPHIER_PIN_IECTRL_EXIST,
262 45, UNIPHIER_PIN_DRV_2BIT,
263 79, UNIPHIER_PIN_PULL_DOWN),
264 UNIPHIER_PINCTRL_PIN(80, "RGMII1_TXD1", UNIPHIER_PIN_IECTRL_EXIST,
265 46, UNIPHIER_PIN_DRV_2BIT,
266 80, UNIPHIER_PIN_PULL_DOWN),
267 UNIPHIER_PINCTRL_PIN(81, "RGMII1_TXD2", UNIPHIER_PIN_IECTRL_EXIST,
268 47, UNIPHIER_PIN_DRV_2BIT,
269 81, UNIPHIER_PIN_PULL_DOWN),
270 UNIPHIER_PINCTRL_PIN(82, "RGMII1_TXD3", UNIPHIER_PIN_IECTRL_EXIST,
271 48, UNIPHIER_PIN_DRV_2BIT,
272 82, UNIPHIER_PIN_PULL_DOWN),
273 UNIPHIER_PINCTRL_PIN(83, "RGMII1_TXCTL", UNIPHIER_PIN_IECTRL_EXIST,
274 49, UNIPHIER_PIN_DRV_2BIT,
275 83, UNIPHIER_PIN_PULL_DOWN),
276 UNIPHIER_PINCTRL_PIN(84, "USB0VBUS", UNIPHIER_PIN_IECTRL_EXIST,
277 34, UNIPHIER_PIN_DRV_3BIT,
278 84, UNIPHIER_PIN_PULL_DOWN),
279 UNIPHIER_PINCTRL_PIN(85, "USB0OD", UNIPHIER_PIN_IECTRL_EXIST,
280 35, UNIPHIER_PIN_DRV_3BIT,
281 85, UNIPHIER_PIN_PULL_UP),
282 UNIPHIER_PINCTRL_PIN(86, "USB1VBUS", UNIPHIER_PIN_IECTRL_EXIST,
283 36, UNIPHIER_PIN_DRV_3BIT,
284 86, UNIPHIER_PIN_PULL_DOWN),
285 UNIPHIER_PINCTRL_PIN(87, "USB1OD", UNIPHIER_PIN_IECTRL_EXIST,
286 37, UNIPHIER_PIN_DRV_3BIT,
287 87, UNIPHIER_PIN_PULL_UP),
288 UNIPHIER_PINCTRL_PIN(88, "USB2VBUS", UNIPHIER_PIN_IECTRL_EXIST,
289 38, UNIPHIER_PIN_DRV_3BIT,
290 88, UNIPHIER_PIN_PULL_DOWN),
291 UNIPHIER_PINCTRL_PIN(89, "USB2OD", UNIPHIER_PIN_IECTRL_EXIST,
292 39, UNIPHIER_PIN_DRV_3BIT,
293 89, UNIPHIER_PIN_PULL_UP),
294 UNIPHIER_PINCTRL_PIN(90, "USB3VBUS", UNIPHIER_PIN_IECTRL_EXIST,
295 40, UNIPHIER_PIN_DRV_3BIT,
296 90, UNIPHIER_PIN_PULL_DOWN),
297 UNIPHIER_PINCTRL_PIN(91, "USB3OD", UNIPHIER_PIN_IECTRL_EXIST,
298 41, UNIPHIER_PIN_DRV_3BIT,
299 91, UNIPHIER_PIN_PULL_UP),
300 UNIPHIER_PINCTRL_PIN(92, "TXD0", UNIPHIER_PIN_IECTRL_EXIST,
301 42, UNIPHIER_PIN_DRV_3BIT,
302 92, UNIPHIER_PIN_PULL_UP),
303 UNIPHIER_PINCTRL_PIN(93, "RXD0", UNIPHIER_PIN_IECTRL_EXIST,
304 43, UNIPHIER_PIN_DRV_3BIT,
305 93, UNIPHIER_PIN_PULL_UP),
306 UNIPHIER_PINCTRL_PIN(94, "TXD1", UNIPHIER_PIN_IECTRL_EXIST,
307 44, UNIPHIER_PIN_DRV_3BIT,
308 94, UNIPHIER_PIN_PULL_UP),
309 UNIPHIER_PINCTRL_PIN(95, "RXD1", UNIPHIER_PIN_IECTRL_EXIST,
310 45, UNIPHIER_PIN_DRV_3BIT,
311 95, UNIPHIER_PIN_PULL_UP),
312 UNIPHIER_PINCTRL_PIN(96, "TXD2", UNIPHIER_PIN_IECTRL_EXIST,
313 46, UNIPHIER_PIN_DRV_3BIT,
314 96, UNIPHIER_PIN_PULL_UP),
315 UNIPHIER_PINCTRL_PIN(97, "RXD2", UNIPHIER_PIN_IECTRL_EXIST,
316 47, UNIPHIER_PIN_DRV_3BIT,
317 97, UNIPHIER_PIN_PULL_UP),
318 UNIPHIER_PINCTRL_PIN(98, "TXD3", UNIPHIER_PIN_IECTRL_EXIST,
319 48, UNIPHIER_PIN_DRV_3BIT,
320 98, UNIPHIER_PIN_PULL_UP),
321 UNIPHIER_PINCTRL_PIN(99, "RXD3", UNIPHIER_PIN_IECTRL_EXIST,
322 49, UNIPHIER_PIN_DRV_3BIT,
323 99, UNIPHIER_PIN_PULL_UP),
324 UNIPHIER_PINCTRL_PIN(100, "SPISYNC0", UNIPHIER_PIN_IECTRL_EXIST,
325 50, UNIPHIER_PIN_DRV_3BIT,
326 100, UNIPHIER_PIN_PULL_DOWN),
327 UNIPHIER_PINCTRL_PIN(101, "SPISCLK0", UNIPHIER_PIN_IECTRL_EXIST,
328 51, UNIPHIER_PIN_DRV_3BIT,
329 101, UNIPHIER_PIN_PULL_DOWN),
330 UNIPHIER_PINCTRL_PIN(102, "SPITXD0", UNIPHIER_PIN_IECTRL_EXIST,
331 52, UNIPHIER_PIN_DRV_3BIT,
332 102, UNIPHIER_PIN_PULL_DOWN),
333 UNIPHIER_PINCTRL_PIN(103, "SPIRXD0", UNIPHIER_PIN_IECTRL_EXIST,
334 53, UNIPHIER_PIN_DRV_3BIT,
335 103, UNIPHIER_PIN_PULL_DOWN),
336 UNIPHIER_PINCTRL_PIN(104, "SDA0", UNIPHIER_PIN_IECTRL_EXIST,
337 -1, UNIPHIER_PIN_DRV_FIXED4,
338 -1, UNIPHIER_PIN_PULL_NONE),
339 UNIPHIER_PINCTRL_PIN(105, "SCL0", UNIPHIER_PIN_IECTRL_EXIST,
340 -1, UNIPHIER_PIN_DRV_FIXED4,
341 -1, UNIPHIER_PIN_PULL_NONE),
342 UNIPHIER_PINCTRL_PIN(106, "SDA1", UNIPHIER_PIN_IECTRL_EXIST,
343 -1, UNIPHIER_PIN_DRV_FIXED4,
344 -1, UNIPHIER_PIN_PULL_NONE),
345 UNIPHIER_PINCTRL_PIN(107, "SCL1", UNIPHIER_PIN_IECTRL_EXIST,
346 -1, UNIPHIER_PIN_DRV_FIXED4,
347 -1, UNIPHIER_PIN_PULL_NONE),
348 UNIPHIER_PINCTRL_PIN(108, "SDA2", UNIPHIER_PIN_IECTRL_EXIST,
349 -1, UNIPHIER_PIN_DRV_FIXED4,
350 -1, UNIPHIER_PIN_PULL_NONE),
351 UNIPHIER_PINCTRL_PIN(109, "SCL2", UNIPHIER_PIN_IECTRL_EXIST,
352 -1, UNIPHIER_PIN_DRV_FIXED4,
353 -1, UNIPHIER_PIN_PULL_NONE),
354 UNIPHIER_PINCTRL_PIN(110, "SDA3", UNIPHIER_PIN_IECTRL_EXIST,
355 -1, UNIPHIER_PIN_DRV_FIXED4,
356 -1, UNIPHIER_PIN_PULL_NONE),
357 UNIPHIER_PINCTRL_PIN(111, "SCL3", UNIPHIER_PIN_IECTRL_EXIST,
358 -1, UNIPHIER_PIN_DRV_FIXED4,
359 -1, UNIPHIER_PIN_PULL_NONE),
360 UNIPHIER_PINCTRL_PIN(112, "SMTRST0", UNIPHIER_PIN_IECTRL_EXIST,
361 54, UNIPHIER_PIN_DRV_3BIT,
362 112, UNIPHIER_PIN_PULL_DOWN),
363 UNIPHIER_PINCTRL_PIN(113, "SMTCMD0", UNIPHIER_PIN_IECTRL_EXIST,
364 55, UNIPHIER_PIN_DRV_3BIT,
365 113, UNIPHIER_PIN_PULL_DOWN),
366 UNIPHIER_PINCTRL_PIN(114, "SMTD0", UNIPHIER_PIN_IECTRL_EXIST,
367 56, UNIPHIER_PIN_DRV_3BIT,
368 114, UNIPHIER_PIN_PULL_DOWN),
369 UNIPHIER_PINCTRL_PIN(115, "SMTSEL0", UNIPHIER_PIN_IECTRL_EXIST,
370 57, UNIPHIER_PIN_DRV_3BIT,
371 115, UNIPHIER_PIN_PULL_DOWN),
372 UNIPHIER_PINCTRL_PIN(116, "SMTCLK0CG", UNIPHIER_PIN_IECTRL_EXIST,
373 58, UNIPHIER_PIN_DRV_3BIT,
374 116, UNIPHIER_PIN_PULL_DOWN),
375 UNIPHIER_PINCTRL_PIN(117, "SMTDET0", UNIPHIER_PIN_IECTRL_EXIST,
376 59, UNIPHIER_PIN_DRV_3BIT,
377 117, UNIPHIER_PIN_PULL_DOWN),
378 UNIPHIER_PINCTRL_PIN(118, "SMTRST1", UNIPHIER_PIN_IECTRL_EXIST,
379 60, UNIPHIER_PIN_DRV_3BIT,
380 118, UNIPHIER_PIN_PULL_DOWN),
381 UNIPHIER_PINCTRL_PIN(119, "SMTCMD1", UNIPHIER_PIN_IECTRL_EXIST,
382 61, UNIPHIER_PIN_DRV_3BIT,
383 119, UNIPHIER_PIN_PULL_DOWN),
384 UNIPHIER_PINCTRL_PIN(120, "SMTD1", UNIPHIER_PIN_IECTRL_EXIST,
385 62, UNIPHIER_PIN_DRV_3BIT,
386 120, UNIPHIER_PIN_PULL_DOWN),
387 UNIPHIER_PINCTRL_PIN(121, "SMTSEL1", UNIPHIER_PIN_IECTRL_EXIST,
388 63, UNIPHIER_PIN_DRV_3BIT,
389 121, UNIPHIER_PIN_PULL_DOWN),
390 UNIPHIER_PINCTRL_PIN(122, "SMTCLK1CG", UNIPHIER_PIN_IECTRL_EXIST,
391 64, UNIPHIER_PIN_DRV_3BIT,
392 122, UNIPHIER_PIN_PULL_DOWN),
393 UNIPHIER_PINCTRL_PIN(123, "SMTDET1", UNIPHIER_PIN_IECTRL_EXIST,
394 65, UNIPHIER_PIN_DRV_3BIT,
395 123, UNIPHIER_PIN_PULL_DOWN),
396 UNIPHIER_PINCTRL_PIN(124, "SMTRST2", UNIPHIER_PIN_IECTRL_EXIST,
397 66, UNIPHIER_PIN_DRV_3BIT,
398 124, UNIPHIER_PIN_PULL_DOWN),
399 UNIPHIER_PINCTRL_PIN(125, "SMTCMD2", UNIPHIER_PIN_IECTRL_EXIST,
400 67, UNIPHIER_PIN_DRV_3BIT,
401 125, UNIPHIER_PIN_PULL_DOWN),
402 UNIPHIER_PINCTRL_PIN(126, "SMTD2", UNIPHIER_PIN_IECTRL_EXIST,
403 68, UNIPHIER_PIN_DRV_3BIT,
404 126, UNIPHIER_PIN_PULL_DOWN),
405 UNIPHIER_PINCTRL_PIN(127, "SMTSEL2", UNIPHIER_PIN_IECTRL_EXIST,
406 69, UNIPHIER_PIN_DRV_3BIT,
407 127, UNIPHIER_PIN_PULL_DOWN),
408 UNIPHIER_PINCTRL_PIN(128, "SMTCLK2CG", UNIPHIER_PIN_IECTRL_EXIST,
409 70, UNIPHIER_PIN_DRV_3BIT,
410 128, UNIPHIER_PIN_PULL_DOWN),
411 UNIPHIER_PINCTRL_PIN(129, "SMTDET2", UNIPHIER_PIN_IECTRL_EXIST,
412 71, UNIPHIER_PIN_DRV_3BIT,
413 129, UNIPHIER_PIN_PULL_DOWN),
414 UNIPHIER_PINCTRL_PIN(130, "CH0CLK", UNIPHIER_PIN_IECTRL_EXIST,
415 72, UNIPHIER_PIN_DRV_3BIT,
416 130, UNIPHIER_PIN_PULL_DOWN),
417 UNIPHIER_PINCTRL_PIN(131, "CH0PSYNC", UNIPHIER_PIN_IECTRL_EXIST,
418 73, UNIPHIER_PIN_DRV_3BIT,
419 131, UNIPHIER_PIN_PULL_DOWN),
420 UNIPHIER_PINCTRL_PIN(132, "CH0VAL", UNIPHIER_PIN_IECTRL_EXIST,
421 74, UNIPHIER_PIN_DRV_3BIT,
422 132, UNIPHIER_PIN_PULL_DOWN),
423 UNIPHIER_PINCTRL_PIN(133, "CH0DATA", UNIPHIER_PIN_IECTRL_EXIST,
424 75, UNIPHIER_PIN_DRV_3BIT,
425 133, UNIPHIER_PIN_PULL_DOWN),
426 UNIPHIER_PINCTRL_PIN(134, "CH1CLK", UNIPHIER_PIN_IECTRL_EXIST,
427 76, UNIPHIER_PIN_DRV_3BIT,
428 134, UNIPHIER_PIN_PULL_DOWN),
429 UNIPHIER_PINCTRL_PIN(135, "CH1PSYNC", UNIPHIER_PIN_IECTRL_EXIST,
430 77, UNIPHIER_PIN_DRV_3BIT,
431 135, UNIPHIER_PIN_PULL_DOWN),
432 UNIPHIER_PINCTRL_PIN(136, "CH1VAL", UNIPHIER_PIN_IECTRL_EXIST,
433 78, UNIPHIER_PIN_DRV_3BIT,
434 136, UNIPHIER_PIN_PULL_DOWN),
435 UNIPHIER_PINCTRL_PIN(137, "CH1DATA", UNIPHIER_PIN_IECTRL_EXIST,
436 79, UNIPHIER_PIN_DRV_3BIT,
437 137, UNIPHIER_PIN_PULL_DOWN),
438 UNIPHIER_PINCTRL_PIN(138, "CH2CLK", UNIPHIER_PIN_IECTRL_EXIST,
439 80, UNIPHIER_PIN_DRV_3BIT,
440 138, UNIPHIER_PIN_PULL_DOWN),
441 UNIPHIER_PINCTRL_PIN(139, "CH2PSYNC", UNIPHIER_PIN_IECTRL_EXIST,
442 81, UNIPHIER_PIN_DRV_3BIT,
443 139, UNIPHIER_PIN_PULL_DOWN),
444 UNIPHIER_PINCTRL_PIN(140, "CH2VAL", UNIPHIER_PIN_IECTRL_EXIST,
445 82, UNIPHIER_PIN_DRV_3BIT,
446 140, UNIPHIER_PIN_PULL_DOWN),
447 UNIPHIER_PINCTRL_PIN(141, "CH2DATA", UNIPHIER_PIN_IECTRL_EXIST,
448 83, UNIPHIER_PIN_DRV_3BIT,
449 141, UNIPHIER_PIN_PULL_DOWN),
450 UNIPHIER_PINCTRL_PIN(142, "HS0BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
451 84, UNIPHIER_PIN_DRV_3BIT,
452 142, UNIPHIER_PIN_PULL_DOWN),
453 UNIPHIER_PINCTRL_PIN(143, "HS0SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
454 85, UNIPHIER_PIN_DRV_3BIT,
455 143, UNIPHIER_PIN_PULL_DOWN),
456 UNIPHIER_PINCTRL_PIN(144, "HS0VALIN", UNIPHIER_PIN_IECTRL_EXIST,
457 86, UNIPHIER_PIN_DRV_3BIT,
458 144, UNIPHIER_PIN_PULL_DOWN),
459 UNIPHIER_PINCTRL_PIN(145, "HS0DIN0", UNIPHIER_PIN_IECTRL_EXIST,
460 87, UNIPHIER_PIN_DRV_3BIT,
461 145, UNIPHIER_PIN_PULL_DOWN),
462 UNIPHIER_PINCTRL_PIN(146, "HS0DIN1", UNIPHIER_PIN_IECTRL_EXIST,
463 88, UNIPHIER_PIN_DRV_3BIT,
464 146, UNIPHIER_PIN_PULL_DOWN),
465 UNIPHIER_PINCTRL_PIN(147, "HS0DIN2", UNIPHIER_PIN_IECTRL_EXIST,
466 89, UNIPHIER_PIN_DRV_3BIT,
467 147, UNIPHIER_PIN_PULL_DOWN),
468 UNIPHIER_PINCTRL_PIN(148, "HS0DIN3", UNIPHIER_PIN_IECTRL_EXIST,
469 90, UNIPHIER_PIN_DRV_3BIT,
470 148, UNIPHIER_PIN_PULL_DOWN),
471 UNIPHIER_PINCTRL_PIN(149, "HS0DIN4", UNIPHIER_PIN_IECTRL_EXIST,
472 91, UNIPHIER_PIN_DRV_3BIT,
473 149, UNIPHIER_PIN_PULL_DOWN),
474 UNIPHIER_PINCTRL_PIN(150, "HS0DIN5", UNIPHIER_PIN_IECTRL_EXIST,
475 92, UNIPHIER_PIN_DRV_3BIT,
476 150, UNIPHIER_PIN_PULL_DOWN),
477 UNIPHIER_PINCTRL_PIN(151, "HS0DIN6", UNIPHIER_PIN_IECTRL_EXIST,
478 93, UNIPHIER_PIN_DRV_3BIT,
479 151, UNIPHIER_PIN_PULL_DOWN),
480 UNIPHIER_PINCTRL_PIN(152, "HS0DIN7", UNIPHIER_PIN_IECTRL_EXIST,
481 94, UNIPHIER_PIN_DRV_3BIT,
482 152, UNIPHIER_PIN_PULL_DOWN),
483 UNIPHIER_PINCTRL_PIN(153, "HS1BCLKIN", UNIPHIER_PIN_IECTRL_EXIST,
484 95, UNIPHIER_PIN_DRV_3BIT,
485 153, UNIPHIER_PIN_PULL_DOWN),
486 UNIPHIER_PINCTRL_PIN(154, "HS1SYNCIN", UNIPHIER_PIN_IECTRL_EXIST,
487 96, UNIPHIER_PIN_DRV_3BIT,
488 154, UNIPHIER_PIN_PULL_DOWN),
489 UNIPHIER_PINCTRL_PIN(155, "HS1VALIN", UNIPHIER_PIN_IECTRL_EXIST,
490 97, UNIPHIER_PIN_DRV_3BIT,
491 155, UNIPHIER_PIN_PULL_DOWN),
492 UNIPHIER_PINCTRL_PIN(156, "HS1DIN0", UNIPHIER_PIN_IECTRL_EXIST,
493 98, UNIPHIER_PIN_DRV_3BIT,
494 156, UNIPHIER_PIN_PULL_DOWN),
495 UNIPHIER_PINCTRL_PIN(157, "HS1DIN1", UNIPHIER_PIN_IECTRL_EXIST,
496 99, UNIPHIER_PIN_DRV_3BIT,
497 157, UNIPHIER_PIN_PULL_DOWN),
498 UNIPHIER_PINCTRL_PIN(158, "HS1DIN2", UNIPHIER_PIN_IECTRL_EXIST,
499 100, UNIPHIER_PIN_DRV_3BIT,
500 158, UNIPHIER_PIN_PULL_DOWN),
501 UNIPHIER_PINCTRL_PIN(159, "HS1DIN3", UNIPHIER_PIN_IECTRL_EXIST,
502 101, UNIPHIER_PIN_DRV_3BIT,
503 159, UNIPHIER_PIN_PULL_DOWN),
504 UNIPHIER_PINCTRL_PIN(160, "HS1DIN4", UNIPHIER_PIN_IECTRL_EXIST,
505 102, UNIPHIER_PIN_DRV_3BIT,
506 160, UNIPHIER_PIN_PULL_DOWN),
507 UNIPHIER_PINCTRL_PIN(161, "HS1DIN5", UNIPHIER_PIN_IECTRL_EXIST,
508 103, UNIPHIER_PIN_DRV_3BIT,
509 161, UNIPHIER_PIN_PULL_DOWN),
510 UNIPHIER_PINCTRL_PIN(162, "HS1DIN6", UNIPHIER_PIN_IECTRL_EXIST,
511 104, UNIPHIER_PIN_DRV_3BIT,
512 162, UNIPHIER_PIN_PULL_DOWN),
513 UNIPHIER_PINCTRL_PIN(163, "HS1DIN7", UNIPHIER_PIN_IECTRL_EXIST,
514 105, UNIPHIER_PIN_DRV_3BIT,
515 163, UNIPHIER_PIN_PULL_DOWN),
516 UNIPHIER_PINCTRL_PIN(164, "LINKCLK", UNIPHIER_PIN_IECTRL_EXIST,
517 106, UNIPHIER_PIN_DRV_3BIT,
518 164, UNIPHIER_PIN_PULL_DOWN),
519 UNIPHIER_PINCTRL_PIN(165, "LINKREQ", UNIPHIER_PIN_IECTRL_EXIST,
520 107, UNIPHIER_PIN_DRV_3BIT,
521 165, UNIPHIER_PIN_PULL_DOWN),
522 UNIPHIER_PINCTRL_PIN(166, "LINKCTL0", UNIPHIER_PIN_IECTRL_EXIST,
523 108, UNIPHIER_PIN_DRV_3BIT,
524 166, UNIPHIER_PIN_PULL_DOWN),
525 UNIPHIER_PINCTRL_PIN(167, "LINKCTL1", UNIPHIER_PIN_IECTRL_EXIST,
526 109, UNIPHIER_PIN_DRV_3BIT,
527 167, UNIPHIER_PIN_PULL_DOWN),
528 UNIPHIER_PINCTRL_PIN(168, "LINKDT0", UNIPHIER_PIN_IECTRL_EXIST,
529 110, UNIPHIER_PIN_DRV_3BIT,
530 168, UNIPHIER_PIN_PULL_DOWN),
531 UNIPHIER_PINCTRL_PIN(169, "LINKDT1", UNIPHIER_PIN_IECTRL_EXIST,
532 111, UNIPHIER_PIN_DRV_3BIT,
533 169, UNIPHIER_PIN_PULL_DOWN),
534 UNIPHIER_PINCTRL_PIN(170, "LINKDT2", UNIPHIER_PIN_IECTRL_EXIST,
535 112, UNIPHIER_PIN_DRV_3BIT,
536 170, UNIPHIER_PIN_PULL_DOWN),
537 UNIPHIER_PINCTRL_PIN(171, "LINKDT3", UNIPHIER_PIN_IECTRL_EXIST,
538 113, UNIPHIER_PIN_DRV_3BIT,
539 171, UNIPHIER_PIN_PULL_DOWN),
540 UNIPHIER_PINCTRL_PIN(172, "LINKDT4", UNIPHIER_PIN_IECTRL_EXIST,
541 114, UNIPHIER_PIN_DRV_3BIT,
542 172, UNIPHIER_PIN_PULL_DOWN),
543 UNIPHIER_PINCTRL_PIN(173, "LINKDT5", UNIPHIER_PIN_IECTRL_EXIST,
544 115, UNIPHIER_PIN_DRV_3BIT,
545 173, UNIPHIER_PIN_PULL_DOWN),
546 UNIPHIER_PINCTRL_PIN(174, "LINKDT6", UNIPHIER_PIN_IECTRL_EXIST,
547 116, UNIPHIER_PIN_DRV_3BIT,
548 174, UNIPHIER_PIN_PULL_DOWN),
549 UNIPHIER_PINCTRL_PIN(175, "LINKDT7", UNIPHIER_PIN_IECTRL_EXIST,
550 117, UNIPHIER_PIN_DRV_3BIT,
551 175, UNIPHIER_PIN_PULL_DOWN),
552 UNIPHIER_PINCTRL_PIN(176, "H0RXDDCSDA", UNIPHIER_PIN_IECTRL_EXIST,
553 -1, UNIPHIER_PIN_DRV_FIXED4,
554 -1, UNIPHIER_PIN_PULL_NONE),
555 UNIPHIER_PINCTRL_PIN(177, "H0RXDDCSCL", UNIPHIER_PIN_IECTRL_EXIST,
556 -1, UNIPHIER_PIN_DRV_FIXED4,
557 -1, UNIPHIER_PIN_PULL_NONE),
558 UNIPHIER_PINCTRL_PIN(178, "H0RXHPDO", UNIPHIER_PIN_IECTRL_EXIST,
559 -1, UNIPHIER_PIN_DRV_FIXED4,
560 -1, UNIPHIER_PIN_PULL_NONE),
561 UNIPHIER_PINCTRL_PIN(179, "H0RX5VDETI", UNIPHIER_PIN_IECTRL_EXIST,
562 -1, UNIPHIER_PIN_DRV_FIXED4,
563 -1, UNIPHIER_PIN_PULL_NONE),
564 UNIPHIER_PINCTRL_PIN(180, "H0TXDDCSDA", UNIPHIER_PIN_IECTRL_EXIST,
565 -1, UNIPHIER_PIN_DRV_FIXED4,
566 -1, UNIPHIER_PIN_PULL_NONE),
567 UNIPHIER_PINCTRL_PIN(181, "H0TXDDCSCL", UNIPHIER_PIN_IECTRL_EXIST,
568 -1, UNIPHIER_PIN_DRV_FIXED4,
569 -1, UNIPHIER_PIN_PULL_NONE),
570 UNIPHIER_PINCTRL_PIN(182, "H0TXHPDI", UNIPHIER_PIN_IECTRL_EXIST,
571 -1, UNIPHIER_PIN_DRV_FIXED4,
572 -1, UNIPHIER_PIN_PULL_NONE),
573 UNIPHIER_PINCTRL_PIN(183, "H1TXDDCSDA", UNIPHIER_PIN_IECTRL_EXIST,
574 -1, UNIPHIER_PIN_DRV_FIXED4,
575 -1, UNIPHIER_PIN_PULL_NONE),
576 UNIPHIER_PINCTRL_PIN(184, "H1TXDDCSCL", UNIPHIER_PIN_IECTRL_EXIST,
577 -1, UNIPHIER_PIN_DRV_FIXED4,
578 -1, UNIPHIER_PIN_PULL_NONE),
579 UNIPHIER_PINCTRL_PIN(185, "H1TXHPDI", UNIPHIER_PIN_IECTRL_EXIST,
580 -1, UNIPHIER_PIN_DRV_FIXED4,
581 -1, UNIPHIER_PIN_PULL_NONE),
582 UNIPHIER_PINCTRL_PIN(186, "AI1ADCCK", UNIPHIER_PIN_IECTRL_EXIST,
583 118, UNIPHIER_PIN_DRV_3BIT,
584 186, UNIPHIER_PIN_PULL_DOWN),
585 UNIPHIER_PINCTRL_PIN(187, "AI1BCK", UNIPHIER_PIN_IECTRL_EXIST,
586 119, UNIPHIER_PIN_DRV_3BIT,
587 187, UNIPHIER_PIN_PULL_DOWN),
588 UNIPHIER_PINCTRL_PIN(188, "AI1LRCK", UNIPHIER_PIN_IECTRL_EXIST,
589 120, UNIPHIER_PIN_DRV_3BIT,
590 188, UNIPHIER_PIN_PULL_DOWN),
591 UNIPHIER_PINCTRL_PIN(189, "AI1D0", UNIPHIER_PIN_IECTRL_EXIST,
592 121, UNIPHIER_PIN_DRV_3BIT,
593 189, UNIPHIER_PIN_PULL_DOWN),
594 UNIPHIER_PINCTRL_PIN(190, "AO1IEC", UNIPHIER_PIN_IECTRL_EXIST,
595 122, UNIPHIER_PIN_DRV_3BIT,
596 190, UNIPHIER_PIN_PULL_DOWN),
597 UNIPHIER_PINCTRL_PIN(191, "AO2IEC", UNIPHIER_PIN_IECTRL_EXIST,
598 123, UNIPHIER_PIN_DRV_3BIT,
599 191, UNIPHIER_PIN_PULL_DOWN),
600 UNIPHIER_PINCTRL_PIN(192, "AO2DACCK", UNIPHIER_PIN_IECTRL_EXIST,
601 124, UNIPHIER_PIN_DRV_3BIT,
602 192, UNIPHIER_PIN_PULL_DOWN),
603 UNIPHIER_PINCTRL_PIN(193, "AO2BCK", UNIPHIER_PIN_IECTRL_EXIST,
604 125, UNIPHIER_PIN_DRV_3BIT,
605 193, UNIPHIER_PIN_PULL_DOWN),
606 UNIPHIER_PINCTRL_PIN(194, "AO2LRCK", UNIPHIER_PIN_IECTRL_EXIST,
607 126, UNIPHIER_PIN_DRV_3BIT,
608 194, UNIPHIER_PIN_PULL_DOWN),
609 UNIPHIER_PINCTRL_PIN(195, "AO2D0", UNIPHIER_PIN_IECTRL_EXIST,
610 127, UNIPHIER_PIN_DRV_3BIT,
611 195, UNIPHIER_PIN_PULL_DOWN),
612 UNIPHIER_PINCTRL_PIN(196, "AO2D1", UNIPHIER_PIN_IECTRL_EXIST,
613 128, UNIPHIER_PIN_DRV_3BIT,
614 196, UNIPHIER_PIN_PULL_DOWN),
615 UNIPHIER_PINCTRL_PIN(197, "AO2D2", UNIPHIER_PIN_IECTRL_EXIST,
616 129, UNIPHIER_PIN_DRV_3BIT,
617 197, UNIPHIER_PIN_PULL_DOWN),
618 UNIPHIER_PINCTRL_PIN(198, "AO2D3", UNIPHIER_PIN_IECTRL_EXIST,
619 130, UNIPHIER_PIN_DRV_3BIT,
620 198, UNIPHIER_PIN_PULL_DOWN),
621 UNIPHIER_PINCTRL_PIN(199, "AO3DACCK", UNIPHIER_PIN_IECTRL_EXIST,
622 131, UNIPHIER_PIN_DRV_3BIT,
623 199, UNIPHIER_PIN_PULL_DOWN),
624 UNIPHIER_PINCTRL_PIN(200, "AO3BCK", UNIPHIER_PIN_IECTRL_EXIST,
625 132, UNIPHIER_PIN_DRV_3BIT,
626 200, UNIPHIER_PIN_PULL_DOWN),
627 UNIPHIER_PINCTRL_PIN(201, "AO3LRCK", UNIPHIER_PIN_IECTRL_EXIST,
628 133, UNIPHIER_PIN_DRV_3BIT,
629 201, UNIPHIER_PIN_PULL_DOWN),
630 UNIPHIER_PINCTRL_PIN(202, "AO3D0", UNIPHIER_PIN_IECTRL_EXIST,
631 134, UNIPHIER_PIN_DRV_3BIT,
632 202, UNIPHIER_PIN_PULL_DOWN),
633 UNIPHIER_PINCTRL_PIN(203, "VI1CLK", UNIPHIER_PIN_IECTRL_EXIST,
634 135, UNIPHIER_PIN_DRV_3BIT,
635 203, UNIPHIER_PIN_PULL_DOWN),
636 UNIPHIER_PINCTRL_PIN(204, "VI1G2", UNIPHIER_PIN_IECTRL_EXIST,
637 136, UNIPHIER_PIN_DRV_3BIT,
638 204, UNIPHIER_PIN_PULL_DOWN),
639 UNIPHIER_PINCTRL_PIN(205, "VI1G3", UNIPHIER_PIN_IECTRL_EXIST,
640 137, UNIPHIER_PIN_DRV_3BIT,
641 205, UNIPHIER_PIN_PULL_DOWN),
642 UNIPHIER_PINCTRL_PIN(206, "VI1G4", UNIPHIER_PIN_IECTRL_EXIST,
643 138, UNIPHIER_PIN_DRV_3BIT,
644 206, UNIPHIER_PIN_PULL_DOWN),
645 UNIPHIER_PINCTRL_PIN(207, "VI1G5", UNIPHIER_PIN_IECTRL_EXIST,
646 139, UNIPHIER_PIN_DRV_3BIT,
647 207, UNIPHIER_PIN_PULL_DOWN),
648 UNIPHIER_PINCTRL_PIN(208, "VI1G6", UNIPHIER_PIN_IECTRL_EXIST,
649 140, UNIPHIER_PIN_DRV_3BIT,
650 208, UNIPHIER_PIN_PULL_DOWN),
651 UNIPHIER_PINCTRL_PIN(209, "VI1G7", UNIPHIER_PIN_IECTRL_EXIST,
652 141, UNIPHIER_PIN_DRV_3BIT,
653 209, UNIPHIER_PIN_PULL_DOWN),
654 UNIPHIER_PINCTRL_PIN(210, "VI1G8", UNIPHIER_PIN_IECTRL_EXIST,
655 142, UNIPHIER_PIN_DRV_3BIT,
656 210, UNIPHIER_PIN_PULL_DOWN),
657 UNIPHIER_PINCTRL_PIN(211, "VI1G9", UNIPHIER_PIN_IECTRL_EXIST,
658 143, UNIPHIER_PIN_DRV_3BIT,
659 211, UNIPHIER_PIN_PULL_DOWN),
660 UNIPHIER_PINCTRL_PIN(212, "FANPWM", UNIPHIER_PIN_IECTRL_EXIST,
661 144, UNIPHIER_PIN_DRV_3BIT,
662 212, UNIPHIER_PIN_PULL_DOWN),
663 UNIPHIER_PINCTRL_PIN(213, "CK27EXO", UNIPHIER_PIN_IECTRL_EXIST,
664 145, UNIPHIER_PIN_DRV_3BIT,
665 213, UNIPHIER_PIN_PULL_DOWN),
666 UNIPHIER_PINCTRL_PIN(214, "CK27AO", UNIPHIER_PIN_IECTRL_EXIST,
667 146, UNIPHIER_PIN_DRV_3BIT,
668 214, UNIPHIER_PIN_PULL_DOWN),
669 UNIPHIER_PINCTRL_PIN(215, "CK27EXI", UNIPHIER_PIN_IECTRL_EXIST,
670 147, UNIPHIER_PIN_DRV_3BIT,
671 215, UNIPHIER_PIN_PULL_DOWN),
672 UNIPHIER_PINCTRL_PIN(216, "VEXCKA", UNIPHIER_PIN_IECTRL_EXIST,
673 148, UNIPHIER_PIN_DRV_3BIT,
674 216, UNIPHIER_PIN_PULL_DOWN),
675 UNIPHIER_PINCTRL_PIN(217, "AEXCKA", UNIPHIER_PIN_IECTRL_EXIST,
676 149, UNIPHIER_PIN_DRV_3BIT,
677 217, UNIPHIER_PIN_PULL_DOWN),
678 UNIPHIER_PINCTRL_PIN(218, "ASEL", UNIPHIER_PIN_IECTRL_EXIST,
679 150, UNIPHIER_PIN_DRV_3BIT,
680 218, UNIPHIER_PIN_PULL_DOWN),
681 UNIPHIER_PINCTRL_PIN(219, "XIRQ0", UNIPHIER_PIN_IECTRL_EXIST,
682 151, UNIPHIER_PIN_DRV_3BIT,
683 219, UNIPHIER_PIN_PULL_DOWN),
684 UNIPHIER_PINCTRL_PIN(220, "XIRQ1", UNIPHIER_PIN_IECTRL_EXIST,
685 152, UNIPHIER_PIN_DRV_3BIT,
686 220, UNIPHIER_PIN_PULL_DOWN),
687 UNIPHIER_PINCTRL_PIN(221, "XIRQ2", UNIPHIER_PIN_IECTRL_EXIST,
688 153, UNIPHIER_PIN_DRV_3BIT,
689 221, UNIPHIER_PIN_PULL_DOWN),
690 UNIPHIER_PINCTRL_PIN(222, "XIRQ3", UNIPHIER_PIN_IECTRL_EXIST,
691 154, UNIPHIER_PIN_DRV_3BIT,
692 222, UNIPHIER_PIN_PULL_DOWN),
693 UNIPHIER_PINCTRL_PIN(223, "XIRQ4", UNIPHIER_PIN_IECTRL_EXIST,
694 155, UNIPHIER_PIN_DRV_3BIT,
695 223, UNIPHIER_PIN_PULL_DOWN),
696 UNIPHIER_PINCTRL_PIN(224, "XIRQ5", UNIPHIER_PIN_IECTRL_EXIST,
697 156, UNIPHIER_PIN_DRV_3BIT,
698 224, UNIPHIER_PIN_PULL_DOWN),
699 UNIPHIER_PINCTRL_PIN(225, "XIRQ6", UNIPHIER_PIN_IECTRL_EXIST,
700 157, UNIPHIER_PIN_DRV_3BIT,
701 225, UNIPHIER_PIN_PULL_DOWN),
702 UNIPHIER_PINCTRL_PIN(226, "XIRQ7", UNIPHIER_PIN_IECTRL_EXIST,
703 158, UNIPHIER_PIN_DRV_3BIT,
704 226, UNIPHIER_PIN_PULL_DOWN),
705 UNIPHIER_PINCTRL_PIN(227, "XIRQ8", UNIPHIER_PIN_IECTRL_EXIST,
706 159, UNIPHIER_PIN_DRV_3BIT,
707 227, UNIPHIER_PIN_PULL_DOWN),
708 UNIPHIER_PINCTRL_PIN(228, "XIRQ9", UNIPHIER_PIN_IECTRL_EXIST,
709 160, UNIPHIER_PIN_DRV_3BIT,
710 228, UNIPHIER_PIN_PULL_DOWN),
711 UNIPHIER_PINCTRL_PIN(229, "XIRQ10", UNIPHIER_PIN_IECTRL_EXIST,
712 161, UNIPHIER_PIN_DRV_3BIT,
713 229, UNIPHIER_PIN_PULL_DOWN),
714 UNIPHIER_PINCTRL_PIN(230, "XIRQ11", UNIPHIER_PIN_IECTRL_EXIST,
715 162, UNIPHIER_PIN_DRV_3BIT,
716 230, UNIPHIER_PIN_PULL_DOWN),
717 UNIPHIER_PINCTRL_PIN(231, "XIRQ12", UNIPHIER_PIN_IECTRL_EXIST,
718 163, UNIPHIER_PIN_DRV_3BIT,
719 231, UNIPHIER_PIN_PULL_DOWN),
720 UNIPHIER_PINCTRL_PIN(232, "XIRQ13", UNIPHIER_PIN_IECTRL_EXIST,
721 164, UNIPHIER_PIN_DRV_3BIT,
722 232, UNIPHIER_PIN_PULL_DOWN),
723 UNIPHIER_PINCTRL_PIN(233, "XIRQ14", UNIPHIER_PIN_IECTRL_EXIST,
724 165, UNIPHIER_PIN_DRV_3BIT,
725 233, UNIPHIER_PIN_PULL_DOWN),
726 UNIPHIER_PINCTRL_PIN(234, "XIRQ15", UNIPHIER_PIN_IECTRL_EXIST,
727 166, UNIPHIER_PIN_DRV_3BIT,
728 234, UNIPHIER_PIN_PULL_DOWN),
729 UNIPHIER_PINCTRL_PIN(235, "PORT00", UNIPHIER_PIN_IECTRL_EXIST,
730 167, UNIPHIER_PIN_DRV_3BIT,
731 235, UNIPHIER_PIN_PULL_DOWN),
732 UNIPHIER_PINCTRL_PIN(236, "PORT01", UNIPHIER_PIN_IECTRL_EXIST,
733 168, UNIPHIER_PIN_DRV_3BIT,
734 236, UNIPHIER_PIN_PULL_DOWN),
735 UNIPHIER_PINCTRL_PIN(237, "PORT02", UNIPHIER_PIN_IECTRL_EXIST,
736 169, UNIPHIER_PIN_DRV_3BIT,
737 237, UNIPHIER_PIN_PULL_DOWN),
738 UNIPHIER_PINCTRL_PIN(238, "PORT03", UNIPHIER_PIN_IECTRL_EXIST,
739 170, UNIPHIER_PIN_DRV_3BIT,
740 238, UNIPHIER_PIN_PULL_DOWN),
741 UNIPHIER_PINCTRL_PIN(239, "PORT04", UNIPHIER_PIN_IECTRL_EXIST,
742 171, UNIPHIER_PIN_DRV_3BIT,
743 239, UNIPHIER_PIN_PULL_DOWN),
744 UNIPHIER_PINCTRL_PIN(240, "PORT05", UNIPHIER_PIN_IECTRL_EXIST,
745 172, UNIPHIER_PIN_DRV_3BIT,
746 240, UNIPHIER_PIN_PULL_DOWN),
747 UNIPHIER_PINCTRL_PIN(241, "PORT06", UNIPHIER_PIN_IECTRL_EXIST,
748 173, UNIPHIER_PIN_DRV_3BIT,
749 241, UNIPHIER_PIN_PULL_DOWN),
750 UNIPHIER_PINCTRL_PIN(242, "PORT07", UNIPHIER_PIN_IECTRL_EXIST,
751 174, UNIPHIER_PIN_DRV_3BIT,
752 242, UNIPHIER_PIN_PULL_DOWN),
753 UNIPHIER_PINCTRL_PIN(243, "PORT10", UNIPHIER_PIN_IECTRL_EXIST,
754 175, UNIPHIER_PIN_DRV_3BIT,
755 243, UNIPHIER_PIN_PULL_DOWN),
756 UNIPHIER_PINCTRL_PIN(244, "PORT11", UNIPHIER_PIN_IECTRL_EXIST,
757 176, UNIPHIER_PIN_DRV_3BIT,
758 244, UNIPHIER_PIN_PULL_DOWN),
759 UNIPHIER_PINCTRL_PIN(245, "PORT12", UNIPHIER_PIN_IECTRL_EXIST,
760 177, UNIPHIER_PIN_DRV_3BIT,
761 245, UNIPHIER_PIN_PULL_DOWN),
762 UNIPHIER_PINCTRL_PIN(246, "PORT13", UNIPHIER_PIN_IECTRL_EXIST,
763 178, UNIPHIER_PIN_DRV_3BIT,
764 246, UNIPHIER_PIN_PULL_DOWN),
765 UNIPHIER_PINCTRL_PIN(247, "PORT14", UNIPHIER_PIN_IECTRL_EXIST,
766 179, UNIPHIER_PIN_DRV_3BIT,
767 247, UNIPHIER_PIN_PULL_DOWN),
768 UNIPHIER_PINCTRL_PIN(248, "PORT15", UNIPHIER_PIN_IECTRL_EXIST,
769 180, UNIPHIER_PIN_DRV_3BIT,
770 248, UNIPHIER_PIN_PULL_DOWN),
771 UNIPHIER_PINCTRL_PIN(249, "PORT16", UNIPHIER_PIN_IECTRL_EXIST,
772 181, UNIPHIER_PIN_DRV_3BIT,
773 249, UNIPHIER_PIN_PULL_DOWN),
774 UNIPHIER_PINCTRL_PIN(250, "PORT17", UNIPHIER_PIN_IECTRL_EXIST,
775 182, UNIPHIER_PIN_DRV_3BIT,
776 250, UNIPHIER_PIN_PULL_DOWN),
777};
778
779static const unsigned int emmc_pins[] = {31, 32, 33, 34, 35, 36, 37, 38};
780static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0};
781static const unsigned int emmc_dat8_pins[] = {39, 40, 41, 42};
782static const int emmc_dat8_muxvals[] = {0, 0, 0, 0};
783static const unsigned int ether_rgmii_pins[] = {52, 53, 54, 55, 56, 57, 58, 59,
784 60, 61, 62, 63, 64, 65, 66, 67};
785static const int ether_rgmii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
786 0, 0, 0};
787static const unsigned int ether_rmii_pins[] = {52, 53, 54, 55, 56, 57, 58, 59,
788 61, 63, 64, 67};
789static const int ether_rmii_muxvals[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
790static const unsigned int ether1_rgmii_pins[] = {68, 69, 70, 71, 72, 73, 74,
791 75, 76, 77, 78, 79, 80, 81,
792 82, 83};
793static const int ether1_rgmii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
794 0, 0, 0, 0};
795static const unsigned int ether1_rmii_pins[] = {68, 69, 70, 71, 72, 73, 74, 75,
796 77, 79, 80, 83};
797static const int ether1_rmii_muxvals[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
798static const unsigned int i2c0_pins[] = {104, 105};
799static const int i2c0_muxvals[] = {0, 0};
800static const unsigned int i2c1_pins[] = {106, 107};
801static const int i2c1_muxvals[] = {0, 0};
802static const unsigned int i2c2_pins[] = {108, 109};
803static const int i2c2_muxvals[] = {0, 0};
804static const unsigned int i2c3_pins[] = {110, 111};
805static const int i2c3_muxvals[] = {0, 0};
806static const unsigned int nand_pins[] = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
807 26, 27, 28, 29, 30};
808static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
809static const unsigned int sd_pins[] = {43, 44, 45, 46, 47, 48, 49, 50, 51};
810static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
811static const unsigned int system_bus_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
812 11, 12, 13, 14};
813static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
814 0};
815static const unsigned int system_bus_cs1_pins[] = {15};
816static const int system_bus_cs1_muxvals[] = {0};
817static const unsigned int uart0_pins[] = {92, 93};
818static const int uart0_muxvals[] = {0, 0};
819static const unsigned int uart1_pins[] = {94, 95};
820static const int uart1_muxvals[] = {0, 0};
821static const unsigned int uart2_pins[] = {96, 97};
822static const int uart2_muxvals[] = {0, 0};
823static const unsigned int uart3_pins[] = {98, 99};
824static const int uart3_muxvals[] = {0, 0};
825static const unsigned int usb0_pins[] = {84, 85};
826static const int usb0_muxvals[] = {0, 0};
827static const unsigned int usb1_pins[] = {86, 87};
828static const int usb1_muxvals[] = {0, 0};
829static const unsigned int usb2_pins[] = {88, 89};
830static const int usb2_muxvals[] = {0, 0};
831static const unsigned int usb3_pins[] = {90, 91};
832static const int usb3_muxvals[] = {0, 0};
833static const unsigned int gpio_range0_pins[] = {
834 235, 236, 237, 238, 239, 240, 241, 242, /* PORT0x */
835 243, 244, 245, 246, 247, 248, 249, 250, /* PORT1x */
836 0, 1, 2, 3, 4, 5, 6, 7, /* PORT2x */
837 8, 9, 10, 11, 12, 13, 14, 15, /* PORT3x */
838 16, 17, 18, 19, 20, 21, 22, 23, /* PORT4x */
839 24, 25, 26, 27, 28, 29, 30, 31, /* PORT5x */
840 43, 44, 45, 46, 47, 48, 49, 50, /* PORT6x */
841 51, 52, 53, 54, 55, 56, 57, 58, /* PORT7x */
842 59, 60, 61, 62, 63, 64, 65, 66, /* PORT8x */
843 67, 68, 69, 70, 71, 72, 73, 74, /* PORT9x */
844 75, 76, 77, 78, 79, 80, 81, 82, /* PORT10x */
845};
846static const unsigned int gpio_range1_pins[] = {
847 83, 84, 85, 86, 87, 88, 89, 90, /* PORT13x */
848 91, 92, 93, 94, 95, 96, 97, 98, /* PORT14x */
849 219, 220, 221, 222, 223, 224, 225, 226, /* XIRQ0-7 */
850 227, 228, 229, 230, 231, 232, 233, 234, /* XIRQ8-15 */
851 215, 216, 217, 218, 164, 165, 166, 167, /* XIRQ16-23 */
852 104, 105, 106, 107, 108, 109, 110, 111, /* PORT18x */
853 176, 177, 178, 179, 180, 181, 182, 183, /* PORT19x */
854 184, 185, /* PORT200-201 */
855};
856static const unsigned int gpio_range2_pins[] = {
857 99, 100, 101, 102, 103, 112, 113, 114, /* PORT21x */
858 115, 116, 117, 118, 119, 120, 121, 122, /* PORT22x */
859 123, 124, 125, 126, 127, 128, 129, 130, /* PORT23x */
860 131, 132, 133, 134, 135, 136, 137, 138, /* PORT24x */
861 139, 140, 141, 142, 143, 144, 145, 146, /* PORT25x */
862 147, 148, 149, 150, 151, 152, 153, 154, /* PORT26x */
863 155, 156, 157, 158, 159, 160, 161, 162, /* PORT27x */
864 163, 164, 165, 166, 167, 168, 169, 170, /* PORT28x */
865 171, 172, 173, 174, 175, 186, 187, 188, /* PORT29x */
866 189, 190, 191, 192, 193, 194, 195, 196, /* PORT30x */
867 197, 198, 199, 200, 201, 202, 203, 204, /* PORT31x */
868 205, 206, 207, 208, 209, 210, 211, 212, /* PORT32x */
869 213, 214, 215, 216, 217, 218, 219, 220, /* PORT33x */
870 221, 222, 223, 224, 225, 226, 227, 228, /* PORT34x */
871 229, 230, 231, 232, 233, 234, /* PORT350-355 */
872};
873
874static const struct uniphier_pinctrl_group uniphier_pxs3_groups[] = {
875 UNIPHIER_PINCTRL_GROUP(emmc),
876 UNIPHIER_PINCTRL_GROUP(emmc_dat8),
877 UNIPHIER_PINCTRL_GROUP(ether_rgmii),
878 UNIPHIER_PINCTRL_GROUP(ether_rmii),
879 UNIPHIER_PINCTRL_GROUP(ether1_rgmii),
880 UNIPHIER_PINCTRL_GROUP(ether1_rmii),
881 UNIPHIER_PINCTRL_GROUP(i2c0),
882 UNIPHIER_PINCTRL_GROUP(i2c1),
883 UNIPHIER_PINCTRL_GROUP(i2c2),
884 UNIPHIER_PINCTRL_GROUP(i2c3),
885 UNIPHIER_PINCTRL_GROUP(nand),
886 UNIPHIER_PINCTRL_GROUP(sd),
887 UNIPHIER_PINCTRL_GROUP(system_bus),
888 UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
889 UNIPHIER_PINCTRL_GROUP(uart0),
890 UNIPHIER_PINCTRL_GROUP(uart1),
891 UNIPHIER_PINCTRL_GROUP(uart2),
892 UNIPHIER_PINCTRL_GROUP(uart3),
893 UNIPHIER_PINCTRL_GROUP(usb0),
894 UNIPHIER_PINCTRL_GROUP(usb1),
895 UNIPHIER_PINCTRL_GROUP(usb2),
896 UNIPHIER_PINCTRL_GROUP(usb3),
897 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
898 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
899 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
900};
901
902static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
903static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
904static const char * const ether_rmii_groups[] = {"ether_rmii"};
905static const char * const ether1_rgmii_groups[] = {"ether1_rgmii"};
906static const char * const ether1_rmii_groups[] = {"ether1_rmii"};
907static const char * const i2c0_groups[] = {"i2c0"};
908static const char * const i2c1_groups[] = {"i2c1"};
909static const char * const i2c2_groups[] = {"i2c2"};
910static const char * const i2c3_groups[] = {"i2c3"};
911static const char * const nand_groups[] = {"nand"};
912static const char * const sd_groups[] = {"sd"};
913static const char * const system_bus_groups[] = {"system_bus",
914 "system_bus_cs1"};
915static const char * const uart0_groups[] = {"uart0"};
916static const char * const uart1_groups[] = {"uart1"};
917static const char * const uart2_groups[] = {"uart2"};
918static const char * const uart3_groups[] = {"uart3"};
919static const char * const usb0_groups[] = {"usb0"};
920static const char * const usb1_groups[] = {"usb1"};
921static const char * const usb2_groups[] = {"usb2"};
922static const char * const usb3_groups[] = {"usb3"};
923
924static const struct uniphier_pinmux_function uniphier_pxs3_functions[] = {
925 UNIPHIER_PINMUX_FUNCTION(emmc),
926 UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
927 UNIPHIER_PINMUX_FUNCTION(ether_rmii),
928 UNIPHIER_PINMUX_FUNCTION(ether1_rgmii),
929 UNIPHIER_PINMUX_FUNCTION(ether1_rmii),
930 UNIPHIER_PINMUX_FUNCTION(i2c0),
931 UNIPHIER_PINMUX_FUNCTION(i2c1),
932 UNIPHIER_PINMUX_FUNCTION(i2c2),
933 UNIPHIER_PINMUX_FUNCTION(i2c3),
934 UNIPHIER_PINMUX_FUNCTION(nand),
935 UNIPHIER_PINMUX_FUNCTION(sd),
936 UNIPHIER_PINMUX_FUNCTION(system_bus),
937 UNIPHIER_PINMUX_FUNCTION(uart0),
938 UNIPHIER_PINMUX_FUNCTION(uart1),
939 UNIPHIER_PINMUX_FUNCTION(uart2),
940 UNIPHIER_PINMUX_FUNCTION(uart3),
941 UNIPHIER_PINMUX_FUNCTION(usb0),
942 UNIPHIER_PINMUX_FUNCTION(usb1),
943 UNIPHIER_PINMUX_FUNCTION(usb2),
944 UNIPHIER_PINMUX_FUNCTION(usb3),
945};
946
947static int uniphier_pxs3_get_gpio_muxval(unsigned int pin,
948 unsigned int gpio_offset)
949{
950 if (gpio_offset >= 120 && gpio_offset <= 143) { /* XIRQx */
951 if (pin >= 219 && pin <= 234)
952 return 0;
953
954 return 14;
955 }
956
957 return 15;
958}
959
960static struct uniphier_pinctrl_socdata uniphier_pxs3_pindata = {
961 .pins = uniphier_pxs3_pins,
962 .npins = ARRAY_SIZE(uniphier_pxs3_pins),
963 .groups = uniphier_pxs3_groups,
964 .groups_count = ARRAY_SIZE(uniphier_pxs3_groups),
965 .functions = uniphier_pxs3_functions,
966 .functions_count = ARRAY_SIZE(uniphier_pxs3_functions),
967 .get_gpio_muxval = uniphier_pxs3_get_gpio_muxval,
968 .caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
969};
970
971static int uniphier_pxs3_pinctrl_probe(struct platform_device *pdev)
972{
973 return uniphier_pinctrl_probe(pdev, &uniphier_pxs3_pindata);
974}
975
976static const struct of_device_id uniphier_pxs3_pinctrl_match[] = {
977 { .compatible = "socionext,uniphier-pxs3-pinctrl" },
978 { /* sentinel */ }
979};
980
981static struct platform_driver uniphier_pxs3_pinctrl_driver = {
982 .probe = uniphier_pxs3_pinctrl_probe,
983 .driver = {
984 .name = "uniphier-pxs3-pinctrl",
985 .of_match_table = uniphier_pxs3_pinctrl_match,
986 .pm = &uniphier_pinctrl_pm_ops,
987 },
988};
989builtin_platform_driver(uniphier_pxs3_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
index 37deaf615dcf..1af430d701be 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
@@ -532,67 +532,28 @@ static const unsigned usb1_pins[] = {43, 44};
532static const int usb1_muxvals[] = {0, 0}; 532static const int usb1_muxvals[] = {0, 0};
533static const unsigned usb2_pins[] = {114, 115}; 533static const unsigned usb2_pins[] = {114, 115};
534static const int usb2_muxvals[] = {1, 1}; 534static const int usb2_muxvals[] = {1, 1};
535static const unsigned port_range0_pins[] = { 535static const unsigned int gpio_range0_pins[] = {
536 0, 1, 2, 3, 4, 5, 6, 7, /* PORT0x */ 536 0, 1, 2, 3, 4, 5, 6, 7, /* PORT0x */
537 8, 9, 10, 11, 12, 13, 14, 15, /* PORT1x */ 537 8, 9, 10, 11, 12, 13, 14, 15, /* PORT1x */
538 32, 33, 34, 35, 36, 37, 38, 39, /* PORT2x */ 538 32, 33, 34, 35, 36, 37, 38, 39, /* PORT2x */
539 59, 60, 61, 62, 63, 64, 65, 66, /* PORT3x */ 539 59, 60, 61, 62, 63, 64, 65, 66, /* PORT3x */
540 95, 96, 97, 98, 99, 100, 101, 57, /* PORT4x */ 540 95, 96, 97, 98, 99, 100, 101, 57, /* PORT4x */
541 70, 71, 72, 73, 74, 75, 76, 77, /* PORT5x */ 541 70, 71, 72, 73, 74, 75, 76, 77, /* PORT5x */
542 81, 83, 84, 85, 86, 89, 90, 91, /* PORT6x */ 542 81, 83, 84, 85, 86, 89, 90, 91, /* PORT6x */
543 118, 119, 120, 121, 122, 53, 54, 55, /* PORT7x */ 543 118, 119, 120, 121, 122, 53, 54, 55, /* PORT7x */
544 41, 42, 43, 44, 79, 80, 18, 19, /* PORT8x */ 544 41, 42, 43, 44, 79, 80, 18, 19, /* PORT8x */
545 110, 111, 112, 113, 114, 115, 16, 17, /* PORT9x */ 545 110, 111, 112, 113, 114, 115, 16, 17, /* PORT9x */
546 40, 67, 68, 69, 78, 92, 93, 94, /* PORT10x */ 546 40, 67, 68, 69, 78, 92, 93, 94, /* PORT10x */
547 48, 49, 46, 45, 123, 124, 125, 126, /* PORT11x */ 547 48, 49, 46, 45, 123, 124, 125, 126, /* PORT11x */
548 47, 127, 20, 56, 22, /* PORT120-124 */ 548 47, 127, 20, 56, 22, /* PORT120-124 */
549}; 549};
550static const int port_range0_muxvals[] = { 550static const unsigned int gpio_range1_pins[] = {
551 15, 15, 15, 15, 15, 15, 15, 15, /* PORT0x */ 551 116, 117, /* PORT130-131 */
552 15, 15, 15, 15, 15, 15, 15, 15, /* PORT1x */
553 15, 15, 15, 15, 15, 15, 15, 15, /* PORT2x */
554 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */
555 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */
556 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */
557 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */
558 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */
559 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */
560 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */
561 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */
562 15, 15, 15, 15, 15, 15, 15, 15, /* PORT11x */
563 15, 15, 15, 15, 15, /* PORT120-124 */
564}; 552};
565static const unsigned port_range1_pins[] = { 553static const unsigned int gpio_range2_pins[] = {
566 116, 117, /* PORT130-131 */ 554 102, 103, 104, 105, 106, 107, 108, 109, /* PORT14x */
567}; 555 128, 129, 130, 131, 132, 133, 134, 135, /* XIRQ0-7 */
568static const int port_range1_muxvals[] = { 556 82, 87, 88, 50, 51, 23, 52, 58, /* XIRQ8-12, PORT165, XIRQ14-15 */
569 15, 15, /* PORT130-131 */
570};
571static const unsigned port_range2_pins[] = {
572 102, 103, 104, 105, 106, 107, 108, 109, /* PORT14x */
573};
574static const int port_range2_muxvals[] = {
575 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */
576};
577static const unsigned port_range3_pins[] = {
578 23, /* PORT166 */
579};
580static const int port_range3_muxvals[] = {
581 15, /* PORT166 */
582};
583static const unsigned xirq_range0_pins[] = {
584 128, 129, 130, 131, 132, 133, 134, 135, /* XIRQ0-7 */
585 82, 87, 88, 50, 51, /* XIRQ8-12 */
586};
587static const int xirq_range0_muxvals[] = {
588 0, 0, 0, 0, 0, 0, 0, 0, /* XIRQ0-7 */
589 14, 14, 14, 14, 14, /* XIRQ8-12 */
590};
591static const unsigned xirq_range1_pins[] = {
592 52, 58, /* XIRQ14-15 */
593};
594static const int xirq_range1_muxvals[] = {
595 14, 14, /* XIRQ14-15 */
596}; 557};
597 558
598static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = { 559static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = {
@@ -620,139 +581,9 @@ static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = {
620 UNIPHIER_PINCTRL_GROUP(usb0), 581 UNIPHIER_PINCTRL_GROUP(usb0),
621 UNIPHIER_PINCTRL_GROUP(usb1), 582 UNIPHIER_PINCTRL_GROUP(usb1),
622 UNIPHIER_PINCTRL_GROUP(usb2), 583 UNIPHIER_PINCTRL_GROUP(usb2),
623 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 584 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
624 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1), 585 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
625 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range2), 586 UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
626 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range3),
627 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_range0),
628 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_range1),
629 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0),
630 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1),
631 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2),
632 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3),
633 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4),
634 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5),
635 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6),
636 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7),
637 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8),
638 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9),
639 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10),
640 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11),
641 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12),
642 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13),
643 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14),
644 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15),
645 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16),
646 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17),
647 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18),
648 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19),
649 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20),
650 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21),
651 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22),
652 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23),
653 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24),
654 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25),
655 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26),
656 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27),
657 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28),
658 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29),
659 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30),
660 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31),
661 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32),
662 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33),
663 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34),
664 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35),
665 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36),
666 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37),
667 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38),
668 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39),
669 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40),
670 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41),
671 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42),
672 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43),
673 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44),
674 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45),
675 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46),
676 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47),
677 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48),
678 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49),
679 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50),
680 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51),
681 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52),
682 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53),
683 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54),
684 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55),
685 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56),
686 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57),
687 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58),
688 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59),
689 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60),
690 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61),
691 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62),
692 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63),
693 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64),
694 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65),
695 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66),
696 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67),
697 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68),
698 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69),
699 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70),
700 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71),
701 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72),
702 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73),
703 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74),
704 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75),
705 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76),
706 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77),
707 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78),
708 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79),
709 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80),
710 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81),
711 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82),
712 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83),
713 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84),
714 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85),
715 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86),
716 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87),
717 UNIPHIER_PINCTRL_GROUP_SINGLE(port110, port_range0, 88),
718 UNIPHIER_PINCTRL_GROUP_SINGLE(port111, port_range0, 89),
719 UNIPHIER_PINCTRL_GROUP_SINGLE(port112, port_range0, 90),
720 UNIPHIER_PINCTRL_GROUP_SINGLE(port113, port_range0, 91),
721 UNIPHIER_PINCTRL_GROUP_SINGLE(port114, port_range0, 92),
722 UNIPHIER_PINCTRL_GROUP_SINGLE(port115, port_range0, 93),
723 UNIPHIER_PINCTRL_GROUP_SINGLE(port116, port_range0, 94),
724 UNIPHIER_PINCTRL_GROUP_SINGLE(port117, port_range0, 95),
725 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range0, 96),
726 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range0, 97),
727 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range0, 98),
728 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range0, 99),
729 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range0, 100),
730 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range1, 0),
731 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range1, 1),
732 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range2, 0),
733 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range2, 1),
734 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range2, 2),
735 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range2, 3),
736 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range2, 4),
737 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range2, 5),
738 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range2, 6),
739 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range2, 7),
740 UNIPHIER_PINCTRL_GROUP_SINGLE(port166, port_range3, 0),
741 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq_range0, 0),
742 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq_range0, 1),
743 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq_range0, 2),
744 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq_range0, 3),
745 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq_range0, 4),
746 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq_range0, 5),
747 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq_range0, 6),
748 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq_range0, 7),
749 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq_range0, 8),
750 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq_range0, 9),
751 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq_range0, 10),
752 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq_range0, 11),
753 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq_range0, 12),
754 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq_range1, 0),
755 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq_range1, 1),
756}; 587};
757 588
758static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 589static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
@@ -777,46 +608,6 @@ static const char * const uart3_groups[] = {"uart3"};
777static const char * const usb0_groups[] = {"usb0"}; 608static const char * const usb0_groups[] = {"usb0"};
778static const char * const usb1_groups[] = {"usb1"}; 609static const char * const usb1_groups[] = {"usb1"};
779static const char * const usb2_groups[] = {"usb2"}; 610static const char * const usb2_groups[] = {"usb2"};
780static const char * const port_groups[] = {
781 "port00", "port01", "port02", "port03",
782 "port04", "port05", "port06", "port07",
783 "port10", "port11", "port12", "port13",
784 "port14", "port15", "port16", "port17",
785 "port20", "port21", "port22", "port23",
786 "port24", "port25", "port26", "port27",
787 "port30", "port31", "port32", "port33",
788 "port34", "port35", "port36", "port37",
789 "port40", "port41", "port42", "port43",
790 "port44", "port45", "port46", "port47",
791 "port50", "port51", "port52", "port53",
792 "port54", "port55", "port56", "port57",
793 "port60", "port61", "port62", "port63",
794 "port64", "port65", "port66", "port67",
795 "port70", "port71", "port72", "port73",
796 "port74", "port75", "port76", "port77",
797 "port80", "port81", "port82", "port83",
798 "port84", "port85", "port86", "port87",
799 "port90", "port91", "port92", "port93",
800 "port94", "port95", "port96", "port97",
801 "port100", "port101", "port102", "port103",
802 "port104", "port105", "port106", "port107",
803 "port110", "port111", "port112", "port113",
804 "port114", "port115", "port116", "port117",
805 "port120", "port121", "port122", "port123",
806 "port124", "port125", "port126", "port127",
807 "port130", "port131", "port132", "port133",
808 "port134", "port135", "port136", "port137",
809 "port140", "port141", "port142", "port143",
810 "port144", "port145", "port146", "port147",
811 /* port150-164 missing */
812 /* none */ "port165",
813};
814static const char * const xirq_groups[] = {
815 "xirq0", "xirq1", "xirq2", "xirq3",
816 "xirq4", "xirq5", "xirq6", "xirq7",
817 "xirq8", "xirq9", "xirq10", "xirq11",
818 "xirq12", /* none*/ "xirq14", "xirq15",
819};
820 611
821static const struct uniphier_pinmux_function uniphier_sld8_functions[] = { 612static const struct uniphier_pinmux_function uniphier_sld8_functions[] = {
822 UNIPHIER_PINMUX_FUNCTION(emmc), 613 UNIPHIER_PINMUX_FUNCTION(emmc),
@@ -836,10 +627,22 @@ static const struct uniphier_pinmux_function uniphier_sld8_functions[] = {
836 UNIPHIER_PINMUX_FUNCTION(usb0), 627 UNIPHIER_PINMUX_FUNCTION(usb0),
837 UNIPHIER_PINMUX_FUNCTION(usb1), 628 UNIPHIER_PINMUX_FUNCTION(usb1),
838 UNIPHIER_PINMUX_FUNCTION(usb2), 629 UNIPHIER_PINMUX_FUNCTION(usb2),
839 UNIPHIER_PINMUX_FUNCTION(port),
840 UNIPHIER_PINMUX_FUNCTION(xirq),
841}; 630};
842 631
632static int uniphier_sld8_get_gpio_muxval(unsigned int pin,
633 unsigned int gpio_offset)
634{
635 switch (gpio_offset) {
636 case 120 ... 127: /* XIRQ0-XIRQ7 */
637 return 0;
638 case 128 ... 132: /* XIRQ8-12 */
639 case 134 ... 135: /* XIRQ14-15 */
640 return 14;
641 default:
642 return 15;
643 }
644}
645
843static struct uniphier_pinctrl_socdata uniphier_sld8_pindata = { 646static struct uniphier_pinctrl_socdata uniphier_sld8_pindata = {
844 .pins = uniphier_sld8_pins, 647 .pins = uniphier_sld8_pins,
845 .npins = ARRAY_SIZE(uniphier_sld8_pins), 648 .npins = ARRAY_SIZE(uniphier_sld8_pins),
@@ -847,6 +650,7 @@ static struct uniphier_pinctrl_socdata uniphier_sld8_pindata = {
847 .groups_count = ARRAY_SIZE(uniphier_sld8_groups), 650 .groups_count = ARRAY_SIZE(uniphier_sld8_groups),
848 .functions = uniphier_sld8_functions, 651 .functions = uniphier_sld8_functions,
849 .functions_count = ARRAY_SIZE(uniphier_sld8_functions), 652 .functions_count = ARRAY_SIZE(uniphier_sld8_functions),
653 .get_gpio_muxval = uniphier_sld8_get_gpio_muxval,
850 .caps = 0, 654 .caps = 0,
851}; 655};
852 656
@@ -865,6 +669,7 @@ static struct platform_driver uniphier_sld8_pinctrl_driver = {
865 .driver = { 669 .driver = {
866 .name = "uniphier-sld8-pinctrl", 670 .name = "uniphier-sld8-pinctrl",
867 .of_match_table = uniphier_sld8_pinctrl_match, 671 .of_match_table = uniphier_sld8_pinctrl_match,
672 .pm = &uniphier_pinctrl_pm_ops,
868 }, 673 },
869}; 674};
870builtin_platform_driver(uniphier_sld8_pinctrl_driver); 675builtin_platform_driver(uniphier_sld8_pinctrl_driver);
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier.h b/drivers/pinctrl/uniphier/pinctrl-uniphier.h
index 6f2f33bf788f..c075ecb8e5db 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier.h
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier.h
@@ -25,7 +25,7 @@ struct platform_device;
25 25
26/* input enable control register bit */ 26/* input enable control register bit */
27#define UNIPHIER_PIN_IECTRL_SHIFT 0 27#define UNIPHIER_PIN_IECTRL_SHIFT 0
28#define UNIPHIER_PIN_IECTRL_BITS 8 28#define UNIPHIER_PIN_IECTRL_BITS 3
29#define UNIPHIER_PIN_IECTRL_MASK ((1UL << (UNIPHIER_PIN_IECTRL_BITS)) \ 29#define UNIPHIER_PIN_IECTRL_MASK ((1UL << (UNIPHIER_PIN_IECTRL_BITS)) \
30 - 1) 30 - 1)
31 31
@@ -62,6 +62,7 @@ struct platform_device;
62#endif 62#endif
63 63
64#define UNIPHIER_PIN_IECTRL_NONE (UNIPHIER_PIN_IECTRL_MASK) 64#define UNIPHIER_PIN_IECTRL_NONE (UNIPHIER_PIN_IECTRL_MASK)
65#define UNIPHIER_PIN_IECTRL_EXIST 0
65 66
66/* drive control type */ 67/* drive control type */
67enum uniphier_pin_drv_type { 68enum uniphier_pin_drv_type {
@@ -131,18 +132,11 @@ static inline unsigned int uniphier_pin_get_pull_dir(void *drv_data)
131 UNIPHIER_PIN_PULL_DIR_MASK; 132 UNIPHIER_PIN_PULL_DIR_MASK;
132} 133}
133 134
134enum uniphier_pinmux_gpio_range_type {
135 UNIPHIER_PINMUX_GPIO_RANGE_PORT,
136 UNIPHIER_PINMUX_GPIO_RANGE_IRQ,
137 UNIPHIER_PINMUX_GPIO_RANGE_NONE,
138};
139
140struct uniphier_pinctrl_group { 135struct uniphier_pinctrl_group {
141 const char *name; 136 const char *name;
142 const unsigned *pins; 137 const unsigned *pins;
143 unsigned num_pins; 138 unsigned num_pins;
144 const int *muxvals; 139 const int *muxvals;
145 enum uniphier_pinmux_gpio_range_type range_type;
146}; 140};
147 141
148struct uniphier_pinmux_function { 142struct uniphier_pinmux_function {
@@ -158,6 +152,7 @@ struct uniphier_pinctrl_socdata {
158 int groups_count; 152 int groups_count;
159 const struct uniphier_pinmux_function *functions; 153 const struct uniphier_pinmux_function *functions;
160 int functions_count; 154 int functions_count;
155 int (*get_gpio_muxval)(unsigned int pin, unsigned int gpio_offset);
161 unsigned int caps; 156 unsigned int caps;
162#define UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL BIT(1) 157#define UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL BIT(1)
163#define UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE BIT(0) 158#define UNIPHIER_PINCTRL_CAPS_DBGMUX_SEPARATE BIT(0)
@@ -170,33 +165,22 @@ struct uniphier_pinctrl_socdata {
170 .drv_data = (void *)UNIPHIER_PIN_ATTR_PACKED(c, d, e, f, g), \ 165 .drv_data = (void *)UNIPHIER_PIN_ATTR_PACKED(c, d, e, f, g), \
171} 166}
172 167
173#define __UNIPHIER_PINCTRL_GROUP(grp, type) \ 168#define __UNIPHIER_PINCTRL_GROUP(grp, mux) \
174 { \ 169 { \
175 .name = #grp, \ 170 .name = #grp, \
176 .pins = grp##_pins, \ 171 .pins = grp##_pins, \
177 .num_pins = ARRAY_SIZE(grp##_pins), \ 172 .num_pins = ARRAY_SIZE(grp##_pins), \
178 .muxvals = grp##_muxvals + \ 173 .muxvals = mux, \
179 BUILD_BUG_ON_ZERO(ARRAY_SIZE(grp##_pins) != \
180 ARRAY_SIZE(grp##_muxvals)), \
181 .range_type = type, \
182 } 174 }
183 175
184#define UNIPHIER_PINCTRL_GROUP(grp) \ 176#define UNIPHIER_PINCTRL_GROUP(grp) \
185 __UNIPHIER_PINCTRL_GROUP(grp, UNIPHIER_PINMUX_GPIO_RANGE_NONE) 177 __UNIPHIER_PINCTRL_GROUP(grp, \
186 178 grp##_muxvals + \
187#define UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(grp) \ 179 BUILD_BUG_ON_ZERO(ARRAY_SIZE(grp##_pins) != \
188 __UNIPHIER_PINCTRL_GROUP(grp, UNIPHIER_PINMUX_GPIO_RANGE_PORT) 180 ARRAY_SIZE(grp##_muxvals)))
189
190#define UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(grp) \
191 __UNIPHIER_PINCTRL_GROUP(grp, UNIPHIER_PINMUX_GPIO_RANGE_IRQ)
192 181
193#define UNIPHIER_PINCTRL_GROUP_SINGLE(grp, array, ofst) \ 182#define UNIPHIER_PINCTRL_GROUP_GPIO(grp) \
194 { \ 183 __UNIPHIER_PINCTRL_GROUP(grp, NULL)
195 .name = #grp, \
196 .pins = array##_pins + ofst, \
197 .num_pins = 1, \
198 .muxvals = array##_muxvals + ofst, \
199 }
200 184
201#define UNIPHIER_PINMUX_FUNCTION(func) \ 185#define UNIPHIER_PINMUX_FUNCTION(func) \
202 { \ 186 { \
@@ -208,4 +192,6 @@ struct uniphier_pinctrl_socdata {
208int uniphier_pinctrl_probe(struct platform_device *pdev, 192int uniphier_pinctrl_probe(struct platform_device *pdev,
209 struct uniphier_pinctrl_socdata *socdata); 193 struct uniphier_pinctrl_socdata *socdata);
210 194
195extern const struct dev_pm_ops uniphier_pinctrl_pm_ops;
196
211#endif /* __PINCTRL_UNIPHIER_H__ */ 197#endif /* __PINCTRL_UNIPHIER_H__ */
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index c207e60b734f..d73956bdc211 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -163,7 +163,7 @@ static int wmt_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
163 return 0; 163 return 0;
164} 164}
165 165
166static struct pinmux_ops wmt_pinmux_ops = { 166static const struct pinmux_ops wmt_pinmux_ops = {
167 .get_functions_count = wmt_pmx_get_functions_count, 167 .get_functions_count = wmt_pmx_get_functions_count,
168 .get_function_name = wmt_pmx_get_function_name, 168 .get_function_name = wmt_pmx_get_function_name,
169 .get_function_groups = wmt_pmx_get_function_groups, 169 .get_function_groups = wmt_pmx_get_function_groups,
@@ -409,7 +409,7 @@ fail:
409 return err; 409 return err;
410} 410}
411 411
412static struct pinctrl_ops wmt_pctl_ops = { 412static const struct pinctrl_ops wmt_pctl_ops = {
413 .get_groups_count = wmt_get_groups_count, 413 .get_groups_count = wmt_get_groups_count,
414 .get_group_name = wmt_get_group_name, 414 .get_group_name = wmt_get_group_name,
415 .get_group_pins = wmt_get_group_pins, 415 .get_group_pins = wmt_get_group_pins,
@@ -472,7 +472,7 @@ static int wmt_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin,
472 return 0; 472 return 0;
473} 473}
474 474
475static struct pinconf_ops wmt_pinconf_ops = { 475static const struct pinconf_ops wmt_pinconf_ops = {
476 .pin_config_get = wmt_pinconf_get, 476 .pin_config_get = wmt_pinconf_get,
477 .pin_config_set = wmt_pinconf_set, 477 .pin_config_set = wmt_pinconf_set,
478}; 478};
@@ -546,7 +546,7 @@ static int wmt_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
546 return pinctrl_gpio_direction_output(chip->base + offset); 546 return pinctrl_gpio_direction_output(chip->base + offset);
547} 547}
548 548
549static struct gpio_chip wmt_gpio_chip = { 549static const struct gpio_chip wmt_gpio_chip = {
550 .label = "gpio-wmt", 550 .label = "gpio-wmt",
551 .owner = THIS_MODULE, 551 .owner = THIS_MODULE,
552 .request = gpiochip_generic_request, 552 .request = gpiochip_generic_request,
diff --git a/drivers/pinctrl/zte/pinctrl-zx.c b/drivers/pinctrl/zte/pinctrl-zx.c
index f828ee340a98..ded366bb6564 100644
--- a/drivers/pinctrl/zte/pinctrl-zx.c
+++ b/drivers/pinctrl/zte/pinctrl-zx.c
@@ -295,8 +295,7 @@ static int zx_pinctrl_build_state(struct platform_device *pdev)
295 pctldev->num_groups = ngroups; 295 pctldev->num_groups = ngroups;
296 296
297 /* Build function list from pin mux functions */ 297 /* Build function list from pin mux functions */
298 functions = devm_kzalloc(&pdev->dev, info->npins * sizeof(*functions), 298 functions = kcalloc(info->npins, sizeof(*functions), GFP_KERNEL);
299 GFP_KERNEL);
300 if (!functions) 299 if (!functions)
301 return -ENOMEM; 300 return -ENOMEM;
302 301
@@ -367,8 +366,10 @@ static int zx_pinctrl_build_state(struct platform_device *pdev)
367 func->num_group_names * 366 func->num_group_names *
368 sizeof(*func->group_names), 367 sizeof(*func->group_names),
369 GFP_KERNEL); 368 GFP_KERNEL);
370 if (!func->group_names) 369 if (!func->group_names) {
370 kfree(functions);
371 return -ENOMEM; 371 return -ENOMEM;
372 }
372 } 373 }
373 374
374 group = func->group_names; 375 group = func->group_names;
diff --git a/include/dt-bindings/pinctrl/qcom,pmic-gpio.h b/include/dt-bindings/pinctrl/qcom,pmic-gpio.h
index d33f17c8a515..b8ff8824e21b 100644
--- a/include/dt-bindings/pinctrl/qcom,pmic-gpio.h
+++ b/include/dt-bindings/pinctrl/qcom,pmic-gpio.h
@@ -98,6 +98,8 @@
98#define PMIC_GPIO_FUNC_PAIRED "paired" 98#define PMIC_GPIO_FUNC_PAIRED "paired"
99#define PMIC_GPIO_FUNC_FUNC1 "func1" 99#define PMIC_GPIO_FUNC_FUNC1 "func1"
100#define PMIC_GPIO_FUNC_FUNC2 "func2" 100#define PMIC_GPIO_FUNC_FUNC2 "func2"
101#define PMIC_GPIO_FUNC_FUNC3 "func3"
102#define PMIC_GPIO_FUNC_FUNC4 "func4"
101#define PMIC_GPIO_FUNC_DTEST1 "dtest1" 103#define PMIC_GPIO_FUNC_DTEST1 "dtest1"
102#define PMIC_GPIO_FUNC_DTEST2 "dtest2" 104#define PMIC_GPIO_FUNC_DTEST2 "dtest2"
103#define PMIC_GPIO_FUNC_DTEST3 "dtest3" 105#define PMIC_GPIO_FUNC_DTEST3 "dtest3"
diff --git a/include/dt-bindings/pinctrl/samsung.h b/include/dt-bindings/pinctrl/samsung.h
index b7aa3646208b..ceb672305f59 100644
--- a/include/dt-bindings/pinctrl/samsung.h
+++ b/include/dt-bindings/pinctrl/samsung.h
@@ -66,7 +66,8 @@
66#define EXYNOS_PIN_FUNC_4 4 66#define EXYNOS_PIN_FUNC_4 4
67#define EXYNOS_PIN_FUNC_5 5 67#define EXYNOS_PIN_FUNC_5 5
68#define EXYNOS_PIN_FUNC_6 6 68#define EXYNOS_PIN_FUNC_6 6
69#define EXYNOS_PIN_FUNC_F 0xf 69#define EXYNOS_PIN_FUNC_EINT 0xf
70#define EXYNOS_PIN_FUNC_F EXYNOS_PIN_FUNC_EINT
70 71
71/* Drive strengths for Exynos7 FSYS1 block */ 72/* Drive strengths for Exynos7 FSYS1 block */
72#define EXYNOS7_FSYS1_PIN_DRV_LV1 0 73#define EXYNOS7_FSYS1_PIN_DRV_LV1 0
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
index e5b1716f98cc..7fa5d87190c2 100644
--- a/include/linux/pinctrl/machine.h
+++ b/include/linux/pinctrl/machine.h
@@ -152,12 +152,12 @@ struct pinctrl_map {
152 152
153#ifdef CONFIG_PINCTRL 153#ifdef CONFIG_PINCTRL
154 154
155extern int pinctrl_register_mappings(struct pinctrl_map const *map, 155extern int pinctrl_register_mappings(const struct pinctrl_map *map,
156 unsigned num_maps); 156 unsigned num_maps);
157extern void pinctrl_provide_dummies(void); 157extern void pinctrl_provide_dummies(void);
158#else 158#else
159 159
160static inline int pinctrl_register_mappings(struct pinctrl_map const *map, 160static inline int pinctrl_register_mappings(const struct pinctrl_map *map,
161 unsigned num_maps) 161 unsigned num_maps)
162{ 162{
163 return 0; 163 return 0;
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index e91d1b6a260d..5d8bc7f21c2a 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -86,6 +86,7 @@
86 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 86 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
87 * supplies, the argument to this parameter (on a custom format) tells 87 * supplies, the argument to this parameter (on a custom format) tells
88 * the driver which alternative power source to use. 88 * the driver which alternative power source to use.
89 * @PIN_CONFIG_SLEEP_HARDWARE_STATE: indicate this is sleep related state.
89 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to 90 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
90 * this parameter (on a custom format) tells the driver which alternative 91 * this parameter (on a custom format) tells the driver which alternative
91 * slew rate to use. 92 * slew rate to use.
@@ -114,6 +115,7 @@ enum pin_config_param {
114 PIN_CONFIG_OUTPUT_ENABLE, 115 PIN_CONFIG_OUTPUT_ENABLE,
115 PIN_CONFIG_OUTPUT, 116 PIN_CONFIG_OUTPUT,
116 PIN_CONFIG_POWER_SOURCE, 117 PIN_CONFIG_POWER_SOURCE,
118 PIN_CONFIG_SLEEP_HARDWARE_STATE,
117 PIN_CONFIG_SLEW_RATE, 119 PIN_CONFIG_SLEW_RATE,
118 PIN_CONFIG_END = 0x7F, 120 PIN_CONFIG_END = 0x7F,
119 PIN_CONFIG_MAX = 0xFF, 121 PIN_CONFIG_MAX = 0xFF,