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

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

Pull pin control updates from Linus Walleij:
"There is a lot going on!

Core changes:

- A semantic change to handle pinmux and pinconf in explicit order
while up until now we depended on the semantic order in the device
tree. The device tree is a functional programming language and does
not imply any order, so the right thing is for the pin control core
to provide these semantics.

- Add a new pinmux-select debugfs file which makes it possible to go
in and select functions for a pin manually (iteratively, at the
prompt) for debugging purposes.

- Fixes to gpio regmap handling for a new pin control driver making
use of regmap-gpio.

- Use octal permissions on debugfs files.

New drivers:

- A massive rewrite of the former custom pin control driver for MIPS
Broadcom devices to instead use the pin control subsystem. New pin
control drivers for BCM6345, BCM6328, BCM6358, BCM6362, BCM6368,
BCM63268 and BCM6318 SoC variants are implemented.

- Support for PM8350, PM8350B, PM8350C, PMK8350, PMR735A and PMR735B
in the Qualcomm PMIC GPIO driver. Also the two GPIOs on PM8008 are
supported.

- Support for the Rockchip RK3568/RK3566 pin controller.

- Support for Ingenic JZ4730, JZ4750, JZ4755, JZ4775 and X2000.

- Support for Mediatek MTK8195.

- Add a new Xilinx ZynqMP pin control driver.

Driver improvements and non-urgent fixes:

- Modularization and improvements of the Rockchip drivers.

- Some new pins added to the description of new Renesas SoCs.

- Clarifications of the GPIO base calculation in the Intel driver.

- Fix the function names for the MPP54 and MPP55 pins in the Armada
CP110 pin controller.

- GPIO wakeup interrupt map for Qualcomm SC7280 and SM8350.

- Support for ACPI probing of the Qualcomm SC8180x.

- Fix interrupt clear status on rockchip

- Fix some missing pins on the Ingenic JZ4770, some semantic fixes
for the behaviour of the Ingenic pin controller. Add DMIC pins for
JZ4780, X1000, X1500 and X1830.

- A slew of janitorial like of_node_put() calls"

* tag 'pinctrl-v5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (99 commits)
pinctrl: Add Xilinx ZynqMP pinctrl driver support
firmware: xilinx: Add pinctrl support
pinctrl: rockchip: do coding style for mux route struct
pinctrl: Add PIN_CONFIG_MODE_PWM to enum pin_config_param
pinctrl: Introduce MODE group in enum pin_config_param
pinctrl: Keep enum pin_config_param ordered by name
dt-bindings: pinctrl: Add binding for ZynqMP pinctrl driver
pinctrl: core: Fix kernel doc string for pin_get_name()
pinctrl: mediatek: use spin lock in mtk_rmw
pinctrl: add drive for I2C related pins on MT8195
pinctrl: add pinctrl driver on mt8195
dt-bindings: pinctrl: mt8195: add pinctrl file and binding document
pinctrl: Ingenic: Add pinctrl driver for X2000.
pinctrl: Ingenic: Add pinctrl driver for JZ4775.
pinctrl: Ingenic: Add pinctrl driver for JZ4755.
pinctrl: Ingenic: Add pinctrl driver for JZ4750.
pinctrl: Ingenic: Add pinctrl driver for JZ4730.
dt-bindings: pinctrl: Add bindings for new Ingenic SoCs.
pinctrl: Ingenic: Reformat the code.
pinctrl: Ingenic: Add DMIC pins support for Ingenic SoCs.
...

+13663 -1072
+2 -2
Documentation/devicetree/bindings/arm/marvell/cp110-system-controller.txt
··· 142 142 mpp51 51 gpio, ge1(rxd0), mss_i2c(sck), spi1(csn1), uart2(rxd), uart0(cts), sdio(pwr10) 143 143 mpp52 52 gpio, ge1(rxd1), synce1(clk), synce2(clk), spi1(csn2), uart1(cts), led(clk), pcie(rstoutn), pcie0(clkreq) 144 144 mpp53 53 gpio, ge1(rxd2), ptp(clk), spi1(csn3), uart1(rxd), led(stb), sdio(led) 145 - mpp54 54 gpio, ge1(rxd3), synce2(clk), ptp(pclk_out), synce1(clk), led(data), sdio(hw_rst), sdio(wr_protect) 146 - mpp55 55 gpio, ge1(rxctl_rxdv), ptp(pulse), sdio(led), sdio(card_detect) 145 + mpp54 54 gpio, ge1(rxd3), synce2(clk), ptp(pclk_out), synce1(clk), led(data), sdio(hw_rst), sdio_wp(wr_protect) 146 + mpp55 55 gpio, ge1(rxctl_rxdv), ptp(pulse), sdio(led), sdio_cd(card_detect) 147 147 mpp56 56 gpio, tdm(drx), au(i2sdo_spdifo), spi0(clk), uart1(rxd), sata1(present_act), sdio(clk) 148 148 mpp57 57 gpio, mss_i2c(sda), ptp(pclk_out), tdm(intn), au(i2sbclk), spi0(mosi), uart1(txd), sata0(present_act), sdio(cmd) 149 149 mpp58 58 gpio, mss_i2c(sck), ptp(clk), tdm(rstn), au(i2sdi), spi0(miso), uart1(cts), led(clk), sdio(d0)
-46
Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.txt
··· 1 - Bindings for the Broadcom's brcm,bcm6345-gpio memory-mapped GPIO controllers. 2 - 3 - These bindings can be used on any BCM63xx SoC. However, BCM6338 and BCM6345 4 - are the only ones which don't need a pinctrl driver. 5 - BCM6338 have 8-bit data and dirout registers, where GPIO state can be read 6 - and/or written, and the direction changed from input to output. 7 - BCM6345 have 16-bit data and dirout registers, where GPIO state can be read 8 - and/or written, and the direction changed from input to output. 9 - 10 - Required properties: 11 - - compatible: should be "brcm,bcm6345-gpio" 12 - - reg-names: must contain 13 - "dat" - data register 14 - "dirout" - direction (output) register 15 - - reg: address + size pairs describing the GPIO register sets; 16 - order must correspond with the order of entries in reg-names 17 - - #gpio-cells: must be set to 2. The first cell is the pin number and 18 - the second cell is used to specify the gpio polarity: 19 - 0 = active high 20 - 1 = active low 21 - - gpio-controller: Marks the device node as a gpio controller. 22 - 23 - Optional properties: 24 - - native-endian: use native endian memory. 25 - 26 - Examples: 27 - - BCM6338: 28 - gpio: gpio-controller@fffe0407 { 29 - compatible = "brcm,bcm6345-gpio"; 30 - reg-names = "dirout", "dat"; 31 - reg = <0xfffe0407 1>, <0xfffe040f 1>; 32 - 33 - #gpio-cells = <2>; 34 - gpio-controller; 35 - }; 36 - 37 - - BCM6345: 38 - gpio: gpio-controller@fffe0406 { 39 - compatible = "brcm,bcm6345-gpio"; 40 - reg-names = "dirout", "dat"; 41 - reg = <0xfffe0406 2>, <0xfffe040a 2>; 42 - native-endian; 43 - 44 - #gpio-cells = <2>; 45 - gpio-controller; 46 - };
+86
Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/gpio/brcm,bcm6345-gpio.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6345 GPIO controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: |+ 14 + Bindings for Broadcom's BCM63xx memory-mapped GPIO controllers. 15 + 16 + These bindings can be used on any BCM63xx SoC. However, BCM6338 and BCM6345 17 + are the only ones which don't need a pinctrl driver. 18 + 19 + BCM6338 have 8-bit data and dirout registers, where GPIO state can be read 20 + and/or written, and the direction changed from input to output. 21 + BCM6345 have 16-bit data and dirout registers, where GPIO state can be read 22 + and/or written, and the direction changed from input to output. 23 + BCM6318, BCM6328, BCM6358, BCM6362, BCM6368 and BCM63268 have 32-bit data 24 + and dirout registers, where GPIO state can be read and/or written, and the 25 + direction changed from input to output. 26 + 27 + properties: 28 + compatible: 29 + enum: 30 + - brcm,bcm6318-gpio 31 + - brcm,bcm6328-gpio 32 + - brcm,bcm6345-gpio 33 + - brcm,bcm6358-gpio 34 + - brcm,bcm6362-gpio 35 + - brcm,bcm6368-gpio 36 + - brcm,bcm63268-gpio 37 + 38 + gpio-controller: true 39 + 40 + "#gpio-cells": 41 + const: 2 42 + 43 + gpio-ranges: 44 + maxItems: 1 45 + 46 + native-endian: true 47 + 48 + reg: 49 + maxItems: 2 50 + 51 + reg-names: 52 + items: 53 + - const: dirout 54 + - const: dat 55 + 56 + required: 57 + - compatible 58 + - reg 59 + - reg-names 60 + - gpio-controller 61 + - '#gpio-cells' 62 + 63 + additionalProperties: false 64 + 65 + examples: 66 + - | 67 + gpio@fffe0406 { 68 + compatible = "brcm,bcm6345-gpio"; 69 + reg-names = "dirout", "dat"; 70 + reg = <0xfffe0406 2>, <0xfffe040a 2>; 71 + native-endian; 72 + 73 + gpio-controller; 74 + #gpio-cells = <2>; 75 + }; 76 + 77 + - | 78 + gpio@0 { 79 + compatible = "brcm,bcm63268-gpio"; 80 + reg-names = "dirout", "dat"; 81 + reg = <0x0 0x8>, <0x8 0x8>; 82 + 83 + gpio-controller; 84 + gpio-ranges = <&pinctrl 0 0 52>; 85 + #gpio-cells = <2>; 86 + };
+177
Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,bcm6318-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6318 GPIO System Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Broadcom BCM6318 SoC GPIO system controller which provides a register map 15 + for controlling the GPIO and pins of the SoC. 16 + 17 + properties: 18 + "#address-cells": true 19 + 20 + "#size-cells": true 21 + 22 + compatible: 23 + items: 24 + - const: brcm,bcm6318-gpio-sysctl 25 + - const: syscon 26 + - const: simple-mfd 27 + 28 + ranges: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + patternProperties: 35 + "^gpio@[0-9a-f]+$": 36 + # Child node 37 + type: object 38 + $ref: "../gpio/brcm,bcm6345-gpio.yaml" 39 + description: 40 + GPIO controller for the SoC GPIOs. This child node definition 41 + should follow the bindings specified in 42 + Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. 43 + 44 + "^pinctrl@[0-9a-f]+$": 45 + # Child node 46 + type: object 47 + $ref: "../pinctrl/brcm,bcm6318-pinctrl.yaml" 48 + description: 49 + Pin controller for the SoC pins. This child node definition 50 + should follow the bindings specified in 51 + Documentation/devicetree/bindings/pinctrl/brcm,bcm6318-pinctrl.yaml. 52 + 53 + required: 54 + - "#address-cells" 55 + - compatible 56 + - ranges 57 + - reg 58 + - "#size-cells" 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + syscon@10000080 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "brcm,bcm6318-gpio-sysctl", "syscon", "simple-mfd"; 68 + reg = <0x10000080 0x80>; 69 + ranges = <0 0x10000080 0x80>; 70 + 71 + gpio@0 { 72 + compatible = "brcm,bcm6318-gpio"; 73 + reg-names = "dirout", "dat"; 74 + reg = <0x0 0x8>, <0x8 0x8>; 75 + 76 + gpio-controller; 77 + gpio-ranges = <&pinctrl 0 0 50>; 78 + #gpio-cells = <2>; 79 + }; 80 + 81 + pinctrl: pinctrl@10 { 82 + compatible = "brcm,bcm6318-pinctrl"; 83 + reg = <0x18 0x10>, <0x54 0x18>; 84 + 85 + pinctrl_ephy0_spd_led: ephy0_spd_led-pins { 86 + function = "ephy0_spd_led"; 87 + pins = "gpio0"; 88 + }; 89 + 90 + pinctrl_ephy1_spd_led: ephy1_spd_led-pins { 91 + function = "ephy1_spd_led"; 92 + pins = "gpio1"; 93 + }; 94 + 95 + pinctrl_ephy2_spd_led: ephy2_spd_led-pins { 96 + function = "ephy2_spd_led"; 97 + pins = "gpio2"; 98 + }; 99 + 100 + pinctrl_ephy3_spd_led: ephy3_spd_led-pins { 101 + function = "ephy3_spd_led"; 102 + pins = "gpio3"; 103 + }; 104 + 105 + pinctrl_ephy0_act_led: ephy0_act_led-pins { 106 + function = "ephy0_act_led"; 107 + pins = "gpio4"; 108 + }; 109 + 110 + pinctrl_ephy1_act_led: ephy1_act_led-pins { 111 + function = "ephy1_act_led"; 112 + pins = "gpio5"; 113 + }; 114 + 115 + pinctrl_ephy2_act_led: ephy2_act_led-pins { 116 + function = "ephy2_act_led"; 117 + pins = "gpio6"; 118 + }; 119 + 120 + pinctrl_ephy3_act_led: ephy3_act_led-pins { 121 + function = "ephy3_act_led"; 122 + pins = "gpio7"; 123 + }; 124 + 125 + pinctrl_serial_led: serial_led-pins { 126 + pinctrl_serial_led_data: serial_led_data-pins { 127 + function = "serial_led_data"; 128 + pins = "gpio6"; 129 + }; 130 + 131 + pinctrl_serial_led_clk: serial_led_clk-pins { 132 + function = "serial_led_clk"; 133 + pins = "gpio7"; 134 + }; 135 + }; 136 + 137 + pinctrl_inet_act_led: inet_act_led-pins { 138 + function = "inet_act_led"; 139 + pins = "gpio8"; 140 + }; 141 + 142 + pinctrl_inet_fail_led: inet_fail_led-pins { 143 + function = "inet_fail_led"; 144 + pins = "gpio9"; 145 + }; 146 + 147 + pinctrl_dsl_led: dsl_led-pins { 148 + function = "dsl_led"; 149 + pins = "gpio10"; 150 + }; 151 + 152 + pinctrl_post_fail_led: post_fail_led-pins { 153 + function = "post_fail_led"; 154 + pins = "gpio11"; 155 + }; 156 + 157 + pinctrl_wlan_wps_led: wlan_wps_led-pins { 158 + function = "wlan_wps_led"; 159 + pins = "gpio12"; 160 + }; 161 + 162 + pinctrl_usb_pwron: usb_pwron-pins { 163 + function = "usb_pwron"; 164 + pins = "gpio13"; 165 + }; 166 + 167 + pinctrl_usb_device_led: usb_device_led-pins { 168 + function = "usb_device_led"; 169 + pins = "gpio13"; 170 + }; 171 + 172 + pinctrl_usb_active: usb_active-pins { 173 + function = "usb_active"; 174 + pins = "gpio40"; 175 + }; 176 + }; 177 + };
+194
Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,bcm63268-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM63268 GPIO System Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Broadcom BCM63268 SoC GPIO system controller which provides a register map 15 + for controlling the GPIO and pins of the SoC. 16 + 17 + properties: 18 + "#address-cells": true 19 + 20 + "#size-cells": true 21 + 22 + compatible: 23 + items: 24 + - const: brcm,bcm63268-gpio-sysctl 25 + - const: syscon 26 + - const: simple-mfd 27 + 28 + ranges: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + patternProperties: 35 + "^gpio@[0-9a-f]+$": 36 + # Child node 37 + type: object 38 + $ref: "../gpio/brcm,bcm6345-gpio.yaml" 39 + description: 40 + GPIO controller for the SoC GPIOs. This child node definition 41 + should follow the bindings specified in 42 + Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. 43 + 44 + "^pinctrl@[0-9a-f]+$": 45 + # Child node 46 + type: object 47 + $ref: "../pinctrl/brcm,bcm63268-pinctrl.yaml" 48 + description: 49 + Pin controller for the SoC pins. This child node definition 50 + should follow the bindings specified in 51 + Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.yaml. 52 + 53 + required: 54 + - "#address-cells" 55 + - compatible 56 + - ranges 57 + - reg 58 + - "#size-cells" 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + syscon@100000c0 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "brcm,bcm63268-gpio-sysctl", "syscon", "simple-mfd"; 68 + reg = <0x100000c0 0x80>; 69 + ranges = <0 0x100000c0 0x80>; 70 + 71 + gpio@0 { 72 + compatible = "brcm,bcm63268-gpio"; 73 + reg-names = "dirout", "dat"; 74 + reg = <0x0 0x8>, <0x8 0x8>; 75 + 76 + gpio-controller; 77 + gpio-ranges = <&pinctrl 0 0 52>; 78 + #gpio-cells = <2>; 79 + }; 80 + 81 + pinctrl: pinctrl@10 { 82 + compatible = "brcm,bcm63268-pinctrl"; 83 + reg = <0x10 0x4>, <0x18 0x8>, <0x38 0x4>; 84 + 85 + pinctrl_serial_led: serial_led-pins { 86 + pinctrl_serial_led_clk: serial_led_clk-pins { 87 + function = "serial_led_clk"; 88 + pins = "gpio0"; 89 + }; 90 + 91 + pinctrl_serial_led_data: serial_led_data-pins { 92 + function = "serial_led_data"; 93 + pins = "gpio1"; 94 + }; 95 + }; 96 + 97 + pinctrl_hsspi_cs4: hsspi_cs4-pins { 98 + function = "hsspi_cs4"; 99 + pins = "gpio16"; 100 + }; 101 + 102 + pinctrl_hsspi_cs5: hsspi_cs5-pins { 103 + function = "hsspi_cs5"; 104 + pins = "gpio17"; 105 + }; 106 + 107 + pinctrl_hsspi_cs6: hsspi_cs6-pins { 108 + function = "hsspi_cs6"; 109 + pins = "gpio8"; 110 + }; 111 + 112 + pinctrl_hsspi_cs7: hsspi_cs7-pins { 113 + function = "hsspi_cs7"; 114 + pins = "gpio9"; 115 + }; 116 + 117 + pinctrl_adsl_spi: adsl_spi-pins { 118 + pinctrl_adsl_spi_miso: adsl_spi_miso-pins { 119 + function = "adsl_spi_miso"; 120 + pins = "gpio18"; 121 + }; 122 + 123 + pinctrl_adsl_spi_mosi: adsl_spi_mosi-pins { 124 + function = "adsl_spi_mosi"; 125 + pins = "gpio19"; 126 + }; 127 + }; 128 + 129 + pinctrl_vreq_clk: vreq_clk-pins { 130 + function = "vreq_clk"; 131 + pins = "gpio22"; 132 + }; 133 + 134 + pinctrl_pcie_clkreq_b: pcie_clkreq_b-pins { 135 + function = "pcie_clkreq_b"; 136 + pins = "gpio23"; 137 + }; 138 + 139 + pinctrl_robosw_led_clk: robosw_led_clk-pins { 140 + function = "robosw_led_clk"; 141 + pins = "gpio30"; 142 + }; 143 + 144 + pinctrl_robosw_led_data: robosw_led_data-pins { 145 + function = "robosw_led_data"; 146 + pins = "gpio31"; 147 + }; 148 + 149 + pinctrl_nand: nand-pins { 150 + function = "nand"; 151 + group = "nand_grp"; 152 + }; 153 + 154 + pinctrl_gpio35_alt: gpio35_alt-pins { 155 + function = "gpio35_alt"; 156 + pin = "gpio35"; 157 + }; 158 + 159 + pinctrl_dectpd: dectpd-pins { 160 + function = "dectpd"; 161 + group = "dectpd_grp"; 162 + }; 163 + 164 + pinctrl_vdsl_phy_override_0: vdsl_phy_override_0-pins { 165 + function = "vdsl_phy_override_0"; 166 + group = "vdsl_phy_override_0_grp"; 167 + }; 168 + 169 + pinctrl_vdsl_phy_override_1: vdsl_phy_override_1-pins { 170 + function = "vdsl_phy_override_1"; 171 + group = "vdsl_phy_override_1_grp"; 172 + }; 173 + 174 + pinctrl_vdsl_phy_override_2: vdsl_phy_override_2-pins { 175 + function = "vdsl_phy_override_2"; 176 + group = "vdsl_phy_override_2_grp"; 177 + }; 178 + 179 + pinctrl_vdsl_phy_override_3: vdsl_phy_override_3-pins { 180 + function = "vdsl_phy_override_3"; 181 + group = "vdsl_phy_override_3_grp"; 182 + }; 183 + 184 + pinctrl_dsl_gpio8: dsl_gpio8-pins { 185 + function = "dsl_gpio8"; 186 + group = "dsl_gpio8"; 187 + }; 188 + 189 + pinctrl_dsl_gpio9: dsl_gpio9-pins { 190 + function = "dsl_gpio9"; 191 + group = "dsl_gpio9"; 192 + }; 193 + }; 194 + };
+162
Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,bcm6328-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6328 GPIO System Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Broadcom BCM6328 SoC GPIO system controller which provides a register map 15 + for controlling the GPIO and pins of the SoC. 16 + 17 + properties: 18 + "#address-cells": true 19 + 20 + "#size-cells": true 21 + 22 + compatible: 23 + items: 24 + - const: brcm,bcm6328-gpio-sysctl 25 + - const: syscon 26 + - const: simple-mfd 27 + 28 + ranges: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + patternProperties: 35 + "^gpio@[0-9a-f]+$": 36 + # Child node 37 + type: object 38 + $ref: "../gpio/brcm,bcm6345-gpio.yaml" 39 + description: 40 + GPIO controller for the SoC GPIOs. This child node definition 41 + should follow the bindings specified in 42 + Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. 43 + 44 + "^pinctrl@[0-9a-f]+$": 45 + # Child node 46 + type: object 47 + $ref: "../pinctrl/brcm,bcm6328-pinctrl.yaml" 48 + description: 49 + Pin controller for the SoC pins. This child node definition 50 + should follow the bindings specified in 51 + Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.yaml. 52 + 53 + required: 54 + - "#address-cells" 55 + - compatible 56 + - ranges 57 + - reg 58 + - "#size-cells" 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + syscon@10000080 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "brcm,bcm6328-gpio-sysctl", "syscon", "simple-mfd"; 68 + reg = <0x10000080 0x80>; 69 + ranges = <0 0x10000080 0x80>; 70 + 71 + gpio@0 { 72 + compatible = "brcm,bcm6328-gpio"; 73 + reg-names = "dirout", "dat"; 74 + reg = <0x0 0x8>, <0x8 0x8>; 75 + 76 + gpio-controller; 77 + gpio-ranges = <&pinctrl 0 0 32>; 78 + #gpio-cells = <2>; 79 + }; 80 + 81 + pinctrl: pinctrl@18 { 82 + compatible = "brcm,bcm6328-pinctrl"; 83 + reg = <0x18 0x10>; 84 + 85 + pinctrl_serial_led: serial_led-pins { 86 + pinctrl_serial_led_data: serial_led_data-pins { 87 + function = "serial_led_data"; 88 + pins = "gpio6"; 89 + }; 90 + 91 + pinctrl_serial_led_clk: serial_led_clk-pins { 92 + function = "serial_led_clk"; 93 + pins = "gpio7"; 94 + }; 95 + }; 96 + 97 + pinctrl_inet_act_led: inet_act_led-pins { 98 + function = "inet_act_led"; 99 + pins = "gpio11"; 100 + }; 101 + 102 + pinctrl_pcie_clkreq: pcie_clkreq-pins { 103 + function = "pcie_clkreq"; 104 + pins = "gpio16"; 105 + }; 106 + 107 + pinctrl_ephy0_spd_led: ephy0_spd_led-pins { 108 + function = "led"; 109 + pins = "gpio17"; 110 + }; 111 + 112 + pinctrl_ephy1_spd_led: ephy1_spd_led-pins { 113 + function = "led"; 114 + pins = "gpio18"; 115 + }; 116 + 117 + pinctrl_ephy2_spd_led: ephy2_spd_led-pins { 118 + function = "led"; 119 + pins = "gpio19"; 120 + }; 121 + 122 + pinctrl_ephy3_spd_led: ephy3_spd_led-pins { 123 + function = "led"; 124 + pins = "gpio20"; 125 + }; 126 + 127 + pinctrl_ephy0_act_led: ephy0_act_led-pins { 128 + function = "ephy0_act_led"; 129 + pins = "gpio25"; 130 + }; 131 + 132 + pinctrl_ephy1_act_led: ephy1_act_led-pins { 133 + function = "ephy1_act_led"; 134 + pins = "gpio26"; 135 + }; 136 + 137 + pinctrl_ephy2_act_led: ephy2_act_led-pins { 138 + function = "ephy2_act_led"; 139 + pins = "gpio27"; 140 + }; 141 + 142 + pinctrl_ephy3_act_led: ephy3_act_led-pins { 143 + function = "ephy3_act_led"; 144 + pins = "gpio28"; 145 + }; 146 + 147 + pinctrl_hsspi_cs1: hsspi_cs1-pins { 148 + function = "hsspi_cs1"; 149 + pins = "hsspi_cs1"; 150 + }; 151 + 152 + pinctrl_usb_port1_device: usb_port1_device-pins { 153 + function = "usb_device_port"; 154 + pins = "usb_port1"; 155 + }; 156 + 157 + pinctrl_usb_port1_host: usb_port1_host-pins { 158 + function = "usb_host_port"; 159 + pins = "usb_port1"; 160 + }; 161 + }; 162 + };
+130
Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,bcm6358-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6358 GPIO System Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Broadcom BCM6358 SoC GPIO system controller which provides a register map 15 + for controlling the GPIO and pins of the SoC. 16 + 17 + properties: 18 + "#address-cells": true 19 + 20 + "#size-cells": true 21 + 22 + compatible: 23 + items: 24 + - const: brcm,bcm6358-gpio-sysctl 25 + - const: syscon 26 + - const: simple-mfd 27 + 28 + ranges: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + patternProperties: 35 + "^gpio@[0-9a-f]+$": 36 + # Child node 37 + type: object 38 + $ref: "../gpio/brcm,bcm6345-gpio.yaml" 39 + description: 40 + GPIO controller for the SoC GPIOs. This child node definition 41 + should follow the bindings specified in 42 + Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. 43 + 44 + "^pinctrl@[0-9a-f]+$": 45 + # Child node 46 + type: object 47 + $ref: "../pinctrl/brcm,bcm6358-pinctrl.yaml" 48 + description: 49 + Pin controller for the SoC pins. This child node definition 50 + should follow the bindings specified in 51 + Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.yaml. 52 + 53 + required: 54 + - "#address-cells" 55 + - compatible 56 + - ranges 57 + - reg 58 + - "#size-cells" 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + syscon@fffe0080 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "brcm,bcm6358-gpio-sysctl", "syscon", "simple-mfd"; 68 + reg = <0xfffe0080 0x80>; 69 + ranges = <0 0xfffe0080 0x80>; 70 + 71 + gpio@0 { 72 + compatible = "brcm,bcm6358-gpio"; 73 + reg-names = "dirout", "dat"; 74 + reg = <0x0 0x8>, <0x8 0x8>; 75 + 76 + gpio-controller; 77 + gpio-ranges = <&pinctrl 0 0 40>; 78 + #gpio-cells = <2>; 79 + }; 80 + 81 + pinctrl: pinctrl@18 { 82 + compatible = "brcm,bcm6358-pinctrl"; 83 + reg = <0x18 0x4>; 84 + 85 + pinctrl_ebi_cs: ebi_cs-pins { 86 + function = "ebi_cs"; 87 + groups = "ebi_cs_grp"; 88 + }; 89 + 90 + pinctrl_uart1: uart1-pins { 91 + function = "uart1"; 92 + groups = "uart1_grp"; 93 + }; 94 + 95 + pinctrl_serial_led: serial_led-pins { 96 + function = "serial_led"; 97 + groups = "serial_led_grp"; 98 + }; 99 + 100 + pinctrl_legacy_led: legacy_led-pins { 101 + function = "legacy_led"; 102 + groups = "legacy_led_grp"; 103 + }; 104 + 105 + pinctrl_led: led-pins { 106 + function = "led"; 107 + groups = "led_grp"; 108 + }; 109 + 110 + pinctrl_spi_cs_23: spi_cs-pins { 111 + function = "spi_cs"; 112 + groups = "spi_cs_grp"; 113 + }; 114 + 115 + pinctrl_utopia: utopia-pins { 116 + function = "utopia"; 117 + groups = "utopia_grp"; 118 + }; 119 + 120 + pinctrl_pwm_syn_clk: pwm_syn_clk-pins { 121 + function = "pwm_syn_clk"; 122 + groups = "pwm_syn_clk_grp"; 123 + }; 124 + 125 + pinctrl_sys_irq: sys_irq-pins { 126 + function = "sys_irq"; 127 + groups = "sys_irq_grp"; 128 + }; 129 + }; 130 + };
+236
Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,bcm6362-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6362 GPIO System Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Broadcom BCM6362 SoC GPIO system controller which provides a register map 15 + for controlling the GPIO and pins of the SoC. 16 + 17 + properties: 18 + "#address-cells": true 19 + 20 + "#size-cells": true 21 + 22 + compatible: 23 + items: 24 + - const: brcm,bcm6362-gpio-sysctl 25 + - const: syscon 26 + - const: simple-mfd 27 + 28 + ranges: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + patternProperties: 35 + "^gpio@[0-9a-f]+$": 36 + # Child node 37 + type: object 38 + $ref: "../gpio/brcm,bcm6345-gpio.yaml" 39 + description: 40 + GPIO controller for the SoC GPIOs. This child node definition 41 + should follow the bindings specified in 42 + Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. 43 + 44 + "^pinctrl@[0-9a-f]+$": 45 + # Child node 46 + type: object 47 + $ref: "../pinctrl/brcm,bcm6362-pinctrl.yaml" 48 + description: 49 + Pin controller for the SoC pins. This child node definition 50 + should follow the bindings specified in 51 + Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.yaml. 52 + 53 + required: 54 + - "#address-cells" 55 + - compatible 56 + - ranges 57 + - reg 58 + - "#size-cells" 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + syscon@10000080 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "brcm,bcm6362-gpio-sysctl", "syscon", "simple-mfd"; 68 + reg = <0x10000080 0x80>; 69 + ranges = <0 0x10000080 0x80>; 70 + 71 + gpio@0 { 72 + compatible = "brcm,bcm6362-gpio"; 73 + reg-names = "dirout", "dat"; 74 + reg = <0x0 0x8>, <0x8 0x8>; 75 + 76 + gpio-controller; 77 + gpio-ranges = <&pinctrl 0 0 48>; 78 + #gpio-cells = <2>; 79 + }; 80 + 81 + pinctrl: pinctrl@18 { 82 + compatible = "brcm,bcm6362-pinctrl"; 83 + reg = <0x18 0x10>, <0x38 0x4>; 84 + 85 + pinctrl_usb_device_led: usb_device_led-pins { 86 + function = "usb_device_led"; 87 + pins = "gpio0"; 88 + }; 89 + 90 + pinctrl_sys_irq: sys_irq-pins { 91 + function = "sys_irq"; 92 + pins = "gpio1"; 93 + }; 94 + 95 + pinctrl_serial_led: serial_led-pins { 96 + pinctrl_serial_led_clk: serial_led_clk-pins { 97 + function = "serial_led_clk"; 98 + pins = "gpio2"; 99 + }; 100 + 101 + pinctrl_serial_led_data: serial_led_data-pins { 102 + function = "serial_led_data"; 103 + pins = "gpio3"; 104 + }; 105 + }; 106 + 107 + pinctrl_robosw_led_data: robosw_led_data-pins { 108 + function = "robosw_led_data"; 109 + pins = "gpio4"; 110 + }; 111 + 112 + pinctrl_robosw_led_clk: robosw_led_clk-pins { 113 + function = "robosw_led_clk"; 114 + pins = "gpio5"; 115 + }; 116 + 117 + pinctrl_robosw_led0: robosw_led0-pins { 118 + function = "robosw_led0"; 119 + pins = "gpio6"; 120 + }; 121 + 122 + pinctrl_robosw_led1: robosw_led1-pins { 123 + function = "robosw_led1"; 124 + pins = "gpio7"; 125 + }; 126 + 127 + pinctrl_inet_led: inet_led-pins { 128 + function = "inet_led"; 129 + pins = "gpio8"; 130 + }; 131 + 132 + pinctrl_spi_cs2: spi_cs2-pins { 133 + function = "spi_cs2"; 134 + pins = "gpio9"; 135 + }; 136 + 137 + pinctrl_spi_cs3: spi_cs3-pins { 138 + function = "spi_cs3"; 139 + pins = "gpio10"; 140 + }; 141 + 142 + pinctrl_ntr_pulse: ntr_pulse-pins { 143 + function = "ntr_pulse"; 144 + pins = "gpio11"; 145 + }; 146 + 147 + pinctrl_uart1_scts: uart1_scts-pins { 148 + function = "uart1_scts"; 149 + pins = "gpio12"; 150 + }; 151 + 152 + pinctrl_uart1_srts: uart1_srts-pins { 153 + function = "uart1_srts"; 154 + pins = "gpio13"; 155 + }; 156 + 157 + pinctrl_uart1: uart1-pins { 158 + pinctrl_uart1_sdin: uart1_sdin-pins { 159 + function = "uart1_sdin"; 160 + pins = "gpio14"; 161 + }; 162 + 163 + pinctrl_uart1_sdout: uart1_sdout-pins { 164 + function = "uart1_sdout"; 165 + pins = "gpio15"; 166 + }; 167 + }; 168 + 169 + pinctrl_adsl_spi: adsl_spi-pins { 170 + pinctrl_adsl_spi_miso: adsl_spi_miso-pins { 171 + function = "adsl_spi_miso"; 172 + pins = "gpio16"; 173 + }; 174 + 175 + pinctrl_adsl_spi_mosi: adsl_spi_mosi-pins { 176 + function = "adsl_spi_mosi"; 177 + pins = "gpio17"; 178 + }; 179 + 180 + pinctrl_adsl_spi_clk: adsl_spi_clk-pins { 181 + function = "adsl_spi_clk"; 182 + pins = "gpio18"; 183 + }; 184 + 185 + pinctrl_adsl_spi_cs: adsl_spi_cs-pins { 186 + function = "adsl_spi_cs"; 187 + pins = "gpio19"; 188 + }; 189 + }; 190 + 191 + pinctrl_ephy0_led: ephy0_led-pins { 192 + function = "ephy0_led"; 193 + pins = "gpio20"; 194 + }; 195 + 196 + pinctrl_ephy1_led: ephy1_led-pins { 197 + function = "ephy1_led"; 198 + pins = "gpio21"; 199 + }; 200 + 201 + pinctrl_ephy2_led: ephy2_led-pins { 202 + function = "ephy2_led"; 203 + pins = "gpio22"; 204 + }; 205 + 206 + pinctrl_ephy3_led: ephy3_led-pins { 207 + function = "ephy3_led"; 208 + pins = "gpio23"; 209 + }; 210 + 211 + pinctrl_ext_irq0: ext_irq0-pins { 212 + function = "ext_irq0"; 213 + pins = "gpio24"; 214 + }; 215 + 216 + pinctrl_ext_irq1: ext_irq1-pins { 217 + function = "ext_irq1"; 218 + pins = "gpio25"; 219 + }; 220 + 221 + pinctrl_ext_irq2: ext_irq2-pins { 222 + function = "ext_irq2"; 223 + pins = "gpio26"; 224 + }; 225 + 226 + pinctrl_ext_irq3: ext_irq3-pins { 227 + function = "ext_irq3"; 228 + pins = "gpio27"; 229 + }; 230 + 231 + pinctrl_nand: nand-pins { 232 + function = "nand"; 233 + group = "nand_grp"; 234 + }; 235 + }; 236 + };
+246
Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/brcm,bcm6368-gpio-sysctl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6368 GPIO System Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Broadcom BCM6368 SoC GPIO system controller which provides a register map 15 + for controlling the GPIO and pins of the SoC. 16 + 17 + properties: 18 + "#address-cells": true 19 + 20 + "#size-cells": true 21 + 22 + compatible: 23 + items: 24 + - const: brcm,bcm6368-gpio-sysctl 25 + - const: syscon 26 + - const: simple-mfd 27 + 28 + ranges: 29 + maxItems: 1 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + patternProperties: 35 + "^gpio@[0-9a-f]+$": 36 + # Child node 37 + type: object 38 + $ref: "../gpio/brcm,bcm6345-gpio.yaml" 39 + description: 40 + GPIO controller for the SoC GPIOs. This child node definition 41 + should follow the bindings specified in 42 + Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. 43 + 44 + "^pinctrl@[0-9a-f]+$": 45 + # Child node 46 + type: object 47 + $ref: "../pinctrl/brcm,bcm6368-pinctrl.yaml" 48 + description: 49 + Pin controller for the SoC pins. This child node definition 50 + should follow the bindings specified in 51 + Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.yaml. 52 + 53 + required: 54 + - "#address-cells" 55 + - compatible 56 + - ranges 57 + - reg 58 + - "#size-cells" 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + syscon@10000080 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "brcm,bcm6368-gpio-sysctl", "syscon", "simple-mfd"; 68 + reg = <0x10000080 0x80>; 69 + ranges = <0 0x10000080 0x80>; 70 + 71 + gpio@0 { 72 + compatible = "brcm,bcm6368-gpio"; 73 + reg-names = "dirout", "dat"; 74 + reg = <0x0 0x8>, <0x8 0x8>; 75 + 76 + gpio-controller; 77 + gpio-ranges = <&pinctrl 0 0 38>; 78 + #gpio-cells = <2>; 79 + }; 80 + 81 + pinctrl: pinctrl@18 { 82 + compatible = "brcm,bcm6368-pinctrl"; 83 + reg = <0x18 0x4>, <0x38 0x4>; 84 + 85 + pinctrl_analog_afe_0: analog_afe_0-pins { 86 + function = "analog_afe_0"; 87 + pins = "gpio0"; 88 + }; 89 + 90 + pinctrl_analog_afe_1: analog_afe_1-pins { 91 + function = "analog_afe_1"; 92 + pins = "gpio1"; 93 + }; 94 + 95 + pinctrl_sys_irq: sys_irq-pins { 96 + function = "sys_irq"; 97 + pins = "gpio2"; 98 + }; 99 + 100 + pinctrl_serial_led: serial_led-pins { 101 + pinctrl_serial_led_data: serial_led_data-pins { 102 + function = "serial_led_data"; 103 + pins = "gpio3"; 104 + }; 105 + 106 + pinctrl_serial_led_clk: serial_led_clk-pins { 107 + function = "serial_led_clk"; 108 + pins = "gpio4"; 109 + }; 110 + }; 111 + 112 + pinctrl_inet_led: inet_led-pins { 113 + function = "inet_led"; 114 + pins = "gpio5"; 115 + }; 116 + 117 + pinctrl_ephy0_led: ephy0_led-pins { 118 + function = "ephy0_led"; 119 + pins = "gpio6"; 120 + }; 121 + 122 + pinctrl_ephy1_led: ephy1_led-pins { 123 + function = "ephy1_led"; 124 + pins = "gpio7"; 125 + }; 126 + 127 + pinctrl_ephy2_led: ephy2_led-pins { 128 + function = "ephy2_led"; 129 + pins = "gpio8"; 130 + }; 131 + 132 + pinctrl_ephy3_led: ephy3_led-pins { 133 + function = "ephy3_led"; 134 + pins = "gpio9"; 135 + }; 136 + 137 + pinctrl_robosw_led_data: robosw_led_data-pins { 138 + function = "robosw_led_data"; 139 + pins = "gpio10"; 140 + }; 141 + 142 + pinctrl_robosw_led_clk: robosw_led_clk-pins { 143 + function = "robosw_led_clk"; 144 + pins = "gpio11"; 145 + }; 146 + 147 + pinctrl_robosw_led0: robosw_led0-pins { 148 + function = "robosw_led0"; 149 + pins = "gpio12"; 150 + }; 151 + 152 + pinctrl_robosw_led1: robosw_led1-pins { 153 + function = "robosw_led1"; 154 + pins = "gpio13"; 155 + }; 156 + 157 + pinctrl_usb_device_led: usb_device_led-pins { 158 + function = "usb_device_led"; 159 + pins = "gpio14"; 160 + }; 161 + 162 + pinctrl_pci: pci-pins { 163 + pinctrl_pci_req1: pci_req1-pins { 164 + function = "pci_req1"; 165 + pins = "gpio16"; 166 + }; 167 + 168 + pinctrl_pci_gnt1: pci_gnt1-pins { 169 + function = "pci_gnt1"; 170 + pins = "gpio17"; 171 + }; 172 + 173 + pinctrl_pci_intb: pci_intb-pins { 174 + function = "pci_intb"; 175 + pins = "gpio18"; 176 + }; 177 + 178 + pinctrl_pci_req0: pci_req0-pins { 179 + function = "pci_req0"; 180 + pins = "gpio19"; 181 + }; 182 + 183 + pinctrl_pci_gnt0: pci_gnt0-pins { 184 + function = "pci_gnt0"; 185 + pins = "gpio20"; 186 + }; 187 + }; 188 + 189 + pinctrl_pcmcia: pcmcia-pins { 190 + pinctrl_pcmcia_cd1: pcmcia_cd1-pins { 191 + function = "pcmcia_cd1"; 192 + pins = "gpio22"; 193 + }; 194 + 195 + pinctrl_pcmcia_cd2: pcmcia_cd2-pins { 196 + function = "pcmcia_cd2"; 197 + pins = "gpio23"; 198 + }; 199 + 200 + pinctrl_pcmcia_vs1: pcmcia_vs1-pins { 201 + function = "pcmcia_vs1"; 202 + pins = "gpio24"; 203 + }; 204 + 205 + pinctrl_pcmcia_vs2: pcmcia_vs2-pins { 206 + function = "pcmcia_vs2"; 207 + pins = "gpio25"; 208 + }; 209 + }; 210 + 211 + pinctrl_ebi_cs2: ebi_cs2-pins { 212 + function = "ebi_cs2"; 213 + pins = "gpio26"; 214 + }; 215 + 216 + pinctrl_ebi_cs3: ebi_cs3-pins { 217 + function = "ebi_cs3"; 218 + pins = "gpio27"; 219 + }; 220 + 221 + pinctrl_spi_cs2: spi_cs2-pins { 222 + function = "spi_cs2"; 223 + pins = "gpio28"; 224 + }; 225 + 226 + pinctrl_spi_cs3: spi_cs3-pins { 227 + function = "spi_cs3"; 228 + pins = "gpio29"; 229 + }; 230 + 231 + pinctrl_spi_cs4: spi_cs4-pins { 232 + function = "spi_cs4"; 233 + pins = "gpio30"; 234 + }; 235 + 236 + pinctrl_spi_cs5: spi_cs5-pins { 237 + function = "spi_cs5"; 238 + pins = "gpio31"; 239 + }; 240 + 241 + pinctrl_uart1: uart1-pins { 242 + function = "uart1"; 243 + group = "uart1_grp"; 244 + }; 245 + }; 246 + };
+143
Documentation/devicetree/bindings/pinctrl/brcm,bcm6318-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm6318-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6318 pin controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Bindings for Broadcom's BCM6318 memory-mapped pin controller. 15 + 16 + properties: 17 + compatible: 18 + const: brcm,bcm6318-pinctrl 19 + 20 + reg: 21 + maxItems: 2 22 + 23 + patternProperties: 24 + '-pins$': 25 + type: object 26 + $ref: pinmux-node.yaml# 27 + 28 + properties: 29 + function: 30 + enum: [ ephy0_spd_led, ephy1_spd_led, ephy2_spd_led, ephy3_spd_led, 31 + ephy0_act_led, ephy1_act_led, ephy2_act_led, ephy3_act_led, 32 + serial_led_data, serial_led_clk, inet_act_led, inet_fail_led, 33 + dsl_led, post_fail_led, wlan_wps_led, usb_pwron, 34 + usb_device_led, usb_active ] 35 + 36 + pins: 37 + enum: [ gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, 38 + gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio40 ] 39 + 40 + required: 41 + - compatible 42 + - reg 43 + 44 + additionalProperties: false 45 + 46 + examples: 47 + - | 48 + pinctrl@18 { 49 + compatible = "brcm,bcm6318-pinctrl"; 50 + reg = <0x18 0x10>, <0x54 0x18>; 51 + 52 + pinctrl_ephy0_spd_led: ephy0_spd_led-pins { 53 + function = "ephy0_spd_led"; 54 + pins = "gpio0"; 55 + }; 56 + 57 + pinctrl_ephy1_spd_led: ephy1_spd_led-pins { 58 + function = "ephy1_spd_led"; 59 + pins = "gpio1"; 60 + }; 61 + 62 + pinctrl_ephy2_spd_led: ephy2_spd_led-pins { 63 + function = "ephy2_spd_led"; 64 + pins = "gpio2"; 65 + }; 66 + 67 + pinctrl_ephy3_spd_led: ephy3_spd_led-pins { 68 + function = "ephy3_spd_led"; 69 + pins = "gpio3"; 70 + }; 71 + 72 + pinctrl_ephy0_act_led: ephy0_act_led-pins { 73 + function = "ephy0_act_led"; 74 + pins = "gpio4"; 75 + }; 76 + 77 + pinctrl_ephy1_act_led: ephy1_act_led-pins { 78 + function = "ephy1_act_led"; 79 + pins = "gpio5"; 80 + }; 81 + 82 + pinctrl_ephy2_act_led: ephy2_act_led-pins { 83 + function = "ephy2_act_led"; 84 + pins = "gpio6"; 85 + }; 86 + 87 + pinctrl_ephy3_act_led: ephy3_act_led-pins { 88 + function = "ephy3_act_led"; 89 + pins = "gpio7"; 90 + }; 91 + 92 + pinctrl_serial_led: serial_led-pins { 93 + pinctrl_serial_led_data: serial_led_data-pins { 94 + function = "serial_led_data"; 95 + pins = "gpio6"; 96 + }; 97 + 98 + pinctrl_serial_led_clk: serial_led_clk-pins { 99 + function = "serial_led_clk"; 100 + pins = "gpio7"; 101 + }; 102 + }; 103 + 104 + pinctrl_inet_act_led: inet_act_led-pins { 105 + function = "inet_act_led"; 106 + pins = "gpio8"; 107 + }; 108 + 109 + pinctrl_inet_fail_led: inet_fail_led-pins { 110 + function = "inet_fail_led"; 111 + pins = "gpio9"; 112 + }; 113 + 114 + pinctrl_dsl_led: dsl_led-pins { 115 + function = "dsl_led"; 116 + pins = "gpio10"; 117 + }; 118 + 119 + pinctrl_post_fail_led: post_fail_led-pins { 120 + function = "post_fail_led"; 121 + pins = "gpio11"; 122 + }; 123 + 124 + pinctrl_wlan_wps_led: wlan_wps_led-pins { 125 + function = "wlan_wps_led"; 126 + pins = "gpio12"; 127 + }; 128 + 129 + pinctrl_usb_pwron: usb_pwron-pins { 130 + function = "usb_pwron"; 131 + pins = "gpio13"; 132 + }; 133 + 134 + pinctrl_usb_device_led: usb_device_led-pins { 135 + function = "usb_device_led"; 136 + pins = "gpio13"; 137 + }; 138 + 139 + pinctrl_usb_active: usb_active-pins { 140 + function = "usb_active"; 141 + pins = "gpio40"; 142 + }; 143 + };
+164
Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm63268-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM63268 pin controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Bindings for Broadcom's BCM63268 memory-mapped pin controller. 15 + 16 + properties: 17 + compatible: 18 + const: brcm,bcm63268-pinctrl 19 + 20 + reg: 21 + maxItems: 3 22 + 23 + patternProperties: 24 + '-pins$': 25 + type: object 26 + $ref: pinmux-node.yaml# 27 + 28 + properties: 29 + function: 30 + enum: [ serial_led_clk, serial_led_data, hsspi_cs4, hsspi_cs5, 31 + hsspi_cs6, hsspi_cs7, adsl_spi_miso, adsl_spi_mosi, 32 + vreq_clk, pcie_clkreq_b, robosw_led_clk, robosw_led_data, 33 + nand, gpio35_alt, dectpd, vdsl_phy_override_0, 34 + vdsl_phy_override_1, vdsl_phy_override_2, 35 + vdsl_phy_override_3, dsl_gpio8, dsl_gpio9 ] 36 + 37 + pins: 38 + enum: [ gpio0, gpio1, gpio16, gpio17, gpio8, gpio9, gpio18, gpio19, 39 + gpio22, gpio23, gpio30, gpio31, nand_grp, gpio35 40 + dectpd_grp, vdsl_phy_override_0_grp, 41 + vdsl_phy_override_1_grp, vdsl_phy_override_2_grp, 42 + vdsl_phy_override_3_grp, dsl_gpio8, dsl_gpio9 ] 43 + 44 + required: 45 + - compatible 46 + - reg 47 + 48 + additionalProperties: false 49 + 50 + examples: 51 + - | 52 + pinctrl@10 { 53 + compatible = "brcm,bcm63268-pinctrl"; 54 + reg = <0x10 0x4>, <0x18 0x8>, <0x38 0x4>; 55 + 56 + pinctrl_serial_led: serial_led-pins { 57 + pinctrl_serial_led_clk: serial_led_clk-pins { 58 + function = "serial_led_clk"; 59 + pins = "gpio0"; 60 + }; 61 + 62 + pinctrl_serial_led_data: serial_led_data-pins { 63 + function = "serial_led_data"; 64 + pins = "gpio1"; 65 + }; 66 + }; 67 + 68 + pinctrl_hsspi_cs4: hsspi_cs4-pins { 69 + function = "hsspi_cs4"; 70 + pins = "gpio16"; 71 + }; 72 + 73 + pinctrl_hsspi_cs5: hsspi_cs5-pins { 74 + function = "hsspi_cs5"; 75 + pins = "gpio17"; 76 + }; 77 + 78 + pinctrl_hsspi_cs6: hsspi_cs6-pins { 79 + function = "hsspi_cs6"; 80 + pins = "gpio8"; 81 + }; 82 + 83 + pinctrl_hsspi_cs7: hsspi_cs7-pins { 84 + function = "hsspi_cs7"; 85 + pins = "gpio9"; 86 + }; 87 + 88 + pinctrl_adsl_spi: adsl_spi-pins { 89 + pinctrl_adsl_spi_miso: adsl_spi_miso-pins { 90 + function = "adsl_spi_miso"; 91 + pins = "gpio18"; 92 + }; 93 + 94 + pinctrl_adsl_spi_mosi: adsl_spi_mosi-pins { 95 + function = "adsl_spi_mosi"; 96 + pins = "gpio19"; 97 + }; 98 + }; 99 + 100 + pinctrl_vreq_clk: vreq_clk-pins { 101 + function = "vreq_clk"; 102 + pins = "gpio22"; 103 + }; 104 + 105 + pinctrl_pcie_clkreq_b: pcie_clkreq_b-pins { 106 + function = "pcie_clkreq_b"; 107 + pins = "gpio23"; 108 + }; 109 + 110 + pinctrl_robosw_led_clk: robosw_led_clk-pins { 111 + function = "robosw_led_clk"; 112 + pins = "gpio30"; 113 + }; 114 + 115 + pinctrl_robosw_led_data: robosw_led_data-pins { 116 + function = "robosw_led_data"; 117 + pins = "gpio31"; 118 + }; 119 + 120 + pinctrl_nand: nand-pins { 121 + function = "nand"; 122 + group = "nand_grp"; 123 + }; 124 + 125 + pinctrl_gpio35_alt: gpio35_alt-pins { 126 + function = "gpio35_alt"; 127 + pin = "gpio35"; 128 + }; 129 + 130 + pinctrl_dectpd: dectpd-pins { 131 + function = "dectpd"; 132 + group = "dectpd_grp"; 133 + }; 134 + 135 + pinctrl_vdsl_phy_override_0: vdsl_phy_override_0-pins { 136 + function = "vdsl_phy_override_0"; 137 + group = "vdsl_phy_override_0_grp"; 138 + }; 139 + 140 + pinctrl_vdsl_phy_override_1: vdsl_phy_override_1-pins { 141 + function = "vdsl_phy_override_1"; 142 + group = "vdsl_phy_override_1_grp"; 143 + }; 144 + 145 + pinctrl_vdsl_phy_override_2: vdsl_phy_override_2-pins { 146 + function = "vdsl_phy_override_2"; 147 + group = "vdsl_phy_override_2_grp"; 148 + }; 149 + 150 + pinctrl_vdsl_phy_override_3: vdsl_phy_override_3-pins { 151 + function = "vdsl_phy_override_3"; 152 + group = "vdsl_phy_override_3_grp"; 153 + }; 154 + 155 + pinctrl_dsl_gpio8: dsl_gpio8-pins { 156 + function = "dsl_gpio8"; 157 + group = "dsl_gpio8"; 158 + }; 159 + 160 + pinctrl_dsl_gpio9: dsl_gpio9-pins { 161 + function = "dsl_gpio9"; 162 + group = "dsl_gpio9"; 163 + }; 164 + };
+127
Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm6328-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6328 pin controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Bindings for Broadcom's BCM6328 memory-mapped pin controller. 15 + 16 + properties: 17 + compatible: 18 + const: brcm,bcm6328-pinctrl 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + patternProperties: 24 + '-pins$': 25 + type: object 26 + $ref: pinmux-node.yaml# 27 + 28 + properties: 29 + function: 30 + enum: [ serial_led_data, serial_led_clk, inet_act_led, pcie_clkreq, 31 + led, ephy0_act_led, ephy1_act_led, ephy2_act_led, 32 + ephy3_act_led, hsspi_cs1, usb_device_port, usb_host_port ] 33 + 34 + pins: 35 + enum: [ gpio6, gpio7, gpio11, gpio16, gpio17, gpio18, gpio19, 36 + gpio20, gpio25, gpio26, gpio27, gpio28, hsspi_cs1, 37 + usb_port1 ] 38 + 39 + required: 40 + - compatible 41 + - reg 42 + 43 + additionalProperties: false 44 + 45 + examples: 46 + - | 47 + pinctrl@18 { 48 + compatible = "brcm,bcm6328-pinctrl"; 49 + reg = <0x18 0x10>; 50 + 51 + pinctrl_serial_led: serial_led-pins { 52 + pinctrl_serial_led_data: serial_led_data-pins { 53 + function = "serial_led_data"; 54 + pins = "gpio6"; 55 + }; 56 + 57 + pinctrl_serial_led_clk: serial_led_clk-pins { 58 + function = "serial_led_clk"; 59 + pins = "gpio7"; 60 + }; 61 + }; 62 + 63 + pinctrl_inet_act_led: inet_act_led-pins { 64 + function = "inet_act_led"; 65 + pins = "gpio11"; 66 + }; 67 + 68 + pinctrl_pcie_clkreq: pcie_clkreq-pins { 69 + function = "pcie_clkreq"; 70 + pins = "gpio16"; 71 + }; 72 + 73 + pinctrl_ephy0_spd_led: ephy0_spd_led-pins { 74 + function = "led"; 75 + pins = "gpio17"; 76 + }; 77 + 78 + pinctrl_ephy1_spd_led: ephy1_spd_led-pins { 79 + function = "led"; 80 + pins = "gpio18"; 81 + }; 82 + 83 + pinctrl_ephy2_spd_led: ephy2_spd_led-pins { 84 + function = "led"; 85 + pins = "gpio19"; 86 + }; 87 + 88 + pinctrl_ephy3_spd_led: ephy3_spd_led-pins { 89 + function = "led"; 90 + pins = "gpio20"; 91 + }; 92 + 93 + pinctrl_ephy0_act_led: ephy0_act_led-pins { 94 + function = "ephy0_act_led"; 95 + pins = "gpio25"; 96 + }; 97 + 98 + pinctrl_ephy1_act_led: ephy1_act_led-pins { 99 + function = "ephy1_act_led"; 100 + pins = "gpio26"; 101 + }; 102 + 103 + pinctrl_ephy2_act_led: ephy2_act_led-pins { 104 + function = "ephy2_act_led"; 105 + pins = "gpio27"; 106 + }; 107 + 108 + pinctrl_ephy3_act_led: ephy3_act_led-pins { 109 + function = "ephy3_act_led"; 110 + pins = "gpio28"; 111 + }; 112 + 113 + pinctrl_hsspi_cs1: hsspi_cs1-pins { 114 + function = "hsspi_cs1"; 115 + pins = "hsspi_cs1"; 116 + }; 117 + 118 + pinctrl_usb_port1_device: usb_port1_device-pins { 119 + function = "usb_device_port"; 120 + pins = "usb_port1"; 121 + }; 122 + 123 + pinctrl_usb_port1_host: usb_port1_host-pins { 124 + function = "usb_host_port"; 125 + pins = "usb_port1"; 126 + }; 127 + };
+93
Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm6358-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6358 pin controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Bindings for Broadcom's BCM6358 memory-mapped pin controller. 15 + 16 + properties: 17 + compatible: 18 + const: brcm,bcm6358-pinctrl 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + patternProperties: 24 + '-pins$': 25 + type: object 26 + $ref: pinmux-node.yaml# 27 + 28 + properties: 29 + function: 30 + enum: [ ebi_cs, uart1, serial_led, legacy_led, led, spi_cs, utopia, 31 + pwm_syn_clk, sys_irq ] 32 + 33 + pins: 34 + enum: [ ebi_cs_grp, uart1_grp, serial_led_grp, legacy_led_grp, 35 + led_grp, spi_cs_grp, utopia_grp, pwm_syn_clk, sys_irq_grp ] 36 + 37 + required: 38 + - compatible 39 + - reg 40 + 41 + additionalProperties: false 42 + 43 + examples: 44 + - | 45 + pinctrl@18 { 46 + compatible = "brcm,bcm6358-pinctrl"; 47 + reg = <0x18 0x4>; 48 + 49 + pinctrl_ebi_cs: ebi_cs-pins { 50 + function = "ebi_cs"; 51 + groups = "ebi_cs_grp"; 52 + }; 53 + 54 + pinctrl_uart1: uart1-pins { 55 + function = "uart1"; 56 + groups = "uart1_grp"; 57 + }; 58 + 59 + pinctrl_serial_led: serial_led-pins { 60 + function = "serial_led"; 61 + groups = "serial_led_grp"; 62 + }; 63 + 64 + pinctrl_legacy_led: legacy_led-pins { 65 + function = "legacy_led"; 66 + groups = "legacy_led_grp"; 67 + }; 68 + 69 + pinctrl_led: led-pins { 70 + function = "led"; 71 + groups = "led_grp"; 72 + }; 73 + 74 + pinctrl_spi_cs_23: spi_cs-pins { 75 + function = "spi_cs"; 76 + groups = "spi_cs_grp"; 77 + }; 78 + 79 + pinctrl_utopia: utopia-pins { 80 + function = "utopia"; 81 + groups = "utopia_grp"; 82 + }; 83 + 84 + pinctrl_pwm_syn_clk: pwm_syn_clk-pins { 85 + function = "pwm_syn_clk"; 86 + groups = "pwm_syn_clk_grp"; 87 + }; 88 + 89 + pinctrl_sys_irq: sys_irq-pins { 90 + function = "sys_irq"; 91 + groups = "sys_irq_grp"; 92 + }; 93 + };
+206
Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm6362-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6362 pin controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Bindings for Broadcom's BCM6362 memory-mapped pin controller. 15 + 16 + properties: 17 + compatible: 18 + const: brcm,bcm6362-pinctrl 19 + 20 + reg: 21 + maxItems: 2 22 + 23 + patternProperties: 24 + '-pins$': 25 + type: object 26 + $ref: pinmux-node.yaml# 27 + 28 + properties: 29 + function: 30 + enum: [ usb_device_led, sys_irq, serial_led_clk, serial_led_data, 31 + robosw_led_data, robosw_led_clk, robosw_led0, robosw_led1, 32 + inet_led, spi_cs2, spi_cs3, ntr_pulse, uart1_scts, 33 + uart1_srts, uart1_sdin, uart1_sdout, adsl_spi_miso, 34 + adsl_spi_mosi, adsl_spi_clk, adsl_spi_cs, ephy0_led, 35 + ephy1_led, ephy2_led, ephy3_led, ext_irq0, ext_irq1, 36 + ext_irq2, ext_irq3, nand ] 37 + 38 + pins: 39 + enum: [ gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, 40 + gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio14, 41 + gpio15, gpio16, gpio17, gpio18, gpio19, gpio20, gpio21, 42 + gpio22, gpio23, gpio24, gpio25, gpio26, gpio27, nand_grp ] 43 + 44 + required: 45 + - compatible 46 + - reg 47 + 48 + additionalProperties: false 49 + 50 + examples: 51 + - | 52 + pinctrl@18 { 53 + compatible = "brcm,bcm6362-pinctrl"; 54 + reg = <0x18 0x10>, <0x38 0x4>; 55 + 56 + pinctrl_usb_device_led: usb_device_led-pins { 57 + function = "usb_device_led"; 58 + pins = "gpio0"; 59 + }; 60 + 61 + pinctrl_sys_irq: sys_irq-pins { 62 + function = "sys_irq"; 63 + pins = "gpio1"; 64 + }; 65 + 66 + pinctrl_serial_led: serial_led-pins { 67 + pinctrl_serial_led_clk: serial_led_clk-pins { 68 + function = "serial_led_clk"; 69 + pins = "gpio2"; 70 + }; 71 + 72 + pinctrl_serial_led_data: serial_led_data-pins { 73 + function = "serial_led_data"; 74 + pins = "gpio3"; 75 + }; 76 + }; 77 + 78 + pinctrl_robosw_led_data: robosw_led_data-pins { 79 + function = "robosw_led_data"; 80 + pins = "gpio4"; 81 + }; 82 + 83 + pinctrl_robosw_led_clk: robosw_led_clk-pins { 84 + function = "robosw_led_clk"; 85 + pins = "gpio5"; 86 + }; 87 + 88 + pinctrl_robosw_led0: robosw_led0-pins { 89 + function = "robosw_led0"; 90 + pins = "gpio6"; 91 + }; 92 + 93 + pinctrl_robosw_led1: robosw_led1-pins { 94 + function = "robosw_led1"; 95 + pins = "gpio7"; 96 + }; 97 + 98 + pinctrl_inet_led: inet_led-pins { 99 + function = "inet_led"; 100 + pins = "gpio8"; 101 + }; 102 + 103 + pinctrl_spi_cs2: spi_cs2-pins { 104 + function = "spi_cs2"; 105 + pins = "gpio9"; 106 + }; 107 + 108 + pinctrl_spi_cs3: spi_cs3-pins { 109 + function = "spi_cs3"; 110 + pins = "gpio10"; 111 + }; 112 + 113 + pinctrl_ntr_pulse: ntr_pulse-pins { 114 + function = "ntr_pulse"; 115 + pins = "gpio11"; 116 + }; 117 + 118 + pinctrl_uart1_scts: uart1_scts-pins { 119 + function = "uart1_scts"; 120 + pins = "gpio12"; 121 + }; 122 + 123 + pinctrl_uart1_srts: uart1_srts-pins { 124 + function = "uart1_srts"; 125 + pins = "gpio13"; 126 + }; 127 + 128 + pinctrl_uart1: uart1-pins { 129 + pinctrl_uart1_sdin: uart1_sdin-pins { 130 + function = "uart1_sdin"; 131 + pins = "gpio14"; 132 + }; 133 + 134 + pinctrl_uart1_sdout: uart1_sdout-pins { 135 + function = "uart1_sdout"; 136 + pins = "gpio15"; 137 + }; 138 + }; 139 + 140 + pinctrl_adsl_spi: adsl_spi-pins { 141 + pinctrl_adsl_spi_miso: adsl_spi_miso-pins { 142 + function = "adsl_spi_miso"; 143 + pins = "gpio16"; 144 + }; 145 + 146 + pinctrl_adsl_spi_mosi: adsl_spi_mosi-pins { 147 + function = "adsl_spi_mosi"; 148 + pins = "gpio17"; 149 + }; 150 + 151 + pinctrl_adsl_spi_clk: adsl_spi_clk-pins { 152 + function = "adsl_spi_clk"; 153 + pins = "gpio18"; 154 + }; 155 + 156 + pinctrl_adsl_spi_cs: adsl_spi_cs-pins { 157 + function = "adsl_spi_cs"; 158 + pins = "gpio19"; 159 + }; 160 + }; 161 + 162 + pinctrl_ephy0_led: ephy0_led-pins { 163 + function = "ephy0_led"; 164 + pins = "gpio20"; 165 + }; 166 + 167 + pinctrl_ephy1_led: ephy1_led-pins { 168 + function = "ephy1_led"; 169 + pins = "gpio21"; 170 + }; 171 + 172 + pinctrl_ephy2_led: ephy2_led-pins { 173 + function = "ephy2_led"; 174 + pins = "gpio22"; 175 + }; 176 + 177 + pinctrl_ephy3_led: ephy3_led-pins { 178 + function = "ephy3_led"; 179 + pins = "gpio23"; 180 + }; 181 + 182 + pinctrl_ext_irq0: ext_irq0-pins { 183 + function = "ext_irq0"; 184 + pins = "gpio24"; 185 + }; 186 + 187 + pinctrl_ext_irq1: ext_irq1-pins { 188 + function = "ext_irq1"; 189 + pins = "gpio25"; 190 + }; 191 + 192 + pinctrl_ext_irq2: ext_irq2-pins { 193 + function = "ext_irq2"; 194 + pins = "gpio26"; 195 + }; 196 + 197 + pinctrl_ext_irq3: ext_irq3-pins { 198 + function = "ext_irq3"; 199 + pins = "gpio27"; 200 + }; 201 + 202 + pinctrl_nand: nand-pins { 203 + function = "nand"; 204 + group = "nand_grp"; 205 + }; 206 + };
+217
Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/brcm,bcm6368-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM6368 pin controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + description: 14 + Bindings for Broadcom's BCM6368 memory-mapped pin controller. 15 + 16 + properties: 17 + compatible: 18 + const: brcm,bcm6368-pinctrl 19 + 20 + reg: 21 + maxItems: 2 22 + 23 + patternProperties: 24 + '-pins$': 25 + type: object 26 + $ref: pinmux-node.yaml# 27 + 28 + properties: 29 + function: 30 + enum: [ analog_afe_0, analog_afe_1, sys_irq, serial_led_data, 31 + serial_led_clk, inet_led, ephy0_led, ephy1_led, ephy2_led, 32 + ephy3_led, robosw_led_data, robosw_led_clk, robosw_led0, 33 + robosw_led1, usb_device_led, pci_req1, pci_gnt1, pci_intb, 34 + pci_req0, pci_gnt0, pcmcia_cd1, pcmcia_cd2, pcmcia_vs1, 35 + pcmcia_vs2, ebi_cs2, ebi_cs3, spi_cs2, spi_cs3, spi_cs4, 36 + spi_cs5, uart1 ] 37 + 38 + pins: 39 + enum: [ gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, 40 + gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio14, 41 + gpio16, gpio17, gpio18, gpio19, gpio20, gpio22, gpio23, 42 + gpio24, gpio25, gpio26, gpio27, gpio28, gpio29, gpio30, 43 + gpio31, uart1_grp ] 44 + 45 + required: 46 + - compatible 47 + - reg 48 + 49 + additionalProperties: false 50 + 51 + examples: 52 + - | 53 + pinctrl@18 { 54 + compatible = "brcm,bcm6368-pinctrl"; 55 + reg = <0x18 0x4>, <0x38 0x4>; 56 + 57 + pinctrl_analog_afe_0: analog_afe_0-pins { 58 + function = "analog_afe_0"; 59 + pins = "gpio0"; 60 + }; 61 + 62 + pinctrl_analog_afe_1: analog_afe_1-pins { 63 + function = "analog_afe_1"; 64 + pins = "gpio1"; 65 + }; 66 + 67 + pinctrl_sys_irq: sys_irq-pins { 68 + function = "sys_irq"; 69 + pins = "gpio2"; 70 + }; 71 + 72 + pinctrl_serial_led: serial_led-pins { 73 + pinctrl_serial_led_data: serial_led_data-pins { 74 + function = "serial_led_data"; 75 + pins = "gpio3"; 76 + }; 77 + 78 + pinctrl_serial_led_clk: serial_led_clk-pins { 79 + function = "serial_led_clk"; 80 + pins = "gpio4"; 81 + }; 82 + }; 83 + 84 + pinctrl_inet_led: inet_led-pins { 85 + function = "inet_led"; 86 + pins = "gpio5"; 87 + }; 88 + 89 + pinctrl_ephy0_led: ephy0_led-pins { 90 + function = "ephy0_led"; 91 + pins = "gpio6"; 92 + }; 93 + 94 + pinctrl_ephy1_led: ephy1_led-pins { 95 + function = "ephy1_led"; 96 + pins = "gpio7"; 97 + }; 98 + 99 + pinctrl_ephy2_led: ephy2_led-pins { 100 + function = "ephy2_led"; 101 + pins = "gpio8"; 102 + }; 103 + 104 + pinctrl_ephy3_led: ephy3_led-pins { 105 + function = "ephy3_led"; 106 + pins = "gpio9"; 107 + }; 108 + 109 + pinctrl_robosw_led_data: robosw_led_data-pins { 110 + function = "robosw_led_data"; 111 + pins = "gpio10"; 112 + }; 113 + 114 + pinctrl_robosw_led_clk: robosw_led_clk-pins { 115 + function = "robosw_led_clk"; 116 + pins = "gpio11"; 117 + }; 118 + 119 + pinctrl_robosw_led0: robosw_led0-pins { 120 + function = "robosw_led0"; 121 + pins = "gpio12"; 122 + }; 123 + 124 + pinctrl_robosw_led1: robosw_led1-pins { 125 + function = "robosw_led1"; 126 + pins = "gpio13"; 127 + }; 128 + 129 + pinctrl_usb_device_led: usb_device_led-pins { 130 + function = "usb_device_led"; 131 + pins = "gpio14"; 132 + }; 133 + 134 + pinctrl_pci: pci-pins { 135 + pinctrl_pci_req1: pci_req1-pins { 136 + function = "pci_req1"; 137 + pins = "gpio16"; 138 + }; 139 + 140 + pinctrl_pci_gnt1: pci_gnt1-pins { 141 + function = "pci_gnt1"; 142 + pins = "gpio17"; 143 + }; 144 + 145 + pinctrl_pci_intb: pci_intb-pins { 146 + function = "pci_intb"; 147 + pins = "gpio18"; 148 + }; 149 + 150 + pinctrl_pci_req0: pci_req0-pins { 151 + function = "pci_req0"; 152 + pins = "gpio19"; 153 + }; 154 + 155 + pinctrl_pci_gnt0: pci_gnt0-pins { 156 + function = "pci_gnt0"; 157 + pins = "gpio20"; 158 + }; 159 + }; 160 + 161 + pinctrl_pcmcia: pcmcia-pins { 162 + pinctrl_pcmcia_cd1: pcmcia_cd1-pins { 163 + function = "pcmcia_cd1"; 164 + pins = "gpio22"; 165 + }; 166 + 167 + pinctrl_pcmcia_cd2: pcmcia_cd2-pins { 168 + function = "pcmcia_cd2"; 169 + pins = "gpio23"; 170 + }; 171 + 172 + pinctrl_pcmcia_vs1: pcmcia_vs1-pins { 173 + function = "pcmcia_vs1"; 174 + pins = "gpio24"; 175 + }; 176 + 177 + pinctrl_pcmcia_vs2: pcmcia_vs2-pins { 178 + function = "pcmcia_vs2"; 179 + pins = "gpio25"; 180 + }; 181 + }; 182 + 183 + pinctrl_ebi_cs2: ebi_cs2-pins { 184 + function = "ebi_cs2"; 185 + pins = "gpio26"; 186 + }; 187 + 188 + pinctrl_ebi_cs3: ebi_cs3-pins { 189 + function = "ebi_cs3"; 190 + pins = "gpio27"; 191 + }; 192 + 193 + pinctrl_spi_cs2: spi_cs2-pins { 194 + function = "spi_cs2"; 195 + pins = "gpio28"; 196 + }; 197 + 198 + pinctrl_spi_cs3: spi_cs3-pins { 199 + function = "spi_cs3"; 200 + pins = "gpio29"; 201 + }; 202 + 203 + pinctrl_spi_cs4: spi_cs4-pins { 204 + function = "spi_cs4"; 205 + pins = "gpio30"; 206 + }; 207 + 208 + pinctrl_spi_cs5: spi_cs5-pins { 209 + function = "spi_cs5"; 210 + pins = "gpio31"; 211 + }; 212 + 213 + pinctrl_uart1: uart1-pins { 214 + function = "uart1"; 215 + group = "uart1_grp"; 216 + }; 217 + };
+19 -4
Documentation/devicetree/bindings/pinctrl/ingenic,pinctrl.yaml
··· 17 17 naming scheme "PxN" where x is a character identifying the GPIO port with 18 18 which the pin is associated and N is an integer from 0 to 31 identifying the 19 19 pin within that GPIO port. For example PA0 is the first pin in GPIO port A, 20 - and PB31 is the last pin in GPIO port B. The JZ4740, the X1000 and the X1830 21 - contains 4 GPIO ports, PA to PD, for a total of 128 pins. The JZ4760, the 22 - JZ4770 and the JZ4780 contains 6 GPIO ports, PA to PF, for a total of 192 23 - pins. 20 + and PB31 is the last pin in GPIO port B. The JZ4730, the JZ4740, the JZ4725B, 21 + the X1000 and the X1830 contains 4 GPIO ports, PA to PD, for a total of 128 22 + pins. The X2000 contains 5 GPIO ports, PA to PE, for a total of 160 pins. 23 + The JZ4750, the JZ4755 the JZ4760, the JZ4770 and the JZ4780 contains 6 GPIO 24 + ports, PA to PF, for a total of 192 pins. The JZ4775 contains 7 GPIO ports, 25 + PA to PG, for a total of 224 pins. 24 26 25 27 maintainers: 26 28 - Paul Cercueil <paul@crapouillou.net> ··· 34 32 compatible: 35 33 oneOf: 36 34 - enum: 35 + - ingenic,jz4730-pinctrl 37 36 - ingenic,jz4740-pinctrl 38 37 - ingenic,jz4725b-pinctrl 38 + - ingenic,jz4750-pinctrl 39 + - ingenic,jz4755-pinctrl 39 40 - ingenic,jz4760-pinctrl 40 41 - ingenic,jz4770-pinctrl 42 + - ingenic,jz4775-pinctrl 41 43 - ingenic,jz4780-pinctrl 42 44 - ingenic,x1000-pinctrl 43 45 - ingenic,x1500-pinctrl 44 46 - ingenic,x1830-pinctrl 47 + - ingenic,x2000-pinctrl 45 48 - items: 46 49 - const: ingenic,jz4760b-pinctrl 47 50 - const: ingenic,jz4760-pinctrl 48 51 - items: 49 52 - const: ingenic,x1000e-pinctrl 50 53 - const: ingenic,x1000-pinctrl 54 + - items: 55 + - const: ingenic,x2000e-pinctrl 56 + - const: ingenic,x2000-pinctrl 51 57 52 58 reg: 53 59 maxItems: 1 ··· 72 62 properties: 73 63 compatible: 74 64 enum: 65 + - ingenic,jz4730-gpio 75 66 - ingenic,jz4740-gpio 76 67 - ingenic,jz4725b-gpio 68 + - ingenic,jz4750-gpio 69 + - ingenic,jz4755-gpio 77 70 - ingenic,jz4760-gpio 78 71 - ingenic,jz4770-gpio 72 + - ingenic,jz4775-gpio 79 73 - ingenic,jz4780-gpio 80 74 - ingenic,x1000-gpio 81 75 - ingenic,x1500-gpio 82 76 - ingenic,x1830-gpio 77 + - ingenic,x2000-gpio 83 78 84 79 reg: 85 80 items:
+151
Documentation/devicetree/bindings/pinctrl/pinctrl-mt8195.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/pinctrl-mt8195.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek MT8195 Pin Controller 8 + 9 + maintainers: 10 + - Sean Wang <sean.wang@mediatek.com> 11 + 12 + description: | 13 + The Mediatek's Pin controller is used to control SoC pins. 14 + 15 + properties: 16 + compatible: 17 + const: mediatek,mt8195-pinctrl 18 + 19 + gpio-controller: true 20 + 21 + '#gpio-cells': 22 + description: | 23 + Number of cells in GPIO specifier. Since the generic GPIO binding is used, 24 + the amount of cells must be specified as 2. See the below 25 + mentioned gpio binding representation for description of particular cells. 26 + const: 2 27 + 28 + gpio-ranges: 29 + description: gpio valid number range. 30 + maxItems: 1 31 + 32 + reg: 33 + description: | 34 + Physical address base for gpio base registers. There are 8 GPIO 35 + physical address base in mt8195. 36 + maxItems: 8 37 + 38 + reg-names: 39 + description: | 40 + Gpio base register names. 41 + maxItems: 8 42 + 43 + interrupt-controller: true 44 + 45 + '#interrupt-cells': 46 + const: 2 47 + 48 + interrupts: 49 + description: The interrupt outputs to sysirq. 50 + maxItems: 1 51 + 52 + #PIN CONFIGURATION NODES 53 + patternProperties: 54 + '-pins$': 55 + type: object 56 + description: | 57 + A pinctrl node should contain at least one subnodes representing the 58 + pinctrl groups available on the machine. Each subnode will list the 59 + pins it needs, and how they should be configured, with regard to muxer 60 + configuration, pullups, drive strength, input enable/disable and 61 + input schmitt. 62 + An example of using macro: 63 + pincontroller { 64 + /* GPIO0 set as multifunction GPIO0 */ 65 + gpio_pin { 66 + pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 67 + }; 68 + /* GPIO8 set as multifunction SDA0 */ 69 + i2c0_pin { 70 + pinmux = <PINMUX_GPIO8__FUNC_SDA0>; 71 + }; 72 + }; 73 + $ref: "pinmux-node.yaml" 74 + 75 + properties: 76 + pinmux: 77 + description: | 78 + Integer array, represents gpio pin number and mux setting. 79 + Supported pin number and mux varies for different SoCs, and are defined 80 + as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly. 81 + 82 + drive-strength: 83 + description: | 84 + It can support some arguments which is from 0 to 7. It can only support 85 + 2/4/6/8/10/12/14/16mA in mt8195. 86 + enum: [0, 1, 2, 3, 4, 5, 6, 7] 87 + 88 + bias-pull-down: true 89 + 90 + bias-pull-up: true 91 + 92 + bias-disable: true 93 + 94 + output-high: true 95 + 96 + output-low: true 97 + 98 + input-enable: true 99 + 100 + input-disable: true 101 + 102 + input-schmitt-enable: true 103 + 104 + input-schmitt-disable: true 105 + 106 + required: 107 + - pinmux 108 + 109 + additionalProperties: false 110 + 111 + required: 112 + - compatible 113 + - reg 114 + - interrupts 115 + - interrupt-controller 116 + - '#interrupt-cells' 117 + - gpio-controller 118 + - '#gpio-cells' 119 + - gpio-ranges 120 + 121 + additionalProperties: false 122 + 123 + examples: 124 + - | 125 + #include <dt-bindings/pinctrl/mt8195-pinfunc.h> 126 + #include <dt-bindings/interrupt-controller/arm-gic.h> 127 + pio: pinctrl@10005000 { 128 + compatible = "mediatek,mt8195-pinctrl"; 129 + reg = <0x10005000 0x1000>, 130 + <0x11d10000 0x1000>, 131 + <0x11d30000 0x1000>, 132 + <0x11d40000 0x1000>, 133 + <0x11e20000 0x1000>, 134 + <0x11eb0000 0x1000>, 135 + <0x11f40000 0x1000>, 136 + <0x1000b000 0x1000>; 137 + reg-names = "iocfg0", "iocfg_bm", "iocfg_bl", 138 + "iocfg_br", "iocfg_lm", "iocfg_rb", 139 + "iocfg_tl", "eint"; 140 + gpio-controller; 141 + #gpio-cells = <2>; 142 + gpio-ranges = <&pio 0 0 144>; 143 + interrupt-controller; 144 + interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>; 145 + #interrupt-cells = <2>; 146 + 147 + pio-pins { 148 + pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; 149 + output-low; 150 + }; 151 + };
+14
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
··· 27 27 "qcom,pm660l-gpio" 28 28 "qcom,pm8150-gpio" 29 29 "qcom,pm8150b-gpio" 30 + "qcom,pm8350-gpio" 31 + "qcom,pm8350b-gpio" 32 + "qcom,pm8350c-gpio" 33 + "qcom,pmk8350-gpio" 34 + "qcom,pmr735a-gpio" 35 + "qcom,pmr735b-gpio" 30 36 "qcom,pm6150-gpio" 31 37 "qcom,pm6150l-gpio" 38 + "qcom,pm8008-gpio" 32 39 "qcom,pmx55-gpio" 33 40 34 41 And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio" ··· 116 109 and gpio8) 117 110 gpio1-gpio12 for pm8150b (holes on gpio3, gpio4, gpio7) 118 111 gpio1-gpio12 for pm8150l (hole on gpio7) 112 + gpio1-gpio10 for pm8350 113 + gpio1-gpio8 for pm8350b 114 + gpio1-gpio9 for pm8350c 115 + gpio1-gpio4 for pmk8350 116 + gpio1-gpio4 for pmr735a 117 + gpio1-gpio4 for pmr735b 119 118 gpio1-gpio10 for pm6150 120 119 gpio1-gpio12 for pm6150l 120 + gpio1-gpio2 for pm8008 121 121 gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10 122 122 and gpio11) 123 123
+1
Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.txt
··· 33 33 "rockchip,rk3328-pinctrl": for Rockchip RK3328 34 34 "rockchip,rk3368-pinctrl": for Rockchip RK3368 35 35 "rockchip,rk3399-pinctrl": for Rockchip RK3399 36 + "rockchip,rk3568-pinctrl": for Rockchip RK3568 36 37 37 38 - rockchip,grf: phandle referencing a syscon providing the 38 39 "general register files"
+336
Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Xilinx ZynqMP Pinctrl 8 + 9 + maintainers: 10 + - Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com> 11 + - Rajan Vaja <rajan.vaja@xilinx.com> 12 + 13 + description: | 14 + Please refer to pinctrl-bindings.txt in this directory for details of the 15 + common pinctrl bindings used by client devices, including the meaning of the 16 + phrase "pin configuration node". 17 + 18 + ZynqMP's pin configuration nodes act as a container for an arbitrary number of 19 + subnodes. Each of these subnodes represents some desired configuration for a 20 + pin, a group, or a list of pins or groups. This configuration can include the 21 + mux function to select on those pin(s)/group(s), and various pin configuration 22 + parameters, such as pull-up, slew rate, etc. 23 + 24 + Each configuration node can consist of multiple nodes describing the pinmux and 25 + pinconf options. Those nodes can be pinmux nodes or pinconf nodes. 26 + 27 + The name of each subnode is not important; all subnodes should be enumerated 28 + and processed purely based on their content. 29 + 30 + properties: 31 + compatible: 32 + const: xlnx,zynqmp-pinctrl 33 + 34 + patternProperties: 35 + '^(.*-)?(default|gpio)$': 36 + type: object 37 + patternProperties: 38 + '^mux': 39 + type: object 40 + description: 41 + Pinctrl node's client devices use subnodes for pin muxes, 42 + which in turn use below standard properties. 43 + $ref: pinmux-node.yaml# 44 + 45 + properties: 46 + groups: 47 + description: 48 + List of groups to select (either this or "pins" must be 49 + specified), available groups for this subnode. 50 + items: 51 + enum: [ethernet0_0_grp, ethernet1_0_grp, ethernet2_0_grp, 52 + ethernet3_0_grp, gemtsu0_0_grp, gemtsu0_1_grp, 53 + gemtsu0_2_grp, mdio0_0_grp, mdio1_0_grp, 54 + mdio1_1_grp, mdio2_0_grp, mdio3_0_grp, 55 + qspi0_0_grp, qspi_ss_0_grp, qspi_fbclk_0_grp, 56 + spi0_0_grp, spi0_ss_0_grp, spi0_ss_1_grp, 57 + spi0_ss_2_grp, spi0_1_grp, spi0_ss_3_grp, 58 + spi0_ss_4_grp, spi0_ss_5_grp, spi0_2_grp, 59 + spi0_ss_6_grp, spi0_ss_7_grp, spi0_ss_8_grp, 60 + spi0_3_grp, spi0_ss_9_grp, spi0_ss_10_grp, 61 + spi0_ss_11_grp, spi0_4_grp, spi0_ss_12_grp, 62 + spi0_ss_13_grp, spi0_ss_14_grp, spi0_5_grp, 63 + spi0_ss_15_grp, spi0_ss_16_grp, spi0_ss_17_grp, 64 + spi1_0_grp, spi1_ss_0_grp, spi1_ss_1_grp, 65 + spi1_ss_2_grp, spi1_1_grp, spi1_ss_3_grp, 66 + spi1_ss_4_grp, spi1_ss_5_grp, spi1_2_grp, 67 + spi1_ss_6_grp, spi1_ss_7_grp, spi1_ss_8_grp, 68 + spi1_3_grp, spi1_ss_9_grp, spi1_ss_10_grp, 69 + spi1_ss_11_grp, spi1_4_grp, spi1_ss_12_grp, 70 + spi1_ss_13_grp, spi1_ss_14_grp, spi1_5_grp, 71 + spi1_ss_15_grp, spi1_ss_16_grp, spi1_ss_17_grp, 72 + sdio0_0_grp, sdio0_1_grp, sdio0_2_grp, 73 + sdio0_3_grp, sdio0_4_grp, sdio0_5_grp, 74 + sdio0_6_grp, sdio0_7_grp, sdio0_8_grp, 75 + sdio0_9_grp, sdio0_10_grp, sdio0_11_grp, 76 + sdio0_12_grp, sdio0_13_grp, sdio0_14_grp, 77 + sdio0_15_grp, sdio0_16_grp, sdio0_17_grp, 78 + sdio0_18_grp, sdio0_19_grp, sdio0_20_grp, 79 + sdio0_21_grp, sdio0_22_grp, sdio0_23_grp, 80 + sdio0_24_grp, sdio0_25_grp, sdio0_26_grp, 81 + sdio0_27_grp, sdio0_28_grp, sdio0_29_grp, 82 + sdio0_30_grp, sdio0_31_grp, sdio0_32_grp, 83 + sdio0_pc_0_grp, sdio0_cd_0_grp, sdio0_wp_0_grp, 84 + sdio0_pc_1_grp, sdio0_cd_1_grp, sdio0_wp_1_grp, 85 + sdio0_pc_2_grp, sdio0_cd_2_grp, sdio0_wp_2_grp, 86 + sdio1_0_grp, sdio1_1_grp, sdio1_2_grp, 87 + sdio1_3_grp, sdio1_4_grp, sdio1_5_grp, 88 + sdio1_6_grp, sdio1_7_grp, sdio1_8_grp, 89 + sdio1_9_grp, sdio1_10_grp, sdio1_11_grp, 90 + sdio1_12_grp, sdio1_13_grp, sdio1_14_grp, 91 + sdio1_15_grp, sdio1_pc_0_grp, sdio1_cd_0_grp, 92 + sdio1_wp_0_grp, sdio1_pc_1_grp, sdio1_cd_1_grp, 93 + sdio1_wp_1_grp, nand0_0_grp, nand0_ce_0_grp, 94 + nand0_rb_0_grp, nand0_dqs_0_grp, nand0_ce_1_grp, 95 + nand0_rb_1_grp, nand0_dqs_1_grp, can0_0_grp, 96 + can0_1_grp, can0_2_grp, can0_3_grp, 97 + can0_4_grp, can0_5_grp, can0_6_grp, 98 + can0_7_grp, can0_8_grp, can0_9_grp, 99 + can0_10_grp, can0_11_grp, can0_12_grp, 100 + can0_13_grp, can0_14_grp, can0_15_grp, 101 + can0_16_grp, can0_17_grp, can0_18_grp, 102 + can1_0_grp, can1_1_grp, can1_2_grp, 103 + can1_3_grp, can1_4_grp, can1_5_grp, 104 + can1_6_grp, can1_7_grp, can1_8_grp, 105 + can1_9_grp, can1_10_grp, can1_11_grp, 106 + can1_12_grp, can1_13_grp, can1_14_grp, 107 + can1_15_grp, can1_16_grp, can1_17_grp, 108 + can1_18_grp, can1_19_grp, uart0_0_grp, 109 + uart0_1_grp, uart0_2_grp, uart0_3_grp, 110 + uart0_4_grp, uart0_5_grp, uart0_6_grp, 111 + uart0_7_grp, uart0_8_grp, uart0_9_grp, 112 + uart0_10_grp, uart0_11_grp, uart0_12_grp, 113 + uart0_13_grp, uart0_14_grp, uart0_15_grp, 114 + uart0_16_grp, uart0_17_grp, uart0_18_grp, 115 + uart1_0_grp, uart1_1_grp, uart1_2_grp, 116 + uart1_3_grp, uart1_4_grp, uart1_5_grp, 117 + uart1_6_grp, uart1_7_grp, uart1_8_grp, 118 + uart1_9_grp, uart1_10_grp, uart1_11_grp, 119 + uart1_12_grp, uart1_13_grp, uart1_14_grp, 120 + uart1_15_grp, uart1_16_grp, uart1_17_grp, 121 + uart1_18_grp, i2c0_0_grp, i2c0_1_grp, 122 + i2c0_2_grp, i2c0_3_grp, i2c0_4_grp, 123 + i2c0_5_grp, i2c0_6_grp, i2c0_7_grp, 124 + i2c0_8_grp, i2c0_9_grp, i2c0_10_grp, 125 + i2c0_11_grp, i2c0_12_grp, i2c0_13_grp, 126 + i2c0_14_grp, i2c0_15_grp, i2c0_16_grp, 127 + i2c0_17_grp, i2c0_18_grp, i2c1_0_grp, 128 + i2c1_1_grp, i2c1_2_grp, i2c1_3_grp, 129 + i2c1_4_grp, i2c1_5_grp, i2c1_6_grp, 130 + i2c1_7_grp, i2c1_8_grp, i2c1_9_grp, 131 + i2c1_10_grp, i2c1_11_grp, i2c1_12_grp, 132 + i2c1_13_grp, i2c1_14_grp, i2c1_15_grp, 133 + i2c1_16_grp, i2c1_17_grp, i2c1_18_grp, 134 + i2c1_19_grp, ttc0_clk_0_grp, ttc0_wav_0_grp, 135 + ttc0_clk_1_grp, ttc0_wav_1_grp, ttc0_clk_2_grp, 136 + ttc0_wav_2_grp, ttc0_clk_3_grp, ttc0_wav_3_grp, 137 + ttc0_clk_4_grp, ttc0_wav_4_grp, ttc0_clk_5_grp, 138 + ttc0_wav_5_grp, ttc0_clk_6_grp, ttc0_wav_6_grp, 139 + ttc0_clk_7_grp, ttc0_wav_7_grp, ttc0_clk_8_grp, 140 + ttc0_wav_8_grp, ttc1_clk_0_grp, ttc1_wav_0_grp, 141 + ttc1_clk_1_grp, ttc1_wav_1_grp, ttc1_clk_2_grp, 142 + ttc1_wav_2_grp, ttc1_clk_3_grp, ttc1_wav_3_grp, 143 + ttc1_clk_4_grp, ttc1_wav_4_grp, ttc1_clk_5_grp, 144 + ttc1_wav_5_grp, ttc1_clk_6_grp, ttc1_wav_6_grp, 145 + ttc1_clk_7_grp, ttc1_wav_7_grp, ttc1_clk_8_grp, 146 + ttc1_wav_8_grp, ttc2_clk_0_grp, ttc2_wav_0_grp, 147 + ttc2_clk_1_grp, ttc2_wav_1_grp, ttc2_clk_2_grp, 148 + ttc2_wav_2_grp, ttc2_clk_3_grp, ttc2_wav_3_grp, 149 + ttc2_clk_4_grp, ttc2_wav_4_grp, ttc2_clk_5_grp, 150 + ttc2_wav_5_grp, ttc2_clk_6_grp, ttc2_wav_6_grp, 151 + ttc2_clk_7_grp, ttc2_wav_7_grp, ttc2_clk_8_grp, 152 + ttc2_wav_8_grp, ttc3_clk_0_grp, ttc3_wav_0_grp, 153 + ttc3_clk_1_grp, ttc3_wav_1_grp, ttc3_clk_2_grp, 154 + ttc3_wav_2_grp, ttc3_clk_3_grp, ttc3_wav_3_grp, 155 + ttc3_clk_4_grp, ttc3_wav_4_grp, ttc3_clk_5_grp, 156 + ttc3_wav_5_grp, ttc3_clk_6_grp, ttc3_wav_6_grp, 157 + ttc3_clk_7_grp, ttc3_wav_7_grp, ttc3_clk_8_grp, 158 + ttc3_wav_8_grp, swdt0_clk_0_grp, swdt0_rst_0_grp, 159 + swdt0_clk_1_grp, swdt0_rst_1_grp, swdt0_clk_2_grp, 160 + swdt0_rst_2_grp, swdt0_clk_3_grp, swdt0_rst_3_grp, 161 + swdt0_clk_4_grp, swdt0_rst_4_grp, swdt0_clk_5_grp, 162 + swdt0_rst_5_grp, swdt0_clk_6_grp, swdt0_rst_6_grp, 163 + swdt0_clk_7_grp, swdt0_rst_7_grp, swdt0_clk_8_grp, 164 + swdt0_rst_8_grp, swdt0_clk_9_grp, swdt0_rst_9_grp, 165 + swdt0_clk_10_grp, swdt0_rst_10_grp, swdt0_clk_11_grp, 166 + swdt0_rst_11_grp, swdt0_clk_12_grp, swdt0_rst_12_grp, 167 + swdt1_clk_0_grp, swdt1_rst_0_grp, swdt1_clk_1_grp, 168 + swdt1_rst_1_grp, swdt1_clk_2_grp, swdt1_rst_2_grp, 169 + swdt1_clk_3_grp, swdt1_rst_3_grp, swdt1_clk_4_grp, 170 + swdt1_rst_4_grp, swdt1_clk_5_grp, swdt1_rst_5_grp, 171 + swdt1_clk_6_grp, swdt1_rst_6_grp, swdt1_clk_7_grp, 172 + swdt1_rst_7_grp, swdt1_clk_8_grp, swdt1_rst_8_grp, 173 + swdt1_clk_9_grp, swdt1_rst_9_grp, swdt1_clk_10_grp, 174 + swdt1_rst_10_grp, swdt1_clk_11_grp, swdt1_rst_11_grp, 175 + swdt1_clk_12_grp, swdt1_rst_12_grp, gpio0_0_grp, 176 + gpio0_1_grp, gpio0_2_grp, gpio0_3_grp, 177 + gpio0_4_grp, gpio0_5_grp, gpio0_6_grp, 178 + gpio0_7_grp, gpio0_8_grp, gpio0_9_grp, 179 + gpio0_10_grp, gpio0_11_grp, gpio0_12_grp, 180 + gpio0_13_grp, gpio0_14_grp, gpio0_15_grp, 181 + gpio0_16_grp, gpio0_17_grp, gpio0_18_grp, 182 + gpio0_19_grp, gpio0_20_grp, gpio0_21_grp, 183 + gpio0_22_grp, gpio0_23_grp, gpio0_24_grp, 184 + gpio0_25_grp, gpio0_26_grp, gpio0_27_grp, 185 + gpio0_28_grp, gpio0_29_grp, gpio0_30_grp, 186 + gpio0_31_grp, gpio0_32_grp, gpio0_33_grp, 187 + gpio0_34_grp, gpio0_35_grp, gpio0_36_grp, 188 + gpio0_37_grp, gpio0_38_grp, gpio0_39_grp, 189 + gpio0_40_grp, gpio0_41_grp, gpio0_42_grp, 190 + gpio0_43_grp, gpio0_44_grp, gpio0_45_grp, 191 + gpio0_46_grp, gpio0_47_grp, gpio0_48_grp, 192 + gpio0_49_grp, gpio0_50_grp, gpio0_51_grp, 193 + gpio0_52_grp, gpio0_53_grp, gpio0_54_grp, 194 + gpio0_55_grp, gpio0_56_grp, gpio0_57_grp, 195 + gpio0_58_grp, gpio0_59_grp, gpio0_60_grp, 196 + gpio0_61_grp, gpio0_62_grp, gpio0_63_grp, 197 + gpio0_64_grp, gpio0_65_grp, gpio0_66_grp, 198 + gpio0_67_grp, gpio0_68_grp, gpio0_69_grp, 199 + gpio0_70_grp, gpio0_71_grp, gpio0_72_grp, 200 + gpio0_73_grp, gpio0_74_grp, gpio0_75_grp, 201 + gpio0_76_grp, gpio0_77_grp, usb0_0_grp, 202 + usb1_0_grp, pmu0_0_grp, pmu0_1_grp, 203 + pmu0_2_grp, pmu0_3_grp, pmu0_4_grp, 204 + pmu0_5_grp, pmu0_6_grp, pmu0_7_grp, 205 + pmu0_8_grp, pmu0_9_grp, pmu0_10_grp, 206 + pmu0_11_grp, pcie0_0_grp, pcie0_1_grp, 207 + pcie0_2_grp, pcie0_3_grp, pcie0_4_grp, 208 + pcie0_5_grp, pcie0_6_grp, pcie0_7_grp, 209 + csu0_0_grp, csu0_1_grp, csu0_2_grp, 210 + csu0_3_grp, csu0_4_grp, csu0_5_grp, 211 + csu0_6_grp, csu0_7_grp, csu0_8_grp, 212 + csu0_9_grp, csu0_10_grp, csu0_11_grp, 213 + dpaux0_0_grp, dpaux0_1_grp, dpaux0_2_grp, 214 + dpaux0_3_grp, pjtag0_0_grp, pjtag0_1_grp, 215 + pjtag0_2_grp, pjtag0_3_grp, pjtag0_4_grp, 216 + pjtag0_5_grp, trace0_0_grp, trace0_clk_0_grp, 217 + trace0_1_grp, trace0_clk_1_grp, trace0_2_grp, 218 + trace0_clk_2_grp, testscan0_0_grp] 219 + maxItems: 78 220 + 221 + function: 222 + description: 223 + Specify the alternative function to be configured for the 224 + given pin groups. 225 + enum: [ethernet0, ethernet1, ethernet2, ethernet3, gemtsu0, usb0, usb1, mdio0, 226 + mdio1, mdio2, mdio3, qspi0, qspi_fbclk, qspi_ss, spi0, spi1, spi0_ss, 227 + spi1_ss, sdio0, sdio0_pc, sdio0_wp, sdio0_cd, sdio1, sdio1_pc, sdio1_wp, 228 + sdio1_cd, nand0, nand0_ce, nand0_rb, nand0_dqs, can0, can1, uart0, uart1, 229 + i2c0, i2c1, ttc0_clk, ttc0_wav, ttc1_clk, ttc1_wav, ttc2_clk, ttc2_wav, 230 + ttc3_clk, ttc3_wav, swdt0_clk, swdt0_rst, swdt1_clk, swdt1_rst, gpio0, pmu0, 231 + pcie0, csu0, dpaux0, pjtag0, trace0, trace0_clk, testscan0] 232 + 233 + required: 234 + - groups 235 + - function 236 + 237 + additionalProperties: false 238 + 239 + '^conf': 240 + type: object 241 + description: 242 + Pinctrl node's client devices use subnodes for pin configurations, 243 + which in turn use the standard properties below. 244 + $ref: pincfg-node.yaml# 245 + 246 + properties: 247 + groups: 248 + description: 249 + List of pin groups as mentioned above. 250 + 251 + pins: 252 + description: 253 + List of pin names to select in this subnode. 254 + items: 255 + pattern: '^MIO([0-9]|[1-6][0-9]|7[0-7])$' 256 + maxItems: 78 257 + 258 + bias-pull-up: true 259 + 260 + bias-pull-down: true 261 + 262 + bias-disable: true 263 + 264 + input-schmitt-enable: true 265 + 266 + input-schmitt-disable: true 267 + 268 + bias-high-impedance: true 269 + 270 + low-power-enable: true 271 + 272 + low-power-disable: true 273 + 274 + slew-rate: 275 + enum: [0, 1] 276 + 277 + drive-strength: 278 + description: 279 + Selects the drive strength for MIO pins, in mA. 280 + enum: [2, 4, 8, 12] 281 + 282 + power-source: 283 + enum: [0, 1] 284 + 285 + oneOf: 286 + - required: [ groups ] 287 + - required: [ pins ] 288 + 289 + additionalProperties: false 290 + 291 + additionalProperties: false 292 + 293 + required: 294 + - compatible 295 + 296 + additionalProperties: false 297 + 298 + examples: 299 + - | 300 + #include <dt-bindings/pinctrl/pinctrl-zynqmp.h> 301 + zynqmp_firmware: zynqmp-firmware { 302 + pinctrl0: pinctrl { 303 + compatible = "xlnx,zynqmp-pinctrl"; 304 + 305 + pinctrl_uart1_default: uart1-default { 306 + mux { 307 + groups = "uart0_4_grp", "uart0_5_grp"; 308 + function = "uart0"; 309 + }; 310 + 311 + conf { 312 + groups = "uart0_4_grp"; 313 + slew-rate = <SLEW_RATE_SLOW>; 314 + power-source = <IO_STANDARD_LVCMOS18>; 315 + }; 316 + 317 + conf-rx { 318 + pins = "MIO18"; 319 + bias-pull-up; 320 + }; 321 + 322 + conf-tx { 323 + pins = "MIO19"; 324 + bias-disable; 325 + input-schmitt-disable; 326 + }; 327 + }; 328 + }; 329 + }; 330 + 331 + uart1 { 332 + pinctrl-names = "default"; 333 + pinctrl-0 = <&pinctrl_uart1_default>; 334 + }; 335 + 336 + ...
+1 -1
Documentation/driver-api/gpio/legacy.rst
··· 461 461 462 462 This is done by registering "ranges" of pins, which are essentially 463 463 cross-reference tables. These are described in 464 - Documentation/driver-api/pinctl.rst 464 + Documentation/driver-api/pin-control.rst 465 465 466 466 While the pin allocation is totally managed by the pinctrl subsystem, 467 467 gpio (under gpiolib) is still maintained by gpio drivers. It may happen
+1 -1
Documentation/driver-api/index.rst
··· 62 62 80211/index 63 63 uio-howto 64 64 firmware/index 65 - pinctl 65 + pin-control 66 66 gpio/index 67 67 md/index 68 68 media/index
+38 -1
Documentation/driver-api/pinctl.rst Documentation/driver-api/pin-control.rst
··· 1235 1235 foo->s = pinctrl_lookup_state(foo->p, PINCTRL_STATE_DEFAULT); 1236 1236 if (IS_ERR(foo->s)) { 1237 1237 /* FIXME: clean up "foo" here */ 1238 - return PTR_ERR(s); 1238 + return PTR_ERR(foo->s); 1239 1239 } 1240 1240 1241 1241 ret = pinctrl_select_state(foo->s); ··· 1428 1428 The above has to be done from process context. The reservation of the pins 1429 1429 will be done when the state is activated, so in effect one specific pin 1430 1430 can be used by different functions at different times on a running system. 1431 + 1432 + 1433 + Debugfs files 1434 + ============= 1435 + These files are created in ``/sys/kernel/debug/pinctrl``: 1436 + 1437 + - ``pinctrl-devices``: prints each pin controller device along with columns to 1438 + indicate support for pinmux and pinconf 1439 + 1440 + - ``pinctrl-handles``: prints each configured pin controller handle and the 1441 + corresponding pinmux maps 1442 + 1443 + - ``pinctrl-maps``: print all pinctrl maps 1444 + 1445 + A sub-directory is created inside of ``/sys/kernel/debug/pinctrl`` for each pin 1446 + controller device containing these files: 1447 + 1448 + - ``pins``: prints a line for each pin registered on the pin controller. The 1449 + pinctrl driver may add additional information such as register contents. 1450 + 1451 + - ``gpio-ranges``: print ranges that map gpio lines to pins on the controller 1452 + 1453 + - ``pingroups``: print all pin groups registered on the pin controller 1454 + 1455 + - ``pinconf-pins``: print pin config settings for each pin 1456 + 1457 + - ``pinconf-groups``: print pin config settings per pin group 1458 + 1459 + - ``pinmux-functions``: print each pin function along with the pin groups that 1460 + map to the pin function 1461 + 1462 + - ``pinmux-pins``: iterate through all pins and print mux owner, gpio owner 1463 + and if the pin is a hog 1464 + 1465 + - ``pinmux-select``: write to this file to activate a pin function for a group:: 1466 + 1467 + echo "<group-name function-name>" > pinmux-select
+1 -1
MAINTAINERS
··· 14371 14371 S: Maintained 14372 14372 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git 14373 14373 F: Documentation/devicetree/bindings/pinctrl/ 14374 - F: Documentation/driver-api/pinctl.rst 14374 + F: Documentation/driver-api/pin-control.rst 14375 14375 F: drivers/pinctrl/ 14376 14376 F: include/linux/pinctrl/ 14377 14377
-2
arch/arm64/Kconfig.platforms
··· 232 232 config ARCH_ROCKCHIP 233 233 bool "Rockchip Platforms" 234 234 select ARCH_HAS_RESET_CONTROLLER 235 - select GPIOLIB 236 235 select PINCTRL 237 - select PINCTRL_ROCKCHIP 238 236 select PM 239 237 select ROCKCHIP_TIMER 240 238 help
+114
drivers/firmware/xilinx/zynqmp.c
··· 812 812 EXPORT_SYMBOL_GPL(zynqmp_pm_fpga_get_status); 813 813 814 814 /** 815 + * zynqmp_pm_pinctrl_request - Request Pin from firmware 816 + * @pin: Pin number to request 817 + * 818 + * This function requests pin from firmware. 819 + * 820 + * Return: Returns status, either success or error+reason. 821 + */ 822 + int zynqmp_pm_pinctrl_request(const u32 pin) 823 + { 824 + return zynqmp_pm_invoke_fn(PM_PINCTRL_REQUEST, pin, 0, 0, 0, NULL); 825 + } 826 + EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_request); 827 + 828 + /** 829 + * zynqmp_pm_pinctrl_release - Inform firmware that Pin control is released 830 + * @pin: Pin number to release 831 + * 832 + * This function release pin from firmware. 833 + * 834 + * Return: Returns status, either success or error+reason. 835 + */ 836 + int zynqmp_pm_pinctrl_release(const u32 pin) 837 + { 838 + return zynqmp_pm_invoke_fn(PM_PINCTRL_RELEASE, pin, 0, 0, 0, NULL); 839 + } 840 + EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_release); 841 + 842 + /** 843 + * zynqmp_pm_pinctrl_get_function - Read function id set for the given pin 844 + * @pin: Pin number 845 + * @id: Buffer to store function ID 846 + * 847 + * This function provides the function currently set for the given pin. 848 + * 849 + * Return: Returns status, either success or error+reason 850 + */ 851 + int zynqmp_pm_pinctrl_get_function(const u32 pin, u32 *id) 852 + { 853 + u32 ret_payload[PAYLOAD_ARG_CNT]; 854 + int ret; 855 + 856 + if (!id) 857 + return -EINVAL; 858 + 859 + ret = zynqmp_pm_invoke_fn(PM_PINCTRL_GET_FUNCTION, pin, 0, 860 + 0, 0, ret_payload); 861 + *id = ret_payload[1]; 862 + 863 + return ret; 864 + } 865 + EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_function); 866 + 867 + /** 868 + * zynqmp_pm_pinctrl_set_function - Set requested function for the pin 869 + * @pin: Pin number 870 + * @id: Function ID to set 871 + * 872 + * This function sets requested function for the given pin. 873 + * 874 + * Return: Returns status, either success or error+reason. 875 + */ 876 + int zynqmp_pm_pinctrl_set_function(const u32 pin, const u32 id) 877 + { 878 + return zynqmp_pm_invoke_fn(PM_PINCTRL_SET_FUNCTION, pin, id, 879 + 0, 0, NULL); 880 + } 881 + EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_function); 882 + 883 + /** 884 + * zynqmp_pm_pinctrl_get_config - Get configuration parameter for the pin 885 + * @pin: Pin number 886 + * @param: Parameter to get 887 + * @value: Buffer to store parameter value 888 + * 889 + * This function gets requested configuration parameter for the given pin. 890 + * 891 + * Return: Returns status, either success or error+reason. 892 + */ 893 + int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param, 894 + u32 *value) 895 + { 896 + u32 ret_payload[PAYLOAD_ARG_CNT]; 897 + int ret; 898 + 899 + if (!value) 900 + return -EINVAL; 901 + 902 + ret = zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_GET, pin, param, 903 + 0, 0, ret_payload); 904 + *value = ret_payload[1]; 905 + 906 + return ret; 907 + } 908 + EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_config); 909 + 910 + /** 911 + * zynqmp_pm_pinctrl_set_config - Set configuration parameter for the pin 912 + * @pin: Pin number 913 + * @param: Parameter to set 914 + * @value: Parameter value to set 915 + * 916 + * This function sets requested configuration parameter for the given pin. 917 + * 918 + * Return: Returns status, either success or error+reason. 919 + */ 920 + int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 921 + u32 value) 922 + { 923 + return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin, 924 + param, value, 0, NULL); 925 + } 926 + EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_set_config); 927 + 928 + /** 815 929 * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller 816 930 * master has initialized its own power management 817 931 *
+5
drivers/gpio/gpio-regmap.c
··· 254 254 chip->names = config->names; 255 255 chip->label = config->label ?: dev_name(config->parent); 256 256 257 + #if defined(CONFIG_OF_GPIO) 258 + /* gpiolib will use of_node of the parent if chip->of_node is NULL */ 259 + chip->of_node = to_of_node(config->fwnode); 260 + #endif /* CONFIG_OF_GPIO */ 261 + 257 262 /* 258 263 * If our regmap is fast_io we should probably set can_sleep to false. 259 264 * Right now, the regmap doesn't save this property, nor is there any
+20 -1
drivers/pinctrl/Kconfig
··· 208 208 select MFD_SYSCON 209 209 210 210 config PINCTRL_ROCKCHIP 211 - bool 211 + tristate "Rockchip gpio and pinctrl driver" 212 + depends on ARCH_ROCKCHIP || COMPILE_TEST 212 213 depends on OF 214 + select GPIOLIB 213 215 select PINMUX 214 216 select GENERIC_PINCONF 215 217 select GENERIC_IRQ_CHIP 216 218 select MFD_SYSCON 217 219 select OF_GPIO 220 + default ARCH_ROCKCHIP 221 + help 222 + This support pinctrl and gpio driver for Rockchip SoCs. 218 223 219 224 config PINCTRL_SINGLE 220 225 tristate "One-register-per-pin type device tree based pinctrl driver" ··· 322 317 select GENERIC_PINCONF 323 318 help 324 319 This selects the pinctrl driver for Xilinx Zynq. 320 + 321 + config PINCTRL_ZYNQMP 322 + tristate "Pinctrl driver for Xilinx ZynqMP" 323 + depends on ZYNQMP_FIRMWARE 324 + select PINMUX 325 + select GENERIC_PINCONF 326 + default ZYNQMP_FIRMWARE 327 + help 328 + This selects the pinctrl driver for Xilinx ZynqMP platform. 329 + This driver will query the pin information from the firmware 330 + and allow configuring the pins. 331 + Configuration can include the mux function to select on those 332 + pin(s)/group(s), and various pin configuration parameters 333 + such as pull-up, slew rate, etc. 325 334 326 335 config PINCTRL_INGENIC 327 336 bool "Pinctrl driver for the Ingenic JZ47xx SoCs"
+1
drivers/pinctrl/Makefile
··· 40 40 obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o 41 41 obj-$(CONFIG_PINCTRL_STMFX) += pinctrl-stmfx.o 42 42 obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o 43 + obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o 43 44 obj-$(CONFIG_PINCTRL_INGENIC) += pinctrl-ingenic.o 44 45 obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o 45 46 obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o
+62
drivers/pinctrl/bcm/Kconfig
··· 29 29 help 30 30 Say Y here to enable the Broadcom BCM2835 GPIO driver. 31 31 32 + config PINCTRL_BCM63XX 33 + bool 34 + select PINMUX 35 + select PINCONF 36 + select GENERIC_PINCONF 37 + select GPIOLIB 38 + select GPIO_REGMAP 39 + 40 + config PINCTRL_BCM6318 41 + bool "Broadcom BCM6318 GPIO driver" 42 + depends on (BMIPS_GENERIC || COMPILE_TEST) 43 + depends on OF 44 + select PINCTRL_BCM63XX 45 + default BMIPS_GENERIC 46 + help 47 + Say Y here to enable the Broadcom BCM6318 GPIO driver. 48 + 49 + config PINCTRL_BCM6328 50 + bool "Broadcom BCM6328 GPIO driver" 51 + depends on (BMIPS_GENERIC || COMPILE_TEST) 52 + depends on OF 53 + select PINCTRL_BCM63XX 54 + default BMIPS_GENERIC 55 + help 56 + Say Y here to enable the Broadcom BCM6328 GPIO driver. 57 + 58 + config PINCTRL_BCM6358 59 + bool "Broadcom BCM6358 GPIO driver" 60 + depends on (BMIPS_GENERIC || COMPILE_TEST) 61 + depends on OF 62 + select PINCTRL_BCM63XX 63 + default BMIPS_GENERIC 64 + help 65 + Say Y here to enable the Broadcom BCM6358 GPIO driver. 66 + 67 + config PINCTRL_BCM6362 68 + bool "Broadcom BCM6362 GPIO driver" 69 + depends on (BMIPS_GENERIC || COMPILE_TEST) 70 + depends on OF 71 + select PINCTRL_BCM63XX 72 + default BMIPS_GENERIC 73 + help 74 + Say Y here to enable the Broadcom BCM6362 GPIO driver. 75 + 76 + config PINCTRL_BCM6368 77 + bool "Broadcom BCM6368 GPIO driver" 78 + depends on (BMIPS_GENERIC || COMPILE_TEST) 79 + depends on OF 80 + select PINCTRL_BCM63XX 81 + default BMIPS_GENERIC 82 + help 83 + Say Y here to enable the Broadcom BCM6368 GPIO driver. 84 + 85 + config PINCTRL_BCM63268 86 + bool "Broadcom BCM63268 GPIO driver" 87 + depends on (BMIPS_GENERIC || COMPILE_TEST) 88 + depends on OF 89 + select PINCTRL_BCM63XX 90 + default BMIPS_GENERIC 91 + help 92 + Say Y here to enable the Broadcom BCM63268 GPIO driver. 93 + 32 94 config PINCTRL_IPROC_GPIO 33 95 bool "Broadcom iProc GPIO (with PINCONF) driver" 34 96 depends on OF_GPIO && (ARCH_BCM_IPROC || COMPILE_TEST)
+7
drivers/pinctrl/bcm/Makefile
··· 3 3 4 4 obj-$(CONFIG_PINCTRL_BCM281XX) += pinctrl-bcm281xx.o 5 5 obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o 6 + obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o 7 + obj-$(CONFIG_PINCTRL_BCM6318) += pinctrl-bcm6318.o 8 + obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o 9 + obj-$(CONFIG_PINCTRL_BCM6358) += pinctrl-bcm6358.o 10 + obj-$(CONFIG_PINCTRL_BCM6362) += pinctrl-bcm6362.o 11 + obj-$(CONFIG_PINCTRL_BCM6368) += pinctrl-bcm6368.o 12 + obj-$(CONFIG_PINCTRL_BCM63268) += pinctrl-bcm63268.o 6 13 obj-$(CONFIG_PINCTRL_IPROC_GPIO) += pinctrl-iproc-gpio.o 7 14 obj-$(CONFIG_PINCTRL_CYGNUS_MUX) += pinctrl-cygnus-mux.o 8 15 obj-$(CONFIG_PINCTRL_NS) += pinctrl-ns.o
+498
drivers/pinctrl/bcm/pinctrl-bcm6318.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM6318 GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/kernel.h> 12 + #include <linux/of.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/regmap.h> 16 + 17 + #include "../pinctrl-utils.h" 18 + 19 + #include "pinctrl-bcm63xx.h" 20 + 21 + #define BCM6318_NUM_GPIOS 50 22 + #define BCM6318_NUM_MUX 48 23 + 24 + #define BCM6318_MODE_REG 0x18 25 + #define BCM6318_MUX_REG 0x1c 26 + #define BCM6328_MUX_MASK GENMASK(1, 0) 27 + #define BCM6318_PAD_REG 0x54 28 + #define BCM6328_PAD_MASK GENMASK(3, 0) 29 + 30 + struct bcm6318_pingroup { 31 + const char *name; 32 + const unsigned * const pins; 33 + const unsigned num_pins; 34 + }; 35 + 36 + struct bcm6318_function { 37 + const char *name; 38 + const char * const *groups; 39 + const unsigned num_groups; 40 + 41 + unsigned mode_val:1; 42 + unsigned mux_val:2; 43 + }; 44 + 45 + static const struct pinctrl_pin_desc bcm6318_pins[] = { 46 + PINCTRL_PIN(0, "gpio0"), 47 + PINCTRL_PIN(1, "gpio1"), 48 + PINCTRL_PIN(2, "gpio2"), 49 + PINCTRL_PIN(3, "gpio3"), 50 + PINCTRL_PIN(4, "gpio4"), 51 + PINCTRL_PIN(5, "gpio5"), 52 + PINCTRL_PIN(6, "gpio6"), 53 + PINCTRL_PIN(7, "gpio7"), 54 + PINCTRL_PIN(8, "gpio8"), 55 + PINCTRL_PIN(9, "gpio9"), 56 + PINCTRL_PIN(10, "gpio10"), 57 + PINCTRL_PIN(11, "gpio11"), 58 + PINCTRL_PIN(12, "gpio12"), 59 + PINCTRL_PIN(13, "gpio13"), 60 + PINCTRL_PIN(14, "gpio14"), 61 + PINCTRL_PIN(15, "gpio15"), 62 + PINCTRL_PIN(16, "gpio16"), 63 + PINCTRL_PIN(17, "gpio17"), 64 + PINCTRL_PIN(18, "gpio18"), 65 + PINCTRL_PIN(19, "gpio19"), 66 + PINCTRL_PIN(20, "gpio20"), 67 + PINCTRL_PIN(21, "gpio21"), 68 + PINCTRL_PIN(22, "gpio22"), 69 + PINCTRL_PIN(23, "gpio23"), 70 + PINCTRL_PIN(24, "gpio24"), 71 + PINCTRL_PIN(25, "gpio25"), 72 + PINCTRL_PIN(26, "gpio26"), 73 + PINCTRL_PIN(27, "gpio27"), 74 + PINCTRL_PIN(28, "gpio28"), 75 + PINCTRL_PIN(29, "gpio29"), 76 + PINCTRL_PIN(30, "gpio30"), 77 + PINCTRL_PIN(31, "gpio31"), 78 + PINCTRL_PIN(32, "gpio32"), 79 + PINCTRL_PIN(33, "gpio33"), 80 + PINCTRL_PIN(34, "gpio34"), 81 + PINCTRL_PIN(35, "gpio35"), 82 + PINCTRL_PIN(36, "gpio36"), 83 + PINCTRL_PIN(37, "gpio37"), 84 + PINCTRL_PIN(38, "gpio38"), 85 + PINCTRL_PIN(39, "gpio39"), 86 + PINCTRL_PIN(40, "gpio40"), 87 + PINCTRL_PIN(41, "gpio41"), 88 + PINCTRL_PIN(42, "gpio42"), 89 + PINCTRL_PIN(43, "gpio43"), 90 + PINCTRL_PIN(44, "gpio44"), 91 + PINCTRL_PIN(45, "gpio45"), 92 + PINCTRL_PIN(46, "gpio46"), 93 + PINCTRL_PIN(47, "gpio47"), 94 + PINCTRL_PIN(48, "gpio48"), 95 + PINCTRL_PIN(49, "gpio49"), 96 + }; 97 + 98 + static unsigned gpio0_pins[] = { 0 }; 99 + static unsigned gpio1_pins[] = { 1 }; 100 + static unsigned gpio2_pins[] = { 2 }; 101 + static unsigned gpio3_pins[] = { 3 }; 102 + static unsigned gpio4_pins[] = { 4 }; 103 + static unsigned gpio5_pins[] = { 5 }; 104 + static unsigned gpio6_pins[] = { 6 }; 105 + static unsigned gpio7_pins[] = { 7 }; 106 + static unsigned gpio8_pins[] = { 8 }; 107 + static unsigned gpio9_pins[] = { 9 }; 108 + static unsigned gpio10_pins[] = { 10 }; 109 + static unsigned gpio11_pins[] = { 11 }; 110 + static unsigned gpio12_pins[] = { 12 }; 111 + static unsigned gpio13_pins[] = { 13 }; 112 + static unsigned gpio14_pins[] = { 14 }; 113 + static unsigned gpio15_pins[] = { 15 }; 114 + static unsigned gpio16_pins[] = { 16 }; 115 + static unsigned gpio17_pins[] = { 17 }; 116 + static unsigned gpio18_pins[] = { 18 }; 117 + static unsigned gpio19_pins[] = { 19 }; 118 + static unsigned gpio20_pins[] = { 20 }; 119 + static unsigned gpio21_pins[] = { 21 }; 120 + static unsigned gpio22_pins[] = { 22 }; 121 + static unsigned gpio23_pins[] = { 23 }; 122 + static unsigned gpio24_pins[] = { 24 }; 123 + static unsigned gpio25_pins[] = { 25 }; 124 + static unsigned gpio26_pins[] = { 26 }; 125 + static unsigned gpio27_pins[] = { 27 }; 126 + static unsigned gpio28_pins[] = { 28 }; 127 + static unsigned gpio29_pins[] = { 29 }; 128 + static unsigned gpio30_pins[] = { 30 }; 129 + static unsigned gpio31_pins[] = { 31 }; 130 + static unsigned gpio32_pins[] = { 32 }; 131 + static unsigned gpio33_pins[] = { 33 }; 132 + static unsigned gpio34_pins[] = { 34 }; 133 + static unsigned gpio35_pins[] = { 35 }; 134 + static unsigned gpio36_pins[] = { 36 }; 135 + static unsigned gpio37_pins[] = { 37 }; 136 + static unsigned gpio38_pins[] = { 38 }; 137 + static unsigned gpio39_pins[] = { 39 }; 138 + static unsigned gpio40_pins[] = { 40 }; 139 + static unsigned gpio41_pins[] = { 41 }; 140 + static unsigned gpio42_pins[] = { 42 }; 141 + static unsigned gpio43_pins[] = { 43 }; 142 + static unsigned gpio44_pins[] = { 44 }; 143 + static unsigned gpio45_pins[] = { 45 }; 144 + static unsigned gpio46_pins[] = { 46 }; 145 + static unsigned gpio47_pins[] = { 47 }; 146 + static unsigned gpio48_pins[] = { 48 }; 147 + static unsigned gpio49_pins[] = { 49 }; 148 + 149 + #define BCM6318_GROUP(n) \ 150 + { \ 151 + .name = #n, \ 152 + .pins = n##_pins, \ 153 + .num_pins = ARRAY_SIZE(n##_pins), \ 154 + } 155 + 156 + static struct bcm6318_pingroup bcm6318_groups[] = { 157 + BCM6318_GROUP(gpio0), 158 + BCM6318_GROUP(gpio1), 159 + BCM6318_GROUP(gpio2), 160 + BCM6318_GROUP(gpio3), 161 + BCM6318_GROUP(gpio4), 162 + BCM6318_GROUP(gpio5), 163 + BCM6318_GROUP(gpio6), 164 + BCM6318_GROUP(gpio7), 165 + BCM6318_GROUP(gpio8), 166 + BCM6318_GROUP(gpio9), 167 + BCM6318_GROUP(gpio10), 168 + BCM6318_GROUP(gpio11), 169 + BCM6318_GROUP(gpio12), 170 + BCM6318_GROUP(gpio13), 171 + BCM6318_GROUP(gpio14), 172 + BCM6318_GROUP(gpio15), 173 + BCM6318_GROUP(gpio16), 174 + BCM6318_GROUP(gpio17), 175 + BCM6318_GROUP(gpio18), 176 + BCM6318_GROUP(gpio19), 177 + BCM6318_GROUP(gpio20), 178 + BCM6318_GROUP(gpio21), 179 + BCM6318_GROUP(gpio22), 180 + BCM6318_GROUP(gpio23), 181 + BCM6318_GROUP(gpio24), 182 + BCM6318_GROUP(gpio25), 183 + BCM6318_GROUP(gpio26), 184 + BCM6318_GROUP(gpio27), 185 + BCM6318_GROUP(gpio28), 186 + BCM6318_GROUP(gpio29), 187 + BCM6318_GROUP(gpio30), 188 + BCM6318_GROUP(gpio31), 189 + BCM6318_GROUP(gpio32), 190 + BCM6318_GROUP(gpio33), 191 + BCM6318_GROUP(gpio34), 192 + BCM6318_GROUP(gpio35), 193 + BCM6318_GROUP(gpio36), 194 + BCM6318_GROUP(gpio37), 195 + BCM6318_GROUP(gpio38), 196 + BCM6318_GROUP(gpio39), 197 + BCM6318_GROUP(gpio40), 198 + BCM6318_GROUP(gpio41), 199 + BCM6318_GROUP(gpio42), 200 + BCM6318_GROUP(gpio43), 201 + BCM6318_GROUP(gpio44), 202 + BCM6318_GROUP(gpio45), 203 + BCM6318_GROUP(gpio46), 204 + BCM6318_GROUP(gpio47), 205 + BCM6318_GROUP(gpio48), 206 + BCM6318_GROUP(gpio49), 207 + }; 208 + 209 + /* GPIO_MODE */ 210 + static const char * const led_groups[] = { 211 + "gpio0", 212 + "gpio1", 213 + "gpio2", 214 + "gpio3", 215 + "gpio4", 216 + "gpio5", 217 + "gpio6", 218 + "gpio7", 219 + "gpio8", 220 + "gpio9", 221 + "gpio10", 222 + "gpio11", 223 + "gpio12", 224 + "gpio13", 225 + "gpio14", 226 + "gpio15", 227 + "gpio16", 228 + "gpio17", 229 + "gpio18", 230 + "gpio19", 231 + "gpio20", 232 + "gpio21", 233 + "gpio22", 234 + "gpio23", 235 + }; 236 + 237 + /* PINMUX_SEL */ 238 + static const char * const ephy0_spd_led_groups[] = { 239 + "gpio0", 240 + }; 241 + 242 + static const char * const ephy1_spd_led_groups[] = { 243 + "gpio1", 244 + }; 245 + 246 + static const char * const ephy2_spd_led_groups[] = { 247 + "gpio2", 248 + }; 249 + 250 + static const char * const ephy3_spd_led_groups[] = { 251 + "gpio3", 252 + }; 253 + 254 + static const char * const ephy0_act_led_groups[] = { 255 + "gpio4", 256 + }; 257 + 258 + static const char * const ephy1_act_led_groups[] = { 259 + "gpio5", 260 + }; 261 + 262 + static const char * const ephy2_act_led_groups[] = { 263 + "gpio6", 264 + }; 265 + 266 + static const char * const ephy3_act_led_groups[] = { 267 + "gpio7", 268 + }; 269 + 270 + static const char * const serial_led_data_groups[] = { 271 + "gpio6", 272 + }; 273 + 274 + static const char * const serial_led_clk_groups[] = { 275 + "gpio7", 276 + }; 277 + 278 + static const char * const inet_act_led_groups[] = { 279 + "gpio8", 280 + }; 281 + 282 + static const char * const inet_fail_led_groups[] = { 283 + "gpio9", 284 + }; 285 + 286 + static const char * const dsl_led_groups[] = { 287 + "gpio10", 288 + }; 289 + 290 + static const char * const post_fail_led_groups[] = { 291 + "gpio11", 292 + }; 293 + 294 + static const char * const wlan_wps_led_groups[] = { 295 + "gpio12", 296 + }; 297 + 298 + static const char * const usb_pwron_groups[] = { 299 + "gpio13", 300 + }; 301 + 302 + static const char * const usb_device_led_groups[] = { 303 + "gpio13", 304 + }; 305 + 306 + static const char * const usb_active_groups[] = { 307 + "gpio40", 308 + }; 309 + 310 + #define BCM6318_MODE_FUN(n) \ 311 + { \ 312 + .name = #n, \ 313 + .groups = n##_groups, \ 314 + .num_groups = ARRAY_SIZE(n##_groups), \ 315 + .mode_val = 1, \ 316 + } 317 + 318 + #define BCM6318_MUX_FUN(n, mux) \ 319 + { \ 320 + .name = #n, \ 321 + .groups = n##_groups, \ 322 + .num_groups = ARRAY_SIZE(n##_groups), \ 323 + .mux_val = mux, \ 324 + } 325 + 326 + static const struct bcm6318_function bcm6318_funcs[] = { 327 + BCM6318_MODE_FUN(led), 328 + BCM6318_MUX_FUN(ephy0_spd_led, 1), 329 + BCM6318_MUX_FUN(ephy1_spd_led, 1), 330 + BCM6318_MUX_FUN(ephy2_spd_led, 1), 331 + BCM6318_MUX_FUN(ephy3_spd_led, 1), 332 + BCM6318_MUX_FUN(ephy0_act_led, 1), 333 + BCM6318_MUX_FUN(ephy1_act_led, 1), 334 + BCM6318_MUX_FUN(ephy2_act_led, 1), 335 + BCM6318_MUX_FUN(ephy3_act_led, 1), 336 + BCM6318_MUX_FUN(serial_led_data, 3), 337 + BCM6318_MUX_FUN(serial_led_clk, 3), 338 + BCM6318_MUX_FUN(inet_act_led, 1), 339 + BCM6318_MUX_FUN(inet_fail_led, 1), 340 + BCM6318_MUX_FUN(dsl_led, 1), 341 + BCM6318_MUX_FUN(post_fail_led, 1), 342 + BCM6318_MUX_FUN(wlan_wps_led, 1), 343 + BCM6318_MUX_FUN(usb_pwron, 1), 344 + BCM6318_MUX_FUN(usb_device_led, 2), 345 + BCM6318_MUX_FUN(usb_active, 2), 346 + }; 347 + 348 + static inline unsigned int bcm6318_mux_off(unsigned int pin) 349 + { 350 + return BCM6318_MUX_REG + (pin / 16) * 4; 351 + } 352 + 353 + static inline unsigned int bcm6318_pad_off(unsigned int pin) 354 + { 355 + return BCM6318_PAD_REG + (pin / 8) * 4; 356 + } 357 + 358 + static int bcm6318_pinctrl_get_group_count(struct pinctrl_dev *pctldev) 359 + { 360 + return ARRAY_SIZE(bcm6318_groups); 361 + } 362 + 363 + static const char *bcm6318_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 364 + unsigned group) 365 + { 366 + return bcm6318_groups[group].name; 367 + } 368 + 369 + static int bcm6318_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 370 + unsigned group, const unsigned **pins, 371 + unsigned *num_pins) 372 + { 373 + *pins = bcm6318_groups[group].pins; 374 + *num_pins = bcm6318_groups[group].num_pins; 375 + 376 + return 0; 377 + } 378 + 379 + static int bcm6318_pinctrl_get_func_count(struct pinctrl_dev *pctldev) 380 + { 381 + return ARRAY_SIZE(bcm6318_funcs); 382 + } 383 + 384 + static const char *bcm6318_pinctrl_get_func_name(struct pinctrl_dev *pctldev, 385 + unsigned selector) 386 + { 387 + return bcm6318_funcs[selector].name; 388 + } 389 + 390 + static int bcm6318_pinctrl_get_groups(struct pinctrl_dev *pctldev, 391 + unsigned selector, 392 + const char * const **groups, 393 + unsigned * const num_groups) 394 + { 395 + *groups = bcm6318_funcs[selector].groups; 396 + *num_groups = bcm6318_funcs[selector].num_groups; 397 + 398 + return 0; 399 + } 400 + 401 + static inline void bcm6318_rmw_mux(struct bcm63xx_pinctrl *pc, unsigned pin, 402 + unsigned int mode, unsigned int mux) 403 + { 404 + if (pin < BCM63XX_BANK_GPIOS) 405 + regmap_update_bits(pc->regs, BCM6318_MODE_REG, BIT(pin), 406 + mode ? BIT(pin) : 0); 407 + 408 + if (pin < BCM6318_NUM_MUX) 409 + regmap_update_bits(pc->regs, 410 + bcm6318_mux_off(pin), 411 + BCM6328_MUX_MASK << ((pin % 16) * 2), 412 + mux << ((pin % 16) * 2)); 413 + } 414 + 415 + static inline void bcm6318_set_pad(struct bcm63xx_pinctrl *pc, unsigned pin, 416 + uint8_t val) 417 + { 418 + regmap_update_bits(pc->regs, bcm6318_pad_off(pin), 419 + BCM6328_PAD_MASK << ((pin % 8) * 4), 420 + val << ((pin % 8) * 4)); 421 + } 422 + 423 + static int bcm6318_pinctrl_set_mux(struct pinctrl_dev *pctldev, 424 + unsigned selector, unsigned group) 425 + { 426 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 427 + const struct bcm6318_pingroup *pg = &bcm6318_groups[group]; 428 + const struct bcm6318_function *f = &bcm6318_funcs[selector]; 429 + 430 + bcm6318_rmw_mux(pc, pg->pins[0], f->mode_val, f->mux_val); 431 + 432 + return 0; 433 + } 434 + 435 + static int bcm6318_gpio_request_enable(struct pinctrl_dev *pctldev, 436 + struct pinctrl_gpio_range *range, 437 + unsigned offset) 438 + { 439 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 440 + 441 + /* disable all functions using this pin */ 442 + if (offset < 13) { 443 + /* GPIOs 0-12 use mux 0 as GPIO function */ 444 + bcm6318_rmw_mux(pc, offset, 0, 0); 445 + } else if (offset < 42) { 446 + /* GPIOs 13-41 use mux 3 as GPIO function */ 447 + bcm6318_rmw_mux(pc, offset, 0, 3); 448 + 449 + bcm6318_set_pad(pc, offset, 0); 450 + } 451 + 452 + return 0; 453 + } 454 + 455 + static struct pinctrl_ops bcm6318_pctl_ops = { 456 + .dt_free_map = pinctrl_utils_free_map, 457 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 458 + .get_group_name = bcm6318_pinctrl_get_group_name, 459 + .get_group_pins = bcm6318_pinctrl_get_group_pins, 460 + .get_groups_count = bcm6318_pinctrl_get_group_count, 461 + }; 462 + 463 + static struct pinmux_ops bcm6318_pmx_ops = { 464 + .get_function_groups = bcm6318_pinctrl_get_groups, 465 + .get_function_name = bcm6318_pinctrl_get_func_name, 466 + .get_functions_count = bcm6318_pinctrl_get_func_count, 467 + .gpio_request_enable = bcm6318_gpio_request_enable, 468 + .set_mux = bcm6318_pinctrl_set_mux, 469 + .strict = true, 470 + }; 471 + 472 + static const struct bcm63xx_pinctrl_soc bcm6318_soc = { 473 + .ngpios = BCM6318_NUM_GPIOS, 474 + .npins = ARRAY_SIZE(bcm6318_pins), 475 + .pctl_ops = &bcm6318_pctl_ops, 476 + .pins = bcm6318_pins, 477 + .pmx_ops = &bcm6318_pmx_ops, 478 + }; 479 + 480 + static int bcm6318_pinctrl_probe(struct platform_device *pdev) 481 + { 482 + return bcm63xx_pinctrl_probe(pdev, &bcm6318_soc, NULL); 483 + } 484 + 485 + static const struct of_device_id bcm6318_pinctrl_match[] = { 486 + { .compatible = "brcm,bcm6318-pinctrl", }, 487 + { /* sentinel */ } 488 + }; 489 + 490 + static struct platform_driver bcm6318_pinctrl_driver = { 491 + .probe = bcm6318_pinctrl_probe, 492 + .driver = { 493 + .name = "bcm6318-pinctrl", 494 + .of_match_table = bcm6318_pinctrl_match, 495 + }, 496 + }; 497 + 498 + builtin_platform_driver(bcm6318_pinctrl_driver);
+643
drivers/pinctrl/bcm/pinctrl-bcm63268.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM63268 GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/kernel.h> 12 + #include <linux/of.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/regmap.h> 16 + 17 + #include "../pinctrl-utils.h" 18 + 19 + #include "pinctrl-bcm63xx.h" 20 + 21 + #define BCM63268_NUM_GPIOS 52 22 + #define BCM63268_NUM_LEDS 24 23 + 24 + #define BCM63268_LED_REG 0x10 25 + #define BCM63268_MODE_REG 0x18 26 + #define BCM63268_CTRL_REG 0x1c 27 + #define BCM63268_BASEMODE_REG 0x38 28 + #define BCM63268_BASEMODE_NAND BIT(2) /* GPIOs 2-7, 24-31 */ 29 + #define BCM63268_BASEMODE_GPIO35 BIT(4) /* GPIO 35 */ 30 + #define BCM63268_BASEMODE_DECTPD BIT(5) /* GPIOs 8/9 */ 31 + #define BCM63268_BASEMODE_VDSL_PHY_0 BIT(6) /* GPIOs 10/11 */ 32 + #define BCM63268_BASEMODE_VDSL_PHY_1 BIT(7) /* GPIOs 12/13 */ 33 + #define BCM63268_BASEMODE_VDSL_PHY_2 BIT(8) /* GPIOs 24/25 */ 34 + #define BCM63268_BASEMODE_VDSL_PHY_3 BIT(9) /* GPIOs 26/27 */ 35 + 36 + enum bcm63268_pinctrl_reg { 37 + BCM63268_LEDCTRL, 38 + BCM63268_MODE, 39 + BCM63268_CTRL, 40 + BCM63268_BASEMODE, 41 + }; 42 + 43 + struct bcm63268_pingroup { 44 + const char *name; 45 + const unsigned * const pins; 46 + const unsigned num_pins; 47 + }; 48 + 49 + struct bcm63268_function { 50 + const char *name; 51 + const char * const *groups; 52 + const unsigned num_groups; 53 + 54 + enum bcm63268_pinctrl_reg reg; 55 + uint32_t mask; 56 + }; 57 + 58 + #define BCM63268_PIN(a, b, basemode) \ 59 + { \ 60 + .number = a, \ 61 + .name = b, \ 62 + .drv_data = (void *)(basemode) \ 63 + } 64 + 65 + static const struct pinctrl_pin_desc bcm63268_pins[] = { 66 + PINCTRL_PIN(0, "gpio0"), 67 + PINCTRL_PIN(1, "gpio1"), 68 + BCM63268_PIN(2, "gpio2", BCM63268_BASEMODE_NAND), 69 + BCM63268_PIN(3, "gpio3", BCM63268_BASEMODE_NAND), 70 + BCM63268_PIN(4, "gpio4", BCM63268_BASEMODE_NAND), 71 + BCM63268_PIN(5, "gpio5", BCM63268_BASEMODE_NAND), 72 + BCM63268_PIN(6, "gpio6", BCM63268_BASEMODE_NAND), 73 + BCM63268_PIN(7, "gpio7", BCM63268_BASEMODE_NAND), 74 + BCM63268_PIN(8, "gpio8", BCM63268_BASEMODE_DECTPD), 75 + BCM63268_PIN(9, "gpio9", BCM63268_BASEMODE_DECTPD), 76 + BCM63268_PIN(10, "gpio10", BCM63268_BASEMODE_VDSL_PHY_0), 77 + BCM63268_PIN(11, "gpio11", BCM63268_BASEMODE_VDSL_PHY_0), 78 + BCM63268_PIN(12, "gpio12", BCM63268_BASEMODE_VDSL_PHY_1), 79 + BCM63268_PIN(13, "gpio13", BCM63268_BASEMODE_VDSL_PHY_1), 80 + PINCTRL_PIN(14, "gpio14"), 81 + PINCTRL_PIN(15, "gpio15"), 82 + PINCTRL_PIN(16, "gpio16"), 83 + PINCTRL_PIN(17, "gpio17"), 84 + PINCTRL_PIN(18, "gpio18"), 85 + PINCTRL_PIN(19, "gpio19"), 86 + PINCTRL_PIN(20, "gpio20"), 87 + PINCTRL_PIN(21, "gpio21"), 88 + PINCTRL_PIN(22, "gpio22"), 89 + PINCTRL_PIN(23, "gpio23"), 90 + BCM63268_PIN(24, "gpio24", 91 + BCM63268_BASEMODE_NAND | BCM63268_BASEMODE_VDSL_PHY_2), 92 + BCM63268_PIN(25, "gpio25", 93 + BCM63268_BASEMODE_NAND | BCM63268_BASEMODE_VDSL_PHY_2), 94 + BCM63268_PIN(26, "gpio26", 95 + BCM63268_BASEMODE_NAND | BCM63268_BASEMODE_VDSL_PHY_3), 96 + BCM63268_PIN(27, "gpio27", 97 + BCM63268_BASEMODE_NAND | BCM63268_BASEMODE_VDSL_PHY_3), 98 + BCM63268_PIN(28, "gpio28", BCM63268_BASEMODE_NAND), 99 + BCM63268_PIN(29, "gpio29", BCM63268_BASEMODE_NAND), 100 + BCM63268_PIN(30, "gpio30", BCM63268_BASEMODE_NAND), 101 + BCM63268_PIN(31, "gpio31", BCM63268_BASEMODE_NAND), 102 + PINCTRL_PIN(32, "gpio32"), 103 + PINCTRL_PIN(33, "gpio33"), 104 + PINCTRL_PIN(34, "gpio34"), 105 + PINCTRL_PIN(35, "gpio35"), 106 + PINCTRL_PIN(36, "gpio36"), 107 + PINCTRL_PIN(37, "gpio37"), 108 + PINCTRL_PIN(38, "gpio38"), 109 + PINCTRL_PIN(39, "gpio39"), 110 + PINCTRL_PIN(40, "gpio40"), 111 + PINCTRL_PIN(41, "gpio41"), 112 + PINCTRL_PIN(42, "gpio42"), 113 + PINCTRL_PIN(43, "gpio43"), 114 + PINCTRL_PIN(44, "gpio44"), 115 + PINCTRL_PIN(45, "gpio45"), 116 + PINCTRL_PIN(46, "gpio46"), 117 + PINCTRL_PIN(47, "gpio47"), 118 + PINCTRL_PIN(48, "gpio48"), 119 + PINCTRL_PIN(49, "gpio49"), 120 + PINCTRL_PIN(50, "gpio50"), 121 + PINCTRL_PIN(51, "gpio51"), 122 + }; 123 + 124 + static unsigned gpio0_pins[] = { 0 }; 125 + static unsigned gpio1_pins[] = { 1 }; 126 + static unsigned gpio2_pins[] = { 2 }; 127 + static unsigned gpio3_pins[] = { 3 }; 128 + static unsigned gpio4_pins[] = { 4 }; 129 + static unsigned gpio5_pins[] = { 5 }; 130 + static unsigned gpio6_pins[] = { 6 }; 131 + static unsigned gpio7_pins[] = { 7 }; 132 + static unsigned gpio8_pins[] = { 8 }; 133 + static unsigned gpio9_pins[] = { 9 }; 134 + static unsigned gpio10_pins[] = { 10 }; 135 + static unsigned gpio11_pins[] = { 11 }; 136 + static unsigned gpio12_pins[] = { 12 }; 137 + static unsigned gpio13_pins[] = { 13 }; 138 + static unsigned gpio14_pins[] = { 14 }; 139 + static unsigned gpio15_pins[] = { 15 }; 140 + static unsigned gpio16_pins[] = { 16 }; 141 + static unsigned gpio17_pins[] = { 17 }; 142 + static unsigned gpio18_pins[] = { 18 }; 143 + static unsigned gpio19_pins[] = { 19 }; 144 + static unsigned gpio20_pins[] = { 20 }; 145 + static unsigned gpio21_pins[] = { 21 }; 146 + static unsigned gpio22_pins[] = { 22 }; 147 + static unsigned gpio23_pins[] = { 23 }; 148 + static unsigned gpio24_pins[] = { 24 }; 149 + static unsigned gpio25_pins[] = { 25 }; 150 + static unsigned gpio26_pins[] = { 26 }; 151 + static unsigned gpio27_pins[] = { 27 }; 152 + static unsigned gpio28_pins[] = { 28 }; 153 + static unsigned gpio29_pins[] = { 29 }; 154 + static unsigned gpio30_pins[] = { 30 }; 155 + static unsigned gpio31_pins[] = { 31 }; 156 + static unsigned gpio32_pins[] = { 32 }; 157 + static unsigned gpio33_pins[] = { 33 }; 158 + static unsigned gpio34_pins[] = { 34 }; 159 + static unsigned gpio35_pins[] = { 35 }; 160 + static unsigned gpio36_pins[] = { 36 }; 161 + static unsigned gpio37_pins[] = { 37 }; 162 + static unsigned gpio38_pins[] = { 38 }; 163 + static unsigned gpio39_pins[] = { 39 }; 164 + static unsigned gpio40_pins[] = { 40 }; 165 + static unsigned gpio41_pins[] = { 41 }; 166 + static unsigned gpio42_pins[] = { 42 }; 167 + static unsigned gpio43_pins[] = { 43 }; 168 + static unsigned gpio44_pins[] = { 44 }; 169 + static unsigned gpio45_pins[] = { 45 }; 170 + static unsigned gpio46_pins[] = { 46 }; 171 + static unsigned gpio47_pins[] = { 47 }; 172 + static unsigned gpio48_pins[] = { 48 }; 173 + static unsigned gpio49_pins[] = { 49 }; 174 + static unsigned gpio50_pins[] = { 50 }; 175 + static unsigned gpio51_pins[] = { 51 }; 176 + 177 + static unsigned nand_grp_pins[] = { 178 + 2, 3, 4, 5, 6, 7, 24, 179 + 25, 26, 27, 28, 29, 30, 31, 180 + }; 181 + 182 + static unsigned dectpd_grp_pins[] = { 8, 9 }; 183 + static unsigned vdsl_phy0_grp_pins[] = { 10, 11 }; 184 + static unsigned vdsl_phy1_grp_pins[] = { 12, 13 }; 185 + static unsigned vdsl_phy2_grp_pins[] = { 24, 25 }; 186 + static unsigned vdsl_phy3_grp_pins[] = { 26, 27 }; 187 + 188 + #define BCM63268_GROUP(n) \ 189 + { \ 190 + .name = #n, \ 191 + .pins = n##_pins, \ 192 + .num_pins = ARRAY_SIZE(n##_pins), \ 193 + } 194 + 195 + static struct bcm63268_pingroup bcm63268_groups[] = { 196 + BCM63268_GROUP(gpio0), 197 + BCM63268_GROUP(gpio1), 198 + BCM63268_GROUP(gpio2), 199 + BCM63268_GROUP(gpio3), 200 + BCM63268_GROUP(gpio4), 201 + BCM63268_GROUP(gpio5), 202 + BCM63268_GROUP(gpio6), 203 + BCM63268_GROUP(gpio7), 204 + BCM63268_GROUP(gpio8), 205 + BCM63268_GROUP(gpio9), 206 + BCM63268_GROUP(gpio10), 207 + BCM63268_GROUP(gpio11), 208 + BCM63268_GROUP(gpio12), 209 + BCM63268_GROUP(gpio13), 210 + BCM63268_GROUP(gpio14), 211 + BCM63268_GROUP(gpio15), 212 + BCM63268_GROUP(gpio16), 213 + BCM63268_GROUP(gpio17), 214 + BCM63268_GROUP(gpio18), 215 + BCM63268_GROUP(gpio19), 216 + BCM63268_GROUP(gpio20), 217 + BCM63268_GROUP(gpio21), 218 + BCM63268_GROUP(gpio22), 219 + BCM63268_GROUP(gpio23), 220 + BCM63268_GROUP(gpio24), 221 + BCM63268_GROUP(gpio25), 222 + BCM63268_GROUP(gpio26), 223 + BCM63268_GROUP(gpio27), 224 + BCM63268_GROUP(gpio28), 225 + BCM63268_GROUP(gpio29), 226 + BCM63268_GROUP(gpio30), 227 + BCM63268_GROUP(gpio31), 228 + BCM63268_GROUP(gpio32), 229 + BCM63268_GROUP(gpio33), 230 + BCM63268_GROUP(gpio34), 231 + BCM63268_GROUP(gpio35), 232 + BCM63268_GROUP(gpio36), 233 + BCM63268_GROUP(gpio37), 234 + BCM63268_GROUP(gpio38), 235 + BCM63268_GROUP(gpio39), 236 + BCM63268_GROUP(gpio40), 237 + BCM63268_GROUP(gpio41), 238 + BCM63268_GROUP(gpio42), 239 + BCM63268_GROUP(gpio43), 240 + BCM63268_GROUP(gpio44), 241 + BCM63268_GROUP(gpio45), 242 + BCM63268_GROUP(gpio46), 243 + BCM63268_GROUP(gpio47), 244 + BCM63268_GROUP(gpio48), 245 + BCM63268_GROUP(gpio49), 246 + BCM63268_GROUP(gpio50), 247 + BCM63268_GROUP(gpio51), 248 + 249 + /* multi pin groups */ 250 + BCM63268_GROUP(nand_grp), 251 + BCM63268_GROUP(dectpd_grp), 252 + BCM63268_GROUP(vdsl_phy0_grp), 253 + BCM63268_GROUP(vdsl_phy1_grp), 254 + BCM63268_GROUP(vdsl_phy2_grp), 255 + BCM63268_GROUP(vdsl_phy3_grp), 256 + }; 257 + 258 + static const char * const led_groups[] = { 259 + "gpio0", 260 + "gpio1", 261 + "gpio2", 262 + "gpio3", 263 + "gpio4", 264 + "gpio5", 265 + "gpio6", 266 + "gpio7", 267 + "gpio8", 268 + "gpio9", 269 + "gpio10", 270 + "gpio11", 271 + "gpio12", 272 + "gpio13", 273 + "gpio14", 274 + "gpio15", 275 + "gpio16", 276 + "gpio17", 277 + "gpio18", 278 + "gpio19", 279 + "gpio20", 280 + "gpio21", 281 + "gpio22", 282 + "gpio23", 283 + }; 284 + 285 + static const char * const serial_led_clk_groups[] = { 286 + "gpio0", 287 + }; 288 + 289 + static const char * const serial_led_data_groups[] = { 290 + "gpio1", 291 + }; 292 + 293 + static const char * const hsspi_cs4_groups[] = { 294 + "gpio16", 295 + }; 296 + 297 + static const char * const hsspi_cs5_groups[] = { 298 + "gpio17", 299 + }; 300 + 301 + static const char * const hsspi_cs6_groups[] = { 302 + "gpio8", 303 + }; 304 + 305 + static const char * const hsspi_cs7_groups[] = { 306 + "gpio9", 307 + }; 308 + 309 + static const char * const uart1_scts_groups[] = { 310 + "gpio10", 311 + "gpio24", 312 + }; 313 + 314 + static const char * const uart1_srts_groups[] = { 315 + "gpio11", 316 + "gpio25", 317 + }; 318 + 319 + static const char * const uart1_sdin_groups[] = { 320 + "gpio12", 321 + "gpio26", 322 + }; 323 + 324 + static const char * const uart1_sdout_groups[] = { 325 + "gpio13", 326 + "gpio27", 327 + }; 328 + 329 + static const char * const ntr_pulse_in_groups[] = { 330 + "gpio14", 331 + "gpio28", 332 + }; 333 + 334 + static const char * const dsl_ntr_pulse_out_groups[] = { 335 + "gpio15", 336 + "gpio29", 337 + }; 338 + 339 + static const char * const adsl_spi_miso_groups[] = { 340 + "gpio18", 341 + }; 342 + 343 + static const char * const adsl_spi_mosi_groups[] = { 344 + "gpio19", 345 + }; 346 + 347 + static const char * const vreg_clk_groups[] = { 348 + "gpio22", 349 + }; 350 + 351 + static const char * const pcie_clkreq_b_groups[] = { 352 + "gpio23", 353 + }; 354 + 355 + static const char * const switch_led_clk_groups[] = { 356 + "gpio30", 357 + }; 358 + 359 + static const char * const switch_led_data_groups[] = { 360 + "gpio31", 361 + }; 362 + 363 + static const char * const wifi_groups[] = { 364 + "gpio32", 365 + "gpio33", 366 + "gpio34", 367 + "gpio35", 368 + "gpio36", 369 + "gpio37", 370 + "gpio38", 371 + "gpio39", 372 + "gpio40", 373 + "gpio41", 374 + "gpio42", 375 + "gpio43", 376 + "gpio44", 377 + "gpio45", 378 + "gpio46", 379 + "gpio47", 380 + "gpio48", 381 + "gpio49", 382 + "gpio50", 383 + "gpio51", 384 + }; 385 + 386 + static const char * const nand_groups[] = { 387 + "nand_grp", 388 + }; 389 + 390 + static const char * const dectpd_groups[] = { 391 + "dectpd_grp", 392 + }; 393 + 394 + static const char * const vdsl_phy_override_0_groups[] = { 395 + "vdsl_phy_override_0_grp", 396 + }; 397 + 398 + static const char * const vdsl_phy_override_1_groups[] = { 399 + "vdsl_phy_override_1_grp", 400 + }; 401 + 402 + static const char * const vdsl_phy_override_2_groups[] = { 403 + "vdsl_phy_override_2_grp", 404 + }; 405 + 406 + static const char * const vdsl_phy_override_3_groups[] = { 407 + "vdsl_phy_override_3_grp", 408 + }; 409 + 410 + #define BCM63268_LED_FUN(n) \ 411 + { \ 412 + .name = #n, \ 413 + .groups = n##_groups, \ 414 + .num_groups = ARRAY_SIZE(n##_groups), \ 415 + .reg = BCM63268_LEDCTRL, \ 416 + } 417 + 418 + #define BCM63268_MODE_FUN(n) \ 419 + { \ 420 + .name = #n, \ 421 + .groups = n##_groups, \ 422 + .num_groups = ARRAY_SIZE(n##_groups), \ 423 + .reg = BCM63268_MODE, \ 424 + } 425 + 426 + #define BCM63268_CTRL_FUN(n) \ 427 + { \ 428 + .name = #n, \ 429 + .groups = n##_groups, \ 430 + .num_groups = ARRAY_SIZE(n##_groups), \ 431 + .reg = BCM63268_CTRL, \ 432 + } 433 + 434 + #define BCM63268_BASEMODE_FUN(n, val) \ 435 + { \ 436 + .name = #n, \ 437 + .groups = n##_groups, \ 438 + .num_groups = ARRAY_SIZE(n##_groups), \ 439 + .reg = BCM63268_BASEMODE, \ 440 + .mask = val, \ 441 + } 442 + 443 + static const struct bcm63268_function bcm63268_funcs[] = { 444 + BCM63268_LED_FUN(led), 445 + BCM63268_MODE_FUN(serial_led_clk), 446 + BCM63268_MODE_FUN(serial_led_data), 447 + BCM63268_MODE_FUN(hsspi_cs6), 448 + BCM63268_MODE_FUN(hsspi_cs7), 449 + BCM63268_MODE_FUN(uart1_scts), 450 + BCM63268_MODE_FUN(uart1_srts), 451 + BCM63268_MODE_FUN(uart1_sdin), 452 + BCM63268_MODE_FUN(uart1_sdout), 453 + BCM63268_MODE_FUN(ntr_pulse_in), 454 + BCM63268_MODE_FUN(dsl_ntr_pulse_out), 455 + BCM63268_MODE_FUN(hsspi_cs4), 456 + BCM63268_MODE_FUN(hsspi_cs5), 457 + BCM63268_MODE_FUN(adsl_spi_miso), 458 + BCM63268_MODE_FUN(adsl_spi_mosi), 459 + BCM63268_MODE_FUN(vreg_clk), 460 + BCM63268_MODE_FUN(pcie_clkreq_b), 461 + BCM63268_MODE_FUN(switch_led_clk), 462 + BCM63268_MODE_FUN(switch_led_data), 463 + BCM63268_CTRL_FUN(wifi), 464 + BCM63268_BASEMODE_FUN(nand, BCM63268_BASEMODE_NAND), 465 + BCM63268_BASEMODE_FUN(dectpd, BCM63268_BASEMODE_DECTPD), 466 + BCM63268_BASEMODE_FUN(vdsl_phy_override_0, 467 + BCM63268_BASEMODE_VDSL_PHY_0), 468 + BCM63268_BASEMODE_FUN(vdsl_phy_override_1, 469 + BCM63268_BASEMODE_VDSL_PHY_1), 470 + BCM63268_BASEMODE_FUN(vdsl_phy_override_2, 471 + BCM63268_BASEMODE_VDSL_PHY_2), 472 + BCM63268_BASEMODE_FUN(vdsl_phy_override_3, 473 + BCM63268_BASEMODE_VDSL_PHY_3), 474 + }; 475 + 476 + static int bcm63268_pinctrl_get_group_count(struct pinctrl_dev *pctldev) 477 + { 478 + return ARRAY_SIZE(bcm63268_groups); 479 + } 480 + 481 + static const char *bcm63268_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 482 + unsigned group) 483 + { 484 + return bcm63268_groups[group].name; 485 + } 486 + 487 + static int bcm63268_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 488 + unsigned group, 489 + const unsigned **pins, 490 + unsigned *num_pins) 491 + { 492 + *pins = bcm63268_groups[group].pins; 493 + *num_pins = bcm63268_groups[group].num_pins; 494 + 495 + return 0; 496 + } 497 + 498 + static int bcm63268_pinctrl_get_func_count(struct pinctrl_dev *pctldev) 499 + { 500 + return ARRAY_SIZE(bcm63268_funcs); 501 + } 502 + 503 + static const char *bcm63268_pinctrl_get_func_name(struct pinctrl_dev *pctldev, 504 + unsigned selector) 505 + { 506 + return bcm63268_funcs[selector].name; 507 + } 508 + 509 + static int bcm63268_pinctrl_get_groups(struct pinctrl_dev *pctldev, 510 + unsigned selector, 511 + const char * const **groups, 512 + unsigned * const num_groups) 513 + { 514 + *groups = bcm63268_funcs[selector].groups; 515 + *num_groups = bcm63268_funcs[selector].num_groups; 516 + 517 + return 0; 518 + } 519 + 520 + static void bcm63268_set_gpio(struct bcm63xx_pinctrl *pc, unsigned pin) 521 + { 522 + const struct pinctrl_pin_desc *desc = &bcm63268_pins[pin]; 523 + unsigned int basemode = (unsigned long) desc->drv_data; 524 + unsigned int mask = BIT(bcm63xx_bank_pin(pin)); 525 + 526 + if (basemode) 527 + regmap_update_bits(pc->regs, BCM63268_BASEMODE_REG, basemode, 528 + 0); 529 + 530 + if (pin < BCM63XX_BANK_GPIOS) { 531 + /* base mode: 0 => gpio, 1 => mux function */ 532 + regmap_update_bits(pc->regs, BCM63268_MODE_REG, mask, 0); 533 + 534 + /* pins 0-23 might be muxed to led */ 535 + if (pin < BCM63268_NUM_LEDS) 536 + regmap_update_bits(pc->regs, BCM63268_LED_REG, mask, 537 + 0); 538 + } else if (pin < BCM63268_NUM_GPIOS) { 539 + /* ctrl reg: 0 => wifi function, 1 => gpio */ 540 + regmap_update_bits(pc->regs, BCM63268_CTRL_REG, mask, mask); 541 + } 542 + } 543 + 544 + static int bcm63268_pinctrl_set_mux(struct pinctrl_dev *pctldev, 545 + unsigned selector, unsigned group) 546 + { 547 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 548 + const struct bcm63268_pingroup *pg = &bcm63268_groups[group]; 549 + const struct bcm63268_function *f = &bcm63268_funcs[selector]; 550 + unsigned i; 551 + unsigned int reg; 552 + unsigned int val, mask; 553 + 554 + for (i = 0; i < pg->num_pins; i++) 555 + bcm63268_set_gpio(pc, pg->pins[i]); 556 + 557 + switch (f->reg) { 558 + case BCM63268_LEDCTRL: 559 + reg = BCM63268_LED_REG; 560 + mask = BIT(pg->pins[0]); 561 + val = BIT(pg->pins[0]); 562 + break; 563 + case BCM63268_MODE: 564 + reg = BCM63268_MODE_REG; 565 + mask = BIT(pg->pins[0]); 566 + val = BIT(pg->pins[0]); 567 + break; 568 + case BCM63268_CTRL: 569 + reg = BCM63268_CTRL_REG; 570 + mask = BIT(pg->pins[0]); 571 + val = 0; 572 + break; 573 + case BCM63268_BASEMODE: 574 + reg = BCM63268_BASEMODE_REG; 575 + mask = f->mask; 576 + val = f->mask; 577 + break; 578 + default: 579 + WARN_ON(1); 580 + return -EINVAL; 581 + } 582 + 583 + regmap_update_bits(pc->regs, reg, mask, val); 584 + 585 + return 0; 586 + } 587 + 588 + static int bcm63268_gpio_request_enable(struct pinctrl_dev *pctldev, 589 + struct pinctrl_gpio_range *range, 590 + unsigned offset) 591 + { 592 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 593 + 594 + /* disable all functions using this pin */ 595 + bcm63268_set_gpio(pc, offset); 596 + 597 + return 0; 598 + } 599 + 600 + static struct pinctrl_ops bcm63268_pctl_ops = { 601 + .dt_free_map = pinctrl_utils_free_map, 602 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 603 + .get_group_name = bcm63268_pinctrl_get_group_name, 604 + .get_group_pins = bcm63268_pinctrl_get_group_pins, 605 + .get_groups_count = bcm63268_pinctrl_get_group_count, 606 + }; 607 + 608 + static struct pinmux_ops bcm63268_pmx_ops = { 609 + .get_function_groups = bcm63268_pinctrl_get_groups, 610 + .get_function_name = bcm63268_pinctrl_get_func_name, 611 + .get_functions_count = bcm63268_pinctrl_get_func_count, 612 + .gpio_request_enable = bcm63268_gpio_request_enable, 613 + .set_mux = bcm63268_pinctrl_set_mux, 614 + .strict = true, 615 + }; 616 + 617 + static const struct bcm63xx_pinctrl_soc bcm63268_soc = { 618 + .ngpios = BCM63268_NUM_GPIOS, 619 + .npins = ARRAY_SIZE(bcm63268_pins), 620 + .pctl_ops = &bcm63268_pctl_ops, 621 + .pins = bcm63268_pins, 622 + .pmx_ops = &bcm63268_pmx_ops, 623 + }; 624 + 625 + static int bcm63268_pinctrl_probe(struct platform_device *pdev) 626 + { 627 + return bcm63xx_pinctrl_probe(pdev, &bcm63268_soc, NULL); 628 + } 629 + 630 + static const struct of_device_id bcm63268_pinctrl_match[] = { 631 + { .compatible = "brcm,bcm63268-pinctrl", }, 632 + { /* sentinel */ } 633 + }; 634 + 635 + static struct platform_driver bcm63268_pinctrl_driver = { 636 + .probe = bcm63268_pinctrl_probe, 637 + .driver = { 638 + .name = "bcm63268-pinctrl", 639 + .of_match_table = bcm63268_pinctrl_match, 640 + }, 641 + }; 642 + 643 + builtin_platform_driver(bcm63268_pinctrl_driver);
+404
drivers/pinctrl/bcm/pinctrl-bcm6328.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM6328 GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/kernel.h> 12 + #include <linux/of.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/regmap.h> 16 + 17 + #include "../pinctrl-utils.h" 18 + 19 + #include "pinctrl-bcm63xx.h" 20 + 21 + #define BCM6328_NUM_GPIOS 32 22 + 23 + #define BCM6328_MODE_REG 0x18 24 + #define BCM6328_MUX_HI_REG 0x1c 25 + #define BCM6328_MUX_LO_REG 0x20 26 + #define BCM6328_MUX_OTHER_REG 0x24 27 + #define BCM6328_MUX_MASK GENMASK(1, 0) 28 + 29 + struct bcm6328_pingroup { 30 + const char *name; 31 + const unsigned * const pins; 32 + const unsigned num_pins; 33 + }; 34 + 35 + struct bcm6328_function { 36 + const char *name; 37 + const char * const *groups; 38 + const unsigned num_groups; 39 + 40 + unsigned mode_val:1; 41 + unsigned mux_val:2; 42 + }; 43 + 44 + static const unsigned int bcm6328_mux[] = { 45 + BCM6328_MUX_LO_REG, 46 + BCM6328_MUX_HI_REG, 47 + BCM6328_MUX_OTHER_REG 48 + }; 49 + 50 + static const struct pinctrl_pin_desc bcm6328_pins[] = { 51 + PINCTRL_PIN(0, "gpio0"), 52 + PINCTRL_PIN(1, "gpio1"), 53 + PINCTRL_PIN(2, "gpio2"), 54 + PINCTRL_PIN(3, "gpio3"), 55 + PINCTRL_PIN(4, "gpio4"), 56 + PINCTRL_PIN(5, "gpio5"), 57 + PINCTRL_PIN(6, "gpio6"), 58 + PINCTRL_PIN(7, "gpio7"), 59 + PINCTRL_PIN(8, "gpio8"), 60 + PINCTRL_PIN(9, "gpio9"), 61 + PINCTRL_PIN(10, "gpio10"), 62 + PINCTRL_PIN(11, "gpio11"), 63 + PINCTRL_PIN(12, "gpio12"), 64 + PINCTRL_PIN(13, "gpio13"), 65 + PINCTRL_PIN(14, "gpio14"), 66 + PINCTRL_PIN(15, "gpio15"), 67 + PINCTRL_PIN(16, "gpio16"), 68 + PINCTRL_PIN(17, "gpio17"), 69 + PINCTRL_PIN(18, "gpio18"), 70 + PINCTRL_PIN(19, "gpio19"), 71 + PINCTRL_PIN(20, "gpio20"), 72 + PINCTRL_PIN(21, "gpio21"), 73 + PINCTRL_PIN(22, "gpio22"), 74 + PINCTRL_PIN(23, "gpio23"), 75 + PINCTRL_PIN(24, "gpio24"), 76 + PINCTRL_PIN(25, "gpio25"), 77 + PINCTRL_PIN(26, "gpio26"), 78 + PINCTRL_PIN(27, "gpio27"), 79 + PINCTRL_PIN(28, "gpio28"), 80 + PINCTRL_PIN(29, "gpio29"), 81 + PINCTRL_PIN(30, "gpio30"), 82 + PINCTRL_PIN(31, "gpio31"), 83 + 84 + /* 85 + * No idea where they really are; so let's put them according 86 + * to their mux offsets. 87 + */ 88 + PINCTRL_PIN(36, "hsspi_cs1"), 89 + PINCTRL_PIN(38, "usb_p2"), 90 + }; 91 + 92 + static unsigned gpio0_pins[] = { 0 }; 93 + static unsigned gpio1_pins[] = { 1 }; 94 + static unsigned gpio2_pins[] = { 2 }; 95 + static unsigned gpio3_pins[] = { 3 }; 96 + static unsigned gpio4_pins[] = { 4 }; 97 + static unsigned gpio5_pins[] = { 5 }; 98 + static unsigned gpio6_pins[] = { 6 }; 99 + static unsigned gpio7_pins[] = { 7 }; 100 + static unsigned gpio8_pins[] = { 8 }; 101 + static unsigned gpio9_pins[] = { 9 }; 102 + static unsigned gpio10_pins[] = { 10 }; 103 + static unsigned gpio11_pins[] = { 11 }; 104 + static unsigned gpio12_pins[] = { 12 }; 105 + static unsigned gpio13_pins[] = { 13 }; 106 + static unsigned gpio14_pins[] = { 14 }; 107 + static unsigned gpio15_pins[] = { 15 }; 108 + static unsigned gpio16_pins[] = { 16 }; 109 + static unsigned gpio17_pins[] = { 17 }; 110 + static unsigned gpio18_pins[] = { 18 }; 111 + static unsigned gpio19_pins[] = { 19 }; 112 + static unsigned gpio20_pins[] = { 20 }; 113 + static unsigned gpio21_pins[] = { 21 }; 114 + static unsigned gpio22_pins[] = { 22 }; 115 + static unsigned gpio23_pins[] = { 23 }; 116 + static unsigned gpio24_pins[] = { 24 }; 117 + static unsigned gpio25_pins[] = { 25 }; 118 + static unsigned gpio26_pins[] = { 26 }; 119 + static unsigned gpio27_pins[] = { 27 }; 120 + static unsigned gpio28_pins[] = { 28 }; 121 + static unsigned gpio29_pins[] = { 29 }; 122 + static unsigned gpio30_pins[] = { 30 }; 123 + static unsigned gpio31_pins[] = { 31 }; 124 + 125 + static unsigned hsspi_cs1_pins[] = { 36 }; 126 + static unsigned usb_port1_pins[] = { 38 }; 127 + 128 + #define BCM6328_GROUP(n) \ 129 + { \ 130 + .name = #n, \ 131 + .pins = n##_pins, \ 132 + .num_pins = ARRAY_SIZE(n##_pins), \ 133 + } 134 + 135 + static struct bcm6328_pingroup bcm6328_groups[] = { 136 + BCM6328_GROUP(gpio0), 137 + BCM6328_GROUP(gpio1), 138 + BCM6328_GROUP(gpio2), 139 + BCM6328_GROUP(gpio3), 140 + BCM6328_GROUP(gpio4), 141 + BCM6328_GROUP(gpio5), 142 + BCM6328_GROUP(gpio6), 143 + BCM6328_GROUP(gpio7), 144 + BCM6328_GROUP(gpio8), 145 + BCM6328_GROUP(gpio9), 146 + BCM6328_GROUP(gpio10), 147 + BCM6328_GROUP(gpio11), 148 + BCM6328_GROUP(gpio12), 149 + BCM6328_GROUP(gpio13), 150 + BCM6328_GROUP(gpio14), 151 + BCM6328_GROUP(gpio15), 152 + BCM6328_GROUP(gpio16), 153 + BCM6328_GROUP(gpio17), 154 + BCM6328_GROUP(gpio18), 155 + BCM6328_GROUP(gpio19), 156 + BCM6328_GROUP(gpio20), 157 + BCM6328_GROUP(gpio21), 158 + BCM6328_GROUP(gpio22), 159 + BCM6328_GROUP(gpio23), 160 + BCM6328_GROUP(gpio24), 161 + BCM6328_GROUP(gpio25), 162 + BCM6328_GROUP(gpio26), 163 + BCM6328_GROUP(gpio27), 164 + BCM6328_GROUP(gpio28), 165 + BCM6328_GROUP(gpio29), 166 + BCM6328_GROUP(gpio30), 167 + BCM6328_GROUP(gpio31), 168 + 169 + BCM6328_GROUP(hsspi_cs1), 170 + BCM6328_GROUP(usb_port1), 171 + }; 172 + 173 + /* GPIO_MODE */ 174 + static const char * const led_groups[] = { 175 + "gpio0", 176 + "gpio1", 177 + "gpio2", 178 + "gpio3", 179 + "gpio4", 180 + "gpio5", 181 + "gpio6", 182 + "gpio7", 183 + "gpio8", 184 + "gpio9", 185 + "gpio10", 186 + "gpio11", 187 + "gpio12", 188 + "gpio13", 189 + "gpio14", 190 + "gpio15", 191 + "gpio16", 192 + "gpio17", 193 + "gpio18", 194 + "gpio19", 195 + "gpio20", 196 + "gpio21", 197 + "gpio22", 198 + "gpio23", 199 + }; 200 + 201 + /* PINMUX_SEL */ 202 + static const char * const serial_led_data_groups[] = { 203 + "gpio6", 204 + }; 205 + 206 + static const char * const serial_led_clk_groups[] = { 207 + "gpio7", 208 + }; 209 + 210 + static const char * const inet_act_led_groups[] = { 211 + "gpio11", 212 + }; 213 + 214 + static const char * const pcie_clkreq_groups[] = { 215 + "gpio16", 216 + }; 217 + 218 + static const char * const ephy0_act_led_groups[] = { 219 + "gpio25", 220 + }; 221 + 222 + static const char * const ephy1_act_led_groups[] = { 223 + "gpio26", 224 + }; 225 + 226 + static const char * const ephy2_act_led_groups[] = { 227 + "gpio27", 228 + }; 229 + 230 + static const char * const ephy3_act_led_groups[] = { 231 + "gpio28", 232 + }; 233 + 234 + static const char * const hsspi_cs1_groups[] = { 235 + "hsspi_cs1" 236 + }; 237 + 238 + static const char * const usb_host_port_groups[] = { 239 + "usb_port1", 240 + }; 241 + 242 + static const char * const usb_device_port_groups[] = { 243 + "usb_port1", 244 + }; 245 + 246 + #define BCM6328_MODE_FUN(n) \ 247 + { \ 248 + .name = #n, \ 249 + .groups = n##_groups, \ 250 + .num_groups = ARRAY_SIZE(n##_groups), \ 251 + .mode_val = 1, \ 252 + } 253 + 254 + #define BCM6328_MUX_FUN(n, mux) \ 255 + { \ 256 + .name = #n, \ 257 + .groups = n##_groups, \ 258 + .num_groups = ARRAY_SIZE(n##_groups), \ 259 + .mux_val = mux, \ 260 + } 261 + 262 + static const struct bcm6328_function bcm6328_funcs[] = { 263 + BCM6328_MODE_FUN(led), 264 + BCM6328_MUX_FUN(serial_led_data, 2), 265 + BCM6328_MUX_FUN(serial_led_clk, 2), 266 + BCM6328_MUX_FUN(inet_act_led, 1), 267 + BCM6328_MUX_FUN(pcie_clkreq, 2), 268 + BCM6328_MUX_FUN(ephy0_act_led, 1), 269 + BCM6328_MUX_FUN(ephy1_act_led, 1), 270 + BCM6328_MUX_FUN(ephy2_act_led, 1), 271 + BCM6328_MUX_FUN(ephy3_act_led, 1), 272 + BCM6328_MUX_FUN(hsspi_cs1, 2), 273 + BCM6328_MUX_FUN(usb_host_port, 1), 274 + BCM6328_MUX_FUN(usb_device_port, 2), 275 + }; 276 + 277 + static inline unsigned int bcm6328_mux_off(unsigned int pin) 278 + { 279 + return bcm6328_mux[pin / 16]; 280 + } 281 + 282 + static int bcm6328_pinctrl_get_group_count(struct pinctrl_dev *pctldev) 283 + { 284 + return ARRAY_SIZE(bcm6328_groups); 285 + } 286 + 287 + static const char *bcm6328_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 288 + unsigned group) 289 + { 290 + return bcm6328_groups[group].name; 291 + } 292 + 293 + static int bcm6328_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 294 + unsigned group, const unsigned **pins, 295 + unsigned *num_pins) 296 + { 297 + *pins = bcm6328_groups[group].pins; 298 + *num_pins = bcm6328_groups[group].num_pins; 299 + 300 + return 0; 301 + } 302 + 303 + static int bcm6328_pinctrl_get_func_count(struct pinctrl_dev *pctldev) 304 + { 305 + return ARRAY_SIZE(bcm6328_funcs); 306 + } 307 + 308 + static const char *bcm6328_pinctrl_get_func_name(struct pinctrl_dev *pctldev, 309 + unsigned selector) 310 + { 311 + return bcm6328_funcs[selector].name; 312 + } 313 + 314 + static int bcm6328_pinctrl_get_groups(struct pinctrl_dev *pctldev, 315 + unsigned selector, 316 + const char * const **groups, 317 + unsigned * const num_groups) 318 + { 319 + *groups = bcm6328_funcs[selector].groups; 320 + *num_groups = bcm6328_funcs[selector].num_groups; 321 + 322 + return 0; 323 + } 324 + 325 + static void bcm6328_rmw_mux(struct bcm63xx_pinctrl *pc, unsigned pin, 326 + unsigned int mode, unsigned int mux) 327 + { 328 + if (pin < BCM6328_NUM_GPIOS) 329 + regmap_update_bits(pc->regs, BCM6328_MODE_REG, BIT(pin), 330 + mode ? BIT(pin) : 0); 331 + 332 + regmap_update_bits(pc->regs, bcm6328_mux_off(pin), 333 + BCM6328_MUX_MASK << ((pin % 16) * 2), 334 + mux << ((pin % 16) * 2)); 335 + } 336 + 337 + static int bcm6328_pinctrl_set_mux(struct pinctrl_dev *pctldev, 338 + unsigned selector, unsigned group) 339 + { 340 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 341 + const struct bcm6328_pingroup *pg = &bcm6328_groups[group]; 342 + const struct bcm6328_function *f = &bcm6328_funcs[selector]; 343 + 344 + bcm6328_rmw_mux(pc, pg->pins[0], f->mode_val, f->mux_val); 345 + 346 + return 0; 347 + } 348 + 349 + static int bcm6328_gpio_request_enable(struct pinctrl_dev *pctldev, 350 + struct pinctrl_gpio_range *range, 351 + unsigned offset) 352 + { 353 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 354 + 355 + /* disable all functions using this pin */ 356 + bcm6328_rmw_mux(pc, offset, 0, 0); 357 + 358 + return 0; 359 + } 360 + 361 + static struct pinctrl_ops bcm6328_pctl_ops = { 362 + .dt_free_map = pinctrl_utils_free_map, 363 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 364 + .get_group_name = bcm6328_pinctrl_get_group_name, 365 + .get_group_pins = bcm6328_pinctrl_get_group_pins, 366 + .get_groups_count = bcm6328_pinctrl_get_group_count, 367 + }; 368 + 369 + static struct pinmux_ops bcm6328_pmx_ops = { 370 + .get_function_groups = bcm6328_pinctrl_get_groups, 371 + .get_function_name = bcm6328_pinctrl_get_func_name, 372 + .get_functions_count = bcm6328_pinctrl_get_func_count, 373 + .gpio_request_enable = bcm6328_gpio_request_enable, 374 + .set_mux = bcm6328_pinctrl_set_mux, 375 + .strict = true, 376 + }; 377 + 378 + static const struct bcm63xx_pinctrl_soc bcm6328_soc = { 379 + .ngpios = BCM6328_NUM_GPIOS, 380 + .npins = ARRAY_SIZE(bcm6328_pins), 381 + .pctl_ops = &bcm6328_pctl_ops, 382 + .pins = bcm6328_pins, 383 + .pmx_ops = &bcm6328_pmx_ops, 384 + }; 385 + 386 + static int bcm6328_pinctrl_probe(struct platform_device *pdev) 387 + { 388 + return bcm63xx_pinctrl_probe(pdev, &bcm6328_soc, NULL); 389 + } 390 + 391 + static const struct of_device_id bcm6328_pinctrl_match[] = { 392 + { .compatible = "brcm,bcm6328-pinctrl", }, 393 + { /* sentinel */ } 394 + }; 395 + 396 + static struct platform_driver bcm6328_pinctrl_driver = { 397 + .probe = bcm6328_pinctrl_probe, 398 + .driver = { 399 + .name = "bcm6328-pinctrl", 400 + .of_match_table = bcm6328_pinctrl_match, 401 + }, 402 + }; 403 + 404 + builtin_platform_driver(bcm6328_pinctrl_driver);
+369
drivers/pinctrl/bcm/pinctrl-bcm6358.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM6358 GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/kernel.h> 12 + #include <linux/of.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/regmap.h> 16 + 17 + #include "../pinctrl-utils.h" 18 + 19 + #include "pinctrl-bcm63xx.h" 20 + 21 + #define BCM6358_NUM_GPIOS 40 22 + 23 + #define BCM6358_MODE_REG 0x18 24 + #define BCM6358_MODE_MUX_NONE 0 25 + #define BCM6358_MODE_MUX_EBI_CS BIT(5) 26 + #define BCM6358_MODE_MUX_UART1 BIT(6) 27 + #define BCM6358_MODE_MUX_SPI_CS BIT(7) 28 + #define BCM6358_MODE_MUX_ASYNC_MODEM BIT(8) 29 + #define BCM6358_MODE_MUX_LEGACY_LED BIT(9) 30 + #define BCM6358_MODE_MUX_SERIAL_LED BIT(10) 31 + #define BCM6358_MODE_MUX_LED BIT(11) 32 + #define BCM6358_MODE_MUX_UTOPIA BIT(12) 33 + #define BCM6358_MODE_MUX_CLKRST BIT(13) 34 + #define BCM6358_MODE_MUX_PWM_SYN_CLK BIT(14) 35 + #define BCM6358_MODE_MUX_SYS_IRQ BIT(15) 36 + 37 + struct bcm6358_pingroup { 38 + const char *name; 39 + const unsigned * const pins; 40 + const unsigned num_pins; 41 + 42 + const uint16_t mode_val; 43 + 44 + /* non-GPIO function muxes require the gpio direction to be set */ 45 + const uint16_t direction; 46 + }; 47 + 48 + struct bcm6358_function { 49 + const char *name; 50 + const char * const *groups; 51 + const unsigned num_groups; 52 + }; 53 + 54 + struct bcm6358_priv { 55 + struct regmap_field *overlays; 56 + }; 57 + 58 + #define BCM6358_GPIO_PIN(a, b, bit1, bit2, bit3) \ 59 + { \ 60 + .number = a, \ 61 + .name = b, \ 62 + .drv_data = (void *)(BCM6358_MODE_MUX_##bit1 | \ 63 + BCM6358_MODE_MUX_##bit2 | \ 64 + BCM6358_MODE_MUX_##bit3), \ 65 + } 66 + 67 + static const struct pinctrl_pin_desc bcm6358_pins[] = { 68 + BCM6358_GPIO_PIN(0, "gpio0", LED, NONE, NONE), 69 + BCM6358_GPIO_PIN(1, "gpio1", LED, NONE, NONE), 70 + BCM6358_GPIO_PIN(2, "gpio2", LED, NONE, NONE), 71 + BCM6358_GPIO_PIN(3, "gpio3", LED, NONE, NONE), 72 + PINCTRL_PIN(4, "gpio4"), 73 + BCM6358_GPIO_PIN(5, "gpio5", SYS_IRQ, NONE, NONE), 74 + BCM6358_GPIO_PIN(6, "gpio6", SERIAL_LED, NONE, NONE), 75 + BCM6358_GPIO_PIN(7, "gpio7", SERIAL_LED, NONE, NONE), 76 + BCM6358_GPIO_PIN(8, "gpio8", PWM_SYN_CLK, NONE, NONE), 77 + BCM6358_GPIO_PIN(9, "gpio09", LEGACY_LED, NONE, NONE), 78 + BCM6358_GPIO_PIN(10, "gpio10", LEGACY_LED, NONE, NONE), 79 + BCM6358_GPIO_PIN(11, "gpio11", LEGACY_LED, NONE, NONE), 80 + BCM6358_GPIO_PIN(12, "gpio12", LEGACY_LED, ASYNC_MODEM, UTOPIA), 81 + BCM6358_GPIO_PIN(13, "gpio13", LEGACY_LED, ASYNC_MODEM, UTOPIA), 82 + BCM6358_GPIO_PIN(14, "gpio14", LEGACY_LED, ASYNC_MODEM, UTOPIA), 83 + BCM6358_GPIO_PIN(15, "gpio15", LEGACY_LED, ASYNC_MODEM, UTOPIA), 84 + PINCTRL_PIN(16, "gpio16"), 85 + PINCTRL_PIN(17, "gpio17"), 86 + PINCTRL_PIN(18, "gpio18"), 87 + PINCTRL_PIN(19, "gpio19"), 88 + PINCTRL_PIN(20, "gpio20"), 89 + PINCTRL_PIN(21, "gpio21"), 90 + BCM6358_GPIO_PIN(22, "gpio22", UTOPIA, NONE, NONE), 91 + BCM6358_GPIO_PIN(23, "gpio23", UTOPIA, NONE, NONE), 92 + BCM6358_GPIO_PIN(24, "gpio24", UTOPIA, NONE, NONE), 93 + BCM6358_GPIO_PIN(25, "gpio25", UTOPIA, NONE, NONE), 94 + BCM6358_GPIO_PIN(26, "gpio26", UTOPIA, NONE, NONE), 95 + BCM6358_GPIO_PIN(27, "gpio27", UTOPIA, NONE, NONE), 96 + BCM6358_GPIO_PIN(28, "gpio28", UTOPIA, UART1, NONE), 97 + BCM6358_GPIO_PIN(29, "gpio29", UTOPIA, UART1, NONE), 98 + BCM6358_GPIO_PIN(30, "gpio30", UTOPIA, UART1, EBI_CS), 99 + BCM6358_GPIO_PIN(31, "gpio31", UTOPIA, UART1, EBI_CS), 100 + BCM6358_GPIO_PIN(32, "gpio32", SPI_CS, NONE, NONE), 101 + BCM6358_GPIO_PIN(33, "gpio33", SPI_CS, NONE, NONE), 102 + PINCTRL_PIN(34, "gpio34"), 103 + PINCTRL_PIN(35, "gpio35"), 104 + PINCTRL_PIN(36, "gpio36"), 105 + PINCTRL_PIN(37, "gpio37"), 106 + PINCTRL_PIN(38, "gpio38"), 107 + PINCTRL_PIN(39, "gpio39"), 108 + }; 109 + 110 + static unsigned ebi_cs_grp_pins[] = { 30, 31 }; 111 + 112 + static unsigned uart1_grp_pins[] = { 28, 29, 30, 31 }; 113 + 114 + static unsigned spi_cs_grp_pins[] = { 32, 33 }; 115 + 116 + static unsigned async_modem_grp_pins[] = { 12, 13, 14, 15 }; 117 + 118 + static unsigned serial_led_grp_pins[] = { 6, 7 }; 119 + 120 + static unsigned legacy_led_grp_pins[] = { 9, 10, 11, 12, 13, 14, 15 }; 121 + 122 + static unsigned led_grp_pins[] = { 0, 1, 2, 3 }; 123 + 124 + static unsigned utopia_grp_pins[] = { 125 + 12, 13, 14, 15, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 126 + }; 127 + 128 + static unsigned pwm_syn_clk_grp_pins[] = { 8 }; 129 + 130 + static unsigned sys_irq_grp_pins[] = { 5 }; 131 + 132 + #define BCM6358_GPIO_MUX_GROUP(n, bit, dir) \ 133 + { \ 134 + .name = #n, \ 135 + .pins = n##_pins, \ 136 + .num_pins = ARRAY_SIZE(n##_pins), \ 137 + .mode_val = BCM6358_MODE_MUX_##bit, \ 138 + .direction = dir, \ 139 + } 140 + 141 + static const struct bcm6358_pingroup bcm6358_groups[] = { 142 + BCM6358_GPIO_MUX_GROUP(ebi_cs_grp, EBI_CS, 0x3), 143 + BCM6358_GPIO_MUX_GROUP(uart1_grp, UART1, 0x2), 144 + BCM6358_GPIO_MUX_GROUP(spi_cs_grp, SPI_CS, 0x6), 145 + BCM6358_GPIO_MUX_GROUP(async_modem_grp, ASYNC_MODEM, 0x6), 146 + BCM6358_GPIO_MUX_GROUP(legacy_led_grp, LEGACY_LED, 0x7f), 147 + BCM6358_GPIO_MUX_GROUP(serial_led_grp, SERIAL_LED, 0x3), 148 + BCM6358_GPIO_MUX_GROUP(led_grp, LED, 0xf), 149 + BCM6358_GPIO_MUX_GROUP(utopia_grp, UTOPIA, 0x000f), 150 + BCM6358_GPIO_MUX_GROUP(pwm_syn_clk_grp, PWM_SYN_CLK, 0x1), 151 + BCM6358_GPIO_MUX_GROUP(sys_irq_grp, SYS_IRQ, 0x1), 152 + }; 153 + 154 + static const char * const ebi_cs_groups[] = { 155 + "ebi_cs_grp" 156 + }; 157 + 158 + static const char * const uart1_groups[] = { 159 + "uart1_grp" 160 + }; 161 + 162 + static const char * const spi_cs_2_3_groups[] = { 163 + "spi_cs_2_3_grp" 164 + }; 165 + 166 + static const char * const async_modem_groups[] = { 167 + "async_modem_grp" 168 + }; 169 + 170 + static const char * const legacy_led_groups[] = { 171 + "legacy_led_grp", 172 + }; 173 + 174 + static const char * const serial_led_groups[] = { 175 + "serial_led_grp", 176 + }; 177 + 178 + static const char * const led_groups[] = { 179 + "led_grp", 180 + }; 181 + 182 + static const char * const clkrst_groups[] = { 183 + "clkrst_grp", 184 + }; 185 + 186 + static const char * const pwm_syn_clk_groups[] = { 187 + "pwm_syn_clk_grp", 188 + }; 189 + 190 + static const char * const sys_irq_groups[] = { 191 + "sys_irq_grp", 192 + }; 193 + 194 + #define BCM6358_FUN(n) \ 195 + { \ 196 + .name = #n, \ 197 + .groups = n##_groups, \ 198 + .num_groups = ARRAY_SIZE(n##_groups), \ 199 + } 200 + 201 + static const struct bcm6358_function bcm6358_funcs[] = { 202 + BCM6358_FUN(ebi_cs), 203 + BCM6358_FUN(uart1), 204 + BCM6358_FUN(spi_cs_2_3), 205 + BCM6358_FUN(async_modem), 206 + BCM6358_FUN(legacy_led), 207 + BCM6358_FUN(serial_led), 208 + BCM6358_FUN(led), 209 + BCM6358_FUN(clkrst), 210 + BCM6358_FUN(pwm_syn_clk), 211 + BCM6358_FUN(sys_irq), 212 + }; 213 + 214 + static int bcm6358_pinctrl_get_group_count(struct pinctrl_dev *pctldev) 215 + { 216 + return ARRAY_SIZE(bcm6358_groups); 217 + } 218 + 219 + static const char *bcm6358_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 220 + unsigned group) 221 + { 222 + return bcm6358_groups[group].name; 223 + } 224 + 225 + static int bcm6358_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 226 + unsigned group, const unsigned **pins, 227 + unsigned *num_pins) 228 + { 229 + *pins = bcm6358_groups[group].pins; 230 + *num_pins = bcm6358_groups[group].num_pins; 231 + 232 + return 0; 233 + } 234 + 235 + static int bcm6358_pinctrl_get_func_count(struct pinctrl_dev *pctldev) 236 + { 237 + return ARRAY_SIZE(bcm6358_funcs); 238 + } 239 + 240 + static const char *bcm6358_pinctrl_get_func_name(struct pinctrl_dev *pctldev, 241 + unsigned selector) 242 + { 243 + return bcm6358_funcs[selector].name; 244 + } 245 + 246 + static int bcm6358_pinctrl_get_groups(struct pinctrl_dev *pctldev, 247 + unsigned selector, 248 + const char * const **groups, 249 + unsigned * const num_groups) 250 + { 251 + *groups = bcm6358_funcs[selector].groups; 252 + *num_groups = bcm6358_funcs[selector].num_groups; 253 + 254 + return 0; 255 + } 256 + 257 + static int bcm6358_pinctrl_set_mux(struct pinctrl_dev *pctldev, 258 + unsigned selector, unsigned group) 259 + { 260 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 261 + struct bcm6358_priv *priv = pc->driver_data; 262 + const struct bcm6358_pingroup *pg = &bcm6358_groups[group]; 263 + unsigned int val = pg->mode_val; 264 + unsigned int mask = val; 265 + unsigned pin; 266 + 267 + for (pin = 0; pin < pg->num_pins; pin++) 268 + mask |= (unsigned long)bcm6358_pins[pin].drv_data; 269 + 270 + regmap_field_update_bits(priv->overlays, mask, val); 271 + 272 + for (pin = 0; pin < pg->num_pins; pin++) { 273 + struct pinctrl_gpio_range *range; 274 + unsigned int hw_gpio = bcm6358_pins[pin].number; 275 + 276 + range = pinctrl_find_gpio_range_from_pin(pctldev, hw_gpio); 277 + if (range) { 278 + struct gpio_chip *gc = range->gc; 279 + 280 + if (pg->direction & BIT(pin)) 281 + gc->direction_output(gc, hw_gpio, 0); 282 + else 283 + gc->direction_input(gc, hw_gpio); 284 + } 285 + } 286 + 287 + return 0; 288 + } 289 + 290 + static int bcm6358_gpio_request_enable(struct pinctrl_dev *pctldev, 291 + struct pinctrl_gpio_range *range, 292 + unsigned offset) 293 + { 294 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 295 + struct bcm6358_priv *priv = pc->driver_data; 296 + unsigned int mask; 297 + 298 + mask = (unsigned long) bcm6358_pins[offset].drv_data; 299 + if (!mask) 300 + return 0; 301 + 302 + /* disable all functions using this pin */ 303 + return regmap_field_update_bits(priv->overlays, mask, 0); 304 + } 305 + 306 + static struct pinctrl_ops bcm6358_pctl_ops = { 307 + .dt_free_map = pinctrl_utils_free_map, 308 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 309 + .get_group_name = bcm6358_pinctrl_get_group_name, 310 + .get_group_pins = bcm6358_pinctrl_get_group_pins, 311 + .get_groups_count = bcm6358_pinctrl_get_group_count, 312 + }; 313 + 314 + static struct pinmux_ops bcm6358_pmx_ops = { 315 + .get_function_groups = bcm6358_pinctrl_get_groups, 316 + .get_function_name = bcm6358_pinctrl_get_func_name, 317 + .get_functions_count = bcm6358_pinctrl_get_func_count, 318 + .gpio_request_enable = bcm6358_gpio_request_enable, 319 + .set_mux = bcm6358_pinctrl_set_mux, 320 + .strict = true, 321 + }; 322 + 323 + static const struct bcm63xx_pinctrl_soc bcm6358_soc = { 324 + .ngpios = BCM6358_NUM_GPIOS, 325 + .npins = ARRAY_SIZE(bcm6358_pins), 326 + .pctl_ops = &bcm6358_pctl_ops, 327 + .pins = bcm6358_pins, 328 + .pmx_ops = &bcm6358_pmx_ops, 329 + }; 330 + 331 + static int bcm6358_pinctrl_probe(struct platform_device *pdev) 332 + { 333 + struct reg_field overlays = REG_FIELD(BCM6358_MODE_REG, 0, 15); 334 + struct device *dev = &pdev->dev; 335 + struct bcm63xx_pinctrl *pc; 336 + struct bcm6358_priv *priv; 337 + int err; 338 + 339 + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 340 + if (!priv) 341 + return -ENOMEM; 342 + 343 + err = bcm63xx_pinctrl_probe(pdev, &bcm6358_soc, (void *) priv); 344 + if (err) 345 + return err; 346 + 347 + pc = platform_get_drvdata(pdev); 348 + 349 + priv->overlays = devm_regmap_field_alloc(dev, pc->regs, overlays); 350 + if (IS_ERR(priv->overlays)) 351 + return PTR_ERR(priv->overlays); 352 + 353 + return 0; 354 + } 355 + 356 + static const struct of_device_id bcm6358_pinctrl_match[] = { 357 + { .compatible = "brcm,bcm6358-pinctrl", }, 358 + { /* sentinel */ } 359 + }; 360 + 361 + static struct platform_driver bcm6358_pinctrl_driver = { 362 + .probe = bcm6358_pinctrl_probe, 363 + .driver = { 364 + .name = "bcm6358-pinctrl", 365 + .of_match_table = bcm6358_pinctrl_match, 366 + }, 367 + }; 368 + 369 + builtin_platform_driver(bcm6358_pinctrl_driver);
+617
drivers/pinctrl/bcm/pinctrl-bcm6362.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM6362 GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/kernel.h> 12 + #include <linux/of.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/regmap.h> 16 + 17 + #include "../pinctrl-utils.h" 18 + 19 + #include "pinctrl-bcm63xx.h" 20 + 21 + #define BCM6362_BANK_GPIOS 32 22 + #define BCM6362_NUM_GPIOS 48 23 + #define BCM6362_NUM_LEDS 24 24 + 25 + #define BCM6362_LED_REG 0x10 26 + #define BCM6362_MODE_REG 0x18 27 + #define BCM6362_CTRL_REG 0x1c 28 + #define BCM6362_BASEMODE_REG 0x38 29 + #define BASEMODE_NAND BIT(2) 30 + 31 + enum bcm6362_pinctrl_reg { 32 + BCM6362_LEDCTRL, 33 + BCM6362_MODE, 34 + BCM6362_CTRL, 35 + BCM6362_BASEMODE, 36 + }; 37 + 38 + struct bcm6362_pingroup { 39 + const char *name; 40 + const unsigned * const pins; 41 + const unsigned num_pins; 42 + }; 43 + 44 + struct bcm6362_function { 45 + const char *name; 46 + const char * const *groups; 47 + const unsigned num_groups; 48 + 49 + enum bcm6362_pinctrl_reg reg; 50 + uint32_t basemode_mask; 51 + }; 52 + 53 + #define BCM6362_PIN(a, b, mask) \ 54 + { \ 55 + .number = a, \ 56 + .name = b, \ 57 + .drv_data = (void *)(mask), \ 58 + } 59 + 60 + static const struct pinctrl_pin_desc bcm6362_pins[] = { 61 + PINCTRL_PIN(0, "gpio0"), 62 + PINCTRL_PIN(1, "gpio1"), 63 + PINCTRL_PIN(2, "gpio2"), 64 + PINCTRL_PIN(3, "gpio3"), 65 + PINCTRL_PIN(4, "gpio4"), 66 + PINCTRL_PIN(5, "gpio5"), 67 + PINCTRL_PIN(6, "gpio6"), 68 + PINCTRL_PIN(7, "gpio7"), 69 + BCM6362_PIN(8, "gpio8", BASEMODE_NAND), 70 + PINCTRL_PIN(9, "gpio9"), 71 + PINCTRL_PIN(10, "gpio10"), 72 + PINCTRL_PIN(11, "gpio11"), 73 + BCM6362_PIN(12, "gpio12", BASEMODE_NAND), 74 + BCM6362_PIN(13, "gpio13", BASEMODE_NAND), 75 + BCM6362_PIN(14, "gpio14", BASEMODE_NAND), 76 + BCM6362_PIN(15, "gpio15", BASEMODE_NAND), 77 + BCM6362_PIN(16, "gpio16", BASEMODE_NAND), 78 + BCM6362_PIN(17, "gpio17", BASEMODE_NAND), 79 + BCM6362_PIN(18, "gpio18", BASEMODE_NAND), 80 + BCM6362_PIN(19, "gpio19", BASEMODE_NAND), 81 + BCM6362_PIN(20, "gpio20", BASEMODE_NAND), 82 + BCM6362_PIN(21, "gpio21", BASEMODE_NAND), 83 + BCM6362_PIN(22, "gpio22", BASEMODE_NAND), 84 + BCM6362_PIN(23, "gpio23", BASEMODE_NAND), 85 + PINCTRL_PIN(24, "gpio24"), 86 + PINCTRL_PIN(25, "gpio25"), 87 + PINCTRL_PIN(26, "gpio26"), 88 + BCM6362_PIN(27, "gpio27", BASEMODE_NAND), 89 + PINCTRL_PIN(28, "gpio28"), 90 + PINCTRL_PIN(29, "gpio29"), 91 + PINCTRL_PIN(30, "gpio30"), 92 + PINCTRL_PIN(31, "gpio31"), 93 + PINCTRL_PIN(32, "gpio32"), 94 + PINCTRL_PIN(33, "gpio33"), 95 + PINCTRL_PIN(34, "gpio34"), 96 + PINCTRL_PIN(35, "gpio35"), 97 + PINCTRL_PIN(36, "gpio36"), 98 + PINCTRL_PIN(37, "gpio37"), 99 + PINCTRL_PIN(38, "gpio38"), 100 + PINCTRL_PIN(39, "gpio39"), 101 + PINCTRL_PIN(40, "gpio40"), 102 + PINCTRL_PIN(41, "gpio41"), 103 + PINCTRL_PIN(42, "gpio42"), 104 + PINCTRL_PIN(43, "gpio43"), 105 + PINCTRL_PIN(44, "gpio44"), 106 + PINCTRL_PIN(45, "gpio45"), 107 + PINCTRL_PIN(46, "gpio46"), 108 + PINCTRL_PIN(47, "gpio47"), 109 + }; 110 + 111 + static unsigned gpio0_pins[] = { 0 }; 112 + static unsigned gpio1_pins[] = { 1 }; 113 + static unsigned gpio2_pins[] = { 2 }; 114 + static unsigned gpio3_pins[] = { 3 }; 115 + static unsigned gpio4_pins[] = { 4 }; 116 + static unsigned gpio5_pins[] = { 5 }; 117 + static unsigned gpio6_pins[] = { 6 }; 118 + static unsigned gpio7_pins[] = { 7 }; 119 + static unsigned gpio8_pins[] = { 8 }; 120 + static unsigned gpio9_pins[] = { 9 }; 121 + static unsigned gpio10_pins[] = { 10 }; 122 + static unsigned gpio11_pins[] = { 11 }; 123 + static unsigned gpio12_pins[] = { 12 }; 124 + static unsigned gpio13_pins[] = { 13 }; 125 + static unsigned gpio14_pins[] = { 14 }; 126 + static unsigned gpio15_pins[] = { 15 }; 127 + static unsigned gpio16_pins[] = { 16 }; 128 + static unsigned gpio17_pins[] = { 17 }; 129 + static unsigned gpio18_pins[] = { 18 }; 130 + static unsigned gpio19_pins[] = { 19 }; 131 + static unsigned gpio20_pins[] = { 20 }; 132 + static unsigned gpio21_pins[] = { 21 }; 133 + static unsigned gpio22_pins[] = { 22 }; 134 + static unsigned gpio23_pins[] = { 23 }; 135 + static unsigned gpio24_pins[] = { 24 }; 136 + static unsigned gpio25_pins[] = { 25 }; 137 + static unsigned gpio26_pins[] = { 26 }; 138 + static unsigned gpio27_pins[] = { 27 }; 139 + static unsigned gpio28_pins[] = { 28 }; 140 + static unsigned gpio29_pins[] = { 29 }; 141 + static unsigned gpio30_pins[] = { 30 }; 142 + static unsigned gpio31_pins[] = { 31 }; 143 + static unsigned gpio32_pins[] = { 32 }; 144 + static unsigned gpio33_pins[] = { 33 }; 145 + static unsigned gpio34_pins[] = { 34 }; 146 + static unsigned gpio35_pins[] = { 35 }; 147 + static unsigned gpio36_pins[] = { 36 }; 148 + static unsigned gpio37_pins[] = { 37 }; 149 + static unsigned gpio38_pins[] = { 38 }; 150 + static unsigned gpio39_pins[] = { 39 }; 151 + static unsigned gpio40_pins[] = { 40 }; 152 + static unsigned gpio41_pins[] = { 41 }; 153 + static unsigned gpio42_pins[] = { 42 }; 154 + static unsigned gpio43_pins[] = { 43 }; 155 + static unsigned gpio44_pins[] = { 44 }; 156 + static unsigned gpio45_pins[] = { 45 }; 157 + static unsigned gpio46_pins[] = { 46 }; 158 + static unsigned gpio47_pins[] = { 47 }; 159 + 160 + static unsigned nand_grp_pins[] = { 161 + 8, 12, 13, 14, 15, 16, 17, 162 + 18, 19, 20, 21, 22, 23, 27, 163 + }; 164 + 165 + #define BCM6362_GROUP(n) \ 166 + { \ 167 + .name = #n, \ 168 + .pins = n##_pins, \ 169 + .num_pins = ARRAY_SIZE(n##_pins), \ 170 + } 171 + 172 + static struct bcm6362_pingroup bcm6362_groups[] = { 173 + BCM6362_GROUP(gpio0), 174 + BCM6362_GROUP(gpio1), 175 + BCM6362_GROUP(gpio2), 176 + BCM6362_GROUP(gpio3), 177 + BCM6362_GROUP(gpio4), 178 + BCM6362_GROUP(gpio5), 179 + BCM6362_GROUP(gpio6), 180 + BCM6362_GROUP(gpio7), 181 + BCM6362_GROUP(gpio8), 182 + BCM6362_GROUP(gpio9), 183 + BCM6362_GROUP(gpio10), 184 + BCM6362_GROUP(gpio11), 185 + BCM6362_GROUP(gpio12), 186 + BCM6362_GROUP(gpio13), 187 + BCM6362_GROUP(gpio14), 188 + BCM6362_GROUP(gpio15), 189 + BCM6362_GROUP(gpio16), 190 + BCM6362_GROUP(gpio17), 191 + BCM6362_GROUP(gpio18), 192 + BCM6362_GROUP(gpio19), 193 + BCM6362_GROUP(gpio20), 194 + BCM6362_GROUP(gpio21), 195 + BCM6362_GROUP(gpio22), 196 + BCM6362_GROUP(gpio23), 197 + BCM6362_GROUP(gpio24), 198 + BCM6362_GROUP(gpio25), 199 + BCM6362_GROUP(gpio26), 200 + BCM6362_GROUP(gpio27), 201 + BCM6362_GROUP(gpio28), 202 + BCM6362_GROUP(gpio29), 203 + BCM6362_GROUP(gpio30), 204 + BCM6362_GROUP(gpio31), 205 + BCM6362_GROUP(gpio32), 206 + BCM6362_GROUP(gpio33), 207 + BCM6362_GROUP(gpio34), 208 + BCM6362_GROUP(gpio35), 209 + BCM6362_GROUP(gpio36), 210 + BCM6362_GROUP(gpio37), 211 + BCM6362_GROUP(gpio38), 212 + BCM6362_GROUP(gpio39), 213 + BCM6362_GROUP(gpio40), 214 + BCM6362_GROUP(gpio41), 215 + BCM6362_GROUP(gpio42), 216 + BCM6362_GROUP(gpio43), 217 + BCM6362_GROUP(gpio44), 218 + BCM6362_GROUP(gpio45), 219 + BCM6362_GROUP(gpio46), 220 + BCM6362_GROUP(gpio47), 221 + BCM6362_GROUP(nand_grp), 222 + }; 223 + 224 + static const char * const led_groups[] = { 225 + "gpio0", 226 + "gpio1", 227 + "gpio2", 228 + "gpio3", 229 + "gpio4", 230 + "gpio5", 231 + "gpio6", 232 + "gpio7", 233 + "gpio8", 234 + "gpio9", 235 + "gpio10", 236 + "gpio11", 237 + "gpio12", 238 + "gpio13", 239 + "gpio14", 240 + "gpio15", 241 + "gpio16", 242 + "gpio17", 243 + "gpio18", 244 + "gpio19", 245 + "gpio20", 246 + "gpio21", 247 + "gpio22", 248 + "gpio23", 249 + }; 250 + 251 + static const char * const usb_device_led_groups[] = { 252 + "gpio0", 253 + }; 254 + 255 + static const char * const sys_irq_groups[] = { 256 + "gpio1", 257 + }; 258 + 259 + static const char * const serial_led_clk_groups[] = { 260 + "gpio2", 261 + }; 262 + 263 + static const char * const serial_led_data_groups[] = { 264 + "gpio3", 265 + }; 266 + 267 + static const char * const robosw_led_data_groups[] = { 268 + "gpio4", 269 + }; 270 + 271 + static const char * const robosw_led_clk_groups[] = { 272 + "gpio5", 273 + }; 274 + 275 + static const char * const robosw_led0_groups[] = { 276 + "gpio6", 277 + }; 278 + 279 + static const char * const robosw_led1_groups[] = { 280 + "gpio7", 281 + }; 282 + 283 + static const char * const inet_led_groups[] = { 284 + "gpio8", 285 + }; 286 + 287 + static const char * const spi_cs2_groups[] = { 288 + "gpio9", 289 + }; 290 + 291 + static const char * const spi_cs3_groups[] = { 292 + "gpio10", 293 + }; 294 + 295 + static const char * const ntr_pulse_groups[] = { 296 + "gpio11", 297 + }; 298 + 299 + static const char * const uart1_scts_groups[] = { 300 + "gpio12", 301 + }; 302 + 303 + static const char * const uart1_srts_groups[] = { 304 + "gpio13", 305 + }; 306 + 307 + static const char * const uart1_sdin_groups[] = { 308 + "gpio14", 309 + }; 310 + 311 + static const char * const uart1_sdout_groups[] = { 312 + "gpio15", 313 + }; 314 + 315 + static const char * const adsl_spi_miso_groups[] = { 316 + "gpio16", 317 + }; 318 + 319 + static const char * const adsl_spi_mosi_groups[] = { 320 + "gpio17", 321 + }; 322 + 323 + static const char * const adsl_spi_clk_groups[] = { 324 + "gpio18", 325 + }; 326 + 327 + static const char * const adsl_spi_cs_groups[] = { 328 + "gpio19", 329 + }; 330 + 331 + static const char * const ephy0_led_groups[] = { 332 + "gpio20", 333 + }; 334 + 335 + static const char * const ephy1_led_groups[] = { 336 + "gpio21", 337 + }; 338 + 339 + static const char * const ephy2_led_groups[] = { 340 + "gpio22", 341 + }; 342 + 343 + static const char * const ephy3_led_groups[] = { 344 + "gpio23", 345 + }; 346 + 347 + static const char * const ext_irq0_groups[] = { 348 + "gpio24", 349 + }; 350 + 351 + static const char * const ext_irq1_groups[] = { 352 + "gpio25", 353 + }; 354 + 355 + static const char * const ext_irq2_groups[] = { 356 + "gpio26", 357 + }; 358 + 359 + static const char * const ext_irq3_groups[] = { 360 + "gpio27", 361 + }; 362 + 363 + static const char * const wifi_groups[] = { 364 + "gpio32", 365 + "gpio33", 366 + "gpio34", 367 + "gpio35", 368 + "gpio36", 369 + "gpio37", 370 + "gpio38", 371 + "gpio39", 372 + "gpio40", 373 + "gpio41", 374 + "gpio42", 375 + "gpio43", 376 + "gpio44", 377 + "gpio45", 378 + "gpio46", 379 + "gpio47", 380 + }; 381 + 382 + static const char * const nand_groups[] = { 383 + "nand_grp", 384 + }; 385 + 386 + #define BCM6362_LED_FUN(n) \ 387 + { \ 388 + .name = #n, \ 389 + .groups = n##_groups, \ 390 + .num_groups = ARRAY_SIZE(n##_groups), \ 391 + .reg = BCM6362_LEDCTRL, \ 392 + } 393 + 394 + #define BCM6362_MODE_FUN(n) \ 395 + { \ 396 + .name = #n, \ 397 + .groups = n##_groups, \ 398 + .num_groups = ARRAY_SIZE(n##_groups), \ 399 + .reg = BCM6362_MODE, \ 400 + } 401 + 402 + #define BCM6362_CTRL_FUN(n) \ 403 + { \ 404 + .name = #n, \ 405 + .groups = n##_groups, \ 406 + .num_groups = ARRAY_SIZE(n##_groups), \ 407 + .reg = BCM6362_CTRL, \ 408 + } 409 + 410 + #define BCM6362_BASEMODE_FUN(n, mask) \ 411 + { \ 412 + .name = #n, \ 413 + .groups = n##_groups, \ 414 + .num_groups = ARRAY_SIZE(n##_groups), \ 415 + .reg = BCM6362_BASEMODE, \ 416 + .basemode_mask = (mask), \ 417 + } 418 + 419 + static const struct bcm6362_function bcm6362_funcs[] = { 420 + BCM6362_LED_FUN(led), 421 + BCM6362_MODE_FUN(usb_device_led), 422 + BCM6362_MODE_FUN(sys_irq), 423 + BCM6362_MODE_FUN(serial_led_clk), 424 + BCM6362_MODE_FUN(serial_led_data), 425 + BCM6362_MODE_FUN(robosw_led_data), 426 + BCM6362_MODE_FUN(robosw_led_clk), 427 + BCM6362_MODE_FUN(robosw_led0), 428 + BCM6362_MODE_FUN(robosw_led1), 429 + BCM6362_MODE_FUN(inet_led), 430 + BCM6362_MODE_FUN(spi_cs2), 431 + BCM6362_MODE_FUN(spi_cs3), 432 + BCM6362_MODE_FUN(ntr_pulse), 433 + BCM6362_MODE_FUN(uart1_scts), 434 + BCM6362_MODE_FUN(uart1_srts), 435 + BCM6362_MODE_FUN(uart1_sdin), 436 + BCM6362_MODE_FUN(uart1_sdout), 437 + BCM6362_MODE_FUN(adsl_spi_miso), 438 + BCM6362_MODE_FUN(adsl_spi_mosi), 439 + BCM6362_MODE_FUN(adsl_spi_clk), 440 + BCM6362_MODE_FUN(adsl_spi_cs), 441 + BCM6362_MODE_FUN(ephy0_led), 442 + BCM6362_MODE_FUN(ephy1_led), 443 + BCM6362_MODE_FUN(ephy2_led), 444 + BCM6362_MODE_FUN(ephy3_led), 445 + BCM6362_MODE_FUN(ext_irq0), 446 + BCM6362_MODE_FUN(ext_irq1), 447 + BCM6362_MODE_FUN(ext_irq2), 448 + BCM6362_MODE_FUN(ext_irq3), 449 + BCM6362_CTRL_FUN(wifi), 450 + BCM6362_BASEMODE_FUN(nand, BASEMODE_NAND), 451 + }; 452 + 453 + static int bcm6362_pinctrl_get_group_count(struct pinctrl_dev *pctldev) 454 + { 455 + return ARRAY_SIZE(bcm6362_groups); 456 + } 457 + 458 + static const char *bcm6362_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 459 + unsigned group) 460 + { 461 + return bcm6362_groups[group].name; 462 + } 463 + 464 + static int bcm6362_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 465 + unsigned group, const unsigned **pins, 466 + unsigned *num_pins) 467 + { 468 + *pins = bcm6362_groups[group].pins; 469 + *num_pins = bcm6362_groups[group].num_pins; 470 + 471 + return 0; 472 + } 473 + 474 + static int bcm6362_pinctrl_get_func_count(struct pinctrl_dev *pctldev) 475 + { 476 + return ARRAY_SIZE(bcm6362_funcs); 477 + } 478 + 479 + static const char *bcm6362_pinctrl_get_func_name(struct pinctrl_dev *pctldev, 480 + unsigned selector) 481 + { 482 + return bcm6362_funcs[selector].name; 483 + } 484 + 485 + static int bcm6362_pinctrl_get_groups(struct pinctrl_dev *pctldev, 486 + unsigned selector, 487 + const char * const **groups, 488 + unsigned * const num_groups) 489 + { 490 + *groups = bcm6362_funcs[selector].groups; 491 + *num_groups = bcm6362_funcs[selector].num_groups; 492 + 493 + return 0; 494 + } 495 + 496 + static void bcm6362_set_gpio(struct bcm63xx_pinctrl *pc, unsigned pin) 497 + { 498 + const struct pinctrl_pin_desc *desc = &bcm6362_pins[pin]; 499 + unsigned int basemode = (uintptr_t)desc->drv_data; 500 + unsigned int mask = bcm63xx_bank_pin(pin); 501 + 502 + if (basemode) 503 + regmap_update_bits(pc->regs, BCM6362_BASEMODE_REG, basemode, 0); 504 + 505 + if (pin < BCM63XX_BANK_GPIOS) { 506 + /* base mode 0 => gpio 1 => mux function */ 507 + regmap_update_bits(pc->regs, BCM6362_MODE_REG, mask, 0); 508 + 509 + /* pins 0-23 might be muxed to led */ 510 + if (pin < BCM6362_NUM_LEDS) 511 + regmap_update_bits(pc->regs, BCM6362_LED_REG, mask, 0); 512 + } else { 513 + /* ctrl reg 0 => wifi function 1 => gpio */ 514 + regmap_update_bits(pc->regs, BCM6362_CTRL_REG, mask, mask); 515 + } 516 + } 517 + 518 + static int bcm6362_pinctrl_set_mux(struct pinctrl_dev *pctldev, 519 + unsigned selector, unsigned group) 520 + { 521 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 522 + const struct bcm6362_pingroup *pg = &bcm6362_groups[group]; 523 + const struct bcm6362_function *f = &bcm6362_funcs[selector]; 524 + unsigned i; 525 + unsigned int reg; 526 + unsigned int val, mask; 527 + 528 + for (i = 0; i < pg->num_pins; i++) 529 + bcm6362_set_gpio(pc, pg->pins[i]); 530 + 531 + switch (f->reg) { 532 + case BCM6362_LEDCTRL: 533 + reg = BCM6362_LED_REG; 534 + mask = BIT(pg->pins[0]); 535 + val = BIT(pg->pins[0]); 536 + break; 537 + case BCM6362_MODE: 538 + reg = BCM6362_MODE_REG; 539 + mask = BIT(pg->pins[0]); 540 + val = BIT(pg->pins[0]); 541 + break; 542 + case BCM6362_CTRL: 543 + reg = BCM6362_CTRL_REG; 544 + mask = BIT(pg->pins[0]); 545 + val = 0; 546 + break; 547 + case BCM6362_BASEMODE: 548 + reg = BCM6362_BASEMODE_REG; 549 + mask = f->basemode_mask; 550 + val = f->basemode_mask; 551 + break; 552 + default: 553 + WARN_ON(1); 554 + return -EINVAL; 555 + } 556 + 557 + regmap_update_bits(pc->regs, reg, mask, val); 558 + 559 + return 0; 560 + } 561 + 562 + static int bcm6362_gpio_request_enable(struct pinctrl_dev *pctldev, 563 + struct pinctrl_gpio_range *range, 564 + unsigned offset) 565 + { 566 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 567 + 568 + /* disable all functions using this pin */ 569 + bcm6362_set_gpio(pc, offset); 570 + 571 + return 0; 572 + } 573 + 574 + static struct pinctrl_ops bcm6362_pctl_ops = { 575 + .dt_free_map = pinctrl_utils_free_map, 576 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 577 + .get_group_name = bcm6362_pinctrl_get_group_name, 578 + .get_group_pins = bcm6362_pinctrl_get_group_pins, 579 + .get_groups_count = bcm6362_pinctrl_get_group_count, 580 + }; 581 + 582 + static struct pinmux_ops bcm6362_pmx_ops = { 583 + .get_function_groups = bcm6362_pinctrl_get_groups, 584 + .get_function_name = bcm6362_pinctrl_get_func_name, 585 + .get_functions_count = bcm6362_pinctrl_get_func_count, 586 + .gpio_request_enable = bcm6362_gpio_request_enable, 587 + .set_mux = bcm6362_pinctrl_set_mux, 588 + .strict = true, 589 + }; 590 + 591 + static const struct bcm63xx_pinctrl_soc bcm6362_soc = { 592 + .ngpios = BCM6362_NUM_GPIOS, 593 + .npins = ARRAY_SIZE(bcm6362_pins), 594 + .pctl_ops = &bcm6362_pctl_ops, 595 + .pins = bcm6362_pins, 596 + .pmx_ops = &bcm6362_pmx_ops, 597 + }; 598 + 599 + static int bcm6362_pinctrl_probe(struct platform_device *pdev) 600 + { 601 + return bcm63xx_pinctrl_probe(pdev, &bcm6362_soc, NULL); 602 + } 603 + 604 + static const struct of_device_id bcm6362_pinctrl_match[] = { 605 + { .compatible = "brcm,bcm6362-pinctrl", }, 606 + { /* sentinel */ } 607 + }; 608 + 609 + static struct platform_driver bcm6362_pinctrl_driver = { 610 + .probe = bcm6362_pinctrl_probe, 611 + .driver = { 612 + .name = "bcm6362-pinctrl", 613 + .of_match_table = bcm6362_pinctrl_match, 614 + }, 615 + }; 616 + 617 + builtin_platform_driver(bcm6362_pinctrl_driver);
+523
drivers/pinctrl/bcm/pinctrl-bcm6368.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM6368 GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/bits.h> 10 + #include <linux/gpio/driver.h> 11 + #include <linux/kernel.h> 12 + #include <linux/of.h> 13 + #include <linux/pinctrl/pinmux.h> 14 + #include <linux/platform_device.h> 15 + #include <linux/regmap.h> 16 + 17 + #include "../pinctrl-utils.h" 18 + 19 + #include "pinctrl-bcm63xx.h" 20 + 21 + #define BCM6368_NUM_GPIOS 38 22 + 23 + #define BCM6368_MODE_REG 0x18 24 + #define BCM6368_BASEMODE_REG 0x38 25 + #define BCM6368_BASEMODE_MASK 0x7 26 + #define BCM6368_BASEMODE_GPIO 0x0 27 + #define BCM6368_BASEMODE_UART1 0x1 28 + 29 + struct bcm6368_pingroup { 30 + const char *name; 31 + const unsigned * const pins; 32 + const unsigned num_pins; 33 + }; 34 + 35 + struct bcm6368_function { 36 + const char *name; 37 + const char * const *groups; 38 + const unsigned num_groups; 39 + 40 + unsigned dir_out:16; 41 + unsigned basemode:3; 42 + }; 43 + 44 + struct bcm6368_priv { 45 + struct regmap_field *overlays; 46 + }; 47 + 48 + #define BCM6368_BASEMODE_PIN(a, b) \ 49 + { \ 50 + .number = a, \ 51 + .name = b, \ 52 + .drv_data = (void *)true \ 53 + } 54 + 55 + static const struct pinctrl_pin_desc bcm6368_pins[] = { 56 + PINCTRL_PIN(0, "gpio0"), 57 + PINCTRL_PIN(1, "gpio1"), 58 + PINCTRL_PIN(2, "gpio2"), 59 + PINCTRL_PIN(3, "gpio3"), 60 + PINCTRL_PIN(4, "gpio4"), 61 + PINCTRL_PIN(5, "gpio5"), 62 + PINCTRL_PIN(6, "gpio6"), 63 + PINCTRL_PIN(7, "gpio7"), 64 + PINCTRL_PIN(8, "gpio8"), 65 + PINCTRL_PIN(9, "gpio9"), 66 + PINCTRL_PIN(10, "gpio10"), 67 + PINCTRL_PIN(11, "gpio11"), 68 + PINCTRL_PIN(12, "gpio12"), 69 + PINCTRL_PIN(13, "gpio13"), 70 + PINCTRL_PIN(14, "gpio14"), 71 + PINCTRL_PIN(15, "gpio15"), 72 + PINCTRL_PIN(16, "gpio16"), 73 + PINCTRL_PIN(17, "gpio17"), 74 + PINCTRL_PIN(18, "gpio18"), 75 + PINCTRL_PIN(19, "gpio19"), 76 + PINCTRL_PIN(20, "gpio20"), 77 + PINCTRL_PIN(21, "gpio21"), 78 + PINCTRL_PIN(22, "gpio22"), 79 + PINCTRL_PIN(23, "gpio23"), 80 + PINCTRL_PIN(24, "gpio24"), 81 + PINCTRL_PIN(25, "gpio25"), 82 + PINCTRL_PIN(26, "gpio26"), 83 + PINCTRL_PIN(27, "gpio27"), 84 + PINCTRL_PIN(28, "gpio28"), 85 + PINCTRL_PIN(29, "gpio29"), 86 + BCM6368_BASEMODE_PIN(30, "gpio30"), 87 + BCM6368_BASEMODE_PIN(31, "gpio31"), 88 + BCM6368_BASEMODE_PIN(32, "gpio32"), 89 + BCM6368_BASEMODE_PIN(33, "gpio33"), 90 + PINCTRL_PIN(34, "gpio34"), 91 + PINCTRL_PIN(35, "gpio35"), 92 + PINCTRL_PIN(36, "gpio36"), 93 + PINCTRL_PIN(37, "gpio37"), 94 + }; 95 + 96 + static unsigned gpio0_pins[] = { 0 }; 97 + static unsigned gpio1_pins[] = { 1 }; 98 + static unsigned gpio2_pins[] = { 2 }; 99 + static unsigned gpio3_pins[] = { 3 }; 100 + static unsigned gpio4_pins[] = { 4 }; 101 + static unsigned gpio5_pins[] = { 5 }; 102 + static unsigned gpio6_pins[] = { 6 }; 103 + static unsigned gpio7_pins[] = { 7 }; 104 + static unsigned gpio8_pins[] = { 8 }; 105 + static unsigned gpio9_pins[] = { 9 }; 106 + static unsigned gpio10_pins[] = { 10 }; 107 + static unsigned gpio11_pins[] = { 11 }; 108 + static unsigned gpio12_pins[] = { 12 }; 109 + static unsigned gpio13_pins[] = { 13 }; 110 + static unsigned gpio14_pins[] = { 14 }; 111 + static unsigned gpio15_pins[] = { 15 }; 112 + static unsigned gpio16_pins[] = { 16 }; 113 + static unsigned gpio17_pins[] = { 17 }; 114 + static unsigned gpio18_pins[] = { 18 }; 115 + static unsigned gpio19_pins[] = { 19 }; 116 + static unsigned gpio20_pins[] = { 20 }; 117 + static unsigned gpio21_pins[] = { 21 }; 118 + static unsigned gpio22_pins[] = { 22 }; 119 + static unsigned gpio23_pins[] = { 23 }; 120 + static unsigned gpio24_pins[] = { 24 }; 121 + static unsigned gpio25_pins[] = { 25 }; 122 + static unsigned gpio26_pins[] = { 26 }; 123 + static unsigned gpio27_pins[] = { 27 }; 124 + static unsigned gpio28_pins[] = { 28 }; 125 + static unsigned gpio29_pins[] = { 29 }; 126 + static unsigned gpio30_pins[] = { 30 }; 127 + static unsigned gpio31_pins[] = { 31 }; 128 + static unsigned uart1_grp_pins[] = { 30, 31, 32, 33 }; 129 + 130 + #define BCM6368_GROUP(n) \ 131 + { \ 132 + .name = #n, \ 133 + .pins = n##_pins, \ 134 + .num_pins = ARRAY_SIZE(n##_pins), \ 135 + } 136 + 137 + static struct bcm6368_pingroup bcm6368_groups[] = { 138 + BCM6368_GROUP(gpio0), 139 + BCM6368_GROUP(gpio1), 140 + BCM6368_GROUP(gpio2), 141 + BCM6368_GROUP(gpio3), 142 + BCM6368_GROUP(gpio4), 143 + BCM6368_GROUP(gpio5), 144 + BCM6368_GROUP(gpio6), 145 + BCM6368_GROUP(gpio7), 146 + BCM6368_GROUP(gpio8), 147 + BCM6368_GROUP(gpio9), 148 + BCM6368_GROUP(gpio10), 149 + BCM6368_GROUP(gpio11), 150 + BCM6368_GROUP(gpio12), 151 + BCM6368_GROUP(gpio13), 152 + BCM6368_GROUP(gpio14), 153 + BCM6368_GROUP(gpio15), 154 + BCM6368_GROUP(gpio16), 155 + BCM6368_GROUP(gpio17), 156 + BCM6368_GROUP(gpio18), 157 + BCM6368_GROUP(gpio19), 158 + BCM6368_GROUP(gpio20), 159 + BCM6368_GROUP(gpio21), 160 + BCM6368_GROUP(gpio22), 161 + BCM6368_GROUP(gpio23), 162 + BCM6368_GROUP(gpio24), 163 + BCM6368_GROUP(gpio25), 164 + BCM6368_GROUP(gpio26), 165 + BCM6368_GROUP(gpio27), 166 + BCM6368_GROUP(gpio28), 167 + BCM6368_GROUP(gpio29), 168 + BCM6368_GROUP(gpio30), 169 + BCM6368_GROUP(gpio31), 170 + BCM6368_GROUP(uart1_grp), 171 + }; 172 + 173 + static const char * const analog_afe_0_groups[] = { 174 + "gpio0", 175 + }; 176 + 177 + static const char * const analog_afe_1_groups[] = { 178 + "gpio1", 179 + }; 180 + 181 + static const char * const sys_irq_groups[] = { 182 + "gpio2", 183 + }; 184 + 185 + static const char * const serial_led_data_groups[] = { 186 + "gpio3", 187 + }; 188 + 189 + static const char * const serial_led_clk_groups[] = { 190 + "gpio4", 191 + }; 192 + 193 + static const char * const inet_led_groups[] = { 194 + "gpio5", 195 + }; 196 + 197 + static const char * const ephy0_led_groups[] = { 198 + "gpio6", 199 + }; 200 + 201 + static const char * const ephy1_led_groups[] = { 202 + "gpio7", 203 + }; 204 + 205 + static const char * const ephy2_led_groups[] = { 206 + "gpio8", 207 + }; 208 + 209 + static const char * const ephy3_led_groups[] = { 210 + "gpio9", 211 + }; 212 + 213 + static const char * const robosw_led_data_groups[] = { 214 + "gpio10", 215 + }; 216 + 217 + static const char * const robosw_led_clk_groups[] = { 218 + "gpio11", 219 + }; 220 + 221 + static const char * const robosw_led0_groups[] = { 222 + "gpio12", 223 + }; 224 + 225 + static const char * const robosw_led1_groups[] = { 226 + "gpio13", 227 + }; 228 + 229 + static const char * const usb_device_led_groups[] = { 230 + "gpio14", 231 + }; 232 + 233 + static const char * const pci_req1_groups[] = { 234 + "gpio16", 235 + }; 236 + 237 + static const char * const pci_gnt1_groups[] = { 238 + "gpio17", 239 + }; 240 + 241 + static const char * const pci_intb_groups[] = { 242 + "gpio18", 243 + }; 244 + 245 + static const char * const pci_req0_groups[] = { 246 + "gpio19", 247 + }; 248 + 249 + static const char * const pci_gnt0_groups[] = { 250 + "gpio20", 251 + }; 252 + 253 + static const char * const pcmcia_cd1_groups[] = { 254 + "gpio22", 255 + }; 256 + 257 + static const char * const pcmcia_cd2_groups[] = { 258 + "gpio23", 259 + }; 260 + 261 + static const char * const pcmcia_vs1_groups[] = { 262 + "gpio24", 263 + }; 264 + 265 + static const char * const pcmcia_vs2_groups[] = { 266 + "gpio25", 267 + }; 268 + 269 + static const char * const ebi_cs2_groups[] = { 270 + "gpio26", 271 + }; 272 + 273 + static const char * const ebi_cs3_groups[] = { 274 + "gpio27", 275 + }; 276 + 277 + static const char * const spi_cs2_groups[] = { 278 + "gpio28", 279 + }; 280 + 281 + static const char * const spi_cs3_groups[] = { 282 + "gpio29", 283 + }; 284 + 285 + static const char * const spi_cs4_groups[] = { 286 + "gpio30", 287 + }; 288 + 289 + static const char * const spi_cs5_groups[] = { 290 + "gpio31", 291 + }; 292 + 293 + static const char * const uart1_groups[] = { 294 + "uart1_grp", 295 + }; 296 + 297 + #define BCM6368_FUN(n, out) \ 298 + { \ 299 + .name = #n, \ 300 + .groups = n##_groups, \ 301 + .num_groups = ARRAY_SIZE(n##_groups), \ 302 + .dir_out = out, \ 303 + } 304 + 305 + #define BCM6368_BASEMODE_FUN(n, val, out) \ 306 + { \ 307 + .name = #n, \ 308 + .groups = n##_groups, \ 309 + .num_groups = ARRAY_SIZE(n##_groups), \ 310 + .basemode = BCM6368_BASEMODE_##val, \ 311 + .dir_out = out, \ 312 + } 313 + 314 + static const struct bcm6368_function bcm6368_funcs[] = { 315 + BCM6368_FUN(analog_afe_0, 1), 316 + BCM6368_FUN(analog_afe_1, 1), 317 + BCM6368_FUN(sys_irq, 1), 318 + BCM6368_FUN(serial_led_data, 1), 319 + BCM6368_FUN(serial_led_clk, 1), 320 + BCM6368_FUN(inet_led, 1), 321 + BCM6368_FUN(ephy0_led, 1), 322 + BCM6368_FUN(ephy1_led, 1), 323 + BCM6368_FUN(ephy2_led, 1), 324 + BCM6368_FUN(ephy3_led, 1), 325 + BCM6368_FUN(robosw_led_data, 1), 326 + BCM6368_FUN(robosw_led_clk, 1), 327 + BCM6368_FUN(robosw_led0, 1), 328 + BCM6368_FUN(robosw_led1, 1), 329 + BCM6368_FUN(usb_device_led, 1), 330 + BCM6368_FUN(pci_req1, 0), 331 + BCM6368_FUN(pci_gnt1, 0), 332 + BCM6368_FUN(pci_intb, 0), 333 + BCM6368_FUN(pci_req0, 0), 334 + BCM6368_FUN(pci_gnt0, 0), 335 + BCM6368_FUN(pcmcia_cd1, 0), 336 + BCM6368_FUN(pcmcia_cd2, 0), 337 + BCM6368_FUN(pcmcia_vs1, 0), 338 + BCM6368_FUN(pcmcia_vs2, 0), 339 + BCM6368_FUN(ebi_cs2, 1), 340 + BCM6368_FUN(ebi_cs3, 1), 341 + BCM6368_FUN(spi_cs2, 1), 342 + BCM6368_FUN(spi_cs3, 1), 343 + BCM6368_FUN(spi_cs4, 1), 344 + BCM6368_FUN(spi_cs5, 1), 345 + BCM6368_BASEMODE_FUN(uart1, UART1, 0x6), 346 + }; 347 + 348 + static int bcm6368_pinctrl_get_group_count(struct pinctrl_dev *pctldev) 349 + { 350 + return ARRAY_SIZE(bcm6368_groups); 351 + } 352 + 353 + static const char *bcm6368_pinctrl_get_group_name(struct pinctrl_dev *pctldev, 354 + unsigned group) 355 + { 356 + return bcm6368_groups[group].name; 357 + } 358 + 359 + static int bcm6368_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, 360 + unsigned group, const unsigned **pins, 361 + unsigned *num_pins) 362 + { 363 + *pins = bcm6368_groups[group].pins; 364 + *num_pins = bcm6368_groups[group].num_pins; 365 + 366 + return 0; 367 + } 368 + 369 + static int bcm6368_pinctrl_get_func_count(struct pinctrl_dev *pctldev) 370 + { 371 + return ARRAY_SIZE(bcm6368_funcs); 372 + } 373 + 374 + static const char *bcm6368_pinctrl_get_func_name(struct pinctrl_dev *pctldev, 375 + unsigned selector) 376 + { 377 + return bcm6368_funcs[selector].name; 378 + } 379 + 380 + static int bcm6368_pinctrl_get_groups(struct pinctrl_dev *pctldev, 381 + unsigned selector, 382 + const char * const **groups, 383 + unsigned * const num_groups) 384 + { 385 + *groups = bcm6368_funcs[selector].groups; 386 + *num_groups = bcm6368_funcs[selector].num_groups; 387 + 388 + return 0; 389 + } 390 + 391 + static int bcm6368_pinctrl_set_mux(struct pinctrl_dev *pctldev, 392 + unsigned selector, unsigned group) 393 + { 394 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 395 + struct bcm6368_priv *priv = pc->driver_data; 396 + const struct bcm6368_pingroup *pg = &bcm6368_groups[group]; 397 + const struct bcm6368_function *fun = &bcm6368_funcs[selector]; 398 + int i, pin; 399 + 400 + if (fun->basemode) { 401 + unsigned int mask = 0; 402 + 403 + for (i = 0; i < pg->num_pins; i++) { 404 + pin = pg->pins[i]; 405 + if (pin < BCM63XX_BANK_GPIOS) 406 + mask |= BIT(pin); 407 + } 408 + 409 + regmap_update_bits(pc->regs, BCM6368_MODE_REG, mask, 0); 410 + regmap_field_write(priv->overlays, fun->basemode); 411 + } else { 412 + pin = pg->pins[0]; 413 + 414 + if (bcm6368_pins[pin].drv_data) 415 + regmap_field_write(priv->overlays, 416 + BCM6368_BASEMODE_GPIO); 417 + 418 + regmap_update_bits(pc->regs, BCM6368_MODE_REG, BIT(pin), 419 + BIT(pin)); 420 + } 421 + 422 + for (pin = 0; pin < pg->num_pins; pin++) { 423 + struct pinctrl_gpio_range *range; 424 + int hw_gpio = bcm6368_pins[pin].number; 425 + 426 + range = pinctrl_find_gpio_range_from_pin(pctldev, hw_gpio); 427 + if (range) { 428 + struct gpio_chip *gc = range->gc; 429 + 430 + if (fun->dir_out & BIT(pin)) 431 + gc->direction_output(gc, hw_gpio, 0); 432 + else 433 + gc->direction_input(gc, hw_gpio); 434 + } 435 + } 436 + 437 + return 0; 438 + } 439 + 440 + static int bcm6368_gpio_request_enable(struct pinctrl_dev *pctldev, 441 + struct pinctrl_gpio_range *range, 442 + unsigned offset) 443 + { 444 + struct bcm63xx_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 445 + struct bcm6368_priv *priv = pc->driver_data; 446 + 447 + if (offset >= BCM63XX_BANK_GPIOS && !bcm6368_pins[offset].drv_data) 448 + return 0; 449 + 450 + /* disable all functions using this pin */ 451 + if (offset < BCM63XX_BANK_GPIOS) 452 + regmap_update_bits(pc->regs, BCM6368_MODE_REG, BIT(offset), 0); 453 + 454 + if (bcm6368_pins[offset].drv_data) 455 + regmap_field_write(priv->overlays, BCM6368_BASEMODE_GPIO); 456 + 457 + return 0; 458 + } 459 + 460 + static struct pinctrl_ops bcm6368_pctl_ops = { 461 + .dt_free_map = pinctrl_utils_free_map, 462 + .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, 463 + .get_group_name = bcm6368_pinctrl_get_group_name, 464 + .get_group_pins = bcm6368_pinctrl_get_group_pins, 465 + .get_groups_count = bcm6368_pinctrl_get_group_count, 466 + }; 467 + 468 + static struct pinmux_ops bcm6368_pmx_ops = { 469 + .get_function_groups = bcm6368_pinctrl_get_groups, 470 + .get_function_name = bcm6368_pinctrl_get_func_name, 471 + .get_functions_count = bcm6368_pinctrl_get_func_count, 472 + .gpio_request_enable = bcm6368_gpio_request_enable, 473 + .set_mux = bcm6368_pinctrl_set_mux, 474 + .strict = true, 475 + }; 476 + 477 + static const struct bcm63xx_pinctrl_soc bcm6368_soc = { 478 + .ngpios = BCM6368_NUM_GPIOS, 479 + .npins = ARRAY_SIZE(bcm6368_pins), 480 + .pctl_ops = &bcm6368_pctl_ops, 481 + .pins = bcm6368_pins, 482 + .pmx_ops = &bcm6368_pmx_ops, 483 + }; 484 + 485 + static int bcm6368_pinctrl_probe(struct platform_device *pdev) 486 + { 487 + struct reg_field overlays = REG_FIELD(BCM6368_BASEMODE_REG, 0, 15); 488 + struct device *dev = &pdev->dev; 489 + struct bcm63xx_pinctrl *pc; 490 + struct bcm6368_priv *priv; 491 + int err; 492 + 493 + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 494 + if (!priv) 495 + return -ENOMEM; 496 + 497 + err = bcm63xx_pinctrl_probe(pdev, &bcm6368_soc, (void *) priv); 498 + if (err) 499 + return err; 500 + 501 + pc = platform_get_drvdata(pdev); 502 + 503 + priv->overlays = devm_regmap_field_alloc(dev, pc->regs, overlays); 504 + if (IS_ERR(priv->overlays)) 505 + return PTR_ERR(priv->overlays); 506 + 507 + return 0; 508 + } 509 + 510 + static const struct of_device_id bcm6368_pinctrl_match[] = { 511 + { .compatible = "brcm,bcm6368-pinctrl", }, 512 + { /* sentinel */ } 513 + }; 514 + 515 + static struct platform_driver bcm6368_pinctrl_driver = { 516 + .probe = bcm6368_pinctrl_probe, 517 + .driver = { 518 + .name = "bcm6368-pinctrl", 519 + .of_match_table = bcm6368_pinctrl_match, 520 + }, 521 + }; 522 + 523 + builtin_platform_driver(bcm6368_pinctrl_driver);
+109
drivers/pinctrl/bcm/pinctrl-bcm63xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Driver for BCM63xx GPIO unit (pinctrl + GPIO) 4 + * 5 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 6 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 7 + */ 8 + 9 + #include <linux/gpio/regmap.h> 10 + #include <linux/mfd/syscon.h> 11 + #include <linux/mod_devicetable.h> 12 + #include <linux/of.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include "pinctrl-bcm63xx.h" 16 + 17 + #define BCM63XX_BANK_SIZE 4 18 + 19 + #define BCM63XX_DIROUT_REG 0x04 20 + #define BCM63XX_DATA_REG 0x0c 21 + 22 + static int bcm63xx_reg_mask_xlate(struct gpio_regmap *gpio, 23 + unsigned int base, unsigned int offset, 24 + unsigned int *reg, unsigned int *mask) 25 + { 26 + unsigned int line = offset % BCM63XX_BANK_GPIOS; 27 + unsigned int stride = offset / BCM63XX_BANK_GPIOS; 28 + 29 + *reg = base - stride * BCM63XX_BANK_SIZE; 30 + *mask = BIT(line); 31 + 32 + return 0; 33 + } 34 + 35 + static const struct of_device_id bcm63xx_gpio_of_match[] = { 36 + { .compatible = "brcm,bcm6318-gpio", }, 37 + { .compatible = "brcm,bcm6328-gpio", }, 38 + { .compatible = "brcm,bcm6358-gpio", }, 39 + { .compatible = "brcm,bcm6362-gpio", }, 40 + { .compatible = "brcm,bcm6368-gpio", }, 41 + { .compatible = "brcm,bcm63268-gpio", }, 42 + { /* sentinel */ } 43 + }; 44 + 45 + static int bcm63xx_gpio_probe(struct device *dev, struct device_node *node, 46 + const struct bcm63xx_pinctrl_soc *soc, 47 + struct bcm63xx_pinctrl *pc) 48 + { 49 + struct gpio_regmap_config grc = {0}; 50 + 51 + grc.parent = dev; 52 + grc.fwnode = &node->fwnode; 53 + grc.ngpio = soc->ngpios; 54 + grc.ngpio_per_reg = BCM63XX_BANK_GPIOS; 55 + grc.regmap = pc->regs; 56 + grc.reg_dat_base = BCM63XX_DATA_REG; 57 + grc.reg_dir_out_base = BCM63XX_DIROUT_REG; 58 + grc.reg_set_base = BCM63XX_DATA_REG; 59 + grc.reg_mask_xlate = bcm63xx_reg_mask_xlate; 60 + 61 + return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &grc)); 62 + } 63 + 64 + int bcm63xx_pinctrl_probe(struct platform_device *pdev, 65 + const struct bcm63xx_pinctrl_soc *soc, 66 + void *driver_data) 67 + { 68 + struct device *dev = &pdev->dev; 69 + struct bcm63xx_pinctrl *pc; 70 + struct device_node *node; 71 + int err; 72 + 73 + pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL); 74 + if (!pc) 75 + return -ENOMEM; 76 + 77 + platform_set_drvdata(pdev, pc); 78 + 79 + pc->dev = dev; 80 + pc->driver_data = driver_data; 81 + 82 + pc->regs = syscon_node_to_regmap(dev->parent->of_node); 83 + if (IS_ERR(pc->regs)) 84 + return PTR_ERR(pc->regs); 85 + 86 + pc->pctl_desc.name = dev_name(dev); 87 + pc->pctl_desc.pins = soc->pins; 88 + pc->pctl_desc.npins = soc->npins; 89 + pc->pctl_desc.pctlops = soc->pctl_ops; 90 + pc->pctl_desc.pmxops = soc->pmx_ops; 91 + pc->pctl_desc.owner = THIS_MODULE; 92 + 93 + pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc); 94 + if (IS_ERR(pc->pctl_dev)) 95 + return PTR_ERR(pc->pctl_dev); 96 + 97 + for_each_child_of_node(dev->parent->of_node, node) { 98 + if (of_match_node(bcm63xx_gpio_of_match, node)) { 99 + err = bcm63xx_gpio_probe(dev, node, soc, pc); 100 + if (err) { 101 + dev_err(dev, "could not add GPIO chip\n"); 102 + of_node_put(node); 103 + return err; 104 + } 105 + } 106 + } 107 + 108 + return 0; 109 + }
+43
drivers/pinctrl/bcm/pinctrl-bcm63xx.h
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com> 4 + * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com> 5 + */ 6 + 7 + #ifndef __PINCTRL_BCM63XX_H__ 8 + #define __PINCTRL_BCM63XX_H__ 9 + 10 + #include <linux/pinctrl/pinctrl.h> 11 + 12 + #define BCM63XX_BANK_GPIOS 32 13 + 14 + struct bcm63xx_pinctrl_soc { 15 + struct pinctrl_ops *pctl_ops; 16 + struct pinmux_ops *pmx_ops; 17 + 18 + const struct pinctrl_pin_desc *pins; 19 + unsigned npins; 20 + 21 + unsigned int ngpios; 22 + }; 23 + 24 + struct bcm63xx_pinctrl { 25 + struct device *dev; 26 + struct regmap *regs; 27 + 28 + struct pinctrl_desc pctl_desc; 29 + struct pinctrl_dev *pctl_dev; 30 + 31 + void *driver_data; 32 + }; 33 + 34 + static inline unsigned int bcm63xx_bank_pin(unsigned int pin) 35 + { 36 + return pin % BCM63XX_BANK_GPIOS; 37 + } 38 + 39 + int bcm63xx_pinctrl_probe(struct platform_device *pdev, 40 + const struct bcm63xx_pinctrl_soc *soc, 41 + void *driver_data); 42 + 43 + #endif /* __PINCTRL_BCM63XX_H__ */
+31 -8
drivers/pinctrl/core.c
··· 160 160 } 161 161 162 162 /** 163 - * pin_get_name_from_id() - look up a pin name from a pin id 163 + * pin_get_name() - look up a pin name from a pin id 164 164 * @pctldev: the pin control device to lookup the pin on 165 165 * @pin: pin number/id to look up 166 166 */ ··· 1258 1258 1259 1259 p->state = NULL; 1260 1260 1261 - /* Apply all the settings for the new state */ 1261 + /* Apply all the settings for the new state - pinmux first */ 1262 1262 list_for_each_entry(setting, &state->settings, node) { 1263 1263 switch (setting->type) { 1264 1264 case PIN_MAP_TYPE_MUX_GROUP: 1265 1265 ret = pinmux_enable_setting(setting); 1266 + break; 1267 + case PIN_MAP_TYPE_CONFIGS_PIN: 1268 + case PIN_MAP_TYPE_CONFIGS_GROUP: 1269 + ret = 0; 1270 + break; 1271 + default: 1272 + ret = -EINVAL; 1273 + break; 1274 + } 1275 + 1276 + if (ret < 0) 1277 + goto unapply_new_state; 1278 + 1279 + /* Do not link hogs (circular dependency) */ 1280 + if (p != setting->pctldev->p) 1281 + pinctrl_link_add(setting->pctldev, p->dev); 1282 + } 1283 + 1284 + /* Apply all the settings for the new state - pinconf after */ 1285 + list_for_each_entry(setting, &state->settings, node) { 1286 + switch (setting->type) { 1287 + case PIN_MAP_TYPE_MUX_GROUP: 1288 + ret = 0; 1266 1289 break; 1267 1290 case PIN_MAP_TYPE_CONFIGS_PIN: 1268 1291 case PIN_MAP_TYPE_CONFIGS_GROUP: ··· 1915 1892 dev_name(pctldev->dev)); 1916 1893 return; 1917 1894 } 1918 - debugfs_create_file("pins", S_IFREG | S_IRUGO, 1895 + debugfs_create_file("pins", 0444, 1919 1896 device_root, pctldev, &pinctrl_pins_fops); 1920 - debugfs_create_file("pingroups", S_IFREG | S_IRUGO, 1897 + debugfs_create_file("pingroups", 0444, 1921 1898 device_root, pctldev, &pinctrl_groups_fops); 1922 - debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, 1899 + debugfs_create_file("gpio-ranges", 0444, 1923 1900 device_root, pctldev, &pinctrl_gpioranges_fops); 1924 1901 if (pctldev->desc->pmxops) 1925 1902 pinmux_init_device_debugfs(device_root, pctldev); ··· 1941 1918 return; 1942 1919 } 1943 1920 1944 - debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, 1921 + debugfs_create_file("pinctrl-devices", 0444, 1945 1922 debugfs_root, NULL, &pinctrl_devices_fops); 1946 - debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO, 1923 + debugfs_create_file("pinctrl-maps", 0444, 1947 1924 debugfs_root, NULL, &pinctrl_maps_fops); 1948 - debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO, 1925 + debugfs_create_file("pinctrl-handles", 0444, 1949 1926 debugfs_root, NULL, &pinctrl_fops); 1950 1927 } 1951 1928
+1
drivers/pinctrl/freescale/pinctrl-imx1.c
··· 262 262 .driver = { 263 263 .name = "imx1-pinctrl", 264 264 .of_match_table = imx1_pinctrl_of_match, 265 + .suppress_bind_attrs = true, 265 266 }, 266 267 }; 267 268 builtin_platform_driver_probe(imx1_pinctrl_driver, imx1_pinctrl_probe);
+2 -1
drivers/pinctrl/freescale/pinctrl-imx25.c
··· 323 323 static struct platform_driver imx25_pinctrl_driver = { 324 324 .driver = { 325 325 .name = "imx25-pinctrl", 326 - .of_match_table = of_match_ptr(imx25_pinctrl_of_match), 326 + .of_match_table = imx25_pinctrl_of_match, 327 + .suppress_bind_attrs = true, 327 328 }, 328 329 .probe = imx25_pinctrl_probe, 329 330 };
+2 -1
drivers/pinctrl/freescale/pinctrl-imx27.c
··· 396 396 static struct platform_driver imx27_pinctrl_driver = { 397 397 .driver = { 398 398 .name = "imx27-pinctrl", 399 - .of_match_table = of_match_ptr(imx27_pinctrl_of_match), 399 + .of_match_table = imx27_pinctrl_of_match, 400 + .suppress_bind_attrs = true, 400 401 }, 401 402 .probe = imx27_pinctrl_probe, 402 403 };
+1
drivers/pinctrl/freescale/pinctrl-imx35.c
··· 1014 1014 .driver = { 1015 1015 .name = "imx35-pinctrl", 1016 1016 .of_match_table = imx35_pinctrl_of_match, 1017 + .suppress_bind_attrs = true, 1017 1018 }, 1018 1019 .probe = imx35_pinctrl_probe, 1019 1020 };
+2 -1
drivers/pinctrl/freescale/pinctrl-imx50.c
··· 399 399 static struct platform_driver imx50_pinctrl_driver = { 400 400 .driver = { 401 401 .name = "imx50-pinctrl", 402 - .of_match_table = of_match_ptr(imx50_pinctrl_of_match), 402 + .of_match_table = imx50_pinctrl_of_match, 403 + .suppress_bind_attrs = true, 403 404 }, 404 405 .probe = imx50_pinctrl_probe, 405 406 };
+1
drivers/pinctrl/freescale/pinctrl-imx51.c
··· 776 776 .driver = { 777 777 .name = "imx51-pinctrl", 778 778 .of_match_table = imx51_pinctrl_of_match, 779 + .suppress_bind_attrs = true, 779 780 }, 780 781 .probe = imx51_pinctrl_probe, 781 782 };
+1
drivers/pinctrl/freescale/pinctrl-imx53.c
··· 463 463 .driver = { 464 464 .name = "imx53-pinctrl", 465 465 .of_match_table = imx53_pinctrl_of_match, 466 + .suppress_bind_attrs = true, 466 467 }, 467 468 .probe = imx53_pinctrl_probe, 468 469 };
+1
drivers/pinctrl/freescale/pinctrl-imx6dl.c
··· 473 473 .driver = { 474 474 .name = "imx6dl-pinctrl", 475 475 .of_match_table = imx6dl_pinctrl_of_match, 476 + .suppress_bind_attrs = true, 476 477 }, 477 478 .probe = imx6dl_pinctrl_probe, 478 479 };
+1
drivers/pinctrl/freescale/pinctrl-imx6q.c
··· 475 475 .driver = { 476 476 .name = "imx6q-pinctrl", 477 477 .of_match_table = imx6q_pinctrl_of_match, 478 + .suppress_bind_attrs = true, 478 479 }, 479 480 .probe = imx6q_pinctrl_probe, 480 481 };
+1
drivers/pinctrl/freescale/pinctrl-imx6sl.c
··· 379 379 .driver = { 380 380 .name = "imx6sl-pinctrl", 381 381 .of_match_table = imx6sl_pinctrl_of_match, 382 + .suppress_bind_attrs = true, 382 383 }, 383 384 .probe = imx6sl_pinctrl_probe, 384 385 };
+1 -1
drivers/pinctrl/freescale/pinctrl-imx6sll.c
··· 345 345 static struct platform_driver imx6sll_pinctrl_driver = { 346 346 .driver = { 347 347 .name = "imx6sll-pinctrl", 348 - .of_match_table = of_match_ptr(imx6sll_pinctrl_of_match), 348 + .of_match_table = imx6sll_pinctrl_of_match, 349 349 .suppress_bind_attrs = true, 350 350 }, 351 351 .probe = imx6sll_pinctrl_probe,
+2 -1
drivers/pinctrl/freescale/pinctrl-imx6sx.c
··· 382 382 static struct platform_driver imx6sx_pinctrl_driver = { 383 383 .driver = { 384 384 .name = "imx6sx-pinctrl", 385 - .of_match_table = of_match_ptr(imx6sx_pinctrl_of_match), 385 + .of_match_table = imx6sx_pinctrl_of_match, 386 + .suppress_bind_attrs = true, 386 387 }, 387 388 .probe = imx6sx_pinctrl_probe, 388 389 };
+2 -1
drivers/pinctrl/freescale/pinctrl-imx6ul.c
··· 342 342 static struct platform_driver imx6ul_pinctrl_driver = { 343 343 .driver = { 344 344 .name = "imx6ul-pinctrl", 345 - .of_match_table = of_match_ptr(imx6ul_pinctrl_of_match), 345 + .of_match_table = imx6ul_pinctrl_of_match, 346 + .suppress_bind_attrs = true, 346 347 }, 347 348 .probe = imx6ul_pinctrl_probe, 348 349 };
+2 -1
drivers/pinctrl/freescale/pinctrl-imx7d.c
··· 386 386 static struct platform_driver imx7d_pinctrl_driver = { 387 387 .driver = { 388 388 .name = "imx7d-pinctrl", 389 - .of_match_table = of_match_ptr(imx7d_pinctrl_of_match), 389 + .of_match_table = imx7d_pinctrl_of_match, 390 + .suppress_bind_attrs = true, 390 391 }, 391 392 .probe = imx7d_pinctrl_probe, 392 393 };
+1 -1
drivers/pinctrl/freescale/pinctrl-imx7ulp.c
··· 303 303 static struct platform_driver imx7ulp_pinctrl_driver = { 304 304 .driver = { 305 305 .name = "imx7ulp-pinctrl", 306 - .of_match_table = of_match_ptr(imx7ulp_pinctrl_of_match), 306 + .of_match_table = imx7ulp_pinctrl_of_match, 307 307 .suppress_bind_attrs = true, 308 308 }, 309 309 .probe = imx7ulp_pinctrl_probe,
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8dxl.c
··· 184 184 static struct platform_driver imx8dxl_pinctrl_driver = { 185 185 .driver = { 186 186 .name = "fsl,imx8dxl-iomuxc", 187 - .of_match_table = of_match_ptr(imx8dxl_pinctrl_of_match), 187 + .of_match_table = imx8dxl_pinctrl_of_match, 188 188 .suppress_bind_attrs = true, 189 189 }, 190 190 .probe = imx8dxl_pinctrl_probe,
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8mm.c
··· 337 337 static struct platform_driver imx8mm_pinctrl_driver = { 338 338 .driver = { 339 339 .name = "imx8mm-pinctrl", 340 - .of_match_table = of_match_ptr(imx8mm_pinctrl_of_match), 340 + .of_match_table = imx8mm_pinctrl_of_match, 341 341 .suppress_bind_attrs = true, 342 342 }, 343 343 .probe = imx8mm_pinctrl_probe,
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8mn.c
··· 337 337 static struct platform_driver imx8mn_pinctrl_driver = { 338 338 .driver = { 339 339 .name = "imx8mn-pinctrl", 340 - .of_match_table = of_match_ptr(imx8mn_pinctrl_of_match), 340 + .of_match_table = imx8mn_pinctrl_of_match, 341 341 .suppress_bind_attrs = true, 342 342 }, 343 343 .probe = imx8mn_pinctrl_probe,
+2 -1
drivers/pinctrl/freescale/pinctrl-imx8mp.c
··· 335 335 static struct platform_driver imx8mp_pinctrl_driver = { 336 336 .driver = { 337 337 .name = "imx8mp-pinctrl", 338 - .of_match_table = of_match_ptr(imx8mp_pinctrl_of_match), 338 + .of_match_table = imx8mp_pinctrl_of_match, 339 + .suppress_bind_attrs = true, 339 340 }, 340 341 .probe = imx8mp_pinctrl_probe, 341 342 };
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8mq.c
··· 340 340 static struct platform_driver imx8mq_pinctrl_driver = { 341 341 .driver = { 342 342 .name = "imx8mq-pinctrl", 343 - .of_match_table = of_match_ptr(imx8mq_pinctrl_of_match), 343 + .of_match_table = imx8mq_pinctrl_of_match, 344 344 .pm = &imx_pinctrl_pm_ops, 345 345 .suppress_bind_attrs = true, 346 346 },
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8qm.c
··· 317 317 static struct platform_driver imx8qm_pinctrl_driver = { 318 318 .driver = { 319 319 .name = "imx8qm-pinctrl", 320 - .of_match_table = of_match_ptr(imx8qm_pinctrl_of_match), 320 + .of_match_table = imx8qm_pinctrl_of_match, 321 321 .suppress_bind_attrs = true, 322 322 }, 323 323 .probe = imx8qm_pinctrl_probe,
+1 -1
drivers/pinctrl/freescale/pinctrl-imx8qxp.c
··· 223 223 static struct platform_driver imx8qxp_pinctrl_driver = { 224 224 .driver = { 225 225 .name = "imx8qxp-pinctrl", 226 - .of_match_table = of_match_ptr(imx8qxp_pinctrl_of_match), 226 + .of_match_table = imx8qxp_pinctrl_of_match, 227 227 .suppress_bind_attrs = true, 228 228 }, 229 229 .probe = imx8qxp_pinctrl_probe,
+1
drivers/pinctrl/freescale/pinctrl-vf610.c
··· 336 336 .driver = { 337 337 .name = "vf610-pinctrl", 338 338 .of_match_table = vf610_pinctrl_of_match, 339 + .suppress_bind_attrs = true, 339 340 }, 340 341 .probe = vf610_pinctrl_probe, 341 342 };
+2 -3
drivers/pinctrl/intel/pinctrl-intel.c
··· 1173 1173 for (gpp = 0; gpp < community->ngpps; gpp++) { 1174 1174 const struct intel_padgroup *padgrp = &community->gpps[gpp]; 1175 1175 unsigned long pending, enabled, gpp_offset; 1176 - unsigned long flags; 1177 1176 1178 - raw_spin_lock_irqsave(&pctrl->lock, flags); 1177 + raw_spin_lock(&pctrl->lock); 1179 1178 1180 1179 pending = readl(community->regs + community->is_offset + 1181 1180 padgrp->reg_num * 4); 1182 1181 enabled = readl(community->regs + community->ie_offset + 1183 1182 padgrp->reg_num * 4); 1184 1183 1185 - raw_spin_unlock_irqrestore(&pctrl->lock, flags); 1184 + raw_spin_unlock(&pctrl->lock); 1186 1185 1187 1186 /* Only interrupts that are enabled */ 1188 1187 pending &= enabled;
+6
drivers/pinctrl/mediatek/Kconfig
··· 147 147 default ARM64 && ARCH_MEDIATEK 148 148 select PINCTRL_MTK_PARIS 149 149 150 + config PINCTRL_MT8195 151 + bool "Mediatek MT8195 pin control" 152 + depends on OF 153 + depends on ARM64 || COMPILE_TEST 154 + select PINCTRL_MTK_PARIS 155 + 150 156 config PINCTRL_MT8516 151 157 bool "Mediatek MT8516 pin control" 152 158 depends on OF
+1
drivers/pinctrl/mediatek/Makefile
··· 21 21 obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o 22 22 obj-$(CONFIG_PINCTRL_MT8183) += pinctrl-mt8183.o 23 23 obj-$(CONFIG_PINCTRL_MT8192) += pinctrl-mt8192.o 24 + obj-$(CONFIG_PINCTRL_MT8195) += pinctrl-mt8195.o 24 25 obj-$(CONFIG_PINCTRL_MT8516) += pinctrl-mt8516.o 25 26 obj-$(CONFIG_PINCTRL_MT6397) += pinctrl-mt6397.o
+2
drivers/pinctrl/mediatek/pinctrl-moore.c
··· 619 619 620 620 hw->nbase = hw->soc->nbase_names; 621 621 622 + spin_lock_init(&hw->lock); 623 + 622 624 /* Copy from internal struct mtk_pin_desc to register to the core */ 623 625 pins = devm_kmalloc_array(&pdev->dev, hw->soc->npins, sizeof(*pins), 624 626 GFP_KERNEL);
+850
drivers/pinctrl/mediatek/pinctrl-mt8195.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2020 MediaTek Inc. 4 + * 5 + * Author: Zhiyong Tao <zhiyong.tao@mediatek.com> 6 + * 7 + */ 8 + 9 + #include "pinctrl-mtk-mt8195.h" 10 + #include "pinctrl-paris.h" 11 + 12 + /* MT8195 have multiple bases to program pin configuration listed as the below: 13 + * iocfg[0]:0x10005000, iocfg[1]:0x11d10000, iocfg[2]:0x11d30000, 14 + * iocfg[3]:0x11d40000, iocfg[4]:0x11e20000, iocfg[5]:0x11eb0000, 15 + * iocfg[6]:0x11f40000. 16 + * _i_based could be used to indicate what base the pin should be mapped into. 17 + */ 18 + 19 + #define PIN_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \ 20 + PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \ 21 + 32, 0) 22 + 23 + #define PINS_FIELD_BASE(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits) \ 24 + PIN_FIELD_CALC(s_pin, e_pin, i_base, s_addr, x_addrs, s_bit, x_bits, \ 25 + 32, 1) 26 + 27 + static const struct mtk_pin_field_calc mt8195_pin_mode_range[] = { 28 + PIN_FIELD(0, 144, 0x300, 0x10, 0, 4), 29 + }; 30 + 31 + static const struct mtk_pin_field_calc mt8195_pin_dir_range[] = { 32 + PIN_FIELD(0, 144, 0x0, 0x10, 0, 1), 33 + }; 34 + 35 + static const struct mtk_pin_field_calc mt8195_pin_di_range[] = { 36 + PIN_FIELD(0, 144, 0x200, 0x10, 0, 1), 37 + }; 38 + 39 + static const struct mtk_pin_field_calc mt8195_pin_do_range[] = { 40 + PIN_FIELD(0, 144, 0x100, 0x10, 0, 1), 41 + }; 42 + 43 + static const struct mtk_pin_field_calc mt8195_pin_ies_range[] = { 44 + PIN_FIELD_BASE(0, 0, 4, 0x040, 0x10, 0, 1), 45 + PIN_FIELD_BASE(1, 1, 4, 0x040, 0x10, 1, 1), 46 + PIN_FIELD_BASE(2, 2, 4, 0x040, 0x10, 2, 1), 47 + PIN_FIELD_BASE(3, 3, 4, 0x040, 0x10, 3, 1), 48 + PIN_FIELD_BASE(4, 4, 4, 0x040, 0x10, 4, 1), 49 + PIN_FIELD_BASE(5, 5, 4, 0x040, 0x10, 5, 1), 50 + PIN_FIELD_BASE(6, 6, 4, 0x040, 0x10, 6, 1), 51 + PIN_FIELD_BASE(7, 7, 4, 0x040, 0x10, 7, 1), 52 + PIN_FIELD_BASE(8, 8, 4, 0x040, 0x10, 13, 1), 53 + PIN_FIELD_BASE(9, 9, 4, 0x040, 0x10, 8, 1), 54 + PIN_FIELD_BASE(10, 10, 4, 0x040, 0x10, 14, 1), 55 + PIN_FIELD_BASE(11, 11, 4, 0x040, 0x10, 9, 1), 56 + PIN_FIELD_BASE(12, 12, 4, 0x040, 0x10, 15, 1), 57 + PIN_FIELD_BASE(13, 13, 4, 0x040, 0x10, 10, 1), 58 + PIN_FIELD_BASE(14, 14, 4, 0x040, 0x10, 16, 1), 59 + PIN_FIELD_BASE(15, 15, 4, 0x040, 0x10, 11, 1), 60 + PIN_FIELD_BASE(16, 16, 4, 0x040, 0x10, 17, 1), 61 + PIN_FIELD_BASE(17, 17, 4, 0x040, 0x10, 12, 1), 62 + PIN_FIELD_BASE(18, 18, 2, 0x040, 0x10, 5, 1), 63 + PIN_FIELD_BASE(19, 19, 2, 0x040, 0x10, 12, 1), 64 + PIN_FIELD_BASE(20, 20, 2, 0x040, 0x10, 11, 1), 65 + PIN_FIELD_BASE(21, 21, 2, 0x040, 0x10, 10, 1), 66 + PIN_FIELD_BASE(22, 22, 2, 0x040, 0x10, 0, 1), 67 + PIN_FIELD_BASE(23, 23, 2, 0x040, 0x10, 1, 1), 68 + PIN_FIELD_BASE(24, 24, 2, 0x040, 0x10, 2, 1), 69 + PIN_FIELD_BASE(25, 25, 2, 0x040, 0x10, 4, 1), 70 + PIN_FIELD_BASE(26, 26, 2, 0x040, 0x10, 3, 1), 71 + PIN_FIELD_BASE(27, 27, 2, 0x040, 0x10, 6, 1), 72 + PIN_FIELD_BASE(28, 28, 2, 0x040, 0x10, 7, 1), 73 + PIN_FIELD_BASE(29, 29, 2, 0x040, 0x10, 8, 1), 74 + PIN_FIELD_BASE(30, 30, 2, 0x040, 0x10, 9, 1), 75 + PIN_FIELD_BASE(31, 31, 1, 0x060, 0x10, 13, 1), 76 + PIN_FIELD_BASE(32, 32, 1, 0x060, 0x10, 12, 1), 77 + PIN_FIELD_BASE(33, 33, 1, 0x060, 0x10, 11, 1), 78 + PIN_FIELD_BASE(34, 34, 1, 0x060, 0x10, 14, 1), 79 + PIN_FIELD_BASE(35, 35, 1, 0x060, 0x10, 15, 1), 80 + PIN_FIELD_BASE(36, 36, 1, 0x070, 0x10, 3, 1), 81 + PIN_FIELD_BASE(37, 37, 1, 0x070, 0x10, 6, 1), 82 + PIN_FIELD_BASE(38, 38, 1, 0x070, 0x10, 4, 1), 83 + PIN_FIELD_BASE(39, 39, 1, 0x070, 0x10, 5, 1), 84 + PIN_FIELD_BASE(40, 40, 1, 0x070, 0x10, 8, 1), 85 + PIN_FIELD_BASE(41, 41, 1, 0x070, 0x10, 7, 1), 86 + PIN_FIELD_BASE(42, 42, 1, 0x070, 0x10, 10, 1), 87 + PIN_FIELD_BASE(43, 43, 1, 0x070, 0x10, 9, 1), 88 + PIN_FIELD_BASE(44, 44, 1, 0x070, 0x10, 20, 1), 89 + PIN_FIELD_BASE(45, 45, 1, 0x070, 0x10, 21, 1), 90 + PIN_FIELD_BASE(46, 46, 1, 0x060, 0x10, 18, 1), 91 + PIN_FIELD_BASE(47, 47, 1, 0x060, 0x10, 16, 1), 92 + PIN_FIELD_BASE(48, 48, 1, 0x060, 0x10, 19, 1), 93 + PIN_FIELD_BASE(49, 49, 1, 0x060, 0x10, 17, 1), 94 + PIN_FIELD_BASE(50, 50, 1, 0x060, 0x10, 25, 1), 95 + PIN_FIELD_BASE(51, 51, 1, 0x060, 0x10, 20, 1), 96 + PIN_FIELD_BASE(52, 52, 1, 0x060, 0x10, 26, 1), 97 + PIN_FIELD_BASE(53, 53, 1, 0x060, 0x10, 21, 1), 98 + PIN_FIELD_BASE(54, 54, 1, 0x060, 0x10, 22, 1), 99 + PIN_FIELD_BASE(55, 55, 1, 0x060, 0x10, 23, 1), 100 + PIN_FIELD_BASE(56, 56, 1, 0x060, 0x10, 24, 1), 101 + PIN_FIELD_BASE(57, 57, 1, 0x060, 0x10, 29, 1), 102 + PIN_FIELD_BASE(58, 58, 1, 0x060, 0x10, 27, 1), 103 + PIN_FIELD_BASE(59, 59, 1, 0x060, 0x10, 30, 1), 104 + PIN_FIELD_BASE(60, 60, 1, 0x060, 0x10, 28, 1), 105 + PIN_FIELD_BASE(61, 61, 1, 0x060, 0x10, 8, 1), 106 + PIN_FIELD_BASE(62, 62, 1, 0x060, 0x10, 7, 1), 107 + PIN_FIELD_BASE(63, 63, 1, 0x060, 0x10, 10, 1), 108 + PIN_FIELD_BASE(64, 64, 1, 0x060, 0x10, 9, 1), 109 + PIN_FIELD_BASE(65, 65, 1, 0x070, 0x10, 1, 1), 110 + PIN_FIELD_BASE(66, 66, 1, 0x060, 0x10, 31, 1), 111 + PIN_FIELD_BASE(67, 67, 1, 0x070, 0x10, 0, 1), 112 + PIN_FIELD_BASE(68, 68, 1, 0x070, 0x10, 2, 1), 113 + PIN_FIELD_BASE(69, 69, 1, 0x060, 0x10, 0, 1), 114 + PIN_FIELD_BASE(70, 70, 1, 0x060, 0x10, 6, 1), 115 + PIN_FIELD_BASE(71, 71, 1, 0x060, 0x10, 4, 1), 116 + PIN_FIELD_BASE(72, 72, 1, 0x060, 0x10, 5, 1), 117 + PIN_FIELD_BASE(73, 73, 1, 0x060, 0x10, 1, 1), 118 + PIN_FIELD_BASE(74, 74, 1, 0x060, 0x10, 2, 1), 119 + PIN_FIELD_BASE(75, 75, 1, 0x060, 0x10, 3, 1), 120 + PIN_FIELD_BASE(76, 76, 1, 0x070, 0x10, 11, 1), 121 + PIN_FIELD_BASE(77, 77, 3, 0x030, 0x10, 1, 1), 122 + PIN_FIELD_BASE(78, 78, 3, 0x030, 0x10, 2, 1), 123 + PIN_FIELD_BASE(79, 79, 3, 0x030, 0x10, 9, 1), 124 + PIN_FIELD_BASE(80, 80, 3, 0x030, 0x10, 10, 1), 125 + PIN_FIELD_BASE(81, 81, 3, 0x030, 0x10, 11, 1), 126 + PIN_FIELD_BASE(82, 82, 3, 0x030, 0x10, 12, 1), 127 + PIN_FIELD_BASE(83, 83, 3, 0x030, 0x10, 13, 1), 128 + PIN_FIELD_BASE(84, 84, 3, 0x030, 0x10, 14, 1), 129 + PIN_FIELD_BASE(85, 85, 3, 0x030, 0x10, 15, 1), 130 + PIN_FIELD_BASE(86, 86, 3, 0x030, 0x10, 16, 1), 131 + PIN_FIELD_BASE(87, 87, 3, 0x030, 0x10, 3, 1), 132 + PIN_FIELD_BASE(88, 88, 3, 0x030, 0x10, 4, 1), 133 + PIN_FIELD_BASE(89, 89, 3, 0x030, 0x10, 5, 1), 134 + PIN_FIELD_BASE(90, 90, 3, 0x030, 0x10, 6, 1), 135 + PIN_FIELD_BASE(91, 91, 3, 0x030, 0x10, 7, 1), 136 + PIN_FIELD_BASE(92, 92, 3, 0x030, 0x10, 8, 1), 137 + PIN_FIELD_BASE(93, 93, 3, 0x030, 0x10, 18, 1), 138 + PIN_FIELD_BASE(94, 94, 3, 0x030, 0x10, 19, 1), 139 + PIN_FIELD_BASE(95, 95, 3, 0x030, 0x10, 17, 1), 140 + PIN_FIELD_BASE(96, 96, 3, 0x030, 0x10, 0, 1), 141 + PIN_FIELD_BASE(97, 97, 3, 0x030, 0x10, 20, 1), 142 + PIN_FIELD_BASE(98, 98, 3, 0x030, 0x10, 28, 1), 143 + PIN_FIELD_BASE(99, 99, 3, 0x030, 0x10, 27, 1), 144 + PIN_FIELD_BASE(100, 100, 3, 0x030, 0x10, 30, 1), 145 + PIN_FIELD_BASE(101, 101, 3, 0x030, 0x10, 29, 1), 146 + PIN_FIELD_BASE(102, 102, 3, 0x040, 0x10, 0, 1), 147 + PIN_FIELD_BASE(103, 103, 3, 0x030, 0x10, 31, 1), 148 + PIN_FIELD_BASE(104, 104, 3, 0x030, 0x10, 25, 1), 149 + PIN_FIELD_BASE(105, 105, 3, 0x030, 0x10, 26, 1), 150 + PIN_FIELD_BASE(106, 106, 3, 0x030, 0x10, 23, 1), 151 + PIN_FIELD_BASE(107, 107, 3, 0x030, 0x10, 24, 1), 152 + PIN_FIELD_BASE(108, 108, 3, 0x030, 0x10, 22, 1), 153 + PIN_FIELD_BASE(109, 109, 3, 0x030, 0x10, 21, 1), 154 + PIN_FIELD_BASE(110, 110, 5, 0x010, 0x10, 1, 1), 155 + PIN_FIELD_BASE(111, 111, 5, 0x010, 0x10, 0, 1), 156 + PIN_FIELD_BASE(112, 112, 5, 0x010, 0x10, 2, 1), 157 + PIN_FIELD_BASE(113, 113, 5, 0x010, 0x10, 3, 1), 158 + PIN_FIELD_BASE(114, 114, 5, 0x010, 0x10, 4, 1), 159 + PIN_FIELD_BASE(115, 115, 5, 0x010, 0x10, 5, 1), 160 + PIN_FIELD_BASE(116, 116, 6, 0x030, 0x10, 9, 1), 161 + PIN_FIELD_BASE(117, 117, 6, 0x030, 0x10, 8, 1), 162 + PIN_FIELD_BASE(118, 118, 6, 0x030, 0x10, 7, 1), 163 + PIN_FIELD_BASE(119, 119, 6, 0x030, 0x10, 6, 1), 164 + PIN_FIELD_BASE(120, 120, 6, 0x030, 0x10, 11, 1), 165 + PIN_FIELD_BASE(121, 121, 6, 0x030, 0x10, 1, 1), 166 + PIN_FIELD_BASE(122, 122, 6, 0x030, 0x10, 0, 1), 167 + PIN_FIELD_BASE(123, 123, 6, 0x030, 0x10, 5, 1), 168 + PIN_FIELD_BASE(124, 124, 6, 0x030, 0x10, 4, 1), 169 + PIN_FIELD_BASE(125, 125, 6, 0x030, 0x10, 3, 1), 170 + PIN_FIELD_BASE(126, 126, 6, 0x030, 0x10, 2, 1), 171 + PIN_FIELD_BASE(127, 127, 6, 0x030, 0x10, 10, 1), 172 + PIN_FIELD_BASE(128, 128, 3, 0x040, 0x10, 3, 1), 173 + PIN_FIELD_BASE(129, 129, 3, 0x040, 0x10, 1, 1), 174 + PIN_FIELD_BASE(130, 130, 3, 0x040, 0x10, 4, 1), 175 + PIN_FIELD_BASE(131, 131, 3, 0x040, 0x10, 2, 1), 176 + PIN_FIELD_BASE(132, 132, 6, 0x030, 0x10, 13, 1), 177 + PIN_FIELD_BASE(133, 133, 6, 0x030, 0x10, 12, 1), 178 + PIN_FIELD_BASE(134, 134, 6, 0x030, 0x10, 15, 1), 179 + PIN_FIELD_BASE(135, 135, 6, 0x030, 0x10, 14, 1), 180 + PIN_FIELD_BASE(136, 136, 1, 0x070, 0x10, 13, 1), 181 + PIN_FIELD_BASE(137, 137, 1, 0x070, 0x10, 12, 1), 182 + PIN_FIELD_BASE(138, 138, 1, 0x070, 0x10, 15, 1), 183 + PIN_FIELD_BASE(139, 139, 1, 0x070, 0x10, 14, 1), 184 + PIN_FIELD_BASE(140, 140, 1, 0x070, 0x10, 17, 1), 185 + PIN_FIELD_BASE(141, 141, 1, 0x070, 0x10, 16, 1), 186 + PIN_FIELD_BASE(142, 142, 1, 0x070, 0x10, 19, 1), 187 + PIN_FIELD_BASE(143, 143, 1, 0x070, 0x10, 18, 1), 188 + }; 189 + 190 + static const struct mtk_pin_field_calc mt8195_pin_smt_range[] = { 191 + PIN_FIELD_BASE(0, 0, 4, 0x0d0, 0x10, 0, 1), 192 + PIN_FIELD_BASE(1, 1, 4, 0x0d0, 0x10, 1, 1), 193 + PIN_FIELD_BASE(2, 2, 4, 0x0d0, 0x10, 2, 1), 194 + PIN_FIELD_BASE(3, 3, 4, 0x0d0, 0x10, 3, 1), 195 + PIN_FIELD_BASE(4, 4, 4, 0x0d0, 0x10, 4, 1), 196 + PIN_FIELD_BASE(5, 5, 4, 0x0d0, 0x10, 5, 1), 197 + PINS_FIELD_BASE(6, 7, 4, 0x0d0, 0x10, 6, 1), 198 + PIN_FIELD_BASE(8, 8, 4, 0x0d0, 0x10, 12, 1), 199 + PIN_FIELD_BASE(9, 9, 4, 0x0d0, 0x10, 7, 1), 200 + PIN_FIELD_BASE(10, 10, 4, 0x0d0, 0x10, 13, 1), 201 + PIN_FIELD_BASE(11, 11, 4, 0x0d0, 0x10, 8, 1), 202 + PIN_FIELD_BASE(12, 12, 4, 0x0d0, 0x10, 14, 1), 203 + PIN_FIELD_BASE(13, 13, 4, 0x0d0, 0x10, 9, 1), 204 + PIN_FIELD_BASE(14, 14, 4, 0x0d0, 0x10, 15, 1), 205 + PIN_FIELD_BASE(15, 15, 4, 0x0d0, 0x10, 10, 1), 206 + PIN_FIELD_BASE(16, 16, 4, 0x0d0, 0x10, 16, 1), 207 + PIN_FIELD_BASE(17, 17, 4, 0x0d0, 0x10, 11, 1), 208 + PIN_FIELD_BASE(18, 18, 2, 0x090, 0x10, 11, 1), 209 + PIN_FIELD_BASE(19, 19, 2, 0x090, 0x10, 10, 1), 210 + PIN_FIELD_BASE(20, 20, 2, 0x090, 0x10, 9, 1), 211 + PIN_FIELD_BASE(21, 21, 2, 0x090, 0x10, 11, 1), 212 + PIN_FIELD_BASE(22, 22, 2, 0x090, 0x10, 0, 1), 213 + PIN_FIELD_BASE(23, 23, 2, 0x090, 0x10, 1, 1), 214 + PIN_FIELD_BASE(24, 24, 2, 0x090, 0x10, 2, 1), 215 + PIN_FIELD_BASE(25, 25, 2, 0x090, 0x10, 4, 1), 216 + PIN_FIELD_BASE(26, 26, 2, 0x090, 0x10, 3, 1), 217 + PIN_FIELD_BASE(27, 27, 2, 0x090, 0x10, 5, 1), 218 + PIN_FIELD_BASE(28, 28, 2, 0x090, 0x10, 6, 1), 219 + PIN_FIELD_BASE(29, 29, 2, 0x090, 0x10, 7, 1), 220 + PIN_FIELD_BASE(30, 30, 2, 0x090, 0x10, 8, 1), 221 + PINS_FIELD_BASE(31, 33, 1, 0x0f0, 0x10, 4, 1), 222 + PIN_FIELD_BASE(34, 34, 1, 0x0f0, 0x10, 0, 1), 223 + PIN_FIELD_BASE(35, 35, 1, 0x0f0, 0x10, 1, 1), 224 + PIN_FIELD_BASE(36, 36, 1, 0x0f0, 0x10, 4, 1), 225 + PIN_FIELD_BASE(37, 37, 1, 0x0f0, 0x10, 2, 1), 226 + PINS_FIELD_BASE(38, 39, 1, 0x0f0, 0x10, 5, 1), 227 + PIN_FIELD_BASE(40, 40, 1, 0x0f0, 0x10, 14, 1), 228 + PIN_FIELD_BASE(41, 41, 1, 0x0f0, 0x10, 13, 1), 229 + PIN_FIELD_BASE(42, 42, 1, 0x0f0, 0x10, 16, 1), 230 + PIN_FIELD_BASE(43, 43, 1, 0x0f0, 0x10, 15, 1), 231 + PIN_FIELD_BASE(44, 44, 1, 0x0f0, 0x10, 25, 1), 232 + PIN_FIELD_BASE(45, 45, 1, 0x0f0, 0x10, 26, 1), 233 + PINS_FIELD_BASE(46, 47, 1, 0x0f0, 0x10, 5, 1), 234 + PINS_FIELD_BASE(48, 51, 1, 0x0f0, 0x10, 6, 1), 235 + PINS_FIELD_BASE(52, 55, 1, 0x0f0, 0x10, 7, 1), 236 + PINS_FIELD_BASE(56, 59, 1, 0x0f0, 0x10, 8, 1), 237 + PINS_FIELD_BASE(60, 63, 1, 0x0f0, 0x10, 9, 1), 238 + PIN_FIELD_BASE(64, 64, 1, 0x0f0, 0x10, 10, 1), 239 + PINS_FIELD_BASE(65, 68, 1, 0x0f0, 0x10, 3, 1), 240 + PINS_FIELD_BASE(69, 71, 1, 0x0f0, 0x10, 10, 1), 241 + PINS_FIELD_BASE(72, 75, 1, 0x0f0, 0x10, 11, 1), 242 + PIN_FIELD_BASE(76, 76, 1, 0x0f0, 0x10, 12, 1), 243 + PIN_FIELD_BASE(77, 77, 3, 0x0e0, 0x10, 0, 1), 244 + PIN_FIELD_BASE(78, 78, 3, 0x0e0, 0x10, 1, 1), 245 + PIN_FIELD_BASE(79, 79, 3, 0x0e0, 0x10, 6, 1), 246 + PIN_FIELD_BASE(80, 80, 3, 0x0e0, 0x10, 7, 1), 247 + PIN_FIELD_BASE(81, 81, 3, 0x0e0, 0x10, 8, 1), 248 + PIN_FIELD_BASE(82, 82, 3, 0x0e0, 0x10, 9, 1), 249 + PIN_FIELD_BASE(83, 83, 3, 0x0e0, 0x10, 10, 1), 250 + PIN_FIELD_BASE(84, 84, 3, 0x0e0, 0x10, 11, 1), 251 + PINS_FIELD_BASE(85, 88, 3, 0x0e0, 0x10, 14, 1), 252 + PIN_FIELD_BASE(89, 89, 3, 0x0e0, 0x10, 2, 1), 253 + PIN_FIELD_BASE(90, 90, 3, 0x0e0, 0x10, 3, 1), 254 + PIN_FIELD_BASE(91, 91, 3, 0x0e0, 0x10, 4, 1), 255 + PIN_FIELD_BASE(92, 92, 3, 0x0e0, 0x10, 5, 1), 256 + PIN_FIELD_BASE(93, 93, 3, 0x0e0, 0x10, 12, 1), 257 + PIN_FIELD_BASE(94, 94, 3, 0x0e0, 0x10, 13, 1), 258 + PINS_FIELD_BASE(95, 98, 3, 0x0e0, 0x10, 15, 1), 259 + PINS_FIELD_BASE(99, 102, 3, 0x0e0, 0x10, 16, 1), 260 + PINS_FIELD_BASE(103, 104, 3, 0x0e0, 0x10, 17, 1), 261 + PIN_FIELD_BASE(105, 105, 3, 0x0e0, 0x10, 18, 1), 262 + PINS_FIELD_BASE(106, 107, 3, 0x0e0, 0x10, 17, 1), 263 + PINS_FIELD_BASE(108, 109, 3, 0x0e0, 0x10, 18, 1), 264 + PIN_FIELD_BASE(110, 110, 5, 0x070, 0x10, 1, 1), 265 + PIN_FIELD_BASE(111, 111, 5, 0x070, 0x10, 0, 1), 266 + PIN_FIELD_BASE(112, 112, 5, 0x070, 0x10, 2, 1), 267 + PIN_FIELD_BASE(113, 113, 5, 0x070, 0x10, 3, 1), 268 + PIN_FIELD_BASE(114, 114, 5, 0x070, 0x10, 4, 1), 269 + PIN_FIELD_BASE(115, 115, 5, 0x070, 0x10, 5, 1), 270 + PIN_FIELD_BASE(116, 116, 6, 0x0c0, 0x10, 9, 1), 271 + PIN_FIELD_BASE(117, 117, 6, 0x0c0, 0x10, 8, 1), 272 + PIN_FIELD_BASE(118, 118, 6, 0x0c0, 0x10, 7, 1), 273 + PIN_FIELD_BASE(119, 119, 6, 0x0c0, 0x10, 6, 1), 274 + PIN_FIELD_BASE(120, 120, 6, 0x0c0, 0x10, 11, 1), 275 + PIN_FIELD_BASE(121, 121, 6, 0x0c0, 0x10, 1, 1), 276 + PIN_FIELD_BASE(122, 122, 6, 0x0c0, 0x10, 0, 1), 277 + PIN_FIELD_BASE(123, 123, 6, 0x0c0, 0x10, 5, 1), 278 + PIN_FIELD_BASE(124, 124, 6, 0x0c0, 0x10, 4, 1), 279 + PIN_FIELD_BASE(125, 125, 6, 0x0c0, 0x10, 3, 1), 280 + PIN_FIELD_BASE(126, 126, 6, 0x0c0, 0x10, 2, 1), 281 + PIN_FIELD_BASE(127, 127, 6, 0x0c0, 0x10, 10, 1), 282 + PIN_FIELD_BASE(128, 128, 3, 0x0e0, 0x10, 18, 1), 283 + PINS_FIELD_BASE(129, 131, 3, 0x0e0, 0x10, 19, 1), 284 + PIN_FIELD_BASE(132, 132, 6, 0x0c0, 0x10, 13, 1), 285 + PIN_FIELD_BASE(133, 133, 6, 0x0c0, 0x10, 12, 1), 286 + PIN_FIELD_BASE(134, 134, 6, 0x0c0, 0x10, 15, 1), 287 + PIN_FIELD_BASE(135, 135, 6, 0x0c0, 0x10, 14, 1), 288 + PIN_FIELD_BASE(136, 136, 1, 0x0f0, 0x10, 18, 1), 289 + PIN_FIELD_BASE(137, 137, 1, 0x0f0, 0x10, 17, 1), 290 + PIN_FIELD_BASE(138, 138, 1, 0x0f0, 0x10, 20, 1), 291 + PIN_FIELD_BASE(139, 139, 1, 0x0f0, 0x10, 19, 1), 292 + PIN_FIELD_BASE(140, 140, 1, 0x0f0, 0x10, 22, 1), 293 + PIN_FIELD_BASE(141, 141, 1, 0x0f0, 0x10, 21, 1), 294 + PIN_FIELD_BASE(142, 142, 1, 0x0f0, 0x10, 24, 1), 295 + PIN_FIELD_BASE(143, 143, 1, 0x0f0, 0x10, 23, 1), 296 + }; 297 + 298 + static const struct mtk_pin_field_calc mt8195_pin_pu_range[] = { 299 + PIN_FIELD_BASE(6, 6, 4, 0x0070, 0x10, 0, 1), 300 + PIN_FIELD_BASE(7, 7, 4, 0x0070, 0x10, 1, 1), 301 + PIN_FIELD_BASE(8, 8, 4, 0x0070, 0x10, 7, 1), 302 + PIN_FIELD_BASE(9, 9, 4, 0x0070, 0x10, 2, 1), 303 + PIN_FIELD_BASE(10, 10, 4, 0x0070, 0x10, 8, 1), 304 + PIN_FIELD_BASE(11, 11, 4, 0x0070, 0x10, 3, 1), 305 + PIN_FIELD_BASE(12, 12, 4, 0x0070, 0x10, 9, 1), 306 + PIN_FIELD_BASE(13, 13, 4, 0x0070, 0x10, 4, 1), 307 + PIN_FIELD_BASE(14, 14, 4, 0x0070, 0x10, 10, 1), 308 + PIN_FIELD_BASE(15, 15, 4, 0x0070, 0x10, 5, 1), 309 + PIN_FIELD_BASE(16, 16, 4, 0x0070, 0x10, 11, 1), 310 + PIN_FIELD_BASE(17, 17, 4, 0x0070, 0x10, 6, 1), 311 + PIN_FIELD_BASE(18, 18, 2, 0x0060, 0x10, 5, 1), 312 + PIN_FIELD_BASE(19, 19, 2, 0x0060, 0x10, 12, 1), 313 + PIN_FIELD_BASE(20, 20, 2, 0x0060, 0x10, 11, 1), 314 + PIN_FIELD_BASE(21, 21, 2, 0x0060, 0x10, 10, 1), 315 + PIN_FIELD_BASE(22, 22, 2, 0x0060, 0x10, 0, 1), 316 + PIN_FIELD_BASE(23, 23, 2, 0x0060, 0x10, 1, 1), 317 + PIN_FIELD_BASE(24, 24, 2, 0x0060, 0x10, 2, 1), 318 + PIN_FIELD_BASE(25, 25, 2, 0x0060, 0x10, 4, 1), 319 + PIN_FIELD_BASE(26, 26, 2, 0x0060, 0x10, 3, 1), 320 + PIN_FIELD_BASE(27, 27, 2, 0x0060, 0x10, 6, 1), 321 + PIN_FIELD_BASE(28, 28, 2, 0x0060, 0x10, 7, 1), 322 + PIN_FIELD_BASE(29, 29, 2, 0x0060, 0x10, 8, 1), 323 + PIN_FIELD_BASE(30, 30, 2, 0x0060, 0x10, 9, 1), 324 + PIN_FIELD_BASE(31, 31, 1, 0x00a0, 0x10, 13, 1), 325 + PIN_FIELD_BASE(32, 32, 1, 0x00a0, 0x10, 12, 1), 326 + PIN_FIELD_BASE(33, 33, 1, 0x00a0, 0x10, 11, 1), 327 + PIN_FIELD_BASE(34, 34, 1, 0x00a0, 0x10, 14, 1), 328 + PIN_FIELD_BASE(35, 35, 1, 0x00a0, 0x10, 15, 1), 329 + PIN_FIELD_BASE(36, 36, 1, 0x00b0, 0x10, 3, 1), 330 + PIN_FIELD_BASE(37, 37, 1, 0x00b0, 0x10, 6, 1), 331 + PIN_FIELD_BASE(38, 38, 1, 0x00b0, 0x10, 4, 1), 332 + PIN_FIELD_BASE(39, 39, 1, 0x00b0, 0x10, 5, 1), 333 + PIN_FIELD_BASE(40, 40, 1, 0x00b0, 0x10, 8, 1), 334 + PIN_FIELD_BASE(41, 41, 1, 0x00b0, 0x10, 7, 1), 335 + PIN_FIELD_BASE(42, 42, 1, 0x00b0, 0x10, 10, 1), 336 + PIN_FIELD_BASE(43, 43, 1, 0x00b0, 0x10, 9, 1), 337 + PIN_FIELD_BASE(44, 44, 1, 0x00b0, 0x10, 21, 1), 338 + PIN_FIELD_BASE(45, 45, 1, 0x00b0, 0x10, 22, 1), 339 + PIN_FIELD_BASE(46, 46, 1, 0x00a0, 0x10, 18, 1), 340 + PIN_FIELD_BASE(47, 47, 1, 0x00a0, 0x10, 16, 1), 341 + PIN_FIELD_BASE(48, 48, 1, 0x00a0, 0x10, 19, 1), 342 + PIN_FIELD_BASE(49, 49, 1, 0x00a0, 0x10, 17, 1), 343 + PIN_FIELD_BASE(50, 50, 1, 0x00a0, 0x10, 25, 1), 344 + PIN_FIELD_BASE(51, 51, 1, 0x00a0, 0x10, 20, 1), 345 + PIN_FIELD_BASE(52, 52, 1, 0x00a0, 0x10, 26, 1), 346 + PIN_FIELD_BASE(53, 53, 1, 0x00a0, 0x10, 21, 1), 347 + PIN_FIELD_BASE(54, 54, 1, 0x00a0, 0x10, 22, 1), 348 + PIN_FIELD_BASE(55, 55, 1, 0x00a0, 0x10, 23, 1), 349 + PIN_FIELD_BASE(56, 56, 1, 0x00a0, 0x10, 24, 1), 350 + PIN_FIELD_BASE(57, 57, 1, 0x00a0, 0x10, 29, 1), 351 + PIN_FIELD_BASE(58, 58, 1, 0x00a0, 0x10, 27, 1), 352 + PIN_FIELD_BASE(59, 59, 1, 0x00a0, 0x10, 30, 1), 353 + PIN_FIELD_BASE(60, 60, 1, 0x00a0, 0x10, 28, 1), 354 + PIN_FIELD_BASE(61, 61, 1, 0x00a0, 0x10, 8, 1), 355 + PIN_FIELD_BASE(62, 62, 1, 0x00a0, 0x10, 7, 1), 356 + PIN_FIELD_BASE(63, 63, 1, 0x00a0, 0x10, 10, 1), 357 + PIN_FIELD_BASE(64, 64, 1, 0x00a0, 0x10, 9, 1), 358 + PIN_FIELD_BASE(65, 65, 1, 0x00b0, 0x10, 1, 1), 359 + PIN_FIELD_BASE(66, 66, 1, 0x00a0, 0x10, 31, 1), 360 + PIN_FIELD_BASE(67, 67, 1, 0x00b0, 0x10, 0, 1), 361 + PIN_FIELD_BASE(68, 68, 1, 0x00b0, 0x10, 2, 1), 362 + PIN_FIELD_BASE(69, 69, 1, 0x00a0, 0x10, 0, 1), 363 + PIN_FIELD_BASE(70, 70, 1, 0x00a0, 0x10, 6, 1), 364 + PIN_FIELD_BASE(71, 71, 1, 0x00a0, 0x10, 4, 1), 365 + PIN_FIELD_BASE(72, 72, 1, 0x00a0, 0x10, 5, 1), 366 + PIN_FIELD_BASE(73, 73, 1, 0x00a0, 0x10, 1, 1), 367 + PIN_FIELD_BASE(74, 74, 1, 0x00a0, 0x10, 2, 1), 368 + PIN_FIELD_BASE(75, 75, 1, 0x00a0, 0x10, 3, 1), 369 + PIN_FIELD_BASE(76, 76, 1, 0x00b0, 0x10, 11, 1), 370 + PIN_FIELD_BASE(97, 97, 3, 0x0070, 0x10, 0, 1), 371 + PIN_FIELD_BASE(98, 98, 3, 0x0070, 0x10, 4, 1), 372 + PIN_FIELD_BASE(99, 99, 3, 0x0070, 0x10, 3, 1), 373 + PIN_FIELD_BASE(100, 100, 3, 0x0070, 0x10, 6, 1), 374 + PIN_FIELD_BASE(101, 101, 3, 0x0070, 0x10, 5, 1), 375 + PIN_FIELD_BASE(102, 102, 3, 0x0070, 0x10, 8, 1), 376 + PIN_FIELD_BASE(103, 103, 3, 0x0070, 0x10, 7, 1), 377 + PIN_FIELD_BASE(108, 108, 3, 0x0070, 0x10, 2, 1), 378 + PIN_FIELD_BASE(109, 109, 3, 0x0070, 0x10, 1, 1), 379 + PIN_FIELD_BASE(128, 128, 3, 0x0070, 0x10, 11, 1), 380 + PIN_FIELD_BASE(129, 129, 3, 0x0070, 0x10, 9, 1), 381 + PIN_FIELD_BASE(130, 130, 3, 0x0070, 0x10, 12, 1), 382 + PIN_FIELD_BASE(131, 131, 3, 0x0070, 0x10, 10, 1), 383 + PIN_FIELD_BASE(132, 132, 6, 0x0060, 0x10, 1, 1), 384 + PIN_FIELD_BASE(133, 133, 6, 0x0060, 0x10, 0, 1), 385 + PIN_FIELD_BASE(134, 134, 6, 0x0060, 0x10, 3, 1), 386 + PIN_FIELD_BASE(135, 135, 6, 0x0060, 0x10, 2, 1), 387 + PIN_FIELD_BASE(136, 136, 1, 0x00b0, 0x10, 14, 1), 388 + PIN_FIELD_BASE(137, 137, 1, 0x00b0, 0x10, 13, 1), 389 + PIN_FIELD_BASE(138, 138, 1, 0x00b0, 0x10, 16, 1), 390 + PIN_FIELD_BASE(139, 139, 1, 0x00b0, 0x10, 15, 1), 391 + PIN_FIELD_BASE(140, 140, 1, 0x00b0, 0x10, 18, 1), 392 + PIN_FIELD_BASE(141, 141, 1, 0x00b0, 0x10, 17, 1), 393 + PIN_FIELD_BASE(142, 142, 1, 0x00b0, 0x10, 20, 1), 394 + PIN_FIELD_BASE(143, 143, 1, 0x00b0, 0x10, 19, 1), 395 + }; 396 + 397 + static const struct mtk_pin_field_calc mt8195_pin_pd_range[] = { 398 + PIN_FIELD_BASE(6, 6, 4, 0x0050, 0x10, 0, 1), 399 + PIN_FIELD_BASE(7, 7, 4, 0x0050, 0x10, 1, 1), 400 + PIN_FIELD_BASE(8, 8, 4, 0x0050, 0x10, 7, 1), 401 + PIN_FIELD_BASE(9, 9, 4, 0x0050, 0x10, 2, 1), 402 + PIN_FIELD_BASE(10, 10, 4, 0x0050, 0x10, 8, 1), 403 + PIN_FIELD_BASE(11, 11, 4, 0x0050, 0x10, 3, 1), 404 + PIN_FIELD_BASE(12, 12, 4, 0x0050, 0x10, 9, 1), 405 + PIN_FIELD_BASE(13, 13, 4, 0x0050, 0x10, 4, 1), 406 + PIN_FIELD_BASE(14, 14, 4, 0x0050, 0x10, 10, 1), 407 + PIN_FIELD_BASE(15, 15, 4, 0x0050, 0x10, 5, 1), 408 + PIN_FIELD_BASE(16, 16, 4, 0x0050, 0x10, 11, 1), 409 + PIN_FIELD_BASE(17, 17, 4, 0x0050, 0x10, 6, 1), 410 + PIN_FIELD_BASE(18, 18, 2, 0x0050, 0x10, 5, 1), 411 + PIN_FIELD_BASE(19, 19, 2, 0x0050, 0x10, 12, 1), 412 + PIN_FIELD_BASE(20, 20, 2, 0x0050, 0x10, 11, 1), 413 + PIN_FIELD_BASE(21, 21, 2, 0x0050, 0x10, 10, 1), 414 + PIN_FIELD_BASE(22, 22, 2, 0x0050, 0x10, 0, 1), 415 + PIN_FIELD_BASE(23, 23, 2, 0x0050, 0x10, 1, 1), 416 + PIN_FIELD_BASE(24, 24, 2, 0x0050, 0x10, 2, 1), 417 + PIN_FIELD_BASE(25, 25, 2, 0x0050, 0x10, 4, 1), 418 + PIN_FIELD_BASE(26, 26, 2, 0x0050, 0x10, 3, 1), 419 + PIN_FIELD_BASE(27, 27, 2, 0x0050, 0x10, 6, 1), 420 + PIN_FIELD_BASE(28, 28, 2, 0x0050, 0x10, 7, 1), 421 + PIN_FIELD_BASE(29, 29, 2, 0x0050, 0x10, 8, 1), 422 + PIN_FIELD_BASE(30, 30, 2, 0x0050, 0x10, 9, 1), 423 + PIN_FIELD_BASE(31, 31, 1, 0x0080, 0x10, 13, 1), 424 + PIN_FIELD_BASE(32, 32, 1, 0x0080, 0x10, 12, 1), 425 + PIN_FIELD_BASE(33, 33, 1, 0x0080, 0x10, 11, 1), 426 + PIN_FIELD_BASE(34, 34, 1, 0x0080, 0x10, 14, 1), 427 + PIN_FIELD_BASE(35, 35, 1, 0x0080, 0x10, 15, 1), 428 + PIN_FIELD_BASE(36, 36, 1, 0x0090, 0x10, 3, 1), 429 + PIN_FIELD_BASE(37, 37, 1, 0x0090, 0x10, 6, 1), 430 + PIN_FIELD_BASE(38, 38, 1, 0x0090, 0x10, 4, 1), 431 + PIN_FIELD_BASE(39, 39, 1, 0x0090, 0x10, 5, 1), 432 + PIN_FIELD_BASE(40, 40, 1, 0x0090, 0x10, 8, 1), 433 + PIN_FIELD_BASE(41, 41, 1, 0x0090, 0x10, 7, 1), 434 + PIN_FIELD_BASE(42, 42, 1, 0x0090, 0x10, 10, 1), 435 + PIN_FIELD_BASE(43, 43, 1, 0x0090, 0x10, 9, 1), 436 + PIN_FIELD_BASE(44, 44, 1, 0x0090, 0x10, 21, 1), 437 + PIN_FIELD_BASE(45, 45, 1, 0x0090, 0x10, 22, 1), 438 + PIN_FIELD_BASE(46, 46, 1, 0x0080, 0x10, 18, 1), 439 + PIN_FIELD_BASE(47, 47, 1, 0x0080, 0x10, 16, 1), 440 + PIN_FIELD_BASE(48, 48, 1, 0x0080, 0x10, 19, 1), 441 + PIN_FIELD_BASE(49, 49, 1, 0x0080, 0x10, 17, 1), 442 + PIN_FIELD_BASE(50, 50, 1, 0x0080, 0x10, 25, 1), 443 + PIN_FIELD_BASE(51, 51, 1, 0x0080, 0x10, 20, 1), 444 + PIN_FIELD_BASE(52, 52, 1, 0x0080, 0x10, 26, 1), 445 + PIN_FIELD_BASE(53, 53, 1, 0x0080, 0x10, 21, 1), 446 + PIN_FIELD_BASE(54, 54, 1, 0x0080, 0x10, 22, 1), 447 + PIN_FIELD_BASE(55, 55, 1, 0x0080, 0x10, 23, 1), 448 + PIN_FIELD_BASE(56, 56, 1, 0x0080, 0x10, 24, 1), 449 + PIN_FIELD_BASE(57, 57, 1, 0x0080, 0x10, 29, 1), 450 + PIN_FIELD_BASE(58, 58, 1, 0x0080, 0x10, 27, 1), 451 + PIN_FIELD_BASE(59, 59, 1, 0x0080, 0x10, 30, 1), 452 + PIN_FIELD_BASE(60, 60, 1, 0x0080, 0x10, 28, 1), 453 + PIN_FIELD_BASE(61, 61, 1, 0x0080, 0x10, 8, 1), 454 + PIN_FIELD_BASE(62, 62, 1, 0x0080, 0x10, 7, 1), 455 + PIN_FIELD_BASE(63, 63, 1, 0x0080, 0x10, 10, 1), 456 + PIN_FIELD_BASE(64, 64, 1, 0x0080, 0x10, 9, 1), 457 + PIN_FIELD_BASE(65, 65, 1, 0x0090, 0x10, 1, 1), 458 + PIN_FIELD_BASE(66, 66, 1, 0x0080, 0x10, 31, 1), 459 + PIN_FIELD_BASE(67, 67, 1, 0x0090, 0x10, 0, 1), 460 + PIN_FIELD_BASE(68, 68, 1, 0x0090, 0x10, 2, 1), 461 + PIN_FIELD_BASE(69, 69, 1, 0x0080, 0x10, 0, 1), 462 + PIN_FIELD_BASE(70, 70, 1, 0x0080, 0x10, 6, 1), 463 + PIN_FIELD_BASE(71, 71, 1, 0x0080, 0x10, 4, 1), 464 + PIN_FIELD_BASE(72, 72, 1, 0x0080, 0x10, 5, 1), 465 + PIN_FIELD_BASE(73, 73, 1, 0x0080, 0x10, 1, 1), 466 + PIN_FIELD_BASE(74, 74, 1, 0x0080, 0x10, 2, 1), 467 + PIN_FIELD_BASE(75, 75, 1, 0x0080, 0x10, 3, 1), 468 + PIN_FIELD_BASE(76, 76, 1, 0x0090, 0x10, 11, 1), 469 + PIN_FIELD_BASE(97, 97, 3, 0x0050, 0x10, 0, 1), 470 + PIN_FIELD_BASE(98, 98, 3, 0x0050, 0x10, 4, 1), 471 + PIN_FIELD_BASE(99, 99, 3, 0x0050, 0x10, 3, 1), 472 + PIN_FIELD_BASE(100, 100, 3, 0x0050, 0x10, 6, 1), 473 + PIN_FIELD_BASE(101, 101, 3, 0x0050, 0x10, 5, 1), 474 + PIN_FIELD_BASE(102, 102, 3, 0x0050, 0x10, 8, 1), 475 + PIN_FIELD_BASE(103, 103, 3, 0x0050, 0x10, 7, 1), 476 + PIN_FIELD_BASE(108, 108, 3, 0x0050, 0x10, 2, 1), 477 + PIN_FIELD_BASE(109, 109, 3, 0x0050, 0x10, 1, 1), 478 + PIN_FIELD_BASE(128, 128, 3, 0x0050, 0x10, 11, 1), 479 + PIN_FIELD_BASE(129, 129, 3, 0x0050, 0x10, 9, 1), 480 + PIN_FIELD_BASE(130, 130, 3, 0x0050, 0x10, 12, 1), 481 + PIN_FIELD_BASE(131, 131, 3, 0x0050, 0x10, 10, 1), 482 + PIN_FIELD_BASE(132, 132, 6, 0x0040, 0x10, 1, 1), 483 + PIN_FIELD_BASE(133, 133, 6, 0x0040, 0x10, 0, 1), 484 + PIN_FIELD_BASE(134, 134, 6, 0x0040, 0x10, 3, 1), 485 + PIN_FIELD_BASE(135, 135, 6, 0x0040, 0x10, 2, 1), 486 + PIN_FIELD_BASE(136, 136, 1, 0x0090, 0x10, 14, 1), 487 + PIN_FIELD_BASE(137, 137, 1, 0x0090, 0x10, 13, 1), 488 + PIN_FIELD_BASE(138, 138, 1, 0x0090, 0x10, 16, 1), 489 + PIN_FIELD_BASE(139, 139, 1, 0x0090, 0x10, 15, 1), 490 + PIN_FIELD_BASE(140, 140, 1, 0x0090, 0x10, 18, 1), 491 + PIN_FIELD_BASE(141, 141, 1, 0x0090, 0x10, 17, 1), 492 + PIN_FIELD_BASE(142, 142, 1, 0x0090, 0x10, 20, 1), 493 + PIN_FIELD_BASE(143, 143, 1, 0x0090, 0x10, 19, 1), 494 + }; 495 + 496 + static const struct mtk_pin_field_calc mt8195_pin_pupd_range[] = { 497 + PIN_FIELD_BASE(0, 0, 4, 0x0060, 0x10, 0, 1), 498 + PIN_FIELD_BASE(1, 1, 4, 0x0060, 0x10, 1, 1), 499 + PIN_FIELD_BASE(2, 2, 4, 0x0060, 0x10, 2, 1), 500 + PIN_FIELD_BASE(3, 3, 4, 0x0060, 0x10, 3, 1), 501 + PIN_FIELD_BASE(4, 4, 4, 0x0060, 0x10, 4, 1), 502 + PIN_FIELD_BASE(5, 5, 4, 0x0060, 0x10, 5, 1), 503 + PIN_FIELD_BASE(77, 77, 3, 0x0060, 0x10, 1, 1), 504 + PIN_FIELD_BASE(78, 78, 3, 0x0060, 0x10, 2, 1), 505 + PIN_FIELD_BASE(79, 79, 3, 0x0060, 0x10, 9, 1), 506 + PIN_FIELD_BASE(80, 80, 3, 0x0060, 0x10, 10, 1), 507 + PIN_FIELD_BASE(81, 81, 3, 0x0060, 0x10, 11, 1), 508 + PIN_FIELD_BASE(82, 82, 3, 0x0060, 0x10, 12, 1), 509 + PIN_FIELD_BASE(83, 83, 3, 0x0060, 0x10, 13, 1), 510 + PIN_FIELD_BASE(84, 84, 3, 0x0060, 0x10, 14, 1), 511 + PIN_FIELD_BASE(85, 85, 3, 0x0060, 0x10, 15, 1), 512 + PIN_FIELD_BASE(86, 86, 3, 0x0060, 0x10, 16, 1), 513 + PIN_FIELD_BASE(87, 87, 3, 0x0060, 0x10, 3, 1), 514 + PIN_FIELD_BASE(88, 88, 3, 0x0060, 0x10, 4, 1), 515 + PIN_FIELD_BASE(89, 89, 3, 0x0060, 0x10, 5, 1), 516 + PIN_FIELD_BASE(90, 90, 3, 0x0060, 0x10, 6, 1), 517 + PIN_FIELD_BASE(91, 91, 3, 0x0060, 0x10, 7, 1), 518 + PIN_FIELD_BASE(92, 92, 3, 0x0060, 0x10, 8, 1), 519 + PIN_FIELD_BASE(93, 93, 3, 0x0060, 0x10, 18, 1), 520 + PIN_FIELD_BASE(94, 94, 3, 0x0060, 0x10, 19, 1), 521 + PIN_FIELD_BASE(95, 95, 3, 0x0060, 0x10, 17, 1), 522 + PIN_FIELD_BASE(96, 96, 3, 0x0060, 0x10, 0, 1), 523 + PIN_FIELD_BASE(104, 104, 3, 0x0060, 0x10, 22, 1), 524 + PIN_FIELD_BASE(105, 105, 3, 0x0060, 0x10, 23, 1), 525 + PIN_FIELD_BASE(106, 106, 3, 0x0060, 0x10, 20, 1), 526 + PIN_FIELD_BASE(107, 107, 3, 0x0060, 0x10, 21, 1), 527 + PIN_FIELD_BASE(110, 110, 5, 0x0020, 0x10, 1, 1), 528 + PIN_FIELD_BASE(111, 111, 5, 0x0020, 0x10, 0, 1), 529 + PIN_FIELD_BASE(112, 112, 5, 0x0020, 0x10, 2, 1), 530 + PIN_FIELD_BASE(113, 113, 5, 0x0020, 0x10, 3, 1), 531 + PIN_FIELD_BASE(114, 114, 5, 0x0020, 0x10, 4, 1), 532 + PIN_FIELD_BASE(115, 115, 5, 0x0020, 0x10, 5, 1), 533 + PIN_FIELD_BASE(116, 116, 6, 0x0050, 0x10, 9, 1), 534 + PIN_FIELD_BASE(117, 117, 6, 0x0050, 0x10, 8, 1), 535 + PIN_FIELD_BASE(118, 118, 6, 0x0050, 0x10, 7, 1), 536 + PIN_FIELD_BASE(119, 119, 6, 0x0050, 0x10, 6, 1), 537 + PIN_FIELD_BASE(120, 120, 6, 0x0050, 0x10, 11, 1), 538 + PIN_FIELD_BASE(121, 121, 6, 0x0050, 0x10, 1, 1), 539 + PIN_FIELD_BASE(122, 122, 6, 0x0050, 0x10, 0, 1), 540 + PIN_FIELD_BASE(123, 123, 6, 0x0050, 0x10, 5, 1), 541 + PIN_FIELD_BASE(124, 124, 6, 0x0050, 0x10, 4, 1), 542 + PIN_FIELD_BASE(125, 125, 6, 0x0050, 0x10, 3, 1), 543 + PIN_FIELD_BASE(126, 126, 6, 0x0050, 0x10, 2, 1), 544 + PIN_FIELD_BASE(127, 127, 6, 0x0050, 0x10, 10, 1), 545 + }; 546 + 547 + static const struct mtk_pin_field_calc mt8195_pin_r0_range[] = { 548 + PIN_FIELD_BASE(0, 0, 4, 0x0080, 0x10, 0, 1), 549 + PIN_FIELD_BASE(1, 1, 4, 0x0080, 0x10, 1, 1), 550 + PIN_FIELD_BASE(2, 2, 4, 0x0080, 0x10, 2, 1), 551 + PIN_FIELD_BASE(3, 3, 4, 0x0080, 0x10, 3, 1), 552 + PIN_FIELD_BASE(4, 4, 4, 0x0080, 0x10, 4, 1), 553 + PIN_FIELD_BASE(5, 5, 4, 0x0080, 0x10, 5, 1), 554 + PIN_FIELD_BASE(77, 77, 3, 0x0080, 0x10, 1, 1), 555 + PIN_FIELD_BASE(78, 78, 3, 0x0080, 0x10, 2, 1), 556 + PIN_FIELD_BASE(79, 79, 3, 0x0080, 0x10, 9, 1), 557 + PIN_FIELD_BASE(80, 80, 3, 0x0080, 0x10, 10, 1), 558 + PIN_FIELD_BASE(81, 81, 3, 0x0080, 0x10, 11, 1), 559 + PIN_FIELD_BASE(82, 82, 3, 0x0080, 0x10, 12, 1), 560 + PIN_FIELD_BASE(83, 83, 3, 0x0080, 0x10, 13, 1), 561 + PIN_FIELD_BASE(84, 84, 3, 0x0080, 0x10, 14, 1), 562 + PIN_FIELD_BASE(85, 85, 3, 0x0080, 0x10, 15, 1), 563 + PIN_FIELD_BASE(86, 86, 3, 0x0080, 0x10, 16, 1), 564 + PIN_FIELD_BASE(87, 87, 3, 0x0080, 0x10, 3, 1), 565 + PIN_FIELD_BASE(88, 88, 3, 0x0080, 0x10, 4, 1), 566 + PIN_FIELD_BASE(89, 89, 3, 0x0080, 0x10, 5, 1), 567 + PIN_FIELD_BASE(90, 90, 3, 0x0080, 0x10, 6, 1), 568 + PIN_FIELD_BASE(91, 91, 3, 0x0080, 0x10, 7, 1), 569 + PIN_FIELD_BASE(92, 92, 3, 0x0080, 0x10, 8, 1), 570 + PIN_FIELD_BASE(93, 93, 3, 0x0080, 0x10, 18, 1), 571 + PIN_FIELD_BASE(94, 94, 3, 0x0080, 0x10, 19, 1), 572 + PIN_FIELD_BASE(95, 95, 3, 0x0080, 0x10, 17, 1), 573 + PIN_FIELD_BASE(96, 96, 3, 0x0080, 0x10, 0, 1), 574 + PIN_FIELD_BASE(104, 104, 3, 0x0080, 0x10, 22, 1), 575 + PIN_FIELD_BASE(105, 105, 3, 0x0080, 0x10, 23, 1), 576 + PIN_FIELD_BASE(106, 106, 3, 0x0080, 0x10, 20, 1), 577 + PIN_FIELD_BASE(107, 107, 3, 0x0080, 0x10, 21, 1), 578 + PIN_FIELD_BASE(110, 110, 5, 0x0030, 0x10, 1, 1), 579 + PIN_FIELD_BASE(111, 111, 5, 0x0030, 0x10, 0, 1), 580 + PIN_FIELD_BASE(112, 112, 5, 0x0030, 0x10, 2, 1), 581 + PIN_FIELD_BASE(113, 113, 5, 0x0030, 0x10, 3, 1), 582 + PIN_FIELD_BASE(114, 114, 5, 0x0030, 0x10, 4, 1), 583 + PIN_FIELD_BASE(115, 115, 5, 0x0030, 0x10, 5, 1), 584 + PIN_FIELD_BASE(116, 116, 6, 0x0070, 0x10, 9, 1), 585 + PIN_FIELD_BASE(117, 117, 6, 0x0070, 0x10, 8, 1), 586 + PIN_FIELD_BASE(118, 118, 6, 0x0070, 0x10, 7, 1), 587 + PIN_FIELD_BASE(119, 119, 6, 0x0070, 0x10, 6, 1), 588 + PIN_FIELD_BASE(120, 120, 6, 0x0070, 0x10, 11, 1), 589 + PIN_FIELD_BASE(121, 121, 6, 0x0070, 0x10, 1, 1), 590 + PIN_FIELD_BASE(122, 122, 6, 0x0070, 0x10, 0, 1), 591 + PIN_FIELD_BASE(123, 123, 6, 0x0070, 0x10, 5, 1), 592 + PIN_FIELD_BASE(124, 124, 6, 0x0070, 0x10, 4, 1), 593 + PIN_FIELD_BASE(125, 125, 6, 0x0070, 0x10, 3, 1), 594 + PIN_FIELD_BASE(126, 126, 6, 0x0070, 0x10, 2, 1), 595 + PIN_FIELD_BASE(127, 127, 6, 0x0070, 0x10, 10, 1), 596 + }; 597 + 598 + static const struct mtk_pin_field_calc mt8195_pin_r1_range[] = { 599 + PIN_FIELD_BASE(0, 0, 4, 0x0090, 0x10, 0, 1), 600 + PIN_FIELD_BASE(1, 1, 4, 0x0090, 0x10, 1, 1), 601 + PIN_FIELD_BASE(2, 2, 4, 0x0090, 0x10, 2, 1), 602 + PIN_FIELD_BASE(3, 3, 4, 0x0090, 0x10, 3, 1), 603 + PIN_FIELD_BASE(4, 4, 4, 0x0090, 0x10, 4, 1), 604 + PIN_FIELD_BASE(5, 5, 4, 0x0090, 0x10, 5, 1), 605 + PIN_FIELD_BASE(77, 77, 3, 0x0090, 0x10, 1, 1), 606 + PIN_FIELD_BASE(78, 78, 3, 0x0090, 0x10, 2, 1), 607 + PIN_FIELD_BASE(79, 79, 3, 0x0090, 0x10, 9, 1), 608 + PIN_FIELD_BASE(80, 80, 3, 0x0090, 0x10, 10, 1), 609 + PIN_FIELD_BASE(81, 81, 3, 0x0090, 0x10, 11, 1), 610 + PIN_FIELD_BASE(82, 82, 3, 0x0090, 0x10, 12, 1), 611 + PIN_FIELD_BASE(83, 83, 3, 0x0090, 0x10, 13, 1), 612 + PIN_FIELD_BASE(84, 84, 3, 0x0090, 0x10, 14, 1), 613 + PIN_FIELD_BASE(85, 85, 3, 0x0090, 0x10, 15, 1), 614 + PIN_FIELD_BASE(86, 86, 3, 0x0090, 0x10, 16, 1), 615 + PIN_FIELD_BASE(87, 87, 3, 0x0090, 0x10, 3, 1), 616 + PIN_FIELD_BASE(88, 88, 3, 0x0090, 0x10, 4, 1), 617 + PIN_FIELD_BASE(89, 89, 3, 0x0090, 0x10, 5, 1), 618 + PIN_FIELD_BASE(90, 90, 3, 0x0090, 0x10, 6, 1), 619 + PIN_FIELD_BASE(91, 91, 3, 0x0090, 0x10, 7, 1), 620 + PIN_FIELD_BASE(92, 92, 3, 0x0090, 0x10, 8, 1), 621 + PIN_FIELD_BASE(93, 93, 3, 0x0090, 0x10, 18, 1), 622 + PIN_FIELD_BASE(94, 94, 3, 0x0090, 0x10, 19, 1), 623 + PIN_FIELD_BASE(95, 95, 3, 0x0090, 0x10, 17, 1), 624 + PIN_FIELD_BASE(96, 96, 3, 0x0090, 0x10, 0, 1), 625 + PIN_FIELD_BASE(104, 104, 3, 0x0090, 0x10, 22, 1), 626 + PIN_FIELD_BASE(105, 105, 3, 0x0090, 0x10, 23, 1), 627 + PIN_FIELD_BASE(106, 106, 3, 0x0090, 0x10, 20, 1), 628 + PIN_FIELD_BASE(107, 107, 3, 0x0090, 0x10, 21, 1), 629 + PIN_FIELD_BASE(110, 110, 5, 0x0040, 0x10, 1, 1), 630 + PIN_FIELD_BASE(111, 111, 5, 0x0040, 0x10, 0, 1), 631 + PIN_FIELD_BASE(112, 112, 5, 0x0040, 0x10, 2, 1), 632 + PIN_FIELD_BASE(113, 113, 5, 0x0040, 0x10, 3, 1), 633 + PIN_FIELD_BASE(114, 114, 5, 0x0040, 0x10, 4, 1), 634 + PIN_FIELD_BASE(115, 115, 5, 0x0040, 0x10, 5, 1), 635 + PIN_FIELD_BASE(116, 116, 6, 0x0080, 0x10, 9, 1), 636 + PIN_FIELD_BASE(117, 117, 6, 0x0080, 0x10, 8, 1), 637 + PIN_FIELD_BASE(118, 118, 6, 0x0080, 0x10, 7, 1), 638 + PIN_FIELD_BASE(119, 119, 6, 0x0080, 0x10, 6, 1), 639 + PIN_FIELD_BASE(120, 120, 6, 0x0080, 0x10, 11, 1), 640 + PIN_FIELD_BASE(121, 121, 6, 0x0080, 0x10, 1, 1), 641 + PIN_FIELD_BASE(122, 122, 6, 0x0080, 0x10, 0, 1), 642 + PIN_FIELD_BASE(123, 123, 6, 0x0080, 0x10, 5, 1), 643 + PIN_FIELD_BASE(124, 124, 6, 0x0080, 0x10, 4, 1), 644 + PIN_FIELD_BASE(125, 125, 6, 0x0080, 0x10, 3, 1), 645 + PIN_FIELD_BASE(126, 126, 6, 0x0080, 0x10, 2, 1), 646 + PIN_FIELD_BASE(127, 127, 6, 0x0080, 0x10, 10, 1), 647 + }; 648 + 649 + static const struct mtk_pin_field_calc mt8195_pin_drv_range[] = { 650 + PIN_FIELD_BASE(0, 0, 4, 0x000, 0x10, 0, 3), 651 + PIN_FIELD_BASE(1, 1, 4, 0x000, 0x10, 3, 3), 652 + PIN_FIELD_BASE(2, 2, 4, 0x000, 0x10, 6, 3), 653 + PIN_FIELD_BASE(3, 3, 4, 0x000, 0x10, 9, 3), 654 + PIN_FIELD_BASE(4, 4, 4, 0x000, 0x10, 12, 3), 655 + PIN_FIELD_BASE(5, 5, 4, 0x000, 0x10, 15, 3), 656 + PINS_FIELD_BASE(6, 7, 4, 0x000, 0x10, 18, 3), 657 + PIN_FIELD_BASE(8, 8, 4, 0x010, 0x10, 6, 3), 658 + PIN_FIELD_BASE(9, 9, 4, 0x000, 0x10, 21, 3), 659 + PIN_FIELD_BASE(10, 10, 4, 0x010, 0x10, 9, 3), 660 + PIN_FIELD_BASE(11, 11, 4, 0x000, 0x10, 24, 3), 661 + PIN_FIELD_BASE(12, 12, 4, 0x010, 0x10, 12, 3), 662 + PIN_FIELD_BASE(13, 13, 4, 0x010, 0x10, 27, 3), 663 + PIN_FIELD_BASE(14, 14, 4, 0x010, 0x10, 15, 3), 664 + PIN_FIELD_BASE(15, 15, 4, 0x010, 0x10, 0, 3), 665 + PIN_FIELD_BASE(16, 16, 4, 0x010, 0x10, 18, 3), 666 + PIN_FIELD_BASE(17, 17, 4, 0x010, 0x10, 3, 3), 667 + PIN_FIELD_BASE(18, 18, 2, 0x010, 0x10, 6, 3), 668 + PIN_FIELD_BASE(19, 19, 2, 0x010, 0x10, 3, 3), 669 + PIN_FIELD_BASE(20, 20, 2, 0x010, 0x10, 0, 3), 670 + PIN_FIELD_BASE(21, 21, 2, 0x000, 0x10, 27, 3), 671 + PIN_FIELD_BASE(22, 22, 2, 0x000, 0x10, 0, 3), 672 + PIN_FIELD_BASE(23, 23, 2, 0x000, 0x10, 3, 3), 673 + PIN_FIELD_BASE(24, 24, 2, 0x000, 0x10, 6, 3), 674 + PIN_FIELD_BASE(25, 25, 2, 0x000, 0x10, 12, 3), 675 + PIN_FIELD_BASE(26, 26, 2, 0x000, 0x10, 9, 3), 676 + PIN_FIELD_BASE(27, 27, 2, 0x000, 0x10, 15, 3), 677 + PIN_FIELD_BASE(28, 28, 2, 0x000, 0x10, 18, 3), 678 + PIN_FIELD_BASE(29, 29, 2, 0x000, 0x10, 21, 3), 679 + PIN_FIELD_BASE(30, 30, 2, 0x000, 0x10, 24, 3), 680 + PINS_FIELD_BASE(31, 33, 1, 0x010, 0x10, 0, 3), 681 + PIN_FIELD_BASE(34, 34, 1, 0x000, 0x10, 21, 3), 682 + PIN_FIELD_BASE(35, 35, 1, 0x000, 0x10, 24, 3), 683 + PIN_FIELD_BASE(36, 36, 1, 0x010, 0x10, 0, 3), 684 + PIN_FIELD_BASE(37, 37, 1, 0x010, 0x10, 21, 3), 685 + PINS_FIELD_BASE(38, 39, 1, 0x010, 0x10, 3, 3), 686 + PIN_FIELD_BASE(40, 40, 1, 0x010, 0x10, 27, 3), 687 + PIN_FIELD_BASE(41, 41, 1, 0x010, 0x10, 24, 3), 688 + PIN_FIELD_BASE(42, 42, 1, 0x020, 0x10, 3, 3), 689 + PIN_FIELD_BASE(43, 43, 1, 0x020, 0x10, 0, 3), 690 + PIN_FIELD_BASE(44, 44, 1, 0x030, 0x10, 0, 3), 691 + PIN_FIELD_BASE(45, 45, 1, 0x030, 0x10, 3, 3), 692 + PINS_FIELD_BASE(46, 47, 1, 0x010, 0x10, 3, 3), 693 + PINS_FIELD_BASE(48, 51, 1, 0x010, 0x10, 6, 3), 694 + PINS_FIELD_BASE(52, 55, 1, 0x010, 0x10, 9, 3), 695 + PINS_FIELD_BASE(56, 59, 1, 0x010, 0x10, 12, 3), 696 + PINS_FIELD_BASE(60, 63, 1, 0x010, 0x10, 15, 3), 697 + PIN_FIELD_BASE(64, 64, 1, 0x010, 0x10, 18, 3), 698 + PINS_FIELD_BASE(65, 68, 1, 0x000, 0x10, 27, 3), 699 + PIN_FIELD_BASE(69, 69, 1, 0x000, 0x10, 0, 3), 700 + PIN_FIELD_BASE(70, 70, 1, 0x000, 0x10, 18, 3), 701 + PIN_FIELD_BASE(71, 71, 1, 0x000, 0x10, 12, 3), 702 + PIN_FIELD_BASE(72, 72, 1, 0x000, 0x10, 15, 3), 703 + PIN_FIELD_BASE(73, 73, 1, 0x000, 0x10, 3, 3), 704 + PIN_FIELD_BASE(74, 74, 1, 0x000, 0x10, 6, 3), 705 + PIN_FIELD_BASE(75, 75, 1, 0x000, 0x10, 9, 3), 706 + PIN_FIELD_BASE(76, 76, 1, 0x010, 0x10, 18, 3), 707 + PIN_FIELD_BASE(77, 77, 3, 0x000, 0x10, 0, 3), 708 + PIN_FIELD_BASE(78, 78, 3, 0x000, 0x10, 15, 3), 709 + PIN_FIELD_BASE(79, 79, 3, 0x000, 0x10, 18, 3), 710 + PIN_FIELD_BASE(80, 80, 3, 0x000, 0x10, 21, 3), 711 + PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 28, 3), 712 + PIN_FIELD_BASE(82, 82, 3, 0x000, 0x10, 27, 3), 713 + PIN_FIELD_BASE(83, 83, 3, 0x010, 0x10, 0, 3), 714 + PIN_FIELD_BASE(84, 84, 3, 0x010, 0x10, 3, 3), 715 + PINS_FIELD_BASE(85, 88, 3, 0x010, 0x10, 15, 3), 716 + PIN_FIELD_BASE(89, 89, 3, 0x000, 0x10, 3, 3), 717 + PIN_FIELD_BASE(90, 90, 3, 0x000, 0x10, 6, 3), 718 + PIN_FIELD_BASE(91, 91, 3, 0x000, 0x10, 9, 3), 719 + PIN_FIELD_BASE(92, 92, 3, 0x000, 0x10, 12, 3), 720 + PIN_FIELD_BASE(93, 93, 3, 0x010, 0x10, 6, 3), 721 + PIN_FIELD_BASE(94, 94, 3, 0x010, 0x10, 9, 3), 722 + PINS_FIELD_BASE(95, 98, 3, 0x010, 0x10, 18, 3), 723 + PINS_FIELD_BASE(99, 102, 3, 0x010, 0x10, 21, 3), 724 + PINS_FIELD_BASE(103, 104, 3, 0x010, 0x10, 24, 3), 725 + PIN_FIELD_BASE(105, 105, 3, 0x010, 0x10, 27, 3), 726 + PINS_FIELD_BASE(106, 107, 3, 0x010, 0x10, 24, 3), 727 + PINS_FIELD_BASE(108, 109, 3, 0x010, 0x10, 27, 3), 728 + PIN_FIELD_BASE(110, 110, 5, 0x000, 0x10, 3, 3), 729 + PIN_FIELD_BASE(111, 111, 5, 0x000, 0x10, 0, 3), 730 + PIN_FIELD_BASE(112, 112, 5, 0x000, 0x10, 6, 3), 731 + PIN_FIELD_BASE(113, 113, 5, 0x000, 0x10, 9, 3), 732 + PIN_FIELD_BASE(114, 114, 5, 0x000, 0x10, 12, 3), 733 + PIN_FIELD_BASE(115, 115, 5, 0x000, 0x10, 15, 3), 734 + PIN_FIELD_BASE(116, 116, 6, 0x000, 0x10, 27, 3), 735 + PIN_FIELD_BASE(117, 117, 6, 0x000, 0x10, 24, 3), 736 + PIN_FIELD_BASE(118, 118, 6, 0x000, 0x10, 21, 3), 737 + PIN_FIELD_BASE(119, 119, 6, 0x000, 0x10, 18, 3), 738 + PIN_FIELD_BASE(120, 120, 6, 0x010, 0x10, 3, 3), 739 + PIN_FIELD_BASE(121, 121, 6, 0x000, 0x10, 3, 3), 740 + PIN_FIELD_BASE(122, 122, 6, 0x000, 0x10, 0, 3), 741 + PIN_FIELD_BASE(123, 123, 6, 0x000, 0x10, 15, 3), 742 + PIN_FIELD_BASE(124, 124, 6, 0x000, 0x10, 12, 3), 743 + PIN_FIELD_BASE(125, 125, 6, 0x000, 0x10, 9, 3), 744 + PIN_FIELD_BASE(126, 126, 6, 0x000, 0x10, 6, 3), 745 + PIN_FIELD_BASE(127, 127, 6, 0x010, 0x10, 0, 3), 746 + PIN_FIELD_BASE(128, 128, 3, 0x010, 0x10, 27, 3), 747 + PINS_FIELD_BASE(129, 130, 3, 0x020, 0x10, 0, 3), 748 + PINS_FIELD_BASE(131, 131, 3, 0x010, 0x10, 12, 3), 749 + PIN_FIELD_BASE(132, 132, 6, 0x010, 0x10, 9, 3), 750 + PIN_FIELD_BASE(133, 133, 6, 0x010, 0x10, 6, 3), 751 + PIN_FIELD_BASE(134, 134, 6, 0x010, 0x10, 15, 3), 752 + PIN_FIELD_BASE(135, 135, 6, 0x010, 0x10, 12, 3), 753 + PIN_FIELD_BASE(136, 136, 1, 0x020, 0x10, 9, 3), 754 + PIN_FIELD_BASE(137, 137, 1, 0x020, 0x10, 6, 3), 755 + PIN_FIELD_BASE(138, 138, 1, 0x020, 0x10, 15, 3), 756 + PIN_FIELD_BASE(139, 139, 1, 0x020, 0x10, 12, 3), 757 + PIN_FIELD_BASE(140, 140, 1, 0x020, 0x10, 21, 3), 758 + PIN_FIELD_BASE(141, 141, 1, 0x020, 0x10, 18, 3), 759 + PIN_FIELD_BASE(142, 142, 1, 0x020, 0x10, 27, 3), 760 + PIN_FIELD_BASE(143, 143, 1, 0x020, 0x10, 24, 3), 761 + }; 762 + 763 + static const struct mtk_pin_field_calc mt8195_pin_drv_adv_range[] = { 764 + PIN_FIELD_BASE(8, 8, 4, 0x020, 0x10, 15, 3), 765 + PIN_FIELD_BASE(9, 9, 4, 0x020, 0x10, 0, 3), 766 + PIN_FIELD_BASE(10, 10, 4, 0x020, 0x10, 18, 3), 767 + PIN_FIELD_BASE(11, 11, 4, 0x020, 0x10, 3, 3), 768 + PIN_FIELD_BASE(12, 12, 4, 0x020, 0x10, 21, 3), 769 + PIN_FIELD_BASE(13, 13, 4, 0x020, 0x10, 6, 3), 770 + PIN_FIELD_BASE(14, 14, 4, 0x020, 0x10, 24, 3), 771 + PIN_FIELD_BASE(15, 15, 4, 0x020, 0x10, 9, 3), 772 + PIN_FIELD_BASE(16, 16, 4, 0x020, 0x10, 27, 3), 773 + PIN_FIELD_BASE(17, 17, 4, 0x020, 0x10, 12, 3), 774 + PIN_FIELD_BASE(29, 29, 2, 0x020, 0x10, 0, 3), 775 + PIN_FIELD_BASE(30, 30, 2, 0x020, 0x10, 3, 3), 776 + PIN_FIELD_BASE(34, 34, 1, 0x040, 0x10, 0, 3), 777 + PIN_FIELD_BASE(35, 35, 1, 0x040, 0x10, 3, 3), 778 + PIN_FIELD_BASE(44, 44, 1, 0x040, 0x10, 6, 3), 779 + PIN_FIELD_BASE(45, 45, 1, 0x040, 0x10, 9, 3), 780 + }; 781 + 782 + static const struct mtk_pin_reg_calc mt8195_reg_cals[PINCTRL_PIN_REG_MAX] = { 783 + [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8195_pin_mode_range), 784 + [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8195_pin_dir_range), 785 + [PINCTRL_PIN_REG_DI] = MTK_RANGE(mt8195_pin_di_range), 786 + [PINCTRL_PIN_REG_DO] = MTK_RANGE(mt8195_pin_do_range), 787 + [PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt8195_pin_smt_range), 788 + [PINCTRL_PIN_REG_IES] = MTK_RANGE(mt8195_pin_ies_range), 789 + [PINCTRL_PIN_REG_PU] = MTK_RANGE(mt8195_pin_pu_range), 790 + [PINCTRL_PIN_REG_PD] = MTK_RANGE(mt8195_pin_pd_range), 791 + [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt8195_pin_drv_range), 792 + [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt8195_pin_pupd_range), 793 + [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8195_pin_r0_range), 794 + [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8195_pin_r1_range), 795 + [PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8195_pin_drv_adv_range), 796 + }; 797 + 798 + static const char * const mt8195_pinctrl_register_base_names[] = { 799 + "iocfg0", "iocfg_bm", "iocfg_bl", "iocfg_br", "iocfg_lm", 800 + "iocfg_rb", "iocfg_tl", 801 + }; 802 + 803 + static const struct mtk_eint_hw mt8195_eint_hw = { 804 + .port_mask = 0xf, 805 + .ports = 7, 806 + .ap_num = 225, 807 + .db_cnt = 32, 808 + }; 809 + 810 + static const struct mtk_pin_soc mt8195_data = { 811 + .reg_cal = mt8195_reg_cals, 812 + .pins = mtk_pins_mt8195, 813 + .npins = ARRAY_SIZE(mtk_pins_mt8195), 814 + .ngrps = ARRAY_SIZE(mtk_pins_mt8195), 815 + .eint_hw = &mt8195_eint_hw, 816 + .nfuncs = 8, 817 + .gpio_m = 0, 818 + .base_names = mt8195_pinctrl_register_base_names, 819 + .nbase_names = ARRAY_SIZE(mt8195_pinctrl_register_base_names), 820 + .bias_set_combo = mtk_pinconf_bias_set_combo, 821 + .bias_get_combo = mtk_pinconf_bias_get_combo, 822 + .drive_set = mtk_pinconf_drive_set_rev1, 823 + .drive_get = mtk_pinconf_drive_get_rev1, 824 + .adv_drive_get = mtk_pinconf_adv_drive_get_raw, 825 + .adv_drive_set = mtk_pinconf_adv_drive_set_raw, 826 + }; 827 + 828 + static const struct of_device_id mt8195_pinctrl_of_match[] = { 829 + { .compatible = "mediatek,mt8195-pinctrl", }, 830 + { } 831 + }; 832 + 833 + static int mt8195_pinctrl_probe(struct platform_device *pdev) 834 + { 835 + return mtk_paris_pinctrl_probe(pdev, &mt8195_data); 836 + } 837 + 838 + static struct platform_driver mt8195_pinctrl_driver = { 839 + .driver = { 840 + .name = "mt8195-pinctrl", 841 + .of_match_table = mt8195_pinctrl_of_match, 842 + }, 843 + .probe = mt8195_pinctrl_probe, 844 + }; 845 + 846 + static int __init mt8195_pinctrl_init(void) 847 + { 848 + return platform_driver_register(&mt8195_pinctrl_driver); 849 + } 850 + arch_initcall(mt8195_pinctrl_init);
+19
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
··· 57 57 void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set) 58 58 { 59 59 u32 val; 60 + unsigned long flags; 61 + 62 + spin_lock_irqsave(&pctl->lock, flags); 60 63 61 64 val = mtk_r32(pctl, i, reg); 62 65 val &= ~mask; 63 66 val |= set; 64 67 mtk_w32(pctl, i, reg, val); 68 + 69 + spin_unlock_irqrestore(&pctl->lock, flags); 65 70 } 66 71 67 72 static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw, ··· 1031 1026 return 0; 1032 1027 } 1033 1028 EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get); 1029 + 1030 + int mtk_pinconf_adv_drive_set_raw(struct mtk_pinctrl *hw, 1031 + const struct mtk_pin_desc *desc, u32 arg) 1032 + { 1033 + return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_ADV, arg); 1034 + } 1035 + EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set_raw); 1036 + 1037 + int mtk_pinconf_adv_drive_get_raw(struct mtk_pinctrl *hw, 1038 + const struct mtk_pin_desc *desc, u32 *val) 1039 + { 1040 + return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_ADV, val); 1041 + } 1042 + EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_get_raw); 1034 1043 1035 1044 MODULE_LICENSE("GPL v2"); 1036 1045 MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
+7
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
··· 66 66 PINCTRL_PIN_REG_DRV_EN, 67 67 PINCTRL_PIN_REG_DRV_E0, 68 68 PINCTRL_PIN_REG_DRV_E1, 69 + PINCTRL_PIN_REG_DRV_ADV, 69 70 PINCTRL_PIN_REG_MAX, 70 71 }; 71 72 ··· 252 251 struct mtk_eint *eint; 253 252 struct mtk_pinctrl_group *groups; 254 253 const char **grp_names; 254 + /* lock pin's register resource to avoid multiple threads issue*/ 255 + spinlock_t lock; 255 256 }; 256 257 257 258 void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set); ··· 317 314 const struct mtk_pin_desc *desc, u32 arg); 318 315 int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw, 319 316 const struct mtk_pin_desc *desc, u32 *val); 317 + int mtk_pinconf_adv_drive_set_raw(struct mtk_pinctrl *hw, 318 + const struct mtk_pin_desc *desc, u32 arg); 319 + int mtk_pinconf_adv_drive_get_raw(struct mtk_pinctrl *hw, 320 + const struct mtk_pin_desc *desc, u32 *val); 320 321 321 322 bool mtk_is_virt_gpio(struct mtk_pinctrl *hw, unsigned int gpio_n); 322 323 #endif /* __PINCTRL_MTK_COMMON_V2_H */
+1669
drivers/pinctrl/mediatek/pinctrl-mtk-mt8195.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2020 MediaTek Inc. 4 + * 5 + * Author: Zhiyong Tao <zhiyong.tao@mediatek.com> 6 + * 7 + */ 8 + 9 + #ifndef __PINCTRL_MTK_MT8195_H 10 + #define __PINCTRL_MTK_MT8195_H 11 + 12 + #include "pinctrl-paris.h" 13 + 14 + static const struct mtk_pin_desc mtk_pins_mt8195[] = { 15 + MTK_PIN( 16 + 0, "GPIO0", 17 + MTK_EINT_FUNCTION(0, 0), 18 + DRV_GRP4, 19 + MTK_FUNCTION(0, "GPIO0"), 20 + MTK_FUNCTION(1, "TP_GPIO0_AO"), 21 + MTK_FUNCTION(2, "MSDC2_CMD"), 22 + MTK_FUNCTION(3, "TDMIN_MCK"), 23 + MTK_FUNCTION(4, "CLKM0"), 24 + MTK_FUNCTION(5, "PERSTN_1"), 25 + MTK_FUNCTION(6, "IDDIG_1P"), 26 + MTK_FUNCTION(7, "DMIC4_CLK") 27 + ), 28 + MTK_PIN( 29 + 1, "GPIO1", 30 + MTK_EINT_FUNCTION(0, 1), 31 + DRV_GRP4, 32 + MTK_FUNCTION(0, "GPIO1"), 33 + MTK_FUNCTION(1, "TP_GPIO1_AO"), 34 + MTK_FUNCTION(2, "MSDC2_CLK"), 35 + MTK_FUNCTION(3, "TDMIN_DI"), 36 + MTK_FUNCTION(4, "CLKM1"), 37 + MTK_FUNCTION(5, "CLKREQN_1"), 38 + MTK_FUNCTION(6, "USB_DRVVBUS_1P"), 39 + MTK_FUNCTION(7, "DMIC4_DAT") 40 + ), 41 + MTK_PIN( 42 + 2, "GPIO2", 43 + MTK_EINT_FUNCTION(0, 2), 44 + DRV_GRP4, 45 + MTK_FUNCTION(0, "GPIO2"), 46 + MTK_FUNCTION(1, "TP_GPIO2_AO"), 47 + MTK_FUNCTION(2, "MSDC2_DAT3"), 48 + MTK_FUNCTION(3, "TDMIN_LRCK"), 49 + MTK_FUNCTION(4, "CLKM2"), 50 + MTK_FUNCTION(5, "WAKEN_1"), 51 + MTK_FUNCTION(7, "DMIC2_CLK") 52 + ), 53 + MTK_PIN( 54 + 3, "GPIO3", 55 + MTK_EINT_FUNCTION(0, 3), 56 + DRV_GRP4, 57 + MTK_FUNCTION(0, "GPIO3"), 58 + MTK_FUNCTION(1, "TP_GPIO3_AO"), 59 + MTK_FUNCTION(2, "MSDC2_DAT0"), 60 + MTK_FUNCTION(3, "TDMIN_BCK"), 61 + MTK_FUNCTION(4, "CLKM3"), 62 + MTK_FUNCTION(7, "DMIC2_DAT") 63 + ), 64 + MTK_PIN( 65 + 4, "GPIO4", 66 + MTK_EINT_FUNCTION(0, 4), 67 + DRV_GRP4, 68 + MTK_FUNCTION(0, "GPIO4"), 69 + MTK_FUNCTION(1, "TP_GPIO4_AO"), 70 + MTK_FUNCTION(2, "MSDC2_DAT2"), 71 + MTK_FUNCTION(3, "SPDIF_IN1"), 72 + MTK_FUNCTION(4, "UTXD3"), 73 + MTK_FUNCTION(5, "SDA2"), 74 + MTK_FUNCTION(7, "IDDIG_2P") 75 + ), 76 + MTK_PIN( 77 + 5, "GPIO5", 78 + MTK_EINT_FUNCTION(0, 5), 79 + DRV_GRP4, 80 + MTK_FUNCTION(0, "GPIO5"), 81 + MTK_FUNCTION(1, "TP_GPIO5_AO"), 82 + MTK_FUNCTION(2, "MSDC2_DAT1"), 83 + MTK_FUNCTION(3, "SPDIF_IN0"), 84 + MTK_FUNCTION(4, "URXD3"), 85 + MTK_FUNCTION(5, "SCL2"), 86 + MTK_FUNCTION(7, "USB_DRVVBUS_2P") 87 + ), 88 + MTK_PIN( 89 + 6, "GPIO6", 90 + MTK_EINT_FUNCTION(0, 6), 91 + DRV_GRP4, 92 + MTK_FUNCTION(0, "GPIO6"), 93 + MTK_FUNCTION(1, "TP_GPIO6_AO"), 94 + MTK_FUNCTION(2, "DP_TX_HPD"), 95 + MTK_FUNCTION(3, "I2SO1_D4"), 96 + MTK_FUNCTION(4, "UTXD4"), 97 + MTK_FUNCTION(5, "CMVREF3"), 98 + MTK_FUNCTION(7, "DMIC3_CLK") 99 + ), 100 + MTK_PIN( 101 + 7, "GPIO7", 102 + MTK_EINT_FUNCTION(0, 7), 103 + DRV_GRP4, 104 + MTK_FUNCTION(0, "GPIO7"), 105 + MTK_FUNCTION(1, "TP_GPIO7_AO"), 106 + MTK_FUNCTION(2, "EDP_TX_HPD"), 107 + MTK_FUNCTION(3, "I2SO1_D5"), 108 + MTK_FUNCTION(4, "URXD4"), 109 + MTK_FUNCTION(5, "CMVREF4"), 110 + MTK_FUNCTION(7, "DMIC3_DAT") 111 + ), 112 + MTK_PIN( 113 + 8, "GPIO8", 114 + MTK_EINT_FUNCTION(0, 8), 115 + DRV_GRP4, 116 + MTK_FUNCTION(0, "GPIO8"), 117 + MTK_FUNCTION(1, "SDA0"), 118 + MTK_FUNCTION(2, "PWM_0"), 119 + MTK_FUNCTION(4, "SPDIF_OUT"), 120 + MTK_FUNCTION(6, "LVTS_FOUT"), 121 + MTK_FUNCTION(7, "DBG_MON_A0") 122 + ), 123 + MTK_PIN( 124 + 9, "GPIO9", 125 + MTK_EINT_FUNCTION(0, 9), 126 + DRV_GRP4, 127 + MTK_FUNCTION(0, "GPIO9"), 128 + MTK_FUNCTION(1, "SCL0"), 129 + MTK_FUNCTION(2, "PWM_1"), 130 + MTK_FUNCTION(4, "IR_IN"), 131 + MTK_FUNCTION(6, "LVTS_SDO"), 132 + MTK_FUNCTION(7, "DBG_MON_A1") 133 + ), 134 + MTK_PIN( 135 + 10, "GPIO10", 136 + MTK_EINT_FUNCTION(0, 10), 137 + DRV_GRP4, 138 + MTK_FUNCTION(0, "GPIO10"), 139 + MTK_FUNCTION(1, "SDA1"), 140 + MTK_FUNCTION(2, "PWM_2"), 141 + MTK_FUNCTION(3, "ADSP_URXD0"), 142 + MTK_FUNCTION(4, "SPDIF_IN1"), 143 + MTK_FUNCTION(6, "LVTS_SCF"), 144 + MTK_FUNCTION(7, "DBG_MON_A2") 145 + ), 146 + MTK_PIN( 147 + 11, "GPIO11", 148 + MTK_EINT_FUNCTION(0, 11), 149 + DRV_GRP4, 150 + MTK_FUNCTION(0, "GPIO11"), 151 + MTK_FUNCTION(1, "SCL1"), 152 + MTK_FUNCTION(2, "PWM_3"), 153 + MTK_FUNCTION(3, "ADSP_UTXD0"), 154 + MTK_FUNCTION(4, "SPDIF_IN0"), 155 + MTK_FUNCTION(6, "LVTS_SCK"), 156 + MTK_FUNCTION(7, "DBG_MON_A3") 157 + ), 158 + MTK_PIN( 159 + 12, "GPIO12", 160 + MTK_EINT_FUNCTION(0, 12), 161 + DRV_GRP4, 162 + MTK_FUNCTION(0, "GPIO12"), 163 + MTK_FUNCTION(1, "SDA2"), 164 + MTK_FUNCTION(2, "DMIC3_DAT_R"), 165 + MTK_FUNCTION(3, "I2SO1_D6"), 166 + MTK_FUNCTION(6, "LVTS_SDI"), 167 + MTK_FUNCTION(7, "DBG_MON_A4") 168 + ), 169 + MTK_PIN( 170 + 13, "GPIO13", 171 + MTK_EINT_FUNCTION(0, 13), 172 + DRV_GRP4, 173 + MTK_FUNCTION(0, "GPIO13"), 174 + MTK_FUNCTION(1, "SCL2"), 175 + MTK_FUNCTION(2, "DMIC4_DAT_R"), 176 + MTK_FUNCTION(3, "I2SO1_D7"), 177 + MTK_FUNCTION(7, "DBG_MON_A5") 178 + ), 179 + MTK_PIN( 180 + 14, "GPIO14", 181 + MTK_EINT_FUNCTION(0, 14), 182 + DRV_GRP4, 183 + MTK_FUNCTION(0, "GPIO14"), 184 + MTK_FUNCTION(1, "SDA3"), 185 + MTK_FUNCTION(2, "DMIC3_DAT"), 186 + MTK_FUNCTION(3, "TDMIN_MCK"), 187 + MTK_FUNCTION(7, "DBG_MON_A6") 188 + ), 189 + MTK_PIN( 190 + 15, "GPIO15", 191 + MTK_EINT_FUNCTION(0, 15), 192 + DRV_GRP4, 193 + MTK_FUNCTION(0, "GPIO15"), 194 + MTK_FUNCTION(1, "SCL3"), 195 + MTK_FUNCTION(2, "DMIC3_CLK"), 196 + MTK_FUNCTION(3, "TDMIN_DI"), 197 + MTK_FUNCTION(7, "DBG_MON_A7") 198 + ), 199 + MTK_PIN( 200 + 16, "GPIO16", 201 + MTK_EINT_FUNCTION(0, 16), 202 + DRV_GRP4, 203 + MTK_FUNCTION(0, "GPIO16"), 204 + MTK_FUNCTION(1, "SDA4"), 205 + MTK_FUNCTION(2, "DMIC4_DAT"), 206 + MTK_FUNCTION(3, "TDMIN_LRCK"), 207 + MTK_FUNCTION(7, "DBG_MON_A8") 208 + ), 209 + MTK_PIN( 210 + 17, "GPIO17", 211 + MTK_EINT_FUNCTION(0, 17), 212 + DRV_GRP4, 213 + MTK_FUNCTION(0, "GPIO17"), 214 + MTK_FUNCTION(1, "SCL4"), 215 + MTK_FUNCTION(2, "DMIC4_CLK"), 216 + MTK_FUNCTION(3, "TDMIN_BCK"), 217 + MTK_FUNCTION(7, "DBG_MON_A9") 218 + ), 219 + MTK_PIN( 220 + 18, "GPIO18", 221 + MTK_EINT_FUNCTION(0, 18), 222 + DRV_GRP4, 223 + MTK_FUNCTION(0, "GPIO18"), 224 + MTK_FUNCTION(1, "DP_TX_HPD") 225 + ), 226 + MTK_PIN( 227 + 19, "GPIO19", 228 + MTK_EINT_FUNCTION(0, 19), 229 + DRV_GRP4, 230 + MTK_FUNCTION(0, "GPIO19"), 231 + MTK_FUNCTION(1, "WAKEN"), 232 + MTK_FUNCTION(2, "SCP_SDA1"), 233 + MTK_FUNCTION(3, "MD32_0_JTAG_TCK"), 234 + MTK_FUNCTION(4, "ADSP_JTAG0_TCK"), 235 + MTK_FUNCTION(5, "SDA6") 236 + ), 237 + MTK_PIN( 238 + 20, "GPIO20", 239 + MTK_EINT_FUNCTION(0, 20), 240 + DRV_GRP4, 241 + MTK_FUNCTION(0, "GPIO20"), 242 + MTK_FUNCTION(1, "PERSTN"), 243 + MTK_FUNCTION(2, "SCP_SCL1"), 244 + MTK_FUNCTION(3, "MD32_0_JTAG_TMS"), 245 + MTK_FUNCTION(4, "ADSP_JTAG0_TMS"), 246 + MTK_FUNCTION(5, "SCL6") 247 + ), 248 + MTK_PIN( 249 + 21, "GPIO21", 250 + MTK_EINT_FUNCTION(0, 21), 251 + DRV_GRP4, 252 + MTK_FUNCTION(0, "GPIO21"), 253 + MTK_FUNCTION(1, "CLKREQN"), 254 + MTK_FUNCTION(3, "MD32_0_JTAG_TDI"), 255 + MTK_FUNCTION(4, "ADSP_JTAG0_TDI"), 256 + MTK_FUNCTION(5, "SCP_SDA1") 257 + ), 258 + MTK_PIN( 259 + 22, "GPIO22", 260 + MTK_EINT_FUNCTION(0, 22), 261 + DRV_GRP4, 262 + MTK_FUNCTION(0, "GPIO22"), 263 + MTK_FUNCTION(1, "CMMCLK0"), 264 + MTK_FUNCTION(2, "PERSTN_1"), 265 + MTK_FUNCTION(5, "SCP_SCL1"), 266 + MTK_FUNCTION(7, "MD32_0_GPIO0") 267 + ), 268 + MTK_PIN( 269 + 23, "GPIO23", 270 + MTK_EINT_FUNCTION(0, 23), 271 + DRV_GRP4, 272 + MTK_FUNCTION(0, "GPIO23"), 273 + MTK_FUNCTION(1, "CMMCLK1"), 274 + MTK_FUNCTION(2, "CLKREQN_1"), 275 + MTK_FUNCTION(3, "SDA4"), 276 + MTK_FUNCTION(4, "DMIC1_CLK"), 277 + MTK_FUNCTION(5, "SCP_SDA0"), 278 + MTK_FUNCTION(7, "MD32_0_GPIO1") 279 + ), 280 + MTK_PIN( 281 + 24, "GPIO24", 282 + MTK_EINT_FUNCTION(0, 24), 283 + DRV_GRP4, 284 + MTK_FUNCTION(0, "GPIO24"), 285 + MTK_FUNCTION(1, "CMMCLK2"), 286 + MTK_FUNCTION(2, "WAKEN_1"), 287 + MTK_FUNCTION(3, "SCL4"), 288 + MTK_FUNCTION(4, "DMIC1_DAT"), 289 + MTK_FUNCTION(5, "SCP_SCL0"), 290 + MTK_FUNCTION(6, "LVTS_26M"), 291 + MTK_FUNCTION(7, "MD32_0_GPIO2") 292 + ), 293 + MTK_PIN( 294 + 25, "GPIO25", 295 + MTK_EINT_FUNCTION(0, 25), 296 + DRV_GRP4, 297 + MTK_FUNCTION(0, "GPIO25"), 298 + MTK_FUNCTION(1, "CMMRST"), 299 + MTK_FUNCTION(2, "CMMCLK3"), 300 + MTK_FUNCTION(3, "SPDIF_OUT"), 301 + MTK_FUNCTION(4, "SDA6"), 302 + MTK_FUNCTION(5, "ADSP_JTAG0_TRSTN"), 303 + MTK_FUNCTION(6, "MD32_0_JTAG_TRST") 304 + ), 305 + MTK_PIN( 306 + 26, "GPIO26", 307 + MTK_EINT_FUNCTION(0, 26), 308 + DRV_GRP4, 309 + MTK_FUNCTION(0, "GPIO26"), 310 + MTK_FUNCTION(1, "CMMPDN"), 311 + MTK_FUNCTION(2, "CMMCLK4"), 312 + MTK_FUNCTION(3, "IR_IN"), 313 + MTK_FUNCTION(4, "SCL6"), 314 + MTK_FUNCTION(5, "ADSP_JTAG0_TDO"), 315 + MTK_FUNCTION(6, "MD32_0_JTAG_TDO") 316 + ), 317 + MTK_PIN( 318 + 27, "GPIO27", 319 + MTK_EINT_FUNCTION(0, 27), 320 + DRV_GRP4, 321 + MTK_FUNCTION(0, "GPIO27"), 322 + MTK_FUNCTION(1, "HDMIRX20_HTPLG"), 323 + MTK_FUNCTION(2, "CMFLASH0"), 324 + MTK_FUNCTION(3, "MD32_0_TXD"), 325 + MTK_FUNCTION(4, "TP_UTXD2_AO"), 326 + MTK_FUNCTION(5, "SCL7"), 327 + MTK_FUNCTION(6, "UCTS2"), 328 + MTK_FUNCTION(7, "DBG_MON_A18") 329 + ), 330 + MTK_PIN( 331 + 28, "GPIO28", 332 + MTK_EINT_FUNCTION(0, 28), 333 + DRV_GRP4, 334 + MTK_FUNCTION(0, "GPIO28"), 335 + MTK_FUNCTION(1, "HDMIRX20_PWR5V"), 336 + MTK_FUNCTION(2, "CMFLASH1"), 337 + MTK_FUNCTION(3, "MD32_0_RXD"), 338 + MTK_FUNCTION(4, "TP_URXD2_AO"), 339 + MTK_FUNCTION(5, "SDA7"), 340 + MTK_FUNCTION(6, "URTS2"), 341 + MTK_FUNCTION(7, "DBG_MON_A19") 342 + ), 343 + MTK_PIN( 344 + 29, "GPIO29", 345 + MTK_EINT_FUNCTION(0, 29), 346 + DRV_GRP4, 347 + MTK_FUNCTION(0, "GPIO29"), 348 + MTK_FUNCTION(1, "HDMIRX20_SCL"), 349 + MTK_FUNCTION(2, "CMFLASH2"), 350 + MTK_FUNCTION(3, "SCL5"), 351 + MTK_FUNCTION(4, "TP_URTS2_AO"), 352 + MTK_FUNCTION(6, "UTXD2"), 353 + MTK_FUNCTION(7, "DBG_MON_A20") 354 + ), 355 + MTK_PIN( 356 + 30, "GPIO30", 357 + MTK_EINT_FUNCTION(0, 30), 358 + DRV_GRP4, 359 + MTK_FUNCTION(0, "GPIO30"), 360 + MTK_FUNCTION(1, "HDMIRX20_SDA"), 361 + MTK_FUNCTION(2, "CMFLASH3"), 362 + MTK_FUNCTION(3, "SDA5"), 363 + MTK_FUNCTION(4, "TP_UCTS2_AO"), 364 + MTK_FUNCTION(6, "URXD2"), 365 + MTK_FUNCTION(7, "DBG_MON_A21") 366 + ), 367 + MTK_PIN( 368 + 31, "GPIO31", 369 + MTK_EINT_FUNCTION(0, 31), 370 + DRV_GRP4, 371 + MTK_FUNCTION(0, "GPIO31"), 372 + MTK_FUNCTION(1, "HDMITX20_PWR5V"), 373 + MTK_FUNCTION(2, "DMIC1_DAT_R"), 374 + MTK_FUNCTION(3, "PERSTN"), 375 + MTK_FUNCTION(7, "DBG_MON_A22") 376 + ), 377 + MTK_PIN( 378 + 32, "GPIO32", 379 + MTK_EINT_FUNCTION(0, 32), 380 + DRV_GRP4, 381 + MTK_FUNCTION(0, "GPIO32"), 382 + MTK_FUNCTION(1, "HDMITX20_HTPLG"), 383 + MTK_FUNCTION(3, "CLKREQN"), 384 + MTK_FUNCTION(7, "DBG_MON_A23") 385 + ), 386 + MTK_PIN( 387 + 33, "GPIO33", 388 + MTK_EINT_FUNCTION(0, 33), 389 + DRV_GRP4, 390 + MTK_FUNCTION(0, "GPIO33"), 391 + MTK_FUNCTION(1, "HDMITX20_CEC"), 392 + MTK_FUNCTION(2, "CMVREF0"), 393 + MTK_FUNCTION(3, "WAKEN") 394 + ), 395 + MTK_PIN( 396 + 34, "GPIO34", 397 + MTK_EINT_FUNCTION(0, 34), 398 + DRV_GRP4, 399 + MTK_FUNCTION(0, "GPIO34"), 400 + MTK_FUNCTION(1, "HDMITX20_SCL"), 401 + MTK_FUNCTION(2, "CMVREF1"), 402 + MTK_FUNCTION(3, "SCL7"), 403 + MTK_FUNCTION(4, "SCL6"), 404 + MTK_FUNCTION(7, "DBG_MON_A24") 405 + ), 406 + MTK_PIN( 407 + 35, "GPIO35", 408 + MTK_EINT_FUNCTION(0, 35), 409 + DRV_GRP4, 410 + MTK_FUNCTION(0, "GPIO35"), 411 + MTK_FUNCTION(1, "HDMITX20_SDA"), 412 + MTK_FUNCTION(2, "CMVREF2"), 413 + MTK_FUNCTION(3, "SDA7"), 414 + MTK_FUNCTION(4, "SDA6"), 415 + MTK_FUNCTION(7, "DBG_MON_A25") 416 + ), 417 + MTK_PIN( 418 + 36, "GPIO36", 419 + MTK_EINT_FUNCTION(0, 36), 420 + DRV_GRP4, 421 + MTK_FUNCTION(0, "GPIO36"), 422 + MTK_FUNCTION(1, "RTC32K_CK"), 423 + MTK_FUNCTION(7, "DBG_MON_A27") 424 + ), 425 + MTK_PIN( 426 + 37, "GPIO37", 427 + MTK_EINT_FUNCTION(0, 37), 428 + DRV_GRP4, 429 + MTK_FUNCTION(0, "GPIO37"), 430 + MTK_FUNCTION(1, "WATCHDOG"), 431 + MTK_FUNCTION(7, "DBG_MON_A28") 432 + ), 433 + MTK_PIN( 434 + 38, "GPIO38", 435 + MTK_EINT_FUNCTION(0, 38), 436 + DRV_GRP4, 437 + MTK_FUNCTION(0, "GPIO38"), 438 + MTK_FUNCTION(1, "SRCLKENA0"), 439 + MTK_FUNCTION(7, "DBG_MON_A29") 440 + ), 441 + MTK_PIN( 442 + 39, "GPIO39", 443 + MTK_EINT_FUNCTION(0, 39), 444 + DRV_GRP4, 445 + MTK_FUNCTION(0, "GPIO39"), 446 + MTK_FUNCTION(1, "SRCLKENA1"), 447 + MTK_FUNCTION(2, "DMIC2_DAT_R"), 448 + MTK_FUNCTION(7, "DBG_MON_A30") 449 + ), 450 + MTK_PIN( 451 + 40, "GPIO40", 452 + MTK_EINT_FUNCTION(0, 40), 453 + DRV_GRP4, 454 + MTK_FUNCTION(0, "GPIO40"), 455 + MTK_FUNCTION(1, "PWRAP_SPI0_CSN"), 456 + MTK_FUNCTION(3, "SPIM3_CSB"), 457 + MTK_FUNCTION(7, "DBG_MON_A31") 458 + ), 459 + MTK_PIN( 460 + 41, "GPIO41", 461 + MTK_EINT_FUNCTION(0, 41), 462 + DRV_GRP4, 463 + MTK_FUNCTION(0, "GPIO41"), 464 + MTK_FUNCTION(1, "PWRAP_SPI0_CK"), 465 + MTK_FUNCTION(3, "SPIM3_CLK"), 466 + MTK_FUNCTION(7, "DBG_MON_A32") 467 + ), 468 + MTK_PIN( 469 + 42, "GPIO42", 470 + MTK_EINT_FUNCTION(0, 42), 471 + DRV_GRP4, 472 + MTK_FUNCTION(0, "GPIO42"), 473 + MTK_FUNCTION(1, "PWRAP_SPI0_MO"), 474 + MTK_FUNCTION(2, "PWRAP_SPI0_MI"), 475 + MTK_FUNCTION(3, "SPIM3_MO"), 476 + MTK_FUNCTION(7, "DBG_MON_B0") 477 + ), 478 + MTK_PIN( 479 + 43, "GPIO43", 480 + MTK_EINT_FUNCTION(0, 43), 481 + DRV_GRP4, 482 + MTK_FUNCTION(0, "GPIO43"), 483 + MTK_FUNCTION(1, "PWRAP_SPI0_MI"), 484 + MTK_FUNCTION(2, "PWRAP_SPI0_MO"), 485 + MTK_FUNCTION(3, "SPIM3_MI"), 486 + MTK_FUNCTION(7, "DBG_MON_B1") 487 + ), 488 + MTK_PIN( 489 + 44, "GPIO44", 490 + MTK_EINT_FUNCTION(0, 44), 491 + DRV_GRP4, 492 + MTK_FUNCTION(0, "GPIO44"), 493 + MTK_FUNCTION(1, "SPMI_M_SCL"), 494 + MTK_FUNCTION(2, "I2SI00_DATA1"), 495 + MTK_FUNCTION(3, "SCL5"), 496 + MTK_FUNCTION(4, "UTXD5"), 497 + MTK_FUNCTION(7, "DBG_MON_B2") 498 + ), 499 + MTK_PIN( 500 + 45, "GPIO45", 501 + MTK_EINT_FUNCTION(0, 45), 502 + DRV_GRP4, 503 + MTK_FUNCTION(0, "GPIO45"), 504 + MTK_FUNCTION(1, "SPMI_M_SDA"), 505 + MTK_FUNCTION(2, "I2SI00_DATA2"), 506 + MTK_FUNCTION(3, "SDA5"), 507 + MTK_FUNCTION(4, "URXD5"), 508 + MTK_FUNCTION(7, "DBG_MON_B3") 509 + ), 510 + MTK_PIN( 511 + 46, "GPIO46", 512 + MTK_EINT_FUNCTION(0, 46), 513 + DRV_GRP4, 514 + MTK_FUNCTION(0, "GPIO46"), 515 + MTK_FUNCTION(1, "I2SIN_MCK"), 516 + MTK_FUNCTION(2, "I2SI00_DATA3"), 517 + MTK_FUNCTION(3, "SPLIN_MCK"), 518 + MTK_FUNCTION(7, "DBG_MON_B4") 519 + ), 520 + MTK_PIN( 521 + 47, "GPIO47", 522 + MTK_EINT_FUNCTION(0, 47), 523 + DRV_GRP4, 524 + MTK_FUNCTION(0, "GPIO47"), 525 + MTK_FUNCTION(1, "I2SIN_BCK"), 526 + MTK_FUNCTION(2, "I2SIN0_BCK"), 527 + MTK_FUNCTION(3, "SPLIN_LRCK"), 528 + MTK_FUNCTION(7, "DBG_MON_B5") 529 + ), 530 + MTK_PIN( 531 + 48, "GPIO48", 532 + MTK_EINT_FUNCTION(0, 48), 533 + DRV_GRP4, 534 + MTK_FUNCTION(0, "GPIO48"), 535 + MTK_FUNCTION(1, "I2SIN_WS"), 536 + MTK_FUNCTION(2, "I2SIN0_LRCK"), 537 + MTK_FUNCTION(3, "SPLIN_BCK"), 538 + MTK_FUNCTION(7, "DBG_MON_B6") 539 + ), 540 + MTK_PIN( 541 + 49, "GPIO49", 542 + MTK_EINT_FUNCTION(0, 49), 543 + DRV_GRP4, 544 + MTK_FUNCTION(0, "GPIO49"), 545 + MTK_FUNCTION(1, "I2SIN_D0"), 546 + MTK_FUNCTION(2, "I2SI00_DATA0"), 547 + MTK_FUNCTION(3, "SPLIN_D0"), 548 + MTK_FUNCTION(7, "DBG_MON_B7") 549 + ), 550 + MTK_PIN( 551 + 50, "GPIO50", 552 + MTK_EINT_FUNCTION(0, 50), 553 + DRV_GRP4, 554 + MTK_FUNCTION(0, "GPIO50"), 555 + MTK_FUNCTION(1, "I2SO1_MCK"), 556 + MTK_FUNCTION(2, "I2SI5_D0"), 557 + MTK_FUNCTION(4, "I2SO4_MCK"), 558 + MTK_FUNCTION(7, "DBG_MON_B8") 559 + ), 560 + MTK_PIN( 561 + 51, "GPIO51", 562 + MTK_EINT_FUNCTION(0, 51), 563 + DRV_GRP4, 564 + MTK_FUNCTION(0, "GPIO51"), 565 + MTK_FUNCTION(1, "I2SO1_BCK"), 566 + MTK_FUNCTION(2, "I2SI5_BCK"), 567 + MTK_FUNCTION(7, "DBG_MON_B9") 568 + ), 569 + MTK_PIN( 570 + 52, "GPIO52", 571 + MTK_EINT_FUNCTION(0, 52), 572 + DRV_GRP4, 573 + MTK_FUNCTION(0, "GPIO52"), 574 + MTK_FUNCTION(1, "I2SO1_WS"), 575 + MTK_FUNCTION(2, "I2SI5_WS"), 576 + MTK_FUNCTION(7, "DBG_MON_B10") 577 + ), 578 + MTK_PIN( 579 + 53, "GPIO53", 580 + MTK_EINT_FUNCTION(0, 53), 581 + DRV_GRP4, 582 + MTK_FUNCTION(0, "GPIO53"), 583 + MTK_FUNCTION(1, "I2SO1_D0"), 584 + MTK_FUNCTION(2, "I2SI5_MCK"), 585 + MTK_FUNCTION(7, "DBG_MON_B11") 586 + ), 587 + MTK_PIN( 588 + 54, "GPIO54", 589 + MTK_EINT_FUNCTION(0, 54), 590 + DRV_GRP4, 591 + MTK_FUNCTION(0, "GPIO54"), 592 + MTK_FUNCTION(1, "I2SO1_D1"), 593 + MTK_FUNCTION(2, "I2SI01_DATA1"), 594 + MTK_FUNCTION(3, "SPLIN_D1"), 595 + MTK_FUNCTION(4, "I2SO4_BCK"), 596 + MTK_FUNCTION(7, "DBG_MON_B12") 597 + ), 598 + MTK_PIN( 599 + 55, "GPIO55", 600 + MTK_EINT_FUNCTION(0, 55), 601 + DRV_GRP4, 602 + MTK_FUNCTION(0, "GPIO55"), 603 + MTK_FUNCTION(1, "I2SO1_D2"), 604 + MTK_FUNCTION(2, "I2SI01_DATA2"), 605 + MTK_FUNCTION(3, "SPLIN_D2"), 606 + MTK_FUNCTION(4, "I2SO4_WS"), 607 + MTK_FUNCTION(7, "DBG_MON_B13") 608 + ), 609 + MTK_PIN( 610 + 56, "GPIO56", 611 + MTK_EINT_FUNCTION(0, 56), 612 + DRV_GRP4, 613 + MTK_FUNCTION(0, "GPIO56"), 614 + MTK_FUNCTION(1, "I2SO1_D3"), 615 + MTK_FUNCTION(2, "I2SI01_DATA3"), 616 + MTK_FUNCTION(3, "SPLIN_D3"), 617 + MTK_FUNCTION(4, "I2SO4_D0"), 618 + MTK_FUNCTION(7, "DBG_MON_B14") 619 + ), 620 + MTK_PIN( 621 + 57, "GPIO57", 622 + MTK_EINT_FUNCTION(0, 57), 623 + DRV_GRP4, 624 + MTK_FUNCTION(0, "GPIO57"), 625 + MTK_FUNCTION(1, "I2SO2_MCK"), 626 + MTK_FUNCTION(2, "I2SO1_D12"), 627 + MTK_FUNCTION(3, "LCM1_RST"), 628 + MTK_FUNCTION(7, "DBG_MON_B15") 629 + ), 630 + MTK_PIN( 631 + 58, "GPIO58", 632 + MTK_EINT_FUNCTION(0, 58), 633 + DRV_GRP4, 634 + MTK_FUNCTION(0, "GPIO58"), 635 + MTK_FUNCTION(1, "I2SO2_BCK"), 636 + MTK_FUNCTION(2, "I2SO1_D13"), 637 + MTK_FUNCTION(3, "I2SIN1_BCK"), 638 + MTK_FUNCTION(7, "DBG_MON_B16") 639 + ), 640 + MTK_PIN( 641 + 59, "GPIO59", 642 + MTK_EINT_FUNCTION(0, 59), 643 + DRV_GRP4, 644 + MTK_FUNCTION(0, "GPIO59"), 645 + MTK_FUNCTION(1, "I2SO2_WS"), 646 + MTK_FUNCTION(2, "I2SO1_D14"), 647 + MTK_FUNCTION(3, "I2SIN1_LRCK"), 648 + MTK_FUNCTION(7, "DBG_MON_B17") 649 + ), 650 + MTK_PIN( 651 + 60, "GPIO60", 652 + MTK_EINT_FUNCTION(0, 60), 653 + DRV_GRP4, 654 + MTK_FUNCTION(0, "GPIO60"), 655 + MTK_FUNCTION(1, "I2SO2_D0"), 656 + MTK_FUNCTION(2, "I2SO1_D15"), 657 + MTK_FUNCTION(3, "I2SI01_DATA0"), 658 + MTK_FUNCTION(7, "DBG_MON_B18") 659 + ), 660 + MTK_PIN( 661 + 61, "GPIO61", 662 + MTK_EINT_FUNCTION(0, 61), 663 + DRV_GRP4, 664 + MTK_FUNCTION(0, "GPIO61"), 665 + MTK_FUNCTION(1, "DMIC1_CLK"), 666 + MTK_FUNCTION(2, "I2SO2_BCK"), 667 + MTK_FUNCTION(3, "SCP_SPI2_CK"), 668 + MTK_FUNCTION(7, "DBG_MON_B19") 669 + ), 670 + MTK_PIN( 671 + 62, "GPIO62", 672 + MTK_EINT_FUNCTION(0, 62), 673 + DRV_GRP4, 674 + MTK_FUNCTION(0, "GPIO62"), 675 + MTK_FUNCTION(1, "DMIC1_DAT"), 676 + MTK_FUNCTION(2, "I2SO2_WS"), 677 + MTK_FUNCTION(3, "SCP_SPI2_MI"), 678 + MTK_FUNCTION(7, "DBG_MON_B20") 679 + ), 680 + MTK_PIN( 681 + 63, "GPIO63", 682 + MTK_EINT_FUNCTION(0, 63), 683 + DRV_GRP4, 684 + MTK_FUNCTION(0, "GPIO63"), 685 + MTK_FUNCTION(1, "DMIC2_CLK"), 686 + MTK_FUNCTION(2, "VBUSVALID"), 687 + MTK_FUNCTION(3, "SCP_SPI2_MO"), 688 + MTK_FUNCTION(4, "SCP_SCL2"), 689 + MTK_FUNCTION(5, "SCP_JTAG1_TDO"), 690 + MTK_FUNCTION(6, "JTDO_SEL1"), 691 + MTK_FUNCTION(7, "DBG_MON_B21") 692 + ), 693 + MTK_PIN( 694 + 64, "GPIO64", 695 + MTK_EINT_FUNCTION(0, 64), 696 + DRV_GRP4, 697 + MTK_FUNCTION(0, "GPIO64"), 698 + MTK_FUNCTION(1, "DMIC2_DAT"), 699 + MTK_FUNCTION(2, "VBUSVALID_1P"), 700 + MTK_FUNCTION(3, "SCP_SPI2_CS"), 701 + MTK_FUNCTION(4, "SCP_SDA2"), 702 + MTK_FUNCTION(7, "DBG_MON_B22") 703 + ), 704 + MTK_PIN( 705 + 65, "GPIO65", 706 + MTK_EINT_FUNCTION(0, 65), 707 + DRV_GRP4, 708 + MTK_FUNCTION(0, "GPIO65"), 709 + MTK_FUNCTION(1, "PCM_DO"), 710 + MTK_FUNCTION(2, "AUXIF_ST0"), 711 + MTK_FUNCTION(3, "UCTS2"), 712 + MTK_FUNCTION(5, "SCP_JTAG1_TMS"), 713 + MTK_FUNCTION(6, "JTMS_SEL1"), 714 + MTK_FUNCTION(7, "DBG_MON_B23") 715 + ), 716 + MTK_PIN( 717 + 66, "GPIO66", 718 + MTK_EINT_FUNCTION(0, 66), 719 + DRV_GRP4, 720 + MTK_FUNCTION(0, "GPIO66"), 721 + MTK_FUNCTION(1, "PCM_CLK"), 722 + MTK_FUNCTION(2, "AUXIF_CLK0"), 723 + MTK_FUNCTION(3, "URTS2"), 724 + MTK_FUNCTION(5, "SCP_JTAG1_TCK"), 725 + MTK_FUNCTION(6, "JTCK_SEL1"), 726 + MTK_FUNCTION(7, "DBG_MON_B24") 727 + ), 728 + MTK_PIN( 729 + 67, "GPIO67", 730 + MTK_EINT_FUNCTION(0, 67), 731 + DRV_GRP4, 732 + MTK_FUNCTION(0, "GPIO67"), 733 + MTK_FUNCTION(1, "PCM_DI"), 734 + MTK_FUNCTION(2, "AUXIF_ST1"), 735 + MTK_FUNCTION(3, "UTXD2"), 736 + MTK_FUNCTION(5, "SCP_JTAG1_TRSTN"), 737 + MTK_FUNCTION(6, "JTRSTn_SEL1"), 738 + MTK_FUNCTION(7, "DBG_MON_B25") 739 + ), 740 + MTK_PIN( 741 + 68, "GPIO68", 742 + MTK_EINT_FUNCTION(0, 68), 743 + DRV_GRP4, 744 + MTK_FUNCTION(0, "GPIO68"), 745 + MTK_FUNCTION(1, "PCM_SYNC"), 746 + MTK_FUNCTION(2, "AUXIF_CLK1"), 747 + MTK_FUNCTION(3, "URXD2"), 748 + MTK_FUNCTION(5, "SCP_JTAG1_TDI"), 749 + MTK_FUNCTION(6, "JTDI_SEL1"), 750 + MTK_FUNCTION(7, "DBG_MON_B26") 751 + ), 752 + MTK_PIN( 753 + 69, "GPIO69", 754 + MTK_EINT_FUNCTION(0, 69), 755 + DRV_GRP4, 756 + MTK_FUNCTION(0, "GPIO69"), 757 + MTK_FUNCTION(1, "AUD_CLK_MOSI"), 758 + MTK_FUNCTION(2, "I2SIN2_BCK"), 759 + MTK_FUNCTION(3, "PWM_0"), 760 + MTK_FUNCTION(4, "WAKEN"), 761 + MTK_FUNCTION(7, "DBG_MON_B27") 762 + ), 763 + MTK_PIN( 764 + 70, "GPIO70", 765 + MTK_EINT_FUNCTION(0, 70), 766 + DRV_GRP4, 767 + MTK_FUNCTION(0, "GPIO70"), 768 + MTK_FUNCTION(1, "AUD_SYNC_MOSI"), 769 + MTK_FUNCTION(2, "I2SIN2_LRCK"), 770 + MTK_FUNCTION(3, "PWM_1"), 771 + MTK_FUNCTION(4, "PERSTN"), 772 + MTK_FUNCTION(7, "DBG_MON_B28") 773 + ), 774 + MTK_PIN( 775 + 71, "GPIO71", 776 + MTK_EINT_FUNCTION(0, 71), 777 + DRV_GRP4, 778 + MTK_FUNCTION(0, "GPIO71"), 779 + MTK_FUNCTION(1, "AUD_DAT_MOSI0"), 780 + MTK_FUNCTION(2, "IDDIG_2P"), 781 + MTK_FUNCTION(3, "PWM_2"), 782 + MTK_FUNCTION(4, "CLKREQN"), 783 + MTK_FUNCTION(7, "DBG_MON_B29") 784 + ), 785 + MTK_PIN( 786 + 72, "GPIO72", 787 + MTK_EINT_FUNCTION(0, 72), 788 + DRV_GRP4, 789 + MTK_FUNCTION(0, "GPIO72"), 790 + MTK_FUNCTION(1, "AUD_DAT_MOSI1"), 791 + MTK_FUNCTION(2, "USB_DRVVBUS_2P"), 792 + MTK_FUNCTION(3, "PWM_3"), 793 + MTK_FUNCTION(4, "PERSTN_1"), 794 + MTK_FUNCTION(7, "DBG_MON_B30") 795 + ), 796 + MTK_PIN( 797 + 73, "GPIO73", 798 + MTK_EINT_FUNCTION(0, 73), 799 + DRV_GRP4, 800 + MTK_FUNCTION(0, "GPIO73"), 801 + MTK_FUNCTION(1, "AUD_DAT_MISO0"), 802 + MTK_FUNCTION(2, "I2SI02_DATA0"), 803 + MTK_FUNCTION(4, "CLKREQN_1"), 804 + MTK_FUNCTION(5, "VOW_DAT_MISO"), 805 + MTK_FUNCTION(7, "DBG_MON_B31") 806 + ), 807 + MTK_PIN( 808 + 74, "GPIO74", 809 + MTK_EINT_FUNCTION(0, 74), 810 + DRV_GRP4, 811 + MTK_FUNCTION(0, "GPIO74"), 812 + MTK_FUNCTION(1, "AUD_DAT_MISO1"), 813 + MTK_FUNCTION(2, "I2SI02_DATA1"), 814 + MTK_FUNCTION(4, "WAKEN_1"), 815 + MTK_FUNCTION(5, "VOW_CLK_MISO"), 816 + MTK_FUNCTION(7, "DBG_MON_B32") 817 + ), 818 + MTK_PIN( 819 + 75, "GPIO75", 820 + MTK_EINT_FUNCTION(0, 75), 821 + DRV_GRP4, 822 + MTK_FUNCTION(0, "GPIO75"), 823 + MTK_FUNCTION(1, "AUD_DAT_MISO2"), 824 + MTK_FUNCTION(2, "I2SI02_DATA2") 825 + ), 826 + MTK_PIN( 827 + 76, "GPIO76", 828 + MTK_EINT_FUNCTION(0, 76), 829 + DRV_GRP4, 830 + MTK_FUNCTION(0, "GPIO76"), 831 + MTK_FUNCTION(1, "SCP_VREQ_VAO"), 832 + MTK_FUNCTION(2, "I2SI02_DATA3"), 833 + MTK_FUNCTION(7, "DBG_MON_A26") 834 + ), 835 + MTK_PIN( 836 + 77, "GPIO77", 837 + MTK_EINT_FUNCTION(0, 77), 838 + DRV_GRP4, 839 + MTK_FUNCTION(0, "GPIO77"), 840 + MTK_FUNCTION(1, "DGI_D0"), 841 + MTK_FUNCTION(2, "DPI_D0"), 842 + MTK_FUNCTION(3, "I2SI4_MCK"), 843 + MTK_FUNCTION(4, "SPIM4_CLK"), 844 + MTK_FUNCTION(5, "GBE_TXD3"), 845 + MTK_FUNCTION(6, "SPM_JTAG_TCK") 846 + ), 847 + MTK_PIN( 848 + 78, "GPIO78", 849 + MTK_EINT_FUNCTION(0, 78), 850 + DRV_GRP4, 851 + MTK_FUNCTION(0, "GPIO78"), 852 + MTK_FUNCTION(1, "DGI_D1"), 853 + MTK_FUNCTION(2, "DPI_D1"), 854 + MTK_FUNCTION(3, "I2SI4_BCK"), 855 + MTK_FUNCTION(4, "SPIM4_MO"), 856 + MTK_FUNCTION(5, "GBE_TXD2"), 857 + MTK_FUNCTION(6, "SPM_JTAG_TMS") 858 + ), 859 + MTK_PIN( 860 + 79, "GPIO79", 861 + MTK_EINT_FUNCTION(0, 79), 862 + DRV_GRP4, 863 + MTK_FUNCTION(0, "GPIO79"), 864 + MTK_FUNCTION(1, "DGI_D2"), 865 + MTK_FUNCTION(2, "DPI_D2"), 866 + MTK_FUNCTION(3, "I2SI4_WS"), 867 + MTK_FUNCTION(4, "SPIM4_CSB"), 868 + MTK_FUNCTION(5, "GBE_TXD1"), 869 + MTK_FUNCTION(6, "SPM_JTAG_TDI") 870 + ), 871 + MTK_PIN( 872 + 80, "GPIO80", 873 + MTK_EINT_FUNCTION(0, 80), 874 + DRV_GRP4, 875 + MTK_FUNCTION(0, "GPIO80"), 876 + MTK_FUNCTION(1, "DGI_D3"), 877 + MTK_FUNCTION(2, "DPI_D3"), 878 + MTK_FUNCTION(3, "I2SI4_D0"), 879 + MTK_FUNCTION(4, "SPIM4_MI"), 880 + MTK_FUNCTION(5, "GBE_TXD0"), 881 + MTK_FUNCTION(6, "SPM_JTAG_TDO") 882 + ), 883 + MTK_PIN( 884 + 81, "GPIO81", 885 + MTK_EINT_FUNCTION(0, 81), 886 + DRV_GRP4, 887 + MTK_FUNCTION(0, "GPIO81"), 888 + MTK_FUNCTION(1, "DGI_D4"), 889 + MTK_FUNCTION(2, "DPI_D4"), 890 + MTK_FUNCTION(3, "I2SI5_MCK"), 891 + MTK_FUNCTION(4, "SPIM5_CLK"), 892 + MTK_FUNCTION(5, "GBE_RXD3"), 893 + MTK_FUNCTION(6, "SPM_JTAG_TRSTN") 894 + ), 895 + MTK_PIN( 896 + 82, "GPIO82", 897 + MTK_EINT_FUNCTION(0, 82), 898 + DRV_GRP4, 899 + MTK_FUNCTION(0, "GPIO82"), 900 + MTK_FUNCTION(1, "DGI_D5"), 901 + MTK_FUNCTION(2, "DPI_D5"), 902 + MTK_FUNCTION(3, "I2SI5_BCK"), 903 + MTK_FUNCTION(4, "SPIM5_MO"), 904 + MTK_FUNCTION(5, "GBE_RXD2"), 905 + MTK_FUNCTION(6, "MCUPM_JTAG_TDO") 906 + ), 907 + MTK_PIN( 908 + 83, "GPIO83", 909 + MTK_EINT_FUNCTION(0, 83), 910 + DRV_GRP4, 911 + MTK_FUNCTION(0, "GPIO83"), 912 + MTK_FUNCTION(1, "DGI_D6"), 913 + MTK_FUNCTION(2, "DPI_D6"), 914 + MTK_FUNCTION(3, "I2SI5_WS"), 915 + MTK_FUNCTION(4, "SPIM5_CSB"), 916 + MTK_FUNCTION(5, "GBE_RXD1"), 917 + MTK_FUNCTION(6, "MCUPM_JTAG_TMS") 918 + ), 919 + MTK_PIN( 920 + 84, "GPIO84", 921 + MTK_EINT_FUNCTION(0, 84), 922 + DRV_GRP4, 923 + MTK_FUNCTION(0, "GPIO84"), 924 + MTK_FUNCTION(1, "DGI_D7"), 925 + MTK_FUNCTION(2, "DPI_D7"), 926 + MTK_FUNCTION(3, "I2SI5_D0"), 927 + MTK_FUNCTION(4, "SPIM5_MI"), 928 + MTK_FUNCTION(5, "GBE_RXD0"), 929 + MTK_FUNCTION(6, "MCUPM_JTAG_TCK") 930 + ), 931 + MTK_PIN( 932 + 85, "GPIO85", 933 + MTK_EINT_FUNCTION(0, 85), 934 + DRV_GRP4, 935 + MTK_FUNCTION(0, "GPIO85"), 936 + MTK_FUNCTION(1, "DGI_D8"), 937 + MTK_FUNCTION(2, "DPI_D8"), 938 + MTK_FUNCTION(3, "I2SO4_MCK"), 939 + MTK_FUNCTION(4, "SCP_SPI1_B_CK"), 940 + MTK_FUNCTION(5, "GBE_TXC"), 941 + MTK_FUNCTION(6, "MCUPM_JTAG_TDI") 942 + ), 943 + MTK_PIN( 944 + 86, "GPIO86", 945 + MTK_EINT_FUNCTION(0, 86), 946 + DRV_GRP4, 947 + MTK_FUNCTION(0, "GPIO86"), 948 + MTK_FUNCTION(1, "DGI_D9"), 949 + MTK_FUNCTION(2, "DPI_D9"), 950 + MTK_FUNCTION(3, "I2SO4_BCK"), 951 + MTK_FUNCTION(4, "SCP_SPI1_B_MI"), 952 + MTK_FUNCTION(5, "GBE_RXC"), 953 + MTK_FUNCTION(6, "MCUPM_JTAG_TRSTN") 954 + ), 955 + MTK_PIN( 956 + 87, "GPIO87", 957 + MTK_EINT_FUNCTION(0, 87), 958 + DRV_GRP4, 959 + MTK_FUNCTION(0, "GPIO87"), 960 + MTK_FUNCTION(1, "DGI_D10"), 961 + MTK_FUNCTION(2, "DPI_D10"), 962 + MTK_FUNCTION(3, "I2SO4_WS"), 963 + MTK_FUNCTION(4, "SCP_SPI1_B_CS"), 964 + MTK_FUNCTION(5, "GBE_RXDV"), 965 + MTK_FUNCTION(6, "SSPM_JTAG_TDO") 966 + ), 967 + MTK_PIN( 968 + 88, "GPIO88", 969 + MTK_EINT_FUNCTION(0, 88), 970 + DRV_GRP4, 971 + MTK_FUNCTION(0, "GPIO88"), 972 + MTK_FUNCTION(1, "DGI_D11"), 973 + MTK_FUNCTION(2, "DPI_D11"), 974 + MTK_FUNCTION(3, "I2SO4_D0"), 975 + MTK_FUNCTION(4, "SCP_SPI1_B_MO"), 976 + MTK_FUNCTION(5, "GBE_TXEN"), 977 + MTK_FUNCTION(6, "SSPM_JTAG_TMS") 978 + ), 979 + MTK_PIN( 980 + 89, "GPIO89", 981 + MTK_EINT_FUNCTION(0, 89), 982 + DRV_GRP4, 983 + MTK_FUNCTION(0, "GPIO89"), 984 + MTK_FUNCTION(1, "DGI_D12"), 985 + MTK_FUNCTION(2, "DPI_D12"), 986 + MTK_FUNCTION(3, "MSDC2_CMD_A"), 987 + MTK_FUNCTION(4, "I2SO5_BCK"), 988 + MTK_FUNCTION(5, "GBE_MDC"), 989 + MTK_FUNCTION(6, "SSPM_JTAG_TCK") 990 + ), 991 + MTK_PIN( 992 + 90, "GPIO90", 993 + MTK_EINT_FUNCTION(0, 90), 994 + DRV_GRP4, 995 + MTK_FUNCTION(0, "GPIO90"), 996 + MTK_FUNCTION(1, "DGI_D13"), 997 + MTK_FUNCTION(2, "DPI_D13"), 998 + MTK_FUNCTION(3, "MSDC2_CLK_A"), 999 + MTK_FUNCTION(4, "I2SO5_WS"), 1000 + MTK_FUNCTION(5, "GBE_MDIO"), 1001 + MTK_FUNCTION(6, "SSPM_JTAG_TDI") 1002 + ), 1003 + MTK_PIN( 1004 + 91, "GPIO91", 1005 + MTK_EINT_FUNCTION(0, 91), 1006 + DRV_GRP4, 1007 + MTK_FUNCTION(0, "GPIO91"), 1008 + MTK_FUNCTION(1, "DGI_D14"), 1009 + MTK_FUNCTION(2, "DPI_D14"), 1010 + MTK_FUNCTION(3, "MSDC2_DAT3_A"), 1011 + MTK_FUNCTION(4, "I2SO5_D0"), 1012 + MTK_FUNCTION(5, "GBE_TXER"), 1013 + MTK_FUNCTION(6, "SSPM_JTAG_TRSTN") 1014 + ), 1015 + MTK_PIN( 1016 + 92, "GPIO92", 1017 + MTK_EINT_FUNCTION(0, 92), 1018 + DRV_GRP4, 1019 + MTK_FUNCTION(0, "GPIO92"), 1020 + MTK_FUNCTION(1, "DGI_D15"), 1021 + MTK_FUNCTION(2, "DPI_D15"), 1022 + MTK_FUNCTION(3, "MSDC2_DAT0_A"), 1023 + MTK_FUNCTION(4, "I2SO2_D1"), 1024 + MTK_FUNCTION(5, "GBE_RXER"), 1025 + MTK_FUNCTION(6, "CCU0_JTAG_TDO") 1026 + ), 1027 + MTK_PIN( 1028 + 93, "GPIO93", 1029 + MTK_EINT_FUNCTION(0, 93), 1030 + DRV_GRP4, 1031 + MTK_FUNCTION(0, "GPIO93"), 1032 + MTK_FUNCTION(1, "DGI_HSYNC"), 1033 + MTK_FUNCTION(2, "DPI_HSYNC"), 1034 + MTK_FUNCTION(3, "MSDC2_DAT2_A"), 1035 + MTK_FUNCTION(4, "I2SO2_D2"), 1036 + MTK_FUNCTION(5, "GBE_COL"), 1037 + MTK_FUNCTION(6, "CCU0_JTAG_TMS") 1038 + ), 1039 + MTK_PIN( 1040 + 94, "GPIO94", 1041 + MTK_EINT_FUNCTION(0, 94), 1042 + DRV_GRP4, 1043 + MTK_FUNCTION(0, "GPIO94"), 1044 + MTK_FUNCTION(1, "DGI_VSYNC"), 1045 + MTK_FUNCTION(2, "DPI_VSYNC"), 1046 + MTK_FUNCTION(3, "MSDC2_DAT1_A"), 1047 + MTK_FUNCTION(4, "I2SO2_D3"), 1048 + MTK_FUNCTION(5, "GBE_INTR"), 1049 + MTK_FUNCTION(6, "CCU0_JTAG_TDI") 1050 + ), 1051 + MTK_PIN( 1052 + 95, "GPIO95", 1053 + MTK_EINT_FUNCTION(0, 95), 1054 + DRV_GRP4, 1055 + MTK_FUNCTION(0, "GPIO95"), 1056 + MTK_FUNCTION(1, "DGI_DE"), 1057 + MTK_FUNCTION(2, "DPI_DE"), 1058 + MTK_FUNCTION(3, "UTXD2"), 1059 + MTK_FUNCTION(5, "I2SIN_D1"), 1060 + MTK_FUNCTION(6, "CCU0_JTAG_TCK") 1061 + ), 1062 + MTK_PIN( 1063 + 96, "GPIO96", 1064 + MTK_EINT_FUNCTION(0, 96), 1065 + DRV_GRP4, 1066 + MTK_FUNCTION(0, "GPIO96"), 1067 + MTK_FUNCTION(1, "DGI_CK"), 1068 + MTK_FUNCTION(2, "DPI_CK"), 1069 + MTK_FUNCTION(3, "URXD2"), 1070 + MTK_FUNCTION(4, "I2SO5_MCK"), 1071 + MTK_FUNCTION(5, "I2SIN_D2"), 1072 + MTK_FUNCTION(6, "CCU0_JTAG_TRST") 1073 + ), 1074 + MTK_PIN( 1075 + 97, "GPIO97", 1076 + MTK_EINT_FUNCTION(0, 97), 1077 + DRV_GRP4, 1078 + MTK_FUNCTION(0, "GPIO97"), 1079 + MTK_FUNCTION(1, "DISP_PWM0"), 1080 + MTK_FUNCTION(2, "DVFSRC_EXT_REQ") 1081 + ), 1082 + MTK_PIN( 1083 + 98, "GPIO98", 1084 + MTK_EINT_FUNCTION(0, 98), 1085 + DRV_GRP4, 1086 + MTK_FUNCTION(0, "GPIO98"), 1087 + MTK_FUNCTION(1, "UTXD0") 1088 + ), 1089 + MTK_PIN( 1090 + 99, "GPIO99", 1091 + MTK_EINT_FUNCTION(0, 99), 1092 + DRV_GRP4, 1093 + MTK_FUNCTION(0, "GPIO99"), 1094 + MTK_FUNCTION(1, "URXD0") 1095 + ), 1096 + MTK_PIN( 1097 + 100, "GPIO100", 1098 + MTK_EINT_FUNCTION(0, 100), 1099 + DRV_GRP4, 1100 + MTK_FUNCTION(0, "GPIO100"), 1101 + MTK_FUNCTION(1, "URTS1"), 1102 + MTK_FUNCTION(2, "DSI_TE"), 1103 + MTK_FUNCTION(3, "I2SO1_D8"), 1104 + MTK_FUNCTION(4, "KPROW2"), 1105 + MTK_FUNCTION(5, "PWM_0"), 1106 + MTK_FUNCTION(6, "TP_URTS1_AO"), 1107 + MTK_FUNCTION(7, "I2SIN_D0") 1108 + ), 1109 + MTK_PIN( 1110 + 101, "GPIO101", 1111 + MTK_EINT_FUNCTION(0, 101), 1112 + DRV_GRP4, 1113 + MTK_FUNCTION(0, "GPIO101"), 1114 + MTK_FUNCTION(1, "UCTS1"), 1115 + MTK_FUNCTION(2, "DSI1_TE"), 1116 + MTK_FUNCTION(3, "I2SO1_D9"), 1117 + MTK_FUNCTION(4, "KPCOL2"), 1118 + MTK_FUNCTION(5, "PWM_1"), 1119 + MTK_FUNCTION(6, "TP_UCTS1_AO"), 1120 + MTK_FUNCTION(7, "I2SIN_D1") 1121 + ), 1122 + MTK_PIN( 1123 + 102, "GPIO102", 1124 + MTK_EINT_FUNCTION(0, 102), 1125 + DRV_GRP4, 1126 + MTK_FUNCTION(0, "GPIO102"), 1127 + MTK_FUNCTION(1, "UTXD1"), 1128 + MTK_FUNCTION(2, "VBUSVALID_2P"), 1129 + MTK_FUNCTION(3, "I2SO1_D10"), 1130 + MTK_FUNCTION(4, "SSPM_UTXD_AO"), 1131 + MTK_FUNCTION(5, "TP_UTXD1_AO"), 1132 + MTK_FUNCTION(6, "MD32_1_TXD"), 1133 + MTK_FUNCTION(7, "I2SIN_D2") 1134 + ), 1135 + MTK_PIN( 1136 + 103, "GPIO103", 1137 + MTK_EINT_FUNCTION(0, 103), 1138 + DRV_GRP4, 1139 + MTK_FUNCTION(0, "GPIO103"), 1140 + MTK_FUNCTION(1, "URXD1"), 1141 + MTK_FUNCTION(2, "VBUSVALID_3P"), 1142 + MTK_FUNCTION(3, "I2SO1_D11"), 1143 + MTK_FUNCTION(4, "SSPM_URXD_AO"), 1144 + MTK_FUNCTION(5, "TP_URXD1_AO"), 1145 + MTK_FUNCTION(6, "MD32_1_RXD"), 1146 + MTK_FUNCTION(7, "I2SIN_D3") 1147 + ), 1148 + MTK_PIN( 1149 + 104, "GPIO104", 1150 + MTK_EINT_FUNCTION(0, 104), 1151 + DRV_GRP4, 1152 + MTK_FUNCTION(0, "GPIO104"), 1153 + MTK_FUNCTION(1, "KPROW0"), 1154 + MTK_FUNCTION(2, "DISP_PWM1") 1155 + ), 1156 + MTK_PIN( 1157 + 105, "GPIO105", 1158 + MTK_EINT_FUNCTION(0, 105), 1159 + DRV_GRP4, 1160 + MTK_FUNCTION(0, "GPIO105"), 1161 + MTK_FUNCTION(1, "KPROW1"), 1162 + MTK_FUNCTION(2, "EDP_TX_HPD"), 1163 + MTK_FUNCTION(3, "PWM_2") 1164 + ), 1165 + MTK_PIN( 1166 + 106, "GPIO106", 1167 + MTK_EINT_FUNCTION(0, 106), 1168 + DRV_GRP4, 1169 + MTK_FUNCTION(0, "GPIO106"), 1170 + MTK_FUNCTION(1, "KPCOL0") 1171 + ), 1172 + MTK_PIN( 1173 + 107, "GPIO107", 1174 + MTK_EINT_FUNCTION(0, 107), 1175 + DRV_GRP4, 1176 + MTK_FUNCTION(0, "GPIO107"), 1177 + MTK_FUNCTION(1, "KPCOL1"), 1178 + MTK_FUNCTION(2, "DSI1_TE"), 1179 + MTK_FUNCTION(3, "PWM_3"), 1180 + MTK_FUNCTION(4, "SCP_SCL3"), 1181 + MTK_FUNCTION(5, "I2SIN_MCK") 1182 + ), 1183 + MTK_PIN( 1184 + 108, "GPIO108", 1185 + MTK_EINT_FUNCTION(0, 108), 1186 + DRV_GRP4, 1187 + MTK_FUNCTION(0, "GPIO108"), 1188 + MTK_FUNCTION(1, "LCM_RST"), 1189 + MTK_FUNCTION(2, "KPCOL1"), 1190 + MTK_FUNCTION(4, "SCP_SDA3"), 1191 + MTK_FUNCTION(5, "I2SIN_BCK") 1192 + ), 1193 + MTK_PIN( 1194 + 109, "GPIO109", 1195 + MTK_EINT_FUNCTION(0, 109), 1196 + DRV_GRP4, 1197 + MTK_FUNCTION(0, "GPIO109"), 1198 + MTK_FUNCTION(1, "DSI_TE"), 1199 + MTK_FUNCTION(2, "I2SIN_D3"), 1200 + MTK_FUNCTION(5, "I2SIN_WS") 1201 + ), 1202 + MTK_PIN( 1203 + 110, "GPIO110", 1204 + MTK_EINT_FUNCTION(0, 110), 1205 + DRV_GRP4, 1206 + MTK_FUNCTION(0, "GPIO110"), 1207 + MTK_FUNCTION(1, "MSDC1_CMD"), 1208 + MTK_FUNCTION(2, "JTMS_SEL3"), 1209 + MTK_FUNCTION(3, "UDI_TMS"), 1210 + MTK_FUNCTION(5, "CCU1_JTAG_TMS"), 1211 + MTK_FUNCTION(6, "IPU_JTAG_TMS") 1212 + ), 1213 + MTK_PIN( 1214 + 111, "GPIO111", 1215 + MTK_EINT_FUNCTION(0, 111), 1216 + DRV_GRP4, 1217 + MTK_FUNCTION(0, "GPIO111"), 1218 + MTK_FUNCTION(1, "MSDC1_CLK"), 1219 + MTK_FUNCTION(2, "JTCK_SEL3"), 1220 + MTK_FUNCTION(3, "UDI_TCK"), 1221 + MTK_FUNCTION(5, "CCU1_JTAG_TCK"), 1222 + MTK_FUNCTION(6, "IPU_JTAG_TCK") 1223 + ), 1224 + MTK_PIN( 1225 + 112, "GPIO112", 1226 + MTK_EINT_FUNCTION(0, 112), 1227 + DRV_GRP4, 1228 + MTK_FUNCTION(0, "GPIO112"), 1229 + MTK_FUNCTION(1, "MSDC1_DAT0"), 1230 + MTK_FUNCTION(2, "JTDI_SEL3"), 1231 + MTK_FUNCTION(3, "UDI_TDI"), 1232 + MTK_FUNCTION(4, "I2SO2_D0"), 1233 + MTK_FUNCTION(5, "CCU1_JTAG_TDI"), 1234 + MTK_FUNCTION(6, "IPU_JTAG_TDI") 1235 + ), 1236 + MTK_PIN( 1237 + 113, "GPIO113", 1238 + MTK_EINT_FUNCTION(0, 113), 1239 + DRV_GRP4, 1240 + MTK_FUNCTION(0, "GPIO113"), 1241 + MTK_FUNCTION(1, "MSDC1_DAT1"), 1242 + MTK_FUNCTION(2, "JTDO_SEL3"), 1243 + MTK_FUNCTION(3, "UDI_TDO"), 1244 + MTK_FUNCTION(4, "I2SO2_D1"), 1245 + MTK_FUNCTION(5, "CCU1_JTAG_TDO"), 1246 + MTK_FUNCTION(6, "IPU_JTAG_TDO") 1247 + ), 1248 + MTK_PIN( 1249 + 114, "GPIO114", 1250 + MTK_EINT_FUNCTION(0, 114), 1251 + DRV_GRP4, 1252 + MTK_FUNCTION(0, "GPIO114"), 1253 + MTK_FUNCTION(1, "MSDC1_DAT2"), 1254 + MTK_FUNCTION(2, "JTRSTn_SEL3"), 1255 + MTK_FUNCTION(3, "UDI_NTRST"), 1256 + MTK_FUNCTION(4, "I2SO2_D2"), 1257 + MTK_FUNCTION(5, "CCU1_JTAG_TRST"), 1258 + MTK_FUNCTION(6, "IPU_JTAG_TRST") 1259 + ), 1260 + MTK_PIN( 1261 + 115, "GPIO115", 1262 + MTK_EINT_FUNCTION(0, 115), 1263 + DRV_GRP4, 1264 + MTK_FUNCTION(0, "GPIO115"), 1265 + MTK_FUNCTION(1, "MSDC1_DAT3"), 1266 + MTK_FUNCTION(4, "I2SO2_D3"), 1267 + MTK_FUNCTION(6, "MD32_1_GPIO2") 1268 + ), 1269 + MTK_PIN( 1270 + 116, "GPIO116", 1271 + MTK_EINT_FUNCTION(0, 116), 1272 + DRV_GRP4, 1273 + MTK_FUNCTION(0, "GPIO116"), 1274 + MTK_FUNCTION(1, "MSDC0_DAT7") 1275 + ), 1276 + MTK_PIN( 1277 + 117, "GPIO117", 1278 + MTK_EINT_FUNCTION(0, 117), 1279 + DRV_GRP4, 1280 + MTK_FUNCTION(0, "GPIO117"), 1281 + MTK_FUNCTION(1, "MSDC0_DAT6") 1282 + ), 1283 + MTK_PIN( 1284 + 118, "GPIO118", 1285 + MTK_EINT_FUNCTION(0, 118), 1286 + DRV_GRP4, 1287 + MTK_FUNCTION(0, "GPIO118"), 1288 + MTK_FUNCTION(1, "MSDC0_DAT5") 1289 + ), 1290 + MTK_PIN( 1291 + 119, "GPIO119", 1292 + MTK_EINT_FUNCTION(0, 119), 1293 + DRV_GRP4, 1294 + MTK_FUNCTION(0, "GPIO119"), 1295 + MTK_FUNCTION(1, "MSDC0_DAT4") 1296 + ), 1297 + MTK_PIN( 1298 + 120, "GPIO120", 1299 + MTK_EINT_FUNCTION(0, 120), 1300 + DRV_GRP4, 1301 + MTK_FUNCTION(0, "GPIO120"), 1302 + MTK_FUNCTION(1, "MSDC0_RSTB") 1303 + ), 1304 + MTK_PIN( 1305 + 121, "GPIO121", 1306 + MTK_EINT_FUNCTION(0, 121), 1307 + DRV_GRP4, 1308 + MTK_FUNCTION(0, "GPIO121"), 1309 + MTK_FUNCTION(1, "MSDC0_CMD") 1310 + ), 1311 + MTK_PIN( 1312 + 122, "GPIO122", 1313 + MTK_EINT_FUNCTION(0, 122), 1314 + DRV_GRP4, 1315 + MTK_FUNCTION(0, "GPIO122"), 1316 + MTK_FUNCTION(1, "MSDC0_CLK") 1317 + ), 1318 + MTK_PIN( 1319 + 123, "GPIO123", 1320 + MTK_EINT_FUNCTION(0, 123), 1321 + DRV_GRP4, 1322 + MTK_FUNCTION(0, "GPIO123"), 1323 + MTK_FUNCTION(1, "MSDC0_DAT3") 1324 + ), 1325 + MTK_PIN( 1326 + 124, "GPIO124", 1327 + MTK_EINT_FUNCTION(0, 124), 1328 + DRV_GRP4, 1329 + MTK_FUNCTION(0, "GPIO124"), 1330 + MTK_FUNCTION(1, "MSDC0_DAT2") 1331 + ), 1332 + MTK_PIN( 1333 + 125, "GPIO125", 1334 + MTK_EINT_FUNCTION(0, 125), 1335 + DRV_GRP4, 1336 + MTK_FUNCTION(0, "GPIO125"), 1337 + MTK_FUNCTION(1, "MSDC0_DAT1") 1338 + ), 1339 + MTK_PIN( 1340 + 126, "GPIO126", 1341 + MTK_EINT_FUNCTION(0, 126), 1342 + DRV_GRP4, 1343 + MTK_FUNCTION(0, "GPIO126"), 1344 + MTK_FUNCTION(1, "MSDC0_DAT0") 1345 + ), 1346 + MTK_PIN( 1347 + 127, "GPIO127", 1348 + MTK_EINT_FUNCTION(0, 127), 1349 + DRV_GRP4, 1350 + MTK_FUNCTION(0, "GPIO127"), 1351 + MTK_FUNCTION(1, "MSDC0_DSL") 1352 + ), 1353 + MTK_PIN( 1354 + 128, "GPIO128", 1355 + MTK_EINT_FUNCTION(0, 128), 1356 + DRV_GRP4, 1357 + MTK_FUNCTION(0, "GPIO128"), 1358 + MTK_FUNCTION(1, "IDDIG"), 1359 + MTK_FUNCTION(2, "UCTS2"), 1360 + MTK_FUNCTION(3, "UTXD5"), 1361 + MTK_FUNCTION(4, "UFS_MPHY_SCL"), 1362 + MTK_FUNCTION(5, "mbistreaden_trigger"), 1363 + MTK_FUNCTION(6, "MD32_1_GPIO0"), 1364 + MTK_FUNCTION(7, "SCP_SCL2") 1365 + ), 1366 + MTK_PIN( 1367 + 129, "GPIO129", 1368 + MTK_EINT_FUNCTION(0, 129), 1369 + DRV_GRP4, 1370 + MTK_FUNCTION(0, "GPIO129"), 1371 + MTK_FUNCTION(1, "USB_DRVVBUS"), 1372 + MTK_FUNCTION(2, "URTS2"), 1373 + MTK_FUNCTION(3, "URXD5"), 1374 + MTK_FUNCTION(4, "UFS_MPHY_SDA"), 1375 + MTK_FUNCTION(5, "mbistwriteen_trigger"), 1376 + MTK_FUNCTION(6, "MD32_1_GPIO1"), 1377 + MTK_FUNCTION(7, "SCP_SDA2") 1378 + ), 1379 + MTK_PIN( 1380 + 130, "GPIO130", 1381 + MTK_EINT_FUNCTION(0, 130), 1382 + DRV_GRP4, 1383 + MTK_FUNCTION(0, "GPIO130"), 1384 + MTK_FUNCTION(1, "IDDIG_1P"), 1385 + MTK_FUNCTION(2, "SPINOR_IO2"), 1386 + MTK_FUNCTION(3, "SNFI_WP"), 1387 + MTK_FUNCTION(4, "VPU_UDI_NTRST") 1388 + ), 1389 + MTK_PIN( 1390 + 131, "GPIO131", 1391 + MTK_EINT_FUNCTION(0, 131), 1392 + DRV_GRP4, 1393 + MTK_FUNCTION(0, "GPIO131"), 1394 + MTK_FUNCTION(1, "USB_DRVVBUS_1P"), 1395 + MTK_FUNCTION(2, "SPINOR_IO3"), 1396 + MTK_FUNCTION(3, "SNFI_HOLD"), 1397 + MTK_FUNCTION(4, "MD32_1_JTAG_TRST"), 1398 + MTK_FUNCTION(5, "SCP_JTAG0_TRSTN"), 1399 + MTK_FUNCTION(6, "APU_JTAG_TRST") 1400 + ), 1401 + MTK_PIN( 1402 + 132, "GPIO132", 1403 + MTK_EINT_FUNCTION(0, 132), 1404 + DRV_GRP4, 1405 + MTK_FUNCTION(0, "GPIO132"), 1406 + MTK_FUNCTION(1, "SPIM0_CSB"), 1407 + MTK_FUNCTION(2, "SCP_SPI0_CS"), 1408 + MTK_FUNCTION(3, "SPIS0_CSB"), 1409 + MTK_FUNCTION(4, "VPU_UDI_TMS"), 1410 + MTK_FUNCTION(6, "I2SO5_D0") 1411 + ), 1412 + MTK_PIN( 1413 + 133, "GPIO133", 1414 + MTK_EINT_FUNCTION(0, 133), 1415 + DRV_GRP4, 1416 + MTK_FUNCTION(0, "GPIO133"), 1417 + MTK_FUNCTION(1, "SPIM0_CLK"), 1418 + MTK_FUNCTION(2, "SCP_SPI0_CK"), 1419 + MTK_FUNCTION(3, "SPIS0_CLK"), 1420 + MTK_FUNCTION(4, "VPU_UDI_TCK"), 1421 + MTK_FUNCTION(6, "I2SO5_BCK") 1422 + ), 1423 + MTK_PIN( 1424 + 134, "GPIO134", 1425 + MTK_EINT_FUNCTION(0, 134), 1426 + DRV_GRP4, 1427 + MTK_FUNCTION(0, "GPIO134"), 1428 + MTK_FUNCTION(1, "SPIM0_MO"), 1429 + MTK_FUNCTION(2, "SCP_SPI0_MO"), 1430 + MTK_FUNCTION(3, "SPIS0_SI"), 1431 + MTK_FUNCTION(4, "VPU_UDI_TDO"), 1432 + MTK_FUNCTION(6, "I2SO5_WS") 1433 + ), 1434 + MTK_PIN( 1435 + 135, "GPIO135", 1436 + MTK_EINT_FUNCTION(0, 135), 1437 + DRV_GRP4, 1438 + MTK_FUNCTION(0, "GPIO135"), 1439 + MTK_FUNCTION(1, "SPIM0_MI"), 1440 + MTK_FUNCTION(2, "SCP_SPI0_MI"), 1441 + MTK_FUNCTION(3, "SPIS0_SO"), 1442 + MTK_FUNCTION(4, "VPU_UDI_TDI"), 1443 + MTK_FUNCTION(6, "I2SO5_MCK") 1444 + ), 1445 + MTK_PIN( 1446 + 136, "GPIO136", 1447 + MTK_EINT_FUNCTION(0, 136), 1448 + DRV_GRP4, 1449 + MTK_FUNCTION(0, "GPIO136"), 1450 + MTK_FUNCTION(1, "SPIM1_CSB"), 1451 + MTK_FUNCTION(2, "SCP_SPI1_A_CS"), 1452 + MTK_FUNCTION(3, "SPIS1_CSB"), 1453 + MTK_FUNCTION(4, "MD32_1_JTAG_TMS"), 1454 + MTK_FUNCTION(5, "SCP_JTAG0_TMS"), 1455 + MTK_FUNCTION(6, "APU_JTAG_TMS"), 1456 + MTK_FUNCTION(7, "DBG_MON_A15") 1457 + ), 1458 + MTK_PIN( 1459 + 137, "GPIO137", 1460 + MTK_EINT_FUNCTION(0, 137), 1461 + DRV_GRP4, 1462 + MTK_FUNCTION(0, "GPIO137"), 1463 + MTK_FUNCTION(1, "SPIM1_CLK"), 1464 + MTK_FUNCTION(2, "SCP_SPI1_A_CK"), 1465 + MTK_FUNCTION(3, "SPIS1_CLK"), 1466 + MTK_FUNCTION(4, "MD32_1_JTAG_TCK"), 1467 + MTK_FUNCTION(5, "SCP_JTAG0_TCK"), 1468 + MTK_FUNCTION(6, "APU_JTAG_TCK"), 1469 + MTK_FUNCTION(7, "DBG_MON_A14") 1470 + ), 1471 + MTK_PIN( 1472 + 138, "GPIO138", 1473 + MTK_EINT_FUNCTION(0, 138), 1474 + DRV_GRP4, 1475 + MTK_FUNCTION(0, "GPIO138"), 1476 + MTK_FUNCTION(1, "SPIM1_MO"), 1477 + MTK_FUNCTION(2, "SCP_SPI1_A_MO"), 1478 + MTK_FUNCTION(3, "SPIS1_SI"), 1479 + MTK_FUNCTION(4, "MD32_1_JTAG_TDO"), 1480 + MTK_FUNCTION(5, "SCP_JTAG0_TDO"), 1481 + MTK_FUNCTION(6, "APU_JTAG_TDO"), 1482 + MTK_FUNCTION(7, "DBG_MON_A16") 1483 + ), 1484 + MTK_PIN( 1485 + 139, "GPIO139", 1486 + MTK_EINT_FUNCTION(0, 139), 1487 + DRV_GRP4, 1488 + MTK_FUNCTION(0, "GPIO139"), 1489 + MTK_FUNCTION(1, "SPIM1_MI"), 1490 + MTK_FUNCTION(2, "SCP_SPI1_A_MI"), 1491 + MTK_FUNCTION(3, "SPIS1_SO"), 1492 + MTK_FUNCTION(4, "MD32_1_JTAG_TDI"), 1493 + MTK_FUNCTION(5, "SCP_JTAG0_TDI"), 1494 + MTK_FUNCTION(6, "APU_JTAG_TDI"), 1495 + MTK_FUNCTION(7, "DBG_MON_A17") 1496 + ), 1497 + MTK_PIN( 1498 + 140, "GPIO140", 1499 + MTK_EINT_FUNCTION(0, 140), 1500 + DRV_GRP4, 1501 + MTK_FUNCTION(0, "GPIO140"), 1502 + MTK_FUNCTION(1, "SPIM2_CSB"), 1503 + MTK_FUNCTION(2, "SPINOR_CS"), 1504 + MTK_FUNCTION(3, "SNFI_CS"), 1505 + MTK_FUNCTION(4, "DMIC3_DAT"), 1506 + MTK_FUNCTION(7, "DBG_MON_A11") 1507 + ), 1508 + MTK_PIN( 1509 + 141, "GPIO141", 1510 + MTK_EINT_FUNCTION(0, 141), 1511 + DRV_GRP4, 1512 + MTK_FUNCTION(0, "GPIO141"), 1513 + MTK_FUNCTION(1, "SPIM2_CLK"), 1514 + MTK_FUNCTION(2, "SPINOR_CK"), 1515 + MTK_FUNCTION(3, "SNFI_CLK"), 1516 + MTK_FUNCTION(4, "DMIC3_CLK"), 1517 + MTK_FUNCTION(7, "DBG_MON_A10") 1518 + ), 1519 + MTK_PIN( 1520 + 142, "GPIO142", 1521 + MTK_EINT_FUNCTION(0, 142), 1522 + DRV_GRP4, 1523 + MTK_FUNCTION(0, "GPIO142"), 1524 + MTK_FUNCTION(1, "SPIM2_MO"), 1525 + MTK_FUNCTION(2, "SPINOR_IO0"), 1526 + MTK_FUNCTION(3, "SNFI_MOSI"), 1527 + MTK_FUNCTION(4, "DMIC4_DAT"), 1528 + MTK_FUNCTION(7, "DBG_MON_A12") 1529 + ), 1530 + MTK_PIN( 1531 + 143, "GPIO143", 1532 + MTK_EINT_FUNCTION(0, 143), 1533 + DRV_GRP4, 1534 + MTK_FUNCTION(0, "GPIO143"), 1535 + MTK_FUNCTION(1, "SPIM2_MI"), 1536 + MTK_FUNCTION(2, "SPINOR_IO1"), 1537 + MTK_FUNCTION(3, "SNFI_MISO"), 1538 + MTK_FUNCTION(4, "DMIC4_CLK"), 1539 + MTK_FUNCTION(7, "DBG_MON_A13") 1540 + ), 1541 + MTK_PIN( 1542 + 144, "GPIO144", 1543 + MTK_EINT_FUNCTION(0, 144), 1544 + DRV_FIXED, 1545 + MTK_FUNCTION(0, NULL) 1546 + ), 1547 + MTK_PIN( 1548 + 145, "GPIO145", 1549 + MTK_EINT_FUNCTION(0, 145), 1550 + DRV_FIXED, 1551 + MTK_FUNCTION(0, NULL) 1552 + ), 1553 + MTK_PIN( 1554 + 146, "GPIO146", 1555 + MTK_EINT_FUNCTION(0, 146), 1556 + DRV_FIXED, 1557 + MTK_FUNCTION(0, NULL) 1558 + ), 1559 + MTK_PIN( 1560 + 147, "GPIO147", 1561 + MTK_EINT_FUNCTION(0, 147), 1562 + DRV_FIXED, 1563 + MTK_FUNCTION(0, NULL) 1564 + ), 1565 + MTK_PIN( 1566 + 148, "GPIO148", 1567 + MTK_EINT_FUNCTION(0, 148), 1568 + DRV_FIXED, 1569 + MTK_FUNCTION(0, NULL) 1570 + ), 1571 + MTK_PIN( 1572 + 149, "GPIO149", 1573 + MTK_EINT_FUNCTION(0, 149), 1574 + DRV_FIXED, 1575 + MTK_FUNCTION(0, NULL) 1576 + ), 1577 + MTK_PIN( 1578 + 150, "GPIO150", 1579 + MTK_EINT_FUNCTION(0, 150), 1580 + DRV_FIXED, 1581 + MTK_FUNCTION(0, NULL) 1582 + ), 1583 + MTK_PIN( 1584 + 151, "GPIO151", 1585 + MTK_EINT_FUNCTION(0, 151), 1586 + DRV_FIXED, 1587 + MTK_FUNCTION(0, NULL) 1588 + ), 1589 + MTK_PIN( 1590 + 152, "GPIO152", 1591 + MTK_EINT_FUNCTION(0, 152), 1592 + DRV_FIXED, 1593 + MTK_FUNCTION(0, NULL) 1594 + ), 1595 + MTK_PIN( 1596 + 153, "GPIO153", 1597 + MTK_EINT_FUNCTION(0, 153), 1598 + DRV_FIXED, 1599 + MTK_FUNCTION(0, NULL) 1600 + ), 1601 + MTK_PIN( 1602 + 154, "GPIO154", 1603 + MTK_EINT_FUNCTION(0, 154), 1604 + DRV_GRP4, 1605 + MTK_FUNCTION(0, NULL) 1606 + ), 1607 + MTK_PIN( 1608 + 155, "GPIO155", 1609 + MTK_EINT_FUNCTION(0, 155), 1610 + DRV_FIXED, 1611 + MTK_FUNCTION(0, NULL) 1612 + ), 1613 + MTK_PIN( 1614 + 156, "GPIO156", 1615 + MTK_EINT_FUNCTION(0, 216), 1616 + DRV_FIXED, 1617 + MTK_FUNCTION(0, NULL) 1618 + ), 1619 + MTK_PIN( 1620 + 157, "GPIO157", 1621 + MTK_EINT_FUNCTION(0, 217), 1622 + DRV_FIXED, 1623 + MTK_FUNCTION(0, NULL) 1624 + ), 1625 + MTK_PIN( 1626 + 158, "GPIO158", 1627 + MTK_EINT_FUNCTION(0, 218), 1628 + DRV_FIXED, 1629 + MTK_FUNCTION(0, NULL) 1630 + ), 1631 + MTK_PIN( 1632 + 159, "GPIO159", 1633 + MTK_EINT_FUNCTION(0, 219), 1634 + DRV_FIXED, 1635 + MTK_FUNCTION(0, NULL) 1636 + ), 1637 + MTK_PIN( 1638 + 160, "GPIO160", 1639 + MTK_EINT_FUNCTION(0, 220), 1640 + DRV_FIXED, 1641 + MTK_FUNCTION(0, NULL) 1642 + ), 1643 + MTK_PIN( 1644 + 161, "GPIO161", 1645 + MTK_EINT_FUNCTION(0, 221), 1646 + DRV_FIXED, 1647 + MTK_FUNCTION(0, NULL) 1648 + ), 1649 + MTK_PIN( 1650 + 162, "GPIO162", 1651 + MTK_EINT_FUNCTION(0, 222), 1652 + DRV_FIXED, 1653 + MTK_FUNCTION(0, NULL) 1654 + ), 1655 + MTK_PIN( 1656 + 163, "GPIO163", 1657 + MTK_EINT_FUNCTION(0, 223), 1658 + DRV_FIXED, 1659 + MTK_FUNCTION(0, NULL) 1660 + ), 1661 + MTK_PIN( 1662 + 164, "GPIO164", 1663 + MTK_EINT_FUNCTION(0, 224), 1664 + DRV_FIXED, 1665 + MTK_FUNCTION(0, NULL) 1666 + ) 1667 + }; 1668 + 1669 + #endif /* __PINCTRL_MTK_MT8195_H */
+2
drivers/pinctrl/mediatek/pinctrl-paris.c
··· 970 970 971 971 hw->nbase = hw->soc->nbase_names; 972 972 973 + spin_lock_init(&hw->lock); 974 + 973 975 err = mtk_pctrl_build_state(pdev); 974 976 if (err) { 975 977 dev_err(&pdev->dev, "build state failed: %d\n", err);
+2 -2
drivers/pinctrl/mvebu/pinctrl-armada-cp110.c
··· 519 519 MPP_FUNCTION(4, "synce1", "clk"), 520 520 MPP_FUNCTION(8, "led", "data"), 521 521 MPP_FUNCTION(10, "sdio", "hw_rst"), 522 - MPP_FUNCTION(11, "sdio", "wr_protect")), 522 + MPP_FUNCTION(11, "sdio_wp", "wr_protect")), 523 523 MPP_MODE(55, 524 524 MPP_FUNCTION(0, "gpio", NULL), 525 525 MPP_FUNCTION(1, "ge1", "rxctl_rxdv"), 526 526 MPP_FUNCTION(3, "ptp", "pulse"), 527 527 MPP_FUNCTION(10, "sdio", "led"), 528 - MPP_FUNCTION(11, "sdio", "card_detect")), 528 + MPP_FUNCTION(11, "sdio_cd", "card_detect")), 529 529 MPP_MODE(56, 530 530 MPP_FUNCTION(0, "gpio", NULL), 531 531 MPP_FUNCTION(4, "tdm", "drx"),
+3 -3
drivers/pinctrl/pinconf-generic.c
··· 43 43 PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false), 44 44 PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false), 45 45 PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL, false), 46 - PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode", true), 46 + PCONFDUMP(PIN_CONFIG_MODE_LOW_POWER, "pin low power", "mode", true), 47 47 PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false), 48 48 PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), 49 49 PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), ··· 174 174 { "input-schmitt", PIN_CONFIG_INPUT_SCHMITT, 0 }, 175 175 { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, 176 176 { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, 177 - { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 }, 178 - { "low-power-enable", PIN_CONFIG_LOW_POWER_MODE, 1 }, 177 + { "low-power-disable", PIN_CONFIG_MODE_LOW_POWER, 0 }, 178 + { "low-power-enable", PIN_CONFIG_MODE_LOW_POWER, 1 }, 179 179 { "output-disable", PIN_CONFIG_OUTPUT_ENABLE, 0 }, 180 180 { "output-enable", PIN_CONFIG_OUTPUT_ENABLE, 1 }, 181 181 { "output-high", PIN_CONFIG_OUTPUT, 1, },
+2 -2
drivers/pinctrl/pinconf.c
··· 370 370 void pinconf_init_device_debugfs(struct dentry *devroot, 371 371 struct pinctrl_dev *pctldev) 372 372 { 373 - debugfs_create_file("pinconf-pins", S_IFREG | S_IRUGO, 373 + debugfs_create_file("pinconf-pins", 0444, 374 374 devroot, pctldev, &pinconf_pins_fops); 375 - debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO, 375 + debugfs_create_file("pinconf-groups", 0444, 376 376 devroot, pctldev, &pinconf_groups_fops); 377 377 } 378 378
+4 -4
drivers/pinctrl/pinctrl-at91-pio4.c
··· 801 801 802 802 conf = atmel_pin_config_read(pctldev, pin_id); 803 803 804 + /* Keep slew rate enabled by default. */ 805 + if (atmel_pioctrl->slew_rate_support) 806 + conf |= ATMEL_PIO_SR_MASK; 807 + 804 808 for (i = 0; i < num_configs; i++) { 805 809 unsigned int param = pinconf_to_config_param(configs[i]); 806 810 unsigned int arg = pinconf_to_config_argument(configs[i]); 807 811 808 812 dev_dbg(pctldev->dev, "%s: pin=%u, config=0x%lx\n", 809 813 __func__, pin_id, configs[i]); 810 - 811 - /* Keep slew rate enabled by default. */ 812 - if (atmel_pioctrl->slew_rate_support) 813 - conf |= ATMEL_PIO_SR_MASK; 814 814 815 815 switch (param) { 816 816 case PIN_CONFIG_BIAS_DISABLE:
+13 -3
drivers/pinctrl/pinctrl-equilibrium.c
··· 628 628 break; 629 629 630 630 default: 631 - return -EINVAL; 631 + of_node_put(np); 632 + return -EINVAL; 632 633 } 633 634 i++; 634 635 } ··· 708 707 group.num_pins = of_property_count_u32_elems(np, "pins"); 709 708 if (group.num_pins < 0) { 710 709 dev_err(dev, "No pins in the group: %s\n", prop->name); 710 + of_node_put(np); 711 711 return -EINVAL; 712 712 } 713 713 group.name = prop->value; 714 714 group.pins = devm_kcalloc(dev, group.num_pins, 715 715 sizeof(*(group.pins)), GFP_KERNEL); 716 - if (!group.pins) 716 + if (!group.pins) { 717 + of_node_put(np); 717 718 return -ENOMEM; 719 + } 718 720 719 721 pinmux = devm_kcalloc(dev, group.num_pins, sizeof(*pinmux), 720 722 GFP_KERNEL); 721 - if (!pinmux) 723 + if (!pinmux) { 724 + of_node_put(np); 722 725 return -ENOMEM; 726 + } 723 727 724 728 for (j = 0; j < group.num_pins; j++) { 725 729 if (of_property_read_u32_index(np, "pins", j, &pin_id)) { 726 730 dev_err(dev, "Group %s: Read intel pins id failed\n", 727 731 group.name); 732 + of_node_put(np); 728 733 return -EINVAL; 729 734 } 730 735 if (pin_id >= drvdata->pctl_desc.npins) { 731 736 dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n", 732 737 group.name, j, pin_id); 738 + of_node_put(np); 733 739 return -EINVAL; 734 740 } 735 741 group.pins[j] = pin_id; 736 742 if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) { 737 743 dev_err(dev, "Group %s: Read intel pinmux id failed\n", 738 744 group.name); 745 + of_node_put(np); 739 746 return -EINVAL; 740 747 } 741 748 pinmux[j] = pinmux_id; ··· 754 745 pinmux); 755 746 if (err < 0) { 756 747 dev_err(dev, "Failed to register group %s\n", group.name); 748 + of_node_put(np); 757 749 return err; 758 750 } 759 751 memset(&group, 0, sizeof(group));
+1512 -127
drivers/pinctrl/pinctrl-ingenic.c
··· 3 3 * Ingenic SoCs pinctrl driver 4 4 * 5 5 * Copyright (c) 2017 Paul Cercueil <paul@crapouillou.net> 6 - * Copyright (c) 2019 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> 7 6 * Copyright (c) 2017, 2019 Paul Boddie <paul@boddie.org.uk> 7 + * Copyright (c) 2019, 2020 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> 8 8 */ 9 9 10 10 #include <linux/compiler.h> ··· 26 26 #include "pinconf.h" 27 27 #include "pinmux.h" 28 28 29 - #define GPIO_PIN 0x00 30 - #define GPIO_MSK 0x20 29 + #define GPIO_PIN 0x00 30 + #define GPIO_MSK 0x20 31 31 32 - #define JZ4740_GPIO_DATA 0x10 33 - #define JZ4740_GPIO_PULL_DIS 0x30 34 - #define JZ4740_GPIO_FUNC 0x40 35 - #define JZ4740_GPIO_SELECT 0x50 36 - #define JZ4740_GPIO_DIR 0x60 37 - #define JZ4740_GPIO_TRIG 0x70 38 - #define JZ4740_GPIO_FLAG 0x80 32 + #define JZ4730_GPIO_DATA 0x00 33 + #define JZ4730_GPIO_GPDIR 0x04 34 + #define JZ4730_GPIO_GPPUR 0x0c 35 + #define JZ4730_GPIO_GPALR 0x10 36 + #define JZ4730_GPIO_GPAUR 0x14 37 + #define JZ4730_GPIO_GPIDLR 0x18 38 + #define JZ4730_GPIO_GPIDUR 0x1c 39 + #define JZ4730_GPIO_GPIER 0x20 40 + #define JZ4730_GPIO_GPIMR 0x24 41 + #define JZ4730_GPIO_GPFR 0x28 39 42 40 - #define JZ4770_GPIO_INT 0x10 41 - #define JZ4770_GPIO_PAT1 0x30 42 - #define JZ4770_GPIO_PAT0 0x40 43 - #define JZ4770_GPIO_FLAG 0x50 44 - #define JZ4770_GPIO_PEN 0x70 43 + #define JZ4740_GPIO_DATA 0x10 44 + #define JZ4740_GPIO_PULL_DIS 0x30 45 + #define JZ4740_GPIO_FUNC 0x40 46 + #define JZ4740_GPIO_SELECT 0x50 47 + #define JZ4740_GPIO_DIR 0x60 48 + #define JZ4740_GPIO_TRIG 0x70 49 + #define JZ4740_GPIO_FLAG 0x80 45 50 46 - #define X1830_GPIO_PEL 0x110 47 - #define X1830_GPIO_PEH 0x120 51 + #define JZ4770_GPIO_INT 0x10 52 + #define JZ4770_GPIO_PAT1 0x30 53 + #define JZ4770_GPIO_PAT0 0x40 54 + #define JZ4770_GPIO_FLAG 0x50 55 + #define JZ4770_GPIO_PEN 0x70 48 56 49 - #define REG_SET(x) ((x) + 0x4) 50 - #define REG_CLEAR(x) ((x) + 0x8) 57 + #define X1830_GPIO_PEL 0x110 58 + #define X1830_GPIO_PEH 0x120 59 + #define X1830_GPIO_SR 0x150 60 + #define X1830_GPIO_SMT 0x160 51 61 52 - #define REG_PZ_BASE(x) ((x) * 7) 53 - #define REG_PZ_GID2LD(x) ((x) * 7 + 0xf0) 62 + #define X2000_GPIO_EDG 0x70 63 + #define X2000_GPIO_PEPU 0x80 64 + #define X2000_GPIO_PEPD 0x90 65 + #define X2000_GPIO_SR 0xd0 66 + #define X2000_GPIO_SMT 0xe0 54 67 55 - #define GPIO_PULL_DIS 0 56 - #define GPIO_PULL_UP 1 57 - #define GPIO_PULL_DOWN 2 68 + #define REG_SET(x) ((x) + 0x4) 69 + #define REG_CLEAR(x) ((x) + 0x8) 58 70 59 - #define PINS_PER_GPIO_CHIP 32 71 + #define REG_PZ_BASE(x) ((x) * 7) 72 + #define REG_PZ_GID2LD(x) ((x) * 7 + 0xf0) 73 + 74 + #define GPIO_PULL_DIS 0 75 + #define GPIO_PULL_UP 1 76 + #define GPIO_PULL_DOWN 2 77 + 78 + #define PINS_PER_GPIO_CHIP 32 79 + #define JZ4730_PINS_PER_PAIRED_REG 16 80 + 81 + #define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \ 82 + { \ 83 + name, \ 84 + id##_pins, \ 85 + ARRAY_SIZE(id##_pins), \ 86 + funcs, \ 87 + } 88 + 89 + #define INGENIC_PIN_GROUP(name, id, func) \ 90 + INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) 60 91 61 92 enum jz_version { 93 + ID_JZ4730, 62 94 ID_JZ4740, 63 95 ID_JZ4725B, 96 + ID_JZ4750, 97 + ID_JZ4755, 64 98 ID_JZ4760, 65 99 ID_JZ4770, 100 + ID_JZ4775, 66 101 ID_JZ4780, 67 102 ID_X1000, 68 103 ID_X1500, 69 104 ID_X1830, 105 + ID_X2000, 70 106 }; 71 107 72 108 struct ingenic_chip_info { ··· 135 99 unsigned int irq, reg_base; 136 100 }; 137 101 102 + static const u32 jz4730_pull_ups[4] = { 103 + 0x3fa3320f, 0xf200ffff, 0xffffffff, 0xffffffff, 104 + }; 105 + 106 + static const u32 jz4730_pull_downs[4] = { 107 + 0x00000df0, 0x0dff0000, 0x00000000, 0x00000000, 108 + }; 109 + 110 + static int jz4730_mmc_1bit_pins[] = { 0x27, 0x26, 0x22, }; 111 + static int jz4730_mmc_4bit_pins[] = { 0x23, 0x24, 0x25, }; 112 + static int jz4730_uart0_data_pins[] = { 0x7e, 0x7f, }; 113 + static int jz4730_uart1_data_pins[] = { 0x18, 0x19, }; 114 + static int jz4730_uart2_data_pins[] = { 0x6f, 0x7d, }; 115 + static int jz4730_uart3_data_pins[] = { 0x10, 0x15, }; 116 + static int jz4730_uart3_hwflow_pins[] = { 0x11, 0x17, }; 117 + static int jz4730_lcd_8bit_pins[] = { 118 + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 119 + 0x3a, 0x39, 0x38, 120 + }; 121 + static int jz4730_lcd_16bit_pins[] = { 122 + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 123 + }; 124 + static int jz4730_lcd_special_pins[] = { 0x3d, 0x3c, 0x3e, 0x3f, }; 125 + static int jz4730_lcd_generic_pins[] = { 0x3b, }; 126 + static int jz4730_nand_cs1_pins[] = { 0x53, }; 127 + static int jz4730_nand_cs2_pins[] = { 0x54, }; 128 + static int jz4730_nand_cs3_pins[] = { 0x55, }; 129 + static int jz4730_nand_cs4_pins[] = { 0x56, }; 130 + static int jz4730_nand_cs5_pins[] = { 0x57, }; 131 + static int jz4730_pwm_pwm0_pins[] = { 0x5e, }; 132 + static int jz4730_pwm_pwm1_pins[] = { 0x5f, }; 133 + 134 + static u8 jz4730_lcd_8bit_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, }; 135 + 136 + static const struct group_desc jz4730_groups[] = { 137 + INGENIC_PIN_GROUP("mmc-1bit", jz4730_mmc_1bit, 1), 138 + INGENIC_PIN_GROUP("mmc-4bit", jz4730_mmc_4bit, 1), 139 + INGENIC_PIN_GROUP("uart0-data", jz4730_uart0_data, 1), 140 + INGENIC_PIN_GROUP("uart1-data", jz4730_uart1_data, 1), 141 + INGENIC_PIN_GROUP("uart2-data", jz4730_uart2_data, 1), 142 + INGENIC_PIN_GROUP("uart3-data", jz4730_uart3_data, 1), 143 + INGENIC_PIN_GROUP("uart3-hwflow", jz4730_uart3_hwflow, 1), 144 + INGENIC_PIN_GROUP_FUNCS("lcd-8bit", jz4730_lcd_8bit, jz4730_lcd_8bit_funcs), 145 + INGENIC_PIN_GROUP("lcd-16bit", jz4730_lcd_16bit, 1), 146 + INGENIC_PIN_GROUP("lcd-special", jz4730_lcd_special, 1), 147 + INGENIC_PIN_GROUP("lcd-generic", jz4730_lcd_generic, 1), 148 + INGENIC_PIN_GROUP("nand-cs1", jz4730_nand_cs1, 1), 149 + INGENIC_PIN_GROUP("nand-cs2", jz4730_nand_cs2, 1), 150 + INGENIC_PIN_GROUP("nand-cs3", jz4730_nand_cs3, 1), 151 + INGENIC_PIN_GROUP("nand-cs4", jz4730_nand_cs4, 1), 152 + INGENIC_PIN_GROUP("nand-cs5", jz4730_nand_cs5, 1), 153 + INGENIC_PIN_GROUP("pwm0", jz4730_pwm_pwm0, 1), 154 + INGENIC_PIN_GROUP("pwm1", jz4730_pwm_pwm1, 1), 155 + }; 156 + 157 + static const char *jz4730_mmc_groups[] = { "mmc-1bit", "mmc-4bit", }; 158 + static const char *jz4730_uart0_groups[] = { "uart0-data", }; 159 + static const char *jz4730_uart1_groups[] = { "uart1-data", }; 160 + static const char *jz4730_uart2_groups[] = { "uart2-data", }; 161 + static const char *jz4730_uart3_groups[] = { "uart3-data", "uart3-hwflow", }; 162 + static const char *jz4730_lcd_groups[] = { 163 + "lcd-8bit", "lcd-16bit", "lcd-special", "lcd-generic", 164 + }; 165 + static const char *jz4730_nand_groups[] = { 166 + "nand-cs1", "nand-cs2", "nand-cs3", "nand-cs4", "nand-cs5", 167 + }; 168 + static const char *jz4730_pwm0_groups[] = { "pwm0", }; 169 + static const char *jz4730_pwm1_groups[] = { "pwm1", }; 170 + 171 + static const struct function_desc jz4730_functions[] = { 172 + { "mmc", jz4730_mmc_groups, ARRAY_SIZE(jz4730_mmc_groups), }, 173 + { "uart0", jz4730_uart0_groups, ARRAY_SIZE(jz4730_uart0_groups), }, 174 + { "uart1", jz4730_uart1_groups, ARRAY_SIZE(jz4730_uart1_groups), }, 175 + { "uart2", jz4730_uart2_groups, ARRAY_SIZE(jz4730_uart2_groups), }, 176 + { "uart3", jz4730_uart3_groups, ARRAY_SIZE(jz4730_uart3_groups), }, 177 + { "lcd", jz4730_lcd_groups, ARRAY_SIZE(jz4730_lcd_groups), }, 178 + { "nand", jz4730_nand_groups, ARRAY_SIZE(jz4730_nand_groups), }, 179 + { "pwm0", jz4730_pwm0_groups, ARRAY_SIZE(jz4730_pwm0_groups), }, 180 + { "pwm1", jz4730_pwm1_groups, ARRAY_SIZE(jz4730_pwm1_groups), }, 181 + }; 182 + 183 + static const struct ingenic_chip_info jz4730_chip_info = { 184 + .num_chips = 4, 185 + .reg_offset = 0x30, 186 + .version = ID_JZ4730, 187 + .groups = jz4730_groups, 188 + .num_groups = ARRAY_SIZE(jz4730_groups), 189 + .functions = jz4730_functions, 190 + .num_functions = ARRAY_SIZE(jz4730_functions), 191 + .pull_ups = jz4730_pull_ups, 192 + .pull_downs = jz4730_pull_downs, 193 + }; 194 + 138 195 static const u32 jz4740_pull_ups[4] = { 139 196 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 140 197 }; ··· 242 113 static int jz4740_uart0_hwflow_pins[] = { 0x7e, 0x7f, }; 243 114 static int jz4740_uart1_data_pins[] = { 0x7e, 0x7f, }; 244 115 static int jz4740_lcd_8bit_pins[] = { 245 - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x52, 0x53, 0x54, 116 + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 117 + 0x52, 0x53, 0x54, 246 118 }; 247 119 static int jz4740_lcd_16bit_pins[] = { 248 - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x55, 120 + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 249 121 }; 250 122 static int jz4740_lcd_18bit_pins[] = { 0x50, 0x51, }; 251 - static int jz4740_lcd_18bit_tft_pins[] = { 0x56, 0x57, 0x31, 0x32, }; 123 + static int jz4740_lcd_special_pins[] = { 0x31, 0x32, 0x56, 0x57, }; 124 + static int jz4740_lcd_generic_pins[] = { 0x55, }; 252 125 static int jz4740_nand_cs1_pins[] = { 0x39, }; 253 126 static int jz4740_nand_cs2_pins[] = { 0x3a, }; 254 127 static int jz4740_nand_cs3_pins[] = { 0x3b, }; ··· 265 134 static int jz4740_pwm_pwm6_pins[] = { 0x7e, }; 266 135 static int jz4740_pwm_pwm7_pins[] = { 0x7f, }; 267 136 268 - 269 - #define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \ 270 - { \ 271 - name, \ 272 - id##_pins, \ 273 - ARRAY_SIZE(id##_pins), \ 274 - funcs, \ 275 - } 276 - 277 - #define INGENIC_PIN_GROUP(name, id, func) \ 278 - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) 279 - 280 137 static const struct group_desc jz4740_groups[] = { 281 138 INGENIC_PIN_GROUP("mmc-1bit", jz4740_mmc_1bit, 0), 282 139 INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0), ··· 274 155 INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0), 275 156 INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0), 276 157 INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0), 277 - INGENIC_PIN_GROUP("lcd-18bit-tft", jz4740_lcd_18bit_tft, 0), 278 - { "lcd-no-pins", }, 158 + INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0), 159 + INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0), 279 160 INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0), 280 161 INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0), 281 162 INGENIC_PIN_GROUP("nand-cs3", jz4740_nand_cs3, 0), ··· 295 176 static const char *jz4740_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 296 177 static const char *jz4740_uart1_groups[] = { "uart1-data", }; 297 178 static const char *jz4740_lcd_groups[] = { 298 - "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-18bit-tft", "lcd-no-pins", 179 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-special", "lcd-generic", 299 180 }; 300 181 static const char *jz4740_nand_groups[] = { 301 182 "nand-cs1", "nand-cs2", "nand-cs3", "nand-cs4", "nand-fre-fwe", ··· 342 223 static int jz4725b_mmc1_1bit_pins[] = { 0x7a, 0x7b, 0x7c, }; 343 224 static int jz4725b_mmc1_4bit_pins[] = { 0x7d, 0x7e, 0x7f, }; 344 225 static int jz4725b_uart_data_pins[] = { 0x4c, 0x4d, }; 226 + static int jz4725b_lcd_8bit_pins[] = { 227 + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 228 + 0x72, 0x73, 0x74, 229 + }; 230 + static int jz4725b_lcd_16bit_pins[] = { 231 + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 232 + }; 233 + static int jz4725b_lcd_18bit_pins[] = { 0x70, 0x71, }; 234 + static int jz4725b_lcd_24bit_pins[] = { 0x76, 0x77, 0x78, 0x79, }; 235 + static int jz4725b_lcd_special_pins[] = { 0x76, 0x77, 0x78, 0x79, }; 236 + static int jz4725b_lcd_generic_pins[] = { 0x75, }; 345 237 static int jz4725b_nand_cs1_pins[] = { 0x55, }; 346 238 static int jz4725b_nand_cs2_pins[] = { 0x56, }; 347 239 static int jz4725b_nand_cs3_pins[] = { 0x57, }; ··· 365 235 static int jz4725b_pwm_pwm3_pins[] = { 0x4d, }; 366 236 static int jz4725b_pwm_pwm4_pins[] = { 0x4e, }; 367 237 static int jz4725b_pwm_pwm5_pins[] = { 0x4f, }; 368 - static int jz4725b_lcd_8bit_pins[] = { 369 - 0x72, 0x73, 0x74, 370 - 0x60, 0x61, 0x62, 0x63, 371 - 0x64, 0x65, 0x66, 0x67, 372 - }; 373 - static int jz4725b_lcd_16bit_pins[] = { 374 - 0x68, 0x69, 0x6a, 0x6b, 375 - 0x6c, 0x6d, 0x6e, 0x6f, 376 - }; 377 - static int jz4725b_lcd_18bit_pins[] = { 0x70, 0x71, }; 378 - static int jz4725b_lcd_24bit_pins[] = { 0x76, 0x77, 0x78, 0x79, }; 379 - static int jz4725b_lcd_special_pins[] = { 0x76, 0x77, 0x78, 0x79, }; 380 - static int jz4725b_lcd_generic_pins[] = { 0x75, }; 381 238 382 239 static u8 jz4725b_mmc0_4bit_funcs[] = { 1, 0, 1, }; 383 240 ··· 375 258 INGENIC_PIN_GROUP("mmc1-1bit", jz4725b_mmc1_1bit, 0), 376 259 INGENIC_PIN_GROUP("mmc1-4bit", jz4725b_mmc1_4bit, 0), 377 260 INGENIC_PIN_GROUP("uart-data", jz4725b_uart_data, 1), 261 + INGENIC_PIN_GROUP("lcd-8bit", jz4725b_lcd_8bit, 0), 262 + INGENIC_PIN_GROUP("lcd-16bit", jz4725b_lcd_16bit, 0), 263 + INGENIC_PIN_GROUP("lcd-18bit", jz4725b_lcd_18bit, 0), 264 + INGENIC_PIN_GROUP("lcd-24bit", jz4725b_lcd_24bit, 1), 265 + INGENIC_PIN_GROUP("lcd-special", jz4725b_lcd_special, 0), 266 + INGENIC_PIN_GROUP("lcd-generic", jz4725b_lcd_generic, 0), 378 267 INGENIC_PIN_GROUP("nand-cs1", jz4725b_nand_cs1, 0), 379 268 INGENIC_PIN_GROUP("nand-cs2", jz4725b_nand_cs2, 0), 380 269 INGENIC_PIN_GROUP("nand-cs3", jz4725b_nand_cs3, 0), ··· 393 270 INGENIC_PIN_GROUP("pwm3", jz4725b_pwm_pwm3, 0), 394 271 INGENIC_PIN_GROUP("pwm4", jz4725b_pwm_pwm4, 0), 395 272 INGENIC_PIN_GROUP("pwm5", jz4725b_pwm_pwm5, 0), 396 - INGENIC_PIN_GROUP("lcd-8bit", jz4725b_lcd_8bit, 0), 397 - INGENIC_PIN_GROUP("lcd-16bit", jz4725b_lcd_16bit, 0), 398 - INGENIC_PIN_GROUP("lcd-18bit", jz4725b_lcd_18bit, 0), 399 - INGENIC_PIN_GROUP("lcd-24bit", jz4725b_lcd_24bit, 1), 400 - INGENIC_PIN_GROUP("lcd-special", jz4725b_lcd_special, 0), 401 - INGENIC_PIN_GROUP("lcd-generic", jz4725b_lcd_generic, 0), 402 273 }; 403 274 404 275 static const char *jz4725b_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", }; 405 276 static const char *jz4725b_mmc1_groups[] = { "mmc1-1bit", "mmc1-4bit", }; 406 277 static const char *jz4725b_uart_groups[] = { "uart-data", }; 278 + static const char *jz4725b_lcd_groups[] = { 279 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 280 + "lcd-special", "lcd-generic", 281 + }; 407 282 static const char *jz4725b_nand_groups[] = { 408 283 "nand-cs1", "nand-cs2", "nand-cs3", "nand-cs4", 409 284 "nand-cle-ale", "nand-fre-fwe", ··· 412 291 static const char *jz4725b_pwm3_groups[] = { "pwm3", }; 413 292 static const char *jz4725b_pwm4_groups[] = { "pwm4", }; 414 293 static const char *jz4725b_pwm5_groups[] = { "pwm5", }; 415 - static const char *jz4725b_lcd_groups[] = { 416 - "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 417 - "lcd-special", "lcd-generic", 418 - }; 419 294 420 295 static const struct function_desc jz4725b_functions[] = { 421 296 { "mmc0", jz4725b_mmc0_groups, ARRAY_SIZE(jz4725b_mmc0_groups), }, ··· 437 320 .num_functions = ARRAY_SIZE(jz4725b_functions), 438 321 .pull_ups = jz4740_pull_ups, 439 322 .pull_downs = jz4740_pull_downs, 323 + }; 324 + 325 + static const u32 jz4750_pull_ups[6] = { 326 + 0xffffffff, 0xffffffff, 0x3fffffff, 0x7fffffff, 0x1fff3fff, 0x00ffffff, 327 + }; 328 + 329 + static const u32 jz4750_pull_downs[6] = { 330 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 331 + }; 332 + 333 + static int jz4750_uart0_data_pins[] = { 0xa4, 0xa5, }; 334 + static int jz4750_uart0_hwflow_pins[] = { 0xa6, 0xa7, }; 335 + static int jz4750_uart1_data_pins[] = { 0x90, 0x91, }; 336 + static int jz4750_uart1_hwflow_pins[] = { 0x92, 0x93, }; 337 + static int jz4750_uart2_data_pins[] = { 0x9b, 0x9a, }; 338 + static int jz4750_uart3_data_pins[] = { 0xb0, 0xb1, }; 339 + static int jz4750_uart3_hwflow_pins[] = { 0xb2, 0xb3, }; 340 + static int jz4750_mmc0_1bit_pins[] = { 0xa8, 0xa9, 0xa0, }; 341 + static int jz4750_mmc0_4bit_pins[] = { 0xa1, 0xa2, 0xa3, }; 342 + static int jz4750_mmc0_8bit_pins[] = { 0xa4, 0xa5, 0xa6, 0xa7, }; 343 + static int jz4750_mmc1_1bit_pins[] = { 0xae, 0xaf, 0xaa, }; 344 + static int jz4750_mmc1_4bit_pins[] = { 0xab, 0xac, 0xad, }; 345 + static int jz4750_i2c_pins[] = { 0x8c, 0x8d, }; 346 + static int jz4750_cim_pins[] = { 347 + 0x89, 0x8b, 0x8a, 0x88, 348 + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 349 + }; 350 + static int jz4750_lcd_8bit_pins[] = { 351 + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 352 + 0x72, 0x73, 0x74, 353 + }; 354 + static int jz4750_lcd_16bit_pins[] = { 355 + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 356 + }; 357 + static int jz4750_lcd_18bit_pins[] = { 0x70, 0x71, }; 358 + static int jz4750_lcd_24bit_pins[] = { 0x76, 0x77, 0x78, 0x79, 0xb2, 0xb3, }; 359 + static int jz4750_lcd_special_pins[] = { 0x76, 0x77, 0x78, 0x79, }; 360 + static int jz4750_lcd_generic_pins[] = { 0x75, }; 361 + static int jz4750_nand_cs1_pins[] = { 0x55, }; 362 + static int jz4750_nand_cs2_pins[] = { 0x56, }; 363 + static int jz4750_nand_cs3_pins[] = { 0x57, }; 364 + static int jz4750_nand_cs4_pins[] = { 0x58, }; 365 + static int jz4750_nand_fre_fwe_pins[] = { 0x5c, 0x5d, }; 366 + static int jz4750_pwm_pwm0_pins[] = { 0x94, }; 367 + static int jz4750_pwm_pwm1_pins[] = { 0x95, }; 368 + static int jz4750_pwm_pwm2_pins[] = { 0x96, }; 369 + static int jz4750_pwm_pwm3_pins[] = { 0x97, }; 370 + static int jz4750_pwm_pwm4_pins[] = { 0x98, }; 371 + static int jz4750_pwm_pwm5_pins[] = { 0x99, }; 372 + 373 + static const struct group_desc jz4750_groups[] = { 374 + INGENIC_PIN_GROUP("uart0-data", jz4750_uart0_data, 1), 375 + INGENIC_PIN_GROUP("uart0-hwflow", jz4750_uart0_hwflow, 1), 376 + INGENIC_PIN_GROUP("uart1-data", jz4750_uart1_data, 0), 377 + INGENIC_PIN_GROUP("uart1-hwflow", jz4750_uart1_hwflow, 0), 378 + INGENIC_PIN_GROUP("uart2-data", jz4750_uart2_data, 1), 379 + INGENIC_PIN_GROUP("uart3-data", jz4750_uart3_data, 0), 380 + INGENIC_PIN_GROUP("uart3-hwflow", jz4750_uart3_hwflow, 0), 381 + INGENIC_PIN_GROUP("mmc0-1bit", jz4750_mmc0_1bit, 0), 382 + INGENIC_PIN_GROUP("mmc0-4bit", jz4750_mmc0_4bit, 0), 383 + INGENIC_PIN_GROUP("mmc0-8bit", jz4750_mmc0_8bit, 0), 384 + INGENIC_PIN_GROUP("mmc1-1bit", jz4750_mmc1_1bit, 0), 385 + INGENIC_PIN_GROUP("mmc1-4bit", jz4750_mmc1_4bit, 0), 386 + INGENIC_PIN_GROUP("i2c-data", jz4750_i2c, 0), 387 + INGENIC_PIN_GROUP("cim-data", jz4750_cim, 0), 388 + INGENIC_PIN_GROUP("lcd-8bit", jz4750_lcd_8bit, 0), 389 + INGENIC_PIN_GROUP("lcd-16bit", jz4750_lcd_16bit, 0), 390 + INGENIC_PIN_GROUP("lcd-18bit", jz4750_lcd_18bit, 0), 391 + INGENIC_PIN_GROUP("lcd-24bit", jz4750_lcd_24bit, 1), 392 + INGENIC_PIN_GROUP("lcd-special", jz4750_lcd_special, 0), 393 + INGENIC_PIN_GROUP("lcd-generic", jz4750_lcd_generic, 0), 394 + INGENIC_PIN_GROUP("nand-cs1", jz4750_nand_cs1, 0), 395 + INGENIC_PIN_GROUP("nand-cs2", jz4750_nand_cs2, 0), 396 + INGENIC_PIN_GROUP("nand-cs3", jz4750_nand_cs3, 0), 397 + INGENIC_PIN_GROUP("nand-cs4", jz4750_nand_cs4, 0), 398 + INGENIC_PIN_GROUP("nand-fre-fwe", jz4750_nand_fre_fwe, 0), 399 + INGENIC_PIN_GROUP("pwm0", jz4750_pwm_pwm0, 0), 400 + INGENIC_PIN_GROUP("pwm1", jz4750_pwm_pwm1, 0), 401 + INGENIC_PIN_GROUP("pwm2", jz4750_pwm_pwm2, 0), 402 + INGENIC_PIN_GROUP("pwm3", jz4750_pwm_pwm3, 0), 403 + INGENIC_PIN_GROUP("pwm4", jz4750_pwm_pwm4, 0), 404 + INGENIC_PIN_GROUP("pwm5", jz4750_pwm_pwm5, 0), 405 + }; 406 + 407 + static const char *jz4750_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 408 + static const char *jz4750_uart1_groups[] = { "uart1-data", "uart1-hwflow", }; 409 + static const char *jz4750_uart2_groups[] = { "uart2-data", }; 410 + static const char *jz4750_uart3_groups[] = { "uart3-data", "uart3-hwflow", }; 411 + static const char *jz4750_mmc0_groups[] = { 412 + "mmc0-1bit", "mmc0-4bit", "mmc0-8bit", 413 + }; 414 + static const char *jz4750_mmc1_groups[] = { "mmc0-1bit", "mmc0-4bit", }; 415 + static const char *jz4750_i2c_groups[] = { "i2c-data", }; 416 + static const char *jz4750_cim_groups[] = { "cim-data", }; 417 + static const char *jz4750_lcd_groups[] = { 418 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 419 + "lcd-special", "lcd-generic", 420 + }; 421 + static const char *jz4750_nand_groups[] = { 422 + "nand-cs1", "nand-cs2", "nand-cs3", "nand-cs4", "nand-fre-fwe", 423 + }; 424 + static const char *jz4750_pwm0_groups[] = { "pwm0", }; 425 + static const char *jz4750_pwm1_groups[] = { "pwm1", }; 426 + static const char *jz4750_pwm2_groups[] = { "pwm2", }; 427 + static const char *jz4750_pwm3_groups[] = { "pwm3", }; 428 + static const char *jz4750_pwm4_groups[] = { "pwm4", }; 429 + static const char *jz4750_pwm5_groups[] = { "pwm5", }; 430 + 431 + static const struct function_desc jz4750_functions[] = { 432 + { "uart0", jz4750_uart0_groups, ARRAY_SIZE(jz4750_uart0_groups), }, 433 + { "uart1", jz4750_uart1_groups, ARRAY_SIZE(jz4750_uart1_groups), }, 434 + { "uart2", jz4750_uart2_groups, ARRAY_SIZE(jz4750_uart2_groups), }, 435 + { "uart3", jz4750_uart3_groups, ARRAY_SIZE(jz4750_uart3_groups), }, 436 + { "mmc0", jz4750_mmc0_groups, ARRAY_SIZE(jz4750_mmc0_groups), }, 437 + { "mmc1", jz4750_mmc1_groups, ARRAY_SIZE(jz4750_mmc1_groups), }, 438 + { "i2c", jz4750_i2c_groups, ARRAY_SIZE(jz4750_i2c_groups), }, 439 + { "cim", jz4750_cim_groups, ARRAY_SIZE(jz4750_cim_groups), }, 440 + { "lcd", jz4750_lcd_groups, ARRAY_SIZE(jz4750_lcd_groups), }, 441 + { "nand", jz4750_nand_groups, ARRAY_SIZE(jz4750_nand_groups), }, 442 + { "pwm0", jz4750_pwm0_groups, ARRAY_SIZE(jz4750_pwm0_groups), }, 443 + { "pwm1", jz4750_pwm1_groups, ARRAY_SIZE(jz4750_pwm1_groups), }, 444 + { "pwm2", jz4750_pwm2_groups, ARRAY_SIZE(jz4750_pwm2_groups), }, 445 + { "pwm3", jz4750_pwm3_groups, ARRAY_SIZE(jz4750_pwm3_groups), }, 446 + { "pwm4", jz4750_pwm4_groups, ARRAY_SIZE(jz4750_pwm4_groups), }, 447 + { "pwm5", jz4750_pwm5_groups, ARRAY_SIZE(jz4750_pwm5_groups), }, 448 + }; 449 + 450 + static const struct ingenic_chip_info jz4750_chip_info = { 451 + .num_chips = 6, 452 + .reg_offset = 0x100, 453 + .version = ID_JZ4750, 454 + .groups = jz4750_groups, 455 + .num_groups = ARRAY_SIZE(jz4750_groups), 456 + .functions = jz4750_functions, 457 + .num_functions = ARRAY_SIZE(jz4750_functions), 458 + .pull_ups = jz4750_pull_ups, 459 + .pull_downs = jz4750_pull_downs, 460 + }; 461 + 462 + static const u32 jz4755_pull_ups[6] = { 463 + 0xffffffff, 0xffffffff, 0x0fffffff, 0xffffffff, 0x33dc3fff, 0x0000fc00, 464 + }; 465 + 466 + static const u32 jz4755_pull_downs[6] = { 467 + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 468 + }; 469 + 470 + static int jz4755_uart0_data_pins[] = { 0x7c, 0x7d, }; 471 + static int jz4755_uart0_hwflow_pins[] = { 0x7e, 0x7f, }; 472 + static int jz4755_uart1_data_pins[] = { 0x97, 0x99, }; 473 + static int jz4755_uart2_data_pins[] = { 0x9f, }; 474 + static int jz4755_mmc0_1bit_pins[] = { 0x2f, 0x50, 0x5c, }; 475 + static int jz4755_mmc0_4bit_pins[] = { 0x5d, 0x5b, 0x51, }; 476 + static int jz4755_mmc1_1bit_pins[] = { 0x3a, 0x3d, 0x3c, }; 477 + static int jz4755_mmc1_4bit_pins[] = { 0x3b, 0x3e, 0x3f, }; 478 + static int jz4755_i2c_pins[] = { 0x8c, 0x8d, }; 479 + static int jz4755_cim_pins[] = { 480 + 0x89, 0x8b, 0x8a, 0x88, 481 + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 482 + }; 483 + static int jz4755_lcd_8bit_pins[] = { 484 + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 485 + 0x72, 0x73, 0x74, 486 + }; 487 + static int jz4755_lcd_16bit_pins[] = { 488 + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 489 + }; 490 + static int jz4755_lcd_18bit_pins[] = { 0x70, 0x71, }; 491 + static int jz4755_lcd_24bit_pins[] = { 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, }; 492 + static int jz4755_lcd_special_pins[] = { 0x76, 0x77, 0x78, 0x79, }; 493 + static int jz4755_lcd_generic_pins[] = { 0x75, }; 494 + static int jz4755_nand_cs1_pins[] = { 0x55, }; 495 + static int jz4755_nand_cs2_pins[] = { 0x56, }; 496 + static int jz4755_nand_cs3_pins[] = { 0x57, }; 497 + static int jz4755_nand_cs4_pins[] = { 0x58, }; 498 + static int jz4755_nand_fre_fwe_pins[] = { 0x5c, 0x5d, }; 499 + static int jz4755_pwm_pwm0_pins[] = { 0x94, }; 500 + static int jz4755_pwm_pwm1_pins[] = { 0xab, }; 501 + static int jz4755_pwm_pwm2_pins[] = { 0x96, }; 502 + static int jz4755_pwm_pwm3_pins[] = { 0x97, }; 503 + static int jz4755_pwm_pwm4_pins[] = { 0x98, }; 504 + static int jz4755_pwm_pwm5_pins[] = { 0x99, }; 505 + 506 + static u8 jz4755_mmc0_1bit_funcs[] = { 2, 2, 1, }; 507 + static u8 jz4755_mmc0_4bit_funcs[] = { 1, 0, 1, }; 508 + static u8 jz4755_lcd_24bit_funcs[] = { 1, 1, 1, 1, 0, 0, }; 509 + 510 + static const struct group_desc jz4755_groups[] = { 511 + INGENIC_PIN_GROUP("uart0-data", jz4755_uart0_data, 0), 512 + INGENIC_PIN_GROUP("uart0-hwflow", jz4755_uart0_hwflow, 0), 513 + INGENIC_PIN_GROUP("uart1-data", jz4755_uart1_data, 0), 514 + INGENIC_PIN_GROUP("uart2-data", jz4755_uart2_data, 1), 515 + INGENIC_PIN_GROUP_FUNCS("mmc0-1bit", jz4755_mmc0_1bit, 516 + jz4755_mmc0_1bit_funcs), 517 + INGENIC_PIN_GROUP_FUNCS("mmc0-4bit", jz4755_mmc0_4bit, 518 + jz4755_mmc0_4bit_funcs), 519 + INGENIC_PIN_GROUP("mmc1-1bit", jz4755_mmc1_1bit, 1), 520 + INGENIC_PIN_GROUP("mmc1-4bit", jz4755_mmc1_4bit, 1), 521 + INGENIC_PIN_GROUP("i2c-data", jz4755_i2c, 0), 522 + INGENIC_PIN_GROUP("cim-data", jz4755_cim, 0), 523 + INGENIC_PIN_GROUP("lcd-8bit", jz4755_lcd_8bit, 0), 524 + INGENIC_PIN_GROUP("lcd-16bit", jz4755_lcd_16bit, 0), 525 + INGENIC_PIN_GROUP("lcd-18bit", jz4755_lcd_18bit, 0), 526 + INGENIC_PIN_GROUP_FUNCS("lcd-24bit", jz4755_lcd_24bit, 527 + jz4755_lcd_24bit_funcs), 528 + INGENIC_PIN_GROUP("lcd-special", jz4755_lcd_special, 0), 529 + INGENIC_PIN_GROUP("lcd-generic", jz4755_lcd_generic, 0), 530 + INGENIC_PIN_GROUP("nand-cs1", jz4755_nand_cs1, 0), 531 + INGENIC_PIN_GROUP("nand-cs2", jz4755_nand_cs2, 0), 532 + INGENIC_PIN_GROUP("nand-cs3", jz4755_nand_cs3, 0), 533 + INGENIC_PIN_GROUP("nand-cs4", jz4755_nand_cs4, 0), 534 + INGENIC_PIN_GROUP("nand-fre-fwe", jz4755_nand_fre_fwe, 0), 535 + INGENIC_PIN_GROUP("pwm0", jz4755_pwm_pwm0, 0), 536 + INGENIC_PIN_GROUP("pwm1", jz4755_pwm_pwm1, 1), 537 + INGENIC_PIN_GROUP("pwm2", jz4755_pwm_pwm2, 0), 538 + INGENIC_PIN_GROUP("pwm3", jz4755_pwm_pwm3, 0), 539 + INGENIC_PIN_GROUP("pwm4", jz4755_pwm_pwm4, 0), 540 + INGENIC_PIN_GROUP("pwm5", jz4755_pwm_pwm5, 0), 541 + }; 542 + 543 + static const char *jz4755_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 544 + static const char *jz4755_uart1_groups[] = { "uart1-data", }; 545 + static const char *jz4755_uart2_groups[] = { "uart2-data", }; 546 + static const char *jz4755_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", }; 547 + static const char *jz4755_mmc1_groups[] = { "mmc0-1bit", "mmc0-4bit", }; 548 + static const char *jz4755_i2c_groups[] = { "i2c-data", }; 549 + static const char *jz4755_cim_groups[] = { "cim-data", }; 550 + static const char *jz4755_lcd_groups[] = { 551 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 552 + "lcd-special", "lcd-generic", 553 + }; 554 + static const char *jz4755_nand_groups[] = { 555 + "nand-cs1", "nand-cs2", "nand-cs3", "nand-cs4", "nand-fre-fwe", 556 + }; 557 + static const char *jz4755_pwm0_groups[] = { "pwm0", }; 558 + static const char *jz4755_pwm1_groups[] = { "pwm1", }; 559 + static const char *jz4755_pwm2_groups[] = { "pwm2", }; 560 + static const char *jz4755_pwm3_groups[] = { "pwm3", }; 561 + static const char *jz4755_pwm4_groups[] = { "pwm4", }; 562 + static const char *jz4755_pwm5_groups[] = { "pwm5", }; 563 + 564 + static const struct function_desc jz4755_functions[] = { 565 + { "uart0", jz4755_uart0_groups, ARRAY_SIZE(jz4755_uart0_groups), }, 566 + { "uart1", jz4755_uart1_groups, ARRAY_SIZE(jz4755_uart1_groups), }, 567 + { "uart2", jz4755_uart2_groups, ARRAY_SIZE(jz4755_uart2_groups), }, 568 + { "mmc0", jz4755_mmc0_groups, ARRAY_SIZE(jz4755_mmc0_groups), }, 569 + { "mmc1", jz4755_mmc1_groups, ARRAY_SIZE(jz4755_mmc1_groups), }, 570 + { "i2c", jz4755_i2c_groups, ARRAY_SIZE(jz4755_i2c_groups), }, 571 + { "cim", jz4755_cim_groups, ARRAY_SIZE(jz4755_cim_groups), }, 572 + { "lcd", jz4755_lcd_groups, ARRAY_SIZE(jz4755_lcd_groups), }, 573 + { "nand", jz4755_nand_groups, ARRAY_SIZE(jz4755_nand_groups), }, 574 + { "pwm0", jz4755_pwm0_groups, ARRAY_SIZE(jz4755_pwm0_groups), }, 575 + { "pwm1", jz4755_pwm1_groups, ARRAY_SIZE(jz4755_pwm1_groups), }, 576 + { "pwm2", jz4755_pwm2_groups, ARRAY_SIZE(jz4755_pwm2_groups), }, 577 + { "pwm3", jz4755_pwm3_groups, ARRAY_SIZE(jz4755_pwm3_groups), }, 578 + { "pwm4", jz4755_pwm4_groups, ARRAY_SIZE(jz4755_pwm4_groups), }, 579 + { "pwm5", jz4755_pwm5_groups, ARRAY_SIZE(jz4755_pwm5_groups), }, 580 + }; 581 + 582 + static const struct ingenic_chip_info jz4755_chip_info = { 583 + .num_chips = 6, 584 + .reg_offset = 0x100, 585 + .version = ID_JZ4755, 586 + .groups = jz4755_groups, 587 + .num_groups = ARRAY_SIZE(jz4755_groups), 588 + .functions = jz4755_functions, 589 + .num_functions = ARRAY_SIZE(jz4755_functions), 590 + .pull_ups = jz4755_pull_ups, 591 + .pull_downs = jz4755_pull_downs, 440 592 }; 441 593 442 594 static const u32 jz4760_pull_ups[6] = { ··· 775 389 static int jz4760_lcd_24bit_pins[] = { 776 390 0x40, 0x41, 0x4a, 0x4b, 0x54, 0x55, 777 391 }; 778 - static int jz4760_lcd_special_pins[] = { 0x40, 0x41, 0x4a, 0x54 }; 392 + static int jz4760_lcd_special_pins[] = { 0x54, 0x4a, 0x41, 0x40, }; 779 393 static int jz4760_lcd_generic_pins[] = { 0x49, }; 780 394 static int jz4760_pwm_pwm0_pins[] = { 0x80, }; 781 395 static int jz4760_pwm_pwm1_pins[] = { 0x81, }; ··· 836 450 INGENIC_PIN_GROUP("lcd-16bit", jz4760_lcd_16bit, 0), 837 451 INGENIC_PIN_GROUP("lcd-18bit", jz4760_lcd_18bit, 0), 838 452 INGENIC_PIN_GROUP("lcd-24bit", jz4760_lcd_24bit, 0), 839 - INGENIC_PIN_GROUP("lcd-generic", jz4760_lcd_generic, 0), 840 453 INGENIC_PIN_GROUP("lcd-special", jz4760_lcd_special, 1), 454 + INGENIC_PIN_GROUP("lcd-generic", jz4760_lcd_generic, 0), 841 455 INGENIC_PIN_GROUP("pwm0", jz4760_pwm_pwm0, 0), 842 456 INGENIC_PIN_GROUP("pwm1", jz4760_pwm_pwm1, 0), 843 457 INGENIC_PIN_GROUP("pwm2", jz4760_pwm_pwm2, 0), ··· 1034 648 }; 1035 649 static int jz4770_lcd_8bit_pins[] = { 1036 650 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x4c, 0x4d, 1037 - 0x48, 0x49, 0x52, 0x53, 651 + 0x48, 0x52, 0x53, 652 + }; 653 + static int jz4770_lcd_16bit_pins[] = { 654 + 0x4e, 0x4f, 0x50, 0x51, 0x56, 0x57, 0x58, 0x59, 655 + }; 656 + static int jz4770_lcd_18bit_pins[] = { 657 + 0x5a, 0x5b, 1038 658 }; 1039 659 static int jz4770_lcd_24bit_pins[] = { 1040 660 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, ··· 1048 656 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 1049 657 0x58, 0x59, 0x5a, 0x5b, 1050 658 }; 659 + static int jz4770_lcd_special_pins[] = { 0x54, 0x4a, 0x41, 0x40, }; 660 + static int jz4770_lcd_generic_pins[] = { 0x49, }; 1051 661 static int jz4770_pwm_pwm0_pins[] = { 0x80, }; 1052 662 static int jz4770_pwm_pwm1_pins[] = { 0x81, }; 1053 663 static int jz4770_pwm_pwm2_pins[] = { 0x82, }; ··· 1061 667 static int jz4770_mac_rmii_pins[] = { 1062 668 0xa9, 0xab, 0xaa, 0xac, 0xa5, 0xa4, 0xad, 0xae, 0xa6, 0xa8, 1063 669 }; 1064 - static int jz4770_mac_mii_pins[] = { 0xa7, 0xaf, }; 670 + static int jz4770_mac_mii_pins[] = { 671 + 0x7b, 0x7a, 0x7d, 0x7c, 0xa7, 0x24, 0xaf, 672 + }; 1065 673 1066 674 static const struct group_desc jz4770_groups[] = { 1067 675 INGENIC_PIN_GROUP("uart0-data", jz4770_uart0_data, 0), ··· 1150 754 INGENIC_PIN_GROUP("cim-data-8bit", jz4770_cim_8bit, 0), 1151 755 INGENIC_PIN_GROUP("cim-data-12bit", jz4770_cim_12bit, 0), 1152 756 INGENIC_PIN_GROUP("lcd-8bit", jz4770_lcd_8bit, 0), 757 + INGENIC_PIN_GROUP("lcd-16bit", jz4770_lcd_16bit, 0), 758 + INGENIC_PIN_GROUP("lcd-18bit", jz4770_lcd_18bit, 0), 1153 759 INGENIC_PIN_GROUP("lcd-24bit", jz4770_lcd_24bit, 0), 1154 - { "lcd-no-pins", }, 760 + INGENIC_PIN_GROUP("lcd-special", jz4770_lcd_special, 1), 761 + INGENIC_PIN_GROUP("lcd-generic", jz4770_lcd_generic, 0), 1155 762 INGENIC_PIN_GROUP("pwm0", jz4770_pwm_pwm0, 0), 1156 763 INGENIC_PIN_GROUP("pwm1", jz4770_pwm_pwm1, 0), 1157 764 INGENIC_PIN_GROUP("pwm2", jz4770_pwm_pwm2, 0), ··· 1215 816 static const char *jz4770_i2c2_groups[] = { "i2c2-data", }; 1216 817 static const char *jz4770_cim_groups[] = { "cim-data-8bit", "cim-data-12bit", }; 1217 818 static const char *jz4770_lcd_groups[] = { 1218 - "lcd-8bit", "lcd-24bit", "lcd-no-pins", 819 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 820 + "lcd-special", "lcd-generic", 1219 821 }; 1220 822 static const char *jz4770_pwm0_groups[] = { "pwm0", }; 1221 823 static const char *jz4770_pwm1_groups[] = { "pwm1", }; ··· 1274 874 .pull_downs = jz4770_pull_downs, 1275 875 }; 1276 876 877 + static const u32 jz4775_pull_ups[7] = { 878 + 0x28ff00ff, 0xf030f3fc, 0x0fffffff, 0xfffe4000, 0xf0f0000c, 0x0000f00f, 0x0000f3c0, 879 + }; 880 + 881 + static const u32 jz4775_pull_downs[7] = { 882 + 0x00000000, 0x00030c03, 0x00000000, 0x00008000, 0x00000403, 0x00000ff0, 0x00030c00, 883 + }; 884 + 885 + static int jz4775_uart0_data_pins[] = { 0xa0, 0xa3, }; 886 + static int jz4775_uart0_hwflow_pins[] = { 0xa1, 0xa2, }; 887 + static int jz4775_uart1_data_pins[] = { 0x7a, 0x7c, }; 888 + static int jz4775_uart1_hwflow_pins[] = { 0x7b, 0x7d, }; 889 + static int jz4775_uart2_data_c_pins[] = { 0x54, 0x4a, }; 890 + static int jz4775_uart2_data_f_pins[] = { 0xa5, 0xa4, }; 891 + static int jz4775_uart3_data_pins[] = { 0x1e, 0x1f, }; 892 + static int jz4775_ssi_dt_a_pins[] = { 0x13, }; 893 + static int jz4775_ssi_dt_d_pins[] = { 0x75, }; 894 + static int jz4775_ssi_dr_a_pins[] = { 0x14, }; 895 + static int jz4775_ssi_dr_d_pins[] = { 0x74, }; 896 + static int jz4775_ssi_clk_a_pins[] = { 0x12, }; 897 + static int jz4775_ssi_clk_d_pins[] = { 0x78, }; 898 + static int jz4775_ssi_gpc_pins[] = { 0x76, }; 899 + static int jz4775_ssi_ce0_a_pins[] = { 0x17, }; 900 + static int jz4775_ssi_ce0_d_pins[] = { 0x79, }; 901 + static int jz4775_ssi_ce1_pins[] = { 0x77, }; 902 + static int jz4775_mmc0_1bit_a_pins[] = { 0x12, 0x13, 0x14, }; 903 + static int jz4775_mmc0_4bit_a_pins[] = { 0x15, 0x16, 0x17, }; 904 + static int jz4775_mmc0_8bit_a_pins[] = { 0x04, 0x05, 0x06, 0x07, }; 905 + static int jz4775_mmc0_1bit_e_pins[] = { 0x9c, 0x9d, 0x94, }; 906 + static int jz4775_mmc0_4bit_e_pins[] = { 0x95, 0x96, 0x97, }; 907 + static int jz4775_mmc1_1bit_d_pins[] = { 0x78, 0x79, 0x74, }; 908 + static int jz4775_mmc1_4bit_d_pins[] = { 0x75, 0x76, 0x77, }; 909 + static int jz4775_mmc1_1bit_e_pins[] = { 0x9c, 0x9d, 0x94, }; 910 + static int jz4775_mmc1_4bit_e_pins[] = { 0x95, 0x96, 0x97, }; 911 + static int jz4775_mmc2_1bit_b_pins[] = { 0x3c, 0x3d, 0x34, }; 912 + static int jz4775_mmc2_4bit_b_pins[] = { 0x35, 0x3e, 0x3f, }; 913 + static int jz4775_mmc2_1bit_e_pins[] = { 0x9c, 0x9d, 0x94, }; 914 + static int jz4775_mmc2_4bit_e_pins[] = { 0x95, 0x96, 0x97, }; 915 + static int jz4775_nemc_8bit_data_pins[] = { 916 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 917 + }; 918 + static int jz4775_nemc_16bit_data_pins[] = { 919 + 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 920 + }; 921 + static int jz4775_nemc_cle_ale_pins[] = { 0x20, 0x21, }; 922 + static int jz4775_nemc_addr_pins[] = { 0x22, 0x23, 0x24, 0x25, }; 923 + static int jz4775_nemc_rd_we_pins[] = { 0x10, 0x11, }; 924 + static int jz4775_nemc_frd_fwe_pins[] = { 0x12, 0x13, }; 925 + static int jz4775_nemc_wait_pins[] = { 0x1b, }; 926 + static int jz4775_nemc_cs1_pins[] = { 0x15, }; 927 + static int jz4775_nemc_cs2_pins[] = { 0x16, }; 928 + static int jz4775_nemc_cs3_pins[] = { 0x17, }; 929 + static int jz4775_i2c0_pins[] = { 0x7e, 0x7f, }; 930 + static int jz4775_i2c1_pins[] = { 0x9e, 0x9f, }; 931 + static int jz4775_i2c2_pins[] = { 0x80, 0x83, }; 932 + static int jz4775_i2s_data_tx_pins[] = { 0xa3, }; 933 + static int jz4775_i2s_data_rx_pins[] = { 0xa2, }; 934 + static int jz4775_i2s_clk_txrx_pins[] = { 0xa0, 0xa1, }; 935 + static int jz4775_i2s_sysclk_pins[] = { 0x83, }; 936 + static int jz4775_dmic_pins[] = { 0xaa, 0xab, }; 937 + static int jz4775_cim_pins[] = { 938 + 0x26, 0x27, 0x28, 0x29, 939 + 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 940 + }; 941 + static int jz4775_lcd_8bit_pins[] = { 942 + 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x4c, 0x4d, 943 + 0x48, 0x52, 0x53, 944 + }; 945 + static int jz4775_lcd_16bit_pins[] = { 946 + 0x4e, 0x4f, 0x50, 0x51, 0x56, 0x57, 0x58, 0x59, 947 + }; 948 + static int jz4775_lcd_18bit_pins[] = { 949 + 0x5a, 0x5b, 950 + }; 951 + static int jz4775_lcd_24bit_pins[] = { 952 + 0x40, 0x41, 0x4a, 0x4b, 0x54, 0x55, 953 + }; 954 + static int jz4775_lcd_special_pins[] = { 0x54, 0x4a, 0x41, 0x40, }; 955 + static int jz4775_lcd_generic_pins[] = { 0x49, }; 956 + static int jz4775_pwm_pwm0_pins[] = { 0x80, }; 957 + static int jz4775_pwm_pwm1_pins[] = { 0x81, }; 958 + static int jz4775_pwm_pwm2_pins[] = { 0x82, }; 959 + static int jz4775_pwm_pwm3_pins[] = { 0x83, }; 960 + static int jz4775_mac_rmii_pins[] = { 961 + 0xa9, 0xab, 0xaa, 0xac, 0xa5, 0xa4, 0xad, 0xae, 0xa6, 0xa8, 962 + }; 963 + static int jz4775_mac_mii_pins[] = { 964 + 0x7b, 0x7a, 0x7d, 0x7c, 0xa7, 0x24, 0xaf, 965 + }; 966 + static int jz4775_mac_rgmii_pins[] = { 967 + 0xa9, 0x7b, 0x7a, 0xab, 0xaa, 0xac, 0x7d, 0x7c, 0xa5, 0xa4, 968 + 0xad, 0xae, 0xa7, 0xa6, 969 + }; 970 + static int jz4775_mac_gmii_pins[] = { 971 + 0x31, 0x30, 0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 972 + 0xa8, 0x28, 0x24, 0xaf, 973 + }; 974 + static int jz4775_otg_pins[] = { 0x8a, }; 975 + 976 + static u8 jz4775_uart3_data_funcs[] = { 0, 1, }; 977 + static u8 jz4775_mac_mii_funcs[] = { 1, 1, 1, 1, 0, 1, 0, }; 978 + static u8 jz4775_mac_rgmii_funcs[] = { 979 + 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 980 + 0, 0, 0, 0, 981 + }; 982 + static u8 jz4775_mac_gmii_funcs[] = { 983 + 1, 1, 1, 1, 1, 1, 1, 1, 984 + 0, 1, 1, 0, 985 + }; 986 + 987 + static const struct group_desc jz4775_groups[] = { 988 + INGENIC_PIN_GROUP("uart0-data", jz4775_uart0_data, 0), 989 + INGENIC_PIN_GROUP("uart0-hwflow", jz4775_uart0_hwflow, 0), 990 + INGENIC_PIN_GROUP("uart1-data", jz4775_uart1_data, 0), 991 + INGENIC_PIN_GROUP("uart1-hwflow", jz4775_uart1_hwflow, 0), 992 + INGENIC_PIN_GROUP("uart2-data-c", jz4775_uart2_data_c, 2), 993 + INGENIC_PIN_GROUP("uart2-data-f", jz4775_uart2_data_f, 1), 994 + INGENIC_PIN_GROUP_FUNCS("uart3-data", jz4775_uart3_data, 995 + jz4775_uart3_data_funcs), 996 + INGENIC_PIN_GROUP("ssi-dt-a", jz4775_ssi_dt_a, 2), 997 + INGENIC_PIN_GROUP("ssi-dt-d", jz4775_ssi_dt_d, 1), 998 + INGENIC_PIN_GROUP("ssi-dr-a", jz4775_ssi_dr_a, 2), 999 + INGENIC_PIN_GROUP("ssi-dr-d", jz4775_ssi_dr_d, 1), 1000 + INGENIC_PIN_GROUP("ssi-clk-a", jz4775_ssi_clk_a, 2), 1001 + INGENIC_PIN_GROUP("ssi-clk-d", jz4775_ssi_clk_d, 1), 1002 + INGENIC_PIN_GROUP("ssi-gpc", jz4775_ssi_gpc, 1), 1003 + INGENIC_PIN_GROUP("ssi-ce0-a", jz4775_ssi_ce0_a, 2), 1004 + INGENIC_PIN_GROUP("ssi-ce0-d", jz4775_ssi_ce0_d, 1), 1005 + INGENIC_PIN_GROUP("ssi-ce1", jz4775_ssi_ce1, 1), 1006 + INGENIC_PIN_GROUP("mmc0-1bit-a", jz4775_mmc0_1bit_a, 1), 1007 + INGENIC_PIN_GROUP("mmc0-4bit-a", jz4775_mmc0_4bit_a, 1), 1008 + INGENIC_PIN_GROUP("mmc0-8bit-a", jz4775_mmc0_8bit_a, 1), 1009 + INGENIC_PIN_GROUP("mmc0-1bit-e", jz4775_mmc0_1bit_e, 0), 1010 + INGENIC_PIN_GROUP("mmc0-4bit-e", jz4775_mmc0_4bit_e, 0), 1011 + INGENIC_PIN_GROUP("mmc1-1bit-d", jz4775_mmc1_1bit_d, 0), 1012 + INGENIC_PIN_GROUP("mmc1-4bit-d", jz4775_mmc1_4bit_d, 0), 1013 + INGENIC_PIN_GROUP("mmc1-1bit-e", jz4775_mmc1_1bit_e, 1), 1014 + INGENIC_PIN_GROUP("mmc1-4bit-e", jz4775_mmc1_4bit_e, 1), 1015 + INGENIC_PIN_GROUP("mmc2-1bit-b", jz4775_mmc2_1bit_b, 0), 1016 + INGENIC_PIN_GROUP("mmc2-4bit-b", jz4775_mmc2_4bit_b, 0), 1017 + INGENIC_PIN_GROUP("mmc2-1bit-e", jz4775_mmc2_1bit_e, 2), 1018 + INGENIC_PIN_GROUP("mmc2-4bit-e", jz4775_mmc2_4bit_e, 2), 1019 + INGENIC_PIN_GROUP("nemc-8bit-data", jz4775_nemc_8bit_data, 0), 1020 + INGENIC_PIN_GROUP("nemc-16bit-data", jz4775_nemc_16bit_data, 1), 1021 + INGENIC_PIN_GROUP("nemc-cle-ale", jz4775_nemc_cle_ale, 0), 1022 + INGENIC_PIN_GROUP("nemc-addr", jz4775_nemc_addr, 0), 1023 + INGENIC_PIN_GROUP("nemc-rd-we", jz4775_nemc_rd_we, 0), 1024 + INGENIC_PIN_GROUP("nemc-frd-fwe", jz4775_nemc_frd_fwe, 0), 1025 + INGENIC_PIN_GROUP("nemc-wait", jz4775_nemc_wait, 0), 1026 + INGENIC_PIN_GROUP("nemc-cs1", jz4775_nemc_cs1, 0), 1027 + INGENIC_PIN_GROUP("nemc-cs2", jz4775_nemc_cs2, 0), 1028 + INGENIC_PIN_GROUP("nemc-cs3", jz4775_nemc_cs3, 0), 1029 + INGENIC_PIN_GROUP("i2c0-data", jz4775_i2c0, 0), 1030 + INGENIC_PIN_GROUP("i2c1-data", jz4775_i2c1, 0), 1031 + INGENIC_PIN_GROUP("i2c2-data", jz4775_i2c2, 1), 1032 + INGENIC_PIN_GROUP("i2s-data-tx", jz4775_i2s_data_tx, 1), 1033 + INGENIC_PIN_GROUP("i2s-data-rx", jz4775_i2s_data_rx, 1), 1034 + INGENIC_PIN_GROUP("i2s-clk-txrx", jz4775_i2s_clk_txrx, 1), 1035 + INGENIC_PIN_GROUP("i2s-sysclk", jz4775_i2s_sysclk, 2), 1036 + INGENIC_PIN_GROUP("dmic", jz4775_dmic, 1), 1037 + INGENIC_PIN_GROUP("cim-data", jz4775_cim, 0), 1038 + INGENIC_PIN_GROUP("lcd-8bit", jz4775_lcd_8bit, 0), 1039 + INGENIC_PIN_GROUP("lcd-16bit", jz4775_lcd_16bit, 0), 1040 + INGENIC_PIN_GROUP("lcd-18bit", jz4775_lcd_18bit, 0), 1041 + INGENIC_PIN_GROUP("lcd-24bit", jz4775_lcd_24bit, 0), 1042 + INGENIC_PIN_GROUP("lcd-generic", jz4775_lcd_generic, 0), 1043 + INGENIC_PIN_GROUP("lcd-special", jz4775_lcd_special, 1), 1044 + INGENIC_PIN_GROUP("pwm0", jz4775_pwm_pwm0, 0), 1045 + INGENIC_PIN_GROUP("pwm1", jz4775_pwm_pwm1, 0), 1046 + INGENIC_PIN_GROUP("pwm2", jz4775_pwm_pwm2, 0), 1047 + INGENIC_PIN_GROUP("pwm3", jz4775_pwm_pwm3, 0), 1048 + INGENIC_PIN_GROUP("mac-rmii", jz4775_mac_rmii, 0), 1049 + INGENIC_PIN_GROUP_FUNCS("mac-mii", jz4775_mac_mii, 1050 + jz4775_mac_mii_funcs), 1051 + INGENIC_PIN_GROUP_FUNCS("mac-rgmii", jz4775_mac_rgmii, 1052 + jz4775_mac_rgmii_funcs), 1053 + INGENIC_PIN_GROUP_FUNCS("mac-gmii", jz4775_mac_gmii, 1054 + jz4775_mac_gmii_funcs), 1055 + INGENIC_PIN_GROUP("otg-vbus", jz4775_otg, 0), 1056 + }; 1057 + 1058 + static const char *jz4775_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 1059 + static const char *jz4775_uart1_groups[] = { "uart1-data", "uart1-hwflow", }; 1060 + static const char *jz4775_uart2_groups[] = { "uart2-data-c", "uart2-data-f", }; 1061 + static const char *jz4775_uart3_groups[] = { "uart3-data", }; 1062 + static const char *jz4775_ssi_groups[] = { 1063 + "ssi-dt-a", "ssi-dt-d", 1064 + "ssi-dr-a", "ssi-dr-d", 1065 + "ssi-clk-a", "ssi-clk-d", 1066 + "ssi-gpc", 1067 + "ssi-ce0-a", "ssi-ce0-d", 1068 + "ssi-ce1", 1069 + }; 1070 + static const char *jz4775_mmc0_groups[] = { 1071 + "mmc0-1bit-a", "mmc0-4bit-a", "mmc0-8bit-a", 1072 + "mmc0-1bit-e", "mmc0-4bit-e", 1073 + }; 1074 + static const char *jz4775_mmc1_groups[] = { 1075 + "mmc1-1bit-d", "mmc1-4bit-d", 1076 + "mmc1-1bit-e", "mmc1-4bit-e", 1077 + }; 1078 + static const char *jz4775_mmc2_groups[] = { 1079 + "mmc2-1bit-b", "mmc2-4bit-b", 1080 + "mmc2-1bit-e", "mmc2-4bit-e", 1081 + }; 1082 + static const char *jz4775_nemc_groups[] = { 1083 + "nemc-8bit-data", "nemc-16bit-data", "nemc-cle-ale", 1084 + "nemc-addr", "nemc-rd-we", "nemc-frd-fwe", "nemc-wait", 1085 + }; 1086 + static const char *jz4775_cs1_groups[] = { "nemc-cs1", }; 1087 + static const char *jz4775_cs2_groups[] = { "nemc-cs2", }; 1088 + static const char *jz4775_cs3_groups[] = { "nemc-cs3", }; 1089 + static const char *jz4775_i2c0_groups[] = { "i2c0-data", }; 1090 + static const char *jz4775_i2c1_groups[] = { "i2c1-data", }; 1091 + static const char *jz4775_i2c2_groups[] = { "i2c2-data", }; 1092 + static const char *jz4775_i2s_groups[] = { 1093 + "i2s-data-tx", "i2s-data-rx", "i2s-clk-txrx", "i2s-sysclk", 1094 + }; 1095 + static const char *jz4775_dmic_groups[] = { "dmic", }; 1096 + static const char *jz4775_cim_groups[] = { "cim-data", }; 1097 + static const char *jz4775_lcd_groups[] = { 1098 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 1099 + "lcd-special", "lcd-generic", 1100 + }; 1101 + static const char *jz4775_pwm0_groups[] = { "pwm0", }; 1102 + static const char *jz4775_pwm1_groups[] = { "pwm1", }; 1103 + static const char *jz4775_pwm2_groups[] = { "pwm2", }; 1104 + static const char *jz4775_pwm3_groups[] = { "pwm3", }; 1105 + static const char *jz4775_mac_groups[] = { 1106 + "mac-rmii", "mac-mii", "mac-rgmii", "mac-gmii", 1107 + }; 1108 + static const char *jz4775_otg_groups[] = { "otg-vbus", }; 1109 + 1110 + static const struct function_desc jz4775_functions[] = { 1111 + { "uart0", jz4775_uart0_groups, ARRAY_SIZE(jz4775_uart0_groups), }, 1112 + { "uart1", jz4775_uart1_groups, ARRAY_SIZE(jz4775_uart1_groups), }, 1113 + { "uart2", jz4775_uart2_groups, ARRAY_SIZE(jz4775_uart2_groups), }, 1114 + { "uart3", jz4775_uart3_groups, ARRAY_SIZE(jz4775_uart3_groups), }, 1115 + { "ssi", jz4775_ssi_groups, ARRAY_SIZE(jz4775_ssi_groups), }, 1116 + { "mmc0", jz4775_mmc0_groups, ARRAY_SIZE(jz4775_mmc0_groups), }, 1117 + { "mmc1", jz4775_mmc1_groups, ARRAY_SIZE(jz4775_mmc1_groups), }, 1118 + { "mmc2", jz4775_mmc2_groups, ARRAY_SIZE(jz4775_mmc2_groups), }, 1119 + { "nemc", jz4775_nemc_groups, ARRAY_SIZE(jz4775_nemc_groups), }, 1120 + { "nemc-cs1", jz4775_cs1_groups, ARRAY_SIZE(jz4775_cs1_groups), }, 1121 + { "nemc-cs2", jz4775_cs2_groups, ARRAY_SIZE(jz4775_cs2_groups), }, 1122 + { "nemc-cs3", jz4775_cs3_groups, ARRAY_SIZE(jz4775_cs3_groups), }, 1123 + { "i2c0", jz4775_i2c0_groups, ARRAY_SIZE(jz4775_i2c0_groups), }, 1124 + { "i2c1", jz4775_i2c1_groups, ARRAY_SIZE(jz4775_i2c1_groups), }, 1125 + { "i2c2", jz4775_i2c2_groups, ARRAY_SIZE(jz4775_i2c2_groups), }, 1126 + { "i2s", jz4775_i2s_groups, ARRAY_SIZE(jz4775_i2s_groups), }, 1127 + { "dmic", jz4775_dmic_groups, ARRAY_SIZE(jz4775_dmic_groups), }, 1128 + { "cim", jz4775_cim_groups, ARRAY_SIZE(jz4775_cim_groups), }, 1129 + { "lcd", jz4775_lcd_groups, ARRAY_SIZE(jz4775_lcd_groups), }, 1130 + { "pwm0", jz4775_pwm0_groups, ARRAY_SIZE(jz4775_pwm0_groups), }, 1131 + { "pwm1", jz4775_pwm1_groups, ARRAY_SIZE(jz4775_pwm1_groups), }, 1132 + { "pwm2", jz4775_pwm2_groups, ARRAY_SIZE(jz4775_pwm2_groups), }, 1133 + { "pwm3", jz4775_pwm3_groups, ARRAY_SIZE(jz4775_pwm3_groups), }, 1134 + { "mac", jz4775_mac_groups, ARRAY_SIZE(jz4775_mac_groups), }, 1135 + { "otg", jz4775_otg_groups, ARRAY_SIZE(jz4775_otg_groups), }, 1136 + }; 1137 + 1138 + static const struct ingenic_chip_info jz4775_chip_info = { 1139 + .num_chips = 7, 1140 + .reg_offset = 0x100, 1141 + .version = ID_JZ4775, 1142 + .groups = jz4775_groups, 1143 + .num_groups = ARRAY_SIZE(jz4775_groups), 1144 + .functions = jz4775_functions, 1145 + .num_functions = ARRAY_SIZE(jz4775_functions), 1146 + .pull_ups = jz4775_pull_ups, 1147 + .pull_downs = jz4775_pull_downs, 1148 + }; 1149 + 1277 1150 static const u32 jz4780_pull_ups[6] = { 1278 1151 0x3fffffff, 0xfff0f3fc, 0x0fffffff, 0xffff4fff, 0xfffffb7c, 0x7fa7f00f, 1279 1152 }; ··· 1600 927 static int jz4780_i2s_clk_txrx_pins[] = { 0x6c, 0x6d, }; 1601 928 static int jz4780_i2s_clk_rx_pins[] = { 0x88, 0x89, }; 1602 929 static int jz4780_i2s_sysclk_pins[] = { 0x85, }; 930 + static int jz4780_dmic_pins[] = { 0x32, 0x33, }; 1603 931 static int jz4780_hdmi_ddc_pins[] = { 0xb9, 0xb8, }; 1604 932 1605 933 static u8 jz4780_i2s_clk_txrx_funcs[] = { 1, 0, }; ··· 1699 1025 jz4780_i2s_clk_txrx_funcs), 1700 1026 INGENIC_PIN_GROUP("i2s-clk-rx", jz4780_i2s_clk_rx, 1), 1701 1027 INGENIC_PIN_GROUP("i2s-sysclk", jz4780_i2s_sysclk, 2), 1028 + INGENIC_PIN_GROUP("dmic", jz4780_dmic, 1), 1702 1029 INGENIC_PIN_GROUP("hdmi-ddc", jz4780_hdmi_ddc, 0), 1703 1030 INGENIC_PIN_GROUP("cim-data", jz4770_cim_8bit, 0), 1704 1031 INGENIC_PIN_GROUP("cim-data-12bit", jz4770_cim_12bit, 0), 1032 + INGENIC_PIN_GROUP("lcd-8bit", jz4770_lcd_8bit, 0), 1033 + INGENIC_PIN_GROUP("lcd-16bit", jz4770_lcd_16bit, 0), 1034 + INGENIC_PIN_GROUP("lcd-18bit", jz4770_lcd_18bit, 0), 1705 1035 INGENIC_PIN_GROUP("lcd-24bit", jz4770_lcd_24bit, 0), 1706 - { "lcd-no-pins", }, 1036 + INGENIC_PIN_GROUP("lcd-special", jz4770_lcd_special, 1), 1037 + INGENIC_PIN_GROUP("lcd-generic", jz4770_lcd_generic, 0), 1707 1038 INGENIC_PIN_GROUP("pwm0", jz4770_pwm_pwm0, 0), 1708 1039 INGENIC_PIN_GROUP("pwm1", jz4770_pwm_pwm1, 0), 1709 1040 INGENIC_PIN_GROUP("pwm2", jz4770_pwm_pwm2, 0), ··· 1756 1077 static const char *jz4780_i2s_groups[] = { 1757 1078 "i2s-data-tx", "i2s-data-rx", "i2s-clk-txrx", "i2s-clk-rx", "i2s-sysclk", 1758 1079 }; 1080 + static const char *jz4780_dmic_groups[] = { "dmic", }; 1759 1081 static const char *jz4780_cim_groups[] = { "cim-data", }; 1760 1082 static const char *jz4780_hdmi_ddc_groups[] = { "hdmi-ddc", }; 1761 1083 ··· 1784 1104 { "i2c3", jz4780_i2c3_groups, ARRAY_SIZE(jz4780_i2c3_groups), }, 1785 1105 { "i2c4", jz4780_i2c4_groups, ARRAY_SIZE(jz4780_i2c4_groups), }, 1786 1106 { "i2s", jz4780_i2s_groups, ARRAY_SIZE(jz4780_i2s_groups), }, 1107 + { "dmic", jz4780_dmic_groups, ARRAY_SIZE(jz4780_dmic_groups), }, 1787 1108 { "cim", jz4780_cim_groups, ARRAY_SIZE(jz4780_cim_groups), }, 1788 1109 { "lcd", jz4770_lcd_groups, ARRAY_SIZE(jz4770_lcd_groups), }, 1789 1110 { "pwm0", jz4770_pwm0_groups, ARRAY_SIZE(jz4770_pwm0_groups), }, ··· 1870 1189 static int x1000_i2s_data_rx_pins[] = { 0x23, }; 1871 1190 static int x1000_i2s_clk_txrx_pins[] = { 0x21, 0x22, }; 1872 1191 static int x1000_i2s_sysclk_pins[] = { 0x20, }; 1192 + static int x1000_dmic0_pins[] = { 0x35, 0x36, }; 1193 + static int x1000_dmic1_pins[] = { 0x25, }; 1873 1194 static int x1000_cim_pins[] = { 1874 1195 0x08, 0x09, 0x0a, 0x0b, 1875 1196 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e, 0x0d, 0x0c, ··· 1937 1254 INGENIC_PIN_GROUP("i2s-data-rx", x1000_i2s_data_rx, 1), 1938 1255 INGENIC_PIN_GROUP("i2s-clk-txrx", x1000_i2s_clk_txrx, 1), 1939 1256 INGENIC_PIN_GROUP("i2s-sysclk", x1000_i2s_sysclk, 1), 1257 + INGENIC_PIN_GROUP("dmic0", x1000_dmic0, 0), 1258 + INGENIC_PIN_GROUP("dmic1", x1000_dmic1, 1), 1940 1259 INGENIC_PIN_GROUP("cim-data", x1000_cim, 2), 1941 1260 INGENIC_PIN_GROUP("lcd-8bit", x1000_lcd_8bit, 1), 1942 1261 INGENIC_PIN_GROUP("lcd-16bit", x1000_lcd_16bit, 1), 1943 - { "lcd-no-pins", }, 1944 1262 INGENIC_PIN_GROUP("pwm0", x1000_pwm_pwm0, 0), 1945 1263 INGENIC_PIN_GROUP("pwm1", x1000_pwm_pwm1, 1), 1946 1264 INGENIC_PIN_GROUP("pwm2", x1000_pwm_pwm2, 1), ··· 1982 1298 static const char *x1000_i2s_groups[] = { 1983 1299 "i2s-data-tx", "i2s-data-rx", "i2s-clk-txrx", "i2s-sysclk", 1984 1300 }; 1301 + static const char *x1000_dmic_groups[] = { "dmic0", "dmic1", }; 1985 1302 static const char *x1000_cim_groups[] = { "cim-data", }; 1986 - static const char *x1000_lcd_groups[] = { 1987 - "lcd-8bit", "lcd-16bit", "lcd-no-pins", 1988 - }; 1303 + static const char *x1000_lcd_groups[] = { "lcd-8bit", "lcd-16bit", }; 1989 1304 static const char *x1000_pwm0_groups[] = { "pwm0", }; 1990 1305 static const char *x1000_pwm1_groups[] = { "pwm1", }; 1991 1306 static const char *x1000_pwm2_groups[] = { "pwm2", }; ··· 2007 1324 { "i2c1", x1000_i2c1_groups, ARRAY_SIZE(x1000_i2c1_groups), }, 2008 1325 { "i2c2", x1000_i2c2_groups, ARRAY_SIZE(x1000_i2c2_groups), }, 2009 1326 { "i2s", x1000_i2s_groups, ARRAY_SIZE(x1000_i2s_groups), }, 1327 + { "dmic", x1000_dmic_groups, ARRAY_SIZE(x1000_dmic_groups), }, 2010 1328 { "cim", x1000_cim_groups, ARRAY_SIZE(x1000_cim_groups), }, 2011 1329 { "lcd", x1000_lcd_groups, ARRAY_SIZE(x1000_lcd_groups), }, 2012 1330 { "pwm0", x1000_pwm0_groups, ARRAY_SIZE(x1000_pwm0_groups), }, ··· 2047 1363 static int x1500_i2s_data_rx_pins[] = { 0x23, }; 2048 1364 static int x1500_i2s_clk_txrx_pins[] = { 0x21, 0x22, }; 2049 1365 static int x1500_i2s_sysclk_pins[] = { 0x20, }; 1366 + static int x1500_dmic0_pins[] = { 0x35, 0x36, }; 1367 + static int x1500_dmic1_pins[] = { 0x25, }; 2050 1368 static int x1500_cim_pins[] = { 2051 1369 0x08, 0x09, 0x0a, 0x0b, 2052 1370 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e, 0x0d, 0x0c, ··· 2078 1392 INGENIC_PIN_GROUP("i2s-data-rx", x1500_i2s_data_rx, 1), 2079 1393 INGENIC_PIN_GROUP("i2s-clk-txrx", x1500_i2s_clk_txrx, 1), 2080 1394 INGENIC_PIN_GROUP("i2s-sysclk", x1500_i2s_sysclk, 1), 1395 + INGENIC_PIN_GROUP("dmic0", x1500_dmic0, 0), 1396 + INGENIC_PIN_GROUP("dmic1", x1500_dmic1, 1), 2081 1397 INGENIC_PIN_GROUP("cim-data", x1500_cim, 2), 2082 - { "lcd-no-pins", }, 2083 1398 INGENIC_PIN_GROUP("pwm0", x1500_pwm_pwm0, 0), 2084 1399 INGENIC_PIN_GROUP("pwm1", x1500_pwm_pwm1, 1), 2085 1400 INGENIC_PIN_GROUP("pwm2", x1500_pwm_pwm2, 1), ··· 2100 1413 static const char *x1500_i2s_groups[] = { 2101 1414 "i2s-data-tx", "i2s-data-rx", "i2s-clk-txrx", "i2s-sysclk", 2102 1415 }; 1416 + static const char *x1500_dmic_groups[] = { "dmic0", "dmic1", }; 2103 1417 static const char *x1500_cim_groups[] = { "cim-data", }; 2104 - static const char *x1500_lcd_groups[] = { "lcd-no-pins", }; 2105 1418 static const char *x1500_pwm0_groups[] = { "pwm0", }; 2106 1419 static const char *x1500_pwm1_groups[] = { "pwm1", }; 2107 1420 static const char *x1500_pwm2_groups[] = { "pwm2", }; ··· 2118 1431 { "i2c1", x1500_i2c1_groups, ARRAY_SIZE(x1500_i2c1_groups), }, 2119 1432 { "i2c2", x1500_i2c2_groups, ARRAY_SIZE(x1500_i2c2_groups), }, 2120 1433 { "i2s", x1500_i2s_groups, ARRAY_SIZE(x1500_i2s_groups), }, 1434 + { "dmic", x1500_dmic_groups, ARRAY_SIZE(x1500_dmic_groups), }, 2121 1435 { "cim", x1500_cim_groups, ARRAY_SIZE(x1500_cim_groups), }, 2122 - { "lcd", x1500_lcd_groups, ARRAY_SIZE(x1500_lcd_groups), }, 2123 1436 { "pwm0", x1500_pwm0_groups, ARRAY_SIZE(x1500_pwm0_groups), }, 2124 1437 { "pwm1", x1500_pwm1_groups, ARRAY_SIZE(x1500_pwm1_groups), }, 2125 1438 { "pwm2", x1500_pwm2_groups, ARRAY_SIZE(x1500_pwm2_groups), }, ··· 2158 1471 static int x1830_ssi0_ce0_pins[] = { 0x50, }; 2159 1472 static int x1830_ssi0_ce1_pins[] = { 0x4e, }; 2160 1473 static int x1830_ssi1_dt_c_pins[] = { 0x53, }; 2161 - static int x1830_ssi1_dr_c_pins[] = { 0x54, }; 2162 - static int x1830_ssi1_clk_c_pins[] = { 0x57, }; 2163 - static int x1830_ssi1_gpc_c_pins[] = { 0x55, }; 2164 - static int x1830_ssi1_ce0_c_pins[] = { 0x58, }; 2165 - static int x1830_ssi1_ce1_c_pins[] = { 0x56, }; 2166 1474 static int x1830_ssi1_dt_d_pins[] = { 0x62, }; 1475 + static int x1830_ssi1_dr_c_pins[] = { 0x54, }; 2167 1476 static int x1830_ssi1_dr_d_pins[] = { 0x63, }; 1477 + static int x1830_ssi1_clk_c_pins[] = { 0x57, }; 2168 1478 static int x1830_ssi1_clk_d_pins[] = { 0x66, }; 1479 + static int x1830_ssi1_gpc_c_pins[] = { 0x55, }; 2169 1480 static int x1830_ssi1_gpc_d_pins[] = { 0x64, }; 1481 + static int x1830_ssi1_ce0_c_pins[] = { 0x58, }; 2170 1482 static int x1830_ssi1_ce0_d_pins[] = { 0x67, }; 1483 + static int x1830_ssi1_ce1_c_pins[] = { 0x56, }; 2171 1484 static int x1830_ssi1_ce1_d_pins[] = { 0x65, }; 2172 1485 static int x1830_mmc0_1bit_pins[] = { 0x24, 0x25, 0x20, }; 2173 1486 static int x1830_mmc0_4bit_pins[] = { 0x21, 0x22, 0x23, }; ··· 2181 1494 static int x1830_i2s_clk_txrx_pins[] = { 0x58, 0x52, }; 2182 1495 static int x1830_i2s_clk_rx_pins[] = { 0x56, 0x55, }; 2183 1496 static int x1830_i2s_sysclk_pins[] = { 0x57, }; 2184 - static int x1830_lcd_rgb_18bit_pins[] = { 1497 + static int x1830_dmic0_pins[] = { 0x48, 0x59, }; 1498 + static int x1830_dmic1_pins[] = { 0x5a, }; 1499 + static int x1830_lcd_tft_8bit_pins[] = { 2185 1500 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 2186 - 0x68, 0x69, 0x6c, 0x6d, 0x6e, 0x6f, 2187 - 0x70, 0x71, 0x72, 0x73, 0x76, 0x77, 2188 - 0x78, 0x79, 0x7a, 0x7b, 1501 + 0x68, 0x73, 0x72, 0x69, 1502 + }; 1503 + static int x1830_lcd_tft_24bit_pins[] = { 1504 + 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 1505 + 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 2189 1506 }; 2190 1507 static int x1830_lcd_slcd_8bit_pins[] = { 2191 1508 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x6c, 0x6d, ··· 2253 1562 INGENIC_PIN_GROUP("i2s-clk-txrx", x1830_i2s_clk_txrx, 0), 2254 1563 INGENIC_PIN_GROUP("i2s-clk-rx", x1830_i2s_clk_rx, 0), 2255 1564 INGENIC_PIN_GROUP("i2s-sysclk", x1830_i2s_sysclk, 0), 2256 - INGENIC_PIN_GROUP("lcd-rgb-18bit", x1830_lcd_rgb_18bit, 0), 1565 + INGENIC_PIN_GROUP("dmic0", x1830_dmic0, 2), 1566 + INGENIC_PIN_GROUP("dmic1", x1830_dmic1, 2), 1567 + INGENIC_PIN_GROUP("lcd-tft-8bit", x1830_lcd_tft_8bit, 0), 1568 + INGENIC_PIN_GROUP("lcd-tft-24bit", x1830_lcd_tft_24bit, 0), 2257 1569 INGENIC_PIN_GROUP("lcd-slcd-8bit", x1830_lcd_slcd_8bit, 1), 2258 1570 INGENIC_PIN_GROUP("lcd-slcd-16bit", x1830_lcd_slcd_16bit, 1), 2259 - { "lcd-no-pins", }, 2260 1571 INGENIC_PIN_GROUP("pwm0-b", x1830_pwm_pwm0_b, 0), 2261 1572 INGENIC_PIN_GROUP("pwm0-c", x1830_pwm_pwm0_c, 1), 2262 1573 INGENIC_PIN_GROUP("pwm1-b", x1830_pwm_pwm1_b, 0), ··· 2300 1607 static const char *x1830_i2s_groups[] = { 2301 1608 "i2s-data-tx", "i2s-data-rx", "i2s-clk-txrx", "i2s-clk-rx", "i2s-sysclk", 2302 1609 }; 1610 + static const char *x1830_dmic_groups[] = { "dmic0", "dmic1", }; 2303 1611 static const char *x1830_lcd_groups[] = { 2304 - "lcd-rgb-18bit", "lcd-slcd-8bit", "lcd-slcd-16bit", "lcd-no-pins", 1612 + "lcd-tft-8bit", "lcd-tft-24bit", "lcd-slcd-8bit", "lcd-slcd-16bit", 2305 1613 }; 2306 1614 static const char *x1830_pwm0_groups[] = { "pwm0-b", "pwm0-c", }; 2307 1615 static const char *x1830_pwm1_groups[] = { "pwm1-b", "pwm1-c", }; ··· 2326 1632 { "i2c1", x1830_i2c1_groups, ARRAY_SIZE(x1830_i2c1_groups), }, 2327 1633 { "i2c2", x1830_i2c2_groups, ARRAY_SIZE(x1830_i2c2_groups), }, 2328 1634 { "i2s", x1830_i2s_groups, ARRAY_SIZE(x1830_i2s_groups), }, 1635 + { "dmic", x1830_dmic_groups, ARRAY_SIZE(x1830_dmic_groups), }, 2329 1636 { "lcd", x1830_lcd_groups, ARRAY_SIZE(x1830_lcd_groups), }, 2330 1637 { "pwm0", x1830_pwm0_groups, ARRAY_SIZE(x1830_pwm0_groups), }, 2331 1638 { "pwm1", x1830_pwm1_groups, ARRAY_SIZE(x1830_pwm1_groups), }, ··· 2351 1656 .pull_downs = x1830_pull_downs, 2352 1657 }; 2353 1658 1659 + static const u32 x2000_pull_ups[5] = { 1660 + 0x0003ffff, 0xffffffff, 0x1ff0ffff, 0xc7fe3f3f, 0x8fff003f, 1661 + }; 1662 + 1663 + static const u32 x2000_pull_downs[5] = { 1664 + 0x0003ffff, 0xffffffff, 0x1ff0ffff, 0x00000000, 0x8fff003f, 1665 + }; 1666 + 1667 + static int x2000_uart0_data_pins[] = { 0x77, 0x78, }; 1668 + static int x2000_uart0_hwflow_pins[] = { 0x79, 0x7a, }; 1669 + static int x2000_uart1_data_pins[] = { 0x57, 0x58, }; 1670 + static int x2000_uart1_hwflow_pins[] = { 0x55, 0x56, }; 1671 + static int x2000_uart2_data_pins[] = { 0x7e, 0x7f, }; 1672 + static int x2000_uart3_data_c_pins[] = { 0x59, 0x5a, }; 1673 + static int x2000_uart3_data_d_pins[] = { 0x62, 0x63, }; 1674 + static int x2000_uart3_hwflow_c_pins[] = { 0x5b, 0x5c, }; 1675 + static int x2000_uart3_hwflow_d_pins[] = { 0x60, 0x61, }; 1676 + static int x2000_uart4_data_a_pins[] = { 0x02, 0x03, }; 1677 + static int x2000_uart4_data_c_pins[] = { 0x4b, 0x4c, }; 1678 + static int x2000_uart4_hwflow_a_pins[] = { 0x00, 0x01, }; 1679 + static int x2000_uart4_hwflow_c_pins[] = { 0x49, 0x4a, }; 1680 + static int x2000_uart5_data_a_pins[] = { 0x04, 0x05, }; 1681 + static int x2000_uart5_data_c_pins[] = { 0x45, 0x46, }; 1682 + static int x2000_uart6_data_a_pins[] = { 0x06, 0x07, }; 1683 + static int x2000_uart6_data_c_pins[] = { 0x47, 0x48, }; 1684 + static int x2000_uart7_data_a_pins[] = { 0x08, 0x09, }; 1685 + static int x2000_uart7_data_c_pins[] = { 0x41, 0x42, }; 1686 + static int x2000_uart8_data_pins[] = { 0x3c, 0x3d, }; 1687 + static int x2000_uart9_data_pins[] = { 0x3e, 0x3f, }; 1688 + static int x2000_sfc0_d_pins[] = { 0x73, 0x74, 0x75, 0x76, 0x71, 0x72, }; 1689 + static int x2000_sfc0_e_pins[] = { 0x92, 0x93, 0x94, 0x95, 0x90, 0x91, }; 1690 + static int x2000_sfc1_pins[] = { 0x77, 0x78, 0x79, 0x7a, }; 1691 + static int x2000_ssi0_dt_b_pins[] = { 0x3e, }; 1692 + static int x2000_ssi0_dt_d_pins[] = { 0x69, }; 1693 + static int x2000_ssi0_dr_b_pins[] = { 0x3d, }; 1694 + static int x2000_ssi0_dr_d_pins[] = { 0x6a, }; 1695 + static int x2000_ssi0_clk_b_pins[] = { 0x3f, }; 1696 + static int x2000_ssi0_clk_d_pins[] = { 0x68, }; 1697 + static int x2000_ssi0_ce0_b_pins[] = { 0x3c, }; 1698 + static int x2000_ssi0_ce0_d_pins[] = { 0x6d, }; 1699 + static int x2000_ssi1_dt_c_pins[] = { 0x4b, }; 1700 + static int x2000_ssi1_dt_d_pins[] = { 0x72, }; 1701 + static int x2000_ssi1_dt_e_pins[] = { 0x91, }; 1702 + static int x2000_ssi1_dr_c_pins[] = { 0x4a, }; 1703 + static int x2000_ssi1_dr_d_pins[] = { 0x73, }; 1704 + static int x2000_ssi1_dr_e_pins[] = { 0x92, }; 1705 + static int x2000_ssi1_clk_c_pins[] = { 0x4c, }; 1706 + static int x2000_ssi1_clk_d_pins[] = { 0x71, }; 1707 + static int x2000_ssi1_clk_e_pins[] = { 0x90, }; 1708 + static int x2000_ssi1_ce0_c_pins[] = { 0x49, }; 1709 + static int x2000_ssi1_ce0_d_pins[] = { 0x76, }; 1710 + static int x2000_ssi1_ce0_e_pins[] = { 0x95, }; 1711 + static int x2000_mmc0_1bit_pins[] = { 0x71, 0x72, 0x73, }; 1712 + static int x2000_mmc0_4bit_pins[] = { 0x74, 0x75, 0x75, }; 1713 + static int x2000_mmc0_8bit_pins[] = { 0x77, 0x78, 0x79, 0x7a, }; 1714 + static int x2000_mmc1_1bit_pins[] = { 0x68, 0x69, 0x6a, }; 1715 + static int x2000_mmc1_4bit_pins[] = { 0x6b, 0x6c, 0x6d, }; 1716 + static int x2000_mmc2_1bit_pins[] = { 0x80, 0x81, 0x82, }; 1717 + static int x2000_mmc2_4bit_pins[] = { 0x83, 0x84, 0x85, }; 1718 + static int x2000_emc_8bit_data_pins[] = { 1719 + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 1720 + }; 1721 + static int x2000_emc_16bit_data_pins[] = { 1722 + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 1723 + }; 1724 + static int x2000_emc_addr_pins[] = { 1725 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 1726 + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 1727 + }; 1728 + static int x2000_emc_rd_we_pins[] = { 0x2d, 0x2e, }; 1729 + static int x2000_emc_wait_pins[] = { 0x2f, }; 1730 + static int x2000_emc_cs1_pins[] = { 0x57, }; 1731 + static int x2000_emc_cs2_pins[] = { 0x58, }; 1732 + static int x2000_i2c0_pins[] = { 0x4e, 0x4d, }; 1733 + static int x2000_i2c1_c_pins[] = { 0x58, 0x57, }; 1734 + static int x2000_i2c1_d_pins[] = { 0x6c, 0x6b, }; 1735 + static int x2000_i2c2_b_pins[] = { 0x37, 0x36, }; 1736 + static int x2000_i2c2_d_pins[] = { 0x75, 0x74, }; 1737 + static int x2000_i2c2_e_pins[] = { 0x94, 0x93, }; 1738 + static int x2000_i2c3_a_pins[] = { 0x11, 0x10, }; 1739 + static int x2000_i2c3_d_pins[] = { 0x7f, 0x7e, }; 1740 + static int x2000_i2c4_c_pins[] = { 0x5a, 0x59, }; 1741 + static int x2000_i2c4_d_pins[] = { 0x61, 0x60, }; 1742 + static int x2000_i2c5_c_pins[] = { 0x5c, 0x5b, }; 1743 + static int x2000_i2c5_d_pins[] = { 0x65, 0x64, }; 1744 + static int x2000_i2s1_data_tx_pins[] = { 0x47, }; 1745 + static int x2000_i2s1_data_rx_pins[] = { 0x44, }; 1746 + static int x2000_i2s1_clk_tx_pins[] = { 0x45, 0x46, }; 1747 + static int x2000_i2s1_clk_rx_pins[] = { 0x42, 0x43, }; 1748 + static int x2000_i2s1_sysclk_tx_pins[] = { 0x48, }; 1749 + static int x2000_i2s1_sysclk_rx_pins[] = { 0x41, }; 1750 + static int x2000_i2s2_data_rx0_pins[] = { 0x0a, }; 1751 + static int x2000_i2s2_data_rx1_pins[] = { 0x0b, }; 1752 + static int x2000_i2s2_data_rx2_pins[] = { 0x0c, }; 1753 + static int x2000_i2s2_data_rx3_pins[] = { 0x0d, }; 1754 + static int x2000_i2s2_clk_rx_pins[] = { 0x11, 0x09, }; 1755 + static int x2000_i2s2_sysclk_rx_pins[] = { 0x07, }; 1756 + static int x2000_i2s3_data_tx0_pins[] = { 0x03, }; 1757 + static int x2000_i2s3_data_tx1_pins[] = { 0x04, }; 1758 + static int x2000_i2s3_data_tx2_pins[] = { 0x05, }; 1759 + static int x2000_i2s3_data_tx3_pins[] = { 0x06, }; 1760 + static int x2000_i2s3_clk_tx_pins[] = { 0x10, 0x02, }; 1761 + static int x2000_i2s3_sysclk_tx_pins[] = { 0x00, }; 1762 + static int x2000_dmic0_pins[] = { 0x54, 0x55, }; 1763 + static int x2000_dmic1_pins[] = { 0x56, }; 1764 + static int x2000_dmic2_pins[] = { 0x57, }; 1765 + static int x2000_dmic3_pins[] = { 0x58, }; 1766 + static int x2000_cim_8bit_pins[] = { 1767 + 0x0e, 0x0c, 0x0d, 0x4f, 1768 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1769 + }; 1770 + static int x2000_cim_12bit_pins[] = { 0x08, 0x09, 0x0a, 0x0b, }; 1771 + static int x2000_lcd_tft_8bit_pins[] = { 1772 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 1773 + 0x38, 0x3a, 0x39, 0x3b, 1774 + }; 1775 + static int x2000_lcd_tft_16bit_pins[] = { 1776 + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 1777 + }; 1778 + static int x2000_lcd_tft_18bit_pins[] = { 1779 + 0x30, 0x31, 1780 + }; 1781 + static int x2000_lcd_tft_24bit_pins[] = { 1782 + 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 1783 + }; 1784 + static int x2000_lcd_slcd_8bit_pins[] = { 1785 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 1786 + 0x3a, 0x38, 0x3b, 0x30, 0x39, 1787 + }; 1788 + static int x2000_pwm_pwm0_c_pins[] = { 0x40, }; 1789 + static int x2000_pwm_pwm0_d_pins[] = { 0x7e, }; 1790 + static int x2000_pwm_pwm1_c_pins[] = { 0x41, }; 1791 + static int x2000_pwm_pwm1_d_pins[] = { 0x7f, }; 1792 + static int x2000_pwm_pwm2_c_pins[] = { 0x42, }; 1793 + static int x2000_pwm_pwm2_e_pins[] = { 0x80, }; 1794 + static int x2000_pwm_pwm3_c_pins[] = { 0x43, }; 1795 + static int x2000_pwm_pwm3_e_pins[] = { 0x81, }; 1796 + static int x2000_pwm_pwm4_c_pins[] = { 0x44, }; 1797 + static int x2000_pwm_pwm4_e_pins[] = { 0x82, }; 1798 + static int x2000_pwm_pwm5_c_pins[] = { 0x45, }; 1799 + static int x2000_pwm_pwm5_e_pins[] = { 0x83, }; 1800 + static int x2000_pwm_pwm6_c_pins[] = { 0x46, }; 1801 + static int x2000_pwm_pwm6_e_pins[] = { 0x84, }; 1802 + static int x2000_pwm_pwm7_c_pins[] = { 0x47, }; 1803 + static int x2000_pwm_pwm7_e_pins[] = { 0x85, }; 1804 + static int x2000_pwm_pwm8_pins[] = { 0x48, }; 1805 + static int x2000_pwm_pwm9_pins[] = { 0x49, }; 1806 + static int x2000_pwm_pwm10_pins[] = { 0x4a, }; 1807 + static int x2000_pwm_pwm11_pins[] = { 0x4b, }; 1808 + static int x2000_pwm_pwm12_pins[] = { 0x4c, }; 1809 + static int x2000_pwm_pwm13_pins[] = { 0x4d, }; 1810 + static int x2000_pwm_pwm14_pins[] = { 0x4e, }; 1811 + static int x2000_pwm_pwm15_pins[] = { 0x4f, }; 1812 + static int x2000_mac0_rmii_pins[] = { 1813 + 0x4b, 0x47, 0x46, 0x4a, 0x43, 0x42, 0x4c, 0x4d, 0x4e, 0x41, 1814 + }; 1815 + static int x2000_mac0_rgmii_pins[] = { 1816 + 0x4b, 0x49, 0x48, 0x47, 0x46, 0x4a, 0x45, 0x44, 0x43, 0x42, 1817 + 0x4c, 0x4d, 0x4f, 0x4e, 0x41, 1818 + }; 1819 + static int x2000_mac1_rmii_pins[] = { 1820 + 0x32, 0x2d, 0x2c, 0x31, 0x29, 0x28, 0x33, 0x34, 0x35, 0x37, 1821 + }; 1822 + static int x2000_mac1_rgmii_pins[] = { 1823 + 0x32, 0x2f, 0x2e, 0x2d, 0x2c, 0x31, 0x2b, 0x2a, 0x29, 0x28, 1824 + 0x33, 0x34, 0x36, 0x35, 0x37, 1825 + }; 1826 + static int x2000_otg_pins[] = { 0x96, }; 1827 + 1828 + static u8 x2000_cim_8bit_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, }; 1829 + 1830 + static const struct group_desc x2000_groups[] = { 1831 + INGENIC_PIN_GROUP("uart0-data", x2000_uart0_data, 2), 1832 + INGENIC_PIN_GROUP("uart0-hwflow", x2000_uart0_hwflow, 2), 1833 + INGENIC_PIN_GROUP("uart1-data", x2000_uart1_data, 1), 1834 + INGENIC_PIN_GROUP("uart1-hwflow", x2000_uart1_hwflow, 1), 1835 + INGENIC_PIN_GROUP("uart2-data", x2000_uart2_data, 0), 1836 + INGENIC_PIN_GROUP("uart3-data-c", x2000_uart3_data_c, 0), 1837 + INGENIC_PIN_GROUP("uart3-data-d", x2000_uart3_data_d, 1), 1838 + INGENIC_PIN_GROUP("uart3-hwflow-c", x2000_uart3_hwflow_c, 0), 1839 + INGENIC_PIN_GROUP("uart3-hwflow-d", x2000_uart3_hwflow_d, 1), 1840 + INGENIC_PIN_GROUP("uart4-data-a", x2000_uart4_data_a, 1), 1841 + INGENIC_PIN_GROUP("uart4-data-c", x2000_uart4_data_c, 3), 1842 + INGENIC_PIN_GROUP("uart4-hwflow-a", x2000_uart4_hwflow_a, 1), 1843 + INGENIC_PIN_GROUP("uart4-hwflow-c", x2000_uart4_hwflow_c, 3), 1844 + INGENIC_PIN_GROUP("uart5-data-a", x2000_uart5_data_a, 1), 1845 + INGENIC_PIN_GROUP("uart5-data-c", x2000_uart5_data_c, 3), 1846 + INGENIC_PIN_GROUP("uart6-data-a", x2000_uart6_data_a, 1), 1847 + INGENIC_PIN_GROUP("uart6-data-c", x2000_uart6_data_c, 3), 1848 + INGENIC_PIN_GROUP("uart7-data-a", x2000_uart7_data_a, 1), 1849 + INGENIC_PIN_GROUP("uart7-data-c", x2000_uart7_data_c, 3), 1850 + INGENIC_PIN_GROUP("uart8-data", x2000_uart8_data, 3), 1851 + INGENIC_PIN_GROUP("uart9-data", x2000_uart9_data, 3), 1852 + INGENIC_PIN_GROUP("sfc0-d", x2000_sfc0_d, 1), 1853 + INGENIC_PIN_GROUP("sfc0-e", x2000_sfc0_e, 0), 1854 + INGENIC_PIN_GROUP("sfc1", x2000_sfc1, 1), 1855 + INGENIC_PIN_GROUP("ssi0-dt-b", x2000_ssi0_dt_b, 1), 1856 + INGENIC_PIN_GROUP("ssi0-dt-d", x2000_ssi0_dt_d, 1), 1857 + INGENIC_PIN_GROUP("ssi0-dr-b", x2000_ssi0_dr_b, 1), 1858 + INGENIC_PIN_GROUP("ssi0-dr-d", x2000_ssi0_dr_d, 1), 1859 + INGENIC_PIN_GROUP("ssi0-clk-b", x2000_ssi0_clk_b, 1), 1860 + INGENIC_PIN_GROUP("ssi0-clk-d", x2000_ssi0_clk_d, 1), 1861 + INGENIC_PIN_GROUP("ssi0-ce0-b", x2000_ssi0_ce0_b, 1), 1862 + INGENIC_PIN_GROUP("ssi0-ce0-d", x2000_ssi0_ce0_d, 1), 1863 + INGENIC_PIN_GROUP("ssi1-dt-c", x2000_ssi1_dt_c, 2), 1864 + INGENIC_PIN_GROUP("ssi1-dt-d", x2000_ssi1_dt_d, 2), 1865 + INGENIC_PIN_GROUP("ssi1-dt-e", x2000_ssi1_dt_e, 1), 1866 + INGENIC_PIN_GROUP("ssi1-dr-c", x2000_ssi1_dr_c, 2), 1867 + INGENIC_PIN_GROUP("ssi1-dr-d", x2000_ssi1_dr_d, 2), 1868 + INGENIC_PIN_GROUP("ssi1-dr-e", x2000_ssi1_dr_e, 1), 1869 + INGENIC_PIN_GROUP("ssi1-clk-c", x2000_ssi1_clk_c, 2), 1870 + INGENIC_PIN_GROUP("ssi1-clk-d", x2000_ssi1_clk_d, 2), 1871 + INGENIC_PIN_GROUP("ssi1-clk-e", x2000_ssi1_clk_e, 1), 1872 + INGENIC_PIN_GROUP("ssi1-ce0-c", x2000_ssi1_ce0_c, 2), 1873 + INGENIC_PIN_GROUP("ssi1-ce0-d", x2000_ssi1_ce0_d, 2), 1874 + INGENIC_PIN_GROUP("ssi1-ce0-e", x2000_ssi1_ce0_e, 1), 1875 + INGENIC_PIN_GROUP("mmc0-1bit", x2000_mmc0_1bit, 0), 1876 + INGENIC_PIN_GROUP("mmc0-4bit", x2000_mmc0_4bit, 0), 1877 + INGENIC_PIN_GROUP("mmc0-8bit", x2000_mmc0_8bit, 0), 1878 + INGENIC_PIN_GROUP("mmc1-1bit", x2000_mmc1_1bit, 0), 1879 + INGENIC_PIN_GROUP("mmc1-4bit", x2000_mmc1_4bit, 0), 1880 + INGENIC_PIN_GROUP("mmc2-1bit", x2000_mmc2_1bit, 0), 1881 + INGENIC_PIN_GROUP("mmc2-4bit", x2000_mmc2_4bit, 0), 1882 + INGENIC_PIN_GROUP("emc-8bit-data", x2000_emc_8bit_data, 0), 1883 + INGENIC_PIN_GROUP("emc-16bit-data", x2000_emc_16bit_data, 0), 1884 + INGENIC_PIN_GROUP("emc-addr", x2000_emc_addr, 0), 1885 + INGENIC_PIN_GROUP("emc-rd-we", x2000_emc_rd_we, 0), 1886 + INGENIC_PIN_GROUP("emc-wait", x2000_emc_wait, 0), 1887 + INGENIC_PIN_GROUP("emc-cs1", x2000_emc_cs1, 3), 1888 + INGENIC_PIN_GROUP("emc-cs2", x2000_emc_cs2, 3), 1889 + INGENIC_PIN_GROUP("i2c0-data", x2000_i2c0, 3), 1890 + INGENIC_PIN_GROUP("i2c1-data-c", x2000_i2c1_c, 2), 1891 + INGENIC_PIN_GROUP("i2c1-data-d", x2000_i2c1_d, 1), 1892 + INGENIC_PIN_GROUP("i2c2-data-b", x2000_i2c2_b, 2), 1893 + INGENIC_PIN_GROUP("i2c2-data-d", x2000_i2c2_d, 2), 1894 + INGENIC_PIN_GROUP("i2c2-data-e", x2000_i2c2_e, 1), 1895 + INGENIC_PIN_GROUP("i2c3-data-a", x2000_i2c3_a, 0), 1896 + INGENIC_PIN_GROUP("i2c3-data-d", x2000_i2c3_d, 1), 1897 + INGENIC_PIN_GROUP("i2c4-data-c", x2000_i2c4_c, 1), 1898 + INGENIC_PIN_GROUP("i2c4-data-d", x2000_i2c4_d, 2), 1899 + INGENIC_PIN_GROUP("i2c5-data-c", x2000_i2c5_c, 1), 1900 + INGENIC_PIN_GROUP("i2c5-data-d", x2000_i2c5_d, 1), 1901 + INGENIC_PIN_GROUP("i2s1-data-tx", x2000_i2s1_data_tx, 2), 1902 + INGENIC_PIN_GROUP("i2s1-data-rx", x2000_i2s1_data_rx, 2), 1903 + INGENIC_PIN_GROUP("i2s1-clk-tx", x2000_i2s1_clk_tx, 2), 1904 + INGENIC_PIN_GROUP("i2s1-clk-rx", x2000_i2s1_clk_rx, 2), 1905 + INGENIC_PIN_GROUP("i2s1-sysclk-tx", x2000_i2s1_sysclk_tx, 2), 1906 + INGENIC_PIN_GROUP("i2s1-sysclk-rx", x2000_i2s1_sysclk_rx, 2), 1907 + INGENIC_PIN_GROUP("i2s2-data-rx0", x2000_i2s2_data_rx0, 2), 1908 + INGENIC_PIN_GROUP("i2s2-data-rx1", x2000_i2s2_data_rx1, 2), 1909 + INGENIC_PIN_GROUP("i2s2-data-rx2", x2000_i2s2_data_rx2, 2), 1910 + INGENIC_PIN_GROUP("i2s2-data-rx3", x2000_i2s2_data_rx3, 2), 1911 + INGENIC_PIN_GROUP("i2s2-clk-rx", x2000_i2s2_clk_rx, 2), 1912 + INGENIC_PIN_GROUP("i2s2-sysclk-rx", x2000_i2s2_sysclk_rx, 2), 1913 + INGENIC_PIN_GROUP("i2s3-data-tx0", x2000_i2s3_data_tx0, 2), 1914 + INGENIC_PIN_GROUP("i2s3-data-tx1", x2000_i2s3_data_tx1, 2), 1915 + INGENIC_PIN_GROUP("i2s3-data-tx2", x2000_i2s3_data_tx2, 2), 1916 + INGENIC_PIN_GROUP("i2s3-data-tx3", x2000_i2s3_data_tx3, 2), 1917 + INGENIC_PIN_GROUP("i2s3-clk-tx", x2000_i2s3_clk_tx, 2), 1918 + INGENIC_PIN_GROUP("i2s3-sysclk-tx", x2000_i2s3_sysclk_tx, 2), 1919 + INGENIC_PIN_GROUP("dmic0", x2000_dmic0, 0), 1920 + INGENIC_PIN_GROUP("dmic1", x2000_dmic1, 0), 1921 + INGENIC_PIN_GROUP("dmic2", x2000_dmic2, 0), 1922 + INGENIC_PIN_GROUP("dmic3", x2000_dmic3, 0), 1923 + INGENIC_PIN_GROUP_FUNCS("cim-data-8bit", x2000_cim_8bit, 1924 + x2000_cim_8bit_funcs), 1925 + INGENIC_PIN_GROUP("cim-data-12bit", x2000_cim_12bit, 0), 1926 + INGENIC_PIN_GROUP("lcd-tft-8bit", x2000_lcd_tft_8bit, 1), 1927 + INGENIC_PIN_GROUP("lcd-tft-16bit", x2000_lcd_tft_16bit, 1), 1928 + INGENIC_PIN_GROUP("lcd-tft-18bit", x2000_lcd_tft_18bit, 1), 1929 + INGENIC_PIN_GROUP("lcd-tft-24bit", x2000_lcd_tft_24bit, 1), 1930 + INGENIC_PIN_GROUP("lcd-slcd-8bit", x2000_lcd_slcd_8bit, 2), 1931 + INGENIC_PIN_GROUP("lcd-slcd-16bit", x2000_lcd_tft_16bit, 2), 1932 + INGENIC_PIN_GROUP("pwm0-c", x2000_pwm_pwm0_c, 0), 1933 + INGENIC_PIN_GROUP("pwm0-d", x2000_pwm_pwm0_d, 2), 1934 + INGENIC_PIN_GROUP("pwm1-c", x2000_pwm_pwm1_c, 0), 1935 + INGENIC_PIN_GROUP("pwm1-d", x2000_pwm_pwm1_d, 2), 1936 + INGENIC_PIN_GROUP("pwm2-c", x2000_pwm_pwm2_c, 0), 1937 + INGENIC_PIN_GROUP("pwm2-e", x2000_pwm_pwm2_e, 1), 1938 + INGENIC_PIN_GROUP("pwm3-c", x2000_pwm_pwm3_c, 0), 1939 + INGENIC_PIN_GROUP("pwm3-e", x2000_pwm_pwm3_e, 1), 1940 + INGENIC_PIN_GROUP("pwm4-c", x2000_pwm_pwm4_c, 0), 1941 + INGENIC_PIN_GROUP("pwm4-e", x2000_pwm_pwm4_e, 1), 1942 + INGENIC_PIN_GROUP("pwm5-c", x2000_pwm_pwm5_c, 0), 1943 + INGENIC_PIN_GROUP("pwm5-e", x2000_pwm_pwm5_e, 1), 1944 + INGENIC_PIN_GROUP("pwm6-c", x2000_pwm_pwm6_c, 0), 1945 + INGENIC_PIN_GROUP("pwm6-e", x2000_pwm_pwm6_e, 1), 1946 + INGENIC_PIN_GROUP("pwm7-c", x2000_pwm_pwm7_c, 0), 1947 + INGENIC_PIN_GROUP("pwm7-e", x2000_pwm_pwm7_e, 1), 1948 + INGENIC_PIN_GROUP("pwm8", x2000_pwm_pwm8, 0), 1949 + INGENIC_PIN_GROUP("pwm9", x2000_pwm_pwm9, 0), 1950 + INGENIC_PIN_GROUP("pwm10", x2000_pwm_pwm10, 0), 1951 + INGENIC_PIN_GROUP("pwm11", x2000_pwm_pwm11, 0), 1952 + INGENIC_PIN_GROUP("pwm12", x2000_pwm_pwm12, 0), 1953 + INGENIC_PIN_GROUP("pwm13", x2000_pwm_pwm13, 0), 1954 + INGENIC_PIN_GROUP("pwm14", x2000_pwm_pwm14, 0), 1955 + INGENIC_PIN_GROUP("pwm15", x2000_pwm_pwm15, 0), 1956 + INGENIC_PIN_GROUP("mac0-rmii", x2000_mac0_rmii, 1), 1957 + INGENIC_PIN_GROUP("mac0-rgmii", x2000_mac0_rgmii, 1), 1958 + INGENIC_PIN_GROUP("mac1-rmii", x2000_mac1_rmii, 3), 1959 + INGENIC_PIN_GROUP("mac1-rgmii", x2000_mac1_rgmii, 3), 1960 + INGENIC_PIN_GROUP("otg-vbus", x2000_otg, 0), 1961 + }; 1962 + 1963 + static const char *x2000_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 1964 + static const char *x2000_uart1_groups[] = { "uart1-data", "uart1-hwflow", }; 1965 + static const char *x2000_uart2_groups[] = { "uart2-data", }; 1966 + static const char *x2000_uart3_groups[] = { 1967 + "uart3-data-c", "uart3-data-d", "uart3-hwflow-c", "uart3-hwflow-d", 1968 + }; 1969 + static const char *x2000_uart4_groups[] = { 1970 + "uart4-data-a", "uart4-data-c", "uart4-hwflow-a", "uart4-hwflow-c", 1971 + }; 1972 + static const char *x2000_uart5_groups[] = { "uart5-data-a", "uart5-data-c", }; 1973 + static const char *x2000_uart6_groups[] = { "uart6-data-a", "uart6-data-c", }; 1974 + static const char *x2000_uart7_groups[] = { "uart7-data-a", "uart7-data-c", }; 1975 + static const char *x2000_uart8_groups[] = { "uart8-data", }; 1976 + static const char *x2000_uart9_groups[] = { "uart9-data", }; 1977 + static const char *x2000_sfc_groups[] = { "sfc0-d", "sfc0-e", "sfc1", }; 1978 + static const char *x2000_ssi0_groups[] = { 1979 + "ssi0-dt-b", "ssi0-dt-d", 1980 + "ssi0-dr-b", "ssi0-dr-d", 1981 + "ssi0-clk-b", "ssi0-clk-d", 1982 + "ssi0-ce0-b", "ssi0-ce0-d", 1983 + }; 1984 + static const char *x2000_ssi1_groups[] = { 1985 + "ssi1-dt-c", "ssi1-dt-d", "ssi1-dt-e", 1986 + "ssi1-dr-c", "ssi1-dr-d", "ssi1-dr-e", 1987 + "ssi1-clk-c", "ssi1-clk-d", "ssi1-clk-e", 1988 + "ssi1-ce0-c", "ssi1-ce0-d", "ssi1-ce0-e", 1989 + }; 1990 + static const char *x2000_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", "mmc0-8bit", }; 1991 + static const char *x2000_mmc1_groups[] = { "mmc1-1bit", "mmc1-4bit", }; 1992 + static const char *x2000_mmc2_groups[] = { "mmc2-1bit", "mmc2-4bit", }; 1993 + static const char *x2000_emc_groups[] = { 1994 + "emc-8bit-data", "emc-16bit-data", 1995 + "emc-addr", "emc-rd-we", "emc-wait", 1996 + }; 1997 + static const char *x2000_cs1_groups[] = { "emc-cs1", }; 1998 + static const char *x2000_cs2_groups[] = { "emc-cs2", }; 1999 + static const char *x2000_i2c0_groups[] = { "i2c0-data", }; 2000 + static const char *x2000_i2c1_groups[] = { "i2c1-data-c", "i2c1-data-d", }; 2001 + static const char *x2000_i2c2_groups[] = { "i2c2-data-b", "i2c2-data-d", }; 2002 + static const char *x2000_i2c3_groups[] = { "i2c3-data-a", "i2c3-data-d", }; 2003 + static const char *x2000_i2c4_groups[] = { "i2c4-data-c", "i2c4-data-d", }; 2004 + static const char *x2000_i2c5_groups[] = { "i2c5-data-c", "i2c5-data-d", }; 2005 + static const char *x2000_i2s1_groups[] = { 2006 + "i2s1-data-tx", "i2s1-data-rx", 2007 + "i2s1-clk-tx", "i2s1-clk-rx", 2008 + "i2s1-sysclk-tx", "i2s1-sysclk-rx", 2009 + }; 2010 + static const char *x2000_i2s2_groups[] = { 2011 + "i2s2-data-rx0", "i2s2-data-rx1", "i2s2-data-rx2", "i2s2-data-rx3", 2012 + "i2s2-clk-rx", "i2s2-sysclk-rx", 2013 + }; 2014 + static const char *x2000_i2s3_groups[] = { 2015 + "i2s3-data-tx0", "i2s3-data-tx1", "i2s3-data-tx2", "i2s3-data-tx3", 2016 + "i2s3-clk-tx", "i2s3-sysclk-tx", 2017 + }; 2018 + static const char *x2000_dmic_groups[] = { "dmic0", "dmic1", "dmic2", "dmic3", }; 2019 + static const char *x2000_cim_groups[] = { "cim-data-8bit", "cim-data-12bit", }; 2020 + static const char *x2000_lcd_groups[] = { 2021 + "lcd-tft-8bit", "lcd-tft-16bit", "lcd-tft-18bit", "lcd-tft-24bit", 2022 + "lcd-slcd-8bit", "lcd-slcd-16bit", 2023 + }; 2024 + static const char *x2000_pwm0_groups[] = { "pwm0-c", "pwm0-d", }; 2025 + static const char *x2000_pwm1_groups[] = { "pwm1-c", "pwm1-d", }; 2026 + static const char *x2000_pwm2_groups[] = { "pwm2-c", "pwm2-e", }; 2027 + static const char *x2000_pwm3_groups[] = { "pwm3-c", "pwm3-r", }; 2028 + static const char *x2000_pwm4_groups[] = { "pwm4-c", "pwm4-e", }; 2029 + static const char *x2000_pwm5_groups[] = { "pwm5-c", "pwm5-e", }; 2030 + static const char *x2000_pwm6_groups[] = { "pwm6-c", "pwm6-e", }; 2031 + static const char *x2000_pwm7_groups[] = { "pwm7-c", "pwm7-e", }; 2032 + static const char *x2000_pwm8_groups[] = { "pwm8", }; 2033 + static const char *x2000_pwm9_groups[] = { "pwm9", }; 2034 + static const char *x2000_pwm10_groups[] = { "pwm10", }; 2035 + static const char *x2000_pwm11_groups[] = { "pwm11", }; 2036 + static const char *x2000_pwm12_groups[] = { "pwm12", }; 2037 + static const char *x2000_pwm13_groups[] = { "pwm13", }; 2038 + static const char *x2000_pwm14_groups[] = { "pwm14", }; 2039 + static const char *x2000_pwm15_groups[] = { "pwm15", }; 2040 + static const char *x2000_mac0_groups[] = { "mac0-rmii", "mac0-rgmii", }; 2041 + static const char *x2000_mac1_groups[] = { "mac1-rmii", "mac1-rgmii", }; 2042 + static const char *x2000_otg_groups[] = { "otg-vbus", }; 2043 + 2044 + static const struct function_desc x2000_functions[] = { 2045 + { "uart0", x2000_uart0_groups, ARRAY_SIZE(x2000_uart0_groups), }, 2046 + { "uart1", x2000_uart1_groups, ARRAY_SIZE(x2000_uart1_groups), }, 2047 + { "uart2", x2000_uart2_groups, ARRAY_SIZE(x2000_uart2_groups), }, 2048 + { "uart3", x2000_uart3_groups, ARRAY_SIZE(x2000_uart3_groups), }, 2049 + { "uart4", x2000_uart4_groups, ARRAY_SIZE(x2000_uart4_groups), }, 2050 + { "uart5", x2000_uart5_groups, ARRAY_SIZE(x2000_uart5_groups), }, 2051 + { "uart6", x2000_uart6_groups, ARRAY_SIZE(x2000_uart6_groups), }, 2052 + { "uart7", x2000_uart7_groups, ARRAY_SIZE(x2000_uart7_groups), }, 2053 + { "uart8", x2000_uart8_groups, ARRAY_SIZE(x2000_uart8_groups), }, 2054 + { "uart9", x2000_uart9_groups, ARRAY_SIZE(x2000_uart9_groups), }, 2055 + { "sfc", x2000_sfc_groups, ARRAY_SIZE(x2000_sfc_groups), }, 2056 + { "ssi0", x2000_ssi0_groups, ARRAY_SIZE(x2000_ssi0_groups), }, 2057 + { "ssi1", x2000_ssi1_groups, ARRAY_SIZE(x2000_ssi1_groups), }, 2058 + { "mmc0", x2000_mmc0_groups, ARRAY_SIZE(x2000_mmc0_groups), }, 2059 + { "mmc1", x2000_mmc1_groups, ARRAY_SIZE(x2000_mmc1_groups), }, 2060 + { "mmc2", x2000_mmc2_groups, ARRAY_SIZE(x2000_mmc2_groups), }, 2061 + { "emc", x2000_emc_groups, ARRAY_SIZE(x2000_emc_groups), }, 2062 + { "emc-cs1", x2000_cs1_groups, ARRAY_SIZE(x2000_cs1_groups), }, 2063 + { "emc-cs2", x2000_cs2_groups, ARRAY_SIZE(x2000_cs2_groups), }, 2064 + { "i2c0", x2000_i2c0_groups, ARRAY_SIZE(x2000_i2c0_groups), }, 2065 + { "i2c1", x2000_i2c1_groups, ARRAY_SIZE(x2000_i2c1_groups), }, 2066 + { "i2c2", x2000_i2c2_groups, ARRAY_SIZE(x2000_i2c2_groups), }, 2067 + { "i2c3", x2000_i2c3_groups, ARRAY_SIZE(x2000_i2c3_groups), }, 2068 + { "i2c4", x2000_i2c4_groups, ARRAY_SIZE(x2000_i2c4_groups), }, 2069 + { "i2c5", x2000_i2c5_groups, ARRAY_SIZE(x2000_i2c5_groups), }, 2070 + { "i2s1", x2000_i2s1_groups, ARRAY_SIZE(x2000_i2s1_groups), }, 2071 + { "i2s2", x2000_i2s2_groups, ARRAY_SIZE(x2000_i2s2_groups), }, 2072 + { "i2s3", x2000_i2s3_groups, ARRAY_SIZE(x2000_i2s3_groups), }, 2073 + { "dmic", x2000_dmic_groups, ARRAY_SIZE(x2000_dmic_groups), }, 2074 + { "cim", x2000_cim_groups, ARRAY_SIZE(x2000_cim_groups), }, 2075 + { "lcd", x2000_lcd_groups, ARRAY_SIZE(x2000_lcd_groups), }, 2076 + { "pwm0", x2000_pwm0_groups, ARRAY_SIZE(x2000_pwm0_groups), }, 2077 + { "pwm1", x2000_pwm1_groups, ARRAY_SIZE(x2000_pwm1_groups), }, 2078 + { "pwm2", x2000_pwm2_groups, ARRAY_SIZE(x2000_pwm2_groups), }, 2079 + { "pwm3", x2000_pwm3_groups, ARRAY_SIZE(x2000_pwm3_groups), }, 2080 + { "pwm4", x2000_pwm4_groups, ARRAY_SIZE(x2000_pwm4_groups), }, 2081 + { "pwm5", x2000_pwm5_groups, ARRAY_SIZE(x2000_pwm5_groups), }, 2082 + { "pwm6", x2000_pwm6_groups, ARRAY_SIZE(x2000_pwm6_groups), }, 2083 + { "pwm7", x2000_pwm7_groups, ARRAY_SIZE(x2000_pwm7_groups), }, 2084 + { "pwm8", x2000_pwm8_groups, ARRAY_SIZE(x2000_pwm8_groups), }, 2085 + { "pwm9", x2000_pwm9_groups, ARRAY_SIZE(x2000_pwm9_groups), }, 2086 + { "pwm10", x2000_pwm10_groups, ARRAY_SIZE(x2000_pwm10_groups), }, 2087 + { "pwm11", x2000_pwm11_groups, ARRAY_SIZE(x2000_pwm11_groups), }, 2088 + { "pwm12", x2000_pwm12_groups, ARRAY_SIZE(x2000_pwm12_groups), }, 2089 + { "pwm13", x2000_pwm13_groups, ARRAY_SIZE(x2000_pwm13_groups), }, 2090 + { "pwm14", x2000_pwm14_groups, ARRAY_SIZE(x2000_pwm14_groups), }, 2091 + { "pwm15", x2000_pwm15_groups, ARRAY_SIZE(x2000_pwm15_groups), }, 2092 + { "mac0", x2000_mac0_groups, ARRAY_SIZE(x2000_mac0_groups), }, 2093 + { "mac1", x2000_mac1_groups, ARRAY_SIZE(x2000_mac1_groups), }, 2094 + { "otg", x2000_otg_groups, ARRAY_SIZE(x2000_otg_groups), }, 2095 + }; 2096 + 2097 + static const struct ingenic_chip_info x2000_chip_info = { 2098 + .num_chips = 5, 2099 + .reg_offset = 0x100, 2100 + .version = ID_X2000, 2101 + .groups = x2000_groups, 2102 + .num_groups = ARRAY_SIZE(x2000_groups), 2103 + .functions = x2000_functions, 2104 + .num_functions = ARRAY_SIZE(x2000_functions), 2105 + .pull_ups = x2000_pull_ups, 2106 + .pull_downs = x2000_pull_downs, 2107 + }; 2108 + 2354 2109 static u32 ingenic_gpio_read_reg(struct ingenic_gpio_chip *jzgc, u8 reg) 2355 2110 { 2356 2111 unsigned int val; ··· 2813 1668 static void ingenic_gpio_set_bit(struct ingenic_gpio_chip *jzgc, 2814 1669 u8 reg, u8 offset, bool set) 2815 1670 { 1671 + if (jzgc->jzpc->info->version == ID_JZ4730) { 1672 + regmap_update_bits(jzgc->jzpc->map, jzgc->reg_base + reg, 1673 + BIT(offset), set ? BIT(offset) : 0); 1674 + return; 1675 + } 1676 + 2816 1677 if (set) 2817 1678 reg = REG_SET(reg); 2818 1679 else ··· 2846 1695 jzgc->gc.base / PINS_PER_GPIO_CHIP); 2847 1696 } 2848 1697 1698 + static void jz4730_gpio_set_bits(struct ingenic_gpio_chip *jzgc, 1699 + u8 reg_upper, u8 reg_lower, u8 offset, u8 value) 1700 + { 1701 + /* 1702 + * JZ4730 function and IRQ registers support two-bits-per-pin 1703 + * definitions, split into two groups of 16. 1704 + */ 1705 + u8 reg = offset < JZ4730_PINS_PER_PAIRED_REG ? reg_lower : reg_upper; 1706 + unsigned int idx = offset % JZ4730_PINS_PER_PAIRED_REG; 1707 + unsigned int mask = GENMASK(1, 0) << idx * 2; 1708 + 1709 + regmap_update_bits(jzgc->jzpc->map, jzgc->reg_base + reg, mask, value << (idx * 2)); 1710 + } 1711 + 2849 1712 static inline bool ingenic_gpio_get_value(struct ingenic_gpio_chip *jzgc, 2850 1713 u8 offset) 2851 1714 { ··· 2873 1708 { 2874 1709 if (jzgc->jzpc->info->version >= ID_JZ4770) 2875 1710 ingenic_gpio_set_bit(jzgc, JZ4770_GPIO_PAT0, offset, !!value); 2876 - else 1711 + else if (jzgc->jzpc->info->version >= ID_JZ4740) 2877 1712 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, offset, !!value); 1713 + else 1714 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_DATA, offset, !!value); 2878 1715 } 2879 1716 2880 1717 static void irq_set_type(struct ingenic_gpio_chip *jzgc, 2881 1718 u8 offset, unsigned int type) 2882 1719 { 2883 1720 u8 reg1, reg2; 2884 - bool val1, val2; 1721 + bool val1, val2, val3; 2885 1722 2886 1723 switch (type) { 1724 + case IRQ_TYPE_EDGE_BOTH: 1725 + val1 = val2 = false; 1726 + val3 = true; 1727 + break; 2887 1728 case IRQ_TYPE_EDGE_RISING: 2888 1729 val1 = val2 = true; 1730 + val3 = false; 2889 1731 break; 2890 1732 case IRQ_TYPE_EDGE_FALLING: 2891 - val1 = false; 1733 + val1 = val3 = false; 2892 1734 val2 = true; 2893 1735 break; 2894 1736 case IRQ_TYPE_LEVEL_HIGH: 2895 1737 val1 = true; 2896 - val2 = false; 1738 + val2 = val3 = false; 2897 1739 break; 2898 1740 case IRQ_TYPE_LEVEL_LOW: 2899 1741 default: 2900 - val1 = val2 = false; 1742 + val1 = val2 = val3 = false; 2901 1743 break; 2902 1744 } 2903 1745 2904 1746 if (jzgc->jzpc->info->version >= ID_JZ4770) { 2905 1747 reg1 = JZ4770_GPIO_PAT1; 2906 1748 reg2 = JZ4770_GPIO_PAT0; 2907 - } else { 1749 + } else if (jzgc->jzpc->info->version >= ID_JZ4740) { 2908 1750 reg1 = JZ4740_GPIO_TRIG; 2909 1751 reg2 = JZ4740_GPIO_DIR; 1752 + } else { 1753 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_GPDIR, offset, false); 1754 + jz4730_gpio_set_bits(jzgc, JZ4730_GPIO_GPIDUR, 1755 + JZ4730_GPIO_GPIDLR, offset, (val2 << 1) | val1); 1756 + return; 2910 1757 } 2911 1758 2912 - if (jzgc->jzpc->info->version >= ID_X1000) { 1759 + if (jzgc->jzpc->info->version >= ID_X2000) { 1760 + ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, val1); 1761 + ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, val2); 1762 + ingenic_gpio_shadow_set_bit_load(jzgc); 1763 + ingenic_gpio_set_bit(jzgc, X2000_GPIO_EDG, offset, val3); 1764 + } else if (jzgc->jzpc->info->version >= ID_X1000) { 2913 1765 ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, val1); 2914 1766 ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, val2); 2915 1767 ingenic_gpio_shadow_set_bit_load(jzgc); ··· 2940 1758 { 2941 1759 struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); 2942 1760 struct ingenic_gpio_chip *jzgc = gpiochip_get_data(gc); 1761 + int irq = irqd->hwirq; 2943 1762 2944 - ingenic_gpio_set_bit(jzgc, GPIO_MSK, irqd->hwirq, true); 1763 + if (jzgc->jzpc->info->version >= ID_JZ4740) 1764 + ingenic_gpio_set_bit(jzgc, GPIO_MSK, irq, true); 1765 + else 1766 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_GPIMR, irq, true); 2945 1767 } 2946 1768 2947 1769 static void ingenic_gpio_irq_unmask(struct irq_data *irqd) 2948 1770 { 2949 1771 struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); 2950 1772 struct ingenic_gpio_chip *jzgc = gpiochip_get_data(gc); 1773 + int irq = irqd->hwirq; 2951 1774 2952 - ingenic_gpio_set_bit(jzgc, GPIO_MSK, irqd->hwirq, false); 1775 + if (jzgc->jzpc->info->version >= ID_JZ4740) 1776 + ingenic_gpio_set_bit(jzgc, GPIO_MSK, irq, false); 1777 + else 1778 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_GPIMR, irq, false); 2953 1779 } 2954 1780 2955 1781 static void ingenic_gpio_irq_enable(struct irq_data *irqd) ··· 2968 1778 2969 1779 if (jzgc->jzpc->info->version >= ID_JZ4770) 2970 1780 ingenic_gpio_set_bit(jzgc, JZ4770_GPIO_INT, irq, true); 2971 - else 1781 + else if (jzgc->jzpc->info->version >= ID_JZ4740) 2972 1782 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, true); 1783 + else 1784 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_GPIER, irq, true); 2973 1785 2974 1786 ingenic_gpio_irq_unmask(irqd); 2975 1787 } ··· 2986 1794 2987 1795 if (jzgc->jzpc->info->version >= ID_JZ4770) 2988 1796 ingenic_gpio_set_bit(jzgc, JZ4770_GPIO_INT, irq, false); 2989 - else 1797 + else if (jzgc->jzpc->info->version >= ID_JZ4740) 2990 1798 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, false); 1799 + else 1800 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_GPIER, irq, false); 2991 1801 } 2992 1802 2993 1803 static void ingenic_gpio_irq_ack(struct irq_data *irqd) ··· 2999 1805 int irq = irqd->hwirq; 3000 1806 bool high; 3001 1807 3002 - if (irqd_get_trigger_type(irqd) == IRQ_TYPE_EDGE_BOTH) { 1808 + if ((irqd_get_trigger_type(irqd) == IRQ_TYPE_EDGE_BOTH) && 1809 + (jzgc->jzpc->info->version < ID_X2000)) { 3003 1810 /* 3004 1811 * Switch to an interrupt for the opposite edge to the one that 3005 1812 * triggered the interrupt being ACKed. ··· 3014 1819 3015 1820 if (jzgc->jzpc->info->version >= ID_JZ4770) 3016 1821 ingenic_gpio_set_bit(jzgc, JZ4770_GPIO_FLAG, irq, false); 3017 - else 1822 + else if (jzgc->jzpc->info->version >= ID_JZ4740) 3018 1823 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, irq, true); 1824 + else 1825 + ingenic_gpio_set_bit(jzgc, JZ4730_GPIO_GPFR, irq, false); 3019 1826 } 3020 1827 3021 1828 static int ingenic_gpio_irq_set_type(struct irq_data *irqd, unsigned int type) ··· 3039 1842 irq_set_handler_locked(irqd, handle_bad_irq); 3040 1843 } 3041 1844 3042 - if (type == IRQ_TYPE_EDGE_BOTH) { 1845 + if ((type == IRQ_TYPE_EDGE_BOTH) && (jzgc->jzpc->info->version < ID_X2000)) { 3043 1846 /* 3044 1847 * The hardware does not support interrupts on both edges. The 3045 1848 * best we can do is to set up a single-edge interrupt and then ··· 3073 1876 3074 1877 if (jzgc->jzpc->info->version >= ID_JZ4770) 3075 1878 flag = ingenic_gpio_read_reg(jzgc, JZ4770_GPIO_FLAG); 3076 - else 1879 + else if (jzgc->jzpc->info->version >= ID_JZ4740) 3077 1880 flag = ingenic_gpio_read_reg(jzgc, JZ4740_GPIO_FLAG); 1881 + else 1882 + flag = ingenic_gpio_read_reg(jzgc, JZ4730_GPIO_GPFR); 3078 1883 3079 1884 for_each_set_bit(i, &flag, 32) 3080 1885 generic_handle_irq(irq_linear_revmap(gc->irq.domain, i)); ··· 3112 1913 } 3113 1914 3114 1915 static inline void ingenic_config_pin(struct ingenic_pinctrl *jzpc, 3115 - unsigned int pin, u8 reg, bool set) 1916 + unsigned int pin, unsigned int reg, bool set) 3116 1917 { 3117 1918 unsigned int idx = pin % PINS_PER_GPIO_CHIP; 3118 1919 unsigned int offt = pin / PINS_PER_GPIO_CHIP; 3119 1920 3120 - regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 3121 - (set ? REG_SET(reg) : REG_CLEAR(reg)), BIT(idx)); 1921 + if (set) { 1922 + if (jzpc->info->version >= ID_JZ4740) 1923 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1924 + REG_SET(reg), BIT(idx)); 1925 + else 1926 + regmap_set_bits(jzpc->map, offt * jzpc->info->reg_offset + 1927 + reg, BIT(idx)); 1928 + } else { 1929 + if (jzpc->info->version >= ID_JZ4740) 1930 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1931 + REG_CLEAR(reg), BIT(idx)); 1932 + else 1933 + regmap_clear_bits(jzpc->map, offt * jzpc->info->reg_offset + 1934 + reg, BIT(idx)); 1935 + } 3122 1936 } 3123 1937 3124 1938 static inline void ingenic_shadow_config_pin(struct ingenic_pinctrl *jzpc, ··· 3150 1938 pin / PINS_PER_GPIO_CHIP); 3151 1939 } 3152 1940 1941 + static inline void jz4730_config_pin_function(struct ingenic_pinctrl *jzpc, 1942 + unsigned int pin, u8 reg_upper, u8 reg_lower, u8 value) 1943 + { 1944 + /* 1945 + * JZ4730 function and IRQ registers support two-bits-per-pin 1946 + * definitions, split into two groups of 16. 1947 + */ 1948 + unsigned int idx = pin % JZ4730_PINS_PER_PAIRED_REG; 1949 + unsigned int mask = GENMASK(1, 0) << idx * 2; 1950 + unsigned int offt = pin / PINS_PER_GPIO_CHIP; 1951 + u8 reg = (pin % PINS_PER_GPIO_CHIP) < JZ4730_PINS_PER_PAIRED_REG ? reg_lower : reg_upper; 1952 + 1953 + regmap_update_bits(jzpc->map, offt * jzpc->info->reg_offset + reg, 1954 + mask, value << (idx * 2)); 1955 + } 1956 + 3153 1957 static inline bool ingenic_get_pin_config(struct ingenic_pinctrl *jzpc, 3154 - unsigned int pin, u8 reg) 1958 + unsigned int pin, unsigned int reg) 3155 1959 { 3156 1960 unsigned int idx = pin % PINS_PER_GPIO_CHIP; 3157 1961 unsigned int offt = pin / PINS_PER_GPIO_CHIP; ··· 3187 1959 if (jzpc->info->version >= ID_JZ4770) { 3188 1960 if (ingenic_get_pin_config(jzpc, pin, JZ4770_GPIO_INT) || 3189 1961 ingenic_get_pin_config(jzpc, pin, JZ4770_GPIO_PAT1)) 1962 + return GPIO_LINE_DIRECTION_IN; 1963 + return GPIO_LINE_DIRECTION_OUT; 1964 + } else if (jzpc->info->version == ID_JZ4730) { 1965 + if (!ingenic_get_pin_config(jzpc, pin, JZ4730_GPIO_GPDIR)) 3190 1966 return GPIO_LINE_DIRECTION_IN; 3191 1967 return GPIO_LINE_DIRECTION_OUT; 3192 1968 } ··· 3251 2019 ingenic_config_pin(jzpc, pin, GPIO_MSK, false); 3252 2020 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PAT1, func & 0x2); 3253 2021 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PAT0, func & 0x1); 3254 - } else { 2022 + } else if (jzpc->info->version >= ID_JZ4740) { 3255 2023 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_FUNC, true); 3256 2024 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_TRIG, func & 0x2); 3257 2025 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, func & 0x1); 2026 + } else { 2027 + ingenic_config_pin(jzpc, pin, JZ4730_GPIO_GPIER, false); 2028 + jz4730_config_pin_function(jzpc, pin, JZ4730_GPIO_GPAUR, JZ4730_GPIO_GPALR, func); 3258 2029 } 3259 2030 3260 2031 return 0; ··· 3318 2083 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_INT, false); 3319 2084 ingenic_config_pin(jzpc, pin, GPIO_MSK, true); 3320 2085 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PAT1, input); 3321 - } else { 2086 + } else if (jzpc->info->version >= ID_JZ4740) { 3322 2087 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, false); 3323 2088 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_DIR, !input); 3324 2089 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_FUNC, false); 2090 + } else { 2091 + ingenic_config_pin(jzpc, pin, JZ4730_GPIO_GPIER, false); 2092 + ingenic_config_pin(jzpc, pin, JZ4730_GPIO_GPDIR, !input); 2093 + jz4730_config_pin_function(jzpc, pin, JZ4730_GPIO_GPAUR, JZ4730_GPIO_GPALR, 0); 3325 2094 } 3326 2095 3327 2096 return 0; ··· 3346 2107 enum pin_config_param param = pinconf_to_config_param(*config); 3347 2108 unsigned int idx = pin % PINS_PER_GPIO_CHIP; 3348 2109 unsigned int offt = pin / PINS_PER_GPIO_CHIP; 3349 - bool pull; 2110 + unsigned int arg = 1; 2111 + unsigned int bias, reg; 2112 + bool pull, pullup, pulldown; 3350 2113 3351 - if (jzpc->info->version >= ID_JZ4770) 3352 - pull = !ingenic_get_pin_config(jzpc, pin, JZ4770_GPIO_PEN); 3353 - else 3354 - pull = !ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_PULL_DIS); 2114 + if (jzpc->info->version >= ID_X2000) { 2115 + pullup = ingenic_get_pin_config(jzpc, pin, X2000_GPIO_PEPU) && 2116 + !ingenic_get_pin_config(jzpc, pin, X2000_GPIO_PEPD) && 2117 + (jzpc->info->pull_ups[offt] & BIT(idx)); 2118 + pulldown = ingenic_get_pin_config(jzpc, pin, X2000_GPIO_PEPD) && 2119 + !ingenic_get_pin_config(jzpc, pin, X2000_GPIO_PEPU) && 2120 + (jzpc->info->pull_downs[offt] & BIT(idx)); 2121 + 2122 + } else if (jzpc->info->version >= ID_X1830) { 2123 + unsigned int half = PINS_PER_GPIO_CHIP / 2; 2124 + unsigned int idxh = (pin % half) * 2; 2125 + 2126 + if (idx < half) 2127 + regmap_read(jzpc->map, offt * jzpc->info->reg_offset + 2128 + X1830_GPIO_PEL, &bias); 2129 + else 2130 + regmap_read(jzpc->map, offt * jzpc->info->reg_offset + 2131 + X1830_GPIO_PEH, &bias); 2132 + 2133 + bias = (bias >> idxh) & (GPIO_PULL_UP | GPIO_PULL_DOWN); 2134 + 2135 + pullup = (bias == GPIO_PULL_UP) && (jzpc->info->pull_ups[offt] & BIT(idx)); 2136 + pulldown = (bias == GPIO_PULL_DOWN) && (jzpc->info->pull_downs[offt] & BIT(idx)); 2137 + 2138 + } else { 2139 + if (jzpc->info->version >= ID_JZ4770) 2140 + pull = !ingenic_get_pin_config(jzpc, pin, JZ4770_GPIO_PEN); 2141 + else if (jzpc->info->version >= ID_JZ4740) 2142 + pull = !ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_PULL_DIS); 2143 + else 2144 + pull = ingenic_get_pin_config(jzpc, pin, JZ4730_GPIO_GPPUR); 2145 + 2146 + pullup = pull && (jzpc->info->pull_ups[offt] & BIT(idx)); 2147 + pulldown = pull && (jzpc->info->pull_downs[offt] & BIT(idx)); 2148 + } 3355 2149 3356 2150 switch (param) { 3357 2151 case PIN_CONFIG_BIAS_DISABLE: 3358 - if (pull) 2152 + if (pullup || pulldown) 3359 2153 return -EINVAL; 2154 + 3360 2155 break; 3361 2156 3362 2157 case PIN_CONFIG_BIAS_PULL_UP: 3363 - if (!pull || !(jzpc->info->pull_ups[offt] & BIT(idx))) 2158 + if (!pullup) 3364 2159 return -EINVAL; 2160 + 3365 2161 break; 3366 2162 3367 2163 case PIN_CONFIG_BIAS_PULL_DOWN: 3368 - if (!pull || !(jzpc->info->pull_downs[offt] & BIT(idx))) 2164 + if (!pulldown) 3369 2165 return -EINVAL; 2166 + 2167 + break; 2168 + 2169 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 2170 + if (jzpc->info->version >= ID_X2000) 2171 + reg = X2000_GPIO_SMT; 2172 + else if (jzpc->info->version >= ID_X1830) 2173 + reg = X1830_GPIO_SMT; 2174 + else 2175 + return -EINVAL; 2176 + 2177 + arg = !!ingenic_get_pin_config(jzpc, pin, reg); 2178 + break; 2179 + 2180 + case PIN_CONFIG_SLEW_RATE: 2181 + if (jzpc->info->version >= ID_X2000) 2182 + reg = X2000_GPIO_SR; 2183 + else if (jzpc->info->version >= ID_X1830) 2184 + reg = X1830_GPIO_SR; 2185 + else 2186 + return -EINVAL; 2187 + 2188 + arg = !!ingenic_get_pin_config(jzpc, pin, reg); 3370 2189 break; 3371 2190 3372 2191 default: 3373 2192 return -ENOTSUPP; 3374 2193 } 3375 2194 3376 - *config = pinconf_to_config_packed(param, 1); 2195 + *config = pinconf_to_config_packed(param, arg); 3377 2196 return 0; 3378 2197 } 3379 2198 3380 2199 static void ingenic_set_bias(struct ingenic_pinctrl *jzpc, 3381 2200 unsigned int pin, unsigned int bias) 3382 2201 { 3383 - if (jzpc->info->version >= ID_X1830) { 2202 + if (jzpc->info->version >= ID_X2000) { 2203 + switch (bias) { 2204 + case PIN_CONFIG_BIAS_PULL_UP: 2205 + ingenic_config_pin(jzpc, pin, X2000_GPIO_PEPD, false); 2206 + ingenic_config_pin(jzpc, pin, X2000_GPIO_PEPU, true); 2207 + break; 2208 + 2209 + case PIN_CONFIG_BIAS_PULL_DOWN: 2210 + ingenic_config_pin(jzpc, pin, X2000_GPIO_PEPU, false); 2211 + ingenic_config_pin(jzpc, pin, X2000_GPIO_PEPD, true); 2212 + break; 2213 + 2214 + case PIN_CONFIG_BIAS_DISABLE: 2215 + default: 2216 + ingenic_config_pin(jzpc, pin, X2000_GPIO_PEPU, false); 2217 + ingenic_config_pin(jzpc, pin, X2000_GPIO_PEPD, false); 2218 + } 2219 + 2220 + } else if (jzpc->info->version >= ID_X1830) { 3384 2221 unsigned int idx = pin % PINS_PER_GPIO_CHIP; 3385 2222 unsigned int half = PINS_PER_GPIO_CHIP / 2; 3386 - unsigned int idxh = pin % half * 2; 2223 + unsigned int idxh = (pin % half) * 2; 3387 2224 unsigned int offt = pin / PINS_PER_GPIO_CHIP; 3388 2225 3389 2226 if (idx < half) { ··· 3476 2161 3477 2162 } else if (jzpc->info->version >= ID_JZ4770) { 3478 2163 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PEN, !bias); 3479 - } else { 2164 + } else if (jzpc->info->version >= ID_JZ4740) { 3480 2165 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_PULL_DIS, !bias); 2166 + } else { 2167 + ingenic_config_pin(jzpc, pin, JZ4730_GPIO_GPPUR, bias); 3481 2168 } 2169 + } 2170 + 2171 + static void ingenic_set_schmitt_trigger(struct ingenic_pinctrl *jzpc, 2172 + unsigned int pin, bool enable) 2173 + { 2174 + if (jzpc->info->version >= ID_X2000) 2175 + ingenic_config_pin(jzpc, pin, X2000_GPIO_SMT, enable); 2176 + else 2177 + ingenic_config_pin(jzpc, pin, X1830_GPIO_SMT, enable); 3482 2178 } 3483 2179 3484 2180 static void ingenic_set_output_level(struct ingenic_pinctrl *jzpc, ··· 3497 2171 { 3498 2172 if (jzpc->info->version >= ID_JZ4770) 3499 2173 ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PAT0, high); 3500 - else 2174 + else if (jzpc->info->version >= ID_JZ4740) 3501 2175 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_DATA, high); 2176 + else 2177 + ingenic_config_pin(jzpc, pin, JZ4730_GPIO_DATA, high); 2178 + } 2179 + 2180 + static void ingenic_set_slew_rate(struct ingenic_pinctrl *jzpc, 2181 + unsigned int pin, unsigned int slew) 2182 + { 2183 + if (jzpc->info->version >= ID_X2000) 2184 + ingenic_config_pin(jzpc, pin, X2000_GPIO_SR, slew); 2185 + else 2186 + ingenic_config_pin(jzpc, pin, X1830_GPIO_SR, slew); 3502 2187 } 3503 2188 3504 2189 static int ingenic_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, ··· 3526 2189 case PIN_CONFIG_BIAS_DISABLE: 3527 2190 case PIN_CONFIG_BIAS_PULL_UP: 3528 2191 case PIN_CONFIG_BIAS_PULL_DOWN: 2192 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 3529 2193 case PIN_CONFIG_OUTPUT: 2194 + case PIN_CONFIG_SLEW_RATE: 3530 2195 continue; 3531 2196 default: 3532 2197 return -ENOTSUPP; ··· 3561 2222 ingenic_set_bias(jzpc, pin, GPIO_PULL_DOWN); 3562 2223 break; 3563 2224 2225 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 2226 + if (jzpc->info->version < ID_X1830) 2227 + return -EINVAL; 2228 + 2229 + ingenic_set_schmitt_trigger(jzpc, pin, arg); 2230 + break; 2231 + 3564 2232 case PIN_CONFIG_OUTPUT: 3565 2233 ret = pinctrl_gpio_direction_output(pin); 3566 2234 if (ret) 3567 2235 return ret; 3568 2236 3569 2237 ingenic_set_output_level(jzpc, pin, arg); 2238 + break; 2239 + 2240 + case PIN_CONFIG_SLEW_RATE: 2241 + if (jzpc->info->version < ID_X1830) 2242 + return -EINVAL; 2243 + 2244 + ingenic_set_slew_rate(jzpc, pin, arg); 3570 2245 break; 3571 2246 3572 2247 default: ··· 3654 2301 }; 3655 2302 3656 2303 static const struct of_device_id ingenic_gpio_of_match[] __initconst = { 2304 + { .compatible = "ingenic,jz4730-gpio", }, 3657 2305 { .compatible = "ingenic,jz4740-gpio", }, 3658 2306 { .compatible = "ingenic,jz4725b-gpio", }, 2307 + { .compatible = "ingenic,jz4750-gpio", }, 2308 + { .compatible = "ingenic,jz4755-gpio", }, 3659 2309 { .compatible = "ingenic,jz4760-gpio", }, 3660 2310 { .compatible = "ingenic,jz4770-gpio", }, 2311 + { .compatible = "ingenic,jz4775-gpio", }, 3661 2312 { .compatible = "ingenic,jz4780-gpio", }, 3662 2313 { .compatible = "ingenic,x1000-gpio", }, 3663 2314 { .compatible = "ingenic,x1830-gpio", }, 2315 + { .compatible = "ingenic,x2000-gpio", }, 3664 2316 {}, 3665 2317 }; 3666 2318 ··· 3738 2380 GFP_KERNEL); 3739 2381 if (!girq->parents) 3740 2382 return -ENOMEM; 2383 + 3741 2384 girq->parents[0] = jzgc->irq; 3742 2385 girq->default_type = IRQ_TYPE_NONE; 3743 2386 girq->handler = handle_level_irq; ··· 3844 2485 for_each_child_of_node(dev->of_node, node) { 3845 2486 if (of_match_node(ingenic_gpio_of_match, node)) { 3846 2487 err = ingenic_gpio_probe(jzpc, node); 3847 - if (err) 2488 + if (err) { 2489 + of_node_put(node); 3848 2490 return err; 2491 + } 3849 2492 } 3850 2493 } 3851 2494 ··· 3856 2495 3857 2496 static const struct of_device_id ingenic_pinctrl_of_match[] = { 3858 2497 { 2498 + .compatible = "ingenic,jz4730-pinctrl", 2499 + .data = IF_ENABLED(CONFIG_MACH_JZ4730, &jz4730_chip_info) 2500 + }, 2501 + { 3859 2502 .compatible = "ingenic,jz4740-pinctrl", 3860 2503 .data = IF_ENABLED(CONFIG_MACH_JZ4740, &jz4740_chip_info) 3861 2504 }, 3862 2505 { 3863 2506 .compatible = "ingenic,jz4725b-pinctrl", 3864 2507 .data = IF_ENABLED(CONFIG_MACH_JZ4725B, &jz4725b_chip_info) 2508 + }, 2509 + { 2510 + .compatible = "ingenic,jz4750-pinctrl", 2511 + .data = IF_ENABLED(CONFIG_MACH_JZ4750, &jz4750_chip_info) 2512 + }, 2513 + { 2514 + .compatible = "ingenic,jz4755-pinctrl", 2515 + .data = IF_ENABLED(CONFIG_MACH_JZ4755, &jz4755_chip_info) 3865 2516 }, 3866 2517 { 3867 2518 .compatible = "ingenic,jz4760-pinctrl", ··· 3886 2513 { 3887 2514 .compatible = "ingenic,jz4770-pinctrl", 3888 2515 .data = IF_ENABLED(CONFIG_MACH_JZ4770, &jz4770_chip_info) 2516 + }, 2517 + { 2518 + .compatible = "ingenic,jz4775-pinctrl", 2519 + .data = IF_ENABLED(CONFIG_MACH_JZ4775, &jz4775_chip_info) 3889 2520 }, 3890 2521 { 3891 2522 .compatible = "ingenic,jz4780-pinctrl", ··· 3910 2533 { 3911 2534 .compatible = "ingenic,x1830-pinctrl", 3912 2535 .data = IF_ENABLED(CONFIG_MACH_X1830, &x1830_chip_info) 2536 + }, 2537 + { 2538 + .compatible = "ingenic,x2000-pinctrl", 2539 + .data = IF_ENABLED(CONFIG_MACH_X2000, &x2000_chip_info) 2540 + }, 2541 + { 2542 + .compatible = "ingenic,x2000e-pinctrl", 2543 + .data = IF_ENABLED(CONFIG_MACH_X2000, &x2000_chip_info) 3913 2544 }, 3914 2545 { /* sentinel */ }, 3915 2546 };
-1
drivers/pinctrl/pinctrl-k210.c
··· 15 15 #include <linux/pinctrl/pinmux.h> 16 16 #include <linux/pinctrl/pinconf.h> 17 17 #include <linux/pinctrl/pinconf-generic.h> 18 - #include <linux/io.h> 19 18 20 19 #include <dt-bindings/pinctrl/k210-fpioa.h> 21 20
+2 -2
drivers/pinctrl/pinctrl-lpc18xx.c
··· 646 646 static int lpc18xx_pconf_get_usb1(enum pin_config_param param, int *arg, u32 reg) 647 647 { 648 648 switch (param) { 649 - case PIN_CONFIG_LOW_POWER_MODE: 649 + case PIN_CONFIG_MODE_LOW_POWER: 650 650 if (reg & LPC18XX_SCU_USB1_EPWR) 651 651 *arg = 0; 652 652 else ··· 904 904 u32 param_val, u32 *reg) 905 905 { 906 906 switch (param) { 907 - case PIN_CONFIG_LOW_POWER_MODE: 907 + case PIN_CONFIG_MODE_LOW_POWER: 908 908 if (param_val) 909 909 *reg &= ~LPC18XX_SCU_USB1_EPWR; 910 910 else
+384 -572
drivers/pinctrl/pinctrl-rockchip.c
··· 16 16 */ 17 17 18 18 #include <linux/init.h> 19 + #include <linux/module.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/io.h> 21 22 #include <linux/bitops.h> 22 23 #include <linux/gpio/driver.h> 24 + #include <linux/of_device.h> 23 25 #include <linux/of_address.h> 24 26 #include <linux/of_irq.h> 25 27 #include <linux/pinctrl/machine.h> ··· 63 61 RK3308, 64 62 RK3368, 65 63 RK3399, 64 + RK3568, 66 65 }; 66 + 67 + 68 + /** 69 + * Generate a bitmask for setting a value (v) with a write mask bit in hiword 70 + * register 31:16 area. 71 + */ 72 + #define WRITE_MASK_VAL(h, l, v) \ 73 + (GENMASK(((h) + 16), ((l) + 16)) | (((v) << (l)) & GENMASK((h), (l)))) 67 74 68 75 /* 69 76 * Encode variants of iomux registers into a type variable ··· 300 289 .pull_type[2] = pull2, \ 301 290 .pull_type[3] = pull3, \ 302 291 } 292 + 293 + #define PIN_BANK_MUX_ROUTE_FLAGS(ID, PIN, FUNC, REG, VAL, FLAG) \ 294 + { \ 295 + .bank_num = ID, \ 296 + .pin = PIN, \ 297 + .func = FUNC, \ 298 + .route_offset = REG, \ 299 + .route_val = VAL, \ 300 + .route_location = FLAG, \ 301 + } 302 + 303 + #define RK_MUXROUTE_SAME(ID, PIN, FUNC, REG, VAL) \ 304 + PIN_BANK_MUX_ROUTE_FLAGS(ID, PIN, FUNC, REG, VAL, ROCKCHIP_ROUTE_SAME) 305 + 306 + #define RK_MUXROUTE_GRF(ID, PIN, FUNC, REG, VAL) \ 307 + PIN_BANK_MUX_ROUTE_FLAGS(ID, PIN, FUNC, REG, VAL, ROCKCHIP_ROUTE_GRF) 308 + 309 + #define RK_MUXROUTE_PMU(ID, PIN, FUNC, REG, VAL) \ 310 + PIN_BANK_MUX_ROUTE_FLAGS(ID, PIN, FUNC, REG, VAL, ROCKCHIP_ROUTE_PMU) 303 311 304 312 /** 305 313 * struct rockchip_mux_recalced_data: represent a pin iomux data. ··· 831 801 } 832 802 833 803 static struct rockchip_mux_route_data px30_mux_route_data[] = { 834 - { 835 - /* cif-d2m0 */ 836 - .bank_num = 2, 837 - .pin = 0, 838 - .func = 1, 839 - .route_offset = 0x184, 840 - .route_val = BIT(16 + 7), 841 - }, { 842 - /* cif-d2m1 */ 843 - .bank_num = 3, 844 - .pin = 3, 845 - .func = 3, 846 - .route_offset = 0x184, 847 - .route_val = BIT(16 + 7) | BIT(7), 848 - }, { 849 - /* pdm-m0 */ 850 - .bank_num = 3, 851 - .pin = 22, 852 - .func = 2, 853 - .route_offset = 0x184, 854 - .route_val = BIT(16 + 8), 855 - }, { 856 - /* pdm-m1 */ 857 - .bank_num = 2, 858 - .pin = 22, 859 - .func = 1, 860 - .route_offset = 0x184, 861 - .route_val = BIT(16 + 8) | BIT(8), 862 - }, { 863 - /* uart2-rxm0 */ 864 - .bank_num = 1, 865 - .pin = 27, 866 - .func = 2, 867 - .route_offset = 0x184, 868 - .route_val = BIT(16 + 10), 869 - }, { 870 - /* uart2-rxm1 */ 871 - .bank_num = 2, 872 - .pin = 14, 873 - .func = 2, 874 - .route_offset = 0x184, 875 - .route_val = BIT(16 + 10) | BIT(10), 876 - }, { 877 - /* uart3-rxm0 */ 878 - .bank_num = 0, 879 - .pin = 17, 880 - .func = 2, 881 - .route_offset = 0x184, 882 - .route_val = BIT(16 + 9), 883 - }, { 884 - /* uart3-rxm1 */ 885 - .bank_num = 1, 886 - .pin = 15, 887 - .func = 2, 888 - .route_offset = 0x184, 889 - .route_val = BIT(16 + 9) | BIT(9), 890 - }, 804 + RK_MUXROUTE_SAME(2, RK_PA0, 1, 0x184, BIT(16 + 7)), /* cif-d2m0 */ 805 + RK_MUXROUTE_SAME(3, RK_PA3, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d2m1 */ 806 + RK_MUXROUTE_SAME(3, RK_PC6, 2, 0x184, BIT(16 + 8)), /* pdm-m0 */ 807 + RK_MUXROUTE_SAME(2, RK_PC6, 1, 0x184, BIT(16 + 8) | BIT(8)), /* pdm-m1 */ 808 + RK_MUXROUTE_SAME(1, RK_PD3, 2, 0x184, BIT(16 + 10)), /* uart2-rxm0 */ 809 + RK_MUXROUTE_SAME(2, RK_PB6, 2, 0x184, BIT(16 + 10) | BIT(10)), /* uart2-rxm1 */ 810 + RK_MUXROUTE_SAME(0, RK_PC1, 2, 0x184, BIT(16 + 9)), /* uart3-rxm0 */ 811 + RK_MUXROUTE_SAME(1, RK_PB7, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-rxm1 */ 891 812 }; 892 813 893 814 static struct rockchip_mux_route_data rk3128_mux_route_data[] = { 894 - { 895 - /* spi-0 */ 896 - .bank_num = 1, 897 - .pin = 10, 898 - .func = 1, 899 - .route_offset = 0x144, 900 - .route_val = BIT(16 + 3) | BIT(16 + 4), 901 - }, { 902 - /* spi-1 */ 903 - .bank_num = 1, 904 - .pin = 27, 905 - .func = 3, 906 - .route_offset = 0x144, 907 - .route_val = BIT(16 + 3) | BIT(16 + 4) | BIT(3), 908 - }, { 909 - /* spi-2 */ 910 - .bank_num = 0, 911 - .pin = 13, 912 - .func = 2, 913 - .route_offset = 0x144, 914 - .route_val = BIT(16 + 3) | BIT(16 + 4) | BIT(4), 915 - }, { 916 - /* i2s-0 */ 917 - .bank_num = 1, 918 - .pin = 5, 919 - .func = 1, 920 - .route_offset = 0x144, 921 - .route_val = BIT(16 + 5), 922 - }, { 923 - /* i2s-1 */ 924 - .bank_num = 0, 925 - .pin = 14, 926 - .func = 1, 927 - .route_offset = 0x144, 928 - .route_val = BIT(16 + 5) | BIT(5), 929 - }, { 930 - /* emmc-0 */ 931 - .bank_num = 1, 932 - .pin = 22, 933 - .func = 2, 934 - .route_offset = 0x144, 935 - .route_val = BIT(16 + 6), 936 - }, { 937 - /* emmc-1 */ 938 - .bank_num = 2, 939 - .pin = 4, 940 - .func = 2, 941 - .route_offset = 0x144, 942 - .route_val = BIT(16 + 6) | BIT(6), 943 - }, 815 + RK_MUXROUTE_SAME(1, RK_PB2, 1, 0x144, BIT(16 + 3) | BIT(16 + 4)), /* spi-0 */ 816 + RK_MUXROUTE_SAME(1, RK_PD3, 3, 0x144, BIT(16 + 3) | BIT(16 + 4) | BIT(3)), /* spi-1 */ 817 + RK_MUXROUTE_SAME(0, RK_PB5, 2, 0x144, BIT(16 + 3) | BIT(16 + 4) | BIT(4)), /* spi-2 */ 818 + RK_MUXROUTE_SAME(1, RK_PA5, 1, 0x144, BIT(16 + 5)), /* i2s-0 */ 819 + RK_MUXROUTE_SAME(0, RK_PB6, 1, 0x144, BIT(16 + 5) | BIT(5)), /* i2s-1 */ 820 + RK_MUXROUTE_SAME(1, RK_PC6, 2, 0x144, BIT(16 + 6)), /* emmc-0 */ 821 + RK_MUXROUTE_SAME(2, RK_PA4, 2, 0x144, BIT(16 + 6) | BIT(6)), /* emmc-1 */ 944 822 }; 945 823 946 824 static struct rockchip_mux_route_data rk3188_mux_route_data[] = { 947 - { 948 - /* non-iomuxed emmc/flash pins on flash-dqs */ 949 - .bank_num = 0, 950 - .pin = 24, 951 - .func = 1, 952 - .route_location = ROCKCHIP_ROUTE_GRF, 953 - .route_offset = 0xa0, 954 - .route_val = BIT(16 + 11), 955 - }, { 956 - /* non-iomuxed emmc/flash pins on emmc-clk */ 957 - .bank_num = 0, 958 - .pin = 24, 959 - .func = 2, 960 - .route_location = ROCKCHIP_ROUTE_GRF, 961 - .route_offset = 0xa0, 962 - .route_val = BIT(16 + 11) | BIT(11), 963 - }, 825 + RK_MUXROUTE_SAME(0, RK_PD0, 1, 0xa0, BIT(16 + 11)), /* non-iomuxed emmc/flash pins on flash-dqs */ 826 + RK_MUXROUTE_SAME(0, RK_PD0, 2, 0xa0, BIT(16 + 11) | BIT(11)), /* non-iomuxed emmc/flash pins on emmc-clk */ 964 827 }; 965 828 966 829 static struct rockchip_mux_route_data rk3228_mux_route_data[] = { 967 - { 968 - /* pwm0-0 */ 969 - .bank_num = 0, 970 - .pin = 26, 971 - .func = 1, 972 - .route_offset = 0x50, 973 - .route_val = BIT(16), 974 - }, { 975 - /* pwm0-1 */ 976 - .bank_num = 3, 977 - .pin = 21, 978 - .func = 1, 979 - .route_offset = 0x50, 980 - .route_val = BIT(16) | BIT(0), 981 - }, { 982 - /* pwm1-0 */ 983 - .bank_num = 0, 984 - .pin = 27, 985 - .func = 1, 986 - .route_offset = 0x50, 987 - .route_val = BIT(16 + 1), 988 - }, { 989 - /* pwm1-1 */ 990 - .bank_num = 0, 991 - .pin = 30, 992 - .func = 2, 993 - .route_offset = 0x50, 994 - .route_val = BIT(16 + 1) | BIT(1), 995 - }, { 996 - /* pwm2-0 */ 997 - .bank_num = 0, 998 - .pin = 28, 999 - .func = 1, 1000 - .route_offset = 0x50, 1001 - .route_val = BIT(16 + 2), 1002 - }, { 1003 - /* pwm2-1 */ 1004 - .bank_num = 1, 1005 - .pin = 12, 1006 - .func = 2, 1007 - .route_offset = 0x50, 1008 - .route_val = BIT(16 + 2) | BIT(2), 1009 - }, { 1010 - /* pwm3-0 */ 1011 - .bank_num = 3, 1012 - .pin = 26, 1013 - .func = 1, 1014 - .route_offset = 0x50, 1015 - .route_val = BIT(16 + 3), 1016 - }, { 1017 - /* pwm3-1 */ 1018 - .bank_num = 1, 1019 - .pin = 11, 1020 - .func = 2, 1021 - .route_offset = 0x50, 1022 - .route_val = BIT(16 + 3) | BIT(3), 1023 - }, { 1024 - /* sdio-0_d0 */ 1025 - .bank_num = 1, 1026 - .pin = 1, 1027 - .func = 1, 1028 - .route_offset = 0x50, 1029 - .route_val = BIT(16 + 4), 1030 - }, { 1031 - /* sdio-1_d0 */ 1032 - .bank_num = 3, 1033 - .pin = 2, 1034 - .func = 1, 1035 - .route_offset = 0x50, 1036 - .route_val = BIT(16 + 4) | BIT(4), 1037 - }, { 1038 - /* spi-0_rx */ 1039 - .bank_num = 0, 1040 - .pin = 13, 1041 - .func = 2, 1042 - .route_offset = 0x50, 1043 - .route_val = BIT(16 + 5), 1044 - }, { 1045 - /* spi-1_rx */ 1046 - .bank_num = 2, 1047 - .pin = 0, 1048 - .func = 2, 1049 - .route_offset = 0x50, 1050 - .route_val = BIT(16 + 5) | BIT(5), 1051 - }, { 1052 - /* emmc-0_cmd */ 1053 - .bank_num = 1, 1054 - .pin = 22, 1055 - .func = 2, 1056 - .route_offset = 0x50, 1057 - .route_val = BIT(16 + 7), 1058 - }, { 1059 - /* emmc-1_cmd */ 1060 - .bank_num = 2, 1061 - .pin = 4, 1062 - .func = 2, 1063 - .route_offset = 0x50, 1064 - .route_val = BIT(16 + 7) | BIT(7), 1065 - }, { 1066 - /* uart2-0_rx */ 1067 - .bank_num = 1, 1068 - .pin = 19, 1069 - .func = 2, 1070 - .route_offset = 0x50, 1071 - .route_val = BIT(16 + 8), 1072 - }, { 1073 - /* uart2-1_rx */ 1074 - .bank_num = 1, 1075 - .pin = 10, 1076 - .func = 2, 1077 - .route_offset = 0x50, 1078 - .route_val = BIT(16 + 8) | BIT(8), 1079 - }, { 1080 - /* uart1-0_rx */ 1081 - .bank_num = 1, 1082 - .pin = 10, 1083 - .func = 1, 1084 - .route_offset = 0x50, 1085 - .route_val = BIT(16 + 11), 1086 - }, { 1087 - /* uart1-1_rx */ 1088 - .bank_num = 3, 1089 - .pin = 13, 1090 - .func = 1, 1091 - .route_offset = 0x50, 1092 - .route_val = BIT(16 + 11) | BIT(11), 1093 - }, 830 + RK_MUXROUTE_SAME(0, RK_PD2, 1, 0x50, BIT(16)), /* pwm0-0 */ 831 + RK_MUXROUTE_SAME(3, RK_PC5, 1, 0x50, BIT(16) | BIT(0)), /* pwm0-1 */ 832 + RK_MUXROUTE_SAME(0, RK_PD3, 1, 0x50, BIT(16 + 1)), /* pwm1-0 */ 833 + RK_MUXROUTE_SAME(0, RK_PD6, 2, 0x50, BIT(16 + 1) | BIT(1)), /* pwm1-1 */ 834 + RK_MUXROUTE_SAME(0, RK_PD4, 1, 0x50, BIT(16 + 2)), /* pwm2-0 */ 835 + RK_MUXROUTE_SAME(1, RK_PB4, 2, 0x50, BIT(16 + 2) | BIT(2)), /* pwm2-1 */ 836 + RK_MUXROUTE_SAME(3, RK_PD2, 1, 0x50, BIT(16 + 3)), /* pwm3-0 */ 837 + RK_MUXROUTE_SAME(1, RK_PB3, 2, 0x50, BIT(16 + 3) | BIT(3)), /* pwm3-1 */ 838 + RK_MUXROUTE_SAME(1, RK_PA1, 1, 0x50, BIT(16 + 4)), /* sdio-0_d0 */ 839 + RK_MUXROUTE_SAME(3, RK_PA2, 1, 0x50, BIT(16 + 4) | BIT(4)), /* sdio-1_d0 */ 840 + RK_MUXROUTE_SAME(0, RK_PB5, 2, 0x50, BIT(16 + 5)), /* spi-0_rx */ 841 + RK_MUXROUTE_SAME(2, RK_PA0, 2, 0x50, BIT(16 + 5) | BIT(5)), /* spi-1_rx */ 842 + RK_MUXROUTE_SAME(1, RK_PC6, 2, 0x50, BIT(16 + 7)), /* emmc-0_cmd */ 843 + RK_MUXROUTE_SAME(2, RK_PA4, 2, 0x50, BIT(16 + 7) | BIT(7)), /* emmc-1_cmd */ 844 + RK_MUXROUTE_SAME(1, RK_PC3, 2, 0x50, BIT(16 + 8)), /* uart2-0_rx */ 845 + RK_MUXROUTE_SAME(1, RK_PB2, 2, 0x50, BIT(16 + 8) | BIT(8)), /* uart2-1_rx */ 846 + RK_MUXROUTE_SAME(1, RK_PB2, 1, 0x50, BIT(16 + 11)), /* uart1-0_rx */ 847 + RK_MUXROUTE_SAME(3, RK_PB5, 1, 0x50, BIT(16 + 11) | BIT(11)), /* uart1-1_rx */ 1094 848 }; 1095 849 1096 850 static struct rockchip_mux_route_data rk3288_mux_route_data[] = { 1097 - { 1098 - /* edphdmi_cecinoutt1 */ 1099 - .bank_num = 7, 1100 - .pin = 16, 1101 - .func = 2, 1102 - .route_offset = 0x264, 1103 - .route_val = BIT(16 + 12) | BIT(12), 1104 - }, { 1105 - /* edphdmi_cecinout */ 1106 - .bank_num = 7, 1107 - .pin = 23, 1108 - .func = 4, 1109 - .route_offset = 0x264, 1110 - .route_val = BIT(16 + 12), 1111 - }, 851 + RK_MUXROUTE_SAME(7, RK_PC0, 2, 0x264, BIT(16 + 12) | BIT(12)), /* edphdmi_cecinoutt1 */ 852 + RK_MUXROUTE_SAME(7, RK_PC7, 4, 0x264, BIT(16 + 12)), /* edphdmi_cecinout */ 1112 853 }; 1113 854 1114 855 static struct rockchip_mux_route_data rk3308_mux_route_data[] = { 1115 - { 1116 - /* rtc_clk */ 1117 - .bank_num = 0, 1118 - .pin = 19, 1119 - .func = 1, 1120 - .route_offset = 0x314, 1121 - .route_val = BIT(16 + 0) | BIT(0), 1122 - }, { 1123 - /* uart2_rxm0 */ 1124 - .bank_num = 1, 1125 - .pin = 22, 1126 - .func = 2, 1127 - .route_offset = 0x314, 1128 - .route_val = BIT(16 + 2) | BIT(16 + 3), 1129 - }, { 1130 - /* uart2_rxm1 */ 1131 - .bank_num = 4, 1132 - .pin = 26, 1133 - .func = 2, 1134 - .route_offset = 0x314, 1135 - .route_val = BIT(16 + 2) | BIT(16 + 3) | BIT(2), 1136 - }, { 1137 - /* i2c3_sdam0 */ 1138 - .bank_num = 0, 1139 - .pin = 15, 1140 - .func = 2, 1141 - .route_offset = 0x608, 1142 - .route_val = BIT(16 + 8) | BIT(16 + 9), 1143 - }, { 1144 - /* i2c3_sdam1 */ 1145 - .bank_num = 3, 1146 - .pin = 12, 1147 - .func = 2, 1148 - .route_offset = 0x608, 1149 - .route_val = BIT(16 + 8) | BIT(16 + 9) | BIT(8), 1150 - }, { 1151 - /* i2c3_sdam2 */ 1152 - .bank_num = 2, 1153 - .pin = 0, 1154 - .func = 3, 1155 - .route_offset = 0x608, 1156 - .route_val = BIT(16 + 8) | BIT(16 + 9) | BIT(9), 1157 - }, { 1158 - /* i2s-8ch-1-sclktxm0 */ 1159 - .bank_num = 1, 1160 - .pin = 3, 1161 - .func = 2, 1162 - .route_offset = 0x308, 1163 - .route_val = BIT(16 + 3), 1164 - }, { 1165 - /* i2s-8ch-1-sclkrxm0 */ 1166 - .bank_num = 1, 1167 - .pin = 4, 1168 - .func = 2, 1169 - .route_offset = 0x308, 1170 - .route_val = BIT(16 + 3), 1171 - }, { 1172 - /* i2s-8ch-1-sclktxm1 */ 1173 - .bank_num = 1, 1174 - .pin = 13, 1175 - .func = 2, 1176 - .route_offset = 0x308, 1177 - .route_val = BIT(16 + 3) | BIT(3), 1178 - }, { 1179 - /* i2s-8ch-1-sclkrxm1 */ 1180 - .bank_num = 1, 1181 - .pin = 14, 1182 - .func = 2, 1183 - .route_offset = 0x308, 1184 - .route_val = BIT(16 + 3) | BIT(3), 1185 - }, { 1186 - /* pdm-clkm0 */ 1187 - .bank_num = 1, 1188 - .pin = 4, 1189 - .func = 3, 1190 - .route_offset = 0x308, 1191 - .route_val = BIT(16 + 12) | BIT(16 + 13), 1192 - }, { 1193 - /* pdm-clkm1 */ 1194 - .bank_num = 1, 1195 - .pin = 14, 1196 - .func = 4, 1197 - .route_offset = 0x308, 1198 - .route_val = BIT(16 + 12) | BIT(16 + 13) | BIT(12), 1199 - }, { 1200 - /* pdm-clkm2 */ 1201 - .bank_num = 2, 1202 - .pin = 6, 1203 - .func = 2, 1204 - .route_offset = 0x308, 1205 - .route_val = BIT(16 + 12) | BIT(16 + 13) | BIT(13), 1206 - }, { 1207 - /* pdm-clkm-m2 */ 1208 - .bank_num = 2, 1209 - .pin = 4, 1210 - .func = 3, 1211 - .route_offset = 0x600, 1212 - .route_val = BIT(16 + 2) | BIT(2), 1213 - }, { 1214 - /* spi1_miso */ 1215 - .bank_num = 3, 1216 - .pin = 10, 1217 - .func = 3, 1218 - .route_offset = 0x314, 1219 - .route_val = BIT(16 + 9), 1220 - }, { 1221 - /* spi1_miso_m1 */ 1222 - .bank_num = 2, 1223 - .pin = 4, 1224 - .func = 2, 1225 - .route_offset = 0x314, 1226 - .route_val = BIT(16 + 9) | BIT(9), 1227 - }, { 1228 - /* owire_m0 */ 1229 - .bank_num = 0, 1230 - .pin = 11, 1231 - .func = 3, 1232 - .route_offset = 0x314, 1233 - .route_val = BIT(16 + 10) | BIT(16 + 11), 1234 - }, { 1235 - /* owire_m1 */ 1236 - .bank_num = 1, 1237 - .pin = 22, 1238 - .func = 7, 1239 - .route_offset = 0x314, 1240 - .route_val = BIT(16 + 10) | BIT(16 + 11) | BIT(10), 1241 - }, { 1242 - /* owire_m2 */ 1243 - .bank_num = 2, 1244 - .pin = 2, 1245 - .func = 5, 1246 - .route_offset = 0x314, 1247 - .route_val = BIT(16 + 10) | BIT(16 + 11) | BIT(11), 1248 - }, { 1249 - /* can_rxd_m0 */ 1250 - .bank_num = 0, 1251 - .pin = 11, 1252 - .func = 2, 1253 - .route_offset = 0x314, 1254 - .route_val = BIT(16 + 12) | BIT(16 + 13), 1255 - }, { 1256 - /* can_rxd_m1 */ 1257 - .bank_num = 1, 1258 - .pin = 22, 1259 - .func = 5, 1260 - .route_offset = 0x314, 1261 - .route_val = BIT(16 + 12) | BIT(16 + 13) | BIT(12), 1262 - }, { 1263 - /* can_rxd_m2 */ 1264 - .bank_num = 2, 1265 - .pin = 2, 1266 - .func = 4, 1267 - .route_offset = 0x314, 1268 - .route_val = BIT(16 + 12) | BIT(16 + 13) | BIT(13), 1269 - }, { 1270 - /* mac_rxd0_m0 */ 1271 - .bank_num = 1, 1272 - .pin = 20, 1273 - .func = 3, 1274 - .route_offset = 0x314, 1275 - .route_val = BIT(16 + 14), 1276 - }, { 1277 - /* mac_rxd0_m1 */ 1278 - .bank_num = 4, 1279 - .pin = 2, 1280 - .func = 2, 1281 - .route_offset = 0x314, 1282 - .route_val = BIT(16 + 14) | BIT(14), 1283 - }, { 1284 - /* uart3_rx */ 1285 - .bank_num = 3, 1286 - .pin = 12, 1287 - .func = 4, 1288 - .route_offset = 0x314, 1289 - .route_val = BIT(16 + 15), 1290 - }, { 1291 - /* uart3_rx_m1 */ 1292 - .bank_num = 0, 1293 - .pin = 17, 1294 - .func = 3, 1295 - .route_offset = 0x314, 1296 - .route_val = BIT(16 + 15) | BIT(15), 1297 - }, 856 + RK_MUXROUTE_SAME(0, RK_PC3, 1, 0x314, BIT(16 + 0) | BIT(0)), /* rtc_clk */ 857 + RK_MUXROUTE_SAME(1, RK_PC6, 2, 0x314, BIT(16 + 2) | BIT(16 + 3)), /* uart2_rxm0 */ 858 + RK_MUXROUTE_SAME(4, RK_PD2, 2, 0x314, BIT(16 + 2) | BIT(16 + 3) | BIT(2)), /* uart2_rxm1 */ 859 + RK_MUXROUTE_SAME(0, RK_PB7, 2, 0x608, BIT(16 + 8) | BIT(16 + 9)), /* i2c3_sdam0 */ 860 + RK_MUXROUTE_SAME(3, RK_PB4, 2, 0x608, BIT(16 + 8) | BIT(16 + 9) | BIT(8)), /* i2c3_sdam1 */ 861 + RK_MUXROUTE_SAME(2, RK_PA0, 3, 0x608, BIT(16 + 8) | BIT(16 + 9) | BIT(9)), /* i2c3_sdam2 */ 862 + RK_MUXROUTE_SAME(1, RK_PA3, 2, 0x308, BIT(16 + 3)), /* i2s-8ch-1-sclktxm0 */ 863 + RK_MUXROUTE_SAME(1, RK_PA4, 2, 0x308, BIT(16 + 3)), /* i2s-8ch-1-sclkrxm0 */ 864 + RK_MUXROUTE_SAME(1, RK_PB5, 2, 0x308, BIT(16 + 3) | BIT(3)), /* i2s-8ch-1-sclktxm1 */ 865 + RK_MUXROUTE_SAME(1, RK_PB6, 2, 0x308, BIT(16 + 3) | BIT(3)), /* i2s-8ch-1-sclkrxm1 */ 866 + RK_MUXROUTE_SAME(1, RK_PA4, 3, 0x308, BIT(16 + 12) | BIT(16 + 13)), /* pdm-clkm0 */ 867 + RK_MUXROUTE_SAME(1, RK_PB6, 4, 0x308, BIT(16 + 12) | BIT(16 + 13) | BIT(12)), /* pdm-clkm1 */ 868 + RK_MUXROUTE_SAME(2, RK_PA6, 2, 0x308, BIT(16 + 12) | BIT(16 + 13) | BIT(13)), /* pdm-clkm2 */ 869 + RK_MUXROUTE_SAME(2, RK_PA4, 3, 0x600, BIT(16 + 2) | BIT(2)), /* pdm-clkm-m2 */ 870 + RK_MUXROUTE_SAME(3, RK_PB2, 3, 0x314, BIT(16 + 9)), /* spi1_miso */ 871 + RK_MUXROUTE_SAME(2, RK_PA4, 2, 0x314, BIT(16 + 9) | BIT(9)), /* spi1_miso_m1 */ 872 + RK_MUXROUTE_SAME(0, RK_PB3, 3, 0x314, BIT(16 + 10) | BIT(16 + 11)), /* owire_m0 */ 873 + RK_MUXROUTE_SAME(1, RK_PC6, 7, 0x314, BIT(16 + 10) | BIT(16 + 11) | BIT(10)), /* owire_m1 */ 874 + RK_MUXROUTE_SAME(2, RK_PA2, 5, 0x314, BIT(16 + 10) | BIT(16 + 11) | BIT(11)), /* owire_m2 */ 875 + RK_MUXROUTE_SAME(0, RK_PB3, 2, 0x314, BIT(16 + 12) | BIT(16 + 13)), /* can_rxd_m0 */ 876 + RK_MUXROUTE_SAME(1, RK_PC6, 5, 0x314, BIT(16 + 12) | BIT(16 + 13) | BIT(12)), /* can_rxd_m1 */ 877 + RK_MUXROUTE_SAME(2, RK_PA2, 4, 0x314, BIT(16 + 12) | BIT(16 + 13) | BIT(13)), /* can_rxd_m2 */ 878 + RK_MUXROUTE_SAME(1, RK_PC4, 3, 0x314, BIT(16 + 14)), /* mac_rxd0_m0 */ 879 + RK_MUXROUTE_SAME(4, RK_PA2, 2, 0x314, BIT(16 + 14) | BIT(14)), /* mac_rxd0_m1 */ 880 + RK_MUXROUTE_SAME(3, RK_PB4, 4, 0x314, BIT(16 + 15)), /* uart3_rx */ 881 + RK_MUXROUTE_SAME(0, RK_PC1, 3, 0x314, BIT(16 + 15) | BIT(15)), /* uart3_rx_m1 */ 1298 882 }; 1299 883 1300 884 static struct rockchip_mux_route_data rk3328_mux_route_data[] = { 1301 - { 1302 - /* uart2dbg_rxm0 */ 1303 - .bank_num = 1, 1304 - .pin = 1, 1305 - .func = 2, 1306 - .route_offset = 0x50, 1307 - .route_val = BIT(16) | BIT(16 + 1), 1308 - }, { 1309 - /* uart2dbg_rxm1 */ 1310 - .bank_num = 2, 1311 - .pin = 1, 1312 - .func = 1, 1313 - .route_offset = 0x50, 1314 - .route_val = BIT(16) | BIT(16 + 1) | BIT(0), 1315 - }, { 1316 - /* gmac-m1_rxd0 */ 1317 - .bank_num = 1, 1318 - .pin = 11, 1319 - .func = 2, 1320 - .route_offset = 0x50, 1321 - .route_val = BIT(16 + 2) | BIT(2), 1322 - }, { 1323 - /* gmac-m1-optimized_rxd3 */ 1324 - .bank_num = 1, 1325 - .pin = 14, 1326 - .func = 2, 1327 - .route_offset = 0x50, 1328 - .route_val = BIT(16 + 10) | BIT(10), 1329 - }, { 1330 - /* pdm_sdi0m0 */ 1331 - .bank_num = 2, 1332 - .pin = 19, 1333 - .func = 2, 1334 - .route_offset = 0x50, 1335 - .route_val = BIT(16 + 3), 1336 - }, { 1337 - /* pdm_sdi0m1 */ 1338 - .bank_num = 1, 1339 - .pin = 23, 1340 - .func = 3, 1341 - .route_offset = 0x50, 1342 - .route_val = BIT(16 + 3) | BIT(3), 1343 - }, { 1344 - /* spi_rxdm2 */ 1345 - .bank_num = 3, 1346 - .pin = 2, 1347 - .func = 4, 1348 - .route_offset = 0x50, 1349 - .route_val = BIT(16 + 4) | BIT(16 + 5) | BIT(5), 1350 - }, { 1351 - /* i2s2_sdim0 */ 1352 - .bank_num = 1, 1353 - .pin = 24, 1354 - .func = 1, 1355 - .route_offset = 0x50, 1356 - .route_val = BIT(16 + 6), 1357 - }, { 1358 - /* i2s2_sdim1 */ 1359 - .bank_num = 3, 1360 - .pin = 2, 1361 - .func = 6, 1362 - .route_offset = 0x50, 1363 - .route_val = BIT(16 + 6) | BIT(6), 1364 - }, { 1365 - /* card_iom1 */ 1366 - .bank_num = 2, 1367 - .pin = 22, 1368 - .func = 3, 1369 - .route_offset = 0x50, 1370 - .route_val = BIT(16 + 7) | BIT(7), 1371 - }, { 1372 - /* tsp_d5m1 */ 1373 - .bank_num = 2, 1374 - .pin = 16, 1375 - .func = 3, 1376 - .route_offset = 0x50, 1377 - .route_val = BIT(16 + 8) | BIT(8), 1378 - }, { 1379 - /* cif_data5m1 */ 1380 - .bank_num = 2, 1381 - .pin = 16, 1382 - .func = 4, 1383 - .route_offset = 0x50, 1384 - .route_val = BIT(16 + 9) | BIT(9), 1385 - }, 885 + RK_MUXROUTE_SAME(1, RK_PA1, 2, 0x50, BIT(16) | BIT(16 + 1)), /* uart2dbg_rxm0 */ 886 + RK_MUXROUTE_SAME(2, RK_PA1, 1, 0x50, BIT(16) | BIT(16 + 1) | BIT(0)), /* uart2dbg_rxm1 */ 887 + RK_MUXROUTE_SAME(1, RK_PB3, 2, 0x50, BIT(16 + 2) | BIT(2)), /* gmac-m1_rxd0 */ 888 + RK_MUXROUTE_SAME(1, RK_PB6, 2, 0x50, BIT(16 + 10) | BIT(10)), /* gmac-m1-optimized_rxd3 */ 889 + RK_MUXROUTE_SAME(2, RK_PC3, 2, 0x50, BIT(16 + 3)), /* pdm_sdi0m0 */ 890 + RK_MUXROUTE_SAME(1, RK_PC7, 3, 0x50, BIT(16 + 3) | BIT(3)), /* pdm_sdi0m1 */ 891 + RK_MUXROUTE_SAME(3, RK_PA2, 4, 0x50, BIT(16 + 4) | BIT(16 + 5) | BIT(5)), /* spi_rxdm2 */ 892 + RK_MUXROUTE_SAME(1, RK_PD0, 1, 0x50, BIT(16 + 6)), /* i2s2_sdim0 */ 893 + RK_MUXROUTE_SAME(3, RK_PA2, 6, 0x50, BIT(16 + 6) | BIT(6)), /* i2s2_sdim1 */ 894 + RK_MUXROUTE_SAME(2, RK_PC6, 3, 0x50, BIT(16 + 7) | BIT(7)), /* card_iom1 */ 895 + RK_MUXROUTE_SAME(2, RK_PC0, 3, 0x50, BIT(16 + 8) | BIT(8)), /* tsp_d5m1 */ 896 + RK_MUXROUTE_SAME(2, RK_PC0, 4, 0x50, BIT(16 + 9) | BIT(9)), /* cif_data5m1 */ 1386 897 }; 1387 898 1388 899 static struct rockchip_mux_route_data rk3399_mux_route_data[] = { 1389 - { 1390 - /* uart2dbga_rx */ 1391 - .bank_num = 4, 1392 - .pin = 8, 1393 - .func = 2, 1394 - .route_offset = 0xe21c, 1395 - .route_val = BIT(16 + 10) | BIT(16 + 11), 1396 - }, { 1397 - /* uart2dbgb_rx */ 1398 - .bank_num = 4, 1399 - .pin = 16, 1400 - .func = 2, 1401 - .route_offset = 0xe21c, 1402 - .route_val = BIT(16 + 10) | BIT(16 + 11) | BIT(10), 1403 - }, { 1404 - /* uart2dbgc_rx */ 1405 - .bank_num = 4, 1406 - .pin = 19, 1407 - .func = 1, 1408 - .route_offset = 0xe21c, 1409 - .route_val = BIT(16 + 10) | BIT(16 + 11) | BIT(11), 1410 - }, { 1411 - /* pcie_clkreqn */ 1412 - .bank_num = 2, 1413 - .pin = 26, 1414 - .func = 2, 1415 - .route_offset = 0xe21c, 1416 - .route_val = BIT(16 + 14), 1417 - }, { 1418 - /* pcie_clkreqnb */ 1419 - .bank_num = 4, 1420 - .pin = 24, 1421 - .func = 1, 1422 - .route_offset = 0xe21c, 1423 - .route_val = BIT(16 + 14) | BIT(14), 1424 - }, 900 + RK_MUXROUTE_SAME(4, RK_PB0, 2, 0xe21c, BIT(16 + 10) | BIT(16 + 11)), /* uart2dbga_rx */ 901 + RK_MUXROUTE_SAME(4, RK_PC0, 2, 0xe21c, BIT(16 + 10) | BIT(16 + 11) | BIT(10)), /* uart2dbgb_rx */ 902 + RK_MUXROUTE_SAME(4, RK_PC3, 1, 0xe21c, BIT(16 + 10) | BIT(16 + 11) | BIT(11)), /* uart2dbgc_rx */ 903 + RK_MUXROUTE_SAME(2, RK_PD2, 2, 0xe21c, BIT(16 + 14)), /* pcie_clkreqn */ 904 + RK_MUXROUTE_SAME(4, RK_PD0, 1, 0xe21c, BIT(16 + 14) | BIT(14)), /* pcie_clkreqnb */ 905 + }; 906 + 907 + static struct rockchip_mux_route_data rk3568_mux_route_data[] = { 908 + RK_MUXROUTE_PMU(0, RK_PB7, 1, 0x0110, WRITE_MASK_VAL(1, 0, 0)), /* PWM0 IO mux M0 */ 909 + RK_MUXROUTE_PMU(0, RK_PC7, 2, 0x0110, WRITE_MASK_VAL(1, 0, 1)), /* PWM0 IO mux M1 */ 910 + RK_MUXROUTE_PMU(0, RK_PC0, 1, 0x0110, WRITE_MASK_VAL(3, 2, 0)), /* PWM1 IO mux M0 */ 911 + RK_MUXROUTE_PMU(0, RK_PB5, 4, 0x0110, WRITE_MASK_VAL(3, 2, 1)), /* PWM1 IO mux M1 */ 912 + RK_MUXROUTE_PMU(0, RK_PC1, 1, 0x0110, WRITE_MASK_VAL(5, 4, 0)), /* PWM2 IO mux M0 */ 913 + RK_MUXROUTE_PMU(0, RK_PB6, 4, 0x0110, WRITE_MASK_VAL(5, 4, 1)), /* PWM2 IO mux M1 */ 914 + RK_MUXROUTE_PMU(0, RK_PB3, 2, 0x0300, WRITE_MASK_VAL(0, 0, 0)), /* CAN0 IO mux M0 */ 915 + RK_MUXROUTE_GRF(2, RK_PA1, 4, 0x0300, WRITE_MASK_VAL(0, 0, 1)), /* CAN0 IO mux M1 */ 916 + RK_MUXROUTE_GRF(1, RK_PA1, 3, 0x0300, WRITE_MASK_VAL(2, 2, 0)), /* CAN1 IO mux M0 */ 917 + RK_MUXROUTE_GRF(4, RK_PC3, 3, 0x0300, WRITE_MASK_VAL(2, 2, 1)), /* CAN1 IO mux M1 */ 918 + RK_MUXROUTE_GRF(4, RK_PB5, 3, 0x0300, WRITE_MASK_VAL(4, 4, 0)), /* CAN2 IO mux M0 */ 919 + RK_MUXROUTE_GRF(2, RK_PB2, 4, 0x0300, WRITE_MASK_VAL(4, 4, 1)), /* CAN2 IO mux M1 */ 920 + RK_MUXROUTE_GRF(4, RK_PC4, 1, 0x0300, WRITE_MASK_VAL(6, 6, 0)), /* HPDIN IO mux M0 */ 921 + RK_MUXROUTE_PMU(0, RK_PC2, 2, 0x0300, WRITE_MASK_VAL(6, 6, 1)), /* HPDIN IO mux M1 */ 922 + RK_MUXROUTE_GRF(3, RK_PB1, 3, 0x0300, WRITE_MASK_VAL(8, 8, 0)), /* GMAC1 IO mux M0 */ 923 + RK_MUXROUTE_GRF(4, RK_PA7, 3, 0x0300, WRITE_MASK_VAL(8, 8, 1)), /* GMAC1 IO mux M1 */ 924 + RK_MUXROUTE_GRF(4, RK_PD1, 1, 0x0300, WRITE_MASK_VAL(10, 10, 0)), /* HDMITX IO mux M0 */ 925 + RK_MUXROUTE_PMU(0, RK_PC7, 1, 0x0300, WRITE_MASK_VAL(10, 10, 1)), /* HDMITX IO mux M1 */ 926 + RK_MUXROUTE_PMU(0, RK_PB6, 1, 0x0300, WRITE_MASK_VAL(14, 14, 0)), /* I2C2 IO mux M0 */ 927 + RK_MUXROUTE_GRF(4, RK_PB4, 1, 0x0300, WRITE_MASK_VAL(14, 14, 1)), /* I2C2 IO mux M1 */ 928 + RK_MUXROUTE_GRF(1, RK_PA0, 1, 0x0304, WRITE_MASK_VAL(0, 0, 0)), /* I2C3 IO mux M0 */ 929 + RK_MUXROUTE_GRF(3, RK_PB6, 4, 0x0304, WRITE_MASK_VAL(0, 0, 1)), /* I2C3 IO mux M1 */ 930 + RK_MUXROUTE_GRF(4, RK_PB2, 1, 0x0304, WRITE_MASK_VAL(2, 2, 0)), /* I2C4 IO mux M0 */ 931 + RK_MUXROUTE_GRF(2, RK_PB1, 2, 0x0304, WRITE_MASK_VAL(2, 2, 1)), /* I2C4 IO mux M1 */ 932 + RK_MUXROUTE_GRF(3, RK_PB4, 4, 0x0304, WRITE_MASK_VAL(4, 4, 0)), /* I2C5 IO mux M0 */ 933 + RK_MUXROUTE_GRF(4, RK_PD0, 2, 0x0304, WRITE_MASK_VAL(4, 4, 1)), /* I2C5 IO mux M1 */ 934 + RK_MUXROUTE_GRF(3, RK_PB1, 5, 0x0304, WRITE_MASK_VAL(14, 14, 0)), /* PWM8 IO mux M0 */ 935 + RK_MUXROUTE_GRF(1, RK_PD5, 4, 0x0304, WRITE_MASK_VAL(14, 14, 1)), /* PWM8 IO mux M1 */ 936 + RK_MUXROUTE_GRF(3, RK_PB2, 5, 0x0308, WRITE_MASK_VAL(0, 0, 0)), /* PWM9 IO mux M0 */ 937 + RK_MUXROUTE_GRF(1, RK_PD6, 4, 0x0308, WRITE_MASK_VAL(0, 0, 1)), /* PWM9 IO mux M1 */ 938 + RK_MUXROUTE_GRF(3, RK_PB5, 5, 0x0308, WRITE_MASK_VAL(2, 2, 0)), /* PWM10 IO mux M0 */ 939 + RK_MUXROUTE_GRF(2, RK_PA1, 2, 0x0308, WRITE_MASK_VAL(2, 2, 1)), /* PWM10 IO mux M1 */ 940 + RK_MUXROUTE_GRF(3, RK_PB6, 5, 0x0308, WRITE_MASK_VAL(4, 4, 0)), /* PWM11 IO mux M0 */ 941 + RK_MUXROUTE_GRF(4, RK_PC0, 3, 0x0308, WRITE_MASK_VAL(4, 4, 1)), /* PWM11 IO mux M1 */ 942 + RK_MUXROUTE_GRF(3, RK_PB7, 2, 0x0308, WRITE_MASK_VAL(6, 6, 0)), /* PWM12 IO mux M0 */ 943 + RK_MUXROUTE_GRF(4, RK_PC5, 1, 0x0308, WRITE_MASK_VAL(6, 6, 1)), /* PWM12 IO mux M1 */ 944 + RK_MUXROUTE_GRF(3, RK_PC0, 2, 0x0308, WRITE_MASK_VAL(8, 8, 0)), /* PWM13 IO mux M0 */ 945 + RK_MUXROUTE_GRF(4, RK_PC6, 1, 0x0308, WRITE_MASK_VAL(8, 8, 1)), /* PWM13 IO mux M1 */ 946 + RK_MUXROUTE_GRF(3, RK_PC4, 1, 0x0308, WRITE_MASK_VAL(10, 10, 0)), /* PWM14 IO mux M0 */ 947 + RK_MUXROUTE_GRF(4, RK_PC2, 1, 0x0308, WRITE_MASK_VAL(10, 10, 1)), /* PWM14 IO mux M1 */ 948 + RK_MUXROUTE_GRF(3, RK_PC5, 1, 0x0308, WRITE_MASK_VAL(12, 12, 0)), /* PWM15 IO mux M0 */ 949 + RK_MUXROUTE_GRF(4, RK_PC3, 1, 0x0308, WRITE_MASK_VAL(12, 12, 1)), /* PWM15 IO mux M1 */ 950 + RK_MUXROUTE_GRF(3, RK_PD2, 3, 0x0308, WRITE_MASK_VAL(14, 14, 0)), /* SDMMC2 IO mux M0 */ 951 + RK_MUXROUTE_GRF(3, RK_PA5, 5, 0x0308, WRITE_MASK_VAL(14, 14, 1)), /* SDMMC2 IO mux M1 */ 952 + RK_MUXROUTE_PMU(0, RK_PB5, 2, 0x030c, WRITE_MASK_VAL(0, 0, 0)), /* SPI0 IO mux M0 */ 953 + RK_MUXROUTE_GRF(2, RK_PD3, 3, 0x030c, WRITE_MASK_VAL(0, 0, 1)), /* SPI0 IO mux M1 */ 954 + RK_MUXROUTE_GRF(2, RK_PB5, 3, 0x030c, WRITE_MASK_VAL(2, 2, 0)), /* SPI1 IO mux M0 */ 955 + RK_MUXROUTE_GRF(3, RK_PC3, 3, 0x030c, WRITE_MASK_VAL(2, 2, 1)), /* SPI1 IO mux M1 */ 956 + RK_MUXROUTE_GRF(2, RK_PC1, 4, 0x030c, WRITE_MASK_VAL(4, 4, 0)), /* SPI2 IO mux M0 */ 957 + RK_MUXROUTE_GRF(3, RK_PA0, 3, 0x030c, WRITE_MASK_VAL(4, 4, 1)), /* SPI2 IO mux M1 */ 958 + RK_MUXROUTE_GRF(4, RK_PB3, 4, 0x030c, WRITE_MASK_VAL(6, 6, 0)), /* SPI3 IO mux M0 */ 959 + RK_MUXROUTE_GRF(4, RK_PC2, 2, 0x030c, WRITE_MASK_VAL(6, 6, 1)), /* SPI3 IO mux M1 */ 960 + RK_MUXROUTE_GRF(2, RK_PB4, 2, 0x030c, WRITE_MASK_VAL(8, 8, 0)), /* UART1 IO mux M0 */ 961 + RK_MUXROUTE_PMU(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(8, 8, 1)), /* UART1 IO mux M1 */ 962 + RK_MUXROUTE_PMU(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(10, 10, 0)), /* UART2 IO mux M0 */ 963 + RK_MUXROUTE_GRF(1, RK_PD5, 2, 0x030c, WRITE_MASK_VAL(10, 10, 1)), /* UART2 IO mux M1 */ 964 + RK_MUXROUTE_GRF(1, RK_PA1, 2, 0x030c, WRITE_MASK_VAL(12, 12, 0)), /* UART3 IO mux M0 */ 965 + RK_MUXROUTE_GRF(3, RK_PB7, 4, 0x030c, WRITE_MASK_VAL(12, 12, 1)), /* UART3 IO mux M1 */ 966 + RK_MUXROUTE_GRF(1, RK_PA6, 2, 0x030c, WRITE_MASK_VAL(14, 14, 0)), /* UART4 IO mux M0 */ 967 + RK_MUXROUTE_GRF(3, RK_PB2, 4, 0x030c, WRITE_MASK_VAL(14, 14, 1)), /* UART4 IO mux M1 */ 968 + RK_MUXROUTE_GRF(2, RK_PA2, 3, 0x0310, WRITE_MASK_VAL(0, 0, 0)), /* UART5 IO mux M0 */ 969 + RK_MUXROUTE_GRF(3, RK_PC2, 4, 0x0310, WRITE_MASK_VAL(0, 0, 1)), /* UART5 IO mux M1 */ 970 + RK_MUXROUTE_GRF(2, RK_PA4, 3, 0x0310, WRITE_MASK_VAL(2, 2, 0)), /* UART6 IO mux M0 */ 971 + RK_MUXROUTE_GRF(1, RK_PD5, 3, 0x0310, WRITE_MASK_VAL(2, 2, 1)), /* UART6 IO mux M1 */ 972 + RK_MUXROUTE_GRF(2, RK_PA6, 3, 0x0310, WRITE_MASK_VAL(5, 4, 0)), /* UART7 IO mux M0 */ 973 + RK_MUXROUTE_GRF(3, RK_PC4, 4, 0x0310, WRITE_MASK_VAL(5, 4, 1)), /* UART7 IO mux M1 */ 974 + RK_MUXROUTE_GRF(4, RK_PA2, 4, 0x0310, WRITE_MASK_VAL(5, 4, 2)), /* UART7 IO mux M2 */ 975 + RK_MUXROUTE_GRF(2, RK_PC5, 3, 0x0310, WRITE_MASK_VAL(6, 6, 0)), /* UART8 IO mux M0 */ 976 + RK_MUXROUTE_GRF(2, RK_PD7, 4, 0x0310, WRITE_MASK_VAL(6, 6, 1)), /* UART8 IO mux M1 */ 977 + RK_MUXROUTE_GRF(2, RK_PB0, 3, 0x0310, WRITE_MASK_VAL(9, 8, 0)), /* UART9 IO mux M0 */ 978 + RK_MUXROUTE_GRF(4, RK_PC5, 4, 0x0310, WRITE_MASK_VAL(9, 8, 1)), /* UART9 IO mux M1 */ 979 + RK_MUXROUTE_GRF(4, RK_PA4, 4, 0x0310, WRITE_MASK_VAL(9, 8, 2)), /* UART9 IO mux M2 */ 980 + RK_MUXROUTE_GRF(1, RK_PA2, 1, 0x0310, WRITE_MASK_VAL(11, 10, 0)), /* I2S1 IO mux M0 */ 981 + RK_MUXROUTE_GRF(3, RK_PC6, 4, 0x0310, WRITE_MASK_VAL(11, 10, 1)), /* I2S1 IO mux M1 */ 982 + RK_MUXROUTE_GRF(2, RK_PD0, 5, 0x0310, WRITE_MASK_VAL(11, 10, 2)), /* I2S1 IO mux M2 */ 983 + RK_MUXROUTE_GRF(2, RK_PC1, 1, 0x0310, WRITE_MASK_VAL(12, 12, 0)), /* I2S2 IO mux M0 */ 984 + RK_MUXROUTE_GRF(4, RK_PB6, 5, 0x0310, WRITE_MASK_VAL(12, 12, 1)), /* I2S2 IO mux M1 */ 985 + RK_MUXROUTE_GRF(3, RK_PA2, 4, 0x0310, WRITE_MASK_VAL(14, 14, 0)), /* I2S3 IO mux M0 */ 986 + RK_MUXROUTE_GRF(4, RK_PC2, 5, 0x0310, WRITE_MASK_VAL(14, 14, 1)), /* I2S3 IO mux M1 */ 987 + RK_MUXROUTE_GRF(1, RK_PA4, 3, 0x0314, WRITE_MASK_VAL(1, 0, 0)), /* PDM IO mux M0 */ 988 + RK_MUXROUTE_GRF(1, RK_PA6, 3, 0x0314, WRITE_MASK_VAL(1, 0, 0)), /* PDM IO mux M0 */ 989 + RK_MUXROUTE_GRF(3, RK_PD6, 5, 0x0314, WRITE_MASK_VAL(1, 0, 1)), /* PDM IO mux M1 */ 990 + RK_MUXROUTE_GRF(4, RK_PA0, 4, 0x0314, WRITE_MASK_VAL(1, 0, 1)), /* PDM IO mux M1 */ 991 + RK_MUXROUTE_GRF(3, RK_PC4, 5, 0x0314, WRITE_MASK_VAL(1, 0, 2)), /* PDM IO mux M2 */ 992 + RK_MUXROUTE_PMU(0, RK_PA5, 3, 0x0314, WRITE_MASK_VAL(3, 2, 0)), /* PCIE20 IO mux M0 */ 993 + RK_MUXROUTE_GRF(2, RK_PD0, 4, 0x0314, WRITE_MASK_VAL(3, 2, 1)), /* PCIE20 IO mux M1 */ 994 + RK_MUXROUTE_GRF(1, RK_PB0, 4, 0x0314, WRITE_MASK_VAL(3, 2, 2)), /* PCIE20 IO mux M2 */ 995 + RK_MUXROUTE_PMU(0, RK_PA4, 3, 0x0314, WRITE_MASK_VAL(5, 4, 0)), /* PCIE30X1 IO mux M0 */ 996 + RK_MUXROUTE_GRF(2, RK_PD2, 4, 0x0314, WRITE_MASK_VAL(5, 4, 1)), /* PCIE30X1 IO mux M1 */ 997 + RK_MUXROUTE_GRF(1, RK_PA5, 4, 0x0314, WRITE_MASK_VAL(5, 4, 2)), /* PCIE30X1 IO mux M2 */ 998 + RK_MUXROUTE_PMU(0, RK_PA6, 2, 0x0314, WRITE_MASK_VAL(7, 6, 0)), /* PCIE30X2 IO mux M0 */ 999 + RK_MUXROUTE_GRF(2, RK_PD4, 4, 0x0314, WRITE_MASK_VAL(7, 6, 1)), /* PCIE30X2 IO mux M1 */ 1000 + RK_MUXROUTE_GRF(4, RK_PC2, 4, 0x0314, WRITE_MASK_VAL(7, 6, 2)), /* PCIE30X2 IO mux M2 */ 1425 1001 }; 1426 1002 1427 1003 static bool rockchip_get_mux_route(struct rockchip_pin_bank *bank, int pin, ··· 1738 2102 *bit = (pin_num % 8) * 2; 1739 2103 } 1740 2104 2105 + #define RK3568_PULL_PMU_OFFSET 0x20 2106 + #define RK3568_PULL_GRF_OFFSET 0x80 2107 + #define RK3568_PULL_BITS_PER_PIN 2 2108 + #define RK3568_PULL_PINS_PER_REG 8 2109 + #define RK3568_PULL_BANK_STRIDE 0x10 2110 + 2111 + static void rk3568_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, 2112 + int pin_num, struct regmap **regmap, 2113 + int *reg, u8 *bit) 2114 + { 2115 + struct rockchip_pinctrl *info = bank->drvdata; 2116 + 2117 + if (bank->bank_num == 0) { 2118 + *regmap = info->regmap_pmu; 2119 + *reg = RK3568_PULL_PMU_OFFSET; 2120 + *reg += bank->bank_num * RK3568_PULL_BANK_STRIDE; 2121 + *reg += ((pin_num / RK3568_PULL_PINS_PER_REG) * 4); 2122 + 2123 + *bit = pin_num % RK3568_PULL_PINS_PER_REG; 2124 + *bit *= RK3568_PULL_BITS_PER_PIN; 2125 + } else { 2126 + *regmap = info->regmap_base; 2127 + *reg = RK3568_PULL_GRF_OFFSET; 2128 + *reg += (bank->bank_num - 1) * RK3568_PULL_BANK_STRIDE; 2129 + *reg += ((pin_num / RK3568_PULL_PINS_PER_REG) * 4); 2130 + 2131 + *bit = (pin_num % RK3568_PULL_PINS_PER_REG); 2132 + *bit *= RK3568_PULL_BITS_PER_PIN; 2133 + } 2134 + } 2135 + 2136 + #define RK3568_DRV_PMU_OFFSET 0x70 2137 + #define RK3568_DRV_GRF_OFFSET 0x200 2138 + #define RK3568_DRV_BITS_PER_PIN 8 2139 + #define RK3568_DRV_PINS_PER_REG 2 2140 + #define RK3568_DRV_BANK_STRIDE 0x40 2141 + 2142 + static void rk3568_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, 2143 + int pin_num, struct regmap **regmap, 2144 + int *reg, u8 *bit) 2145 + { 2146 + struct rockchip_pinctrl *info = bank->drvdata; 2147 + 2148 + /* The first 32 pins of the first bank are located in PMU */ 2149 + if (bank->bank_num == 0) { 2150 + *regmap = info->regmap_pmu; 2151 + *reg = RK3568_DRV_PMU_OFFSET; 2152 + *reg += ((pin_num / RK3568_DRV_PINS_PER_REG) * 4); 2153 + 2154 + *bit = pin_num % RK3568_DRV_PINS_PER_REG; 2155 + *bit *= RK3568_DRV_BITS_PER_PIN; 2156 + } else { 2157 + *regmap = info->regmap_base; 2158 + *reg = RK3568_DRV_GRF_OFFSET; 2159 + *reg += (bank->bank_num - 1) * RK3568_DRV_BANK_STRIDE; 2160 + *reg += ((pin_num / RK3568_DRV_PINS_PER_REG) * 4); 2161 + 2162 + *bit = (pin_num % RK3568_DRV_PINS_PER_REG); 2163 + *bit *= RK3568_DRV_BITS_PER_PIN; 2164 + } 2165 + } 2166 + 1741 2167 static int rockchip_perpin_drv_list[DRV_TYPE_MAX][8] = { 1742 2168 { 2, 4, 8, 12, -1, -1, -1, -1 }, 1743 2169 { 3, 6, 9, 12, -1, -1, -1, -1 }, ··· 1900 2202 bank->bank_num, pin_num, strength); 1901 2203 1902 2204 ctrl->drv_calc_reg(bank, pin_num, &regmap, &reg, &bit); 2205 + if (ctrl->type == RK3568) { 2206 + rmask_bits = RK3568_DRV_BITS_PER_PIN; 2207 + ret = (1 << (strength + 1)) - 1; 2208 + goto config; 2209 + } 1903 2210 1904 2211 ret = -EINVAL; 1905 2212 for (i = 0; i < ARRAY_SIZE(rockchip_perpin_drv_list[drv_type]); i++) { ··· 1974 2271 return -EINVAL; 1975 2272 } 1976 2273 2274 + config: 1977 2275 /* enable the write to the equivalent lower bits */ 1978 2276 data = ((1 << rmask_bits) - 1) << (bit + 16); 1979 2277 rmask = data | (data >> 16); ··· 2077 2373 case RK3308: 2078 2374 case RK3368: 2079 2375 case RK3399: 2376 + case RK3568: 2080 2377 pull_type = bank->pull_type[pin_num / 8]; 2081 2378 ret = -EINVAL; 2082 2379 for (i = 0; i < ARRAY_SIZE(rockchip_pull_list[pull_type]); ··· 2086 2381 ret = i; 2087 2382 break; 2088 2383 } 2384 + } 2385 + /* 2386 + * In the TRM, pull-up being 1 for everything except the GPIO0_D0-D6, 2387 + * where that pull up value becomes 3. 2388 + */ 2389 + if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) { 2390 + if (ret == 1) 2391 + ret = 3; 2089 2392 } 2090 2393 2091 2394 if (ret < 0) { ··· 2139 2426 return 0; 2140 2427 } 2141 2428 2429 + #define RK3568_SCHMITT_BITS_PER_PIN 2 2430 + #define RK3568_SCHMITT_PINS_PER_REG 8 2431 + #define RK3568_SCHMITT_BANK_STRIDE 0x10 2432 + #define RK3568_SCHMITT_GRF_OFFSET 0xc0 2433 + #define RK3568_SCHMITT_PMUGRF_OFFSET 0x30 2434 + 2435 + static int rk3568_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, 2436 + int pin_num, 2437 + struct regmap **regmap, 2438 + int *reg, u8 *bit) 2439 + { 2440 + struct rockchip_pinctrl *info = bank->drvdata; 2441 + 2442 + if (bank->bank_num == 0) { 2443 + *regmap = info->regmap_pmu; 2444 + *reg = RK3568_SCHMITT_PMUGRF_OFFSET; 2445 + } else { 2446 + *regmap = info->regmap_base; 2447 + *reg = RK3568_SCHMITT_GRF_OFFSET; 2448 + *reg += (bank->bank_num - 1) * RK3568_SCHMITT_BANK_STRIDE; 2449 + } 2450 + 2451 + *reg += ((pin_num / RK3568_SCHMITT_PINS_PER_REG) * 4); 2452 + *bit = pin_num % RK3568_SCHMITT_PINS_PER_REG; 2453 + *bit *= RK3568_SCHMITT_BITS_PER_PIN; 2454 + 2455 + return 0; 2456 + } 2457 + 2142 2458 static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int pin_num) 2143 2459 { 2144 2460 struct rockchip_pinctrl *info = bank->drvdata; ··· 2186 2444 return ret; 2187 2445 2188 2446 data >>= bit; 2447 + switch (ctrl->type) { 2448 + case RK3568: 2449 + return data & ((1 << RK3568_SCHMITT_BITS_PER_PIN) - 1); 2450 + default: 2451 + break; 2452 + } 2453 + 2189 2454 return data & 0x1; 2190 2455 } 2191 2456 ··· 2214 2465 return ret; 2215 2466 2216 2467 /* enable the write to the equivalent lower bits */ 2217 - data = BIT(bit + 16) | (enable << bit); 2218 - rmask = BIT(bit + 16) | BIT(bit); 2468 + switch (ctrl->type) { 2469 + case RK3568: 2470 + data = ((1 << RK3568_SCHMITT_BITS_PER_PIN) - 1) << (bit + 16); 2471 + rmask = data | (data >> 16); 2472 + data |= ((enable ? 0x2 : 0x1) << bit); 2473 + break; 2474 + default: 2475 + data = BIT(bit + 16) | (enable << bit); 2476 + rmask = BIT(bit + 16) | BIT(bit); 2477 + break; 2478 + } 2219 2479 2220 2480 return regmap_update_bits(regmap, reg, rmask, data); 2221 2481 } ··· 2398 2640 case RK3308: 2399 2641 case RK3368: 2400 2642 case RK3399: 2643 + case RK3568: 2401 2644 return (pull != PIN_CONFIG_BIAS_PULL_PIN_DEFAULT); 2402 2645 } 2403 2646 ··· 3192 3433 * things enabled, so for us that's all masked and all enabled. 3193 3434 */ 3194 3435 writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK); 3436 + writel_relaxed(0xffffffff, bank->reg_base + GPIO_PORTS_EOI); 3195 3437 writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN); 3196 3438 gc->mask_cache = 0xffffffff; 3197 3439 ··· 3973 4213 .drv_calc_reg = rk3399_calc_drv_reg_and_bit, 3974 4214 }; 3975 4215 4216 + static struct rockchip_pin_bank rk3568_pin_banks[] = { 4217 + PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU | IOMUX_WIDTH_4BIT, 4218 + IOMUX_SOURCE_PMU | IOMUX_WIDTH_4BIT, 4219 + IOMUX_SOURCE_PMU | IOMUX_WIDTH_4BIT, 4220 + IOMUX_SOURCE_PMU | IOMUX_WIDTH_4BIT), 4221 + PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", IOMUX_WIDTH_4BIT, 4222 + IOMUX_WIDTH_4BIT, 4223 + IOMUX_WIDTH_4BIT, 4224 + IOMUX_WIDTH_4BIT), 4225 + PIN_BANK_IOMUX_FLAGS(2, 32, "gpio2", IOMUX_WIDTH_4BIT, 4226 + IOMUX_WIDTH_4BIT, 4227 + IOMUX_WIDTH_4BIT, 4228 + IOMUX_WIDTH_4BIT), 4229 + PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3", IOMUX_WIDTH_4BIT, 4230 + IOMUX_WIDTH_4BIT, 4231 + IOMUX_WIDTH_4BIT, 4232 + IOMUX_WIDTH_4BIT), 4233 + PIN_BANK_IOMUX_FLAGS(4, 32, "gpio4", IOMUX_WIDTH_4BIT, 4234 + IOMUX_WIDTH_4BIT, 4235 + IOMUX_WIDTH_4BIT, 4236 + IOMUX_WIDTH_4BIT), 4237 + }; 4238 + 4239 + static struct rockchip_pin_ctrl rk3568_pin_ctrl = { 4240 + .pin_banks = rk3568_pin_banks, 4241 + .nr_banks = ARRAY_SIZE(rk3568_pin_banks), 4242 + .label = "RK3568-GPIO", 4243 + .type = RK3568, 4244 + .grf_mux_offset = 0x0, 4245 + .pmu_mux_offset = 0x0, 4246 + .grf_drv_offset = 0x0200, 4247 + .pmu_drv_offset = 0x0070, 4248 + .iomux_routes = rk3568_mux_route_data, 4249 + .niomux_routes = ARRAY_SIZE(rk3568_mux_route_data), 4250 + .pull_calc_reg = rk3568_calc_pull_reg_and_bit, 4251 + .drv_calc_reg = rk3568_calc_drv_reg_and_bit, 4252 + .schmitt_calc_reg = rk3568_calc_schmitt_reg_and_bit, 4253 + }; 4254 + 3976 4255 static const struct of_device_id rockchip_pinctrl_dt_match[] = { 3977 4256 { .compatible = "rockchip,px30-pinctrl", 3978 4257 .data = &px30_pin_ctrl }, ··· 4041 4242 .data = &rk3368_pin_ctrl }, 4042 4243 { .compatible = "rockchip,rk3399-pinctrl", 4043 4244 .data = &rk3399_pin_ctrl }, 4245 + { .compatible = "rockchip,rk3568-pinctrl", 4246 + .data = &rk3568_pin_ctrl }, 4044 4247 {}, 4045 4248 }; 4046 4249 ··· 4060 4259 return platform_driver_register(&rockchip_pinctrl_driver); 4061 4260 } 4062 4261 postcore_initcall(rockchip_pinctrl_drv_register); 4262 + 4263 + static void __exit rockchip_pinctrl_drv_unregister(void) 4264 + { 4265 + platform_driver_unregister(&rockchip_pinctrl_driver); 4266 + } 4267 + module_exit(rockchip_pinctrl_drv_unregister); 4268 + 4269 + MODULE_DESCRIPTION("ROCKCHIP Pin Controller Driver"); 4270 + MODULE_LICENSE("GPL"); 4271 + MODULE_ALIAS("platform:pinctrl-rockchip"); 4272 + MODULE_DEVICE_TABLE(of, rockchip_pinctrl_dt_match);
+40 -31
drivers/pinctrl/pinctrl-single.c
··· 270 270 writel(val, reg); 271 271 } 272 272 273 + static unsigned int pcs_pin_reg_offset_get(struct pcs_device *pcs, 274 + unsigned int pin) 275 + { 276 + unsigned int mux_bytes = pcs->width / BITS_PER_BYTE; 277 + 278 + if (pcs->bits_per_mux) { 279 + unsigned int pin_offset_bytes; 280 + 281 + pin_offset_bytes = (pcs->bits_per_pin * pin) / BITS_PER_BYTE; 282 + return (pin_offset_bytes / mux_bytes) * mux_bytes; 283 + } 284 + 285 + return pin * mux_bytes; 286 + } 287 + 288 + static unsigned int pcs_pin_shift_reg_get(struct pcs_device *pcs, 289 + unsigned int pin) 290 + { 291 + return (pin % (pcs->width / pcs->bits_per_pin)) * pcs->bits_per_pin; 292 + } 293 + 273 294 static void pcs_pin_dbg_show(struct pinctrl_dev *pctldev, 274 295 struct seq_file *s, 275 296 unsigned pin) 276 297 { 277 298 struct pcs_device *pcs; 278 - unsigned val, mux_bytes; 299 + unsigned int val; 279 300 unsigned long offset; 280 301 size_t pa; 281 302 282 303 pcs = pinctrl_dev_get_drvdata(pctldev); 283 304 284 - mux_bytes = pcs->width / BITS_PER_BYTE; 285 - offset = pin * mux_bytes; 305 + offset = pcs_pin_reg_offset_get(pcs, pin); 286 306 val = pcs->read(pcs->base + offset); 307 + 308 + if (pcs->bits_per_mux) 309 + val &= pcs->fmask << pcs_pin_shift_reg_get(pcs, pin); 310 + 287 311 pa = pcs->res->start + offset; 288 312 289 313 seq_printf(s, "%zx %08x %s ", pa, val, DRIVER_NAME); ··· 408 384 struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); 409 385 struct pcs_gpiofunc_range *frange = NULL; 410 386 struct list_head *pos, *tmp; 411 - int mux_bytes = 0; 412 387 unsigned data; 413 388 414 389 /* If function mask is null, return directly. */ ··· 415 392 return -ENOTSUPP; 416 393 417 394 list_for_each_safe(pos, tmp, &pcs->gpiofuncs) { 395 + u32 offset; 396 + 418 397 frange = list_entry(pos, struct pcs_gpiofunc_range, node); 419 398 if (pin >= frange->offset + frange->npins 420 399 || pin < frange->offset) 421 400 continue; 422 - mux_bytes = pcs->width / BITS_PER_BYTE; 401 + 402 + offset = pcs_pin_reg_offset_get(pcs, pin); 423 403 424 404 if (pcs->bits_per_mux) { 425 - int byte_num, offset, pin_shift; 426 - 427 - byte_num = (pcs->bits_per_pin * pin) / BITS_PER_BYTE; 428 - offset = (byte_num / mux_bytes) * mux_bytes; 429 - pin_shift = pin % (pcs->width / pcs->bits_per_pin) * 430 - pcs->bits_per_pin; 405 + int pin_shift = pcs_pin_shift_reg_get(pcs, pin); 431 406 432 407 data = pcs->read(pcs->base + offset); 433 408 data &= ~(pcs->fmask << pin_shift); 434 409 data |= frange->gpiofunc << pin_shift; 435 410 pcs->write(data, pcs->base + offset); 436 411 } else { 437 - data = pcs->read(pcs->base + pin * mux_bytes); 412 + data = pcs->read(pcs->base + offset); 438 413 data &= ~pcs->fmask; 439 414 data |= frange->gpiofunc; 440 - pcs->write(data, pcs->base + pin * mux_bytes); 415 + pcs->write(data, pcs->base + offset); 441 416 } 442 417 break; 443 418 } ··· 533 512 break; 534 513 case PIN_CONFIG_DRIVE_STRENGTH: 535 514 case PIN_CONFIG_SLEW_RATE: 536 - case PIN_CONFIG_LOW_POWER_MODE: 515 + case PIN_CONFIG_MODE_LOW_POWER: 537 516 default: 538 517 *config = data; 539 518 break; ··· 571 550 case PIN_CONFIG_INPUT_SCHMITT: 572 551 case PIN_CONFIG_DRIVE_STRENGTH: 573 552 case PIN_CONFIG_SLEW_RATE: 574 - case PIN_CONFIG_LOW_POWER_MODE: 553 + case PIN_CONFIG_MODE_LOW_POWER: 575 554 shift = ffs(func->conf[i].mask) - 1; 576 555 data &= ~func->conf[i].mask; 577 556 data |= (arg << shift) & func->conf[i].mask; ··· 677 656 * pcs_add_pin() - add a pin to the static per controller pin array 678 657 * @pcs: pcs driver instance 679 658 * @offset: register offset from base 680 - * @pin_pos: unused 681 659 */ 682 - static int pcs_add_pin(struct pcs_device *pcs, unsigned offset, 683 - unsigned pin_pos) 660 + static int pcs_add_pin(struct pcs_device *pcs, unsigned int offset) 684 661 { 685 662 struct pcs_soc_data *pcs_soc = &pcs->socdata; 686 663 struct pinctrl_pin_desc *pin; ··· 722 703 static int pcs_allocate_pin_table(struct pcs_device *pcs) 723 704 { 724 705 int mux_bytes, nr_pins, i; 725 - int num_pins_in_register = 0; 726 706 727 707 mux_bytes = pcs->width / BITS_PER_BYTE; 728 708 729 709 if (pcs->bits_per_mux) { 730 710 pcs->bits_per_pin = fls(pcs->fmask); 731 711 nr_pins = (pcs->size * BITS_PER_BYTE) / pcs->bits_per_pin; 732 - num_pins_in_register = pcs->width / pcs->bits_per_pin; 733 712 } else { 734 713 nr_pins = pcs->size / mux_bytes; 735 714 } ··· 745 728 for (i = 0; i < pcs->desc.npins; i++) { 746 729 unsigned offset; 747 730 int res; 748 - int byte_num; 749 - int pin_pos = 0; 750 731 751 - if (pcs->bits_per_mux) { 752 - byte_num = (pcs->bits_per_pin * i) / BITS_PER_BYTE; 753 - offset = (byte_num / mux_bytes) * mux_bytes; 754 - pin_pos = i % num_pins_in_register; 755 - } else { 756 - offset = i * mux_bytes; 757 - } 758 - res = pcs_add_pin(pcs, offset, pin_pos); 732 + offset = pcs_pin_reg_offset_get(pcs, i); 733 + res = pcs_add_pin(pcs, offset); 759 734 if (res < 0) { 760 735 dev_err(pcs->dev, "error adding pins: %i\n", res); 761 736 return res; ··· 919 910 { "pinctrl-single,drive-strength", PIN_CONFIG_DRIVE_STRENGTH, }, 920 911 { "pinctrl-single,slew-rate", PIN_CONFIG_SLEW_RATE, }, 921 912 { "pinctrl-single,input-schmitt", PIN_CONFIG_INPUT_SCHMITT, }, 922 - { "pinctrl-single,low-power-mode", PIN_CONFIG_LOW_POWER_MODE, }, 913 + { "pinctrl-single,low-power-mode", PIN_CONFIG_MODE_LOW_POWER, }, 923 914 }; 924 915 static const struct pcs_conf_type prop4[] = { 925 916 { "pinctrl-single,bias-pullup", PIN_CONFIG_BIAS_PULL_UP, },
+2 -2
drivers/pinctrl/pinctrl-zynq.c
··· 1016 1016 case PIN_CONFIG_SLEW_RATE: 1017 1017 arg = !!(reg & ZYNQ_PINCONF_SPEED); 1018 1018 break; 1019 - case PIN_CONFIG_LOW_POWER_MODE: 1019 + case PIN_CONFIG_MODE_LOW_POWER: 1020 1020 { 1021 1021 enum zynq_io_standards iostd = zynq_pinconf_iostd_get(reg); 1022 1022 ··· 1087 1087 reg &= ~ZYNQ_PINCONF_IOTYPE_MASK; 1088 1088 reg |= arg << ZYNQ_PINCONF_IOTYPE_SHIFT; 1089 1089 break; 1090 - case PIN_CONFIG_LOW_POWER_MODE: 1090 + case PIN_CONFIG_MODE_LOW_POWER: 1091 1091 if (arg) 1092 1092 reg |= ZYNQ_PINCONF_DISABLE_RECVR; 1093 1093 else
+906
drivers/pinctrl/pinctrl-zynqmp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * ZynqMP pin controller 4 + * 5 + * Copyright (C) 2020 Xilinx, Inc. 6 + * 7 + * Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com> 8 + * Rajan Vaja <rajan.vaja@xilinx.com> 9 + */ 10 + 11 + #include <dt-bindings/pinctrl/pinctrl-zynqmp.h> 12 + 13 + #include <linux/init.h> 14 + #include <linux/module.h> 15 + #include <linux/of_address.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/firmware/xlnx-zynqmp.h> 18 + 19 + #include <linux/pinctrl/pinmux.h> 20 + #include <linux/pinctrl/pinconf-generic.h> 21 + 22 + #include "core.h" 23 + #include "pinctrl-utils.h" 24 + 25 + #define ZYNQMP_PIN_PREFIX "MIO" 26 + #define PINCTRL_GET_FUNC_NAME_RESP_LEN 16 27 + #define MAX_FUNC_NAME_LEN 16 28 + #define MAX_GROUP_PIN 50 29 + #define MAX_PIN_GROUPS 50 30 + #define END_OF_FUNCTIONS "END_OF_FUNCTIONS" 31 + #define NUM_GROUPS_PER_RESP 6 32 + 33 + #define PINCTRL_GET_FUNC_GROUPS_RESP_LEN 12 34 + #define PINCTRL_GET_PIN_GROUPS_RESP_LEN 12 35 + #define NA_GROUP 0xFFFF 36 + #define RESERVED_GROUP 0xFFFE 37 + 38 + #define DRIVE_STRENGTH_2MA 2 39 + #define DRIVE_STRENGTH_4MA 4 40 + #define DRIVE_STRENGTH_8MA 8 41 + #define DRIVE_STRENGTH_12MA 12 42 + 43 + /** 44 + * struct zynqmp_pmux_function - a pinmux function 45 + * @name: Name of the pin mux function 46 + * @groups: List of pin groups for this function 47 + * @ngroups: Number of entries in @groups 48 + * @node: Firmware node matching with the function 49 + * 50 + * This structure holds information about pin control function 51 + * and function group names supporting that function. 52 + */ 53 + struct zynqmp_pmux_function { 54 + char name[MAX_FUNC_NAME_LEN]; 55 + const char * const *groups; 56 + unsigned int ngroups; 57 + }; 58 + 59 + /** 60 + * struct zynqmp_pinctrl - driver data 61 + * @pctrl: Pin control device 62 + * @groups: Pin groups 63 + * @ngroups: Number of @groups 64 + * @funcs: Pin mux functions 65 + * @nfuncs: Number of @funcs 66 + * 67 + * This struct is stored as driver data and used to retrieve 68 + * information regarding pin control functions, groups and 69 + * group pins. 70 + */ 71 + struct zynqmp_pinctrl { 72 + struct pinctrl_dev *pctrl; 73 + const struct zynqmp_pctrl_group *groups; 74 + unsigned int ngroups; 75 + const struct zynqmp_pmux_function *funcs; 76 + unsigned int nfuncs; 77 + }; 78 + 79 + /** 80 + * struct zynqmp_pctrl_group - Pin control group info 81 + * @name: Group name 82 + * @pins: Group pin numbers 83 + * @npins: Number of pins in the group 84 + */ 85 + struct zynqmp_pctrl_group { 86 + const char *name; 87 + unsigned int pins[MAX_GROUP_PIN]; 88 + unsigned int npins; 89 + }; 90 + 91 + static struct pinctrl_desc zynqmp_desc; 92 + 93 + static int zynqmp_pctrl_get_groups_count(struct pinctrl_dev *pctldev) 94 + { 95 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 96 + 97 + return pctrl->ngroups; 98 + } 99 + 100 + static const char *zynqmp_pctrl_get_group_name(struct pinctrl_dev *pctldev, 101 + unsigned int selector) 102 + { 103 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 104 + 105 + return pctrl->groups[selector].name; 106 + } 107 + 108 + static int zynqmp_pctrl_get_group_pins(struct pinctrl_dev *pctldev, 109 + unsigned int selector, 110 + const unsigned int **pins, 111 + unsigned int *npins) 112 + { 113 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 114 + 115 + *pins = pctrl->groups[selector].pins; 116 + *npins = pctrl->groups[selector].npins; 117 + 118 + return 0; 119 + } 120 + 121 + static const struct pinctrl_ops zynqmp_pctrl_ops = { 122 + .get_groups_count = zynqmp_pctrl_get_groups_count, 123 + .get_group_name = zynqmp_pctrl_get_group_name, 124 + .get_group_pins = zynqmp_pctrl_get_group_pins, 125 + .dt_node_to_map = pinconf_generic_dt_node_to_map_all, 126 + .dt_free_map = pinctrl_utils_free_map, 127 + }; 128 + 129 + static int zynqmp_pinmux_request_pin(struct pinctrl_dev *pctldev, 130 + unsigned int pin) 131 + { 132 + int ret; 133 + 134 + ret = zynqmp_pm_pinctrl_request(pin); 135 + if (ret) { 136 + dev_err(pctldev->dev, "request failed for pin %u\n", pin); 137 + return ret; 138 + } 139 + 140 + return 0; 141 + } 142 + 143 + static int zynqmp_pmux_get_functions_count(struct pinctrl_dev *pctldev) 144 + { 145 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 146 + 147 + return pctrl->nfuncs; 148 + } 149 + 150 + static const char *zynqmp_pmux_get_function_name(struct pinctrl_dev *pctldev, 151 + unsigned int selector) 152 + { 153 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 154 + 155 + return pctrl->funcs[selector].name; 156 + } 157 + 158 + /** 159 + * zynqmp_pmux_get_function_groups() - Get groups for the function 160 + * @pctldev: Pincontrol device pointer. 161 + * @selector: Function ID 162 + * @groups: Group names. 163 + * @num_groups: Number of function groups. 164 + * 165 + * Get function's group count and group names. 166 + */ 167 + static int zynqmp_pmux_get_function_groups(struct pinctrl_dev *pctldev, 168 + unsigned int selector, 169 + const char * const **groups, 170 + unsigned * const num_groups) 171 + { 172 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 173 + 174 + *groups = pctrl->funcs[selector].groups; 175 + *num_groups = pctrl->funcs[selector].ngroups; 176 + 177 + return 0; 178 + } 179 + 180 + /** 181 + * zynqmp_pinmux_set_mux() - Set requested function for the group 182 + * @pctldev: Pincontrol device pointer. 183 + * @function: Function ID. 184 + * @group: Group ID. 185 + * 186 + * Loop through all pins of the group and call firmware API 187 + * to set requested function for all pins in the group. 188 + * 189 + * Return: 0 on success else error code. 190 + */ 191 + static int zynqmp_pinmux_set_mux(struct pinctrl_dev *pctldev, 192 + unsigned int function, 193 + unsigned int group) 194 + { 195 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 196 + const struct zynqmp_pctrl_group *pgrp = &pctrl->groups[group]; 197 + int ret, i; 198 + 199 + for (i = 0; i < pgrp->npins; i++) { 200 + unsigned int pin = pgrp->pins[i]; 201 + 202 + ret = zynqmp_pm_pinctrl_set_function(pin, function); 203 + if (ret) { 204 + dev_err(pctldev->dev, "set mux failed for pin %u\n", 205 + pin); 206 + return ret; 207 + } 208 + } 209 + 210 + return 0; 211 + } 212 + 213 + static int zynqmp_pinmux_release_pin(struct pinctrl_dev *pctldev, 214 + unsigned int pin) 215 + { 216 + int ret; 217 + 218 + ret = zynqmp_pm_pinctrl_release(pin); 219 + if (ret) { 220 + dev_err(pctldev->dev, "free pin failed for pin %u\n", 221 + pin); 222 + return ret; 223 + } 224 + 225 + return 0; 226 + } 227 + 228 + static const struct pinmux_ops zynqmp_pinmux_ops = { 229 + .request = zynqmp_pinmux_request_pin, 230 + .get_functions_count = zynqmp_pmux_get_functions_count, 231 + .get_function_name = zynqmp_pmux_get_function_name, 232 + .get_function_groups = zynqmp_pmux_get_function_groups, 233 + .set_mux = zynqmp_pinmux_set_mux, 234 + .free = zynqmp_pinmux_release_pin, 235 + }; 236 + 237 + /** 238 + * zynqmp_pinconf_cfg_get() - get config value for the pin 239 + * @pctldev: Pin control device pointer. 240 + * @pin: Pin number. 241 + * @config: Value of config param. 242 + * 243 + * Get value of the requested configuration parameter for the 244 + * given pin. 245 + * 246 + * Return: 0 on success else error code. 247 + */ 248 + static int zynqmp_pinconf_cfg_get(struct pinctrl_dev *pctldev, 249 + unsigned int pin, 250 + unsigned long *config) 251 + { 252 + unsigned int arg, param = pinconf_to_config_param(*config); 253 + int ret; 254 + 255 + if (pin >= zynqmp_desc.npins) 256 + return -EOPNOTSUPP; 257 + 258 + switch (param) { 259 + case PIN_CONFIG_SLEW_RATE: 260 + param = PM_PINCTRL_CONFIG_SLEW_RATE; 261 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 262 + break; 263 + case PIN_CONFIG_BIAS_PULL_UP: 264 + param = PM_PINCTRL_CONFIG_PULL_CTRL; 265 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 266 + if (arg != PM_PINCTRL_BIAS_PULL_UP) 267 + return -EINVAL; 268 + 269 + arg = 1; 270 + break; 271 + case PIN_CONFIG_BIAS_PULL_DOWN: 272 + param = PM_PINCTRL_CONFIG_PULL_CTRL; 273 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 274 + if (arg != PM_PINCTRL_BIAS_PULL_DOWN) 275 + return -EINVAL; 276 + 277 + arg = 1; 278 + break; 279 + case PIN_CONFIG_BIAS_DISABLE: 280 + param = PM_PINCTRL_CONFIG_BIAS_STATUS; 281 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 282 + if (arg != PM_PINCTRL_BIAS_DISABLE) 283 + return -EINVAL; 284 + 285 + arg = 1; 286 + break; 287 + case PIN_CONFIG_POWER_SOURCE: 288 + param = PM_PINCTRL_CONFIG_VOLTAGE_STATUS; 289 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 290 + break; 291 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 292 + param = PM_PINCTRL_CONFIG_SCHMITT_CMOS; 293 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 294 + break; 295 + case PIN_CONFIG_DRIVE_STRENGTH: 296 + param = PM_PINCTRL_CONFIG_DRIVE_STRENGTH; 297 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); 298 + switch (arg) { 299 + case PM_PINCTRL_DRIVE_STRENGTH_2MA: 300 + arg = DRIVE_STRENGTH_2MA; 301 + break; 302 + case PM_PINCTRL_DRIVE_STRENGTH_4MA: 303 + arg = DRIVE_STRENGTH_4MA; 304 + break; 305 + case PM_PINCTRL_DRIVE_STRENGTH_8MA: 306 + arg = DRIVE_STRENGTH_8MA; 307 + break; 308 + case PM_PINCTRL_DRIVE_STRENGTH_12MA: 309 + arg = DRIVE_STRENGTH_12MA; 310 + break; 311 + default: 312 + /* Invalid drive strength */ 313 + dev_warn(pctldev->dev, 314 + "Invalid drive strength for pin %d\n", 315 + pin); 316 + return -EINVAL; 317 + } 318 + break; 319 + default: 320 + ret = -EOPNOTSUPP; 321 + break; 322 + } 323 + 324 + if (ret) 325 + return ret; 326 + 327 + param = pinconf_to_config_param(*config); 328 + *config = pinconf_to_config_packed(param, arg); 329 + 330 + return 0; 331 + } 332 + 333 + /** 334 + * zynqmp_pinconf_cfg_set() - Set requested config for the pin 335 + * @pctldev: Pincontrol device pointer. 336 + * @pin: Pin number. 337 + * @configs: Configuration to set. 338 + * @num_configs: Number of configurations. 339 + * 340 + * Loop through all configurations and call firmware API 341 + * to set requested configurations for the pin. 342 + * 343 + * Return: 0 on success else error code. 344 + */ 345 + static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev, 346 + unsigned int pin, unsigned long *configs, 347 + unsigned int num_configs) 348 + { 349 + int i, ret; 350 + 351 + if (pin >= zynqmp_desc.npins) 352 + return -EOPNOTSUPP; 353 + 354 + for (i = 0; i < num_configs; i++) { 355 + unsigned int param = pinconf_to_config_param(configs[i]); 356 + unsigned int arg = pinconf_to_config_argument(configs[i]); 357 + unsigned int value; 358 + 359 + switch (param) { 360 + case PIN_CONFIG_SLEW_RATE: 361 + param = PM_PINCTRL_CONFIG_SLEW_RATE; 362 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 363 + break; 364 + case PIN_CONFIG_BIAS_PULL_UP: 365 + param = PM_PINCTRL_CONFIG_PULL_CTRL; 366 + arg = PM_PINCTRL_BIAS_PULL_UP; 367 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 368 + break; 369 + case PIN_CONFIG_BIAS_PULL_DOWN: 370 + param = PM_PINCTRL_CONFIG_PULL_CTRL; 371 + arg = PM_PINCTRL_BIAS_PULL_DOWN; 372 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 373 + break; 374 + case PIN_CONFIG_BIAS_DISABLE: 375 + param = PM_PINCTRL_CONFIG_BIAS_STATUS; 376 + arg = PM_PINCTRL_BIAS_DISABLE; 377 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 378 + break; 379 + case PIN_CONFIG_INPUT_SCHMITT_ENABLE: 380 + param = PM_PINCTRL_CONFIG_SCHMITT_CMOS; 381 + ret = zynqmp_pm_pinctrl_set_config(pin, param, arg); 382 + break; 383 + case PIN_CONFIG_DRIVE_STRENGTH: 384 + switch (arg) { 385 + case DRIVE_STRENGTH_2MA: 386 + value = PM_PINCTRL_DRIVE_STRENGTH_2MA; 387 + break; 388 + case DRIVE_STRENGTH_4MA: 389 + value = PM_PINCTRL_DRIVE_STRENGTH_4MA; 390 + break; 391 + case DRIVE_STRENGTH_8MA: 392 + value = PM_PINCTRL_DRIVE_STRENGTH_8MA; 393 + break; 394 + case DRIVE_STRENGTH_12MA: 395 + value = PM_PINCTRL_DRIVE_STRENGTH_12MA; 396 + break; 397 + default: 398 + /* Invalid drive strength */ 399 + dev_warn(pctldev->dev, 400 + "Invalid drive strength for pin %d\n", 401 + pin); 402 + return -EINVAL; 403 + } 404 + 405 + param = PM_PINCTRL_CONFIG_DRIVE_STRENGTH; 406 + ret = zynqmp_pm_pinctrl_set_config(pin, param, value); 407 + break; 408 + case PIN_CONFIG_POWER_SOURCE: 409 + param = PM_PINCTRL_CONFIG_VOLTAGE_STATUS; 410 + ret = zynqmp_pm_pinctrl_get_config(pin, param, &value); 411 + 412 + if (arg != value) 413 + dev_warn(pctldev->dev, 414 + "Invalid IO Standard requested for pin %d\n", 415 + pin); 416 + 417 + break; 418 + case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: 419 + case PIN_CONFIG_MODE_LOW_POWER: 420 + /* 421 + * These cases are mentioned in dts but configurable 422 + * registers are unknown. So falling through to ignore 423 + * boot time warnings as of now. 424 + */ 425 + ret = 0; 426 + break; 427 + default: 428 + dev_warn(pctldev->dev, 429 + "unsupported configuration parameter '%u'\n", 430 + param); 431 + ret = -EOPNOTSUPP; 432 + break; 433 + } 434 + 435 + param = pinconf_to_config_param(configs[i]); 436 + arg = pinconf_to_config_argument(configs[i]); 437 + if (ret) 438 + dev_warn(pctldev->dev, 439 + "failed to set: pin %u param %u value %u\n", 440 + pin, param, arg); 441 + } 442 + 443 + return 0; 444 + } 445 + 446 + /** 447 + * zynqmp_pinconf_group_set() - Set requested config for the group 448 + * @pctldev: Pincontrol device pointer. 449 + * @selector: Group ID. 450 + * @configs: Configuration to set. 451 + * @num_configs: Number of configurations. 452 + * 453 + * Call function to set configs for each pin in the group. 454 + * 455 + * Return: 0 on success else error code. 456 + */ 457 + static int zynqmp_pinconf_group_set(struct pinctrl_dev *pctldev, 458 + unsigned int selector, 459 + unsigned long *configs, 460 + unsigned int num_configs) 461 + { 462 + int i, ret; 463 + struct zynqmp_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); 464 + const struct zynqmp_pctrl_group *pgrp = &pctrl->groups[selector]; 465 + 466 + for (i = 0; i < pgrp->npins; i++) { 467 + ret = zynqmp_pinconf_cfg_set(pctldev, pgrp->pins[i], configs, 468 + num_configs); 469 + if (ret) 470 + return ret; 471 + } 472 + 473 + return 0; 474 + } 475 + 476 + static const struct pinconf_ops zynqmp_pinconf_ops = { 477 + .is_generic = true, 478 + .pin_config_get = zynqmp_pinconf_cfg_get, 479 + .pin_config_set = zynqmp_pinconf_cfg_set, 480 + .pin_config_group_set = zynqmp_pinconf_group_set, 481 + }; 482 + 483 + static struct pinctrl_desc zynqmp_desc = { 484 + .name = "zynqmp_pinctrl", 485 + .owner = THIS_MODULE, 486 + .pctlops = &zynqmp_pctrl_ops, 487 + .pmxops = &zynqmp_pinmux_ops, 488 + .confops = &zynqmp_pinconf_ops, 489 + }; 490 + 491 + static int zynqmp_pinctrl_get_function_groups(u32 fid, u32 index, u16 *groups) 492 + { 493 + struct zynqmp_pm_query_data qdata = {0}; 494 + u32 payload[PAYLOAD_ARG_CNT]; 495 + int ret; 496 + 497 + qdata.qid = PM_QID_PINCTRL_GET_FUNCTION_GROUPS; 498 + qdata.arg1 = fid; 499 + qdata.arg2 = index; 500 + 501 + ret = zynqmp_pm_query_data(qdata, payload); 502 + if (ret) 503 + return ret; 504 + 505 + memcpy(groups, &payload[1], PINCTRL_GET_FUNC_GROUPS_RESP_LEN); 506 + 507 + return ret; 508 + } 509 + 510 + static int zynqmp_pinctrl_get_func_num_groups(u32 fid, unsigned int *ngroups) 511 + { 512 + struct zynqmp_pm_query_data qdata = {0}; 513 + u32 payload[PAYLOAD_ARG_CNT]; 514 + int ret; 515 + 516 + qdata.qid = PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS; 517 + qdata.arg1 = fid; 518 + 519 + ret = zynqmp_pm_query_data(qdata, payload); 520 + if (ret) 521 + return ret; 522 + 523 + *ngroups = payload[1]; 524 + 525 + return ret; 526 + } 527 + 528 + /** 529 + * zynqmp_pinctrl_prepare_func_groups() - prepare function and groups data 530 + * @dev: Device pointer. 531 + * @fid: Function ID. 532 + * @func: Function data. 533 + * @groups: Groups data. 534 + * 535 + * Query firmware to get group IDs for each function. Firmware returns 536 + * group IDs. Based on group index for the function, group names in 537 + * the function are stored. For example, the first group in "eth0" function 538 + * is named as "eth0_0" and second group as "eth0_1" and so on. 539 + * 540 + * Based on the group ID received from the firmware, function stores name of 541 + * the group for that group ID. For example, if "eth0" first group ID 542 + * is x, groups[x] name will be stored as "eth0_0". 543 + * 544 + * Once done for each function, each function would have its group names 545 + * and each groups would also have their names. 546 + * 547 + * Return: 0 on success else error code. 548 + */ 549 + static int zynqmp_pinctrl_prepare_func_groups(struct device *dev, u32 fid, 550 + struct zynqmp_pmux_function *func, 551 + struct zynqmp_pctrl_group *groups) 552 + { 553 + u16 resp[NUM_GROUPS_PER_RESP] = {0}; 554 + const char **fgroups; 555 + int ret = 0, index, i; 556 + 557 + fgroups = devm_kzalloc(dev, sizeof(*fgroups) * func->ngroups, GFP_KERNEL); 558 + if (!fgroups) 559 + return -ENOMEM; 560 + 561 + for (index = 0; index < func->ngroups; index += NUM_GROUPS_PER_RESP) { 562 + ret = zynqmp_pinctrl_get_function_groups(fid, index, resp); 563 + if (ret) 564 + return ret; 565 + 566 + for (i = 0; i < NUM_GROUPS_PER_RESP; i++) { 567 + if (resp[i] == NA_GROUP) 568 + goto done; 569 + 570 + if (resp[i] == RESERVED_GROUP) 571 + continue; 572 + 573 + fgroups[index + i] = devm_kasprintf(dev, GFP_KERNEL, 574 + "%s_%d_grp", 575 + func->name, 576 + index + i); 577 + if (!fgroups[index + i]) 578 + return -ENOMEM; 579 + 580 + groups[resp[i]].name = devm_kasprintf(dev, GFP_KERNEL, 581 + "%s_%d_grp", 582 + func->name, 583 + index + i); 584 + if (!groups[resp[i]].name) 585 + return -ENOMEM; 586 + } 587 + } 588 + done: 589 + func->groups = fgroups; 590 + 591 + return ret; 592 + } 593 + 594 + static void zynqmp_pinctrl_get_function_name(u32 fid, char *name) 595 + { 596 + struct zynqmp_pm_query_data qdata = {0}; 597 + u32 payload[PAYLOAD_ARG_CNT]; 598 + 599 + qdata.qid = PM_QID_PINCTRL_GET_FUNCTION_NAME; 600 + qdata.arg1 = fid; 601 + 602 + /* 603 + * Name of the function is maximum 16 bytes and cannot 604 + * accommodate the return value in SMC buffers, hence ignoring 605 + * the return value for this specific qid. 606 + */ 607 + zynqmp_pm_query_data(qdata, payload); 608 + memcpy(name, payload, PINCTRL_GET_FUNC_NAME_RESP_LEN); 609 + } 610 + 611 + static int zynqmp_pinctrl_get_num_functions(unsigned int *nfuncs) 612 + { 613 + struct zynqmp_pm_query_data qdata = {0}; 614 + u32 payload[PAYLOAD_ARG_CNT]; 615 + int ret; 616 + 617 + qdata.qid = PM_QID_PINCTRL_GET_NUM_FUNCTIONS; 618 + 619 + ret = zynqmp_pm_query_data(qdata, payload); 620 + if (ret) 621 + return ret; 622 + 623 + *nfuncs = payload[1]; 624 + 625 + return ret; 626 + } 627 + 628 + static int zynqmp_pinctrl_get_pin_groups(u32 pin, u32 index, u16 *groups) 629 + { 630 + struct zynqmp_pm_query_data qdata = {0}; 631 + u32 payload[PAYLOAD_ARG_CNT]; 632 + int ret; 633 + 634 + qdata.qid = PM_QID_PINCTRL_GET_PIN_GROUPS; 635 + qdata.arg1 = pin; 636 + qdata.arg2 = index; 637 + 638 + ret = zynqmp_pm_query_data(qdata, payload); 639 + if (ret) 640 + return ret; 641 + 642 + memcpy(groups, &payload[1], PINCTRL_GET_PIN_GROUPS_RESP_LEN); 643 + 644 + return ret; 645 + } 646 + 647 + static void zynqmp_pinctrl_group_add_pin(struct zynqmp_pctrl_group *group, 648 + unsigned int pin) 649 + { 650 + group->pins[group->npins++] = pin; 651 + } 652 + 653 + /** 654 + * zynqmp_pinctrl_create_pin_groups() - assign pins to respective groups 655 + * @dev: Device pointer. 656 + * @groups: Groups data. 657 + * @pin: Pin number. 658 + * 659 + * Query firmware to get groups available for the given pin. 660 + * Based on the firmware response(group IDs for the pin), add 661 + * pin number to the respective group's pin array. 662 + * 663 + * Once all pins are queries, each groups would have its number 664 + * of pins and pin numbers data. 665 + * 666 + * Return: 0 on success else error code. 667 + */ 668 + static int zynqmp_pinctrl_create_pin_groups(struct device *dev, 669 + struct zynqmp_pctrl_group *groups, 670 + unsigned int pin) 671 + { 672 + u16 resp[NUM_GROUPS_PER_RESP] = {0}; 673 + int ret, i, index = 0; 674 + 675 + do { 676 + ret = zynqmp_pinctrl_get_pin_groups(pin, index, resp); 677 + if (ret) 678 + return ret; 679 + 680 + for (i = 0; i < NUM_GROUPS_PER_RESP; i++) { 681 + if (resp[i] == NA_GROUP) 682 + return ret; 683 + 684 + if (resp[i] == RESERVED_GROUP) 685 + continue; 686 + 687 + zynqmp_pinctrl_group_add_pin(&groups[resp[i]], pin); 688 + } 689 + index += NUM_GROUPS_PER_RESP; 690 + } while (index <= MAX_PIN_GROUPS); 691 + 692 + return ret; 693 + } 694 + 695 + /** 696 + * zynqmp_pinctrl_prepare_group_pins() - prepare each group's pin data 697 + * @dev: Device pointer. 698 + * @groups: Groups data. 699 + * @ngroups: Number of groups. 700 + * 701 + * Prepare pin number and number of pins data for each pins. 702 + * 703 + * Return: 0 on success else error code. 704 + */ 705 + static int zynqmp_pinctrl_prepare_group_pins(struct device *dev, 706 + struct zynqmp_pctrl_group *groups, 707 + unsigned int ngroups) 708 + { 709 + unsigned int pin; 710 + int ret; 711 + 712 + for (pin = 0; pin < zynqmp_desc.npins; pin++) { 713 + ret = zynqmp_pinctrl_create_pin_groups(dev, groups, pin); 714 + if (ret) 715 + return ret; 716 + } 717 + 718 + return 0; 719 + } 720 + 721 + /** 722 + * zynqmp_pinctrl_prepare_function_info() - prepare function info 723 + * @dev: Device pointer. 724 + * @pctrl: Pin control driver data. 725 + * 726 + * Query firmware for functions, groups and pin information and 727 + * prepare pin control driver data. 728 + * 729 + * Query number of functions and number of function groups (number 730 + * of groups in given function) to allocate required memory buffers 731 + * for functions and groups. Once buffers are allocated to store 732 + * functions and groups data, query and store required information 733 + * (number of groups and group names for each function, number of 734 + * pins and pin numbers for each group). 735 + * 736 + * Return: 0 on success else error code. 737 + */ 738 + static int zynqmp_pinctrl_prepare_function_info(struct device *dev, 739 + struct zynqmp_pinctrl *pctrl) 740 + { 741 + struct zynqmp_pmux_function *funcs; 742 + struct zynqmp_pctrl_group *groups; 743 + int ret, i; 744 + 745 + ret = zynqmp_pinctrl_get_num_functions(&pctrl->nfuncs); 746 + if (ret) 747 + return ret; 748 + 749 + funcs = devm_kzalloc(dev, sizeof(*funcs) * pctrl->nfuncs, GFP_KERNEL); 750 + if (!funcs) 751 + return -ENOMEM; 752 + 753 + for (i = 0; i < pctrl->nfuncs; i++) { 754 + zynqmp_pinctrl_get_function_name(i, funcs[i].name); 755 + 756 + ret = zynqmp_pinctrl_get_func_num_groups(i, &funcs[i].ngroups); 757 + if (ret) 758 + return ret; 759 + 760 + pctrl->ngroups += funcs[i].ngroups; 761 + } 762 + 763 + groups = devm_kzalloc(dev, sizeof(*groups) * pctrl->ngroups, GFP_KERNEL); 764 + if (!groups) 765 + return -ENOMEM; 766 + 767 + for (i = 0; i < pctrl->nfuncs; i++) { 768 + ret = zynqmp_pinctrl_prepare_func_groups(dev, i, &funcs[i], 769 + groups); 770 + if (ret) 771 + return ret; 772 + } 773 + 774 + ret = zynqmp_pinctrl_prepare_group_pins(dev, groups, pctrl->ngroups); 775 + if (ret) 776 + return ret; 777 + 778 + pctrl->funcs = funcs; 779 + pctrl->groups = groups; 780 + 781 + return ret; 782 + } 783 + 784 + static int zynqmp_pinctrl_get_num_pins(unsigned int *npins) 785 + { 786 + struct zynqmp_pm_query_data qdata = {0}; 787 + u32 payload[PAYLOAD_ARG_CNT]; 788 + int ret; 789 + 790 + qdata.qid = PM_QID_PINCTRL_GET_NUM_PINS; 791 + 792 + ret = zynqmp_pm_query_data(qdata, payload); 793 + if (ret) 794 + return ret; 795 + 796 + *npins = payload[1]; 797 + 798 + return ret; 799 + } 800 + 801 + /** 802 + * zynqmp_pinctrl_prepare_pin_desc() - prepare pin description info 803 + * @dev: Device pointer. 804 + * @zynqmp_pins: Pin information. 805 + * @npins: Number of pins. 806 + * 807 + * Query number of pins information from firmware and prepare pin 808 + * description containing pin number and pin name. 809 + * 810 + * Return: 0 on success else error code. 811 + */ 812 + static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev, 813 + const struct pinctrl_pin_desc 814 + **zynqmp_pins, 815 + unsigned int *npins) 816 + { 817 + struct pinctrl_pin_desc *pins, *pin; 818 + int ret; 819 + int i; 820 + 821 + ret = zynqmp_pinctrl_get_num_pins(npins); 822 + if (ret) 823 + return ret; 824 + 825 + pins = devm_kzalloc(dev, sizeof(*pins) * *npins, GFP_KERNEL); 826 + if (!pins) 827 + return -ENOMEM; 828 + 829 + for (i = 0; i < *npins; i++) { 830 + pin = &pins[i]; 831 + pin->number = i; 832 + pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", 833 + ZYNQMP_PIN_PREFIX, i); 834 + if (!pin->name) 835 + return -ENOMEM; 836 + } 837 + 838 + *zynqmp_pins = pins; 839 + 840 + return 0; 841 + } 842 + 843 + static int zynqmp_pinctrl_probe(struct platform_device *pdev) 844 + { 845 + struct zynqmp_pinctrl *pctrl; 846 + int ret; 847 + 848 + pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); 849 + if (!pctrl) 850 + return -ENOMEM; 851 + 852 + ret = zynqmp_pinctrl_prepare_pin_desc(&pdev->dev, 853 + &zynqmp_desc.pins, 854 + &zynqmp_desc.npins); 855 + if (ret) { 856 + dev_err(&pdev->dev, "pin desc prepare fail with %d\n", 857 + ret); 858 + return ret; 859 + } 860 + 861 + ret = zynqmp_pinctrl_prepare_function_info(&pdev->dev, pctrl); 862 + if (ret) { 863 + dev_err(&pdev->dev, "function info prepare fail with %d\n", 864 + ret); 865 + return ret; 866 + } 867 + 868 + pctrl->pctrl = pinctrl_register(&zynqmp_desc, &pdev->dev, pctrl); 869 + if (IS_ERR(pctrl->pctrl)) 870 + return PTR_ERR(pctrl->pctrl); 871 + 872 + platform_set_drvdata(pdev, pctrl); 873 + 874 + return ret; 875 + } 876 + 877 + static int zynqmp_pinctrl_remove(struct platform_device *pdev) 878 + { 879 + struct zynqmp_pinctrl *pctrl = platform_get_drvdata(pdev); 880 + 881 + pinctrl_unregister(pctrl->pctrl); 882 + 883 + return 0; 884 + } 885 + 886 + static const struct of_device_id zynqmp_pinctrl_of_match[] = { 887 + { .compatible = "xlnx,zynqmp-pinctrl" }, 888 + { } 889 + }; 890 + 891 + MODULE_DEVICE_TABLE(of, zynqmp_pinctrl_of_match); 892 + 893 + static struct platform_driver zynqmp_pinctrl_driver = { 894 + .driver = { 895 + .name = "zynqmp-pinctrl", 896 + .of_match_table = zynqmp_pinctrl_of_match, 897 + }, 898 + .probe = zynqmp_pinctrl_probe, 899 + .remove = zynqmp_pinctrl_remove, 900 + }; 901 + 902 + module_platform_driver(zynqmp_pinctrl_driver); 903 + 904 + MODULE_AUTHOR("Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>"); 905 + MODULE_DESCRIPTION("ZynqMP Pin Controller Driver"); 906 + MODULE_LICENSE("GPL v2");
+104 -2
drivers/pinctrl/pinmux.c
··· 12 12 */ 13 13 #define pr_fmt(fmt) "pinmux core: " fmt 14 14 15 + #include <linux/ctype.h> 15 16 #include <linux/kernel.h> 16 17 #include <linux/module.h> 17 18 #include <linux/init.h> ··· 674 673 DEFINE_SHOW_ATTRIBUTE(pinmux_functions); 675 674 DEFINE_SHOW_ATTRIBUTE(pinmux_pins); 676 675 676 + #define PINMUX_SELECT_MAX 128 677 + static ssize_t pinmux_select(struct file *file, const char __user *user_buf, 678 + size_t len, loff_t *ppos) 679 + { 680 + struct seq_file *sfile = file->private_data; 681 + struct pinctrl_dev *pctldev = sfile->private; 682 + const struct pinmux_ops *pmxops = pctldev->desc->pmxops; 683 + const char *const *groups; 684 + char *buf, *gname, *fname; 685 + unsigned int num_groups; 686 + int fsel, gsel, ret; 687 + 688 + if (len > PINMUX_SELECT_MAX) 689 + return -ENOMEM; 690 + 691 + buf = kzalloc(PINMUX_SELECT_MAX, GFP_KERNEL); 692 + if (!buf) 693 + return -ENOMEM; 694 + 695 + ret = strncpy_from_user(buf, user_buf, PINMUX_SELECT_MAX); 696 + if (ret < 0) 697 + goto exit_free_buf; 698 + buf[len-1] = '\0'; 699 + 700 + /* remove leading and trailing spaces of input buffer */ 701 + gname = strstrip(buf); 702 + if (*gname == '\0') { 703 + ret = -EINVAL; 704 + goto exit_free_buf; 705 + } 706 + 707 + /* find a separator which is a spacelike character */ 708 + for (fname = gname; !isspace(*fname); fname++) { 709 + if (*fname == '\0') { 710 + ret = -EINVAL; 711 + goto exit_free_buf; 712 + } 713 + } 714 + *fname = '\0'; 715 + 716 + /* drop extra spaces between function and group names */ 717 + fname = skip_spaces(fname + 1); 718 + if (*fname == '\0') { 719 + ret = -EINVAL; 720 + goto exit_free_buf; 721 + } 722 + 723 + ret = pinmux_func_name_to_selector(pctldev, fname); 724 + if (ret < 0) { 725 + dev_err(pctldev->dev, "invalid function %s in map table\n", fname); 726 + goto exit_free_buf; 727 + } 728 + fsel = ret; 729 + 730 + ret = pmxops->get_function_groups(pctldev, fsel, &groups, &num_groups); 731 + if (ret) { 732 + dev_err(pctldev->dev, "no groups for function %d (%s)", fsel, fname); 733 + goto exit_free_buf; 734 + } 735 + 736 + ret = match_string(groups, num_groups, gname); 737 + if (ret < 0) { 738 + dev_err(pctldev->dev, "invalid group %s", gname); 739 + goto exit_free_buf; 740 + } 741 + 742 + ret = pinctrl_get_group_selector(pctldev, gname); 743 + if (ret < 0) { 744 + dev_err(pctldev->dev, "failed to get group selector for %s", gname); 745 + goto exit_free_buf; 746 + } 747 + gsel = ret; 748 + 749 + ret = pmxops->set_mux(pctldev, fsel, gsel); 750 + if (ret) { 751 + dev_err(pctldev->dev, "set_mux() failed: %d", ret); 752 + goto exit_free_buf; 753 + } 754 + ret = len; 755 + 756 + exit_free_buf: 757 + kfree(buf); 758 + 759 + return ret; 760 + } 761 + 762 + static int pinmux_select_open(struct inode *inode, struct file *file) 763 + { 764 + return single_open(file, NULL, inode->i_private); 765 + } 766 + 767 + static const struct file_operations pinmux_select_ops = { 768 + .owner = THIS_MODULE, 769 + .open = pinmux_select_open, 770 + .write = pinmux_select, 771 + .llseek = no_llseek, 772 + .release = single_release, 773 + }; 774 + 677 775 void pinmux_init_device_debugfs(struct dentry *devroot, 678 776 struct pinctrl_dev *pctldev) 679 777 { 680 - debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO, 778 + debugfs_create_file("pinmux-functions", 0444, 681 779 devroot, pctldev, &pinmux_functions_fops); 682 - debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO, 780 + debugfs_create_file("pinmux-pins", 0444, 683 781 devroot, pctldev, &pinmux_pins_fops); 782 + debugfs_create_file("pinmux-select", 0200, 783 + devroot, pctldev, &pinmux_select_ops); 684 784 } 685 785 686 786 #endif /* CONFIG_DEBUG_FS */
+2 -2
drivers/pinctrl/pxa/pinctrl-pxa2xx.c
··· 194 194 195 195 spin_lock_irqsave(&pctl->lock, flags); 196 196 val = readl_relaxed(pgsr) & BIT(pin % 32); 197 - *config = val ? PIN_CONFIG_LOW_POWER_MODE : 0; 197 + *config = val ? PIN_CONFIG_MODE_LOW_POWER : 0; 198 198 spin_unlock_irqrestore(&pctl->lock, flags); 199 199 200 200 dev_dbg(pctl->dev, "get sleep gpio state(pin=%d) %d\n", ··· 217 217 218 218 for (i = 0; i < num_configs; i++) { 219 219 switch (pinconf_to_config_param(configs[i])) { 220 - case PIN_CONFIG_LOW_POWER_MODE: 220 + case PIN_CONFIG_MODE_LOW_POWER: 221 221 is_set = pinconf_to_config_argument(configs[i]); 222 222 break; 223 223 default:
+2 -2
drivers/pinctrl/qcom/Kconfig
··· 3 3 4 4 config PINCTRL_MSM 5 5 tristate "Qualcomm core pin controller driver" 6 - depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y 6 + depends on GPIOLIB && (QCOM_SCM || !QCOM_SCM) #if QCOM_SCM=m this can't be =y 7 7 select PINMUX 8 8 select PINCONF 9 9 select GENERIC_PINCONF ··· 222 222 223 223 config PINCTRL_SC8180X 224 224 tristate "Qualcomm Technologies Inc SC8180x pin controller driver" 225 - depends on GPIOLIB && OF 225 + depends on GPIOLIB && (OF || ACPI) 226 226 select PINCTRL_MSM 227 227 help 228 228 This is the pinctrl, pinmux, pinconf and gpiolib driver for the
+24
drivers/pinctrl/qcom/pinctrl-sc7280.c
··· 1449 1449 [182] = SDC_QDSD_PINGROUP(sdc2_data, 0xb4000, 9, 0), 1450 1450 }; 1451 1451 1452 + static const struct msm_gpio_wakeirq_map sc7280_pdc_map[] = { 1453 + { 0, 134 }, { 3, 131 }, { 4, 121 }, { 7, 103 }, { 8, 155 }, 1454 + { 11, 93 }, { 12, 78 }, { 15, 79 }, { 16, 80 }, { 18, 81 }, 1455 + { 19, 107 }, { 20, 82 }, { 21, 83 }, { 23, 99 }, { 24, 86 }, 1456 + { 25, 95 }, { 27, 158 }, { 28, 159 }, { 31, 90 }, { 32, 144 }, 1457 + { 34, 77 }, { 35, 92 }, { 36, 157 }, { 39, 73 }, { 40, 97 }, 1458 + { 41, 98 }, { 43, 85 }, { 44, 100 }, { 45, 101 }, { 47, 102 }, 1459 + { 48, 74 }, { 51, 112 }, { 52, 156 }, { 54, 117 }, { 55, 84 }, 1460 + { 56, 108 }, { 59, 110 }, { 60, 111 }, { 61, 123 }, { 63, 104 }, 1461 + { 68, 127 }, { 72, 150 }, { 75, 133 }, { 77, 125 }, { 78, 105 }, 1462 + { 79, 106 }, { 80, 118 }, { 81, 119 }, { 82, 162 }, { 83, 122 }, 1463 + { 86, 75 }, { 88, 154 }, { 89, 124 }, { 90, 149 }, { 91, 76 }, 1464 + { 93, 128 }, { 95, 160 }, { 101, 126 }, { 102, 96 }, { 103, 116 }, 1465 + { 104, 114 }, { 112, 72 }, { 116, 135 }, { 117, 163 }, { 119, 137 }, 1466 + { 121, 138 }, { 123, 139 }, { 125, 140 }, { 127, 141 }, { 128, 165 }, 1467 + { 129, 143 }, { 130, 94 }, { 131, 145 }, { 133, 146 }, { 136, 147 }, 1468 + { 140, 148 }, { 141, 115 }, { 142, 113 }, { 145, 130 }, { 148, 132 }, 1469 + { 150, 87 }, { 151, 88 }, { 153, 89 }, { 155, 164 }, { 156, 129 }, 1470 + { 157, 161 }, { 158, 120 }, { 161, 136 }, { 163, 142 }, { 172, 166 }, 1471 + { 174, 167 }, 1472 + }; 1473 + 1452 1474 static const struct msm_pinctrl_soc_data sc7280_pinctrl = { 1453 1475 .pins = sc7280_pins, 1454 1476 .npins = ARRAY_SIZE(sc7280_pins), ··· 1479 1457 .groups = sc7280_groups, 1480 1458 .ngroups = ARRAY_SIZE(sc7280_groups), 1481 1459 .ngpios = 176, 1460 + .wakeirq_map = sc7280_pdc_map, 1461 + .nwakeirq_map = ARRAY_SIZE(sc7280_pdc_map), 1482 1462 }; 1483 1463 1484 1464 static int sc7280_pinctrl_probe(struct platform_device *pdev)
+122 -3
drivers/pinctrl/qcom/pinctrl-sc8180x.c
··· 23 23 WEST 24 24 }; 25 25 26 + /* 27 + * ACPI DSDT has one single memory resource for TLMM. The offsets below are 28 + * used to locate different tiles for ACPI probe. 29 + */ 30 + struct tile_info { 31 + u32 offset; 32 + u32 size; 33 + }; 34 + 35 + static const struct tile_info sc8180x_tile_info[] = { 36 + { 0x00d00000, 0x00300000, }, 37 + { 0x00500000, 0x00700000, }, 38 + { 0x00100000, 0x00300000, }, 39 + }; 40 + 26 41 #define FUNCTION(fname) \ 27 42 [msm_mux_##fname] = { \ 28 43 .name = #fname, \ ··· 1572 1557 [193] = SDC_QDSD_PINGROUP(sdc2_data, 0x4b2000, 9, 0), 1573 1558 }; 1574 1559 1560 + static const int sc8180x_acpi_reserved_gpios[] = { 1561 + 0, 1, 2, 3, 1562 + 47, 48, 49, 50, 1563 + 126, 127, 128, 129, 1564 + -1 /* terminator */ 1565 + }; 1566 + 1575 1567 static const struct msm_gpio_wakeirq_map sc8180x_pdc_map[] = { 1576 1568 { 3, 31 }, { 5, 32 }, { 8, 33 }, { 9, 34 }, { 10, 100 }, { 12, 104 }, 1577 1569 { 24, 37 }, { 26, 38 }, { 27, 41 }, { 28, 42 }, { 30, 39 }, { 36, 43 }, ··· 1610 1588 .nwakeirq_map = ARRAY_SIZE(sc8180x_pdc_map), 1611 1589 }; 1612 1590 1613 - static int sc8180x_pinctrl_probe(struct platform_device *pdev) 1591 + static const struct msm_pinctrl_soc_data sc8180x_acpi_pinctrl = { 1592 + .tiles = sc8180x_tiles, 1593 + .ntiles = ARRAY_SIZE(sc8180x_tiles), 1594 + .pins = sc8180x_pins, 1595 + .npins = ARRAY_SIZE(sc8180x_pins), 1596 + .groups = sc8180x_groups, 1597 + .ngroups = ARRAY_SIZE(sc8180x_groups), 1598 + .reserved_gpios = sc8180x_acpi_reserved_gpios, 1599 + .ngpios = 190, 1600 + }; 1601 + 1602 + /* 1603 + * ACPI DSDT has one single memory resource for TLMM, which voilates the 1604 + * hardware layout of 3 sepearte tiles. Let's split the memory resource into 1605 + * 3 named ones, so that msm_pinctrl_probe() can map memory for ACPI in the 1606 + * same way as for DT probe. 1607 + */ 1608 + static int sc8180x_pinctrl_add_tile_resources(struct platform_device *pdev) 1614 1609 { 1615 - return msm_pinctrl_probe(pdev, &sc8180x_pinctrl); 1610 + int nres_num = pdev->num_resources + ARRAY_SIZE(sc8180x_tiles) - 1; 1611 + struct resource *mres, *nres, *res; 1612 + int i, ret; 1613 + 1614 + /* 1615 + * DT already has tiles defined properly, so nothing needs to be done 1616 + * for DT probe. 1617 + */ 1618 + if (pdev->dev.of_node) 1619 + return 0; 1620 + 1621 + /* Allocate for new resources */ 1622 + nres = devm_kzalloc(&pdev->dev, sizeof(*nres) * nres_num, GFP_KERNEL); 1623 + if (!nres) 1624 + return -ENOMEM; 1625 + 1626 + res = nres; 1627 + 1628 + for (i = 0; i < pdev->num_resources; i++) { 1629 + struct resource *r = &pdev->resource[i]; 1630 + 1631 + /* Save memory resource and copy others */ 1632 + if (resource_type(r) == IORESOURCE_MEM) 1633 + mres = r; 1634 + else 1635 + *res++ = *r; 1636 + } 1637 + 1638 + /* Append tile memory resources */ 1639 + for (i = 0; i < ARRAY_SIZE(sc8180x_tiles); i++, res++) { 1640 + const struct tile_info *info = &sc8180x_tile_info[i]; 1641 + 1642 + res->start = mres->start + info->offset; 1643 + res->end = mres->start + info->offset + info->size - 1; 1644 + res->flags = mres->flags; 1645 + res->name = sc8180x_tiles[i]; 1646 + 1647 + /* Add new MEM to resource tree */ 1648 + insert_resource(mres->parent, res); 1649 + } 1650 + 1651 + /* Remove old MEM from resource tree */ 1652 + remove_resource(mres); 1653 + 1654 + /* Free old resources and install new ones */ 1655 + ret = platform_device_add_resources(pdev, nres, nres_num); 1656 + if (ret) { 1657 + dev_err(&pdev->dev, "failed to add new resources: %d\n", ret); 1658 + return ret; 1659 + } 1660 + 1661 + return 0; 1616 1662 } 1617 1663 1664 + static int sc8180x_pinctrl_probe(struct platform_device *pdev) 1665 + { 1666 + const struct msm_pinctrl_soc_data *soc_data; 1667 + int ret; 1668 + 1669 + soc_data = device_get_match_data(&pdev->dev); 1670 + if (!soc_data) 1671 + return -EINVAL; 1672 + 1673 + ret = sc8180x_pinctrl_add_tile_resources(pdev); 1674 + if (ret) 1675 + return ret; 1676 + 1677 + return msm_pinctrl_probe(pdev, soc_data); 1678 + } 1679 + 1680 + static const struct acpi_device_id sc8180x_pinctrl_acpi_match[] = { 1681 + { 1682 + .id = "QCOM040D", 1683 + .driver_data = (kernel_ulong_t) &sc8180x_acpi_pinctrl, 1684 + }, 1685 + { } 1686 + }; 1687 + MODULE_DEVICE_TABLE(acpi, sc8180x_pinctrl_acpi_match); 1688 + 1618 1689 static const struct of_device_id sc8180x_pinctrl_of_match[] = { 1619 - { .compatible = "qcom,sc8180x-tlmm", }, 1690 + { 1691 + .compatible = "qcom,sc8180x-tlmm", 1692 + .data = &sc8180x_pinctrl, 1693 + }, 1620 1694 { }, 1621 1695 }; 1622 1696 MODULE_DEVICE_TABLE(of, sc8180x_pinctrl_of_match); ··· 1721 1603 .driver = { 1722 1604 .name = "sc8180x-pinctrl", 1723 1605 .of_match_table = sc8180x_pinctrl_of_match, 1606 + .acpi_match_table = sc8180x_pinctrl_acpi_match, 1724 1607 }, 1725 1608 .probe = sc8180x_pinctrl_probe, 1726 1609 .remove = msm_pinctrl_remove,
+21
drivers/pinctrl/qcom/pinctrl-sm8350.c
··· 1603 1603 [206] = SDC_PINGROUP(sdc2_data, 0x1cf000, 9, 0), 1604 1604 }; 1605 1605 1606 + static const struct msm_gpio_wakeirq_map sm8350_pdc_map[] = { 1607 + { 2, 117 }, { 7, 82 }, { 11, 83 }, { 14, 80 }, { 15, 146 }, 1608 + { 19, 121 }, { 23, 84 }, { 26, 86 }, { 27, 75 }, { 31, 85 }, 1609 + { 32, 97 }, { 34, 98 }, { 35, 131 }, { 36, 79 }, { 38, 99 }, 1610 + { 39, 92 }, { 40, 101 }, { 43, 137 }, { 44, 102 }, { 46, 96 }, 1611 + { 47, 93 }, { 50, 108 }, { 51, 127 }, { 55, 128 }, { 56, 81 }, 1612 + { 59, 112 }, { 60, 119 }, { 63, 73 }, { 67, 74 }, { 71, 134 }, 1613 + { 75, 103 }, { 79, 104 }, { 80, 126 }, { 81, 139 }, { 82, 140 }, 1614 + { 83, 141 }, { 84, 124 }, { 85, 109 }, { 86, 143 }, { 87, 138 }, 1615 + { 88, 122 }, { 89, 113 }, { 90, 114 }, { 91, 115 }, { 92, 76 }, 1616 + { 95, 147 }, { 96, 148 }, { 98, 149 }, { 99, 150 }, { 115, 125 }, 1617 + { 116, 106 }, { 117, 105 }, { 118, 116 }, { 119, 123 }, { 130, 145 }, 1618 + { 136, 72 }, { 140, 100 }, { 151, 110 }, { 153, 95 }, { 155, 107 }, 1619 + { 156, 94 }, { 157, 111 }, { 159, 118 }, { 162, 77 }, { 165, 78 }, 1620 + { 169, 70 }, { 172, 132 }, { 174, 87 }, { 175, 88 }, { 177, 89 }, 1621 + { 179, 120 }, { 180, 129 }, { 183, 90 }, { 185, 136 }, { 187, 142 }, 1622 + { 190, 144 }, { 198, 91 }, { 200, 133 }, { 202, 135 }, 1623 + }; 1624 + 1606 1625 static const struct msm_pinctrl_soc_data sm8350_tlmm = { 1607 1626 .pins = sm8350_pins, 1608 1627 .npins = ARRAY_SIZE(sm8350_pins), ··· 1630 1611 .groups = sm8350_groups, 1631 1612 .ngroups = ARRAY_SIZE(sm8350_groups), 1632 1613 .ngpios = 204, 1614 + .wakeirq_map = sm8350_pdc_map, 1615 + .nwakeirq_map = ARRAY_SIZE(sm8350_pdc_map), 1633 1616 }; 1634 1617 1635 1618 static int sm8350_tlmm_probe(struct platform_device *pdev)
+7
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 1127 1127 { .compatible = "qcom,pm8150b-gpio", .data = (void *) 12 }, 1128 1128 /* pm8150l has 12 GPIOs with holes on 7 */ 1129 1129 { .compatible = "qcom,pm8150l-gpio", .data = (void *) 12 }, 1130 + { .compatible = "qcom,pm8350-gpio", .data = (void *) 10 }, 1131 + { .compatible = "qcom,pm8350b-gpio", .data = (void *) 8 }, 1132 + { .compatible = "qcom,pm8350c-gpio", .data = (void *) 9 }, 1133 + { .compatible = "qcom,pmk8350-gpio", .data = (void *) 4 }, 1134 + { .compatible = "qcom,pmr735a-gpio", .data = (void *) 4 }, 1135 + { .compatible = "qcom,pmr735b-gpio", .data = (void *) 4 }, 1130 1136 { .compatible = "qcom,pm6150-gpio", .data = (void *) 10 }, 1131 1137 { .compatible = "qcom,pm6150l-gpio", .data = (void *) 12 }, 1138 + { .compatible = "qcom,pm8008-gpio", .data = (void *) 2 }, 1132 1139 /* pmx55 has 11 GPIOs with holes on 3, 7, 10, 11 */ 1133 1140 { .compatible = "qcom,pmx55-gpio", .data = (void *) 11 }, 1134 1141 { },
-20
drivers/pinctrl/renesas/core.c
··· 394 394 return 0; 395 395 } 396 396 397 - const struct pinmux_bias_reg * 398 - sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin, 399 - unsigned int *bit) 400 - { 401 - unsigned int i, j; 402 - 403 - for (i = 0; pfc->info->bias_regs[i].puen; i++) { 404 - for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) { 405 - if (pfc->info->bias_regs[i].pins[j] == pin) { 406 - *bit = j; 407 - return &pfc->info->bias_regs[i]; 408 - } 409 - } 410 - } 411 - 412 - WARN_ONCE(1, "Pin %u is not in bias info list\n", pin); 413 - 414 - return NULL; 415 - } 416 - 417 397 static int sh_pfc_init_ranges(struct sh_pfc *pfc) 418 398 { 419 399 struct sh_pfc_pin_range *range;
-8
drivers/pinctrl/renesas/core.h
··· 29 29 int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin); 30 30 int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type); 31 31 32 - const struct pinmux_bias_reg * 33 - sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin, 34 - unsigned int *bit); 35 - 36 - unsigned int rcar_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin); 37 - void rcar_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 38 - unsigned int bias); 39 - 40 32 #endif /* __SH_PFC_CORE_H__ */
+5 -43
drivers/pinctrl/renesas/pfc-r8a73a4.c
··· 2649 2649 PINMUX_IRQ(329), /* IRQ57 */ 2650 2650 }; 2651 2651 2652 - #define PORTCR_PULMD_OFF (0 << 6) 2653 - #define PORTCR_PULMD_DOWN (2 << 6) 2654 - #define PORTCR_PULMD_UP (3 << 6) 2655 - #define PORTCR_PULMD_MASK (3 << 6) 2656 - 2657 2652 static const unsigned int r8a73a4_portcr_offsets[] = { 2658 2653 0x00000000, 0x00001000, 0x00000000, 0x00001000, 2659 2654 0x00001000, 0x00002000, 0x00002000, 0x00002000, 2660 2655 0x00002000, 0x00003000, 0x00003000, 2661 2656 }; 2662 2657 2663 - static unsigned int r8a73a4_pinmux_get_bias(struct sh_pfc *pfc, 2664 - unsigned int pin) 2658 + static void __iomem *r8a73a4_pin_to_portcr(struct sh_pfc *pfc, unsigned int pin) 2665 2659 { 2666 - void __iomem *addr; 2667 - 2668 - addr = pfc->windows->virt + r8a73a4_portcr_offsets[pin >> 5] + pin; 2669 - 2670 - switch (ioread8(addr) & PORTCR_PULMD_MASK) { 2671 - case PORTCR_PULMD_UP: 2672 - return PIN_CONFIG_BIAS_PULL_UP; 2673 - case PORTCR_PULMD_DOWN: 2674 - return PIN_CONFIG_BIAS_PULL_DOWN; 2675 - case PORTCR_PULMD_OFF: 2676 - default: 2677 - return PIN_CONFIG_BIAS_DISABLE; 2678 - } 2679 - } 2680 - 2681 - static void r8a73a4_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 2682 - unsigned int bias) 2683 - { 2684 - void __iomem *addr; 2685 - u32 value; 2686 - 2687 - addr = pfc->windows->virt + r8a73a4_portcr_offsets[pin >> 5] + pin; 2688 - value = ioread8(addr) & ~PORTCR_PULMD_MASK; 2689 - 2690 - switch (bias) { 2691 - case PIN_CONFIG_BIAS_PULL_UP: 2692 - value |= PORTCR_PULMD_UP; 2693 - break; 2694 - case PIN_CONFIG_BIAS_PULL_DOWN: 2695 - value |= PORTCR_PULMD_DOWN; 2696 - break; 2697 - } 2698 - 2699 - iowrite8(value, addr); 2660 + return pfc->windows->virt + r8a73a4_portcr_offsets[pin >> 5] + pin; 2700 2661 } 2701 2662 2702 2663 static const struct sh_pfc_soc_operations r8a73a4_pfc_ops = { 2703 - .get_bias = r8a73a4_pinmux_get_bias, 2704 - .set_bias = r8a73a4_pinmux_set_bias, 2664 + .get_bias = rmobile_pinmux_get_bias, 2665 + .set_bias = rmobile_pinmux_set_bias, 2666 + .pin_to_portcr = r8a73a4_pin_to_portcr, 2705 2667 }; 2706 2668 2707 2669 const struct sh_pfc_soc_info r8a73a4_pinmux_info = {
+4 -42
drivers/pinctrl/renesas/pfc-r8a7740.c
··· 3672 3672 PINMUX_IRQ(41, 167), /* IRQ31A */ 3673 3673 }; 3674 3674 3675 - #define PORTnCR_PULMD_OFF (0 << 6) 3676 - #define PORTnCR_PULMD_DOWN (2 << 6) 3677 - #define PORTnCR_PULMD_UP (3 << 6) 3678 - #define PORTnCR_PULMD_MASK (3 << 6) 3679 - 3680 3675 struct r8a7740_portcr_group { 3681 3676 unsigned int end_pin; 3682 3677 unsigned int offset; ··· 3681 3686 { 83, 0x0000 }, { 114, 0x1000 }, { 209, 0x2000 }, { 211, 0x3000 }, 3682 3687 }; 3683 3688 3684 - static void __iomem *r8a7740_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin) 3689 + static void __iomem *r8a7740_pin_to_portcr(struct sh_pfc *pfc, unsigned int pin) 3685 3690 { 3686 3691 unsigned int i; 3687 3692 ··· 3696 3701 return NULL; 3697 3702 } 3698 3703 3699 - static unsigned int r8a7740_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin) 3700 - { 3701 - void __iomem *addr = r8a7740_pinmux_portcr(pfc, pin); 3702 - u32 value = ioread8(addr) & PORTnCR_PULMD_MASK; 3703 - 3704 - switch (value) { 3705 - case PORTnCR_PULMD_UP: 3706 - return PIN_CONFIG_BIAS_PULL_UP; 3707 - case PORTnCR_PULMD_DOWN: 3708 - return PIN_CONFIG_BIAS_PULL_DOWN; 3709 - case PORTnCR_PULMD_OFF: 3710 - default: 3711 - return PIN_CONFIG_BIAS_DISABLE; 3712 - } 3713 - } 3714 - 3715 - static void r8a7740_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 3716 - unsigned int bias) 3717 - { 3718 - void __iomem *addr = r8a7740_pinmux_portcr(pfc, pin); 3719 - u32 value = ioread8(addr) & ~PORTnCR_PULMD_MASK; 3720 - 3721 - switch (bias) { 3722 - case PIN_CONFIG_BIAS_PULL_UP: 3723 - value |= PORTnCR_PULMD_UP; 3724 - break; 3725 - case PIN_CONFIG_BIAS_PULL_DOWN: 3726 - value |= PORTnCR_PULMD_DOWN; 3727 - break; 3728 - } 3729 - 3730 - iowrite8(value, addr); 3731 - } 3732 - 3733 3704 static const struct sh_pfc_soc_operations r8a7740_pfc_ops = { 3734 - .get_bias = r8a7740_pinmux_get_bias, 3735 - .set_bias = r8a7740_pinmux_set_bias, 3705 + .get_bias = rmobile_pinmux_get_bias, 3706 + .set_bias = rmobile_pinmux_set_bias, 3707 + .pin_to_portcr = r8a7740_pin_to_portcr, 3736 3708 }; 3737 3709 3738 3710 const struct sh_pfc_soc_info r8a7740_pinmux_info = {
-1
drivers/pinctrl/renesas/pfc-r8a7778.c
··· 16 16 #include <linux/kernel.h> 17 17 #include <linux/pinctrl/pinconf-generic.h> 18 18 19 - #include "core.h" 20 19 #include "sh_pfc.h" 21 20 22 21 #define PORT_GP_PUP_1(bank, pin, fn, sfx) \
+371 -16
drivers/pinctrl/renesas/pfc-r8a7791.c
··· 16 16 * which case they support both 3.3V and 1.8V signalling. 17 17 */ 18 18 #define CPU_ALL_GP(fn, sfx) \ 19 - PORT_GP_32(0, fn, sfx), \ 20 - PORT_GP_26(1, fn, sfx), \ 21 - PORT_GP_32(2, fn, sfx), \ 22 - PORT_GP_32(3, fn, sfx), \ 23 - PORT_GP_32(4, fn, sfx), \ 24 - PORT_GP_32(5, fn, sfx), \ 25 - PORT_GP_CFG_24(6, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \ 26 - PORT_GP_1(6, 24, fn, sfx), \ 27 - PORT_GP_1(6, 25, fn, sfx), \ 28 - PORT_GP_1(6, 26, fn, sfx), \ 29 - PORT_GP_1(6, 27, fn, sfx), \ 30 - PORT_GP_1(6, 28, fn, sfx), \ 31 - PORT_GP_1(6, 29, fn, sfx), \ 32 - PORT_GP_1(6, 30, fn, sfx), \ 33 - PORT_GP_1(6, 31, fn, sfx), \ 34 - PORT_GP_26(7, fn, sfx) 19 + PORT_GP_CFG_32(0, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 20 + PORT_GP_CFG_26(1, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 21 + PORT_GP_CFG_32(2, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 22 + PORT_GP_CFG_32(3, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 23 + PORT_GP_CFG_32(4, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 24 + PORT_GP_CFG_32(5, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 25 + PORT_GP_CFG_24(6, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE | SH_PFC_PIN_CFG_PULL_UP), \ 26 + PORT_GP_CFG_1(6, 24, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 27 + PORT_GP_CFG_1(6, 25, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 28 + PORT_GP_CFG_1(6, 26, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 29 + PORT_GP_CFG_1(6, 27, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 30 + PORT_GP_CFG_1(6, 28, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 31 + PORT_GP_CFG_1(6, 29, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 32 + PORT_GP_CFG_1(6, 30, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 33 + PORT_GP_CFG_1(6, 31, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 34 + PORT_GP_CFG_7(7, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 35 + PORT_GP_1(7, 7, fn, sfx), \ 36 + PORT_GP_1(7, 8, fn, sfx), \ 37 + PORT_GP_1(7, 9, fn, sfx), \ 38 + PORT_GP_CFG_1(7, 10, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 39 + PORT_GP_CFG_1(7, 11, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 40 + PORT_GP_CFG_1(7, 12, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 41 + PORT_GP_CFG_1(7, 13, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 42 + PORT_GP_CFG_1(7, 14, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 43 + PORT_GP_CFG_1(7, 15, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 44 + PORT_GP_CFG_1(7, 16, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 45 + PORT_GP_CFG_1(7, 17, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 46 + PORT_GP_CFG_1(7, 18, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 47 + PORT_GP_CFG_1(7, 19, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 48 + PORT_GP_CFG_1(7, 20, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 49 + PORT_GP_CFG_1(7, 21, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 50 + PORT_GP_CFG_1(7, 22, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 51 + PORT_GP_CFG_1(7, 23, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 52 + PORT_GP_CFG_1(7, 24, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \ 53 + PORT_GP_CFG_1(7, 25, fn, sfx, SH_PFC_PIN_CFG_PULL_UP) 54 + 55 + #define CPU_ALL_NOGP(fn) \ 56 + PIN_NOGP_CFG(ASEBRK_N_ACK, "ASEBRK#/ACK", fn, SH_PFC_PIN_CFG_PULL_DOWN), \ 57 + PIN_NOGP_CFG(AVS1, "AVS1", fn, SH_PFC_PIN_CFG_PULL_UP), \ 58 + PIN_NOGP_CFG(AVS2, "AVS2", fn, SH_PFC_PIN_CFG_PULL_UP), \ 59 + PIN_NOGP_CFG(TCK, "TCK", fn, SH_PFC_PIN_CFG_PULL_UP), \ 60 + PIN_NOGP_CFG(TDI, "TDI", fn, SH_PFC_PIN_CFG_PULL_UP), \ 61 + PIN_NOGP_CFG(TMS, "TMS", fn, SH_PFC_PIN_CFG_PULL_UP), \ 62 + PIN_NOGP_CFG(TRST_N, "TRST#", fn, SH_PFC_PIN_CFG_PULL_UP) 35 63 36 64 enum { 37 65 PINMUX_RESERVED = 0, ··· 1724 1696 PINMUX_IPSR_MSEL(IP16_11_10, CAN1_RX_B, SEL_CAN1_1), 1725 1697 }; 1726 1698 1699 + /* 1700 + * Pins not associated with a GPIO port. 1701 + */ 1702 + enum { 1703 + GP_ASSIGN_LAST(), 1704 + NOGP_ALL(), 1705 + }; 1706 + 1727 1707 static const struct sh_pfc_pin pinmux_pins[] = { 1728 1708 PINMUX_GPIO_GP_ALL(), 1709 + PINMUX_NOGP_ALL(), 1729 1710 }; 1730 1711 1731 1712 #if defined(CONFIG_PINCTRL_PFC_R8A7791) || defined(CONFIG_PINCTRL_PFC_R8A7793) ··· 6682 6645 return 31 - (pin & 0x1f); 6683 6646 } 6684 6647 6648 + static const struct pinmux_bias_reg pinmux_bias_regs[] = { 6649 + { PINMUX_BIAS_REG("PUPR0", 0xe6060100, "N/A", 0) { 6650 + [ 0] = RCAR_GP_PIN(1, 4), /* A20 */ 6651 + [ 1] = RCAR_GP_PIN(1, 5), /* A21 */ 6652 + [ 2] = RCAR_GP_PIN(1, 6), /* A22 */ 6653 + [ 3] = RCAR_GP_PIN(1, 7), /* A23 */ 6654 + [ 4] = RCAR_GP_PIN(1, 8), /* A24 */ 6655 + [ 5] = RCAR_GP_PIN(6, 31), /* DU0_DOTCLKIN */ 6656 + [ 6] = RCAR_GP_PIN(0, 0), /* D0 */ 6657 + [ 7] = RCAR_GP_PIN(0, 1), /* D1 */ 6658 + [ 8] = RCAR_GP_PIN(0, 2), /* D2 */ 6659 + [ 9] = RCAR_GP_PIN(0, 3), /* D3 */ 6660 + [10] = RCAR_GP_PIN(0, 4), /* D4 */ 6661 + [11] = RCAR_GP_PIN(0, 5), /* D5 */ 6662 + [12] = RCAR_GP_PIN(0, 6), /* D6 */ 6663 + [13] = RCAR_GP_PIN(0, 7), /* D7 */ 6664 + [14] = RCAR_GP_PIN(0, 8), /* D8 */ 6665 + [15] = RCAR_GP_PIN(0, 9), /* D9 */ 6666 + [16] = RCAR_GP_PIN(0, 10), /* D10 */ 6667 + [17] = RCAR_GP_PIN(0, 11), /* D11 */ 6668 + [18] = RCAR_GP_PIN(0, 12), /* D12 */ 6669 + [19] = RCAR_GP_PIN(0, 13), /* D13 */ 6670 + [20] = RCAR_GP_PIN(0, 14), /* D14 */ 6671 + [21] = RCAR_GP_PIN(0, 15), /* D15 */ 6672 + [22] = RCAR_GP_PIN(0, 16), /* A0 */ 6673 + [23] = RCAR_GP_PIN(0, 17), /* A1 */ 6674 + [24] = RCAR_GP_PIN(0, 18), /* A2 */ 6675 + [25] = RCAR_GP_PIN(0, 19), /* A3 */ 6676 + [26] = RCAR_GP_PIN(0, 20), /* A4 */ 6677 + [27] = RCAR_GP_PIN(0, 21), /* A5 */ 6678 + [28] = RCAR_GP_PIN(0, 22), /* A6 */ 6679 + [29] = RCAR_GP_PIN(0, 23), /* A7 */ 6680 + [30] = RCAR_GP_PIN(0, 24), /* A8 */ 6681 + [31] = RCAR_GP_PIN(0, 25), /* A9 */ 6682 + } }, 6683 + { PINMUX_BIAS_REG("PUPR1", 0xe6060104, "N/A", 0) { 6684 + [ 0] = RCAR_GP_PIN(0, 26), /* A10 */ 6685 + [ 1] = RCAR_GP_PIN(0, 27), /* A11 */ 6686 + [ 2] = RCAR_GP_PIN(0, 28), /* A12 */ 6687 + [ 3] = RCAR_GP_PIN(0, 29), /* A13 */ 6688 + [ 4] = RCAR_GP_PIN(0, 30), /* A14 */ 6689 + [ 5] = RCAR_GP_PIN(0, 31), /* A15 */ 6690 + [ 6] = RCAR_GP_PIN(1, 0), /* A16 */ 6691 + [ 7] = RCAR_GP_PIN(1, 1), /* A17 */ 6692 + [ 8] = RCAR_GP_PIN(1, 2), /* A18 */ 6693 + [ 9] = RCAR_GP_PIN(1, 3), /* A19 */ 6694 + [10] = PIN_TRST_N, /* TRST# */ 6695 + [11] = PIN_TCK, /* TCK */ 6696 + [12] = PIN_TMS, /* TMS */ 6697 + [13] = PIN_TDI, /* TDI */ 6698 + [14] = RCAR_GP_PIN(1, 11), /* CS1#/A26 */ 6699 + [15] = RCAR_GP_PIN(1, 12), /* EX_CS0# */ 6700 + [16] = RCAR_GP_PIN(1, 13), /* EX_CS1# */ 6701 + [17] = RCAR_GP_PIN(1, 14), /* EX_CS2# */ 6702 + [18] = RCAR_GP_PIN(1, 15), /* EX_CS3# */ 6703 + [19] = RCAR_GP_PIN(1, 16), /* EX_CS4# */ 6704 + [20] = RCAR_GP_PIN(1, 17), /* EX_CS5# */ 6705 + [21] = RCAR_GP_PIN(1, 18), /* BS# */ 6706 + [22] = RCAR_GP_PIN(1, 19), /* RD# */ 6707 + [23] = RCAR_GP_PIN(1, 20), /* RD/WR# */ 6708 + [24] = RCAR_GP_PIN(1, 21), /* WE0# */ 6709 + [25] = RCAR_GP_PIN(1, 22), /* WE1# */ 6710 + [26] = RCAR_GP_PIN(1, 23), /* EX_WAIT0 */ 6711 + [27] = RCAR_GP_PIN(1, 24), /* DREQ0 */ 6712 + [28] = RCAR_GP_PIN(1, 25), /* DACK0 */ 6713 + [29] = RCAR_GP_PIN(5, 31), /* SPEEDIN */ 6714 + [30] = RCAR_GP_PIN(2, 0), /* SSI_SCK0129 */ 6715 + [31] = RCAR_GP_PIN(2, 1), /* SSI_WS0129 */ 6716 + } }, 6717 + { PINMUX_BIAS_REG("PUPR2", 0xe6060108, "N/A", 0) { 6718 + [ 0] = RCAR_GP_PIN(2, 2), /* SSI_SDATA0 */ 6719 + [ 1] = RCAR_GP_PIN(2, 3), /* SSI_SCK1 */ 6720 + [ 2] = RCAR_GP_PIN(2, 4), /* SSI_WS1 */ 6721 + [ 3] = RCAR_GP_PIN(2, 5), /* SSI_SDATA1 */ 6722 + [ 4] = RCAR_GP_PIN(2, 6), /* SSI_SCK2 */ 6723 + [ 5] = RCAR_GP_PIN(2, 7), /* SSI_WS2 */ 6724 + [ 6] = RCAR_GP_PIN(2, 8), /* SSI_SDATA2 */ 6725 + [ 7] = RCAR_GP_PIN(2, 9), /* SSI_SCK34 */ 6726 + [ 8] = RCAR_GP_PIN(2, 10), /* SSI_WS34 */ 6727 + [ 9] = RCAR_GP_PIN(2, 11), /* SSI_SDATA3 */ 6728 + [10] = RCAR_GP_PIN(2, 12), /* SSI_SCK4 */ 6729 + [11] = RCAR_GP_PIN(2, 13), /* SSI_WS4 */ 6730 + [12] = RCAR_GP_PIN(2, 14), /* SSI_SDATA4 */ 6731 + [13] = RCAR_GP_PIN(2, 15), /* SSI_SCK5 */ 6732 + [14] = RCAR_GP_PIN(2, 16), /* SSI_WS5 */ 6733 + [15] = RCAR_GP_PIN(2, 17), /* SSI_SDATA5 */ 6734 + [16] = RCAR_GP_PIN(2, 18), /* SSI_SCK6 */ 6735 + [17] = RCAR_GP_PIN(2, 19), /* SSI_WS6 */ 6736 + [18] = RCAR_GP_PIN(2, 20), /* SSI_SDATA6 */ 6737 + [19] = RCAR_GP_PIN(2, 21), /* SSI_SCK78 */ 6738 + [20] = RCAR_GP_PIN(2, 22), /* SSI_WS78 */ 6739 + [21] = RCAR_GP_PIN(2, 23), /* SSI_SDATA7 */ 6740 + [22] = RCAR_GP_PIN(2, 24), /* SSI_SDATA8 */ 6741 + [23] = RCAR_GP_PIN(2, 25), /* SSI_SCK9 */ 6742 + [24] = RCAR_GP_PIN(2, 26), /* SSI_WS9 */ 6743 + [25] = RCAR_GP_PIN(2, 27), /* SSI_SDATA9 */ 6744 + [26] = RCAR_GP_PIN(2, 28), /* AUDIO_CLKA */ 6745 + [27] = RCAR_GP_PIN(2, 29), /* AUDIO_CLKB */ 6746 + [28] = RCAR_GP_PIN(2, 30), /* AUDIO_CLKC */ 6747 + [29] = RCAR_GP_PIN(2, 31), /* AUDIO_CLKOUT */ 6748 + [30] = RCAR_GP_PIN(7, 10), /* IRQ0 */ 6749 + [31] = RCAR_GP_PIN(7, 11), /* IRQ1 */ 6750 + } }, 6751 + { PINMUX_BIAS_REG("PUPR3", 0xe606010c, "N/A", 0) { 6752 + [ 0] = RCAR_GP_PIN(7, 12), /* IRQ2 */ 6753 + [ 1] = RCAR_GP_PIN(7, 13), /* IRQ3 */ 6754 + [ 2] = RCAR_GP_PIN(7, 14), /* IRQ4 */ 6755 + [ 3] = RCAR_GP_PIN(7, 15), /* IRQ5 */ 6756 + [ 4] = RCAR_GP_PIN(7, 16), /* IRQ6 */ 6757 + [ 5] = RCAR_GP_PIN(7, 17), /* IRQ7 */ 6758 + [ 6] = RCAR_GP_PIN(7, 18), /* IRQ8 */ 6759 + [ 7] = RCAR_GP_PIN(7, 19), /* IRQ9 */ 6760 + [ 8] = RCAR_GP_PIN(3, 0), /* DU1_DR0 */ 6761 + [ 9] = RCAR_GP_PIN(3, 1), /* DU1_DR1 */ 6762 + [10] = RCAR_GP_PIN(3, 2), /* DU1_DR2 */ 6763 + [11] = RCAR_GP_PIN(3, 3), /* DU1_DR3 */ 6764 + [12] = RCAR_GP_PIN(3, 4), /* DU1_DR4 */ 6765 + [13] = RCAR_GP_PIN(3, 5), /* DU1_DR5 */ 6766 + [14] = RCAR_GP_PIN(3, 6), /* DU1_DR6 */ 6767 + [15] = RCAR_GP_PIN(3, 7), /* DU1_DR7 */ 6768 + [16] = RCAR_GP_PIN(3, 8), /* DU1_DG0 */ 6769 + [17] = RCAR_GP_PIN(3, 9), /* DU1_DG1 */ 6770 + [18] = RCAR_GP_PIN(3, 10), /* DU1_DG2 */ 6771 + [19] = RCAR_GP_PIN(3, 11), /* DU1_DG3 */ 6772 + [20] = RCAR_GP_PIN(3, 12), /* DU1_DG4 */ 6773 + [21] = RCAR_GP_PIN(3, 13), /* DU1_DG5 */ 6774 + [22] = RCAR_GP_PIN(3, 14), /* DU1_DG6 */ 6775 + [23] = RCAR_GP_PIN(3, 15), /* DU1_DG7 */ 6776 + [24] = RCAR_GP_PIN(3, 16), /* DU1_DB0 */ 6777 + [25] = RCAR_GP_PIN(3, 17), /* DU1_DB1 */ 6778 + [26] = RCAR_GP_PIN(3, 18), /* DU1_DB2 */ 6779 + [27] = RCAR_GP_PIN(3, 19), /* DU1_DB3 */ 6780 + [28] = RCAR_GP_PIN(3, 20), /* DU1_DB4 */ 6781 + [29] = RCAR_GP_PIN(3, 21), /* DU1_DB5 */ 6782 + [30] = RCAR_GP_PIN(3, 22), /* DU1_DB6 */ 6783 + [31] = RCAR_GP_PIN(3, 23), /* DU1_DB7 */ 6784 + } }, 6785 + { PINMUX_BIAS_REG("PUPR4", 0xe6060110, "N/A", 0) { 6786 + [ 0] = RCAR_GP_PIN(3, 24), /* DU1_DOTCLKIN */ 6787 + [ 1] = RCAR_GP_PIN(3, 25), /* DU1_DOTCLKOUT0 */ 6788 + [ 2] = RCAR_GP_PIN(3, 26), /* DU1_DOTCLKOUT1 */ 6789 + [ 3] = RCAR_GP_PIN(3, 27), /* DU1_EXHSYNC_DU1_HSYNC */ 6790 + [ 4] = RCAR_GP_PIN(3, 28), /* DU1_EXVSYNC_DU1_VSYNC */ 6791 + [ 5] = RCAR_GP_PIN(3, 29), /* DU1_EXODDF_DU1_ODDF_DISP_CDE */ 6792 + [ 6] = RCAR_GP_PIN(3, 30), /* DU1_DISP */ 6793 + [ 7] = RCAR_GP_PIN(3, 31), /* DU1_CDE */ 6794 + [ 8] = RCAR_GP_PIN(4, 0), /* VI0_CLK */ 6795 + [ 9] = RCAR_GP_PIN(4, 1), /* VI0_CLKENB */ 6796 + [10] = RCAR_GP_PIN(4, 2), /* VI0_FIELD */ 6797 + [11] = RCAR_GP_PIN(4, 3), /* VI0_HSYNC# */ 6798 + [12] = RCAR_GP_PIN(4, 4), /* VI0_VSYNC# */ 6799 + [13] = RCAR_GP_PIN(4, 5), /* VI0_DATA0_VI0_B0 */ 6800 + [14] = RCAR_GP_PIN(4, 6), /* VI0_DATA1_VI0_B1 */ 6801 + [15] = RCAR_GP_PIN(4, 7), /* VI0_DATA2_VI0_B2 */ 6802 + [16] = RCAR_GP_PIN(4, 8), /* VI0_DATA3_VI0_B3 */ 6803 + [17] = RCAR_GP_PIN(4, 9), /* VI0_DATA4_VI0_B4 */ 6804 + [18] = RCAR_GP_PIN(4, 10), /* VI0_DATA5_VI0_B5 */ 6805 + [19] = RCAR_GP_PIN(4, 11), /* VI0_DATA6_VI0_B6 */ 6806 + [20] = RCAR_GP_PIN(4, 12), /* VI0_DATA7_VI0_B7 */ 6807 + [21] = RCAR_GP_PIN(4, 13), /* VI0_G0 */ 6808 + [22] = RCAR_GP_PIN(4, 14), /* VI0_G1 */ 6809 + [23] = RCAR_GP_PIN(4, 15), /* VI0_G2 */ 6810 + [24] = RCAR_GP_PIN(4, 16), /* VI0_G3 */ 6811 + [25] = RCAR_GP_PIN(4, 17), /* VI0_G4 */ 6812 + [26] = RCAR_GP_PIN(4, 18), /* VI0_G5 */ 6813 + [27] = RCAR_GP_PIN(4, 19), /* VI0_G6 */ 6814 + [28] = RCAR_GP_PIN(4, 20), /* VI0_G7 */ 6815 + [29] = RCAR_GP_PIN(4, 21), /* VI0_R0 */ 6816 + [30] = RCAR_GP_PIN(4, 22), /* VI0_R1 */ 6817 + [31] = RCAR_GP_PIN(4, 23), /* VI0_R2 */ 6818 + } }, 6819 + { PINMUX_BIAS_REG("PUPR5", 0xe6060114, "N/A", 0) { 6820 + [ 0] = RCAR_GP_PIN(4, 24), /* VI0_R3 */ 6821 + [ 1] = RCAR_GP_PIN(4, 25), /* VI0_R4 */ 6822 + [ 2] = RCAR_GP_PIN(4, 26), /* VI0_R5 */ 6823 + [ 3] = RCAR_GP_PIN(4, 27), /* VI0_R6 */ 6824 + [ 4] = RCAR_GP_PIN(4, 28), /* VI0_R7 */ 6825 + [ 5] = RCAR_GP_PIN(5, 0), /* VI1_HSYNC# */ 6826 + [ 6] = RCAR_GP_PIN(5, 1), /* VI1_VSYNC# */ 6827 + [ 7] = RCAR_GP_PIN(5, 2), /* VI1_CLKENB */ 6828 + [ 8] = RCAR_GP_PIN(5, 3), /* VI1_FIELD */ 6829 + [ 9] = RCAR_GP_PIN(5, 4), /* VI1_CLK */ 6830 + [10] = RCAR_GP_PIN(5, 5), /* VI1_DATA0 */ 6831 + [11] = RCAR_GP_PIN(5, 6), /* VI1_DATA1 */ 6832 + [12] = RCAR_GP_PIN(5, 7), /* VI1_DATA2 */ 6833 + [13] = RCAR_GP_PIN(5, 8), /* VI1_DATA3 */ 6834 + [14] = RCAR_GP_PIN(5, 9), /* VI1_DATA4 */ 6835 + [15] = RCAR_GP_PIN(5, 10), /* VI1_DATA5 */ 6836 + [16] = RCAR_GP_PIN(5, 11), /* VI1_DATA6 */ 6837 + [17] = RCAR_GP_PIN(5, 12), /* VI1_DATA7 */ 6838 + [18] = RCAR_GP_PIN(5, 13), /* ETH_MDIO */ 6839 + [19] = RCAR_GP_PIN(5, 14), /* ETH_CRS_DV */ 6840 + [20] = RCAR_GP_PIN(5, 15), /* ETH_RX_ER */ 6841 + [21] = RCAR_GP_PIN(5, 16), /* ETH_RXD0 */ 6842 + [22] = RCAR_GP_PIN(5, 17), /* ETH_RXD1 */ 6843 + [23] = RCAR_GP_PIN(5, 18), /* ETH_LINK */ 6844 + [24] = RCAR_GP_PIN(5, 19), /* ETH_REFCLK */ 6845 + [25] = RCAR_GP_PIN(5, 20), /* ETH_TXD1 */ 6846 + [26] = RCAR_GP_PIN(5, 21), /* ETH_TX_EN */ 6847 + [27] = RCAR_GP_PIN(5, 22), /* ETH_MAGIC */ 6848 + [28] = RCAR_GP_PIN(5, 23), /* ETH_TXD0 */ 6849 + [29] = RCAR_GP_PIN(5, 24), /* ETH_MDC */ 6850 + [30] = RCAR_GP_PIN(5, 25), /* STP_IVCXO27_0 */ 6851 + [31] = RCAR_GP_PIN(5, 26), /* STP_ISCLK_0 */ 6852 + } }, 6853 + { PINMUX_BIAS_REG("PUPR6", 0xe6060118, "N/A", 0) { 6854 + [ 0] = RCAR_GP_PIN(5, 27), /* STP_ISD_0 */ 6855 + [ 1] = RCAR_GP_PIN(5, 28), /* STP_ISEN_0 */ 6856 + [ 2] = RCAR_GP_PIN(5, 29), /* STP_ISSYNC_0 */ 6857 + [ 3] = RCAR_GP_PIN(5, 30), /* STP_OPWM_0 */ 6858 + [ 4] = RCAR_GP_PIN(6, 0), /* SD0_CLK */ 6859 + [ 5] = RCAR_GP_PIN(6, 1), /* SD0_CMD */ 6860 + [ 6] = RCAR_GP_PIN(6, 2), /* SD0_DATA0 */ 6861 + [ 7] = RCAR_GP_PIN(6, 3), /* SD0_DATA1 */ 6862 + [ 8] = RCAR_GP_PIN(6, 4), /* SD0_DATA2 */ 6863 + [ 9] = RCAR_GP_PIN(6, 5), /* SD0_DATA3 */ 6864 + [10] = RCAR_GP_PIN(6, 6), /* SD0_CD */ 6865 + [11] = RCAR_GP_PIN(6, 7), /* SD0_WP */ 6866 + [12] = RCAR_GP_PIN(6, 8), /* SD2_CLK */ 6867 + [13] = RCAR_GP_PIN(6, 9), /* SD2_CMD */ 6868 + [14] = RCAR_GP_PIN(6, 10), /* SD2_DATA0 */ 6869 + [15] = RCAR_GP_PIN(6, 11), /* SD2_DATA1 */ 6870 + [16] = RCAR_GP_PIN(6, 12), /* SD2_DATA2 */ 6871 + [17] = RCAR_GP_PIN(6, 13), /* SD2_DATA3 */ 6872 + [18] = RCAR_GP_PIN(6, 14), /* SD2_CD */ 6873 + [19] = RCAR_GP_PIN(6, 15), /* SD2_WP */ 6874 + [20] = RCAR_GP_PIN(6, 16), /* SD3_CLK */ 6875 + [21] = RCAR_GP_PIN(6, 17), /* SD3_CMD */ 6876 + [22] = RCAR_GP_PIN(6, 18), /* SD3_DATA0 */ 6877 + [23] = RCAR_GP_PIN(6, 19), /* SD3_DATA1 */ 6878 + [24] = RCAR_GP_PIN(6, 20), /* SD3_DATA2 */ 6879 + [25] = RCAR_GP_PIN(6, 21), /* SD3_DATA3 */ 6880 + [26] = RCAR_GP_PIN(6, 22), /* SD3_CD */ 6881 + [27] = RCAR_GP_PIN(6, 23), /* SD3_WP */ 6882 + [28] = RCAR_GP_PIN(6, 24), /* MSIOF0_SCK */ 6883 + [29] = RCAR_GP_PIN(6, 25), /* MSIOF0_SYNC */ 6884 + [30] = RCAR_GP_PIN(6, 26), /* MSIOF0_TXD */ 6885 + [31] = RCAR_GP_PIN(6, 27), /* MSIOF0_RXD */ 6886 + } }, 6887 + { PINMUX_BIAS_REG("PUPR7", 0xe606011c, "N/A", 0) { 6888 + /* PUPR7 pull-up pins */ 6889 + [ 0] = RCAR_GP_PIN(6, 28), /* MSIOF0_SS1 */ 6890 + [ 1] = RCAR_GP_PIN(6, 29), /* MSIOF0_SS2 */ 6891 + [ 2] = RCAR_GP_PIN(4, 29), /* SIM0_RST */ 6892 + [ 3] = RCAR_GP_PIN(4, 30), /* SIM0_CLK */ 6893 + [ 4] = RCAR_GP_PIN(4, 31), /* SIM0_D */ 6894 + [ 5] = RCAR_GP_PIN(7, 20), /* GPS_CLK */ 6895 + [ 6] = RCAR_GP_PIN(7, 21), /* GPS_SIGN */ 6896 + [ 7] = RCAR_GP_PIN(7, 22), /* GPS_MAG */ 6897 + [ 8] = RCAR_GP_PIN(7, 0), /* HCTS0# */ 6898 + [ 9] = RCAR_GP_PIN(7, 1), /* HRTS0# */ 6899 + [10] = RCAR_GP_PIN(7, 2), /* HSCK0 */ 6900 + [11] = RCAR_GP_PIN(7, 3), /* HRX0 */ 6901 + [12] = RCAR_GP_PIN(7, 4), /* HTX0 */ 6902 + [13] = RCAR_GP_PIN(7, 5), /* HRX1 */ 6903 + [14] = RCAR_GP_PIN(7, 6), /* HTX1 */ 6904 + [15] = SH_PFC_PIN_NONE, 6905 + [16] = SH_PFC_PIN_NONE, 6906 + [17] = SH_PFC_PIN_NONE, 6907 + [18] = RCAR_GP_PIN(1, 9), /* A25 */ 6908 + [19] = SH_PFC_PIN_NONE, 6909 + [20] = RCAR_GP_PIN(1, 10), /* CS0# */ 6910 + [21] = RCAR_GP_PIN(7, 23), /* USB0_PWEN */ 6911 + [22] = RCAR_GP_PIN(7, 24), /* USB0_OVC */ 6912 + [23] = RCAR_GP_PIN(7, 25), /* USB1_PWEN */ 6913 + [24] = RCAR_GP_PIN(6, 30), /* USB1_OVC */ 6914 + [25] = PIN_AVS1, /* AVS1 */ 6915 + [26] = PIN_AVS2, /* AVS2 */ 6916 + [27] = SH_PFC_PIN_NONE, 6917 + [28] = SH_PFC_PIN_NONE, 6918 + [29] = SH_PFC_PIN_NONE, 6919 + [30] = SH_PFC_PIN_NONE, 6920 + [31] = SH_PFC_PIN_NONE, 6921 + } }, 6922 + { PINMUX_BIAS_REG("N/A", 0, "PUPR7", 0xe606011c) { 6923 + /* PUPR7 pull-down pins */ 6924 + [ 0] = SH_PFC_PIN_NONE, 6925 + [ 1] = SH_PFC_PIN_NONE, 6926 + [ 2] = SH_PFC_PIN_NONE, 6927 + [ 3] = SH_PFC_PIN_NONE, 6928 + [ 4] = SH_PFC_PIN_NONE, 6929 + [ 5] = SH_PFC_PIN_NONE, 6930 + [ 6] = SH_PFC_PIN_NONE, 6931 + [ 7] = SH_PFC_PIN_NONE, 6932 + [ 8] = SH_PFC_PIN_NONE, 6933 + [ 9] = SH_PFC_PIN_NONE, 6934 + [10] = SH_PFC_PIN_NONE, 6935 + [11] = SH_PFC_PIN_NONE, 6936 + [12] = SH_PFC_PIN_NONE, 6937 + [13] = SH_PFC_PIN_NONE, 6938 + [14] = SH_PFC_PIN_NONE, 6939 + [15] = SH_PFC_PIN_NONE, 6940 + [16] = SH_PFC_PIN_NONE, 6941 + [17] = SH_PFC_PIN_NONE, 6942 + [18] = SH_PFC_PIN_NONE, 6943 + [19] = PIN_ASEBRK_N_ACK, /* ASEBRK#/ACK */ 6944 + [20] = SH_PFC_PIN_NONE, 6945 + [21] = SH_PFC_PIN_NONE, 6946 + [22] = SH_PFC_PIN_NONE, 6947 + [23] = SH_PFC_PIN_NONE, 6948 + [24] = SH_PFC_PIN_NONE, 6949 + [25] = SH_PFC_PIN_NONE, 6950 + [26] = SH_PFC_PIN_NONE, 6951 + [27] = SH_PFC_PIN_NONE, 6952 + [28] = SH_PFC_PIN_NONE, 6953 + [29] = SH_PFC_PIN_NONE, 6954 + [30] = SH_PFC_PIN_NONE, 6955 + [31] = SH_PFC_PIN_NONE, 6956 + } }, 6957 + { /* sentinel */ }, 6958 + }; 6959 + 6685 6960 static const struct sh_pfc_soc_operations r8a7791_pinmux_ops = { 6686 6961 .pin_to_pocctrl = r8a7791_pin_to_pocctrl, 6962 + .get_bias = rcar_pinmux_get_bias, 6963 + .set_bias = rcar_pinmux_set_bias, 6687 6964 }; 6688 6965 6689 6966 #ifdef CONFIG_PINCTRL_PFC_R8A7743 ··· 7016 6665 .nr_functions = ARRAY_SIZE(pinmux_functions.common), 7017 6666 7018 6667 .cfg_regs = pinmux_config_regs, 6668 + .bias_regs = pinmux_bias_regs, 7019 6669 7020 6670 .pinmux_data = pinmux_data, 7021 6671 .pinmux_data_size = ARRAY_SIZE(pinmux_data), ··· 7039 6687 .nr_functions = ARRAY_SIZE(pinmux_functions.common), 7040 6688 7041 6689 .cfg_regs = pinmux_config_regs, 6690 + .bias_regs = pinmux_bias_regs, 7042 6691 7043 6692 .pinmux_data = pinmux_data, 7044 6693 .pinmux_data_size = ARRAY_SIZE(pinmux_data), ··· 7064 6711 ARRAY_SIZE(pinmux_functions.automotive), 7065 6712 7066 6713 .cfg_regs = pinmux_config_regs, 6714 + .bias_regs = pinmux_bias_regs, 7067 6715 7068 6716 .pinmux_data = pinmux_data, 7069 6717 .pinmux_data_size = ARRAY_SIZE(pinmux_data), ··· 7089 6735 ARRAY_SIZE(pinmux_functions.automotive), 7090 6736 7091 6737 .cfg_regs = pinmux_config_regs, 6738 + .bias_regs = pinmux_bias_regs, 7092 6739 7093 6740 .pinmux_data = pinmux_data, 7094 6741 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
-1
drivers/pinctrl/renesas/pfc-r8a7792.c
··· 8 8 9 9 #include <linux/kernel.h> 10 10 11 - #include "core.h" 12 11 #include "sh_pfc.h" 13 12 14 13 #define CPU_ALL_GP(fn, sfx) \
-1
drivers/pinctrl/renesas/pfc-r8a77950.c
··· 8 8 #include <linux/errno.h> 9 9 #include <linux/kernel.h> 10 10 11 - #include "core.h" 12 11 #include "sh_pfc.h" 13 12 14 13 #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN)
+29 -2
drivers/pinctrl/renesas/pfc-r8a77951.c
··· 9 9 #include <linux/kernel.h> 10 10 #include <linux/sys_soc.h> 11 11 12 - #include "core.h" 13 12 #include "sh_pfc.h" 14 13 15 14 #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) ··· 4125 4126 VI4_DATA22_MARK, VI4_DATA23_MARK, 4126 4127 }, 4127 4128 }; 4129 + static const unsigned int vin4_g8_pins[] = { 4130 + RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1), 4131 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 4132 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 4133 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 4134 + }; 4135 + static const unsigned int vin4_g8_mux[] = { 4136 + VI4_DATA8_MARK, VI4_DATA9_MARK, 4137 + VI4_DATA10_MARK, VI4_DATA11_MARK, 4138 + VI4_DATA12_MARK, VI4_DATA13_MARK, 4139 + VI4_DATA14_MARK, VI4_DATA15_MARK, 4140 + }; 4128 4141 static const unsigned int vin4_sync_pins[] = { 4129 4142 /* HSYNC#, VSYNC# */ 4130 4143 RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 17), ··· 4191 4180 VI5_DATA14_MARK, VI5_DATA15_MARK, 4192 4181 }, 4193 4182 }; 4183 + static const unsigned int vin5_high8_pins[] = { 4184 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 4185 + RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15), 4186 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 4187 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 4188 + }; 4189 + static const unsigned int vin5_high8_mux[] = { 4190 + VI5_DATA8_MARK, VI5_DATA9_MARK, 4191 + VI5_DATA10_MARK, VI5_DATA11_MARK, 4192 + VI5_DATA12_MARK, VI5_DATA13_MARK, 4193 + VI5_DATA14_MARK, VI5_DATA15_MARK, 4194 + }; 4194 4195 static const unsigned int vin5_sync_pins[] = { 4195 4196 /* HSYNC#, VSYNC# */ 4196 4197 RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 9), ··· 4233 4210 }; 4234 4211 4235 4212 static const struct { 4236 - struct sh_pfc_pin_group common[326]; 4213 + struct sh_pfc_pin_group common[328]; 4237 4214 #ifdef CONFIG_PINCTRL_PFC_R8A77951 4238 4215 struct sh_pfc_pin_group automotive[30]; 4239 4216 #endif ··· 4553 4530 SH_PFC_PIN_GROUP(vin4_data18_b), 4554 4531 VIN_DATA_PIN_GROUP(vin4_data, 20, _b), 4555 4532 VIN_DATA_PIN_GROUP(vin4_data, 24, _b), 4533 + SH_PFC_PIN_GROUP(vin4_g8), 4556 4534 SH_PFC_PIN_GROUP(vin4_sync), 4557 4535 SH_PFC_PIN_GROUP(vin4_field), 4558 4536 SH_PFC_PIN_GROUP(vin4_clkenb), ··· 4562 4538 VIN_DATA_PIN_GROUP(vin5_data, 10), 4563 4539 VIN_DATA_PIN_GROUP(vin5_data, 12), 4564 4540 VIN_DATA_PIN_GROUP(vin5_data, 16), 4541 + SH_PFC_PIN_GROUP(vin5_high8), 4565 4542 SH_PFC_PIN_GROUP(vin5_sync), 4566 4543 SH_PFC_PIN_GROUP(vin5_field), 4567 4544 SH_PFC_PIN_GROUP(vin5_clkenb), ··· 5122 5097 "vin4_data18_b", 5123 5098 "vin4_data20_b", 5124 5099 "vin4_data24_b", 5100 + "vin4_g8", 5125 5101 "vin4_sync", 5126 5102 "vin4_field", 5127 5103 "vin4_clkenb", ··· 5134 5108 "vin5_data10", 5135 5109 "vin5_data12", 5136 5110 "vin5_data16", 5111 + "vin5_high8", 5137 5112 "vin5_sync", 5138 5113 "vin5_field", 5139 5114 "vin5_clkenb",
+29 -2
drivers/pinctrl/renesas/pfc-r8a7796.c
··· 14 14 #include <linux/errno.h> 15 15 #include <linux/kernel.h> 16 16 17 - #include "core.h" 18 17 #include "sh_pfc.h" 19 18 20 19 #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) ··· 4099 4100 VI4_DATA22_MARK, VI4_DATA23_MARK, 4100 4101 }, 4101 4102 }; 4103 + static const unsigned int vin4_g8_pins[] = { 4104 + RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1), 4105 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 4106 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 4107 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 4108 + }; 4109 + static const unsigned int vin4_g8_mux[] = { 4110 + VI4_DATA8_MARK, VI4_DATA9_MARK, 4111 + VI4_DATA10_MARK, VI4_DATA11_MARK, 4112 + VI4_DATA12_MARK, VI4_DATA13_MARK, 4113 + VI4_DATA14_MARK, VI4_DATA15_MARK, 4114 + }; 4102 4115 static const unsigned int vin4_sync_pins[] = { 4103 4116 /* HSYNC#, VSYNC# */ 4104 4117 RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 17), ··· 4165 4154 VI5_DATA14_MARK, VI5_DATA15_MARK, 4166 4155 }, 4167 4156 }; 4157 + static const unsigned int vin5_high8_pins[] = { 4158 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 4159 + RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15), 4160 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 4161 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 4162 + }; 4163 + static const unsigned int vin5_high8_mux[] = { 4164 + VI5_DATA8_MARK, VI5_DATA9_MARK, 4165 + VI5_DATA10_MARK, VI5_DATA11_MARK, 4166 + VI5_DATA12_MARK, VI5_DATA13_MARK, 4167 + VI5_DATA14_MARK, VI5_DATA15_MARK, 4168 + }; 4168 4169 static const unsigned int vin5_sync_pins[] = { 4169 4170 /* HSYNC#, VSYNC# */ 4170 4171 RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 9), ··· 4207 4184 }; 4208 4185 4209 4186 static const struct { 4210 - struct sh_pfc_pin_group common[322]; 4187 + struct sh_pfc_pin_group common[324]; 4211 4188 #if defined(CONFIG_PINCTRL_PFC_R8A77960) || defined(CONFIG_PINCTRL_PFC_R8A77961) 4212 4189 struct sh_pfc_pin_group automotive[30]; 4213 4190 #endif ··· 4523 4500 SH_PFC_PIN_GROUP(vin4_data18_b), 4524 4501 VIN_DATA_PIN_GROUP(vin4_data, 20, _b), 4525 4502 VIN_DATA_PIN_GROUP(vin4_data, 24, _b), 4503 + SH_PFC_PIN_GROUP(vin4_g8), 4526 4504 SH_PFC_PIN_GROUP(vin4_sync), 4527 4505 SH_PFC_PIN_GROUP(vin4_field), 4528 4506 SH_PFC_PIN_GROUP(vin4_clkenb), ··· 4532 4508 VIN_DATA_PIN_GROUP(vin5_data, 10), 4533 4509 VIN_DATA_PIN_GROUP(vin5_data, 12), 4534 4510 VIN_DATA_PIN_GROUP(vin5_data, 16), 4511 + SH_PFC_PIN_GROUP(vin5_high8), 4535 4512 SH_PFC_PIN_GROUP(vin5_sync), 4536 4513 SH_PFC_PIN_GROUP(vin5_field), 4537 4514 SH_PFC_PIN_GROUP(vin5_clkenb), ··· 5079 5054 "vin4_data18_b", 5080 5055 "vin4_data20_b", 5081 5056 "vin4_data24_b", 5057 + "vin4_g8", 5082 5058 "vin4_sync", 5083 5059 "vin4_field", 5084 5060 "vin4_clkenb", ··· 5091 5065 "vin5_data10", 5092 5066 "vin5_data12", 5093 5067 "vin5_data16", 5068 + "vin5_high8", 5094 5069 "vin5_sync", 5095 5070 "vin5_field", 5096 5071 "vin5_clkenb",
+33 -2
drivers/pinctrl/renesas/pfc-r8a77965.c
··· 15 15 #include <linux/errno.h> 16 16 #include <linux/kernel.h> 17 17 18 - #include "core.h" 19 18 #include "sh_pfc.h" 20 19 21 20 #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN) ··· 4336 4337 }, 4337 4338 }; 4338 4339 4340 + static const unsigned int vin4_g8_pins[] = { 4341 + RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1), 4342 + RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3), 4343 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 4344 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 4345 + }; 4346 + 4347 + static const unsigned int vin4_g8_mux[] = { 4348 + VI4_DATA8_MARK, VI4_DATA9_MARK, 4349 + VI4_DATA10_MARK, VI4_DATA11_MARK, 4350 + VI4_DATA12_MARK, VI4_DATA13_MARK, 4351 + VI4_DATA14_MARK, VI4_DATA15_MARK, 4352 + }; 4353 + 4339 4354 static const unsigned int vin4_sync_pins[] = { 4340 4355 /* VSYNC_N, HSYNC_N */ 4341 4356 RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18), ··· 4410 4397 }, 4411 4398 }; 4412 4399 4400 + static const unsigned int vin5_high8_pins[] = { 4401 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 4402 + RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15), 4403 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 4404 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 4405 + }; 4406 + 4407 + static const unsigned int vin5_high8_mux[] = { 4408 + VI5_DATA8_MARK, VI5_DATA9_MARK, 4409 + VI5_DATA10_MARK, VI5_DATA11_MARK, 4410 + VI5_DATA12_MARK, VI5_DATA13_MARK, 4411 + VI5_DATA14_MARK, VI5_DATA15_MARK, 4412 + }; 4413 + 4413 4414 static const unsigned int vin5_sync_pins[] = { 4414 4415 /* VSYNC_N, HSYNC_N */ 4415 4416 RCAR_GP_PIN(1, 9), RCAR_GP_PIN(1, 10), ··· 4458 4431 }; 4459 4432 4460 4433 static const struct { 4461 - struct sh_pfc_pin_group common[324]; 4434 + struct sh_pfc_pin_group common[326]; 4462 4435 #ifdef CONFIG_PINCTRL_PFC_R8A77965 4463 4436 struct sh_pfc_pin_group automotive[30]; 4464 4437 #endif ··· 4776 4749 SH_PFC_PIN_GROUP(vin4_data18_b), 4777 4750 VIN_DATA_PIN_GROUP(vin4_data, 20, _b), 4778 4751 VIN_DATA_PIN_GROUP(vin4_data, 24, _b), 4752 + SH_PFC_PIN_GROUP(vin4_g8), 4779 4753 SH_PFC_PIN_GROUP(vin4_sync), 4780 4754 SH_PFC_PIN_GROUP(vin4_field), 4781 4755 SH_PFC_PIN_GROUP(vin4_clkenb), ··· 4785 4757 VIN_DATA_PIN_GROUP(vin5_data, 10), 4786 4758 VIN_DATA_PIN_GROUP(vin5_data, 12), 4787 4759 VIN_DATA_PIN_GROUP(vin5_data, 16), 4760 + SH_PFC_PIN_GROUP(vin5_high8), 4788 4761 SH_PFC_PIN_GROUP(vin5_sync), 4789 4762 SH_PFC_PIN_GROUP(vin5_field), 4790 4763 SH_PFC_PIN_GROUP(vin5_clkenb), ··· 5336 5307 "vin4_data18_b", 5337 5308 "vin4_data20_b", 5338 5309 "vin4_data24_b", 5310 + "vin4_g8", 5339 5311 "vin4_sync", 5340 5312 "vin4_field", 5341 5313 "vin4_clkenb", ··· 5348 5318 "vin5_data10", 5349 5319 "vin5_data12", 5350 5320 "vin5_data16", 5321 + "vin5_high8", 5351 5322 "vin5_sync", 5352 5323 "vin5_field", 5353 5324 "vin5_clkenb",
-1
drivers/pinctrl/renesas/pfc-r8a77970.c
··· 16 16 #include <linux/io.h> 17 17 #include <linux/kernel.h> 18 18 19 - #include "core.h" 20 19 #include "sh_pfc.h" 21 20 22 21 #define CPU_ALL_GP(fn, sfx) \
-1
drivers/pinctrl/renesas/pfc-r8a77980.c
··· 16 16 #include <linux/io.h> 17 17 #include <linux/kernel.h> 18 18 19 - #include "core.h" 20 19 #include "sh_pfc.h" 21 20 22 21 #define CPU_ALL_GP(fn, sfx) \
+33 -2
drivers/pinctrl/renesas/pfc-r8a77990.c
··· 14 14 #include <linux/errno.h> 15 15 #include <linux/kernel.h> 16 16 17 - #include "core.h" 18 17 #include "sh_pfc.h" 19 18 20 19 #define CFG_FLAGS (SH_PFC_PIN_CFG_PULL_UP_DOWN) ··· 3696 3697 }, 3697 3698 }; 3698 3699 3700 + static const unsigned int vin4_g8_pins[] = { 3701 + RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5), 3702 + RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7), 3703 + RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 10), 3704 + RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14), 3705 + }; 3706 + 3707 + static const unsigned int vin4_g8_mux[] = { 3708 + VI4_DATA8_MARK, VI4_DATA9_MARK, 3709 + VI4_DATA10_MARK, VI4_DATA11_MARK, 3710 + VI4_DATA12_MARK, VI4_DATA13_MARK, 3711 + VI4_DATA14_MARK, VI4_DATA15_MARK, 3712 + }; 3713 + 3699 3714 static const unsigned int vin4_sync_pins[] = { 3700 3715 /* HSYNC, VSYNC */ 3701 3716 RCAR_GP_PIN(2, 25), RCAR_GP_PIN(2, 24), ··· 3784 3771 VI5_DATA6_B_MARK, VI5_DATA7_B_MARK, 3785 3772 }; 3786 3773 3774 + static const unsigned int vin5_high8_pins[] = { 3775 + RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13), 3776 + RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 11), 3777 + RCAR_GP_PIN(0, 8), RCAR_GP_PIN(0, 10), 3778 + RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3), 3779 + }; 3780 + 3781 + static const unsigned int vin5_high8_mux[] = { 3782 + VI5_DATA8_A_MARK, VI5_DATA9_A_MARK, 3783 + VI5_DATA10_A_MARK, VI5_DATA11_A_MARK, 3784 + VI5_DATA12_A_MARK, VI5_DATA13_A_MARK, 3785 + VI5_DATA14_A_MARK, VI5_DATA15_A_MARK, 3786 + }; 3787 + 3787 3788 static const unsigned int vin5_sync_a_pins[] = { 3788 3789 /* HSYNC_N, VSYNC_N */ 3789 3790 RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 9), ··· 3840 3813 }; 3841 3814 3842 3815 static const struct { 3843 - struct sh_pfc_pin_group common[253]; 3816 + struct sh_pfc_pin_group common[255]; 3844 3817 #ifdef CONFIG_PINCTRL_PFC_R8A77990 3845 3818 struct sh_pfc_pin_group automotive[21]; 3846 3819 #endif ··· 4085 4058 SH_PFC_PIN_GROUP(vin4_data18_b), 4086 4059 VIN_DATA_PIN_GROUP(vin4_data, 20, _b), 4087 4060 VIN_DATA_PIN_GROUP(vin4_data, 24, _b), 4061 + SH_PFC_PIN_GROUP(vin4_g8), 4088 4062 SH_PFC_PIN_GROUP(vin4_sync), 4089 4063 SH_PFC_PIN_GROUP(vin4_field), 4090 4064 SH_PFC_PIN_GROUP(vin4_clkenb), ··· 4095 4067 VIN_DATA_PIN_GROUP(vin5_data, 12, _a), 4096 4068 VIN_DATA_PIN_GROUP(vin5_data, 16, _a), 4097 4069 SH_PFC_PIN_GROUP(vin5_data8_b), 4070 + SH_PFC_PIN_GROUP(vin5_high8), 4098 4071 SH_PFC_PIN_GROUP(vin5_sync_a), 4099 4072 SH_PFC_PIN_GROUP(vin5_field_a), 4100 4073 SH_PFC_PIN_GROUP(vin5_clkenb_a), ··· 4545 4516 "vin4_data18_b", 4546 4517 "vin4_data20_b", 4547 4518 "vin4_data24_b", 4519 + "vin4_g8", 4548 4520 "vin4_sync", 4549 4521 "vin4_field", 4550 4522 "vin4_clkenb", ··· 4558 4528 "vin5_data12_a", 4559 4529 "vin5_data16_a", 4560 4530 "vin5_data8_b", 4531 + "vin5_high8", 4561 4532 "vin5_sync_a", 4562 4533 "vin5_field_a", 4563 4534 "vin5_clkenb_a",
-1
drivers/pinctrl/renesas/pfc-r8a77995.c
··· 14 14 #include <linux/errno.h> 15 15 #include <linux/kernel.h> 16 16 17 - #include "core.h" 18 17 #include "sh_pfc.h" 19 18 20 19 #define CPU_ALL_GP(fn, sfx) \
-1
drivers/pinctrl/renesas/pfc-r8a779a0.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/kernel.h> 13 13 14 - #include "core.h" 15 14 #include "sh_pfc.h" 16 15 17 16 #define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN)
+5 -41
drivers/pinctrl/renesas/pfc-sh73a0.c
··· 13 13 #include <linux/regulator/machine.h> 14 14 #include <linux/slab.h> 15 15 16 - #include "core.h" 17 16 #include "sh_pfc.h" 18 17 19 18 #define CPU_ALL_PORT(fn, pfx, sfx) \ ··· 4309 4310 * Pin bias 4310 4311 */ 4311 4312 4312 - #define PORTnCR_PULMD_OFF (0 << 6) 4313 - #define PORTnCR_PULMD_DOWN (2 << 6) 4314 - #define PORTnCR_PULMD_UP (3 << 6) 4315 - #define PORTnCR_PULMD_MASK (3 << 6) 4316 - 4317 4313 static const unsigned int sh73a0_portcr_offsets[] = { 4318 4314 0x00000000, 0x00001000, 0x00001000, 0x00002000, 0x00002000, 4319 4315 0x00002000, 0x00002000, 0x00003000, 0x00003000, 0x00002000, 4320 4316 }; 4321 4317 4322 - static unsigned int sh73a0_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin) 4318 + static void __iomem *sh73a0_pin_to_portcr(struct sh_pfc *pfc, unsigned int pin) 4323 4319 { 4324 - void __iomem *addr = pfc->windows->virt 4325 - + sh73a0_portcr_offsets[pin >> 5] + pin; 4326 - u32 value = ioread8(addr) & PORTnCR_PULMD_MASK; 4327 - 4328 - switch (value) { 4329 - case PORTnCR_PULMD_UP: 4330 - return PIN_CONFIG_BIAS_PULL_UP; 4331 - case PORTnCR_PULMD_DOWN: 4332 - return PIN_CONFIG_BIAS_PULL_DOWN; 4333 - case PORTnCR_PULMD_OFF: 4334 - default: 4335 - return PIN_CONFIG_BIAS_DISABLE; 4336 - } 4337 - } 4338 - 4339 - static void sh73a0_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 4340 - unsigned int bias) 4341 - { 4342 - void __iomem *addr = pfc->windows->virt 4343 - + sh73a0_portcr_offsets[pin >> 5] + pin; 4344 - u32 value = ioread8(addr) & ~PORTnCR_PULMD_MASK; 4345 - 4346 - switch (bias) { 4347 - case PIN_CONFIG_BIAS_PULL_UP: 4348 - value |= PORTnCR_PULMD_UP; 4349 - break; 4350 - case PIN_CONFIG_BIAS_PULL_DOWN: 4351 - value |= PORTnCR_PULMD_DOWN; 4352 - break; 4353 - } 4354 - 4355 - iowrite8(value, addr); 4320 + return pfc->windows->virt + sh73a0_portcr_offsets[pin >> 5] + pin; 4356 4321 } 4357 4322 4358 4323 /* ----------------------------------------------------------------------------- ··· 4346 4383 4347 4384 static const struct sh_pfc_soc_operations sh73a0_pfc_ops = { 4348 4385 .init = sh73a0_pinmux_soc_init, 4349 - .get_bias = sh73a0_pinmux_get_bias, 4350 - .set_bias = sh73a0_pinmux_set_bias, 4386 + .get_bias = rmobile_pinmux_get_bias, 4387 + .set_bias = rmobile_pinmux_set_bias, 4388 + .pin_to_portcr = sh73a0_pin_to_portcr, 4351 4389 }; 4352 4390 4353 4391 const struct sh_pfc_soc_info sh73a0_pinmux_info = {
+92 -17
drivers/pinctrl/renesas/pinctrl.c
··· 10 10 #include <linux/device.h> 11 11 #include <linux/err.h> 12 12 #include <linux/init.h> 13 + #include <linux/io.h> 13 14 #include <linux/module.h> 14 15 #include <linux/of.h> 15 16 #include <linux/pinctrl/consumer.h> ··· 841 840 return pinctrl_enable(pmx->pctl); 842 841 } 843 842 843 + static const struct pinmux_bias_reg * 844 + rcar_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin, 845 + unsigned int *bit) 846 + { 847 + unsigned int i, j; 848 + 849 + for (i = 0; pfc->info->bias_regs[i].puen || pfc->info->bias_regs[i].pud; i++) { 850 + for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) { 851 + if (pfc->info->bias_regs[i].pins[j] == pin) { 852 + *bit = j; 853 + return &pfc->info->bias_regs[i]; 854 + } 855 + } 856 + } 857 + 858 + WARN_ONCE(1, "Pin %u is not in bias info list\n", pin); 859 + 860 + return NULL; 861 + } 862 + 844 863 unsigned int rcar_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin) 845 864 { 846 865 const struct pinmux_bias_reg *reg; 847 866 unsigned int bit; 848 867 849 - reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 868 + reg = rcar_pin_to_bias_reg(pfc, pin, &bit); 850 869 if (!reg) 851 870 return PIN_CONFIG_BIAS_DISABLE; 852 871 853 - if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit))) 854 - return PIN_CONFIG_BIAS_DISABLE; 855 - else if (!reg->pud || (sh_pfc_read(pfc, reg->pud) & BIT(bit))) 856 - return PIN_CONFIG_BIAS_PULL_UP; 857 - else 858 - return PIN_CONFIG_BIAS_PULL_DOWN; 872 + if (reg->puen) { 873 + if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit))) 874 + return PIN_CONFIG_BIAS_DISABLE; 875 + else if (!reg->pud || (sh_pfc_read(pfc, reg->pud) & BIT(bit))) 876 + return PIN_CONFIG_BIAS_PULL_UP; 877 + else 878 + return PIN_CONFIG_BIAS_PULL_DOWN; 879 + } else { 880 + if (sh_pfc_read(pfc, reg->pud) & BIT(bit)) 881 + return PIN_CONFIG_BIAS_PULL_DOWN; 882 + else 883 + return PIN_CONFIG_BIAS_DISABLE; 884 + } 859 885 } 860 886 861 887 void rcar_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, ··· 892 864 u32 enable, updown; 893 865 unsigned int bit; 894 866 895 - reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit); 867 + reg = rcar_pin_to_bias_reg(pfc, pin, &bit); 896 868 if (!reg) 897 869 return; 898 870 899 - enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit); 900 - if (bias != PIN_CONFIG_BIAS_DISABLE) 901 - enable |= BIT(bit); 871 + if (reg->puen) { 872 + enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit); 873 + if (bias != PIN_CONFIG_BIAS_DISABLE) 874 + enable |= BIT(bit); 902 875 903 - if (reg->pud) { 904 - updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit); 905 - if (bias == PIN_CONFIG_BIAS_PULL_UP) 906 - updown |= BIT(bit); 876 + if (reg->pud) { 877 + updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit); 878 + if (bias == PIN_CONFIG_BIAS_PULL_UP) 879 + updown |= BIT(bit); 907 880 908 - sh_pfc_write(pfc, reg->pud, updown); 881 + sh_pfc_write(pfc, reg->pud, updown); 882 + } 883 + 884 + sh_pfc_write(pfc, reg->puen, enable); 885 + } else { 886 + enable = sh_pfc_read(pfc, reg->pud) & ~BIT(bit); 887 + if (bias == PIN_CONFIG_BIAS_PULL_DOWN) 888 + enable |= BIT(bit); 889 + 890 + sh_pfc_write(pfc, reg->pud, enable); 891 + } 892 + } 893 + 894 + #define PORTnCR_PULMD_OFF (0 << 6) 895 + #define PORTnCR_PULMD_DOWN (2 << 6) 896 + #define PORTnCR_PULMD_UP (3 << 6) 897 + #define PORTnCR_PULMD_MASK (3 << 6) 898 + 899 + unsigned int rmobile_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin) 900 + { 901 + void __iomem *reg = pfc->info->ops->pin_to_portcr(pfc, pin); 902 + u32 value = ioread8(reg) & PORTnCR_PULMD_MASK; 903 + 904 + switch (value) { 905 + case PORTnCR_PULMD_UP: 906 + return PIN_CONFIG_BIAS_PULL_UP; 907 + case PORTnCR_PULMD_DOWN: 908 + return PIN_CONFIG_BIAS_PULL_DOWN; 909 + case PORTnCR_PULMD_OFF: 910 + default: 911 + return PIN_CONFIG_BIAS_DISABLE; 912 + } 913 + } 914 + 915 + void rmobile_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 916 + unsigned int bias) 917 + { 918 + void __iomem *reg = pfc->info->ops->pin_to_portcr(pfc, pin); 919 + u32 value = ioread8(reg) & ~PORTnCR_PULMD_MASK; 920 + 921 + switch (bias) { 922 + case PIN_CONFIG_BIAS_PULL_UP: 923 + value |= PORTnCR_PULMD_UP; 924 + break; 925 + case PIN_CONFIG_BIAS_PULL_DOWN: 926 + value |= PORTnCR_PULMD_DOWN; 927 + break; 909 928 } 910 929 911 - sh_pfc_write(pfc, reg->puen, enable); 930 + iowrite8(value, reg); 912 931 }
+20 -4
drivers/pinctrl/renesas/sh_pfc.h
··· 188 188 .reg = r, \ 189 189 .fields = 190 190 191 - struct pinmux_bias_reg { 191 + struct pinmux_bias_reg { /* At least one of puen/pud must exist */ 192 192 u32 puen; /* Pull-enable or pull-up control register */ 193 - u32 pud; /* Pull-up/down control register (optional) */ 193 + u32 pud; /* Pull-up/down or pull-down control register */ 194 194 const u16 pins[32]; 195 195 }; 196 196 ··· 273 273 void (*set_bias)(struct sh_pfc *pfc, unsigned int pin, 274 274 unsigned int bias); 275 275 int (*pin_to_pocctrl)(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl); 276 + void __iomem * (*pin_to_portcr)(struct sh_pfc *pfc, unsigned int pin); 276 277 }; 277 278 278 279 struct sh_pfc_soc_info { ··· 479 478 PORT_GP_CFG_1(bank, 5, fn, sfx, cfg) 480 479 #define PORT_GP_6(bank, fn, sfx) PORT_GP_CFG_6(bank, fn, sfx, 0) 481 480 482 - #define PORT_GP_CFG_8(bank, fn, sfx, cfg) \ 481 + #define PORT_GP_CFG_7(bank, fn, sfx, cfg) \ 483 482 PORT_GP_CFG_6(bank, fn, sfx, cfg), \ 484 - PORT_GP_CFG_1(bank, 6, fn, sfx, cfg), \ 483 + PORT_GP_CFG_1(bank, 6, fn, sfx, cfg) 484 + #define PORT_GP_7(bank, fn, sfx) PORT_GP_CFG_7(bank, fn, sfx, 0) 485 + 486 + #define PORT_GP_CFG_8(bank, fn, sfx, cfg) \ 487 + PORT_GP_CFG_7(bank, fn, sfx, cfg), \ 485 488 PORT_GP_CFG_1(bank, 7, fn, sfx, cfg) 486 489 #define PORT_GP_8(bank, fn, sfx) PORT_GP_CFG_8(bank, fn, sfx, 0) 487 490 ··· 777 772 * GPIO number helper macro for R-Car 778 773 */ 779 774 #define RCAR_GP_PIN(bank, pin) (((bank) * 32) + (pin)) 775 + 776 + /* 777 + * Bias helpers 778 + */ 779 + unsigned int rcar_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin); 780 + void rcar_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 781 + unsigned int bias); 782 + 783 + unsigned int rmobile_pinmux_get_bias(struct sh_pfc *pfc, unsigned int pin); 784 + void rmobile_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 785 + unsigned int bias); 780 786 781 787 #endif /* __SH_PFC_H */
+5 -5
drivers/pinctrl/samsung/pinctrl-exynos.c
··· 55 55 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 56 56 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 57 57 unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset; 58 - unsigned long mask; 58 + unsigned int mask; 59 59 unsigned long flags; 60 60 61 61 raw_spin_lock_irqsave(&bank->slock, flags); ··· 83 83 struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 84 84 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 85 85 unsigned long reg_mask = our_chip->eint_mask + bank->eint_offset; 86 - unsigned long mask; 86 + unsigned int mask; 87 87 unsigned long flags; 88 88 89 89 /* ··· 483 483 chained_irq_exit(chip, desc); 484 484 } 485 485 486 - static inline void exynos_irq_demux_eint(unsigned long pend, 486 + static inline void exynos_irq_demux_eint(unsigned int pend, 487 487 struct irq_domain *domain) 488 488 { 489 489 unsigned int irq; ··· 500 500 { 501 501 struct irq_chip *chip = irq_desc_get_chip(desc); 502 502 struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc); 503 - unsigned long pend; 504 - unsigned long mask; 503 + unsigned int pend; 504 + unsigned int mask; 505 505 int i; 506 506 507 507 chained_irq_enter(chip, desc);
+8 -10
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 531 531 break; 532 532 } 533 533 534 + dev_err(pctl->dev, "invalid function %d on pin %d .\n", fnum, pin_num); 535 + 534 536 return false; 535 537 } 536 538 ··· 547 545 (*map)[*num_maps].type = PIN_MAP_TYPE_MUX_GROUP; 548 546 (*map)[*num_maps].data.mux.group = grp->name; 549 547 550 - if (!stm32_pctrl_is_function_valid(pctl, pin, fnum)) { 551 - dev_err(pctl->dev, "invalid function %d on pin %d .\n", 552 - fnum, pin); 548 + if (!stm32_pctrl_is_function_valid(pctl, pin, fnum)) 553 549 return -EINVAL; 554 - } 555 550 556 551 (*map)[*num_maps].data.mux.function = stm32_gpio_functions[fnum]; 557 552 (*num_maps)++; ··· 619 620 func = STM32_GET_PIN_FUNC(pinfunc); 620 621 621 622 if (!stm32_pctrl_is_function_valid(pctl, pin, func)) { 622 - dev_err(pctl->dev, "invalid function.\n"); 623 623 err = -EINVAL; 624 624 goto exit; 625 625 } ··· 819 821 int pin; 820 822 821 823 ret = stm32_pctrl_is_function_valid(pctl, g->pin, function); 822 - if (!ret) { 823 - dev_err(pctl->dev, "invalid function %d on group %d .\n", 824 - function, group); 824 + if (!ret) 825 825 return -EINVAL; 826 - } 827 826 828 827 range = pinctrl_find_gpio_range_from_pin(pctldev, g->pin); 829 828 if (!range) { ··· 1537 1542 if (of_property_read_bool(child, "gpio-controller")) { 1538 1543 bank->rstc = of_reset_control_get_exclusive(child, 1539 1544 NULL); 1540 - if (PTR_ERR(bank->rstc) == -EPROBE_DEFER) 1545 + if (PTR_ERR(bank->rstc) == -EPROBE_DEFER) { 1546 + of_node_put(child); 1541 1547 return -EPROBE_DEFER; 1548 + } 1542 1549 1543 1550 bank->clk = of_clk_get_by_name(child, NULL); 1544 1551 if (IS_ERR(bank->clk)) { ··· 1548 1551 dev_err(dev, 1549 1552 "failed to get clk (%ld)\n", 1550 1553 PTR_ERR(bank->clk)); 1554 + of_node_put(child); 1551 1555 return PTR_ERR(bank->clk); 1552 1556 } 1553 1557 i++;
+5 -2
drivers/pinctrl/ti/pinctrl-ti-iodelay.c
··· 511 511 } 512 512 513 513 pins = devm_kcalloc(iod->dev, rows, sizeof(*pins), GFP_KERNEL); 514 - if (!pins) 514 + if (!pins) { 515 + error = -ENOMEM; 515 516 goto free_group; 517 + } 516 518 517 519 cfg = devm_kcalloc(iod->dev, rows, sizeof(*cfg), GFP_KERNEL); 518 520 if (!cfg) { ··· 869 867 goto exit_out; 870 868 } 871 869 872 - if (ti_iodelay_pinconf_init_dev(iod)) 870 + ret = ti_iodelay_pinconf_init_dev(iod); 871 + if (ret) 873 872 goto exit_out; 874 873 875 874 ret = ti_iodelay_alloc_pins(dev, iod, res->start);
+2 -2
drivers/soc/tegra/pmc.c
··· 1904 1904 arg = ret; 1905 1905 break; 1906 1906 1907 - case PIN_CONFIG_LOW_POWER_MODE: 1907 + case PIN_CONFIG_MODE_LOW_POWER: 1908 1908 ret = tegra_io_pad_is_powered(pmc, pad->id); 1909 1909 if (ret < 0) 1910 1910 return ret; ··· 1941 1941 arg = pinconf_to_config_argument(configs[i]); 1942 1942 1943 1943 switch (param) { 1944 - case PIN_CONFIG_LOW_POWER_MODE: 1944 + case PIN_CONFIG_MODE_LOW_POWER: 1945 1945 if (arg) 1946 1946 err = tegra_io_pad_power_disable(pad->id); 1947 1947 else
+962
include/dt-bindings/pinctrl/mt8195-pinfunc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2020 MediaTek Inc. 4 + * Author: Zhiyong Tao <zhiyong.tao@mediatek.com> 5 + */ 6 + 7 + #ifndef __MT8195_PINFUNC_H 8 + #define __MT8195_PINFUNC_H 9 + 10 + #include "mt65xx.h" 11 + 12 + #define PINMUX_GPIO0__FUNC_GPIO0 (MTK_PIN_NO(0) | 0) 13 + #define PINMUX_GPIO0__FUNC_TP_GPIO0_AO (MTK_PIN_NO(0) | 1) 14 + #define PINMUX_GPIO0__FUNC_MSDC2_CMD (MTK_PIN_NO(0) | 2) 15 + #define PINMUX_GPIO0__FUNC_TDMIN_MCK (MTK_PIN_NO(0) | 3) 16 + #define PINMUX_GPIO0__FUNC_CLKM0 (MTK_PIN_NO(0) | 4) 17 + #define PINMUX_GPIO0__FUNC_PERSTN_1 (MTK_PIN_NO(0) | 5) 18 + #define PINMUX_GPIO0__FUNC_IDDIG_1P (MTK_PIN_NO(0) | 6) 19 + #define PINMUX_GPIO0__FUNC_DMIC4_CLK (MTK_PIN_NO(0) | 7) 20 + 21 + #define PINMUX_GPIO1__FUNC_GPIO1 (MTK_PIN_NO(1) | 0) 22 + #define PINMUX_GPIO1__FUNC_TP_GPIO1_AO (MTK_PIN_NO(1) | 1) 23 + #define PINMUX_GPIO1__FUNC_MSDC2_CLK (MTK_PIN_NO(1) | 2) 24 + #define PINMUX_GPIO1__FUNC_TDMIN_DI (MTK_PIN_NO(1) | 3) 25 + #define PINMUX_GPIO1__FUNC_CLKM1 (MTK_PIN_NO(1) | 4) 26 + #define PINMUX_GPIO1__FUNC_CLKREQN_1 (MTK_PIN_NO(1) | 5) 27 + #define PINMUX_GPIO1__FUNC_USB_DRVVBUS_1P (MTK_PIN_NO(1) | 6) 28 + #define PINMUX_GPIO1__FUNC_DMIC4_DAT (MTK_PIN_NO(1) | 7) 29 + 30 + #define PINMUX_GPIO2__FUNC_GPIO2 (MTK_PIN_NO(2) | 0) 31 + #define PINMUX_GPIO2__FUNC_TP_GPIO2_AO (MTK_PIN_NO(2) | 1) 32 + #define PINMUX_GPIO2__FUNC_MSDC2_DAT3 (MTK_PIN_NO(2) | 2) 33 + #define PINMUX_GPIO2__FUNC_TDMIN_LRCK (MTK_PIN_NO(2) | 3) 34 + #define PINMUX_GPIO2__FUNC_CLKM2 (MTK_PIN_NO(2) | 4) 35 + #define PINMUX_GPIO2__FUNC_WAKEN_1 (MTK_PIN_NO(2) | 5) 36 + #define PINMUX_GPIO2__FUNC_DMIC2_CLK (MTK_PIN_NO(2) | 7) 37 + 38 + #define PINMUX_GPIO3__FUNC_GPIO3 (MTK_PIN_NO(3) | 0) 39 + #define PINMUX_GPIO3__FUNC_TP_GPIO3_AO (MTK_PIN_NO(3) | 1) 40 + #define PINMUX_GPIO3__FUNC_MSDC2_DAT0 (MTK_PIN_NO(3) | 2) 41 + #define PINMUX_GPIO3__FUNC_TDMIN_BCK (MTK_PIN_NO(3) | 3) 42 + #define PINMUX_GPIO3__FUNC_CLKM3 (MTK_PIN_NO(3) | 4) 43 + #define PINMUX_GPIO3__FUNC_DMIC2_DAT (MTK_PIN_NO(3) | 7) 44 + 45 + #define PINMUX_GPIO4__FUNC_GPIO4 (MTK_PIN_NO(4) | 0) 46 + #define PINMUX_GPIO4__FUNC_TP_GPIO4_AO (MTK_PIN_NO(4) | 1) 47 + #define PINMUX_GPIO4__FUNC_MSDC2_DAT2 (MTK_PIN_NO(4) | 2) 48 + #define PINMUX_GPIO4__FUNC_SPDIF_IN1 (MTK_PIN_NO(4) | 3) 49 + #define PINMUX_GPIO4__FUNC_UTXD3 (MTK_PIN_NO(4) | 4) 50 + #define PINMUX_GPIO4__FUNC_SDA2 (MTK_PIN_NO(4) | 5) 51 + #define PINMUX_GPIO4__FUNC_IDDIG_2P (MTK_PIN_NO(4) | 7) 52 + 53 + #define PINMUX_GPIO5__FUNC_GPIO5 (MTK_PIN_NO(5) | 0) 54 + #define PINMUX_GPIO5__FUNC_TP_GPIO5_AO (MTK_PIN_NO(5) | 1) 55 + #define PINMUX_GPIO5__FUNC_MSDC2_DAT1 (MTK_PIN_NO(5) | 2) 56 + #define PINMUX_GPIO5__FUNC_SPDIF_IN0 (MTK_PIN_NO(5) | 3) 57 + #define PINMUX_GPIO5__FUNC_URXD3 (MTK_PIN_NO(5) | 4) 58 + #define PINMUX_GPIO5__FUNC_SCL2 (MTK_PIN_NO(5) | 5) 59 + #define PINMUX_GPIO5__FUNC_USB_DRVVBUS_2P (MTK_PIN_NO(5) | 7) 60 + 61 + #define PINMUX_GPIO6__FUNC_GPIO6 (MTK_PIN_NO(6) | 0) 62 + #define PINMUX_GPIO6__FUNC_TP_GPIO6_AO (MTK_PIN_NO(6) | 1) 63 + #define PINMUX_GPIO6__FUNC_DP_TX_HPD (MTK_PIN_NO(6) | 2) 64 + #define PINMUX_GPIO6__FUNC_I2SO1_D4 (MTK_PIN_NO(6) | 3) 65 + #define PINMUX_GPIO6__FUNC_UTXD4 (MTK_PIN_NO(6) | 4) 66 + #define PINMUX_GPIO6__FUNC_CMVREF3 (MTK_PIN_NO(6) | 5) 67 + #define PINMUX_GPIO6__FUNC_DMIC3_CLK (MTK_PIN_NO(6) | 7) 68 + 69 + #define PINMUX_GPIO7__FUNC_GPIO7 (MTK_PIN_NO(7) | 0) 70 + #define PINMUX_GPIO7__FUNC_TP_GPIO7_AO (MTK_PIN_NO(7) | 1) 71 + #define PINMUX_GPIO7__FUNC_EDP_TX_HPD (MTK_PIN_NO(7) | 2) 72 + #define PINMUX_GPIO7__FUNC_I2SO1_D5 (MTK_PIN_NO(7) | 3) 73 + #define PINMUX_GPIO7__FUNC_URXD4 (MTK_PIN_NO(7) | 4) 74 + #define PINMUX_GPIO7__FUNC_CMVREF4 (MTK_PIN_NO(7) | 5) 75 + #define PINMUX_GPIO7__FUNC_DMIC3_DAT (MTK_PIN_NO(7) | 7) 76 + 77 + #define PINMUX_GPIO8__FUNC_GPIO8 (MTK_PIN_NO(8) | 0) 78 + #define PINMUX_GPIO8__FUNC_SDA0 (MTK_PIN_NO(8) | 1) 79 + #define PINMUX_GPIO8__FUNC_PWM_0 (MTK_PIN_NO(8) | 2) 80 + #define PINMUX_GPIO8__FUNC_SPDIF_OUT (MTK_PIN_NO(8) | 4) 81 + #define PINMUX_GPIO8__FUNC_LVTS_FOUT (MTK_PIN_NO(8) | 6) 82 + #define PINMUX_GPIO8__FUNC_DBG_MON_A0 (MTK_PIN_NO(8) | 7) 83 + 84 + #define PINMUX_GPIO9__FUNC_GPIO9 (MTK_PIN_NO(9) | 0) 85 + #define PINMUX_GPIO9__FUNC_SCL0 (MTK_PIN_NO(9) | 1) 86 + #define PINMUX_GPIO9__FUNC_PWM_1 (MTK_PIN_NO(9) | 2) 87 + #define PINMUX_GPIO9__FUNC_IR_IN (MTK_PIN_NO(9) | 4) 88 + #define PINMUX_GPIO9__FUNC_LVTS_SDO (MTK_PIN_NO(9) | 6) 89 + #define PINMUX_GPIO9__FUNC_DBG_MON_A1 (MTK_PIN_NO(9) | 7) 90 + 91 + #define PINMUX_GPIO10__FUNC_GPIO10 (MTK_PIN_NO(10) | 0) 92 + #define PINMUX_GPIO10__FUNC_SDA1 (MTK_PIN_NO(10) | 1) 93 + #define PINMUX_GPIO10__FUNC_PWM_2 (MTK_PIN_NO(10) | 2) 94 + #define PINMUX_GPIO10__FUNC_ADSP_URXD0 (MTK_PIN_NO(10) | 3) 95 + #define PINMUX_GPIO10__FUNC_SPDIF_IN1 (MTK_PIN_NO(10) | 4) 96 + #define PINMUX_GPIO10__FUNC_LVTS_SCF (MTK_PIN_NO(10) | 6) 97 + #define PINMUX_GPIO10__FUNC_DBG_MON_A2 (MTK_PIN_NO(10) | 7) 98 + 99 + #define PINMUX_GPIO11__FUNC_GPIO11 (MTK_PIN_NO(11) | 0) 100 + #define PINMUX_GPIO11__FUNC_SCL1 (MTK_PIN_NO(11) | 1) 101 + #define PINMUX_GPIO11__FUNC_PWM_3 (MTK_PIN_NO(11) | 2) 102 + #define PINMUX_GPIO11__FUNC_ADSP_UTXD0 (MTK_PIN_NO(11) | 3) 103 + #define PINMUX_GPIO11__FUNC_SPDIF_IN0 (MTK_PIN_NO(11) | 4) 104 + #define PINMUX_GPIO11__FUNC_LVTS_SCK (MTK_PIN_NO(11) | 6) 105 + #define PINMUX_GPIO11__FUNC_DBG_MON_A3 (MTK_PIN_NO(11) | 7) 106 + 107 + #define PINMUX_GPIO12__FUNC_GPIO12 (MTK_PIN_NO(12) | 0) 108 + #define PINMUX_GPIO12__FUNC_SDA2 (MTK_PIN_NO(12) | 1) 109 + #define PINMUX_GPIO12__FUNC_DMIC3_DAT_R (MTK_PIN_NO(12) | 2) 110 + #define PINMUX_GPIO12__FUNC_I2SO1_D6 (MTK_PIN_NO(12) | 3) 111 + #define PINMUX_GPIO12__FUNC_LVTS_SDI (MTK_PIN_NO(12) | 6) 112 + #define PINMUX_GPIO12__FUNC_DBG_MON_A4 (MTK_PIN_NO(12) | 7) 113 + 114 + #define PINMUX_GPIO13__FUNC_GPIO13 (MTK_PIN_NO(13) | 0) 115 + #define PINMUX_GPIO13__FUNC_SCL2 (MTK_PIN_NO(13) | 1) 116 + #define PINMUX_GPIO13__FUNC_DMIC4_DAT_R (MTK_PIN_NO(13) | 2) 117 + #define PINMUX_GPIO13__FUNC_I2SO1_D7 (MTK_PIN_NO(13) | 3) 118 + #define PINMUX_GPIO13__FUNC_DBG_MON_A5 (MTK_PIN_NO(13) | 7) 119 + 120 + #define PINMUX_GPIO14__FUNC_GPIO14 (MTK_PIN_NO(14) | 0) 121 + #define PINMUX_GPIO14__FUNC_SDA3 (MTK_PIN_NO(14) | 1) 122 + #define PINMUX_GPIO14__FUNC_DMIC3_DAT (MTK_PIN_NO(14) | 2) 123 + #define PINMUX_GPIO14__FUNC_TDMIN_MCK (MTK_PIN_NO(14) | 3) 124 + #define PINMUX_GPIO14__FUNC_DBG_MON_A6 (MTK_PIN_NO(14) | 7) 125 + 126 + #define PINMUX_GPIO15__FUNC_GPIO15 (MTK_PIN_NO(15) | 0) 127 + #define PINMUX_GPIO15__FUNC_SCL3 (MTK_PIN_NO(15) | 1) 128 + #define PINMUX_GPIO15__FUNC_DMIC3_CLK (MTK_PIN_NO(15) | 2) 129 + #define PINMUX_GPIO15__FUNC_TDMIN_DI (MTK_PIN_NO(15) | 3) 130 + #define PINMUX_GPIO15__FUNC_DBG_MON_A7 (MTK_PIN_NO(15) | 7) 131 + 132 + #define PINMUX_GPIO16__FUNC_GPIO16 (MTK_PIN_NO(16) | 0) 133 + #define PINMUX_GPIO16__FUNC_SDA4 (MTK_PIN_NO(16) | 1) 134 + #define PINMUX_GPIO16__FUNC_DMIC4_DAT (MTK_PIN_NO(16) | 2) 135 + #define PINMUX_GPIO16__FUNC_TDMIN_LRCK (MTK_PIN_NO(16) | 3) 136 + #define PINMUX_GPIO16__FUNC_DBG_MON_A8 (MTK_PIN_NO(16) | 7) 137 + 138 + #define PINMUX_GPIO17__FUNC_GPIO17 (MTK_PIN_NO(17) | 0) 139 + #define PINMUX_GPIO17__FUNC_SCL4 (MTK_PIN_NO(17) | 1) 140 + #define PINMUX_GPIO17__FUNC_DMIC4_CLK (MTK_PIN_NO(17) | 2) 141 + #define PINMUX_GPIO17__FUNC_TDMIN_BCK (MTK_PIN_NO(17) | 3) 142 + #define PINMUX_GPIO17__FUNC_DBG_MON_A9 (MTK_PIN_NO(17) | 7) 143 + 144 + #define PINMUX_GPIO18__FUNC_GPIO18 (MTK_PIN_NO(18) | 0) 145 + #define PINMUX_GPIO18__FUNC_DP_TX_HPD (MTK_PIN_NO(18) | 1) 146 + 147 + #define PINMUX_GPIO19__FUNC_GPIO19 (MTK_PIN_NO(19) | 0) 148 + #define PINMUX_GPIO19__FUNC_WAKEN (MTK_PIN_NO(19) | 1) 149 + #define PINMUX_GPIO19__FUNC_SCP_SDA1 (MTK_PIN_NO(19) | 2) 150 + #define PINMUX_GPIO19__FUNC_MD32_0_JTAG_TCK (MTK_PIN_NO(19) | 3) 151 + #define PINMUX_GPIO19__FUNC_ADSP_JTAG0_TCK (MTK_PIN_NO(19) | 4) 152 + #define PINMUX_GPIO19__FUNC_SDA6 (MTK_PIN_NO(19) | 5) 153 + 154 + #define PINMUX_GPIO20__FUNC_GPIO20 (MTK_PIN_NO(20) | 0) 155 + #define PINMUX_GPIO20__FUNC_PERSTN (MTK_PIN_NO(20) | 1) 156 + #define PINMUX_GPIO20__FUNC_SCP_SCL1 (MTK_PIN_NO(20) | 2) 157 + #define PINMUX_GPIO20__FUNC_MD32_0_JTAG_TMS (MTK_PIN_NO(20) | 3) 158 + #define PINMUX_GPIO20__FUNC_ADSP_JTAG0_TMS (MTK_PIN_NO(20) | 4) 159 + #define PINMUX_GPIO20__FUNC_SCL6 (MTK_PIN_NO(20) | 5) 160 + 161 + #define PINMUX_GPIO21__FUNC_GPIO21 (MTK_PIN_NO(21) | 0) 162 + #define PINMUX_GPIO21__FUNC_CLKREQN (MTK_PIN_NO(21) | 1) 163 + #define PINMUX_GPIO21__FUNC_MD32_0_JTAG_TDI (MTK_PIN_NO(21) | 3) 164 + #define PINMUX_GPIO21__FUNC_ADSP_JTAG0_TDI (MTK_PIN_NO(21) | 4) 165 + #define PINMUX_GPIO21__FUNC_SCP_SDA1 (MTK_PIN_NO(21) | 5) 166 + 167 + #define PINMUX_GPIO22__FUNC_GPIO22 (MTK_PIN_NO(22) | 0) 168 + #define PINMUX_GPIO22__FUNC_CMMCLK0 (MTK_PIN_NO(22) | 1) 169 + #define PINMUX_GPIO22__FUNC_PERSTN_1 (MTK_PIN_NO(22) | 2) 170 + #define PINMUX_GPIO22__FUNC_SCP_SCL1 (MTK_PIN_NO(22) | 5) 171 + #define PINMUX_GPIO22__FUNC_MD32_0_GPIO0 (MTK_PIN_NO(22) | 7) 172 + 173 + #define PINMUX_GPIO23__FUNC_GPIO23 (MTK_PIN_NO(23) | 0) 174 + #define PINMUX_GPIO23__FUNC_CMMCLK1 (MTK_PIN_NO(23) | 1) 175 + #define PINMUX_GPIO23__FUNC_CLKREQN_1 (MTK_PIN_NO(23) | 2) 176 + #define PINMUX_GPIO23__FUNC_SDA4 (MTK_PIN_NO(23) | 3) 177 + #define PINMUX_GPIO23__FUNC_DMIC1_CLK (MTK_PIN_NO(23) | 4) 178 + #define PINMUX_GPIO23__FUNC_SCP_SDA0 (MTK_PIN_NO(23) | 5) 179 + #define PINMUX_GPIO23__FUNC_MD32_0_GPIO1 (MTK_PIN_NO(23) | 7) 180 + 181 + #define PINMUX_GPIO24__FUNC_GPIO24 (MTK_PIN_NO(24) | 0) 182 + #define PINMUX_GPIO24__FUNC_CMMCLK2 (MTK_PIN_NO(24) | 1) 183 + #define PINMUX_GPIO24__FUNC_WAKEN_1 (MTK_PIN_NO(24) | 2) 184 + #define PINMUX_GPIO24__FUNC_SCL4 (MTK_PIN_NO(24) | 3) 185 + #define PINMUX_GPIO24__FUNC_DMIC1_DAT (MTK_PIN_NO(24) | 4) 186 + #define PINMUX_GPIO24__FUNC_SCP_SCL0 (MTK_PIN_NO(24) | 5) 187 + #define PINMUX_GPIO24__FUNC_LVTS_26M (MTK_PIN_NO(24) | 6) 188 + #define PINMUX_GPIO24__FUNC_MD32_0_GPIO2 (MTK_PIN_NO(24) | 7) 189 + 190 + #define PINMUX_GPIO25__FUNC_GPIO25 (MTK_PIN_NO(25) | 0) 191 + #define PINMUX_GPIO25__FUNC_CMMRST (MTK_PIN_NO(25) | 1) 192 + #define PINMUX_GPIO25__FUNC_CMMCLK3 (MTK_PIN_NO(25) | 2) 193 + #define PINMUX_GPIO25__FUNC_SPDIF_OUT (MTK_PIN_NO(25) | 3) 194 + #define PINMUX_GPIO25__FUNC_SDA6 (MTK_PIN_NO(25) | 4) 195 + #define PINMUX_GPIO25__FUNC_ADSP_JTAG0_TRSTN (MTK_PIN_NO(25) | 5) 196 + #define PINMUX_GPIO25__FUNC_MD32_0_JTAG_TRST (MTK_PIN_NO(25) | 6) 197 + 198 + #define PINMUX_GPIO26__FUNC_GPIO26 (MTK_PIN_NO(26) | 0) 199 + #define PINMUX_GPIO26__FUNC_CMMPDN (MTK_PIN_NO(26) | 1) 200 + #define PINMUX_GPIO26__FUNC_CMMCLK4 (MTK_PIN_NO(26) | 2) 201 + #define PINMUX_GPIO26__FUNC_IR_IN (MTK_PIN_NO(26) | 3) 202 + #define PINMUX_GPIO26__FUNC_SCL6 (MTK_PIN_NO(26) | 4) 203 + #define PINMUX_GPIO26__FUNC_ADSP_JTAG0_TDO (MTK_PIN_NO(26) | 5) 204 + #define PINMUX_GPIO26__FUNC_MD32_0_JTAG_TDO (MTK_PIN_NO(26) | 6) 205 + 206 + #define PINMUX_GPIO27__FUNC_GPIO27 (MTK_PIN_NO(27) | 0) 207 + #define PINMUX_GPIO27__FUNC_HDMIRX20_HTPLG (MTK_PIN_NO(27) | 1) 208 + #define PINMUX_GPIO27__FUNC_CMFLASH0 (MTK_PIN_NO(27) | 2) 209 + #define PINMUX_GPIO27__FUNC_MD32_0_TXD (MTK_PIN_NO(27) | 3) 210 + #define PINMUX_GPIO27__FUNC_TP_UTXD2_AO (MTK_PIN_NO(27) | 4) 211 + #define PINMUX_GPIO27__FUNC_SCL7 (MTK_PIN_NO(27) | 5) 212 + #define PINMUX_GPIO27__FUNC_UCTS2 (MTK_PIN_NO(27) | 6) 213 + #define PINMUX_GPIO27__FUNC_DBG_MON_A18 (MTK_PIN_NO(27) | 7) 214 + 215 + #define PINMUX_GPIO28__FUNC_GPIO28 (MTK_PIN_NO(28) | 0) 216 + #define PINMUX_GPIO28__FUNC_HDMIRX20_PWR5V (MTK_PIN_NO(28) | 1) 217 + #define PINMUX_GPIO28__FUNC_CMFLASH1 (MTK_PIN_NO(28) | 2) 218 + #define PINMUX_GPIO28__FUNC_MD32_0_RXD (MTK_PIN_NO(28) | 3) 219 + #define PINMUX_GPIO28__FUNC_TP_URXD2_AO (MTK_PIN_NO(28) | 4) 220 + #define PINMUX_GPIO28__FUNC_SDA7 (MTK_PIN_NO(28) | 5) 221 + #define PINMUX_GPIO28__FUNC_URTS2 (MTK_PIN_NO(28) | 6) 222 + #define PINMUX_GPIO28__FUNC_DBG_MON_A19 (MTK_PIN_NO(28) | 7) 223 + 224 + #define PINMUX_GPIO29__FUNC_GPIO29 (MTK_PIN_NO(29) | 0) 225 + #define PINMUX_GPIO29__FUNC_HDMIRX20_SCL (MTK_PIN_NO(29) | 1) 226 + #define PINMUX_GPIO29__FUNC_CMFLASH2 (MTK_PIN_NO(29) | 2) 227 + #define PINMUX_GPIO29__FUNC_SCL5 (MTK_PIN_NO(29) | 3) 228 + #define PINMUX_GPIO29__FUNC_TP_URTS2_AO (MTK_PIN_NO(29) | 4) 229 + #define PINMUX_GPIO29__FUNC_UTXD2 (MTK_PIN_NO(29) | 6) 230 + #define PINMUX_GPIO29__FUNC_DBG_MON_A20 (MTK_PIN_NO(29) | 7) 231 + 232 + #define PINMUX_GPIO30__FUNC_GPIO30 (MTK_PIN_NO(30) | 0) 233 + #define PINMUX_GPIO30__FUNC_HDMIRX20_SDA (MTK_PIN_NO(30) | 1) 234 + #define PINMUX_GPIO30__FUNC_CMFLASH3 (MTK_PIN_NO(30) | 2) 235 + #define PINMUX_GPIO30__FUNC_SDA5 (MTK_PIN_NO(30) | 3) 236 + #define PINMUX_GPIO30__FUNC_TP_UCTS2_AO (MTK_PIN_NO(30) | 4) 237 + #define PINMUX_GPIO30__FUNC_URXD2 (MTK_PIN_NO(30) | 6) 238 + #define PINMUX_GPIO30__FUNC_DBG_MON_A21 (MTK_PIN_NO(30) | 7) 239 + 240 + #define PINMUX_GPIO31__FUNC_GPIO31 (MTK_PIN_NO(31) | 0) 241 + #define PINMUX_GPIO31__FUNC_HDMITX20_PWR5V (MTK_PIN_NO(31) | 1) 242 + #define PINMUX_GPIO31__FUNC_DMIC1_DAT_R (MTK_PIN_NO(31) | 2) 243 + #define PINMUX_GPIO31__FUNC_PERSTN (MTK_PIN_NO(31) | 3) 244 + #define PINMUX_GPIO31__FUNC_DBG_MON_A22 (MTK_PIN_NO(31) | 7) 245 + 246 + #define PINMUX_GPIO32__FUNC_GPIO32 (MTK_PIN_NO(32) | 0) 247 + #define PINMUX_GPIO32__FUNC_HDMITX20_HTPLG (MTK_PIN_NO(32) | 1) 248 + #define PINMUX_GPIO32__FUNC_CLKREQN (MTK_PIN_NO(32) | 3) 249 + #define PINMUX_GPIO32__FUNC_DBG_MON_A23 (MTK_PIN_NO(32) | 7) 250 + 251 + #define PINMUX_GPIO33__FUNC_GPIO33 (MTK_PIN_NO(33) | 0) 252 + #define PINMUX_GPIO33__FUNC_HDMITX20_CEC (MTK_PIN_NO(33) | 1) 253 + #define PINMUX_GPIO33__FUNC_CMVREF0 (MTK_PIN_NO(33) | 2) 254 + #define PINMUX_GPIO33__FUNC_WAKEN (MTK_PIN_NO(33) | 3) 255 + 256 + #define PINMUX_GPIO34__FUNC_GPIO34 (MTK_PIN_NO(34) | 0) 257 + #define PINMUX_GPIO34__FUNC_HDMITX20_SCL (MTK_PIN_NO(34) | 1) 258 + #define PINMUX_GPIO34__FUNC_CMVREF1 (MTK_PIN_NO(34) | 2) 259 + #define PINMUX_GPIO34__FUNC_SCL7 (MTK_PIN_NO(34) | 3) 260 + #define PINMUX_GPIO34__FUNC_SCL6 (MTK_PIN_NO(34) | 4) 261 + #define PINMUX_GPIO34__FUNC_DBG_MON_A24 (MTK_PIN_NO(34) | 7) 262 + 263 + #define PINMUX_GPIO35__FUNC_GPIO35 (MTK_PIN_NO(35) | 0) 264 + #define PINMUX_GPIO35__FUNC_HDMITX20_SDA (MTK_PIN_NO(35) | 1) 265 + #define PINMUX_GPIO35__FUNC_CMVREF2 (MTK_PIN_NO(35) | 2) 266 + #define PINMUX_GPIO35__FUNC_SDA7 (MTK_PIN_NO(35) | 3) 267 + #define PINMUX_GPIO35__FUNC_SDA6 (MTK_PIN_NO(35) | 4) 268 + #define PINMUX_GPIO35__FUNC_DBG_MON_A25 (MTK_PIN_NO(35) | 7) 269 + 270 + #define PINMUX_GPIO36__FUNC_GPIO36 (MTK_PIN_NO(36) | 0) 271 + #define PINMUX_GPIO36__FUNC_RTC32K_CK (MTK_PIN_NO(36) | 1) 272 + #define PINMUX_GPIO36__FUNC_DBG_MON_A27 (MTK_PIN_NO(36) | 7) 273 + 274 + #define PINMUX_GPIO37__FUNC_GPIO37 (MTK_PIN_NO(37) | 0) 275 + #define PINMUX_GPIO37__FUNC_WATCHDOG (MTK_PIN_NO(37) | 1) 276 + #define PINMUX_GPIO37__FUNC_DBG_MON_A28 (MTK_PIN_NO(37) | 7) 277 + 278 + #define PINMUX_GPIO38__FUNC_GPIO38 (MTK_PIN_NO(38) | 0) 279 + #define PINMUX_GPIO38__FUNC_SRCLKENA0 (MTK_PIN_NO(38) | 1) 280 + #define PINMUX_GPIO38__FUNC_DBG_MON_A29 (MTK_PIN_NO(38) | 7) 281 + 282 + #define PINMUX_GPIO39__FUNC_GPIO39 (MTK_PIN_NO(39) | 0) 283 + #define PINMUX_GPIO39__FUNC_SRCLKENA1 (MTK_PIN_NO(39) | 1) 284 + #define PINMUX_GPIO39__FUNC_DMIC2_DAT_R (MTK_PIN_NO(39) | 2) 285 + #define PINMUX_GPIO39__FUNC_DBG_MON_A30 (MTK_PIN_NO(39) | 7) 286 + 287 + #define PINMUX_GPIO40__FUNC_GPIO40 (MTK_PIN_NO(40) | 0) 288 + #define PINMUX_GPIO40__FUNC_PWRAP_SPI0_CSN (MTK_PIN_NO(40) | 1) 289 + #define PINMUX_GPIO40__FUNC_SPIM3_CSB (MTK_PIN_NO(40) | 3) 290 + #define PINMUX_GPIO40__FUNC_DBG_MON_A31 (MTK_PIN_NO(40) | 7) 291 + 292 + #define PINMUX_GPIO41__FUNC_GPIO41 (MTK_PIN_NO(41) | 0) 293 + #define PINMUX_GPIO41__FUNC_PWRAP_SPI0_CK (MTK_PIN_NO(41) | 1) 294 + #define PINMUX_GPIO41__FUNC_SPIM3_CLK (MTK_PIN_NO(41) | 3) 295 + #define PINMUX_GPIO41__FUNC_DBG_MON_A32 (MTK_PIN_NO(41) | 7) 296 + 297 + #define PINMUX_GPIO42__FUNC_GPIO42 (MTK_PIN_NO(42) | 0) 298 + #define PINMUX_GPIO42__FUNC_PWRAP_SPI0_MO (MTK_PIN_NO(42) | 1) 299 + #define PINMUX_GPIO42__FUNC_PWRAP_SPI0_MI (MTK_PIN_NO(42) | 2) 300 + #define PINMUX_GPIO42__FUNC_SPIM3_MO (MTK_PIN_NO(42) | 3) 301 + #define PINMUX_GPIO42__FUNC_DBG_MON_B0 (MTK_PIN_NO(42) | 7) 302 + 303 + #define PINMUX_GPIO43__FUNC_GPIO43 (MTK_PIN_NO(43) | 0) 304 + #define PINMUX_GPIO43__FUNC_PWRAP_SPI0_MI (MTK_PIN_NO(43) | 1) 305 + #define PINMUX_GPIO43__FUNC_PWRAP_SPI0_MO (MTK_PIN_NO(43) | 2) 306 + #define PINMUX_GPIO43__FUNC_SPIM3_MI (MTK_PIN_NO(43) | 3) 307 + #define PINMUX_GPIO43__FUNC_DBG_MON_B1 (MTK_PIN_NO(43) | 7) 308 + 309 + #define PINMUX_GPIO44__FUNC_GPIO44 (MTK_PIN_NO(44) | 0) 310 + #define PINMUX_GPIO44__FUNC_SPMI_M_SCL (MTK_PIN_NO(44) | 1) 311 + #define PINMUX_GPIO44__FUNC_I2SI00_DATA1 (MTK_PIN_NO(44) | 2) 312 + #define PINMUX_GPIO44__FUNC_SCL5 (MTK_PIN_NO(44) | 3) 313 + #define PINMUX_GPIO44__FUNC_UTXD5 (MTK_PIN_NO(44) | 4) 314 + #define PINMUX_GPIO44__FUNC_DBG_MON_B2 (MTK_PIN_NO(44) | 7) 315 + 316 + #define PINMUX_GPIO45__FUNC_GPIO45 (MTK_PIN_NO(45) | 0) 317 + #define PINMUX_GPIO45__FUNC_SPMI_M_SDA (MTK_PIN_NO(45) | 1) 318 + #define PINMUX_GPIO45__FUNC_I2SI00_DATA2 (MTK_PIN_NO(45) | 2) 319 + #define PINMUX_GPIO45__FUNC_SDA5 (MTK_PIN_NO(45) | 3) 320 + #define PINMUX_GPIO45__FUNC_URXD5 (MTK_PIN_NO(45) | 4) 321 + #define PINMUX_GPIO45__FUNC_DBG_MON_B3 (MTK_PIN_NO(45) | 7) 322 + 323 + #define PINMUX_GPIO46__FUNC_GPIO46 (MTK_PIN_NO(46) | 0) 324 + #define PINMUX_GPIO46__FUNC_I2SIN_MCK (MTK_PIN_NO(46) | 1) 325 + #define PINMUX_GPIO46__FUNC_I2SI00_DATA3 (MTK_PIN_NO(46) | 2) 326 + #define PINMUX_GPIO46__FUNC_SPLIN_MCK (MTK_PIN_NO(46) | 3) 327 + #define PINMUX_GPIO46__FUNC_DBG_MON_B4 (MTK_PIN_NO(46) | 7) 328 + 329 + #define PINMUX_GPIO47__FUNC_GPIO47 (MTK_PIN_NO(47) | 0) 330 + #define PINMUX_GPIO47__FUNC_I2SIN_BCK (MTK_PIN_NO(47) | 1) 331 + #define PINMUX_GPIO47__FUNC_I2SIN0_BCK (MTK_PIN_NO(47) | 2) 332 + #define PINMUX_GPIO47__FUNC_SPLIN_LRCK (MTK_PIN_NO(47) | 3) 333 + #define PINMUX_GPIO47__FUNC_DBG_MON_B5 (MTK_PIN_NO(47) | 7) 334 + 335 + #define PINMUX_GPIO48__FUNC_GPIO48 (MTK_PIN_NO(48) | 0) 336 + #define PINMUX_GPIO48__FUNC_I2SIN_WS (MTK_PIN_NO(48) | 1) 337 + #define PINMUX_GPIO48__FUNC_I2SIN0_LRCK (MTK_PIN_NO(48) | 2) 338 + #define PINMUX_GPIO48__FUNC_SPLIN_BCK (MTK_PIN_NO(48) | 3) 339 + #define PINMUX_GPIO48__FUNC_DBG_MON_B6 (MTK_PIN_NO(48) | 7) 340 + 341 + #define PINMUX_GPIO49__FUNC_GPIO49 (MTK_PIN_NO(49) | 0) 342 + #define PINMUX_GPIO49__FUNC_I2SIN_D0 (MTK_PIN_NO(49) | 1) 343 + #define PINMUX_GPIO49__FUNC_I2SI00_DATA0 (MTK_PIN_NO(49) | 2) 344 + #define PINMUX_GPIO49__FUNC_SPLIN_D0 (MTK_PIN_NO(49) | 3) 345 + #define PINMUX_GPIO49__FUNC_DBG_MON_B7 (MTK_PIN_NO(49) | 7) 346 + 347 + #define PINMUX_GPIO50__FUNC_GPIO50 (MTK_PIN_NO(50) | 0) 348 + #define PINMUX_GPIO50__FUNC_I2SO1_MCK (MTK_PIN_NO(50) | 1) 349 + #define PINMUX_GPIO50__FUNC_I2SI5_D0 (MTK_PIN_NO(50) | 2) 350 + #define PINMUX_GPIO50__FUNC_I2SO4_MCK (MTK_PIN_NO(50) | 4) 351 + #define PINMUX_GPIO50__FUNC_DBG_MON_B8 (MTK_PIN_NO(50) | 7) 352 + 353 + #define PINMUX_GPIO51__FUNC_GPIO51 (MTK_PIN_NO(51) | 0) 354 + #define PINMUX_GPIO51__FUNC_I2SO1_BCK (MTK_PIN_NO(51) | 1) 355 + #define PINMUX_GPIO51__FUNC_I2SI5_BCK (MTK_PIN_NO(51) | 2) 356 + #define PINMUX_GPIO51__FUNC_DBG_MON_B9 (MTK_PIN_NO(51) | 7) 357 + 358 + #define PINMUX_GPIO52__FUNC_GPIO52 (MTK_PIN_NO(52) | 0) 359 + #define PINMUX_GPIO52__FUNC_I2SO1_WS (MTK_PIN_NO(52) | 1) 360 + #define PINMUX_GPIO52__FUNC_I2SI5_WS (MTK_PIN_NO(52) | 2) 361 + #define PINMUX_GPIO52__FUNC_DBG_MON_B10 (MTK_PIN_NO(52) | 7) 362 + 363 + #define PINMUX_GPIO53__FUNC_GPIO53 (MTK_PIN_NO(53) | 0) 364 + #define PINMUX_GPIO53__FUNC_I2SO1_D0 (MTK_PIN_NO(53) | 1) 365 + #define PINMUX_GPIO53__FUNC_I2SI5_MCK (MTK_PIN_NO(53) | 2) 366 + #define PINMUX_GPIO53__FUNC_DBG_MON_B11 (MTK_PIN_NO(53) | 7) 367 + 368 + #define PINMUX_GPIO54__FUNC_GPIO54 (MTK_PIN_NO(54) | 0) 369 + #define PINMUX_GPIO54__FUNC_I2SO1_D1 (MTK_PIN_NO(54) | 1) 370 + #define PINMUX_GPIO54__FUNC_I2SI01_DATA1 (MTK_PIN_NO(54) | 2) 371 + #define PINMUX_GPIO54__FUNC_SPLIN_D1 (MTK_PIN_NO(54) | 3) 372 + #define PINMUX_GPIO54__FUNC_I2SO4_BCK (MTK_PIN_NO(54) | 4) 373 + #define PINMUX_GPIO54__FUNC_DBG_MON_B12 (MTK_PIN_NO(54) | 7) 374 + 375 + #define PINMUX_GPIO55__FUNC_GPIO55 (MTK_PIN_NO(55) | 0) 376 + #define PINMUX_GPIO55__FUNC_I2SO1_D2 (MTK_PIN_NO(55) | 1) 377 + #define PINMUX_GPIO55__FUNC_I2SI01_DATA2 (MTK_PIN_NO(55) | 2) 378 + #define PINMUX_GPIO55__FUNC_SPLIN_D2 (MTK_PIN_NO(55) | 3) 379 + #define PINMUX_GPIO55__FUNC_I2SO4_WS (MTK_PIN_NO(55) | 4) 380 + #define PINMUX_GPIO55__FUNC_DBG_MON_B13 (MTK_PIN_NO(55) | 7) 381 + 382 + #define PINMUX_GPIO56__FUNC_GPIO56 (MTK_PIN_NO(56) | 0) 383 + #define PINMUX_GPIO56__FUNC_I2SO1_D3 (MTK_PIN_NO(56) | 1) 384 + #define PINMUX_GPIO56__FUNC_I2SI01_DATA3 (MTK_PIN_NO(56) | 2) 385 + #define PINMUX_GPIO56__FUNC_SPLIN_D3 (MTK_PIN_NO(56) | 3) 386 + #define PINMUX_GPIO56__FUNC_I2SO4_D0 (MTK_PIN_NO(56) | 4) 387 + #define PINMUX_GPIO56__FUNC_DBG_MON_B14 (MTK_PIN_NO(56) | 7) 388 + 389 + #define PINMUX_GPIO57__FUNC_GPIO57 (MTK_PIN_NO(57) | 0) 390 + #define PINMUX_GPIO57__FUNC_I2SO2_MCK (MTK_PIN_NO(57) | 1) 391 + #define PINMUX_GPIO57__FUNC_I2SO1_D12 (MTK_PIN_NO(57) | 2) 392 + #define PINMUX_GPIO57__FUNC_LCM1_RST (MTK_PIN_NO(57) | 3) 393 + #define PINMUX_GPIO57__FUNC_DBG_MON_B15 (MTK_PIN_NO(57) | 7) 394 + 395 + #define PINMUX_GPIO58__FUNC_GPIO58 (MTK_PIN_NO(58) | 0) 396 + #define PINMUX_GPIO58__FUNC_I2SO2_BCK (MTK_PIN_NO(58) | 1) 397 + #define PINMUX_GPIO58__FUNC_I2SO1_D13 (MTK_PIN_NO(58) | 2) 398 + #define PINMUX_GPIO58__FUNC_I2SIN1_BCK (MTK_PIN_NO(58) | 3) 399 + #define PINMUX_GPIO58__FUNC_DBG_MON_B16 (MTK_PIN_NO(58) | 7) 400 + 401 + #define PINMUX_GPIO59__FUNC_GPIO59 (MTK_PIN_NO(59) | 0) 402 + #define PINMUX_GPIO59__FUNC_I2SO2_WS (MTK_PIN_NO(59) | 1) 403 + #define PINMUX_GPIO59__FUNC_I2SO1_D14 (MTK_PIN_NO(59) | 2) 404 + #define PINMUX_GPIO59__FUNC_I2SIN1_LRCK (MTK_PIN_NO(59) | 3) 405 + #define PINMUX_GPIO59__FUNC_DBG_MON_B17 (MTK_PIN_NO(59) | 7) 406 + 407 + #define PINMUX_GPIO60__FUNC_GPIO60 (MTK_PIN_NO(60) | 0) 408 + #define PINMUX_GPIO60__FUNC_I2SO2_D0 (MTK_PIN_NO(60) | 1) 409 + #define PINMUX_GPIO60__FUNC_I2SO1_D15 (MTK_PIN_NO(60) | 2) 410 + #define PINMUX_GPIO60__FUNC_I2SI01_DATA0 (MTK_PIN_NO(60) | 3) 411 + #define PINMUX_GPIO60__FUNC_DBG_MON_B18 (MTK_PIN_NO(60) | 7) 412 + 413 + #define PINMUX_GPIO61__FUNC_GPIO61 (MTK_PIN_NO(61) | 0) 414 + #define PINMUX_GPIO61__FUNC_DMIC1_CLK (MTK_PIN_NO(61) | 1) 415 + #define PINMUX_GPIO61__FUNC_I2SO2_BCK (MTK_PIN_NO(61) | 2) 416 + #define PINMUX_GPIO61__FUNC_SCP_SPI2_CK (MTK_PIN_NO(61) | 3) 417 + #define PINMUX_GPIO61__FUNC_DBG_MON_B19 (MTK_PIN_NO(61) | 7) 418 + 419 + #define PINMUX_GPIO62__FUNC_GPIO62 (MTK_PIN_NO(62) | 0) 420 + #define PINMUX_GPIO62__FUNC_DMIC1_DAT (MTK_PIN_NO(62) | 1) 421 + #define PINMUX_GPIO62__FUNC_I2SO2_WS (MTK_PIN_NO(62) | 2) 422 + #define PINMUX_GPIO62__FUNC_SCP_SPI2_MI (MTK_PIN_NO(62) | 3) 423 + #define PINMUX_GPIO62__FUNC_DBG_MON_B20 (MTK_PIN_NO(62) | 7) 424 + 425 + #define PINMUX_GPIO63__FUNC_GPIO63 (MTK_PIN_NO(63) | 0) 426 + #define PINMUX_GPIO63__FUNC_DMIC2_CLK (MTK_PIN_NO(63) | 1) 427 + #define PINMUX_GPIO63__FUNC_VBUSVALID (MTK_PIN_NO(63) | 2) 428 + #define PINMUX_GPIO63__FUNC_SCP_SPI2_MO (MTK_PIN_NO(63) | 3) 429 + #define PINMUX_GPIO63__FUNC_SCP_SCL2 (MTK_PIN_NO(63) | 4) 430 + #define PINMUX_GPIO63__FUNC_SCP_JTAG1_TDO (MTK_PIN_NO(63) | 5) 431 + #define PINMUX_GPIO63__FUNC_JTDO_SEL1 (MTK_PIN_NO(63) | 6) 432 + #define PINMUX_GPIO63__FUNC_DBG_MON_B21 (MTK_PIN_NO(63) | 7) 433 + 434 + #define PINMUX_GPIO64__FUNC_GPIO64 (MTK_PIN_NO(64) | 0) 435 + #define PINMUX_GPIO64__FUNC_DMIC2_DAT (MTK_PIN_NO(64) | 1) 436 + #define PINMUX_GPIO64__FUNC_VBUSVALID_1P (MTK_PIN_NO(64) | 2) 437 + #define PINMUX_GPIO64__FUNC_SCP_SPI2_CS (MTK_PIN_NO(64) | 3) 438 + #define PINMUX_GPIO64__FUNC_SCP_SDA2 (MTK_PIN_NO(64) | 4) 439 + #define PINMUX_GPIO64__FUNC_DBG_MON_B22 (MTK_PIN_NO(64) | 7) 440 + 441 + #define PINMUX_GPIO65__FUNC_GPIO65 (MTK_PIN_NO(65) | 0) 442 + #define PINMUX_GPIO65__FUNC_PCM_DO (MTK_PIN_NO(65) | 1) 443 + #define PINMUX_GPIO65__FUNC_AUXIF_ST0 (MTK_PIN_NO(65) | 2) 444 + #define PINMUX_GPIO65__FUNC_UCTS2 (MTK_PIN_NO(65) | 3) 445 + #define PINMUX_GPIO65__FUNC_SCP_JTAG1_TMS (MTK_PIN_NO(65) | 5) 446 + #define PINMUX_GPIO65__FUNC_JTMS_SEL1 (MTK_PIN_NO(65) | 6) 447 + #define PINMUX_GPIO65__FUNC_DBG_MON_B23 (MTK_PIN_NO(65) | 7) 448 + 449 + #define PINMUX_GPIO66__FUNC_GPIO66 (MTK_PIN_NO(66) | 0) 450 + #define PINMUX_GPIO66__FUNC_PCM_CLK (MTK_PIN_NO(66) | 1) 451 + #define PINMUX_GPIO66__FUNC_AUXIF_CLK0 (MTK_PIN_NO(66) | 2) 452 + #define PINMUX_GPIO66__FUNC_URTS2 (MTK_PIN_NO(66) | 3) 453 + #define PINMUX_GPIO66__FUNC_SCP_JTAG1_TCK (MTK_PIN_NO(66) | 5) 454 + #define PINMUX_GPIO66__FUNC_JTCK_SEL1 (MTK_PIN_NO(66) | 6) 455 + #define PINMUX_GPIO66__FUNC_DBG_MON_B24 (MTK_PIN_NO(66) | 7) 456 + 457 + #define PINMUX_GPIO67__FUNC_GPIO67 (MTK_PIN_NO(67) | 0) 458 + #define PINMUX_GPIO67__FUNC_PCM_DI (MTK_PIN_NO(67) | 1) 459 + #define PINMUX_GPIO67__FUNC_AUXIF_ST1 (MTK_PIN_NO(67) | 2) 460 + #define PINMUX_GPIO67__FUNC_UTXD2 (MTK_PIN_NO(67) | 3) 461 + #define PINMUX_GPIO67__FUNC_SCP_JTAG1_TRSTN (MTK_PIN_NO(67) | 5) 462 + #define PINMUX_GPIO67__FUNC_JTRSTn_SEL1 (MTK_PIN_NO(67) | 6) 463 + #define PINMUX_GPIO67__FUNC_DBG_MON_B25 (MTK_PIN_NO(67) | 7) 464 + 465 + #define PINMUX_GPIO68__FUNC_GPIO68 (MTK_PIN_NO(68) | 0) 466 + #define PINMUX_GPIO68__FUNC_PCM_SYNC (MTK_PIN_NO(68) | 1) 467 + #define PINMUX_GPIO68__FUNC_AUXIF_CLK1 (MTK_PIN_NO(68) | 2) 468 + #define PINMUX_GPIO68__FUNC_URXD2 (MTK_PIN_NO(68) | 3) 469 + #define PINMUX_GPIO68__FUNC_SCP_JTAG1_TDI (MTK_PIN_NO(68) | 5) 470 + #define PINMUX_GPIO68__FUNC_JTDI_SEL1 (MTK_PIN_NO(68) | 6) 471 + #define PINMUX_GPIO68__FUNC_DBG_MON_B26 (MTK_PIN_NO(68) | 7) 472 + 473 + #define PINMUX_GPIO69__FUNC_GPIO69 (MTK_PIN_NO(69) | 0) 474 + #define PINMUX_GPIO69__FUNC_AUD_CLK_MOSI (MTK_PIN_NO(69) | 1) 475 + #define PINMUX_GPIO69__FUNC_I2SIN2_BCK (MTK_PIN_NO(69) | 2) 476 + #define PINMUX_GPIO69__FUNC_PWM_0 (MTK_PIN_NO(69) | 3) 477 + #define PINMUX_GPIO69__FUNC_WAKEN (MTK_PIN_NO(69) | 4) 478 + #define PINMUX_GPIO69__FUNC_DBG_MON_B27 (MTK_PIN_NO(69) | 7) 479 + 480 + #define PINMUX_GPIO70__FUNC_GPIO70 (MTK_PIN_NO(70) | 0) 481 + #define PINMUX_GPIO70__FUNC_AUD_SYNC_MOSI (MTK_PIN_NO(70) | 1) 482 + #define PINMUX_GPIO70__FUNC_I2SIN2_LRCK (MTK_PIN_NO(70) | 2) 483 + #define PINMUX_GPIO70__FUNC_PWM_1 (MTK_PIN_NO(70) | 3) 484 + #define PINMUX_GPIO70__FUNC_PERSTN (MTK_PIN_NO(70) | 4) 485 + #define PINMUX_GPIO70__FUNC_DBG_MON_B28 (MTK_PIN_NO(70) | 7) 486 + 487 + #define PINMUX_GPIO71__FUNC_GPIO71 (MTK_PIN_NO(71) | 0) 488 + #define PINMUX_GPIO71__FUNC_AUD_DAT_MOSI0 (MTK_PIN_NO(71) | 1) 489 + #define PINMUX_GPIO71__FUNC_IDDIG_2P (MTK_PIN_NO(71) | 2) 490 + #define PINMUX_GPIO71__FUNC_PWM_2 (MTK_PIN_NO(71) | 3) 491 + #define PINMUX_GPIO71__FUNC_CLKREQN (MTK_PIN_NO(71) | 4) 492 + #define PINMUX_GPIO71__FUNC_DBG_MON_B29 (MTK_PIN_NO(71) | 7) 493 + 494 + #define PINMUX_GPIO72__FUNC_GPIO72 (MTK_PIN_NO(72) | 0) 495 + #define PINMUX_GPIO72__FUNC_AUD_DAT_MOSI1 (MTK_PIN_NO(72) | 1) 496 + #define PINMUX_GPIO72__FUNC_USB_DRVVBUS_2P (MTK_PIN_NO(72) | 2) 497 + #define PINMUX_GPIO72__FUNC_PWM_3 (MTK_PIN_NO(72) | 3) 498 + #define PINMUX_GPIO72__FUNC_PERSTN_1 (MTK_PIN_NO(72) | 4) 499 + #define PINMUX_GPIO72__FUNC_DBG_MON_B30 (MTK_PIN_NO(72) | 7) 500 + 501 + #define PINMUX_GPIO73__FUNC_GPIO73 (MTK_PIN_NO(73) | 0) 502 + #define PINMUX_GPIO73__FUNC_AUD_DAT_MISO0 (MTK_PIN_NO(73) | 1) 503 + #define PINMUX_GPIO73__FUNC_I2SI02_DATA0 (MTK_PIN_NO(73) | 2) 504 + #define PINMUX_GPIO73__FUNC_CLKREQN_1 (MTK_PIN_NO(73) | 4) 505 + #define PINMUX_GPIO73__FUNC_VOW_DAT_MISO (MTK_PIN_NO(73) | 5) 506 + #define PINMUX_GPIO73__FUNC_DBG_MON_B31 (MTK_PIN_NO(73) | 7) 507 + 508 + #define PINMUX_GPIO74__FUNC_GPIO74 (MTK_PIN_NO(74) | 0) 509 + #define PINMUX_GPIO74__FUNC_AUD_DAT_MISO1 (MTK_PIN_NO(74) | 1) 510 + #define PINMUX_GPIO74__FUNC_I2SI02_DATA1 (MTK_PIN_NO(74) | 2) 511 + #define PINMUX_GPIO74__FUNC_WAKEN_1 (MTK_PIN_NO(74) | 4) 512 + #define PINMUX_GPIO74__FUNC_VOW_CLK_MISO (MTK_PIN_NO(74) | 5) 513 + #define PINMUX_GPIO74__FUNC_DBG_MON_B32 (MTK_PIN_NO(74) | 7) 514 + 515 + #define PINMUX_GPIO75__FUNC_GPIO75 (MTK_PIN_NO(75) | 0) 516 + #define PINMUX_GPIO75__FUNC_AUD_DAT_MISO2 (MTK_PIN_NO(75) | 1) 517 + #define PINMUX_GPIO75__FUNC_I2SI02_DATA2 (MTK_PIN_NO(75) | 2) 518 + 519 + #define PINMUX_GPIO76__FUNC_GPIO76 (MTK_PIN_NO(76) | 0) 520 + #define PINMUX_GPIO76__FUNC_SCP_VREQ_VAO (MTK_PIN_NO(76) | 1) 521 + #define PINMUX_GPIO76__FUNC_I2SI02_DATA3 (MTK_PIN_NO(76) | 2) 522 + #define PINMUX_GPIO76__FUNC_DBG_MON_A26 (MTK_PIN_NO(76) | 7) 523 + 524 + #define PINMUX_GPIO77__FUNC_GPIO77 (MTK_PIN_NO(77) | 0) 525 + #define PINMUX_GPIO77__FUNC_DGI_D0 (MTK_PIN_NO(77) | 1) 526 + #define PINMUX_GPIO77__FUNC_DPI_D0 (MTK_PIN_NO(77) | 2) 527 + #define PINMUX_GPIO77__FUNC_I2SI4_MCK (MTK_PIN_NO(77) | 3) 528 + #define PINMUX_GPIO77__FUNC_SPIM4_CLK (MTK_PIN_NO(77) | 4) 529 + #define PINMUX_GPIO77__FUNC_GBE_TXD3 (MTK_PIN_NO(77) | 5) 530 + #define PINMUX_GPIO77__FUNC_SPM_JTAG_TCK (MTK_PIN_NO(77) | 6) 531 + 532 + #define PINMUX_GPIO78__FUNC_GPIO78 (MTK_PIN_NO(78) | 0) 533 + #define PINMUX_GPIO78__FUNC_DGI_D1 (MTK_PIN_NO(78) | 1) 534 + #define PINMUX_GPIO78__FUNC_DPI_D1 (MTK_PIN_NO(78) | 2) 535 + #define PINMUX_GPIO78__FUNC_I2SI4_BCK (MTK_PIN_NO(78) | 3) 536 + #define PINMUX_GPIO78__FUNC_SPIM4_MO (MTK_PIN_NO(78) | 4) 537 + #define PINMUX_GPIO78__FUNC_GBE_TXD2 (MTK_PIN_NO(78) | 5) 538 + #define PINMUX_GPIO78__FUNC_SPM_JTAG_TMS (MTK_PIN_NO(78) | 6) 539 + 540 + #define PINMUX_GPIO79__FUNC_GPIO79 (MTK_PIN_NO(79) | 0) 541 + #define PINMUX_GPIO79__FUNC_DGI_D2 (MTK_PIN_NO(79) | 1) 542 + #define PINMUX_GPIO79__FUNC_DPI_D2 (MTK_PIN_NO(79) | 2) 543 + #define PINMUX_GPIO79__FUNC_I2SI4_WS (MTK_PIN_NO(79) | 3) 544 + #define PINMUX_GPIO79__FUNC_SPIM4_CSB (MTK_PIN_NO(79) | 4) 545 + #define PINMUX_GPIO79__FUNC_GBE_TXD1 (MTK_PIN_NO(79) | 5) 546 + #define PINMUX_GPIO79__FUNC_SPM_JTAG_TDI (MTK_PIN_NO(79) | 6) 547 + 548 + #define PINMUX_GPIO80__FUNC_GPIO80 (MTK_PIN_NO(80) | 0) 549 + #define PINMUX_GPIO80__FUNC_DGI_D3 (MTK_PIN_NO(80) | 1) 550 + #define PINMUX_GPIO80__FUNC_DPI_D3 (MTK_PIN_NO(80) | 2) 551 + #define PINMUX_GPIO80__FUNC_I2SI4_D0 (MTK_PIN_NO(80) | 3) 552 + #define PINMUX_GPIO80__FUNC_SPIM4_MI (MTK_PIN_NO(80) | 4) 553 + #define PINMUX_GPIO80__FUNC_GBE_TXD0 (MTK_PIN_NO(80) | 5) 554 + #define PINMUX_GPIO80__FUNC_SPM_JTAG_TDO (MTK_PIN_NO(80) | 6) 555 + 556 + #define PINMUX_GPIO81__FUNC_GPIO81 (MTK_PIN_NO(81) | 0) 557 + #define PINMUX_GPIO81__FUNC_DGI_D4 (MTK_PIN_NO(81) | 1) 558 + #define PINMUX_GPIO81__FUNC_DPI_D4 (MTK_PIN_NO(81) | 2) 559 + #define PINMUX_GPIO81__FUNC_I2SI5_MCK (MTK_PIN_NO(81) | 3) 560 + #define PINMUX_GPIO81__FUNC_SPIM5_CLK (MTK_PIN_NO(81) | 4) 561 + #define PINMUX_GPIO81__FUNC_GBE_RXD3 (MTK_PIN_NO(81) | 5) 562 + #define PINMUX_GPIO81__FUNC_SPM_JTAG_TRSTN (MTK_PIN_NO(81) | 6) 563 + 564 + #define PINMUX_GPIO82__FUNC_GPIO82 (MTK_PIN_NO(82) | 0) 565 + #define PINMUX_GPIO82__FUNC_DGI_D5 (MTK_PIN_NO(82) | 1) 566 + #define PINMUX_GPIO82__FUNC_DPI_D5 (MTK_PIN_NO(82) | 2) 567 + #define PINMUX_GPIO82__FUNC_I2SI5_BCK (MTK_PIN_NO(82) | 3) 568 + #define PINMUX_GPIO82__FUNC_SPIM5_MO (MTK_PIN_NO(82) | 4) 569 + #define PINMUX_GPIO82__FUNC_GBE_RXD2 (MTK_PIN_NO(82) | 5) 570 + #define PINMUX_GPIO82__FUNC_MCUPM_JTAG_TDO (MTK_PIN_NO(82) | 6) 571 + 572 + #define PINMUX_GPIO83__FUNC_GPIO83 (MTK_PIN_NO(83) | 0) 573 + #define PINMUX_GPIO83__FUNC_DGI_D6 (MTK_PIN_NO(83) | 1) 574 + #define PINMUX_GPIO83__FUNC_DPI_D6 (MTK_PIN_NO(83) | 2) 575 + #define PINMUX_GPIO83__FUNC_I2SI5_WS (MTK_PIN_NO(83) | 3) 576 + #define PINMUX_GPIO83__FUNC_SPIM5_CSB (MTK_PIN_NO(83) | 4) 577 + #define PINMUX_GPIO83__FUNC_GBE_RXD1 (MTK_PIN_NO(83) | 5) 578 + #define PINMUX_GPIO83__FUNC_MCUPM_JTAG_TMS (MTK_PIN_NO(83) | 6) 579 + 580 + #define PINMUX_GPIO84__FUNC_GPIO84 (MTK_PIN_NO(84) | 0) 581 + #define PINMUX_GPIO84__FUNC_DGI_D7 (MTK_PIN_NO(84) | 1) 582 + #define PINMUX_GPIO84__FUNC_DPI_D7 (MTK_PIN_NO(84) | 2) 583 + #define PINMUX_GPIO84__FUNC_I2SI5_D0 (MTK_PIN_NO(84) | 3) 584 + #define PINMUX_GPIO84__FUNC_SPIM5_MI (MTK_PIN_NO(84) | 4) 585 + #define PINMUX_GPIO84__FUNC_GBE_RXD0 (MTK_PIN_NO(84) | 5) 586 + #define PINMUX_GPIO84__FUNC_MCUPM_JTAG_TCK (MTK_PIN_NO(84) | 6) 587 + 588 + #define PINMUX_GPIO85__FUNC_GPIO85 (MTK_PIN_NO(85) | 0) 589 + #define PINMUX_GPIO85__FUNC_DGI_D8 (MTK_PIN_NO(85) | 1) 590 + #define PINMUX_GPIO85__FUNC_DPI_D8 (MTK_PIN_NO(85) | 2) 591 + #define PINMUX_GPIO85__FUNC_I2SO4_MCK (MTK_PIN_NO(85) | 3) 592 + #define PINMUX_GPIO85__FUNC_SCP_SPI1_B_CK (MTK_PIN_NO(85) | 4) 593 + #define PINMUX_GPIO85__FUNC_GBE_TXC (MTK_PIN_NO(85) | 5) 594 + #define PINMUX_GPIO85__FUNC_MCUPM_JTAG_TDI (MTK_PIN_NO(85) | 6) 595 + 596 + #define PINMUX_GPIO86__FUNC_GPIO86 (MTK_PIN_NO(86) | 0) 597 + #define PINMUX_GPIO86__FUNC_DGI_D9 (MTK_PIN_NO(86) | 1) 598 + #define PINMUX_GPIO86__FUNC_DPI_D9 (MTK_PIN_NO(86) | 2) 599 + #define PINMUX_GPIO86__FUNC_I2SO4_BCK (MTK_PIN_NO(86) | 3) 600 + #define PINMUX_GPIO86__FUNC_SCP_SPI1_B_MI (MTK_PIN_NO(86) | 4) 601 + #define PINMUX_GPIO86__FUNC_GBE_RXC (MTK_PIN_NO(86) | 5) 602 + #define PINMUX_GPIO86__FUNC_MCUPM_JTAG_TRSTN (MTK_PIN_NO(86) | 6) 603 + 604 + #define PINMUX_GPIO87__FUNC_GPIO87 (MTK_PIN_NO(87) | 0) 605 + #define PINMUX_GPIO87__FUNC_DGI_D10 (MTK_PIN_NO(87) | 1) 606 + #define PINMUX_GPIO87__FUNC_DPI_D10 (MTK_PIN_NO(87) | 2) 607 + #define PINMUX_GPIO87__FUNC_I2SO4_WS (MTK_PIN_NO(87) | 3) 608 + #define PINMUX_GPIO87__FUNC_SCP_SPI1_B_CS (MTK_PIN_NO(87) | 4) 609 + #define PINMUX_GPIO87__FUNC_GBE_RXDV (MTK_PIN_NO(87) | 5) 610 + #define PINMUX_GPIO87__FUNC_SSPM_JTAG_TDO (MTK_PIN_NO(87) | 6) 611 + 612 + #define PINMUX_GPIO88__FUNC_GPIO88 (MTK_PIN_NO(88) | 0) 613 + #define PINMUX_GPIO88__FUNC_DGI_D11 (MTK_PIN_NO(88) | 1) 614 + #define PINMUX_GPIO88__FUNC_DPI_D11 (MTK_PIN_NO(88) | 2) 615 + #define PINMUX_GPIO88__FUNC_I2SO4_D0 (MTK_PIN_NO(88) | 3) 616 + #define PINMUX_GPIO88__FUNC_SCP_SPI1_B_MO (MTK_PIN_NO(88) | 4) 617 + #define PINMUX_GPIO88__FUNC_GBE_TXEN (MTK_PIN_NO(88) | 5) 618 + #define PINMUX_GPIO88__FUNC_SSPM_JTAG_TMS (MTK_PIN_NO(88) | 6) 619 + 620 + #define PINMUX_GPIO89__FUNC_GPIO89 (MTK_PIN_NO(89) | 0) 621 + #define PINMUX_GPIO89__FUNC_DGI_D12 (MTK_PIN_NO(89) | 1) 622 + #define PINMUX_GPIO89__FUNC_DPI_D12 (MTK_PIN_NO(89) | 2) 623 + #define PINMUX_GPIO89__FUNC_MSDC2_CMD_A (MTK_PIN_NO(89) | 3) 624 + #define PINMUX_GPIO89__FUNC_I2SO5_BCK (MTK_PIN_NO(89) | 4) 625 + #define PINMUX_GPIO89__FUNC_GBE_MDC (MTK_PIN_NO(89) | 5) 626 + #define PINMUX_GPIO89__FUNC_SSPM_JTAG_TCK (MTK_PIN_NO(89) | 6) 627 + 628 + #define PINMUX_GPIO90__FUNC_GPIO90 (MTK_PIN_NO(90) | 0) 629 + #define PINMUX_GPIO90__FUNC_DGI_D13 (MTK_PIN_NO(90) | 1) 630 + #define PINMUX_GPIO90__FUNC_DPI_D13 (MTK_PIN_NO(90) | 2) 631 + #define PINMUX_GPIO90__FUNC_MSDC2_CLK_A (MTK_PIN_NO(90) | 3) 632 + #define PINMUX_GPIO90__FUNC_I2SO5_WS (MTK_PIN_NO(90) | 4) 633 + #define PINMUX_GPIO90__FUNC_GBE_MDIO (MTK_PIN_NO(90) | 5) 634 + #define PINMUX_GPIO90__FUNC_SSPM_JTAG_TDI (MTK_PIN_NO(90) | 6) 635 + 636 + #define PINMUX_GPIO91__FUNC_GPIO91 (MTK_PIN_NO(91) | 0) 637 + #define PINMUX_GPIO91__FUNC_DGI_D14 (MTK_PIN_NO(91) | 1) 638 + #define PINMUX_GPIO91__FUNC_DPI_D14 (MTK_PIN_NO(91) | 2) 639 + #define PINMUX_GPIO91__FUNC_MSDC2_DAT3_A (MTK_PIN_NO(91) | 3) 640 + #define PINMUX_GPIO91__FUNC_I2SO5_D0 (MTK_PIN_NO(91) | 4) 641 + #define PINMUX_GPIO91__FUNC_GBE_TXER (MTK_PIN_NO(91) | 5) 642 + #define PINMUX_GPIO91__FUNC_SSPM_JTAG_TRSTN (MTK_PIN_NO(91) | 6) 643 + 644 + #define PINMUX_GPIO92__FUNC_GPIO92 (MTK_PIN_NO(92) | 0) 645 + #define PINMUX_GPIO92__FUNC_DGI_D15 (MTK_PIN_NO(92) | 1) 646 + #define PINMUX_GPIO92__FUNC_DPI_D15 (MTK_PIN_NO(92) | 2) 647 + #define PINMUX_GPIO92__FUNC_MSDC2_DAT0_A (MTK_PIN_NO(92) | 3) 648 + #define PINMUX_GPIO92__FUNC_I2SO2_D1 (MTK_PIN_NO(92) | 4) 649 + #define PINMUX_GPIO92__FUNC_GBE_RXER (MTK_PIN_NO(92) | 5) 650 + #define PINMUX_GPIO92__FUNC_CCU0_JTAG_TDO (MTK_PIN_NO(92) | 6) 651 + 652 + #define PINMUX_GPIO93__FUNC_GPIO93 (MTK_PIN_NO(93) | 0) 653 + #define PINMUX_GPIO93__FUNC_DGI_HSYNC (MTK_PIN_NO(93) | 1) 654 + #define PINMUX_GPIO93__FUNC_DPI_HSYNC (MTK_PIN_NO(93) | 2) 655 + #define PINMUX_GPIO93__FUNC_MSDC2_DAT2_A (MTK_PIN_NO(93) | 3) 656 + #define PINMUX_GPIO93__FUNC_I2SO2_D2 (MTK_PIN_NO(93) | 4) 657 + #define PINMUX_GPIO93__FUNC_GBE_COL (MTK_PIN_NO(93) | 5) 658 + #define PINMUX_GPIO93__FUNC_CCU0_JTAG_TMS (MTK_PIN_NO(93) | 6) 659 + 660 + #define PINMUX_GPIO94__FUNC_GPIO94 (MTK_PIN_NO(94) | 0) 661 + #define PINMUX_GPIO94__FUNC_DGI_VSYNC (MTK_PIN_NO(94) | 1) 662 + #define PINMUX_GPIO94__FUNC_DPI_VSYNC (MTK_PIN_NO(94) | 2) 663 + #define PINMUX_GPIO94__FUNC_MSDC2_DAT1_A (MTK_PIN_NO(94) | 3) 664 + #define PINMUX_GPIO94__FUNC_I2SO2_D3 (MTK_PIN_NO(94) | 4) 665 + #define PINMUX_GPIO94__FUNC_GBE_INTR (MTK_PIN_NO(94) | 5) 666 + #define PINMUX_GPIO94__FUNC_CCU0_JTAG_TDI (MTK_PIN_NO(94) | 6) 667 + 668 + #define PINMUX_GPIO95__FUNC_GPIO95 (MTK_PIN_NO(95) | 0) 669 + #define PINMUX_GPIO95__FUNC_DGI_DE (MTK_PIN_NO(95) | 1) 670 + #define PINMUX_GPIO95__FUNC_DPI_DE (MTK_PIN_NO(95) | 2) 671 + #define PINMUX_GPIO95__FUNC_UTXD2 (MTK_PIN_NO(95) | 3) 672 + #define PINMUX_GPIO95__FUNC_I2SIN_D1 (MTK_PIN_NO(95) | 5) 673 + #define PINMUX_GPIO95__FUNC_CCU0_JTAG_TCK (MTK_PIN_NO(95) | 6) 674 + 675 + #define PINMUX_GPIO96__FUNC_GPIO96 (MTK_PIN_NO(96) | 0) 676 + #define PINMUX_GPIO96__FUNC_DGI_CK (MTK_PIN_NO(96) | 1) 677 + #define PINMUX_GPIO96__FUNC_DPI_CK (MTK_PIN_NO(96) | 2) 678 + #define PINMUX_GPIO96__FUNC_URXD2 (MTK_PIN_NO(96) | 3) 679 + #define PINMUX_GPIO96__FUNC_I2SO5_MCK (MTK_PIN_NO(96) | 4) 680 + #define PINMUX_GPIO96__FUNC_I2SIN_D2 (MTK_PIN_NO(96) | 5) 681 + #define PINMUX_GPIO96__FUNC_CCU0_JTAG_TRST (MTK_PIN_NO(96) | 6) 682 + 683 + #define PINMUX_GPIO97__FUNC_GPIO97 (MTK_PIN_NO(97) | 0) 684 + #define PINMUX_GPIO97__FUNC_DISP_PWM0 (MTK_PIN_NO(97) | 1) 685 + #define PINMUX_GPIO97__FUNC_DVFSRC_EXT_REQ (MTK_PIN_NO(97) | 2) 686 + 687 + #define PINMUX_GPIO98__FUNC_GPIO98 (MTK_PIN_NO(98) | 0) 688 + #define PINMUX_GPIO98__FUNC_UTXD0 (MTK_PIN_NO(98) | 1) 689 + 690 + #define PINMUX_GPIO99__FUNC_GPIO99 (MTK_PIN_NO(99) | 0) 691 + #define PINMUX_GPIO99__FUNC_URXD0 (MTK_PIN_NO(99) | 1) 692 + 693 + #define PINMUX_GPIO100__FUNC_GPIO100 (MTK_PIN_NO(100) | 0) 694 + #define PINMUX_GPIO100__FUNC_URTS1 (MTK_PIN_NO(100) | 1) 695 + #define PINMUX_GPIO100__FUNC_DSI_TE (MTK_PIN_NO(100) | 2) 696 + #define PINMUX_GPIO100__FUNC_I2SO1_D8 (MTK_PIN_NO(100) | 3) 697 + #define PINMUX_GPIO100__FUNC_KPROW2 (MTK_PIN_NO(100) | 4) 698 + #define PINMUX_GPIO100__FUNC_PWM_0 (MTK_PIN_NO(100) | 5) 699 + #define PINMUX_GPIO100__FUNC_TP_URTS1_AO (MTK_PIN_NO(100) | 6) 700 + #define PINMUX_GPIO100__FUNC_I2SIN_D0 (MTK_PIN_NO(100) | 7) 701 + 702 + #define PINMUX_GPIO101__FUNC_GPIO101 (MTK_PIN_NO(101) | 0) 703 + #define PINMUX_GPIO101__FUNC_UCTS1 (MTK_PIN_NO(101) | 1) 704 + #define PINMUX_GPIO101__FUNC_DSI1_TE (MTK_PIN_NO(101) | 2) 705 + #define PINMUX_GPIO101__FUNC_I2SO1_D9 (MTK_PIN_NO(101) | 3) 706 + #define PINMUX_GPIO101__FUNC_KPCOL2 (MTK_PIN_NO(101) | 4) 707 + #define PINMUX_GPIO101__FUNC_PWM_1 (MTK_PIN_NO(101) | 5) 708 + #define PINMUX_GPIO101__FUNC_TP_UCTS1_AO (MTK_PIN_NO(101) | 6) 709 + #define PINMUX_GPIO101__FUNC_I2SIN_D1 (MTK_PIN_NO(101) | 7) 710 + 711 + #define PINMUX_GPIO102__FUNC_GPIO102 (MTK_PIN_NO(102) | 0) 712 + #define PINMUX_GPIO102__FUNC_UTXD1 (MTK_PIN_NO(102) | 1) 713 + #define PINMUX_GPIO102__FUNC_VBUSVALID_2P (MTK_PIN_NO(102) | 2) 714 + #define PINMUX_GPIO102__FUNC_I2SO1_D10 (MTK_PIN_NO(102) | 3) 715 + #define PINMUX_GPIO102__FUNC_SSPM_UTXD_AO (MTK_PIN_NO(102) | 4) 716 + #define PINMUX_GPIO102__FUNC_TP_UTXD1_AO (MTK_PIN_NO(102) | 5) 717 + #define PINMUX_GPIO102__FUNC_MD32_1_TXD (MTK_PIN_NO(102) | 6) 718 + #define PINMUX_GPIO102__FUNC_I2SIN_D2 (MTK_PIN_NO(102) | 7) 719 + 720 + #define PINMUX_GPIO103__FUNC_GPIO103 (MTK_PIN_NO(103) | 0) 721 + #define PINMUX_GPIO103__FUNC_URXD1 (MTK_PIN_NO(103) | 1) 722 + #define PINMUX_GPIO103__FUNC_VBUSVALID_3P (MTK_PIN_NO(103) | 2) 723 + #define PINMUX_GPIO103__FUNC_I2SO1_D11 (MTK_PIN_NO(103) | 3) 724 + #define PINMUX_GPIO103__FUNC_SSPM_URXD_AO (MTK_PIN_NO(103) | 4) 725 + #define PINMUX_GPIO103__FUNC_TP_URXD1_AO (MTK_PIN_NO(103) | 5) 726 + #define PINMUX_GPIO103__FUNC_MD32_1_RXD (MTK_PIN_NO(103) | 6) 727 + #define PINMUX_GPIO103__FUNC_I2SIN_D3 (MTK_PIN_NO(103) | 7) 728 + 729 + #define PINMUX_GPIO104__FUNC_GPIO104 (MTK_PIN_NO(104) | 0) 730 + #define PINMUX_GPIO104__FUNC_KPROW0 (MTK_PIN_NO(104) | 1) 731 + #define PINMUX_GPIO104__FUNC_DISP_PWM1 (MTK_PIN_NO(104) | 2) 732 + 733 + #define PINMUX_GPIO105__FUNC_GPIO105 (MTK_PIN_NO(105) | 0) 734 + #define PINMUX_GPIO105__FUNC_KPROW1 (MTK_PIN_NO(105) | 1) 735 + #define PINMUX_GPIO105__FUNC_EDP_TX_HPD (MTK_PIN_NO(105) | 2) 736 + #define PINMUX_GPIO105__FUNC_PWM_2 (MTK_PIN_NO(105) | 3) 737 + 738 + #define PINMUX_GPIO106__FUNC_GPIO106 (MTK_PIN_NO(106) | 0) 739 + #define PINMUX_GPIO106__FUNC_KPCOL0 (MTK_PIN_NO(106) | 1) 740 + 741 + #define PINMUX_GPIO107__FUNC_GPIO107 (MTK_PIN_NO(107) | 0) 742 + #define PINMUX_GPIO107__FUNC_KPCOL1 (MTK_PIN_NO(107) | 1) 743 + #define PINMUX_GPIO107__FUNC_DSI1_TE (MTK_PIN_NO(107) | 2) 744 + #define PINMUX_GPIO107__FUNC_PWM_3 (MTK_PIN_NO(107) | 3) 745 + #define PINMUX_GPIO107__FUNC_SCP_SCL3 (MTK_PIN_NO(107) | 4) 746 + #define PINMUX_GPIO107__FUNC_I2SIN_MCK (MTK_PIN_NO(107) | 5) 747 + 748 + #define PINMUX_GPIO108__FUNC_GPIO108 (MTK_PIN_NO(108) | 0) 749 + #define PINMUX_GPIO108__FUNC_LCM_RST (MTK_PIN_NO(108) | 1) 750 + #define PINMUX_GPIO108__FUNC_KPCOL1 (MTK_PIN_NO(108) | 2) 751 + #define PINMUX_GPIO108__FUNC_SCP_SDA3 (MTK_PIN_NO(108) | 4) 752 + #define PINMUX_GPIO108__FUNC_I2SIN_BCK (MTK_PIN_NO(108) | 5) 753 + 754 + #define PINMUX_GPIO109__FUNC_GPIO109 (MTK_PIN_NO(109) | 0) 755 + #define PINMUX_GPIO109__FUNC_DSI_TE (MTK_PIN_NO(109) | 1) 756 + #define PINMUX_GPIO109__FUNC_I2SIN_D3 (MTK_PIN_NO(109) | 2) 757 + #define PINMUX_GPIO109__FUNC_I2SIN_WS (MTK_PIN_NO(109) | 5) 758 + 759 + #define PINMUX_GPIO110__FUNC_GPIO110 (MTK_PIN_NO(110) | 0) 760 + #define PINMUX_GPIO110__FUNC_MSDC1_CMD (MTK_PIN_NO(110) | 1) 761 + #define PINMUX_GPIO110__FUNC_JTMS_SEL3 (MTK_PIN_NO(110) | 2) 762 + #define PINMUX_GPIO110__FUNC_UDI_TMS (MTK_PIN_NO(110) | 3) 763 + #define PINMUX_GPIO110__FUNC_CCU1_JTAG_TMS (MTK_PIN_NO(110) | 5) 764 + #define PINMUX_GPIO110__FUNC_IPU_JTAG_TMS (MTK_PIN_NO(110) | 6) 765 + 766 + #define PINMUX_GPIO111__FUNC_GPIO111 (MTK_PIN_NO(111) | 0) 767 + #define PINMUX_GPIO111__FUNC_MSDC1_CLK (MTK_PIN_NO(111) | 1) 768 + #define PINMUX_GPIO111__FUNC_JTCK_SEL3 (MTK_PIN_NO(111) | 2) 769 + #define PINMUX_GPIO111__FUNC_UDI_TCK (MTK_PIN_NO(111) | 3) 770 + #define PINMUX_GPIO111__FUNC_CCU1_JTAG_TCK (MTK_PIN_NO(111) | 5) 771 + #define PINMUX_GPIO111__FUNC_IPU_JTAG_TCK (MTK_PIN_NO(111) | 6) 772 + 773 + #define PINMUX_GPIO112__FUNC_GPIO112 (MTK_PIN_NO(112) | 0) 774 + #define PINMUX_GPIO112__FUNC_MSDC1_DAT0 (MTK_PIN_NO(112) | 1) 775 + #define PINMUX_GPIO112__FUNC_JTDI_SEL3 (MTK_PIN_NO(112) | 2) 776 + #define PINMUX_GPIO112__FUNC_UDI_TDI (MTK_PIN_NO(112) | 3) 777 + #define PINMUX_GPIO112__FUNC_I2SO2_D0 (MTK_PIN_NO(112) | 4) 778 + #define PINMUX_GPIO112__FUNC_CCU1_JTAG_TDI (MTK_PIN_NO(112) | 5) 779 + #define PINMUX_GPIO112__FUNC_IPU_JTAG_TDI (MTK_PIN_NO(112) | 6) 780 + 781 + #define PINMUX_GPIO113__FUNC_GPIO113 (MTK_PIN_NO(113) | 0) 782 + #define PINMUX_GPIO113__FUNC_MSDC1_DAT1 (MTK_PIN_NO(113) | 1) 783 + #define PINMUX_GPIO113__FUNC_JTDO_SEL3 (MTK_PIN_NO(113) | 2) 784 + #define PINMUX_GPIO113__FUNC_UDI_TDO (MTK_PIN_NO(113) | 3) 785 + #define PINMUX_GPIO113__FUNC_I2SO2_D1 (MTK_PIN_NO(113) | 4) 786 + #define PINMUX_GPIO113__FUNC_CCU1_JTAG_TDO (MTK_PIN_NO(113) | 5) 787 + #define PINMUX_GPIO113__FUNC_IPU_JTAG_TDO (MTK_PIN_NO(113) | 6) 788 + 789 + #define PINMUX_GPIO114__FUNC_GPIO114 (MTK_PIN_NO(114) | 0) 790 + #define PINMUX_GPIO114__FUNC_MSDC1_DAT2 (MTK_PIN_NO(114) | 1) 791 + #define PINMUX_GPIO114__FUNC_JTRSTn_SEL3 (MTK_PIN_NO(114) | 2) 792 + #define PINMUX_GPIO114__FUNC_UDI_NTRST (MTK_PIN_NO(114) | 3) 793 + #define PINMUX_GPIO114__FUNC_I2SO2_D2 (MTK_PIN_NO(114) | 4) 794 + #define PINMUX_GPIO114__FUNC_CCU1_JTAG_TRST (MTK_PIN_NO(114) | 5) 795 + #define PINMUX_GPIO114__FUNC_IPU_JTAG_TRST (MTK_PIN_NO(114) | 6) 796 + 797 + #define PINMUX_GPIO115__FUNC_GPIO115 (MTK_PIN_NO(115) | 0) 798 + #define PINMUX_GPIO115__FUNC_MSDC1_DAT3 (MTK_PIN_NO(115) | 1) 799 + #define PINMUX_GPIO115__FUNC_I2SO2_D3 (MTK_PIN_NO(115) | 4) 800 + #define PINMUX_GPIO115__FUNC_MD32_1_GPIO2 (MTK_PIN_NO(115) | 6) 801 + 802 + #define PINMUX_GPIO116__FUNC_GPIO116 (MTK_PIN_NO(116) | 0) 803 + #define PINMUX_GPIO116__FUNC_MSDC0_DAT7 (MTK_PIN_NO(116) | 1) 804 + 805 + #define PINMUX_GPIO117__FUNC_GPIO117 (MTK_PIN_NO(117) | 0) 806 + #define PINMUX_GPIO117__FUNC_MSDC0_DAT6 (MTK_PIN_NO(117) | 1) 807 + 808 + #define PINMUX_GPIO118__FUNC_GPIO118 (MTK_PIN_NO(118) | 0) 809 + #define PINMUX_GPIO118__FUNC_MSDC0_DAT5 (MTK_PIN_NO(118) | 1) 810 + 811 + #define PINMUX_GPIO119__FUNC_GPIO119 (MTK_PIN_NO(119) | 0) 812 + #define PINMUX_GPIO119__FUNC_MSDC0_DAT4 (MTK_PIN_NO(119) | 1) 813 + 814 + #define PINMUX_GPIO120__FUNC_GPIO120 (MTK_PIN_NO(120) | 0) 815 + #define PINMUX_GPIO120__FUNC_MSDC0_RSTB (MTK_PIN_NO(120) | 1) 816 + 817 + #define PINMUX_GPIO121__FUNC_GPIO121 (MTK_PIN_NO(121) | 0) 818 + #define PINMUX_GPIO121__FUNC_MSDC0_CMD (MTK_PIN_NO(121) | 1) 819 + 820 + #define PINMUX_GPIO122__FUNC_GPIO122 (MTK_PIN_NO(122) | 0) 821 + #define PINMUX_GPIO122__FUNC_MSDC0_CLK (MTK_PIN_NO(122) | 1) 822 + 823 + #define PINMUX_GPIO123__FUNC_GPIO123 (MTK_PIN_NO(123) | 0) 824 + #define PINMUX_GPIO123__FUNC_MSDC0_DAT3 (MTK_PIN_NO(123) | 1) 825 + 826 + #define PINMUX_GPIO124__FUNC_GPIO124 (MTK_PIN_NO(124) | 0) 827 + #define PINMUX_GPIO124__FUNC_MSDC0_DAT2 (MTK_PIN_NO(124) | 1) 828 + 829 + #define PINMUX_GPIO125__FUNC_GPIO125 (MTK_PIN_NO(125) | 0) 830 + #define PINMUX_GPIO125__FUNC_MSDC0_DAT1 (MTK_PIN_NO(125) | 1) 831 + 832 + #define PINMUX_GPIO126__FUNC_GPIO126 (MTK_PIN_NO(126) | 0) 833 + #define PINMUX_GPIO126__FUNC_MSDC0_DAT0 (MTK_PIN_NO(126) | 1) 834 + 835 + #define PINMUX_GPIO127__FUNC_GPIO127 (MTK_PIN_NO(127) | 0) 836 + #define PINMUX_GPIO127__FUNC_MSDC0_DSL (MTK_PIN_NO(127) | 1) 837 + 838 + #define PINMUX_GPIO128__FUNC_GPIO128 (MTK_PIN_NO(128) | 0) 839 + #define PINMUX_GPIO128__FUNC_IDDIG (MTK_PIN_NO(128) | 1) 840 + #define PINMUX_GPIO128__FUNC_UCTS2 (MTK_PIN_NO(128) | 2) 841 + #define PINMUX_GPIO128__FUNC_UTXD5 (MTK_PIN_NO(128) | 3) 842 + #define PINMUX_GPIO128__FUNC_UFS_MPHY_SCL (MTK_PIN_NO(128) | 4) 843 + #define PINMUX_GPIO128__FUNC_mbistreaden_trigger (MTK_PIN_NO(128) | 5) 844 + #define PINMUX_GPIO128__FUNC_MD32_1_GPIO0 (MTK_PIN_NO(128) | 6) 845 + #define PINMUX_GPIO128__FUNC_SCP_SCL2 (MTK_PIN_NO(128) | 7) 846 + 847 + #define PINMUX_GPIO129__FUNC_GPIO129 (MTK_PIN_NO(129) | 0) 848 + #define PINMUX_GPIO129__FUNC_USB_DRVVBUS (MTK_PIN_NO(129) | 1) 849 + #define PINMUX_GPIO129__FUNC_URTS2 (MTK_PIN_NO(129) | 2) 850 + #define PINMUX_GPIO129__FUNC_URXD5 (MTK_PIN_NO(129) | 3) 851 + #define PINMUX_GPIO129__FUNC_UFS_MPHY_SDA (MTK_PIN_NO(129) | 4) 852 + #define PINMUX_GPIO129__FUNC_mbistwriteen_trigger (MTK_PIN_NO(129) | 5) 853 + #define PINMUX_GPIO129__FUNC_MD32_1_GPIO1 (MTK_PIN_NO(129) | 6) 854 + #define PINMUX_GPIO129__FUNC_SCP_SDA2 (MTK_PIN_NO(129) | 7) 855 + 856 + #define PINMUX_GPIO130__FUNC_GPIO130 (MTK_PIN_NO(130) | 0) 857 + #define PINMUX_GPIO130__FUNC_IDDIG_1P (MTK_PIN_NO(130) | 1) 858 + #define PINMUX_GPIO130__FUNC_SPINOR_IO2 (MTK_PIN_NO(130) | 2) 859 + #define PINMUX_GPIO130__FUNC_SNFI_WP (MTK_PIN_NO(130) | 3) 860 + #define PINMUX_GPIO130__FUNC_VPU_UDI_NTRST (MTK_PIN_NO(130) | 4) 861 + 862 + #define PINMUX_GPIO131__FUNC_GPIO131 (MTK_PIN_NO(131) | 0) 863 + #define PINMUX_GPIO131__FUNC_USB_DRVVBUS_1P (MTK_PIN_NO(131) | 1) 864 + #define PINMUX_GPIO131__FUNC_SPINOR_IO3 (MTK_PIN_NO(131) | 2) 865 + #define PINMUX_GPIO131__FUNC_SNFI_HOLD (MTK_PIN_NO(131) | 3) 866 + #define PINMUX_GPIO131__FUNC_MD32_1_JTAG_TRST (MTK_PIN_NO(131) | 4) 867 + #define PINMUX_GPIO131__FUNC_SCP_JTAG0_TRSTN (MTK_PIN_NO(131) | 5) 868 + #define PINMUX_GPIO131__FUNC_APU_JTAG_TRST (MTK_PIN_NO(131) | 6) 869 + 870 + #define PINMUX_GPIO132__FUNC_GPIO132 (MTK_PIN_NO(132) | 0) 871 + #define PINMUX_GPIO132__FUNC_SPIM0_CSB (MTK_PIN_NO(132) | 1) 872 + #define PINMUX_GPIO132__FUNC_SCP_SPI0_CS (MTK_PIN_NO(132) | 2) 873 + #define PINMUX_GPIO132__FUNC_SPIS0_CSB (MTK_PIN_NO(132) | 3) 874 + #define PINMUX_GPIO132__FUNC_VPU_UDI_TMS (MTK_PIN_NO(132) | 4) 875 + #define PINMUX_GPIO132__FUNC_I2SO5_D0 (MTK_PIN_NO(132) | 6) 876 + 877 + #define PINMUX_GPIO133__FUNC_GPIO133 (MTK_PIN_NO(133) | 0) 878 + #define PINMUX_GPIO133__FUNC_SPIM0_CLK (MTK_PIN_NO(133) | 1) 879 + #define PINMUX_GPIO133__FUNC_SCP_SPI0_CK (MTK_PIN_NO(133) | 2) 880 + #define PINMUX_GPIO133__FUNC_SPIS0_CLK (MTK_PIN_NO(133) | 3) 881 + #define PINMUX_GPIO133__FUNC_VPU_UDI_TCK (MTK_PIN_NO(133) | 4) 882 + #define PINMUX_GPIO133__FUNC_I2SO5_BCK (MTK_PIN_NO(133) | 6) 883 + 884 + #define PINMUX_GPIO134__FUNC_GPIO134 (MTK_PIN_NO(134) | 0) 885 + #define PINMUX_GPIO134__FUNC_SPIM0_MO (MTK_PIN_NO(134) | 1) 886 + #define PINMUX_GPIO134__FUNC_SCP_SPI0_MO (MTK_PIN_NO(134) | 2) 887 + #define PINMUX_GPIO134__FUNC_SPIS0_SI (MTK_PIN_NO(134) | 3) 888 + #define PINMUX_GPIO134__FUNC_VPU_UDI_TDO (MTK_PIN_NO(134) | 4) 889 + #define PINMUX_GPIO134__FUNC_I2SO5_WS (MTK_PIN_NO(134) | 6) 890 + 891 + #define PINMUX_GPIO135__FUNC_GPIO135 (MTK_PIN_NO(135) | 0) 892 + #define PINMUX_GPIO135__FUNC_SPIM0_MI (MTK_PIN_NO(135) | 1) 893 + #define PINMUX_GPIO135__FUNC_SCP_SPI0_MI (MTK_PIN_NO(135) | 2) 894 + #define PINMUX_GPIO135__FUNC_SPIS0_SO (MTK_PIN_NO(135) | 3) 895 + #define PINMUX_GPIO135__FUNC_VPU_UDI_TDI (MTK_PIN_NO(135) | 4) 896 + #define PINMUX_GPIO135__FUNC_I2SO5_MCK (MTK_PIN_NO(135) | 6) 897 + 898 + #define PINMUX_GPIO136__FUNC_GPIO136 (MTK_PIN_NO(136) | 0) 899 + #define PINMUX_GPIO136__FUNC_SPIM1_CSB (MTK_PIN_NO(136) | 1) 900 + #define PINMUX_GPIO136__FUNC_SCP_SPI1_A_CS (MTK_PIN_NO(136) | 2) 901 + #define PINMUX_GPIO136__FUNC_SPIS1_CSB (MTK_PIN_NO(136) | 3) 902 + #define PINMUX_GPIO136__FUNC_MD32_1_JTAG_TMS (MTK_PIN_NO(136) | 4) 903 + #define PINMUX_GPIO136__FUNC_SCP_JTAG0_TMS (MTK_PIN_NO(136) | 5) 904 + #define PINMUX_GPIO136__FUNC_APU_JTAG_TMS (MTK_PIN_NO(136) | 6) 905 + #define PINMUX_GPIO136__FUNC_DBG_MON_A15 (MTK_PIN_NO(136) | 7) 906 + 907 + #define PINMUX_GPIO137__FUNC_GPIO137 (MTK_PIN_NO(137) | 0) 908 + #define PINMUX_GPIO137__FUNC_SPIM1_CLK (MTK_PIN_NO(137) | 1) 909 + #define PINMUX_GPIO137__FUNC_SCP_SPI1_A_CK (MTK_PIN_NO(137) | 2) 910 + #define PINMUX_GPIO137__FUNC_SPIS1_CLK (MTK_PIN_NO(137) | 3) 911 + #define PINMUX_GPIO137__FUNC_MD32_1_JTAG_TCK (MTK_PIN_NO(137) | 4) 912 + #define PINMUX_GPIO137__FUNC_SCP_JTAG0_TCK (MTK_PIN_NO(137) | 5) 913 + #define PINMUX_GPIO137__FUNC_APU_JTAG_TCK (MTK_PIN_NO(137) | 6) 914 + #define PINMUX_GPIO137__FUNC_DBG_MON_A14 (MTK_PIN_NO(137) | 7) 915 + 916 + #define PINMUX_GPIO138__FUNC_GPIO138 (MTK_PIN_NO(138) | 0) 917 + #define PINMUX_GPIO138__FUNC_SPIM1_MO (MTK_PIN_NO(138) | 1) 918 + #define PINMUX_GPIO138__FUNC_SCP_SPI1_A_MO (MTK_PIN_NO(138) | 2) 919 + #define PINMUX_GPIO138__FUNC_SPIS1_SI (MTK_PIN_NO(138) | 3) 920 + #define PINMUX_GPIO138__FUNC_MD32_1_JTAG_TDO (MTK_PIN_NO(138) | 4) 921 + #define PINMUX_GPIO138__FUNC_SCP_JTAG0_TDO (MTK_PIN_NO(138) | 5) 922 + #define PINMUX_GPIO138__FUNC_APU_JTAG_TDO (MTK_PIN_NO(138) | 6) 923 + #define PINMUX_GPIO138__FUNC_DBG_MON_A16 (MTK_PIN_NO(138) | 7) 924 + 925 + #define PINMUX_GPIO139__FUNC_GPIO139 (MTK_PIN_NO(139) | 0) 926 + #define PINMUX_GPIO139__FUNC_SPIM1_MI (MTK_PIN_NO(139) | 1) 927 + #define PINMUX_GPIO139__FUNC_SCP_SPI1_A_MI (MTK_PIN_NO(139) | 2) 928 + #define PINMUX_GPIO139__FUNC_SPIS1_SO (MTK_PIN_NO(139) | 3) 929 + #define PINMUX_GPIO139__FUNC_MD32_1_JTAG_TDI (MTK_PIN_NO(139) | 4) 930 + #define PINMUX_GPIO139__FUNC_SCP_JTAG0_TDI (MTK_PIN_NO(139) | 5) 931 + #define PINMUX_GPIO139__FUNC_APU_JTAG_TDI (MTK_PIN_NO(139) | 6) 932 + #define PINMUX_GPIO139__FUNC_DBG_MON_A17 (MTK_PIN_NO(139) | 7) 933 + 934 + #define PINMUX_GPIO140__FUNC_GPIO140 (MTK_PIN_NO(140) | 0) 935 + #define PINMUX_GPIO140__FUNC_SPIM2_CSB (MTK_PIN_NO(140) | 1) 936 + #define PINMUX_GPIO140__FUNC_SPINOR_CS (MTK_PIN_NO(140) | 2) 937 + #define PINMUX_GPIO140__FUNC_SNFI_CS (MTK_PIN_NO(140) | 3) 938 + #define PINMUX_GPIO140__FUNC_DMIC3_DAT (MTK_PIN_NO(140) | 4) 939 + #define PINMUX_GPIO140__FUNC_DBG_MON_A11 (MTK_PIN_NO(140) | 7) 940 + 941 + #define PINMUX_GPIO141__FUNC_GPIO141 (MTK_PIN_NO(141) | 0) 942 + #define PINMUX_GPIO141__FUNC_SPIM2_CLK (MTK_PIN_NO(141) | 1) 943 + #define PINMUX_GPIO141__FUNC_SPINOR_CK (MTK_PIN_NO(141) | 2) 944 + #define PINMUX_GPIO141__FUNC_SNFI_CLK (MTK_PIN_NO(141) | 3) 945 + #define PINMUX_GPIO141__FUNC_DMIC3_CLK (MTK_PIN_NO(141) | 4) 946 + #define PINMUX_GPIO141__FUNC_DBG_MON_A10 (MTK_PIN_NO(141) | 7) 947 + 948 + #define PINMUX_GPIO142__FUNC_GPIO142 (MTK_PIN_NO(142) | 0) 949 + #define PINMUX_GPIO142__FUNC_SPIM2_MO (MTK_PIN_NO(142) | 1) 950 + #define PINMUX_GPIO142__FUNC_SPINOR_IO0 (MTK_PIN_NO(142) | 2) 951 + #define PINMUX_GPIO142__FUNC_SNFI_MOSI (MTK_PIN_NO(142) | 3) 952 + #define PINMUX_GPIO142__FUNC_DMIC4_DAT (MTK_PIN_NO(142) | 4) 953 + #define PINMUX_GPIO142__FUNC_DBG_MON_A12 (MTK_PIN_NO(142) | 7) 954 + 955 + #define PINMUX_GPIO143__FUNC_GPIO143 (MTK_PIN_NO(143) | 0) 956 + #define PINMUX_GPIO143__FUNC_SPIM2_MI (MTK_PIN_NO(143) | 1) 957 + #define PINMUX_GPIO143__FUNC_SPINOR_IO1 (MTK_PIN_NO(143) | 2) 958 + #define PINMUX_GPIO143__FUNC_SNFI_MISO (MTK_PIN_NO(143) | 3) 959 + #define PINMUX_GPIO143__FUNC_DMIC4_CLK (MTK_PIN_NO(143) | 4) 960 + #define PINMUX_GPIO143__FUNC_DBG_MON_A13 (MTK_PIN_NO(143) | 7) 961 + 962 + #endif /* __MT8195-PINFUNC_H */
+19
include/dt-bindings/pinctrl/pinctrl-zynqmp.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * MIO pin configuration defines for Xilinx ZynqMP 4 + * 5 + * Copyright (C) 2020 Xilinx, Inc. 6 + */ 7 + 8 + #ifndef _DT_BINDINGS_PINCTRL_ZYNQMP_H 9 + #define _DT_BINDINGS_PINCTRL_ZYNQMP_H 10 + 11 + /* Bit value for different voltage levels */ 12 + #define IO_STANDARD_LVCMOS33 0 13 + #define IO_STANDARD_LVCMOS18 1 14 + 15 + /* Bit values for Slew Rates */ 16 + #define SLEW_RATE_FAST 0 17 + #define SLEW_RATE_SLOW 1 18 + 19 + #endif /* _DT_BINDINGS_PINCTRL_ZYNQMP_H */
+90
include/linux/firmware/xlnx-zynqmp.h
··· 72 72 PM_FPGA_LOAD = 22, 73 73 PM_FPGA_GET_STATUS = 23, 74 74 PM_GET_CHIPID = 24, 75 + PM_PINCTRL_REQUEST = 28, 76 + PM_PINCTRL_RELEASE = 29, 77 + PM_PINCTRL_GET_FUNCTION = 30, 78 + PM_PINCTRL_SET_FUNCTION = 31, 79 + PM_PINCTRL_CONFIG_PARAM_GET = 32, 80 + PM_PINCTRL_CONFIG_PARAM_SET = 33, 75 81 PM_IOCTL = 34, 76 82 PM_QUERY_DATA = 35, 77 83 PM_CLOCK_ENABLE = 36, ··· 128 122 PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS = 3, 129 123 PM_QID_CLOCK_GET_PARENTS = 4, 130 124 PM_QID_CLOCK_GET_ATTRIBUTES = 5, 125 + PM_QID_PINCTRL_GET_NUM_PINS = 6, 126 + PM_QID_PINCTRL_GET_NUM_FUNCTIONS = 7, 127 + PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS = 8, 128 + PM_QID_PINCTRL_GET_FUNCTION_NAME = 9, 129 + PM_QID_PINCTRL_GET_FUNCTION_GROUPS = 10, 130 + PM_QID_PINCTRL_GET_PIN_GROUPS = 11, 131 131 PM_QID_CLOCK_GET_NUM_CLOCKS = 12, 132 132 PM_QID_CLOCK_GET_MAX_DIVISOR = 13, 133 133 }; ··· 297 285 PM_DLL_RESET_PULSE = 2, 298 286 }; 299 287 288 + enum pm_pinctrl_config_param { 289 + PM_PINCTRL_CONFIG_SLEW_RATE = 0, 290 + PM_PINCTRL_CONFIG_BIAS_STATUS = 1, 291 + PM_PINCTRL_CONFIG_PULL_CTRL = 2, 292 + PM_PINCTRL_CONFIG_SCHMITT_CMOS = 3, 293 + PM_PINCTRL_CONFIG_DRIVE_STRENGTH = 4, 294 + PM_PINCTRL_CONFIG_VOLTAGE_STATUS = 5, 295 + PM_PINCTRL_CONFIG_TRI_STATE = 6, 296 + PM_PINCTRL_CONFIG_MAX = 7, 297 + }; 298 + 299 + enum pm_pinctrl_slew_rate { 300 + PM_PINCTRL_SLEW_RATE_FAST = 0, 301 + PM_PINCTRL_SLEW_RATE_SLOW = 1, 302 + }; 303 + 304 + enum pm_pinctrl_bias_status { 305 + PM_PINCTRL_BIAS_DISABLE = 0, 306 + PM_PINCTRL_BIAS_ENABLE = 1, 307 + }; 308 + 309 + enum pm_pinctrl_pull_ctrl { 310 + PM_PINCTRL_BIAS_PULL_DOWN = 0, 311 + PM_PINCTRL_BIAS_PULL_UP = 1, 312 + }; 313 + 314 + enum pm_pinctrl_schmitt_cmos { 315 + PM_PINCTRL_INPUT_TYPE_CMOS = 0, 316 + PM_PINCTRL_INPUT_TYPE_SCHMITT = 1, 317 + }; 318 + 319 + enum pm_pinctrl_drive_strength { 320 + PM_PINCTRL_DRIVE_STRENGTH_2MA = 0, 321 + PM_PINCTRL_DRIVE_STRENGTH_4MA = 1, 322 + PM_PINCTRL_DRIVE_STRENGTH_8MA = 2, 323 + PM_PINCTRL_DRIVE_STRENGTH_12MA = 3, 324 + }; 325 + 300 326 enum zynqmp_pm_shutdown_type { 301 327 ZYNQMP_PM_SHUTDOWN_TYPE_SHUTDOWN = 0, 302 328 ZYNQMP_PM_SHUTDOWN_TYPE_RESET = 1, ··· 403 353 int zynqmp_pm_read_pggs(u32 index, u32 *value); 404 354 int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype); 405 355 int zynqmp_pm_set_boot_health_status(u32 value); 356 + int zynqmp_pm_pinctrl_request(const u32 pin); 357 + int zynqmp_pm_pinctrl_release(const u32 pin); 358 + int zynqmp_pm_pinctrl_get_function(const u32 pin, u32 *id); 359 + int zynqmp_pm_pinctrl_set_function(const u32 pin, const u32 id); 360 + int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param, 361 + u32 *value); 362 + int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 363 + u32 value); 406 364 #else 407 365 static inline int zynqmp_pm_get_api_version(u32 *version) 408 366 { ··· 587 529 } 588 530 589 531 static inline int zynqmp_pm_set_boot_health_status(u32 value) 532 + { 533 + return -ENODEV; 534 + } 535 + 536 + static inline int zynqmp_pm_pinctrl_request(const u32 pin) 537 + { 538 + return -ENODEV; 539 + } 540 + 541 + static inline int zynqmp_pm_pinctrl_release(const u32 pin) 542 + { 543 + return -ENODEV; 544 + } 545 + 546 + static inline int zynqmp_pm_pinctrl_get_function(const u32 pin, u32 *id) 547 + { 548 + return -ENODEV; 549 + } 550 + 551 + static inline int zynqmp_pm_pinctrl_set_function(const u32 pin, const u32 id) 552 + { 553 + return -ENODEV; 554 + } 555 + 556 + static inline int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param, 557 + u32 *value) 558 + { 559 + return -ENODEV; 560 + } 561 + 562 + static inline int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 563 + u32 value) 590 564 { 591 565 return -ENODEV; 592 566 }
+9
include/linux/gpio/driver.h
··· 624 624 bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc, 625 625 unsigned int offset); 626 626 627 + #ifdef CONFIG_GPIOLIB_IRQCHIP 627 628 int gpiochip_irqchip_add_domain(struct gpio_chip *gc, 628 629 struct irq_domain *domain); 630 + #else 631 + static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc, 632 + struct irq_domain *domain) 633 + { 634 + WARN_ON(1); 635 + return -EINVAL; 636 + } 637 + #endif 629 638 630 639 int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset); 631 640 void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset);
+4
include/linux/gpio/regmap.h
··· 4 4 #define _LINUX_GPIO_REGMAP_H 5 5 6 6 struct device; 7 + struct fwnode_handle; 7 8 struct gpio_regmap; 8 9 struct irq_domain; 9 10 struct regmap; ··· 17 16 * @parent: The parent device 18 17 * @regmap: The regmap used to access the registers 19 18 * given, the name of the device is used 19 + * @fwnode: (Optional) The firmware node. 20 + * If not given, the fwnode of the parent is used. 20 21 * @label: (Optional) Descriptive name for GPIO controller. 21 22 * If not given, the name of the device is used. 22 23 * @ngpio: Number of GPIOs ··· 60 57 struct gpio_regmap_config { 61 58 struct device *parent; 62 59 struct regmap *regmap; 60 + struct fwnode_handle *fwnode; 63 61 64 62 const char *label; 65 63 int ngpio;
+6 -4
include/linux/pinctrl/pinconf-generic.h
··· 76 76 * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. 77 77 * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, 78 78 * schmitt-trigger mode is disabled. 79 - * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power 79 + * @PIN_CONFIG_MODE_LOW_POWER: this will configure the pin for low power 80 80 * operation, if several modes of operation are supported these can be 81 81 * passed in the argument on a custom form, else just use argument 1 82 82 * to indicate low power mode, argument 0 turns low power mode off. 83 + * @PIN_CONFIG_MODE_PWM: this will configure the pin for PWM 83 84 * @PIN_CONFIG_OUTPUT_ENABLE: this will enable the pin's output mode 84 85 * without driving a value there. For most platforms this reduces to 85 86 * enable the output buffers and then let the pin controller current ··· 91 90 * value on the line. Use argument 1 to indicate high level, argument 0 to 92 91 * indicate low level. (Please see Documentation/driver-api/pinctl.rst, 93 92 * section "GPIO mode pitfalls" for a discussion around this parameter.) 93 + * @PIN_CONFIG_PERSIST_STATE: retain pin state across sleep or controller reset 94 94 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 95 95 * supplies, the argument to this parameter (on a custom format) tells 96 96 * the driver which alternative power source to use. ··· 103 101 * or latch delay (on outputs) this parameter (in a custom format) 104 102 * specifies the clock skew or latch delay. It typically controls how 105 103 * many double inverters are put in front of the line. 106 - * @PIN_CONFIG_PERSIST_STATE: retain pin state across sleep or controller reset 107 104 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if 108 105 * you need to pass in custom configurations to the pin controller, use 109 106 * PIN_CONFIG_END+1 as the base offset. ··· 125 124 PIN_CONFIG_INPUT_ENABLE, 126 125 PIN_CONFIG_INPUT_SCHMITT, 127 126 PIN_CONFIG_INPUT_SCHMITT_ENABLE, 128 - PIN_CONFIG_LOW_POWER_MODE, 127 + PIN_CONFIG_MODE_LOW_POWER, 128 + PIN_CONFIG_MODE_PWM, 129 129 PIN_CONFIG_OUTPUT_ENABLE, 130 130 PIN_CONFIG_OUTPUT, 131 + PIN_CONFIG_PERSIST_STATE, 131 132 PIN_CONFIG_POWER_SOURCE, 132 133 PIN_CONFIG_SLEEP_HARDWARE_STATE, 133 134 PIN_CONFIG_SLEW_RATE, 134 135 PIN_CONFIG_SKEW_DELAY, 135 - PIN_CONFIG_PERSIST_STATE, 136 136 PIN_CONFIG_END = 0x7F, 137 137 PIN_CONFIG_MAX = 0xFF, 138 138 };
+1
kernel/irq/generic-chip.c
··· 200 200 irq_gc_unlock(gc); 201 201 return 0; 202 202 } 203 + EXPORT_SYMBOL_GPL(irq_gc_set_wake); 203 204 204 205 static u32 irq_readl_be(void __iomem *addr) 205 206 {