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

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

Pull pin control updates from Linus Walleij:
"This is the bulk of pin control patches for the v4.5 series.

Notably I have a patch to driver core from Stephen Boyd in the pull
request, this has been ACKed by Greg so it should be OK. The internal
API needed some tweaking to allow modular Qualcomm pin controllers.

There is a bit of development history in here but it should all add up
nicely and has boiled in linux-next. For example I merged in v4.4-rc5
to get rid of some nasty merge conflicts.

Summary:

- New drivers:
- PXA2xx pin controller support
- Broadcom NSP pin controller support

- New subdrivers:
- Samsung EXYNOS5410 support
- Qualcomm MSM8996 support
- Qualcomm PM8994 support
- Qualcomm PM8994 MPP support
- Allwinner sunxi H3 support
- Allwinner sunxi A80 support
- Rockchip RK3228 support

- Rename the Cygnus pinctrl driver to "iproc" as it is more generic
than was originally thought.

- A bunch of Lantiq/Xway updates especially from the OpenWRT people.

- Several refactorings for the Super-H SH PFC pin controllers.
Adding SCIF_CLK support.

- Several fixes to the Atlas 7 driver.

- Various fixes all over the place"

* tag 'pinctrl-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (91 commits)
pinctrl: mediatek: Modify pinctrl bindings for mt2701
Revert "pinctrl: qcom: make PMIC drivers bool"
pinctrl: qcom: Use platform_irq_count() instead of of_irq_count()
driver-core: platform: Add platform_irq_count()
pinctrl: lantiq: 2 pins have the wrong mux list
pinctrl: qcom: make PMIC drivers bool
pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength()
pinctrl: mediatek: convert to arch_initcall
pinctrl: bcm2835: Fix memory leak in error path
pinctrl: mediatek: add missing of_node_put
pinctrl: rockchip: add missing of_node_put
pinctrl: sh-pfc: add missing of_node_put
pinctrl: sirf: add missing of_node_put
pinctrl-tegra: add missing of_node_put
pinctrl: sunxi: Add A80 special pin controller
pinctrl: bcm/cygnys/iproc: fixup rebase issue
pinctrl: fixup problematic flag
MAINTAINERS: Add co-maintainer for Renesas Pin Controllers
pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
pinctrl: sh-pfc: r8a7795: Add SATA support
...

+9053 -767
+3
Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt
··· 17 17 "allwinner,sun8i-a23-pinctrl" 18 18 "allwinner,sun8i-a23-r-pinctrl" 19 19 "allwinner,sun8i-a33-pinctrl" 20 + "allwinner,sun9i-a80-pinctrl" 21 + "allwinner,sun9i-a80-r-pinctrl" 20 22 "allwinner,sun8i-a83t-pinctrl" 23 + "allwinner,sun8i-h3-pinctrl" 21 24 22 25 - reg: Should contain the register physical address and length for the 23 26 pin controller.
+7 -2
Documentation/devicetree/bindings/pinctrl/brcm,cygnus-gpio.txt Documentation/devicetree/bindings/pinctrl/brcm,iproc-gpio.txt
··· 1 - Broadcom Cygnus GPIO/PINCONF Controller 1 + Broadcom iProc GPIO/PINCONF Controller 2 2 3 3 Required properties: 4 4 ··· 7 7 "brcm,cygnus-crmu-gpio" or "brcm,iproc-gpio" 8 8 9 9 - reg: 10 - Define the base and range of the I/O address space that contains the Cygnus 10 + Define the base and range of the I/O address space that contains SoC 11 11 GPIO/PINCONF controller registers 12 + 13 + - ngpios: 14 + Total number of in-use slots in GPIO controller 12 15 13 16 - #gpio-cells: 14 17 Must be two. The first cell is the GPIO pin number (within the ··· 60 57 compatible = "brcm,cygnus-ccm-gpio"; 61 58 reg = <0x1800a000 0x50>, 62 59 <0x0301d164 0x20>; 60 + ngpios = <24>; 63 61 #gpio-cells = <2>; 64 62 gpio-controller; 65 63 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; ··· 82 78 gpio_asiu: gpio@180a5000 { 83 79 compatible = "brcm,cygnus-asiu-gpio"; 84 80 reg = <0x180a5000 0x668>; 81 + ngpios = <146>; 85 82 #gpio-cells = <2>; 86 83 gpio-controller; 87 84 interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+80
Documentation/devicetree/bindings/pinctrl/brcm,nsp-gpio.txt
··· 1 + Broadcom Northstar plus (NSP) GPIO/PINCONF Controller 2 + 3 + Required properties: 4 + - compatible: 5 + Must be "brcm,nsp-gpio-a" 6 + 7 + - reg: 8 + Should contain the register physical address and length for each of 9 + GPIO base, IO control registers 10 + 11 + - #gpio-cells: 12 + Must be two. The first cell is the GPIO pin number (within the 13 + controller's pin space) and the second cell is used for the following: 14 + bit[0]: polarity (0 for active high and 1 for active low) 15 + 16 + - gpio-controller: 17 + Specifies that the node is a GPIO controller 18 + 19 + - ngpios: 20 + Number of gpios supported (58x25 supports 32 and 58x23 supports 24) 21 + 22 + Optional properties: 23 + - interrupts: 24 + Interrupt ID 25 + 26 + - interrupt-controller: 27 + Specifies that the node is an interrupt controller 28 + 29 + - gpio-ranges: 30 + Specifies the mapping between gpio controller and pin-controllers pins. 31 + This requires 4 fields in cells defined as - 32 + 1. Phandle of pin-controller. 33 + 2. GPIO base pin offset. 34 + 3 Pin-control base pin offset. 35 + 4. number of gpio pins which are linearly mapped from pin base. 36 + 37 + Supported generic PINCONF properties in child nodes: 38 + - pins: 39 + The list of pins (within the controller's own pin space) that properties 40 + in the node apply to. Pin names are "gpio-<pin>" 41 + 42 + - bias-disable: 43 + Disable pin bias 44 + 45 + - bias-pull-up: 46 + Enable internal pull up resistor 47 + 48 + - bias-pull-down: 49 + Enable internal pull down resistor 50 + 51 + - drive-strength: 52 + Valid drive strength values include 2, 4, 6, 8, 10, 12, 14, 16 (mA) 53 + 54 + Example: 55 + 56 + gpioa: gpio@18000020 { 57 + compatible = "brcm,nsp-gpio-a"; 58 + reg = <0x18000020 0x100>, 59 + <0x1803f1c4 0x1c>; 60 + #gpio-cells = <2>; 61 + gpio-controller; 62 + ngpios = <32>; 63 + gpio-ranges = <&pinctrl 0 0 31>; 64 + interrupt-controller; 65 + interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; 66 + 67 + /* Hog a few default settings */ 68 + pinctrl-names = "default"; 69 + pinctrl-0 = <&led>; 70 + led: led { 71 + pins = "gpio-1"; 72 + bias-pull-up; 73 + }; 74 + 75 + pwr: pwr { 76 + gpio-hog; 77 + gpios = <3 1>; 78 + output-high; 79 + }; 80 + };
+102 -8
Documentation/devicetree/bindings/pinctrl/lantiq,pinctrl-xway.txt
··· 1 1 Lantiq XWAY pinmux controller 2 2 3 3 Required properties: 4 - - compatible: "lantiq,pinctrl-xway" or "lantiq,pinctrl-xr9" 4 + - compatible: "lantiq,pinctrl-xway", (DEPRECATED: Use "lantiq,pinctrl-danube") 5 + "lantiq,pinctrl-xr9", (DEPRECATED: Use "lantiq,xrx100-pinctrl" or 6 + "lantiq,xrx200-pinctrl") 7 + "lantiq,pinctrl-ase", (DEPRECATED: Use "lantiq,ase-pinctrl") 8 + "lantiq,<chip>-pinctrl", where <chip> is: 9 + "ase" (XWAY AMAZON Family) 10 + "danube" (XWAY DANUBE Family) 11 + "xrx100" (XWAY xRX100 Family) 12 + "xrx200" (XWAY xRX200 Family) 13 + "xrx300" (XWAY xRX300 Family) 5 14 - reg: Should contain the physical address and length of the gpio/pinmux 6 15 register range 7 16 ··· 45 36 46 37 Valid values for group and function names: 47 38 39 + XWAY: (DEPRECATED: Use DANUBE) 48 40 mux groups: 49 41 exin0, exin1, exin2, jtag, ebu a23, ebu a24, ebu a25, ebu clk, ebu cs1, 50 42 ebu wait, nand ale, nand cs1, nand cle, spi, spi_cs1, spi_cs2, spi_cs3, 51 - spi_cs4, spi_cs5, spi_cs6, asc0, asc0 cts rts, stp, nmi , gpt1, gpt2, 43 + spi_cs4, spi_cs5, spi_cs6, asc0, asc0 cts rts, stp, nmi, gpt1, gpt2, 52 44 gpt3, clkout0, clkout1, clkout2, clkout3, gnt1, gnt2, gnt3, req1, req2, 53 45 req3 54 46 55 - additional mux groups (XR9 only): 56 - mdio, nand rdy, nand rd, exin3, exin4, gnt4, req4 47 + functions: 48 + spi, asc, cgu, jtag, exin, stp, gpt, nmi, pci, ebu 49 + 50 + XR9: ( DEPRECATED: Use xRX100/xRX200) 51 + mux groups: 52 + exin0, exin1, exin2, exin3, exin4, jtag, ebu a23, ebu a24, ebu a25, 53 + ebu clk, ebu cs1, ebu wait, nand ale, nand cs1, nand cle, nand rdy, 54 + nand rd, spi, spi_cs1, spi_cs2, spi_cs3, spi_cs4, spi_cs5, spi_cs6, 55 + asc0, asc0 cts rts, stp, nmi, gpt1, gpt2, gpt3, clkout0, clkout1, 56 + clkout2, clkout3, gnt1, gnt2, gnt3, gnt4, req1, req2, req3, req4, mdio, 57 + gphy0 led0, gphy0 led1, gphy0 led2, gphy1 led0, gphy1 led1, gphy1 led2 57 58 58 59 functions: 59 - spi, asc, cgu, jtag, exin, stp, gpt, nmi, pci, ebu, mdio 60 + spi, asc, cgu, jtag, exin, stp, gpt, nmi, pci, ebu, mdio, gphy 60 61 62 + AMAZON: 63 + mux groups: 64 + exin0, exin1, exin2, jtag, spi_di, spi_do, spi_clk, spi_cs1, spi_cs2, 65 + spi_cs3, spi_cs4, spi_cs5, spi_cs6, asc, stp, gpt1, gpt2, gpt3, clkout0, 66 + clkout1, clkout2, mdio, dfe led0, dfe led1, ephy led0, ephy led1, ephy led2 67 + 68 + functions: 69 + spi, asc, cgu, jtag, exin, stp, gpt, mdio, ephy, dfe 70 + 71 + DANUBE: 72 + mux groups: 73 + exin0, exin1, exin2, jtag, ebu a23, ebu a24, ebu a25, ebu clk, ebu cs1, 74 + ebu wait, nand ale, nand cs1, nand cle, spi_di, spi_do, spi_clk, spi_cs1, 75 + spi_cs2, spi_cs3, spi_cs4, spi_cs5, spi_cs6, asc0, asc0 cts rts, stp, nmi, 76 + gpt1, gpt2, gpt3, clkout0, clkout1, clkout2, clkout3, gnt1, gnt2, gnt3, 77 + req1, req2, req3, dfe led0, dfe led1 78 + 79 + functions: 80 + spi, asc, cgu, jtag, exin, stp, gpt, nmi, pci, ebu, dfe 81 + 82 + xRX100: 83 + mux groups: 84 + exin0, exin1, exin2, exin3, exin4, ebu a23, ebu a24, ebu a25, ebu clk, 85 + ebu cs1, ebu wait, nand ale, nand cs1, nand cle, nand rdy, nand rd, 86 + spi_di, spi_do, spi_clk, spi_cs1, spi_cs2, spi_cs3, spi_cs4, spi_cs5, 87 + spi_cs6, asc0, asc0 cts rts, stp, nmi, gpt1, gpt2, gpt3, clkout0, clkout1, 88 + clkout2, clkout3, gnt1, gnt2, gnt3, gnt4, req1, req2, req3, req4, mdio, 89 + dfe led0, dfe led1 90 + 91 + functions: 92 + spi, asc, cgu, exin, stp, gpt, nmi, pci, ebu, mdio, dfe 93 + 94 + xRX200: 95 + mux groups: 96 + exin0, exin1, exin2, exin3, exin4, ebu a23, ebu a24, ebu a25, ebu clk, 97 + ebu cs1, ebu wait, nand ale, nand cs1, nand cle, nand rdy, nand rd, 98 + spi_di, spi_do, spi_clk, spi_cs1, spi_cs2, spi_cs3, spi_cs4, spi_cs5, 99 + spi_cs6, usif uart_rx, usif uart_tx, usif uart_rts, usif uart_cts, 100 + usif uart_dtr, usif uart_dsr, usif uart_dcd, usif uart_ri, usif spi_di, 101 + usif spi_do, usif spi_clk, usif spi_cs0, usif spi_cs1, usif spi_cs2, 102 + stp, nmi, gpt1, gpt2, gpt3, clkout0, clkout1, clkout2, clkout3, gnt1, 103 + gnt2, gnt3, gnt4, req1, req2, req3, req4, mdio, dfe led0, dfe led1, 104 + gphy0 led0, gphy0 led1, gphy0 led2, gphy1 led0, gphy1 led1, gphy1 led2 105 + 106 + functions: 107 + spi, usif, cgu, exin, stp, gpt, nmi, pci, ebu, mdio, dfe, gphy 108 + 109 + xRX300: 110 + mux groups: 111 + exin0, exin1, exin2, exin4, nand ale, nand cs0, nand cs1, nand cle, 112 + nand rdy, nand rd, nand_d0, nand_d1, nand_d2, nand_d3, nand_d4, nand_d5, 113 + nand_d6, nand_d7, nand_d1, nand wr, nand wp, nand se, spi_di, spi_do, 114 + spi_clk, spi_cs1, spi_cs4, spi_cs6, usif uart_rx, usif uart_tx, 115 + usif spi_di, usif spi_do, usif spi_clk, usif spi_cs0, stp, clkout2, 116 + mdio, dfe led0, dfe led1, ephy0 led0, ephy0 led1, ephy1 led0, ephy1 led1 117 + 118 + functions: 119 + spi, usif, cgu, exin, stp, ebu, mdio, dfe, ephy 61 120 62 121 63 122 Definition of pin configurations: ··· 139 62 0: none, 1: down, 2: up. 140 63 - lantiq,open-drain: Boolean, enables open-drain on the defined pin. 141 64 142 - Valid values for XWAY pin names: 65 + Valid values for XWAY pin names: (DEPRECATED: Use DANUBE) 143 66 Pinconf pins can be referenced via the names io0-io31. 144 67 145 - Valid values for XR9 pin names: 68 + Valid values for XR9 pin names: (DEPRECATED: Use xrX100/xRX200) 146 69 Pinconf pins can be referenced via the names io0-io55. 70 + 71 + Valid values for AMAZON pin names: 72 + Pinconf pins can be referenced via the names io0-io31. 73 + 74 + Valid values for DANUBE pin names: 75 + Pinconf pins can be referenced via the names io0-io31. 76 + 77 + Valid values for xRX100 pin names: 78 + Pinconf pins can be referenced via the names io0-io55. 79 + 80 + Valid values for xRX200 pin names: 81 + Pinconf pins can be referenced via the names io0-io49. 82 + 83 + Valid values for xRX300 pin names: 84 + Pinconf pins can be referenced via the names io0-io1,io3-io6,io8-io11, 85 + io13-io19,io23-io27,io34-io36, 86 + io42-io43,io48-io61. 147 87 148 88 Example: 149 89 gpio: pinmux@E100B10 { 150 - compatible = "lantiq,pinctrl-xway"; 90 + compatible = "lantiq,danube-pinctrl"; 151 91 pinctrl-names = "default"; 152 92 pinctrl-0 = <&state_default>; 153 93
+5 -4
Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
··· 4 4 5 5 Required properties: 6 6 - compatible: value should be one of the following. 7 - (a) "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl. 8 - (b) "mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl. 9 - (c) "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl. 10 - (d) "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl. 7 + "mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl. 8 + "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl. 9 + "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl. 10 + "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl. 11 + "mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl. 11 12 - pins-are-numbered: Specify the subnodes are using numbered pinmux to 12 13 specify pins. 13 14 - gpio-controller : Marks the device node as a gpio controller.
+199
Documentation/devicetree/bindings/pinctrl/qcom,msm8996-pinctrl.txt
··· 1 + Qualcomm MSM8996 TLMM block 2 + 3 + This binding describes the Top Level Mode Multiplexer block found in the 4 + MSM8996 platform. 5 + 6 + - compatible: 7 + Usage: required 8 + Value type: <string> 9 + Definition: must be "qcom,msm8996-pinctrl" 10 + 11 + - reg: 12 + Usage: required 13 + Value type: <prop-encoded-array> 14 + Definition: the base address and size of the TLMM register space. 15 + 16 + - interrupts: 17 + Usage: required 18 + Value type: <prop-encoded-array> 19 + Definition: should specify the TLMM summary IRQ. 20 + 21 + - interrupt-controller: 22 + Usage: required 23 + Value type: <none> 24 + Definition: identifies this node as an interrupt controller 25 + 26 + - #interrupt-cells: 27 + Usage: required 28 + Value type: <u32> 29 + Definition: must be 2. Specifying the pin number and flags, as defined 30 + in <dt-bindings/interrupt-controller/irq.h> 31 + 32 + - gpio-controller: 33 + Usage: required 34 + Value type: <none> 35 + Definition: identifies this node as a gpio controller 36 + 37 + - #gpio-cells: 38 + Usage: required 39 + Value type: <u32> 40 + Definition: must be 2. Specifying the pin number and flags, as defined 41 + in <dt-bindings/gpio/gpio.h> 42 + 43 + Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 + a general description of GPIO and interrupt bindings. 45 + 46 + Please refer to pinctrl-bindings.txt in this directory for details of the 47 + common pinctrl bindings used by client devices, including the meaning of the 48 + phrase "pin configuration node". 49 + 50 + The pin configuration nodes act as a container for an arbitrary number of 51 + subnodes. Each of these subnodes represents some desired configuration for a 52 + pin, a group, or a list of pins or groups. This configuration can include the 53 + mux function to select on those pin(s)/group(s), and various pin configuration 54 + parameters, such as pull-up, drive strength, etc. 55 + 56 + 57 + PIN CONFIGURATION NODES: 58 + 59 + The name of each subnode is not important; all subnodes should be enumerated 60 + and processed purely based on their content. 61 + 62 + Each subnode only affects those parameters that are explicitly listed. In 63 + other words, a subnode that lists a mux function but no pin configuration 64 + parameters implies no information about any pin configuration parameters. 65 + Similarly, a pin subnode that describes a pullup parameter implies no 66 + information about e.g. the mux function. 67 + 68 + 69 + The following generic properties as defined in pinctrl-bindings.txt are valid 70 + to specify in a pin configuration subnode: 71 + 72 + - pins: 73 + Usage: required 74 + Value type: <string-array> 75 + Definition: List of gpio pins affected by the properties specified in 76 + this subnode. 77 + 78 + Valid pins are: 79 + gpio0-gpio149 80 + Supports mux, bias and drive-strength 81 + 82 + sdc1_clk, sdc1_cmd, sdc1_data sdc2_clk, sdc2_cmd, 83 + sdc2_data sdc1_rclk 84 + Supports bias and drive-strength 85 + 86 + - function: 87 + Usage: required 88 + Value type: <string> 89 + Definition: Specify the alternative function to be configured for the 90 + specified pins. Functions are only valid for gpio pins. 91 + Valid values are: 92 + 93 + blsp_uart1, blsp_spi1, blsp_i2c1, blsp_uim1, atest_tsens, 94 + bimc_dte1, dac_calib0, blsp_spi8, blsp_uart8, blsp_uim8, 95 + qdss_cti_trig_out_b, bimc_dte0, dac_calib1, qdss_cti_trig_in_b, 96 + dac_calib2, atest_tsens2, atest_usb1, blsp_spi10, blsp_uart10, 97 + blsp_uim10, atest_bbrx1, atest_usb13, atest_bbrx0, atest_usb12, 98 + mdp_vsync, edp_lcd, blsp_i2c10, atest_gpsadc1, atest_usb11, 99 + atest_gpsadc0, edp_hot, atest_usb10, m_voc, dac_gpio, atest_char, 100 + cam_mclk, pll_bypassnl, qdss_stm7, blsp_i2c8, qdss_tracedata_b, 101 + pll_reset, qdss_stm6, qdss_stm5, qdss_stm4, atest_usb2, cci_i2c, 102 + qdss_stm3, dac_calib3, atest_usb23, atest_char3, dac_calib4, 103 + qdss_stm2, atest_usb22, atest_char2, qdss_stm1, dac_calib5, 104 + atest_usb21, atest_char1, dbg_out, qdss_stm0, dac_calib6, 105 + atest_usb20, atest_char0, dac_calib10, qdss_stm10, 106 + qdss_cti_trig_in_a, cci_timer4, blsp_spi6, blsp_uart6, blsp_uim6, 107 + blsp2_spi, qdss_stm9, qdss_cti_trig_out_a, dac_calib11, 108 + qdss_stm8, cci_timer0, qdss_stm13, dac_calib7, cci_timer1, 109 + qdss_stm12, dac_calib8, cci_timer2, blsp1_spi, qdss_stm11, 110 + dac_calib9, cci_timer3, cci_async, dac_calib12, blsp_i2c6, 111 + qdss_tracectl_a, dac_calib13, qdss_traceclk_a, dac_calib14, 112 + dac_calib15, hdmi_rcv, dac_calib16, hdmi_cec, pwr_modem, 113 + dac_calib17, hdmi_ddc, pwr_nav, dac_calib18, pwr_crypto, 114 + dac_calib19, hdmi_hot, dac_calib20, dac_calib21, pci_e0, 115 + dac_calib22, dac_calib23, dac_calib24, tsif1_sync, dac_calib25, 116 + sd_write, tsif1_error, blsp_spi2, blsp_uart2, blsp_uim2, 117 + qdss_cti, blsp_i2c2, blsp_spi3, blsp_uart3, blsp_uim3, blsp_i2c3, 118 + uim3, blsp_spi9, blsp_uart9, blsp_uim9, blsp10_spi, blsp_i2c9, 119 + blsp_spi7, blsp_uart7, blsp_uim7, qdss_tracedata_a, blsp_i2c7, 120 + qua_mi2s, gcc_gp1_clk_a, ssc_irq, uim4, blsp_spi11, blsp_uart11, 121 + blsp_uim11, gcc_gp2_clk_a, gcc_gp3_clk_a, blsp_i2c11, cri_trng0, 122 + cri_trng1, cri_trng, qdss_stm18, pri_mi2s, qdss_stm17, blsp_spi4, 123 + blsp_uart4, blsp_uim4, qdss_stm16, qdss_stm15, blsp_i2c4, 124 + qdss_stm14, dac_calib26, spkr_i2s, audio_ref, lpass_slimbus, 125 + isense_dbg, tsense_pwm1, tsense_pwm2, btfm_slimbus, ter_mi2s, 126 + qdss_stm22, qdss_stm21, qdss_stm20, qdss_stm19, gcc_gp1_clk_b, 127 + sec_mi2s, blsp_spi5, blsp_uart5, blsp_uim5, gcc_gp2_clk_b, 128 + gcc_gp3_clk_b, blsp_i2c5, blsp_spi12, blsp_uart12, blsp_uim12, 129 + qdss_stm25, qdss_stm31, blsp_i2c12, qdss_stm30, qdss_stm29, 130 + tsif1_clk, qdss_stm28, tsif1_en, tsif1_data, sdc4_cmd, qdss_stm27, 131 + qdss_traceclk_b, tsif2_error, sdc43, vfr_1, qdss_stm26, tsif2_clk, 132 + sdc4_clk, qdss_stm24, tsif2_en, sdc42, qdss_stm23, qdss_tracectl_b, 133 + sd_card, tsif2_data, sdc41, tsif2_sync, sdc40, mdp_vsync_p_b, 134 + ldo_en, mdp_vsync_s_b, ldo_update, blsp11_uart_tx_b, blsp11_uart_rx_b, 135 + blsp11_i2c_sda_b, prng_rosc, blsp11_i2c_scl_b, uim2, uim1, uim_batt, 136 + pci_e2, pa_indicator, adsp_ext, ddr_bist, qdss_tracedata_11, 137 + qdss_tracedata_12, modem_tsync, nav_dr, nav_pps, pci_e1, gsm_tx, 138 + qspi_cs, ssbi2, ssbi1, mss_lte, qspi_clk, qspi0, qspi1, qspi2, qspi3, 139 + gpio 140 + 141 + - bias-disable: 142 + Usage: optional 143 + Value type: <none> 144 + Definition: The specified pins should be configued as no pull. 145 + 146 + - bias-pull-down: 147 + Usage: optional 148 + Value type: <none> 149 + Definition: The specified pins should be configued as pull down. 150 + 151 + - bias-pull-up: 152 + Usage: optional 153 + Value type: <none> 154 + Definition: The specified pins should be configued as pull up. 155 + 156 + - output-high: 157 + Usage: optional 158 + Value type: <none> 159 + Definition: The specified pins are configured in output mode, driven 160 + high. 161 + Not valid for sdc pins. 162 + 163 + - output-low: 164 + Usage: optional 165 + Value type: <none> 166 + Definition: The specified pins are configured in output mode, driven 167 + low. 168 + Not valid for sdc pins. 169 + 170 + - drive-strength: 171 + Usage: optional 172 + Value type: <u32> 173 + Definition: Selects the drive strength for the specified pins, in mA. 174 + Valid values are: 2, 4, 6, 8, 10, 12, 14 and 16 175 + 176 + Example: 177 + 178 + tlmm: pinctrl@01010000 { 179 + compatible = "qcom,msm8996-pinctrl"; 180 + reg = <0x01010000 0x300000>; 181 + interrupts = <0 208 0>; 182 + gpio-controller; 183 + #gpio-cells = <2>; 184 + interrupt-controller; 185 + #interrupt-cells = <2>; 186 + 187 + uart_console_active: uart_console_active { 188 + mux { 189 + pins = "gpio4", "gpio5"; 190 + function = "blsp_uart8"; 191 + }; 192 + 193 + config { 194 + pins = "gpio4", "gpio5"; 195 + drive-strength = <2>; 196 + bias-disable; 197 + }; 198 + }; 199 + };
+2
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
··· 14 14 "qcom,pm8917-gpio" 15 15 "qcom,pm8921-gpio" 16 16 "qcom,pm8941-gpio" 17 + "qcom,pm8994-gpio" 17 18 "qcom,pma8084-gpio" 18 19 19 20 - reg: ··· 80 79 gpio1-gpio38 for pm8917 81 80 gpio1-gpio44 for pm8921 82 81 gpio1-gpio36 for pm8941 82 + gpio1-gpio22 for pm8994 83 83 gpio1-gpio22 for pma8084 84 84 85 85 - function:
+1
Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
··· 15 15 "qcom,pm8917-mpp", 16 16 "qcom,pm8921-mpp", 17 17 "qcom,pm8941-mpp", 18 + "qcom,pm8994-mpp", 18 19 "qcom,pma8084-mpp", 19 20 20 21 - reg:
+2 -1
Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
··· 21 21 Required properties for iomux controller: 22 22 - compatible: one of "rockchip,rk2928-pinctrl", "rockchip,rk3066a-pinctrl" 23 23 "rockchip,rk3066b-pinctrl", "rockchip,rk3188-pinctrl" 24 - "rockchip,rk3288-pinctrl", "rockchip,rk3368-pinctrl" 24 + "rockchip,rk3228-pinctrl", "rockchip,rk3288-pinctrl" 25 + "rockchip,rk3368-pinctrl" 25 26 - rockchip,grf: phandle referencing a syscon providing the 26 27 "general register files" 27 28
+1
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
··· 17 17 - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. 18 18 - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. 19 19 - "samsung,exynos5260-pinctrl": for Exynos5260 compatible pin-controller. 20 + - "samsung,exynos5410-pinctrl": for Exynos5410 compatible pin-controller. 20 21 - "samsung,exynos5420-pinctrl": for Exynos5420 compatible pin-controller. 21 22 - "samsung,exynos7-pinctrl": for Exynos7 compatible pin-controller. 22 23
+2
MAINTAINERS
··· 8366 8366 8367 8367 PIN CONTROLLER - RENESAS 8368 8368 M: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 8369 + M: Geert Uytterhoeven <geert+renesas@glider.be> 8369 8370 L: linux-sh@vger.kernel.org 8370 8371 S: Maintained 8371 8372 F: drivers/pinctrl/sh-pfc/ ··· 8637 8636 F: arch/arm/mach-pxa/ 8638 8637 F: drivers/dma/pxa* 8639 8638 F: drivers/pcmcia/pxa2xx* 8639 + F: drivers/pinctrl/pxa/ 8640 8640 F: drivers/spi/spi-pxa2xx* 8641 8641 F: drivers/usb/gadget/udc/pxa2* 8642 8642 F: include/sound/pxa2xx-lib.h
+20
drivers/base/platform.c
··· 117 117 EXPORT_SYMBOL_GPL(platform_get_irq); 118 118 119 119 /** 120 + * platform_irq_count - Count the number of IRQs a platform device uses 121 + * @dev: platform device 122 + * 123 + * Return: Number of IRQs a platform device uses or EPROBE_DEFER 124 + */ 125 + int platform_irq_count(struct platform_device *dev) 126 + { 127 + int ret, nr = 0; 128 + 129 + while ((ret = platform_get_irq(dev, nr)) >= 0) 130 + nr++; 131 + 132 + if (ret == -EPROBE_DEFER) 133 + return ret; 134 + 135 + return nr; 136 + } 137 + EXPORT_SYMBOL_GPL(platform_irq_count); 138 + 139 + /** 120 140 * platform_get_resource_byname - get a resource for a device by name 121 141 * @dev: platform device 122 142 * @type: resource type
+2 -1
drivers/pinctrl/Kconfig
··· 244 244 select PINMUX 245 245 select GENERIC_PINCONF 246 246 help 247 - This selectes the pinctrl driver for Xilinx Zynq. 247 + This selects the pinctrl driver for Xilinx Zynq. 248 248 249 249 source "drivers/pinctrl/bcm/Kconfig" 250 250 source "drivers/pinctrl/berlin/Kconfig" ··· 252 252 source "drivers/pinctrl/intel/Kconfig" 253 253 source "drivers/pinctrl/mvebu/Kconfig" 254 254 source "drivers/pinctrl/nomadik/Kconfig" 255 + source "drivers/pinctrl/pxa/Kconfig" 255 256 source "drivers/pinctrl/qcom/Kconfig" 256 257 source "drivers/pinctrl/samsung/Kconfig" 257 258 source "drivers/pinctrl/sh-pfc/Kconfig"
+4 -3
drivers/pinctrl/Makefile
··· 41 41 obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o 42 42 43 43 obj-$(CONFIG_ARCH_BCM) += bcm/ 44 - obj-$(CONFIG_ARCH_BERLIN) += berlin/ 44 + obj-$(CONFIG_PINCTRL_BERLIN) += berlin/ 45 45 obj-y += freescale/ 46 46 obj-$(CONFIG_X86) += intel/ 47 - obj-$(CONFIG_PLAT_ORION) += mvebu/ 47 + obj-$(CONFIG_PINCTRL_MVEBU) += mvebu/ 48 48 obj-y += nomadik/ 49 + obj-$(CONFIG_ARCH_PXA) += pxa/ 49 50 obj-$(CONFIG_ARCH_QCOM) += qcom/ 50 51 obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/ 51 52 obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc/ 52 - obj-$(CONFIG_PLAT_SPEAR) += spear/ 53 + obj-$(CONFIG_PINCTRL_SPEAR) += spear/ 53 54 obj-$(CONFIG_ARCH_SUNXI) += sunxi/ 54 55 obj-$(CONFIG_PINCTRL_UNIPHIER) += uniphier/ 55 56 obj-$(CONFIG_ARCH_VT8500) += vt8500/
+40 -8
drivers/pinctrl/bcm/Kconfig
··· 9 9 select PINCONF 10 10 select GENERIC_PINCONF 11 11 select REGMAP_MMIO 12 + default ARCH_BCM_MOBILE 12 13 help 13 14 Say Y here to support Broadcom BCM281xx pinctrl driver, which is used 14 15 for the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, ··· 21 20 select PINMUX 22 21 select PINCONF 23 22 24 - config PINCTRL_CYGNUS_GPIO 25 - bool "Broadcom Cygnus GPIO (with PINCONF) driver" 26 - depends on OF_GPIO && ARCH_BCM_CYGNUS 23 + config PINCTRL_IPROC_GPIO 24 + bool "Broadcom iProc GPIO (with PINCONF) driver" 25 + depends on OF_GPIO && (ARCH_BCM_IPROC || COMPILE_TEST) 27 26 select GPIOLIB_IRQCHIP 28 27 select PINCONF 29 28 select GENERIC_PINCONF 30 - default ARCH_BCM_CYGNUS 29 + default ARCH_BCM_IPROC 31 30 help 32 - Say yes here to enable the Broadcom Cygnus GPIO driver. 31 + Say yes here to enable the Broadcom iProc GPIO driver. 32 + 33 + The Broadcom iProc based SoCs- Cygnus, NS2, NSP and Stingray, use 34 + same GPIO Controller IP hence this driver could be used for all. 33 35 34 36 The Broadcom Cygnus SoC has 3 GPIO controllers including the ASIU 35 37 GPIO controller (ASIU), the chipCommonG GPIO controller (CCM), and 36 38 the always-ON GPIO controller (CRMU/AON). All 3 GPIO controllers are 37 39 supported by this driver. 38 40 39 - All 3 Cygnus GPIO controllers support basic PINCONF functions such 41 + The Broadcom NSP has two GPIO controllers including the ChipcommonA 42 + GPIO, the ChipcommonB GPIO. Later controller is supported by this 43 + driver. 44 + 45 + The Broadcom NS2 has two GPIO controller including the CRMU GPIO, 46 + the ChipcommonG GPIO. Both controllers are supported by this driver. 47 + 48 + The Broadcom Stingray GPIO controllers are supported by this driver. 49 + 50 + All above SoCs GPIO controllers support basic PINCONF functions such 40 51 as bias pull up, pull down, and drive strength configurations, when 41 52 these pins are muxed to GPIO. 42 53 43 - Pins from the ASIU GPIO can be individually muxed to GPIO function, 44 - through interaction with the Cygnus IOMUX controller. 54 + It provides the framework where pins from the individual GPIO can be 55 + individually muxed to GPIO function, through interaction with the 56 + SoCs IOMUX controller. This features could be used only on SoCs which 57 + support individual pin muxing. 45 58 46 59 config PINCTRL_CYGNUS_MUX 47 60 bool "Broadcom Cygnus IOMUX driver" ··· 69 54 The Broadcom Cygnus IOMUX driver supports group based IOMUX 70 55 configuration, with the exception that certain individual pins 71 56 can be overrided to GPIO function 57 + 58 + config PINCTRL_NSP_GPIO 59 + bool "Broadcom NSP GPIO (with PINCONF) driver" 60 + depends on OF_GPIO && (ARCH_BCM_NSP || COMPILE_TEST) 61 + select GPIOLIB_IRQCHIP 62 + select PINCONF 63 + select GENERIC_PINCONF 64 + default ARCH_BCM_NSP 65 + help 66 + Say yes here to enable the Broadcom NSP GPIO driver. 67 + 68 + The Broadcom Northstar Plus SoC ChipcommonA GPIO controller is 69 + supported by this driver. 70 + 71 + The ChipcommonA GPIO controller support basic PINCONF functions such 72 + as bias pull up, pull down, and drive strength configurations, when 73 + these pins are muxed to GPIO.
+2 -1
drivers/pinctrl/bcm/Makefile
··· 2 2 3 3 obj-$(CONFIG_PINCTRL_BCM281XX) += pinctrl-bcm281xx.o 4 4 obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o 5 - obj-$(CONFIG_PINCTRL_CYGNUS_GPIO) += pinctrl-cygnus-gpio.o 5 + obj-$(CONFIG_PINCTRL_IPROC_GPIO) += pinctrl-iproc-gpio.o 6 6 obj-$(CONFIG_PINCTRL_CYGNUS_MUX) += pinctrl-cygnus-mux.o 7 + obj-$(CONFIG_PINCTRL_NSP_GPIO) += pinctrl-nsp-gpio.o
+1 -1
drivers/pinctrl/bcm/pinctrl-bcm2835.c
··· 795 795 return 0; 796 796 797 797 out: 798 - kfree(maps); 798 + bcm2835_pctl_dt_free_map(pctldev, maps, num_pins * maps_per_pin); 799 799 return err; 800 800 } 801 801
+166 -192
drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
··· 10 10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * GNU General Public License for more details. 12 12 * 13 - * This file contains the Broadcom Cygnus GPIO driver that supports 3 14 - * GPIO controllers on Cygnus including the ASIU GPIO controller, the 13 + * This file contains the Broadcom Iproc GPIO driver that supports 3 14 + * GPIO controllers on Iproc including the ASIU GPIO controller, the 15 15 * chipCommonG GPIO controller, and the always-on GPIO controller. Basic 16 16 * PINCONF such as bias pull up/down, and drive strength are also supported 17 17 * in this driver. 18 18 * 19 - * Pins from the ASIU GPIO can be individually muxed to GPIO function, 20 - * through the interaction with the Cygnus IOMUX controller 19 + * It provides the functionality where pins from the GPIO can be 20 + * individually muxed to GPIO function, if individual pad 21 + * configuration is supported, through the interaction with respective 22 + * SoCs IOMUX controller. 21 23 */ 22 24 23 25 #include <linux/kernel.h> ··· 36 34 37 35 #include "../pinctrl-utils.h" 38 36 39 - #define CYGNUS_GPIO_DATA_IN_OFFSET 0x00 40 - #define CYGNUS_GPIO_DATA_OUT_OFFSET 0x04 41 - #define CYGNUS_GPIO_OUT_EN_OFFSET 0x08 42 - #define CYGNUS_GPIO_INT_TYPE_OFFSET 0x0c 43 - #define CYGNUS_GPIO_INT_DE_OFFSET 0x10 44 - #define CYGNUS_GPIO_INT_EDGE_OFFSET 0x14 45 - #define CYGNUS_GPIO_INT_MSK_OFFSET 0x18 46 - #define CYGNUS_GPIO_INT_STAT_OFFSET 0x1c 47 - #define CYGNUS_GPIO_INT_MSTAT_OFFSET 0x20 48 - #define CYGNUS_GPIO_INT_CLR_OFFSET 0x24 49 - #define CYGNUS_GPIO_PAD_RES_OFFSET 0x34 50 - #define CYGNUS_GPIO_RES_EN_OFFSET 0x38 37 + #define IPROC_GPIO_DATA_IN_OFFSET 0x00 38 + #define IPROC_GPIO_DATA_OUT_OFFSET 0x04 39 + #define IPROC_GPIO_OUT_EN_OFFSET 0x08 40 + #define IPROC_GPIO_INT_TYPE_OFFSET 0x0c 41 + #define IPROC_GPIO_INT_DE_OFFSET 0x10 42 + #define IPROC_GPIO_INT_EDGE_OFFSET 0x14 43 + #define IPROC_GPIO_INT_MSK_OFFSET 0x18 44 + #define IPROC_GPIO_INT_STAT_OFFSET 0x1c 45 + #define IPROC_GPIO_INT_MSTAT_OFFSET 0x20 46 + #define IPROC_GPIO_INT_CLR_OFFSET 0x24 47 + #define IPROC_GPIO_PAD_RES_OFFSET 0x34 48 + #define IPROC_GPIO_RES_EN_OFFSET 0x38 51 49 52 50 /* drive strength control for ASIU GPIO */ 53 - #define CYGNUS_GPIO_ASIU_DRV0_CTRL_OFFSET 0x58 51 + #define IPROC_GPIO_ASIU_DRV0_CTRL_OFFSET 0x58 54 52 55 53 /* drive strength control for CCM/CRMU (AON) GPIO */ 56 - #define CYGNUS_GPIO_DRV0_CTRL_OFFSET 0x00 54 + #define IPROC_GPIO_DRV0_CTRL_OFFSET 0x00 57 55 58 56 #define GPIO_BANK_SIZE 0x200 59 57 #define NGPIOS_PER_BANK 32 60 58 #define GPIO_BANK(pin) ((pin) / NGPIOS_PER_BANK) 61 59 62 - #define CYGNUS_GPIO_REG(pin, reg) (GPIO_BANK(pin) * GPIO_BANK_SIZE + (reg)) 63 - #define CYGNUS_GPIO_SHIFT(pin) ((pin) % NGPIOS_PER_BANK) 60 + #define IPROC_GPIO_REG(pin, reg) (GPIO_BANK(pin) * GPIO_BANK_SIZE + (reg)) 61 + #define IPROC_GPIO_SHIFT(pin) ((pin) % NGPIOS_PER_BANK) 64 62 65 63 #define GPIO_DRV_STRENGTH_BIT_SHIFT 20 66 64 #define GPIO_DRV_STRENGTH_BITS 3 67 65 #define GPIO_DRV_STRENGTH_BIT_MASK ((1 << GPIO_DRV_STRENGTH_BITS) - 1) 68 66 69 67 /* 70 - * Cygnus GPIO core 68 + * Iproc GPIO core 71 69 * 72 70 * @dev: pointer to device 73 - * @base: I/O register base for Cygnus GPIO controller 74 - * @io_ctrl: I/O register base for certain type of Cygnus GPIO controller that 71 + * @base: I/O register base for Iproc GPIO controller 72 + * @io_ctrl: I/O register base for certain type of Iproc GPIO controller that 75 73 * has the PINCONF support implemented outside of the GPIO block 76 74 * @lock: lock to protect access to I/O registers 77 75 * @gc: GPIO chip ··· 81 79 * @pctl: pointer to pinctrl_dev 82 80 * @pctldesc: pinctrl descriptor 83 81 */ 84 - struct cygnus_gpio { 82 + struct iproc_gpio { 85 83 struct device *dev; 86 84 87 85 void __iomem *base; ··· 98 96 struct pinctrl_desc pctldesc; 99 97 }; 100 98 101 - static inline struct cygnus_gpio *to_cygnus_gpio(struct gpio_chip *gc) 99 + static inline struct iproc_gpio *to_iproc_gpio(struct gpio_chip *gc) 102 100 { 103 - return container_of(gc, struct cygnus_gpio, gc); 101 + return container_of(gc, struct iproc_gpio, gc); 104 102 } 105 103 106 104 /* 107 105 * Mapping from PINCONF pins to GPIO pins is 1-to-1 108 106 */ 109 - static inline unsigned cygnus_pin_to_gpio(unsigned pin) 107 + static inline unsigned iproc_pin_to_gpio(unsigned pin) 110 108 { 111 109 return pin; 112 110 } 113 111 114 112 /** 115 - * cygnus_set_bit - set or clear one bit (corresponding to the GPIO pin) in a 116 - * Cygnus GPIO register 113 + * iproc_set_bit - set or clear one bit (corresponding to the GPIO pin) in a 114 + * Iproc GPIO register 117 115 * 118 - * @cygnus_gpio: Cygnus GPIO device 116 + * @iproc_gpio: Iproc GPIO device 119 117 * @reg: register offset 120 118 * @gpio: GPIO pin 121 119 * @set: set or clear 122 120 */ 123 - static inline void cygnus_set_bit(struct cygnus_gpio *chip, unsigned int reg, 121 + static inline void iproc_set_bit(struct iproc_gpio *chip, unsigned int reg, 124 122 unsigned gpio, bool set) 125 123 { 126 - unsigned int offset = CYGNUS_GPIO_REG(gpio, reg); 127 - unsigned int shift = CYGNUS_GPIO_SHIFT(gpio); 124 + unsigned int offset = IPROC_GPIO_REG(gpio, reg); 125 + unsigned int shift = IPROC_GPIO_SHIFT(gpio); 128 126 u32 val; 129 127 130 128 val = readl(chip->base + offset); ··· 135 133 writel(val, chip->base + offset); 136 134 } 137 135 138 - static inline bool cygnus_get_bit(struct cygnus_gpio *chip, unsigned int reg, 136 + static inline bool iproc_get_bit(struct iproc_gpio *chip, unsigned int reg, 139 137 unsigned gpio) 140 138 { 141 - unsigned int offset = CYGNUS_GPIO_REG(gpio, reg); 142 - unsigned int shift = CYGNUS_GPIO_SHIFT(gpio); 139 + unsigned int offset = IPROC_GPIO_REG(gpio, reg); 140 + unsigned int shift = IPROC_GPIO_SHIFT(gpio); 143 141 144 142 return !!(readl(chip->base + offset) & BIT(shift)); 145 143 } 146 144 147 - static void cygnus_gpio_irq_handler(struct irq_desc *desc) 145 + static void iproc_gpio_irq_handler(struct irq_desc *desc) 148 146 { 149 147 struct gpio_chip *gc = irq_desc_get_handler_data(desc); 150 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 148 + struct iproc_gpio *chip = to_iproc_gpio(gc); 151 149 struct irq_chip *irq_chip = irq_desc_get_chip(desc); 152 150 int i, bit; 153 151 ··· 156 154 /* go through the entire GPIO banks and handle all interrupts */ 157 155 for (i = 0; i < chip->num_banks; i++) { 158 156 unsigned long val = readl(chip->base + (i * GPIO_BANK_SIZE) + 159 - CYGNUS_GPIO_INT_MSTAT_OFFSET); 157 + IPROC_GPIO_INT_MSTAT_OFFSET); 160 158 161 159 for_each_set_bit(bit, &val, NGPIOS_PER_BANK) { 162 160 unsigned pin = NGPIOS_PER_BANK * i + bit; ··· 167 165 * handler, so we do not leave any window 168 166 */ 169 167 writel(BIT(bit), chip->base + (i * GPIO_BANK_SIZE) + 170 - CYGNUS_GPIO_INT_CLR_OFFSET); 168 + IPROC_GPIO_INT_CLR_OFFSET); 171 169 172 170 generic_handle_irq(child_irq); 173 171 } ··· 177 175 } 178 176 179 177 180 - static void cygnus_gpio_irq_ack(struct irq_data *d) 178 + static void iproc_gpio_irq_ack(struct irq_data *d) 181 179 { 182 180 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 183 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 181 + struct iproc_gpio *chip = to_iproc_gpio(gc); 184 182 unsigned gpio = d->hwirq; 185 - unsigned int offset = CYGNUS_GPIO_REG(gpio, 186 - CYGNUS_GPIO_INT_CLR_OFFSET); 187 - unsigned int shift = CYGNUS_GPIO_SHIFT(gpio); 183 + unsigned int offset = IPROC_GPIO_REG(gpio, 184 + IPROC_GPIO_INT_CLR_OFFSET); 185 + unsigned int shift = IPROC_GPIO_SHIFT(gpio); 188 186 u32 val = BIT(shift); 189 187 190 188 writel(val, chip->base + offset); 191 189 } 192 190 193 191 /** 194 - * cygnus_gpio_irq_set_mask - mask/unmask a GPIO interrupt 192 + * iproc_gpio_irq_set_mask - mask/unmask a GPIO interrupt 195 193 * 196 194 * @d: IRQ chip data 197 195 * @unmask: mask/unmask GPIO interrupt 198 196 */ 199 - static void cygnus_gpio_irq_set_mask(struct irq_data *d, bool unmask) 197 + static void iproc_gpio_irq_set_mask(struct irq_data *d, bool unmask) 200 198 { 201 199 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 202 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 200 + struct iproc_gpio *chip = to_iproc_gpio(gc); 203 201 unsigned gpio = d->hwirq; 204 202 205 - cygnus_set_bit(chip, CYGNUS_GPIO_INT_MSK_OFFSET, gpio, unmask); 203 + iproc_set_bit(chip, IPROC_GPIO_INT_MSK_OFFSET, gpio, unmask); 206 204 } 207 205 208 - static void cygnus_gpio_irq_mask(struct irq_data *d) 206 + static void iproc_gpio_irq_mask(struct irq_data *d) 209 207 { 210 208 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 211 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 209 + struct iproc_gpio *chip = to_iproc_gpio(gc); 212 210 unsigned long flags; 213 211 214 212 spin_lock_irqsave(&chip->lock, flags); 215 - cygnus_gpio_irq_set_mask(d, false); 213 + iproc_gpio_irq_set_mask(d, false); 216 214 spin_unlock_irqrestore(&chip->lock, flags); 217 215 } 218 216 219 - static void cygnus_gpio_irq_unmask(struct irq_data *d) 217 + static void iproc_gpio_irq_unmask(struct irq_data *d) 220 218 { 221 219 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 222 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 220 + struct iproc_gpio *chip = to_iproc_gpio(gc); 223 221 unsigned long flags; 224 222 225 223 spin_lock_irqsave(&chip->lock, flags); 226 - cygnus_gpio_irq_set_mask(d, true); 224 + iproc_gpio_irq_set_mask(d, true); 227 225 spin_unlock_irqrestore(&chip->lock, flags); 228 226 } 229 227 230 - static int cygnus_gpio_irq_set_type(struct irq_data *d, unsigned int type) 228 + static int iproc_gpio_irq_set_type(struct irq_data *d, unsigned int type) 231 229 { 232 230 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 233 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 231 + struct iproc_gpio *chip = to_iproc_gpio(gc); 234 232 unsigned gpio = d->hwirq; 235 233 bool level_triggered = false; 236 234 bool dual_edge = false; ··· 265 263 } 266 264 267 265 spin_lock_irqsave(&chip->lock, flags); 268 - cygnus_set_bit(chip, CYGNUS_GPIO_INT_TYPE_OFFSET, gpio, 266 + iproc_set_bit(chip, IPROC_GPIO_INT_TYPE_OFFSET, gpio, 269 267 level_triggered); 270 - cygnus_set_bit(chip, CYGNUS_GPIO_INT_DE_OFFSET, gpio, dual_edge); 271 - cygnus_set_bit(chip, CYGNUS_GPIO_INT_EDGE_OFFSET, gpio, 268 + iproc_set_bit(chip, IPROC_GPIO_INT_DE_OFFSET, gpio, dual_edge); 269 + iproc_set_bit(chip, IPROC_GPIO_INT_EDGE_OFFSET, gpio, 272 270 rising_or_high); 273 271 spin_unlock_irqrestore(&chip->lock, flags); 274 272 ··· 279 277 return 0; 280 278 } 281 279 282 - static struct irq_chip cygnus_gpio_irq_chip = { 283 - .name = "bcm-cygnus-gpio", 284 - .irq_ack = cygnus_gpio_irq_ack, 285 - .irq_mask = cygnus_gpio_irq_mask, 286 - .irq_unmask = cygnus_gpio_irq_unmask, 287 - .irq_set_type = cygnus_gpio_irq_set_type, 280 + static struct irq_chip iproc_gpio_irq_chip = { 281 + .name = "bcm-iproc-gpio", 282 + .irq_ack = iproc_gpio_irq_ack, 283 + .irq_mask = iproc_gpio_irq_mask, 284 + .irq_unmask = iproc_gpio_irq_unmask, 285 + .irq_set_type = iproc_gpio_irq_set_type, 288 286 }; 289 287 290 288 /* 291 - * Request the Cygnus IOMUX pinmux controller to mux individual pins to GPIO 289 + * Request the Iproc IOMUX pinmux controller to mux individual pins to GPIO 292 290 */ 293 - static int cygnus_gpio_request(struct gpio_chip *gc, unsigned offset) 291 + static int iproc_gpio_request(struct gpio_chip *gc, unsigned offset) 294 292 { 295 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 293 + struct iproc_gpio *chip = to_iproc_gpio(gc); 296 294 unsigned gpio = gc->base + offset; 297 295 298 - /* not all Cygnus GPIO pins can be muxed individually */ 296 + /* not all Iproc GPIO pins can be muxed individually */ 299 297 if (!chip->pinmux_is_supported) 300 298 return 0; 301 299 302 300 return pinctrl_request_gpio(gpio); 303 301 } 304 302 305 - static void cygnus_gpio_free(struct gpio_chip *gc, unsigned offset) 303 + static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset) 306 304 { 307 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 305 + struct iproc_gpio *chip = to_iproc_gpio(gc); 308 306 unsigned gpio = gc->base + offset; 309 307 310 308 if (!chip->pinmux_is_supported) ··· 313 311 pinctrl_free_gpio(gpio); 314 312 } 315 313 316 - static int cygnus_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) 314 + static int iproc_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) 317 315 { 318 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 316 + struct iproc_gpio *chip = to_iproc_gpio(gc); 319 317 unsigned long flags; 320 318 321 319 spin_lock_irqsave(&chip->lock, flags); 322 - cygnus_set_bit(chip, CYGNUS_GPIO_OUT_EN_OFFSET, gpio, false); 320 + iproc_set_bit(chip, IPROC_GPIO_OUT_EN_OFFSET, gpio, false); 323 321 spin_unlock_irqrestore(&chip->lock, flags); 324 322 325 323 dev_dbg(chip->dev, "gpio:%u set input\n", gpio); ··· 327 325 return 0; 328 326 } 329 327 330 - static int cygnus_gpio_direction_output(struct gpio_chip *gc, unsigned gpio, 328 + static int iproc_gpio_direction_output(struct gpio_chip *gc, unsigned gpio, 331 329 int val) 332 330 { 333 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 331 + struct iproc_gpio *chip = to_iproc_gpio(gc); 334 332 unsigned long flags; 335 333 336 334 spin_lock_irqsave(&chip->lock, flags); 337 - cygnus_set_bit(chip, CYGNUS_GPIO_OUT_EN_OFFSET, gpio, true); 338 - cygnus_set_bit(chip, CYGNUS_GPIO_DATA_OUT_OFFSET, gpio, !!(val)); 335 + iproc_set_bit(chip, IPROC_GPIO_OUT_EN_OFFSET, gpio, true); 336 + iproc_set_bit(chip, IPROC_GPIO_DATA_OUT_OFFSET, gpio, !!(val)); 339 337 spin_unlock_irqrestore(&chip->lock, flags); 340 338 341 339 dev_dbg(chip->dev, "gpio:%u set output, value:%d\n", gpio, val); ··· 343 341 return 0; 344 342 } 345 343 346 - static void cygnus_gpio_set(struct gpio_chip *gc, unsigned gpio, int val) 344 + static void iproc_gpio_set(struct gpio_chip *gc, unsigned gpio, int val) 347 345 { 348 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 346 + struct iproc_gpio *chip = to_iproc_gpio(gc); 349 347 unsigned long flags; 350 348 351 349 spin_lock_irqsave(&chip->lock, flags); 352 - cygnus_set_bit(chip, CYGNUS_GPIO_DATA_OUT_OFFSET, gpio, !!(val)); 350 + iproc_set_bit(chip, IPROC_GPIO_DATA_OUT_OFFSET, gpio, !!(val)); 353 351 spin_unlock_irqrestore(&chip->lock, flags); 354 352 355 353 dev_dbg(chip->dev, "gpio:%u set, value:%d\n", gpio, val); 356 354 } 357 355 358 - static int cygnus_gpio_get(struct gpio_chip *gc, unsigned gpio) 356 + static int iproc_gpio_get(struct gpio_chip *gc, unsigned gpio) 359 357 { 360 - struct cygnus_gpio *chip = to_cygnus_gpio(gc); 361 - unsigned int offset = CYGNUS_GPIO_REG(gpio, 362 - CYGNUS_GPIO_DATA_IN_OFFSET); 363 - unsigned int shift = CYGNUS_GPIO_SHIFT(gpio); 358 + struct iproc_gpio *chip = to_iproc_gpio(gc); 359 + unsigned int offset = IPROC_GPIO_REG(gpio, 360 + IPROC_GPIO_DATA_IN_OFFSET); 361 + unsigned int shift = IPROC_GPIO_SHIFT(gpio); 364 362 365 363 return !!(readl(chip->base + offset) & BIT(shift)); 366 364 } 367 365 368 - static int cygnus_get_groups_count(struct pinctrl_dev *pctldev) 366 + static int iproc_get_groups_count(struct pinctrl_dev *pctldev) 369 367 { 370 368 return 1; 371 369 } ··· 374 372 * Only one group: "gpio_grp", since this local pinctrl device only performs 375 373 * GPIO specific PINCONF configurations 376 374 */ 377 - static const char *cygnus_get_group_name(struct pinctrl_dev *pctldev, 375 + static const char *iproc_get_group_name(struct pinctrl_dev *pctldev, 378 376 unsigned selector) 379 377 { 380 378 return "gpio_grp"; 381 379 } 382 380 383 - static const struct pinctrl_ops cygnus_pctrl_ops = { 384 - .get_groups_count = cygnus_get_groups_count, 385 - .get_group_name = cygnus_get_group_name, 381 + static const struct pinctrl_ops iproc_pctrl_ops = { 382 + .get_groups_count = iproc_get_groups_count, 383 + .get_group_name = iproc_get_group_name, 386 384 .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 387 385 .dt_free_map = pinctrl_utils_dt_free_map, 388 386 }; 389 387 390 - static int cygnus_gpio_set_pull(struct cygnus_gpio *chip, unsigned gpio, 388 + static int iproc_gpio_set_pull(struct iproc_gpio *chip, unsigned gpio, 391 389 bool disable, bool pull_up) 392 390 { 393 391 unsigned long flags; ··· 395 393 spin_lock_irqsave(&chip->lock, flags); 396 394 397 395 if (disable) { 398 - cygnus_set_bit(chip, CYGNUS_GPIO_RES_EN_OFFSET, gpio, false); 396 + iproc_set_bit(chip, IPROC_GPIO_RES_EN_OFFSET, gpio, false); 399 397 } else { 400 - cygnus_set_bit(chip, CYGNUS_GPIO_PAD_RES_OFFSET, gpio, 398 + iproc_set_bit(chip, IPROC_GPIO_PAD_RES_OFFSET, gpio, 401 399 pull_up); 402 - cygnus_set_bit(chip, CYGNUS_GPIO_RES_EN_OFFSET, gpio, true); 400 + iproc_set_bit(chip, IPROC_GPIO_RES_EN_OFFSET, gpio, true); 403 401 } 404 402 405 403 spin_unlock_irqrestore(&chip->lock, flags); ··· 409 407 return 0; 410 408 } 411 409 412 - static void cygnus_gpio_get_pull(struct cygnus_gpio *chip, unsigned gpio, 410 + static void iproc_gpio_get_pull(struct iproc_gpio *chip, unsigned gpio, 413 411 bool *disable, bool *pull_up) 414 412 { 415 413 unsigned long flags; 416 414 417 415 spin_lock_irqsave(&chip->lock, flags); 418 - *disable = !cygnus_get_bit(chip, CYGNUS_GPIO_RES_EN_OFFSET, gpio); 419 - *pull_up = cygnus_get_bit(chip, CYGNUS_GPIO_PAD_RES_OFFSET, gpio); 416 + *disable = !iproc_get_bit(chip, IPROC_GPIO_RES_EN_OFFSET, gpio); 417 + *pull_up = iproc_get_bit(chip, IPROC_GPIO_PAD_RES_OFFSET, gpio); 420 418 spin_unlock_irqrestore(&chip->lock, flags); 421 419 } 422 420 423 - static int cygnus_gpio_set_strength(struct cygnus_gpio *chip, unsigned gpio, 421 + static int iproc_gpio_set_strength(struct iproc_gpio *chip, unsigned gpio, 424 422 unsigned strength) 425 423 { 426 424 void __iomem *base; ··· 434 432 435 433 if (chip->io_ctrl) { 436 434 base = chip->io_ctrl; 437 - offset = CYGNUS_GPIO_DRV0_CTRL_OFFSET; 435 + offset = IPROC_GPIO_DRV0_CTRL_OFFSET; 438 436 } else { 439 437 base = chip->base; 440 - offset = CYGNUS_GPIO_REG(gpio, 441 - CYGNUS_GPIO_ASIU_DRV0_CTRL_OFFSET); 438 + offset = IPROC_GPIO_REG(gpio, 439 + IPROC_GPIO_ASIU_DRV0_CTRL_OFFSET); 442 440 } 443 441 444 - shift = CYGNUS_GPIO_SHIFT(gpio); 442 + shift = IPROC_GPIO_SHIFT(gpio); 445 443 446 444 dev_dbg(chip->dev, "gpio:%u set drive strength:%d mA\n", gpio, 447 445 strength); ··· 460 458 return 0; 461 459 } 462 460 463 - static int cygnus_gpio_get_strength(struct cygnus_gpio *chip, unsigned gpio, 461 + static int iproc_gpio_get_strength(struct iproc_gpio *chip, unsigned gpio, 464 462 u16 *strength) 465 463 { 466 464 void __iomem *base; ··· 470 468 471 469 if (chip->io_ctrl) { 472 470 base = chip->io_ctrl; 473 - offset = CYGNUS_GPIO_DRV0_CTRL_OFFSET; 471 + offset = IPROC_GPIO_DRV0_CTRL_OFFSET; 474 472 } else { 475 473 base = chip->base; 476 - offset = CYGNUS_GPIO_REG(gpio, 477 - CYGNUS_GPIO_ASIU_DRV0_CTRL_OFFSET); 474 + offset = IPROC_GPIO_REG(gpio, 475 + IPROC_GPIO_ASIU_DRV0_CTRL_OFFSET); 478 476 } 479 477 480 - shift = CYGNUS_GPIO_SHIFT(gpio); 478 + shift = IPROC_GPIO_SHIFT(gpio); 481 479 482 480 spin_lock_irqsave(&chip->lock, flags); 483 481 *strength = 0; ··· 495 493 return 0; 496 494 } 497 495 498 - static int cygnus_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin, 496 + static int iproc_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin, 499 497 unsigned long *config) 500 498 { 501 - struct cygnus_gpio *chip = pinctrl_dev_get_drvdata(pctldev); 499 + struct iproc_gpio *chip = pinctrl_dev_get_drvdata(pctldev); 502 500 enum pin_config_param param = pinconf_to_config_param(*config); 503 - unsigned gpio = cygnus_pin_to_gpio(pin); 501 + unsigned gpio = iproc_pin_to_gpio(pin); 504 502 u16 arg; 505 503 bool disable, pull_up; 506 504 int ret; 507 505 508 506 switch (param) { 509 507 case PIN_CONFIG_BIAS_DISABLE: 510 - cygnus_gpio_get_pull(chip, gpio, &disable, &pull_up); 508 + iproc_gpio_get_pull(chip, gpio, &disable, &pull_up); 511 509 if (disable) 512 510 return 0; 513 511 else 514 512 return -EINVAL; 515 513 516 514 case PIN_CONFIG_BIAS_PULL_UP: 517 - cygnus_gpio_get_pull(chip, gpio, &disable, &pull_up); 515 + iproc_gpio_get_pull(chip, gpio, &disable, &pull_up); 518 516 if (!disable && pull_up) 519 517 return 0; 520 518 else 521 519 return -EINVAL; 522 520 523 521 case PIN_CONFIG_BIAS_PULL_DOWN: 524 - cygnus_gpio_get_pull(chip, gpio, &disable, &pull_up); 522 + iproc_gpio_get_pull(chip, gpio, &disable, &pull_up); 525 523 if (!disable && !pull_up) 526 524 return 0; 527 525 else 528 526 return -EINVAL; 529 527 530 528 case PIN_CONFIG_DRIVE_STRENGTH: 531 - ret = cygnus_gpio_get_strength(chip, gpio, &arg); 529 + ret = iproc_gpio_get_strength(chip, gpio, &arg); 532 530 if (ret) 533 531 return ret; 534 - else 535 - *config = pinconf_to_config_packed(param, arg); 532 + *config = pinconf_to_config_packed(param, arg); 536 533 537 534 return 0; 538 535 ··· 542 541 return -ENOTSUPP; 543 542 } 544 543 545 - static int cygnus_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin, 544 + static int iproc_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin, 546 545 unsigned long *configs, unsigned num_configs) 547 546 { 548 - struct cygnus_gpio *chip = pinctrl_dev_get_drvdata(pctldev); 547 + struct iproc_gpio *chip = pinctrl_dev_get_drvdata(pctldev); 549 548 enum pin_config_param param; 550 549 u16 arg; 551 - unsigned i, gpio = cygnus_pin_to_gpio(pin); 550 + unsigned i, gpio = iproc_pin_to_gpio(pin); 552 551 int ret = -ENOTSUPP; 553 552 554 553 for (i = 0; i < num_configs; i++) { ··· 557 556 558 557 switch (param) { 559 558 case PIN_CONFIG_BIAS_DISABLE: 560 - ret = cygnus_gpio_set_pull(chip, gpio, true, false); 559 + ret = iproc_gpio_set_pull(chip, gpio, true, false); 561 560 if (ret < 0) 562 561 goto out; 563 562 break; 564 563 565 564 case PIN_CONFIG_BIAS_PULL_UP: 566 - ret = cygnus_gpio_set_pull(chip, gpio, false, true); 565 + ret = iproc_gpio_set_pull(chip, gpio, false, true); 567 566 if (ret < 0) 568 567 goto out; 569 568 break; 570 569 571 570 case PIN_CONFIG_BIAS_PULL_DOWN: 572 - ret = cygnus_gpio_set_pull(chip, gpio, false, false); 571 + ret = iproc_gpio_set_pull(chip, gpio, false, false); 573 572 if (ret < 0) 574 573 goto out; 575 574 break; 576 575 577 576 case PIN_CONFIG_DRIVE_STRENGTH: 578 - ret = cygnus_gpio_set_strength(chip, gpio, arg); 577 + ret = iproc_gpio_set_strength(chip, gpio, arg); 579 578 if (ret < 0) 580 579 goto out; 581 580 break; ··· 590 589 return ret; 591 590 } 592 591 593 - static const struct pinconf_ops cygnus_pconf_ops = { 592 + static const struct pinconf_ops iproc_pconf_ops = { 594 593 .is_generic = true, 595 - .pin_config_get = cygnus_pin_config_get, 596 - .pin_config_set = cygnus_pin_config_set, 594 + .pin_config_get = iproc_pin_config_get, 595 + .pin_config_set = iproc_pin_config_set, 597 596 }; 598 597 599 598 /* 600 - * Cygnus GPIO controller supports some PINCONF related configurations such as 599 + * Iproc GPIO controller supports some PINCONF related configurations such as 601 600 * pull up, pull down, and drive strength, when the pin is configured to GPIO 602 601 * 603 602 * Here a local pinctrl device is created with simple 1-to-1 pin mapping to the 604 603 * local GPIO pins 605 604 */ 606 - static int cygnus_gpio_register_pinconf(struct cygnus_gpio *chip) 605 + static int iproc_gpio_register_pinconf(struct iproc_gpio *chip) 607 606 { 608 607 struct pinctrl_desc *pctldesc = &chip->pctldesc; 609 608 struct pinctrl_pin_desc *pins; ··· 623 622 } 624 623 625 624 pctldesc->name = dev_name(chip->dev); 626 - pctldesc->pctlops = &cygnus_pctrl_ops; 625 + pctldesc->pctlops = &iproc_pctrl_ops; 627 626 pctldesc->pins = pins; 628 627 pctldesc->npins = gc->ngpio; 629 - pctldesc->confops = &cygnus_pconf_ops; 628 + pctldesc->confops = &iproc_pconf_ops; 630 629 631 630 chip->pctl = pinctrl_register(pctldesc, chip->dev, chip); 632 631 if (IS_ERR(chip->pctl)) { ··· 637 636 return 0; 638 637 } 639 638 640 - static void cygnus_gpio_unregister_pinconf(struct cygnus_gpio *chip) 639 + static void iproc_gpio_unregister_pinconf(struct iproc_gpio *chip) 641 640 { 642 - if (chip->pctl) 643 - pinctrl_unregister(chip->pctl); 641 + pinctrl_unregister(chip->pctl); 644 642 } 645 643 646 - struct cygnus_gpio_data { 647 - unsigned num_gpios; 644 + static const struct of_device_id iproc_gpio_of_match[] = { 645 + { .compatible = "brcm,cygnus-ccm-gpio" }, 646 + { .compatible = "brcm,cygnus-asiu-gpio" }, 647 + { .compatible = "brcm,cygnus-crmu-gpio" }, 648 + { .compatible = "brcm,iproc-gpio" }, 649 + { } 648 650 }; 649 651 650 - static const struct cygnus_gpio_data cygnus_cmm_gpio_data = { 651 - .num_gpios = 24, 652 - }; 653 - 654 - static const struct cygnus_gpio_data cygnus_asiu_gpio_data = { 655 - .num_gpios = 146, 656 - }; 657 - 658 - static const struct cygnus_gpio_data cygnus_crmu_gpio_data = { 659 - .num_gpios = 6, 660 - }; 661 - 662 - static const struct of_device_id cygnus_gpio_of_match[] = { 663 - { 664 - .compatible = "brcm,cygnus-ccm-gpio", 665 - .data = &cygnus_cmm_gpio_data, 666 - }, 667 - { 668 - .compatible = "brcm,cygnus-asiu-gpio", 669 - .data = &cygnus_asiu_gpio_data, 670 - }, 671 - { 672 - .compatible = "brcm,cygnus-crmu-gpio", 673 - .data = &cygnus_crmu_gpio_data, 674 - } 675 - }; 676 - 677 - static int cygnus_gpio_probe(struct platform_device *pdev) 652 + static int iproc_gpio_probe(struct platform_device *pdev) 678 653 { 679 654 struct device *dev = &pdev->dev; 680 655 struct resource *res; 681 - struct cygnus_gpio *chip; 656 + struct iproc_gpio *chip; 682 657 struct gpio_chip *gc; 683 658 u32 ngpios; 684 659 int irq, ret; 685 - const struct of_device_id *match; 686 - const struct cygnus_gpio_data *gpio_data; 687 - 688 - match = of_match_device(cygnus_gpio_of_match, dev); 689 - if (!match) 690 - return -ENODEV; 691 - gpio_data = match->data; 692 - ngpios = gpio_data->num_gpios; 693 660 694 661 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); 695 662 if (!chip) ··· 682 713 } 683 714 } 684 715 716 + if (of_property_read_u32(dev->of_node, "ngpios", &ngpios)) { 717 + dev_err(&pdev->dev, "missing ngpios DT property\n"); 718 + return -ENODEV; 719 + } 720 + 685 721 spin_lock_init(&chip->lock); 686 722 687 723 gc = &chip->gc; ··· 696 722 gc->label = dev_name(dev); 697 723 gc->dev = dev; 698 724 gc->of_node = dev->of_node; 699 - gc->request = cygnus_gpio_request; 700 - gc->free = cygnus_gpio_free; 701 - gc->direction_input = cygnus_gpio_direction_input; 702 - gc->direction_output = cygnus_gpio_direction_output; 703 - gc->set = cygnus_gpio_set; 704 - gc->get = cygnus_gpio_get; 725 + gc->request = iproc_gpio_request; 726 + gc->free = iproc_gpio_free; 727 + gc->direction_input = iproc_gpio_direction_input; 728 + gc->direction_output = iproc_gpio_direction_output; 729 + gc->set = iproc_gpio_set; 730 + gc->get = iproc_gpio_get; 705 731 706 732 chip->pinmux_is_supported = of_property_read_bool(dev->of_node, 707 733 "gpio-ranges"); ··· 712 738 return ret; 713 739 } 714 740 715 - ret = cygnus_gpio_register_pinconf(chip); 741 + ret = iproc_gpio_register_pinconf(chip); 716 742 if (ret) { 717 743 dev_err(dev, "unable to register pinconf\n"); 718 744 goto err_rm_gpiochip; ··· 721 747 /* optional GPIO interrupt support */ 722 748 irq = platform_get_irq(pdev, 0); 723 749 if (irq) { 724 - ret = gpiochip_irqchip_add(gc, &cygnus_gpio_irq_chip, 0, 750 + ret = gpiochip_irqchip_add(gc, &iproc_gpio_irq_chip, 0, 725 751 handle_simple_irq, IRQ_TYPE_NONE); 726 752 if (ret) { 727 753 dev_err(dev, "no GPIO irqchip\n"); 728 754 goto err_unregister_pinconf; 729 755 } 730 756 731 - gpiochip_set_chained_irqchip(gc, &cygnus_gpio_irq_chip, irq, 732 - cygnus_gpio_irq_handler); 757 + gpiochip_set_chained_irqchip(gc, &iproc_gpio_irq_chip, irq, 758 + iproc_gpio_irq_handler); 733 759 } 734 760 735 761 return 0; 736 762 737 763 err_unregister_pinconf: 738 - cygnus_gpio_unregister_pinconf(chip); 764 + iproc_gpio_unregister_pinconf(chip); 739 765 740 766 err_rm_gpiochip: 741 767 gpiochip_remove(gc); ··· 743 769 return ret; 744 770 } 745 771 746 - static struct platform_driver cygnus_gpio_driver = { 772 + static struct platform_driver iproc_gpio_driver = { 747 773 .driver = { 748 - .name = "cygnus-gpio", 749 - .of_match_table = cygnus_gpio_of_match, 774 + .name = "iproc-gpio", 775 + .of_match_table = iproc_gpio_of_match, 750 776 }, 751 - .probe = cygnus_gpio_probe, 777 + .probe = iproc_gpio_probe, 752 778 }; 753 779 754 - static int __init cygnus_gpio_init(void) 780 + static int __init iproc_gpio_init(void) 755 781 { 756 - return platform_driver_probe(&cygnus_gpio_driver, cygnus_gpio_probe); 782 + return platform_driver_probe(&iproc_gpio_driver, iproc_gpio_probe); 757 783 } 758 - arch_initcall_sync(cygnus_gpio_init); 784 + arch_initcall_sync(iproc_gpio_init);
+749
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
··· 1 + /* 2 + * Copyright (C) 2015 Broadcom Corporation 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU General Public License as 6 + * published by the Free Software Foundation version 2. 7 + * 8 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 9 + * kind, whether express or implied; without even the implied warranty 10 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + * 13 + * This file contains the Broadcom Northstar Plus (NSP) GPIO driver that 14 + * supports the chipCommonA GPIO controller. Basic PINCONF such as bias, 15 + * pull up/down, slew and drive strength are also supported in this driver. 16 + * 17 + * Pins from the chipCommonA GPIO can be individually muxed to GPIO function, 18 + * through the interaction with the NSP IOMUX controller. 19 + */ 20 + 21 + #include <linux/gpio.h> 22 + #include <linux/interrupt.h> 23 + #include <linux/io.h> 24 + #include <linux/ioport.h> 25 + #include <linux/kernel.h> 26 + #include <linux/of_address.h> 27 + #include <linux/of_device.h> 28 + #include <linux/of_irq.h> 29 + #include <linux/pinctrl/pinconf.h> 30 + #include <linux/pinctrl/pinconf-generic.h> 31 + #include <linux/pinctrl/pinctrl.h> 32 + #include <linux/slab.h> 33 + 34 + #include "../pinctrl-utils.h" 35 + 36 + #define NSP_CHIP_A_INT_STATUS 0x00 37 + #define NSP_CHIP_A_INT_MASK 0x04 38 + #define NSP_GPIO_DATA_IN 0x40 39 + #define NSP_GPIO_DATA_OUT 0x44 40 + #define NSP_GPIO_OUT_EN 0x48 41 + #define NSP_GPIO_INT_POLARITY 0x50 42 + #define NSP_GPIO_INT_MASK 0x54 43 + #define NSP_GPIO_EVENT 0x58 44 + #define NSP_GPIO_EVENT_INT_MASK 0x5c 45 + #define NSP_GPIO_EVENT_INT_POLARITY 0x64 46 + #define NSP_CHIP_A_GPIO_INT_BIT 0x01 47 + 48 + /* I/O parameters offset for chipcommon A GPIO */ 49 + #define NSP_GPIO_DRV_CTRL 0x00 50 + #define NSP_GPIO_HYSTERESIS_EN 0x10 51 + #define NSP_GPIO_SLEW_RATE_EN 0x14 52 + #define NSP_PULL_UP_EN 0x18 53 + #define NSP_PULL_DOWN_EN 0x1c 54 + #define GPIO_DRV_STRENGTH_BITS 0x03 55 + 56 + /* 57 + * nsp GPIO core 58 + * 59 + * @dev: pointer to device 60 + * @base: I/O register base for nsp GPIO controller 61 + * @io_ctrl: I/O register base for PINCONF support outside the GPIO block 62 + * @gc: GPIO chip 63 + * @pctl: pointer to pinctrl_dev 64 + * @pctldesc: pinctrl descriptor 65 + * @irq_domain: pointer to irq domain 66 + * @lock: lock to protect access to I/O registers 67 + */ 68 + struct nsp_gpio { 69 + struct device *dev; 70 + void __iomem *base; 71 + void __iomem *io_ctrl; 72 + struct gpio_chip gc; 73 + struct pinctrl_dev *pctl; 74 + struct pinctrl_desc pctldesc; 75 + struct irq_domain *irq_domain; 76 + spinlock_t lock; 77 + }; 78 + 79 + enum base_type { 80 + REG, 81 + IO_CTRL 82 + }; 83 + 84 + static inline struct nsp_gpio *to_nsp_gpio(struct gpio_chip *gc) 85 + { 86 + return container_of(gc, struct nsp_gpio, gc); 87 + } 88 + 89 + /* 90 + * Mapping from PINCONF pins to GPIO pins is 1-to-1 91 + */ 92 + static inline unsigned nsp_pin_to_gpio(unsigned pin) 93 + { 94 + return pin; 95 + } 96 + 97 + /* 98 + * nsp_set_bit - set or clear one bit (corresponding to the GPIO pin) in a 99 + * nsp GPIO register 100 + * 101 + * @nsp_gpio: nsp GPIO device 102 + * @base_type: reg base to modify 103 + * @reg: register offset 104 + * @gpio: GPIO pin 105 + * @set: set or clear 106 + */ 107 + static inline void nsp_set_bit(struct nsp_gpio *chip, enum base_type address, 108 + unsigned int reg, unsigned gpio, bool set) 109 + { 110 + u32 val; 111 + void __iomem *base_address; 112 + 113 + if (address == IO_CTRL) 114 + base_address = chip->io_ctrl; 115 + else 116 + base_address = chip->base; 117 + 118 + val = readl(base_address + reg); 119 + if (set) 120 + val |= BIT(gpio); 121 + else 122 + val &= ~BIT(gpio); 123 + 124 + writel(val, base_address + reg); 125 + } 126 + 127 + /* 128 + * nsp_get_bit - get one bit (corresponding to the GPIO pin) in a 129 + * nsp GPIO register 130 + */ 131 + static inline bool nsp_get_bit(struct nsp_gpio *chip, enum base_type address, 132 + unsigned int reg, unsigned gpio) 133 + { 134 + if (address == IO_CTRL) 135 + return !!(readl(chip->io_ctrl + reg) & BIT(gpio)); 136 + else 137 + return !!(readl(chip->base + reg) & BIT(gpio)); 138 + } 139 + 140 + static irqreturn_t nsp_gpio_irq_handler(int irq, void *data) 141 + { 142 + struct nsp_gpio *chip = (struct nsp_gpio *)data; 143 + struct gpio_chip gc = chip->gc; 144 + int bit; 145 + unsigned long int_bits = 0; 146 + u32 int_status; 147 + 148 + /* go through the entire GPIOs and handle all interrupts */ 149 + int_status = readl(chip->base + NSP_CHIP_A_INT_STATUS); 150 + if (int_status & NSP_CHIP_A_GPIO_INT_BIT) { 151 + unsigned int event, level; 152 + 153 + /* Get level and edge interrupts */ 154 + event = readl(chip->base + NSP_GPIO_EVENT_INT_MASK) & 155 + readl(chip->base + NSP_GPIO_EVENT); 156 + level = readl(chip->base + NSP_GPIO_DATA_IN) ^ 157 + readl(chip->base + NSP_GPIO_INT_POLARITY); 158 + level &= readl(chip->base + NSP_GPIO_INT_MASK); 159 + int_bits = level | event; 160 + 161 + for_each_set_bit(bit, &int_bits, gc.ngpio) { 162 + /* 163 + * Clear the interrupt before invoking the 164 + * handler, so we do not leave any window 165 + */ 166 + writel(BIT(bit), chip->base + NSP_GPIO_EVENT); 167 + generic_handle_irq( 168 + irq_linear_revmap(chip->irq_domain, bit)); 169 + } 170 + } 171 + 172 + return int_bits ? IRQ_HANDLED : IRQ_NONE; 173 + } 174 + 175 + static void nsp_gpio_irq_ack(struct irq_data *d) 176 + { 177 + struct nsp_gpio *chip = irq_data_get_irq_chip_data(d); 178 + unsigned gpio = d->hwirq; 179 + u32 val = BIT(gpio); 180 + u32 trigger_type; 181 + 182 + trigger_type = irq_get_trigger_type(d->irq); 183 + if (trigger_type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 184 + nsp_set_bit(chip, REG, NSP_GPIO_EVENT, gpio, val); 185 + } 186 + 187 + /* 188 + * nsp_gpio_irq_set_mask - mask/unmask a GPIO interrupt 189 + * 190 + * @d: IRQ chip data 191 + * @unmask: mask/unmask GPIO interrupt 192 + */ 193 + static void nsp_gpio_irq_set_mask(struct irq_data *d, bool unmask) 194 + { 195 + struct nsp_gpio *chip = irq_data_get_irq_chip_data(d); 196 + unsigned gpio = d->hwirq; 197 + u32 trigger_type; 198 + 199 + trigger_type = irq_get_trigger_type(d->irq); 200 + if (trigger_type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 201 + nsp_set_bit(chip, REG, NSP_GPIO_EVENT_INT_MASK, gpio, unmask); 202 + else 203 + nsp_set_bit(chip, REG, NSP_GPIO_INT_MASK, gpio, unmask); 204 + } 205 + 206 + static void nsp_gpio_irq_mask(struct irq_data *d) 207 + { 208 + struct nsp_gpio *chip = irq_data_get_irq_chip_data(d); 209 + unsigned long flags; 210 + 211 + spin_lock_irqsave(&chip->lock, flags); 212 + nsp_gpio_irq_set_mask(d, false); 213 + spin_unlock_irqrestore(&chip->lock, flags); 214 + } 215 + 216 + static void nsp_gpio_irq_unmask(struct irq_data *d) 217 + { 218 + struct nsp_gpio *chip = irq_data_get_irq_chip_data(d); 219 + unsigned long flags; 220 + 221 + spin_lock_irqsave(&chip->lock, flags); 222 + nsp_gpio_irq_set_mask(d, true); 223 + spin_unlock_irqrestore(&chip->lock, flags); 224 + } 225 + 226 + static int nsp_gpio_irq_set_type(struct irq_data *d, unsigned int type) 227 + { 228 + struct nsp_gpio *chip = irq_data_get_irq_chip_data(d); 229 + unsigned gpio = d->hwirq; 230 + bool level_low; 231 + bool falling; 232 + unsigned long flags; 233 + 234 + spin_lock_irqsave(&chip->lock, flags); 235 + falling = nsp_get_bit(chip, REG, NSP_GPIO_EVENT_INT_POLARITY, gpio); 236 + level_low = nsp_get_bit(chip, REG, NSP_GPIO_INT_POLARITY, gpio); 237 + 238 + switch (type & IRQ_TYPE_SENSE_MASK) { 239 + case IRQ_TYPE_EDGE_RISING: 240 + falling = false; 241 + break; 242 + 243 + case IRQ_TYPE_EDGE_FALLING: 244 + falling = true; 245 + break; 246 + 247 + case IRQ_TYPE_LEVEL_HIGH: 248 + level_low = false; 249 + break; 250 + 251 + case IRQ_TYPE_LEVEL_LOW: 252 + level_low = true; 253 + break; 254 + 255 + default: 256 + dev_err(chip->dev, "invalid GPIO IRQ type 0x%x\n", 257 + type); 258 + spin_unlock_irqrestore(&chip->lock, flags); 259 + return -EINVAL; 260 + } 261 + 262 + nsp_set_bit(chip, REG, NSP_GPIO_EVENT_INT_POLARITY, gpio, falling); 263 + nsp_set_bit(chip, REG, NSP_GPIO_INT_POLARITY, gpio, level_low); 264 + spin_unlock_irqrestore(&chip->lock, flags); 265 + 266 + dev_dbg(chip->dev, "gpio:%u level_low:%s falling:%s\n", gpio, 267 + level_low ? "true" : "false", falling ? "true" : "false"); 268 + return 0; 269 + } 270 + 271 + static struct irq_chip nsp_gpio_irq_chip = { 272 + .name = "gpio-a", 273 + .irq_enable = nsp_gpio_irq_unmask, 274 + .irq_disable = nsp_gpio_irq_mask, 275 + .irq_ack = nsp_gpio_irq_ack, 276 + .irq_mask = nsp_gpio_irq_mask, 277 + .irq_unmask = nsp_gpio_irq_unmask, 278 + .irq_set_type = nsp_gpio_irq_set_type, 279 + }; 280 + 281 + /* 282 + * Request the nsp IOMUX pinmux controller to mux individual pins to GPIO 283 + */ 284 + static int nsp_gpio_request(struct gpio_chip *gc, unsigned offset) 285 + { 286 + unsigned gpio = gc->base + offset; 287 + 288 + return pinctrl_request_gpio(gpio); 289 + } 290 + 291 + static void nsp_gpio_free(struct gpio_chip *gc, unsigned offset) 292 + { 293 + unsigned gpio = gc->base + offset; 294 + 295 + pinctrl_free_gpio(gpio); 296 + } 297 + 298 + static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) 299 + { 300 + struct nsp_gpio *chip = to_nsp_gpio(gc); 301 + unsigned long flags; 302 + 303 + spin_lock_irqsave(&chip->lock, flags); 304 + nsp_set_bit(chip, REG, NSP_GPIO_OUT_EN, gpio, false); 305 + spin_unlock_irqrestore(&chip->lock, flags); 306 + 307 + dev_dbg(chip->dev, "gpio:%u set input\n", gpio); 308 + return 0; 309 + } 310 + 311 + static int nsp_gpio_direction_output(struct gpio_chip *gc, unsigned gpio, 312 + int val) 313 + { 314 + struct nsp_gpio *chip = to_nsp_gpio(gc); 315 + unsigned long flags; 316 + 317 + spin_lock_irqsave(&chip->lock, flags); 318 + nsp_set_bit(chip, REG, NSP_GPIO_OUT_EN, gpio, true); 319 + nsp_set_bit(chip, REG, NSP_GPIO_DATA_OUT, gpio, !!(val)); 320 + spin_unlock_irqrestore(&chip->lock, flags); 321 + 322 + dev_dbg(chip->dev, "gpio:%u set output, value:%d\n", gpio, val); 323 + return 0; 324 + } 325 + 326 + static void nsp_gpio_set(struct gpio_chip *gc, unsigned gpio, int val) 327 + { 328 + struct nsp_gpio *chip = to_nsp_gpio(gc); 329 + unsigned long flags; 330 + 331 + spin_lock_irqsave(&chip->lock, flags); 332 + nsp_set_bit(chip, REG, NSP_GPIO_DATA_OUT, gpio, !!(val)); 333 + spin_unlock_irqrestore(&chip->lock, flags); 334 + 335 + dev_dbg(chip->dev, "gpio:%u set, value:%d\n", gpio, val); 336 + } 337 + 338 + static int nsp_gpio_get(struct gpio_chip *gc, unsigned gpio) 339 + { 340 + struct nsp_gpio *chip = to_nsp_gpio(gc); 341 + 342 + return !!(readl(chip->base + NSP_GPIO_DATA_IN) & BIT(gpio)); 343 + } 344 + 345 + static int nsp_gpio_to_irq(struct gpio_chip *gc, unsigned offset) 346 + { 347 + struct nsp_gpio *chip = to_nsp_gpio(gc); 348 + 349 + return irq_linear_revmap(chip->irq_domain, offset); 350 + } 351 + 352 + static int nsp_get_groups_count(struct pinctrl_dev *pctldev) 353 + { 354 + return 1; 355 + } 356 + 357 + /* 358 + * Only one group: "gpio_grp", since this local pinctrl device only performs 359 + * GPIO specific PINCONF configurations 360 + */ 361 + static const char *nsp_get_group_name(struct pinctrl_dev *pctldev, 362 + unsigned selector) 363 + { 364 + return "gpio_grp"; 365 + } 366 + 367 + static const struct pinctrl_ops nsp_pctrl_ops = { 368 + .get_groups_count = nsp_get_groups_count, 369 + .get_group_name = nsp_get_group_name, 370 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 371 + .dt_free_map = pinctrl_utils_dt_free_map, 372 + }; 373 + 374 + static int nsp_gpio_set_slew(struct nsp_gpio *chip, unsigned gpio, u16 slew) 375 + { 376 + if (slew) 377 + nsp_set_bit(chip, IO_CTRL, NSP_GPIO_SLEW_RATE_EN, gpio, true); 378 + else 379 + nsp_set_bit(chip, IO_CTRL, NSP_GPIO_SLEW_RATE_EN, gpio, false); 380 + 381 + return 0; 382 + } 383 + 384 + static int nsp_gpio_set_pull(struct nsp_gpio *chip, unsigned gpio, 385 + bool pull_up, bool pull_down) 386 + { 387 + unsigned long flags; 388 + 389 + spin_lock_irqsave(&chip->lock, flags); 390 + nsp_set_bit(chip, IO_CTRL, NSP_PULL_DOWN_EN, gpio, pull_down); 391 + nsp_set_bit(chip, IO_CTRL, NSP_PULL_UP_EN, gpio, pull_up); 392 + spin_unlock_irqrestore(&chip->lock, flags); 393 + 394 + dev_dbg(chip->dev, "gpio:%u set pullup:%d pulldown: %d\n", 395 + gpio, pull_up, pull_down); 396 + return 0; 397 + } 398 + 399 + static void nsp_gpio_get_pull(struct nsp_gpio *chip, unsigned gpio, 400 + bool *pull_up, bool *pull_down) 401 + { 402 + unsigned long flags; 403 + 404 + spin_lock_irqsave(&chip->lock, flags); 405 + *pull_up = nsp_get_bit(chip, IO_CTRL, NSP_PULL_UP_EN, gpio); 406 + *pull_down = nsp_get_bit(chip, IO_CTRL, NSP_PULL_DOWN_EN, gpio); 407 + spin_unlock_irqrestore(&chip->lock, flags); 408 + } 409 + 410 + static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio, 411 + u16 strength) 412 + { 413 + u32 offset, shift, i; 414 + u32 val; 415 + unsigned long flags; 416 + 417 + /* make sure drive strength is supported */ 418 + if (strength < 2 || strength > 16 || (strength % 2)) 419 + return -ENOTSUPP; 420 + 421 + shift = gpio; 422 + offset = NSP_GPIO_DRV_CTRL; 423 + dev_dbg(chip->dev, "gpio:%u set drive strength:%d mA\n", gpio, 424 + strength); 425 + spin_lock_irqsave(&chip->lock, flags); 426 + strength = (strength / 2) - 1; 427 + for (i = GPIO_DRV_STRENGTH_BITS; i > 0; i--) { 428 + val = readl(chip->io_ctrl + offset); 429 + val &= ~BIT(shift); 430 + val |= ((strength >> (i-1)) & 0x1) << shift; 431 + writel(val, chip->io_ctrl + offset); 432 + offset += 4; 433 + } 434 + spin_unlock_irqrestore(&chip->lock, flags); 435 + 436 + return 0; 437 + } 438 + 439 + static int nsp_gpio_get_strength(struct nsp_gpio *chip, unsigned gpio, 440 + u16 *strength) 441 + { 442 + unsigned int offset, shift; 443 + u32 val; 444 + unsigned long flags; 445 + int i; 446 + 447 + offset = NSP_GPIO_DRV_CTRL; 448 + shift = gpio; 449 + 450 + spin_lock_irqsave(&chip->lock, flags); 451 + *strength = 0; 452 + for (i = (GPIO_DRV_STRENGTH_BITS - 1); i >= 0; i--) { 453 + val = readl(chip->io_ctrl + offset) & BIT(shift); 454 + val >>= shift; 455 + *strength += (val << i); 456 + offset += 4; 457 + } 458 + 459 + /* convert to mA */ 460 + *strength = (*strength + 1) * 2; 461 + spin_unlock_irqrestore(&chip->lock, flags); 462 + 463 + return 0; 464 + } 465 + 466 + int nsp_pin_config_group_get(struct pinctrl_dev *pctldev, unsigned selector, 467 + unsigned long *config) 468 + { 469 + return 0; 470 + } 471 + 472 + int nsp_pin_config_group_set(struct pinctrl_dev *pctldev, unsigned selector, 473 + unsigned long *configs, unsigned num_configs) 474 + { 475 + return 0; 476 + } 477 + 478 + static int nsp_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin, 479 + unsigned long *config) 480 + { 481 + struct nsp_gpio *chip = pinctrl_dev_get_drvdata(pctldev); 482 + enum pin_config_param param = pinconf_to_config_param(*config); 483 + unsigned int gpio; 484 + u16 arg = 0; 485 + bool pull_up, pull_down; 486 + int ret; 487 + 488 + gpio = nsp_pin_to_gpio(pin); 489 + switch (param) { 490 + case PIN_CONFIG_BIAS_DISABLE: 491 + nsp_gpio_get_pull(chip, gpio, &pull_up, &pull_down); 492 + if ((pull_up == false) && (pull_down == false)) 493 + return 0; 494 + else 495 + return -EINVAL; 496 + 497 + case PIN_CONFIG_BIAS_PULL_UP: 498 + nsp_gpio_get_pull(chip, gpio, &pull_up, &pull_down); 499 + if (pull_up) 500 + return 0; 501 + else 502 + return -EINVAL; 503 + 504 + case PIN_CONFIG_BIAS_PULL_DOWN: 505 + nsp_gpio_get_pull(chip, gpio, &pull_up, &pull_down); 506 + if (pull_down) 507 + return 0; 508 + else 509 + return -EINVAL; 510 + 511 + case PIN_CONFIG_DRIVE_STRENGTH: 512 + ret = nsp_gpio_get_strength(chip, gpio, &arg); 513 + if (ret) 514 + return ret; 515 + *config = pinconf_to_config_packed(param, arg); 516 + return 0; 517 + 518 + default: 519 + return -ENOTSUPP; 520 + } 521 + } 522 + 523 + static int nsp_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin, 524 + unsigned long *configs, unsigned num_configs) 525 + { 526 + struct nsp_gpio *chip = pinctrl_dev_get_drvdata(pctldev); 527 + enum pin_config_param param; 528 + u16 arg; 529 + unsigned int i, gpio; 530 + int ret = -ENOTSUPP; 531 + 532 + gpio = nsp_pin_to_gpio(pin); 533 + for (i = 0; i < num_configs; i++) { 534 + param = pinconf_to_config_param(configs[i]); 535 + arg = pinconf_to_config_argument(configs[i]); 536 + 537 + switch (param) { 538 + case PIN_CONFIG_BIAS_DISABLE: 539 + ret = nsp_gpio_set_pull(chip, gpio, false, false); 540 + if (ret < 0) 541 + goto out; 542 + break; 543 + 544 + case PIN_CONFIG_BIAS_PULL_UP: 545 + ret = nsp_gpio_set_pull(chip, gpio, true, false); 546 + if (ret < 0) 547 + goto out; 548 + break; 549 + 550 + case PIN_CONFIG_BIAS_PULL_DOWN: 551 + ret = nsp_gpio_set_pull(chip, gpio, false, true); 552 + if (ret < 0) 553 + goto out; 554 + break; 555 + 556 + case PIN_CONFIG_DRIVE_STRENGTH: 557 + ret = nsp_gpio_set_strength(chip, gpio, arg); 558 + if (ret < 0) 559 + goto out; 560 + break; 561 + 562 + case PIN_CONFIG_SLEW_RATE: 563 + ret = nsp_gpio_set_slew(chip, gpio, arg); 564 + if (ret < 0) 565 + goto out; 566 + break; 567 + 568 + default: 569 + dev_err(chip->dev, "invalid configuration\n"); 570 + return -ENOTSUPP; 571 + } 572 + } 573 + 574 + out: 575 + return ret; 576 + } 577 + 578 + static const struct pinconf_ops nsp_pconf_ops = { 579 + .is_generic = true, 580 + .pin_config_get = nsp_pin_config_get, 581 + .pin_config_set = nsp_pin_config_set, 582 + .pin_config_group_get = nsp_pin_config_group_get, 583 + .pin_config_group_set = nsp_pin_config_group_set, 584 + }; 585 + 586 + /* 587 + * NSP GPIO controller supports some PINCONF related configurations such as 588 + * pull up, pull down, slew and drive strength, when the pin is configured 589 + * to GPIO. 590 + * 591 + * Here a local pinctrl device is created with simple 1-to-1 pin mapping to the 592 + * local GPIO pins 593 + */ 594 + static int nsp_gpio_register_pinconf(struct nsp_gpio *chip) 595 + { 596 + struct pinctrl_desc *pctldesc = &chip->pctldesc; 597 + struct pinctrl_pin_desc *pins; 598 + struct gpio_chip *gc = &chip->gc; 599 + int i; 600 + 601 + pins = devm_kcalloc(chip->dev, gc->ngpio, sizeof(*pins), GFP_KERNEL); 602 + if (!pins) 603 + return -ENOMEM; 604 + for (i = 0; i < gc->ngpio; i++) { 605 + pins[i].number = i; 606 + pins[i].name = devm_kasprintf(chip->dev, GFP_KERNEL, 607 + "gpio-%d", i); 608 + if (!pins[i].name) 609 + return -ENOMEM; 610 + } 611 + pctldesc->name = dev_name(chip->dev); 612 + pctldesc->pctlops = &nsp_pctrl_ops; 613 + pctldesc->pins = pins; 614 + pctldesc->npins = gc->ngpio; 615 + pctldesc->confops = &nsp_pconf_ops; 616 + 617 + chip->pctl = pinctrl_register(pctldesc, chip->dev, chip); 618 + if (IS_ERR(chip->pctl)) { 619 + dev_err(chip->dev, "unable to register pinctrl device\n"); 620 + return PTR_ERR(chip->pctl); 621 + } 622 + 623 + return 0; 624 + } 625 + 626 + static const struct of_device_id nsp_gpio_of_match[] = { 627 + {.compatible = "brcm,nsp-gpio-a",}, 628 + {} 629 + }; 630 + 631 + static int nsp_gpio_probe(struct platform_device *pdev) 632 + { 633 + struct device *dev = &pdev->dev; 634 + struct resource *res; 635 + struct nsp_gpio *chip; 636 + struct gpio_chip *gc; 637 + u32 val, count; 638 + int irq, ret; 639 + 640 + if (of_property_read_u32(pdev->dev.of_node, "ngpios", &val)) { 641 + dev_err(&pdev->dev, "Missing ngpios OF property\n"); 642 + return -ENODEV; 643 + } 644 + 645 + chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); 646 + if (!chip) 647 + return -ENOMEM; 648 + 649 + chip->dev = dev; 650 + platform_set_drvdata(pdev, chip); 651 + 652 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 653 + chip->base = devm_ioremap_resource(dev, res); 654 + if (IS_ERR(chip->base)) { 655 + dev_err(dev, "unable to map I/O memory\n"); 656 + return PTR_ERR(chip->base); 657 + } 658 + 659 + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 660 + chip->io_ctrl = devm_ioremap_resource(dev, res); 661 + if (IS_ERR(chip->io_ctrl)) { 662 + dev_err(dev, "unable to map I/O memory\n"); 663 + return PTR_ERR(chip->io_ctrl); 664 + } 665 + 666 + spin_lock_init(&chip->lock); 667 + gc = &chip->gc; 668 + gc->base = -1; 669 + gc->can_sleep = false; 670 + gc->ngpio = val; 671 + gc->label = dev_name(dev); 672 + gc->dev = dev; 673 + gc->of_node = dev->of_node; 674 + gc->request = nsp_gpio_request; 675 + gc->free = nsp_gpio_free; 676 + gc->direction_input = nsp_gpio_direction_input; 677 + gc->direction_output = nsp_gpio_direction_output; 678 + gc->set = nsp_gpio_set; 679 + gc->get = nsp_gpio_get; 680 + gc->to_irq = nsp_gpio_to_irq; 681 + 682 + /* optional GPIO interrupt support */ 683 + irq = platform_get_irq(pdev, 0); 684 + if (irq > 0) { 685 + /* Create irq domain so that each pin can be assigned an IRQ.*/ 686 + chip->irq_domain = irq_domain_add_linear(gc->of_node, gc->ngpio, 687 + &irq_domain_simple_ops, 688 + chip); 689 + if (!chip->irq_domain) { 690 + dev_err(&pdev->dev, "Couldn't allocate IRQ domain\n"); 691 + return -ENXIO; 692 + } 693 + 694 + /* Map each gpio to an IRQ and set the handler for gpiolib. */ 695 + for (count = 0; count < gc->ngpio; count++) { 696 + int irq = irq_create_mapping(chip->irq_domain, count); 697 + 698 + irq_set_chip_and_handler(irq, &nsp_gpio_irq_chip, 699 + handle_simple_irq); 700 + irq_set_chip_data(irq, chip); 701 + } 702 + 703 + /* Install ISR for this GPIO controller. */ 704 + ret = devm_request_irq(&pdev->dev, irq, nsp_gpio_irq_handler, 705 + IRQF_SHARED, "gpio-a", chip); 706 + if (ret) { 707 + dev_err(&pdev->dev, "Unable to request IRQ%d: %d\n", 708 + irq, ret); 709 + goto err_rm_gpiochip; 710 + } 711 + 712 + val = readl(chip->base + NSP_CHIP_A_INT_MASK); 713 + val = val | NSP_CHIP_A_GPIO_INT_BIT; 714 + writel(val, (chip->base + NSP_CHIP_A_INT_MASK)); 715 + } 716 + 717 + ret = gpiochip_add(gc); 718 + if (ret < 0) { 719 + dev_err(dev, "unable to add GPIO chip\n"); 720 + return ret; 721 + } 722 + 723 + ret = nsp_gpio_register_pinconf(chip); 724 + if (ret) { 725 + dev_err(dev, "unable to register pinconf\n"); 726 + goto err_rm_gpiochip; 727 + } 728 + 729 + return 0; 730 + 731 + err_rm_gpiochip: 732 + gpiochip_remove(gc); 733 + 734 + return ret; 735 + } 736 + 737 + static struct platform_driver nsp_gpio_driver = { 738 + .driver = { 739 + .name = "nsp-gpio-a", 740 + .of_match_table = nsp_gpio_of_match, 741 + }, 742 + .probe = nsp_gpio_probe, 743 + }; 744 + 745 + static int __init nsp_gpio_init(void) 746 + { 747 + return platform_driver_probe(&nsp_gpio_driver, nsp_gpio_probe); 748 + } 749 + arch_initcall_sync(nsp_gpio_init);
+1 -1
drivers/pinctrl/berlin/Makefile
··· 1 - obj-$(CONFIG_PINCTRL_BERLIN) += berlin.o 1 + obj-y += berlin.o 2 2 obj-$(CONFIG_PINCTRL_BERLIN_BG2) += berlin-bg2.o 3 3 obj-$(CONFIG_PINCTRL_BERLIN_BG2CD) += berlin-bg2cd.o 4 4 obj-$(CONFIG_PINCTRL_BERLIN_BG2Q) += berlin-bg2q.o
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt8127.c
··· 351 351 return platform_driver_register(&mtk_pinctrl_driver); 352 352 } 353 353 354 - module_init(mtk_pinctrl_init); 354 + arch_initcall(mtk_pinctrl_init); 355 355 356 356 MODULE_LICENSE("GPL v2"); 357 357 MODULE_DESCRIPTION("MediaTek MT8127 Pinctrl Driver");
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt8135.c
··· 366 366 return platform_driver_register(&mtk_pinctrl_driver); 367 367 } 368 368 369 - module_init(mtk_pinctrl_init); 369 + arch_initcall(mtk_pinctrl_init); 370 370 371 371 MODULE_LICENSE("GPL"); 372 372 MODULE_DESCRIPTION("MediaTek Pinctrl Driver");
+1 -1
drivers/pinctrl/mediatek/pinctrl-mt8173.c
··· 394 394 return platform_driver_register(&mtk_pinctrl_driver); 395 395 } 396 396 397 - module_init(mtk_pinctrl_init); 397 + arch_initcall(mtk_pinctrl_init); 398 398 399 399 MODULE_LICENSE("GPL v2"); 400 400 MODULE_DESCRIPTION("MediaTek Pinctrl Driver");
+18 -10
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 509 509 510 510 err = pinconf_generic_parse_dt_config(node, pctldev, &configs, 511 511 &num_configs); 512 + if (err) 513 + return err; 514 + 512 515 if (num_configs) 513 516 has_config = 1; 514 517 ··· 523 520 if (has_config && num_pins >= 1) 524 521 maps_per_pin++; 525 522 526 - if (!num_pins || !maps_per_pin) 527 - return -EINVAL; 523 + if (!num_pins || !maps_per_pin) { 524 + err = -EINVAL; 525 + goto exit; 526 + } 528 527 529 528 reserve = num_pins * maps_per_pin; 530 529 531 530 err = pinctrl_utils_reserve_map(pctldev, map, 532 531 reserved_maps, num_maps, reserve); 533 532 if (err < 0) 534 - goto fail; 533 + goto exit; 535 534 536 535 for (i = 0; i < num_pins; i++) { 537 536 err = of_property_read_u32_index(node, "pinmux", 538 537 i, &pinfunc); 539 538 if (err) 540 - goto fail; 539 + goto exit; 541 540 542 541 pin = MTK_GET_PIN_NO(pinfunc); 543 542 func = MTK_GET_PIN_FUNC(pinfunc); ··· 548 543 func >= ARRAY_SIZE(mtk_gpio_functions)) { 549 544 dev_err(pctl->dev, "invalid pins value.\n"); 550 545 err = -EINVAL; 551 - goto fail; 546 + goto exit; 552 547 } 553 548 554 549 grp = mtk_pctrl_find_group_by_pin(pctl, pin); 555 550 if (!grp) { 556 551 dev_err(pctl->dev, "unable to match pin %d to group\n", 557 552 pin); 558 - return -EINVAL; 553 + err = -EINVAL; 554 + goto exit; 559 555 } 560 556 561 557 err = mtk_pctrl_dt_node_to_map_func(pctl, pin, func, grp, map, 562 558 reserved_maps, num_maps); 563 559 if (err < 0) 564 - goto fail; 560 + goto exit; 565 561 566 562 if (has_config) { 567 563 err = pinctrl_utils_add_map_configs(pctldev, map, ··· 570 564 configs, num_configs, 571 565 PIN_MAP_TYPE_CONFIGS_GROUP); 572 566 if (err < 0) 573 - goto fail; 567 + goto exit; 574 568 } 575 569 } 576 570 577 - return 0; 571 + err = 0; 578 572 579 - fail: 573 + exit: 574 + kfree(configs); 580 575 return err; 581 576 } 582 577 ··· 598 591 &reserved_maps, num_maps); 599 592 if (ret < 0) { 600 593 pinctrl_utils_dt_free_map(pctldev, *map, *num_maps); 594 + of_node_put(np); 601 595 return ret; 602 596 } 603 597 }
+1 -1
drivers/pinctrl/mvebu/Makefile
··· 1 - obj-$(CONFIG_PINCTRL_MVEBU) += pinctrl-mvebu.o 1 + obj-y += pinctrl-mvebu.o 2 2 obj-$(CONFIG_PINCTRL_DOVE) += pinctrl-dove.o 3 3 obj-$(CONFIG_PINCTRL_KIRKWOOD) += pinctrl-kirkwood.o 4 4 obj-$(CONFIG_PINCTRL_ARMADA_370) += pinctrl-armada-370.o
+16 -13
drivers/pinctrl/mvebu/pinctrl-mvebu.c
··· 663 663 /* assign mpp modes to groups */ 664 664 for (n = 0; n < soc->nmodes; n++) { 665 665 struct mvebu_mpp_mode *mode = &soc->modes[n]; 666 - struct mvebu_pinctrl_group *grp = 667 - mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); 666 + struct mvebu_mpp_ctrl_setting *set = &mode->settings[0]; 667 + struct mvebu_pinctrl_group *grp; 668 668 unsigned num_settings; 669 669 670 - if (!grp) { 671 - dev_warn(&pdev->dev, "unknown pinctrl group %d\n", 672 - mode->pid); 673 - continue; 674 - } 675 - 676 - for (num_settings = 0; ;) { 677 - struct mvebu_mpp_ctrl_setting *set = 678 - &mode->settings[num_settings]; 679 - 670 + for (num_settings = 0; ; set++) { 680 671 if (!set->name) 681 672 break; 682 - num_settings++; 683 673 684 674 /* skip unsupported settings for this variant */ 685 675 if (pctl->variant && !(pctl->variant & set->variant)) 686 676 continue; 677 + 678 + num_settings++; 687 679 688 680 /* find gpio/gpo/gpi settings */ 689 681 if (strcmp(set->name, "gpio") == 0) ··· 685 693 set->flags = MVEBU_SETTING_GPO; 686 694 else if (strcmp(set->name, "gpi") == 0) 687 695 set->flags = MVEBU_SETTING_GPI; 696 + } 697 + 698 + /* skip modes with no settings for this variant */ 699 + if (!num_settings) 700 + continue; 701 + 702 + grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); 703 + if (!grp) { 704 + dev_warn(&pdev->dev, "unknown pinctrl group %d\n", 705 + mode->pid); 706 + continue; 688 707 } 689 708 690 709 grp->settings = mode->settings;
+1
drivers/pinctrl/pinconf-generic.c
··· 220 220 * parse the config properties into generic pinconfig values. 221 221 * @np: node containing the pinconfig properties 222 222 * @configs: array with nconfigs entries containing the generic pinconf values 223 + * must be freed when no longer necessary. 223 224 * @nconfigs: umber of configurations 224 225 */ 225 226 int pinconf_generic_parse_dt_config(struct device_node *np,
+8 -16
drivers/pinctrl/pinctrl-adi2.c
··· 1102 1102 }, 1103 1103 }; 1104 1104 1105 + static struct platform_driver * const drivers[] = { 1106 + &adi_pinctrl_driver, 1107 + &adi_gpio_pint_driver, 1108 + &adi_gpio_driver, 1109 + }; 1110 + 1105 1111 static int __init adi_pinctrl_setup(void) 1106 1112 { 1107 1113 int ret; 1108 1114 1109 - ret = platform_driver_register(&adi_pinctrl_driver); 1115 + ret = platform_register_drivers(drivers, ARRAY_SIZE(drivers)); 1110 1116 if (ret) 1111 1117 return ret; 1112 - 1113 - ret = platform_driver_register(&adi_gpio_pint_driver); 1114 - if (ret) 1115 - goto pint_error; 1116 - 1117 - ret = platform_driver_register(&adi_gpio_driver); 1118 - if (ret) 1119 - goto gpio_error; 1120 1118 1121 1119 #ifdef CONFIG_PM 1122 1120 register_syscore_ops(&gpio_pm_syscore_ops); 1123 1121 #endif 1124 - return ret; 1125 - gpio_error: 1126 - platform_driver_unregister(&adi_gpio_pint_driver); 1127 - pint_error: 1128 - platform_driver_unregister(&adi_pinctrl_driver); 1129 - 1130 - return ret; 1122 + return 0; 1131 1123 } 1132 1124 arch_initcall(adi_pinctrl_setup); 1133 1125
+10 -7
drivers/pinctrl/pinctrl-at91-pio4.c
··· 500 500 if (!num_pins) { 501 501 dev_err(pctldev->dev, "no pins found in node %s\n", 502 502 of_node_full_name(np)); 503 - return -EINVAL; 503 + ret = -EINVAL; 504 + goto exit; 504 505 } 505 506 506 507 /* ··· 515 514 ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps, num_maps, 516 515 reserve); 517 516 if (ret < 0) 518 - return ret; 517 + goto exit; 519 518 520 519 for (i = 0; i < num_pins; i++) { 521 520 const char *group, *func; 522 521 523 522 ret = of_property_read_u32_index(np, "pinmux", i, &pinfunc); 524 523 if (ret) 525 - return ret; 524 + goto exit; 526 525 527 526 ret = atmel_pctl_xlate_pinfunc(pctldev, np, pinfunc, &group, 528 527 &func); 529 528 if (ret) 530 - return ret; 529 + goto exit; 531 530 532 531 pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, num_maps, 533 532 group, func); ··· 538 537 configs, num_configs, 539 538 PIN_MAP_TYPE_CONFIGS_GROUP); 540 539 if (ret < 0) 541 - return ret; 540 + goto exit; 542 541 } 543 542 } 544 543 545 - return 0; 544 + exit: 545 + kfree(configs); 546 + return ret; 546 547 } 547 548 548 549 static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, ··· 1003 1000 atmel_pioctrl->irqs[i] = res->start; 1004 1001 irq_set_chained_handler(res->start, atmel_gpio_irq_handler); 1005 1002 irq_set_handler_data(res->start, atmel_pioctrl); 1006 - dev_dbg(dev, "bank %i: hwirq=%u\n", i, res->start); 1003 + dev_dbg(dev, "bank %i: irq=%pr\n", i, res); 1007 1004 } 1008 1005 1009 1006 atmel_pioctrl->irq_domain = irq_domain_add_linear(dev->of_node,
+7 -7
drivers/pinctrl/pinctrl-at91.c
··· 1828 1828 .remove = at91_pinctrl_remove, 1829 1829 }; 1830 1830 1831 + static struct platform_driver * const drivers[] = { 1832 + &at91_gpio_driver, 1833 + &at91_pinctrl_driver, 1834 + }; 1835 + 1831 1836 static int __init at91_pinctrl_init(void) 1832 1837 { 1833 - int ret; 1834 - 1835 - ret = platform_driver_register(&at91_gpio_driver); 1836 - if (ret) 1837 - return ret; 1838 - return platform_driver_register(&at91_pinctrl_driver); 1838 + return platform_register_drivers(drivers, ARRAY_SIZE(drivers)); 1839 1839 } 1840 1840 arch_initcall(at91_pinctrl_init); 1841 1841 1842 1842 static void __exit at91_pinctrl_exit(void) 1843 1843 { 1844 - platform_driver_unregister(&at91_pinctrl_driver); 1844 + platform_unregister_drivers(drivers, ARRAY_SIZE(drivers)); 1845 1845 } 1846 1846 1847 1847 module_exit(at91_pinctrl_exit);
+8
drivers/pinctrl/pinctrl-lantiq.h
··· 162 162 GPIO53, 163 163 GPIO54, 164 164 GPIO55, 165 + GPIO56, 166 + GPIO57, 167 + GPIO58, 168 + GPIO59, 169 + GPIO60, /* 60 */ 170 + GPIO61, 171 + GPIO62, 172 + GPIO63, 165 173 166 174 GPIO64, 167 175 GPIO65,
+57 -1
drivers/pinctrl/pinctrl-rockchip.c
··· 614 614 } 615 615 } 616 616 617 + #define RK3228_PULL_OFFSET 0x100 618 + 619 + static void rk3228_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, 620 + int pin_num, struct regmap **regmap, 621 + int *reg, u8 *bit) 622 + { 623 + struct rockchip_pinctrl *info = bank->drvdata; 624 + 625 + *regmap = info->regmap_base; 626 + *reg = RK3228_PULL_OFFSET; 627 + *reg += bank->bank_num * RK3188_PULL_BANK_STRIDE; 628 + *reg += ((pin_num / RK3188_PULL_PINS_PER_REG) * 4); 629 + 630 + *bit = (pin_num % RK3188_PULL_PINS_PER_REG); 631 + *bit *= RK3188_PULL_BITS_PER_PIN; 632 + } 633 + 634 + #define RK3228_DRV_GRF_OFFSET 0x200 635 + 636 + static void rk3228_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, 637 + int pin_num, struct regmap **regmap, 638 + int *reg, u8 *bit) 639 + { 640 + struct rockchip_pinctrl *info = bank->drvdata; 641 + 642 + *regmap = info->regmap_base; 643 + *reg = RK3228_DRV_GRF_OFFSET; 644 + *reg += bank->bank_num * RK3288_DRV_BANK_STRIDE; 645 + *reg += ((pin_num / RK3288_DRV_PINS_PER_REG) * 4); 646 + 647 + *bit = (pin_num % RK3288_DRV_PINS_PER_REG); 648 + *bit *= RK3288_DRV_BITS_PER_PIN; 649 + } 650 + 617 651 #define RK3368_PULL_GRF_OFFSET 0x100 618 652 #define RK3368_PULL_PMU_OFFSET 0x10 619 653 ··· 1292 1258 func->groups[i] = child->name; 1293 1259 grp = &info->groups[grp_index++]; 1294 1260 ret = rockchip_pinctrl_parse_groups(child, grp, info, i++); 1295 - if (ret) 1261 + if (ret) { 1262 + of_node_put(child); 1296 1263 return ret; 1264 + } 1297 1265 } 1298 1266 1299 1267 return 0; ··· 1340 1304 ret = rockchip_pinctrl_parse_functions(child, info, i++); 1341 1305 if (ret) { 1342 1306 dev_err(&pdev->dev, "failed to parse function\n"); 1307 + of_node_put(child); 1343 1308 return ret; 1344 1309 } 1345 1310 } ··· 2180 2143 .pull_calc_reg = rk3188_calc_pull_reg_and_bit, 2181 2144 }; 2182 2145 2146 + static struct rockchip_pin_bank rk3228_pin_banks[] = { 2147 + PIN_BANK(0, 32, "gpio0"), 2148 + PIN_BANK(1, 32, "gpio1"), 2149 + PIN_BANK(2, 32, "gpio2"), 2150 + PIN_BANK(3, 32, "gpio3"), 2151 + }; 2152 + 2153 + static struct rockchip_pin_ctrl rk3228_pin_ctrl = { 2154 + .pin_banks = rk3228_pin_banks, 2155 + .nr_banks = ARRAY_SIZE(rk3228_pin_banks), 2156 + .label = "RK3228-GPIO", 2157 + .type = RK3288, 2158 + .grf_mux_offset = 0x0, 2159 + .pull_calc_reg = rk3228_calc_pull_reg_and_bit, 2160 + .drv_calc_reg = rk3228_calc_drv_reg_and_bit, 2161 + }; 2162 + 2183 2163 static struct rockchip_pin_bank rk3288_pin_banks[] = { 2184 2164 PIN_BANK_IOMUX_FLAGS(0, 24, "gpio0", IOMUX_SOURCE_PMU, 2185 2165 IOMUX_SOURCE_PMU, ··· 2274 2220 .data = (void *)&rk3066b_pin_ctrl }, 2275 2221 { .compatible = "rockchip,rk3188-pinctrl", 2276 2222 .data = (void *)&rk3188_pin_ctrl }, 2223 + { .compatible = "rockchip,rk3228-pinctrl", 2224 + .data = (void *)&rk3228_pin_ctrl }, 2277 2225 { .compatible = "rockchip,rk3288-pinctrl", 2278 2226 .data = (void *)&rk3288_pin_ctrl }, 2279 2227 { .compatible = "rockchip,rk3368-pinctrl",
+1 -4
drivers/pinctrl/pinctrl-single.c
··· 1484 1484 static void pcs_free_resources(struct pcs_device *pcs) 1485 1485 { 1486 1486 pcs_irq_free(pcs); 1487 - 1488 - if (pcs->pctl) 1489 - pinctrl_unregister(pcs->pctl); 1490 - 1487 + pinctrl_unregister(pcs->pctl); 1491 1488 pcs_free_funcs(pcs); 1492 1489 pcs_free_pingroups(pcs); 1493 1490 }
+3 -1
drivers/pinctrl/pinctrl-tegra-xusb.c
··· 253 253 err = tegra_xusb_padctl_parse_subnode(padctl, np, maps, 254 254 &reserved_maps, 255 255 num_maps); 256 - if (err < 0) 256 + if (err < 0) { 257 + of_node_put(np); 257 258 return err; 259 + } 258 260 } 259 261 260 262 return 0;
+1
drivers/pinctrl/pinctrl-tegra.c
··· 217 217 if (ret < 0) { 218 218 pinctrl_utils_dt_free_map(pctldev, *map, 219 219 *num_maps); 220 + of_node_put(np); 220 221 return ret; 221 222 } 222 223 }
+1056 -131
drivers/pinctrl/pinctrl-xway.c
··· 7 7 * publishhed by the Free Software Foundation. 8 8 * 9 9 * Copyright (C) 2012 John Crispin <blogic@openwrt.org> 10 + * Copyright (C) 2015 Martin Schiller <mschiller@tdt.de> 10 11 */ 11 12 12 13 #include <linux/err.h> ··· 25 24 26 25 #include <lantiq_soc.h> 27 26 28 - /* we have 3 1/2 banks of 16 bit each */ 27 + /* we have up to 4 banks of 16 bit each */ 29 28 #define PINS 16 30 29 #define PORT3 3 31 30 #define PORT(x) (x / PINS) ··· 36 35 #define MUX_ALT1 0x2 37 36 38 37 /* 39 - * each bank has this offset apart from the 1/2 bank that is mixed into the 38 + * each bank has this offset apart from the 4th bank that is mixed into the 40 39 * other 3 ranges 41 40 */ 42 41 #define REG_OFF 0x30 ··· 52 51 #define GPIO_PUDSEL(p) (GPIO_BASE(p) + 0x1c) 53 52 #define GPIO_PUDEN(p) (GPIO_BASE(p) + 0x20) 54 53 55 - /* the 1/2 port needs special offsets for some registers */ 54 + /* the 4th port needs special offsets for some registers */ 56 55 #define GPIO3_OD (GPIO_BASE(0) + 0x24) 57 56 #define GPIO3_PUDSEL (GPIO_BASE(0) + 0x28) 58 57 #define GPIO3_PUDEN (GPIO_BASE(0) + 0x2C) ··· 81 80 #define FUNC_MUX(f, m) \ 82 81 { .func = f, .mux = XWAY_MUX_##m, } 83 82 84 - #define XWAY_MAX_PIN 32 85 - #define XR9_MAX_PIN 56 86 - 87 83 enum xway_mux { 88 84 XWAY_MUX_GPIO = 0, 89 85 XWAY_MUX_SPI, 90 86 XWAY_MUX_ASC, 87 + XWAY_MUX_USIF, 91 88 XWAY_MUX_PCI, 89 + XWAY_MUX_CBUS, 92 90 XWAY_MUX_CGU, 93 91 XWAY_MUX_EBU, 92 + XWAY_MUX_EBU2, 94 93 XWAY_MUX_JTAG, 94 + XWAY_MUX_MCD, 95 95 XWAY_MUX_EXIN, 96 96 XWAY_MUX_TDM, 97 97 XWAY_MUX_STP, ··· 105 103 XWAY_MUX_DFE, 106 104 XWAY_MUX_SDIO, 107 105 XWAY_MUX_GPHY, 106 + XWAY_MUX_SSI, 107 + XWAY_MUX_WIFI, 108 108 XWAY_MUX_NONE = 0xffff, 109 109 }; 110 + 111 + /* --------- DEPRECATED: xr9 related code --------- */ 112 + /* ---------- use xrx100/xrx200 instead ---------- */ 113 + #define XR9_MAX_PIN 56 110 114 111 115 static const struct ltq_mfp_pin xway_mfp[] = { 112 116 /* pin f0 f1 f2 f3 */ ··· 121 113 MFP_XWAY(GPIO2, GPIO, CGU, EXIN, GPHY), 122 114 MFP_XWAY(GPIO3, GPIO, CGU, NONE, PCI), 123 115 MFP_XWAY(GPIO4, GPIO, STP, NONE, ASC), 124 - MFP_XWAY(GPIO5, GPIO, STP, NONE, GPHY), 116 + MFP_XWAY(GPIO5, GPIO, STP, GPHY, NONE), 125 117 MFP_XWAY(GPIO6, GPIO, STP, GPT, ASC), 126 118 MFP_XWAY(GPIO7, GPIO, CGU, PCI, GPHY), 127 119 MFP_XWAY(GPIO8, GPIO, CGU, NMI, NONE), ··· 160 152 MFP_XWAY(GPIO41, GPIO, NONE, NONE, NONE), 161 153 MFP_XWAY(GPIO42, GPIO, MDIO, NONE, NONE), 162 154 MFP_XWAY(GPIO43, GPIO, MDIO, NONE, NONE), 163 - MFP_XWAY(GPIO44, GPIO, NONE, GPHY, SIN), 155 + MFP_XWAY(GPIO44, GPIO, MII, SIN, GPHY), 164 156 MFP_XWAY(GPIO45, GPIO, NONE, GPHY, SIN), 165 157 MFP_XWAY(GPIO46, GPIO, NONE, NONE, EXIN), 166 - MFP_XWAY(GPIO47, GPIO, NONE, GPHY, SIN), 158 + MFP_XWAY(GPIO47, GPIO, MII, GPHY, SIN), 167 159 MFP_XWAY(GPIO48, GPIO, EBU, NONE, NONE), 168 160 MFP_XWAY(GPIO49, GPIO, EBU, NONE, NONE), 169 161 MFP_XWAY(GPIO50, GPIO, NONE, NONE, NONE), ··· 172 164 MFP_XWAY(GPIO53, GPIO, NONE, NONE, NONE), 173 165 MFP_XWAY(GPIO54, GPIO, NONE, NONE, NONE), 174 166 MFP_XWAY(GPIO55, GPIO, NONE, NONE, NONE), 175 - }; 176 - 177 - static const struct ltq_mfp_pin ase_mfp[] = { 178 - /* pin f0 f1 f2 f3 */ 179 - MFP_XWAY(GPIO0, GPIO, EXIN, MII, TDM), 180 - MFP_XWAY(GPIO1, GPIO, STP, DFE, EBU), 181 - MFP_XWAY(GPIO2, GPIO, STP, DFE, EPHY), 182 - MFP_XWAY(GPIO3, GPIO, STP, EPHY, EBU), 183 - MFP_XWAY(GPIO4, GPIO, GPT, EPHY, MII), 184 - MFP_XWAY(GPIO5, GPIO, MII, ASC, GPT), 185 - MFP_XWAY(GPIO6, GPIO, MII, ASC, EXIN), 186 - MFP_XWAY(GPIO7, GPIO, SPI, MII, JTAG), 187 - MFP_XWAY(GPIO8, GPIO, SPI, MII, JTAG), 188 - MFP_XWAY(GPIO9, GPIO, SPI, MII, JTAG), 189 - MFP_XWAY(GPIO10, GPIO, SPI, MII, JTAG), 190 - MFP_XWAY(GPIO11, GPIO, EBU, CGU, JTAG), 191 - MFP_XWAY(GPIO12, GPIO, EBU, MII, SDIO), 192 - MFP_XWAY(GPIO13, GPIO, EBU, MII, CGU), 193 - MFP_XWAY(GPIO14, GPIO, EBU, SPI, CGU), 194 - MFP_XWAY(GPIO15, GPIO, EBU, SPI, SDIO), 195 - MFP_XWAY(GPIO16, GPIO, NONE, NONE, NONE), 196 - MFP_XWAY(GPIO17, GPIO, NONE, NONE, NONE), 197 - MFP_XWAY(GPIO18, GPIO, NONE, NONE, NONE), 198 - MFP_XWAY(GPIO19, GPIO, EBU, MII, SDIO), 199 - MFP_XWAY(GPIO20, GPIO, EBU, MII, SDIO), 200 - MFP_XWAY(GPIO21, GPIO, EBU, MII, SDIO), 201 - MFP_XWAY(GPIO22, GPIO, EBU, MII, CGU), 202 - MFP_XWAY(GPIO23, GPIO, EBU, MII, CGU), 203 - MFP_XWAY(GPIO24, GPIO, EBU, NONE, MII), 204 - MFP_XWAY(GPIO25, GPIO, EBU, MII, GPT), 205 - MFP_XWAY(GPIO26, GPIO, EBU, MII, SDIO), 206 - MFP_XWAY(GPIO27, GPIO, EBU, NONE, MII), 207 - MFP_XWAY(GPIO28, GPIO, MII, EBU, SDIO), 208 - MFP_XWAY(GPIO29, GPIO, EBU, MII, EXIN), 209 - MFP_XWAY(GPIO30, GPIO, NONE, NONE, NONE), 210 - MFP_XWAY(GPIO31, GPIO, NONE, NONE, NONE), 211 167 }; 212 168 213 169 static const unsigned pins_jtag[] = {GPIO15, GPIO16, GPIO17, GPIO19, GPIO35}; ··· 203 231 static const unsigned pins_nand_rdy[] = {GPIO48}; 204 232 static const unsigned pins_nand_rd[] = {GPIO49}; 205 233 234 + static const unsigned xway_exin_pin_map[] = {GPIO0, GPIO1, GPIO2, GPIO39, GPIO46, GPIO9}; 235 + 206 236 static const unsigned pins_exin0[] = {GPIO0}; 207 237 static const unsigned pins_exin1[] = {GPIO1}; 208 238 static const unsigned pins_exin2[] = {GPIO2}; ··· 214 240 215 241 static const unsigned pins_spi[] = {GPIO16, GPIO17, GPIO18}; 216 242 static const unsigned pins_spi_cs1[] = {GPIO15}; 217 - static const unsigned pins_spi_cs2[] = {GPIO21}; 243 + static const unsigned pins_spi_cs2[] = {GPIO22}; 218 244 static const unsigned pins_spi_cs3[] = {GPIO13}; 219 245 static const unsigned pins_spi_cs4[] = {GPIO10}; 220 246 static const unsigned pins_spi_cs5[] = {GPIO9}; ··· 237 263 static const unsigned pins_pci_req2[] = {GPIO31}; 238 264 static const unsigned pins_pci_req3[] = {GPIO3}; 239 265 static const unsigned pins_pci_req4[] = {GPIO37}; 240 - 241 - static const unsigned ase_pins_jtag[] = {GPIO7, GPIO8, GPIO9, GPIO10, GPIO11}; 242 - static const unsigned ase_pins_asc[] = {GPIO5, GPIO6}; 243 - static const unsigned ase_pins_stp[] = {GPIO1, GPIO2, GPIO3}; 244 - static const unsigned ase_pins_ephy[] = {GPIO2, GPIO3, GPIO4}; 245 - static const unsigned ase_pins_dfe[] = {GPIO1, GPIO2}; 246 - 247 - static const unsigned ase_pins_spi[] = {GPIO8, GPIO9, GPIO10}; 248 - static const unsigned ase_pins_spi_cs1[] = {GPIO7}; 249 - static const unsigned ase_pins_spi_cs2[] = {GPIO15}; 250 - static const unsigned ase_pins_spi_cs3[] = {GPIO14}; 251 - 252 - static const unsigned ase_pins_exin0[] = {GPIO6}; 253 - static const unsigned ase_pins_exin1[] = {GPIO29}; 254 - static const unsigned ase_pins_exin2[] = {GPIO0}; 255 - 256 - static const unsigned ase_pins_gpt1[] = {GPIO5}; 257 - static const unsigned ase_pins_gpt2[] = {GPIO4}; 258 - static const unsigned ase_pins_gpt3[] = {GPIO25}; 259 266 260 267 static const struct ltq_pin_group xway_grps[] = { 261 268 GRP_MUX("exin0", EXIN, pins_exin0), ··· 293 338 GRP_MUX("gphy1 led2", GPHY, pins_gphy1_led2), 294 339 }; 295 340 296 - static const struct ltq_pin_group ase_grps[] = { 297 - GRP_MUX("exin0", EXIN, ase_pins_exin0), 298 - GRP_MUX("exin1", EXIN, ase_pins_exin1), 299 - GRP_MUX("exin2", EXIN, ase_pins_exin2), 300 - GRP_MUX("jtag", JTAG, ase_pins_jtag), 301 - GRP_MUX("stp", STP, ase_pins_stp), 302 - GRP_MUX("asc", ASC, ase_pins_asc), 303 - GRP_MUX("gpt1", GPT, ase_pins_gpt1), 304 - GRP_MUX("gpt2", GPT, ase_pins_gpt2), 305 - GRP_MUX("gpt3", GPT, ase_pins_gpt3), 306 - GRP_MUX("ephy", EPHY, ase_pins_ephy), 307 - GRP_MUX("dfe", DFE, ase_pins_dfe), 308 - GRP_MUX("spi", SPI, ase_pins_spi), 309 - GRP_MUX("spi_cs1", SPI, ase_pins_spi_cs1), 310 - GRP_MUX("spi_cs2", SPI, ase_pins_spi_cs2), 311 - GRP_MUX("spi_cs3", SPI, ase_pins_spi_cs3), 312 - }; 313 - 314 341 static const char * const xway_pci_grps[] = {"gnt1", "gnt2", 315 342 "gnt3", "req1", 316 343 "req2", "req3"}; ··· 332 395 "req1", "req2", 333 396 "req3", "req4"}; 334 397 335 - /* ase */ 336 - static const char * const ase_exin_grps[] = {"exin0", "exin1", "exin2"}; 337 - static const char * const ase_gpt_grps[] = {"gpt1", "gpt2", "gpt3"}; 338 - static const char * const ase_dfe_grps[] = {"dfe"}; 339 - static const char * const ase_ephy_grps[] = {"ephy"}; 340 - static const char * const ase_asc_grps[] = {"asc"}; 341 - static const char * const ase_jtag_grps[] = {"jtag"}; 342 - static const char * const ase_stp_grps[] = {"stp"}; 343 - static const char * const ase_spi_grps[] = {"spi", "spi_cs1", 344 - "spi_cs2", "spi_cs3"}; 345 - 346 - static const struct ltq_pmx_func danube_funcs[] = { 347 - {"spi", ARRAY_AND_SIZE(xway_spi_grps)}, 348 - {"asc", ARRAY_AND_SIZE(xway_asc_grps)}, 349 - {"cgu", ARRAY_AND_SIZE(xway_cgu_grps)}, 350 - {"jtag", ARRAY_AND_SIZE(xway_jtag_grps)}, 351 - {"exin", ARRAY_AND_SIZE(xway_exin_grps)}, 352 - {"stp", ARRAY_AND_SIZE(xway_stp_grps)}, 353 - {"gpt", ARRAY_AND_SIZE(xway_gpt_grps)}, 354 - {"nmi", ARRAY_AND_SIZE(xway_nmi_grps)}, 355 - {"pci", ARRAY_AND_SIZE(xway_pci_grps)}, 356 - {"ebu", ARRAY_AND_SIZE(xway_ebu_grps)}, 357 - }; 358 - 359 398 static const struct ltq_pmx_func xrx_funcs[] = { 360 399 {"spi", ARRAY_AND_SIZE(xway_spi_grps)}, 361 400 {"asc", ARRAY_AND_SIZE(xway_asc_grps)}, ··· 347 434 {"gphy", ARRAY_AND_SIZE(xrx_gphy_grps)}, 348 435 }; 349 436 437 + /* --------- ase related code --------- */ 438 + #define ASE_MAX_PIN 32 439 + 440 + static const struct ltq_mfp_pin ase_mfp[] = { 441 + /* pin f0 f1 f2 f3 */ 442 + MFP_XWAY(GPIO0, GPIO, EXIN, MII, TDM), 443 + MFP_XWAY(GPIO1, GPIO, STP, DFE, EBU), 444 + MFP_XWAY(GPIO2, GPIO, STP, DFE, EPHY), 445 + MFP_XWAY(GPIO3, GPIO, STP, EPHY, EBU), 446 + MFP_XWAY(GPIO4, GPIO, GPT, EPHY, MII), 447 + MFP_XWAY(GPIO5, GPIO, MII, ASC, GPT), 448 + MFP_XWAY(GPIO6, GPIO, MII, ASC, EXIN), 449 + MFP_XWAY(GPIO7, GPIO, SPI, MII, JTAG), 450 + MFP_XWAY(GPIO8, GPIO, SPI, MII, JTAG), 451 + MFP_XWAY(GPIO9, GPIO, SPI, MII, JTAG), 452 + MFP_XWAY(GPIO10, GPIO, SPI, MII, JTAG), 453 + MFP_XWAY(GPIO11, GPIO, EBU, CGU, JTAG), 454 + MFP_XWAY(GPIO12, GPIO, EBU, MII, SDIO), 455 + MFP_XWAY(GPIO13, GPIO, EBU, MII, CGU), 456 + MFP_XWAY(GPIO14, GPIO, EBU, SPI, CGU), 457 + MFP_XWAY(GPIO15, GPIO, EBU, SPI, SDIO), 458 + MFP_XWAY(GPIO16, GPIO, NONE, NONE, NONE), 459 + MFP_XWAY(GPIO17, GPIO, NONE, NONE, NONE), 460 + MFP_XWAY(GPIO18, GPIO, NONE, NONE, NONE), 461 + MFP_XWAY(GPIO19, GPIO, EBU, MII, SDIO), 462 + MFP_XWAY(GPIO20, GPIO, EBU, MII, SDIO), 463 + MFP_XWAY(GPIO21, GPIO, EBU, MII, EBU2), 464 + MFP_XWAY(GPIO22, GPIO, EBU, MII, CGU), 465 + MFP_XWAY(GPIO23, GPIO, EBU, MII, CGU), 466 + MFP_XWAY(GPIO24, GPIO, EBU, EBU2, MDIO), 467 + MFP_XWAY(GPIO25, GPIO, EBU, MII, GPT), 468 + MFP_XWAY(GPIO26, GPIO, EBU, MII, SDIO), 469 + MFP_XWAY(GPIO27, GPIO, EBU, NONE, MDIO), 470 + MFP_XWAY(GPIO28, GPIO, MII, EBU, SDIO), 471 + MFP_XWAY(GPIO29, GPIO, EBU, MII, EXIN), 472 + MFP_XWAY(GPIO30, GPIO, NONE, NONE, NONE), 473 + MFP_XWAY(GPIO31, GPIO, NONE, NONE, NONE), 474 + }; 475 + 476 + static const unsigned ase_exin_pin_map[] = {GPIO6, GPIO29, GPIO0}; 477 + 478 + static const unsigned ase_pins_exin0[] = {GPIO6}; 479 + static const unsigned ase_pins_exin1[] = {GPIO29}; 480 + static const unsigned ase_pins_exin2[] = {GPIO0}; 481 + 482 + static const unsigned ase_pins_jtag[] = {GPIO7, GPIO8, GPIO9, GPIO10, GPIO11}; 483 + static const unsigned ase_pins_asc[] = {GPIO5, GPIO6}; 484 + static const unsigned ase_pins_stp[] = {GPIO1, GPIO2, GPIO3}; 485 + static const unsigned ase_pins_mdio[] = {GPIO24, GPIO27}; 486 + static const unsigned ase_pins_ephy_led0[] = {GPIO2}; 487 + static const unsigned ase_pins_ephy_led1[] = {GPIO3}; 488 + static const unsigned ase_pins_ephy_led2[] = {GPIO4}; 489 + static const unsigned ase_pins_dfe_led0[] = {GPIO1}; 490 + static const unsigned ase_pins_dfe_led1[] = {GPIO2}; 491 + 492 + static const unsigned ase_pins_spi[] = {GPIO8, GPIO9, GPIO10}; /* DEPRECATED */ 493 + static const unsigned ase_pins_spi_di[] = {GPIO8}; 494 + static const unsigned ase_pins_spi_do[] = {GPIO9}; 495 + static const unsigned ase_pins_spi_clk[] = {GPIO10}; 496 + static const unsigned ase_pins_spi_cs1[] = {GPIO7}; 497 + static const unsigned ase_pins_spi_cs2[] = {GPIO15}; 498 + static const unsigned ase_pins_spi_cs3[] = {GPIO14}; 499 + 500 + static const unsigned ase_pins_gpt1[] = {GPIO5}; 501 + static const unsigned ase_pins_gpt2[] = {GPIO4}; 502 + static const unsigned ase_pins_gpt3[] = {GPIO25}; 503 + 504 + static const unsigned ase_pins_clkout0[] = {GPIO23}; 505 + static const unsigned ase_pins_clkout1[] = {GPIO22}; 506 + static const unsigned ase_pins_clkout2[] = {GPIO14}; 507 + 508 + static const struct ltq_pin_group ase_grps[] = { 509 + GRP_MUX("exin0", EXIN, ase_pins_exin0), 510 + GRP_MUX("exin1", EXIN, ase_pins_exin1), 511 + GRP_MUX("exin2", EXIN, ase_pins_exin2), 512 + GRP_MUX("jtag", JTAG, ase_pins_jtag), 513 + GRP_MUX("spi", SPI, ase_pins_spi), /* DEPRECATED */ 514 + GRP_MUX("spi_di", SPI, ase_pins_spi_di), 515 + GRP_MUX("spi_do", SPI, ase_pins_spi_do), 516 + GRP_MUX("spi_clk", SPI, ase_pins_spi_clk), 517 + GRP_MUX("spi_cs1", SPI, ase_pins_spi_cs1), 518 + GRP_MUX("spi_cs2", SPI, ase_pins_spi_cs2), 519 + GRP_MUX("spi_cs3", SPI, ase_pins_spi_cs3), 520 + GRP_MUX("asc", ASC, ase_pins_asc), 521 + GRP_MUX("stp", STP, ase_pins_stp), 522 + GRP_MUX("gpt1", GPT, ase_pins_gpt1), 523 + GRP_MUX("gpt2", GPT, ase_pins_gpt2), 524 + GRP_MUX("gpt3", GPT, ase_pins_gpt3), 525 + GRP_MUX("clkout0", CGU, ase_pins_clkout0), 526 + GRP_MUX("clkout1", CGU, ase_pins_clkout1), 527 + GRP_MUX("clkout2", CGU, ase_pins_clkout2), 528 + GRP_MUX("mdio", MDIO, ase_pins_mdio), 529 + GRP_MUX("dfe led0", DFE, ase_pins_dfe_led0), 530 + GRP_MUX("dfe led1", DFE, ase_pins_dfe_led1), 531 + GRP_MUX("ephy led0", EPHY, ase_pins_ephy_led0), 532 + GRP_MUX("ephy led1", EPHY, ase_pins_ephy_led1), 533 + GRP_MUX("ephy led2", EPHY, ase_pins_ephy_led2), 534 + }; 535 + 536 + static const char * const ase_exin_grps[] = {"exin0", "exin1", "exin2"}; 537 + static const char * const ase_gpt_grps[] = {"gpt1", "gpt2", "gpt3"}; 538 + static const char * const ase_cgu_grps[] = {"clkout0", "clkout1", 539 + "clkout2"}; 540 + static const char * const ase_mdio_grps[] = {"mdio"}; 541 + static const char * const ase_dfe_grps[] = {"dfe led0", "dfe led1"}; 542 + static const char * const ase_ephy_grps[] = {"ephy led0", "ephy led1", 543 + "ephy led2"}; 544 + static const char * const ase_asc_grps[] = {"asc"}; 545 + static const char * const ase_jtag_grps[] = {"jtag"}; 546 + static const char * const ase_stp_grps[] = {"stp"}; 547 + static const char * const ase_spi_grps[] = {"spi", /* DEPRECATED */ 548 + "spi_di", "spi_do", 549 + "spi_clk", "spi_cs1", 550 + "spi_cs2", "spi_cs3"}; 551 + 350 552 static const struct ltq_pmx_func ase_funcs[] = { 351 553 {"spi", ARRAY_AND_SIZE(ase_spi_grps)}, 352 554 {"asc", ARRAY_AND_SIZE(ase_asc_grps)}, 555 + {"cgu", ARRAY_AND_SIZE(ase_cgu_grps)}, 353 556 {"jtag", ARRAY_AND_SIZE(ase_jtag_grps)}, 354 557 {"exin", ARRAY_AND_SIZE(ase_exin_grps)}, 355 558 {"stp", ARRAY_AND_SIZE(ase_stp_grps)}, 356 559 {"gpt", ARRAY_AND_SIZE(ase_gpt_grps)}, 560 + {"mdio", ARRAY_AND_SIZE(ase_mdio_grps)}, 357 561 {"ephy", ARRAY_AND_SIZE(ase_ephy_grps)}, 358 562 {"dfe", ARRAY_AND_SIZE(ase_dfe_grps)}, 563 + }; 564 + 565 + /* --------- danube related code --------- */ 566 + #define DANUBE_MAX_PIN 32 567 + 568 + static const struct ltq_mfp_pin danube_mfp[] = { 569 + /* pin f0 f1 f2 f3 */ 570 + MFP_XWAY(GPIO0, GPIO, EXIN, SDIO, TDM), 571 + MFP_XWAY(GPIO1, GPIO, EXIN, CBUS, MII), 572 + MFP_XWAY(GPIO2, GPIO, CGU, EXIN, MII), 573 + MFP_XWAY(GPIO3, GPIO, CGU, SDIO, PCI), 574 + MFP_XWAY(GPIO4, GPIO, STP, DFE, ASC), 575 + MFP_XWAY(GPIO5, GPIO, STP, MII, DFE), 576 + MFP_XWAY(GPIO6, GPIO, STP, GPT, ASC), 577 + MFP_XWAY(GPIO7, GPIO, CGU, CBUS, MII), 578 + MFP_XWAY(GPIO8, GPIO, CGU, NMI, MII), 579 + MFP_XWAY(GPIO9, GPIO, ASC, SPI, MII), 580 + MFP_XWAY(GPIO10, GPIO, ASC, SPI, MII), 581 + MFP_XWAY(GPIO11, GPIO, ASC, CBUS, SPI), 582 + MFP_XWAY(GPIO12, GPIO, ASC, CBUS, MCD), 583 + MFP_XWAY(GPIO13, GPIO, EBU, SPI, MII), 584 + MFP_XWAY(GPIO14, GPIO, CGU, CBUS, MII), 585 + MFP_XWAY(GPIO15, GPIO, SPI, SDIO, JTAG), 586 + MFP_XWAY(GPIO16, GPIO, SPI, SDIO, JTAG), 587 + MFP_XWAY(GPIO17, GPIO, SPI, SDIO, JTAG), 588 + MFP_XWAY(GPIO18, GPIO, SPI, SDIO, JTAG), 589 + MFP_XWAY(GPIO19, GPIO, PCI, SDIO, MII), 590 + MFP_XWAY(GPIO20, GPIO, JTAG, SDIO, MII), 591 + MFP_XWAY(GPIO21, GPIO, PCI, EBU, GPT), 592 + MFP_XWAY(GPIO22, GPIO, SPI, MCD, MII), 593 + MFP_XWAY(GPIO23, GPIO, EBU, PCI, STP), 594 + MFP_XWAY(GPIO24, GPIO, EBU, TDM, PCI), 595 + MFP_XWAY(GPIO25, GPIO, TDM, SDIO, ASC), 596 + MFP_XWAY(GPIO26, GPIO, EBU, TDM, SDIO), 597 + MFP_XWAY(GPIO27, GPIO, TDM, SDIO, ASC), 598 + MFP_XWAY(GPIO28, GPIO, GPT, MII, SDIO), 599 + MFP_XWAY(GPIO29, GPIO, PCI, CBUS, MII), 600 + MFP_XWAY(GPIO30, GPIO, PCI, CBUS, MII), 601 + MFP_XWAY(GPIO31, GPIO, EBU, PCI, MII), 602 + }; 603 + 604 + static const unsigned danube_exin_pin_map[] = {GPIO0, GPIO1, GPIO2}; 605 + 606 + static const unsigned danube_pins_exin0[] = {GPIO0}; 607 + static const unsigned danube_pins_exin1[] = {GPIO1}; 608 + static const unsigned danube_pins_exin2[] = {GPIO2}; 609 + 610 + static const unsigned danube_pins_jtag[] = {GPIO15, GPIO16, GPIO17, GPIO18, GPIO20}; 611 + static const unsigned danube_pins_asc0[] = {GPIO11, GPIO12}; 612 + static const unsigned danube_pins_asc0_cts_rts[] = {GPIO9, GPIO10}; 613 + static const unsigned danube_pins_stp[] = {GPIO4, GPIO5, GPIO6}; 614 + static const unsigned danube_pins_nmi[] = {GPIO8}; 615 + 616 + static const unsigned danube_pins_dfe_led0[] = {GPIO4}; 617 + static const unsigned danube_pins_dfe_led1[] = {GPIO5}; 618 + 619 + static const unsigned danube_pins_ebu_a24[] = {GPIO13}; 620 + static const unsigned danube_pins_ebu_clk[] = {GPIO21}; 621 + static const unsigned danube_pins_ebu_cs1[] = {GPIO23}; 622 + static const unsigned danube_pins_ebu_a23[] = {GPIO24}; 623 + static const unsigned danube_pins_ebu_wait[] = {GPIO26}; 624 + static const unsigned danube_pins_ebu_a25[] = {GPIO31}; 625 + 626 + static const unsigned danube_pins_nand_ale[] = {GPIO13}; 627 + static const unsigned danube_pins_nand_cs1[] = {GPIO23}; 628 + static const unsigned danube_pins_nand_cle[] = {GPIO24}; 629 + 630 + static const unsigned danube_pins_spi[] = {GPIO16, GPIO17, GPIO18}; /* DEPRECATED */ 631 + static const unsigned danube_pins_spi_di[] = {GPIO16}; 632 + static const unsigned danube_pins_spi_do[] = {GPIO17}; 633 + static const unsigned danube_pins_spi_clk[] = {GPIO18}; 634 + static const unsigned danube_pins_spi_cs1[] = {GPIO15}; 635 + static const unsigned danube_pins_spi_cs2[] = {GPIO21}; 636 + static const unsigned danube_pins_spi_cs3[] = {GPIO13}; 637 + static const unsigned danube_pins_spi_cs4[] = {GPIO10}; 638 + static const unsigned danube_pins_spi_cs5[] = {GPIO9}; 639 + static const unsigned danube_pins_spi_cs6[] = {GPIO11}; 640 + 641 + static const unsigned danube_pins_gpt1[] = {GPIO28}; 642 + static const unsigned danube_pins_gpt2[] = {GPIO21}; 643 + static const unsigned danube_pins_gpt3[] = {GPIO6}; 644 + 645 + static const unsigned danube_pins_clkout0[] = {GPIO8}; 646 + static const unsigned danube_pins_clkout1[] = {GPIO7}; 647 + static const unsigned danube_pins_clkout2[] = {GPIO3}; 648 + static const unsigned danube_pins_clkout3[] = {GPIO2}; 649 + 650 + static const unsigned danube_pins_pci_gnt1[] = {GPIO30}; 651 + static const unsigned danube_pins_pci_gnt2[] = {GPIO23}; 652 + static const unsigned danube_pins_pci_gnt3[] = {GPIO19}; 653 + static const unsigned danube_pins_pci_req1[] = {GPIO29}; 654 + static const unsigned danube_pins_pci_req2[] = {GPIO31}; 655 + static const unsigned danube_pins_pci_req3[] = {GPIO3}; 656 + 657 + static const struct ltq_pin_group danube_grps[] = { 658 + GRP_MUX("exin0", EXIN, danube_pins_exin0), 659 + GRP_MUX("exin1", EXIN, danube_pins_exin1), 660 + GRP_MUX("exin2", EXIN, danube_pins_exin2), 661 + GRP_MUX("jtag", JTAG, danube_pins_jtag), 662 + GRP_MUX("ebu a23", EBU, danube_pins_ebu_a23), 663 + GRP_MUX("ebu a24", EBU, danube_pins_ebu_a24), 664 + GRP_MUX("ebu a25", EBU, danube_pins_ebu_a25), 665 + GRP_MUX("ebu clk", EBU, danube_pins_ebu_clk), 666 + GRP_MUX("ebu cs1", EBU, danube_pins_ebu_cs1), 667 + GRP_MUX("ebu wait", EBU, danube_pins_ebu_wait), 668 + GRP_MUX("nand ale", EBU, danube_pins_nand_ale), 669 + GRP_MUX("nand cs1", EBU, danube_pins_nand_cs1), 670 + GRP_MUX("nand cle", EBU, danube_pins_nand_cle), 671 + GRP_MUX("spi", SPI, danube_pins_spi), /* DEPRECATED */ 672 + GRP_MUX("spi_di", SPI, danube_pins_spi_di), 673 + GRP_MUX("spi_do", SPI, danube_pins_spi_do), 674 + GRP_MUX("spi_clk", SPI, danube_pins_spi_clk), 675 + GRP_MUX("spi_cs1", SPI, danube_pins_spi_cs1), 676 + GRP_MUX("spi_cs2", SPI, danube_pins_spi_cs2), 677 + GRP_MUX("spi_cs3", SPI, danube_pins_spi_cs3), 678 + GRP_MUX("spi_cs4", SPI, danube_pins_spi_cs4), 679 + GRP_MUX("spi_cs5", SPI, danube_pins_spi_cs5), 680 + GRP_MUX("spi_cs6", SPI, danube_pins_spi_cs6), 681 + GRP_MUX("asc0", ASC, danube_pins_asc0), 682 + GRP_MUX("asc0 cts rts", ASC, danube_pins_asc0_cts_rts), 683 + GRP_MUX("stp", STP, danube_pins_stp), 684 + GRP_MUX("nmi", NMI, danube_pins_nmi), 685 + GRP_MUX("gpt1", GPT, danube_pins_gpt1), 686 + GRP_MUX("gpt2", GPT, danube_pins_gpt2), 687 + GRP_MUX("gpt3", GPT, danube_pins_gpt3), 688 + GRP_MUX("clkout0", CGU, danube_pins_clkout0), 689 + GRP_MUX("clkout1", CGU, danube_pins_clkout1), 690 + GRP_MUX("clkout2", CGU, danube_pins_clkout2), 691 + GRP_MUX("clkout3", CGU, danube_pins_clkout3), 692 + GRP_MUX("gnt1", PCI, danube_pins_pci_gnt1), 693 + GRP_MUX("gnt2", PCI, danube_pins_pci_gnt2), 694 + GRP_MUX("gnt3", PCI, danube_pins_pci_gnt3), 695 + GRP_MUX("req1", PCI, danube_pins_pci_req1), 696 + GRP_MUX("req2", PCI, danube_pins_pci_req2), 697 + GRP_MUX("req3", PCI, danube_pins_pci_req3), 698 + GRP_MUX("dfe led0", DFE, danube_pins_dfe_led0), 699 + GRP_MUX("dfe led1", DFE, danube_pins_dfe_led1), 700 + }; 701 + 702 + static const char * const danube_pci_grps[] = {"gnt1", "gnt2", 703 + "gnt3", "req1", 704 + "req2", "req3"}; 705 + static const char * const danube_spi_grps[] = {"spi", /* DEPRECATED */ 706 + "spi_di", "spi_do", 707 + "spi_clk", "spi_cs1", 708 + "spi_cs2", "spi_cs3", 709 + "spi_cs4", "spi_cs5", 710 + "spi_cs6"}; 711 + static const char * const danube_cgu_grps[] = {"clkout0", "clkout1", 712 + "clkout2", "clkout3"}; 713 + static const char * const danube_ebu_grps[] = {"ebu a23", "ebu a24", 714 + "ebu a25", "ebu cs1", 715 + "ebu wait", "ebu clk", 716 + "nand ale", "nand cs1", 717 + "nand cle"}; 718 + static const char * const danube_dfe_grps[] = {"dfe led0", "dfe led1"}; 719 + static const char * const danube_exin_grps[] = {"exin0", "exin1", "exin2"}; 720 + static const char * const danube_gpt_grps[] = {"gpt1", "gpt2", "gpt3"}; 721 + static const char * const danube_asc_grps[] = {"asc0", "asc0 cts rts"}; 722 + static const char * const danube_jtag_grps[] = {"jtag"}; 723 + static const char * const danube_stp_grps[] = {"stp"}; 724 + static const char * const danube_nmi_grps[] = {"nmi"}; 725 + 726 + static const struct ltq_pmx_func danube_funcs[] = { 727 + {"spi", ARRAY_AND_SIZE(danube_spi_grps)}, 728 + {"asc", ARRAY_AND_SIZE(danube_asc_grps)}, 729 + {"cgu", ARRAY_AND_SIZE(danube_cgu_grps)}, 730 + {"jtag", ARRAY_AND_SIZE(danube_jtag_grps)}, 731 + {"exin", ARRAY_AND_SIZE(danube_exin_grps)}, 732 + {"stp", ARRAY_AND_SIZE(danube_stp_grps)}, 733 + {"gpt", ARRAY_AND_SIZE(danube_gpt_grps)}, 734 + {"nmi", ARRAY_AND_SIZE(danube_nmi_grps)}, 735 + {"pci", ARRAY_AND_SIZE(danube_pci_grps)}, 736 + {"ebu", ARRAY_AND_SIZE(danube_ebu_grps)}, 737 + {"dfe", ARRAY_AND_SIZE(danube_dfe_grps)}, 738 + }; 739 + 740 + /* --------- xrx100 related code --------- */ 741 + #define XRX100_MAX_PIN 56 742 + 743 + static const struct ltq_mfp_pin xrx100_mfp[] = { 744 + /* pin f0 f1 f2 f3 */ 745 + MFP_XWAY(GPIO0, GPIO, EXIN, SDIO, TDM), 746 + MFP_XWAY(GPIO1, GPIO, EXIN, CBUS, SIN), 747 + MFP_XWAY(GPIO2, GPIO, CGU, EXIN, NONE), 748 + MFP_XWAY(GPIO3, GPIO, CGU, SDIO, PCI), 749 + MFP_XWAY(GPIO4, GPIO, STP, DFE, ASC), 750 + MFP_XWAY(GPIO5, GPIO, STP, NONE, DFE), 751 + MFP_XWAY(GPIO6, GPIO, STP, GPT, ASC), 752 + MFP_XWAY(GPIO7, GPIO, CGU, CBUS, NONE), 753 + MFP_XWAY(GPIO8, GPIO, CGU, NMI, NONE), 754 + MFP_XWAY(GPIO9, GPIO, ASC, SPI, EXIN), 755 + MFP_XWAY(GPIO10, GPIO, ASC, SPI, EXIN), 756 + MFP_XWAY(GPIO11, GPIO, ASC, CBUS, SPI), 757 + MFP_XWAY(GPIO12, GPIO, ASC, CBUS, MCD), 758 + MFP_XWAY(GPIO13, GPIO, EBU, SPI, NONE), 759 + MFP_XWAY(GPIO14, GPIO, CGU, NONE, NONE), 760 + MFP_XWAY(GPIO15, GPIO, SPI, SDIO, MCD), 761 + MFP_XWAY(GPIO16, GPIO, SPI, SDIO, NONE), 762 + MFP_XWAY(GPIO17, GPIO, SPI, SDIO, NONE), 763 + MFP_XWAY(GPIO18, GPIO, SPI, SDIO, NONE), 764 + MFP_XWAY(GPIO19, GPIO, PCI, SDIO, CGU), 765 + MFP_XWAY(GPIO20, GPIO, NONE, SDIO, EBU), 766 + MFP_XWAY(GPIO21, GPIO, PCI, EBU, GPT), 767 + MFP_XWAY(GPIO22, GPIO, SPI, NONE, EBU), 768 + MFP_XWAY(GPIO23, GPIO, EBU, PCI, STP), 769 + MFP_XWAY(GPIO24, GPIO, EBU, TDM, PCI), 770 + MFP_XWAY(GPIO25, GPIO, TDM, SDIO, ASC), 771 + MFP_XWAY(GPIO26, GPIO, EBU, TDM, SDIO), 772 + MFP_XWAY(GPIO27, GPIO, TDM, SDIO, ASC), 773 + MFP_XWAY(GPIO28, GPIO, GPT, NONE, SDIO), 774 + MFP_XWAY(GPIO29, GPIO, PCI, CBUS, NONE), 775 + MFP_XWAY(GPIO30, GPIO, PCI, CBUS, NONE), 776 + MFP_XWAY(GPIO31, GPIO, EBU, PCI, NONE), 777 + MFP_XWAY(GPIO32, GPIO, MII, NONE, EBU), 778 + MFP_XWAY(GPIO33, GPIO, MII, NONE, EBU), 779 + MFP_XWAY(GPIO34, GPIO, SIN, SSI, NONE), 780 + MFP_XWAY(GPIO35, GPIO, SIN, SSI, NONE), 781 + MFP_XWAY(GPIO36, GPIO, SIN, SSI, NONE), 782 + MFP_XWAY(GPIO37, GPIO, PCI, NONE, NONE), 783 + MFP_XWAY(GPIO38, GPIO, PCI, NONE, NONE), 784 + MFP_XWAY(GPIO39, GPIO, NONE, EXIN, NONE), 785 + MFP_XWAY(GPIO40, GPIO, MII, TDM, NONE), 786 + MFP_XWAY(GPIO41, GPIO, MII, TDM, NONE), 787 + MFP_XWAY(GPIO42, GPIO, MDIO, NONE, NONE), 788 + MFP_XWAY(GPIO43, GPIO, MDIO, NONE, NONE), 789 + MFP_XWAY(GPIO44, GPIO, MII, SIN, NONE), 790 + MFP_XWAY(GPIO45, GPIO, MII, NONE, SIN), 791 + MFP_XWAY(GPIO46, GPIO, MII, NONE, EXIN), 792 + MFP_XWAY(GPIO47, GPIO, MII, NONE, SIN), 793 + MFP_XWAY(GPIO48, GPIO, EBU, NONE, NONE), 794 + MFP_XWAY(GPIO49, GPIO, EBU, NONE, NONE), 795 + MFP_XWAY(GPIO50, GPIO, NONE, NONE, NONE), 796 + MFP_XWAY(GPIO51, GPIO, NONE, NONE, NONE), 797 + MFP_XWAY(GPIO52, GPIO, NONE, NONE, NONE), 798 + MFP_XWAY(GPIO53, GPIO, NONE, NONE, NONE), 799 + MFP_XWAY(GPIO54, GPIO, NONE, NONE, NONE), 800 + MFP_XWAY(GPIO55, GPIO, NONE, NONE, NONE), 801 + }; 802 + 803 + static const unsigned xrx100_exin_pin_map[] = {GPIO0, GPIO1, GPIO2, GPIO39, GPIO10, GPIO9}; 804 + 805 + static const unsigned xrx100_pins_exin0[] = {GPIO0}; 806 + static const unsigned xrx100_pins_exin1[] = {GPIO1}; 807 + static const unsigned xrx100_pins_exin2[] = {GPIO2}; 808 + static const unsigned xrx100_pins_exin3[] = {GPIO39}; 809 + static const unsigned xrx100_pins_exin4[] = {GPIO10}; 810 + static const unsigned xrx100_pins_exin5[] = {GPIO9}; 811 + 812 + static const unsigned xrx100_pins_asc0[] = {GPIO11, GPIO12}; 813 + static const unsigned xrx100_pins_asc0_cts_rts[] = {GPIO9, GPIO10}; 814 + static const unsigned xrx100_pins_stp[] = {GPIO4, GPIO5, GPIO6}; 815 + static const unsigned xrx100_pins_nmi[] = {GPIO8}; 816 + static const unsigned xrx100_pins_mdio[] = {GPIO42, GPIO43}; 817 + 818 + static const unsigned xrx100_pins_dfe_led0[] = {GPIO4}; 819 + static const unsigned xrx100_pins_dfe_led1[] = {GPIO5}; 820 + 821 + static const unsigned xrx100_pins_ebu_a24[] = {GPIO13}; 822 + static const unsigned xrx100_pins_ebu_clk[] = {GPIO21}; 823 + static const unsigned xrx100_pins_ebu_cs1[] = {GPIO23}; 824 + static const unsigned xrx100_pins_ebu_a23[] = {GPIO24}; 825 + static const unsigned xrx100_pins_ebu_wait[] = {GPIO26}; 826 + static const unsigned xrx100_pins_ebu_a25[] = {GPIO31}; 827 + 828 + static const unsigned xrx100_pins_nand_ale[] = {GPIO13}; 829 + static const unsigned xrx100_pins_nand_cs1[] = {GPIO23}; 830 + static const unsigned xrx100_pins_nand_cle[] = {GPIO24}; 831 + static const unsigned xrx100_pins_nand_rdy[] = {GPIO48}; 832 + static const unsigned xrx100_pins_nand_rd[] = {GPIO49}; 833 + 834 + static const unsigned xrx100_pins_spi_di[] = {GPIO16}; 835 + static const unsigned xrx100_pins_spi_do[] = {GPIO17}; 836 + static const unsigned xrx100_pins_spi_clk[] = {GPIO18}; 837 + static const unsigned xrx100_pins_spi_cs1[] = {GPIO15}; 838 + static const unsigned xrx100_pins_spi_cs2[] = {GPIO22}; 839 + static const unsigned xrx100_pins_spi_cs3[] = {GPIO13}; 840 + static const unsigned xrx100_pins_spi_cs4[] = {GPIO10}; 841 + static const unsigned xrx100_pins_spi_cs5[] = {GPIO9}; 842 + static const unsigned xrx100_pins_spi_cs6[] = {GPIO11}; 843 + 844 + static const unsigned xrx100_pins_gpt1[] = {GPIO28}; 845 + static const unsigned xrx100_pins_gpt2[] = {GPIO21}; 846 + static const unsigned xrx100_pins_gpt3[] = {GPIO6}; 847 + 848 + static const unsigned xrx100_pins_clkout0[] = {GPIO8}; 849 + static const unsigned xrx100_pins_clkout1[] = {GPIO7}; 850 + static const unsigned xrx100_pins_clkout2[] = {GPIO3}; 851 + static const unsigned xrx100_pins_clkout3[] = {GPIO2}; 852 + 853 + static const unsigned xrx100_pins_pci_gnt1[] = {GPIO30}; 854 + static const unsigned xrx100_pins_pci_gnt2[] = {GPIO23}; 855 + static const unsigned xrx100_pins_pci_gnt3[] = {GPIO19}; 856 + static const unsigned xrx100_pins_pci_gnt4[] = {GPIO38}; 857 + static const unsigned xrx100_pins_pci_req1[] = {GPIO29}; 858 + static const unsigned xrx100_pins_pci_req2[] = {GPIO31}; 859 + static const unsigned xrx100_pins_pci_req3[] = {GPIO3}; 860 + static const unsigned xrx100_pins_pci_req4[] = {GPIO37}; 861 + 862 + static const struct ltq_pin_group xrx100_grps[] = { 863 + GRP_MUX("exin0", EXIN, xrx100_pins_exin0), 864 + GRP_MUX("exin1", EXIN, xrx100_pins_exin1), 865 + GRP_MUX("exin2", EXIN, xrx100_pins_exin2), 866 + GRP_MUX("exin3", EXIN, xrx100_pins_exin3), 867 + GRP_MUX("exin4", EXIN, xrx100_pins_exin4), 868 + GRP_MUX("exin5", EXIN, xrx100_pins_exin5), 869 + GRP_MUX("ebu a23", EBU, xrx100_pins_ebu_a23), 870 + GRP_MUX("ebu a24", EBU, xrx100_pins_ebu_a24), 871 + GRP_MUX("ebu a25", EBU, xrx100_pins_ebu_a25), 872 + GRP_MUX("ebu clk", EBU, xrx100_pins_ebu_clk), 873 + GRP_MUX("ebu cs1", EBU, xrx100_pins_ebu_cs1), 874 + GRP_MUX("ebu wait", EBU, xrx100_pins_ebu_wait), 875 + GRP_MUX("nand ale", EBU, xrx100_pins_nand_ale), 876 + GRP_MUX("nand cs1", EBU, xrx100_pins_nand_cs1), 877 + GRP_MUX("nand cle", EBU, xrx100_pins_nand_cle), 878 + GRP_MUX("nand rdy", EBU, xrx100_pins_nand_rdy), 879 + GRP_MUX("nand rd", EBU, xrx100_pins_nand_rd), 880 + GRP_MUX("spi_di", SPI, xrx100_pins_spi_di), 881 + GRP_MUX("spi_do", SPI, xrx100_pins_spi_do), 882 + GRP_MUX("spi_clk", SPI, xrx100_pins_spi_clk), 883 + GRP_MUX("spi_cs1", SPI, xrx100_pins_spi_cs1), 884 + GRP_MUX("spi_cs2", SPI, xrx100_pins_spi_cs2), 885 + GRP_MUX("spi_cs3", SPI, xrx100_pins_spi_cs3), 886 + GRP_MUX("spi_cs4", SPI, xrx100_pins_spi_cs4), 887 + GRP_MUX("spi_cs5", SPI, xrx100_pins_spi_cs5), 888 + GRP_MUX("spi_cs6", SPI, xrx100_pins_spi_cs6), 889 + GRP_MUX("asc0", ASC, xrx100_pins_asc0), 890 + GRP_MUX("asc0 cts rts", ASC, xrx100_pins_asc0_cts_rts), 891 + GRP_MUX("stp", STP, xrx100_pins_stp), 892 + GRP_MUX("nmi", NMI, xrx100_pins_nmi), 893 + GRP_MUX("gpt1", GPT, xrx100_pins_gpt1), 894 + GRP_MUX("gpt2", GPT, xrx100_pins_gpt2), 895 + GRP_MUX("gpt3", GPT, xrx100_pins_gpt3), 896 + GRP_MUX("clkout0", CGU, xrx100_pins_clkout0), 897 + GRP_MUX("clkout1", CGU, xrx100_pins_clkout1), 898 + GRP_MUX("clkout2", CGU, xrx100_pins_clkout2), 899 + GRP_MUX("clkout3", CGU, xrx100_pins_clkout3), 900 + GRP_MUX("gnt1", PCI, xrx100_pins_pci_gnt1), 901 + GRP_MUX("gnt2", PCI, xrx100_pins_pci_gnt2), 902 + GRP_MUX("gnt3", PCI, xrx100_pins_pci_gnt3), 903 + GRP_MUX("gnt4", PCI, xrx100_pins_pci_gnt4), 904 + GRP_MUX("req1", PCI, xrx100_pins_pci_req1), 905 + GRP_MUX("req2", PCI, xrx100_pins_pci_req2), 906 + GRP_MUX("req3", PCI, xrx100_pins_pci_req3), 907 + GRP_MUX("req4", PCI, xrx100_pins_pci_req4), 908 + GRP_MUX("mdio", MDIO, xrx100_pins_mdio), 909 + GRP_MUX("dfe led0", DFE, xrx100_pins_dfe_led0), 910 + GRP_MUX("dfe led1", DFE, xrx100_pins_dfe_led1), 911 + }; 912 + 913 + static const char * const xrx100_pci_grps[] = {"gnt1", "gnt2", 914 + "gnt3", "gnt4", 915 + "req1", "req2", 916 + "req3", "req4"}; 917 + static const char * const xrx100_spi_grps[] = {"spi_di", "spi_do", 918 + "spi_clk", "spi_cs1", 919 + "spi_cs2", "spi_cs3", 920 + "spi_cs4", "spi_cs5", 921 + "spi_cs6"}; 922 + static const char * const xrx100_cgu_grps[] = {"clkout0", "clkout1", 923 + "clkout2", "clkout3"}; 924 + static const char * const xrx100_ebu_grps[] = {"ebu a23", "ebu a24", 925 + "ebu a25", "ebu cs1", 926 + "ebu wait", "ebu clk", 927 + "nand ale", "nand cs1", 928 + "nand cle", "nand rdy", 929 + "nand rd"}; 930 + static const char * const xrx100_exin_grps[] = {"exin0", "exin1", "exin2", 931 + "exin3", "exin4", "exin5"}; 932 + static const char * const xrx100_gpt_grps[] = {"gpt1", "gpt2", "gpt3"}; 933 + static const char * const xrx100_asc_grps[] = {"asc0", "asc0 cts rts"}; 934 + static const char * const xrx100_stp_grps[] = {"stp"}; 935 + static const char * const xrx100_nmi_grps[] = {"nmi"}; 936 + static const char * const xrx100_mdio_grps[] = {"mdio"}; 937 + static const char * const xrx100_dfe_grps[] = {"dfe led0", "dfe led1"}; 938 + 939 + static const struct ltq_pmx_func xrx100_funcs[] = { 940 + {"spi", ARRAY_AND_SIZE(xrx100_spi_grps)}, 941 + {"asc", ARRAY_AND_SIZE(xrx100_asc_grps)}, 942 + {"cgu", ARRAY_AND_SIZE(xrx100_cgu_grps)}, 943 + {"exin", ARRAY_AND_SIZE(xrx100_exin_grps)}, 944 + {"stp", ARRAY_AND_SIZE(xrx100_stp_grps)}, 945 + {"gpt", ARRAY_AND_SIZE(xrx100_gpt_grps)}, 946 + {"nmi", ARRAY_AND_SIZE(xrx100_nmi_grps)}, 947 + {"pci", ARRAY_AND_SIZE(xrx100_pci_grps)}, 948 + {"ebu", ARRAY_AND_SIZE(xrx100_ebu_grps)}, 949 + {"mdio", ARRAY_AND_SIZE(xrx100_mdio_grps)}, 950 + {"dfe", ARRAY_AND_SIZE(xrx100_dfe_grps)}, 951 + }; 952 + 953 + /* --------- xrx200 related code --------- */ 954 + #define XRX200_MAX_PIN 50 955 + 956 + static const struct ltq_mfp_pin xrx200_mfp[] = { 957 + /* pin f0 f1 f2 f3 */ 958 + MFP_XWAY(GPIO0, GPIO, EXIN, SDIO, TDM), 959 + MFP_XWAY(GPIO1, GPIO, EXIN, CBUS, SIN), 960 + MFP_XWAY(GPIO2, GPIO, CGU, EXIN, GPHY), 961 + MFP_XWAY(GPIO3, GPIO, CGU, SDIO, PCI), 962 + MFP_XWAY(GPIO4, GPIO, STP, DFE, USIF), 963 + MFP_XWAY(GPIO5, GPIO, STP, GPHY, DFE), 964 + MFP_XWAY(GPIO6, GPIO, STP, GPT, USIF), 965 + MFP_XWAY(GPIO7, GPIO, CGU, CBUS, GPHY), 966 + MFP_XWAY(GPIO8, GPIO, CGU, NMI, NONE), 967 + MFP_XWAY(GPIO9, GPIO, USIF, SPI, EXIN), 968 + MFP_XWAY(GPIO10, GPIO, USIF, SPI, EXIN), 969 + MFP_XWAY(GPIO11, GPIO, USIF, CBUS, SPI), 970 + MFP_XWAY(GPIO12, GPIO, USIF, CBUS, MCD), 971 + MFP_XWAY(GPIO13, GPIO, EBU, SPI, NONE), 972 + MFP_XWAY(GPIO14, GPIO, CGU, CBUS, USIF), 973 + MFP_XWAY(GPIO15, GPIO, SPI, SDIO, MCD), 974 + MFP_XWAY(GPIO16, GPIO, SPI, SDIO, NONE), 975 + MFP_XWAY(GPIO17, GPIO, SPI, SDIO, NONE), 976 + MFP_XWAY(GPIO18, GPIO, SPI, SDIO, NONE), 977 + MFP_XWAY(GPIO19, GPIO, PCI, SDIO, CGU), 978 + MFP_XWAY(GPIO20, GPIO, NONE, SDIO, EBU), 979 + MFP_XWAY(GPIO21, GPIO, PCI, EBU, GPT), 980 + MFP_XWAY(GPIO22, GPIO, SPI, CGU, EBU), 981 + MFP_XWAY(GPIO23, GPIO, EBU, PCI, STP), 982 + MFP_XWAY(GPIO24, GPIO, EBU, TDM, PCI), 983 + MFP_XWAY(GPIO25, GPIO, TDM, SDIO, USIF), 984 + MFP_XWAY(GPIO26, GPIO, EBU, TDM, SDIO), 985 + MFP_XWAY(GPIO27, GPIO, TDM, SDIO, USIF), 986 + MFP_XWAY(GPIO28, GPIO, GPT, PCI, SDIO), 987 + MFP_XWAY(GPIO29, GPIO, PCI, CBUS, EXIN), 988 + MFP_XWAY(GPIO30, GPIO, PCI, CBUS, NONE), 989 + MFP_XWAY(GPIO31, GPIO, EBU, PCI, NONE), 990 + MFP_XWAY(GPIO32, GPIO, MII, NONE, EBU), 991 + MFP_XWAY(GPIO33, GPIO, MII, NONE, EBU), 992 + MFP_XWAY(GPIO34, GPIO, SIN, SSI, NONE), 993 + MFP_XWAY(GPIO35, GPIO, SIN, SSI, NONE), 994 + MFP_XWAY(GPIO36, GPIO, SIN, SSI, EXIN), 995 + MFP_XWAY(GPIO37, GPIO, USIF, NONE, PCI), 996 + MFP_XWAY(GPIO38, GPIO, PCI, USIF, NONE), 997 + MFP_XWAY(GPIO39, GPIO, USIF, EXIN, NONE), 998 + MFP_XWAY(GPIO40, GPIO, MII, TDM, NONE), 999 + MFP_XWAY(GPIO41, GPIO, MII, TDM, NONE), 1000 + MFP_XWAY(GPIO42, GPIO, MDIO, NONE, NONE), 1001 + MFP_XWAY(GPIO43, GPIO, MDIO, NONE, NONE), 1002 + MFP_XWAY(GPIO44, GPIO, MII, SIN, GPHY), 1003 + MFP_XWAY(GPIO45, GPIO, MII, GPHY, SIN), 1004 + MFP_XWAY(GPIO46, GPIO, MII, NONE, EXIN), 1005 + MFP_XWAY(GPIO47, GPIO, MII, GPHY, SIN), 1006 + MFP_XWAY(GPIO48, GPIO, EBU, NONE, NONE), 1007 + MFP_XWAY(GPIO49, GPIO, EBU, NONE, NONE), 1008 + }; 1009 + 1010 + static const unsigned xrx200_exin_pin_map[] = {GPIO0, GPIO1, GPIO2, GPIO39, GPIO10, GPIO9}; 1011 + 1012 + static const unsigned xrx200_pins_exin0[] = {GPIO0}; 1013 + static const unsigned xrx200_pins_exin1[] = {GPIO1}; 1014 + static const unsigned xrx200_pins_exin2[] = {GPIO2}; 1015 + static const unsigned xrx200_pins_exin3[] = {GPIO39}; 1016 + static const unsigned xrx200_pins_exin4[] = {GPIO10}; 1017 + static const unsigned xrx200_pins_exin5[] = {GPIO9}; 1018 + 1019 + static const unsigned xrx200_pins_usif_uart_rx[] = {GPIO11}; 1020 + static const unsigned xrx200_pins_usif_uart_tx[] = {GPIO12}; 1021 + static const unsigned xrx200_pins_usif_uart_rts[] = {GPIO9}; 1022 + static const unsigned xrx200_pins_usif_uart_cts[] = {GPIO10}; 1023 + static const unsigned xrx200_pins_usif_uart_dtr[] = {GPIO4}; 1024 + static const unsigned xrx200_pins_usif_uart_dsr[] = {GPIO6}; 1025 + static const unsigned xrx200_pins_usif_uart_dcd[] = {GPIO25}; 1026 + static const unsigned xrx200_pins_usif_uart_ri[] = {GPIO27}; 1027 + 1028 + static const unsigned xrx200_pins_usif_spi_di[] = {GPIO11}; 1029 + static const unsigned xrx200_pins_usif_spi_do[] = {GPIO12}; 1030 + static const unsigned xrx200_pins_usif_spi_clk[] = {GPIO38}; 1031 + static const unsigned xrx200_pins_usif_spi_cs0[] = {GPIO37}; 1032 + static const unsigned xrx200_pins_usif_spi_cs1[] = {GPIO39}; 1033 + static const unsigned xrx200_pins_usif_spi_cs2[] = {GPIO14}; 1034 + 1035 + static const unsigned xrx200_pins_stp[] = {GPIO4, GPIO5, GPIO6}; 1036 + static const unsigned xrx200_pins_nmi[] = {GPIO8}; 1037 + static const unsigned xrx200_pins_mdio[] = {GPIO42, GPIO43}; 1038 + 1039 + static const unsigned xrx200_pins_dfe_led0[] = {GPIO4}; 1040 + static const unsigned xrx200_pins_dfe_led1[] = {GPIO5}; 1041 + 1042 + static const unsigned xrx200_pins_gphy0_led0[] = {GPIO5}; 1043 + static const unsigned xrx200_pins_gphy0_led1[] = {GPIO7}; 1044 + static const unsigned xrx200_pins_gphy0_led2[] = {GPIO2}; 1045 + static const unsigned xrx200_pins_gphy1_led0[] = {GPIO44}; 1046 + static const unsigned xrx200_pins_gphy1_led1[] = {GPIO45}; 1047 + static const unsigned xrx200_pins_gphy1_led2[] = {GPIO47}; 1048 + 1049 + static const unsigned xrx200_pins_ebu_a24[] = {GPIO13}; 1050 + static const unsigned xrx200_pins_ebu_clk[] = {GPIO21}; 1051 + static const unsigned xrx200_pins_ebu_cs1[] = {GPIO23}; 1052 + static const unsigned xrx200_pins_ebu_a23[] = {GPIO24}; 1053 + static const unsigned xrx200_pins_ebu_wait[] = {GPIO26}; 1054 + static const unsigned xrx200_pins_ebu_a25[] = {GPIO31}; 1055 + 1056 + static const unsigned xrx200_pins_nand_ale[] = {GPIO13}; 1057 + static const unsigned xrx200_pins_nand_cs1[] = {GPIO23}; 1058 + static const unsigned xrx200_pins_nand_cle[] = {GPIO24}; 1059 + static const unsigned xrx200_pins_nand_rdy[] = {GPIO48}; 1060 + static const unsigned xrx200_pins_nand_rd[] = {GPIO49}; 1061 + 1062 + static const unsigned xrx200_pins_spi_di[] = {GPIO16}; 1063 + static const unsigned xrx200_pins_spi_do[] = {GPIO17}; 1064 + static const unsigned xrx200_pins_spi_clk[] = {GPIO18}; 1065 + static const unsigned xrx200_pins_spi_cs1[] = {GPIO15}; 1066 + static const unsigned xrx200_pins_spi_cs2[] = {GPIO22}; 1067 + static const unsigned xrx200_pins_spi_cs3[] = {GPIO13}; 1068 + static const unsigned xrx200_pins_spi_cs4[] = {GPIO10}; 1069 + static const unsigned xrx200_pins_spi_cs5[] = {GPIO9}; 1070 + static const unsigned xrx200_pins_spi_cs6[] = {GPIO11}; 1071 + 1072 + static const unsigned xrx200_pins_gpt1[] = {GPIO28}; 1073 + static const unsigned xrx200_pins_gpt2[] = {GPIO21}; 1074 + static const unsigned xrx200_pins_gpt3[] = {GPIO6}; 1075 + 1076 + static const unsigned xrx200_pins_clkout0[] = {GPIO8}; 1077 + static const unsigned xrx200_pins_clkout1[] = {GPIO7}; 1078 + static const unsigned xrx200_pins_clkout2[] = {GPIO3}; 1079 + static const unsigned xrx200_pins_clkout3[] = {GPIO2}; 1080 + 1081 + static const unsigned xrx200_pins_pci_gnt1[] = {GPIO28}; 1082 + static const unsigned xrx200_pins_pci_gnt2[] = {GPIO23}; 1083 + static const unsigned xrx200_pins_pci_gnt3[] = {GPIO19}; 1084 + static const unsigned xrx200_pins_pci_gnt4[] = {GPIO38}; 1085 + static const unsigned xrx200_pins_pci_req1[] = {GPIO29}; 1086 + static const unsigned xrx200_pins_pci_req2[] = {GPIO31}; 1087 + static const unsigned xrx200_pins_pci_req3[] = {GPIO3}; 1088 + static const unsigned xrx200_pins_pci_req4[] = {GPIO37}; 1089 + 1090 + static const struct ltq_pin_group xrx200_grps[] = { 1091 + GRP_MUX("exin0", EXIN, xrx200_pins_exin0), 1092 + GRP_MUX("exin1", EXIN, xrx200_pins_exin1), 1093 + GRP_MUX("exin2", EXIN, xrx200_pins_exin2), 1094 + GRP_MUX("exin3", EXIN, xrx200_pins_exin3), 1095 + GRP_MUX("exin4", EXIN, xrx200_pins_exin4), 1096 + GRP_MUX("exin5", EXIN, xrx200_pins_exin5), 1097 + GRP_MUX("ebu a23", EBU, xrx200_pins_ebu_a23), 1098 + GRP_MUX("ebu a24", EBU, xrx200_pins_ebu_a24), 1099 + GRP_MUX("ebu a25", EBU, xrx200_pins_ebu_a25), 1100 + GRP_MUX("ebu clk", EBU, xrx200_pins_ebu_clk), 1101 + GRP_MUX("ebu cs1", EBU, xrx200_pins_ebu_cs1), 1102 + GRP_MUX("ebu wait", EBU, xrx200_pins_ebu_wait), 1103 + GRP_MUX("nand ale", EBU, xrx200_pins_nand_ale), 1104 + GRP_MUX("nand cs1", EBU, xrx200_pins_nand_cs1), 1105 + GRP_MUX("nand cle", EBU, xrx200_pins_nand_cle), 1106 + GRP_MUX("nand rdy", EBU, xrx200_pins_nand_rdy), 1107 + GRP_MUX("nand rd", EBU, xrx200_pins_nand_rd), 1108 + GRP_MUX("spi_di", SPI, xrx200_pins_spi_di), 1109 + GRP_MUX("spi_do", SPI, xrx200_pins_spi_do), 1110 + GRP_MUX("spi_clk", SPI, xrx200_pins_spi_clk), 1111 + GRP_MUX("spi_cs1", SPI, xrx200_pins_spi_cs1), 1112 + GRP_MUX("spi_cs2", SPI, xrx200_pins_spi_cs2), 1113 + GRP_MUX("spi_cs3", SPI, xrx200_pins_spi_cs3), 1114 + GRP_MUX("spi_cs4", SPI, xrx200_pins_spi_cs4), 1115 + GRP_MUX("spi_cs5", SPI, xrx200_pins_spi_cs5), 1116 + GRP_MUX("spi_cs6", SPI, xrx200_pins_spi_cs6), 1117 + GRP_MUX("usif uart_rx", USIF, xrx200_pins_usif_uart_rx), 1118 + GRP_MUX("usif uart_rx", USIF, xrx200_pins_usif_uart_tx), 1119 + GRP_MUX("usif uart_rts", USIF, xrx200_pins_usif_uart_rts), 1120 + GRP_MUX("usif uart_cts", USIF, xrx200_pins_usif_uart_cts), 1121 + GRP_MUX("usif uart_dtr", USIF, xrx200_pins_usif_uart_dtr), 1122 + GRP_MUX("usif uart_dsr", USIF, xrx200_pins_usif_uart_dsr), 1123 + GRP_MUX("usif uart_dcd", USIF, xrx200_pins_usif_uart_dcd), 1124 + GRP_MUX("usif uart_ri", USIF, xrx200_pins_usif_uart_ri), 1125 + GRP_MUX("usif spi_di", USIF, xrx200_pins_usif_spi_di), 1126 + GRP_MUX("usif spi_do", USIF, xrx200_pins_usif_spi_do), 1127 + GRP_MUX("usif spi_clk", USIF, xrx200_pins_usif_spi_clk), 1128 + GRP_MUX("usif spi_cs0", USIF, xrx200_pins_usif_spi_cs0), 1129 + GRP_MUX("usif spi_cs1", USIF, xrx200_pins_usif_spi_cs1), 1130 + GRP_MUX("usif spi_cs2", USIF, xrx200_pins_usif_spi_cs2), 1131 + GRP_MUX("stp", STP, xrx200_pins_stp), 1132 + GRP_MUX("nmi", NMI, xrx200_pins_nmi), 1133 + GRP_MUX("gpt1", GPT, xrx200_pins_gpt1), 1134 + GRP_MUX("gpt2", GPT, xrx200_pins_gpt2), 1135 + GRP_MUX("gpt3", GPT, xrx200_pins_gpt3), 1136 + GRP_MUX("clkout0", CGU, xrx200_pins_clkout0), 1137 + GRP_MUX("clkout1", CGU, xrx200_pins_clkout1), 1138 + GRP_MUX("clkout2", CGU, xrx200_pins_clkout2), 1139 + GRP_MUX("clkout3", CGU, xrx200_pins_clkout3), 1140 + GRP_MUX("gnt1", PCI, xrx200_pins_pci_gnt1), 1141 + GRP_MUX("gnt2", PCI, xrx200_pins_pci_gnt2), 1142 + GRP_MUX("gnt3", PCI, xrx200_pins_pci_gnt3), 1143 + GRP_MUX("gnt4", PCI, xrx200_pins_pci_gnt4), 1144 + GRP_MUX("req1", PCI, xrx200_pins_pci_req1), 1145 + GRP_MUX("req2", PCI, xrx200_pins_pci_req2), 1146 + GRP_MUX("req3", PCI, xrx200_pins_pci_req3), 1147 + GRP_MUX("req4", PCI, xrx200_pins_pci_req4), 1148 + GRP_MUX("mdio", MDIO, xrx200_pins_mdio), 1149 + GRP_MUX("dfe led0", DFE, xrx200_pins_dfe_led0), 1150 + GRP_MUX("dfe led1", DFE, xrx200_pins_dfe_led1), 1151 + GRP_MUX("gphy0 led0", GPHY, xrx200_pins_gphy0_led0), 1152 + GRP_MUX("gphy0 led1", GPHY, xrx200_pins_gphy0_led1), 1153 + GRP_MUX("gphy0 led2", GPHY, xrx200_pins_gphy0_led2), 1154 + GRP_MUX("gphy1 led0", GPHY, xrx200_pins_gphy1_led0), 1155 + GRP_MUX("gphy1 led1", GPHY, xrx200_pins_gphy1_led1), 1156 + GRP_MUX("gphy1 led2", GPHY, xrx200_pins_gphy1_led2), 1157 + }; 1158 + 1159 + static const char * const xrx200_pci_grps[] = {"gnt1", "gnt2", 1160 + "gnt3", "gnt4", 1161 + "req1", "req2", 1162 + "req3", "req4"}; 1163 + static const char * const xrx200_spi_grps[] = {"spi_di", "spi_do", 1164 + "spi_clk", "spi_cs1", 1165 + "spi_cs2", "spi_cs3", 1166 + "spi_cs4", "spi_cs5", 1167 + "spi_cs6"}; 1168 + static const char * const xrx200_cgu_grps[] = {"clkout0", "clkout1", 1169 + "clkout2", "clkout3"}; 1170 + static const char * const xrx200_ebu_grps[] = {"ebu a23", "ebu a24", 1171 + "ebu a25", "ebu cs1", 1172 + "ebu wait", "ebu clk", 1173 + "nand ale", "nand cs1", 1174 + "nand cle", "nand rdy", 1175 + "nand rd"}; 1176 + static const char * const xrx200_exin_grps[] = {"exin0", "exin1", "exin2", 1177 + "exin3", "exin4", "exin5"}; 1178 + static const char * const xrx200_gpt_grps[] = {"gpt1", "gpt2", "gpt3"}; 1179 + static const char * const xrx200_usif_grps[] = {"usif uart_rx", "usif uart_tx", 1180 + "usif uart_rts", "usif uart_cts", 1181 + "usif uart_dtr", "usif uart_dsr", 1182 + "usif uart_dcd", "usif uart_ri", 1183 + "usif spi_di", "usif spi_do", 1184 + "usif spi_clk", "usif spi_cs0", 1185 + "usif spi_cs1", "usif spi_cs2"}; 1186 + static const char * const xrx200_stp_grps[] = {"stp"}; 1187 + static const char * const xrx200_nmi_grps[] = {"nmi"}; 1188 + static const char * const xrx200_mdio_grps[] = {"mdio"}; 1189 + static const char * const xrx200_dfe_grps[] = {"dfe led0", "dfe led1"}; 1190 + static const char * const xrx200_gphy_grps[] = {"gphy0 led0", "gphy0 led1", 1191 + "gphy0 led2", "gphy1 led0", 1192 + "gphy1 led1", "gphy1 led2"}; 1193 + 1194 + static const struct ltq_pmx_func xrx200_funcs[] = { 1195 + {"spi", ARRAY_AND_SIZE(xrx200_spi_grps)}, 1196 + {"usif", ARRAY_AND_SIZE(xrx200_usif_grps)}, 1197 + {"cgu", ARRAY_AND_SIZE(xrx200_cgu_grps)}, 1198 + {"exin", ARRAY_AND_SIZE(xrx200_exin_grps)}, 1199 + {"stp", ARRAY_AND_SIZE(xrx200_stp_grps)}, 1200 + {"gpt", ARRAY_AND_SIZE(xrx200_gpt_grps)}, 1201 + {"nmi", ARRAY_AND_SIZE(xrx200_nmi_grps)}, 1202 + {"pci", ARRAY_AND_SIZE(xrx200_pci_grps)}, 1203 + {"ebu", ARRAY_AND_SIZE(xrx200_ebu_grps)}, 1204 + {"mdio", ARRAY_AND_SIZE(xrx200_mdio_grps)}, 1205 + {"dfe", ARRAY_AND_SIZE(xrx200_dfe_grps)}, 1206 + {"gphy", ARRAY_AND_SIZE(xrx200_gphy_grps)}, 1207 + }; 1208 + 1209 + /* --------- xrx300 related code --------- */ 1210 + #define XRX300_MAX_PIN 64 1211 + 1212 + static const struct ltq_mfp_pin xrx300_mfp[] = { 1213 + /* pin f0 f1 f2 f3 */ 1214 + MFP_XWAY(GPIO0, GPIO, EXIN, EPHY, NONE), 1215 + MFP_XWAY(GPIO1, GPIO, NONE, EXIN, NONE), 1216 + MFP_XWAY(GPIO2, NONE, NONE, NONE, NONE), 1217 + MFP_XWAY(GPIO3, GPIO, CGU, NONE, NONE), 1218 + MFP_XWAY(GPIO4, GPIO, STP, DFE, NONE), 1219 + MFP_XWAY(GPIO5, GPIO, STP, EPHY, DFE), 1220 + MFP_XWAY(GPIO6, GPIO, STP, NONE, NONE), 1221 + MFP_XWAY(GPIO7, NONE, NONE, NONE, NONE), 1222 + MFP_XWAY(GPIO8, GPIO, CGU, GPHY, EPHY), 1223 + MFP_XWAY(GPIO9, GPIO, WIFI, NONE, EXIN), 1224 + MFP_XWAY(GPIO10, GPIO, USIF, SPI, EXIN), 1225 + MFP_XWAY(GPIO11, GPIO, USIF, WIFI, SPI), 1226 + MFP_XWAY(GPIO12, NONE, NONE, NONE, NONE), 1227 + MFP_XWAY(GPIO13, GPIO, EBU, NONE, NONE), 1228 + MFP_XWAY(GPIO14, GPIO, CGU, USIF, EPHY), 1229 + MFP_XWAY(GPIO15, GPIO, SPI, NONE, MCD), 1230 + MFP_XWAY(GPIO16, GPIO, SPI, EXIN, NONE), 1231 + MFP_XWAY(GPIO17, GPIO, SPI, NONE, NONE), 1232 + MFP_XWAY(GPIO18, GPIO, SPI, NONE, NONE), 1233 + MFP_XWAY(GPIO19, GPIO, USIF, NONE, EPHY), 1234 + MFP_XWAY(GPIO20, NONE, NONE, NONE, NONE), 1235 + MFP_XWAY(GPIO21, NONE, NONE, NONE, NONE), 1236 + MFP_XWAY(GPIO22, NONE, NONE, NONE, NONE), 1237 + MFP_XWAY(GPIO23, GPIO, EBU, NONE, NONE), 1238 + MFP_XWAY(GPIO24, GPIO, EBU, NONE, NONE), 1239 + MFP_XWAY(GPIO25, GPIO, TDM, NONE, NONE), 1240 + MFP_XWAY(GPIO26, GPIO, TDM, NONE, NONE), 1241 + MFP_XWAY(GPIO27, GPIO, TDM, NONE, NONE), 1242 + MFP_XWAY(GPIO28, NONE, NONE, NONE, NONE), 1243 + MFP_XWAY(GPIO29, NONE, NONE, NONE, NONE), 1244 + MFP_XWAY(GPIO30, NONE, NONE, NONE, NONE), 1245 + MFP_XWAY(GPIO31, NONE, NONE, NONE, NONE), 1246 + MFP_XWAY(GPIO32, NONE, NONE, NONE, NONE), 1247 + MFP_XWAY(GPIO33, NONE, NONE, NONE, NONE), 1248 + MFP_XWAY(GPIO34, GPIO, NONE, SSI, NONE), 1249 + MFP_XWAY(GPIO35, GPIO, NONE, SSI, NONE), 1250 + MFP_XWAY(GPIO36, GPIO, NONE, SSI, NONE), 1251 + MFP_XWAY(GPIO37, NONE, NONE, NONE, NONE), 1252 + MFP_XWAY(GPIO38, NONE, NONE, NONE, NONE), 1253 + MFP_XWAY(GPIO39, NONE, NONE, NONE, NONE), 1254 + MFP_XWAY(GPIO40, NONE, NONE, NONE, NONE), 1255 + MFP_XWAY(GPIO41, NONE, NONE, NONE, NONE), 1256 + MFP_XWAY(GPIO42, GPIO, MDIO, NONE, NONE), 1257 + MFP_XWAY(GPIO43, GPIO, MDIO, NONE, NONE), 1258 + MFP_XWAY(GPIO44, NONE, NONE, NONE, NONE), 1259 + MFP_XWAY(GPIO45, NONE, NONE, NONE, NONE), 1260 + MFP_XWAY(GPIO46, NONE, NONE, NONE, NONE), 1261 + MFP_XWAY(GPIO47, NONE, NONE, NONE, NONE), 1262 + MFP_XWAY(GPIO48, GPIO, EBU, NONE, NONE), 1263 + MFP_XWAY(GPIO49, GPIO, EBU, NONE, NONE), 1264 + MFP_XWAY(GPIO50, GPIO, EBU, NONE, NONE), 1265 + MFP_XWAY(GPIO51, GPIO, EBU, NONE, NONE), 1266 + MFP_XWAY(GPIO52, GPIO, EBU, NONE, NONE), 1267 + MFP_XWAY(GPIO53, GPIO, EBU, NONE, NONE), 1268 + MFP_XWAY(GPIO54, GPIO, EBU, NONE, NONE), 1269 + MFP_XWAY(GPIO55, GPIO, EBU, NONE, NONE), 1270 + MFP_XWAY(GPIO56, GPIO, EBU, NONE, NONE), 1271 + MFP_XWAY(GPIO57, GPIO, EBU, NONE, NONE), 1272 + MFP_XWAY(GPIO58, GPIO, EBU, TDM, NONE), 1273 + MFP_XWAY(GPIO59, GPIO, EBU, NONE, NONE), 1274 + MFP_XWAY(GPIO60, GPIO, EBU, NONE, NONE), 1275 + MFP_XWAY(GPIO61, GPIO, EBU, NONE, NONE), 1276 + MFP_XWAY(GPIO62, NONE, NONE, NONE, NONE), 1277 + MFP_XWAY(GPIO63, NONE, NONE, NONE, NONE), 1278 + }; 1279 + 1280 + static const unsigned xrx300_exin_pin_map[] = {GPIO0, GPIO1, GPIO16, GPIO10, GPIO9}; 1281 + 1282 + static const unsigned xrx300_pins_exin0[] = {GPIO0}; 1283 + static const unsigned xrx300_pins_exin1[] = {GPIO1}; 1284 + static const unsigned xrx300_pins_exin2[] = {GPIO16}; 1285 + /* EXIN3 is not available on xrX300 */ 1286 + static const unsigned xrx300_pins_exin4[] = {GPIO10}; 1287 + static const unsigned xrx300_pins_exin5[] = {GPIO9}; 1288 + 1289 + static const unsigned xrx300_pins_usif_uart_rx[] = {GPIO11}; 1290 + static const unsigned xrx300_pins_usif_uart_tx[] = {GPIO10}; 1291 + 1292 + static const unsigned xrx300_pins_usif_spi_di[] = {GPIO11}; 1293 + static const unsigned xrx300_pins_usif_spi_do[] = {GPIO10}; 1294 + static const unsigned xrx300_pins_usif_spi_clk[] = {GPIO19}; 1295 + static const unsigned xrx300_pins_usif_spi_cs0[] = {GPIO14}; 1296 + 1297 + static const unsigned xrx300_pins_stp[] = {GPIO4, GPIO5, GPIO6}; 1298 + static const unsigned xrx300_pins_mdio[] = {GPIO42, GPIO43}; 1299 + 1300 + static const unsigned xrx300_pins_dfe_led0[] = {GPIO4}; 1301 + static const unsigned xrx300_pins_dfe_led1[] = {GPIO5}; 1302 + 1303 + static const unsigned xrx300_pins_ephy0_led0[] = {GPIO5}; 1304 + static const unsigned xrx300_pins_ephy0_led1[] = {GPIO8}; 1305 + static const unsigned xrx300_pins_ephy1_led0[] = {GPIO14}; 1306 + static const unsigned xrx300_pins_ephy1_led1[] = {GPIO19}; 1307 + 1308 + static const unsigned xrx300_pins_nand_ale[] = {GPIO13}; 1309 + static const unsigned xrx300_pins_nand_cs1[] = {GPIO23}; 1310 + static const unsigned xrx300_pins_nand_cle[] = {GPIO24}; 1311 + static const unsigned xrx300_pins_nand_rdy[] = {GPIO48}; 1312 + static const unsigned xrx300_pins_nand_rd[] = {GPIO49}; 1313 + static const unsigned xrx300_pins_nand_d1[] = {GPIO50}; 1314 + static const unsigned xrx300_pins_nand_d0[] = {GPIO51}; 1315 + static const unsigned xrx300_pins_nand_d2[] = {GPIO52}; 1316 + static const unsigned xrx300_pins_nand_d7[] = {GPIO53}; 1317 + static const unsigned xrx300_pins_nand_d6[] = {GPIO54}; 1318 + static const unsigned xrx300_pins_nand_d5[] = {GPIO55}; 1319 + static const unsigned xrx300_pins_nand_d4[] = {GPIO56}; 1320 + static const unsigned xrx300_pins_nand_d3[] = {GPIO57}; 1321 + static const unsigned xrx300_pins_nand_cs0[] = {GPIO58}; 1322 + static const unsigned xrx300_pins_nand_wr[] = {GPIO59}; 1323 + static const unsigned xrx300_pins_nand_wp[] = {GPIO60}; 1324 + static const unsigned xrx300_pins_nand_se[] = {GPIO61}; 1325 + 1326 + static const unsigned xrx300_pins_spi_di[] = {GPIO16}; 1327 + static const unsigned xrx300_pins_spi_do[] = {GPIO17}; 1328 + static const unsigned xrx300_pins_spi_clk[] = {GPIO18}; 1329 + static const unsigned xrx300_pins_spi_cs1[] = {GPIO15}; 1330 + /* SPI_CS2 is not available on xrX300 */ 1331 + /* SPI_CS3 is not available on xrX300 */ 1332 + static const unsigned xrx300_pins_spi_cs4[] = {GPIO10}; 1333 + /* SPI_CS5 is not available on xrX300 */ 1334 + static const unsigned xrx300_pins_spi_cs6[] = {GPIO11}; 1335 + 1336 + /* CLKOUT0 is not available on xrX300 */ 1337 + /* CLKOUT1 is not available on xrX300 */ 1338 + static const unsigned xrx300_pins_clkout2[] = {GPIO3}; 1339 + 1340 + static const struct ltq_pin_group xrx300_grps[] = { 1341 + GRP_MUX("exin0", EXIN, xrx300_pins_exin0), 1342 + GRP_MUX("exin1", EXIN, xrx300_pins_exin1), 1343 + GRP_MUX("exin2", EXIN, xrx300_pins_exin2), 1344 + GRP_MUX("exin4", EXIN, xrx300_pins_exin4), 1345 + GRP_MUX("exin5", EXIN, xrx300_pins_exin5), 1346 + GRP_MUX("nand ale", EBU, xrx300_pins_nand_ale), 1347 + GRP_MUX("nand cs1", EBU, xrx300_pins_nand_cs1), 1348 + GRP_MUX("nand cle", EBU, xrx300_pins_nand_cle), 1349 + GRP_MUX("nand rdy", EBU, xrx300_pins_nand_rdy), 1350 + GRP_MUX("nand rd", EBU, xrx300_pins_nand_rd), 1351 + GRP_MUX("nand d1", EBU, xrx300_pins_nand_d1), 1352 + GRP_MUX("nand d0", EBU, xrx300_pins_nand_d0), 1353 + GRP_MUX("nand d2", EBU, xrx300_pins_nand_d2), 1354 + GRP_MUX("nand d7", EBU, xrx300_pins_nand_d7), 1355 + GRP_MUX("nand d6", EBU, xrx300_pins_nand_d6), 1356 + GRP_MUX("nand d5", EBU, xrx300_pins_nand_d5), 1357 + GRP_MUX("nand d4", EBU, xrx300_pins_nand_d4), 1358 + GRP_MUX("nand d3", EBU, xrx300_pins_nand_d3), 1359 + GRP_MUX("nand cs0", EBU, xrx300_pins_nand_cs0), 1360 + GRP_MUX("nand wr", EBU, xrx300_pins_nand_wr), 1361 + GRP_MUX("nand wp", EBU, xrx300_pins_nand_wp), 1362 + GRP_MUX("nand se", EBU, xrx300_pins_nand_se), 1363 + GRP_MUX("spi_di", SPI, xrx300_pins_spi_di), 1364 + GRP_MUX("spi_do", SPI, xrx300_pins_spi_do), 1365 + GRP_MUX("spi_clk", SPI, xrx300_pins_spi_clk), 1366 + GRP_MUX("spi_cs1", SPI, xrx300_pins_spi_cs1), 1367 + GRP_MUX("spi_cs4", SPI, xrx300_pins_spi_cs4), 1368 + GRP_MUX("spi_cs6", SPI, xrx300_pins_spi_cs6), 1369 + GRP_MUX("usif uart_rx", USIF, xrx300_pins_usif_uart_rx), 1370 + GRP_MUX("usif uart_tx", USIF, xrx300_pins_usif_uart_tx), 1371 + GRP_MUX("usif spi_di", USIF, xrx300_pins_usif_spi_di), 1372 + GRP_MUX("usif spi_do", USIF, xrx300_pins_usif_spi_do), 1373 + GRP_MUX("usif spi_clk", USIF, xrx300_pins_usif_spi_clk), 1374 + GRP_MUX("usif spi_cs0", USIF, xrx300_pins_usif_spi_cs0), 1375 + GRP_MUX("stp", STP, xrx300_pins_stp), 1376 + GRP_MUX("clkout2", CGU, xrx300_pins_clkout2), 1377 + GRP_MUX("mdio", MDIO, xrx300_pins_mdio), 1378 + GRP_MUX("dfe led0", DFE, xrx300_pins_dfe_led0), 1379 + GRP_MUX("dfe led1", DFE, xrx300_pins_dfe_led1), 1380 + GRP_MUX("ephy0 led0", GPHY, xrx300_pins_ephy0_led0), 1381 + GRP_MUX("ephy0 led1", GPHY, xrx300_pins_ephy0_led1), 1382 + GRP_MUX("ephy1 led0", GPHY, xrx300_pins_ephy1_led0), 1383 + GRP_MUX("ephy1 led1", GPHY, xrx300_pins_ephy1_led1), 1384 + }; 1385 + 1386 + static const char * const xrx300_spi_grps[] = {"spi_di", "spi_do", 1387 + "spi_clk", "spi_cs1", 1388 + "spi_cs4", "spi_cs6"}; 1389 + static const char * const xrx300_cgu_grps[] = {"clkout2"}; 1390 + static const char * const xrx300_ebu_grps[] = {"nand ale", "nand cs1", 1391 + "nand cle", "nand rdy", 1392 + "nand rd", "nand d1", 1393 + "nand d0", "nand d2", 1394 + "nand d7", "nand d6", 1395 + "nand d5", "nand d4", 1396 + "nand d3", "nand cs0", 1397 + "nand wr", "nand wp", 1398 + "nand se"}; 1399 + static const char * const xrx300_exin_grps[] = {"exin0", "exin1", "exin2", 1400 + "exin4", "exin5"}; 1401 + static const char * const xrx300_usif_grps[] = {"usif uart_rx", "usif uart_tx", 1402 + "usif spi_di", "usif spi_do", 1403 + "usif spi_clk", "usif spi_cs0"}; 1404 + static const char * const xrx300_stp_grps[] = {"stp"}; 1405 + static const char * const xrx300_mdio_grps[] = {"mdio"}; 1406 + static const char * const xrx300_dfe_grps[] = {"dfe led0", "dfe led1"}; 1407 + static const char * const xrx300_gphy_grps[] = {"ephy0 led0", "ephy0 led1", 1408 + "ephy1 led0", "ephy1 led1"}; 1409 + 1410 + static const struct ltq_pmx_func xrx300_funcs[] = { 1411 + {"spi", ARRAY_AND_SIZE(xrx300_spi_grps)}, 1412 + {"usif", ARRAY_AND_SIZE(xrx300_usif_grps)}, 1413 + {"cgu", ARRAY_AND_SIZE(xrx300_cgu_grps)}, 1414 + {"exin", ARRAY_AND_SIZE(xrx300_exin_grps)}, 1415 + {"stp", ARRAY_AND_SIZE(xrx300_stp_grps)}, 1416 + {"ebu", ARRAY_AND_SIZE(xrx300_ebu_grps)}, 1417 + {"mdio", ARRAY_AND_SIZE(xrx300_mdio_grps)}, 1418 + {"dfe", ARRAY_AND_SIZE(xrx300_dfe_grps)}, 1419 + {"ephy", ARRAY_AND_SIZE(xrx300_gphy_grps)}, 359 1420 }; 360 1421 361 1422 /* --------- pinconf related code --------- */ ··· 1563 676 { 1564 677 struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); 1565 678 679 + if (PORT(pin) == PORT3) 680 + gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin)); 681 + else 682 + gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin)); 1566 683 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); 1567 684 xway_gpio_set(chip, pin, val); 1568 685 ··· 1586 695 1587 696 1588 697 /* --------- register the pinctrl layer --------- */ 1589 - static const unsigned xway_exin_pin_map[] = {GPIO0, GPIO1, GPIO2, GPIO39, GPIO46, GPIO9}; 1590 - static const unsigned ase_exin_pins_map[] = {GPIO6, GPIO29, GPIO0}; 1591 - 1592 - static struct pinctrl_xway_soc { 698 + struct pinctrl_xway_soc { 1593 699 int pin_count; 1594 700 const struct ltq_mfp_pin *mfp; 1595 701 const struct ltq_pin_group *grps; ··· 1595 707 unsigned int num_funcs; 1596 708 const unsigned *exin; 1597 709 unsigned int num_exin; 1598 - } soc_cfg[] = { 1599 - /* legacy xway */ 1600 - {XWAY_MAX_PIN, xway_mfp, 1601 - xway_grps, ARRAY_SIZE(xway_grps), 1602 - danube_funcs, ARRAY_SIZE(danube_funcs), 1603 - xway_exin_pin_map, 3}, 1604 - /* xway xr9 series */ 1605 - {XR9_MAX_PIN, xway_mfp, 1606 - xway_grps, ARRAY_SIZE(xway_grps), 1607 - xrx_funcs, ARRAY_SIZE(xrx_funcs), 1608 - xway_exin_pin_map, 6}, 1609 - /* xway ase series */ 1610 - {XWAY_MAX_PIN, ase_mfp, 1611 - ase_grps, ARRAY_SIZE(ase_grps), 1612 - ase_funcs, ARRAY_SIZE(ase_funcs), 1613 - ase_exin_pins_map, 3}, 710 + }; 711 + 712 + /* xway xr9 series (DEPRECATED: Use XWAY xRX100/xRX200 Family) */ 713 + static struct pinctrl_xway_soc xr9_pinctrl = { 714 + XR9_MAX_PIN, xway_mfp, 715 + xway_grps, ARRAY_SIZE(xway_grps), 716 + xrx_funcs, ARRAY_SIZE(xrx_funcs), 717 + xway_exin_pin_map, 6 718 + }; 719 + 720 + /* XWAY AMAZON Family */ 721 + static struct pinctrl_xway_soc ase_pinctrl = { 722 + ASE_MAX_PIN, ase_mfp, 723 + ase_grps, ARRAY_SIZE(ase_grps), 724 + ase_funcs, ARRAY_SIZE(ase_funcs), 725 + ase_exin_pin_map, 3 726 + }; 727 + 728 + /* XWAY DANUBE Family */ 729 + static struct pinctrl_xway_soc danube_pinctrl = { 730 + DANUBE_MAX_PIN, danube_mfp, 731 + danube_grps, ARRAY_SIZE(danube_grps), 732 + danube_funcs, ARRAY_SIZE(danube_funcs), 733 + danube_exin_pin_map, 3 734 + }; 735 + 736 + /* XWAY xRX100 Family */ 737 + static struct pinctrl_xway_soc xrx100_pinctrl = { 738 + XRX100_MAX_PIN, xrx100_mfp, 739 + xrx100_grps, ARRAY_SIZE(xrx100_grps), 740 + xrx100_funcs, ARRAY_SIZE(xrx100_funcs), 741 + xrx100_exin_pin_map, 6 742 + }; 743 + 744 + /* XWAY xRX200 Family */ 745 + static struct pinctrl_xway_soc xrx200_pinctrl = { 746 + XRX200_MAX_PIN, xrx200_mfp, 747 + xrx200_grps, ARRAY_SIZE(xrx200_grps), 748 + xrx200_funcs, ARRAY_SIZE(xrx200_funcs), 749 + xrx200_exin_pin_map, 6 750 + }; 751 + 752 + /* XWAY xRX300 Family */ 753 + static struct pinctrl_xway_soc xrx300_pinctrl = { 754 + XRX300_MAX_PIN, xrx300_mfp, 755 + xrx300_grps, ARRAY_SIZE(xrx300_grps), 756 + xrx300_funcs, ARRAY_SIZE(xrx300_funcs), 757 + xrx300_exin_pin_map, 5 1614 758 }; 1615 759 1616 760 static struct pinctrl_gpio_range xway_gpio_range = { ··· 1651 731 }; 1652 732 1653 733 static const struct of_device_id xway_match[] = { 1654 - { .compatible = "lantiq,pinctrl-xway", .data = &soc_cfg[0]}, 1655 - { .compatible = "lantiq,pinctrl-xr9", .data = &soc_cfg[1]}, 1656 - { .compatible = "lantiq,pinctrl-ase", .data = &soc_cfg[2]}, 734 + { .compatible = "lantiq,pinctrl-xway", .data = &danube_pinctrl}, /*DEPRECATED*/ 735 + { .compatible = "lantiq,pinctrl-xr9", .data = &xr9_pinctrl}, /*DEPRECATED*/ 736 + { .compatible = "lantiq,pinctrl-ase", .data = &ase_pinctrl}, /*DEPRECATED*/ 737 + { .compatible = "lantiq,ase-pinctrl", .data = &ase_pinctrl}, 738 + { .compatible = "lantiq,danube-pinctrl", .data = &danube_pinctrl}, 739 + { .compatible = "lantiq,xrx100-pinctrl", .data = &xrx100_pinctrl}, 740 + { .compatible = "lantiq,xrx200-pinctrl", .data = &xrx200_pinctrl}, 741 + { .compatible = "lantiq,xrx300-pinctrl", .data = &xrx300_pinctrl}, 1657 742 {}, 1658 743 }; 1659 744 MODULE_DEVICE_TABLE(of, xway_match); ··· 1680 755 if (match) 1681 756 xway_soc = (const struct pinctrl_xway_soc *) match->data; 1682 757 else 1683 - xway_soc = &soc_cfg[0]; 758 + xway_soc = &danube_pinctrl; 1684 759 1685 760 /* find out how many pads we have */ 1686 761 xway_chip.ngpio = xway_soc->pin_count;
+17
drivers/pinctrl/pxa/Kconfig
··· 1 + if (ARCH_PXA || COMPILE_TEST) 2 + 3 + config PINCTRL_PXA 4 + bool 5 + select PINMUX 6 + select PINCONF 7 + select GENERIC_PINCONF 8 + 9 + config PINCTRL_PXA27X 10 + tristate "Marvell PXA27x pin controller driver" 11 + select PINCTRL_PXA 12 + default y if PXA27x 13 + help 14 + This is the pinctrl, pinmux, pinconf driver for the Marvell 15 + PXA2xx block found in the pxa25x and pxa27x platforms. 16 + 17 + endif
+2
drivers/pinctrl/pxa/Makefile
··· 1 + # Marvell PXA pin control drivers 2 + obj-$(CONFIG_PINCTRL_PXA27X) += pinctrl-pxa2xx.o pinctrl-pxa27x.o
+566
drivers/pinctrl/pxa/pinctrl-pxa27x.c
··· 1 + /* 2 + * Marvell PXA27x family pin control 3 + * 4 + * Copyright (C) 2015 Robert Jarzmik 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; version 2 of the License. 9 + * 10 + */ 11 + #include <linux/module.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/of.h> 14 + #include <linux/of_device.h> 15 + #include <linux/pinctrl/pinctrl.h> 16 + 17 + #include "pinctrl-pxa2xx.h" 18 + 19 + static const struct pxa_desc_pin pxa27x_pins[] = { 20 + PXA_GPIO_ONLY_PIN(PXA_PINCTRL_PIN(0)), 21 + PXA_GPIO_ONLY_PIN(PXA_PINCTRL_PIN(1)), 22 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(9), 23 + PXA_FUNCTION(0, 3, "FFCTS"), 24 + PXA_FUNCTION(1, 1, "HZ_CLK"), 25 + PXA_FUNCTION(1, 3, "CHOUT<0>")), 26 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(10), 27 + PXA_FUNCTION(0, 1, "FFDCD"), 28 + PXA_FUNCTION(0, 3, "USB_P3_5"), 29 + PXA_FUNCTION(1, 1, "HZ_CLK"), 30 + PXA_FUNCTION(1, 3, "CHOUT<1>")), 31 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(11), 32 + PXA_FUNCTION(0, 1, "EXT_SYNC<0>"), 33 + PXA_FUNCTION(0, 2, "SSPRXD2"), 34 + PXA_FUNCTION(0, 3, "USB_P3_1"), 35 + PXA_FUNCTION(1, 1, "CHOUT<0>"), 36 + PXA_FUNCTION(1, 1, "PWM_OUT<2>"), 37 + PXA_FUNCTION(1, 3, "48_MHz")), 38 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(12), 39 + PXA_FUNCTION(0, 1, "EXT_SYNC<1>"), 40 + PXA_FUNCTION(0, 2, "CIF_DD<7>"), 41 + PXA_FUNCTION(1, 1, "CHOUT<1>"), 42 + PXA_FUNCTION(1, 1, "PWM_OUT<3>"), 43 + PXA_FUNCTION(1, 3, "48_MHz")), 44 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(13), 45 + PXA_FUNCTION(0, 1, "CLK_EXT"), 46 + PXA_FUNCTION(0, 2, "KP_DKIN<7>"), 47 + PXA_FUNCTION(0, 3, "KP_MKIN<7>"), 48 + PXA_FUNCTION(1, 1, "SSPTXD2")), 49 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(14), 50 + PXA_FUNCTION(0, 1, "L_VSYNC"), 51 + PXA_FUNCTION(0, 2, "SSPSFRM2"), 52 + PXA_FUNCTION(1, 1, "SSPSFRM2"), 53 + PXA_FUNCTION(1, 3, "UCLK")), 54 + PXA_GPIO_ONLY_PIN(PXA_PINCTRL_PIN(15)), 55 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(16), 56 + PXA_FUNCTION(0, 1, "KP_MKIN<5>"), 57 + PXA_FUNCTION(1, 2, "PWM_OUT<0>"), 58 + PXA_FUNCTION(1, 3, "FFTXD")), 59 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(17), 60 + PXA_FUNCTION(0, 1, "KP_MKIN<6>"), 61 + PXA_FUNCTION(0, 2, "CIF_DD<6>"), 62 + PXA_FUNCTION(1, 2, "PWM_OUT<1>")), 63 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(18), 64 + PXA_FUNCTION(0, 1, "RDY")), 65 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(19), 66 + PXA_FUNCTION(0, 1, "SSPSCLK2"), 67 + PXA_FUNCTION(0, 3, "FFRXD"), 68 + PXA_FUNCTION(1, 1, "SSPSCLK2"), 69 + PXA_FUNCTION(1, 2, "L_CS"), 70 + PXA_FUNCTION(1, 3, "nURST")), 71 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(20), 72 + PXA_FUNCTION(0, 1, "DREQ<0>"), 73 + PXA_FUNCTION(0, 2, "MBREQ"), 74 + PXA_FUNCTION(1, 1, "nSDCS<2>")), 75 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(21), 76 + PXA_FUNCTION(1, 1, "nSDCS<3>"), 77 + PXA_FUNCTION(1, 2, "DVAL<0>"), 78 + PXA_FUNCTION(1, 3, "MBGNT")), 79 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(22), 80 + PXA_FUNCTION(0, 1, "SSPEXTCLK2"), 81 + PXA_FUNCTION(0, 2, "SSPSCLKEN2"), 82 + PXA_FUNCTION(0, 3, "SSPSCLK2"), 83 + PXA_FUNCTION(1, 1, "KP_MKOUT<7>"), 84 + PXA_FUNCTION(1, 2, "SSPSYSCLK2"), 85 + PXA_FUNCTION(1, 3, "SSPSCLK2")), 86 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(23), 87 + PXA_FUNCTION(0, 2, "SSPSCLK"), 88 + PXA_FUNCTION(1, 1, "CIF_MCLK"), 89 + PXA_FUNCTION(1, 1, "SSPSCLK")), 90 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(24), 91 + PXA_FUNCTION(0, 1, "CIF_FV"), 92 + PXA_FUNCTION(0, 2, "SSPSFRM"), 93 + PXA_FUNCTION(1, 1, "CIF_FV"), 94 + PXA_FUNCTION(1, 2, "SSPSFRM")), 95 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(25), 96 + PXA_FUNCTION(0, 1, "CIF_LV"), 97 + PXA_FUNCTION(1, 1, "CIF_LV"), 98 + PXA_FUNCTION(1, 2, "SSPTXD")), 99 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(26), 100 + PXA_FUNCTION(0, 1, "SSPRXD"), 101 + PXA_FUNCTION(0, 2, "CIF_PCLK"), 102 + PXA_FUNCTION(0, 3, "FFCTS")), 103 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(27), 104 + PXA_FUNCTION(0, 1, "SSPEXTCLK"), 105 + PXA_FUNCTION(0, 2, "SSPSCLKEN"), 106 + PXA_FUNCTION(0, 3, "CIF_DD<0>"), 107 + PXA_FUNCTION(1, 1, "SSPSYSCLK"), 108 + PXA_FUNCTION(1, 3, "FFRTS")), 109 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(28), 110 + PXA_FUNCTION(0, 1, "AC97_BITCLK"), 111 + PXA_FUNCTION(0, 2, "I2S_BITCLK"), 112 + PXA_FUNCTION(0, 3, "SSPSFRM"), 113 + PXA_FUNCTION(1, 1, "I2S_BITCLK"), 114 + PXA_FUNCTION(1, 3, "SSPSFRM")), 115 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(29), 116 + PXA_FUNCTION(0, 1, "AC97_SDATA_IN_0"), 117 + PXA_FUNCTION(0, 2, "I2S_SDATA_IN"), 118 + PXA_FUNCTION(0, 3, "SSPSCLK"), 119 + PXA_FUNCTION(1, 1, "SSPRXD2"), 120 + PXA_FUNCTION(1, 3, "SSPSCLK")), 121 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(30), 122 + PXA_FUNCTION(1, 1, "I2S_SDATA_OUT"), 123 + PXA_FUNCTION(1, 2, "AC97_SDATA_OUT"), 124 + PXA_FUNCTION(1, 3, "USB_P3_2")), 125 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(31), 126 + PXA_FUNCTION(1, 1, "I2S_SYNC"), 127 + PXA_FUNCTION(1, 2, "AC97_SYNC"), 128 + PXA_FUNCTION(1, 3, "USB_P3_6")), 129 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(32), 130 + PXA_FUNCTION(1, 1, "MSSCLK"), 131 + PXA_FUNCTION(1, 2, "MMCLK")), 132 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(33), 133 + PXA_FUNCTION(0, 1, "FFRXD"), 134 + PXA_FUNCTION(0, 2, "FFDSR"), 135 + PXA_FUNCTION(1, 1, "DVAL<1>"), 136 + PXA_FUNCTION(1, 2, "nCS<5>"), 137 + PXA_FUNCTION(1, 3, "MBGNT")), 138 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(34), 139 + PXA_FUNCTION(0, 1, "FFRXD"), 140 + PXA_FUNCTION(0, 2, "KP_MKIN<3>"), 141 + PXA_FUNCTION(0, 3, "SSPSCLK3"), 142 + PXA_FUNCTION(1, 1, "USB_P2_2"), 143 + PXA_FUNCTION(1, 3, "SSPSCLK3")), 144 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(35), 145 + PXA_FUNCTION(0, 1, "FFCTS"), 146 + PXA_FUNCTION(0, 2, "USB_P2_1"), 147 + PXA_FUNCTION(0, 3, "SSPSFRM3"), 148 + PXA_FUNCTION(1, 2, "KP_MKOUT<6>"), 149 + PXA_FUNCTION(1, 3, "SSPTXD3")), 150 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(36), 151 + PXA_FUNCTION(0, 1, "FFDCD"), 152 + PXA_FUNCTION(0, 2, "SSPSCLK2"), 153 + PXA_FUNCTION(0, 3, "KP_MKIN<7>"), 154 + PXA_FUNCTION(1, 1, "USB_P2_4"), 155 + PXA_FUNCTION(1, 2, "SSPSCLK2")), 156 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(37), 157 + PXA_FUNCTION(0, 1, "FFDSR"), 158 + PXA_FUNCTION(0, 2, "SSPSFRM2"), 159 + PXA_FUNCTION(0, 3, "KP_MKIN<3>"), 160 + PXA_FUNCTION(1, 1, "USB_P2_8"), 161 + PXA_FUNCTION(1, 2, "SSPSFRM2"), 162 + PXA_FUNCTION(1, 3, "FFTXD")), 163 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(38), 164 + PXA_FUNCTION(0, 1, "FFRI"), 165 + PXA_FUNCTION(0, 2, "KP_MKIN<4>"), 166 + PXA_FUNCTION(0, 3, "USB_P2_3"), 167 + PXA_FUNCTION(1, 1, "SSPTXD3"), 168 + PXA_FUNCTION(1, 2, "SSPTXD2"), 169 + PXA_FUNCTION(1, 3, "PWM_OUT<0>")), 170 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(39), 171 + PXA_FUNCTION(0, 1, "KP_MKIN<4>"), 172 + PXA_FUNCTION(0, 3, "SSPSFRM3"), 173 + PXA_FUNCTION(1, 1, "USB_P2_6"), 174 + PXA_FUNCTION(1, 2, "FFTXD"), 175 + PXA_FUNCTION(1, 3, "SSPSFRM3")), 176 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(40), 177 + PXA_FUNCTION(0, 1, "SSPRXD2"), 178 + PXA_FUNCTION(0, 3, "USB_P2_5"), 179 + PXA_FUNCTION(1, 1, "KP_MKOUT<6>"), 180 + PXA_FUNCTION(1, 2, "FFDTR"), 181 + PXA_FUNCTION(1, 3, "SSPSCLK3")), 182 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(41), 183 + PXA_FUNCTION(0, 1, "FFRXD"), 184 + PXA_FUNCTION(0, 2, "USB_P2_7"), 185 + PXA_FUNCTION(0, 3, "SSPRXD3"), 186 + PXA_FUNCTION(1, 1, "KP_MKOUT<7>"), 187 + PXA_FUNCTION(1, 2, "FFRTS")), 188 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(42), 189 + PXA_FUNCTION(0, 1, "BTRXD"), 190 + PXA_FUNCTION(0, 2, "ICP_RXD"), 191 + PXA_FUNCTION(1, 3, "CIF_MCLK")), 192 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(43), 193 + PXA_FUNCTION(0, 3, "CIF_FV"), 194 + PXA_FUNCTION(1, 1, "ICP_TXD"), 195 + PXA_FUNCTION(1, 2, "BTTXD"), 196 + PXA_FUNCTION(1, 3, "CIF_FV")), 197 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(44), 198 + PXA_FUNCTION(0, 1, "BTCTS"), 199 + PXA_FUNCTION(0, 3, "CIF_LV"), 200 + PXA_FUNCTION(1, 3, "CIF_LV")), 201 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(45), 202 + PXA_FUNCTION(0, 3, "CIF_PCLK"), 203 + PXA_FUNCTION(1, 1, "AC97_SYSCLK"), 204 + PXA_FUNCTION(1, 2, "BTRTS"), 205 + PXA_FUNCTION(1, 3, "SSPSYSCLK3")), 206 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(46), 207 + PXA_FUNCTION(0, 1, "ICP_RXD"), 208 + PXA_FUNCTION(0, 2, "STD_RXD"), 209 + PXA_FUNCTION(1, 2, "PWM_OUT<2>")), 210 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(47), 211 + PXA_FUNCTION(0, 1, "CIF_DD<0>"), 212 + PXA_FUNCTION(1, 1, "STD_TXD"), 213 + PXA_FUNCTION(1, 2, "ICP_TXD"), 214 + PXA_FUNCTION(1, 3, "PWM_OUT<3>")), 215 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(48), 216 + PXA_FUNCTION(0, 1, "CIF_DD<5>"), 217 + PXA_FUNCTION(1, 1, "BB_OB_DAT<1>"), 218 + PXA_FUNCTION(1, 2, "nPOE")), 219 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(49), 220 + PXA_FUNCTION(1, 2, "nPWE")), 221 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(50), 222 + PXA_FUNCTION(0, 1, "CIF_DD<3>"), 223 + PXA_FUNCTION(0, 3, "SSPSCLK2"), 224 + PXA_FUNCTION(1, 1, "BB_OB_DAT<2>"), 225 + PXA_FUNCTION(1, 2, "nPIOR"), 226 + PXA_FUNCTION(1, 3, "SSPSCLK2")), 227 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(51), 228 + PXA_FUNCTION(0, 1, "CIF_DD<2>"), 229 + PXA_FUNCTION(1, 1, "BB_OB_DAT<3>"), 230 + PXA_FUNCTION(1, 2, "nPIOW")), 231 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(52), 232 + PXA_FUNCTION(0, 1, "CIF_DD<4>"), 233 + PXA_FUNCTION(0, 2, "SSPSCLK3"), 234 + PXA_FUNCTION(1, 1, "BB_OB_CLK"), 235 + PXA_FUNCTION(1, 2, "SSPSCLK3")), 236 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(53), 237 + PXA_FUNCTION(0, 1, "FFRXD"), 238 + PXA_FUNCTION(0, 2, "USB_P2_3"), 239 + PXA_FUNCTION(1, 1, "BB_OB_STB"), 240 + PXA_FUNCTION(1, 2, "CIF_MCLK"), 241 + PXA_FUNCTION(1, 3, "SSPSYSCLK")), 242 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(54), 243 + PXA_FUNCTION(0, 2, "BB_OB_WAIT"), 244 + PXA_FUNCTION(0, 3, "CIF_PCLK"), 245 + PXA_FUNCTION(1, 2, "nPCE<2>")), 246 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(55), 247 + PXA_FUNCTION(0, 1, "CIF_DD<1>"), 248 + PXA_FUNCTION(0, 2, "BB_IB_DAT<1>"), 249 + PXA_FUNCTION(1, 2, "nPREG")), 250 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(56), 251 + PXA_FUNCTION(0, 1, "nPWAIT"), 252 + PXA_FUNCTION(0, 2, "BB_IB_DAT<2>"), 253 + PXA_FUNCTION(1, 1, "USB_P3_4")), 254 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(57), 255 + PXA_FUNCTION(0, 1, "nIOS16"), 256 + PXA_FUNCTION(0, 2, "BB_IB_DAT<3>"), 257 + PXA_FUNCTION(1, 3, "SSPTXD")), 258 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(58), 259 + PXA_FUNCTION(0, 2, "LDD<0>"), 260 + PXA_FUNCTION(1, 2, "LDD<0>")), 261 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(59), 262 + PXA_FUNCTION(0, 2, "LDD<1>"), 263 + PXA_FUNCTION(1, 2, "LDD<1>")), 264 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(60), 265 + PXA_FUNCTION(0, 2, "LDD<2>"), 266 + PXA_FUNCTION(1, 2, "LDD<2>")), 267 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(61), 268 + PXA_FUNCTION(0, 2, "LDD<3>"), 269 + PXA_FUNCTION(1, 2, "LDD<3>")), 270 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(62), 271 + PXA_FUNCTION(0, 2, "LDD<4>"), 272 + PXA_FUNCTION(1, 2, "LDD<4>")), 273 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(63), 274 + PXA_FUNCTION(0, 2, "LDD<5>"), 275 + PXA_FUNCTION(1, 2, "LDD<5>")), 276 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(64), 277 + PXA_FUNCTION(0, 2, "LDD<6>"), 278 + PXA_FUNCTION(1, 2, "LDD<6>")), 279 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(65), 280 + PXA_FUNCTION(0, 2, "LDD<7>"), 281 + PXA_FUNCTION(1, 2, "LDD<7>")), 282 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(66), 283 + PXA_FUNCTION(0, 2, "LDD<8>"), 284 + PXA_FUNCTION(1, 2, "LDD<8>")), 285 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(67), 286 + PXA_FUNCTION(0, 2, "LDD<9>"), 287 + PXA_FUNCTION(1, 2, "LDD<9>")), 288 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(68), 289 + PXA_FUNCTION(0, 2, "LDD<10>"), 290 + PXA_FUNCTION(1, 2, "LDD<10>")), 291 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(69), 292 + PXA_FUNCTION(0, 2, "LDD<11>"), 293 + PXA_FUNCTION(1, 2, "LDD<11>")), 294 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(70), 295 + PXA_FUNCTION(0, 2, "LDD<12>"), 296 + PXA_FUNCTION(1, 2, "LDD<12>")), 297 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(71), 298 + PXA_FUNCTION(0, 2, "LDD<13>"), 299 + PXA_FUNCTION(1, 2, "LDD<13>")), 300 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(72), 301 + PXA_FUNCTION(0, 2, "LDD<14>"), 302 + PXA_FUNCTION(1, 2, "LDD<14>")), 303 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(73), 304 + PXA_FUNCTION(0, 2, "LDD<15>"), 305 + PXA_FUNCTION(1, 2, "LDD<15>")), 306 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(74), 307 + PXA_FUNCTION(1, 2, "L_FCLK_RD")), 308 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(75), 309 + PXA_FUNCTION(1, 2, "L_LCLK_A0")), 310 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(76), 311 + PXA_FUNCTION(1, 2, "L_PCLK_WR")), 312 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(77), 313 + PXA_FUNCTION(1, 2, "L_BIAS")), 314 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(78), 315 + PXA_FUNCTION(1, 1, "nPCE<2>"), 316 + PXA_FUNCTION(1, 2, "nCS<2>")), 317 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(79), 318 + PXA_FUNCTION(1, 1, "PSKTSEL"), 319 + PXA_FUNCTION(1, 2, "nCS<3>"), 320 + PXA_FUNCTION(1, 3, "PWM_OUT<2>")), 321 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(80), 322 + PXA_FUNCTION(0, 1, "DREQ<1>"), 323 + PXA_FUNCTION(0, 2, "MBREQ"), 324 + PXA_FUNCTION(1, 2, "nCS<4>"), 325 + PXA_FUNCTION(1, 3, "PWM_OUT<3>")), 326 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(81), 327 + PXA_FUNCTION(0, 2, "CIF_DD<0>"), 328 + PXA_FUNCTION(1, 1, "SSPTXD3"), 329 + PXA_FUNCTION(1, 2, "BB_OB_DAT<0>")), 330 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(82), 331 + PXA_FUNCTION(0, 1, "SSPRXD3"), 332 + PXA_FUNCTION(0, 2, "BB_IB_DAT<0>"), 333 + PXA_FUNCTION(0, 3, "CIF_DD<5>"), 334 + PXA_FUNCTION(1, 3, "FFDTR")), 335 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(83), 336 + PXA_FUNCTION(0, 1, "SSPSFRM3"), 337 + PXA_FUNCTION(0, 2, "BB_IB_CLK"), 338 + PXA_FUNCTION(0, 3, "CIF_DD<5>"), 339 + PXA_FUNCTION(1, 1, "SSPSFRM3"), 340 + PXA_FUNCTION(1, 2, "FFTXD"), 341 + PXA_FUNCTION(1, 3, "FFRTS")), 342 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(84), 343 + PXA_FUNCTION(0, 1, "SSPCLK3"), 344 + PXA_FUNCTION(0, 2, "BB_IB_STB"), 345 + PXA_FUNCTION(0, 3, "CIF_FV"), 346 + PXA_FUNCTION(1, 1, "SSPCLK3"), 347 + PXA_FUNCTION(1, 3, "CIF_FV")), 348 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(85), 349 + PXA_FUNCTION(0, 1, "FFRXD"), 350 + PXA_FUNCTION(0, 2, "DREQ<2>"), 351 + PXA_FUNCTION(0, 3, "CIF_LV"), 352 + PXA_FUNCTION(1, 1, "nPCE<1>"), 353 + PXA_FUNCTION(1, 2, "BB_IB_WAIT"), 354 + PXA_FUNCTION(1, 3, "CIF_LV")), 355 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(86), 356 + PXA_FUNCTION(0, 1, "SSPRXD2"), 357 + PXA_FUNCTION(0, 2, "LDD<16>"), 358 + PXA_FUNCTION(0, 3, "USB_P3_5"), 359 + PXA_FUNCTION(1, 1, "nPCE<1>"), 360 + PXA_FUNCTION(1, 2, "LDD<16>")), 361 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(87), 362 + PXA_FUNCTION(0, 1, "nPCE<2>"), 363 + PXA_FUNCTION(0, 2, "LDD<17>"), 364 + PXA_FUNCTION(0, 3, "USB_P3_1"), 365 + PXA_FUNCTION(1, 1, "SSPTXD2"), 366 + PXA_FUNCTION(1, 2, "LDD<17>"), 367 + PXA_FUNCTION(1, 3, "SSPSFRM2")), 368 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(88), 369 + PXA_FUNCTION(0, 1, "USBHPWR<1>"), 370 + PXA_FUNCTION(0, 2, "SSPRXD2"), 371 + PXA_FUNCTION(0, 3, "SSPSFRM2"), 372 + PXA_FUNCTION(1, 2, "SSPTXD2"), 373 + PXA_FUNCTION(1, 3, "SSPSFRM2")), 374 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(89), 375 + PXA_FUNCTION(0, 1, "SSPRXD3"), 376 + PXA_FUNCTION(0, 3, "FFRI"), 377 + PXA_FUNCTION(1, 1, "AC97_SYSCLK"), 378 + PXA_FUNCTION(1, 2, "USBHPEN<1>"), 379 + PXA_FUNCTION(1, 3, "SSPTXD2")), 380 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(90), 381 + PXA_FUNCTION(0, 1, "KP_MKIN<5>"), 382 + PXA_FUNCTION(0, 3, "USB_P3_5"), 383 + PXA_FUNCTION(1, 1, "CIF_DD<4>"), 384 + PXA_FUNCTION(1, 2, "nURST")), 385 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(91), 386 + PXA_FUNCTION(0, 1, "KP_MKIN<6>"), 387 + PXA_FUNCTION(0, 3, "USB_P3_1"), 388 + PXA_FUNCTION(1, 1, "CIF_DD<5>"), 389 + PXA_FUNCTION(1, 2, "UCLK")), 390 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(92), 391 + PXA_FUNCTION(0, 1, "MMDAT<0>"), 392 + PXA_FUNCTION(1, 1, "MMDAT<0>"), 393 + PXA_FUNCTION(1, 2, "MSBS")), 394 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(93), 395 + PXA_FUNCTION(0, 1, "KP_DKIN<0>"), 396 + PXA_FUNCTION(0, 2, "CIF_DD<6>"), 397 + PXA_FUNCTION(1, 1, "AC97_SDATA_OUT")), 398 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(94), 399 + PXA_FUNCTION(0, 1, "KP_DKIN<1>"), 400 + PXA_FUNCTION(0, 2, "CIF_DD<5>"), 401 + PXA_FUNCTION(1, 1, "AC97_SYNC")), 402 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(95), 403 + PXA_FUNCTION(0, 1, "KP_DKIN<2>"), 404 + PXA_FUNCTION(0, 2, "CIF_DD<4>"), 405 + PXA_FUNCTION(0, 3, "KP_MKIN<6>"), 406 + PXA_FUNCTION(1, 1, "AC97_RESET_n")), 407 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(96), 408 + PXA_FUNCTION(0, 1, "KP_DKIN<3>"), 409 + PXA_FUNCTION(0, 2, "MBREQ"), 410 + PXA_FUNCTION(0, 3, "FFRXD"), 411 + PXA_FUNCTION(1, 2, "DVAL<1>"), 412 + PXA_FUNCTION(1, 3, "KP_MKOUT<6>")), 413 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(97), 414 + PXA_FUNCTION(0, 1, "KP_DKIN<4>"), 415 + PXA_FUNCTION(0, 2, "DREQ<1>"), 416 + PXA_FUNCTION(0, 3, "KP_MKIN<3>"), 417 + PXA_FUNCTION(1, 2, "MBGNT")), 418 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(98), 419 + PXA_FUNCTION(0, 1, "KP_DKIN<5>"), 420 + PXA_FUNCTION(0, 2, "CIF_DD<0>"), 421 + PXA_FUNCTION(0, 3, "KP_MKIN<4>"), 422 + PXA_FUNCTION(1, 1, "AC97_SYSCLK"), 423 + PXA_FUNCTION(1, 3, "FFRTS")), 424 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(99), 425 + PXA_FUNCTION(0, 1, "KP_DKIN<6>"), 426 + PXA_FUNCTION(0, 2, "AC97_SDATA_IN_1"), 427 + PXA_FUNCTION(0, 3, "KP_MKIN<5>"), 428 + PXA_FUNCTION(1, 3, "FFTXD")), 429 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(100), 430 + PXA_FUNCTION(0, 1, "KP_MKIN<0>"), 431 + PXA_FUNCTION(0, 2, "DREQ<2>"), 432 + PXA_FUNCTION(0, 3, "FFCTS")), 433 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(101), 434 + PXA_FUNCTION(0, 1, "KP_MKIN<1>")), 435 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(102), 436 + PXA_FUNCTION(0, 1, "KP_MKIN<2>"), 437 + PXA_FUNCTION(0, 3, "FFRXD"), 438 + PXA_FUNCTION(1, 1, "nPCE<1>")), 439 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(103), 440 + PXA_FUNCTION(0, 1, "CIF_DD<3>"), 441 + PXA_FUNCTION(1, 2, "KP_MKOUT<0>")), 442 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(104), 443 + PXA_FUNCTION(0, 1, "CIF_DD<2>"), 444 + PXA_FUNCTION(1, 1, "PSKTSEL"), 445 + PXA_FUNCTION(1, 2, "KP_MKOUT<1>")), 446 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(105), 447 + PXA_FUNCTION(0, 1, "CIF_DD<1>"), 448 + PXA_FUNCTION(1, 1, "nPCE<2>"), 449 + PXA_FUNCTION(1, 2, "KP_MKOUT<2>")), 450 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(106), 451 + PXA_FUNCTION(0, 1, "CIF_DD<9>"), 452 + PXA_FUNCTION(1, 2, "KP_MKOUT<3>")), 453 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(107), 454 + PXA_FUNCTION(0, 1, "CIF_DD<8>"), 455 + PXA_FUNCTION(1, 2, "KP_MKOUT<4>")), 456 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(108), 457 + PXA_FUNCTION(0, 1, "CIF_DD<7>"), 458 + PXA_FUNCTION(1, 1, "CHOUT<0>"), 459 + PXA_FUNCTION(1, 2, "KP_MKOUT<5>")), 460 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(109), 461 + PXA_FUNCTION(0, 1, "MMDAT<1>"), 462 + PXA_FUNCTION(0, 2, "MSSDIO"), 463 + PXA_FUNCTION(1, 1, "MMDAT<1>"), 464 + PXA_FUNCTION(1, 2, "MSSDIO")), 465 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(110), 466 + PXA_FUNCTION(0, 1, "MMDAT<2>"), 467 + PXA_FUNCTION(1, 1, "MMDAT<2>")), 468 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(111), 469 + PXA_FUNCTION(0, 1, "MMDAT<3>"), 470 + PXA_FUNCTION(1, 1, "MMDAT<3>")), 471 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(112), 472 + PXA_FUNCTION(0, 1, "MMCMD"), 473 + PXA_FUNCTION(0, 2, "nMSINS"), 474 + PXA_FUNCTION(1, 1, "MMCMD")), 475 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(113), 476 + PXA_FUNCTION(0, 3, "USB_P3_3"), 477 + PXA_FUNCTION(1, 1, "I2S_SYSCLK"), 478 + PXA_FUNCTION(1, 2, "AC97_RESET_n")), 479 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(114), 480 + PXA_FUNCTION(0, 1, "CIF_DD<1>"), 481 + PXA_FUNCTION(1, 1, "UEN"), 482 + PXA_FUNCTION(1, 2, "UVS0")), 483 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(115), 484 + PXA_FUNCTION(0, 1, "DREQ<0>"), 485 + PXA_FUNCTION(0, 2, "CIF_DD<3>"), 486 + PXA_FUNCTION(0, 3, "MBREQ"), 487 + PXA_FUNCTION(1, 1, "UEN"), 488 + PXA_FUNCTION(1, 2, "nUVS1"), 489 + PXA_FUNCTION(1, 3, "PWM_OUT<1>")), 490 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(116), 491 + PXA_FUNCTION(0, 1, "CIF_DD<2>"), 492 + PXA_FUNCTION(0, 2, "AC97_SDATA_IN_0"), 493 + PXA_FUNCTION(0, 3, "UDET"), 494 + PXA_FUNCTION(1, 1, "DVAL<0>"), 495 + PXA_FUNCTION(1, 2, "nUVS2"), 496 + PXA_FUNCTION(1, 3, "MBGNT")), 497 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(117), 498 + PXA_FUNCTION(0, 1, "SCL"), 499 + PXA_FUNCTION(1, 1, "SCL")), 500 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(118), 501 + PXA_FUNCTION(0, 1, "SDA"), 502 + PXA_FUNCTION(1, 1, "SDA")), 503 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(119), 504 + PXA_FUNCTION(0, 1, "USBHPWR<2>")), 505 + PXA_GPIO_PIN(PXA_PINCTRL_PIN(120), 506 + PXA_FUNCTION(1, 2, "USBHPEN<2>")), 507 + }; 508 + 509 + static int pxa27x_pinctrl_probe(struct platform_device *pdev) 510 + { 511 + int ret, i; 512 + void __iomem *base_af[8]; 513 + void __iomem *base_dir[4]; 514 + void __iomem *base_sleep[4]; 515 + struct resource *res; 516 + 517 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 518 + base_af[0] = devm_ioremap_resource(&pdev->dev, res); 519 + if (IS_ERR(base_af[0])) 520 + return PTR_ERR(base_af[0]); 521 + 522 + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 523 + base_dir[0] = devm_ioremap_resource(&pdev->dev, res); 524 + if (IS_ERR(base_dir[0])) 525 + return PTR_ERR(base_dir[0]); 526 + 527 + res = platform_get_resource(pdev, IORESOURCE_MEM, 2); 528 + base_dir[3] = devm_ioremap_resource(&pdev->dev, res); 529 + if (IS_ERR(base_dir[3])) 530 + return PTR_ERR(base_dir[3]); 531 + 532 + res = platform_get_resource(pdev, IORESOURCE_MEM, 3); 533 + base_sleep[0] = devm_ioremap_resource(&pdev->dev, res); 534 + if (IS_ERR(base_sleep[0])) 535 + return PTR_ERR(base_sleep[0]); 536 + 537 + for (i = 0; i < ARRAY_SIZE(base_af); i++) 538 + base_af[i] = base_af[0] + sizeof(base_af[0]) * i; 539 + for (i = 0; i < 3; i++) 540 + base_dir[i] = base_dir[0] + sizeof(base_dir[0]) * i; 541 + for (i = 0; i < ARRAY_SIZE(base_sleep); i++) 542 + base_sleep[i] = base_sleep[0] + sizeof(base_af[0]) * i; 543 + 544 + ret = pxa2xx_pinctrl_init(pdev, pxa27x_pins, ARRAY_SIZE(pxa27x_pins), 545 + base_af, base_dir, base_sleep); 546 + return ret; 547 + } 548 + 549 + static const struct of_device_id pxa27x_pinctrl_match[] = { 550 + { .compatible = "marvell,pxa27x-pinctrl", }, 551 + {} 552 + }; 553 + MODULE_DEVICE_TABLE(of, pxa27x_pinctrl_match); 554 + 555 + static struct platform_driver pxa27x_pinctrl_driver = { 556 + .probe = pxa27x_pinctrl_probe, 557 + .driver = { 558 + .name = "pxa27x-pinctrl", 559 + .of_match_table = pxa27x_pinctrl_match, 560 + }, 561 + }; 562 + module_platform_driver(pxa27x_pinctrl_driver); 563 + 564 + MODULE_AUTHOR("Robert Jarzmik <robert.jarzmik@free.fr>"); 565 + MODULE_DESCRIPTION("Marvell PXA27x pinctrl driver"); 566 + MODULE_LICENSE("GPL v2");
+436
drivers/pinctrl/pxa/pinctrl-pxa2xx.c
··· 1 + /* 2 + * Marvell PXA2xx family pin control 3 + * 4 + * Copyright (C) 2015 Robert Jarzmik 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; version 2 of the License. 9 + * 10 + */ 11 + 12 + #include <linux/bitops.h> 13 + #include <linux/io.h> 14 + #include <linux/of.h> 15 + #include <linux/of_address.h> 16 + #include <linux/module.h> 17 + #include <linux/pinctrl/pinconf.h> 18 + #include <linux/pinctrl/pinconf-generic.h> 19 + #include <linux/pinctrl/pinmux.h> 20 + #include <linux/pinctrl/pinctrl.h> 21 + #include <linux/platform_device.h> 22 + #include <linux/slab.h> 23 + 24 + #include "../pinctrl-utils.h" 25 + #include "pinctrl-pxa2xx.h" 26 + 27 + static int pxa2xx_pctrl_get_groups_count(struct pinctrl_dev *pctldev) 28 + { 29 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 30 + 31 + return pctl->ngroups; 32 + } 33 + 34 + static const char *pxa2xx_pctrl_get_group_name(struct pinctrl_dev *pctldev, 35 + unsigned tgroup) 36 + { 37 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 38 + struct pxa_pinctrl_group *group = pctl->groups + tgroup; 39 + 40 + return group->name; 41 + } 42 + 43 + static int pxa2xx_pctrl_get_group_pins(struct pinctrl_dev *pctldev, 44 + unsigned tgroup, 45 + const unsigned **pins, 46 + unsigned *num_pins) 47 + { 48 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 49 + struct pxa_pinctrl_group *group = pctl->groups + tgroup; 50 + 51 + *pins = (unsigned *)&group->pin; 52 + *num_pins = 1; 53 + 54 + return 0; 55 + } 56 + 57 + static const struct pinctrl_ops pxa2xx_pctl_ops = { 58 + #ifdef CONFIG_OF 59 + .dt_node_to_map = pinconf_generic_dt_node_to_map_all, 60 + .dt_free_map = pinctrl_utils_dt_free_map, 61 + #endif 62 + .get_groups_count = pxa2xx_pctrl_get_groups_count, 63 + .get_group_name = pxa2xx_pctrl_get_group_name, 64 + .get_group_pins = pxa2xx_pctrl_get_group_pins, 65 + }; 66 + 67 + static struct pxa_desc_function * 68 + pxa_desc_by_func_group(struct pxa_pinctrl *pctl, const char *pin_name, 69 + const char *func_name) 70 + { 71 + int i; 72 + struct pxa_desc_function *df; 73 + 74 + for (i = 0; i < pctl->npins; i++) { 75 + const struct pxa_desc_pin *pin = pctl->ppins + i; 76 + 77 + if (!strcmp(pin->pin.name, pin_name)) 78 + for (df = pin->functions; df->name; df++) 79 + if (!strcmp(df->name, func_name)) 80 + return df; 81 + } 82 + 83 + return NULL; 84 + } 85 + 86 + static int pxa2xx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, 87 + struct pinctrl_gpio_range *range, 88 + unsigned pin, 89 + bool input) 90 + { 91 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 92 + unsigned long flags; 93 + uint32_t val; 94 + void __iomem *gpdr; 95 + 96 + gpdr = pctl->base_gpdr[pin / 32]; 97 + dev_dbg(pctl->dev, "set_direction(pin=%d): dir=%d\n", 98 + pin, !input); 99 + 100 + spin_lock_irqsave(&pctl->lock, flags); 101 + 102 + val = readl_relaxed(gpdr); 103 + val = (val & ~BIT(pin % 32)) | (input ? 0 : BIT(pin % 32)); 104 + writel_relaxed(val, gpdr); 105 + 106 + spin_unlock_irqrestore(&pctl->lock, flags); 107 + 108 + return 0; 109 + } 110 + 111 + static const char *pxa2xx_pmx_get_func_name(struct pinctrl_dev *pctldev, 112 + unsigned function) 113 + { 114 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 115 + struct pxa_pinctrl_function *pf = pctl->functions + function; 116 + 117 + return pf->name; 118 + } 119 + 120 + static int pxa2xx_get_functions_count(struct pinctrl_dev *pctldev) 121 + { 122 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 123 + 124 + return pctl->nfuncs; 125 + } 126 + 127 + static int pxa2xx_pmx_get_func_groups(struct pinctrl_dev *pctldev, 128 + unsigned function, 129 + const char * const **groups, 130 + unsigned * const num_groups) 131 + { 132 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 133 + struct pxa_pinctrl_function *pf = pctl->functions + function; 134 + 135 + *groups = pf->groups; 136 + *num_groups = pf->ngroups; 137 + 138 + return 0; 139 + } 140 + 141 + static int pxa2xx_pmx_set_mux(struct pinctrl_dev *pctldev, unsigned function, 142 + unsigned tgroup) 143 + { 144 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 145 + struct pxa_pinctrl_group *group = pctl->groups + tgroup; 146 + struct pxa_desc_function *df; 147 + int pin, shift; 148 + unsigned long flags; 149 + void __iomem *gafr, *gpdr; 150 + u32 val; 151 + 152 + 153 + df = pxa_desc_by_func_group(pctl, group->name, 154 + (pctl->functions + function)->name); 155 + if (!df) 156 + return -EINVAL; 157 + 158 + pin = group->pin; 159 + gafr = pctl->base_gafr[pin / 16]; 160 + gpdr = pctl->base_gpdr[pin / 32]; 161 + shift = (pin % 16) << 1; 162 + dev_dbg(pctl->dev, "set_mux(pin=%d): af=%d dir=%d\n", 163 + pin, df->muxval >> 1, df->muxval & 0x1); 164 + 165 + spin_lock_irqsave(&pctl->lock, flags); 166 + 167 + val = readl_relaxed(gafr); 168 + val = (val & ~(0x3 << shift)) | ((df->muxval >> 1) << shift); 169 + writel_relaxed(val, gafr); 170 + 171 + val = readl_relaxed(gpdr); 172 + val = (val & ~BIT(pin % 32)) | ((df->muxval & 1) ? BIT(pin % 32) : 0); 173 + writel_relaxed(val, gpdr); 174 + 175 + spin_unlock_irqrestore(&pctl->lock, flags); 176 + 177 + return 0; 178 + } 179 + static const struct pinmux_ops pxa2xx_pinmux_ops = { 180 + .get_functions_count = pxa2xx_get_functions_count, 181 + .get_function_name = pxa2xx_pmx_get_func_name, 182 + .get_function_groups = pxa2xx_pmx_get_func_groups, 183 + .set_mux = pxa2xx_pmx_set_mux, 184 + .gpio_set_direction = pxa2xx_pmx_gpio_set_direction, 185 + }; 186 + 187 + static int pxa2xx_pconf_group_get(struct pinctrl_dev *pctldev, 188 + unsigned group, 189 + unsigned long *config) 190 + { 191 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 192 + struct pxa_pinctrl_group *g = pctl->groups + group; 193 + unsigned long flags; 194 + unsigned pin = g->pin; 195 + void __iomem *pgsr = pctl->base_pgsr[pin / 32]; 196 + u32 val; 197 + 198 + spin_lock_irqsave(&pctl->lock, flags); 199 + val = readl_relaxed(pgsr) & BIT(pin % 32); 200 + *config = val ? PIN_CONFIG_LOW_POWER_MODE : 0; 201 + spin_unlock_irqrestore(&pctl->lock, flags); 202 + 203 + dev_dbg(pctl->dev, "get sleep gpio state(pin=%d) %d\n", 204 + pin, !!val); 205 + return 0; 206 + } 207 + 208 + static int pxa2xx_pconf_group_set(struct pinctrl_dev *pctldev, 209 + unsigned group, 210 + unsigned long *configs, 211 + unsigned num_configs) 212 + { 213 + struct pxa_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 214 + struct pxa_pinctrl_group *g = pctl->groups + group; 215 + unsigned long flags; 216 + unsigned pin = g->pin; 217 + void __iomem *pgsr = pctl->base_pgsr[pin / 32]; 218 + int i, is_set = 0; 219 + u32 val; 220 + 221 + for (i = 0; i < num_configs; i++) { 222 + switch (pinconf_to_config_param(configs[i])) { 223 + case PIN_CONFIG_LOW_POWER_MODE: 224 + is_set = pinconf_to_config_argument(configs[i]); 225 + break; 226 + default: 227 + return -EINVAL; 228 + } 229 + } 230 + 231 + dev_dbg(pctl->dev, "set sleep gpio state(pin=%d) %d\n", 232 + pin, is_set); 233 + 234 + spin_lock_irqsave(&pctl->lock, flags); 235 + val = readl_relaxed(pgsr); 236 + val = (val & ~BIT(pin % 32)) | (is_set ? BIT(pin % 32) : 0); 237 + writel_relaxed(val, pgsr); 238 + spin_unlock_irqrestore(&pctl->lock, flags); 239 + 240 + return 0; 241 + } 242 + 243 + static const struct pinconf_ops pxa2xx_pconf_ops = { 244 + .pin_config_group_get = pxa2xx_pconf_group_get, 245 + .pin_config_group_set = pxa2xx_pconf_group_set, 246 + .is_generic = true, 247 + }; 248 + 249 + static struct pinctrl_desc pxa2xx_pinctrl_desc = { 250 + .confops = &pxa2xx_pconf_ops, 251 + .pctlops = &pxa2xx_pctl_ops, 252 + .pmxops = &pxa2xx_pinmux_ops, 253 + }; 254 + 255 + static const struct pxa_pinctrl_function * 256 + pxa2xx_find_function(struct pxa_pinctrl *pctl, const char *fname, 257 + const struct pxa_pinctrl_function *functions) 258 + { 259 + const struct pxa_pinctrl_function *func; 260 + 261 + for (func = functions; func->name; func++) 262 + if (!strcmp(fname, func->name)) 263 + return func; 264 + 265 + return NULL; 266 + } 267 + 268 + static int pxa2xx_build_functions(struct pxa_pinctrl *pctl) 269 + { 270 + int i; 271 + struct pxa_pinctrl_function *functions; 272 + struct pxa_desc_function *df; 273 + 274 + /* 275 + * Each pin can have at most 6 alternate functions, and 2 gpio functions 276 + * which are common to each pin. As there are more than 2 pins without 277 + * alternate function, 6 * npins is an absolute high limit of the number 278 + * of functions. 279 + */ 280 + functions = devm_kcalloc(pctl->dev, pctl->npins * 6, 281 + sizeof(*functions), GFP_KERNEL); 282 + if (!functions) 283 + return -ENOMEM; 284 + 285 + for (i = 0; i < pctl->npins; i++) 286 + for (df = pctl->ppins[i].functions; df->name; df++) 287 + if (!pxa2xx_find_function(pctl, df->name, functions)) 288 + (functions + pctl->nfuncs++)->name = df->name; 289 + pctl->functions = devm_kmemdup(pctl->dev, functions, 290 + pctl->nfuncs * sizeof(*functions), 291 + GFP_KERNEL); 292 + if (!pctl->functions) 293 + return -ENOMEM; 294 + 295 + devm_kfree(pctl->dev, functions); 296 + return 0; 297 + } 298 + 299 + static int pxa2xx_build_groups(struct pxa_pinctrl *pctl) 300 + { 301 + int i, j, ngroups; 302 + struct pxa_pinctrl_function *func; 303 + struct pxa_desc_function *df; 304 + char **gtmp; 305 + 306 + gtmp = devm_kmalloc_array(pctl->dev, pctl->npins, sizeof(*gtmp), 307 + GFP_KERNEL); 308 + if (!gtmp) 309 + return -ENOMEM; 310 + 311 + for (i = 0; i < pctl->nfuncs; i++) { 312 + ngroups = 0; 313 + for (j = 0; j < pctl->npins; j++) 314 + for (df = pctl->ppins[j].functions; df->name; 315 + df++) 316 + if (!strcmp(pctl->functions[i].name, 317 + df->name)) 318 + gtmp[ngroups++] = (char *) 319 + pctl->ppins[j].pin.name; 320 + func = pctl->functions + i; 321 + func->ngroups = ngroups; 322 + func->groups = 323 + devm_kmalloc_array(pctl->dev, ngroups, 324 + sizeof(char *), GFP_KERNEL); 325 + if (!func->groups) 326 + return -ENOMEM; 327 + 328 + memcpy(func->groups, gtmp, ngroups * sizeof(*gtmp)); 329 + } 330 + 331 + devm_kfree(pctl->dev, gtmp); 332 + return 0; 333 + } 334 + 335 + static int pxa2xx_build_state(struct pxa_pinctrl *pctl, 336 + const struct pxa_desc_pin *ppins, int npins) 337 + { 338 + struct pxa_pinctrl_group *group; 339 + struct pinctrl_pin_desc *pins; 340 + int ret, i; 341 + 342 + pctl->npins = npins; 343 + pctl->ppins = ppins; 344 + pctl->ngroups = npins; 345 + 346 + pctl->desc.npins = npins; 347 + pins = devm_kcalloc(pctl->dev, npins, sizeof(*pins), GFP_KERNEL); 348 + if (!pins) 349 + return -ENOMEM; 350 + 351 + pctl->desc.pins = pins; 352 + for (i = 0; i < npins; i++) 353 + pins[i] = ppins[i].pin; 354 + 355 + pctl->groups = devm_kmalloc_array(pctl->dev, pctl->ngroups, 356 + sizeof(*pctl->groups), GFP_KERNEL); 357 + if (!pctl->groups) 358 + return -ENOMEM; 359 + 360 + for (i = 0; i < npins; i++) { 361 + group = pctl->groups + i; 362 + group->name = ppins[i].pin.name; 363 + group->pin = ppins[i].pin.number; 364 + } 365 + 366 + ret = pxa2xx_build_functions(pctl); 367 + if (ret) 368 + return ret; 369 + 370 + ret = pxa2xx_build_groups(pctl); 371 + if (ret) 372 + return ret; 373 + 374 + return 0; 375 + } 376 + 377 + int pxa2xx_pinctrl_init(struct platform_device *pdev, 378 + const struct pxa_desc_pin *ppins, int npins, 379 + void __iomem *base_gafr[], void __iomem *base_gpdr[], 380 + void __iomem *base_pgsr[]) 381 + { 382 + struct pxa_pinctrl *pctl; 383 + int ret, i, maxpin = 0; 384 + 385 + for (i = 0; i < npins; i++) 386 + maxpin = max_t(int, ppins[i].pin.number, maxpin); 387 + 388 + pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); 389 + if (!pctl) 390 + return -ENOMEM; 391 + pctl->base_gafr = devm_kcalloc(&pdev->dev, roundup(maxpin, 16), 392 + sizeof(*pctl->base_gafr), GFP_KERNEL); 393 + pctl->base_gpdr = devm_kcalloc(&pdev->dev, roundup(maxpin, 32), 394 + sizeof(*pctl->base_gpdr), GFP_KERNEL); 395 + pctl->base_pgsr = devm_kcalloc(&pdev->dev, roundup(maxpin, 32), 396 + sizeof(*pctl->base_pgsr), GFP_KERNEL); 397 + if (!pctl->base_gafr || !pctl->base_gpdr || !pctl->base_pgsr) 398 + return -ENOMEM; 399 + 400 + platform_set_drvdata(pdev, pctl); 401 + spin_lock_init(&pctl->lock); 402 + 403 + pctl->dev = &pdev->dev; 404 + pctl->desc = pxa2xx_pinctrl_desc; 405 + pctl->desc.name = dev_name(&pdev->dev); 406 + pctl->desc.owner = THIS_MODULE; 407 + 408 + for (i = 0; i < roundup(maxpin, 16); i += 16) 409 + pctl->base_gafr[i / 16] = base_gafr[i / 16]; 410 + for (i = 0; i < roundup(maxpin, 32); i += 32) { 411 + pctl->base_gpdr[i / 32] = base_gpdr[i / 32]; 412 + pctl->base_pgsr[i / 32] = base_pgsr[i / 32]; 413 + } 414 + 415 + ret = pxa2xx_build_state(pctl, ppins, npins); 416 + if (ret) 417 + return ret; 418 + 419 + pctl->pctl_dev = pinctrl_register(&pctl->desc, &pdev->dev, pctl); 420 + if (IS_ERR(pctl->pctl_dev)) { 421 + dev_err(&pdev->dev, "couldn't register pinctrl driver\n"); 422 + return PTR_ERR(pctl->pctl_dev); 423 + } 424 + 425 + dev_info(&pdev->dev, "initialized pxa2xx pinctrl driver\n"); 426 + 427 + return 0; 428 + } 429 + 430 + int pxa2xx_pinctrl_exit(struct platform_device *pdev) 431 + { 432 + struct pxa_pinctrl *pctl = platform_get_drvdata(pdev); 433 + 434 + pinctrl_unregister(pctl->pctl_dev); 435 + return 0; 436 + }
+92
drivers/pinctrl/pxa/pinctrl-pxa2xx.h
··· 1 + /* 2 + * Marvell PXA2xx family pin control 3 + * 4 + * Copyright (C) 2015 Robert Jarzmik 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; version 2 of the License. 9 + * 10 + */ 11 + 12 + #ifndef __PINCTRL_PXA_H 13 + #define __PINCTRL_PXA_H 14 + 15 + #define PXA_FUNCTION(_dir, _af, _name) \ 16 + { \ 17 + .name = _name, \ 18 + .muxval = (_dir | (_af << 1)), \ 19 + } 20 + 21 + #define PXA_PIN(_pin, funcs...) \ 22 + { \ 23 + .pin = _pin, \ 24 + .functions = (struct pxa_desc_function[]){ \ 25 + funcs, { } }, \ 26 + } 27 + 28 + #define PXA_GPIO_PIN(_pin, funcs...) \ 29 + { \ 30 + .pin = _pin, \ 31 + .functions = (struct pxa_desc_function[]){ \ 32 + PXA_FUNCTION(0, 0, "gpio_in"), \ 33 + PXA_FUNCTION(1, 0, "gpio_out"), \ 34 + funcs, { } }, \ 35 + } 36 + 37 + #define PXA_GPIO_ONLY_PIN(_pin) \ 38 + { \ 39 + .pin = _pin, \ 40 + .functions = (struct pxa_desc_function[]){ \ 41 + PXA_FUNCTION(0, 0, "gpio_in"), \ 42 + PXA_FUNCTION(1, 0, "gpio_out"), \ 43 + { } }, \ 44 + } 45 + 46 + #define PXA_PINCTRL_PIN(pin) \ 47 + PINCTRL_PIN(pin, "P" #pin) 48 + 49 + struct pxa_desc_function { 50 + const char *name; 51 + u8 muxval; 52 + }; 53 + 54 + struct pxa_desc_pin { 55 + struct pinctrl_pin_desc pin; 56 + struct pxa_desc_function *functions; 57 + }; 58 + 59 + struct pxa_pinctrl_group { 60 + const char *name; 61 + unsigned pin; 62 + }; 63 + 64 + struct pxa_pinctrl_function { 65 + const char *name; 66 + const char **groups; 67 + unsigned ngroups; 68 + }; 69 + 70 + struct pxa_pinctrl { 71 + spinlock_t lock; 72 + void __iomem **base_gafr; 73 + void __iomem **base_gpdr; 74 + void __iomem **base_pgsr; 75 + struct device *dev; 76 + struct pinctrl_desc desc; 77 + struct pinctrl_dev *pctl_dev; 78 + unsigned npins; 79 + const struct pxa_desc_pin *ppins; 80 + unsigned ngroups; 81 + struct pxa_pinctrl_group *groups; 82 + unsigned nfuncs; 83 + struct pxa_pinctrl_function *functions; 84 + char *name; 85 + }; 86 + 87 + int pxa2xx_pinctrl_init(struct platform_device *pdev, 88 + const struct pxa_desc_pin *ppins, int npins, 89 + void __iomem *base_gafr[], void __iomem *base_gpdr[], 90 + void __iomem *base_gpsr[]); 91 + 92 + #endif /* __PINCTRL_PXA_H */
+8
drivers/pinctrl/qcom/Kconfig
··· 63 63 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 64 64 Qualcomm TLMM block found on the Qualcomm 8916 platform. 65 65 66 + config PINCTRL_MSM8996 67 + tristate "Qualcomm MSM8996 pin controller driver" 68 + depends on GPIOLIB && OF 69 + select PINCTRL_MSM 70 + help 71 + This is the pinctrl, pinmux, pinconf and gpiolib driver for the 72 + Qualcomm TLMM block found in the Qualcomm MSM8996 platform. 73 + 66 74 config PINCTRL_QDF2XXX 67 75 tristate "Qualcomm Technologies QDF2xxx pin controller driver" 68 76 depends on GPIOLIB && ACPI
+1
drivers/pinctrl/qcom/Makefile
··· 7 7 obj-$(CONFIG_PINCTRL_MSM8960) += pinctrl-msm8960.o 8 8 obj-$(CONFIG_PINCTRL_MSM8X74) += pinctrl-msm8x74.o 9 9 obj-$(CONFIG_PINCTRL_MSM8916) += pinctrl-msm8916.o 10 + obj-$(CONFIG_PINCTRL_MSM8996) += pinctrl-msm8996.o 10 11 obj-$(CONFIG_PINCTRL_QDF2XXX) += pinctrl-qdf2xxx.o 11 12 obj-$(CONFIG_PINCTRL_QCOM_SPMI_PMIC) += pinctrl-spmi-gpio.o 12 13 obj-$(CONFIG_PINCTRL_QCOM_SPMI_PMIC) += pinctrl-spmi-mpp.o
+1942
drivers/pinctrl/qcom/pinctrl-msm8996.c
··· 1 + /* 2 + * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 and 6 + * only version 2 as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope that it will be useful, 9 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + */ 13 + 14 + #include <linux/module.h> 15 + #include <linux/of.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/pinctrl/pinctrl.h> 18 + 19 + #include "pinctrl-msm.h" 20 + 21 + #define FUNCTION(fname) \ 22 + [msm_mux_##fname] = { \ 23 + .name = #fname, \ 24 + .groups = fname##_groups, \ 25 + .ngroups = ARRAY_SIZE(fname##_groups), \ 26 + } 27 + 28 + #define REG_BASE 0x0 29 + #define REG_SIZE 0x1000 30 + #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \ 31 + { \ 32 + .name = "gpio" #id, \ 33 + .pins = gpio##id##_pins, \ 34 + .npins = (unsigned)ARRAY_SIZE(gpio##id##_pins), \ 35 + .funcs = (int[]){ \ 36 + msm_mux_gpio, /* gpio mode */ \ 37 + msm_mux_##f1, \ 38 + msm_mux_##f2, \ 39 + msm_mux_##f3, \ 40 + msm_mux_##f4, \ 41 + msm_mux_##f5, \ 42 + msm_mux_##f6, \ 43 + msm_mux_##f7, \ 44 + msm_mux_##f8, \ 45 + msm_mux_##f9 \ 46 + }, \ 47 + .nfuncs = 10, \ 48 + .ctl_reg = REG_BASE + REG_SIZE * id, \ 49 + .io_reg = REG_BASE + 0x4 + REG_SIZE * id, \ 50 + .intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 51 + .intr_status_reg = REG_BASE + 0xc + REG_SIZE * id, \ 52 + .intr_target_reg = REG_BASE + 0x8 + REG_SIZE * id, \ 53 + .mux_bit = 2, \ 54 + .pull_bit = 0, \ 55 + .drv_bit = 6, \ 56 + .oe_bit = 9, \ 57 + .in_bit = 0, \ 58 + .out_bit = 1, \ 59 + .intr_enable_bit = 0, \ 60 + .intr_status_bit = 0, \ 61 + .intr_target_bit = 5, \ 62 + .intr_target_kpss_val = 3, \ 63 + .intr_raw_status_bit = 4, \ 64 + .intr_polarity_bit = 1, \ 65 + .intr_detection_bit = 2, \ 66 + .intr_detection_width = 2, \ 67 + } 68 + 69 + #define SDC_QDSD_PINGROUP(pg_name, ctl, pull, drv) \ 70 + { \ 71 + .name = #pg_name, \ 72 + .pins = pg_name##_pins, \ 73 + .npins = (unsigned)ARRAY_SIZE(pg_name##_pins), \ 74 + .ctl_reg = ctl, \ 75 + .io_reg = 0, \ 76 + .intr_cfg_reg = 0, \ 77 + .intr_status_reg = 0, \ 78 + .intr_target_reg = 0, \ 79 + .mux_bit = -1, \ 80 + .pull_bit = pull, \ 81 + .drv_bit = drv, \ 82 + .oe_bit = -1, \ 83 + .in_bit = -1, \ 84 + .out_bit = -1, \ 85 + .intr_enable_bit = -1, \ 86 + .intr_status_bit = -1, \ 87 + .intr_target_bit = -1, \ 88 + .intr_raw_status_bit = -1, \ 89 + .intr_polarity_bit = -1, \ 90 + .intr_detection_bit = -1, \ 91 + .intr_detection_width = -1, \ 92 + } 93 + static const struct pinctrl_pin_desc msm8996_pins[] = { 94 + PINCTRL_PIN(0, "GPIO_0"), 95 + PINCTRL_PIN(1, "GPIO_1"), 96 + PINCTRL_PIN(2, "GPIO_2"), 97 + PINCTRL_PIN(3, "GPIO_3"), 98 + PINCTRL_PIN(4, "GPIO_4"), 99 + PINCTRL_PIN(5, "GPIO_5"), 100 + PINCTRL_PIN(6, "GPIO_6"), 101 + PINCTRL_PIN(7, "GPIO_7"), 102 + PINCTRL_PIN(8, "GPIO_8"), 103 + PINCTRL_PIN(9, "GPIO_9"), 104 + PINCTRL_PIN(10, "GPIO_10"), 105 + PINCTRL_PIN(11, "GPIO_11"), 106 + PINCTRL_PIN(12, "GPIO_12"), 107 + PINCTRL_PIN(13, "GPIO_13"), 108 + PINCTRL_PIN(14, "GPIO_14"), 109 + PINCTRL_PIN(15, "GPIO_15"), 110 + PINCTRL_PIN(16, "GPIO_16"), 111 + PINCTRL_PIN(17, "GPIO_17"), 112 + PINCTRL_PIN(18, "GPIO_18"), 113 + PINCTRL_PIN(19, "GPIO_19"), 114 + PINCTRL_PIN(20, "GPIO_20"), 115 + PINCTRL_PIN(21, "GPIO_21"), 116 + PINCTRL_PIN(22, "GPIO_22"), 117 + PINCTRL_PIN(23, "GPIO_23"), 118 + PINCTRL_PIN(24, "GPIO_24"), 119 + PINCTRL_PIN(25, "GPIO_25"), 120 + PINCTRL_PIN(26, "GPIO_26"), 121 + PINCTRL_PIN(27, "GPIO_27"), 122 + PINCTRL_PIN(28, "GPIO_28"), 123 + PINCTRL_PIN(29, "GPIO_29"), 124 + PINCTRL_PIN(30, "GPIO_30"), 125 + PINCTRL_PIN(31, "GPIO_31"), 126 + PINCTRL_PIN(32, "GPIO_32"), 127 + PINCTRL_PIN(33, "GPIO_33"), 128 + PINCTRL_PIN(34, "GPIO_34"), 129 + PINCTRL_PIN(35, "GPIO_35"), 130 + PINCTRL_PIN(36, "GPIO_36"), 131 + PINCTRL_PIN(37, "GPIO_37"), 132 + PINCTRL_PIN(38, "GPIO_38"), 133 + PINCTRL_PIN(39, "GPIO_39"), 134 + PINCTRL_PIN(40, "GPIO_40"), 135 + PINCTRL_PIN(41, "GPIO_41"), 136 + PINCTRL_PIN(42, "GPIO_42"), 137 + PINCTRL_PIN(43, "GPIO_43"), 138 + PINCTRL_PIN(44, "GPIO_44"), 139 + PINCTRL_PIN(45, "GPIO_45"), 140 + PINCTRL_PIN(46, "GPIO_46"), 141 + PINCTRL_PIN(47, "GPIO_47"), 142 + PINCTRL_PIN(48, "GPIO_48"), 143 + PINCTRL_PIN(49, "GPIO_49"), 144 + PINCTRL_PIN(50, "GPIO_50"), 145 + PINCTRL_PIN(51, "GPIO_51"), 146 + PINCTRL_PIN(52, "GPIO_52"), 147 + PINCTRL_PIN(53, "GPIO_53"), 148 + PINCTRL_PIN(54, "GPIO_54"), 149 + PINCTRL_PIN(55, "GPIO_55"), 150 + PINCTRL_PIN(56, "GPIO_56"), 151 + PINCTRL_PIN(57, "GPIO_57"), 152 + PINCTRL_PIN(58, "GPIO_58"), 153 + PINCTRL_PIN(59, "GPIO_59"), 154 + PINCTRL_PIN(60, "GPIO_60"), 155 + PINCTRL_PIN(61, "GPIO_61"), 156 + PINCTRL_PIN(62, "GPIO_62"), 157 + PINCTRL_PIN(63, "GPIO_63"), 158 + PINCTRL_PIN(64, "GPIO_64"), 159 + PINCTRL_PIN(65, "GPIO_65"), 160 + PINCTRL_PIN(66, "GPIO_66"), 161 + PINCTRL_PIN(67, "GPIO_67"), 162 + PINCTRL_PIN(68, "GPIO_68"), 163 + PINCTRL_PIN(69, "GPIO_69"), 164 + PINCTRL_PIN(70, "GPIO_70"), 165 + PINCTRL_PIN(71, "GPIO_71"), 166 + PINCTRL_PIN(72, "GPIO_72"), 167 + PINCTRL_PIN(73, "GPIO_73"), 168 + PINCTRL_PIN(74, "GPIO_74"), 169 + PINCTRL_PIN(75, "GPIO_75"), 170 + PINCTRL_PIN(76, "GPIO_76"), 171 + PINCTRL_PIN(77, "GPIO_77"), 172 + PINCTRL_PIN(78, "GPIO_78"), 173 + PINCTRL_PIN(79, "GPIO_79"), 174 + PINCTRL_PIN(80, "GPIO_80"), 175 + PINCTRL_PIN(81, "GPIO_81"), 176 + PINCTRL_PIN(82, "GPIO_82"), 177 + PINCTRL_PIN(83, "GPIO_83"), 178 + PINCTRL_PIN(84, "GPIO_84"), 179 + PINCTRL_PIN(85, "GPIO_85"), 180 + PINCTRL_PIN(86, "GPIO_86"), 181 + PINCTRL_PIN(87, "GPIO_87"), 182 + PINCTRL_PIN(88, "GPIO_88"), 183 + PINCTRL_PIN(89, "GPIO_89"), 184 + PINCTRL_PIN(90, "GPIO_90"), 185 + PINCTRL_PIN(91, "GPIO_91"), 186 + PINCTRL_PIN(92, "GPIO_92"), 187 + PINCTRL_PIN(93, "GPIO_93"), 188 + PINCTRL_PIN(94, "GPIO_94"), 189 + PINCTRL_PIN(95, "GPIO_95"), 190 + PINCTRL_PIN(96, "GPIO_96"), 191 + PINCTRL_PIN(97, "GPIO_97"), 192 + PINCTRL_PIN(98, "GPIO_98"), 193 + PINCTRL_PIN(99, "GPIO_99"), 194 + PINCTRL_PIN(100, "GPIO_100"), 195 + PINCTRL_PIN(101, "GPIO_101"), 196 + PINCTRL_PIN(102, "GPIO_102"), 197 + PINCTRL_PIN(103, "GPIO_103"), 198 + PINCTRL_PIN(104, "GPIO_104"), 199 + PINCTRL_PIN(105, "GPIO_105"), 200 + PINCTRL_PIN(106, "GPIO_106"), 201 + PINCTRL_PIN(107, "GPIO_107"), 202 + PINCTRL_PIN(108, "GPIO_108"), 203 + PINCTRL_PIN(109, "GPIO_109"), 204 + PINCTRL_PIN(110, "GPIO_110"), 205 + PINCTRL_PIN(111, "GPIO_111"), 206 + PINCTRL_PIN(112, "GPIO_112"), 207 + PINCTRL_PIN(113, "GPIO_113"), 208 + PINCTRL_PIN(114, "GPIO_114"), 209 + PINCTRL_PIN(115, "GPIO_115"), 210 + PINCTRL_PIN(116, "GPIO_116"), 211 + PINCTRL_PIN(117, "GPIO_117"), 212 + PINCTRL_PIN(118, "GPIO_118"), 213 + PINCTRL_PIN(119, "GPIO_119"), 214 + PINCTRL_PIN(120, "GPIO_120"), 215 + PINCTRL_PIN(121, "GPIO_121"), 216 + PINCTRL_PIN(122, "GPIO_122"), 217 + PINCTRL_PIN(123, "GPIO_123"), 218 + PINCTRL_PIN(124, "GPIO_124"), 219 + PINCTRL_PIN(125, "GPIO_125"), 220 + PINCTRL_PIN(126, "GPIO_126"), 221 + PINCTRL_PIN(127, "GPIO_127"), 222 + PINCTRL_PIN(128, "GPIO_128"), 223 + PINCTRL_PIN(129, "GPIO_129"), 224 + PINCTRL_PIN(130, "GPIO_130"), 225 + PINCTRL_PIN(131, "GPIO_131"), 226 + PINCTRL_PIN(132, "GPIO_132"), 227 + PINCTRL_PIN(133, "GPIO_133"), 228 + PINCTRL_PIN(134, "GPIO_134"), 229 + PINCTRL_PIN(135, "GPIO_135"), 230 + PINCTRL_PIN(136, "GPIO_136"), 231 + PINCTRL_PIN(137, "GPIO_137"), 232 + PINCTRL_PIN(138, "GPIO_138"), 233 + PINCTRL_PIN(139, "GPIO_139"), 234 + PINCTRL_PIN(140, "GPIO_140"), 235 + PINCTRL_PIN(141, "GPIO_141"), 236 + PINCTRL_PIN(142, "GPIO_142"), 237 + PINCTRL_PIN(143, "GPIO_143"), 238 + PINCTRL_PIN(144, "GPIO_144"), 239 + PINCTRL_PIN(145, "GPIO_145"), 240 + PINCTRL_PIN(146, "GPIO_146"), 241 + PINCTRL_PIN(147, "GPIO_147"), 242 + PINCTRL_PIN(148, "GPIO_148"), 243 + PINCTRL_PIN(149, "GPIO_149"), 244 + PINCTRL_PIN(150, "SDC1_CLK"), 245 + PINCTRL_PIN(151, "SDC1_CMD"), 246 + PINCTRL_PIN(152, "SDC1_DATA"), 247 + PINCTRL_PIN(153, "SDC2_CLK"), 248 + PINCTRL_PIN(154, "SDC2_CMD"), 249 + PINCTRL_PIN(155, "SDC2_DATA"), 250 + PINCTRL_PIN(156, "SDC1_RCLK"), 251 + }; 252 + 253 + #define DECLARE_MSM_GPIO_PINS(pin) \ 254 + static const unsigned int gpio##pin##_pins[] = { pin } 255 + DECLARE_MSM_GPIO_PINS(0); 256 + DECLARE_MSM_GPIO_PINS(1); 257 + DECLARE_MSM_GPIO_PINS(2); 258 + DECLARE_MSM_GPIO_PINS(3); 259 + DECLARE_MSM_GPIO_PINS(4); 260 + DECLARE_MSM_GPIO_PINS(5); 261 + DECLARE_MSM_GPIO_PINS(6); 262 + DECLARE_MSM_GPIO_PINS(7); 263 + DECLARE_MSM_GPIO_PINS(8); 264 + DECLARE_MSM_GPIO_PINS(9); 265 + DECLARE_MSM_GPIO_PINS(10); 266 + DECLARE_MSM_GPIO_PINS(11); 267 + DECLARE_MSM_GPIO_PINS(12); 268 + DECLARE_MSM_GPIO_PINS(13); 269 + DECLARE_MSM_GPIO_PINS(14); 270 + DECLARE_MSM_GPIO_PINS(15); 271 + DECLARE_MSM_GPIO_PINS(16); 272 + DECLARE_MSM_GPIO_PINS(17); 273 + DECLARE_MSM_GPIO_PINS(18); 274 + DECLARE_MSM_GPIO_PINS(19); 275 + DECLARE_MSM_GPIO_PINS(20); 276 + DECLARE_MSM_GPIO_PINS(21); 277 + DECLARE_MSM_GPIO_PINS(22); 278 + DECLARE_MSM_GPIO_PINS(23); 279 + DECLARE_MSM_GPIO_PINS(24); 280 + DECLARE_MSM_GPIO_PINS(25); 281 + DECLARE_MSM_GPIO_PINS(26); 282 + DECLARE_MSM_GPIO_PINS(27); 283 + DECLARE_MSM_GPIO_PINS(28); 284 + DECLARE_MSM_GPIO_PINS(29); 285 + DECLARE_MSM_GPIO_PINS(30); 286 + DECLARE_MSM_GPIO_PINS(31); 287 + DECLARE_MSM_GPIO_PINS(32); 288 + DECLARE_MSM_GPIO_PINS(33); 289 + DECLARE_MSM_GPIO_PINS(34); 290 + DECLARE_MSM_GPIO_PINS(35); 291 + DECLARE_MSM_GPIO_PINS(36); 292 + DECLARE_MSM_GPIO_PINS(37); 293 + DECLARE_MSM_GPIO_PINS(38); 294 + DECLARE_MSM_GPIO_PINS(39); 295 + DECLARE_MSM_GPIO_PINS(40); 296 + DECLARE_MSM_GPIO_PINS(41); 297 + DECLARE_MSM_GPIO_PINS(42); 298 + DECLARE_MSM_GPIO_PINS(43); 299 + DECLARE_MSM_GPIO_PINS(44); 300 + DECLARE_MSM_GPIO_PINS(45); 301 + DECLARE_MSM_GPIO_PINS(46); 302 + DECLARE_MSM_GPIO_PINS(47); 303 + DECLARE_MSM_GPIO_PINS(48); 304 + DECLARE_MSM_GPIO_PINS(49); 305 + DECLARE_MSM_GPIO_PINS(50); 306 + DECLARE_MSM_GPIO_PINS(51); 307 + DECLARE_MSM_GPIO_PINS(52); 308 + DECLARE_MSM_GPIO_PINS(53); 309 + DECLARE_MSM_GPIO_PINS(54); 310 + DECLARE_MSM_GPIO_PINS(55); 311 + DECLARE_MSM_GPIO_PINS(56); 312 + DECLARE_MSM_GPIO_PINS(57); 313 + DECLARE_MSM_GPIO_PINS(58); 314 + DECLARE_MSM_GPIO_PINS(59); 315 + DECLARE_MSM_GPIO_PINS(60); 316 + DECLARE_MSM_GPIO_PINS(61); 317 + DECLARE_MSM_GPIO_PINS(62); 318 + DECLARE_MSM_GPIO_PINS(63); 319 + DECLARE_MSM_GPIO_PINS(64); 320 + DECLARE_MSM_GPIO_PINS(65); 321 + DECLARE_MSM_GPIO_PINS(66); 322 + DECLARE_MSM_GPIO_PINS(67); 323 + DECLARE_MSM_GPIO_PINS(68); 324 + DECLARE_MSM_GPIO_PINS(69); 325 + DECLARE_MSM_GPIO_PINS(70); 326 + DECLARE_MSM_GPIO_PINS(71); 327 + DECLARE_MSM_GPIO_PINS(72); 328 + DECLARE_MSM_GPIO_PINS(73); 329 + DECLARE_MSM_GPIO_PINS(74); 330 + DECLARE_MSM_GPIO_PINS(75); 331 + DECLARE_MSM_GPIO_PINS(76); 332 + DECLARE_MSM_GPIO_PINS(77); 333 + DECLARE_MSM_GPIO_PINS(78); 334 + DECLARE_MSM_GPIO_PINS(79); 335 + DECLARE_MSM_GPIO_PINS(80); 336 + DECLARE_MSM_GPIO_PINS(81); 337 + DECLARE_MSM_GPIO_PINS(82); 338 + DECLARE_MSM_GPIO_PINS(83); 339 + DECLARE_MSM_GPIO_PINS(84); 340 + DECLARE_MSM_GPIO_PINS(85); 341 + DECLARE_MSM_GPIO_PINS(86); 342 + DECLARE_MSM_GPIO_PINS(87); 343 + DECLARE_MSM_GPIO_PINS(88); 344 + DECLARE_MSM_GPIO_PINS(89); 345 + DECLARE_MSM_GPIO_PINS(90); 346 + DECLARE_MSM_GPIO_PINS(91); 347 + DECLARE_MSM_GPIO_PINS(92); 348 + DECLARE_MSM_GPIO_PINS(93); 349 + DECLARE_MSM_GPIO_PINS(94); 350 + DECLARE_MSM_GPIO_PINS(95); 351 + DECLARE_MSM_GPIO_PINS(96); 352 + DECLARE_MSM_GPIO_PINS(97); 353 + DECLARE_MSM_GPIO_PINS(98); 354 + DECLARE_MSM_GPIO_PINS(99); 355 + DECLARE_MSM_GPIO_PINS(100); 356 + DECLARE_MSM_GPIO_PINS(101); 357 + DECLARE_MSM_GPIO_PINS(102); 358 + DECLARE_MSM_GPIO_PINS(103); 359 + DECLARE_MSM_GPIO_PINS(104); 360 + DECLARE_MSM_GPIO_PINS(105); 361 + DECLARE_MSM_GPIO_PINS(106); 362 + DECLARE_MSM_GPIO_PINS(107); 363 + DECLARE_MSM_GPIO_PINS(108); 364 + DECLARE_MSM_GPIO_PINS(109); 365 + DECLARE_MSM_GPIO_PINS(110); 366 + DECLARE_MSM_GPIO_PINS(111); 367 + DECLARE_MSM_GPIO_PINS(112); 368 + DECLARE_MSM_GPIO_PINS(113); 369 + DECLARE_MSM_GPIO_PINS(114); 370 + DECLARE_MSM_GPIO_PINS(115); 371 + DECLARE_MSM_GPIO_PINS(116); 372 + DECLARE_MSM_GPIO_PINS(117); 373 + DECLARE_MSM_GPIO_PINS(118); 374 + DECLARE_MSM_GPIO_PINS(119); 375 + DECLARE_MSM_GPIO_PINS(120); 376 + DECLARE_MSM_GPIO_PINS(121); 377 + DECLARE_MSM_GPIO_PINS(122); 378 + DECLARE_MSM_GPIO_PINS(123); 379 + DECLARE_MSM_GPIO_PINS(124); 380 + DECLARE_MSM_GPIO_PINS(125); 381 + DECLARE_MSM_GPIO_PINS(126); 382 + DECLARE_MSM_GPIO_PINS(127); 383 + DECLARE_MSM_GPIO_PINS(128); 384 + DECLARE_MSM_GPIO_PINS(129); 385 + DECLARE_MSM_GPIO_PINS(130); 386 + DECLARE_MSM_GPIO_PINS(131); 387 + DECLARE_MSM_GPIO_PINS(132); 388 + DECLARE_MSM_GPIO_PINS(133); 389 + DECLARE_MSM_GPIO_PINS(134); 390 + DECLARE_MSM_GPIO_PINS(135); 391 + DECLARE_MSM_GPIO_PINS(136); 392 + DECLARE_MSM_GPIO_PINS(137); 393 + DECLARE_MSM_GPIO_PINS(138); 394 + DECLARE_MSM_GPIO_PINS(139); 395 + DECLARE_MSM_GPIO_PINS(140); 396 + DECLARE_MSM_GPIO_PINS(141); 397 + DECLARE_MSM_GPIO_PINS(142); 398 + DECLARE_MSM_GPIO_PINS(143); 399 + DECLARE_MSM_GPIO_PINS(144); 400 + DECLARE_MSM_GPIO_PINS(145); 401 + DECLARE_MSM_GPIO_PINS(146); 402 + DECLARE_MSM_GPIO_PINS(147); 403 + DECLARE_MSM_GPIO_PINS(148); 404 + DECLARE_MSM_GPIO_PINS(149); 405 + 406 + static const unsigned int sdc1_clk_pins[] = { 150 }; 407 + static const unsigned int sdc1_cmd_pins[] = { 151 }; 408 + static const unsigned int sdc1_data_pins[] = { 152 }; 409 + static const unsigned int sdc2_clk_pins[] = { 153 }; 410 + static const unsigned int sdc2_cmd_pins[] = { 154 }; 411 + static const unsigned int sdc2_data_pins[] = { 155 }; 412 + static const unsigned int sdc1_rclk_pins[] = { 156 }; 413 + 414 + enum msm8996_functions { 415 + msm_mux_adsp_ext, 416 + msm_mux_atest_bbrx0, 417 + msm_mux_atest_bbrx1, 418 + msm_mux_atest_char, 419 + msm_mux_atest_char0, 420 + msm_mux_atest_char1, 421 + msm_mux_atest_char2, 422 + msm_mux_atest_char3, 423 + msm_mux_atest_gpsadc0, 424 + msm_mux_atest_gpsadc1, 425 + msm_mux_atest_tsens, 426 + msm_mux_atest_tsens2, 427 + msm_mux_atest_usb1, 428 + msm_mux_atest_usb10, 429 + msm_mux_atest_usb11, 430 + msm_mux_atest_usb12, 431 + msm_mux_atest_usb13, 432 + msm_mux_atest_usb2, 433 + msm_mux_atest_usb20, 434 + msm_mux_atest_usb21, 435 + msm_mux_atest_usb22, 436 + msm_mux_atest_usb23, 437 + msm_mux_audio_ref, 438 + msm_mux_bimc_dte0, 439 + msm_mux_bimc_dte1, 440 + msm_mux_blsp10_spi, 441 + msm_mux_blsp11_i2c_scl_b, 442 + msm_mux_blsp11_i2c_sda_b, 443 + msm_mux_blsp11_uart_rx_b, 444 + msm_mux_blsp11_uart_tx_b, 445 + msm_mux_blsp1_spi, 446 + msm_mux_blsp2_spi, 447 + msm_mux_blsp_i2c1, 448 + msm_mux_blsp_i2c10, 449 + msm_mux_blsp_i2c11, 450 + msm_mux_blsp_i2c12, 451 + msm_mux_blsp_i2c2, 452 + msm_mux_blsp_i2c3, 453 + msm_mux_blsp_i2c4, 454 + msm_mux_blsp_i2c5, 455 + msm_mux_blsp_i2c6, 456 + msm_mux_blsp_i2c7, 457 + msm_mux_blsp_i2c8, 458 + msm_mux_blsp_i2c9, 459 + msm_mux_blsp_spi1, 460 + msm_mux_blsp_spi10, 461 + msm_mux_blsp_spi11, 462 + msm_mux_blsp_spi12, 463 + msm_mux_blsp_spi2, 464 + msm_mux_blsp_spi3, 465 + msm_mux_blsp_spi4, 466 + msm_mux_blsp_spi5, 467 + msm_mux_blsp_spi6, 468 + msm_mux_blsp_spi7, 469 + msm_mux_blsp_spi8, 470 + msm_mux_blsp_spi9, 471 + msm_mux_blsp_uart1, 472 + msm_mux_blsp_uart10, 473 + msm_mux_blsp_uart11, 474 + msm_mux_blsp_uart12, 475 + msm_mux_blsp_uart2, 476 + msm_mux_blsp_uart3, 477 + msm_mux_blsp_uart4, 478 + msm_mux_blsp_uart5, 479 + msm_mux_blsp_uart6, 480 + msm_mux_blsp_uart7, 481 + msm_mux_blsp_uart8, 482 + msm_mux_blsp_uart9, 483 + msm_mux_blsp_uim1, 484 + msm_mux_blsp_uim10, 485 + msm_mux_blsp_uim11, 486 + msm_mux_blsp_uim12, 487 + msm_mux_blsp_uim2, 488 + msm_mux_blsp_uim3, 489 + msm_mux_blsp_uim4, 490 + msm_mux_blsp_uim5, 491 + msm_mux_blsp_uim6, 492 + msm_mux_blsp_uim7, 493 + msm_mux_blsp_uim8, 494 + msm_mux_blsp_uim9, 495 + msm_mux_btfm_slimbus, 496 + msm_mux_cam_mclk, 497 + msm_mux_cci_async, 498 + msm_mux_cci_i2c, 499 + msm_mux_cci_timer0, 500 + msm_mux_cci_timer1, 501 + msm_mux_cci_timer2, 502 + msm_mux_cci_timer3, 503 + msm_mux_cci_timer4, 504 + msm_mux_cri_trng, 505 + msm_mux_cri_trng0, 506 + msm_mux_cri_trng1, 507 + msm_mux_dac_calib0, 508 + msm_mux_dac_calib1, 509 + msm_mux_dac_calib10, 510 + msm_mux_dac_calib11, 511 + msm_mux_dac_calib12, 512 + msm_mux_dac_calib13, 513 + msm_mux_dac_calib14, 514 + msm_mux_dac_calib15, 515 + msm_mux_dac_calib16, 516 + msm_mux_dac_calib17, 517 + msm_mux_dac_calib18, 518 + msm_mux_dac_calib19, 519 + msm_mux_dac_calib2, 520 + msm_mux_dac_calib20, 521 + msm_mux_dac_calib21, 522 + msm_mux_dac_calib22, 523 + msm_mux_dac_calib23, 524 + msm_mux_dac_calib24, 525 + msm_mux_dac_calib25, 526 + msm_mux_dac_calib26, 527 + msm_mux_dac_calib3, 528 + msm_mux_dac_calib4, 529 + msm_mux_dac_calib5, 530 + msm_mux_dac_calib6, 531 + msm_mux_dac_calib7, 532 + msm_mux_dac_calib8, 533 + msm_mux_dac_calib9, 534 + msm_mux_dac_gpio, 535 + msm_mux_dbg_out, 536 + msm_mux_ddr_bist, 537 + msm_mux_edp_hot, 538 + msm_mux_edp_lcd, 539 + msm_mux_gcc_gp1_clk_a, 540 + msm_mux_gcc_gp1_clk_b, 541 + msm_mux_gcc_gp2_clk_a, 542 + msm_mux_gcc_gp2_clk_b, 543 + msm_mux_gcc_gp3_clk_a, 544 + msm_mux_gcc_gp3_clk_b, 545 + msm_mux_gsm_tx, 546 + msm_mux_hdmi_cec, 547 + msm_mux_hdmi_ddc, 548 + msm_mux_hdmi_hot, 549 + msm_mux_hdmi_rcv, 550 + msm_mux_isense_dbg, 551 + msm_mux_ldo_en, 552 + msm_mux_ldo_update, 553 + msm_mux_lpass_slimbus, 554 + msm_mux_m_voc, 555 + msm_mux_mdp_vsync, 556 + msm_mux_mdp_vsync_p_b, 557 + msm_mux_mdp_vsync_s_b, 558 + msm_mux_modem_tsync, 559 + msm_mux_mss_lte, 560 + msm_mux_nav_dr, 561 + msm_mux_nav_pps, 562 + msm_mux_pa_indicator, 563 + msm_mux_pci_e0, 564 + msm_mux_pci_e1, 565 + msm_mux_pci_e2, 566 + msm_mux_pll_bypassnl, 567 + msm_mux_pll_reset, 568 + msm_mux_pri_mi2s, 569 + msm_mux_prng_rosc, 570 + msm_mux_pwr_crypto, 571 + msm_mux_pwr_modem, 572 + msm_mux_pwr_nav, 573 + msm_mux_qdss_cti, 574 + msm_mux_qdss_cti_trig_in_a, 575 + msm_mux_qdss_cti_trig_in_b, 576 + msm_mux_qdss_cti_trig_out_a, 577 + msm_mux_qdss_cti_trig_out_b, 578 + msm_mux_qdss_stm0, 579 + msm_mux_qdss_stm1, 580 + msm_mux_qdss_stm10, 581 + msm_mux_qdss_stm11, 582 + msm_mux_qdss_stm12, 583 + msm_mux_qdss_stm13, 584 + msm_mux_qdss_stm14, 585 + msm_mux_qdss_stm15, 586 + msm_mux_qdss_stm16, 587 + msm_mux_qdss_stm17, 588 + msm_mux_qdss_stm18, 589 + msm_mux_qdss_stm19, 590 + msm_mux_qdss_stm2, 591 + msm_mux_qdss_stm20, 592 + msm_mux_qdss_stm21, 593 + msm_mux_qdss_stm22, 594 + msm_mux_qdss_stm23, 595 + msm_mux_qdss_stm24, 596 + msm_mux_qdss_stm25, 597 + msm_mux_qdss_stm26, 598 + msm_mux_qdss_stm27, 599 + msm_mux_qdss_stm28, 600 + msm_mux_qdss_stm29, 601 + msm_mux_qdss_stm3, 602 + msm_mux_qdss_stm30, 603 + msm_mux_qdss_stm31, 604 + msm_mux_qdss_stm4, 605 + msm_mux_qdss_stm5, 606 + msm_mux_qdss_stm6, 607 + msm_mux_qdss_stm7, 608 + msm_mux_qdss_stm8, 609 + msm_mux_qdss_stm9, 610 + msm_mux_qdss_traceclk_a, 611 + msm_mux_qdss_traceclk_b, 612 + msm_mux_qdss_tracectl_a, 613 + msm_mux_qdss_tracectl_b, 614 + msm_mux_qdss_tracedata_11, 615 + msm_mux_qdss_tracedata_12, 616 + msm_mux_qdss_tracedata_a, 617 + msm_mux_qdss_tracedata_b, 618 + msm_mux_qspi0, 619 + msm_mux_qspi1, 620 + msm_mux_qspi2, 621 + msm_mux_qspi3, 622 + msm_mux_qspi_clk, 623 + msm_mux_qspi_cs, 624 + msm_mux_qua_mi2s, 625 + msm_mux_sd_card, 626 + msm_mux_sd_write, 627 + msm_mux_sdc40, 628 + msm_mux_sdc41, 629 + msm_mux_sdc42, 630 + msm_mux_sdc43, 631 + msm_mux_sdc4_clk, 632 + msm_mux_sdc4_cmd, 633 + msm_mux_sec_mi2s, 634 + msm_mux_spkr_i2s, 635 + msm_mux_ssbi1, 636 + msm_mux_ssbi2, 637 + msm_mux_ssc_irq, 638 + msm_mux_ter_mi2s, 639 + msm_mux_tsense_pwm1, 640 + msm_mux_tsense_pwm2, 641 + msm_mux_tsif1_clk, 642 + msm_mux_tsif1_data, 643 + msm_mux_tsif1_en, 644 + msm_mux_tsif1_error, 645 + msm_mux_tsif1_sync, 646 + msm_mux_tsif2_clk, 647 + msm_mux_tsif2_data, 648 + msm_mux_tsif2_en, 649 + msm_mux_tsif2_error, 650 + msm_mux_tsif2_sync, 651 + msm_mux_uim1, 652 + msm_mux_uim2, 653 + msm_mux_uim3, 654 + msm_mux_uim4, 655 + msm_mux_uim_batt, 656 + msm_mux_vfr_1, 657 + msm_mux_gpio, 658 + msm_mux_NA, 659 + }; 660 + 661 + static const char * const gpio_groups[] = { 662 + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", 663 + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", 664 + "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", 665 + "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", 666 + "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35", 667 + "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", 668 + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", 669 + "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", 670 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 671 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70", 672 + "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", 673 + "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84", 674 + "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91", 675 + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", 676 + "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104", 677 + "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110", 678 + "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116", 679 + "gpio117", "gpio118", "gpio119", "gpio120", "gpio121", "gpio122", 680 + "gpio123", "gpio124", "gpio125", "gpio126", "gpio127", "gpio128", 681 + "gpio129", "gpio130", "gpio131", "gpio132", "gpio133", "gpio134", 682 + "gpio135", "gpio136", "gpio137", "gpio138", "gpio139", "gpio140", 683 + "gpio141", "gpio142", "gpio143", "gpio144", "gpio145", "gpio146", 684 + "gpio147", "gpio148", "gpio149" 685 + }; 686 + 687 + 688 + static const char * const blsp_uart1_groups[] = { 689 + "gpio0", "gpio1", "gpio2", "gpio3", 690 + }; 691 + static const char * const blsp_spi1_groups[] = { 692 + "gpio0", "gpio1", "gpio2", "gpio3", 693 + }; 694 + static const char * const blsp_i2c1_groups[] = { 695 + "gpio2", "gpio3", 696 + }; 697 + static const char * const blsp_uim1_groups[] = { 698 + "gpio0", "gpio1", 699 + }; 700 + static const char * const atest_tsens_groups[] = { 701 + "gpio3", 702 + }; 703 + static const char * const bimc_dte1_groups[] = { 704 + "gpio3", "gpio5", 705 + }; 706 + static const char * const blsp_spi8_groups[] = { 707 + "gpio4", "gpio5", "gpio6", "gpio7", 708 + }; 709 + static const char * const blsp_uart8_groups[] = { 710 + "gpio4", "gpio5", "gpio6", "gpio7", 711 + }; 712 + static const char * const blsp_uim8_groups[] = { 713 + "gpio4", "gpio5", 714 + }; 715 + static const char * const qdss_cti_trig_out_b_groups[] = { 716 + "gpio4", 717 + }; 718 + static const char * const dac_calib0_groups[] = { 719 + "gpio4", "gpio41", 720 + }; 721 + static const char * const bimc_dte0_groups[] = { 722 + "gpio4", "gpio6", 723 + }; 724 + static const char * const qdss_cti_trig_in_b_groups[] = { 725 + "gpio5", 726 + }; 727 + static const char * const dac_calib1_groups[] = { 728 + "gpio5", "gpio42", 729 + }; 730 + static const char * const dac_calib2_groups[] = { 731 + "gpio6", "gpio43", 732 + }; 733 + static const char * const atest_tsens2_groups[] = { 734 + "gpio7", 735 + }; 736 + static const char * const blsp_spi10_groups[] = { 737 + "gpio8", "gpio9", "gpio10", "gpio11", 738 + }; 739 + static const char * const blsp_uart10_groups[] = { 740 + "gpio8", "gpio9", "gpio10", "gpio11", 741 + }; 742 + static const char * const blsp_uim10_groups[] = { 743 + "gpio8", "gpio9", 744 + }; 745 + static const char * const atest_bbrx1_groups[] = { 746 + "gpio8", 747 + }; 748 + static const char * const atest_usb12_groups[] = { 749 + "gpio9", 750 + }; 751 + static const char * const mdp_vsync_groups[] = { 752 + "gpio10", "gpio11", "gpio12", 753 + }; 754 + static const char * const edp_lcd_groups[] = { 755 + "gpio10", 756 + }; 757 + static const char * const blsp_i2c10_groups[] = { 758 + "gpio10", "gpio11", 759 + }; 760 + static const char * const atest_usb11_groups[] = { 761 + "gpio10", 762 + }; 763 + static const char * const atest_gpsadc0_groups[] = { 764 + "gpio11", 765 + }; 766 + static const char * const edp_hot_groups[] = { 767 + "gpio11", 768 + }; 769 + static const char * const atest_usb10_groups[] = { 770 + "gpio11", 771 + }; 772 + static const char * const m_voc_groups[] = { 773 + "gpio12", 774 + }; 775 + static const char * const dac_gpio_groups[] = { 776 + "gpio12", 777 + }; 778 + static const char * const atest_char_groups[] = { 779 + "gpio12", 780 + }; 781 + static const char * const cam_mclk_groups[] = { 782 + "gpio13", "gpio14", "gpio15", "gpio16", 783 + }; 784 + static const char * const pll_bypassnl_groups[] = { 785 + "gpio13", 786 + }; 787 + static const char * const qdss_stm7_groups[] = { 788 + "gpio13", 789 + }; 790 + static const char * const blsp_i2c8_groups[] = { 791 + "gpio6", "gpio7", 792 + }; 793 + static const char * const atest_usb1_groups[] = { 794 + "gpio7", 795 + }; 796 + static const char * const atest_usb13_groups[] = { 797 + "gpio8", 798 + }; 799 + static const char * const atest_bbrx0_groups[] = { 800 + "gpio9", 801 + }; 802 + static const char * const atest_gpsadc1_groups[] = { 803 + "gpio10", 804 + }; 805 + static const char * const qdss_tracedata_b_groups[] = { 806 + "gpio13", "gpio14", "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", 807 + "gpio21", "gpio22", "gpio23", "gpio26", "gpio29", "gpio57", "gpio58", 808 + "gpio92", "gpio93", 809 + }; 810 + static const char * const pll_reset_groups[] = { 811 + "gpio14", 812 + }; 813 + static const char * const qdss_stm6_groups[] = { 814 + "gpio14", 815 + }; 816 + static const char * const qdss_stm5_groups[] = { 817 + "gpio15", 818 + }; 819 + static const char * const qdss_stm4_groups[] = { 820 + "gpio16", 821 + }; 822 + static const char * const atest_usb2_groups[] = { 823 + "gpio16", 824 + }; 825 + static const char * const dac_calib3_groups[] = { 826 + "gpio17", "gpio44", 827 + }; 828 + static const char * const cci_i2c_groups[] = { 829 + "gpio17", "gpio18", "gpio19", "gpio20", 830 + }; 831 + static const char * const qdss_stm3_groups[] = { 832 + "gpio17", 833 + }; 834 + static const char * const atest_usb23_groups[] = { 835 + "gpio17", 836 + }; 837 + static const char * const atest_char3_groups[] = { 838 + "gpio17", 839 + }; 840 + static const char * const dac_calib4_groups[] = { 841 + "gpio18", "gpio45", 842 + }; 843 + static const char * const qdss_stm2_groups[] = { 844 + "gpio18", 845 + }; 846 + static const char * const atest_usb22_groups[] = { 847 + "gpio18", 848 + }; 849 + static const char * const atest_char2_groups[] = { 850 + "gpio18", 851 + }; 852 + static const char * const dac_calib5_groups[] = { 853 + "gpio19", "gpio46", 854 + }; 855 + static const char * const qdss_stm1_groups[] = { 856 + "gpio19", 857 + }; 858 + static const char * const atest_usb21_groups[] = { 859 + "gpio19", 860 + }; 861 + static const char * const atest_char1_groups[] = { 862 + "gpio19", 863 + }; 864 + static const char * const dac_calib6_groups[] = { 865 + "gpio20", "gpio47", 866 + }; 867 + static const char * const dbg_out_groups[] = { 868 + "gpio20", 869 + }; 870 + static const char * const qdss_stm0_groups[] = { 871 + "gpio20", 872 + }; 873 + static const char * const atest_usb20_groups[] = { 874 + "gpio20", 875 + }; 876 + static const char * const atest_char0_groups[] = { 877 + "gpio20", 878 + }; 879 + static const char * const dac_calib7_groups[] = { 880 + "gpio21", "gpio48", 881 + }; 882 + static const char * const cci_timer0_groups[] = { 883 + "gpio21", 884 + }; 885 + static const char * const qdss_stm13_groups[] = { 886 + "gpio21", 887 + }; 888 + static const char * const dac_calib8_groups[] = { 889 + "gpio22", "gpio49", 890 + }; 891 + static const char * const cci_timer1_groups[] = { 892 + "gpio22", 893 + }; 894 + static const char * const qdss_stm12_groups[] = { 895 + "gpio22", 896 + }; 897 + static const char * const dac_calib9_groups[] = { 898 + "gpio23", "gpio50", 899 + }; 900 + static const char * const cci_timer2_groups[] = { 901 + "gpio23", 902 + }; 903 + static const char * const qdss_stm11_groups[] = { 904 + "gpio23", 905 + }; 906 + static const char * const dac_calib10_groups[] = { 907 + "gpio24", "gpio51", 908 + }; 909 + static const char * const cci_timer3_groups[] = { 910 + "gpio24", 911 + }; 912 + static const char * const cci_async_groups[] = { 913 + "gpio24", "gpio25", "gpio26", 914 + }; 915 + static const char * const blsp1_spi_groups[] = { 916 + "gpio24", "gpio27", "gpio28", "gpio90", 917 + }; 918 + static const char * const qdss_stm10_groups[] = { 919 + "gpio24", 920 + }; 921 + static const char * const qdss_cti_trig_in_a_groups[] = { 922 + "gpio24", 923 + }; 924 + static const char * const dac_calib11_groups[] = { 925 + "gpio25", "gpio52", 926 + }; 927 + static const char * const cci_timer4_groups[] = { 928 + "gpio25", 929 + }; 930 + static const char * const blsp_spi6_groups[] = { 931 + "gpio25", "gpio26", "gpio27", "gpio28", 932 + }; 933 + static const char * const blsp_uart6_groups[] = { 934 + "gpio25", "gpio26", "gpio27", "gpio28", 935 + }; 936 + static const char * const blsp_uim6_groups[] = { 937 + "gpio25", "gpio26", 938 + }; 939 + static const char * const blsp2_spi_groups[] = { 940 + "gpio25", "gpio29", "gpio30", 941 + }; 942 + static const char * const qdss_stm9_groups[] = { 943 + "gpio25", 944 + }; 945 + static const char * const qdss_cti_trig_out_a_groups[] = { 946 + "gpio25", 947 + }; 948 + static const char * const dac_calib12_groups[] = { 949 + "gpio26", "gpio53", 950 + }; 951 + static const char * const qdss_stm8_groups[] = { 952 + "gpio26", 953 + }; 954 + static const char * const dac_calib13_groups[] = { 955 + "gpio27", "gpio54", 956 + }; 957 + static const char * const blsp_i2c6_groups[] = { 958 + "gpio27", "gpio28", 959 + }; 960 + static const char * const qdss_tracectl_a_groups[] = { 961 + "gpio27", 962 + }; 963 + static const char * const dac_calib14_groups[] = { 964 + "gpio28", "gpio55", 965 + }; 966 + static const char * const qdss_traceclk_a_groups[] = { 967 + "gpio28", 968 + }; 969 + static const char * const dac_calib15_groups[] = { 970 + "gpio29", "gpio56", 971 + }; 972 + static const char * const dac_calib16_groups[] = { 973 + "gpio30", "gpio57", 974 + }; 975 + static const char * const hdmi_rcv_groups[] = { 976 + "gpio30", 977 + }; 978 + static const char * const dac_calib17_groups[] = { 979 + "gpio31", "gpio58", 980 + }; 981 + static const char * const pwr_modem_groups[] = { 982 + "gpio31", 983 + }; 984 + static const char * const hdmi_cec_groups[] = { 985 + "gpio31", 986 + }; 987 + static const char * const pwr_nav_groups[] = { 988 + "gpio32", 989 + }; 990 + static const char * const dac_calib18_groups[] = { 991 + "gpio32", "gpio59", 992 + }; 993 + static const char * const hdmi_ddc_groups[] = { 994 + "gpio32", "gpio33", 995 + }; 996 + static const char * const pwr_crypto_groups[] = { 997 + "gpio33", 998 + }; 999 + static const char * const dac_calib19_groups[] = { 1000 + "gpio33", "gpio60", 1001 + }; 1002 + static const char * const dac_calib20_groups[] = { 1003 + "gpio34", "gpio61", 1004 + }; 1005 + static const char * const hdmi_hot_groups[] = { 1006 + "gpio34", 1007 + }; 1008 + static const char * const dac_calib21_groups[] = { 1009 + "gpio35", "gpio62", 1010 + }; 1011 + static const char * const pci_e0_groups[] = { 1012 + "gpio35", "gpio36", 1013 + }; 1014 + static const char * const dac_calib22_groups[] = { 1015 + "gpio36", "gpio63", 1016 + }; 1017 + static const char * const dac_calib23_groups[] = { 1018 + "gpio37", "gpio64", 1019 + }; 1020 + static const char * const blsp_i2c2_groups[] = { 1021 + "gpio43", "gpio44", 1022 + }; 1023 + static const char * const blsp_spi3_groups[] = { 1024 + "gpio45", "gpio46", "gpio47", "gpio48", 1025 + }; 1026 + static const char * const blsp_uart3_groups[] = { 1027 + "gpio45", "gpio46", "gpio47", "gpio48", 1028 + }; 1029 + static const char * const blsp_uim3_groups[] = { 1030 + "gpio45", "gpio46", 1031 + }; 1032 + static const char * const blsp_i2c3_groups[] = { 1033 + "gpio47", "gpio48", 1034 + }; 1035 + static const char * const dac_calib24_groups[] = { 1036 + "gpio38", "gpio65", 1037 + }; 1038 + static const char * const dac_calib25_groups[] = { 1039 + "gpio39", "gpio66", 1040 + }; 1041 + static const char * const tsif1_sync_groups[] = { 1042 + "gpio39", 1043 + }; 1044 + static const char * const sd_write_groups[] = { 1045 + "gpio40", 1046 + }; 1047 + static const char * const tsif1_error_groups[] = { 1048 + "gpio40", 1049 + }; 1050 + static const char * const blsp_spi2_groups[] = { 1051 + "gpio41", "gpio42", "gpio43", "gpio44", 1052 + }; 1053 + static const char * const blsp_uart2_groups[] = { 1054 + "gpio41", "gpio42", "gpio43", "gpio44", 1055 + }; 1056 + static const char * const blsp_uim2_groups[] = { 1057 + "gpio41", "gpio42", 1058 + }; 1059 + static const char * const qdss_cti_groups[] = { 1060 + "gpio41", "gpio42", "gpio100", "gpio101", 1061 + }; 1062 + static const char * const uim3_groups[] = { 1063 + "gpio49", "gpio50", "gpio51", "gpio52", 1064 + }; 1065 + static const char * const blsp_spi9_groups[] = { 1066 + "gpio49", "gpio50", "gpio51", "gpio52", 1067 + }; 1068 + static const char * const blsp_uart9_groups[] = { 1069 + "gpio49", "gpio50", "gpio51", "gpio52", 1070 + }; 1071 + static const char * const blsp_uim9_groups[] = { 1072 + "gpio49", "gpio50", 1073 + }; 1074 + static const char * const blsp10_spi_groups[] = { 1075 + "gpio49", "gpio50", "gpio51", "gpio52", "gpio88", 1076 + }; 1077 + static const char * const blsp_i2c9_groups[] = { 1078 + "gpio51", "gpio52", 1079 + }; 1080 + static const char * const blsp_spi7_groups[] = { 1081 + "gpio53", "gpio54", "gpio55", "gpio56", 1082 + }; 1083 + static const char * const blsp_uart7_groups[] = { 1084 + "gpio53", "gpio54", "gpio55", "gpio56", 1085 + }; 1086 + static const char * const blsp_uim7_groups[] = { 1087 + "gpio53", "gpio54", 1088 + }; 1089 + static const char * const qdss_tracedata_a_groups[] = { 1090 + "gpio53", "gpio54", "gpio63", "gpio64", "gpio65", "gpio66", "gpio67", 1091 + "gpio74", "gpio75", "gpio76", "gpio77", "gpio85", "gpio86", "gpio87", 1092 + "gpio89", "gpio90", 1093 + }; 1094 + static const char * const blsp_i2c7_groups[] = { 1095 + "gpio55", "gpio56", 1096 + }; 1097 + static const char * const qua_mi2s_groups[] = { 1098 + "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", 1099 + }; 1100 + static const char * const gcc_gp1_clk_a_groups[] = { 1101 + "gpio57", 1102 + }; 1103 + static const char * const uim4_groups[] = { 1104 + "gpio58", "gpio59", "gpio60", "gpio61", 1105 + }; 1106 + static const char * const blsp_spi11_groups[] = { 1107 + "gpio58", "gpio59", "gpio60", "gpio61", 1108 + }; 1109 + static const char * const blsp_uart11_groups[] = { 1110 + "gpio58", "gpio59", "gpio60", "gpio61", 1111 + }; 1112 + static const char * const blsp_uim11_groups[] = { 1113 + "gpio58", "gpio59", 1114 + }; 1115 + static const char * const gcc_gp2_clk_a_groups[] = { 1116 + "gpio58", 1117 + }; 1118 + static const char * const gcc_gp3_clk_a_groups[] = { 1119 + "gpio59", 1120 + }; 1121 + static const char * const blsp_i2c11_groups[] = { 1122 + "gpio60", "gpio61", 1123 + }; 1124 + static const char * const cri_trng0_groups[] = { 1125 + "gpio60", 1126 + }; 1127 + static const char * const cri_trng1_groups[] = { 1128 + "gpio61", 1129 + }; 1130 + static const char * const cri_trng_groups[] = { 1131 + "gpio62", 1132 + }; 1133 + static const char * const qdss_stm18_groups[] = { 1134 + "gpio63", 1135 + }; 1136 + static const char * const pri_mi2s_groups[] = { 1137 + "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", 1138 + }; 1139 + static const char * const qdss_stm17_groups[] = { 1140 + "gpio64", 1141 + }; 1142 + static const char * const blsp_spi4_groups[] = { 1143 + "gpio65", "gpio66", "gpio67", "gpio68", 1144 + }; 1145 + static const char * const blsp_uart4_groups[] = { 1146 + "gpio65", "gpio66", "gpio67", "gpio68", 1147 + }; 1148 + static const char * const blsp_uim4_groups[] = { 1149 + "gpio65", "gpio66", 1150 + }; 1151 + static const char * const qdss_stm16_groups[] = { 1152 + "gpio65", 1153 + }; 1154 + static const char * const qdss_stm15_groups[] = { 1155 + "gpio66", 1156 + }; 1157 + static const char * const dac_calib26_groups[] = { 1158 + "gpio67", 1159 + }; 1160 + static const char * const blsp_i2c4_groups[] = { 1161 + "gpio67", "gpio68", 1162 + }; 1163 + static const char * const qdss_stm14_groups[] = { 1164 + "gpio67", 1165 + }; 1166 + static const char * const spkr_i2s_groups[] = { 1167 + "gpio69", "gpio70", "gpio71", "gpio72", 1168 + }; 1169 + static const char * const audio_ref_groups[] = { 1170 + "gpio69", 1171 + }; 1172 + static const char * const lpass_slimbus_groups[] = { 1173 + "gpio70", "gpio71", "gpio72", 1174 + }; 1175 + static const char * const isense_dbg_groups[] = { 1176 + "gpio70", 1177 + }; 1178 + static const char * const tsense_pwm1_groups[] = { 1179 + "gpio71", 1180 + }; 1181 + static const char * const tsense_pwm2_groups[] = { 1182 + "gpio71", 1183 + }; 1184 + static const char * const btfm_slimbus_groups[] = { 1185 + "gpio73", "gpio74", 1186 + }; 1187 + static const char * const ter_mi2s_groups[] = { 1188 + "gpio74", "gpio75", "gpio76", "gpio77", "gpio78", 1189 + }; 1190 + static const char * const qdss_stm22_groups[] = { 1191 + "gpio74", 1192 + }; 1193 + static const char * const qdss_stm21_groups[] = { 1194 + "gpio75", 1195 + }; 1196 + static const char * const qdss_stm20_groups[] = { 1197 + "gpio76", 1198 + }; 1199 + static const char * const qdss_stm19_groups[] = { 1200 + "gpio77", 1201 + }; 1202 + static const char * const ssc_irq_groups[] = { 1203 + "gpio78", "gpio79", "gpio80", "gpio117", "gpio118", "gpio119", 1204 + "gpio120", "gpio121", "gpio122", "gpio123", "gpio124", "gpio125", 1205 + }; 1206 + static const char * const gcc_gp1_clk_b_groups[] = { 1207 + "gpio78", 1208 + }; 1209 + static const char * const sec_mi2s_groups[] = { 1210 + "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", 1211 + }; 1212 + static const char * const blsp_spi5_groups[] = { 1213 + "gpio81", "gpio82", "gpio83", "gpio84", 1214 + }; 1215 + static const char * const blsp_uart5_groups[] = { 1216 + "gpio81", "gpio82", "gpio83", "gpio84", 1217 + }; 1218 + static const char * const blsp_uim5_groups[] = { 1219 + "gpio81", "gpio82", 1220 + }; 1221 + static const char * const gcc_gp2_clk_b_groups[] = { 1222 + "gpio81", 1223 + }; 1224 + static const char * const gcc_gp3_clk_b_groups[] = { 1225 + "gpio82", 1226 + }; 1227 + static const char * const blsp_i2c5_groups[] = { 1228 + "gpio83", "gpio84", 1229 + }; 1230 + static const char * const blsp_spi12_groups[] = { 1231 + "gpio85", "gpio86", "gpio87", "gpio88", 1232 + }; 1233 + static const char * const blsp_uart12_groups[] = { 1234 + "gpio85", "gpio86", "gpio87", "gpio88", 1235 + }; 1236 + static const char * const blsp_uim12_groups[] = { 1237 + "gpio85", "gpio86", 1238 + }; 1239 + static const char * const qdss_stm25_groups[] = { 1240 + "gpio85", 1241 + }; 1242 + static const char * const qdss_stm31_groups[] = { 1243 + "gpio86", 1244 + }; 1245 + static const char * const blsp_i2c12_groups[] = { 1246 + "gpio87", "gpio88", 1247 + }; 1248 + static const char * const qdss_stm30_groups[] = { 1249 + "gpio87", 1250 + }; 1251 + static const char * const qdss_stm29_groups[] = { 1252 + "gpio88", 1253 + }; 1254 + static const char * const tsif1_clk_groups[] = { 1255 + "gpio89", 1256 + }; 1257 + static const char * const qdss_stm28_groups[] = { 1258 + "gpio89", 1259 + }; 1260 + static const char * const tsif1_en_groups[] = { 1261 + "gpio90", 1262 + }; 1263 + static const char * const tsif1_data_groups[] = { 1264 + "gpio91", 1265 + }; 1266 + static const char * const sdc4_cmd_groups[] = { 1267 + "gpio91", 1268 + }; 1269 + static const char * const qdss_stm27_groups[] = { 1270 + "gpio91", 1271 + }; 1272 + static const char * const qdss_traceclk_b_groups[] = { 1273 + "gpio91", 1274 + }; 1275 + static const char * const tsif2_error_groups[] = { 1276 + "gpio92", 1277 + }; 1278 + static const char * const sdc43_groups[] = { 1279 + "gpio92", 1280 + }; 1281 + static const char * const vfr_1_groups[] = { 1282 + "gpio92", 1283 + }; 1284 + static const char * const qdss_stm26_groups[] = { 1285 + "gpio92", 1286 + }; 1287 + static const char * const tsif2_clk_groups[] = { 1288 + "gpio93", 1289 + }; 1290 + static const char * const sdc4_clk_groups[] = { 1291 + "gpio93", 1292 + }; 1293 + static const char * const qdss_stm24_groups[] = { 1294 + "gpio93", 1295 + }; 1296 + static const char * const tsif2_en_groups[] = { 1297 + "gpio94", 1298 + }; 1299 + static const char * const sdc42_groups[] = { 1300 + "gpio94", 1301 + }; 1302 + static const char * const qdss_stm23_groups[] = { 1303 + "gpio94", 1304 + }; 1305 + static const char * const qdss_tracectl_b_groups[] = { 1306 + "gpio94", 1307 + }; 1308 + static const char * const sd_card_groups[] = { 1309 + "gpio95", 1310 + }; 1311 + static const char * const tsif2_data_groups[] = { 1312 + "gpio95", 1313 + }; 1314 + static const char * const sdc41_groups[] = { 1315 + "gpio95", 1316 + }; 1317 + static const char * const tsif2_sync_groups[] = { 1318 + "gpio96", 1319 + }; 1320 + static const char * const sdc40_groups[] = { 1321 + "gpio96", 1322 + }; 1323 + static const char * const mdp_vsync_p_b_groups[] = { 1324 + "gpio97", 1325 + }; 1326 + static const char * const ldo_en_groups[] = { 1327 + "gpio97", 1328 + }; 1329 + static const char * const mdp_vsync_s_b_groups[] = { 1330 + "gpio98", 1331 + }; 1332 + static const char * const ldo_update_groups[] = { 1333 + "gpio98", 1334 + }; 1335 + static const char * const blsp11_uart_tx_b_groups[] = { 1336 + "gpio100", 1337 + }; 1338 + static const char * const blsp11_uart_rx_b_groups[] = { 1339 + "gpio101", 1340 + }; 1341 + static const char * const blsp11_i2c_sda_b_groups[] = { 1342 + "gpio102", 1343 + }; 1344 + static const char * const prng_rosc_groups[] = { 1345 + "gpio102", 1346 + }; 1347 + static const char * const blsp11_i2c_scl_b_groups[] = { 1348 + "gpio103", 1349 + }; 1350 + static const char * const uim2_groups[] = { 1351 + "gpio105", "gpio106", "gpio107", "gpio108", 1352 + }; 1353 + static const char * const uim1_groups[] = { 1354 + "gpio109", "gpio110", "gpio111", "gpio112", 1355 + }; 1356 + static const char * const uim_batt_groups[] = { 1357 + "gpio113", 1358 + }; 1359 + static const char * const pci_e2_groups[] = { 1360 + "gpio114", "gpio115", "gpio116", 1361 + }; 1362 + static const char * const pa_indicator_groups[] = { 1363 + "gpio116", 1364 + }; 1365 + static const char * const adsp_ext_groups[] = { 1366 + "gpio118", 1367 + }; 1368 + static const char * const ddr_bist_groups[] = { 1369 + "gpio121", "gpio122", "gpio123", "gpio124", 1370 + }; 1371 + static const char * const qdss_tracedata_11_groups[] = { 1372 + "gpio123", 1373 + }; 1374 + static const char * const qdss_tracedata_12_groups[] = { 1375 + "gpio124", 1376 + }; 1377 + static const char * const modem_tsync_groups[] = { 1378 + "gpio128", 1379 + }; 1380 + static const char * const nav_dr_groups[] = { 1381 + "gpio128", 1382 + }; 1383 + static const char * const nav_pps_groups[] = { 1384 + "gpio128", 1385 + }; 1386 + static const char * const pci_e1_groups[] = { 1387 + "gpio130", "gpio131", "gpio132", 1388 + }; 1389 + static const char * const gsm_tx_groups[] = { 1390 + "gpio134", "gpio135", 1391 + }; 1392 + static const char * const qspi_cs_groups[] = { 1393 + "gpio138", "gpio141", 1394 + }; 1395 + static const char * const ssbi2_groups[] = { 1396 + "gpio139", 1397 + }; 1398 + static const char * const ssbi1_groups[] = { 1399 + "gpio140", 1400 + }; 1401 + static const char * const mss_lte_groups[] = { 1402 + "gpio144", "gpio145", 1403 + }; 1404 + static const char * const qspi_clk_groups[] = { 1405 + "gpio145", 1406 + }; 1407 + static const char * const qspi0_groups[] = { 1408 + "gpio146", 1409 + }; 1410 + static const char * const qspi1_groups[] = { 1411 + "gpio147", 1412 + }; 1413 + static const char * const qspi2_groups[] = { 1414 + "gpio148", 1415 + }; 1416 + static const char * const qspi3_groups[] = { 1417 + "gpio149", 1418 + }; 1419 + 1420 + static const struct msm_function msm8996_functions[] = { 1421 + FUNCTION(adsp_ext), 1422 + FUNCTION(atest_bbrx0), 1423 + FUNCTION(atest_bbrx1), 1424 + FUNCTION(atest_char), 1425 + FUNCTION(atest_char0), 1426 + FUNCTION(atest_char1), 1427 + FUNCTION(atest_char2), 1428 + FUNCTION(atest_char3), 1429 + FUNCTION(atest_gpsadc0), 1430 + FUNCTION(atest_gpsadc1), 1431 + FUNCTION(atest_tsens), 1432 + FUNCTION(atest_tsens2), 1433 + FUNCTION(atest_usb1), 1434 + FUNCTION(atest_usb10), 1435 + FUNCTION(atest_usb11), 1436 + FUNCTION(atest_usb12), 1437 + FUNCTION(atest_usb13), 1438 + FUNCTION(atest_usb2), 1439 + FUNCTION(atest_usb20), 1440 + FUNCTION(atest_usb21), 1441 + FUNCTION(atest_usb22), 1442 + FUNCTION(atest_usb23), 1443 + FUNCTION(audio_ref), 1444 + FUNCTION(bimc_dte0), 1445 + FUNCTION(bimc_dte1), 1446 + FUNCTION(blsp10_spi), 1447 + FUNCTION(blsp11_i2c_scl_b), 1448 + FUNCTION(blsp11_i2c_sda_b), 1449 + FUNCTION(blsp11_uart_rx_b), 1450 + FUNCTION(blsp11_uart_tx_b), 1451 + FUNCTION(blsp1_spi), 1452 + FUNCTION(blsp2_spi), 1453 + FUNCTION(blsp_i2c1), 1454 + FUNCTION(blsp_i2c10), 1455 + FUNCTION(blsp_i2c11), 1456 + FUNCTION(blsp_i2c12), 1457 + FUNCTION(blsp_i2c2), 1458 + FUNCTION(blsp_i2c3), 1459 + FUNCTION(blsp_i2c4), 1460 + FUNCTION(blsp_i2c5), 1461 + FUNCTION(blsp_i2c6), 1462 + FUNCTION(blsp_i2c7), 1463 + FUNCTION(blsp_i2c8), 1464 + FUNCTION(blsp_i2c9), 1465 + FUNCTION(blsp_spi1), 1466 + FUNCTION(blsp_spi10), 1467 + FUNCTION(blsp_spi11), 1468 + FUNCTION(blsp_spi12), 1469 + FUNCTION(blsp_spi2), 1470 + FUNCTION(blsp_spi3), 1471 + FUNCTION(blsp_spi4), 1472 + FUNCTION(blsp_spi5), 1473 + FUNCTION(blsp_spi6), 1474 + FUNCTION(blsp_spi7), 1475 + FUNCTION(blsp_spi8), 1476 + FUNCTION(blsp_spi9), 1477 + FUNCTION(blsp_uart1), 1478 + FUNCTION(blsp_uart10), 1479 + FUNCTION(blsp_uart11), 1480 + FUNCTION(blsp_uart12), 1481 + FUNCTION(blsp_uart2), 1482 + FUNCTION(blsp_uart3), 1483 + FUNCTION(blsp_uart4), 1484 + FUNCTION(blsp_uart5), 1485 + FUNCTION(blsp_uart6), 1486 + FUNCTION(blsp_uart7), 1487 + FUNCTION(blsp_uart8), 1488 + FUNCTION(blsp_uart9), 1489 + FUNCTION(blsp_uim1), 1490 + FUNCTION(blsp_uim10), 1491 + FUNCTION(blsp_uim11), 1492 + FUNCTION(blsp_uim12), 1493 + FUNCTION(blsp_uim2), 1494 + FUNCTION(blsp_uim3), 1495 + FUNCTION(blsp_uim4), 1496 + FUNCTION(blsp_uim5), 1497 + FUNCTION(blsp_uim6), 1498 + FUNCTION(blsp_uim7), 1499 + FUNCTION(blsp_uim8), 1500 + FUNCTION(blsp_uim9), 1501 + FUNCTION(btfm_slimbus), 1502 + FUNCTION(cam_mclk), 1503 + FUNCTION(cci_async), 1504 + FUNCTION(cci_i2c), 1505 + FUNCTION(cci_timer0), 1506 + FUNCTION(cci_timer1), 1507 + FUNCTION(cci_timer2), 1508 + FUNCTION(cci_timer3), 1509 + FUNCTION(cci_timer4), 1510 + FUNCTION(cri_trng), 1511 + FUNCTION(cri_trng0), 1512 + FUNCTION(cri_trng1), 1513 + FUNCTION(dac_calib0), 1514 + FUNCTION(dac_calib1), 1515 + FUNCTION(dac_calib10), 1516 + FUNCTION(dac_calib11), 1517 + FUNCTION(dac_calib12), 1518 + FUNCTION(dac_calib13), 1519 + FUNCTION(dac_calib14), 1520 + FUNCTION(dac_calib15), 1521 + FUNCTION(dac_calib16), 1522 + FUNCTION(dac_calib17), 1523 + FUNCTION(dac_calib18), 1524 + FUNCTION(dac_calib19), 1525 + FUNCTION(dac_calib2), 1526 + FUNCTION(dac_calib20), 1527 + FUNCTION(dac_calib21), 1528 + FUNCTION(dac_calib22), 1529 + FUNCTION(dac_calib23), 1530 + FUNCTION(dac_calib24), 1531 + FUNCTION(dac_calib25), 1532 + FUNCTION(dac_calib26), 1533 + FUNCTION(dac_calib3), 1534 + FUNCTION(dac_calib4), 1535 + FUNCTION(dac_calib5), 1536 + FUNCTION(dac_calib6), 1537 + FUNCTION(dac_calib7), 1538 + FUNCTION(dac_calib8), 1539 + FUNCTION(dac_calib9), 1540 + FUNCTION(dac_gpio), 1541 + FUNCTION(dbg_out), 1542 + FUNCTION(ddr_bist), 1543 + FUNCTION(edp_hot), 1544 + FUNCTION(edp_lcd), 1545 + FUNCTION(gcc_gp1_clk_a), 1546 + FUNCTION(gcc_gp1_clk_b), 1547 + FUNCTION(gcc_gp2_clk_a), 1548 + FUNCTION(gcc_gp2_clk_b), 1549 + FUNCTION(gcc_gp3_clk_a), 1550 + FUNCTION(gcc_gp3_clk_b), 1551 + FUNCTION(gpio), 1552 + FUNCTION(gsm_tx), 1553 + FUNCTION(hdmi_cec), 1554 + FUNCTION(hdmi_ddc), 1555 + FUNCTION(hdmi_hot), 1556 + FUNCTION(hdmi_rcv), 1557 + FUNCTION(isense_dbg), 1558 + FUNCTION(ldo_en), 1559 + FUNCTION(ldo_update), 1560 + FUNCTION(lpass_slimbus), 1561 + FUNCTION(m_voc), 1562 + FUNCTION(mdp_vsync), 1563 + FUNCTION(mdp_vsync_p_b), 1564 + FUNCTION(mdp_vsync_s_b), 1565 + FUNCTION(modem_tsync), 1566 + FUNCTION(mss_lte), 1567 + FUNCTION(nav_dr), 1568 + FUNCTION(nav_pps), 1569 + FUNCTION(pa_indicator), 1570 + FUNCTION(pci_e0), 1571 + FUNCTION(pci_e1), 1572 + FUNCTION(pci_e2), 1573 + FUNCTION(pll_bypassnl), 1574 + FUNCTION(pll_reset), 1575 + FUNCTION(pri_mi2s), 1576 + FUNCTION(prng_rosc), 1577 + FUNCTION(pwr_crypto), 1578 + FUNCTION(pwr_modem), 1579 + FUNCTION(pwr_nav), 1580 + FUNCTION(qdss_cti), 1581 + FUNCTION(qdss_cti_trig_in_a), 1582 + FUNCTION(qdss_cti_trig_in_b), 1583 + FUNCTION(qdss_cti_trig_out_a), 1584 + FUNCTION(qdss_cti_trig_out_b), 1585 + FUNCTION(qdss_stm0), 1586 + FUNCTION(qdss_stm1), 1587 + FUNCTION(qdss_stm10), 1588 + FUNCTION(qdss_stm11), 1589 + FUNCTION(qdss_stm12), 1590 + FUNCTION(qdss_stm13), 1591 + FUNCTION(qdss_stm14), 1592 + FUNCTION(qdss_stm15), 1593 + FUNCTION(qdss_stm16), 1594 + FUNCTION(qdss_stm17), 1595 + FUNCTION(qdss_stm18), 1596 + FUNCTION(qdss_stm19), 1597 + FUNCTION(qdss_stm2), 1598 + FUNCTION(qdss_stm20), 1599 + FUNCTION(qdss_stm21), 1600 + FUNCTION(qdss_stm22), 1601 + FUNCTION(qdss_stm23), 1602 + FUNCTION(qdss_stm24), 1603 + FUNCTION(qdss_stm25), 1604 + FUNCTION(qdss_stm26), 1605 + FUNCTION(qdss_stm27), 1606 + FUNCTION(qdss_stm28), 1607 + FUNCTION(qdss_stm29), 1608 + FUNCTION(qdss_stm3), 1609 + FUNCTION(qdss_stm30), 1610 + FUNCTION(qdss_stm31), 1611 + FUNCTION(qdss_stm4), 1612 + FUNCTION(qdss_stm5), 1613 + FUNCTION(qdss_stm6), 1614 + FUNCTION(qdss_stm7), 1615 + FUNCTION(qdss_stm8), 1616 + FUNCTION(qdss_stm9), 1617 + FUNCTION(qdss_traceclk_a), 1618 + FUNCTION(qdss_traceclk_b), 1619 + FUNCTION(qdss_tracectl_a), 1620 + FUNCTION(qdss_tracectl_b), 1621 + FUNCTION(qdss_tracedata_11), 1622 + FUNCTION(qdss_tracedata_12), 1623 + FUNCTION(qdss_tracedata_a), 1624 + FUNCTION(qdss_tracedata_b), 1625 + FUNCTION(qspi0), 1626 + FUNCTION(qspi1), 1627 + FUNCTION(qspi2), 1628 + FUNCTION(qspi3), 1629 + FUNCTION(qspi_clk), 1630 + FUNCTION(qspi_cs), 1631 + FUNCTION(qua_mi2s), 1632 + FUNCTION(sd_card), 1633 + FUNCTION(sd_write), 1634 + FUNCTION(sdc40), 1635 + FUNCTION(sdc41), 1636 + FUNCTION(sdc42), 1637 + FUNCTION(sdc43), 1638 + FUNCTION(sdc4_clk), 1639 + FUNCTION(sdc4_cmd), 1640 + FUNCTION(sec_mi2s), 1641 + FUNCTION(spkr_i2s), 1642 + FUNCTION(ssbi1), 1643 + FUNCTION(ssbi2), 1644 + FUNCTION(ssc_irq), 1645 + FUNCTION(ter_mi2s), 1646 + FUNCTION(tsense_pwm1), 1647 + FUNCTION(tsense_pwm2), 1648 + FUNCTION(tsif1_clk), 1649 + FUNCTION(tsif1_data), 1650 + FUNCTION(tsif1_en), 1651 + FUNCTION(tsif1_error), 1652 + FUNCTION(tsif1_sync), 1653 + FUNCTION(tsif2_clk), 1654 + FUNCTION(tsif2_data), 1655 + FUNCTION(tsif2_en), 1656 + FUNCTION(tsif2_error), 1657 + FUNCTION(tsif2_sync), 1658 + FUNCTION(uim1), 1659 + FUNCTION(uim2), 1660 + FUNCTION(uim3), 1661 + FUNCTION(uim4), 1662 + FUNCTION(uim_batt), 1663 + FUNCTION(vfr_1), 1664 + }; 1665 + 1666 + static const struct msm_pingroup msm8996_groups[] = { 1667 + PINGROUP(0, blsp_spi1, blsp_uart1, blsp_uim1, NA, NA, NA, NA, NA, NA), 1668 + PINGROUP(1, blsp_spi1, blsp_uart1, blsp_uim1, NA, NA, NA, NA, NA, NA), 1669 + PINGROUP(2, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA, NA, NA), 1670 + PINGROUP(3, blsp_spi1, blsp_uart1, blsp_i2c1, NA, atest_tsens, 1671 + bimc_dte1, NA, NA, NA), 1672 + PINGROUP(4, blsp_spi8, blsp_uart8, blsp_uim8, NA, qdss_cti_trig_out_b, 1673 + dac_calib0, bimc_dte0, NA, NA), 1674 + PINGROUP(5, blsp_spi8, blsp_uart8, blsp_uim8, NA, qdss_cti_trig_in_b, 1675 + dac_calib1, bimc_dte1, NA, NA), 1676 + PINGROUP(6, blsp_spi8, blsp_uart8, blsp_i2c8, NA, dac_calib2, 1677 + bimc_dte0, NA, NA, NA), 1678 + PINGROUP(7, blsp_spi8, blsp_uart8, blsp_i2c8, NA, atest_tsens2, 1679 + atest_usb1, NA, NA, NA), 1680 + PINGROUP(8, blsp_spi10, blsp_uart10, blsp_uim10, NA, atest_bbrx1, 1681 + atest_usb13, NA, NA, NA), 1682 + PINGROUP(9, blsp_spi10, blsp_uart10, blsp_uim10, atest_bbrx0, 1683 + atest_usb12, NA, NA, NA, NA), 1684 + PINGROUP(10, mdp_vsync, blsp_spi10, blsp_uart10, blsp_i2c10, 1685 + atest_gpsadc1, atest_usb11, NA, NA, NA), 1686 + PINGROUP(11, mdp_vsync, blsp_spi10, blsp_uart10, blsp_i2c10, 1687 + atest_gpsadc0, atest_usb10, NA, NA, NA), 1688 + PINGROUP(12, mdp_vsync, m_voc, dac_gpio, atest_char, NA, NA, NA, NA, 1689 + NA), 1690 + PINGROUP(13, cam_mclk, pll_bypassnl, qdss_stm7, qdss_tracedata_b, NA, 1691 + NA, NA, NA, NA), 1692 + PINGROUP(14, cam_mclk, pll_reset, qdss_stm6, qdss_tracedata_b, NA, NA, 1693 + NA, NA, NA), 1694 + PINGROUP(15, cam_mclk, qdss_stm5, qdss_tracedata_b, NA, NA, NA, NA, NA, 1695 + NA), 1696 + PINGROUP(16, cam_mclk, qdss_stm4, qdss_tracedata_b, NA, atest_usb2, NA, 1697 + NA, NA, NA), 1698 + PINGROUP(17, cci_i2c, qdss_stm3, qdss_tracedata_b, dac_calib3, 1699 + atest_usb23, atest_char3, NA, NA, NA), 1700 + PINGROUP(18, cci_i2c, qdss_stm2, qdss_tracedata_b, dac_calib4, 1701 + atest_usb22, atest_char2, NA, NA, NA), 1702 + PINGROUP(19, cci_i2c, qdss_stm1, qdss_tracedata_b, dac_calib5, 1703 + atest_usb21, atest_char1, NA, NA, NA), 1704 + PINGROUP(20, cci_i2c, dbg_out, qdss_stm0, dac_calib6, atest_usb20, 1705 + atest_char0, NA, NA, NA), 1706 + PINGROUP(21, cci_timer0, qdss_stm13, qdss_tracedata_b, dac_calib7, NA, 1707 + NA, NA, NA, NA), 1708 + PINGROUP(22, cci_timer1, qdss_stm12, qdss_tracedata_b, dac_calib8, NA, 1709 + NA, NA, NA, NA), 1710 + PINGROUP(23, cci_timer2, blsp1_spi, qdss_stm11, qdss_tracedata_b, 1711 + dac_calib9, NA, NA, NA, NA), 1712 + PINGROUP(24, cci_timer3, cci_async, blsp1_spi, qdss_stm10, 1713 + qdss_cti_trig_in_a, dac_calib10, NA, NA, NA), 1714 + PINGROUP(25, cci_timer4, cci_async, blsp_spi6, blsp_uart6, blsp_uim6, 1715 + blsp2_spi, qdss_stm9, qdss_cti_trig_out_a, dac_calib11), 1716 + PINGROUP(26, cci_async, blsp_spi6, blsp_uart6, blsp_uim6, qdss_stm8, 1717 + qdss_tracedata_b, dac_calib12, NA, NA), 1718 + PINGROUP(27, blsp_spi6, blsp_uart6, blsp_i2c6, blsp1_spi, 1719 + qdss_tracectl_a, dac_calib13, NA, NA, NA), 1720 + PINGROUP(28, blsp_spi6, blsp_uart6, blsp_i2c6, blsp1_spi, 1721 + qdss_traceclk_a, dac_calib14, NA, NA, NA), 1722 + PINGROUP(29, blsp2_spi, NA, qdss_tracedata_b, dac_calib15, NA, NA, NA, 1723 + NA, NA), 1724 + PINGROUP(30, hdmi_rcv, blsp2_spi, dac_calib16, NA, NA, NA, NA, NA, NA), 1725 + PINGROUP(31, hdmi_cec, pwr_modem, dac_calib17, NA, NA, NA, NA, NA, NA), 1726 + PINGROUP(32, hdmi_ddc, pwr_nav, NA, dac_calib18, NA, NA, NA, NA, NA), 1727 + PINGROUP(33, hdmi_ddc, pwr_crypto, NA, dac_calib19, NA, NA, NA, NA, NA), 1728 + PINGROUP(34, hdmi_hot, NA, dac_calib20, NA, NA, NA, NA, NA, NA), 1729 + PINGROUP(35, pci_e0, NA, dac_calib21, NA, NA, NA, NA, NA, NA), 1730 + PINGROUP(36, pci_e0, NA, dac_calib22, NA, NA, NA, NA, NA, NA), 1731 + PINGROUP(37, NA, dac_calib23, NA, NA, NA, NA, NA, NA, NA), 1732 + PINGROUP(38, NA, dac_calib24, NA, NA, NA, NA, NA, NA, NA), 1733 + PINGROUP(39, tsif1_sync, NA, dac_calib25, NA, NA, NA, NA, NA, NA), 1734 + PINGROUP(40, sd_write, tsif1_error, NA, NA, NA, NA, NA, NA, NA), 1735 + PINGROUP(41, blsp_spi2, blsp_uart2, blsp_uim2, NA, qdss_cti, 1736 + dac_calib0, NA, NA, NA), 1737 + PINGROUP(42, blsp_spi2, blsp_uart2, blsp_uim2, NA, qdss_cti, 1738 + dac_calib1, NA, NA, NA), 1739 + PINGROUP(43, blsp_spi2, blsp_uart2, blsp_i2c2, NA, dac_calib2, NA, NA, 1740 + NA, NA), 1741 + PINGROUP(44, blsp_spi2, blsp_uart2, blsp_i2c2, NA, dac_calib3, NA, NA, 1742 + NA, NA), 1743 + PINGROUP(45, blsp_spi3, blsp_uart3, blsp_uim3, NA, dac_calib4, NA, NA, 1744 + NA, NA), 1745 + PINGROUP(46, blsp_spi3, blsp_uart3, blsp_uim3, NA, dac_calib5, NA, NA, 1746 + NA, NA), 1747 + PINGROUP(47, blsp_spi3, blsp_uart3, blsp_i2c3, dac_calib6, NA, NA, NA, 1748 + NA, NA), 1749 + PINGROUP(48, blsp_spi3, blsp_uart3, blsp_i2c3, dac_calib7, NA, NA, NA, 1750 + NA, NA), 1751 + PINGROUP(49, uim3, blsp_spi9, blsp_uart9, blsp_uim9, blsp10_spi, 1752 + dac_calib8, NA, NA, NA), 1753 + PINGROUP(50, uim3, blsp_spi9, blsp_uart9, blsp_uim9, blsp10_spi, 1754 + dac_calib9, NA, NA, NA), 1755 + PINGROUP(51, uim3, blsp_spi9, blsp_uart9, blsp_i2c9, blsp10_spi, 1756 + dac_calib10, NA, NA, NA), 1757 + PINGROUP(52, uim3, blsp_spi9, blsp_uart9, blsp_i2c9, 1758 + blsp10_spi, dac_calib11, NA, NA, NA), 1759 + PINGROUP(53, blsp_spi7, blsp_uart7, blsp_uim7, NA, qdss_tracedata_a, 1760 + dac_calib12, NA, NA, NA), 1761 + PINGROUP(54, blsp_spi7, blsp_uart7, blsp_uim7, NA, NA, 1762 + qdss_tracedata_a, dac_calib13, NA, NA), 1763 + PINGROUP(55, blsp_spi7, blsp_uart7, blsp_i2c7, NA, dac_calib14, NA, NA, 1764 + NA, NA), 1765 + PINGROUP(56, blsp_spi7, blsp_uart7, blsp_i2c7, NA, dac_calib15, NA, NA, 1766 + NA, NA), 1767 + PINGROUP(57, qua_mi2s, gcc_gp1_clk_a, NA, qdss_tracedata_b, 1768 + dac_calib16, NA, NA, NA, NA), 1769 + PINGROUP(58, qua_mi2s, uim4, blsp_spi11, blsp_uart11, blsp_uim11, 1770 + gcc_gp2_clk_a, NA, qdss_tracedata_b, dac_calib17), 1771 + PINGROUP(59, qua_mi2s, uim4, blsp_spi11, blsp_uart11, blsp_uim11, 1772 + gcc_gp3_clk_a, NA, dac_calib18, NA), 1773 + PINGROUP(60, qua_mi2s, uim4, blsp_spi11, blsp_uart11, blsp_i2c11, 1774 + cri_trng0, NA, dac_calib19, NA), 1775 + PINGROUP(61, qua_mi2s, uim4, blsp_spi11, blsp_uart11, 1776 + blsp_i2c11, cri_trng1, NA, dac_calib20, NA), 1777 + PINGROUP(62, qua_mi2s, cri_trng, NA, dac_calib21, NA, NA, NA, NA, NA), 1778 + PINGROUP(63, qua_mi2s, NA, NA, qdss_stm18, qdss_tracedata_a, 1779 + dac_calib22, NA, NA, NA), 1780 + PINGROUP(64, pri_mi2s, NA, qdss_stm17, qdss_tracedata_a, dac_calib23, 1781 + NA, NA, NA, NA), 1782 + PINGROUP(65, pri_mi2s, blsp_spi4, blsp_uart4, blsp_uim4, NA, 1783 + qdss_stm16, qdss_tracedata_a, dac_calib24, NA), 1784 + PINGROUP(66, pri_mi2s, blsp_spi4, blsp_uart4, blsp_uim4, NA, 1785 + qdss_stm15, qdss_tracedata_a, dac_calib25, NA), 1786 + PINGROUP(67, pri_mi2s, blsp_spi4, blsp_uart4, blsp_i2c4, qdss_stm14, 1787 + qdss_tracedata_a, dac_calib26, NA, NA), 1788 + PINGROUP(68, pri_mi2s, blsp_spi4, blsp_uart4, blsp_i2c4, NA, NA, NA, 1789 + NA, NA), 1790 + PINGROUP(69, spkr_i2s, audio_ref, NA, NA, NA, NA, NA, NA, NA), 1791 + PINGROUP(70, lpass_slimbus, spkr_i2s, isense_dbg, NA, NA, NA, NA, NA, 1792 + NA), 1793 + PINGROUP(71, lpass_slimbus, spkr_i2s, tsense_pwm1, tsense_pwm2, NA, NA, 1794 + NA, NA, NA), 1795 + PINGROUP(72, lpass_slimbus, spkr_i2s, NA, NA, NA, NA, NA, NA, NA), 1796 + PINGROUP(73, btfm_slimbus, NA, NA, NA, NA, NA, NA, NA, NA), 1797 + PINGROUP(74, btfm_slimbus, ter_mi2s, qdss_stm22, qdss_tracedata_a, NA, 1798 + NA, NA, NA, NA), 1799 + PINGROUP(75, ter_mi2s, qdss_stm21, qdss_tracedata_a, NA, NA, NA, NA, 1800 + NA, NA), 1801 + PINGROUP(76, ter_mi2s, qdss_stm20, qdss_tracedata_a, NA, NA, NA, NA, 1802 + NA, NA), 1803 + PINGROUP(77, ter_mi2s, qdss_stm19, qdss_tracedata_a, NA, NA, NA, NA, 1804 + NA, NA), 1805 + PINGROUP(78, ter_mi2s, gcc_gp1_clk_b, NA, NA, NA, NA, NA, NA, NA), 1806 + PINGROUP(79, sec_mi2s, NA, NA, NA, NA, NA, NA, NA, NA), 1807 + PINGROUP(80, sec_mi2s, NA, NA, NA, NA, NA, NA, NA, NA), 1808 + PINGROUP(81, sec_mi2s, blsp_spi5, blsp_uart5, blsp_uim5, gcc_gp2_clk_b, 1809 + NA, NA, NA, NA), 1810 + PINGROUP(82, sec_mi2s, blsp_spi5, blsp_uart5, blsp_uim5, gcc_gp3_clk_b, 1811 + NA, NA, NA, NA), 1812 + PINGROUP(83, sec_mi2s, blsp_spi5, blsp_uart5, blsp_i2c5, NA, NA, NA, 1813 + NA, NA), 1814 + PINGROUP(84, blsp_spi5, blsp_uart5, blsp_i2c5, NA, NA, NA, NA, NA, NA), 1815 + PINGROUP(85, blsp_spi12, blsp_uart12, blsp_uim12, NA, qdss_stm25, 1816 + qdss_tracedata_a, NA, NA, NA), 1817 + PINGROUP(86, blsp_spi12, blsp_uart12, blsp_uim12, NA, NA, qdss_stm31, 1818 + qdss_tracedata_a, NA, NA), 1819 + PINGROUP(87, blsp_spi12, blsp_uart12, blsp_i2c12, NA, qdss_stm30, 1820 + qdss_tracedata_a, NA, NA, NA), 1821 + PINGROUP(88, blsp_spi12, blsp_uart12, blsp_i2c12, blsp10_spi, NA, 1822 + qdss_stm29, NA, NA, NA), 1823 + PINGROUP(89, tsif1_clk, qdss_stm28, qdss_tracedata_a, NA, NA, NA, NA, 1824 + NA, NA), 1825 + PINGROUP(90, tsif1_en, blsp1_spi, qdss_tracedata_a, NA, NA, NA, NA, NA, 1826 + NA), 1827 + PINGROUP(91, tsif1_data, sdc4_cmd, qdss_stm27, qdss_traceclk_b, NA, NA, 1828 + NA, NA, NA), 1829 + PINGROUP(92, tsif2_error, sdc43, vfr_1, qdss_stm26, qdss_tracedata_b, 1830 + NA, NA, NA, NA), 1831 + PINGROUP(93, tsif2_clk, sdc4_clk, NA, qdss_stm24, qdss_tracedata_b, NA, 1832 + NA, NA, NA), 1833 + PINGROUP(94, tsif2_en, sdc42, NA, qdss_stm23, qdss_tracectl_b, NA, NA, 1834 + NA, NA), 1835 + PINGROUP(95, tsif2_data, sdc41, NA, NA, NA, NA, NA, NA, NA), 1836 + PINGROUP(96, tsif2_sync, sdc40, NA, NA, NA, NA, NA, NA, NA), 1837 + PINGROUP(97, NA, NA, mdp_vsync_p_b, ldo_en, NA, NA, NA, NA, NA), 1838 + PINGROUP(98, NA, NA, mdp_vsync_s_b, ldo_update, NA, NA, NA, NA, NA), 1839 + PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1840 + PINGROUP(100, NA, NA, blsp11_uart_tx_b, qdss_cti, NA, NA, NA, NA, NA), 1841 + PINGROUP(101, NA, blsp11_uart_rx_b, qdss_cti, NA, NA, NA, NA, NA, NA), 1842 + PINGROUP(102, NA, blsp11_i2c_sda_b, prng_rosc, NA, NA, NA, NA, NA, NA), 1843 + PINGROUP(103, NA, blsp11_i2c_scl_b, NA, NA, NA, NA, NA, NA, NA), 1844 + PINGROUP(104, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1845 + PINGROUP(105, uim2, NA, NA, NA, NA, NA, NA, NA, NA), 1846 + PINGROUP(106, uim2, NA, NA, NA, NA, NA, NA, NA, NA), 1847 + PINGROUP(107, uim2, NA, NA, NA, NA, NA, NA, NA, NA), 1848 + PINGROUP(108, uim2, NA, NA, NA, NA, NA, NA, NA, NA), 1849 + PINGROUP(109, uim1, NA, NA, NA, NA, NA, NA, NA, NA), 1850 + PINGROUP(110, uim1, NA, NA, NA, NA, NA, NA, NA, NA), 1851 + PINGROUP(111, uim1, NA, NA, NA, NA, NA, NA, NA, NA), 1852 + PINGROUP(112, uim1, NA, NA, NA, NA, NA, NA, NA, NA), 1853 + PINGROUP(113, uim_batt, NA, NA, NA, NA, NA, NA, NA, NA), 1854 + PINGROUP(114, NA, pci_e2, NA, NA, NA, NA, NA, NA, NA), 1855 + PINGROUP(115, NA, pci_e2, NA, NA, NA, NA, NA, NA, NA), 1856 + PINGROUP(116, NA, pa_indicator, NA, NA, NA, NA, NA, NA, NA), 1857 + PINGROUP(117, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1858 + PINGROUP(118, adsp_ext, NA, NA, NA, NA, NA, NA, NA, NA), 1859 + PINGROUP(119, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1860 + PINGROUP(120, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1861 + PINGROUP(121, ddr_bist, NA, NA, NA, NA, NA, NA, NA, NA), 1862 + PINGROUP(122, ddr_bist, NA, NA, NA, NA, NA, NA, NA, NA), 1863 + PINGROUP(123, ddr_bist, qdss_tracedata_11, NA, NA, NA, NA, NA, NA, NA), 1864 + PINGROUP(124, ddr_bist, qdss_tracedata_12, NA, NA, NA, NA, NA, NA, NA), 1865 + PINGROUP(125, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1866 + PINGROUP(126, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1867 + PINGROUP(127, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1868 + PINGROUP(128, NA, modem_tsync, nav_dr, nav_pps, NA, NA, NA, NA, NA), 1869 + PINGROUP(129, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1870 + PINGROUP(130, pci_e1, NA, NA, NA, NA, NA, NA, NA, NA), 1871 + PINGROUP(131, pci_e1, NA, NA, NA, NA, NA, NA, NA, NA), 1872 + PINGROUP(132, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1873 + PINGROUP(133, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1874 + PINGROUP(134, gsm_tx, NA, NA, NA, NA, NA, NA, NA, NA), 1875 + PINGROUP(135, gsm_tx, NA, NA, NA, NA, NA, NA, NA, NA), 1876 + PINGROUP(136, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1877 + PINGROUP(137, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1878 + PINGROUP(138, NA, qspi_cs, NA, NA, NA, NA, NA, NA, NA), 1879 + PINGROUP(139, NA, ssbi2, NA, NA, NA, NA, NA, NA, NA), 1880 + PINGROUP(140, NA, ssbi1, NA, NA, NA, NA, NA, NA, NA), 1881 + PINGROUP(141, NA, qspi_cs, NA, NA, NA, NA, NA, NA, NA), 1882 + PINGROUP(142, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1883 + PINGROUP(143, NA, NA, NA, NA, NA, NA, NA, NA, NA), 1884 + PINGROUP(144, mss_lte, NA, NA, NA, NA, NA, NA, NA, NA), 1885 + PINGROUP(145, mss_lte, qspi_clk, NA, NA, NA, NA, NA, NA, NA), 1886 + PINGROUP(146, NA, qspi0, NA, NA, NA, NA, NA, NA, NA), 1887 + PINGROUP(147, NA, qspi1, NA, NA, NA, NA, NA, NA, NA), 1888 + PINGROUP(148, NA, qspi2, NA, NA, NA, NA, NA, NA, NA), 1889 + PINGROUP(149, NA, qspi3, NA, NA, NA, NA, NA, NA, NA), 1890 + SDC_QDSD_PINGROUP(sdc1_clk, 0x12c000, 13, 6), 1891 + SDC_QDSD_PINGROUP(sdc1_cmd, 0x12c000, 11, 3), 1892 + SDC_QDSD_PINGROUP(sdc1_data, 0x12c000, 9, 0), 1893 + SDC_QDSD_PINGROUP(sdc2_clk, 0x12d000, 14, 6), 1894 + SDC_QDSD_PINGROUP(sdc2_cmd, 0x12d000, 11, 3), 1895 + SDC_QDSD_PINGROUP(sdc2_data, 0x12d000, 9, 0), 1896 + SDC_QDSD_PINGROUP(sdc1_rclk, 0x12c000, 15, 0), 1897 + }; 1898 + 1899 + static const struct msm_pinctrl_soc_data msm8996_pinctrl = { 1900 + .pins = msm8996_pins, 1901 + .npins = ARRAY_SIZE(msm8996_pins), 1902 + .functions = msm8996_functions, 1903 + .nfunctions = ARRAY_SIZE(msm8996_functions), 1904 + .groups = msm8996_groups, 1905 + .ngroups = ARRAY_SIZE(msm8996_groups), 1906 + .ngpios = 150, 1907 + }; 1908 + 1909 + static int msm8996_pinctrl_probe(struct platform_device *pdev) 1910 + { 1911 + return msm_pinctrl_probe(pdev, &msm8996_pinctrl); 1912 + } 1913 + 1914 + static const struct of_device_id msm8996_pinctrl_of_match[] = { 1915 + { .compatible = "qcom,msm8996-pinctrl", }, 1916 + { } 1917 + }; 1918 + 1919 + static struct platform_driver msm8996_pinctrl_driver = { 1920 + .driver = { 1921 + .name = "msm8996-pinctrl", 1922 + .of_match_table = msm8996_pinctrl_of_match, 1923 + }, 1924 + .probe = msm8996_pinctrl_probe, 1925 + .remove = msm_pinctrl_remove, 1926 + }; 1927 + 1928 + static int __init msm8996_pinctrl_init(void) 1929 + { 1930 + return platform_driver_register(&msm8996_pinctrl_driver); 1931 + } 1932 + arch_initcall(msm8996_pinctrl_init); 1933 + 1934 + static void __exit msm8996_pinctrl_exit(void) 1935 + { 1936 + platform_driver_unregister(&msm8996_pinctrl_driver); 1937 + } 1938 + module_exit(msm8996_pinctrl_exit); 1939 + 1940 + MODULE_DESCRIPTION("Qualcomm msm8996 pinctrl driver"); 1941 + MODULE_LICENSE("GPL v2"); 1942 + MODULE_DEVICE_TABLE(of, msm8996_pinctrl_of_match);
+12 -4
drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
··· 32 32 33 33 static struct msm_pinctrl_soc_data qdf2xxx_pinctrl; 34 34 35 + /* A reasonable limit to the number of GPIOS */ 36 + #define MAX_GPIOS 256 37 + 35 38 static int qdf2xxx_pinctrl_probe(struct platform_device *pdev) 36 39 { 37 40 struct pinctrl_pin_desc *pins; ··· 45 42 46 43 /* Query the number of GPIOs from ACPI */ 47 44 ret = device_property_read_u32(&pdev->dev, "num-gpios", &num_gpios); 48 - if (ret < 0) 49 - return ret; 50 - 51 - if (!num_gpios) { 45 + if (ret < 0) { 52 46 dev_warn(&pdev->dev, "missing num-gpios property\n"); 47 + return ret; 48 + } 49 + 50 + if (!num_gpios || num_gpios > MAX_GPIOS) { 51 + dev_warn(&pdev->dev, "invalid num-gpios property\n"); 53 52 return -ENODEV; 54 53 } 55 54 ··· 59 54 sizeof(struct pinctrl_pin_desc), GFP_KERNEL); 60 55 groups = devm_kcalloc(&pdev->dev, num_gpios, 61 56 sizeof(struct msm_pingroup), GFP_KERNEL); 57 + 58 + if (!pins || !groups) 59 + return -ENOMEM; 62 60 63 61 for (i = 0; i < num_gpios; i++) { 64 62 pins[i].number = i;
+9 -6
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 14 14 #include <linux/gpio.h> 15 15 #include <linux/module.h> 16 16 #include <linux/of.h> 17 + #include <linux/of_irq.h> 17 18 #include <linux/pinctrl/pinconf-generic.h> 18 19 #include <linux/pinctrl/pinconf.h> 19 20 #include <linux/pinctrl/pinmux.h> ··· 694 693 struct pmic_gpio_pad *pad, *pads; 695 694 struct pmic_gpio_state *state; 696 695 int ret, npins, i; 697 - u32 res[2]; 696 + u32 reg; 698 697 699 - ret = of_property_read_u32_array(dev->of_node, "reg", res, 2); 698 + ret = of_property_read_u32(dev->of_node, "reg", &reg); 700 699 if (ret < 0) { 701 - dev_err(dev, "missing base address and/or range"); 700 + dev_err(dev, "missing base address"); 702 701 return ret; 703 702 } 704 703 705 - npins = res[1] / PMIC_GPIO_ADDRESS_RANGE; 706 - 704 + npins = platform_irq_count(pdev); 707 705 if (!npins) 708 706 return -EINVAL; 707 + if (npins < 0) 708 + return npins; 709 709 710 710 BUG_ON(npins > ARRAY_SIZE(pmic_gpio_groups)); 711 711 ··· 754 752 if (pad->irq < 0) 755 753 return pad->irq; 756 754 757 - pad->base = res[0] + i * PMIC_GPIO_ADDRESS_RANGE; 755 + pad->base = reg + i * PMIC_GPIO_ADDRESS_RANGE; 758 756 759 757 ret = pmic_gpio_populate(state, pad); 760 758 if (ret < 0) ··· 806 804 static const struct of_device_id pmic_gpio_of_match[] = { 807 805 { .compatible = "qcom,pm8916-gpio" }, /* 4 GPIO's */ 808 806 { .compatible = "qcom,pm8941-gpio" }, /* 36 GPIO's */ 807 + { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ 809 808 { .compatible = "qcom,pma8084-gpio" }, /* 22 GPIO's */ 810 809 { }, 811 810 };
+9 -5
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
··· 14 14 #include <linux/gpio.h> 15 15 #include <linux/module.h> 16 16 #include <linux/of.h> 17 + #include <linux/of_irq.h> 17 18 #include <linux/pinctrl/pinconf-generic.h> 18 19 #include <linux/pinctrl/pinconf.h> 19 20 #include <linux/pinctrl/pinmux.h> ··· 796 795 struct pmic_mpp_pad *pad, *pads; 797 796 struct pmic_mpp_state *state; 798 797 int ret, npins, i; 799 - u32 res[2]; 798 + u32 reg; 800 799 801 - ret = of_property_read_u32_array(dev->of_node, "reg", res, 2); 800 + ret = of_property_read_u32(dev->of_node, "reg", &reg); 802 801 if (ret < 0) { 803 - dev_err(dev, "missing base address and/or range"); 802 + dev_err(dev, "missing base address"); 804 803 return ret; 805 804 } 806 805 807 - npins = res[1] / PMIC_MPP_ADDRESS_RANGE; 806 + npins = platform_irq_count(pdev); 808 807 if (!npins) 809 808 return -EINVAL; 809 + if (npins < 0) 810 + return npins; 810 811 811 812 BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups)); 812 813 ··· 857 854 if (pad->irq < 0) 858 855 return pad->irq; 859 856 860 - pad->base = res[0] + i * PMIC_MPP_ADDRESS_RANGE; 857 + pad->base = reg + i * PMIC_MPP_ADDRESS_RANGE; 861 858 862 859 ret = pmic_mpp_populate(state, pad); 863 860 if (ret < 0) ··· 910 907 { .compatible = "qcom,pm8841-mpp" }, /* 4 MPP's */ 911 908 { .compatible = "qcom,pm8916-mpp" }, /* 4 MPP's */ 912 909 { .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */ 910 + { .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */ 913 911 { .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */ 914 912 { }, 915 913 };
+14 -7
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 23 23 #include <linux/gpio.h> 24 24 #include <linux/interrupt.h> 25 25 #include <linux/of_device.h> 26 + #include <linux/of_irq.h> 26 27 27 28 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h> 28 29 ··· 651 650 } 652 651 653 652 static const struct of_device_id pm8xxx_gpio_of_match[] = { 654 - { .compatible = "qcom,pm8018-gpio", .data = (void *)6 }, 655 - { .compatible = "qcom,pm8038-gpio", .data = (void *)12 }, 656 - { .compatible = "qcom,pm8058-gpio", .data = (void *)40 }, 657 - { .compatible = "qcom,pm8917-gpio", .data = (void *)38 }, 658 - { .compatible = "qcom,pm8921-gpio", .data = (void *)44 }, 653 + { .compatible = "qcom,pm8018-gpio" }, 654 + { .compatible = "qcom,pm8038-gpio" }, 655 + { .compatible = "qcom,pm8058-gpio" }, 656 + { .compatible = "qcom,pm8917-gpio" }, 657 + { .compatible = "qcom,pm8921-gpio" }, 658 + { .compatible = "qcom,ssbi-gpio" }, 659 659 { }, 660 660 }; 661 661 MODULE_DEVICE_TABLE(of, pm8xxx_gpio_of_match); ··· 667 665 struct pinctrl_pin_desc *pins; 668 666 struct pm8xxx_gpio *pctrl; 669 667 int ret; 670 - int i; 668 + int i, npins; 671 669 672 670 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); 673 671 if (!pctrl) 674 672 return -ENOMEM; 675 673 676 674 pctrl->dev = &pdev->dev; 677 - pctrl->npins = (unsigned long)of_device_get_match_data(&pdev->dev); 675 + npins = platform_irq_count(pdev); 676 + if (!npins) 677 + return -EINVAL; 678 + if (npins < 0) 679 + return npins; 680 + pctrl->npins = npins; 678 681 679 682 pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL); 680 683 if (!pctrl->regmap) {
+14 -7
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 23 23 #include <linux/gpio.h> 24 24 #include <linux/interrupt.h> 25 25 #include <linux/of_device.h> 26 + #include <linux/of_irq.h> 26 27 27 28 #include <dt-bindings/pinctrl/qcom,pmic-mpp.h> 28 29 ··· 742 741 } 743 742 744 743 static const struct of_device_id pm8xxx_mpp_of_match[] = { 745 - { .compatible = "qcom,pm8018-mpp", .data = (void *)6 }, 746 - { .compatible = "qcom,pm8038-mpp", .data = (void *)6 }, 747 - { .compatible = "qcom,pm8917-mpp", .data = (void *)10 }, 748 - { .compatible = "qcom,pm8821-mpp", .data = (void *)4 }, 749 - { .compatible = "qcom,pm8921-mpp", .data = (void *)12 }, 744 + { .compatible = "qcom,pm8018-mpp" }, 745 + { .compatible = "qcom,pm8038-mpp" }, 746 + { .compatible = "qcom,pm8917-mpp" }, 747 + { .compatible = "qcom,pm8821-mpp" }, 748 + { .compatible = "qcom,pm8921-mpp" }, 749 + { .compatible = "qcom,ssbi-mpp" }, 750 750 { }, 751 751 }; 752 752 MODULE_DEVICE_TABLE(of, pm8xxx_mpp_of_match); ··· 758 756 struct pinctrl_pin_desc *pins; 759 757 struct pm8xxx_mpp *pctrl; 760 758 int ret; 761 - int i; 759 + int i, npins; 762 760 763 761 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); 764 762 if (!pctrl) 765 763 return -ENOMEM; 766 764 767 765 pctrl->dev = &pdev->dev; 768 - pctrl->npins = (unsigned long)of_device_get_match_data(&pdev->dev); 766 + npins = platform_irq_count(pdev); 767 + if (!npins) 768 + return -EINVAL; 769 + if (npins < 0) 770 + return npins; 771 + pctrl->npins = npins; 769 772 770 773 pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL); 771 774 if (!pctrl->regmap) {
+103
drivers/pinctrl/samsung/pinctrl-exynos.c
··· 1150 1150 }, 1151 1151 }; 1152 1152 1153 + /* pin banks of exynos5410 pin-controller 0 */ 1154 + static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = { 1155 + EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 1156 + EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 1157 + EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08), 1158 + EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c), 1159 + EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10), 1160 + EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14), 1161 + EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpb3", 0x18), 1162 + EXYNOS_PIN_BANK_EINTG(7, 0x0E0, "gpc0", 0x1c), 1163 + EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc3", 0x20), 1164 + EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc1", 0x24), 1165 + EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc2", 0x28), 1166 + EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"), 1167 + EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x2c), 1168 + EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpe0", 0x30), 1169 + EXYNOS_PIN_BANK_EINTG(2, 0x1C0, "gpe1", 0x34), 1170 + EXYNOS_PIN_BANK_EINTG(6, 0x1E0, "gpf0", 0x38), 1171 + EXYNOS_PIN_BANK_EINTG(8, 0x200, "gpf1", 0x3c), 1172 + EXYNOS_PIN_BANK_EINTG(8, 0x220, "gpg0", 0x40), 1173 + EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpg1", 0x44), 1174 + EXYNOS_PIN_BANK_EINTG(2, 0x260, "gpg2", 0x48), 1175 + EXYNOS_PIN_BANK_EINTG(4, 0x280, "gph0", 0x4c), 1176 + EXYNOS_PIN_BANK_EINTG(8, 0x2A0, "gph1", 0x50), 1177 + EXYNOS_PIN_BANK_EINTN(8, 0x2C0, "gpm7"), 1178 + EXYNOS_PIN_BANK_EINTN(6, 0x2E0, "gpy0"), 1179 + EXYNOS_PIN_BANK_EINTN(4, 0x300, "gpy1"), 1180 + EXYNOS_PIN_BANK_EINTN(6, 0x320, "gpy2"), 1181 + EXYNOS_PIN_BANK_EINTN(8, 0x340, "gpy3"), 1182 + EXYNOS_PIN_BANK_EINTN(8, 0x360, "gpy4"), 1183 + EXYNOS_PIN_BANK_EINTN(8, 0x380, "gpy5"), 1184 + EXYNOS_PIN_BANK_EINTN(8, 0x3A0, "gpy6"), 1185 + EXYNOS_PIN_BANK_EINTN(8, 0x3C0, "gpy7"), 1186 + EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00), 1187 + EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04), 1188 + EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08), 1189 + EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c), 1190 + }; 1191 + 1192 + /* pin banks of exynos5410 pin-controller 1 */ 1193 + static const struct samsung_pin_bank_data exynos5410_pin_banks1[] __initconst = { 1194 + EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpj0", 0x00), 1195 + EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpj1", 0x04), 1196 + EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpj2", 0x08), 1197 + EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpj3", 0x0c), 1198 + EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpj4", 0x10), 1199 + EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpk0", 0x14), 1200 + EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpk1", 0x18), 1201 + EXYNOS_PIN_BANK_EINTG(8, 0x0E0, "gpk2", 0x1c), 1202 + EXYNOS_PIN_BANK_EINTG(7, 0x100, "gpk3", 0x20), 1203 + }; 1204 + 1205 + /* pin banks of exynos5410 pin-controller 2 */ 1206 + static const struct samsung_pin_bank_data exynos5410_pin_banks2[] __initconst = { 1207 + EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00), 1208 + EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04), 1209 + EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08), 1210 + EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpv3", 0x0c), 1211 + EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpv4", 0x10), 1212 + }; 1213 + 1214 + /* pin banks of exynos5410 pin-controller 3 */ 1215 + static const struct samsung_pin_bank_data exynos5410_pin_banks3[] __initconst = { 1216 + EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), 1217 + }; 1218 + 1219 + /* 1220 + * Samsung pinctrl driver data for Exynos5410 SoC. Exynos5410 SoC includes 1221 + * four gpio/pin-mux/pinconfig controllers. 1222 + */ 1223 + const struct samsung_pin_ctrl exynos5410_pin_ctrl[] __initconst = { 1224 + { 1225 + /* pin-controller instance 0 data */ 1226 + .pin_banks = exynos5410_pin_banks0, 1227 + .nr_banks = ARRAY_SIZE(exynos5410_pin_banks0), 1228 + .eint_gpio_init = exynos_eint_gpio_init, 1229 + .eint_wkup_init = exynos_eint_wkup_init, 1230 + .suspend = exynos_pinctrl_suspend, 1231 + .resume = exynos_pinctrl_resume, 1232 + }, { 1233 + /* pin-controller instance 1 data */ 1234 + .pin_banks = exynos5410_pin_banks1, 1235 + .nr_banks = ARRAY_SIZE(exynos5410_pin_banks1), 1236 + .eint_gpio_init = exynos_eint_gpio_init, 1237 + .suspend = exynos_pinctrl_suspend, 1238 + .resume = exynos_pinctrl_resume, 1239 + }, { 1240 + /* pin-controller instance 2 data */ 1241 + .pin_banks = exynos5410_pin_banks2, 1242 + .nr_banks = ARRAY_SIZE(exynos5410_pin_banks2), 1243 + .eint_gpio_init = exynos_eint_gpio_init, 1244 + .suspend = exynos_pinctrl_suspend, 1245 + .resume = exynos_pinctrl_resume, 1246 + }, { 1247 + /* pin-controller instance 3 data */ 1248 + .pin_banks = exynos5410_pin_banks3, 1249 + .nr_banks = ARRAY_SIZE(exynos5410_pin_banks3), 1250 + .eint_gpio_init = exynos_eint_gpio_init, 1251 + .suspend = exynos_pinctrl_suspend, 1252 + .resume = exynos_pinctrl_resume, 1253 + }, 1254 + }; 1255 + 1153 1256 /* pin banks of exynos5420 pin-controller 0 */ 1154 1257 static const struct samsung_pin_bank_data exynos5420_pin_banks0[] __initconst = { 1155 1258 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00),
+2
drivers/pinctrl/samsung/pinctrl-samsung.c
··· 1222 1222 .data = (void *)exynos5250_pin_ctrl }, 1223 1223 { .compatible = "samsung,exynos5260-pinctrl", 1224 1224 .data = (void *)exynos5260_pin_ctrl }, 1225 + { .compatible = "samsung,exynos5410-pinctrl", 1226 + .data = (void *)exynos5410_pin_ctrl }, 1225 1227 { .compatible = "samsung,exynos5420-pinctrl", 1226 1228 .data = (void *)exynos5420_pin_ctrl }, 1227 1229 { .compatible = "samsung,exynos5433-pinctrl",
+1
drivers/pinctrl/samsung/pinctrl-samsung.h
··· 270 270 extern const struct samsung_pin_ctrl exynos4415_pin_ctrl[]; 271 271 extern const struct samsung_pin_ctrl exynos5250_pin_ctrl[]; 272 272 extern const struct samsung_pin_ctrl exynos5260_pin_ctrl[]; 273 + extern const struct samsung_pin_ctrl exynos5410_pin_ctrl[]; 273 274 extern const struct samsung_pin_ctrl exynos5420_pin_ctrl[]; 274 275 extern const struct samsung_pin_ctrl exynos5433_pin_ctrl[]; 275 276 extern const struct samsung_pin_ctrl exynos7_pin_ctrl[];
+68 -68
drivers/pinctrl/sh-pfc/pfc-emev2.c
··· 258 258 259 259 /* GPSR0 */ 260 260 /* V9 */ 261 - PINMUX_DATA(JT_SEL_MARK, FN_JT_SEL), 261 + PINMUX_SINGLE(JT_SEL), 262 262 /* U9 */ 263 - PINMUX_DATA(ERR_RST_REQB_MARK, FN_ERR_RST_REQB), 263 + PINMUX_SINGLE(ERR_RST_REQB), 264 264 /* V8 */ 265 - PINMUX_DATA(REF_CLKO_MARK, FN_REF_CLKO), 265 + PINMUX_SINGLE(REF_CLKO), 266 266 /* U8 */ 267 - PINMUX_DATA(EXT_CLKI_MARK, FN_EXT_CLKI), 267 + PINMUX_SINGLE(EXT_CLKI), 268 268 /* B22*/ 269 269 PINMUX_IPSR_NOFN(LCD3_1_0_PORT18, LCD3_PXCLK, SEL_LCD3_1_0_00), 270 270 PINMUX_IPSR_NOFN(LCD3_1_0_PORT18, YUV3_CLK_O, SEL_LCD3_1_0_01), 271 271 /* C21 */ 272 - PINMUX_DATA(LCD3_PXCLKB_MARK, FN_LCD3_PXCLKB), 272 + PINMUX_SINGLE(LCD3_PXCLKB), 273 273 /* A21 */ 274 274 PINMUX_IPSR_NOFN(LCD3_1_0_PORT20, LCD3_CLK_I, SEL_LCD3_1_0_00), 275 275 PINMUX_IPSR_NOFN(LCD3_1_0_PORT20, YUV3_CLK_I, SEL_LCD3_1_0_01), ··· 285 285 286 286 /* GPSR1 */ 287 287 /* A20 */ 288 - PINMUX_DATA(LCD3_R0_MARK, FN_LCD3_R0), 288 + PINMUX_SINGLE(LCD3_R0), 289 289 /* B20 */ 290 - PINMUX_DATA(LCD3_R1_MARK, FN_LCD3_R1), 290 + PINMUX_SINGLE(LCD3_R1), 291 291 /* A19 */ 292 - PINMUX_DATA(LCD3_R2_MARK, FN_LCD3_R2), 292 + PINMUX_SINGLE(LCD3_R2), 293 293 /* B19 */ 294 - PINMUX_DATA(LCD3_R3_MARK, FN_LCD3_R3), 294 + PINMUX_SINGLE(LCD3_R3), 295 295 /* C19 */ 296 - PINMUX_DATA(LCD3_R4_MARK, FN_LCD3_R4), 296 + PINMUX_SINGLE(LCD3_R4), 297 297 /* B18 */ 298 - PINMUX_DATA(LCD3_R5_MARK, FN_LCD3_R5), 298 + PINMUX_SINGLE(LCD3_R5), 299 299 /* C18 */ 300 300 PINMUX_IPSR_NOFN(LCD3_9_8_PORT38, LCD3_R6, SEL_LCD3_9_8_00), 301 301 PINMUX_IPSR_NOFN(LCD3_9_8_PORT38, TP33_CLK, SEL_LCD3_9_8_10), ··· 367 367 PINMUX_IPSR_NOFN(LCD3_11_10_PORT43, YUV3_D15, SEL_LCD3_11_10_01), 368 368 PINMUX_IPSR_NOFN(LCD3_11_10_PORT43, TP33_DATA15, SEL_LCD3_11_10_10), 369 369 /* AA9 */ 370 - PINMUX_DATA(IIC0_SCL_MARK, FN_IIC0_SCL), 370 + PINMUX_SINGLE(IIC0_SCL), 371 371 /* AA8 */ 372 - PINMUX_DATA(IIC0_SDA_MARK, FN_IIC0_SDA), 372 + PINMUX_SINGLE(IIC0_SDA), 373 373 /* Y9 */ 374 374 PINMUX_IPSR_NOFN(IIC_1_0_PORT46, IIC1_SCL, SEL_IIC_1_0_00), 375 375 PINMUX_IPSR_NOFN(IIC_1_0_PORT46, UART3_RX, SEL_IIC_1_0_01), ··· 377 377 PINMUX_IPSR_NOFN(IIC_1_0_PORT47, IIC1_SDA, SEL_IIC_1_0_00), 378 378 PINMUX_IPSR_NOFN(IIC_1_0_PORT47, UART3_TX, SEL_IIC_1_0_01), 379 379 /* AC19 */ 380 - PINMUX_DATA(SD_CKI_MARK, FN_SD_CKI), 380 + PINMUX_SINGLE(SD_CKI), 381 381 /* AB18 */ 382 - PINMUX_DATA(SDI0_CKO_MARK, FN_SDI0_CKO), 382 + PINMUX_SINGLE(SDI0_CKO), 383 383 /* AC18 */ 384 - PINMUX_DATA(SDI0_CKI_MARK, FN_SDI0_CKI), 384 + PINMUX_SINGLE(SDI0_CKI), 385 385 /* Y12 */ 386 - PINMUX_DATA(SDI0_CMD_MARK, FN_SDI0_CMD), 386 + PINMUX_SINGLE(SDI0_CMD), 387 387 /* AA13 */ 388 - PINMUX_DATA(SDI0_DATA0_MARK, FN_SDI0_DATA0), 388 + PINMUX_SINGLE(SDI0_DATA0), 389 389 /* Y13 */ 390 - PINMUX_DATA(SDI0_DATA1_MARK, FN_SDI0_DATA1), 390 + PINMUX_SINGLE(SDI0_DATA1), 391 391 /* AA14 */ 392 - PINMUX_DATA(SDI0_DATA2_MARK, FN_SDI0_DATA2), 392 + PINMUX_SINGLE(SDI0_DATA2), 393 393 /* Y14 */ 394 - PINMUX_DATA(SDI0_DATA3_MARK, FN_SDI0_DATA3), 394 + PINMUX_SINGLE(SDI0_DATA3), 395 395 /* AA15 */ 396 - PINMUX_DATA(SDI0_DATA4_MARK, FN_SDI0_DATA4), 396 + PINMUX_SINGLE(SDI0_DATA4), 397 397 /* Y15 */ 398 - PINMUX_DATA(SDI0_DATA5_MARK, FN_SDI0_DATA5), 398 + PINMUX_SINGLE(SDI0_DATA5), 399 399 /* AA16 */ 400 - PINMUX_DATA(SDI0_DATA6_MARK, FN_SDI0_DATA6), 400 + PINMUX_SINGLE(SDI0_DATA6), 401 401 /* Y16 */ 402 - PINMUX_DATA(SDI0_DATA7_MARK, FN_SDI0_DATA7), 402 + PINMUX_SINGLE(SDI0_DATA7), 403 403 /* AB22 */ 404 - PINMUX_DATA(SDI1_CKO_MARK, FN_SDI1_CKO), 404 + PINMUX_SINGLE(SDI1_CKO), 405 405 /* AA23 */ 406 - PINMUX_DATA(SDI1_CKI_MARK, FN_SDI1_CKI), 406 + PINMUX_SINGLE(SDI1_CKI), 407 407 /* AC21 */ 408 - PINMUX_DATA(SDI1_CMD_MARK, FN_SDI1_CMD), 408 + PINMUX_SINGLE(SDI1_CMD), 409 409 410 410 /* GPSR2 */ 411 411 /* AB21 */ 412 - PINMUX_DATA(SDI1_DATA0_MARK, FN_SDI1_DATA0), 412 + PINMUX_SINGLE(SDI1_DATA0), 413 413 /* AB20 */ 414 - PINMUX_DATA(SDI1_DATA1_MARK, FN_SDI1_DATA1), 414 + PINMUX_SINGLE(SDI1_DATA1), 415 415 /* AB19 */ 416 - PINMUX_DATA(SDI1_DATA2_MARK, FN_SDI1_DATA2), 416 + PINMUX_SINGLE(SDI1_DATA2), 417 417 /* AA19 */ 418 - PINMUX_DATA(SDI1_DATA3_MARK, FN_SDI1_DATA3), 418 + PINMUX_SINGLE(SDI1_DATA3), 419 419 /* J23 */ 420 - PINMUX_DATA(AB_CLK_MARK, FN_AB_CLK), 420 + PINMUX_SINGLE(AB_CLK), 421 421 /* D21 */ 422 - PINMUX_DATA(AB_CSB0_MARK, FN_AB_CSB0), 422 + PINMUX_SINGLE(AB_CSB0), 423 423 /* E21 */ 424 - PINMUX_DATA(AB_CSB1_MARK, FN_AB_CSB1), 424 + PINMUX_SINGLE(AB_CSB1), 425 425 /* F20 */ 426 426 PINMUX_IPSR_NOFN(AB_1_0_PORT71, AB_CSB2, SEL_AB_1_0_00), 427 427 PINMUX_IPSR_NOFN(AB_1_0_PORT71, CF_CSB0, SEL_AB_1_0_10), ··· 514 514 515 515 /* GPSR3 */ 516 516 /* M21 */ 517 - PINMUX_DATA(AB_A20_MARK, FN_AB_A20), 517 + PINMUX_SINGLE(AB_A20), 518 518 /* N21 */ 519 519 PINMUX_IPSR_NOFN(AB_9_8_PORT97, AB_A21, SEL_AB_9_8_00), 520 520 PINMUX_IPSR_NOFN(AB_9_8_PORT97, SDI2_CKO, SEL_AB_9_8_01), ··· 541 541 PINMUX_IPSR_NOFN(AB_13_12_PORT104, AB_A28, SEL_AB_13_12_00), 542 542 PINMUX_IPSR_NOFN(AB_13_12_PORT104, AB_BEN1, SEL_AB_13_12_10), 543 543 /* B8 */ 544 - PINMUX_DATA(USI0_CS1_MARK, FN_USI0_CS1), 544 + PINMUX_SINGLE(USI0_CS1), 545 545 /* B9 */ 546 - PINMUX_DATA(USI0_CS2_MARK, FN_USI0_CS2), 546 + PINMUX_SINGLE(USI0_CS2), 547 547 /* C10 */ 548 - PINMUX_DATA(USI1_DI_MARK, FN_USI1_DI), 548 + PINMUX_SINGLE(USI1_DI), 549 549 /* D10 */ 550 - PINMUX_DATA(USI1_DO_MARK, FN_USI1_DO), 550 + PINMUX_SINGLE(USI1_DO), 551 551 /* AB5 */ 552 552 PINMUX_IPSR_NOFN(USI_1_0_PORT109, USI2_CLK, SEL_USI_1_0_00), 553 553 PINMUX_IPSR_NOFN(USI_1_0_PORT109, DTV_BCLK_B, SEL_USI_1_0_01), ··· 587 587 PINMUX_IPSR_NOFN(USI_9_8_PORT121, PWM1, SEL_USI_9_8_00), 588 588 PINMUX_IPSR_NOFN(USI_9_8_PORT121, USI4_DO, SEL_USI_9_8_01), 589 589 /* V20 */ 590 - PINMUX_DATA(NTSC_CLK_MARK, FN_NTSC_CLK), 590 + PINMUX_SINGLE(NTSC_CLK), 591 591 /* P20 */ 592 - PINMUX_DATA(NTSC_DATA0_MARK, FN_NTSC_DATA0), 592 + PINMUX_SINGLE(NTSC_DATA0), 593 593 /* P18 */ 594 - PINMUX_DATA(NTSC_DATA1_MARK, FN_NTSC_DATA1), 594 + PINMUX_SINGLE(NTSC_DATA1), 595 595 /* R20 */ 596 - PINMUX_DATA(NTSC_DATA2_MARK, FN_NTSC_DATA2), 596 + PINMUX_SINGLE(NTSC_DATA2), 597 597 /* R18 */ 598 - PINMUX_DATA(NTSC_DATA3_MARK, FN_NTSC_DATA3), 598 + PINMUX_SINGLE(NTSC_DATA3), 599 599 /* T20 */ 600 - PINMUX_DATA(NTSC_DATA4_MARK, FN_NTSC_DATA4), 600 + PINMUX_SINGLE(NTSC_DATA4), 601 601 602 602 /* GPRS3 */ 603 603 /* T18 */ 604 - PINMUX_DATA(NTSC_DATA5_MARK, FN_NTSC_DATA5), 604 + PINMUX_SINGLE(NTSC_DATA5), 605 605 /* U20 */ 606 - PINMUX_DATA(NTSC_DATA6_MARK, FN_NTSC_DATA6), 606 + PINMUX_SINGLE(NTSC_DATA6), 607 607 /* U18 */ 608 - PINMUX_DATA(NTSC_DATA7_MARK, FN_NTSC_DATA7), 608 + PINMUX_SINGLE(NTSC_DATA7), 609 609 /* W23 */ 610 - PINMUX_DATA(CAM_CLKO_MARK, FN_CAM_CLKO), 610 + PINMUX_SINGLE(CAM_CLKO), 611 611 /* Y23 */ 612 - PINMUX_DATA(CAM_CLKI_MARK, FN_CAM_CLKI), 612 + PINMUX_SINGLE(CAM_CLKI), 613 613 /* W22 */ 614 - PINMUX_DATA(CAM_VS_MARK, FN_CAM_VS), 614 + PINMUX_SINGLE(CAM_VS), 615 615 /* V21 */ 616 - PINMUX_DATA(CAM_HS_MARK, FN_CAM_HS), 616 + PINMUX_SINGLE(CAM_HS), 617 617 /* T21 */ 618 - PINMUX_DATA(CAM_YUV0_MARK, FN_CAM_YUV0), 618 + PINMUX_SINGLE(CAM_YUV0), 619 619 /* T22 */ 620 - PINMUX_DATA(CAM_YUV1_MARK, FN_CAM_YUV1), 620 + PINMUX_SINGLE(CAM_YUV1), 621 621 /* T23 */ 622 - PINMUX_DATA(CAM_YUV2_MARK, FN_CAM_YUV2), 622 + PINMUX_SINGLE(CAM_YUV2), 623 623 /* U21 */ 624 - PINMUX_DATA(CAM_YUV3_MARK, FN_CAM_YUV3), 624 + PINMUX_SINGLE(CAM_YUV3), 625 625 /* U22 */ 626 - PINMUX_DATA(CAM_YUV4_MARK, FN_CAM_YUV4), 626 + PINMUX_SINGLE(CAM_YUV4), 627 627 /* U23 */ 628 - PINMUX_DATA(CAM_YUV5_MARK, FN_CAM_YUV5), 628 + PINMUX_SINGLE(CAM_YUV5), 629 629 /* V22 */ 630 - PINMUX_DATA(CAM_YUV6_MARK, FN_CAM_YUV6), 630 + PINMUX_SINGLE(CAM_YUV6), 631 631 /* V23 */ 632 - PINMUX_DATA(CAM_YUV7_MARK, FN_CAM_YUV7), 632 + PINMUX_SINGLE(CAM_YUV7), 633 633 /* K22 */ 634 634 PINMUX_IPSR_NOFN(HSI_1_0_PORT143, USI5_CLK_B, SEL_HSI_1_0_01), 635 635 /* K23 */ ··· 647 647 /* M22 */ 648 648 PINMUX_IPSR_NOFN(HSI_1_0_PORT150, USI5_DI_B, SEL_HSI_1_0_01), 649 649 /* D13 */ 650 - PINMUX_DATA(JT_TDO_MARK, FN_JT_TDO), 650 + PINMUX_SINGLE(JT_TDO), 651 651 /* F13 */ 652 - PINMUX_DATA(JT_TDOEN_MARK, FN_JT_TDOEN), 652 + PINMUX_SINGLE(JT_TDOEN), 653 653 /* AA12 */ 654 - PINMUX_DATA(USB_VBUS_MARK, FN_USB_VBUS), 654 + PINMUX_SINGLE(USB_VBUS), 655 655 /* A12 */ 656 - PINMUX_DATA(LOWPWR_MARK, FN_LOWPWR), 656 + PINMUX_SINGLE(LOWPWR), 657 657 /* Y11 */ 658 - PINMUX_DATA(UART1_RX_MARK, FN_UART1_RX), 658 + PINMUX_SINGLE(UART1_RX), 659 659 /* Y10 */ 660 - PINMUX_DATA(UART1_TX_MARK, FN_UART1_TX), 660 + PINMUX_SINGLE(UART1_TX), 661 661 /* AA10 */ 662 662 PINMUX_IPSR_NOFN(UART_1_0_PORT157, UART1_CTSB, SEL_UART_1_0_00), 663 663 PINMUX_IPSR_NOFN(UART_1_0_PORT157, UART2_RX, SEL_UART_1_0_01), ··· 749 749 }; 750 750 751 751 static const unsigned int cf_data8_pins[] = { 752 - /* CF_D[0:8] */ 752 + /* CF_D[0:7] */ 753 753 77, 78, 79, 80, 754 754 81, 82, 83, 84, 755 755 };
+1 -1
drivers/pinctrl/sh-pfc/pfc-r8a7740.c
··· 2214 2214 LCD1_D8_MARK, 2215 2215 }; 2216 2216 static const unsigned int lcd1_data12_pins[] = { 2217 - /* D[0:12] */ 2217 + /* D[0:11] */ 2218 2218 4, 3, 2, 1, 0, 91, 92, 23, 2219 2219 93, 94, 21, 201, 2220 2220 };
+11 -11
drivers/pinctrl/sh-pfc/pfc-r8a7778.c
··· 548 548 static const u16 pinmux_data[] = { 549 549 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */ 550 550 551 - PINMUX_DATA(PENC0_MARK, FN_PENC0), 552 - PINMUX_DATA(PENC1_MARK, FN_PENC1), 553 - PINMUX_DATA(A1_MARK, FN_A1), 554 - PINMUX_DATA(A2_MARK, FN_A2), 555 - PINMUX_DATA(A3_MARK, FN_A3), 556 - PINMUX_DATA(WE0_MARK, FN_WE0), 557 - PINMUX_DATA(AUDIO_CLKA_MARK, FN_AUDIO_CLKA), 558 - PINMUX_DATA(AUDIO_CLKB_MARK, FN_AUDIO_CLKB), 559 - PINMUX_DATA(SSI_SCK34_MARK, FN_SSI_SCK34), 560 - PINMUX_DATA(AVS1_MARK, FN_AVS1), 561 - PINMUX_DATA(AVS2_MARK, FN_AVS2), 551 + PINMUX_SINGLE(PENC0), 552 + PINMUX_SINGLE(PENC1), 553 + PINMUX_SINGLE(A1), 554 + PINMUX_SINGLE(A2), 555 + PINMUX_SINGLE(A3), 556 + PINMUX_SINGLE(WE0), 557 + PINMUX_SINGLE(AUDIO_CLKA), 558 + PINMUX_SINGLE(AUDIO_CLKB), 559 + PINMUX_SINGLE(SSI_SCK34), 560 + PINMUX_SINGLE(AVS1), 561 + PINMUX_SINGLE(AVS2), 562 562 563 563 /* IPSR0 */ 564 564 PINMUX_IPSR_DATA(IP0_1_0, PRESETOUT),
+48 -14
drivers/pinctrl/sh-pfc/pfc-r8a7779.c
··· 23 23 24 24 #include "sh_pfc.h" 25 25 26 - #define PORT_GP_9(bank, fn, sfx) \ 27 - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ 28 - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ 29 - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ 30 - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ 31 - PORT_GP_1(bank, 8, fn, sfx) 32 - 33 26 #define CPU_ALL_PORT(fn, sfx) \ 34 27 PORT_GP_32(0, fn, sfx), \ 35 28 PORT_GP_32(1, fn, sfx), \ ··· 602 609 static const u16 pinmux_data[] = { 603 610 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */ 604 611 605 - PINMUX_DATA(AVS1_MARK, FN_AVS1), 606 - PINMUX_DATA(AVS1_MARK, FN_AVS1), 607 - PINMUX_DATA(A17_MARK, FN_A17), 608 - PINMUX_DATA(A18_MARK, FN_A18), 609 - PINMUX_DATA(A19_MARK, FN_A19), 612 + PINMUX_SINGLE(AVS1), 613 + PINMUX_SINGLE(AVS1), 614 + PINMUX_SINGLE(A17), 615 + PINMUX_SINGLE(A18), 616 + PINMUX_SINGLE(A19), 610 617 611 - PINMUX_DATA(USB_PENC0_MARK, FN_USB_PENC0), 612 - PINMUX_DATA(USB_PENC1_MARK, FN_USB_PENC1), 618 + PINMUX_SINGLE(USB_PENC0), 619 + PINMUX_SINGLE(USB_PENC1), 613 620 614 621 PINMUX_IPSR_DATA(IP0_2_0, USB_PENC2), 615 622 PINMUX_IPSR_MSEL(IP0_2_0, SCK0, SEL_SCIF0_0), ··· 2282 2289 static const unsigned int scif5_clk_d_mux[] = { 2283 2290 SCK5_D_MARK, 2284 2291 }; 2292 + /* - SCIF Clock ------------------------------------------------------------- */ 2293 + static const unsigned int scif_clk_pins[] = { 2294 + /* SCIF_CLK */ 2295 + RCAR_GP_PIN(4, 28), 2296 + }; 2297 + static const unsigned int scif_clk_mux[] = { 2298 + SCIF_CLK_MARK, 2299 + }; 2300 + static const unsigned int scif_clk_b_pins[] = { 2301 + /* SCIF_CLK */ 2302 + RCAR_GP_PIN(4, 5), 2303 + }; 2304 + static const unsigned int scif_clk_b_mux[] = { 2305 + SCIF_CLK_B_MARK, 2306 + }; 2307 + static const unsigned int scif_clk_c_pins[] = { 2308 + /* SCIF_CLK */ 2309 + RCAR_GP_PIN(4, 18), 2310 + }; 2311 + static const unsigned int scif_clk_c_mux[] = { 2312 + SCIF_CLK_C_MARK, 2313 + }; 2314 + static const unsigned int scif_clk_d_pins[] = { 2315 + /* SCIF_CLK */ 2316 + RCAR_GP_PIN(2, 29), 2317 + }; 2318 + static const unsigned int scif_clk_d_mux[] = { 2319 + SCIF_CLK_D_MARK, 2320 + }; 2285 2321 /* - SDHI0 ------------------------------------------------------------------ */ 2286 2322 static const unsigned int sdhi0_data1_pins[] = { 2287 2323 /* D0 */ ··· 2722 2700 SH_PFC_PIN_GROUP(scif5_clk_c), 2723 2701 SH_PFC_PIN_GROUP(scif5_data_d), 2724 2702 SH_PFC_PIN_GROUP(scif5_clk_d), 2703 + SH_PFC_PIN_GROUP(scif_clk), 2704 + SH_PFC_PIN_GROUP(scif_clk_b), 2705 + SH_PFC_PIN_GROUP(scif_clk_c), 2706 + SH_PFC_PIN_GROUP(scif_clk_d), 2725 2707 SH_PFC_PIN_GROUP(sdhi0_data1), 2726 2708 SH_PFC_PIN_GROUP(sdhi0_data4), 2727 2709 SH_PFC_PIN_GROUP(sdhi0_ctrl), ··· 2935 2909 "scif5_clk_d", 2936 2910 }; 2937 2911 2912 + static const char * const scif_clk_groups[] = { 2913 + "scif_clk", 2914 + "scif_clk_b", 2915 + "scif_clk_c", 2916 + "scif_clk_d", 2917 + }; 2918 + 2938 2919 static const char * const sdhi0_groups[] = { 2939 2920 "sdhi0_data1", 2940 2921 "sdhi0_data4", ··· 3037 3004 SH_PFC_FUNCTION(scif3), 3038 3005 SH_PFC_FUNCTION(scif4), 3039 3006 SH_PFC_FUNCTION(scif5), 3007 + SH_PFC_FUNCTION(scif_clk), 3040 3008 SH_PFC_FUNCTION(usb0), 3041 3009 SH_PFC_FUNCTION(usb1), 3042 3010 SH_PFC_FUNCTION(usb2),
+32 -26
drivers/pinctrl/sh-pfc/pfc-r8a7790.c
··· 26 26 #include "core.h" 27 27 #include "sh_pfc.h" 28 28 29 - #define PORT_GP_30(bank, fn, sfx) \ 30 - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ 31 - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ 32 - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ 33 - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ 34 - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ 35 - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ 36 - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ 37 - PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx), \ 38 - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx), \ 39 - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ 40 - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ 41 - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ 42 - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx), \ 43 - PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx), \ 44 - PORT_GP_1(bank, 28, fn, sfx), PORT_GP_1(bank, 29, fn, sfx) 45 - 46 29 #define CPU_ALL_PORT(fn, sfx) \ 47 30 PORT_GP_32(0, fn, sfx), \ 48 31 PORT_GP_30(1, fn, sfx), \ ··· 789 806 static const u16 pinmux_data[] = { 790 807 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */ 791 808 792 - PINMUX_DATA(VI1_DATA7_VI1_B7_MARK, FN_VI1_DATA7_VI1_B7), 793 - PINMUX_DATA(USB0_PWEN_MARK, FN_USB0_PWEN), 794 - PINMUX_DATA(USB0_OVC_VBUS_MARK, FN_USB0_OVC_VBUS), 795 - PINMUX_DATA(USB2_PWEN_MARK, FN_USB2_PWEN), 796 - PINMUX_DATA(USB2_OVC_MARK, FN_USB2_OVC), 797 - PINMUX_DATA(AVS1_MARK, FN_AVS1), 798 - PINMUX_DATA(AVS2_MARK, FN_AVS2), 799 - PINMUX_DATA(DU_DOTCLKIN0_MARK, FN_DU_DOTCLKIN0), 800 - PINMUX_DATA(DU_DOTCLKIN2_MARK, FN_DU_DOTCLKIN2), 809 + PINMUX_SINGLE(VI1_DATA7_VI1_B7), 810 + PINMUX_SINGLE(USB0_PWEN), 811 + PINMUX_SINGLE(USB0_OVC_VBUS), 812 + PINMUX_SINGLE(USB2_PWEN), 813 + PINMUX_SINGLE(USB2_OVC), 814 + PINMUX_SINGLE(AVS1), 815 + PINMUX_SINGLE(AVS2), 816 + PINMUX_SINGLE(DU_DOTCLKIN0), 817 + PINMUX_SINGLE(DU_DOTCLKIN2), 801 818 802 819 PINMUX_IPSR_DATA(IP0_2_0, D0), 803 820 PINMUX_IPSR_MSEL(IP0_2_0, MSIOF3_SCK_B, SEL_SOF3_1), ··· 3219 3236 static const unsigned int scifb2_data_c_mux[] = { 3220 3237 SCIFB2_RXD_C_MARK, SCIFB2_TXD_C_MARK, 3221 3238 }; 3239 + /* - SCIF Clock ------------------------------------------------------------- */ 3240 + static const unsigned int scif_clk_pins[] = { 3241 + /* SCIF_CLK */ 3242 + RCAR_GP_PIN(4, 26), 3243 + }; 3244 + static const unsigned int scif_clk_mux[] = { 3245 + SCIF_CLK_MARK, 3246 + }; 3247 + static const unsigned int scif_clk_b_pins[] = { 3248 + /* SCIF_CLK */ 3249 + RCAR_GP_PIN(5, 4), 3250 + }; 3251 + static const unsigned int scif_clk_b_mux[] = { 3252 + SCIF_CLK_B_MARK, 3253 + }; 3222 3254 /* - SDHI0 ------------------------------------------------------------------ */ 3223 3255 static const unsigned int sdhi0_data1_pins[] = { 3224 3256 /* D0 */ ··· 4137 4139 SH_PFC_PIN_GROUP(scifb2_clk_b), 4138 4140 SH_PFC_PIN_GROUP(scifb2_ctrl_b), 4139 4141 SH_PFC_PIN_GROUP(scifb2_data_c), 4142 + SH_PFC_PIN_GROUP(scif_clk), 4143 + SH_PFC_PIN_GROUP(scif_clk_b), 4140 4144 SH_PFC_PIN_GROUP(sdhi0_data1), 4141 4145 SH_PFC_PIN_GROUP(sdhi0_data4), 4142 4146 SH_PFC_PIN_GROUP(sdhi0_ctrl), ··· 4555 4555 "scifb2_data_c", 4556 4556 }; 4557 4557 4558 + static const char * const scif_clk_groups[] = { 4559 + "scif_clk", 4560 + "scif_clk_b", 4561 + }; 4562 + 4558 4563 static const char * const sdhi0_groups[] = { 4559 4564 "sdhi0_data1", 4560 4565 "sdhi0_data4", ··· 4734 4729 SH_PFC_FUNCTION(scifb0), 4735 4730 SH_PFC_FUNCTION(scifb1), 4736 4731 SH_PFC_FUNCTION(scifb2), 4732 + SH_PFC_FUNCTION(scif_clk), 4737 4733 SH_PFC_FUNCTION(sdhi0), 4738 4734 SH_PFC_FUNCTION(sdhi1), 4739 4735 SH_PFC_FUNCTION(sdhi2),
+135 -32
drivers/pinctrl/sh-pfc/pfc-r8a7791.c
··· 2 2 * r8a7791 processor support - PFC hardware block. 3 3 * 4 4 * Copyright (C) 2013 Renesas Electronics Corporation 5 + * Copyright (C) 2014-2015 Cogent Embedded, Inc. 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License version 2 ··· 13 12 14 13 #include "core.h" 15 14 #include "sh_pfc.h" 16 - 17 - #define PORT_GP_26(bank, fn, sfx) \ 18 - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ 19 - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ 20 - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ 21 - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ 22 - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ 23 - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ 24 - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ 25 - PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx), \ 26 - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx), \ 27 - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ 28 - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ 29 - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ 30 - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) 31 15 32 16 #define CPU_ALL_PORT(fn, sfx) \ 33 17 PORT_GP_32(0, fn, sfx), \ ··· 773 787 static const u16 pinmux_data[] = { 774 788 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */ 775 789 776 - PINMUX_DATA(EX_CS0_N_MARK, FN_EX_CS0_N), 777 - PINMUX_DATA(RD_N_MARK, FN_RD_N), 778 - PINMUX_DATA(AUDIO_CLKA_MARK, FN_AUDIO_CLKA), 779 - PINMUX_DATA(VI0_CLK_MARK, FN_VI0_CLK), 780 - PINMUX_DATA(VI0_DATA0_VI0_B0_MARK, FN_VI0_DATA0_VI0_B0), 781 - PINMUX_DATA(VI0_DATA1_VI0_B1_MARK, FN_VI0_DATA1_VI0_B1), 782 - PINMUX_DATA(VI0_DATA2_VI0_B2_MARK, FN_VI0_DATA2_VI0_B2), 783 - PINMUX_DATA(VI0_DATA4_VI0_B4_MARK, FN_VI0_DATA4_VI0_B4), 784 - PINMUX_DATA(VI0_DATA5_VI0_B5_MARK, FN_VI0_DATA5_VI0_B5), 785 - PINMUX_DATA(VI0_DATA6_VI0_B6_MARK, FN_VI0_DATA6_VI0_B6), 786 - PINMUX_DATA(VI0_DATA7_VI0_B7_MARK, FN_VI0_DATA7_VI0_B7), 787 - PINMUX_DATA(USB0_PWEN_MARK, FN_USB0_PWEN), 788 - PINMUX_DATA(USB0_OVC_MARK, FN_USB0_OVC), 789 - PINMUX_DATA(USB1_PWEN_MARK, FN_USB1_PWEN), 790 - PINMUX_DATA(USB1_OVC_MARK, FN_USB1_OVC), 791 - PINMUX_DATA(DU0_DOTCLKIN_MARK, FN_DU0_DOTCLKIN), 792 - PINMUX_DATA(SD1_CLK_MARK, FN_SD1_CLK), 790 + PINMUX_SINGLE(EX_CS0_N), 791 + PINMUX_SINGLE(RD_N), 792 + PINMUX_SINGLE(AUDIO_CLKA), 793 + PINMUX_SINGLE(VI0_CLK), 794 + PINMUX_SINGLE(VI0_DATA0_VI0_B0), 795 + PINMUX_SINGLE(VI0_DATA1_VI0_B1), 796 + PINMUX_SINGLE(VI0_DATA2_VI0_B2), 797 + PINMUX_SINGLE(VI0_DATA4_VI0_B4), 798 + PINMUX_SINGLE(VI0_DATA5_VI0_B5), 799 + PINMUX_SINGLE(VI0_DATA6_VI0_B6), 800 + PINMUX_SINGLE(VI0_DATA7_VI0_B7), 801 + PINMUX_SINGLE(USB0_PWEN), 802 + PINMUX_SINGLE(USB0_OVC), 803 + PINMUX_SINGLE(USB1_PWEN), 804 + PINMUX_SINGLE(USB1_OVC), 805 + PINMUX_SINGLE(DU0_DOTCLKIN), 806 + PINMUX_SINGLE(SD1_CLK), 793 807 794 808 /* IPSR0 */ 795 809 PINMUX_IPSR_DATA(IP0_0, D0), ··· 1724 1738 1725 1739 static const unsigned int audio_clkout_mux[] = { 1726 1740 AUDIO_CLKOUT_MARK, 1741 + }; 1742 + 1743 + /* - AVB -------------------------------------------------------------------- */ 1744 + static const unsigned int avb_link_pins[] = { 1745 + RCAR_GP_PIN(5, 14), 1746 + }; 1747 + static const unsigned int avb_link_mux[] = { 1748 + AVB_LINK_MARK, 1749 + }; 1750 + static const unsigned int avb_magic_pins[] = { 1751 + RCAR_GP_PIN(5, 11), 1752 + }; 1753 + static const unsigned int avb_magic_mux[] = { 1754 + AVB_MAGIC_MARK, 1755 + }; 1756 + static const unsigned int avb_phy_int_pins[] = { 1757 + RCAR_GP_PIN(5, 16), 1758 + }; 1759 + static const unsigned int avb_phy_int_mux[] = { 1760 + AVB_PHY_INT_MARK, 1761 + }; 1762 + static const unsigned int avb_mdio_pins[] = { 1763 + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 9), 1764 + }; 1765 + static const unsigned int avb_mdio_mux[] = { 1766 + AVB_MDC_MARK, AVB_MDIO_MARK, 1767 + }; 1768 + static const unsigned int avb_mii_pins[] = { 1769 + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20), 1770 + RCAR_GP_PIN(5, 21), 1771 + 1772 + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2), 1773 + RCAR_GP_PIN(5, 3), 1774 + 1775 + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10), 1776 + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27), 1777 + RCAR_GP_PIN(5, 28), RCAR_GP_PIN(5, 29), 1778 + }; 1779 + static const unsigned int avb_mii_mux[] = { 1780 + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK, 1781 + AVB_TXD3_MARK, 1782 + 1783 + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK, 1784 + AVB_RXD3_MARK, 1785 + 1786 + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK, 1787 + AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_ER_MARK, 1788 + AVB_TX_CLK_MARK, AVB_COL_MARK, 1789 + }; 1790 + static const unsigned int avb_gmii_pins[] = { 1791 + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20), 1792 + RCAR_GP_PIN(5, 21), RCAR_GP_PIN(5, 22), RCAR_GP_PIN(5, 23), 1793 + RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25), 1794 + 1795 + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2), 1796 + RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 5), 1797 + RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 7), 1798 + 1799 + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10), 1800 + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 30), RCAR_GP_PIN(5, 17), 1801 + RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27), RCAR_GP_PIN(5, 28), 1802 + RCAR_GP_PIN(5, 29), 1803 + }; 1804 + static const unsigned int avb_gmii_mux[] = { 1805 + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK, 1806 + AVB_TXD3_MARK, AVB_TXD4_MARK, AVB_TXD5_MARK, 1807 + AVB_TXD6_MARK, AVB_TXD7_MARK, 1808 + 1809 + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK, 1810 + AVB_RXD3_MARK, AVB_RXD4_MARK, AVB_RXD5_MARK, 1811 + AVB_RXD6_MARK, AVB_RXD7_MARK, 1812 + 1813 + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK, 1814 + AVB_CRS_MARK, AVB_GTX_CLK_MARK, AVB_GTXREFCLK_MARK, 1815 + AVB_TX_EN_MARK, AVB_TX_ER_MARK, AVB_TX_CLK_MARK, 1816 + AVB_COL_MARK, 1727 1817 }; 1728 1818 1729 1819 /* - CAN -------------------------------------------------------------------- */ ··· 3664 3602 static const unsigned int scifb2_data_d_mux[] = { 3665 3603 SCIFB2_RXD_D_MARK, SCIFB2_TXD_D_MARK, 3666 3604 }; 3605 + 3606 + /* - SCIF Clock ------------------------------------------------------------- */ 3607 + static const unsigned int scif_clk_pins[] = { 3608 + /* SCIF_CLK */ 3609 + RCAR_GP_PIN(2, 29), 3610 + }; 3611 + static const unsigned int scif_clk_mux[] = { 3612 + SCIF_CLK_MARK, 3613 + }; 3614 + static const unsigned int scif_clk_b_pins[] = { 3615 + /* SCIF_CLK */ 3616 + RCAR_GP_PIN(7, 19), 3617 + }; 3618 + static const unsigned int scif_clk_b_mux[] = { 3619 + SCIF_CLK_B_MARK, 3620 + }; 3621 + 3667 3622 /* - SDHI0 ------------------------------------------------------------------ */ 3668 3623 static const unsigned int sdhi0_data1_pins[] = { 3669 3624 /* D0 */ ··· 4337 4258 SH_PFC_PIN_GROUP(audio_clk_b_b), 4338 4259 SH_PFC_PIN_GROUP(audio_clk_c), 4339 4260 SH_PFC_PIN_GROUP(audio_clkout), 4261 + SH_PFC_PIN_GROUP(avb_link), 4262 + SH_PFC_PIN_GROUP(avb_magic), 4263 + SH_PFC_PIN_GROUP(avb_phy_int), 4264 + SH_PFC_PIN_GROUP(avb_mdio), 4265 + SH_PFC_PIN_GROUP(avb_mii), 4266 + SH_PFC_PIN_GROUP(avb_gmii), 4340 4267 SH_PFC_PIN_GROUP(can0_data), 4341 4268 SH_PFC_PIN_GROUP(can0_data_b), 4342 4269 SH_PFC_PIN_GROUP(can0_data_c), ··· 4595 4510 SH_PFC_PIN_GROUP(scifb2_data_c), 4596 4511 SH_PFC_PIN_GROUP(scifb2_clk_c), 4597 4512 SH_PFC_PIN_GROUP(scifb2_data_d), 4513 + SH_PFC_PIN_GROUP(scif_clk), 4514 + SH_PFC_PIN_GROUP(scif_clk_b), 4598 4515 SH_PFC_PIN_GROUP(sdhi0_data1), 4599 4516 SH_PFC_PIN_GROUP(sdhi0_data4), 4600 4517 SH_PFC_PIN_GROUP(sdhi0_ctrl), ··· 4682 4595 "audio_clk_b_b", 4683 4596 "audio_clk_c", 4684 4597 "audio_clkout", 4598 + }; 4599 + 4600 + static const char * const avb_groups[] = { 4601 + "avb_link", 4602 + "avb_magic", 4603 + "avb_phy_int", 4604 + "avb_mdio", 4605 + "avb_mii", 4606 + "avb_gmii", 4685 4607 }; 4686 4608 4687 4609 static const char * const can0_groups[] = { ··· 5072 4976 "scifb2_data_d", 5073 4977 }; 5074 4978 4979 + static const char * const scif_clk_groups[] = { 4980 + "scif_clk", 4981 + "scif_clk_b", 4982 + }; 4983 + 5075 4984 static const char * const sdhi0_groups[] = { 5076 4985 "sdhi0_data1", 5077 4986 "sdhi0_data4", ··· 5182 5081 5183 5082 static const struct sh_pfc_function pinmux_functions[] = { 5184 5083 SH_PFC_FUNCTION(audio_clk), 5084 + SH_PFC_FUNCTION(avb), 5185 5085 SH_PFC_FUNCTION(can0), 5186 5086 SH_PFC_FUNCTION(can1), 5187 5087 SH_PFC_FUNCTION(du), ··· 5228 5126 SH_PFC_FUNCTION(scifb0), 5229 5127 SH_PFC_FUNCTION(scifb1), 5230 5128 SH_PFC_FUNCTION(scifb2), 5129 + SH_PFC_FUNCTION(scif_clk), 5231 5130 SH_PFC_FUNCTION(sdhi0), 5232 5131 SH_PFC_FUNCTION(sdhi1), 5233 5132 SH_PFC_FUNCTION(sdhi2),
+45 -41
drivers/pinctrl/sh-pfc/pfc-r8a7794.c
··· 15 15 #include "core.h" 16 16 #include "sh_pfc.h" 17 17 18 - #define PORT_GP_26(bank, fn, sfx) \ 19 - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ 20 - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ 21 - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ 22 - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ 23 - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ 24 - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ 25 - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ 26 - PORT_GP_1(bank, 14, fn, sfx), PORT_GP_1(bank, 15, fn, sfx), \ 27 - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx), \ 28 - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ 29 - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ 30 - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ 31 - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) 32 - 33 - #define PORT_GP_28(bank, fn, sfx) \ 34 - PORT_GP_26(bank, fn, sfx), \ 35 - PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx) 36 - 37 18 #define CPU_ALL_PORT(fn, sfx) \ 38 19 PORT_GP_32(0, fn, sfx), \ 39 20 PORT_GP_26(1, fn, sfx), \ ··· 599 618 static const u16 pinmux_data[] = { 600 619 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */ 601 620 602 - PINMUX_DATA(A2_MARK, FN_A2), 603 - PINMUX_DATA(WE0_N_MARK, FN_WE0_N), 604 - PINMUX_DATA(WE1_N_MARK, FN_WE1_N), 605 - PINMUX_DATA(DACK0_MARK, FN_DACK0), 606 - PINMUX_DATA(USB0_PWEN_MARK, FN_USB0_PWEN), 607 - PINMUX_DATA(USB0_OVC_MARK, FN_USB0_OVC), 608 - PINMUX_DATA(USB1_PWEN_MARK, FN_USB1_PWEN), 609 - PINMUX_DATA(USB1_OVC_MARK, FN_USB1_OVC), 610 - PINMUX_DATA(SD0_CLK_MARK, FN_SD0_CLK), 611 - PINMUX_DATA(SD0_CMD_MARK, FN_SD0_CMD), 612 - PINMUX_DATA(SD0_DATA0_MARK, FN_SD0_DATA0), 613 - PINMUX_DATA(SD0_DATA1_MARK, FN_SD0_DATA1), 614 - PINMUX_DATA(SD0_DATA2_MARK, FN_SD0_DATA2), 615 - PINMUX_DATA(SD0_DATA3_MARK, FN_SD0_DATA3), 616 - PINMUX_DATA(SD0_CD_MARK, FN_SD0_CD), 617 - PINMUX_DATA(SD0_WP_MARK, FN_SD0_WP), 618 - PINMUX_DATA(SD1_CLK_MARK, FN_SD1_CLK), 619 - PINMUX_DATA(SD1_CMD_MARK, FN_SD1_CMD), 620 - PINMUX_DATA(SD1_DATA0_MARK, FN_SD1_DATA0), 621 - PINMUX_DATA(SD1_DATA1_MARK, FN_SD1_DATA1), 622 - PINMUX_DATA(SD1_DATA2_MARK, FN_SD1_DATA2), 623 - PINMUX_DATA(SD1_DATA3_MARK, FN_SD1_DATA3), 621 + PINMUX_SINGLE(A2), 622 + PINMUX_SINGLE(WE0_N), 623 + PINMUX_SINGLE(WE1_N), 624 + PINMUX_SINGLE(DACK0), 625 + PINMUX_SINGLE(USB0_PWEN), 626 + PINMUX_SINGLE(USB0_OVC), 627 + PINMUX_SINGLE(USB1_PWEN), 628 + PINMUX_SINGLE(USB1_OVC), 629 + PINMUX_SINGLE(SD0_CLK), 630 + PINMUX_SINGLE(SD0_CMD), 631 + PINMUX_SINGLE(SD0_DATA0), 632 + PINMUX_SINGLE(SD0_DATA1), 633 + PINMUX_SINGLE(SD0_DATA2), 634 + PINMUX_SINGLE(SD0_DATA3), 635 + PINMUX_SINGLE(SD0_CD), 636 + PINMUX_SINGLE(SD0_WP), 637 + PINMUX_SINGLE(SD1_CLK), 638 + PINMUX_SINGLE(SD1_CMD), 639 + PINMUX_SINGLE(SD1_DATA0), 640 + PINMUX_SINGLE(SD1_DATA1), 641 + PINMUX_SINGLE(SD1_DATA2), 642 + PINMUX_SINGLE(SD1_DATA3), 624 643 625 644 /* IPSR0 */ 626 645 PINMUX_IPSR_DATA(IP0_0, SD1_CD), ··· 2625 2644 static const unsigned int scifb2_ctrl_mux[] = { 2626 2645 SCIFB2_RTS_N_MARK, SCIFB2_CTS_N_MARK, 2627 2646 }; 2647 + /* - SCIF Clock ------------------------------------------------------------- */ 2648 + static const unsigned int scif_clk_pins[] = { 2649 + /* SCIF_CLK */ 2650 + RCAR_GP_PIN(1, 23), 2651 + }; 2652 + static const unsigned int scif_clk_mux[] = { 2653 + SCIF_CLK_MARK, 2654 + }; 2655 + static const unsigned int scif_clk_b_pins[] = { 2656 + /* SCIF_CLK */ 2657 + RCAR_GP_PIN(3, 29), 2658 + }; 2659 + static const unsigned int scif_clk_b_mux[] = { 2660 + SCIF_CLK_B_MARK, 2661 + }; 2628 2662 /* - SDHI0 ------------------------------------------------------------------ */ 2629 2663 static const unsigned int sdhi0_data1_pins[] = { 2630 2664 /* D0 */ ··· 3067 3071 SH_PFC_PIN_GROUP(scifb2_data), 3068 3072 SH_PFC_PIN_GROUP(scifb2_clk), 3069 3073 SH_PFC_PIN_GROUP(scifb2_ctrl), 3074 + SH_PFC_PIN_GROUP(scif_clk), 3075 + SH_PFC_PIN_GROUP(scif_clk_b), 3070 3076 SH_PFC_PIN_GROUP(sdhi0_data1), 3071 3077 SH_PFC_PIN_GROUP(sdhi0_data4), 3072 3078 SH_PFC_PIN_GROUP(sdhi0_ctrl), ··· 3352 3354 "scifb2_ctrl", 3353 3355 }; 3354 3356 3357 + static const char * const scif_clk_groups[] = { 3358 + "scif_clk", 3359 + "scif_clk_b", 3360 + }; 3361 + 3355 3362 static const char * const sdhi0_groups[] = { 3356 3363 "sdhi0_data1", 3357 3364 "sdhi0_data4", ··· 3444 3441 SH_PFC_FUNCTION(scifb0), 3445 3442 SH_PFC_FUNCTION(scifb1), 3446 3443 SH_PFC_FUNCTION(scifb2), 3444 + SH_PFC_FUNCTION(scif_clk), 3447 3445 SH_PFC_FUNCTION(sdhi0), 3448 3446 SH_PFC_FUNCTION(sdhi1), 3449 3447 SH_PFC_FUNCTION(sdhi2),
+1464 -41
drivers/pinctrl/sh-pfc/pfc-r8a7795.c
··· 13 13 #include "core.h" 14 14 #include "sh_pfc.h" 15 15 16 - #define PORT_GP_3(bank, fn, sfx) \ 17 - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ 18 - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx) 19 - 20 - #define PORT_GP_14(bank, fn, sfx) \ 21 - PORT_GP_3(bank, fn, sfx), \ 22 - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ 23 - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ 24 - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ 25 - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx), \ 26 - PORT_GP_1(bank, 12, fn, sfx), PORT_GP_1(bank, 13, fn, sfx), \ 27 - PORT_GP_1(bank, 14, fn, sfx) 28 - 29 - #define PORT_GP_15(bank, fn, sfx) \ 30 - PORT_GP_14(bank, fn, sfx), PORT_GP_1(bank, 15, fn, sfx) 31 - 32 - #define PORT_GP_17(bank, fn, sfx) \ 33 - PORT_GP_15(bank, fn, sfx), \ 34 - PORT_GP_1(bank, 16, fn, sfx), PORT_GP_1(bank, 17, fn, sfx) 35 - 36 - #define PORT_GP_25(bank, fn, sfx) \ 37 - PORT_GP_17(bank, fn, sfx), \ 38 - PORT_GP_1(bank, 18, fn, sfx), PORT_GP_1(bank, 19, fn, sfx), \ 39 - PORT_GP_1(bank, 20, fn, sfx), PORT_GP_1(bank, 21, fn, sfx), \ 40 - PORT_GP_1(bank, 22, fn, sfx), PORT_GP_1(bank, 23, fn, sfx), \ 41 - PORT_GP_1(bank, 24, fn, sfx), PORT_GP_1(bank, 25, fn, sfx) 42 - 43 - #define PORT_GP_27(bank, fn, sfx) \ 44 - PORT_GP_25(bank, fn, sfx), \ 45 - PORT_GP_1(bank, 26, fn, sfx), PORT_GP_1(bank, 27, fn, sfx) 46 - 47 16 #define CPU_ALL_PORT(fn, sfx) \ 48 - PORT_GP_15(0, fn, sfx), \ 49 - PORT_GP_27(1, fn, sfx), \ 50 - PORT_GP_14(2, fn, sfx), \ 51 - PORT_GP_15(3, fn, sfx), \ 52 - PORT_GP_17(4, fn, sfx), \ 53 - PORT_GP_25(5, fn, sfx), \ 17 + PORT_GP_16(0, fn, sfx), \ 18 + PORT_GP_28(1, fn, sfx), \ 19 + PORT_GP_15(2, fn, sfx), \ 20 + PORT_GP_16(3, fn, sfx), \ 21 + PORT_GP_18(4, fn, sfx), \ 22 + PORT_GP_26(5, fn, sfx), \ 54 23 PORT_GP_32(6, fn, sfx), \ 55 - PORT_GP_3(7, fn, sfx) 24 + PORT_GP_4(7, fn, sfx) 56 25 /* 57 26 * F_() : just information 58 27 * FM() : macro for FN_xxx / xxx_MARK ··· 464 495 #define MOD_SEL1_13 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1) 465 496 #define MOD_SEL1_12 FM(SEL_SCIF2_0) FM(SEL_SCIF2_1) 466 497 #define MOD_SEL1_11 FM(SEL_SCIF1_0) FM(SEL_SCIF1_1) 467 - #define MOD_SEL1_10 FM(SEL_SCIF_0) FM(SEL_SCIF_1) 498 + #define MOD_SEL1_10 FM(SEL_SATA_0) FM(SEL_SATA_1) 468 499 #define MOD_SEL1_9 FM(SEL_REMOCON_0) FM(SEL_REMOCON_1) 469 500 #define MOD_SEL1_6 FM(SEL_RCAN0_0) FM(SEL_RCAN0_1) 470 501 #define MOD_SEL1_5 FM(SEL_PWM6_0) FM(SEL_PWM6_1) ··· 548 579 549 580 static const u16 pinmux_data[] = { 550 581 PINMUX_DATA_GP_ALL(), 582 + 583 + PINMUX_SINGLE(AVS1), 584 + PINMUX_SINGLE(AVS2), 585 + PINMUX_SINGLE(HDMI0_CEC), 586 + PINMUX_SINGLE(HDMI1_CEC), 587 + PINMUX_SINGLE(MSIOF0_RXD), 588 + PINMUX_SINGLE(MSIOF0_SCK), 589 + PINMUX_SINGLE(MSIOF0_TXD), 590 + PINMUX_SINGLE(SD2_CMD), 591 + PINMUX_SINGLE(SD3_CLK), 592 + PINMUX_SINGLE(SD3_CMD), 593 + PINMUX_SINGLE(SD3_DAT0), 594 + PINMUX_SINGLE(SD3_DAT1), 595 + PINMUX_SINGLE(SD3_DAT2), 596 + PINMUX_SINGLE(SD3_DAT3), 597 + PINMUX_SINGLE(SD3_DS), 598 + PINMUX_SINGLE(SSI_SCK5), 599 + PINMUX_SINGLE(SSI_SDATA5), 600 + PINMUX_SINGLE(SSI_WS5), 551 601 552 602 /* IPSR0 */ 553 603 PINMUX_IPSR_DATA(IP0_3_0, AVB_MDC), ··· 1021 1033 PINMUX_IPSR_DATA(IP9_19_16, SD2_DAT3), 1022 1034 1023 1035 PINMUX_IPSR_DATA(IP9_23_20, SD2_DS), 1024 - PINMUX_IPSR_MSEL(IP9_23_20, SATA_DEVSLP_B, SEL_SCIF_1), 1036 + PINMUX_IPSR_MSEL(IP9_23_20, SATA_DEVSLP_B, SEL_SATA_1), 1025 1037 1026 1038 PINMUX_IPSR_DATA(IP9_27_24, SD3_DAT4), 1027 1039 PINMUX_IPSR_MSEL(IP9_27_24, SD2_CD_A, SEL_SDHI2_0), ··· 1281 1293 1282 1294 PINMUX_IPSR_DATA(IP15_11_8, SSI_SDATA6), 1283 1295 PINMUX_IPSR_MSEL(IP15_11_8, SIM0_CLK_D, SEL_SIMCARD_3), 1284 - PINMUX_IPSR_MSEL(IP15_11_8, SATA_DEVSLP_A, SEL_SCIF_0), 1296 + PINMUX_IPSR_MSEL(IP15_11_8, SATA_DEVSLP_A, SEL_SATA_0), 1285 1297 1286 1298 PINMUX_IPSR_DATA(IP15_15_12, SSI_SCK78), 1287 1299 PINMUX_IPSR_MSEL(IP15_15_12, HRX2_B, SEL_HSCIF2_1), ··· 1600 1612 AVB_AVTP_CAPTURE_B_MARK, 1601 1613 }; 1602 1614 1615 + /* - HSCIF0 ----------------------------------------------------------------- */ 1616 + static const unsigned int hscif0_data_pins[] = { 1617 + /* RX, TX */ 1618 + RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14), 1619 + }; 1620 + static const unsigned int hscif0_data_mux[] = { 1621 + HRX0_MARK, HTX0_MARK, 1622 + }; 1623 + static const unsigned int hscif0_clk_pins[] = { 1624 + /* SCK */ 1625 + RCAR_GP_PIN(5, 12), 1626 + }; 1627 + static const unsigned int hscif0_clk_mux[] = { 1628 + HSCK0_MARK, 1629 + }; 1630 + static const unsigned int hscif0_ctrl_pins[] = { 1631 + /* RTS, CTS */ 1632 + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 15), 1633 + }; 1634 + static const unsigned int hscif0_ctrl_mux[] = { 1635 + HRTS0_N_MARK, HCTS0_N_MARK, 1636 + }; 1637 + /* - HSCIF1 ----------------------------------------------------------------- */ 1638 + static const unsigned int hscif1_data_a_pins[] = { 1639 + /* RX, TX */ 1640 + RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 6), 1641 + }; 1642 + static const unsigned int hscif1_data_a_mux[] = { 1643 + HRX1_A_MARK, HTX1_A_MARK, 1644 + }; 1645 + static const unsigned int hscif1_clk_a_pins[] = { 1646 + /* SCK */ 1647 + RCAR_GP_PIN(6, 21), 1648 + }; 1649 + static const unsigned int hscif1_clk_a_mux[] = { 1650 + HSCK1_A_MARK, 1651 + }; 1652 + static const unsigned int hscif1_ctrl_a_pins[] = { 1653 + /* RTS, CTS */ 1654 + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 7), 1655 + }; 1656 + static const unsigned int hscif1_ctrl_a_mux[] = { 1657 + HRTS1_N_A_MARK, HCTS1_N_A_MARK, 1658 + }; 1659 + 1660 + static const unsigned int hscif1_data_b_pins[] = { 1661 + /* RX, TX */ 1662 + RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2), 1663 + }; 1664 + static const unsigned int hscif1_data_b_mux[] = { 1665 + HRX1_B_MARK, HTX1_B_MARK, 1666 + }; 1667 + static const unsigned int hscif1_clk_b_pins[] = { 1668 + /* SCK */ 1669 + RCAR_GP_PIN(5, 0), 1670 + }; 1671 + static const unsigned int hscif1_clk_b_mux[] = { 1672 + HSCK1_B_MARK, 1673 + }; 1674 + static const unsigned int hscif1_ctrl_b_pins[] = { 1675 + /* RTS, CTS */ 1676 + RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 3), 1677 + }; 1678 + static const unsigned int hscif1_ctrl_b_mux[] = { 1679 + HRTS1_N_B_MARK, HCTS1_N_B_MARK, 1680 + }; 1681 + /* - HSCIF2 ----------------------------------------------------------------- */ 1682 + static const unsigned int hscif2_data_a_pins[] = { 1683 + /* RX, TX */ 1684 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1685 + }; 1686 + static const unsigned int hscif2_data_a_mux[] = { 1687 + HRX2_A_MARK, HTX2_A_MARK, 1688 + }; 1689 + static const unsigned int hscif2_clk_a_pins[] = { 1690 + /* SCK */ 1691 + RCAR_GP_PIN(6, 10), 1692 + }; 1693 + static const unsigned int hscif2_clk_a_mux[] = { 1694 + HSCK2_A_MARK, 1695 + }; 1696 + static const unsigned int hscif2_ctrl_a_pins[] = { 1697 + /* RTS, CTS */ 1698 + RCAR_GP_PIN(6, 7), RCAR_GP_PIN(6, 6), 1699 + }; 1700 + static const unsigned int hscif2_ctrl_a_mux[] = { 1701 + HRTS2_N_A_MARK, HCTS2_N_A_MARK, 1702 + }; 1703 + 1704 + static const unsigned int hscif2_data_b_pins[] = { 1705 + /* RX, TX */ 1706 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1707 + }; 1708 + static const unsigned int hscif2_data_b_mux[] = { 1709 + HRX2_B_MARK, HTX2_B_MARK, 1710 + }; 1711 + static const unsigned int hscif2_clk_b_pins[] = { 1712 + /* SCK */ 1713 + RCAR_GP_PIN(6, 21), 1714 + }; 1715 + static const unsigned int hscif2_clk_b_mux[] = { 1716 + HSCK1_B_MARK, 1717 + }; 1718 + static const unsigned int hscif2_ctrl_b_pins[] = { 1719 + /* RTS, CTS */ 1720 + RCAR_GP_PIN(6, 20), RCAR_GP_PIN(6, 19), 1721 + }; 1722 + static const unsigned int hscif2_ctrl_b_mux[] = { 1723 + HRTS2_N_B_MARK, HCTS2_N_B_MARK, 1724 + }; 1725 + /* - HSCIF3 ----------------------------------------------------------------- */ 1726 + static const unsigned int hscif3_data_a_pins[] = { 1727 + /* RX, TX */ 1728 + RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 24), 1729 + }; 1730 + static const unsigned int hscif3_data_a_mux[] = { 1731 + HRX3_A_MARK, HTX3_A_MARK, 1732 + }; 1733 + static const unsigned int hscif3_clk_pins[] = { 1734 + /* SCK */ 1735 + RCAR_GP_PIN(1, 22), 1736 + }; 1737 + static const unsigned int hscif3_clk_mux[] = { 1738 + HSCK3_MARK, 1739 + }; 1740 + static const unsigned int hscif3_ctrl_pins[] = { 1741 + /* RTS, CTS */ 1742 + RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25), 1743 + }; 1744 + static const unsigned int hscif3_ctrl_mux[] = { 1745 + HRTS3_N_MARK, HCTS3_N_MARK, 1746 + }; 1747 + 1748 + static const unsigned int hscif3_data_b_pins[] = { 1749 + /* RX, TX */ 1750 + RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11), 1751 + }; 1752 + static const unsigned int hscif3_data_b_mux[] = { 1753 + HRX3_B_MARK, HTX3_B_MARK, 1754 + }; 1755 + static const unsigned int hscif3_data_c_pins[] = { 1756 + /* RX, TX */ 1757 + RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15), 1758 + }; 1759 + static const unsigned int hscif3_data_c_mux[] = { 1760 + HRX3_C_MARK, HTX3_C_MARK, 1761 + }; 1762 + static const unsigned int hscif3_data_d_pins[] = { 1763 + /* RX, TX */ 1764 + RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8), 1765 + }; 1766 + static const unsigned int hscif3_data_d_mux[] = { 1767 + HRX3_D_MARK, HTX3_D_MARK, 1768 + }; 1769 + /* - HSCIF4 ----------------------------------------------------------------- */ 1770 + static const unsigned int hscif4_data_a_pins[] = { 1771 + /* RX, TX */ 1772 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 1773 + }; 1774 + static const unsigned int hscif4_data_a_mux[] = { 1775 + HRX4_A_MARK, HTX4_A_MARK, 1776 + }; 1777 + static const unsigned int hscif4_clk_pins[] = { 1778 + /* SCK */ 1779 + RCAR_GP_PIN(1, 11), 1780 + }; 1781 + static const unsigned int hscif4_clk_mux[] = { 1782 + HSCK4_MARK, 1783 + }; 1784 + static const unsigned int hscif4_ctrl_pins[] = { 1785 + /* RTS, CTS */ 1786 + RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), 1787 + }; 1788 + static const unsigned int hscif4_ctrl_mux[] = { 1789 + HRTS4_N_MARK, HCTS3_N_MARK, 1790 + }; 1791 + 1792 + static const unsigned int hscif4_data_b_pins[] = { 1793 + /* RX, TX */ 1794 + RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11), 1795 + }; 1796 + static const unsigned int hscif4_data_b_mux[] = { 1797 + HRX4_B_MARK, HTX4_B_MARK, 1798 + }; 1799 + 1603 1800 /* - I2C -------------------------------------------------------------------- */ 1604 1801 static const unsigned int i2c1_a_pins[] = { 1605 1802 /* SDA, SCL */ ··· 1834 1661 }; 1835 1662 static const unsigned int i2c6_c_mux[] = { 1836 1663 SDA6_C_MARK, SCL6_C_MARK, 1664 + }; 1665 + 1666 + /* - MSIOF0 ----------------------------------------------------------------- */ 1667 + static const unsigned int msiof0_clk_pins[] = { 1668 + /* SCK */ 1669 + RCAR_GP_PIN(5, 17), 1670 + }; 1671 + static const unsigned int msiof0_clk_mux[] = { 1672 + MSIOF0_SCK_MARK, 1673 + }; 1674 + static const unsigned int msiof0_sync_pins[] = { 1675 + /* SYNC */ 1676 + RCAR_GP_PIN(5, 18), 1677 + }; 1678 + static const unsigned int msiof0_sync_mux[] = { 1679 + MSIOF0_SYNC_MARK, 1680 + }; 1681 + static const unsigned int msiof0_ss1_pins[] = { 1682 + /* SS1 */ 1683 + RCAR_GP_PIN(5, 19), 1684 + }; 1685 + static const unsigned int msiof0_ss1_mux[] = { 1686 + MSIOF0_SS1_MARK, 1687 + }; 1688 + static const unsigned int msiof0_ss2_pins[] = { 1689 + /* SS2 */ 1690 + RCAR_GP_PIN(5, 21), 1691 + }; 1692 + static const unsigned int msiof0_ss2_mux[] = { 1693 + MSIOF0_SS2_MARK, 1694 + }; 1695 + static const unsigned int msiof0_txd_pins[] = { 1696 + /* TXD */ 1697 + RCAR_GP_PIN(5, 20), 1698 + }; 1699 + static const unsigned int msiof0_txd_mux[] = { 1700 + MSIOF0_TXD_MARK, 1701 + }; 1702 + static const unsigned int msiof0_rxd_pins[] = { 1703 + /* RXD */ 1704 + RCAR_GP_PIN(5, 22), 1705 + }; 1706 + static const unsigned int msiof0_rxd_mux[] = { 1707 + MSIOF0_RXD_MARK, 1708 + }; 1709 + /* - MSIOF1 ----------------------------------------------------------------- */ 1710 + static const unsigned int msiof1_clk_a_pins[] = { 1711 + /* SCK */ 1712 + RCAR_GP_PIN(6, 8), 1713 + }; 1714 + static const unsigned int msiof1_clk_a_mux[] = { 1715 + MSIOF1_SCK_A_MARK, 1716 + }; 1717 + static const unsigned int msiof1_sync_a_pins[] = { 1718 + /* SYNC */ 1719 + RCAR_GP_PIN(6, 9), 1720 + }; 1721 + static const unsigned int msiof1_sync_a_mux[] = { 1722 + MSIOF1_SYNC_A_MARK, 1723 + }; 1724 + static const unsigned int msiof1_ss1_a_pins[] = { 1725 + /* SS1 */ 1726 + RCAR_GP_PIN(6, 5), 1727 + }; 1728 + static const unsigned int msiof1_ss1_a_mux[] = { 1729 + MSIOF1_SS1_A_MARK, 1730 + }; 1731 + static const unsigned int msiof1_ss2_a_pins[] = { 1732 + /* SS2 */ 1733 + RCAR_GP_PIN(6, 6), 1734 + }; 1735 + static const unsigned int msiof1_ss2_a_mux[] = { 1736 + MSIOF1_SS2_A_MARK, 1737 + }; 1738 + static const unsigned int msiof1_txd_a_pins[] = { 1739 + /* TXD */ 1740 + RCAR_GP_PIN(6, 7), 1741 + }; 1742 + static const unsigned int msiof1_txd_a_mux[] = { 1743 + MSIOF1_TXD_A_MARK, 1744 + }; 1745 + static const unsigned int msiof1_rxd_a_pins[] = { 1746 + /* RXD */ 1747 + RCAR_GP_PIN(6, 10), 1748 + }; 1749 + static const unsigned int msiof1_rxd_a_mux[] = { 1750 + MSIOF1_RXD_A_MARK, 1751 + }; 1752 + static const unsigned int msiof1_clk_b_pins[] = { 1753 + /* SCK */ 1754 + RCAR_GP_PIN(5, 9), 1755 + }; 1756 + static const unsigned int msiof1_clk_b_mux[] = { 1757 + MSIOF1_SCK_B_MARK, 1758 + }; 1759 + static const unsigned int msiof1_sync_b_pins[] = { 1760 + /* SYNC */ 1761 + RCAR_GP_PIN(5, 3), 1762 + }; 1763 + static const unsigned int msiof1_sync_b_mux[] = { 1764 + MSIOF1_SYNC_B_MARK, 1765 + }; 1766 + static const unsigned int msiof1_ss1_b_pins[] = { 1767 + /* SS1 */ 1768 + RCAR_GP_PIN(5, 4), 1769 + }; 1770 + static const unsigned int msiof1_ss1_b_mux[] = { 1771 + MSIOF1_SS1_B_MARK, 1772 + }; 1773 + static const unsigned int msiof1_ss2_b_pins[] = { 1774 + /* SS2 */ 1775 + RCAR_GP_PIN(5, 0), 1776 + }; 1777 + static const unsigned int msiof1_ss2_b_mux[] = { 1778 + MSIOF1_SS2_B_MARK, 1779 + }; 1780 + static const unsigned int msiof1_txd_b_pins[] = { 1781 + /* TXD */ 1782 + RCAR_GP_PIN(5, 8), 1783 + }; 1784 + static const unsigned int msiof1_txd_b_mux[] = { 1785 + MSIOF1_TXD_B_MARK, 1786 + }; 1787 + static const unsigned int msiof1_rxd_b_pins[] = { 1788 + /* RXD */ 1789 + RCAR_GP_PIN(5, 7), 1790 + }; 1791 + static const unsigned int msiof1_rxd_b_mux[] = { 1792 + MSIOF1_RXD_B_MARK, 1793 + }; 1794 + static const unsigned int msiof1_clk_c_pins[] = { 1795 + /* SCK */ 1796 + RCAR_GP_PIN(6, 17), 1797 + }; 1798 + static const unsigned int msiof1_clk_c_mux[] = { 1799 + MSIOF1_SCK_C_MARK, 1800 + }; 1801 + static const unsigned int msiof1_sync_c_pins[] = { 1802 + /* SYNC */ 1803 + RCAR_GP_PIN(6, 18), 1804 + }; 1805 + static const unsigned int msiof1_sync_c_mux[] = { 1806 + MSIOF1_SYNC_C_MARK, 1807 + }; 1808 + static const unsigned int msiof1_ss1_c_pins[] = { 1809 + /* SS1 */ 1810 + RCAR_GP_PIN(6, 21), 1811 + }; 1812 + static const unsigned int msiof1_ss1_c_mux[] = { 1813 + MSIOF1_SS1_C_MARK, 1814 + }; 1815 + static const unsigned int msiof1_ss2_c_pins[] = { 1816 + /* SS2 */ 1817 + RCAR_GP_PIN(6, 27), 1818 + }; 1819 + static const unsigned int msiof1_ss2_c_mux[] = { 1820 + MSIOF1_SS2_C_MARK, 1821 + }; 1822 + static const unsigned int msiof1_txd_c_pins[] = { 1823 + /* TXD */ 1824 + RCAR_GP_PIN(6, 20), 1825 + }; 1826 + static const unsigned int msiof1_txd_c_mux[] = { 1827 + MSIOF1_TXD_C_MARK, 1828 + }; 1829 + static const unsigned int msiof1_rxd_c_pins[] = { 1830 + /* RXD */ 1831 + RCAR_GP_PIN(6, 19), 1832 + }; 1833 + static const unsigned int msiof1_rxd_c_mux[] = { 1834 + MSIOF1_RXD_C_MARK, 1835 + }; 1836 + static const unsigned int msiof1_clk_d_pins[] = { 1837 + /* SCK */ 1838 + RCAR_GP_PIN(5, 12), 1839 + }; 1840 + static const unsigned int msiof1_clk_d_mux[] = { 1841 + MSIOF1_SCK_D_MARK, 1842 + }; 1843 + static const unsigned int msiof1_sync_d_pins[] = { 1844 + /* SYNC */ 1845 + RCAR_GP_PIN(5, 15), 1846 + }; 1847 + static const unsigned int msiof1_sync_d_mux[] = { 1848 + MSIOF1_SYNC_D_MARK, 1849 + }; 1850 + static const unsigned int msiof1_ss1_d_pins[] = { 1851 + /* SS1 */ 1852 + RCAR_GP_PIN(5, 16), 1853 + }; 1854 + static const unsigned int msiof1_ss1_d_mux[] = { 1855 + MSIOF1_SS1_D_MARK, 1856 + }; 1857 + static const unsigned int msiof1_ss2_d_pins[] = { 1858 + /* SS2 */ 1859 + RCAR_GP_PIN(5, 21), 1860 + }; 1861 + static const unsigned int msiof1_ss2_d_mux[] = { 1862 + MSIOF1_SS2_D_MARK, 1863 + }; 1864 + static const unsigned int msiof1_txd_d_pins[] = { 1865 + /* TXD */ 1866 + RCAR_GP_PIN(5, 14), 1867 + }; 1868 + static const unsigned int msiof1_txd_d_mux[] = { 1869 + MSIOF1_TXD_D_MARK, 1870 + }; 1871 + static const unsigned int msiof1_rxd_d_pins[] = { 1872 + /* RXD */ 1873 + RCAR_GP_PIN(5, 13), 1874 + }; 1875 + static const unsigned int msiof1_rxd_d_mux[] = { 1876 + MSIOF1_RXD_D_MARK, 1877 + }; 1878 + static const unsigned int msiof1_clk_e_pins[] = { 1879 + /* SCK */ 1880 + RCAR_GP_PIN(3, 0), 1881 + }; 1882 + static const unsigned int msiof1_clk_e_mux[] = { 1883 + MSIOF1_SCK_E_MARK, 1884 + }; 1885 + static const unsigned int msiof1_sync_e_pins[] = { 1886 + /* SYNC */ 1887 + RCAR_GP_PIN(3, 1), 1888 + }; 1889 + static const unsigned int msiof1_sync_e_mux[] = { 1890 + MSIOF1_SYNC_E_MARK, 1891 + }; 1892 + static const unsigned int msiof1_ss1_e_pins[] = { 1893 + /* SS1 */ 1894 + RCAR_GP_PIN(3, 4), 1895 + }; 1896 + static const unsigned int msiof1_ss1_e_mux[] = { 1897 + MSIOF1_SS1_E_MARK, 1898 + }; 1899 + static const unsigned int msiof1_ss2_e_pins[] = { 1900 + /* SS2 */ 1901 + RCAR_GP_PIN(3, 5), 1902 + }; 1903 + static const unsigned int msiof1_ss2_e_mux[] = { 1904 + MSIOF1_SS2_E_MARK, 1905 + }; 1906 + static const unsigned int msiof1_txd_e_pins[] = { 1907 + /* TXD */ 1908 + RCAR_GP_PIN(3, 3), 1909 + }; 1910 + static const unsigned int msiof1_txd_e_mux[] = { 1911 + MSIOF1_TXD_E_MARK, 1912 + }; 1913 + static const unsigned int msiof1_rxd_e_pins[] = { 1914 + /* RXD */ 1915 + RCAR_GP_PIN(3, 2), 1916 + }; 1917 + static const unsigned int msiof1_rxd_e_mux[] = { 1918 + MSIOF1_RXD_E_MARK, 1919 + }; 1920 + static const unsigned int msiof1_clk_f_pins[] = { 1921 + /* SCK */ 1922 + RCAR_GP_PIN(5, 23), 1923 + }; 1924 + static const unsigned int msiof1_clk_f_mux[] = { 1925 + MSIOF1_SCK_F_MARK, 1926 + }; 1927 + static const unsigned int msiof1_sync_f_pins[] = { 1928 + /* SYNC */ 1929 + RCAR_GP_PIN(5, 24), 1930 + }; 1931 + static const unsigned int msiof1_sync_f_mux[] = { 1932 + MSIOF1_SYNC_F_MARK, 1933 + }; 1934 + static const unsigned int msiof1_ss1_f_pins[] = { 1935 + /* SS1 */ 1936 + RCAR_GP_PIN(6, 1), 1937 + }; 1938 + static const unsigned int msiof1_ss1_f_mux[] = { 1939 + MSIOF1_SS1_F_MARK, 1940 + }; 1941 + static const unsigned int msiof1_ss2_f_pins[] = { 1942 + /* SS2 */ 1943 + RCAR_GP_PIN(6, 2), 1944 + }; 1945 + static const unsigned int msiof1_ss2_f_mux[] = { 1946 + MSIOF1_SS2_F_MARK, 1947 + }; 1948 + static const unsigned int msiof1_txd_f_pins[] = { 1949 + /* TXD */ 1950 + RCAR_GP_PIN(6, 0), 1951 + }; 1952 + static const unsigned int msiof1_txd_f_mux[] = { 1953 + MSIOF1_TXD_F_MARK, 1954 + }; 1955 + static const unsigned int msiof1_rxd_f_pins[] = { 1956 + /* RXD */ 1957 + RCAR_GP_PIN(5, 25), 1958 + }; 1959 + static const unsigned int msiof1_rxd_f_mux[] = { 1960 + MSIOF1_RXD_F_MARK, 1961 + }; 1962 + static const unsigned int msiof1_clk_g_pins[] = { 1963 + /* SCK */ 1964 + RCAR_GP_PIN(3, 6), 1965 + }; 1966 + static const unsigned int msiof1_clk_g_mux[] = { 1967 + MSIOF1_SCK_G_MARK, 1968 + }; 1969 + static const unsigned int msiof1_sync_g_pins[] = { 1970 + /* SYNC */ 1971 + RCAR_GP_PIN(3, 7), 1972 + }; 1973 + static const unsigned int msiof1_sync_g_mux[] = { 1974 + MSIOF1_SYNC_G_MARK, 1975 + }; 1976 + static const unsigned int msiof1_ss1_g_pins[] = { 1977 + /* SS1 */ 1978 + RCAR_GP_PIN(3, 10), 1979 + }; 1980 + static const unsigned int msiof1_ss1_g_mux[] = { 1981 + MSIOF1_SS1_G_MARK, 1982 + }; 1983 + static const unsigned int msiof1_ss2_g_pins[] = { 1984 + /* SS2 */ 1985 + RCAR_GP_PIN(3, 11), 1986 + }; 1987 + static const unsigned int msiof1_ss2_g_mux[] = { 1988 + MSIOF1_SS2_G_MARK, 1989 + }; 1990 + static const unsigned int msiof1_txd_g_pins[] = { 1991 + /* TXD */ 1992 + RCAR_GP_PIN(3, 9), 1993 + }; 1994 + static const unsigned int msiof1_txd_g_mux[] = { 1995 + MSIOF1_TXD_G_MARK, 1996 + }; 1997 + static const unsigned int msiof1_rxd_g_pins[] = { 1998 + /* RXD */ 1999 + RCAR_GP_PIN(3, 8), 2000 + }; 2001 + static const unsigned int msiof1_rxd_g_mux[] = { 2002 + MSIOF1_RXD_G_MARK, 2003 + }; 2004 + /* - MSIOF2 ----------------------------------------------------------------- */ 2005 + static const unsigned int msiof2_clk_a_pins[] = { 2006 + /* SCK */ 2007 + RCAR_GP_PIN(1, 9), 2008 + }; 2009 + static const unsigned int msiof2_clk_a_mux[] = { 2010 + MSIOF2_SCK_A_MARK, 2011 + }; 2012 + static const unsigned int msiof2_sync_a_pins[] = { 2013 + /* SYNC */ 2014 + RCAR_GP_PIN(1, 8), 2015 + }; 2016 + static const unsigned int msiof2_sync_a_mux[] = { 2017 + MSIOF2_SYNC_A_MARK, 2018 + }; 2019 + static const unsigned int msiof2_ss1_a_pins[] = { 2020 + /* SS1 */ 2021 + RCAR_GP_PIN(1, 6), 2022 + }; 2023 + static const unsigned int msiof2_ss1_a_mux[] = { 2024 + MSIOF2_SS1_A_MARK, 2025 + }; 2026 + static const unsigned int msiof2_ss2_a_pins[] = { 2027 + /* SS2 */ 2028 + RCAR_GP_PIN(1, 7), 2029 + }; 2030 + static const unsigned int msiof2_ss2_a_mux[] = { 2031 + MSIOF2_SS2_A_MARK, 2032 + }; 2033 + static const unsigned int msiof2_txd_a_pins[] = { 2034 + /* TXD */ 2035 + RCAR_GP_PIN(1, 11), 2036 + }; 2037 + static const unsigned int msiof2_txd_a_mux[] = { 2038 + MSIOF2_TXD_A_MARK, 2039 + }; 2040 + static const unsigned int msiof2_rxd_a_pins[] = { 2041 + /* RXD */ 2042 + RCAR_GP_PIN(1, 10), 2043 + }; 2044 + static const unsigned int msiof2_rxd_a_mux[] = { 2045 + MSIOF2_RXD_A_MARK, 2046 + }; 2047 + static const unsigned int msiof2_clk_b_pins[] = { 2048 + /* SCK */ 2049 + RCAR_GP_PIN(0, 4), 2050 + }; 2051 + static const unsigned int msiof2_clk_b_mux[] = { 2052 + MSIOF2_SCK_B_MARK, 2053 + }; 2054 + static const unsigned int msiof2_sync_b_pins[] = { 2055 + /* SYNC */ 2056 + RCAR_GP_PIN(0, 5), 2057 + }; 2058 + static const unsigned int msiof2_sync_b_mux[] = { 2059 + MSIOF2_SYNC_B_MARK, 2060 + }; 2061 + static const unsigned int msiof2_ss1_b_pins[] = { 2062 + /* SS1 */ 2063 + RCAR_GP_PIN(0, 0), 2064 + }; 2065 + static const unsigned int msiof2_ss1_b_mux[] = { 2066 + MSIOF2_SS1_B_MARK, 2067 + }; 2068 + static const unsigned int msiof2_ss2_b_pins[] = { 2069 + /* SS2 */ 2070 + RCAR_GP_PIN(0, 1), 2071 + }; 2072 + static const unsigned int msiof2_ss2_b_mux[] = { 2073 + MSIOF2_SS2_B_MARK, 2074 + }; 2075 + static const unsigned int msiof2_txd_b_pins[] = { 2076 + /* TXD */ 2077 + RCAR_GP_PIN(0, 7), 2078 + }; 2079 + static const unsigned int msiof2_txd_b_mux[] = { 2080 + MSIOF2_TXD_B_MARK, 2081 + }; 2082 + static const unsigned int msiof2_rxd_b_pins[] = { 2083 + /* RXD */ 2084 + RCAR_GP_PIN(0, 6), 2085 + }; 2086 + static const unsigned int msiof2_rxd_b_mux[] = { 2087 + MSIOF2_RXD_B_MARK, 2088 + }; 2089 + static const unsigned int msiof2_clk_c_pins[] = { 2090 + /* SCK */ 2091 + RCAR_GP_PIN(2, 12), 2092 + }; 2093 + static const unsigned int msiof2_clk_c_mux[] = { 2094 + MSIOF2_SCK_C_MARK, 2095 + }; 2096 + static const unsigned int msiof2_sync_c_pins[] = { 2097 + /* SYNC */ 2098 + RCAR_GP_PIN(2, 11), 2099 + }; 2100 + static const unsigned int msiof2_sync_c_mux[] = { 2101 + MSIOF2_SYNC_C_MARK, 2102 + }; 2103 + static const unsigned int msiof2_ss1_c_pins[] = { 2104 + /* SS1 */ 2105 + RCAR_GP_PIN(2, 10), 2106 + }; 2107 + static const unsigned int msiof2_ss1_c_mux[] = { 2108 + MSIOF2_SS1_C_MARK, 2109 + }; 2110 + static const unsigned int msiof2_ss2_c_pins[] = { 2111 + /* SS2 */ 2112 + RCAR_GP_PIN(2, 9), 2113 + }; 2114 + static const unsigned int msiof2_ss2_c_mux[] = { 2115 + MSIOF2_SS2_C_MARK, 2116 + }; 2117 + static const unsigned int msiof2_txd_c_pins[] = { 2118 + /* TXD */ 2119 + RCAR_GP_PIN(2, 14), 2120 + }; 2121 + static const unsigned int msiof2_txd_c_mux[] = { 2122 + MSIOF2_TXD_C_MARK, 2123 + }; 2124 + static const unsigned int msiof2_rxd_c_pins[] = { 2125 + /* RXD */ 2126 + RCAR_GP_PIN(2, 13), 2127 + }; 2128 + static const unsigned int msiof2_rxd_c_mux[] = { 2129 + MSIOF2_RXD_C_MARK, 2130 + }; 2131 + static const unsigned int msiof2_clk_d_pins[] = { 2132 + /* SCK */ 2133 + RCAR_GP_PIN(0, 8), 2134 + }; 2135 + static const unsigned int msiof2_clk_d_mux[] = { 2136 + MSIOF2_SCK_D_MARK, 2137 + }; 2138 + static const unsigned int msiof2_sync_d_pins[] = { 2139 + /* SYNC */ 2140 + RCAR_GP_PIN(0, 9), 2141 + }; 2142 + static const unsigned int msiof2_sync_d_mux[] = { 2143 + MSIOF2_SYNC_D_MARK, 2144 + }; 2145 + static const unsigned int msiof2_ss1_d_pins[] = { 2146 + /* SS1 */ 2147 + RCAR_GP_PIN(0, 12), 2148 + }; 2149 + static const unsigned int msiof2_ss1_d_mux[] = { 2150 + MSIOF2_SS1_D_MARK, 2151 + }; 2152 + static const unsigned int msiof2_ss2_d_pins[] = { 2153 + /* SS2 */ 2154 + RCAR_GP_PIN(0, 13), 2155 + }; 2156 + static const unsigned int msiof2_ss2_d_mux[] = { 2157 + MSIOF2_SS2_D_MARK, 2158 + }; 2159 + static const unsigned int msiof2_txd_d_pins[] = { 2160 + /* TXD */ 2161 + RCAR_GP_PIN(0, 11), 2162 + }; 2163 + static const unsigned int msiof2_txd_d_mux[] = { 2164 + MSIOF2_TXD_D_MARK, 2165 + }; 2166 + static const unsigned int msiof2_rxd_d_pins[] = { 2167 + /* RXD */ 2168 + RCAR_GP_PIN(0, 10), 2169 + }; 2170 + static const unsigned int msiof2_rxd_d_mux[] = { 2171 + MSIOF2_RXD_D_MARK, 2172 + }; 2173 + /* - MSIOF3 ----------------------------------------------------------------- */ 2174 + static const unsigned int msiof3_clk_a_pins[] = { 2175 + /* SCK */ 2176 + RCAR_GP_PIN(0, 0), 2177 + }; 2178 + static const unsigned int msiof3_clk_a_mux[] = { 2179 + MSIOF3_SCK_A_MARK, 2180 + }; 2181 + static const unsigned int msiof3_sync_a_pins[] = { 2182 + /* SYNC */ 2183 + RCAR_GP_PIN(0, 1), 2184 + }; 2185 + static const unsigned int msiof3_sync_a_mux[] = { 2186 + MSIOF3_SYNC_A_MARK, 2187 + }; 2188 + static const unsigned int msiof3_ss1_a_pins[] = { 2189 + /* SS1 */ 2190 + RCAR_GP_PIN(0, 14), 2191 + }; 2192 + static const unsigned int msiof3_ss1_a_mux[] = { 2193 + MSIOF3_SS1_A_MARK, 2194 + }; 2195 + static const unsigned int msiof3_ss2_a_pins[] = { 2196 + /* SS2 */ 2197 + RCAR_GP_PIN(0, 15), 2198 + }; 2199 + static const unsigned int msiof3_ss2_a_mux[] = { 2200 + MSIOF3_SS2_A_MARK, 2201 + }; 2202 + static const unsigned int msiof3_txd_a_pins[] = { 2203 + /* TXD */ 2204 + RCAR_GP_PIN(0, 3), 2205 + }; 2206 + static const unsigned int msiof3_txd_a_mux[] = { 2207 + MSIOF3_TXD_A_MARK, 2208 + }; 2209 + static const unsigned int msiof3_rxd_a_pins[] = { 2210 + /* RXD */ 2211 + RCAR_GP_PIN(0, 2), 2212 + }; 2213 + static const unsigned int msiof3_rxd_a_mux[] = { 2214 + MSIOF3_RXD_A_MARK, 2215 + }; 2216 + static const unsigned int msiof3_clk_b_pins[] = { 2217 + /* SCK */ 2218 + RCAR_GP_PIN(1, 2), 2219 + }; 2220 + static const unsigned int msiof3_clk_b_mux[] = { 2221 + MSIOF3_SCK_B_MARK, 2222 + }; 2223 + static const unsigned int msiof3_sync_b_pins[] = { 2224 + /* SYNC */ 2225 + RCAR_GP_PIN(1, 0), 2226 + }; 2227 + static const unsigned int msiof3_sync_b_mux[] = { 2228 + MSIOF3_SYNC_B_MARK, 2229 + }; 2230 + static const unsigned int msiof3_ss1_b_pins[] = { 2231 + /* SS1 */ 2232 + RCAR_GP_PIN(1, 4), 2233 + }; 2234 + static const unsigned int msiof3_ss1_b_mux[] = { 2235 + MSIOF3_SS1_B_MARK, 2236 + }; 2237 + static const unsigned int msiof3_ss2_b_pins[] = { 2238 + /* SS2 */ 2239 + RCAR_GP_PIN(1, 5), 2240 + }; 2241 + static const unsigned int msiof3_ss2_b_mux[] = { 2242 + MSIOF3_SS2_B_MARK, 2243 + }; 2244 + static const unsigned int msiof3_txd_b_pins[] = { 2245 + /* TXD */ 2246 + RCAR_GP_PIN(1, 1), 2247 + }; 2248 + static const unsigned int msiof3_txd_b_mux[] = { 2249 + MSIOF3_TXD_B_MARK, 2250 + }; 2251 + static const unsigned int msiof3_rxd_b_pins[] = { 2252 + /* RXD */ 2253 + RCAR_GP_PIN(1, 3), 2254 + }; 2255 + static const unsigned int msiof3_rxd_b_mux[] = { 2256 + MSIOF3_RXD_B_MARK, 2257 + }; 2258 + static const unsigned int msiof3_clk_c_pins[] = { 2259 + /* SCK */ 2260 + RCAR_GP_PIN(1, 12), 2261 + }; 2262 + static const unsigned int msiof3_clk_c_mux[] = { 2263 + MSIOF3_SCK_C_MARK, 2264 + }; 2265 + static const unsigned int msiof3_sync_c_pins[] = { 2266 + /* SYNC */ 2267 + RCAR_GP_PIN(1, 13), 2268 + }; 2269 + static const unsigned int msiof3_sync_c_mux[] = { 2270 + MSIOF3_SYNC_C_MARK, 2271 + }; 2272 + static const unsigned int msiof3_txd_c_pins[] = { 2273 + /* TXD */ 2274 + RCAR_GP_PIN(1, 15), 2275 + }; 2276 + static const unsigned int msiof3_txd_c_mux[] = { 2277 + MSIOF3_TXD_C_MARK, 2278 + }; 2279 + static const unsigned int msiof3_rxd_c_pins[] = { 2280 + /* RXD */ 2281 + RCAR_GP_PIN(1, 14), 2282 + }; 2283 + static const unsigned int msiof3_rxd_c_mux[] = { 2284 + MSIOF3_RXD_C_MARK, 2285 + }; 2286 + static const unsigned int msiof3_clk_d_pins[] = { 2287 + /* SCK */ 2288 + RCAR_GP_PIN(1, 22), 2289 + }; 2290 + static const unsigned int msiof3_clk_d_mux[] = { 2291 + MSIOF3_SCK_D_MARK, 2292 + }; 2293 + static const unsigned int msiof3_sync_d_pins[] = { 2294 + /* SYNC */ 2295 + RCAR_GP_PIN(1, 23), 2296 + }; 2297 + static const unsigned int msiof3_sync_d_mux[] = { 2298 + MSIOF3_SYNC_D_MARK, 2299 + }; 2300 + static const unsigned int msiof3_ss1_d_pins[] = { 2301 + /* SS1 */ 2302 + RCAR_GP_PIN(1, 26), 2303 + }; 2304 + static const unsigned int msiof3_ss1_d_mux[] = { 2305 + MSIOF3_SS1_D_MARK, 2306 + }; 2307 + static const unsigned int msiof3_txd_d_pins[] = { 2308 + /* TXD */ 2309 + RCAR_GP_PIN(1, 25), 2310 + }; 2311 + static const unsigned int msiof3_txd_d_mux[] = { 2312 + MSIOF3_TXD_D_MARK, 2313 + }; 2314 + static const unsigned int msiof3_rxd_d_pins[] = { 2315 + /* RXD */ 2316 + RCAR_GP_PIN(1, 24), 2317 + }; 2318 + static const unsigned int msiof3_rxd_d_mux[] = { 2319 + MSIOF3_RXD_D_MARK, 2320 + }; 2321 + 2322 + /* - SATA --------------------------------------------------------------------*/ 2323 + static const unsigned int sata0_devslp_a_pins[] = { 2324 + /* DEVSLP */ 2325 + RCAR_GP_PIN(6, 16), 2326 + }; 2327 + static const unsigned int sata0_devslp_a_mux[] = { 2328 + SATA_DEVSLP_A_MARK, 2329 + }; 2330 + static const unsigned int sata0_devslp_b_pins[] = { 2331 + /* DEVSLP */ 2332 + RCAR_GP_PIN(4, 6), 2333 + }; 2334 + static const unsigned int sata0_devslp_b_mux[] = { 2335 + SATA_DEVSLP_B_MARK, 1837 2336 }; 1838 2337 1839 2338 /* - SCIF0 ------------------------------------------------------------------ */ ··· 2689 1844 }; 2690 1845 static const unsigned int scif5_clk_mux[] = { 2691 1846 SCK5_MARK, 1847 + }; 1848 + /* - SDHI0 ------------------------------------------------------------------ */ 1849 + static const unsigned int sdhi0_data1_pins[] = { 1850 + /* D0 */ 1851 + RCAR_GP_PIN(3, 2), 1852 + }; 1853 + static const unsigned int sdhi0_data1_mux[] = { 1854 + SD0_DAT0_MARK, 1855 + }; 1856 + static const unsigned int sdhi0_data4_pins[] = { 1857 + /* D[0:3] */ 1858 + RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3), 1859 + RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5), 1860 + }; 1861 + static const unsigned int sdhi0_data4_mux[] = { 1862 + SD0_DAT0_MARK, SD0_DAT1_MARK, 1863 + SD0_DAT2_MARK, SD0_DAT3_MARK, 1864 + }; 1865 + static const unsigned int sdhi0_ctrl_pins[] = { 1866 + /* CLK, CMD */ 1867 + RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1), 1868 + }; 1869 + static const unsigned int sdhi0_ctrl_mux[] = { 1870 + SD0_CLK_MARK, SD0_CMD_MARK, 1871 + }; 1872 + static const unsigned int sdhi0_cd_pins[] = { 1873 + /* CD */ 1874 + RCAR_GP_PIN(3, 12), 1875 + }; 1876 + static const unsigned int sdhi0_cd_mux[] = { 1877 + SD0_CD_MARK, 1878 + }; 1879 + static const unsigned int sdhi0_wp_pins[] = { 1880 + /* WP */ 1881 + RCAR_GP_PIN(3, 13), 1882 + }; 1883 + static const unsigned int sdhi0_wp_mux[] = { 1884 + SD0_WP_MARK, 1885 + }; 1886 + /* - SDHI1 ------------------------------------------------------------------ */ 1887 + static const unsigned int sdhi1_data1_pins[] = { 1888 + /* D0 */ 1889 + RCAR_GP_PIN(3, 8), 1890 + }; 1891 + static const unsigned int sdhi1_data1_mux[] = { 1892 + SD1_DAT0_MARK, 1893 + }; 1894 + static const unsigned int sdhi1_data4_pins[] = { 1895 + /* D[0:3] */ 1896 + RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9), 1897 + RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11), 1898 + }; 1899 + static const unsigned int sdhi1_data4_mux[] = { 1900 + SD1_DAT0_MARK, SD1_DAT1_MARK, 1901 + SD1_DAT2_MARK, SD1_DAT3_MARK, 1902 + }; 1903 + static const unsigned int sdhi1_ctrl_pins[] = { 1904 + /* CLK, CMD */ 1905 + RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7), 1906 + }; 1907 + static const unsigned int sdhi1_ctrl_mux[] = { 1908 + SD1_CLK_MARK, SD1_CMD_MARK, 1909 + }; 1910 + static const unsigned int sdhi1_cd_pins[] = { 1911 + /* CD */ 1912 + RCAR_GP_PIN(3, 14), 1913 + }; 1914 + static const unsigned int sdhi1_cd_mux[] = { 1915 + SD1_CD_MARK, 1916 + }; 1917 + static const unsigned int sdhi1_wp_pins[] = { 1918 + /* WP */ 1919 + RCAR_GP_PIN(3, 15), 1920 + }; 1921 + static const unsigned int sdhi1_wp_mux[] = { 1922 + SD1_WP_MARK, 1923 + }; 1924 + /* - SDHI2 ------------------------------------------------------------------ */ 1925 + static const unsigned int sdhi2_data1_pins[] = { 1926 + /* D0 */ 1927 + RCAR_GP_PIN(4, 2), 1928 + }; 1929 + static const unsigned int sdhi2_data1_mux[] = { 1930 + SD2_DAT0_MARK, 1931 + }; 1932 + static const unsigned int sdhi2_data4_pins[] = { 1933 + /* D[0:3] */ 1934 + RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3), 1935 + RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5), 1936 + }; 1937 + static const unsigned int sdhi2_data4_mux[] = { 1938 + SD2_DAT0_MARK, SD2_DAT1_MARK, 1939 + SD2_DAT2_MARK, SD2_DAT3_MARK, 1940 + }; 1941 + static const unsigned int sdhi2_data8_pins[] = { 1942 + /* D[0:7] */ 1943 + RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3), 1944 + RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5), 1945 + RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9), 1946 + RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11), 1947 + }; 1948 + static const unsigned int sdhi2_data8_mux[] = { 1949 + SD2_DAT0_MARK, SD2_DAT1_MARK, 1950 + SD2_DAT2_MARK, SD2_DAT3_MARK, 1951 + SD2_DAT4_MARK, SD2_DAT5_MARK, 1952 + SD2_DAT6_MARK, SD2_DAT7_MARK, 1953 + }; 1954 + static const unsigned int sdhi2_ctrl_pins[] = { 1955 + /* CLK, CMD */ 1956 + RCAR_GP_PIN(4, 0), RCAR_GP_PIN(4, 1), 1957 + }; 1958 + static const unsigned int sdhi2_ctrl_mux[] = { 1959 + SD2_CLK_MARK, SD2_CMD_MARK, 1960 + }; 1961 + static const unsigned int sdhi2_cd_a_pins[] = { 1962 + /* CD */ 1963 + RCAR_GP_PIN(4, 13), 1964 + }; 1965 + static const unsigned int sdhi2_cd_a_mux[] = { 1966 + SD2_CD_A_MARK, 1967 + }; 1968 + static const unsigned int sdhi2_cd_b_pins[] = { 1969 + /* CD */ 1970 + RCAR_GP_PIN(5, 10), 1971 + }; 1972 + static const unsigned int sdhi2_cd_b_mux[] = { 1973 + SD2_CD_B_MARK, 1974 + }; 1975 + static const unsigned int sdhi2_wp_a_pins[] = { 1976 + /* WP */ 1977 + RCAR_GP_PIN(4, 14), 1978 + }; 1979 + static const unsigned int sdhi2_wp_a_mux[] = { 1980 + SD2_WP_A_MARK, 1981 + }; 1982 + static const unsigned int sdhi2_wp_b_pins[] = { 1983 + /* WP */ 1984 + RCAR_GP_PIN(5, 11), 1985 + }; 1986 + static const unsigned int sdhi2_wp_b_mux[] = { 1987 + SD2_WP_B_MARK, 1988 + }; 1989 + static const unsigned int sdhi2_ds_pins[] = { 1990 + /* DS */ 1991 + RCAR_GP_PIN(4, 6), 1992 + }; 1993 + static const unsigned int sdhi2_ds_mux[] = { 1994 + SD2_DS_MARK, 1995 + }; 1996 + /* - SDHI3 ------------------------------------------------------------------ */ 1997 + static const unsigned int sdhi3_data1_pins[] = { 1998 + /* D0 */ 1999 + RCAR_GP_PIN(4, 9), 2000 + }; 2001 + static const unsigned int sdhi3_data1_mux[] = { 2002 + SD3_DAT0_MARK, 2003 + }; 2004 + static const unsigned int sdhi3_data4_pins[] = { 2005 + /* D[0:3] */ 2006 + RCAR_GP_PIN(4, 9), RCAR_GP_PIN(4, 10), 2007 + RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12), 2008 + }; 2009 + static const unsigned int sdhi3_data4_mux[] = { 2010 + SD3_DAT0_MARK, SD3_DAT1_MARK, 2011 + SD3_DAT2_MARK, SD3_DAT3_MARK, 2012 + }; 2013 + static const unsigned int sdhi3_data8_pins[] = { 2014 + /* D[0:7] */ 2015 + RCAR_GP_PIN(4, 9), RCAR_GP_PIN(4, 10), 2016 + RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12), 2017 + RCAR_GP_PIN(4, 13), RCAR_GP_PIN(4, 14), 2018 + RCAR_GP_PIN(4, 15), RCAR_GP_PIN(4, 16), 2019 + }; 2020 + static const unsigned int sdhi3_data8_mux[] = { 2021 + SD3_DAT0_MARK, SD3_DAT1_MARK, 2022 + SD3_DAT2_MARK, SD3_DAT3_MARK, 2023 + SD3_DAT4_MARK, SD3_DAT5_MARK, 2024 + SD3_DAT6_MARK, SD3_DAT7_MARK, 2025 + }; 2026 + static const unsigned int sdhi3_ctrl_pins[] = { 2027 + /* CLK, CMD */ 2028 + RCAR_GP_PIN(4, 7), RCAR_GP_PIN(4, 8), 2029 + }; 2030 + static const unsigned int sdhi3_ctrl_mux[] = { 2031 + SD3_CLK_MARK, SD3_CMD_MARK, 2032 + }; 2033 + static const unsigned int sdhi3_cd_pins[] = { 2034 + /* CD */ 2035 + RCAR_GP_PIN(4, 15), 2036 + }; 2037 + static const unsigned int sdhi3_cd_mux[] = { 2038 + SD3_CD_MARK, 2039 + }; 2040 + static const unsigned int sdhi3_wp_pins[] = { 2041 + /* WP */ 2042 + RCAR_GP_PIN(4, 16), 2043 + }; 2044 + static const unsigned int sdhi3_wp_mux[] = { 2045 + SD3_WP_MARK, 2046 + }; 2047 + static const unsigned int sdhi3_ds_pins[] = { 2048 + /* DS */ 2049 + RCAR_GP_PIN(4, 17), 2050 + }; 2051 + static const unsigned int sdhi3_ds_mux[] = { 2052 + SD3_DS_MARK, 2053 + }; 2054 + 2055 + /* - SCIF Clock ------------------------------------------------------------- */ 2056 + static const unsigned int scif_clk_a_pins[] = { 2057 + /* SCIF_CLK */ 2058 + RCAR_GP_PIN(6, 23), 2059 + }; 2060 + static const unsigned int scif_clk_a_mux[] = { 2061 + SCIF_CLK_A_MARK, 2062 + }; 2063 + static const unsigned int scif_clk_b_pins[] = { 2064 + /* SCIF_CLK */ 2065 + RCAR_GP_PIN(5, 9), 2066 + }; 2067 + static const unsigned int scif_clk_b_mux[] = { 2068 + SCIF_CLK_B_MARK, 2692 2069 }; 2693 2070 2694 2071 /* - SSI -------------------------------------------------------------------- */ ··· 3117 2050 SH_PFC_PIN_GROUP(avb_avtp_capture_a), 3118 2051 SH_PFC_PIN_GROUP(avb_avtp_match_b), 3119 2052 SH_PFC_PIN_GROUP(avb_avtp_capture_b), 2053 + SH_PFC_PIN_GROUP(hscif0_data), 2054 + SH_PFC_PIN_GROUP(hscif0_clk), 2055 + SH_PFC_PIN_GROUP(hscif0_ctrl), 2056 + SH_PFC_PIN_GROUP(hscif1_data_a), 2057 + SH_PFC_PIN_GROUP(hscif1_clk_a), 2058 + SH_PFC_PIN_GROUP(hscif1_ctrl_a), 2059 + SH_PFC_PIN_GROUP(hscif1_data_b), 2060 + SH_PFC_PIN_GROUP(hscif1_clk_b), 2061 + SH_PFC_PIN_GROUP(hscif1_ctrl_b), 2062 + SH_PFC_PIN_GROUP(hscif2_data_a), 2063 + SH_PFC_PIN_GROUP(hscif2_clk_a), 2064 + SH_PFC_PIN_GROUP(hscif2_ctrl_a), 2065 + SH_PFC_PIN_GROUP(hscif2_data_b), 2066 + SH_PFC_PIN_GROUP(hscif2_clk_b), 2067 + SH_PFC_PIN_GROUP(hscif2_ctrl_b), 2068 + SH_PFC_PIN_GROUP(hscif3_data_a), 2069 + SH_PFC_PIN_GROUP(hscif3_clk), 2070 + SH_PFC_PIN_GROUP(hscif3_ctrl), 2071 + SH_PFC_PIN_GROUP(hscif3_data_b), 2072 + SH_PFC_PIN_GROUP(hscif3_data_c), 2073 + SH_PFC_PIN_GROUP(hscif3_data_d), 2074 + SH_PFC_PIN_GROUP(hscif4_data_a), 2075 + SH_PFC_PIN_GROUP(hscif4_clk), 2076 + SH_PFC_PIN_GROUP(hscif4_ctrl), 2077 + SH_PFC_PIN_GROUP(hscif4_data_b), 3120 2078 SH_PFC_PIN_GROUP(i2c1_a), 3121 2079 SH_PFC_PIN_GROUP(i2c1_b), 3122 2080 SH_PFC_PIN_GROUP(i2c2_a), ··· 3149 2057 SH_PFC_PIN_GROUP(i2c6_a), 3150 2058 SH_PFC_PIN_GROUP(i2c6_b), 3151 2059 SH_PFC_PIN_GROUP(i2c6_c), 2060 + SH_PFC_PIN_GROUP(msiof0_clk), 2061 + SH_PFC_PIN_GROUP(msiof0_sync), 2062 + SH_PFC_PIN_GROUP(msiof0_ss1), 2063 + SH_PFC_PIN_GROUP(msiof0_ss2), 2064 + SH_PFC_PIN_GROUP(msiof0_txd), 2065 + SH_PFC_PIN_GROUP(msiof0_rxd), 2066 + SH_PFC_PIN_GROUP(msiof1_clk_a), 2067 + SH_PFC_PIN_GROUP(msiof1_sync_a), 2068 + SH_PFC_PIN_GROUP(msiof1_ss1_a), 2069 + SH_PFC_PIN_GROUP(msiof1_ss2_a), 2070 + SH_PFC_PIN_GROUP(msiof1_txd_a), 2071 + SH_PFC_PIN_GROUP(msiof1_rxd_a), 2072 + SH_PFC_PIN_GROUP(msiof1_clk_b), 2073 + SH_PFC_PIN_GROUP(msiof1_sync_b), 2074 + SH_PFC_PIN_GROUP(msiof1_ss1_b), 2075 + SH_PFC_PIN_GROUP(msiof1_ss2_b), 2076 + SH_PFC_PIN_GROUP(msiof1_txd_b), 2077 + SH_PFC_PIN_GROUP(msiof1_rxd_b), 2078 + SH_PFC_PIN_GROUP(msiof1_clk_c), 2079 + SH_PFC_PIN_GROUP(msiof1_sync_c), 2080 + SH_PFC_PIN_GROUP(msiof1_ss1_c), 2081 + SH_PFC_PIN_GROUP(msiof1_ss2_c), 2082 + SH_PFC_PIN_GROUP(msiof1_txd_c), 2083 + SH_PFC_PIN_GROUP(msiof1_rxd_c), 2084 + SH_PFC_PIN_GROUP(msiof1_clk_d), 2085 + SH_PFC_PIN_GROUP(msiof1_sync_d), 2086 + SH_PFC_PIN_GROUP(msiof1_ss1_d), 2087 + SH_PFC_PIN_GROUP(msiof1_ss2_d), 2088 + SH_PFC_PIN_GROUP(msiof1_txd_d), 2089 + SH_PFC_PIN_GROUP(msiof1_rxd_d), 2090 + SH_PFC_PIN_GROUP(msiof1_clk_e), 2091 + SH_PFC_PIN_GROUP(msiof1_sync_e), 2092 + SH_PFC_PIN_GROUP(msiof1_ss1_e), 2093 + SH_PFC_PIN_GROUP(msiof1_ss2_e), 2094 + SH_PFC_PIN_GROUP(msiof1_txd_e), 2095 + SH_PFC_PIN_GROUP(msiof1_rxd_e), 2096 + SH_PFC_PIN_GROUP(msiof1_clk_f), 2097 + SH_PFC_PIN_GROUP(msiof1_sync_f), 2098 + SH_PFC_PIN_GROUP(msiof1_ss1_f), 2099 + SH_PFC_PIN_GROUP(msiof1_ss2_f), 2100 + SH_PFC_PIN_GROUP(msiof1_txd_f), 2101 + SH_PFC_PIN_GROUP(msiof1_rxd_f), 2102 + SH_PFC_PIN_GROUP(msiof1_clk_g), 2103 + SH_PFC_PIN_GROUP(msiof1_sync_g), 2104 + SH_PFC_PIN_GROUP(msiof1_ss1_g), 2105 + SH_PFC_PIN_GROUP(msiof1_ss2_g), 2106 + SH_PFC_PIN_GROUP(msiof1_txd_g), 2107 + SH_PFC_PIN_GROUP(msiof1_rxd_g), 2108 + SH_PFC_PIN_GROUP(msiof2_clk_a), 2109 + SH_PFC_PIN_GROUP(msiof2_sync_a), 2110 + SH_PFC_PIN_GROUP(msiof2_ss1_a), 2111 + SH_PFC_PIN_GROUP(msiof2_ss2_a), 2112 + SH_PFC_PIN_GROUP(msiof2_txd_a), 2113 + SH_PFC_PIN_GROUP(msiof2_rxd_a), 2114 + SH_PFC_PIN_GROUP(msiof2_clk_b), 2115 + SH_PFC_PIN_GROUP(msiof2_sync_b), 2116 + SH_PFC_PIN_GROUP(msiof2_ss1_b), 2117 + SH_PFC_PIN_GROUP(msiof2_ss2_b), 2118 + SH_PFC_PIN_GROUP(msiof2_txd_b), 2119 + SH_PFC_PIN_GROUP(msiof2_rxd_b), 2120 + SH_PFC_PIN_GROUP(msiof2_clk_c), 2121 + SH_PFC_PIN_GROUP(msiof2_sync_c), 2122 + SH_PFC_PIN_GROUP(msiof2_ss1_c), 2123 + SH_PFC_PIN_GROUP(msiof2_ss2_c), 2124 + SH_PFC_PIN_GROUP(msiof2_txd_c), 2125 + SH_PFC_PIN_GROUP(msiof2_rxd_c), 2126 + SH_PFC_PIN_GROUP(msiof2_clk_d), 2127 + SH_PFC_PIN_GROUP(msiof2_sync_d), 2128 + SH_PFC_PIN_GROUP(msiof2_ss1_d), 2129 + SH_PFC_PIN_GROUP(msiof2_ss2_d), 2130 + SH_PFC_PIN_GROUP(msiof2_txd_d), 2131 + SH_PFC_PIN_GROUP(msiof2_rxd_d), 2132 + SH_PFC_PIN_GROUP(msiof3_clk_a), 2133 + SH_PFC_PIN_GROUP(msiof3_sync_a), 2134 + SH_PFC_PIN_GROUP(msiof3_ss1_a), 2135 + SH_PFC_PIN_GROUP(msiof3_ss2_a), 2136 + SH_PFC_PIN_GROUP(msiof3_txd_a), 2137 + SH_PFC_PIN_GROUP(msiof3_rxd_a), 2138 + SH_PFC_PIN_GROUP(msiof3_clk_b), 2139 + SH_PFC_PIN_GROUP(msiof3_sync_b), 2140 + SH_PFC_PIN_GROUP(msiof3_ss1_b), 2141 + SH_PFC_PIN_GROUP(msiof3_ss2_b), 2142 + SH_PFC_PIN_GROUP(msiof3_txd_b), 2143 + SH_PFC_PIN_GROUP(msiof3_rxd_b), 2144 + SH_PFC_PIN_GROUP(msiof3_clk_c), 2145 + SH_PFC_PIN_GROUP(msiof3_sync_c), 2146 + SH_PFC_PIN_GROUP(msiof3_txd_c), 2147 + SH_PFC_PIN_GROUP(msiof3_rxd_c), 2148 + SH_PFC_PIN_GROUP(msiof3_clk_d), 2149 + SH_PFC_PIN_GROUP(msiof3_sync_d), 2150 + SH_PFC_PIN_GROUP(msiof3_ss1_d), 2151 + SH_PFC_PIN_GROUP(msiof3_txd_d), 2152 + SH_PFC_PIN_GROUP(msiof3_rxd_d), 2153 + SH_PFC_PIN_GROUP(sata0_devslp_a), 2154 + SH_PFC_PIN_GROUP(sata0_devslp_b), 3152 2155 SH_PFC_PIN_GROUP(scif0_data), 3153 2156 SH_PFC_PIN_GROUP(scif0_clk), 3154 2157 SH_PFC_PIN_GROUP(scif0_ctrl), ··· 3269 2082 SH_PFC_PIN_GROUP(scif4_ctrl_c), 3270 2083 SH_PFC_PIN_GROUP(scif5_data), 3271 2084 SH_PFC_PIN_GROUP(scif5_clk), 2085 + SH_PFC_PIN_GROUP(scif_clk_a), 2086 + SH_PFC_PIN_GROUP(scif_clk_b), 2087 + SH_PFC_PIN_GROUP(sdhi0_data1), 2088 + SH_PFC_PIN_GROUP(sdhi0_data4), 2089 + SH_PFC_PIN_GROUP(sdhi0_ctrl), 2090 + SH_PFC_PIN_GROUP(sdhi0_cd), 2091 + SH_PFC_PIN_GROUP(sdhi0_wp), 2092 + SH_PFC_PIN_GROUP(sdhi1_data1), 2093 + SH_PFC_PIN_GROUP(sdhi1_data4), 2094 + SH_PFC_PIN_GROUP(sdhi1_ctrl), 2095 + SH_PFC_PIN_GROUP(sdhi1_cd), 2096 + SH_PFC_PIN_GROUP(sdhi1_wp), 2097 + SH_PFC_PIN_GROUP(sdhi2_data1), 2098 + SH_PFC_PIN_GROUP(sdhi2_data4), 2099 + SH_PFC_PIN_GROUP(sdhi2_data8), 2100 + SH_PFC_PIN_GROUP(sdhi2_ctrl), 2101 + SH_PFC_PIN_GROUP(sdhi2_cd_a), 2102 + SH_PFC_PIN_GROUP(sdhi2_wp_a), 2103 + SH_PFC_PIN_GROUP(sdhi2_cd_b), 2104 + SH_PFC_PIN_GROUP(sdhi2_wp_b), 2105 + SH_PFC_PIN_GROUP(sdhi2_ds), 2106 + SH_PFC_PIN_GROUP(sdhi3_data1), 2107 + SH_PFC_PIN_GROUP(sdhi3_data4), 2108 + SH_PFC_PIN_GROUP(sdhi3_data8), 2109 + SH_PFC_PIN_GROUP(sdhi3_ctrl), 2110 + SH_PFC_PIN_GROUP(sdhi3_cd), 2111 + SH_PFC_PIN_GROUP(sdhi3_wp), 2112 + SH_PFC_PIN_GROUP(sdhi3_ds), 3272 2113 SH_PFC_PIN_GROUP(ssi0_data), 3273 2114 SH_PFC_PIN_GROUP(ssi01239_ctrl), 3274 2115 SH_PFC_PIN_GROUP(ssi1_data_a), ··· 3356 2141 "avb_avtp_capture_b", 3357 2142 }; 3358 2143 2144 + static const char * const hscif0_groups[] = { 2145 + "hscif0_data", 2146 + "hscif0_clk", 2147 + "hscif0_ctrl", 2148 + }; 2149 + 2150 + static const char * const hscif1_groups[] = { 2151 + "hscif1_data_a", 2152 + "hscif1_clk_a", 2153 + "hscif1_ctrl_a", 2154 + "hscif1_data_b", 2155 + "hscif1_clk_b", 2156 + "hscif1_ctrl_b", 2157 + }; 2158 + 2159 + static const char * const hscif2_groups[] = { 2160 + "hscif2_data_a", 2161 + "hscif2_clk_a", 2162 + "hscif2_ctrl_a", 2163 + "hscif2_data_b", 2164 + "hscif2_clk_b", 2165 + "hscif2_ctrl_b", 2166 + }; 2167 + 2168 + static const char * const hscif3_groups[] = { 2169 + "hscif3_data_a", 2170 + "hscif3_clk", 2171 + "hscif3_ctrl", 2172 + "hscif3_data_b", 2173 + "hscif3_data_c", 2174 + "hscif3_data_d", 2175 + }; 2176 + 2177 + static const char * const hscif4_groups[] = { 2178 + "hscif4_data_a", 2179 + "hscif4_clk", 2180 + "hscif4_ctrl", 2181 + "hscif4_data_b", 2182 + }; 2183 + 3359 2184 static const char * const i2c1_groups[] = { 3360 2185 "i2c1_a", 3361 2186 "i2c1_b", ··· 3410 2155 "i2c6_a", 3411 2156 "i2c6_b", 3412 2157 "i2c6_c", 2158 + }; 2159 + 2160 + static const char * const msiof0_groups[] = { 2161 + "msiof0_clk", 2162 + "msiof0_sync", 2163 + "msiof0_ss1", 2164 + "msiof0_ss2", 2165 + "msiof0_txd", 2166 + "msiof0_rxd", 2167 + }; 2168 + 2169 + static const char * const msiof1_groups[] = { 2170 + "msiof1_clk_a", 2171 + "msiof1_sync_a", 2172 + "msiof1_ss1_a", 2173 + "msiof1_ss2_a", 2174 + "msiof1_txd_a", 2175 + "msiof1_rxd_a", 2176 + "msiof1_clk_b", 2177 + "msiof1_sync_b", 2178 + "msiof1_ss1_b", 2179 + "msiof1_ss2_b", 2180 + "msiof1_txd_b", 2181 + "msiof1_rxd_b", 2182 + "msiof1_clk_c", 2183 + "msiof1_sync_c", 2184 + "msiof1_ss1_c", 2185 + "msiof1_ss2_c", 2186 + "msiof1_txd_c", 2187 + "msiof1_rxd_c", 2188 + "msiof1_clk_d", 2189 + "msiof1_sync_d", 2190 + "msiof1_ss1_d", 2191 + "msiof1_ss2_d", 2192 + "msiof1_txd_d", 2193 + "msiof1_rxd_d", 2194 + "msiof1_clk_e", 2195 + "msiof1_sync_e", 2196 + "msiof1_ss1_e", 2197 + "msiof1_ss2_e", 2198 + "msiof1_txd_e", 2199 + "msiof1_rxd_e", 2200 + "msiof1_clk_f", 2201 + "msiof1_sync_f", 2202 + "msiof1_ss1_f", 2203 + "msiof1_ss2_f", 2204 + "msiof1_txd_f", 2205 + "msiof1_rxd_f", 2206 + "msiof1_clk_g", 2207 + "msiof1_sync_g", 2208 + "msiof1_ss1_g", 2209 + "msiof1_ss2_g", 2210 + "msiof1_txd_g", 2211 + "msiof1_rxd_g", 2212 + }; 2213 + 2214 + static const char * const msiof2_groups[] = { 2215 + "msiof2_clk_a", 2216 + "msiof2_sync_a", 2217 + "msiof2_ss1_a", 2218 + "msiof2_ss2_a", 2219 + "msiof2_txd_a", 2220 + "msiof2_rxd_a", 2221 + "msiof2_clk_b", 2222 + "msiof2_sync_b", 2223 + "msiof2_ss1_b", 2224 + "msiof2_ss2_b", 2225 + "msiof2_txd_b", 2226 + "msiof2_rxd_b", 2227 + "msiof2_clk_c", 2228 + "msiof2_sync_c", 2229 + "msiof2_ss1_c", 2230 + "msiof2_ss2_c", 2231 + "msiof2_txd_c", 2232 + "msiof2_rxd_c", 2233 + "msiof2_clk_d", 2234 + "msiof2_sync_d", 2235 + "msiof2_ss1_d", 2236 + "msiof2_ss2_d", 2237 + "msiof2_txd_d", 2238 + "msiof2_rxd_d", 2239 + }; 2240 + 2241 + static const char * const msiof3_groups[] = { 2242 + "msiof3_clk_a", 2243 + "msiof3_sync_a", 2244 + "msiof3_ss1_a", 2245 + "msiof3_ss2_a", 2246 + "msiof3_txd_a", 2247 + "msiof3_rxd_a", 2248 + "msiof3_clk_b", 2249 + "msiof3_sync_b", 2250 + "msiof3_ss1_b", 2251 + "msiof3_ss2_b", 2252 + "msiof3_txd_b", 2253 + "msiof3_rxd_b", 2254 + "msiof3_clk_c", 2255 + "msiof3_sync_c", 2256 + "msiof3_txd_c", 2257 + "msiof3_rxd_c", 2258 + "msiof3_clk_d", 2259 + "msiof3_sync_d", 2260 + "msiof3_ss1_d", 2261 + "msiof3_txd_d", 2262 + "msiof3_rxd_d", 2263 + }; 2264 + 2265 + static const char * const sata0_groups[] = { 2266 + "sata0_devslp_a", 2267 + "sata0_devslp_b", 3413 2268 }; 3414 2269 3415 2270 static const char * const scif0_groups[] = { ··· 3565 2200 "scif5_clk", 3566 2201 }; 3567 2202 2203 + static const char * const scif_clk_groups[] = { 2204 + "scif_clk_a", 2205 + "scif_clk_b", 2206 + }; 2207 + 2208 + static const char * const sdhi0_groups[] = { 2209 + "sdhi0_data1", 2210 + "sdhi0_data4", 2211 + "sdhi0_ctrl", 2212 + "sdhi0_cd", 2213 + "sdhi0_wp", 2214 + }; 2215 + 2216 + static const char * const sdhi1_groups[] = { 2217 + "sdhi1_data1", 2218 + "sdhi1_data4", 2219 + "sdhi1_ctrl", 2220 + "sdhi1_cd", 2221 + "sdhi1_wp", 2222 + }; 2223 + 2224 + static const char * const sdhi2_groups[] = { 2225 + "sdhi2_data1", 2226 + "sdhi2_data4", 2227 + "sdhi2_data8", 2228 + "sdhi2_ctrl", 2229 + "sdhi2_cd_a", 2230 + "sdhi2_wp_a", 2231 + "sdhi2_cd_b", 2232 + "sdhi2_wp_b", 2233 + "sdhi2_ds", 2234 + }; 2235 + 2236 + static const char * const sdhi3_groups[] = { 2237 + "sdhi3_data1", 2238 + "sdhi3_data4", 2239 + "sdhi3_data8", 2240 + "sdhi3_ctrl", 2241 + "sdhi3_cd", 2242 + "sdhi3_wp", 2243 + "sdhi3_ds", 2244 + }; 2245 + 3568 2246 static const char * const ssi_groups[] = { 3569 2247 "ssi0_data", 3570 2248 "ssi01239_ctrl", ··· 3639 2231 static const struct sh_pfc_function pinmux_functions[] = { 3640 2232 SH_PFC_FUNCTION(audio_clk), 3641 2233 SH_PFC_FUNCTION(avb), 2234 + SH_PFC_FUNCTION(hscif0), 2235 + SH_PFC_FUNCTION(hscif1), 2236 + SH_PFC_FUNCTION(hscif2), 2237 + SH_PFC_FUNCTION(hscif3), 2238 + SH_PFC_FUNCTION(hscif4), 3642 2239 SH_PFC_FUNCTION(i2c1), 3643 2240 SH_PFC_FUNCTION(i2c2), 3644 2241 SH_PFC_FUNCTION(i2c6), 2242 + SH_PFC_FUNCTION(msiof0), 2243 + SH_PFC_FUNCTION(msiof1), 2244 + SH_PFC_FUNCTION(msiof2), 2245 + SH_PFC_FUNCTION(msiof3), 2246 + SH_PFC_FUNCTION(sata0), 3645 2247 SH_PFC_FUNCTION(scif0), 3646 2248 SH_PFC_FUNCTION(scif1), 3647 2249 SH_PFC_FUNCTION(scif2), 3648 2250 SH_PFC_FUNCTION(scif3), 3649 2251 SH_PFC_FUNCTION(scif4), 3650 2252 SH_PFC_FUNCTION(scif5), 2253 + SH_PFC_FUNCTION(scif_clk), 2254 + SH_PFC_FUNCTION(sdhi0), 2255 + SH_PFC_FUNCTION(sdhi1), 2256 + SH_PFC_FUNCTION(sdhi2), 2257 + SH_PFC_FUNCTION(sdhi3), 3651 2258 SH_PFC_FUNCTION(ssi), 3652 2259 }; 3653 2260
+547 -1
drivers/pinctrl/sh-pfc/pfc-sh73a0.c
··· 2059 2059 LCD2D8_MARK, 2060 2060 }; 2061 2061 static const unsigned int lcd2_data12_pins[] = { 2062 - /* D[0:12] */ 2062 + /* D[0:11] */ 2063 2063 128, 129, 142, 143, 144, 145, 138, 139, 2064 2064 140, 141, 130, 131, 2065 2065 }; ··· 2198 2198 static const unsigned int mmc0_ctrl_1_mux[] = { 2199 2199 MMCCMD1_MARK, MMCCLK1_MARK, 2200 2200 }; 2201 + /* - MSIOF0 ----------------------------------------------------------------- */ 2202 + static const unsigned int msiof0_rsck_pins[] = { 2203 + /* RSCK */ 2204 + 66, 2205 + }; 2206 + static const unsigned int msiof0_rsck_mux[] = { 2207 + MSIOF0_RSCK_MARK, 2208 + }; 2209 + static const unsigned int msiof0_tsck_pins[] = { 2210 + /* TSCK */ 2211 + 64, 2212 + }; 2213 + static const unsigned int msiof0_tsck_mux[] = { 2214 + MSIOF0_TSCK_MARK, 2215 + }; 2216 + static const unsigned int msiof0_rsync_pins[] = { 2217 + /* RSYNC */ 2218 + 67, 2219 + }; 2220 + static const unsigned int msiof0_rsync_mux[] = { 2221 + MSIOF0_RSYNC_MARK, 2222 + }; 2223 + static const unsigned int msiof0_tsync_pins[] = { 2224 + /* TSYNC */ 2225 + 63, 2226 + }; 2227 + static const unsigned int msiof0_tsync_mux[] = { 2228 + MSIOF0_TSYNC_MARK, 2229 + }; 2230 + static const unsigned int msiof0_ss1_pins[] = { 2231 + /* SS1 */ 2232 + 62, 2233 + }; 2234 + static const unsigned int msiof0_ss1_mux[] = { 2235 + MSIOF0_SS1_MARK, 2236 + }; 2237 + static const unsigned int msiof0_ss2_pins[] = { 2238 + /* SS2 */ 2239 + 71, 2240 + }; 2241 + static const unsigned int msiof0_ss2_mux[] = { 2242 + MSIOF0_SS2_MARK, 2243 + }; 2244 + static const unsigned int msiof0_rxd_pins[] = { 2245 + /* RXD */ 2246 + 70, 2247 + }; 2248 + static const unsigned int msiof0_rxd_mux[] = { 2249 + MSIOF0_RXD_MARK, 2250 + }; 2251 + static const unsigned int msiof0_txd_pins[] = { 2252 + /* TXD */ 2253 + 65, 2254 + }; 2255 + static const unsigned int msiof0_txd_mux[] = { 2256 + MSIOF0_TXD_MARK, 2257 + }; 2258 + static const unsigned int msiof0_mck0_pins[] = { 2259 + /* MSCK0 */ 2260 + 68, 2261 + }; 2262 + static const unsigned int msiof0_mck0_mux[] = { 2263 + MSIOF0_MCK0_MARK, 2264 + }; 2265 + 2266 + static const unsigned int msiof0_mck1_pins[] = { 2267 + /* MSCK1 */ 2268 + 69, 2269 + }; 2270 + static const unsigned int msiof0_mck1_mux[] = { 2271 + MSIOF0_MCK1_MARK, 2272 + }; 2273 + 2274 + static const unsigned int msiof0l_rsck_pins[] = { 2275 + /* RSCK */ 2276 + 214, 2277 + }; 2278 + static const unsigned int msiof0l_rsck_mux[] = { 2279 + MSIOF0L_RSCK_MARK, 2280 + }; 2281 + static const unsigned int msiof0l_tsck_pins[] = { 2282 + /* TSCK */ 2283 + 219, 2284 + }; 2285 + static const unsigned int msiof0l_tsck_mux[] = { 2286 + MSIOF0L_TSCK_MARK, 2287 + }; 2288 + static const unsigned int msiof0l_rsync_pins[] = { 2289 + /* RSYNC */ 2290 + 215, 2291 + }; 2292 + static const unsigned int msiof0l_rsync_mux[] = { 2293 + MSIOF0L_RSYNC_MARK, 2294 + }; 2295 + static const unsigned int msiof0l_tsync_pins[] = { 2296 + /* TSYNC */ 2297 + 217, 2298 + }; 2299 + static const unsigned int msiof0l_tsync_mux[] = { 2300 + MSIOF0L_TSYNC_MARK, 2301 + }; 2302 + static const unsigned int msiof0l_ss1_a_pins[] = { 2303 + /* SS1 */ 2304 + 207, 2305 + }; 2306 + static const unsigned int msiof0l_ss1_a_mux[] = { 2307 + PORT207_MSIOF0L_SS1_MARK, 2308 + }; 2309 + static const unsigned int msiof0l_ss1_b_pins[] = { 2310 + /* SS1 */ 2311 + 210, 2312 + }; 2313 + static const unsigned int msiof0l_ss1_b_mux[] = { 2314 + PORT210_MSIOF0L_SS1_MARK, 2315 + }; 2316 + static const unsigned int msiof0l_ss2_a_pins[] = { 2317 + /* SS2 */ 2318 + 208, 2319 + }; 2320 + static const unsigned int msiof0l_ss2_a_mux[] = { 2321 + PORT208_MSIOF0L_SS2_MARK, 2322 + }; 2323 + static const unsigned int msiof0l_ss2_b_pins[] = { 2324 + /* SS2 */ 2325 + 211, 2326 + }; 2327 + static const unsigned int msiof0l_ss2_b_mux[] = { 2328 + PORT211_MSIOF0L_SS2_MARK, 2329 + }; 2330 + static const unsigned int msiof0l_rxd_pins[] = { 2331 + /* RXD */ 2332 + 221, 2333 + }; 2334 + static const unsigned int msiof0l_rxd_mux[] = { 2335 + MSIOF0L_RXD_MARK, 2336 + }; 2337 + static const unsigned int msiof0l_txd_pins[] = { 2338 + /* TXD */ 2339 + 222, 2340 + }; 2341 + static const unsigned int msiof0l_txd_mux[] = { 2342 + MSIOF0L_TXD_MARK, 2343 + }; 2344 + static const unsigned int msiof0l_mck0_pins[] = { 2345 + /* MSCK0 */ 2346 + 212, 2347 + }; 2348 + static const unsigned int msiof0l_mck0_mux[] = { 2349 + MSIOF0L_MCK0_MARK, 2350 + }; 2351 + static const unsigned int msiof0l_mck1_pins[] = { 2352 + /* MSCK1 */ 2353 + 213, 2354 + }; 2355 + static const unsigned int msiof0l_mck1_mux[] = { 2356 + MSIOF0L_MCK1_MARK, 2357 + }; 2358 + /* - MSIOF1 ----------------------------------------------------------------- */ 2359 + static const unsigned int msiof1_rsck_pins[] = { 2360 + /* RSCK */ 2361 + 234, 2362 + }; 2363 + static const unsigned int msiof1_rsck_mux[] = { 2364 + MSIOF1_RSCK_MARK, 2365 + }; 2366 + static const unsigned int msiof1_tsck_pins[] = { 2367 + /* TSCK */ 2368 + 232, 2369 + }; 2370 + static const unsigned int msiof1_tsck_mux[] = { 2371 + MSIOF1_TSCK_MARK, 2372 + }; 2373 + static const unsigned int msiof1_rsync_pins[] = { 2374 + /* RSYNC */ 2375 + 235, 2376 + }; 2377 + static const unsigned int msiof1_rsync_mux[] = { 2378 + MSIOF1_RSYNC_MARK, 2379 + }; 2380 + static const unsigned int msiof1_tsync_pins[] = { 2381 + /* TSYNC */ 2382 + 231, 2383 + }; 2384 + static const unsigned int msiof1_tsync_mux[] = { 2385 + MSIOF1_TSYNC_MARK, 2386 + }; 2387 + static const unsigned int msiof1_ss1_pins[] = { 2388 + /* SS1 */ 2389 + 238, 2390 + }; 2391 + static const unsigned int msiof1_ss1_mux[] = { 2392 + MSIOF1_SS1_MARK, 2393 + }; 2394 + static const unsigned int msiof1_ss2_pins[] = { 2395 + /* SS2 */ 2396 + 239, 2397 + }; 2398 + static const unsigned int msiof1_ss2_mux[] = { 2399 + MSIOF1_SS2_MARK, 2400 + }; 2401 + static const unsigned int msiof1_rxd_pins[] = { 2402 + /* RXD */ 2403 + 233, 2404 + }; 2405 + static const unsigned int msiof1_rxd_mux[] = { 2406 + MSIOF1_RXD_MARK, 2407 + }; 2408 + static const unsigned int msiof1_txd_pins[] = { 2409 + /* TXD */ 2410 + 230, 2411 + }; 2412 + static const unsigned int msiof1_txd_mux[] = { 2413 + MSIOF1_TXD_MARK, 2414 + }; 2415 + static const unsigned int msiof1_mck0_pins[] = { 2416 + /* MSCK0 */ 2417 + 236, 2418 + }; 2419 + static const unsigned int msiof1_mck0_mux[] = { 2420 + MSIOF1_MCK0_MARK, 2421 + }; 2422 + static const unsigned int msiof1_mck1_pins[] = { 2423 + /* MSCK1 */ 2424 + 237, 2425 + }; 2426 + static const unsigned int msiof1_mck1_mux[] = { 2427 + MSIOF1_MCK1_MARK, 2428 + }; 2429 + /* - MSIOF2 ----------------------------------------------------------------- */ 2430 + static const unsigned int msiof2_rsck_pins[] = { 2431 + /* RSCK */ 2432 + 151, 2433 + }; 2434 + static const unsigned int msiof2_rsck_mux[] = { 2435 + MSIOF2_RSCK_MARK, 2436 + }; 2437 + static const unsigned int msiof2_tsck_pins[] = { 2438 + /* TSCK */ 2439 + 135, 2440 + }; 2441 + static const unsigned int msiof2_tsck_mux[] = { 2442 + MSIOF2_TSCK_MARK, 2443 + }; 2444 + static const unsigned int msiof2_rsync_pins[] = { 2445 + /* RSYNC */ 2446 + 152, 2447 + }; 2448 + static const unsigned int msiof2_rsync_mux[] = { 2449 + MSIOF2_RSYNC_MARK, 2450 + }; 2451 + static const unsigned int msiof2_tsync_pins[] = { 2452 + /* TSYNC */ 2453 + 133, 2454 + }; 2455 + static const unsigned int msiof2_tsync_mux[] = { 2456 + MSIOF2_TSYNC_MARK, 2457 + }; 2458 + static const unsigned int msiof2_ss1_a_pins[] = { 2459 + /* SS1 */ 2460 + 131, 2461 + }; 2462 + static const unsigned int msiof2_ss1_a_mux[] = { 2463 + PORT131_MSIOF2_SS1_MARK, 2464 + }; 2465 + static const unsigned int msiof2_ss1_b_pins[] = { 2466 + /* SS1 */ 2467 + 153, 2468 + }; 2469 + static const unsigned int msiof2_ss1_b_mux[] = { 2470 + PORT153_MSIOF2_SS1_MARK, 2471 + }; 2472 + static const unsigned int msiof2_ss2_a_pins[] = { 2473 + /* SS2 */ 2474 + 132, 2475 + }; 2476 + static const unsigned int msiof2_ss2_a_mux[] = { 2477 + PORT132_MSIOF2_SS2_MARK, 2478 + }; 2479 + static const unsigned int msiof2_ss2_b_pins[] = { 2480 + /* SS2 */ 2481 + 156, 2482 + }; 2483 + static const unsigned int msiof2_ss2_b_mux[] = { 2484 + PORT156_MSIOF2_SS2_MARK, 2485 + }; 2486 + static const unsigned int msiof2_rxd_a_pins[] = { 2487 + /* RXD */ 2488 + 130, 2489 + }; 2490 + static const unsigned int msiof2_rxd_a_mux[] = { 2491 + PORT130_MSIOF2_RXD_MARK, 2492 + }; 2493 + static const unsigned int msiof2_rxd_b_pins[] = { 2494 + /* RXD */ 2495 + 157, 2496 + }; 2497 + static const unsigned int msiof2_rxd_b_mux[] = { 2498 + PORT157_MSIOF2_RXD_MARK, 2499 + }; 2500 + static const unsigned int msiof2_txd_pins[] = { 2501 + /* TXD */ 2502 + 134, 2503 + }; 2504 + static const unsigned int msiof2_txd_mux[] = { 2505 + MSIOF2_TXD_MARK, 2506 + }; 2507 + static const unsigned int msiof2_mck0_pins[] = { 2508 + /* MSCK0 */ 2509 + 154, 2510 + }; 2511 + static const unsigned int msiof2_mck0_mux[] = { 2512 + MSIOF2_MCK0_MARK, 2513 + }; 2514 + static const unsigned int msiof2_mck1_pins[] = { 2515 + /* MSCK1 */ 2516 + 155, 2517 + }; 2518 + static const unsigned int msiof2_mck1_mux[] = { 2519 + MSIOF2_MCK1_MARK, 2520 + }; 2521 + 2522 + static const unsigned int msiof2r_tsck_pins[] = { 2523 + /* TSCK */ 2524 + 248, 2525 + }; 2526 + static const unsigned int msiof2r_tsck_mux[] = { 2527 + MSIOF2R_TSCK_MARK, 2528 + }; 2529 + static const unsigned int msiof2r_tsync_pins[] = { 2530 + /* TSYNC */ 2531 + 249, 2532 + }; 2533 + static const unsigned int msiof2r_tsync_mux[] = { 2534 + MSIOF2R_TSYNC_MARK, 2535 + }; 2536 + static const unsigned int msiof2r_rxd_pins[] = { 2537 + /* RXD */ 2538 + 244, 2539 + }; 2540 + static const unsigned int msiof2r_rxd_mux[] = { 2541 + MSIOF2R_RXD_MARK, 2542 + }; 2543 + static const unsigned int msiof2r_txd_pins[] = { 2544 + /* TXD */ 2545 + 245, 2546 + }; 2547 + static const unsigned int msiof2r_txd_mux[] = { 2548 + MSIOF2R_TXD_MARK, 2549 + }; 2550 + /* - MSIOF3 (Pin function name of MSIOF3 is named BBIF1) -------------------- */ 2551 + static const unsigned int msiof3_rsck_pins[] = { 2552 + /* RSCK */ 2553 + 115, 2554 + }; 2555 + static const unsigned int msiof3_rsck_mux[] = { 2556 + BBIF1_RSCK_MARK, 2557 + }; 2558 + static const unsigned int msiof3_tsck_pins[] = { 2559 + /* TSCK */ 2560 + 112, 2561 + }; 2562 + static const unsigned int msiof3_tsck_mux[] = { 2563 + BBIF1_TSCK_MARK, 2564 + }; 2565 + static const unsigned int msiof3_rsync_pins[] = { 2566 + /* RSYNC */ 2567 + 116, 2568 + }; 2569 + static const unsigned int msiof3_rsync_mux[] = { 2570 + BBIF1_RSYNC_MARK, 2571 + }; 2572 + static const unsigned int msiof3_tsync_pins[] = { 2573 + /* TSYNC */ 2574 + 113, 2575 + }; 2576 + static const unsigned int msiof3_tsync_mux[] = { 2577 + BBIF1_TSYNC_MARK, 2578 + }; 2579 + static const unsigned int msiof3_ss1_pins[] = { 2580 + /* SS1 */ 2581 + 117, 2582 + }; 2583 + static const unsigned int msiof3_ss1_mux[] = { 2584 + BBIF1_SS1_MARK, 2585 + }; 2586 + static const unsigned int msiof3_ss2_pins[] = { 2587 + /* SS2 */ 2588 + 109, 2589 + }; 2590 + static const unsigned int msiof3_ss2_mux[] = { 2591 + BBIF1_SS2_MARK, 2592 + }; 2593 + static const unsigned int msiof3_rxd_pins[] = { 2594 + /* RXD */ 2595 + 111, 2596 + }; 2597 + static const unsigned int msiof3_rxd_mux[] = { 2598 + BBIF1_RXD_MARK, 2599 + }; 2600 + static const unsigned int msiof3_txd_pins[] = { 2601 + /* TXD */ 2602 + 114, 2603 + }; 2604 + static const unsigned int msiof3_txd_mux[] = { 2605 + BBIF1_TXD_MARK, 2606 + }; 2607 + static const unsigned int msiof3_flow_pins[] = { 2608 + /* FLOW */ 2609 + 117, 2610 + }; 2611 + static const unsigned int msiof3_flow_mux[] = { 2612 + BBIF1_FLOW_MARK, 2613 + }; 2614 + 2201 2615 /* - SCIFA0 ----------------------------------------------------------------- */ 2202 2616 static const unsigned int scifa0_data_pins[] = { 2203 2617 /* RXD, TXD */ ··· 3196 2782 SH_PFC_PIN_GROUP(mmc0_data4_1), 3197 2783 SH_PFC_PIN_GROUP(mmc0_data8_1), 3198 2784 SH_PFC_PIN_GROUP(mmc0_ctrl_1), 2785 + SH_PFC_PIN_GROUP(msiof0_rsck), 2786 + SH_PFC_PIN_GROUP(msiof0_tsck), 2787 + SH_PFC_PIN_GROUP(msiof0_rsync), 2788 + SH_PFC_PIN_GROUP(msiof0_tsync), 2789 + SH_PFC_PIN_GROUP(msiof0_ss1), 2790 + SH_PFC_PIN_GROUP(msiof0_ss2), 2791 + SH_PFC_PIN_GROUP(msiof0_rxd), 2792 + SH_PFC_PIN_GROUP(msiof0_txd), 2793 + SH_PFC_PIN_GROUP(msiof0_mck0), 2794 + SH_PFC_PIN_GROUP(msiof0_mck1), 2795 + SH_PFC_PIN_GROUP(msiof0l_rsck), 2796 + SH_PFC_PIN_GROUP(msiof0l_tsck), 2797 + SH_PFC_PIN_GROUP(msiof0l_rsync), 2798 + SH_PFC_PIN_GROUP(msiof0l_tsync), 2799 + SH_PFC_PIN_GROUP(msiof0l_ss1_a), 2800 + SH_PFC_PIN_GROUP(msiof0l_ss1_b), 2801 + SH_PFC_PIN_GROUP(msiof0l_ss2_a), 2802 + SH_PFC_PIN_GROUP(msiof0l_ss2_b), 2803 + SH_PFC_PIN_GROUP(msiof0l_rxd), 2804 + SH_PFC_PIN_GROUP(msiof0l_txd), 2805 + SH_PFC_PIN_GROUP(msiof0l_mck0), 2806 + SH_PFC_PIN_GROUP(msiof0l_mck1), 2807 + SH_PFC_PIN_GROUP(msiof1_rsck), 2808 + SH_PFC_PIN_GROUP(msiof1_tsck), 2809 + SH_PFC_PIN_GROUP(msiof1_rsync), 2810 + SH_PFC_PIN_GROUP(msiof1_tsync), 2811 + SH_PFC_PIN_GROUP(msiof1_ss1), 2812 + SH_PFC_PIN_GROUP(msiof1_ss2), 2813 + SH_PFC_PIN_GROUP(msiof1_rxd), 2814 + SH_PFC_PIN_GROUP(msiof1_txd), 2815 + SH_PFC_PIN_GROUP(msiof1_mck0), 2816 + SH_PFC_PIN_GROUP(msiof1_mck1), 2817 + SH_PFC_PIN_GROUP(msiof2_rsck), 2818 + SH_PFC_PIN_GROUP(msiof2_tsck), 2819 + SH_PFC_PIN_GROUP(msiof2_rsync), 2820 + SH_PFC_PIN_GROUP(msiof2_tsync), 2821 + SH_PFC_PIN_GROUP(msiof2_ss1_a), 2822 + SH_PFC_PIN_GROUP(msiof2_ss1_b), 2823 + SH_PFC_PIN_GROUP(msiof2_ss2_a), 2824 + SH_PFC_PIN_GROUP(msiof2_ss2_b), 2825 + SH_PFC_PIN_GROUP(msiof2_rxd_a), 2826 + SH_PFC_PIN_GROUP(msiof2_rxd_b), 2827 + SH_PFC_PIN_GROUP(msiof2_txd), 2828 + SH_PFC_PIN_GROUP(msiof2_mck0), 2829 + SH_PFC_PIN_GROUP(msiof2_mck1), 2830 + SH_PFC_PIN_GROUP(msiof2r_tsck), 2831 + SH_PFC_PIN_GROUP(msiof2r_tsync), 2832 + SH_PFC_PIN_GROUP(msiof2r_rxd), 2833 + SH_PFC_PIN_GROUP(msiof2r_txd), 2834 + SH_PFC_PIN_GROUP(msiof3_rsck), 2835 + SH_PFC_PIN_GROUP(msiof3_tsck), 2836 + SH_PFC_PIN_GROUP(msiof3_rsync), 2837 + SH_PFC_PIN_GROUP(msiof3_tsync), 2838 + SH_PFC_PIN_GROUP(msiof3_ss1), 2839 + SH_PFC_PIN_GROUP(msiof3_ss2), 2840 + SH_PFC_PIN_GROUP(msiof3_rxd), 2841 + SH_PFC_PIN_GROUP(msiof3_txd), 2842 + SH_PFC_PIN_GROUP(msiof3_flow), 3199 2843 SH_PFC_PIN_GROUP(scifa0_data), 3200 2844 SH_PFC_PIN_GROUP(scifa0_clk), 3201 2845 SH_PFC_PIN_GROUP(scifa0_ctrl), ··· 3454 2982 "mmc0_ctrl_1", 3455 2983 }; 3456 2984 2985 + static const char * const msiof0_groups[] = { 2986 + "msiof0_rsck", 2987 + "msiof0_tsck", 2988 + "msiof0_rsync", 2989 + "msiof0_tsync", 2990 + "msiof0_ss1", 2991 + "msiof0_ss2", 2992 + "msiof0_rxd", 2993 + "msiof0_txd", 2994 + "msiof0_mck0", 2995 + "msiof0_mck1", 2996 + "msiof0l_rsck", 2997 + "msiof0l_tsck", 2998 + "msiof0l_rsync", 2999 + "msiof0l_tsync", 3000 + "msiof0l_ss1_a", 3001 + "msiof0l_ss1_b", 3002 + "msiof0l_ss2_a", 3003 + "msiof0l_ss2_b", 3004 + "msiof0l_rxd", 3005 + "msiof0l_txd", 3006 + "msiof0l_mck0", 3007 + "msiof0l_mck1", 3008 + }; 3009 + 3010 + static const char * const msiof1_groups[] = { 3011 + "msiof1_rsck", 3012 + "msiof1_tsck", 3013 + "msiof1_rsync", 3014 + "msiof1_tsync", 3015 + "msiof1_ss1", 3016 + "msiof1_ss2", 3017 + "msiof1_rxd", 3018 + "msiof1_txd", 3019 + "msiof1_mck0", 3020 + "msiof1_mck1", 3021 + }; 3022 + 3023 + static const char * const msiof2_groups[] = { 3024 + "msiof2_rsck", 3025 + "msiof2_tsck", 3026 + "msiof2_rsync", 3027 + "msiof2_tsync", 3028 + "msiof2_ss1_a", 3029 + "msiof2_ss1_b", 3030 + "msiof2_ss2_a", 3031 + "msiof2_ss2_b", 3032 + "msiof2_rxd_a", 3033 + "msiof2_rxd_b", 3034 + "msiof2_txd", 3035 + "msiof2_mck0", 3036 + "msiof2_mck1", 3037 + "msiof2r_tsck", 3038 + "msiof2r_tsync", 3039 + "msiof2r_rxd", 3040 + "msiof2r_txd", 3041 + }; 3042 + 3043 + static const char * const msiof3_groups[] = { 3044 + "msiof3_rsck", 3045 + "msiof3_tsck", 3046 + "msiof3_rsync", 3047 + "msiof3_tsync", 3048 + "msiof3_ss1", 3049 + "msiof3_ss2", 3050 + "msiof3_rxd", 3051 + "msiof3_txd", 3052 + "msiof3_flow", 3053 + }; 3054 + 3457 3055 static const char * const scifa0_groups[] = { 3458 3056 "scifa0_data", 3459 3057 "scifa0_clk", ··· 3658 3116 SH_PFC_FUNCTION(lcd), 3659 3117 SH_PFC_FUNCTION(lcd2), 3660 3118 SH_PFC_FUNCTION(mmc0), 3119 + SH_PFC_FUNCTION(msiof0), 3120 + SH_PFC_FUNCTION(msiof1), 3121 + SH_PFC_FUNCTION(msiof2), 3122 + SH_PFC_FUNCTION(msiof3), 3661 3123 SH_PFC_FUNCTION(scifa0), 3662 3124 SH_PFC_FUNCTION(scifa1), 3663 3125 SH_PFC_FUNCTION(scifa2),
+12 -17
drivers/pinctrl/sh-pfc/pfc-sh7734.c
··· 14 14 15 15 #include "sh_pfc.h" 16 16 17 - #define PORT_GP_12(bank, fn, sfx) \ 18 - PORT_GP_1(bank, 0, fn, sfx), PORT_GP_1(bank, 1, fn, sfx), \ 19 - PORT_GP_1(bank, 2, fn, sfx), PORT_GP_1(bank, 3, fn, sfx), \ 20 - PORT_GP_1(bank, 4, fn, sfx), PORT_GP_1(bank, 5, fn, sfx), \ 21 - PORT_GP_1(bank, 6, fn, sfx), PORT_GP_1(bank, 7, fn, sfx), \ 22 - PORT_GP_1(bank, 8, fn, sfx), PORT_GP_1(bank, 9, fn, sfx), \ 23 - PORT_GP_1(bank, 10, fn, sfx), PORT_GP_1(bank, 11, fn, sfx) 24 - 25 17 #define CPU_ALL_PORT(fn, sfx) \ 26 18 PORT_GP_32(0, fn, sfx), \ 27 19 PORT_GP_32(1, fn, sfx), \ ··· 577 585 static const u16 pinmux_data[] = { 578 586 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */ 579 587 580 - PINMUX_DATA(CLKOUT_MARK, FN_CLKOUT), 581 - PINMUX_DATA(BS_MARK, FN_BS), PINMUX_DATA(CS0_MARK, FN_CS0), 582 - PINMUX_DATA(EX_CS0_MARK, FN_EX_CS0), 583 - PINMUX_DATA(RD_MARK, FN_RD), PINMUX_DATA(WE0_MARK, FN_WE0), 584 - PINMUX_DATA(WE1_MARK, FN_WE1), 585 - PINMUX_DATA(SCL0_MARK, FN_SCL0), PINMUX_DATA(PENC0_MARK, FN_PENC0), 586 - PINMUX_DATA(USB_OVC0_MARK, FN_USB_OVC0), 587 - PINMUX_DATA(IRQ2_B_MARK, FN_IRQ2_B), 588 - PINMUX_DATA(IRQ3_B_MARK, FN_IRQ3_B), 588 + PINMUX_SINGLE(CLKOUT), 589 + PINMUX_SINGLE(BS), 590 + PINMUX_SINGLE(CS0), 591 + PINMUX_SINGLE(EX_CS0), 592 + PINMUX_SINGLE(RD), 593 + PINMUX_SINGLE(WE0), 594 + PINMUX_SINGLE(WE1), 595 + PINMUX_SINGLE(SCL0), 596 + PINMUX_SINGLE(PENC0), 597 + PINMUX_SINGLE(USB_OVC0), 598 + PINMUX_SINGLE(IRQ2_B), 599 + PINMUX_SINGLE(IRQ3_B), 589 600 590 601 /* IPSR0 */ 591 602 PINMUX_IPSR_DATA(IP0_1_0, A0),
+3 -1
drivers/pinctrl/sh-pfc/pinctrl.c
··· 273 273 for_each_child_of_node(np, child) { 274 274 ret = sh_pfc_dt_subnode_to_map(pctldev, child, map, num_maps, 275 275 &index); 276 - if (ret < 0) 276 + if (ret < 0) { 277 + of_node_put(child); 277 278 goto done; 279 + } 278 280 } 279 281 280 282 /* If no mapping has been found in child nodes try the config node. */
+64 -10
drivers/pinctrl/sh-pfc/sh_pfc.h
··· 199 199 PINMUX_DATA(fn##_MARK, FN_##ms, FN_##ipsr, FN_##fn) 200 200 201 201 /* 202 + * Describe a pinmux configuration for a single-function pin with GPIO 203 + * capability. 204 + * - fn: Function name 205 + */ 206 + #define PINMUX_SINGLE(fn) \ 207 + PINMUX_DATA(fn##_MARK, FN_##fn) 208 + 209 + /* 202 210 * GP port style (32 ports banks) 203 211 */ 204 212 205 213 #define PORT_GP_CFG_1(bank, pin, fn, sfx, cfg) fn(bank, pin, GP_##bank##_##pin, sfx, cfg) 206 214 #define PORT_GP_1(bank, pin, fn, sfx) PORT_GP_CFG_1(bank, pin, fn, sfx, 0) 207 215 208 - #define PORT_GP_CFG_32(bank, fn, sfx, cfg) \ 216 + #define PORT_GP_CFG_4(bank, fn, sfx, cfg) \ 209 217 PORT_GP_CFG_1(bank, 0, fn, sfx, cfg), PORT_GP_CFG_1(bank, 1, fn, sfx, cfg), \ 210 - PORT_GP_CFG_1(bank, 2, fn, sfx, cfg), PORT_GP_CFG_1(bank, 3, fn, sfx, cfg), \ 218 + PORT_GP_CFG_1(bank, 2, fn, sfx, cfg), PORT_GP_CFG_1(bank, 3, fn, sfx, cfg) 219 + #define PORT_GP_4(bank, fn, sfx) PORT_GP_CFG_4(bank, fn, sfx, 0) 220 + 221 + #define PORT_GP_CFG_8(bank, fn, sfx, cfg) \ 222 + PORT_GP_CFG_4(bank, fn, sfx, cfg), \ 211 223 PORT_GP_CFG_1(bank, 4, fn, sfx, cfg), PORT_GP_CFG_1(bank, 5, fn, sfx, cfg), \ 212 - PORT_GP_CFG_1(bank, 6, fn, sfx, cfg), PORT_GP_CFG_1(bank, 7, fn, sfx, cfg), \ 224 + PORT_GP_CFG_1(bank, 6, fn, sfx, cfg), PORT_GP_CFG_1(bank, 7, fn, sfx, cfg) 225 + #define PORT_GP_8(bank, fn, sfx) PORT_GP_CFG_8(bank, fn, sfx, 0) 226 + 227 + #define PORT_GP_CFG_9(bank, fn, sfx, cfg) \ 228 + PORT_GP_CFG_8(bank, fn, sfx, cfg), \ 229 + PORT_GP_CFG_1(bank, 8, fn, sfx, cfg) 230 + #define PORT_GP_9(bank, fn, sfx) PORT_GP_CFG_9(bank, fn, sfx, 0) 231 + 232 + #define PORT_GP_CFG_12(bank, fn, sfx, cfg) \ 233 + PORT_GP_CFG_8(bank, fn, sfx, cfg), \ 213 234 PORT_GP_CFG_1(bank, 8, fn, sfx, cfg), PORT_GP_CFG_1(bank, 9, fn, sfx, cfg), \ 214 - PORT_GP_CFG_1(bank, 10, fn, sfx, cfg), PORT_GP_CFG_1(bank, 11, fn, sfx, cfg), \ 215 - PORT_GP_CFG_1(bank, 12, fn, sfx, cfg), PORT_GP_CFG_1(bank, 13, fn, sfx, cfg), \ 216 - PORT_GP_CFG_1(bank, 14, fn, sfx, cfg), PORT_GP_CFG_1(bank, 15, fn, sfx, cfg), \ 217 - PORT_GP_CFG_1(bank, 16, fn, sfx, cfg), PORT_GP_CFG_1(bank, 17, fn, sfx, cfg), \ 235 + PORT_GP_CFG_1(bank, 10, fn, sfx, cfg), PORT_GP_CFG_1(bank, 11, fn, sfx, cfg) 236 + #define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0) 237 + 238 + #define PORT_GP_CFG_14(bank, fn, sfx, cfg) \ 239 + PORT_GP_CFG_12(bank, fn, sfx, cfg), \ 240 + PORT_GP_CFG_1(bank, 12, fn, sfx, cfg), PORT_GP_CFG_1(bank, 13, fn, sfx, cfg) 241 + #define PORT_GP_14(bank, fn, sfx) PORT_GP_CFG_14(bank, fn, sfx, 0) 242 + 243 + #define PORT_GP_CFG_15(bank, fn, sfx, cfg) \ 244 + PORT_GP_CFG_14(bank, fn, sfx, cfg), \ 245 + PORT_GP_CFG_1(bank, 14, fn, sfx, cfg) 246 + #define PORT_GP_15(bank, fn, sfx) PORT_GP_CFG_15(bank, fn, sfx, 0) 247 + 248 + #define PORT_GP_CFG_16(bank, fn, sfx, cfg) \ 249 + PORT_GP_CFG_14(bank, fn, sfx, cfg), \ 250 + PORT_GP_CFG_1(bank, 14, fn, sfx, cfg), PORT_GP_CFG_1(bank, 15, fn, sfx, cfg) 251 + #define PORT_GP_16(bank, fn, sfx) PORT_GP_CFG_16(bank, fn, sfx, 0) 252 + 253 + #define PORT_GP_CFG_18(bank, fn, sfx, cfg) \ 254 + PORT_GP_CFG_16(bank, fn, sfx, cfg), \ 255 + PORT_GP_CFG_1(bank, 16, fn, sfx, cfg), PORT_GP_CFG_1(bank, 17, fn, sfx, cfg) 256 + #define PORT_GP_18(bank, fn, sfx) PORT_GP_CFG_18(bank, fn, sfx, 0) 257 + 258 + #define PORT_GP_CFG_26(bank, fn, sfx, cfg) \ 259 + PORT_GP_CFG_18(bank, fn, sfx, cfg), \ 218 260 PORT_GP_CFG_1(bank, 18, fn, sfx, cfg), PORT_GP_CFG_1(bank, 19, fn, sfx, cfg), \ 219 261 PORT_GP_CFG_1(bank, 20, fn, sfx, cfg), PORT_GP_CFG_1(bank, 21, fn, sfx, cfg), \ 220 262 PORT_GP_CFG_1(bank, 22, fn, sfx, cfg), PORT_GP_CFG_1(bank, 23, fn, sfx, cfg), \ 221 - PORT_GP_CFG_1(bank, 24, fn, sfx, cfg), PORT_GP_CFG_1(bank, 25, fn, sfx, cfg), \ 222 - PORT_GP_CFG_1(bank, 26, fn, sfx, cfg), PORT_GP_CFG_1(bank, 27, fn, sfx, cfg), \ 223 - PORT_GP_CFG_1(bank, 28, fn, sfx, cfg), PORT_GP_CFG_1(bank, 29, fn, sfx, cfg), \ 263 + PORT_GP_CFG_1(bank, 24, fn, sfx, cfg), PORT_GP_CFG_1(bank, 25, fn, sfx, cfg) 264 + #define PORT_GP_26(bank, fn, sfx) PORT_GP_CFG_26(bank, fn, sfx, 0) 265 + 266 + #define PORT_GP_CFG_28(bank, fn, sfx, cfg) \ 267 + PORT_GP_CFG_26(bank, fn, sfx, cfg), \ 268 + PORT_GP_CFG_1(bank, 26, fn, sfx, cfg), PORT_GP_CFG_1(bank, 27, fn, sfx, cfg) 269 + #define PORT_GP_28(bank, fn, sfx) PORT_GP_CFG_28(bank, fn, sfx, 0) 270 + 271 + #define PORT_GP_CFG_30(bank, fn, sfx, cfg) \ 272 + PORT_GP_CFG_28(bank, fn, sfx, cfg), \ 273 + PORT_GP_CFG_1(bank, 28, fn, sfx, cfg), PORT_GP_CFG_1(bank, 29, fn, sfx, cfg) 274 + #define PORT_GP_30(bank, fn, sfx) PORT_GP_CFG_30(bank, fn, sfx, 0) 275 + 276 + #define PORT_GP_CFG_32(bank, fn, sfx, cfg) \ 277 + PORT_GP_CFG_30(bank, fn, sfx, cfg), \ 224 278 PORT_GP_CFG_1(bank, 30, fn, sfx, cfg), PORT_GP_CFG_1(bank, 31, fn, sfx, cfg) 225 279 #define PORT_GP_32(bank, fn, sfx) PORT_GP_CFG_32(bank, fn, sfx, 0) 226 280
+88 -46
drivers/pinctrl/sirf/pinctrl-atlas7.c
··· 161 161 #define IN_DISABLE_VAL_1_REG_SET 0x0A88 162 162 #define IN_DISABLE_VAL_1_REG_CLR 0x0A8C 163 163 164 + /* Offset of the SDIO9SEL*/ 165 + #define SYS2PCI_SDIO9SEL 0x14 166 + 164 167 struct dt_params { 165 168 const char *property; 166 169 int value; ··· 373 370 struct pinctrl_desc pctl_desc; 374 371 struct atlas7_pinctrl_data *pctl_data; 375 372 void __iomem *regs[ATLAS7_PINCTRL_REG_BANKS]; 373 + void __iomem *sys2pci_base; 376 374 u32 status_ds[NUM_OF_IN_DISABLE_REG]; 377 375 u32 status_dsv[NUM_OF_IN_DISABLE_REG]; 378 376 struct atlas7_pad_status sleep_data[ATLAS7_PINCTRL_TOTAL_PINS]; ··· 889 885 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, 55, }; 890 886 static const unsigned int lvds_analog_pins[] = { 149, 150, 151, 152, 153, 154, 891 887 155, 156, 157, 158, }; 892 - static const unsigned int nd_df_pins[] = { 44, 43, 42, 41, 40, 39, 38, 37, 893 - 47, 46, 52, 51, 45, 49, 50, 48, 124, }; 894 - static const unsigned int nd_df_nowp_pins[] = { 44, 43, 42, 41, 40, 39, 38, 895 - 37, 47, 46, 52, 51, 45, 49, 50, 48, }; 888 + static const unsigned int nd_df_basic_pins[] = { 44, 43, 42, 41, 40, 39, 38, 889 + 37, 47, 46, 52, 45, 49, 50, 48, }; 890 + static const unsigned int nd_df_wp_pins[] = { 124, }; 891 + static const unsigned int nd_df_cs_pins[] = { 51, }; 896 892 static const unsigned int ps_pins[] = { 120, 119, 121, }; 893 + static const unsigned int ps_no_dir_pins[] = { 119, }; 897 894 static const unsigned int pwc_core_on_pins[] = { 8, }; 898 895 static const unsigned int pwc_ext_on_pins[] = { 6, }; 899 896 static const unsigned int pwc_gpio3_clk_pins[] = { 3, }; ··· 949 944 static const unsigned int sd2_cdb_pins1[] = { 161, }; 950 945 static const unsigned int sd2_wpb_pins0[] = { 123, }; 951 946 static const unsigned int sd2_wpb_pins1[] = { 163, }; 952 - static const unsigned int sd3_pins[] = { 85, 86, 87, 88, 89, 90, }; 947 + static const unsigned int sd3_9_pins[] = { 85, 86, 87, 88, 89, 90, }; 953 948 static const unsigned int sd5_pins[] = { 91, 92, 93, 94, 95, 96, }; 954 949 static const unsigned int sd6_pins0[] = { 79, 78, 74, 75, 76, 77, }; 955 950 static const unsigned int sd6_pins1[] = { 101, 99, 100, 110, 109, 111, }; ··· 1003 998 81, 82, 83, 84, 108, 103, 104, 105, 106, 107, 102, 97, 98, 1004 999 99, 100, }; 1005 1000 static const unsigned int vi_vip1_low8bit_pins[] = { 74, 75, 76, 77, 78, 79, 1006 - 80, 81, }; 1007 - static const unsigned int vi_vip1_high8bit_pins[] = { 82, 83, 84, 108, 103, 1008 - 104, 105, 106, }; 1001 + 80, 81, 82, 83, 84, }; 1002 + static const unsigned int vi_vip1_high8bit_pins[] = { 82, 83, 84, 103, 104, 1003 + 105, 106, 107, 102, 97, 98, }; 1009 1004 1010 1005 /* definition of pin group table */ 1011 1006 struct atlas7_pin_group altas7_pin_groups[] = { ··· 1147 1142 GROUP("ld_ldd_lck_grp", ld_ldd_lck_pins), 1148 1143 GROUP("lr_lcdrom_grp", lr_lcdrom_pins), 1149 1144 GROUP("lvds_analog_grp", lvds_analog_pins), 1150 - GROUP("nd_df_grp", nd_df_pins), 1151 - GROUP("nd_df_nowp_grp", nd_df_nowp_pins), 1145 + GROUP("nd_df_basic_grp", nd_df_basic_pins), 1146 + GROUP("nd_df_wp_grp", nd_df_wp_pins), 1147 + GROUP("nd_df_cs_grp", nd_df_cs_pins), 1152 1148 GROUP("ps_grp", ps_pins), 1149 + GROUP("ps_no_dir_grp", ps_no_dir_pins), 1153 1150 GROUP("pwc_core_on_grp", pwc_core_on_pins), 1154 1151 GROUP("pwc_ext_on_grp", pwc_ext_on_pins), 1155 1152 GROUP("pwc_gpio3_clk_grp", pwc_gpio3_clk_pins), ··· 1203 1196 GROUP("sd2_cdb_grp1", sd2_cdb_pins1), 1204 1197 GROUP("sd2_wpb_grp0", sd2_wpb_pins0), 1205 1198 GROUP("sd2_wpb_grp1", sd2_wpb_pins1), 1206 - GROUP("sd3_grp", sd3_pins), 1199 + GROUP("sd3_9_grp", sd3_9_pins), 1207 1200 GROUP("sd5_grp", sd5_pins), 1208 1201 GROUP("sd6_grp0", sd6_pins0), 1209 1202 GROUP("sd6_grp1", sd6_pins1), ··· 1428 1421 static const char * const ld_ldd_lck_grp[] = { "ld_ldd_lck_grp", }; 1429 1422 static const char * const lr_lcdrom_grp[] = { "lr_lcdrom_grp", }; 1430 1423 static const char * const lvds_analog_grp[] = { "lvds_analog_grp", }; 1431 - static const char * const nd_df_grp[] = { "nd_df_grp", }; 1432 - static const char * const nd_df_nowp_grp[] = { "nd_df_nowp_grp", }; 1424 + static const char * const nd_df_basic_grp[] = { "nd_df_basic_grp", }; 1425 + static const char * const nd_df_wp_grp[] = { "nd_df_wp_grp", }; 1426 + static const char * const nd_df_cs_grp[] = { "nd_df_cs_grp", }; 1433 1427 static const char * const ps_grp[] = { "ps_grp", }; 1428 + static const char * const ps_no_dir_grp[] = { "ps_no_dir_grp", }; 1434 1429 static const char * const pwc_core_on_grp[] = { "pwc_core_on_grp", }; 1435 1430 static const char * const pwc_ext_on_grp[] = { "pwc_ext_on_grp", }; 1436 1431 static const char * const pwc_gpio3_clk_grp[] = { "pwc_gpio3_clk_grp", }; ··· 1487 1478 static const char * const sd2_cdb_grp1[] = { "sd2_cdb_grp1", }; 1488 1479 static const char * const sd2_wpb_grp0[] = { "sd2_wpb_grp0", }; 1489 1480 static const char * const sd2_wpb_grp1[] = { "sd2_wpb_grp1", }; 1490 - static const char * const sd3_grp[] = { "sd3_grp", }; 1481 + static const char * const sd3_9_grp[] = { "sd3_9_grp", }; 1491 1482 static const char * const sd5_grp[] = { "sd5_grp", }; 1492 1483 static const char * const sd6_grp0[] = { "sd6_grp0", }; 1493 1484 static const char * const sd6_grp1[] = { "sd6_grp1", }; ··· 3183 3174 .pad_mux_list = lvds_analog_grp_pad_mux, 3184 3175 }; 3185 3176 3186 - static struct atlas7_pad_mux nd_df_grp_pad_mux[] = { 3177 + static struct atlas7_pad_mux nd_df_basic_grp_pad_mux[] = { 3187 3178 MUX(1, 44, 1, N, N, N, N), 3188 3179 MUX(1, 43, 1, N, N, N, N), 3189 3180 MUX(1, 42, 1, N, N, N, N), ··· 3195 3186 MUX(1, 47, 1, N, N, N, N), 3196 3187 MUX(1, 46, 1, N, N, N, N), 3197 3188 MUX(1, 52, 1, N, N, N, N), 3198 - MUX(1, 51, 1, N, N, N, N), 3199 3189 MUX(1, 45, 1, N, N, N, N), 3200 3190 MUX(1, 49, 1, N, N, N, N), 3201 3191 MUX(1, 50, 1, N, N, N, N), 3202 3192 MUX(1, 48, 1, N, N, N, N), 3193 + }; 3194 + 3195 + static struct atlas7_grp_mux nd_df_basic_grp_mux = { 3196 + .pad_mux_count = ARRAY_SIZE(nd_df_basic_grp_pad_mux), 3197 + .pad_mux_list = nd_df_basic_grp_pad_mux, 3198 + }; 3199 + 3200 + static struct atlas7_pad_mux nd_df_wp_grp_pad_mux[] = { 3203 3201 MUX(1, 124, 4, N, N, N, N), 3204 3202 }; 3205 3203 3206 - static struct atlas7_grp_mux nd_df_grp_mux = { 3207 - .pad_mux_count = ARRAY_SIZE(nd_df_grp_pad_mux), 3208 - .pad_mux_list = nd_df_grp_pad_mux, 3204 + static struct atlas7_grp_mux nd_df_wp_grp_mux = { 3205 + .pad_mux_count = ARRAY_SIZE(nd_df_wp_grp_pad_mux), 3206 + .pad_mux_list = nd_df_wp_grp_pad_mux, 3209 3207 }; 3210 3208 3211 - static struct atlas7_pad_mux nd_df_nowp_grp_pad_mux[] = { 3212 - MUX(1, 44, 1, N, N, N, N), 3213 - MUX(1, 43, 1, N, N, N, N), 3214 - MUX(1, 42, 1, N, N, N, N), 3215 - MUX(1, 41, 1, N, N, N, N), 3216 - MUX(1, 40, 1, N, N, N, N), 3217 - MUX(1, 39, 1, N, N, N, N), 3218 - MUX(1, 38, 1, N, N, N, N), 3219 - MUX(1, 37, 1, N, N, N, N), 3220 - MUX(1, 47, 1, N, N, N, N), 3221 - MUX(1, 46, 1, N, N, N, N), 3222 - MUX(1, 52, 1, N, N, N, N), 3209 + static struct atlas7_pad_mux nd_df_cs_grp_pad_mux[] = { 3223 3210 MUX(1, 51, 1, N, N, N, N), 3224 - MUX(1, 45, 1, N, N, N, N), 3225 - MUX(1, 49, 1, N, N, N, N), 3226 - MUX(1, 50, 1, N, N, N, N), 3227 - MUX(1, 48, 1, N, N, N, N), 3228 3211 }; 3229 3212 3230 - static struct atlas7_grp_mux nd_df_nowp_grp_mux = { 3231 - .pad_mux_count = ARRAY_SIZE(nd_df_nowp_grp_pad_mux), 3232 - .pad_mux_list = nd_df_nowp_grp_pad_mux, 3213 + static struct atlas7_grp_mux nd_df_cs_grp_mux = { 3214 + .pad_mux_count = ARRAY_SIZE(nd_df_cs_grp_pad_mux), 3215 + .pad_mux_list = nd_df_cs_grp_pad_mux, 3233 3216 }; 3234 3217 3235 3218 static struct atlas7_pad_mux ps_grp_pad_mux[] = { ··· 3233 3232 static struct atlas7_grp_mux ps_grp_mux = { 3234 3233 .pad_mux_count = ARRAY_SIZE(ps_grp_pad_mux), 3235 3234 .pad_mux_list = ps_grp_pad_mux, 3235 + }; 3236 + 3237 + static struct atlas7_pad_mux ps_no_dir_grp_pad_mux[] = { 3238 + MUX(1, 119, 2, N, N, N, N), 3239 + }; 3240 + 3241 + static struct atlas7_grp_mux ps_no_dir_grp_mux = { 3242 + .pad_mux_count = ARRAY_SIZE(ps_no_dir_grp_pad_mux), 3243 + .pad_mux_list = ps_no_dir_grp_pad_mux, 3236 3244 }; 3237 3245 3238 3246 static struct atlas7_pad_mux pwc_core_on_grp_pad_mux[] = { ··· 3753 3743 .pad_mux_list = sd2_wpb_grp1_pad_mux, 3754 3744 }; 3755 3745 3756 - static struct atlas7_pad_mux sd3_grp_pad_mux[] = { 3746 + static struct atlas7_pad_mux sd3_9_grp_pad_mux[] = { 3757 3747 MUX(1, 85, 1, N, N, N, N), 3758 3748 MUX(1, 86, 1, N, N, N, N), 3759 3749 MUX(1, 87, 1, N, N, N, N), ··· 3762 3752 MUX(1, 90, 1, N, N, N, N), 3763 3753 }; 3764 3754 3765 - static struct atlas7_grp_mux sd3_grp_mux = { 3766 - .pad_mux_count = ARRAY_SIZE(sd3_grp_pad_mux), 3767 - .pad_mux_list = sd3_grp_pad_mux, 3755 + static struct atlas7_grp_mux sd3_9_grp_mux = { 3756 + .pad_mux_count = ARRAY_SIZE(sd3_9_grp_pad_mux), 3757 + .pad_mux_list = sd3_9_grp_pad_mux, 3768 3758 }; 3769 3759 3770 3760 static struct atlas7_pad_mux sd5_grp_pad_mux[] = { ··· 4306 4296 MUX(1, 79, 1, N, N, N, N), 4307 4297 MUX(1, 80, 1, N, N, N, N), 4308 4298 MUX(1, 81, 1, N, N, N, N), 4299 + MUX(1, 82, 1, N, N, N, N), 4300 + MUX(1, 83, 1, N, N, N, N), 4301 + MUX(1, 84, 1, N, N, N, N), 4309 4302 }; 4310 4303 4311 4304 static struct atlas7_grp_mux vi_vip1_low8bit_grp_mux = { ··· 4320 4307 MUX(1, 82, 1, N, N, N, N), 4321 4308 MUX(1, 83, 1, N, N, N, N), 4322 4309 MUX(1, 84, 1, N, N, N, N), 4323 - MUX(1, 108, 2, N, N, N, N), 4324 4310 MUX(1, 103, 2, N, N, N, N), 4325 4311 MUX(1, 104, 2, N, N, N, N), 4326 4312 MUX(1, 105, 2, N, N, N, N), 4327 4313 MUX(1, 106, 2, N, N, N, N), 4314 + MUX(1, 107, 2, N, N, N, N), 4315 + MUX(1, 102, 2, N, N, N, N), 4316 + MUX(1, 97, 2, N, N, N, N), 4317 + MUX(1, 98, 2, N, N, N, N), 4328 4318 }; 4329 4319 4330 4320 static struct atlas7_grp_mux vi_vip1_high8bit_grp_mux = { ··· 4614 4598 FUNCTION("ld_ldd_lck", ld_ldd_lck_grp, &ld_ldd_lck_grp_mux), 4615 4599 FUNCTION("lr_lcdrom", lr_lcdrom_grp, &lr_lcdrom_grp_mux), 4616 4600 FUNCTION("lvds_analog", lvds_analog_grp, &lvds_analog_grp_mux), 4617 - FUNCTION("nd_df", nd_df_grp, &nd_df_grp_mux), 4618 - FUNCTION("nd_df_nowp", nd_df_nowp_grp, &nd_df_nowp_grp_mux), 4601 + FUNCTION("nd_df_basic", nd_df_basic_grp, &nd_df_basic_grp_mux), 4602 + FUNCTION("nd_df_wp", nd_df_wp_grp, &nd_df_wp_grp_mux), 4603 + FUNCTION("nd_df_cs", nd_df_cs_grp, &nd_df_cs_grp_mux), 4619 4604 FUNCTION("ps", ps_grp, &ps_grp_mux), 4605 + FUNCTION("ps_no_dir", ps_no_dir_grp, &ps_no_dir_grp_mux), 4620 4606 FUNCTION("pwc_core_on", pwc_core_on_grp, &pwc_core_on_grp_mux), 4621 4607 FUNCTION("pwc_ext_on", pwc_ext_on_grp, &pwc_ext_on_grp_mux), 4622 4608 FUNCTION("pwc_gpio3_clk", pwc_gpio3_clk_grp, &pwc_gpio3_clk_grp_mux), ··· 4704 4686 FUNCTION("sd2_cdb_m1", sd2_cdb_grp1, &sd2_cdb_grp1_mux), 4705 4687 FUNCTION("sd2_wpb_m0", sd2_wpb_grp0, &sd2_wpb_grp0_mux), 4706 4688 FUNCTION("sd2_wpb_m1", sd2_wpb_grp1, &sd2_wpb_grp1_mux), 4707 - FUNCTION("sd3", sd3_grp, &sd3_grp_mux), 4689 + FUNCTION("sd3", sd3_9_grp, &sd3_9_grp_mux), 4708 4690 FUNCTION("sd5", sd5_grp, &sd5_grp_mux), 4709 4691 FUNCTION("sd6_m0", sd6_grp0, &sd6_grp0_mux), 4710 4692 FUNCTION("sd6_m1", sd6_grp1, &sd6_grp1_mux), 4693 + FUNCTION("sd9", sd3_9_grp, &sd3_9_grp_mux), 4711 4694 FUNCTION("sp0_ext_ldo_on", 4712 4695 sp0_ext_ldo_on_grp, 4713 4696 &sp0_ext_ldo_on_grp_mux), ··· 5116 5097 pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### START >>>\n", 5117 5098 pmx_func->name, pin_grp->name); 5118 5099 5100 + /* the sd3 and sd9 pin select by SYS2PCI_SDIO9SEL register */ 5101 + if (pin_grp->pins == (unsigned int *)&sd3_9_pins) { 5102 + if (!strcmp(pmx_func->name, "sd9")) 5103 + writel(1, pmx->sys2pci_base + SYS2PCI_SDIO9SEL); 5104 + else 5105 + writel(0, pmx->sys2pci_base + SYS2PCI_SDIO9SEL); 5106 + } 5107 + 5119 5108 grp_mux = pmx_func->grpmux; 5120 5109 5121 5110 for (idx = 0; idx < grp_mux->pad_mux_count; idx++) { ··· 5412 5385 struct atlas7_pmx *pmx; 5413 5386 struct device_node *np = pdev->dev.of_node; 5414 5387 u32 banks = ATLAS7_PINCTRL_REG_BANKS; 5388 + struct device_node *sys2pci_np; 5389 + struct resource res; 5415 5390 5416 5391 /* Create state holders etc for this driver */ 5417 5392 pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL); 5418 5393 if (!pmx) 5394 + return -ENOMEM; 5395 + 5396 + /* The sd3 and sd9 shared all pins, and the function select by 5397 + * SYS2PCI_SDIO9SEL register 5398 + */ 5399 + sys2pci_np = of_find_node_by_name(NULL, "sys2pci"); 5400 + if (!sys2pci_np) 5401 + return -EINVAL; 5402 + ret = of_address_to_resource(sys2pci_np, 0, &res); 5403 + if (ret) 5404 + return ret; 5405 + pmx->sys2pci_base = devm_ioremap_resource(&pdev->dev, &res); 5406 + if (IS_ERR(pmx->sys2pci_base)) 5419 5407 return -ENOMEM; 5420 5408 5421 5409 pmx->dev = &pdev->dev;
+6 -2
drivers/pinctrl/sirf/pinctrl-sirf.c
··· 85 85 /* calculate number of maps required */ 86 86 for_each_child_of_node(np_config, np) { 87 87 ret = of_property_read_string(np, "sirf,function", &function); 88 - if (ret < 0) 88 + if (ret < 0) { 89 + of_node_put(np); 89 90 return ret; 91 + } 90 92 91 93 ret = of_property_count_strings(np, "sirf,pins"); 92 - if (ret < 0) 94 + if (ret < 0) { 95 + of_node_put(np); 93 96 return ret; 97 + } 94 98 95 99 count += ret; 96 100 }
+1 -1
drivers/pinctrl/spear/Makefile
··· 1 1 # SPEAr pinmux support 2 2 3 3 obj-$(CONFIG_PINCTRL_SPEAR_PLGPIO) += pinctrl-plgpio.o 4 - obj-$(CONFIG_PINCTRL_SPEAR) += pinctrl-spear.o 4 + obj-y += pinctrl-spear.o 5 5 obj-$(CONFIG_PINCTRL_SPEAR3XX) += pinctrl-spear3xx.o 6 6 obj-$(CONFIG_PINCTRL_SPEAR300) += pinctrl-spear300.o 7 7 obj-$(CONFIG_PINCTRL_SPEAR310) += pinctrl-spear310.o
+9
drivers/pinctrl/sunxi/Kconfig
··· 51 51 depends on RESET_CONTROLLER 52 52 select PINCTRL_SUNXI_COMMON 53 53 54 + config PINCTRL_SUN8I_H3 55 + def_bool MACH_SUN8I 56 + select PINCTRL_SUNXI_COMMON 57 + 54 58 config PINCTRL_SUN9I_A80 55 59 def_bool MACH_SUN9I 60 + select PINCTRL_SUNXI_COMMON 61 + 62 + config PINCTRL_SUN9I_A80_R 63 + def_bool MACH_SUN9I 64 + depends on RESET_CONTROLLER 56 65 select PINCTRL_SUNXI_COMMON 57 66 58 67 endif
+2
drivers/pinctrl/sunxi/Makefile
··· 13 13 obj-$(CONFIG_PINCTRL_SUN8I_A23_R) += pinctrl-sun8i-a23-r.o 14 14 obj-$(CONFIG_PINCTRL_SUN8I_A33) += pinctrl-sun8i-a33.o 15 15 obj-$(CONFIG_PINCTRL_SUN8I_A83T) += pinctrl-sun8i-a83t.o 16 + obj-$(CONFIG_PINCTRL_SUN8I_H3) += pinctrl-sun8i-h3.o 16 17 obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o 18 + obj-$(CONFIG_PINCTRL_SUN9I_A80_R) += pinctrl-sun9i-a80-r.o
+515
drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c
··· 1 + /* 2 + * Allwinner H3 SoCs pinctrl driver. 3 + * 4 + * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com> 5 + * 6 + * Based on pinctrl-sun8i-a23.c, which is: 7 + * Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org> 8 + * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com> 9 + * 10 + * This file is licensed under the terms of the GNU General Public 11 + * License version 2. This program is licensed "as is" without any 12 + * warranty of any kind, whether express or implied. 13 + */ 14 + 15 + #include <linux/module.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/of.h> 18 + #include <linux/of_device.h> 19 + #include <linux/pinctrl/pinctrl.h> 20 + 21 + #include "pinctrl-sunxi.h" 22 + 23 + static const struct sunxi_desc_pin sun8i_h3_pins[] = { 24 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0), 25 + SUNXI_FUNCTION(0x0, "gpio_in"), 26 + SUNXI_FUNCTION(0x1, "gpio_out"), 27 + SUNXI_FUNCTION(0x2, "uart2"), /* TX */ 28 + SUNXI_FUNCTION(0x3, "jtag"), /* MS */ 29 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */ 30 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1), 31 + SUNXI_FUNCTION(0x0, "gpio_in"), 32 + SUNXI_FUNCTION(0x1, "gpio_out"), 33 + SUNXI_FUNCTION(0x2, "uart2"), /* RX */ 34 + SUNXI_FUNCTION(0x3, "jtag"), /* CK */ 35 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */ 36 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2), 37 + SUNXI_FUNCTION(0x0, "gpio_in"), 38 + SUNXI_FUNCTION(0x1, "gpio_out"), 39 + SUNXI_FUNCTION(0x2, "uart2"), /* RTS */ 40 + SUNXI_FUNCTION(0x3, "jtag"), /* DO */ 41 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */ 42 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3), 43 + SUNXI_FUNCTION(0x0, "gpio_in"), 44 + SUNXI_FUNCTION(0x1, "gpio_out"), 45 + SUNXI_FUNCTION(0x2, "uart2"), /* CTS */ 46 + SUNXI_FUNCTION(0x3, "jtag"), /* DI */ 47 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */ 48 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4), 49 + SUNXI_FUNCTION(0x0, "gpio_in"), 50 + SUNXI_FUNCTION(0x1, "gpio_out"), 51 + SUNXI_FUNCTION(0x2, "uart0"), /* TX */ 52 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */ 53 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5), 54 + SUNXI_FUNCTION(0x0, "gpio_in"), 55 + SUNXI_FUNCTION(0x1, "gpio_out"), 56 + SUNXI_FUNCTION(0x2, "uart0"), /* RX */ 57 + SUNXI_FUNCTION(0x3, "pwm0"), 58 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */ 59 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6), 60 + SUNXI_FUNCTION(0x0, "gpio_in"), 61 + SUNXI_FUNCTION(0x1, "gpio_out"), 62 + SUNXI_FUNCTION(0x2, "sim"), /* PWREN */ 63 + SUNXI_FUNCTION(0x3, "pwm1"), 64 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */ 65 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7), 66 + SUNXI_FUNCTION(0x0, "gpio_in"), 67 + SUNXI_FUNCTION(0x1, "gpio_out"), 68 + SUNXI_FUNCTION(0x2, "sim"), /* CLK */ 69 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */ 70 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8), 71 + SUNXI_FUNCTION(0x0, "gpio_in"), 72 + SUNXI_FUNCTION(0x1, "gpio_out"), 73 + SUNXI_FUNCTION(0x2, "sim"), /* DATA */ 74 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */ 75 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9), 76 + SUNXI_FUNCTION(0x0, "gpio_in"), 77 + SUNXI_FUNCTION(0x1, "gpio_out"), 78 + SUNXI_FUNCTION(0x2, "sim"), /* RST */ 79 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */ 80 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10), 81 + SUNXI_FUNCTION(0x0, "gpio_in"), 82 + SUNXI_FUNCTION(0x1, "gpio_out"), 83 + SUNXI_FUNCTION(0x2, "sim"), /* DET */ 84 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */ 85 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11), 86 + SUNXI_FUNCTION(0x0, "gpio_in"), 87 + SUNXI_FUNCTION(0x1, "gpio_out"), 88 + SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */ 89 + SUNXI_FUNCTION(0x3, "di"), /* TX */ 90 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */ 91 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12), 92 + SUNXI_FUNCTION(0x0, "gpio_in"), 93 + SUNXI_FUNCTION(0x1, "gpio_out"), 94 + SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */ 95 + SUNXI_FUNCTION(0x3, "di"), /* RX */ 96 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */ 97 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13), 98 + SUNXI_FUNCTION(0x0, "gpio_in"), 99 + SUNXI_FUNCTION(0x1, "gpio_out"), 100 + SUNXI_FUNCTION(0x2, "spi1"), /* CS */ 101 + SUNXI_FUNCTION(0x3, "uart3"), /* TX */ 102 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */ 103 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14), 104 + SUNXI_FUNCTION(0x0, "gpio_in"), 105 + SUNXI_FUNCTION(0x1, "gpio_out"), 106 + SUNXI_FUNCTION(0x2, "spi1"), /* CLK */ 107 + SUNXI_FUNCTION(0x3, "uart3"), /* RX */ 108 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */ 109 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15), 110 + SUNXI_FUNCTION(0x0, "gpio_in"), 111 + SUNXI_FUNCTION(0x1, "gpio_out"), 112 + SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */ 113 + SUNXI_FUNCTION(0x3, "uart3"), /* RTS */ 114 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */ 115 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16), 116 + SUNXI_FUNCTION(0x0, "gpio_in"), 117 + SUNXI_FUNCTION(0x1, "gpio_out"), 118 + SUNXI_FUNCTION(0x2, "spi1"), /* MISO */ 119 + SUNXI_FUNCTION(0x3, "uart3"), /* CTS */ 120 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */ 121 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17), 122 + SUNXI_FUNCTION(0x0, "gpio_in"), 123 + SUNXI_FUNCTION(0x1, "gpio_out"), 124 + SUNXI_FUNCTION(0x2, "spdif"), /* OUT */ 125 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */ 126 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18), 127 + SUNXI_FUNCTION(0x0, "gpio_in"), 128 + SUNXI_FUNCTION(0x1, "gpio_out"), 129 + SUNXI_FUNCTION(0x2, "i2s0"), /* SYNC */ 130 + SUNXI_FUNCTION(0x3, "i2c1"), /* SCK */ 131 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */ 132 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19), 133 + SUNXI_FUNCTION(0x0, "gpio_in"), 134 + SUNXI_FUNCTION(0x1, "gpio_out"), 135 + SUNXI_FUNCTION(0x2, "i2s0"), /* CLK */ 136 + SUNXI_FUNCTION(0x3, "i2c1"), /* SDA */ 137 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */ 138 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20), 139 + SUNXI_FUNCTION(0x0, "gpio_in"), 140 + SUNXI_FUNCTION(0x1, "gpio_out"), 141 + SUNXI_FUNCTION(0x2, "i2s0"), /* DOUT */ 142 + SUNXI_FUNCTION(0x3, "sim"), /* VPPEN */ 143 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */ 144 + SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21), 145 + SUNXI_FUNCTION(0x0, "gpio_in"), 146 + SUNXI_FUNCTION(0x1, "gpio_out"), 147 + SUNXI_FUNCTION(0x2, "i2s0"), /* DIN */ 148 + SUNXI_FUNCTION(0x3, "sim"), /* VPPPP */ 149 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */ 150 + /* Hole */ 151 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0), 152 + SUNXI_FUNCTION(0x0, "gpio_in"), 153 + SUNXI_FUNCTION(0x1, "gpio_out"), 154 + SUNXI_FUNCTION(0x2, "nand0"), /* WE */ 155 + SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */ 156 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1), 157 + SUNXI_FUNCTION(0x0, "gpio_in"), 158 + SUNXI_FUNCTION(0x1, "gpio_out"), 159 + SUNXI_FUNCTION(0x2, "nand0"), /* ALE */ 160 + SUNXI_FUNCTION(0x3, "spi0")), /* MISO */ 161 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2), 162 + SUNXI_FUNCTION(0x0, "gpio_in"), 163 + SUNXI_FUNCTION(0x1, "gpio_out"), 164 + SUNXI_FUNCTION(0x2, "nand0"), /* CLE */ 165 + SUNXI_FUNCTION(0x3, "spi0")), /* CLK */ 166 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3), 167 + SUNXI_FUNCTION(0x0, "gpio_in"), 168 + SUNXI_FUNCTION(0x1, "gpio_out"), 169 + SUNXI_FUNCTION(0x2, "nand0"), /* CE1 */ 170 + SUNXI_FUNCTION(0x3, "spi0")), /* CS */ 171 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4), 172 + SUNXI_FUNCTION(0x0, "gpio_in"), 173 + SUNXI_FUNCTION(0x1, "gpio_out"), 174 + SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */ 175 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5), 176 + SUNXI_FUNCTION(0x0, "gpio_in"), 177 + SUNXI_FUNCTION(0x1, "gpio_out"), 178 + SUNXI_FUNCTION(0x2, "nand0"), /* RE */ 179 + SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */ 180 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6), 181 + SUNXI_FUNCTION(0x0, "gpio_in"), 182 + SUNXI_FUNCTION(0x1, "gpio_out"), 183 + SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */ 184 + SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */ 185 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7), 186 + SUNXI_FUNCTION(0x0, "gpio_in"), 187 + SUNXI_FUNCTION(0x1, "gpio_out"), 188 + SUNXI_FUNCTION(0x2, "nand0")), /* RB1 */ 189 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8), 190 + SUNXI_FUNCTION(0x0, "gpio_in"), 191 + SUNXI_FUNCTION(0x1, "gpio_out"), 192 + SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */ 193 + SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */ 194 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9), 195 + SUNXI_FUNCTION(0x0, "gpio_in"), 196 + SUNXI_FUNCTION(0x1, "gpio_out"), 197 + SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */ 198 + SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */ 199 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10), 200 + SUNXI_FUNCTION(0x0, "gpio_in"), 201 + SUNXI_FUNCTION(0x1, "gpio_out"), 202 + SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */ 203 + SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */ 204 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11), 205 + SUNXI_FUNCTION(0x0, "gpio_in"), 206 + SUNXI_FUNCTION(0x1, "gpio_out"), 207 + SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */ 208 + SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */ 209 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12), 210 + SUNXI_FUNCTION(0x0, "gpio_in"), 211 + SUNXI_FUNCTION(0x1, "gpio_out"), 212 + SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */ 213 + SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */ 214 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13), 215 + SUNXI_FUNCTION(0x0, "gpio_in"), 216 + SUNXI_FUNCTION(0x1, "gpio_out"), 217 + SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */ 218 + SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */ 219 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14), 220 + SUNXI_FUNCTION(0x0, "gpio_in"), 221 + SUNXI_FUNCTION(0x1, "gpio_out"), 222 + SUNXI_FUNCTION(0x2, "nand"), /* DQ6 */ 223 + SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */ 224 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15), 225 + SUNXI_FUNCTION(0x0, "gpio_in"), 226 + SUNXI_FUNCTION(0x1, "gpio_out"), 227 + SUNXI_FUNCTION(0x2, "nand"), /* DQ7 */ 228 + SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */ 229 + SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16), 230 + SUNXI_FUNCTION(0x0, "gpio_in"), 231 + SUNXI_FUNCTION(0x1, "gpio_out"), 232 + SUNXI_FUNCTION(0x2, "nand"), /* DQS */ 233 + SUNXI_FUNCTION(0x3, "mmc2")), /* RST */ 234 + /* Hole */ 235 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0), 236 + SUNXI_FUNCTION(0x0, "gpio_in"), 237 + SUNXI_FUNCTION(0x1, "gpio_out"), 238 + SUNXI_FUNCTION(0x2, "emac")), /* RXD3 */ 239 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1), 240 + SUNXI_FUNCTION(0x0, "gpio_in"), 241 + SUNXI_FUNCTION(0x1, "gpio_out"), 242 + SUNXI_FUNCTION(0x2, "emac")), /* RXD2 */ 243 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2), 244 + SUNXI_FUNCTION(0x0, "gpio_in"), 245 + SUNXI_FUNCTION(0x1, "gpio_out"), 246 + SUNXI_FUNCTION(0x2, "emac")), /* RXD1 */ 247 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3), 248 + SUNXI_FUNCTION(0x0, "gpio_in"), 249 + SUNXI_FUNCTION(0x1, "gpio_out"), 250 + SUNXI_FUNCTION(0x2, "emac")), /* RXD0 */ 251 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4), 252 + SUNXI_FUNCTION(0x0, "gpio_in"), 253 + SUNXI_FUNCTION(0x1, "gpio_out"), 254 + SUNXI_FUNCTION(0x2, "emac")), /* RXCK */ 255 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5), 256 + SUNXI_FUNCTION(0x0, "gpio_in"), 257 + SUNXI_FUNCTION(0x1, "gpio_out"), 258 + SUNXI_FUNCTION(0x2, "emac")), /* RXCTL/RXDV */ 259 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6), 260 + SUNXI_FUNCTION(0x0, "gpio_in"), 261 + SUNXI_FUNCTION(0x1, "gpio_out"), 262 + SUNXI_FUNCTION(0x2, "emac")), /* RXERR */ 263 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7), 264 + SUNXI_FUNCTION(0x0, "gpio_in"), 265 + SUNXI_FUNCTION(0x1, "gpio_out"), 266 + SUNXI_FUNCTION(0x2, "emac")), /* TXD3 */ 267 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8), 268 + SUNXI_FUNCTION(0x0, "gpio_in"), 269 + SUNXI_FUNCTION(0x1, "gpio_out"), 270 + SUNXI_FUNCTION(0x2, "emac")), /* TXD2 */ 271 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9), 272 + SUNXI_FUNCTION(0x0, "gpio_in"), 273 + SUNXI_FUNCTION(0x1, "gpio_out"), 274 + SUNXI_FUNCTION(0x2, "emac")), /* TXD1 */ 275 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10), 276 + SUNXI_FUNCTION(0x0, "gpio_in"), 277 + SUNXI_FUNCTION(0x1, "gpio_out"), 278 + SUNXI_FUNCTION(0x2, "emac")), /* TXD0 */ 279 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11), 280 + SUNXI_FUNCTION(0x0, "gpio_in"), 281 + SUNXI_FUNCTION(0x1, "gpio_out"), 282 + SUNXI_FUNCTION(0x2, "emac")), /* CRS */ 283 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12), 284 + SUNXI_FUNCTION(0x0, "gpio_in"), 285 + SUNXI_FUNCTION(0x1, "gpio_out"), 286 + SUNXI_FUNCTION(0x2, "emac")), /* TXCK */ 287 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13), 288 + SUNXI_FUNCTION(0x0, "gpio_in"), 289 + SUNXI_FUNCTION(0x1, "gpio_out"), 290 + SUNXI_FUNCTION(0x2, "emac")), /* TXCTL/TXEN */ 291 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14), 292 + SUNXI_FUNCTION(0x0, "gpio_in"), 293 + SUNXI_FUNCTION(0x1, "gpio_out"), 294 + SUNXI_FUNCTION(0x2, "emac")), /* TXERR */ 295 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15), 296 + SUNXI_FUNCTION(0x0, "gpio_in"), 297 + SUNXI_FUNCTION(0x1, "gpio_out"), 298 + SUNXI_FUNCTION(0x2, "emac")), /* CLKIN/COL */ 299 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16), 300 + SUNXI_FUNCTION(0x0, "gpio_in"), 301 + SUNXI_FUNCTION(0x1, "gpio_out"), 302 + SUNXI_FUNCTION(0x2, "emac")), /* MDC */ 303 + SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17), 304 + SUNXI_FUNCTION(0x0, "gpio_in"), 305 + SUNXI_FUNCTION(0x1, "gpio_out"), 306 + SUNXI_FUNCTION(0x2, "emac")), /* MDIO */ 307 + /* Hole */ 308 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0), 309 + SUNXI_FUNCTION(0x0, "gpio_in"), 310 + SUNXI_FUNCTION(0x1, "gpio_out"), 311 + SUNXI_FUNCTION(0x2, "csi"), /* PCLK */ 312 + SUNXI_FUNCTION(0x3, "ts")), /* CLK */ 313 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1), 314 + SUNXI_FUNCTION(0x0, "gpio_in"), 315 + SUNXI_FUNCTION(0x1, "gpio_out"), 316 + SUNXI_FUNCTION(0x2, "csi"), /* MCLK */ 317 + SUNXI_FUNCTION(0x3, "ts")), /* ERR */ 318 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2), 319 + SUNXI_FUNCTION(0x0, "gpio_in"), 320 + SUNXI_FUNCTION(0x1, "gpio_out"), 321 + SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */ 322 + SUNXI_FUNCTION(0x3, "ts")), /* SYNC */ 323 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3), 324 + SUNXI_FUNCTION(0x0, "gpio_in"), 325 + SUNXI_FUNCTION(0x1, "gpio_out"), 326 + SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */ 327 + SUNXI_FUNCTION(0x3, "ts")), /* DVLD */ 328 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4), 329 + SUNXI_FUNCTION(0x0, "gpio_in"), 330 + SUNXI_FUNCTION(0x1, "gpio_out"), 331 + SUNXI_FUNCTION(0x2, "csi"), /* D0 */ 332 + SUNXI_FUNCTION(0x3, "ts")), /* D0 */ 333 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5), 334 + SUNXI_FUNCTION(0x0, "gpio_in"), 335 + SUNXI_FUNCTION(0x1, "gpio_out"), 336 + SUNXI_FUNCTION(0x2, "csi"), /* D1 */ 337 + SUNXI_FUNCTION(0x3, "ts")), /* D1 */ 338 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6), 339 + SUNXI_FUNCTION(0x0, "gpio_in"), 340 + SUNXI_FUNCTION(0x1, "gpio_out"), 341 + SUNXI_FUNCTION(0x2, "csi"), /* D2 */ 342 + SUNXI_FUNCTION(0x3, "ts")), /* D2 */ 343 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7), 344 + SUNXI_FUNCTION(0x0, "gpio_in"), 345 + SUNXI_FUNCTION(0x1, "gpio_out"), 346 + SUNXI_FUNCTION(0x2, "csi"), /* D3 */ 347 + SUNXI_FUNCTION(0x3, "ts")), /* D3 */ 348 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8), 349 + SUNXI_FUNCTION(0x0, "gpio_in"), 350 + SUNXI_FUNCTION(0x1, "gpio_out"), 351 + SUNXI_FUNCTION(0x2, "csi"), /* D4 */ 352 + SUNXI_FUNCTION(0x3, "ts")), /* D4 */ 353 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9), 354 + SUNXI_FUNCTION(0x0, "gpio_in"), 355 + SUNXI_FUNCTION(0x1, "gpio_out"), 356 + SUNXI_FUNCTION(0x2, "csi"), /* D5 */ 357 + SUNXI_FUNCTION(0x3, "ts")), /* D5 */ 358 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10), 359 + SUNXI_FUNCTION(0x0, "gpio_in"), 360 + SUNXI_FUNCTION(0x1, "gpio_out"), 361 + SUNXI_FUNCTION(0x2, "csi"), /* D6 */ 362 + SUNXI_FUNCTION(0x3, "ts")), /* D6 */ 363 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11), 364 + SUNXI_FUNCTION(0x0, "gpio_in"), 365 + SUNXI_FUNCTION(0x1, "gpio_out"), 366 + SUNXI_FUNCTION(0x2, "csi"), /* D7 */ 367 + SUNXI_FUNCTION(0x3, "ts")), /* D7 */ 368 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12), 369 + SUNXI_FUNCTION(0x0, "gpio_in"), 370 + SUNXI_FUNCTION(0x1, "gpio_out"), 371 + SUNXI_FUNCTION(0x2, "csi"), /* SCK */ 372 + SUNXI_FUNCTION(0x3, "i2c2")), /* SCK */ 373 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13), 374 + SUNXI_FUNCTION(0x0, "gpio_in"), 375 + SUNXI_FUNCTION(0x1, "gpio_out"), 376 + SUNXI_FUNCTION(0x2, "csi"), /* SDA */ 377 + SUNXI_FUNCTION(0x3, "i2c2")), /* SDA */ 378 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14), 379 + SUNXI_FUNCTION(0x0, "gpio_in"), 380 + SUNXI_FUNCTION(0x1, "gpio_out")), 381 + SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15), 382 + SUNXI_FUNCTION(0x0, "gpio_in"), 383 + SUNXI_FUNCTION(0x1, "gpio_out")), 384 + /* Hole */ 385 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0), 386 + SUNXI_FUNCTION(0x0, "gpio_in"), 387 + SUNXI_FUNCTION(0x1, "gpio_out"), 388 + SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */ 389 + SUNXI_FUNCTION(0x3, "jtag")), /* MS */ 390 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1), 391 + SUNXI_FUNCTION(0x0, "gpio_in"), 392 + SUNXI_FUNCTION(0x1, "gpio_out"), 393 + SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */ 394 + SUNXI_FUNCTION(0x3, "jtag")), /* DI */ 395 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2), 396 + SUNXI_FUNCTION(0x0, "gpio_in"), 397 + SUNXI_FUNCTION(0x1, "gpio_out"), 398 + SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */ 399 + SUNXI_FUNCTION(0x3, "uart0")), /* TX */ 400 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3), 401 + SUNXI_FUNCTION(0x0, "gpio_in"), 402 + SUNXI_FUNCTION(0x1, "gpio_out"), 403 + SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */ 404 + SUNXI_FUNCTION(0x3, "jtag")), /* DO */ 405 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4), 406 + SUNXI_FUNCTION(0x0, "gpio_in"), 407 + SUNXI_FUNCTION(0x1, "gpio_out"), 408 + SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */ 409 + SUNXI_FUNCTION(0x3, "uart0")), /* RX */ 410 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5), 411 + SUNXI_FUNCTION(0x0, "gpio_in"), 412 + SUNXI_FUNCTION(0x1, "gpio_out"), 413 + SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */ 414 + SUNXI_FUNCTION(0x3, "jtag")), /* CK */ 415 + SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6), 416 + SUNXI_FUNCTION(0x0, "gpio_in"), 417 + SUNXI_FUNCTION(0x1, "gpio_out")), 418 + /* Hole */ 419 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0), 420 + SUNXI_FUNCTION(0x0, "gpio_in"), 421 + SUNXI_FUNCTION(0x1, "gpio_out"), 422 + SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */ 423 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PG_EINT0 */ 424 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1), 425 + SUNXI_FUNCTION(0x0, "gpio_in"), 426 + SUNXI_FUNCTION(0x1, "gpio_out"), 427 + SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */ 428 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PG_EINT1 */ 429 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2), 430 + SUNXI_FUNCTION(0x0, "gpio_in"), 431 + SUNXI_FUNCTION(0x1, "gpio_out"), 432 + SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */ 433 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PG_EINT2 */ 434 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3), 435 + SUNXI_FUNCTION(0x0, "gpio_in"), 436 + SUNXI_FUNCTION(0x1, "gpio_out"), 437 + SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */ 438 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PG_EINT3 */ 439 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4), 440 + SUNXI_FUNCTION(0x0, "gpio_in"), 441 + SUNXI_FUNCTION(0x1, "gpio_out"), 442 + SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */ 443 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PG_EINT4 */ 444 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5), 445 + SUNXI_FUNCTION(0x0, "gpio_in"), 446 + SUNXI_FUNCTION(0x1, "gpio_out"), 447 + SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */ 448 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PG_EINT5 */ 449 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6), 450 + SUNXI_FUNCTION(0x0, "gpio_in"), 451 + SUNXI_FUNCTION(0x1, "gpio_out"), 452 + SUNXI_FUNCTION(0x2, "uart1"), /* TX */ 453 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PG_EINT6 */ 454 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7), 455 + SUNXI_FUNCTION(0x0, "gpio_in"), 456 + SUNXI_FUNCTION(0x1, "gpio_out"), 457 + SUNXI_FUNCTION(0x2, "uart1"), /* RX */ 458 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)), /* PG_EINT7 */ 459 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8), 460 + SUNXI_FUNCTION(0x0, "gpio_in"), 461 + SUNXI_FUNCTION(0x1, "gpio_out"), 462 + SUNXI_FUNCTION(0x2, "uart1"), /* RTS */ 463 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)), /* PG_EINT8 */ 464 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9), 465 + SUNXI_FUNCTION(0x0, "gpio_in"), 466 + SUNXI_FUNCTION(0x1, "gpio_out"), 467 + SUNXI_FUNCTION(0x2, "uart1"), /* CTS */ 468 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)), /* PG_EINT9 */ 469 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), 470 + SUNXI_FUNCTION(0x0, "gpio_in"), 471 + SUNXI_FUNCTION(0x1, "gpio_out"), 472 + SUNXI_FUNCTION(0x2, "i2s1"), /* SYNC */ 473 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)), /* PG_EINT10 */ 474 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11), 475 + SUNXI_FUNCTION(0x0, "gpio_in"), 476 + SUNXI_FUNCTION(0x1, "gpio_out"), 477 + SUNXI_FUNCTION(0x2, "i2s1"), /* CLK */ 478 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)), /* PG_EINT11 */ 479 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12), 480 + SUNXI_FUNCTION(0x0, "gpio_in"), 481 + SUNXI_FUNCTION(0x1, "gpio_out"), 482 + SUNXI_FUNCTION(0x2, "i2s1"), /* DOUT */ 483 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)), /* PG_EINT12 */ 484 + SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13), 485 + SUNXI_FUNCTION(0x0, "gpio_in"), 486 + SUNXI_FUNCTION(0x1, "gpio_out"), 487 + SUNXI_FUNCTION(0x2, "i2s1"), /* DIN */ 488 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)), /* PG_EINT13 */ 489 + }; 490 + 491 + static const struct sunxi_pinctrl_desc sun8i_h3_pinctrl_data = { 492 + .pins = sun8i_h3_pins, 493 + .npins = ARRAY_SIZE(sun8i_h3_pins), 494 + .irq_banks = 2, 495 + }; 496 + 497 + static int sun8i_h3_pinctrl_probe(struct platform_device *pdev) 498 + { 499 + return sunxi_pinctrl_init(pdev, 500 + &sun8i_h3_pinctrl_data); 501 + } 502 + 503 + static const struct of_device_id sun8i_h3_pinctrl_match[] = { 504 + { .compatible = "allwinner,sun8i-h3-pinctrl", }, 505 + {} 506 + }; 507 + 508 + static struct platform_driver sun8i_h3_pinctrl_driver = { 509 + .probe = sun8i_h3_pinctrl_probe, 510 + .driver = { 511 + .name = "sun8i-h3-pinctrl", 512 + .of_match_table = sun8i_h3_pinctrl_match, 513 + }, 514 + }; 515 + builtin_platform_driver(sun8i_h3_pinctrl_driver);
+181
drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c
··· 1 + /* 2 + * Allwinner A80 SoCs special pins pinctrl driver. 3 + * 4 + * Copyright (C) 2014 Maxime Ripard 5 + * Maxime Ripard <maxime.ripard@free-electrons.com> 6 + * 7 + * This file is licensed under the terms of the GNU General Public 8 + * License version 2. This program is licensed "as is" without any 9 + * warranty of any kind, whether express or implied. 10 + */ 11 + 12 + #include <linux/module.h> 13 + #include <linux/platform_device.h> 14 + #include <linux/of.h> 15 + #include <linux/of_device.h> 16 + #include <linux/pinctrl/pinctrl.h> 17 + #include <linux/reset.h> 18 + 19 + #include "pinctrl-sunxi.h" 20 + 21 + static const struct sunxi_desc_pin sun9i_a80_r_pins[] = { 22 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0), 23 + SUNXI_FUNCTION(0x0, "gpio_in"), 24 + SUNXI_FUNCTION(0x1, "gpio_out"), 25 + SUNXI_FUNCTION(0x3, "s_uart"), /* TX */ 26 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PL_EINT0 */ 27 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1), 28 + SUNXI_FUNCTION(0x0, "gpio_in"), 29 + SUNXI_FUNCTION(0x1, "gpio_out"), 30 + SUNXI_FUNCTION(0x3, "s_uart"), /* RX */ 31 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PL_EINT1 */ 32 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2), 33 + SUNXI_FUNCTION(0x0, "gpio_in"), 34 + SUNXI_FUNCTION(0x1, "gpio_out"), 35 + SUNXI_FUNCTION(0x3, "s_jtag"), /* TMS */ 36 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PL_EINT2 */ 37 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 3), 38 + SUNXI_FUNCTION(0x0, "gpio_in"), 39 + SUNXI_FUNCTION(0x1, "gpio_out"), 40 + SUNXI_FUNCTION(0x3, "s_jtag"), /* TCK */ 41 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PL_EINT3 */ 42 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 4), 43 + SUNXI_FUNCTION(0x0, "gpio_in"), 44 + SUNXI_FUNCTION(0x1, "gpio_out"), 45 + SUNXI_FUNCTION(0x3, "s_jtag"), /* TDO */ 46 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PL_EINT4 */ 47 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 5), 48 + SUNXI_FUNCTION(0x0, "gpio_in"), 49 + SUNXI_FUNCTION(0x1, "gpio_out"), 50 + SUNXI_FUNCTION(0x3, "s_jtag"), /* TDI */ 51 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PL_EINT5 */ 52 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 6), 53 + SUNXI_FUNCTION(0x0, "gpio_in"), 54 + SUNXI_FUNCTION(0x1, "gpio_out"), 55 + SUNXI_FUNCTION(0x3, "s_cir_rx"), 56 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PL_EINT6 */ 57 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 7), 58 + SUNXI_FUNCTION(0x0, "gpio_in"), 59 + SUNXI_FUNCTION(0x1, "gpio_out"), 60 + SUNXI_FUNCTION(0x3, "1wire"), 61 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PL_EINT7 */ 62 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 8), 63 + SUNXI_FUNCTION(0x0, "gpio_in"), 64 + SUNXI_FUNCTION(0x1, "gpio_out"), 65 + SUNXI_FUNCTION(0x2, "s_ps2"), /* SCK1 */ 66 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PL_EINT8 */ 67 + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 9), 68 + SUNXI_FUNCTION(0x0, "gpio_in"), 69 + SUNXI_FUNCTION(0x1, "gpio_out"), 70 + SUNXI_FUNCTION(0x2, "s_ps2"), /* SDA1 */ 71 + SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PL_EINT9 */ 72 + 73 + /* Hole */ 74 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 0), 75 + SUNXI_FUNCTION(0x0, "gpio_in"), 76 + SUNXI_FUNCTION(0x1, "gpio_out"), 77 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PM_EINT0 */ 78 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 1), 79 + SUNXI_FUNCTION(0x0, "gpio_in"), 80 + SUNXI_FUNCTION(0x1, "gpio_out"), 81 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PM_EINT1 */ 82 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 2), 83 + SUNXI_FUNCTION(0x0, "gpio_in"), 84 + SUNXI_FUNCTION(0x1, "gpio_out"), 85 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PM_EINT2 */ 86 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 3), 87 + SUNXI_FUNCTION(0x0, "gpio_in"), 88 + SUNXI_FUNCTION(0x1, "gpio_out"), 89 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PM_EINT3 */ 90 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 4), 91 + SUNXI_FUNCTION(0x0, "gpio_in"), 92 + SUNXI_FUNCTION(0x1, "gpio_out"), 93 + SUNXI_FUNCTION(0x3, "s_i2s1"), /* LRCKR */ 94 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PM_EINT4 */ 95 + 96 + /* Hole */ 97 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 8), 98 + SUNXI_FUNCTION(0x0, "gpio_in"), 99 + SUNXI_FUNCTION(0x1, "gpio_out"), 100 + SUNXI_FUNCTION(0x3, "s_i2c1"), /* SCK */ 101 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)), /* PM_EINT8 */ 102 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 9), 103 + SUNXI_FUNCTION(0x0, "gpio_in"), 104 + SUNXI_FUNCTION(0x1, "gpio_out"), 105 + SUNXI_FUNCTION(0x3, "s_i2c1"), /* SDA */ 106 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)), /* PM_EINT9 */ 107 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 10), 108 + SUNXI_FUNCTION(0x0, "gpio_in"), 109 + SUNXI_FUNCTION(0x1, "gpio_out"), 110 + SUNXI_FUNCTION(0x2, "s_i2s0"), /* MCLK */ 111 + SUNXI_FUNCTION(0x3, "s_i2s1")), /* MCLK */ 112 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 11), 113 + SUNXI_FUNCTION(0x0, "gpio_in"), 114 + SUNXI_FUNCTION(0x1, "gpio_out"), 115 + SUNXI_FUNCTION(0x2, "s_i2s0"), /* BCLK */ 116 + SUNXI_FUNCTION(0x3, "s_i2s1")), /* BCLK */ 117 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 12), 118 + SUNXI_FUNCTION(0x0, "gpio_in"), 119 + SUNXI_FUNCTION(0x1, "gpio_out"), 120 + SUNXI_FUNCTION(0x2, "s_i2s0"), /* LRCK */ 121 + SUNXI_FUNCTION(0x3, "s_i2s1")), /* LRCK */ 122 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 13), 123 + SUNXI_FUNCTION(0x0, "gpio_in"), 124 + SUNXI_FUNCTION(0x1, "gpio_out"), 125 + SUNXI_FUNCTION(0x2, "s_i2s0"), /* DIN */ 126 + SUNXI_FUNCTION(0x3, "s_i2s1")), /* DIN */ 127 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 14), 128 + SUNXI_FUNCTION(0x0, "gpio_in"), 129 + SUNXI_FUNCTION(0x1, "gpio_out"), 130 + SUNXI_FUNCTION(0x2, "s_i2s0"), /* DOUT */ 131 + SUNXI_FUNCTION(0x3, "s_i2s1")), /* DOUT */ 132 + SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 15), 133 + SUNXI_FUNCTION(0x0, "gpio_in"), 134 + SUNXI_FUNCTION(0x1, "gpio_out"), 135 + SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)), /* PM_EINT15 */ 136 + 137 + /* Hole */ 138 + SUNXI_PIN(SUNXI_PINCTRL_PIN(N, 0), 139 + SUNXI_FUNCTION(0x0, "gpio_in"), 140 + SUNXI_FUNCTION(0x1, "gpio_out"), 141 + SUNXI_FUNCTION(0x2, "s_i2c0"), /* SCK */ 142 + SUNXI_FUNCTION(0x3, "s_rsb")), /* SCK */ 143 + SUNXI_PIN(SUNXI_PINCTRL_PIN(N, 1), 144 + SUNXI_FUNCTION(0x0, "gpio_in"), 145 + SUNXI_FUNCTION(0x1, "gpio_out"), 146 + SUNXI_FUNCTION(0x2, "s_i2c0"), /* SDA */ 147 + SUNXI_FUNCTION(0x3, "s_rsb")), /* SDA */ 148 + }; 149 + 150 + static const struct sunxi_pinctrl_desc sun9i_a80_r_pinctrl_data = { 151 + .pins = sun9i_a80_r_pins, 152 + .npins = ARRAY_SIZE(sun9i_a80_r_pins), 153 + .pin_base = PL_BASE, 154 + .irq_banks = 2, 155 + }; 156 + 157 + static int sun9i_a80_r_pinctrl_probe(struct platform_device *pdev) 158 + { 159 + return sunxi_pinctrl_init(pdev, 160 + &sun9i_a80_r_pinctrl_data); 161 + } 162 + 163 + static const struct of_device_id sun9i_a80_r_pinctrl_match[] = { 164 + { .compatible = "allwinner,sun9i-a80-r-pinctrl", }, 165 + {} 166 + }; 167 + MODULE_DEVICE_TABLE(of, sun9i_a80_r_pinctrl_match); 168 + 169 + static struct platform_driver sun9i_a80_r_pinctrl_driver = { 170 + .probe = sun9i_a80_r_pinctrl_probe, 171 + .driver = { 172 + .name = "sun9i-a80-r-pinctrl", 173 + .owner = THIS_MODULE, 174 + .of_match_table = sun9i_a80_r_pinctrl_match, 175 + }, 176 + }; 177 + module_platform_driver(sun9i_a80_r_pinctrl_driver); 178 + 179 + MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com"); 180 + MODULE_DESCRIPTION("Allwinner A80 R_PIO pinctrl driver"); 181 + MODULE_LICENSE("GPL");
+13 -10
drivers/pinctrl/uniphier/Kconfig
··· 1 - if ARCH_UNIPHIER 2 - 3 - config PINCTRL_UNIPHIER 4 - bool 1 + menuconfig PINCTRL_UNIPHIER 2 + bool "UniPhier SoC pinctrl drivers" 3 + depends on ARCH_UNIPHIER 4 + depends on OF && MFD_SYSCON 5 + default y 5 6 select PINMUX 6 7 select GENERIC_PINCONF 7 8 9 + if PINCTRL_UNIPHIER 10 + 8 11 config PINCTRL_UNIPHIER_PH1_LD4 9 12 tristate "UniPhier PH1-LD4 SoC pinctrl driver" 10 - select PINCTRL_UNIPHIER 13 + default y 11 14 12 15 config PINCTRL_UNIPHIER_PH1_PRO4 13 16 tristate "UniPhier PH1-Pro4 SoC pinctrl driver" 14 - select PINCTRL_UNIPHIER 17 + default y 15 18 16 19 config PINCTRL_UNIPHIER_PH1_SLD8 17 20 tristate "UniPhier PH1-sLD8 SoC pinctrl driver" 18 - select PINCTRL_UNIPHIER 21 + default y 19 22 20 23 config PINCTRL_UNIPHIER_PH1_PRO5 21 24 tristate "UniPhier PH1-Pro5 SoC pinctrl driver" 22 - select PINCTRL_UNIPHIER 25 + default y 23 26 24 27 config PINCTRL_UNIPHIER_PROXSTREAM2 25 28 tristate "UniPhier ProXstream2 SoC pinctrl driver" 26 - select PINCTRL_UNIPHIER 29 + default y 27 30 28 31 config PINCTRL_UNIPHIER_PH1_LD6B 29 32 tristate "UniPhier PH1-LD6b SoC pinctrl driver" 30 - select PINCTRL_UNIPHIER 33 + default y 31 34 32 35 endif
+1
include/linux/platform_device.h
··· 51 51 extern struct resource *platform_get_resource(struct platform_device *, 52 52 unsigned int, unsigned int); 53 53 extern int platform_get_irq(struct platform_device *, unsigned int); 54 + extern int platform_irq_count(struct platform_device *); 54 55 extern struct resource *platform_get_resource_byname(struct platform_device *, 55 56 unsigned int, 56 57 const char *);