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

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

Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes, nothing too exciting about
this.

Some changes hit arch/sh and arch/arm but are well isolated and
acknowledged by the respective arch maintainers.

Core changes:

- Dropped the chained IRQ setup callback into GPIOLIB as we got rid
of the last users of that in this changeset.

New drivers:

- New driver for Ingenic X1830.

- New driver for Freescale i.MX8MP.

Driver enhancements:

- Fix all remaining Intel drivers to pass their IRQ chips along with
the GPIO chips.

- Intel Baytrail allocates its irqchip dynamically.

- Intel Lynxpoint is thoroughly rewritten and modernized.

- Aspeed AST2600 pin muxing and configuration is much improved.

- Qualcomm SC7180 functions are updated and wakeup interrupt map is
provided.

- A whole slew of Renesas SH-PFC cleanups and improvements.

- Fix up the Intel DT bindings to use the generic YAML DT bindings
schema (a first user of this)"

* tag 'pinctrl-v5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (99 commits)
pinctrl: madera: Remove extra blank line
pinctrl: qcom: Don't lock around irq_set_irq_wake()
pinctrl: mvebu: armada-37xx: use use platform api
gpio: Drop the chained IRQ handler assign function
pinctrl: freescale: Add i.MX8MP pinctrl driver support
dt-bindings: imx: Add pinctrl binding doc for i.MX8MP
pinctrl: tigerlake: Tiger Lake uses _HID enumeration
pinctrl: sunrisepoint: Add Coffee Lake-S ACPI ID
pinctrl: iproc: Use platform_get_irq_optional() to avoid error message
pinctrl: dt-bindings: Fix some errors in the lgm and pinmux schema
pinctrl: intel: Pass irqchip when adding gpiochip
pinctrl: intel: Add GPIO <-> pin mapping ranges via callback
pinctrl: baytrail: Replace WARN with dev_info_once when setting direct-irq pin to output
pinctrl: baytrail: Do not clear IRQ flags on direct-irq enabled pins
pinctrl: sunrisepoint: Add missing Interrupt Status register offset
pinctrl: sh-pfc: Split R-Car H3 support in two independent drivers
pinctrl: artpec6: fix __iomem on reg in set
pinctrl: ingenic: Use devm_platform_ioremap_resource()
pinctrl: ingenic: Factorize irq_set_type function
pinctrl: ingenic: Remove duplicated ingenic_chip_info structures
...

+3364 -1795
+5 -4
Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml
··· 54 54 TACH10, TACH11, TACH12, TACH13, TACH14, TACH15, TACH2, TACH3, 55 55 TACH4, TACH5, TACH6, TACH7, TACH8, TACH9, THRU0, THRU1, THRU2, 56 56 THRU3, TXD1, TXD2, TXD3, TXD4, UART10, UART11, UART12, UART13, 57 - UART6, UART7, UART8, UART9, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, 58 - WDTRST3, WDTRST4, ] 57 + UART6, UART7, UART8, UART9, USBAD, USBADP, USB2AH, USB2AHP, 58 + USB2BD, USB2BH, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, WDTRST3, 59 + WDTRST4, ] 59 60 groups: 60 61 allOf: 61 62 - $ref: "/schemas/types.yaml#/definitions/string" ··· 86 85 TACH10, TACH11, TACH12, TACH13, TACH14, TACH15, TACH2, TACH3, 87 86 TACH4, TACH5, TACH6, TACH7, TACH8, TACH9, THRU0, THRU1, THRU2, 88 87 THRU3, TXD1, TXD2, TXD3, TXD4, UART10, UART11, UART12G0, 89 - UART12G1, UART13G0, UART13G1, UART6, UART7, UART8, UART9, VB, 90 - VGAHS, VGAVS, WDTRST1, WDTRST2, WDTRST3, WDTRST4, ] 88 + UART12G1, UART13G0, UART13G1, UART6, UART7, UART8, UART9, USBA, 89 + USBB, VB, VGAHS, VGAVS, WDTRST1, WDTRST2, WDTRST3, WDTRST4, ] 91 90 92 91 required: 93 92 - compatible
+69
Documentation/devicetree/bindings/pinctrl/fsl,imx8mp-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/fsl,imx8mp-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Freescale IMX8MP IOMUX Controller 8 + 9 + maintainers: 10 + - Anson Huang <Anson.Huang@nxp.com> 11 + 12 + description: 13 + Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory 14 + for common binding part and usage. 15 + 16 + properties: 17 + compatible: 18 + const: fsl,imx8mp-iomuxc 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + # Client device subnode's properties 24 + patternProperties: 25 + 'grp$': 26 + type: object 27 + description: 28 + Pinctrl node's client devices use subnodes for desired pin configuration. 29 + Client device subnodes use below standard properties. 30 + 31 + properties: 32 + fsl,pins: 33 + allOf: 34 + - $ref: /schemas/types.yaml#/definitions/uint32-array 35 + description: 36 + each entry consists of 6 integers and represents the mux and config 37 + setting for one pin. The first 5 integers <mux_reg conf_reg input_reg 38 + mux_val input_val> are specified using a PIN_FUNC_ID macro, which can 39 + be found in <arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h>. The last 40 + integer CONFIG is the pad setting value like pull-up on this pin. Please 41 + refer to i.MX8M Plus Reference Manual for detailed CONFIG settings. 42 + 43 + required: 44 + - fsl,pins 45 + 46 + additionalProperties: false 47 + 48 + required: 49 + - compatible 50 + - reg 51 + 52 + additionalProperties: false 53 + 54 + examples: 55 + # Pinmux controller node 56 + - | 57 + iomuxc: pinctrl@30330000 { 58 + compatible = "fsl,imx8mp-iomuxc"; 59 + reg = <0x30330000 0x10000>; 60 + 61 + pinctrl_uart2: uart2grp { 62 + fsl,pins = < 63 + 0x228 0x488 0x5F0 0x0 0x6 0x49 64 + 0x228 0x488 0x000 0x0 0x0 0x49 65 + >; 66 + }; 67 + }; 68 + 69 + ...
+5 -3
Documentation/devicetree/bindings/pinctrl/ingenic,pinctrl.txt
··· 10 10 naming scheme "PxN" where x is a character identifying the GPIO port with 11 11 which the pin is associated and N is an integer from 0 to 31 identifying the 12 12 pin within that GPIO port. For example PA0 is the first pin in GPIO port A, and 13 - PB31 is the last pin in GPIO port B. The jz4740 and the x1000 contains 4 GPIO 14 - ports, PA to PD, for a total of 128 pins. The jz4760, the jz4770 and the jz4780 15 - contains 6 GPIO ports, PA to PF, for a total of 192 pins. 13 + PB31 is the last pin in GPIO port B. The jz4740, the x1000 and the x1830 14 + contains 4 GPIO ports, PA to PD, for a total of 128 pins. The jz4760, the 15 + jz4770 and the jz4780 contains 6 GPIO ports, PA to PF, for a total of 192 pins. 16 16 17 17 18 18 Required properties: ··· 28 28 - "ingenic,x1000-pinctrl" 29 29 - "ingenic,x1000e-pinctrl" 30 30 - "ingenic,x1500-pinctrl" 31 + - "ingenic,x1830-pinctrl" 31 32 - reg: Address range of the pinctrl registers. 32 33 33 34 ··· 41 40 - "ingenic,jz4770-gpio" 42 41 - "ingenic,jz4780-gpio" 43 42 - "ingenic,x1000-gpio" 43 + - "ingenic,x1830-gpio" 44 44 - reg: The GPIO bank number. 45 45 - interrupt-controller: Marks the device node as an interrupt controller. 46 46 - interrupts: Interrupt specifier for the controllers interrupt.
+75
Documentation/devicetree/bindings/pinctrl/intel,lgm-io.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/intel,lgm-io.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Intel Lightning Mountain SoC pinmux & GPIO controller binding 8 + 9 + maintainers: 10 + - Rahul Tanwar <rahul.tanwar@linux.intel.com> 11 + 12 + description: | 13 + Pinmux & GPIO controller controls pin multiplexing & configuration including 14 + GPIO function selection & GPIO attributes configuration. 15 + 16 + properties: 17 + compatible: 18 + const: intel,lgm-io 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + # Client device subnode's properties 24 + patternProperties: 25 + '-pins$': 26 + type: object 27 + allOf: 28 + - $ref: pincfg-node.yaml# 29 + - $ref: pinmux-node.yaml# 30 + description: 31 + Pinctrl node's client devices use subnodes for desired pin configuration. 32 + Client device subnodes use below standard properties. 33 + 34 + properties: 35 + function: true 36 + groups: true 37 + pins: true 38 + pinmux: true 39 + bias-pull-up: true 40 + bias-pull-down: true 41 + drive-strength: true 42 + slew-rate: true 43 + drive-open-drain: true 44 + output-enable: true 45 + 46 + required: 47 + - function 48 + - groups 49 + 50 + additionalProperties: false 51 + 52 + required: 53 + - compatible 54 + - reg 55 + 56 + additionalProperties: false 57 + 58 + examples: 59 + # Pinmux controller node 60 + - | 61 + pinctrl: pinctrl@e2880000 { 62 + compatible = "intel,lgm-io"; 63 + reg = <0xe2880000 0x100000>; 64 + 65 + uart0-pins { 66 + pins = <64>, /* UART_RX0 */ 67 + <65>; /* UART_TX0 */ 68 + function = "CONSOLE_UART0"; 69 + pinmux = <1>, 70 + <1>; 71 + groups = "CONSOLE_UART0"; 72 + }; 73 + }; 74 + 75 + ...
-116
Documentation/devicetree/bindings/pinctrl/intel,lgm-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/bindings/pinctrl/intel,lgm-pinctrl.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Intel Lightning Mountain SoC pinmux & GPIO controller binding 8 - 9 - maintainers: 10 - - Rahul Tanwar <rahul.tanwar@linux.intel.com> 11 - 12 - description: | 13 - Pinmux & GPIO controller controls pin multiplexing & configuration including 14 - GPIO function selection & GPIO attributes configuration. 15 - 16 - Please refer to [1] for details of the common pinctrl bindings used by the 17 - client devices. 18 - 19 - [1] Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt 20 - 21 - properties: 22 - compatible: 23 - const: intel,lgm-io 24 - 25 - reg: 26 - maxItems: 1 27 - 28 - # Client device subnode's properties 29 - patternProperties: 30 - '-pins$': 31 - type: object 32 - description: 33 - Pinctrl node's client devices use subnodes for desired pin configuration. 34 - Client device subnodes use below standard properties. 35 - 36 - properties: 37 - function: 38 - $ref: /schemas/types.yaml#/definitions/string 39 - description: 40 - A string containing the name of the function to mux to the group. 41 - 42 - groups: 43 - $ref: /schemas/types.yaml#/definitions/string-array 44 - description: 45 - An array of strings identifying the list of groups. 46 - 47 - pins: 48 - $ref: /schemas/types.yaml#/definitions/uint32-array 49 - description: 50 - List of pins to select with this function. 51 - 52 - pinmux: 53 - description: The applicable mux group. 54 - allOf: 55 - - $ref: "/schemas/types.yaml#/definitions/uint32-array" 56 - 57 - bias-pull-up: 58 - type: boolean 59 - 60 - bias-pull-down: 61 - type: boolean 62 - 63 - drive-strength: 64 - description: | 65 - Selects the drive strength for the specified pins in mA. 66 - 0: 2 mA 67 - 1: 4 mA 68 - 2: 8 mA 69 - 3: 12 mA 70 - allOf: 71 - - $ref: /schemas/types.yaml#/definitions/uint32 72 - - enum: [0, 1, 2, 3] 73 - 74 - slew-rate: 75 - type: boolean 76 - description: | 77 - Sets slew rate for specified pins. 78 - 0: slow slew 79 - 1: fast slew 80 - 81 - drive-open-drain: 82 - type: boolean 83 - 84 - output-enable: 85 - type: boolean 86 - 87 - required: 88 - - function 89 - - groups 90 - 91 - additionalProperties: false 92 - 93 - required: 94 - - compatible 95 - - reg 96 - 97 - additionalProperties: false 98 - 99 - examples: 100 - # Pinmux controller node 101 - - | 102 - pinctrl: pinctrl@e2880000 { 103 - compatible = "intel,lgm-pinctrl"; 104 - reg = <0xe2880000 0x100000>; 105 - 106 - uart0-pins { 107 - pins = <64>, /* UART_RX0 */ 108 - <65>; /* UART_TX0 */ 109 - function = "CONSOLE_UART0"; 110 - pinmux = <1>, 111 - <1>; 112 - groups = "CONSOLE_UART0"; 113 - }; 114 - }; 115 - 116 - ...
+1 -1
Documentation/devicetree/bindings/pinctrl/pinmux-node.yaml
··· 114 114 specific binding for the hardware defines whether the entries are integers 115 115 or strings, and their meaning. 116 116 117 - group: 117 + groups: 118 118 $ref: /schemas/types.yaml#/definitions/string-array 119 119 description: 120 120 the group to apply the properties to, if the driver supports
+3 -2
Documentation/devicetree/bindings/pinctrl/qcom,sc7180-pinctrl.txt
··· 125 125 mi2s_1, mi2s_2, mss_lte, m_voc, pa_indicator, phase_flag, 126 126 PLL_BIST, pll_bypassnl, pll_reset, prng_rosc, qdss, 127 127 qdss_cti, qlink_enable, qlink_request, qspi_clk, qspi_cs, 128 - qspi_data, qup00, qup01, qup02, qup03, qup04, qup05, 129 - qup10, qup11, qup12, qup13, qup14, qup15, sdc1_tb, 128 + qspi_data, qup00, qup01, qup02_i2c, qup02_uart, qup03, 129 + qup04_i2c, qup04_uart, qup05, qup10, qup11_i2c, qup11_uart, 130 + qup12, qup13_i2c, qup13_uart, qup14, qup15, sdc1_tb, 130 131 sdc2_tb, sd_write, sp_cmu, tgu_ch0, tgu_ch1, tgu_ch2, 131 132 tgu_ch3, tsense_pwm1, tsense_pwm2, uim1, uim2, uim_batt, 132 133 usb_phy, vfr_1, _V_GPIO, _V_PPS_IN, _V_PPS_OUT,
-5
Documentation/driver-api/gpio/driver.rst
··· 507 507 cascaded irq has to be handled by a threaded interrupt handler. 508 508 Apart from that it works exactly like the chained irqchip. 509 509 510 - - DEPRECATED: gpiochip_set_chained_irqchip(): sets up a chained cascaded irq 511 - handler for a gpio_chip from a parent IRQ and passes the struct gpio_chip* 512 - as handler data. Notice that we pass is as the handler data, since the 513 - irqchip data is likely used by the parent irqchip. 514 - 515 510 - gpiochip_set_nested_irqchip(): sets up a nested cascaded irq handler for a 516 511 gpio_chip from a parent IRQ. As the parent IRQ has usually been 517 512 explicitly requested by the driver, this does very little more than
-1
MAINTAINERS
··· 8383 8383 T: git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git 8384 8384 F: drivers/gpio/gpio-ich.c 8385 8385 F: drivers/gpio/gpio-intel-mid.c 8386 - F: drivers/gpio/gpio-lynxpoint.c 8387 8386 F: drivers/gpio/gpio-merrifield.c 8388 8387 F: drivers/gpio/gpio-ml-ioh.c 8389 8388 F: drivers/gpio/gpio-pch.c
+1 -1
arch/arm/mach-u300/core.c
··· 201 201 }; 202 202 203 203 /* Pin control settings */ 204 - static struct pinctrl_map __initdata u300_pinmux_map[] = { 204 + static const struct pinctrl_map u300_pinmux_map[] = { 205 205 /* anonymous maps for chip power and EMIFs */ 206 206 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"), 207 207 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "emif0"),
-6
arch/sh/include/cpu-sh2a/cpu/sh7264.h
··· 112 112 GPIO_FN_TIOC0D, GPIO_FN_TIOC0C, GPIO_FN_TIOC0B, GPIO_FN_TIOC0A, 113 113 GPIO_FN_TCLKD, GPIO_FN_TCLKC, GPIO_FN_TCLKB, GPIO_FN_TCLKA, 114 114 115 - /* SSU */ 116 - GPIO_FN_SCS0_PD, GPIO_FN_SSO0_PD, GPIO_FN_SSI0_PD, GPIO_FN_SSCK0_PD, 117 - GPIO_FN_SCS0_PF, GPIO_FN_SSO0_PF, GPIO_FN_SSI0_PF, GPIO_FN_SSCK0_PF, 118 - GPIO_FN_SCS1_PD, GPIO_FN_SSO1_PD, GPIO_FN_SSI1_PD, GPIO_FN_SSCK1_PD, 119 - GPIO_FN_SCS1_PF, GPIO_FN_SSO1_PF, GPIO_FN_SSI1_PF, GPIO_FN_SSCK1_PF, 120 - 121 115 /* SCIF */ 122 116 GPIO_FN_SCK0, GPIO_FN_SCK1, GPIO_FN_SCK2, GPIO_FN_SCK3, 123 117 GPIO_FN_RXD0, GPIO_FN_RXD1, GPIO_FN_RXD2, GPIO_FN_RXD3,
+9 -8
arch/sh/include/cpu-sh2a/cpu/sh7269.h
··· 78 78 GPIO_FN_WDTOVF, 79 79 80 80 /* CAN */ 81 - GPIO_FN_CTX1, GPIO_FN_CRX1, GPIO_FN_CTX0, GPIO_FN_CTX0_CTX1, 82 - GPIO_FN_CRX0, GPIO_FN_CRX0_CRX1, GPIO_FN_CRX0_CRX1_CRX2, 81 + GPIO_FN_CTX2, GPIO_FN_CRX2, 82 + GPIO_FN_CTX1, GPIO_FN_CRX1, 83 + GPIO_FN_CTX0, GPIO_FN_CRX0, 84 + GPIO_FN_CTX0_CTX1, GPIO_FN_CRX0_CRX1, 85 + GPIO_FN_CTX0_CTX1_CTX2, GPIO_FN_CRX0_CRX1_CRX2, 86 + GPIO_FN_CTX2_PJ21, GPIO_FN_CRX2_PJ20, 87 + GPIO_FN_CTX1_PJ23, GPIO_FN_CRX1_PJ22, 88 + GPIO_FN_CTX0_CTX1_PJ23, GPIO_FN_CRX0_CRX1_PJ22, 89 + GPIO_FN_CTX0_CTX1_CTX2_PJ21, GPIO_FN_CRX0_CRX1_CRX2_PJ20, 83 90 84 91 /* DMAC */ 85 92 GPIO_FN_TEND0, GPIO_FN_DACK0, GPIO_FN_DREQ0, ··· 125 118 GPIO_FN_TIOC2B, GPIO_FN_TIOC1B, GPIO_FN_TIOC2A, GPIO_FN_TIOC1A, 126 119 GPIO_FN_TIOC0D, GPIO_FN_TIOC0C, GPIO_FN_TIOC0B, GPIO_FN_TIOC0A, 127 120 GPIO_FN_TCLKD, GPIO_FN_TCLKC, GPIO_FN_TCLKB, GPIO_FN_TCLKA, 128 - 129 - /* SSU */ 130 - GPIO_FN_SCS0_PD, GPIO_FN_SSO0_PD, GPIO_FN_SSI0_PD, GPIO_FN_SSCK0_PD, 131 - GPIO_FN_SCS0_PF, GPIO_FN_SSO0_PF, GPIO_FN_SSI0_PF, GPIO_FN_SSCK0_PF, 132 - GPIO_FN_SCS1_PD, GPIO_FN_SSO1_PD, GPIO_FN_SSI1_PD, GPIO_FN_SSCK1_PD, 133 - GPIO_FN_SCS1_PF, GPIO_FN_SSO1_PF, GPIO_FN_SSI1_PF, GPIO_FN_SSCK1_PF, 134 121 135 122 /* SCIF */ 136 123 GPIO_FN_SCK0, GPIO_FN_RXD0, GPIO_FN_TXD0,
-8
drivers/gpio/Kconfig
··· 341 341 Select this option to enable GPIO driver for 342 342 NXP LPC32XX devices. 343 343 344 - config GPIO_LYNXPOINT 345 - tristate "Intel Lynxpoint GPIO support" 346 - depends on ACPI && X86 347 - select GPIOLIB_IRQCHIP 348 - help 349 - driver for GPIO functionality on Intel Lynxpoint PCH chipset 350 - Requires ACPI device enumeration code to set up a platform device. 351 - 352 344 config GPIO_MB86S7X 353 345 tristate "GPIO support for Fujitsu MB86S7x Platforms" 354 346 help
-1
drivers/gpio/Makefile
··· 77 77 obj-$(CONFIG_GPIO_LP87565) += gpio-lp87565.o 78 78 obj-$(CONFIG_GPIO_LPC18XX) += gpio-lpc18xx.o 79 79 obj-$(CONFIG_GPIO_LPC32XX) += gpio-lpc32xx.o 80 - obj-$(CONFIG_GPIO_LYNXPOINT) += gpio-lynxpoint.o 81 80 obj-$(CONFIG_GPIO_MADERA) += gpio-madera.o 82 81 obj-$(CONFIG_GPIO_MAX3191X) += gpio-max3191x.o 83 82 obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o
-471
drivers/gpio/gpio-lynxpoint.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * GPIO controller driver for Intel Lynxpoint PCH chipset> 4 - * Copyright (c) 2012, Intel Corporation. 5 - * 6 - * Author: Mathias Nyman <mathias.nyman@linux.intel.com> 7 - */ 8 - 9 - #include <linux/acpi.h> 10 - #include <linux/bitops.h> 11 - #include <linux/gpio/driver.h> 12 - #include <linux/interrupt.h> 13 - #include <linux/io.h> 14 - #include <linux/kernel.h> 15 - #include <linux/module.h> 16 - #include <linux/platform_device.h> 17 - #include <linux/pm_runtime.h> 18 - #include <linux/slab.h> 19 - #include <linux/types.h> 20 - 21 - /* LynxPoint chipset has support for 94 gpio pins */ 22 - 23 - #define LP_NUM_GPIO 94 24 - 25 - /* Bitmapped register offsets */ 26 - #define LP_ACPI_OWNED 0x00 /* Bitmap, set by bios, 0: pin reserved for ACPI */ 27 - #define LP_GC 0x7C /* set APIC IRQ to IRQ14 or IRQ15 for all pins */ 28 - #define LP_INT_STAT 0x80 29 - #define LP_INT_ENABLE 0x90 30 - 31 - /* Each pin has two 32 bit config registers, starting at 0x100 */ 32 - #define LP_CONFIG1 0x100 33 - #define LP_CONFIG2 0x104 34 - 35 - /* LP_CONFIG1 reg bits */ 36 - #define OUT_LVL_BIT BIT(31) 37 - #define IN_LVL_BIT BIT(30) 38 - #define TRIG_SEL_BIT BIT(4) /* 0: Edge, 1: Level */ 39 - #define INT_INV_BIT BIT(3) /* Invert interrupt triggering */ 40 - #define DIR_BIT BIT(2) /* 0: Output, 1: Input */ 41 - #define USE_SEL_BIT BIT(0) /* 0: Native, 1: GPIO */ 42 - 43 - /* LP_CONFIG2 reg bits */ 44 - #define GPINDIS_BIT BIT(2) /* disable input sensing */ 45 - #define GPIWP_BIT (BIT(0) | BIT(1)) /* weak pull options */ 46 - 47 - struct lp_gpio { 48 - struct gpio_chip chip; 49 - struct platform_device *pdev; 50 - spinlock_t lock; 51 - unsigned long reg_base; 52 - }; 53 - 54 - /* 55 - * Lynxpoint gpios are controlled through both bitmapped registers and 56 - * per gpio specific registers. The bitmapped registers are in chunks of 57 - * 3 x 32bit registers to cover all 94 gpios 58 - * 59 - * per gpio specific registers consist of two 32bit registers per gpio 60 - * (LP_CONFIG1 and LP_CONFIG2), with 94 gpios there's a total of 61 - * 188 config registers. 62 - * 63 - * A simplified view of the register layout look like this: 64 - * 65 - * LP_ACPI_OWNED[31:0] gpio ownerships for gpios 0-31 (bitmapped registers) 66 - * LP_ACPI_OWNED[63:32] gpio ownerships for gpios 32-63 67 - * LP_ACPI_OWNED[94:64] gpio ownerships for gpios 63-94 68 - * ... 69 - * LP_INT_ENABLE[31:0] ... 70 - * LP_INT_ENABLE[63:31] ... 71 - * LP_INT_ENABLE[94:64] ... 72 - * LP0_CONFIG1 (gpio 0) config1 reg for gpio 0 (per gpio registers) 73 - * LP0_CONFIG2 (gpio 0) config2 reg for gpio 0 74 - * LP1_CONFIG1 (gpio 1) config1 reg for gpio 1 75 - * LP1_CONFIG2 (gpio 1) config2 reg for gpio 1 76 - * LP2_CONFIG1 (gpio 2) ... 77 - * LP2_CONFIG2 (gpio 2) ... 78 - * ... 79 - * LP94_CONFIG1 (gpio 94) ... 80 - * LP94_CONFIG2 (gpio 94) ... 81 - */ 82 - 83 - static unsigned long lp_gpio_reg(struct gpio_chip *chip, unsigned offset, 84 - int reg) 85 - { 86 - struct lp_gpio *lg = gpiochip_get_data(chip); 87 - int reg_offset; 88 - 89 - if (reg == LP_CONFIG1 || reg == LP_CONFIG2) 90 - /* per gpio specific config registers */ 91 - reg_offset = offset * 8; 92 - else 93 - /* bitmapped registers */ 94 - reg_offset = (offset / 32) * 4; 95 - 96 - return lg->reg_base + reg + reg_offset; 97 - } 98 - 99 - static int lp_gpio_request(struct gpio_chip *chip, unsigned offset) 100 - { 101 - struct lp_gpio *lg = gpiochip_get_data(chip); 102 - unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 103 - unsigned long conf2 = lp_gpio_reg(chip, offset, LP_CONFIG2); 104 - unsigned long acpi_use = lp_gpio_reg(chip, offset, LP_ACPI_OWNED); 105 - 106 - pm_runtime_get(&lg->pdev->dev); /* should we put if failed */ 107 - 108 - /* Fail if BIOS reserved pin for ACPI use */ 109 - if (!(inl(acpi_use) & BIT(offset % 32))) { 110 - dev_err(&lg->pdev->dev, "gpio %d reserved for ACPI\n", offset); 111 - return -EBUSY; 112 - } 113 - /* Fail if pin is in alternate function mode (not GPIO mode) */ 114 - if (!(inl(reg) & USE_SEL_BIT)) 115 - return -ENODEV; 116 - 117 - /* enable input sensing */ 118 - outl(inl(conf2) & ~GPINDIS_BIT, conf2); 119 - 120 - 121 - return 0; 122 - } 123 - 124 - static void lp_gpio_free(struct gpio_chip *chip, unsigned offset) 125 - { 126 - struct lp_gpio *lg = gpiochip_get_data(chip); 127 - unsigned long conf2 = lp_gpio_reg(chip, offset, LP_CONFIG2); 128 - 129 - /* disable input sensing */ 130 - outl(inl(conf2) | GPINDIS_BIT, conf2); 131 - 132 - pm_runtime_put(&lg->pdev->dev); 133 - } 134 - 135 - static int lp_irq_type(struct irq_data *d, unsigned type) 136 - { 137 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 138 - struct lp_gpio *lg = gpiochip_get_data(gc); 139 - u32 hwirq = irqd_to_hwirq(d); 140 - unsigned long flags; 141 - u32 value; 142 - unsigned long reg = lp_gpio_reg(&lg->chip, hwirq, LP_CONFIG1); 143 - 144 - if (hwirq >= lg->chip.ngpio) 145 - return -EINVAL; 146 - 147 - spin_lock_irqsave(&lg->lock, flags); 148 - value = inl(reg); 149 - 150 - /* set both TRIG_SEL and INV bits to 0 for rising edge */ 151 - if (type & IRQ_TYPE_EDGE_RISING) 152 - value &= ~(TRIG_SEL_BIT | INT_INV_BIT); 153 - 154 - /* TRIG_SEL bit 0, INV bit 1 for falling edge */ 155 - if (type & IRQ_TYPE_EDGE_FALLING) 156 - value = (value | INT_INV_BIT) & ~TRIG_SEL_BIT; 157 - 158 - /* TRIG_SEL bit 1, INV bit 0 for level low */ 159 - if (type & IRQ_TYPE_LEVEL_LOW) 160 - value = (value | TRIG_SEL_BIT) & ~INT_INV_BIT; 161 - 162 - /* TRIG_SEL bit 1, INV bit 1 for level high */ 163 - if (type & IRQ_TYPE_LEVEL_HIGH) 164 - value |= TRIG_SEL_BIT | INT_INV_BIT; 165 - 166 - outl(value, reg); 167 - 168 - if (type & IRQ_TYPE_EDGE_BOTH) 169 - irq_set_handler_locked(d, handle_edge_irq); 170 - else if (type & IRQ_TYPE_LEVEL_MASK) 171 - irq_set_handler_locked(d, handle_level_irq); 172 - 173 - spin_unlock_irqrestore(&lg->lock, flags); 174 - 175 - return 0; 176 - } 177 - 178 - static int lp_gpio_get(struct gpio_chip *chip, unsigned offset) 179 - { 180 - unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 181 - return !!(inl(reg) & IN_LVL_BIT); 182 - } 183 - 184 - static void lp_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 185 - { 186 - struct lp_gpio *lg = gpiochip_get_data(chip); 187 - unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 188 - unsigned long flags; 189 - 190 - spin_lock_irqsave(&lg->lock, flags); 191 - 192 - if (value) 193 - outl(inl(reg) | OUT_LVL_BIT, reg); 194 - else 195 - outl(inl(reg) & ~OUT_LVL_BIT, reg); 196 - 197 - spin_unlock_irqrestore(&lg->lock, flags); 198 - } 199 - 200 - static int lp_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 201 - { 202 - struct lp_gpio *lg = gpiochip_get_data(chip); 203 - unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 204 - unsigned long flags; 205 - 206 - spin_lock_irqsave(&lg->lock, flags); 207 - outl(inl(reg) | DIR_BIT, reg); 208 - spin_unlock_irqrestore(&lg->lock, flags); 209 - 210 - return 0; 211 - } 212 - 213 - static int lp_gpio_direction_output(struct gpio_chip *chip, 214 - unsigned offset, int value) 215 - { 216 - struct lp_gpio *lg = gpiochip_get_data(chip); 217 - unsigned long reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 218 - unsigned long flags; 219 - 220 - lp_gpio_set(chip, offset, value); 221 - 222 - spin_lock_irqsave(&lg->lock, flags); 223 - outl(inl(reg) & ~DIR_BIT, reg); 224 - spin_unlock_irqrestore(&lg->lock, flags); 225 - 226 - return 0; 227 - } 228 - 229 - static void lp_gpio_irq_handler(struct irq_desc *desc) 230 - { 231 - struct irq_data *data = irq_desc_get_irq_data(desc); 232 - struct gpio_chip *gc = irq_desc_get_handler_data(desc); 233 - struct lp_gpio *lg = gpiochip_get_data(gc); 234 - struct irq_chip *chip = irq_data_get_irq_chip(data); 235 - unsigned long reg, ena, pending; 236 - u32 base, pin; 237 - 238 - /* check from GPIO controller which pin triggered the interrupt */ 239 - for (base = 0; base < lg->chip.ngpio; base += 32) { 240 - reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); 241 - ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); 242 - 243 - /* Only interrupts that are enabled */ 244 - pending = inl(reg) & inl(ena); 245 - 246 - for_each_set_bit(pin, &pending, 32) { 247 - unsigned irq; 248 - 249 - /* Clear before handling so we don't lose an edge */ 250 - outl(BIT(pin), reg); 251 - 252 - irq = irq_find_mapping(lg->chip.irq.domain, base + pin); 253 - generic_handle_irq(irq); 254 - } 255 - } 256 - chip->irq_eoi(data); 257 - } 258 - 259 - static void lp_irq_unmask(struct irq_data *d) 260 - { 261 - } 262 - 263 - static void lp_irq_mask(struct irq_data *d) 264 - { 265 - } 266 - 267 - static void lp_irq_enable(struct irq_data *d) 268 - { 269 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 270 - struct lp_gpio *lg = gpiochip_get_data(gc); 271 - u32 hwirq = irqd_to_hwirq(d); 272 - unsigned long reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); 273 - unsigned long flags; 274 - 275 - spin_lock_irqsave(&lg->lock, flags); 276 - outl(inl(reg) | BIT(hwirq % 32), reg); 277 - spin_unlock_irqrestore(&lg->lock, flags); 278 - } 279 - 280 - static void lp_irq_disable(struct irq_data *d) 281 - { 282 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 283 - struct lp_gpio *lg = gpiochip_get_data(gc); 284 - u32 hwirq = irqd_to_hwirq(d); 285 - unsigned long reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); 286 - unsigned long flags; 287 - 288 - spin_lock_irqsave(&lg->lock, flags); 289 - outl(inl(reg) & ~BIT(hwirq % 32), reg); 290 - spin_unlock_irqrestore(&lg->lock, flags); 291 - } 292 - 293 - static struct irq_chip lp_irqchip = { 294 - .name = "LP-GPIO", 295 - .irq_mask = lp_irq_mask, 296 - .irq_unmask = lp_irq_unmask, 297 - .irq_enable = lp_irq_enable, 298 - .irq_disable = lp_irq_disable, 299 - .irq_set_type = lp_irq_type, 300 - .flags = IRQCHIP_SKIP_SET_WAKE, 301 - }; 302 - 303 - static int lp_gpio_irq_init_hw(struct gpio_chip *chip) 304 - { 305 - struct lp_gpio *lg = gpiochip_get_data(chip); 306 - unsigned long reg; 307 - unsigned base; 308 - 309 - for (base = 0; base < lg->chip.ngpio; base += 32) { 310 - /* disable gpio pin interrupts */ 311 - reg = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); 312 - outl(0, reg); 313 - /* Clear interrupt status register */ 314 - reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); 315 - outl(0xffffffff, reg); 316 - } 317 - 318 - return 0; 319 - } 320 - 321 - static int lp_gpio_probe(struct platform_device *pdev) 322 - { 323 - struct lp_gpio *lg; 324 - struct gpio_chip *gc; 325 - struct resource *io_rc, *irq_rc; 326 - struct device *dev = &pdev->dev; 327 - unsigned long reg_len; 328 - int ret = -ENODEV; 329 - 330 - lg = devm_kzalloc(dev, sizeof(struct lp_gpio), GFP_KERNEL); 331 - if (!lg) 332 - return -ENOMEM; 333 - 334 - lg->pdev = pdev; 335 - platform_set_drvdata(pdev, lg); 336 - 337 - io_rc = platform_get_resource(pdev, IORESOURCE_IO, 0); 338 - irq_rc = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 339 - 340 - if (!io_rc) { 341 - dev_err(dev, "missing IO resources\n"); 342 - return -EINVAL; 343 - } 344 - 345 - lg->reg_base = io_rc->start; 346 - reg_len = resource_size(io_rc); 347 - 348 - if (!devm_request_region(dev, lg->reg_base, reg_len, "lp-gpio")) { 349 - dev_err(dev, "failed requesting IO region 0x%x\n", 350 - (unsigned int)lg->reg_base); 351 - return -EBUSY; 352 - } 353 - 354 - spin_lock_init(&lg->lock); 355 - 356 - gc = &lg->chip; 357 - gc->label = dev_name(dev); 358 - gc->owner = THIS_MODULE; 359 - gc->request = lp_gpio_request; 360 - gc->free = lp_gpio_free; 361 - gc->direction_input = lp_gpio_direction_input; 362 - gc->direction_output = lp_gpio_direction_output; 363 - gc->get = lp_gpio_get; 364 - gc->set = lp_gpio_set; 365 - gc->base = -1; 366 - gc->ngpio = LP_NUM_GPIO; 367 - gc->can_sleep = false; 368 - gc->parent = dev; 369 - 370 - /* set up interrupts */ 371 - if (irq_rc && irq_rc->start) { 372 - struct gpio_irq_chip *girq; 373 - 374 - girq = &gc->irq; 375 - girq->chip = &lp_irqchip; 376 - girq->init_hw = lp_gpio_irq_init_hw; 377 - girq->parent_handler = lp_gpio_irq_handler; 378 - girq->num_parents = 1; 379 - girq->parents = devm_kcalloc(&pdev->dev, girq->num_parents, 380 - sizeof(*girq->parents), 381 - GFP_KERNEL); 382 - if (!girq->parents) 383 - return -ENOMEM; 384 - girq->parents[0] = (unsigned)irq_rc->start; 385 - girq->default_type = IRQ_TYPE_NONE; 386 - girq->handler = handle_bad_irq; 387 - } 388 - 389 - ret = devm_gpiochip_add_data(dev, gc, lg); 390 - if (ret) { 391 - dev_err(dev, "failed adding lp-gpio chip\n"); 392 - return ret; 393 - } 394 - 395 - pm_runtime_enable(dev); 396 - 397 - return 0; 398 - } 399 - 400 - static int lp_gpio_runtime_suspend(struct device *dev) 401 - { 402 - return 0; 403 - } 404 - 405 - static int lp_gpio_runtime_resume(struct device *dev) 406 - { 407 - return 0; 408 - } 409 - 410 - static int lp_gpio_resume(struct device *dev) 411 - { 412 - struct lp_gpio *lg = dev_get_drvdata(dev); 413 - unsigned long reg; 414 - int i; 415 - 416 - /* on some hardware suspend clears input sensing, re-enable it here */ 417 - for (i = 0; i < lg->chip.ngpio; i++) { 418 - if (gpiochip_is_requested(&lg->chip, i) != NULL) { 419 - reg = lp_gpio_reg(&lg->chip, i, LP_CONFIG2); 420 - outl(inl(reg) & ~GPINDIS_BIT, reg); 421 - } 422 - } 423 - return 0; 424 - } 425 - 426 - static const struct dev_pm_ops lp_gpio_pm_ops = { 427 - .runtime_suspend = lp_gpio_runtime_suspend, 428 - .runtime_resume = lp_gpio_runtime_resume, 429 - .resume = lp_gpio_resume, 430 - }; 431 - 432 - static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = { 433 - { "INT33C7", 0 }, 434 - { "INT3437", 0 }, 435 - { } 436 - }; 437 - MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match); 438 - 439 - static int lp_gpio_remove(struct platform_device *pdev) 440 - { 441 - pm_runtime_disable(&pdev->dev); 442 - return 0; 443 - } 444 - 445 - static struct platform_driver lp_gpio_driver = { 446 - .probe = lp_gpio_probe, 447 - .remove = lp_gpio_remove, 448 - .driver = { 449 - .name = "lp_gpio", 450 - .pm = &lp_gpio_pm_ops, 451 - .acpi_match_table = ACPI_PTR(lynxpoint_gpio_acpi_match), 452 - }, 453 - }; 454 - 455 - static int __init lp_gpio_init(void) 456 - { 457 - return platform_driver_register(&lp_gpio_driver); 458 - } 459 - 460 - static void __exit lp_gpio_exit(void) 461 - { 462 - platform_driver_unregister(&lp_gpio_driver); 463 - } 464 - 465 - subsys_initcall(lp_gpio_init); 466 - module_exit(lp_gpio_exit); 467 - 468 - MODULE_AUTHOR("Mathias Nyman (Intel)"); 469 - MODULE_DESCRIPTION("GPIO interface for Intel Lynxpoint"); 470 - MODULE_LICENSE("GPL v2"); 471 - MODULE_ALIAS("platform:lp_gpio");
+1 -2
drivers/gpio/gpio-mt7621.c
··· 253 253 254 254 /* 255 255 * Directly request the irq here instead of passing 256 - * a flow-handler to gpiochip_set_chained_irqchip, 257 - * because the irq is shared. 256 + * a flow-handler because the irq is shared. 258 257 */ 259 258 ret = devm_request_irq(dev, mtk->gpio_irq, 260 259 mediatek_gpio_irq_handler, IRQF_SHARED,
+1 -2
drivers/gpio/gpio-xgs-iproc.c
··· 251 251 252 252 /* 253 253 * Directly request the irq here instead of passing 254 - * a flow-handler to gpiochip_set_chained_irqchip, 255 - * because the irq is shared. 254 + * a flow-handler because the irq is shared. 256 255 */ 257 256 ret = devm_request_irq(dev, irq, iproc_gpio_irq_handler, 258 257 IRQF_SHARED, chip->gc.label, &chip->gc);
+1 -24
drivers/gpio/gpiolib.c
··· 1800 1800 * gpiochip_set_cascaded_irqchip() - connects a cascaded irqchip to a gpiochip 1801 1801 * @gc: the gpiochip to set the irqchip chain to 1802 1802 * @parent_irq: the irq number corresponding to the parent IRQ for this 1803 - * chained irqchip 1803 + * cascaded irqchip 1804 1804 * @parent_handler: the parent interrupt handler for the accumulated IRQ 1805 1805 * coming out of the gpiochip. If the interrupt is nested rather than 1806 1806 * cascaded, pass NULL in this handler argument ··· 1841 1841 gc); 1842 1842 } 1843 1843 } 1844 - 1845 - /** 1846 - * gpiochip_set_chained_irqchip() - connects a chained irqchip to a gpiochip 1847 - * @gpiochip: the gpiochip to set the irqchip chain to 1848 - * @irqchip: the irqchip to chain to the gpiochip 1849 - * @parent_irq: the irq number corresponding to the parent IRQ for this 1850 - * chained irqchip 1851 - * @parent_handler: the parent interrupt handler for the accumulated IRQ 1852 - * coming out of the gpiochip. 1853 - */ 1854 - void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, 1855 - struct irq_chip *irqchip, 1856 - unsigned int parent_irq, 1857 - irq_flow_handler_t parent_handler) 1858 - { 1859 - if (gpiochip->irq.threaded) { 1860 - chip_err(gpiochip, "tried to chain a threaded gpiochip\n"); 1861 - return; 1862 - } 1863 - 1864 - gpiochip_set_cascaded_irqchip(gpiochip, parent_irq, parent_handler); 1865 - } 1866 - EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip); 1867 1844 1868 1845 /** 1869 1846 * gpiochip_set_nested_irqchip() - connects a nested irqchip to a gpiochip
-1
drivers/pinctrl/actions/pinctrl-s700.c
··· 1583 1583 [S700_MUX_USB30] = FUNCTION(usb30), 1584 1584 [S700_MUX_CLKO_25M] = FUNCTION(clko_25m), 1585 1585 [S700_MUX_MIPI_CSI] = FUNCTION(mipi_csi), 1586 - [S700_MUX_DSI] = FUNCTION(dsi), 1587 1586 [S700_MUX_NAND] = FUNCTION(nand), 1588 1587 [S700_MUX_SPDIF] = FUNCTION(spdif), 1589 1588 [S700_MUX_SIRQ0] = FUNCTION(sirq0),
+90 -80
drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
··· 2439 2439 2440 2440 static const struct aspeed_pin_config aspeed_g4_configs[] = { 2441 2441 /* GPIO banks ranges [A, B], [D, J], [M, R] */ 2442 - { PIN_CONFIG_BIAS_PULL_DOWN, { D6, D5 }, SCU8C, 16 }, 2443 - { PIN_CONFIG_BIAS_DISABLE, { D6, D5 }, SCU8C, 16 }, 2444 - { PIN_CONFIG_BIAS_PULL_DOWN, { J21, E18 }, SCU8C, 17 }, 2445 - { PIN_CONFIG_BIAS_DISABLE, { J21, E18 }, SCU8C, 17 }, 2446 - { PIN_CONFIG_BIAS_PULL_DOWN, { A18, E15 }, SCU8C, 19 }, 2447 - { PIN_CONFIG_BIAS_DISABLE, { A18, E15 }, SCU8C, 19 }, 2448 - { PIN_CONFIG_BIAS_PULL_DOWN, { D15, B14 }, SCU8C, 20 }, 2449 - { PIN_CONFIG_BIAS_DISABLE, { D15, B14 }, SCU8C, 20 }, 2450 - { PIN_CONFIG_BIAS_PULL_DOWN, { D18, C17 }, SCU8C, 21 }, 2451 - { PIN_CONFIG_BIAS_DISABLE, { D18, C17 }, SCU8C, 21 }, 2452 - { PIN_CONFIG_BIAS_PULL_DOWN, { A14, U18 }, SCU8C, 22 }, 2453 - { PIN_CONFIG_BIAS_DISABLE, { A14, U18 }, SCU8C, 22 }, 2454 - { PIN_CONFIG_BIAS_PULL_DOWN, { A8, E7 }, SCU8C, 23 }, 2455 - { PIN_CONFIG_BIAS_DISABLE, { A8, E7 }, SCU8C, 23 }, 2456 - { PIN_CONFIG_BIAS_PULL_DOWN, { C22, E20 }, SCU8C, 24 }, 2457 - { PIN_CONFIG_BIAS_DISABLE, { C22, E20 }, SCU8C, 24 }, 2458 - { PIN_CONFIG_BIAS_PULL_DOWN, { J5, T1 }, SCU8C, 25 }, 2459 - { PIN_CONFIG_BIAS_DISABLE, { J5, T1 }, SCU8C, 25 }, 2460 - { PIN_CONFIG_BIAS_PULL_DOWN, { U1, U5 }, SCU8C, 26 }, 2461 - { PIN_CONFIG_BIAS_DISABLE, { U1, U5 }, SCU8C, 26 }, 2462 - { PIN_CONFIG_BIAS_PULL_DOWN, { V3, V5 }, SCU8C, 27 }, 2463 - { PIN_CONFIG_BIAS_DISABLE, { V3, V5 }, SCU8C, 27 }, 2464 - { PIN_CONFIG_BIAS_PULL_DOWN, { W4, AB2 }, SCU8C, 28 }, 2465 - { PIN_CONFIG_BIAS_DISABLE, { W4, AB2 }, SCU8C, 28 }, 2466 - { PIN_CONFIG_BIAS_PULL_DOWN, { V6, V7 }, SCU8C, 29 }, 2467 - { PIN_CONFIG_BIAS_DISABLE, { V6, V7 }, SCU8C, 29 }, 2468 - { PIN_CONFIG_BIAS_PULL_DOWN, { Y6, AB7 }, SCU8C, 30 }, 2469 - { PIN_CONFIG_BIAS_DISABLE, { Y6, AB7 }, SCU8C, 30 }, 2470 - { PIN_CONFIG_BIAS_PULL_DOWN, { V20, A5 }, SCU8C, 31 }, 2471 - { PIN_CONFIG_BIAS_DISABLE, { V20, A5 }, SCU8C, 31 }, 2442 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, D6, D5, SCU8C, 16), 2443 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, D6, D5, SCU8C, 16), 2444 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, J21, E18, SCU8C, 17), 2445 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, J21, E18, SCU8C, 17), 2446 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A18, E15, SCU8C, 19), 2447 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A18, E15, SCU8C, 19), 2448 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, D15, B14, SCU8C, 20), 2449 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, D15, B14, SCU8C, 20), 2450 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, D18, C17, SCU8C, 21), 2451 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, D18, C17, SCU8C, 21), 2452 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A14, U18, SCU8C, 22), 2453 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A14, U18, SCU8C, 22), 2454 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A8, E7, SCU8C, 23), 2455 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A8, E7, SCU8C, 23), 2456 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, C22, E20, SCU8C, 24), 2457 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, C22, E20, SCU8C, 24), 2458 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, J5, T1, SCU8C, 25), 2459 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, J5, T1, SCU8C, 25), 2460 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, U1, U5, SCU8C, 26), 2461 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, U1, U5, SCU8C, 26), 2462 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, V3, V5, SCU8C, 27), 2463 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, V3, V5, SCU8C, 27), 2464 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, W4, AB2, SCU8C, 28), 2465 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, W4, AB2, SCU8C, 28), 2466 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, V6, V7, SCU8C, 29), 2467 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, V6, V7, SCU8C, 29), 2468 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, Y6, AB7, SCU8C, 30), 2469 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, Y6, AB7, SCU8C, 30), 2470 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, V20, A5, SCU8C, 31), 2471 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, V20, A5, SCU8C, 31), 2472 2472 2473 2473 /* GPIOs T[0-5] (RGMII1 Tx pins) */ 2474 - { PIN_CONFIG_DRIVE_STRENGTH, { A12, A13 }, SCU90, 9 }, 2475 - { PIN_CONFIG_BIAS_PULL_DOWN, { A12, A13 }, SCU90, 12 }, 2476 - { PIN_CONFIG_BIAS_DISABLE, { A12, A13 }, SCU90, 12 }, 2474 + ASPEED_SB_PINCONF(PIN_CONFIG_DRIVE_STRENGTH, A12, A13, SCU90, 9), 2475 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A12, A13, SCU90, 12), 2476 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A12, A13, SCU90, 12), 2477 2477 2478 2478 /* GPIOs T[6-7], U[0-3] (RGMII2 TX pins) */ 2479 - { PIN_CONFIG_DRIVE_STRENGTH, { D9, D10 }, SCU90, 11 }, 2480 - { PIN_CONFIG_BIAS_PULL_DOWN, { D9, D10 }, SCU90, 14 }, 2481 - { PIN_CONFIG_BIAS_DISABLE, { D9, D10 }, SCU90, 14 }, 2479 + ASPEED_SB_PINCONF(PIN_CONFIG_DRIVE_STRENGTH, D9, D10, SCU90, 11), 2480 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, D9, D10, SCU90, 14), 2481 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, D9, D10, SCU90, 14), 2482 2482 2483 2483 /* GPIOs U[4-7], V[0-1] (RGMII1 Rx pins) */ 2484 - { PIN_CONFIG_BIAS_PULL_DOWN, { E11, E10 }, SCU90, 13 }, 2485 - { PIN_CONFIG_BIAS_DISABLE, { E11, E10 }, SCU90, 13 }, 2484 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, E11, E10, SCU90, 13), 2485 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, E11, E10, SCU90, 13), 2486 2486 2487 2487 /* GPIOs V[2-7] (RGMII2 Rx pins) */ 2488 - { PIN_CONFIG_BIAS_PULL_DOWN, { C9, C8 }, SCU90, 15 }, 2489 - { PIN_CONFIG_BIAS_DISABLE, { C9, C8 }, SCU90, 15 }, 2488 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, C9, C8, SCU90, 15), 2489 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, C9, C8, SCU90, 15), 2490 2490 2491 2491 /* ADC pull-downs (SCUA8[19:4]) */ 2492 - { PIN_CONFIG_BIAS_PULL_DOWN, { L5, L5 }, SCUA8, 4 }, 2493 - { PIN_CONFIG_BIAS_DISABLE, { L5, L5 }, SCUA8, 4 }, 2494 - { PIN_CONFIG_BIAS_PULL_DOWN, { L4, L4 }, SCUA8, 5 }, 2495 - { PIN_CONFIG_BIAS_DISABLE, { L4, L4 }, SCUA8, 5 }, 2496 - { PIN_CONFIG_BIAS_PULL_DOWN, { L3, L3 }, SCUA8, 6 }, 2497 - { PIN_CONFIG_BIAS_DISABLE, { L3, L3 }, SCUA8, 6 }, 2498 - { PIN_CONFIG_BIAS_PULL_DOWN, { L2, L2 }, SCUA8, 7 }, 2499 - { PIN_CONFIG_BIAS_DISABLE, { L2, L2 }, SCUA8, 7 }, 2500 - { PIN_CONFIG_BIAS_PULL_DOWN, { L1, L1 }, SCUA8, 8 }, 2501 - { PIN_CONFIG_BIAS_DISABLE, { L1, L1 }, SCUA8, 8 }, 2502 - { PIN_CONFIG_BIAS_PULL_DOWN, { M5, M5 }, SCUA8, 9 }, 2503 - { PIN_CONFIG_BIAS_DISABLE, { M5, M5 }, SCUA8, 9 }, 2504 - { PIN_CONFIG_BIAS_PULL_DOWN, { M4, M4 }, SCUA8, 10 }, 2505 - { PIN_CONFIG_BIAS_DISABLE, { M4, M4 }, SCUA8, 10 }, 2506 - { PIN_CONFIG_BIAS_PULL_DOWN, { M3, M3 }, SCUA8, 11 }, 2507 - { PIN_CONFIG_BIAS_DISABLE, { M3, M3 }, SCUA8, 11 }, 2508 - { PIN_CONFIG_BIAS_PULL_DOWN, { M2, M2 }, SCUA8, 12 }, 2509 - { PIN_CONFIG_BIAS_DISABLE, { M2, M2 }, SCUA8, 12 }, 2510 - { PIN_CONFIG_BIAS_PULL_DOWN, { M1, M1 }, SCUA8, 13 }, 2511 - { PIN_CONFIG_BIAS_DISABLE, { M1, M1 }, SCUA8, 13 }, 2512 - { PIN_CONFIG_BIAS_PULL_DOWN, { N5, N5 }, SCUA8, 14 }, 2513 - { PIN_CONFIG_BIAS_DISABLE, { N5, N5 }, SCUA8, 14 }, 2514 - { PIN_CONFIG_BIAS_PULL_DOWN, { N4, N4 }, SCUA8, 15 }, 2515 - { PIN_CONFIG_BIAS_DISABLE, { N4, N4 }, SCUA8, 15 }, 2516 - { PIN_CONFIG_BIAS_PULL_DOWN, { N3, N3 }, SCUA8, 16 }, 2517 - { PIN_CONFIG_BIAS_DISABLE, { N3, N3 }, SCUA8, 16 }, 2518 - { PIN_CONFIG_BIAS_PULL_DOWN, { N2, N2 }, SCUA8, 17 }, 2519 - { PIN_CONFIG_BIAS_DISABLE, { N2, N2 }, SCUA8, 17 }, 2520 - { PIN_CONFIG_BIAS_PULL_DOWN, { N1, N1 }, SCUA8, 18 }, 2521 - { PIN_CONFIG_BIAS_DISABLE, { N1, N1 }, SCUA8, 18 }, 2522 - { PIN_CONFIG_BIAS_PULL_DOWN, { P5, P5 }, SCUA8, 19 }, 2523 - { PIN_CONFIG_BIAS_DISABLE, { P5, P5 }, SCUA8, 19 }, 2492 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, L5, L5, SCUA8, 4), 2493 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, L5, L5, SCUA8, 4), 2494 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, L4, L4, SCUA8, 5), 2495 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, L4, L4, SCUA8, 5), 2496 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, L3, L3, SCUA8, 6), 2497 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, L3, L3, SCUA8, 6), 2498 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, L2, L2, SCUA8, 7), 2499 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, L2, L2, SCUA8, 7), 2500 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, L1, L1, SCUA8, 8), 2501 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, L1, L1, SCUA8, 8), 2502 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, M5, M5, SCUA8, 9), 2503 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, M5, M5, SCUA8, 9), 2504 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, M4, M4, SCUA8, 10), 2505 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, M4, M4, SCUA8, 10), 2506 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, M3, M3, SCUA8, 11), 2507 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, M3, M3, SCUA8, 11), 2508 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, M2, M2, SCUA8, 12), 2509 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, M2, M2, SCUA8, 12), 2510 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, M1, M1, SCUA8, 13), 2511 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, M1, M1, SCUA8, 13), 2512 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, N5, N5, SCUA8, 14), 2513 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, N5, N5, SCUA8, 14), 2514 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, N4, N4, SCUA8, 15), 2515 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, N4, N4, SCUA8, 15), 2516 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, N3, N3, SCUA8, 16), 2517 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, N3, N3, SCUA8, 16), 2518 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, N2, N2, SCUA8, 17), 2519 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, N2, N2, SCUA8, 17), 2520 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, N1, N1, SCUA8, 18), 2521 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, N1, N1, SCUA8, 18), 2522 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, P5, P5, SCUA8, 19), 2523 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, P5, P5, SCUA8, 19), 2524 2524 2525 2525 /* 2526 2526 * Debounce settings for GPIOs D and E passthrough mode are in ··· 2531 2531 * controller. Due to this tangle between GPIO and pinctrl we don't yet 2532 2532 * fully support pass-through debounce. 2533 2533 */ 2534 - { PIN_CONFIG_INPUT_DEBOUNCE, { A18, D16 }, SCUA8, 20 }, 2535 - { PIN_CONFIG_INPUT_DEBOUNCE, { B17, A17 }, SCUA8, 21 }, 2536 - { PIN_CONFIG_INPUT_DEBOUNCE, { C16, B16 }, SCUA8, 22 }, 2537 - { PIN_CONFIG_INPUT_DEBOUNCE, { A16, E15 }, SCUA8, 23 }, 2538 - { PIN_CONFIG_INPUT_DEBOUNCE, { D15, C15 }, SCUA8, 24 }, 2539 - { PIN_CONFIG_INPUT_DEBOUNCE, { B15, A15 }, SCUA8, 25 }, 2540 - { PIN_CONFIG_INPUT_DEBOUNCE, { E14, D14 }, SCUA8, 26 }, 2541 - { PIN_CONFIG_INPUT_DEBOUNCE, { C14, B14 }, SCUA8, 27 }, 2534 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, A18, D16, SCUA8, 20), 2535 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, B17, A17, SCUA8, 21), 2536 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, C16, B16, SCUA8, 22), 2537 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, A16, E15, SCUA8, 23), 2538 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, D15, C15, SCUA8, 24), 2539 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, B15, A15, SCUA8, 25), 2540 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, E14, D14, SCUA8, 26), 2541 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, C14, B14, SCUA8, 27), 2542 2542 }; 2543 2543 2544 2544 static int aspeed_g4_sig_expr_set(struct aspeed_pinmux_data *ctx, ··· 2594 2594 return 0; 2595 2595 } 2596 2596 2597 + static const struct aspeed_pin_config_map aspeed_g4_pin_config_map[] = { 2598 + { PIN_CONFIG_BIAS_PULL_DOWN, 0, 1, BIT_MASK(0)}, 2599 + { PIN_CONFIG_BIAS_PULL_DOWN, -1, 0, BIT_MASK(0)}, 2600 + { PIN_CONFIG_BIAS_DISABLE, -1, 1, BIT_MASK(0)}, 2601 + { PIN_CONFIG_DRIVE_STRENGTH, 8, 0, BIT_MASK(0)}, 2602 + { PIN_CONFIG_DRIVE_STRENGTH, 16, 1, BIT_MASK(0)}, 2603 + }; 2604 + 2597 2605 static const struct aspeed_pinmux_ops aspeed_g4_ops = { 2598 2606 .set = aspeed_g4_sig_expr_set, 2599 2607 }; ··· 2618 2610 }, 2619 2611 .configs = aspeed_g4_configs, 2620 2612 .nconfigs = ARRAY_SIZE(aspeed_g4_configs), 2613 + .confmaps = aspeed_g4_pin_config_map, 2614 + .nconfmaps = ARRAY_SIZE(aspeed_g4_pin_config_map), 2621 2615 }; 2622 2616 2623 2617 static const struct pinmux_ops aspeed_g4_pinmux_ops = {
+111 -101
drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
··· 2476 2476 2477 2477 static struct aspeed_pin_config aspeed_g5_configs[] = { 2478 2478 /* GPIOA, GPIOQ */ 2479 - { PIN_CONFIG_BIAS_PULL_DOWN, { B14, B13 }, SCU8C, 16 }, 2480 - { PIN_CONFIG_BIAS_DISABLE, { B14, B13 }, SCU8C, 16 }, 2481 - { PIN_CONFIG_BIAS_PULL_DOWN, { A11, N20 }, SCU8C, 16 }, 2482 - { PIN_CONFIG_BIAS_DISABLE, { A11, N20 }, SCU8C, 16 }, 2479 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, B14, B13, SCU8C, 16), 2480 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, B14, B13, SCU8C, 16), 2481 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A11, N20, SCU8C, 16), 2482 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A11, N20, SCU8C, 16), 2483 2483 2484 2484 /* GPIOB, GPIOR */ 2485 - { PIN_CONFIG_BIAS_PULL_DOWN, { K19, H20 }, SCU8C, 17 }, 2486 - { PIN_CONFIG_BIAS_DISABLE, { K19, H20 }, SCU8C, 17 }, 2487 - { PIN_CONFIG_BIAS_PULL_DOWN, { AA19, E10 }, SCU8C, 17 }, 2488 - { PIN_CONFIG_BIAS_DISABLE, { AA19, E10 }, SCU8C, 17 }, 2485 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, K19, H20, SCU8C, 17), 2486 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, K19, H20, SCU8C, 17), 2487 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, AA19, E10, SCU8C, 17), 2488 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, AA19, E10, SCU8C, 17), 2489 2489 2490 2490 /* GPIOC, GPIOS*/ 2491 - { PIN_CONFIG_BIAS_PULL_DOWN, { C12, B11 }, SCU8C, 18 }, 2492 - { PIN_CONFIG_BIAS_DISABLE, { C12, B11 }, SCU8C, 18 }, 2493 - { PIN_CONFIG_BIAS_PULL_DOWN, { V20, AA20 }, SCU8C, 18 }, 2494 - { PIN_CONFIG_BIAS_DISABLE, { V20, AA20 }, SCU8C, 18 }, 2491 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, C12, B11, SCU8C, 18), 2492 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, C12, B11, SCU8C, 18), 2493 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, V20, AA20, SCU8C, 18), 2494 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, V20, AA20, SCU8C, 18), 2495 2495 2496 2496 /* GPIOD, GPIOY */ 2497 - { PIN_CONFIG_BIAS_PULL_DOWN, { F19, C21 }, SCU8C, 19 }, 2498 - { PIN_CONFIG_BIAS_DISABLE, { F19, C21 }, SCU8C, 19 }, 2499 - { PIN_CONFIG_BIAS_PULL_DOWN, { R22, P20 }, SCU8C, 19 }, 2500 - { PIN_CONFIG_BIAS_DISABLE, { R22, P20 }, SCU8C, 19 }, 2497 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, F19, C21, SCU8C, 19), 2498 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, F19, C21, SCU8C, 19), 2499 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, R22, P20, SCU8C, 19), 2500 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, R22, P20, SCU8C, 19), 2501 2501 2502 2502 /* GPIOE, GPIOZ */ 2503 - { PIN_CONFIG_BIAS_PULL_DOWN, { B20, B19 }, SCU8C, 20 }, 2504 - { PIN_CONFIG_BIAS_DISABLE, { B20, B19 }, SCU8C, 20 }, 2505 - { PIN_CONFIG_BIAS_PULL_DOWN, { Y20, W21 }, SCU8C, 20 }, 2506 - { PIN_CONFIG_BIAS_DISABLE, { Y20, W21 }, SCU8C, 20 }, 2503 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, B20, B19, SCU8C, 20), 2504 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, B20, B19, SCU8C, 20), 2505 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, Y20, W21, SCU8C, 20), 2506 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, Y20, W21, SCU8C, 20), 2507 2507 2508 2508 /* GPIOF, GPIOAA */ 2509 - { PIN_CONFIG_BIAS_PULL_DOWN, { J19, H18 }, SCU8C, 21 }, 2510 - { PIN_CONFIG_BIAS_DISABLE, { J19, H18 }, SCU8C, 21 }, 2511 - { PIN_CONFIG_BIAS_PULL_DOWN, { Y21, P19 }, SCU8C, 21 }, 2512 - { PIN_CONFIG_BIAS_DISABLE, { Y21, P19 }, SCU8C, 21 }, 2509 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, J19, H18, SCU8C, 21), 2510 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, J19, H18, SCU8C, 21), 2511 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, Y21, P19, SCU8C, 21), 2512 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, Y21, P19, SCU8C, 21), 2513 2513 2514 - /* GPIOG, GPIOAB */ 2515 - { PIN_CONFIG_BIAS_PULL_DOWN, { A19, E14 }, SCU8C, 22 }, 2516 - { PIN_CONFIG_BIAS_DISABLE, { A19, E14 }, SCU8C, 22 }, 2517 - { PIN_CONFIG_BIAS_PULL_DOWN, { N19, R20 }, SCU8C, 22 }, 2518 - { PIN_CONFIG_BIAS_DISABLE, { N19, R20 }, SCU8C, 22 }, 2514 + /* GPIOG, GPIOAB */ 2515 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A19, E14, SCU8C, 22), 2516 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A19, E14, SCU8C, 22), 2517 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, N19, R20, SCU8C, 22), 2518 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, N19, R20, SCU8C, 22), 2519 2519 2520 2520 /* GPIOH, GPIOAC */ 2521 - { PIN_CONFIG_BIAS_PULL_DOWN, { A18, D18 }, SCU8C, 23 }, 2522 - { PIN_CONFIG_BIAS_DISABLE, { A18, D18 }, SCU8C, 23 }, 2523 - { PIN_CONFIG_BIAS_PULL_DOWN, { G21, G22 }, SCU8C, 23 }, 2524 - { PIN_CONFIG_BIAS_DISABLE, { G21, G22 }, SCU8C, 23 }, 2521 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, A18, D18, SCU8C, 23), 2522 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, A18, D18, SCU8C, 23), 2523 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, G21, G22, SCU8C, 23), 2524 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, G21, G22, SCU8C, 23), 2525 2525 2526 2526 /* GPIOs [I, P] */ 2527 - { PIN_CONFIG_BIAS_PULL_DOWN, { C18, A15 }, SCU8C, 24 }, 2528 - { PIN_CONFIG_BIAS_DISABLE, { C18, A15 }, SCU8C, 24 }, 2529 - { PIN_CONFIG_BIAS_PULL_DOWN, { R2, T3 }, SCU8C, 25 }, 2530 - { PIN_CONFIG_BIAS_DISABLE, { R2, T3 }, SCU8C, 25 }, 2531 - { PIN_CONFIG_BIAS_PULL_DOWN, { L3, R1 }, SCU8C, 26 }, 2532 - { PIN_CONFIG_BIAS_DISABLE, { L3, R1 }, SCU8C, 26 }, 2533 - { PIN_CONFIG_BIAS_PULL_DOWN, { T2, W1 }, SCU8C, 27 }, 2534 - { PIN_CONFIG_BIAS_DISABLE, { T2, W1 }, SCU8C, 27 }, 2535 - { PIN_CONFIG_BIAS_PULL_DOWN, { Y1, T5 }, SCU8C, 28 }, 2536 - { PIN_CONFIG_BIAS_DISABLE, { Y1, T5 }, SCU8C, 28 }, 2537 - { PIN_CONFIG_BIAS_PULL_DOWN, { V2, T4 }, SCU8C, 29 }, 2538 - { PIN_CONFIG_BIAS_DISABLE, { V2, T4 }, SCU8C, 29 }, 2539 - { PIN_CONFIG_BIAS_PULL_DOWN, { U5, W4 }, SCU8C, 30 }, 2540 - { PIN_CONFIG_BIAS_DISABLE, { U5, W4 }, SCU8C, 30 }, 2541 - { PIN_CONFIG_BIAS_PULL_DOWN, { V4, V6 }, SCU8C, 31 }, 2542 - { PIN_CONFIG_BIAS_DISABLE, { V4, V6 }, SCU8C, 31 }, 2527 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, C18, A15, SCU8C, 24), 2528 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, C18, A15, SCU8C, 24), 2529 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, R2, T3, SCU8C, 25), 2530 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, R2, T3, SCU8C, 25), 2531 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, L3, R1, SCU8C, 26), 2532 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, L3, R1, SCU8C, 26), 2533 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, T2, W1, SCU8C, 27), 2534 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, T2, W1, SCU8C, 27), 2535 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, Y1, T5, SCU8C, 28), 2536 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, Y1, T5, SCU8C, 28), 2537 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, V2, T4, SCU8C, 29), 2538 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, V2, T4, SCU8C, 29), 2539 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, U5, W4, SCU8C, 30), 2540 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, U5, W4, SCU8C, 30), 2541 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, V4, V6, SCU8C, 31), 2542 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, V4, V6, SCU8C, 31), 2543 2543 2544 2544 /* GPIOs T[0-5] (RGMII1 Tx pins) */ 2545 - { PIN_CONFIG_DRIVE_STRENGTH, { B5, B5 }, SCU90, 8 }, 2546 - { PIN_CONFIG_DRIVE_STRENGTH, { E9, A5 }, SCU90, 9 }, 2547 - { PIN_CONFIG_BIAS_PULL_DOWN, { B5, D7 }, SCU90, 12 }, 2548 - { PIN_CONFIG_BIAS_DISABLE, { B5, D7 }, SCU90, 12 }, 2545 + ASPEED_SB_PINCONF(PIN_CONFIG_DRIVE_STRENGTH, B5, B5, SCU90, 8), 2546 + ASPEED_SB_PINCONF(PIN_CONFIG_DRIVE_STRENGTH, E9, A5, SCU90, 9), 2547 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, B5, D7, SCU90, 12), 2548 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, B5, D7, SCU90, 12), 2549 2549 2550 2550 /* GPIOs T[6-7], U[0-3] (RGMII2 TX pins) */ 2551 - { PIN_CONFIG_DRIVE_STRENGTH, { B2, B2 }, SCU90, 10 }, 2552 - { PIN_CONFIG_DRIVE_STRENGTH, { B1, B3 }, SCU90, 11 }, 2553 - { PIN_CONFIG_BIAS_PULL_DOWN, { B2, D4 }, SCU90, 14 }, 2554 - { PIN_CONFIG_BIAS_DISABLE, { B2, D4 }, SCU90, 14 }, 2551 + ASPEED_SB_PINCONF(PIN_CONFIG_DRIVE_STRENGTH, B2, B2, SCU90, 10), 2552 + ASPEED_SB_PINCONF(PIN_CONFIG_DRIVE_STRENGTH, B1, B3, SCU90, 11), 2553 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, B2, D4, SCU90, 14), 2554 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, B2, D4, SCU90, 14), 2555 2555 2556 2556 /* GPIOs U[4-7], V[0-1] (RGMII1 Rx pins) */ 2557 - { PIN_CONFIG_BIAS_PULL_DOWN, { B4, C4 }, SCU90, 13 }, 2558 - { PIN_CONFIG_BIAS_DISABLE, { B4, C4 }, SCU90, 13 }, 2557 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, B4, C4, SCU90, 13), 2558 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, B4, C4, SCU90, 13), 2559 2559 2560 2560 /* GPIOs V[2-7] (RGMII2 Rx pins) */ 2561 - { PIN_CONFIG_BIAS_PULL_DOWN, { C2, E6 }, SCU90, 15 }, 2562 - { PIN_CONFIG_BIAS_DISABLE, { C2, E6 }, SCU90, 15 }, 2561 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, C2, E6, SCU90, 15), 2562 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, C2, E6, SCU90, 15), 2563 2563 2564 2564 /* ADC pull-downs (SCUA8[19:4]) */ 2565 - { PIN_CONFIG_BIAS_PULL_DOWN, { F4, F4 }, SCUA8, 4 }, 2566 - { PIN_CONFIG_BIAS_DISABLE, { F4, F4 }, SCUA8, 4 }, 2567 - { PIN_CONFIG_BIAS_PULL_DOWN, { F5, F5 }, SCUA8, 5 }, 2568 - { PIN_CONFIG_BIAS_DISABLE, { F5, F5 }, SCUA8, 5 }, 2569 - { PIN_CONFIG_BIAS_PULL_DOWN, { E2, E2 }, SCUA8, 6 }, 2570 - { PIN_CONFIG_BIAS_DISABLE, { E2, E2 }, SCUA8, 6 }, 2571 - { PIN_CONFIG_BIAS_PULL_DOWN, { E1, E1 }, SCUA8, 7 }, 2572 - { PIN_CONFIG_BIAS_DISABLE, { E1, E1 }, SCUA8, 7 }, 2573 - { PIN_CONFIG_BIAS_PULL_DOWN, { F3, F3 }, SCUA8, 8 }, 2574 - { PIN_CONFIG_BIAS_DISABLE, { F3, F3 }, SCUA8, 8 }, 2575 - { PIN_CONFIG_BIAS_PULL_DOWN, { E3, E3 }, SCUA8, 9 }, 2576 - { PIN_CONFIG_BIAS_DISABLE, { E3, E3 }, SCUA8, 9 }, 2577 - { PIN_CONFIG_BIAS_PULL_DOWN, { G5, G5 }, SCUA8, 10 }, 2578 - { PIN_CONFIG_BIAS_DISABLE, { G5, G5 }, SCUA8, 10 }, 2579 - { PIN_CONFIG_BIAS_PULL_DOWN, { G4, G4 }, SCUA8, 11 }, 2580 - { PIN_CONFIG_BIAS_DISABLE, { G4, G4 }, SCUA8, 11 }, 2581 - { PIN_CONFIG_BIAS_PULL_DOWN, { F2, F2 }, SCUA8, 12 }, 2582 - { PIN_CONFIG_BIAS_DISABLE, { F2, F2 }, SCUA8, 12 }, 2583 - { PIN_CONFIG_BIAS_PULL_DOWN, { G3, G3 }, SCUA8, 13 }, 2584 - { PIN_CONFIG_BIAS_DISABLE, { G3, G3 }, SCUA8, 13 }, 2585 - { PIN_CONFIG_BIAS_PULL_DOWN, { G2, G2 }, SCUA8, 14 }, 2586 - { PIN_CONFIG_BIAS_DISABLE, { G2, G2 }, SCUA8, 14 }, 2587 - { PIN_CONFIG_BIAS_PULL_DOWN, { F1, F1 }, SCUA8, 15 }, 2588 - { PIN_CONFIG_BIAS_DISABLE, { F1, F1 }, SCUA8, 15 }, 2589 - { PIN_CONFIG_BIAS_PULL_DOWN, { H5, H5 }, SCUA8, 16 }, 2590 - { PIN_CONFIG_BIAS_DISABLE, { H5, H5 }, SCUA8, 16 }, 2591 - { PIN_CONFIG_BIAS_PULL_DOWN, { G1, G1 }, SCUA8, 17 }, 2592 - { PIN_CONFIG_BIAS_DISABLE, { G1, G1 }, SCUA8, 17 }, 2593 - { PIN_CONFIG_BIAS_PULL_DOWN, { H3, H3 }, SCUA8, 18 }, 2594 - { PIN_CONFIG_BIAS_DISABLE, { H3, H3 }, SCUA8, 18 }, 2595 - { PIN_CONFIG_BIAS_PULL_DOWN, { H4, H4 }, SCUA8, 19 }, 2596 - { PIN_CONFIG_BIAS_DISABLE, { H4, H4 }, SCUA8, 19 }, 2565 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, F4, F4, SCUA8, 4), 2566 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, F4, F4, SCUA8, 4), 2567 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, F5, F5, SCUA8, 5), 2568 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, F5, F5, SCUA8, 5), 2569 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, E2, E2, SCUA8, 6), 2570 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, E2, E2, SCUA8, 6), 2571 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, E1, E1, SCUA8, 7), 2572 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, E1, E1, SCUA8, 7), 2573 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, F3, F3, SCUA8, 8), 2574 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, F3, F3, SCUA8, 8), 2575 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, E3, E3, SCUA8, 9), 2576 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, E3, E3, SCUA8, 9), 2577 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, G5, G5, SCUA8, 10), 2578 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, G5, G5, SCUA8, 10), 2579 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, G4, G4, SCUA8, 11), 2580 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, G4, G4, SCUA8, 11), 2581 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, F2, F2, SCUA8, 12), 2582 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, F2, F2, SCUA8, 12), 2583 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, G3, G3, SCUA8, 13), 2584 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, G3, G3, SCUA8, 13), 2585 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, G2, G2, SCUA8, 14), 2586 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, G2, G2, SCUA8, 14), 2587 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, F1, F1, SCUA8, 15), 2588 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, F1, F1, SCUA8, 15), 2589 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, H5, H5, SCUA8, 16), 2590 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, H5, H5, SCUA8, 16), 2591 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, G1, G1, SCUA8, 17), 2592 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, G1, G1, SCUA8, 17), 2593 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, H3, H3, SCUA8, 18), 2594 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, H3, H3, SCUA8, 18), 2595 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, H4, H4, SCUA8, 19), 2596 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, H4, H4, SCUA8, 19), 2597 2597 2598 2598 /* 2599 2599 * Debounce settings for GPIOs D and E passthrough mode are in ··· 2604 2604 * controller. Due to this tangle between GPIO and pinctrl we don't yet 2605 2605 * fully support pass-through debounce. 2606 2606 */ 2607 - { PIN_CONFIG_INPUT_DEBOUNCE, { F19, E21 }, SCUA8, 20 }, 2608 - { PIN_CONFIG_INPUT_DEBOUNCE, { F20, D20 }, SCUA8, 21 }, 2609 - { PIN_CONFIG_INPUT_DEBOUNCE, { D21, E20 }, SCUA8, 22 }, 2610 - { PIN_CONFIG_INPUT_DEBOUNCE, { G18, C21 }, SCUA8, 23 }, 2611 - { PIN_CONFIG_INPUT_DEBOUNCE, { B20, C20 }, SCUA8, 24 }, 2612 - { PIN_CONFIG_INPUT_DEBOUNCE, { F18, F17 }, SCUA8, 25 }, 2613 - { PIN_CONFIG_INPUT_DEBOUNCE, { E18, D19 }, SCUA8, 26 }, 2614 - { PIN_CONFIG_INPUT_DEBOUNCE, { A20, B19 }, SCUA8, 27 }, 2607 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, F19, E21, SCUA8, 20), 2608 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, F20, D20, SCUA8, 21), 2609 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, D21, E20, SCUA8, 22), 2610 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, G18, C21, SCUA8, 23), 2611 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, B20, C20, SCUA8, 24), 2612 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, F18, F17, SCUA8, 25), 2613 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, E18, D19, SCUA8, 26), 2614 + ASPEED_SB_PINCONF(PIN_CONFIG_INPUT_DEBOUNCE, A20, B19, SCUA8, 27), 2615 2615 }; 2616 2616 2617 2617 static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx, ··· 2780 2780 return 0; 2781 2781 } 2782 2782 2783 + static const struct aspeed_pin_config_map aspeed_g5_pin_config_map[] = { 2784 + { PIN_CONFIG_BIAS_PULL_DOWN, 0, 1, BIT_MASK(0)}, 2785 + { PIN_CONFIG_BIAS_PULL_DOWN, -1, 0, BIT_MASK(0)}, 2786 + { PIN_CONFIG_BIAS_DISABLE, -1, 1, BIT_MASK(0)}, 2787 + { PIN_CONFIG_DRIVE_STRENGTH, 8, 0, BIT_MASK(0)}, 2788 + { PIN_CONFIG_DRIVE_STRENGTH, 16, 1, BIT_MASK(0)}, 2789 + }; 2790 + 2783 2791 static const struct aspeed_pinmux_ops aspeed_g5_ops = { 2784 2792 .eval = aspeed_g5_sig_expr_eval, 2785 2793 .set = aspeed_g5_sig_expr_set, ··· 2805 2797 }, 2806 2798 .configs = aspeed_g5_configs, 2807 2799 .nconfigs = ARRAY_SIZE(aspeed_g5_configs), 2800 + .confmaps = aspeed_g5_pin_config_map, 2801 + .nconfmaps = ARRAY_SIZE(aspeed_g5_pin_config_map), 2808 2802 }; 2809 2803 2810 2804 static const struct pinmux_ops aspeed_g5_pinmux_ops = {
+386 -1
drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
··· 26 26 #define SCU430 0x430 /* Multi-function Pin Control #8 */ 27 27 #define SCU434 0x434 /* Multi-function Pin Control #9 */ 28 28 #define SCU438 0x438 /* Multi-function Pin Control #10 */ 29 + #define SCU440 0x440 /* USB Multi-function Pin Control #12 */ 29 30 #define SCU450 0x450 /* Multi-function Pin Control #14 */ 31 + #define SCU454 0x454 /* Multi-function Pin Control #15 */ 32 + #define SCU458 0x458 /* Multi-function Pin Control #16 */ 30 33 #define SCU4B0 0x4B0 /* Multi-function Pin Control #17 */ 31 34 #define SCU4B4 0x4B4 /* Multi-function Pin Control #18 */ 32 35 #define SCU4B8 0x4B8 /* Multi-function Pin Control #19 */ ··· 38 35 #define SCU4D8 0x4D8 /* Multi-function Pin Control #23 */ 39 36 #define SCU500 0x500 /* Hardware Strap 1 */ 40 37 #define SCU510 0x510 /* Hardware Strap 2 */ 38 + #define SCU610 0x610 /* Disable GPIO Internal Pull-Down #0 */ 39 + #define SCU614 0x614 /* Disable GPIO Internal Pull-Down #1 */ 40 + #define SCU618 0x618 /* Disable GPIO Internal Pull-Down #2 */ 41 + #define SCU61C 0x61c /* Disable GPIO Internal Pull-Down #3 */ 42 + #define SCU620 0x620 /* Disable GPIO Internal Pull-Down #4 */ 43 + #define SCU634 0x634 /* Disable GPIO Internal Pull-Down #5 */ 44 + #define SCU638 0x638 /* Disable GPIO Internal Pull-Down #6 */ 41 45 #define SCU694 0x694 /* Multi-function Pin Control #25 */ 46 + #define SCUC20 0xC20 /* PCIE configuration Setting Control */ 42 47 43 - #define ASPEED_G6_NR_PINS 248 48 + #define ASPEED_G6_NR_PINS 256 44 49 45 50 #define M24 0 46 51 SIG_EXPR_LIST_DECL_SESG(M24, MDC3, MDIO3, SIG_DESC_SET(SCU410, 0)); ··· 1545 1534 FUNC_DECL_2(I3C4, HVI3C4, I3C4); 1546 1535 FUNC_GROUP_DECL(FSI2, AE25, AF24); 1547 1536 1537 + #define AF23 248 1538 + SIG_EXPR_LIST_DECL_SESG(AF23, I3C1SCL, I3C1, SIG_DESC_SET(SCU438, 16)); 1539 + PIN_DECL_(AF23, SIG_EXPR_LIST_PTR(AF23, I3C1SCL)); 1540 + 1541 + #define AE24 249 1542 + SIG_EXPR_LIST_DECL_SESG(AE24, I3C1SDA, I3C1, SIG_DESC_SET(SCU438, 17)); 1543 + PIN_DECL_(AE24, SIG_EXPR_LIST_PTR(AE24, I3C1SDA)); 1544 + 1545 + FUNC_GROUP_DECL(I3C1, AF23, AE24); 1546 + 1547 + #define AF22 250 1548 + SIG_EXPR_LIST_DECL_SESG(AF22, I3C2SCL, I3C2, SIG_DESC_SET(SCU438, 18)); 1549 + PIN_DECL_(AF22, SIG_EXPR_LIST_PTR(AF22, I3C2SCL)); 1550 + 1551 + #define AE22 251 1552 + SIG_EXPR_LIST_DECL_SESG(AE22, I3C2SDA, I3C2, SIG_DESC_SET(SCU438, 19)); 1553 + PIN_DECL_(AE22, SIG_EXPR_LIST_PTR(AE22, I3C2SDA)); 1554 + 1555 + FUNC_GROUP_DECL(I3C2, AF22, AE22); 1556 + 1557 + #define USB2ADP_DESC { ASPEED_IP_SCU, SCU440, GENMASK(25, 24), 0, 0 } 1558 + #define USB2AD_DESC { ASPEED_IP_SCU, SCU440, GENMASK(25, 24), 1, 0 } 1559 + #define USB2AH_DESC { ASPEED_IP_SCU, SCU440, GENMASK(25, 24), 2, 0 } 1560 + #define USB2AHP_DESC { ASPEED_IP_SCU, SCU440, GENMASK(25, 24), 3, 0 } 1561 + #define USB11BHID_DESC { ASPEED_IP_SCU, SCU440, GENMASK(29, 28), 0, 0 } 1562 + #define USB2BD_DESC { ASPEED_IP_SCU, SCU440, GENMASK(29, 28), 1, 0 } 1563 + #define USB2BH_DESC { ASPEED_IP_SCU, SCU440, GENMASK(29, 28), 2, 0 } 1564 + 1565 + #define A4 252 1566 + SIG_EXPR_LIST_DECL_SEMG(A4, USB2ADPDP, USBA, USB2ADP, USB2ADP_DESC, 1567 + SIG_DESC_SET(SCUC20, 16)); 1568 + SIG_EXPR_LIST_DECL_SEMG(A4, USB2ADDP, USBA, USB2AD, USB2AD_DESC); 1569 + SIG_EXPR_LIST_DECL_SEMG(A4, USB2AHDP, USBA, USB2AH, USB2AH_DESC); 1570 + SIG_EXPR_LIST_DECL_SEMG(A4, USB2AHPDP, USBA, USB2AHP, USB2AHP_DESC); 1571 + PIN_DECL_(A4, SIG_EXPR_LIST_PTR(A4, USB2ADPDP), SIG_EXPR_LIST_PTR(A4, USB2ADDP), 1572 + SIG_EXPR_LIST_PTR(A4, USB2AHDP)); 1573 + 1574 + #define B4 253 1575 + SIG_EXPR_LIST_DECL_SEMG(B4, USB2ADPDN, USBA, USB2ADP, USB2ADP_DESC); 1576 + SIG_EXPR_LIST_DECL_SEMG(B4, USB2ADDN, USBA, USB2AD, USB2AD_DESC); 1577 + SIG_EXPR_LIST_DECL_SEMG(B4, USB2AHDN, USBA, USB2AH, USB2AH_DESC); 1578 + SIG_EXPR_LIST_DECL_SEMG(B4, USB2AHPDN, USBA, USB2AHP, USB2AHP_DESC); 1579 + PIN_DECL_(B4, SIG_EXPR_LIST_PTR(B4, USB2ADPDN), SIG_EXPR_LIST_PTR(B4, USB2ADDN), 1580 + SIG_EXPR_LIST_PTR(B4, USB2AHDN)); 1581 + 1582 + GROUP_DECL(USBA, A4, B4); 1583 + 1584 + FUNC_DECL_1(USB2ADP, USBA); 1585 + FUNC_DECL_1(USB2AD, USBA); 1586 + FUNC_DECL_1(USB2AH, USBA); 1587 + FUNC_DECL_1(USB2AHP, USBA); 1588 + 1589 + #define A6 254 1590 + SIG_EXPR_LIST_DECL_SEMG(A6, USB11BDP, USBB, USB11BHID, USB11BHID_DESC); 1591 + SIG_EXPR_LIST_DECL_SEMG(A6, USB2BDDP, USBB, USB2BD, USB2BD_DESC); 1592 + SIG_EXPR_LIST_DECL_SEMG(A6, USB2BHDP, USBB, USB2BH, USB2BH_DESC); 1593 + PIN_DECL_(A6, SIG_EXPR_LIST_PTR(A6, USB11BDP), SIG_EXPR_LIST_PTR(A6, USB2BDDP), 1594 + SIG_EXPR_LIST_PTR(A6, USB2BHDP)); 1595 + 1596 + #define B6 255 1597 + SIG_EXPR_LIST_DECL_SEMG(B6, USB11BDN, USBB, USB11BHID, USB11BHID_DESC); 1598 + SIG_EXPR_LIST_DECL_SEMG(B6, USB2BDDN, USBB, USB2BD, USB2BD_DESC); 1599 + SIG_EXPR_LIST_DECL_SEMG(B6, USB2BHDN, USBB, USB2BH, USB2BH_DESC); 1600 + PIN_DECL_(B6, SIG_EXPR_LIST_PTR(B6, USB11BDN), SIG_EXPR_LIST_PTR(B6, USB2BDDN), 1601 + SIG_EXPR_LIST_PTR(B6, USB2BHDN)); 1602 + 1603 + GROUP_DECL(USBB, A6, B6); 1604 + 1605 + FUNC_DECL_1(USB11BHID, USBB); 1606 + FUNC_DECL_1(USB2BD, USBB); 1607 + FUNC_DECL_1(USB2BH, USBB); 1608 + 1548 1609 /* Pins, groups and functions are sort(1):ed alphabetically for sanity */ 1549 1610 1550 1611 static struct pinctrl_pin_desc aspeed_g6_pins[ASPEED_G6_NR_PINS] = { ··· 1637 1554 ASPEED_PINCTRL_PIN(A24), 1638 1555 ASPEED_PINCTRL_PIN(A25), 1639 1556 ASPEED_PINCTRL_PIN(A3), 1557 + ASPEED_PINCTRL_PIN(A4), 1558 + ASPEED_PINCTRL_PIN(A6), 1640 1559 ASPEED_PINCTRL_PIN(AA11), 1641 1560 ASPEED_PINCTRL_PIN(AA12), 1642 1561 ASPEED_PINCTRL_PIN(AA16), ··· 1710 1625 ASPEED_PINCTRL_PIN(AE16), 1711 1626 ASPEED_PINCTRL_PIN(AE18), 1712 1627 ASPEED_PINCTRL_PIN(AE19), 1628 + ASPEED_PINCTRL_PIN(AE22), 1629 + ASPEED_PINCTRL_PIN(AE24), 1713 1630 ASPEED_PINCTRL_PIN(AE25), 1714 1631 ASPEED_PINCTRL_PIN(AE26), 1715 1632 ASPEED_PINCTRL_PIN(AE7), ··· 1721 1634 ASPEED_PINCTRL_PIN(AF12), 1722 1635 ASPEED_PINCTRL_PIN(AF14), 1723 1636 ASPEED_PINCTRL_PIN(AF15), 1637 + ASPEED_PINCTRL_PIN(AF22), 1638 + ASPEED_PINCTRL_PIN(AF23), 1724 1639 ASPEED_PINCTRL_PIN(AF24), 1725 1640 ASPEED_PINCTRL_PIN(AF25), 1726 1641 ASPEED_PINCTRL_PIN(AF7), ··· 1743 1654 ASPEED_PINCTRL_PIN(B25), 1744 1655 ASPEED_PINCTRL_PIN(B26), 1745 1656 ASPEED_PINCTRL_PIN(B3), 1657 + ASPEED_PINCTRL_PIN(B4), 1658 + ASPEED_PINCTRL_PIN(B6), 1746 1659 ASPEED_PINCTRL_PIN(C1), 1747 1660 ASPEED_PINCTRL_PIN(C11), 1748 1661 ASPEED_PINCTRL_PIN(C12), ··· 1938 1847 ASPEED_PINCTRL_GROUP(I2C7), 1939 1848 ASPEED_PINCTRL_GROUP(I2C8), 1940 1849 ASPEED_PINCTRL_GROUP(I2C9), 1850 + ASPEED_PINCTRL_GROUP(I3C1), 1851 + ASPEED_PINCTRL_GROUP(I3C2), 1941 1852 ASPEED_PINCTRL_GROUP(I3C3), 1942 1853 ASPEED_PINCTRL_GROUP(I3C4), 1943 1854 ASPEED_PINCTRL_GROUP(I3C5), ··· 2105 2012 ASPEED_PINCTRL_GROUP(UART7), 2106 2013 ASPEED_PINCTRL_GROUP(UART8), 2107 2014 ASPEED_PINCTRL_GROUP(UART9), 2015 + ASPEED_PINCTRL_GROUP(USBA), 2016 + ASPEED_PINCTRL_GROUP(USBB), 2108 2017 ASPEED_PINCTRL_GROUP(VB), 2109 2018 ASPEED_PINCTRL_GROUP(VGAHS), 2110 2019 ASPEED_PINCTRL_GROUP(VGAVS), ··· 2174 2079 ASPEED_PINCTRL_FUNC(I2C7), 2175 2080 ASPEED_PINCTRL_FUNC(I2C8), 2176 2081 ASPEED_PINCTRL_FUNC(I2C9), 2082 + ASPEED_PINCTRL_FUNC(I3C1), 2083 + ASPEED_PINCTRL_FUNC(I3C2), 2177 2084 ASPEED_PINCTRL_FUNC(I3C3), 2178 2085 ASPEED_PINCTRL_FUNC(I3C4), 2179 2086 ASPEED_PINCTRL_FUNC(I3C5), ··· 2318 2221 ASPEED_PINCTRL_FUNC(UART7), 2319 2222 ASPEED_PINCTRL_FUNC(UART8), 2320 2223 ASPEED_PINCTRL_FUNC(UART9), 2224 + ASPEED_PINCTRL_FUNC(USB11BHID), 2225 + ASPEED_PINCTRL_FUNC(USB2AD), 2226 + ASPEED_PINCTRL_FUNC(USB2ADP), 2227 + ASPEED_PINCTRL_FUNC(USB2AH), 2228 + ASPEED_PINCTRL_FUNC(USB2AHP), 2229 + ASPEED_PINCTRL_FUNC(USB2BD), 2230 + ASPEED_PINCTRL_FUNC(USB2BH), 2321 2231 ASPEED_PINCTRL_FUNC(VB), 2322 2232 ASPEED_PINCTRL_FUNC(VGAHS), 2323 2233 ASPEED_PINCTRL_FUNC(VGAVS), ··· 2332 2228 ASPEED_PINCTRL_FUNC(WDTRST2), 2333 2229 ASPEED_PINCTRL_FUNC(WDTRST3), 2334 2230 ASPEED_PINCTRL_FUNC(WDTRST4), 2231 + }; 2232 + 2233 + static struct aspeed_pin_config aspeed_g6_configs[] = { 2234 + /* GPIOB7 */ 2235 + ASPEED_PULL_DOWN_PINCONF(J24, SCU610, 15), 2236 + /* GPIOB6 */ 2237 + ASPEED_PULL_DOWN_PINCONF(H25, SCU610, 14), 2238 + /* GPIOB5 */ 2239 + ASPEED_PULL_DOWN_PINCONF(G26, SCU610, 13), 2240 + /* GPIOB4 */ 2241 + ASPEED_PULL_DOWN_PINCONF(J23, SCU610, 12), 2242 + /* GPIOB3 */ 2243 + ASPEED_PULL_DOWN_PINCONF(J25, SCU610, 11), 2244 + /* GPIOB2 */ 2245 + ASPEED_PULL_DOWN_PINCONF(H26, SCU610, 10), 2246 + /* GPIOB1 */ 2247 + ASPEED_PULL_DOWN_PINCONF(K23, SCU610, 9), 2248 + /* GPIOB0 */ 2249 + ASPEED_PULL_DOWN_PINCONF(J26, SCU610, 8), 2250 + 2251 + /* GPIOH3 */ 2252 + ASPEED_PULL_DOWN_PINCONF(A17, SCU614, 27), 2253 + /* GPIOH2 */ 2254 + ASPEED_PULL_DOWN_PINCONF(C18, SCU614, 26), 2255 + /* GPIOH1 */ 2256 + ASPEED_PULL_DOWN_PINCONF(B18, SCU614, 25), 2257 + /* GPIOH0 */ 2258 + ASPEED_PULL_DOWN_PINCONF(A18, SCU614, 24), 2259 + 2260 + /* GPIOL7 */ 2261 + ASPEED_PULL_DOWN_PINCONF(C14, SCU618, 31), 2262 + /* GPIOL6 */ 2263 + ASPEED_PULL_DOWN_PINCONF(B14, SCU618, 30), 2264 + /* GPIOL5 */ 2265 + ASPEED_PULL_DOWN_PINCONF(F15, SCU618, 29), 2266 + /* GPIOL4 */ 2267 + ASPEED_PULL_DOWN_PINCONF(C15, SCU618, 28), 2268 + 2269 + /* GPIOJ7 */ 2270 + ASPEED_PULL_UP_PINCONF(D19, SCU618, 15), 2271 + /* GPIOJ6 */ 2272 + ASPEED_PULL_UP_PINCONF(C20, SCU618, 14), 2273 + /* GPIOJ5 */ 2274 + ASPEED_PULL_UP_PINCONF(A19, SCU618, 13), 2275 + /* GPIOJ4 */ 2276 + ASPEED_PULL_UP_PINCONF(C19, SCU618, 12), 2277 + /* GPIOJ3 */ 2278 + ASPEED_PULL_UP_PINCONF(D20, SCU618, 11), 2279 + /* GPIOJ2 */ 2280 + ASPEED_PULL_UP_PINCONF(E19, SCU618, 10), 2281 + /* GPIOJ1 */ 2282 + ASPEED_PULL_UP_PINCONF(A20, SCU618, 9), 2283 + /* GPIOJ0 */ 2284 + ASPEED_PULL_UP_PINCONF(B20, SCU618, 8), 2285 + 2286 + /* GPIOI7 */ 2287 + ASPEED_PULL_DOWN_PINCONF(A15, SCU618, 7), 2288 + /* GPIOI6 */ 2289 + ASPEED_PULL_DOWN_PINCONF(B16, SCU618, 6), 2290 + /* GPIOI5 */ 2291 + ASPEED_PULL_DOWN_PINCONF(E16, SCU618, 5), 2292 + /* GPIOI4 */ 2293 + ASPEED_PULL_DOWN_PINCONF(C16, SCU618, 4), 2294 + /* GPIOI3 */ 2295 + ASPEED_PULL_DOWN_PINCONF(D16, SCU618, 3), 2296 + /* GPIOI2 */ 2297 + ASPEED_PULL_DOWN_PINCONF(E17, SCU618, 2), 2298 + /* GPIOI1 */ 2299 + ASPEED_PULL_DOWN_PINCONF(A16, SCU618, 1), 2300 + /* GPIOI0 */ 2301 + ASPEED_PULL_DOWN_PINCONF(D17, SCU618, 0), 2302 + 2303 + /* GPIOP7 */ 2304 + ASPEED_PULL_DOWN_PINCONF(Y23, SCU61C, 31), 2305 + /* GPIOP6 */ 2306 + ASPEED_PULL_DOWN_PINCONF(AB24, SCU61C, 30), 2307 + /* GPIOP5 */ 2308 + ASPEED_PULL_DOWN_PINCONF(AB23, SCU61C, 29), 2309 + /* GPIOP4 */ 2310 + ASPEED_PULL_DOWN_PINCONF(W23, SCU61C, 28), 2311 + /* GPIOP3 */ 2312 + ASPEED_PULL_DOWN_PINCONF(AA24, SCU61C, 27), 2313 + /* GPIOP2 */ 2314 + ASPEED_PULL_DOWN_PINCONF(AA23, SCU61C, 26), 2315 + /* GPIOP1 */ 2316 + ASPEED_PULL_DOWN_PINCONF(W24, SCU61C, 25), 2317 + /* GPIOP0 */ 2318 + ASPEED_PULL_DOWN_PINCONF(AB22, SCU61C, 24), 2319 + 2320 + /* GPIOO7 */ 2321 + ASPEED_PULL_DOWN_PINCONF(AC23, SCU61C, 23), 2322 + /* GPIOO6 */ 2323 + ASPEED_PULL_DOWN_PINCONF(AC24, SCU61C, 22), 2324 + /* GPIOO5 */ 2325 + ASPEED_PULL_DOWN_PINCONF(AC22, SCU61C, 21), 2326 + /* GPIOO4 */ 2327 + ASPEED_PULL_DOWN_PINCONF(AD25, SCU61C, 20), 2328 + /* GPIOO3 */ 2329 + ASPEED_PULL_DOWN_PINCONF(AD24, SCU61C, 19), 2330 + /* GPIOO2 */ 2331 + ASPEED_PULL_DOWN_PINCONF(AD23, SCU61C, 18), 2332 + /* GPIOO1 */ 2333 + ASPEED_PULL_DOWN_PINCONF(AD22, SCU61C, 17), 2334 + /* GPIOO0 */ 2335 + ASPEED_PULL_DOWN_PINCONF(AD26, SCU61C, 16), 2336 + 2337 + /* GPION7 */ 2338 + ASPEED_PULL_DOWN_PINCONF(M26, SCU61C, 15), 2339 + /* GPION6 */ 2340 + ASPEED_PULL_DOWN_PINCONF(N26, SCU61C, 14), 2341 + /* GPION5 */ 2342 + ASPEED_PULL_DOWN_PINCONF(M23, SCU61C, 13), 2343 + /* GPION4 */ 2344 + ASPEED_PULL_DOWN_PINCONF(P26, SCU61C, 12), 2345 + /* GPION3 */ 2346 + ASPEED_PULL_DOWN_PINCONF(N24, SCU61C, 11), 2347 + /* GPION2 */ 2348 + ASPEED_PULL_DOWN_PINCONF(N25, SCU61C, 10), 2349 + /* GPION1 */ 2350 + ASPEED_PULL_DOWN_PINCONF(N23, SCU61C, 9), 2351 + /* GPION0 */ 2352 + ASPEED_PULL_DOWN_PINCONF(P25, SCU61C, 8), 2353 + 2354 + /* GPIOM7 */ 2355 + ASPEED_PULL_DOWN_PINCONF(D13, SCU61C, 7), 2356 + /* GPIOM6 */ 2357 + ASPEED_PULL_DOWN_PINCONF(C13, SCU61C, 6), 2358 + /* GPIOM5 */ 2359 + ASPEED_PULL_DOWN_PINCONF(C12, SCU61C, 5), 2360 + /* GPIOM4 */ 2361 + ASPEED_PULL_DOWN_PINCONF(B12, SCU61C, 4), 2362 + /* GPIOM3 */ 2363 + ASPEED_PULL_DOWN_PINCONF(E14, SCU61C, 3), 2364 + /* GPIOM2 */ 2365 + ASPEED_PULL_DOWN_PINCONF(A12, SCU61C, 2), 2366 + /* GPIOM1 */ 2367 + ASPEED_PULL_DOWN_PINCONF(B13, SCU61C, 1), 2368 + /* GPIOM0 */ 2369 + ASPEED_PULL_DOWN_PINCONF(D14, SCU61C, 0), 2370 + 2371 + /* GPIOS7 */ 2372 + ASPEED_PULL_DOWN_PINCONF(T24, SCU620, 23), 2373 + /* GPIOS6 */ 2374 + ASPEED_PULL_DOWN_PINCONF(P23, SCU620, 22), 2375 + /* GPIOS5 */ 2376 + ASPEED_PULL_DOWN_PINCONF(P24, SCU620, 21), 2377 + /* GPIOS4 */ 2378 + ASPEED_PULL_DOWN_PINCONF(R26, SCU620, 20), 2379 + /* GPIOS3*/ 2380 + ASPEED_PULL_DOWN_PINCONF(R24, SCU620, 19), 2381 + /* GPIOS2 */ 2382 + ASPEED_PULL_DOWN_PINCONF(T26, SCU620, 18), 2383 + /* GPIOS1 */ 2384 + ASPEED_PULL_DOWN_PINCONF(T25, SCU620, 17), 2385 + /* GPIOS0 */ 2386 + ASPEED_PULL_DOWN_PINCONF(R23, SCU620, 16), 2387 + 2388 + /* GPIOR7 */ 2389 + ASPEED_PULL_DOWN_PINCONF(U26, SCU620, 15), 2390 + /* GPIOR6 */ 2391 + ASPEED_PULL_DOWN_PINCONF(W26, SCU620, 14), 2392 + /* GPIOR5 */ 2393 + ASPEED_PULL_DOWN_PINCONF(T23, SCU620, 13), 2394 + /* GPIOR4 */ 2395 + ASPEED_PULL_DOWN_PINCONF(U25, SCU620, 12), 2396 + /* GPIOR3*/ 2397 + ASPEED_PULL_DOWN_PINCONF(V26, SCU620, 11), 2398 + /* GPIOR2 */ 2399 + ASPEED_PULL_DOWN_PINCONF(V24, SCU620, 10), 2400 + /* GPIOR1 */ 2401 + ASPEED_PULL_DOWN_PINCONF(U24, SCU620, 9), 2402 + /* GPIOR0 */ 2403 + ASPEED_PULL_DOWN_PINCONF(V25, SCU620, 8), 2404 + 2405 + /* GPIOX7 */ 2406 + ASPEED_PULL_DOWN_PINCONF(AB10, SCU634, 31), 2407 + /* GPIOX6 */ 2408 + ASPEED_PULL_DOWN_PINCONF(AF9, SCU634, 30), 2409 + /* GPIOX5 */ 2410 + ASPEED_PULL_DOWN_PINCONF(AD9, SCU634, 29), 2411 + /* GPIOX4 */ 2412 + ASPEED_PULL_DOWN_PINCONF(AB9, SCU634, 28), 2413 + /* GPIOX3*/ 2414 + ASPEED_PULL_DOWN_PINCONF(AF8, SCU634, 27), 2415 + /* GPIOX2 */ 2416 + ASPEED_PULL_DOWN_PINCONF(AC9, SCU634, 26), 2417 + /* GPIOX1 */ 2418 + ASPEED_PULL_DOWN_PINCONF(AA9, SCU634, 25), 2419 + /* GPIOX0 */ 2420 + ASPEED_PULL_DOWN_PINCONF(AE8, SCU634, 24), 2421 + 2422 + /* GPIOV7 */ 2423 + ASPEED_PULL_DOWN_PINCONF(AF15, SCU634, 15), 2424 + /* GPIOV6 */ 2425 + ASPEED_PULL_DOWN_PINCONF(AD15, SCU634, 14), 2426 + /* GPIOV5 */ 2427 + ASPEED_PULL_DOWN_PINCONF(AE14, SCU634, 13), 2428 + /* GPIOV4 */ 2429 + ASPEED_PULL_DOWN_PINCONF(AE15, SCU634, 12), 2430 + /* GPIOV3*/ 2431 + ASPEED_PULL_DOWN_PINCONF(AC15, SCU634, 11), 2432 + /* GPIOV2 */ 2433 + ASPEED_PULL_DOWN_PINCONF(AD14, SCU634, 10), 2434 + /* GPIOV1 */ 2435 + ASPEED_PULL_DOWN_PINCONF(AF14, SCU634, 9), 2436 + /* GPIOV0 */ 2437 + ASPEED_PULL_DOWN_PINCONF(AB15, SCU634, 8), 2438 + 2439 + /* GPIOZ7 */ 2440 + ASPEED_PULL_DOWN_PINCONF(AF10, SCU638, 15), 2441 + /* GPIOZ6 */ 2442 + ASPEED_PULL_DOWN_PINCONF(AD11, SCU638, 14), 2443 + /* GPIOZ5 */ 2444 + ASPEED_PULL_DOWN_PINCONF(AA11, SCU638, 13), 2445 + /* GPIOZ4 */ 2446 + ASPEED_PULL_DOWN_PINCONF(AC11, SCU638, 12), 2447 + /* GPIOZ3*/ 2448 + ASPEED_PULL_DOWN_PINCONF(AB11, SCU638, 11), 2449 + 2450 + /* GPIOZ1 */ 2451 + ASPEED_PULL_DOWN_PINCONF(AD10, SCU638, 9), 2452 + /* GPIOZ0 */ 2453 + ASPEED_PULL_DOWN_PINCONF(AC10, SCU638, 8), 2454 + 2455 + /* GPIOY6 */ 2456 + ASPEED_PULL_DOWN_PINCONF(AC12, SCU638, 6), 2457 + /* GPIOY5 */ 2458 + ASPEED_PULL_DOWN_PINCONF(AF12, SCU638, 5), 2459 + /* GPIOY4 */ 2460 + ASPEED_PULL_DOWN_PINCONF(AE12, SCU638, 4), 2461 + /* GPIOY3 */ 2462 + ASPEED_PULL_DOWN_PINCONF(AA12, SCU638, 3), 2463 + /* GPIOY2 */ 2464 + ASPEED_PULL_DOWN_PINCONF(AE11, SCU638, 2), 2465 + /* GPIOY1 */ 2466 + ASPEED_PULL_DOWN_PINCONF(AD12, SCU638, 1), 2467 + /* GPIOY0 */ 2468 + ASPEED_PULL_DOWN_PINCONF(AF11, SCU638, 0), 2469 + 2470 + /* LAD3 */ 2471 + { PIN_CONFIG_DRIVE_STRENGTH, { AC7, AC7 }, SCU454, GENMASK(31, 30)}, 2472 + /* LAD2 */ 2473 + { PIN_CONFIG_DRIVE_STRENGTH, { AC8, AC8 }, SCU454, GENMASK(29, 28)}, 2474 + /* LAD1 */ 2475 + { PIN_CONFIG_DRIVE_STRENGTH, { AB8, AB8 }, SCU454, GENMASK(27, 26)}, 2476 + /* LAD0 */ 2477 + { PIN_CONFIG_DRIVE_STRENGTH, { AB7, AB7 }, SCU454, GENMASK(25, 24)}, 2478 + 2479 + /* MAC3 */ 2480 + { PIN_CONFIG_POWER_SOURCE, { H24, E26 }, SCU458, BIT_MASK(4)}, 2481 + { PIN_CONFIG_DRIVE_STRENGTH, { H24, E26 }, SCU458, GENMASK(1, 0)}, 2482 + /* MAC4 */ 2483 + { PIN_CONFIG_POWER_SOURCE, { F24, B24 }, SCU458, BIT_MASK(5)}, 2484 + { PIN_CONFIG_DRIVE_STRENGTH, { F24, B24 }, SCU458, GENMASK(3, 2)}, 2335 2485 }; 2336 2486 2337 2487 /** ··· 2655 2297 return 0; 2656 2298 } 2657 2299 2300 + static const struct aspeed_pin_config_map aspeed_g6_pin_config_map[] = { 2301 + { PIN_CONFIG_BIAS_PULL_DOWN, 0, 1, BIT_MASK(0)}, 2302 + { PIN_CONFIG_BIAS_PULL_DOWN, -1, 0, BIT_MASK(0)}, 2303 + { PIN_CONFIG_BIAS_PULL_UP, 0, 1, BIT_MASK(0)}, 2304 + { PIN_CONFIG_BIAS_PULL_UP, -1, 0, BIT_MASK(0)}, 2305 + { PIN_CONFIG_BIAS_DISABLE, -1, 1, BIT_MASK(0)}, 2306 + { PIN_CONFIG_DRIVE_STRENGTH, 4, 0, GENMASK(1, 0)}, 2307 + { PIN_CONFIG_DRIVE_STRENGTH, 8, 1, GENMASK(1, 0)}, 2308 + { PIN_CONFIG_DRIVE_STRENGTH, 12, 2, GENMASK(1, 0)}, 2309 + { PIN_CONFIG_DRIVE_STRENGTH, 16, 3, GENMASK(1, 0)}, 2310 + { PIN_CONFIG_POWER_SOURCE, 3300, 0, BIT_MASK(0)}, 2311 + { PIN_CONFIG_POWER_SOURCE, 1800, 1, BIT_MASK(0)}, 2312 + }; 2313 + 2658 2314 static const struct aspeed_pinmux_ops aspeed_g5_ops = { 2659 2315 .set = aspeed_g6_sig_expr_set, 2660 2316 }; ··· 2683 2311 .functions = aspeed_g6_functions, 2684 2312 .nfunctions = ARRAY_SIZE(aspeed_g6_functions), 2685 2313 }, 2314 + .configs = aspeed_g6_configs, 2315 + .nconfigs = ARRAY_SIZE(aspeed_g6_configs), 2316 + .confmaps = aspeed_g6_pin_config_map, 2317 + .nconfmaps = ARRAY_SIZE(aspeed_g6_pin_config_map), 2686 2318 }; 2687 2319 2688 2320 static const struct pinmux_ops aspeed_g6_pinmux_ops = { ··· 2707 2331 .dt_free_map = pinctrl_utils_free_map, 2708 2332 }; 2709 2333 2334 + static const struct pinconf_ops aspeed_g6_conf_ops = { 2335 + .is_generic = true, 2336 + .pin_config_get = aspeed_pin_config_get, 2337 + .pin_config_set = aspeed_pin_config_set, 2338 + .pin_config_group_get = aspeed_pin_config_group_get, 2339 + .pin_config_group_set = aspeed_pin_config_group_set, 2340 + }; 2341 + 2710 2342 static struct pinctrl_desc aspeed_g6_pinctrl_desc = { 2711 2343 .name = "aspeed-g6-pinctrl", 2712 2344 .pins = aspeed_g6_pins, 2713 2345 .npins = ARRAY_SIZE(aspeed_g6_pins), 2714 2346 .pctlops = &aspeed_g6_pinctrl_ops, 2715 2347 .pmxops = &aspeed_g6_pinmux_ops, 2348 + .confops = &aspeed_g6_conf_ops, 2716 2349 }; 2717 2350 2718 2351 static int aspeed_g6_pinctrl_probe(struct platform_device *pdev)
+11 -39
drivers/pinctrl/aspeed/pinctrl-aspeed.c
··· 411 411 return NULL; 412 412 } 413 413 414 - /* 415 - * Aspeed pin configuration description. 416 - * 417 - * @param: pinconf configuration parameter 418 - * @arg: The supported argument for @param, or -1 if any value is supported 419 - * @val: The register value to write to configure @arg for @param 420 - * 421 - * The map is to be used in conjunction with the configuration array supplied 422 - * by the driver implementation. 423 - */ 424 - struct aspeed_pin_config_map { 425 - enum pin_config_param param; 426 - s32 arg; 427 - u32 val; 428 - }; 429 - 430 414 enum aspeed_pin_config_map_type { MAP_TYPE_ARG, MAP_TYPE_VAL }; 431 415 432 - /* Aspeed consistently both: 433 - * 434 - * 1. Defines "disable bits" for internal pull-downs 435 - * 2. Uses 8mA or 16mA drive strengths 436 - */ 437 - static const struct aspeed_pin_config_map pin_config_map[] = { 438 - { PIN_CONFIG_BIAS_PULL_DOWN, 0, 1 }, 439 - { PIN_CONFIG_BIAS_PULL_DOWN, -1, 0 }, 440 - { PIN_CONFIG_BIAS_DISABLE, -1, 1 }, 441 - { PIN_CONFIG_DRIVE_STRENGTH, 8, 0 }, 442 - { PIN_CONFIG_DRIVE_STRENGTH, 16, 1 }, 443 - }; 444 - 445 416 static const struct aspeed_pin_config_map *find_pinconf_map( 417 + const struct aspeed_pinctrl_data *pdata, 446 418 enum pin_config_param param, 447 419 enum aspeed_pin_config_map_type type, 448 420 s64 value) 449 421 { 450 422 int i; 451 423 452 - for (i = 0; i < ARRAY_SIZE(pin_config_map); i++) { 424 + for (i = 0; i < pdata->nconfmaps; i++) { 453 425 const struct aspeed_pin_config_map *elem; 454 426 bool match; 455 427 456 - elem = &pin_config_map[i]; 428 + elem = &pdata->confmaps[i]; 457 429 458 430 switch (type) { 459 431 case MAP_TYPE_ARG: ··· 463 491 if (rc < 0) 464 492 return rc; 465 493 466 - pmap = find_pinconf_map(param, MAP_TYPE_VAL, 467 - (val & BIT(pconf->bit)) >> pconf->bit); 494 + pmap = find_pinconf_map(pdata, param, MAP_TYPE_VAL, 495 + (val & pconf->mask) >> __ffs(pconf->mask)); 468 496 469 497 if (!pmap) 470 498 return -EINVAL; ··· 507 535 if (!pconf) 508 536 return -ENOTSUPP; 509 537 510 - pmap = find_pinconf_map(param, MAP_TYPE_ARG, arg); 538 + pmap = find_pinconf_map(pdata, param, MAP_TYPE_ARG, arg); 511 539 512 540 if (WARN_ON(!pmap)) 513 541 return -EINVAL; 514 542 515 - val = pmap->val << pconf->bit; 543 + val = pmap->val << __ffs(pconf->mask); 516 544 517 545 rc = regmap_update_bits(pdata->scu, pconf->reg, 518 - BIT(pconf->bit), val); 546 + pmap->mask, val); 519 547 520 548 if (rc < 0) 521 549 return rc; 522 550 523 - pr_debug("%s: Set SCU%02X[%d]=%d for param %d(=%d) on pin %d\n", 524 - __func__, pconf->reg, pconf->bit, pmap->val, 525 - param, arg, offset); 551 + pr_debug("%s: Set SCU%02X[%lu]=%d for param %d(=%d) on pin %d\n", 552 + __func__, pconf->reg, __ffs(pconf->mask), 553 + pmap->val, param, arg, offset); 526 554 } 527 555 528 556 return 0;
+36 -2
drivers/pinctrl/aspeed/pinctrl-aspeed.h
··· 24 24 enum pin_config_param param; 25 25 unsigned int pins[2]; 26 26 unsigned int reg; 27 - u8 bit; 28 - u8 value; 27 + u32 mask; 29 28 }; 30 29 31 30 #define ASPEED_PINCTRL_PIN(name_) \ ··· 33 34 .name = #name_, \ 34 35 .drv_data = (void *) &(PIN_SYM(name_)) \ 35 36 } 37 + 38 + #define ASPEED_SB_PINCONF(param_, pin0_, pin1_, reg_, bit_) { \ 39 + .param = param_, \ 40 + .pins = {pin0_, pin1_}, \ 41 + .reg = reg_, \ 42 + .mask = BIT_MASK(bit_) \ 43 + } 44 + 45 + #define ASPEED_PULL_DOWN_PINCONF(pin_, reg_, bit_) \ 46 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_DOWN, pin_, pin_, reg_, bit_), \ 47 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, pin_, pin_, reg_, bit_) 48 + 49 + #define ASPEED_PULL_UP_PINCONF(pin_, reg_, bit_) \ 50 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_PULL_UP, pin_, pin_, reg_, bit_), \ 51 + ASPEED_SB_PINCONF(PIN_CONFIG_BIAS_DISABLE, pin_, pin_, reg_, bit_) 52 + /* 53 + * Aspeed pin configuration description. 54 + * 55 + * @param: pinconf configuration parameter 56 + * @arg: The supported argument for @param, or -1 if any value is supported 57 + * @val: The register value to write to configure @arg for @param 58 + * @mask: The bitfield mask for @val 59 + * 60 + * The map is to be used in conjunction with the configuration array supplied 61 + * by the driver implementation. 62 + */ 63 + struct aspeed_pin_config_map { 64 + enum pin_config_param param; 65 + s32 arg; 66 + u32 val; 67 + u32 mask; 68 + }; 36 69 37 70 struct aspeed_pinctrl_data { 38 71 struct regmap *scu; ··· 76 45 const unsigned int nconfigs; 77 46 78 47 struct aspeed_pinmux_data pinmux; 48 + 49 + const struct aspeed_pin_config_map *confmaps; 50 + const unsigned int nconfmaps; 79 51 }; 80 52 81 53 /* Aspeed pinctrl helpers */
+1
drivers/pinctrl/aspeed/pinmux-aspeed.h
··· 737 737 #define FUNC_DECL_(func, ...) \ 738 738 static const char *FUNC_SYM(func)[] = { __VA_ARGS__ } 739 739 740 + #define FUNC_DECL_1(func, group) FUNC_DECL_(func, #group) 740 741 #define FUNC_DECL_2(func, one, two) FUNC_DECL_(func, #one, #two) 741 742 #define FUNC_DECL_3(func, one, two, three) FUNC_DECL_(func, #one, #two, #three) 742 743
+8 -2
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
··· 286 286 iproc_set_bit(chip, IPROC_GPIO_INT_DE_OFFSET, gpio, dual_edge); 287 287 iproc_set_bit(chip, IPROC_GPIO_INT_EDGE_OFFSET, gpio, 288 288 rising_or_high); 289 + 290 + if (type & IRQ_TYPE_EDGE_BOTH) 291 + irq_set_handler_locked(d, handle_edge_irq); 292 + else 293 + irq_set_handler_locked(d, handle_level_irq); 294 + 289 295 raw_spin_unlock_irqrestore(&chip->lock, flags); 290 296 291 297 dev_dbg(chip->dev, ··· 849 843 "gpio-ranges"); 850 844 851 845 /* optional GPIO interrupt support */ 852 - irq = platform_get_irq(pdev, 0); 846 + irq = platform_get_irq_optional(pdev, 0); 853 847 if (irq > 0) { 854 848 struct irq_chip *irqc; 855 849 struct gpio_irq_chip *girq; ··· 874 868 return -ENOMEM; 875 869 girq->parents[0] = irq; 876 870 girq->default_type = IRQ_TYPE_NONE; 877 - girq->handler = handle_simple_irq; 871 + girq->handler = handle_bad_irq; 878 872 } 879 873 880 874 ret = gpiochip_add_data(gc, chip);
-1
drivers/pinctrl/cirrus/pinctrl-madera-core.c
··· 560 560 seq_puts(s, " SCHMITT"); 561 561 } 562 562 563 - 564 563 static const struct pinctrl_ops madera_pin_group_ops = { 565 564 .get_groups_count = madera_get_groups_count, 566 565 .get_group_name = madera_get_group_name,
+17 -26
drivers/pinctrl/core.c
··· 1376 1376 } 1377 1377 EXPORT_SYMBOL_GPL(devm_pinctrl_put); 1378 1378 1379 - int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps, 1380 - bool dup) 1379 + /** 1380 + * pinctrl_register_mappings() - register a set of pin controller mappings 1381 + * @maps: the pincontrol mappings table to register. Note the pinctrl-core 1382 + * keeps a reference to the passed in maps, so they should _not_ be 1383 + * marked with __initdata. 1384 + * @num_maps: the number of maps in the mapping table 1385 + */ 1386 + int pinctrl_register_mappings(const struct pinctrl_map *maps, 1387 + unsigned num_maps) 1381 1388 { 1382 1389 int i, ret; 1383 1390 struct pinctrl_maps *maps_node; ··· 1437 1430 if (!maps_node) 1438 1431 return -ENOMEM; 1439 1432 1433 + maps_node->maps = maps; 1440 1434 maps_node->num_maps = num_maps; 1441 - if (dup) { 1442 - maps_node->maps = kmemdup(maps, sizeof(*maps) * num_maps, 1443 - GFP_KERNEL); 1444 - if (!maps_node->maps) { 1445 - kfree(maps_node); 1446 - return -ENOMEM; 1447 - } 1448 - } else { 1449 - maps_node->maps = maps; 1450 - } 1451 1435 1452 1436 mutex_lock(&pinctrl_maps_mutex); 1453 1437 list_add_tail(&maps_node->node, &pinctrl_maps); ··· 1446 1448 1447 1449 return 0; 1448 1450 } 1449 - 1450 - /** 1451 - * pinctrl_register_mappings() - register a set of pin controller mappings 1452 - * @maps: the pincontrol mappings table to register. This should probably be 1453 - * marked with __initdata so it can be discarded after boot. This 1454 - * function will perform a shallow copy for the mapping entries. 1455 - * @num_maps: the number of maps in the mapping table 1456 - */ 1457 - int pinctrl_register_mappings(const struct pinctrl_map *maps, 1458 - unsigned num_maps) 1459 - { 1460 - return pinctrl_register_map(maps, num_maps, true); 1461 - } 1462 1451 EXPORT_SYMBOL_GPL(pinctrl_register_mappings); 1463 1452 1464 - void pinctrl_unregister_map(const struct pinctrl_map *map) 1453 + /** 1454 + * pinctrl_unregister_mappings() - unregister a set of pin controller mappings 1455 + * @maps: the pincontrol mappings table passed to pinctrl_register_mappings() 1456 + * when registering the mappings. 1457 + */ 1458 + void pinctrl_unregister_mappings(const struct pinctrl_map *map) 1465 1459 { 1466 1460 struct pinctrl_maps *maps_node; 1467 1461 ··· 1468 1478 } 1469 1479 mutex_unlock(&pinctrl_maps_mutex); 1470 1480 } 1481 + EXPORT_SYMBOL_GPL(pinctrl_unregister_mappings); 1471 1482 1472 1483 /** 1473 1484 * pinctrl_force_sleep() - turn a given controller device into sleep state
-4
drivers/pinctrl/core.h
··· 236 236 pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev, 237 237 unsigned int pin); 238 238 239 - int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps, 240 - bool dup); 241 - void pinctrl_unregister_map(const struct pinctrl_map *map); 242 - 243 239 extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev); 244 240 extern int pinctrl_force_default(struct pinctrl_dev *pctldev); 245 241
+2 -2
drivers/pinctrl/devicetree.c
··· 51 51 struct pinctrl_dt_map *dt_map, *n1; 52 52 53 53 list_for_each_entry_safe(dt_map, n1, &p->dt_maps, node) { 54 - pinctrl_unregister_map(dt_map->map); 54 + pinctrl_unregister_mappings(dt_map->map); 55 55 list_del(&dt_map->node); 56 56 dt_free_map(dt_map->pctldev, dt_map->map, 57 57 dt_map->num_maps); ··· 92 92 dt_map->num_maps = num_maps; 93 93 list_add_tail(&dt_map->node, &p->dt_maps); 94 94 95 - return pinctrl_register_map(map, num_maps, false); 95 + return pinctrl_register_mappings(map, num_maps); 96 96 97 97 err_free_map: 98 98 dt_free_map(pctldev, map, num_maps);
+7
drivers/pinctrl/freescale/Kconfig
··· 137 137 help 138 138 Say Y here to enable the imx8mn pinctrl driver 139 139 140 + config PINCTRL_IMX8MP 141 + bool "IMX8MP pinctrl driver" 142 + depends on ARCH_MXC && ARM64 143 + select PINCTRL_IMX 144 + help 145 + Say Y here to enable the imx8mp pinctrl driver 146 + 140 147 config PINCTRL_IMX8MQ 141 148 bool "IMX8MQ pinctrl driver" 142 149 depends on ARCH_MXC && ARM64
+1
drivers/pinctrl/freescale/Makefile
··· 20 20 obj-$(CONFIG_PINCTRL_IMX7ULP) += pinctrl-imx7ulp.o 21 21 obj-$(CONFIG_PINCTRL_IMX8MM) += pinctrl-imx8mm.o 22 22 obj-$(CONFIG_PINCTRL_IMX8MN) += pinctrl-imx8mn.o 23 + obj-$(CONFIG_PINCTRL_IMX8MP) += pinctrl-imx8mp.o 23 24 obj-$(CONFIG_PINCTRL_IMX8MQ) += pinctrl-imx8mq.o 24 25 obj-$(CONFIG_PINCTRL_IMX8QM) += pinctrl-imx8qm.o 25 26 obj-$(CONFIG_PINCTRL_IMX8QXP) += pinctrl-imx8qxp.o
+345
drivers/pinctrl/freescale/pinctrl-imx8mp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright 2019 NXP 4 + */ 5 + 6 + #include <linux/err.h> 7 + #include <linux/init.h> 8 + #include <linux/of.h> 9 + #include <linux/pinctrl/pinctrl.h> 10 + #include <linux/platform_device.h> 11 + 12 + #include "pinctrl-imx.h" 13 + 14 + enum imx8mp_pads { 15 + MX8MP_IOMUXC_RESERVE0 = 0, 16 + MX8MP_IOMUXC_RESERVE1 = 1, 17 + MX8MP_IOMUXC_RESERVE2 = 2, 18 + MX8MP_IOMUXC_RESERVE3 = 3, 19 + MX8MP_IOMUXC_RESERVE4 = 4, 20 + MX8MP_IOMUXC_GPIO1_IO00 = 5, 21 + MX8MP_IOMUXC_GPIO1_IO01 = 6, 22 + MX8MP_IOMUXC_GPIO1_IO02 = 7, 23 + MX8MP_IOMUXC_GPIO1_IO03 = 8, 24 + MX8MP_IOMUXC_GPIO1_IO04 = 9, 25 + MX8MP_IOMUXC_GPIO1_IO05 = 10, 26 + MX8MP_IOMUXC_GPIO1_IO06 = 11, 27 + MX8MP_IOMUXC_GPIO1_IO07 = 12, 28 + MX8MP_IOMUXC_GPIO1_IO08 = 13, 29 + MX8MP_IOMUXC_GPIO1_IO09 = 14, 30 + MX8MP_IOMUXC_GPIO1_IO10 = 15, 31 + MX8MP_IOMUXC_GPIO1_IO11 = 16, 32 + MX8MP_IOMUXC_GPIO1_IO12 = 17, 33 + MX8MP_IOMUXC_GPIO1_IO13 = 18, 34 + MX8MP_IOMUXC_GPIO1_IO14 = 19, 35 + MX8MP_IOMUXC_GPIO1_IO15 = 20, 36 + MX8MP_IOMUXC_ENET_MDC = 21, 37 + MX8MP_IOMUXC_ENET_MDIO = 22, 38 + MX8MP_IOMUXC_ENET_TD3 = 23, 39 + MX8MP_IOMUXC_ENET_TD2 = 24, 40 + MX8MP_IOMUXC_ENET_TD1 = 25, 41 + MX8MP_IOMUXC_ENET_TD0 = 26, 42 + MX8MP_IOMUXC_ENET_TX_CTL = 27, 43 + MX8MP_IOMUXC_ENET_TXC = 28, 44 + MX8MP_IOMUXC_ENET_RX_CTL = 29, 45 + MX8MP_IOMUXC_ENET_RXC = 30, 46 + MX8MP_IOMUXC_ENET_RD0 = 31, 47 + MX8MP_IOMUXC_ENET_RD1 = 32, 48 + MX8MP_IOMUXC_ENET_RD2 = 33, 49 + MX8MP_IOMUXC_ENET_RD3 = 34, 50 + MX8MP_IOMUXC_SD1_CLK = 35, 51 + MX8MP_IOMUXC_SD1_CMD = 36, 52 + MX8MP_IOMUXC_SD1_DATA0 = 37, 53 + MX8MP_IOMUXC_SD1_DATA1 = 38, 54 + MX8MP_IOMUXC_SD1_DATA2 = 39, 55 + MX8MP_IOMUXC_SD1_DATA3 = 40, 56 + MX8MP_IOMUXC_SD1_DATA4 = 41, 57 + MX8MP_IOMUXC_SD1_DATA5 = 42, 58 + MX8MP_IOMUXC_SD1_DATA6 = 43, 59 + MX8MP_IOMUXC_SD1_DATA7 = 44, 60 + MX8MP_IOMUXC_SD1_RESET_B = 45, 61 + MX8MP_IOMUXC_SD1_STROBE = 46, 62 + MX8MP_IOMUXC_SD2_CD_B = 47, 63 + MX8MP_IOMUXC_SD2_CLK = 48, 64 + MX8MP_IOMUXC_SD2_CMD = 49, 65 + MX8MP_IOMUXC_SD2_DATA0 = 50, 66 + MX8MP_IOMUXC_SD2_DATA1 = 51, 67 + MX8MP_IOMUXC_SD2_DATA2 = 52, 68 + MX8MP_IOMUXC_SD2_DATA3 = 53, 69 + MX8MP_IOMUXC_SD2_RESET_B = 54, 70 + MX8MP_IOMUXC_SD2_WP = 55, 71 + MX8MP_IOMUXC_NAND_ALE = 56, 72 + MX8MP_IOMUXC_NAND_CE0_B = 57, 73 + MX8MP_IOMUXC_NAND_CE1_B = 58, 74 + MX8MP_IOMUXC_NAND_CE2_B = 59, 75 + MX8MP_IOMUXC_NAND_CE3_B = 60, 76 + MX8MP_IOMUXC_NAND_CLE = 61, 77 + MX8MP_IOMUXC_NAND_DATA00 = 62, 78 + MX8MP_IOMUXC_NAND_DATA01 = 63, 79 + MX8MP_IOMUXC_NAND_DATA02 = 64, 80 + MX8MP_IOMUXC_NAND_DATA03 = 65, 81 + MX8MP_IOMUXC_NAND_DATA04 = 66, 82 + MX8MP_IOMUXC_NAND_DATA05 = 67, 83 + MX8MP_IOMUXC_NAND_DATA06 = 68, 84 + MX8MP_IOMUXC_NAND_DATA07 = 69, 85 + MX8MP_IOMUXC_NAND_DQS = 70, 86 + MX8MP_IOMUXC_NAND_RE_B = 71, 87 + MX8MP_IOMUXC_NAND_READY_B = 72, 88 + MX8MP_IOMUXC_NAND_WE_B = 73, 89 + MX8MP_IOMUXC_NAND_WP_B = 74, 90 + MX8MP_IOMUXC_SAI5_RXFS = 75, 91 + MX8MP_IOMUXC_SAI5_RXC = 76, 92 + MX8MP_IOMUXC_SAI5_RXD0 = 77, 93 + MX8MP_IOMUXC_SAI5_RXD1 = 78, 94 + MX8MP_IOMUXC_SAI5_RXD2 = 79, 95 + MX8MP_IOMUXC_SAI5_RXD3 = 80, 96 + MX8MP_IOMUXC_SAI5_MCLK = 81, 97 + MX8MP_IOMUXC_SAI1_RXFS = 82, 98 + MX8MP_IOMUXC_SAI1_RXC = 83, 99 + MX8MP_IOMUXC_SAI1_RXD0 = 84, 100 + MX8MP_IOMUXC_SAI1_RXD1 = 85, 101 + MX8MP_IOMUXC_SAI1_RXD2 = 86, 102 + MX8MP_IOMUXC_SAI1_RXD3 = 87, 103 + MX8MP_IOMUXC_SAI1_RXD4 = 88, 104 + MX8MP_IOMUXC_SAI1_RXD5 = 89, 105 + MX8MP_IOMUXC_SAI1_RXD6 = 90, 106 + MX8MP_IOMUXC_SAI1_RXD7 = 91, 107 + MX8MP_IOMUXC_SAI1_TXFS = 92, 108 + MX8MP_IOMUXC_SAI1_TXC = 93, 109 + MX8MP_IOMUXC_SAI1_TXD0 = 94, 110 + MX8MP_IOMUXC_SAI1_TXD1 = 95, 111 + MX8MP_IOMUXC_SAI1_TXD2 = 96, 112 + MX8MP_IOMUXC_SAI1_TXD3 = 97, 113 + MX8MP_IOMUXC_SAI1_TXD4 = 98, 114 + MX8MP_IOMUXC_SAI1_TXD5 = 99, 115 + MX8MP_IOMUXC_SAI1_TXD6 = 100, 116 + MX8MP_IOMUXC_SAI1_TXD7 = 101, 117 + MX8MP_IOMUXC_SAI1_MCLK = 102, 118 + MX8MP_IOMUXC_SAI2_RXFS = 103, 119 + MX8MP_IOMUXC_SAI2_RXC = 104, 120 + MX8MP_IOMUXC_SAI2_RXD0 = 105, 121 + MX8MP_IOMUXC_SAI2_TXFS = 106, 122 + MX8MP_IOMUXC_SAI2_TXC = 107, 123 + MX8MP_IOMUXC_SAI2_TXD0 = 108, 124 + MX8MP_IOMUXC_SAI2_MCLK = 109, 125 + MX8MP_IOMUXC_SAI3_RXFS = 110, 126 + MX8MP_IOMUXC_SAI3_RXC = 111, 127 + MX8MP_IOMUXC_SAI3_RXD = 112, 128 + MX8MP_IOMUXC_SAI3_TXFS = 113, 129 + MX8MP_IOMUXC_SAI3_TXC = 114, 130 + MX8MP_IOMUXC_SAI3_TXD = 115, 131 + MX8MP_IOMUXC_SAI3_MCLK = 116, 132 + MX8MP_IOMUXC_SPDIF_TX = 117, 133 + MX8MP_IOMUXC_SPDIF_RX = 118, 134 + MX8MP_IOMUXC_SPDIF_EXT_CLK = 119, 135 + MX8MP_IOMUXC_ECSPI1_SCLK = 120, 136 + MX8MP_IOMUXC_ECSPI1_MOSI = 121, 137 + MX8MP_IOMUXC_ECSPI1_MISO = 122, 138 + MX8MP_IOMUXC_ECSPI1_SS0 = 123, 139 + MX8MP_IOMUXC_ECSPI2_SCLK = 124, 140 + MX8MP_IOMUXC_ECSPI2_MOSI = 125, 141 + MX8MP_IOMUXC_ECSPI2_MISO = 126, 142 + MX8MP_IOMUXC_ECSPI2_SS0 = 127, 143 + MX8MP_IOMUXC_I2C1_SCL = 128, 144 + MX8MP_IOMUXC_I2C1_SDA = 129, 145 + MX8MP_IOMUXC_I2C2_SCL = 130, 146 + MX8MP_IOMUXC_I2C2_SDA = 131, 147 + MX8MP_IOMUXC_I2C3_SCL = 132, 148 + MX8MP_IOMUXC_I2C3_SDA = 133, 149 + MX8MP_IOMUXC_I2C4_SCL = 134, 150 + MX8MP_IOMUXC_I2C4_SDA = 135, 151 + MX8MP_IOMUXC_UART1_RXD = 136, 152 + MX8MP_IOMUXC_UART1_TXD = 137, 153 + MX8MP_IOMUXC_UART2_RXD = 138, 154 + MX8MP_IOMUXC_UART2_TXD = 139, 155 + MX8MP_IOMUXC_UART3_RXD = 140, 156 + MX8MP_IOMUXC_UART3_TXD = 141, 157 + MX8MP_IOMUXC_UART4_RXD = 142, 158 + MX8MP_IOMUXC_UART4_TXD = 143, 159 + MX8MP_IOMUXC_HDMI_DDC_SCL = 144, 160 + MX8MP_IOMUXC_HDMI_DDC_SDA = 145, 161 + MX8MP_IOMUXC_HDMI_CEC = 146, 162 + MX8MP_IOMUXC_HDMI_HPD = 147, 163 + }; 164 + 165 + /* Pad names for the pinmux subsystem */ 166 + static const struct pinctrl_pin_desc imx8mp_pinctrl_pads[] = { 167 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_RESERVE0), 168 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_RESERVE1), 169 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_RESERVE2), 170 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_RESERVE3), 171 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_RESERVE4), 172 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO00), 173 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO01), 174 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO02), 175 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO03), 176 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO04), 177 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO05), 178 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO06), 179 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO07), 180 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO08), 181 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO09), 182 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO10), 183 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO11), 184 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO12), 185 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO13), 186 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO14), 187 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_GPIO1_IO15), 188 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_MDC), 189 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_MDIO), 190 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_TD3), 191 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_TD2), 192 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_TD1), 193 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_TD0), 194 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_TX_CTL), 195 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_TXC), 196 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_RX_CTL), 197 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_RXC), 198 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_RD0), 199 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_RD1), 200 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_RD2), 201 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ENET_RD3), 202 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_CLK), 203 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_CMD), 204 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA0), 205 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA1), 206 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA2), 207 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA3), 208 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA4), 209 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA5), 210 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA6), 211 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_DATA7), 212 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_RESET_B), 213 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD1_STROBE), 214 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_CD_B), 215 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_CLK), 216 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_CMD), 217 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_DATA0), 218 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_DATA1), 219 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_DATA2), 220 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_DATA3), 221 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_RESET_B), 222 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SD2_WP), 223 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_ALE), 224 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_CE0_B), 225 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_CE1_B), 226 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_CE2_B), 227 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_CE3_B), 228 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_CLE), 229 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA00), 230 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA01), 231 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA02), 232 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA03), 233 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA04), 234 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA05), 235 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA06), 236 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DATA07), 237 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_DQS), 238 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_RE_B), 239 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_READY_B), 240 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_WE_B), 241 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_NAND_WP_B), 242 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_RXFS), 243 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_RXC), 244 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_RXD0), 245 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_RXD1), 246 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_RXD2), 247 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_RXD3), 248 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI5_MCLK), 249 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXFS), 250 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXC), 251 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD0), 252 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD1), 253 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD2), 254 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD3), 255 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD4), 256 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD5), 257 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD6), 258 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_RXD7), 259 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXFS), 260 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXC), 261 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD0), 262 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD1), 263 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD2), 264 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD3), 265 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD4), 266 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD5), 267 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD6), 268 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_TXD7), 269 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI1_MCLK), 270 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_RXFS), 271 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_RXC), 272 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_RXD0), 273 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_TXFS), 274 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_TXC), 275 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_TXD0), 276 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI2_MCLK), 277 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_RXFS), 278 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_RXC), 279 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_RXD), 280 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_TXFS), 281 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_TXC), 282 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_TXD), 283 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SAI3_MCLK), 284 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SPDIF_TX), 285 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SPDIF_RX), 286 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_SPDIF_EXT_CLK), 287 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI1_SCLK), 288 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI1_MOSI), 289 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI1_MISO), 290 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI1_SS0), 291 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI2_SCLK), 292 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI2_MOSI), 293 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI2_MISO), 294 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_ECSPI2_SS0), 295 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C1_SCL), 296 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C1_SDA), 297 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C2_SCL), 298 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C2_SDA), 299 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C3_SCL), 300 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C3_SDA), 301 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C4_SCL), 302 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_I2C4_SDA), 303 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART1_RXD), 304 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART1_TXD), 305 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART2_RXD), 306 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART2_TXD), 307 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART3_RXD), 308 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART3_TXD), 309 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART4_RXD), 310 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_UART4_TXD), 311 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_HDMI_DDC_SCL), 312 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_HDMI_DDC_SDA), 313 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_HDMI_CEC), 314 + IMX_PINCTRL_PIN(MX8MP_IOMUXC_HDMI_HPD), 315 + }; 316 + 317 + static const struct imx_pinctrl_soc_info imx8mp_pinctrl_info = { 318 + .pins = imx8mp_pinctrl_pads, 319 + .npins = ARRAY_SIZE(imx8mp_pinctrl_pads), 320 + .gpr_compatible = "fsl,imx8mp-iomuxc-gpr", 321 + }; 322 + 323 + static const struct of_device_id imx8mp_pinctrl_of_match[] = { 324 + { .compatible = "fsl,imx8mp-iomuxc", .data = &imx8mp_pinctrl_info, }, 325 + { /* sentinel */ } 326 + }; 327 + 328 + static int imx8mp_pinctrl_probe(struct platform_device *pdev) 329 + { 330 + return imx_pinctrl_probe(pdev, &imx8mp_pinctrl_info); 331 + } 332 + 333 + static struct platform_driver imx8mp_pinctrl_driver = { 334 + .driver = { 335 + .name = "imx8mp-pinctrl", 336 + .of_match_table = of_match_ptr(imx8mp_pinctrl_of_match), 337 + }, 338 + .probe = imx8mp_pinctrl_probe, 339 + }; 340 + 341 + static int __init imx8mp_pinctrl_init(void) 342 + { 343 + return platform_driver_register(&imx8mp_pinctrl_driver); 344 + } 345 + arch_initcall(imx8mp_pinctrl_init);
+13
drivers/pinctrl/intel/Kconfig
··· 31 31 Cherryview/Braswell pinctrl driver provides an interface that 32 32 allows configuring of SoC pins and using them as GPIOs. 33 33 34 + config PINCTRL_LYNXPOINT 35 + tristate "Intel Lynxpoint pinctrl and GPIO driver" 36 + depends on ACPI 37 + select PINMUX 38 + select PINCONF 39 + select GENERIC_PINCONF 40 + select GPIOLIB 41 + select GPIOLIB_IRQCHIP 42 + help 43 + Lynxpoint is the PCH of Intel Haswell. This pinctrl driver 44 + provides an interface that allows configuring of PCH pins and 45 + using them as GPIOs. 46 + 34 47 config PINCTRL_MERRIFIELD 35 48 tristate "Intel Merrifield pinctrl driver" 36 49 depends on X86_INTEL_MID
+1
drivers/pinctrl/intel/Makefile
··· 3 3 4 4 obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o 5 5 obj-$(CONFIG_PINCTRL_CHERRYVIEW) += pinctrl-cherryview.o 6 + obj-$(CONFIG_PINCTRL_LYNXPOINT) += pinctrl-lynxpoint.o 6 7 obj-$(CONFIG_PINCTRL_MERRIFIELD) += pinctrl-merrifield.o 7 8 obj-$(CONFIG_PINCTRL_INTEL) += pinctrl-intel.o 8 9 obj-$(CONFIG_PINCTRL_BROXTON) += pinctrl-broxton.o
+150 -161
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 93 93 #define BYT_DEFAULT_GPIO_MUX 0 94 94 #define BYT_ALTER_GPIO_MUX 1 95 95 96 - struct byt_gpio_pin_context { 96 + struct intel_pad_context { 97 97 u32 conf0; 98 98 u32 val; 99 99 }; ··· 104 104 .npins = (n), \ 105 105 .pad_map = (map),\ 106 106 } 107 - 108 - struct byt_gpio { 109 - struct gpio_chip chip; 110 - struct platform_device *pdev; 111 - struct pinctrl_dev *pctl_dev; 112 - struct pinctrl_desc pctl_desc; 113 - const struct intel_pinctrl_soc_data *soc_data; 114 - struct intel_community *communities_copy; 115 - struct byt_gpio_pin_context *saved_context; 116 - }; 117 107 118 108 /* SCORE pins, aka GPIOC_<pin_no> or GPIO_S0_SC[<pin_no>] */ 119 109 static const struct pinctrl_pin_desc byt_score_pins[] = { ··· 540 550 541 551 static DEFINE_RAW_SPINLOCK(byt_lock); 542 552 543 - static struct intel_community *byt_get_community(struct byt_gpio *vg, 553 + static struct intel_community *byt_get_community(struct intel_pinctrl *vg, 544 554 unsigned int pin) 545 555 { 546 556 struct intel_community *comm; 547 557 int i; 548 558 549 - for (i = 0; i < vg->soc_data->ncommunities; i++) { 550 - comm = vg->communities_copy + i; 559 + for (i = 0; i < vg->ncommunities; i++) { 560 + comm = vg->communities + i; 551 561 if (pin < comm->pin_base + comm->npins && pin >= comm->pin_base) 552 562 return comm; 553 563 } ··· 555 565 return NULL; 556 566 } 557 567 558 - static void __iomem *byt_gpio_reg(struct byt_gpio *vg, unsigned int offset, 568 + static void __iomem *byt_gpio_reg(struct intel_pinctrl *vg, unsigned int offset, 559 569 int reg) 560 570 { 561 571 struct intel_community *comm = byt_get_community(vg, offset); ··· 582 592 583 593 static int byt_get_groups_count(struct pinctrl_dev *pctldev) 584 594 { 585 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 595 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 586 596 587 - return vg->soc_data->ngroups; 597 + return vg->soc->ngroups; 588 598 } 589 599 590 600 static const char *byt_get_group_name(struct pinctrl_dev *pctldev, 591 601 unsigned int selector) 592 602 { 593 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 603 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 594 604 595 - return vg->soc_data->groups[selector].name; 605 + return vg->soc->groups[selector].name; 596 606 } 597 607 598 608 static int byt_get_group_pins(struct pinctrl_dev *pctldev, ··· 600 610 const unsigned int **pins, 601 611 unsigned int *num_pins) 602 612 { 603 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 613 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 604 614 605 - *pins = vg->soc_data->groups[selector].pins; 606 - *num_pins = vg->soc_data->groups[selector].npins; 615 + *pins = vg->soc->groups[selector].pins; 616 + *num_pins = vg->soc->groups[selector].npins; 607 617 608 618 return 0; 609 619 } ··· 616 626 617 627 static int byt_get_functions_count(struct pinctrl_dev *pctldev) 618 628 { 619 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 629 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 620 630 621 - return vg->soc_data->nfunctions; 631 + return vg->soc->nfunctions; 622 632 } 623 633 624 634 static const char *byt_get_function_name(struct pinctrl_dev *pctldev, 625 635 unsigned int selector) 626 636 { 627 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 637 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 628 638 629 - return vg->soc_data->functions[selector].name; 639 + return vg->soc->functions[selector].name; 630 640 } 631 641 632 642 static int byt_get_function_groups(struct pinctrl_dev *pctldev, ··· 634 644 const char * const **groups, 635 645 unsigned int *num_groups) 636 646 { 637 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 647 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 638 648 639 - *groups = vg->soc_data->functions[selector].groups; 640 - *num_groups = vg->soc_data->functions[selector].ngroups; 649 + *groups = vg->soc->functions[selector].groups; 650 + *num_groups = vg->soc->functions[selector].ngroups; 641 651 642 652 return 0; 643 653 } 644 654 645 - static void byt_set_group_simple_mux(struct byt_gpio *vg, 655 + static void byt_set_group_simple_mux(struct intel_pinctrl *vg, 646 656 const struct intel_pingroup group, 647 657 unsigned int func) 648 658 { ··· 657 667 658 668 padcfg0 = byt_gpio_reg(vg, group.pins[i], BYT_CONF0_REG); 659 669 if (!padcfg0) { 660 - dev_warn(&vg->pdev->dev, 670 + dev_warn(vg->dev, 661 671 "Group %s, pin %i not muxed (no padcfg0)\n", 662 672 group.name, i); 663 673 continue; ··· 672 682 raw_spin_unlock_irqrestore(&byt_lock, flags); 673 683 } 674 684 675 - static void byt_set_group_mixed_mux(struct byt_gpio *vg, 685 + static void byt_set_group_mixed_mux(struct intel_pinctrl *vg, 676 686 const struct intel_pingroup group, 677 687 const unsigned int *func) 678 688 { ··· 687 697 688 698 padcfg0 = byt_gpio_reg(vg, group.pins[i], BYT_CONF0_REG); 689 699 if (!padcfg0) { 690 - dev_warn(&vg->pdev->dev, 700 + dev_warn(vg->dev, 691 701 "Group %s, pin %i not muxed (no padcfg0)\n", 692 702 group.name, i); 693 703 continue; ··· 705 715 static int byt_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector, 706 716 unsigned int group_selector) 707 717 { 708 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctldev); 709 - const struct intel_function func = vg->soc_data->functions[func_selector]; 710 - const struct intel_pingroup group = vg->soc_data->groups[group_selector]; 718 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); 719 + const struct intel_function func = vg->soc->functions[func_selector]; 720 + const struct intel_pingroup group = vg->soc->groups[group_selector]; 711 721 712 722 if (group.modes) 713 723 byt_set_group_mixed_mux(vg, group, group.modes); ··· 719 729 return 0; 720 730 } 721 731 722 - static u32 byt_get_gpio_mux(struct byt_gpio *vg, unsigned int offset) 732 + static u32 byt_get_gpio_mux(struct intel_pinctrl *vg, unsigned int offset) 723 733 { 724 734 /* SCORE pin 92-93 */ 725 - if (!strcmp(vg->soc_data->uid, BYT_SCORE_ACPI_UID) && 735 + if (!strcmp(vg->soc->uid, BYT_SCORE_ACPI_UID) && 726 736 offset >= 92 && offset <= 93) 727 737 return BYT_ALTER_GPIO_MUX; 728 738 729 739 /* SUS pin 11-21 */ 730 - if (!strcmp(vg->soc_data->uid, BYT_SUS_ACPI_UID) && 740 + if (!strcmp(vg->soc->uid, BYT_SUS_ACPI_UID) && 731 741 offset >= 11 && offset <= 21) 732 742 return BYT_ALTER_GPIO_MUX; 733 743 734 744 return BYT_DEFAULT_GPIO_MUX; 735 745 } 736 746 737 - static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset) 747 + static void byt_gpio_clear_triggering(struct intel_pinctrl *vg, unsigned int offset) 738 748 { 739 749 void __iomem *reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); 740 750 unsigned long flags; ··· 742 752 743 753 raw_spin_lock_irqsave(&byt_lock, flags); 744 754 value = readl(reg); 745 - value &= ~(BYT_TRIG_POS | BYT_TRIG_NEG | BYT_TRIG_LVL); 755 + 756 + /* Do not clear direct-irq enabled IRQs (from gpio_disable_free) */ 757 + if (value & BYT_DIRECT_IRQ_EN) 758 + /* nothing to do */ ; 759 + else 760 + value &= ~(BYT_TRIG_POS | BYT_TRIG_NEG | BYT_TRIG_LVL); 761 + 746 762 writel(value, reg); 747 763 raw_spin_unlock_irqrestore(&byt_lock, flags); 748 764 } ··· 757 761 struct pinctrl_gpio_range *range, 758 762 unsigned int offset) 759 763 { 760 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctl_dev); 764 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev); 761 765 void __iomem *reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); 762 766 u32 value, gpio_mux; 763 767 unsigned long flags; ··· 780 784 value |= gpio_mux; 781 785 writel(value, reg); 782 786 783 - dev_warn(&vg->pdev->dev, FW_BUG 784 - "pin %u forcibly re-configured as GPIO\n", offset); 787 + dev_warn(vg->dev, FW_BUG "pin %u forcibly re-configured as GPIO\n", offset); 785 788 } 786 789 787 790 raw_spin_unlock_irqrestore(&byt_lock, flags); 788 791 789 - pm_runtime_get(&vg->pdev->dev); 792 + pm_runtime_get(vg->dev); 790 793 791 794 return 0; 792 795 } ··· 794 799 struct pinctrl_gpio_range *range, 795 800 unsigned int offset) 796 801 { 797 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctl_dev); 802 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev); 798 803 799 804 byt_gpio_clear_triggering(vg, offset); 800 - pm_runtime_put(&vg->pdev->dev); 805 + pm_runtime_put(vg->dev); 801 806 } 802 807 803 808 static int byt_gpio_set_direction(struct pinctrl_dev *pctl_dev, ··· 805 810 unsigned int offset, 806 811 bool input) 807 812 { 808 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctl_dev); 813 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev); 809 814 void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); 810 815 void __iomem *conf_reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); 811 816 unsigned long flags; ··· 817 822 value &= ~BYT_DIR_MASK; 818 823 if (input) 819 824 value |= BYT_OUTPUT_EN; 820 - else 825 + else if (readl(conf_reg) & BYT_DIRECT_IRQ_EN) 821 826 /* 822 827 * Before making any direction modifications, do a check if gpio 823 828 * is set for direct IRQ. On baytrail, setting GPIO to output 824 - * does not make sense, so let's at least warn the caller before 829 + * does not make sense, so let's at least inform the caller before 825 830 * they shoot themselves in the foot. 826 831 */ 827 - WARN(readl(conf_reg) & BYT_DIRECT_IRQ_EN, 828 - "Potential Error: Setting GPIO with direct_irq_en to output"); 832 + dev_info_once(vg->dev, "Potential Error: Setting GPIO with direct_irq_en to output"); 833 + 829 834 writel(value, val_reg); 830 835 831 836 raw_spin_unlock_irqrestore(&byt_lock, flags); ··· 888 893 static int byt_pin_config_get(struct pinctrl_dev *pctl_dev, unsigned int offset, 889 894 unsigned long *config) 890 895 { 891 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctl_dev); 896 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev); 892 897 enum pin_config_param param = pinconf_to_config_param(*config); 893 898 void __iomem *conf_reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); 894 899 void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); ··· 973 978 unsigned long *configs, 974 979 unsigned int num_configs) 975 980 { 976 - struct byt_gpio *vg = pinctrl_dev_get_drvdata(pctl_dev); 981 + struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev); 977 982 unsigned int param, arg; 978 983 void __iomem *conf_reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); 979 984 void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); ··· 1007 1012 if (val & BYT_INPUT_EN) { 1008 1013 val &= ~BYT_INPUT_EN; 1009 1014 writel(val, val_reg); 1010 - dev_warn(&vg->pdev->dev, 1015 + dev_warn(vg->dev, 1011 1016 "pin %u forcibly set to input mode\n", 1012 1017 offset); 1013 1018 } ··· 1029 1034 if (val & BYT_INPUT_EN) { 1030 1035 val &= ~BYT_INPUT_EN; 1031 1036 writel(val, val_reg); 1032 - dev_warn(&vg->pdev->dev, 1037 + dev_warn(vg->dev, 1033 1038 "pin %u forcibly set to input mode\n", 1034 1039 offset); 1035 1040 } ··· 1110 1115 1111 1116 static int byt_gpio_get(struct gpio_chip *chip, unsigned int offset) 1112 1117 { 1113 - struct byt_gpio *vg = gpiochip_get_data(chip); 1118 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1114 1119 void __iomem *reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); 1115 1120 unsigned long flags; 1116 1121 u32 val; ··· 1124 1129 1125 1130 static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) 1126 1131 { 1127 - struct byt_gpio *vg = gpiochip_get_data(chip); 1132 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1128 1133 void __iomem *reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); 1129 1134 unsigned long flags; 1130 1135 u32 old_val; ··· 1143 1148 1144 1149 static int byt_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) 1145 1150 { 1146 - struct byt_gpio *vg = gpiochip_get_data(chip); 1151 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1147 1152 void __iomem *reg = byt_gpio_reg(vg, offset, BYT_VAL_REG); 1148 1153 unsigned long flags; 1149 1154 u32 value; ··· 1156 1161 raw_spin_unlock_irqrestore(&byt_lock, flags); 1157 1162 1158 1163 if (!(value & BYT_OUTPUT_EN)) 1159 - return 0; 1164 + return GPIO_LINE_DIRECTION_OUT; 1160 1165 if (!(value & BYT_INPUT_EN)) 1161 - return 1; 1166 + return GPIO_LINE_DIRECTION_IN; 1162 1167 1163 1168 return -EINVAL; 1164 1169 } ··· 1183 1188 1184 1189 static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) 1185 1190 { 1186 - struct byt_gpio *vg = gpiochip_get_data(chip); 1191 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1187 1192 int i; 1188 1193 u32 conf0, val; 1189 1194 1190 - for (i = 0; i < vg->soc_data->npins; i++) { 1195 + for (i = 0; i < vg->soc->npins; i++) { 1191 1196 const struct intel_community *comm; 1192 1197 const char *pull_str = NULL; 1193 1198 const char *pull = NULL; ··· 1197 1202 unsigned int pin; 1198 1203 1199 1204 raw_spin_lock_irqsave(&byt_lock, flags); 1200 - pin = vg->soc_data->pins[i].number; 1205 + pin = vg->soc->pins[i].number; 1201 1206 reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); 1202 1207 if (!reg) { 1203 1208 seq_printf(s, ··· 1292 1297 static void byt_irq_ack(struct irq_data *d) 1293 1298 { 1294 1299 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 1295 - struct byt_gpio *vg = gpiochip_get_data(gc); 1300 + struct intel_pinctrl *vg = gpiochip_get_data(gc); 1296 1301 unsigned int offset = irqd_to_hwirq(d); 1297 1302 void __iomem *reg; 1298 1303 ··· 1308 1313 static void byt_irq_mask(struct irq_data *d) 1309 1314 { 1310 1315 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 1311 - struct byt_gpio *vg = gpiochip_get_data(gc); 1316 + struct intel_pinctrl *vg = gpiochip_get_data(gc); 1312 1317 1313 1318 byt_gpio_clear_triggering(vg, irqd_to_hwirq(d)); 1314 1319 } ··· 1316 1321 static void byt_irq_unmask(struct irq_data *d) 1317 1322 { 1318 1323 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 1319 - struct byt_gpio *vg = gpiochip_get_data(gc); 1324 + struct intel_pinctrl *vg = gpiochip_get_data(gc); 1320 1325 unsigned int offset = irqd_to_hwirq(d); 1321 1326 unsigned long flags; 1322 1327 void __iomem *reg; ··· 1354 1359 1355 1360 static int byt_irq_type(struct irq_data *d, unsigned int type) 1356 1361 { 1357 - struct byt_gpio *vg = gpiochip_get_data(irq_data_get_irq_chip_data(d)); 1362 + struct intel_pinctrl *vg = gpiochip_get_data(irq_data_get_irq_chip_data(d)); 1358 1363 u32 offset = irqd_to_hwirq(d); 1359 1364 u32 value; 1360 1365 unsigned long flags; ··· 1390 1395 return 0; 1391 1396 } 1392 1397 1393 - static struct irq_chip byt_irqchip = { 1394 - .name = "BYT-GPIO", 1395 - .irq_ack = byt_irq_ack, 1396 - .irq_mask = byt_irq_mask, 1397 - .irq_unmask = byt_irq_unmask, 1398 - .irq_set_type = byt_irq_type, 1399 - .flags = IRQCHIP_SKIP_SET_WAKE, 1400 - }; 1401 - 1402 1398 static void byt_gpio_irq_handler(struct irq_desc *desc) 1403 1399 { 1404 1400 struct irq_data *data = irq_desc_get_irq_data(desc); 1405 - struct byt_gpio *vg = gpiochip_get_data( 1406 - irq_desc_get_handler_data(desc)); 1401 + struct intel_pinctrl *vg = gpiochip_get_data(irq_desc_get_handler_data(desc)); 1407 1402 struct irq_chip *chip = irq_data_get_irq_chip(data); 1408 1403 u32 base, pin; 1409 1404 void __iomem *reg; ··· 1405 1420 reg = byt_gpio_reg(vg, base, BYT_INT_STAT_REG); 1406 1421 1407 1422 if (!reg) { 1408 - dev_warn(&vg->pdev->dev, 1423 + dev_warn(vg->dev, 1409 1424 "Pin %i: could not retrieve interrupt status register\n", 1410 1425 base); 1411 1426 continue; ··· 1426 1441 unsigned long *valid_mask, 1427 1442 unsigned int ngpios) 1428 1443 { 1429 - /* 1430 - * FIXME: currently the valid_mask is filled in as part of 1431 - * initializing the irq_chip below in byt_gpio_irq_init_hw(). 1432 - * when converting this driver to the new way of passing the 1433 - * gpio_irq_chip along when adding the gpio_chip, move the 1434 - * mask initialization into this callback instead. Right now 1435 - * this callback is here to make sure the mask gets allocated. 1436 - */ 1437 - } 1438 - 1439 - static int byt_gpio_irq_init_hw(struct gpio_chip *chip) 1440 - { 1441 - struct byt_gpio *vg = gpiochip_get_data(chip); 1442 - struct device *dev = &vg->pdev->dev; 1444 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1443 1445 void __iomem *reg; 1444 - u32 base, value; 1446 + u32 value; 1445 1447 int i; 1446 1448 1447 1449 /* ··· 1436 1464 * do not use direct IRQ mode. This will prevent spurious 1437 1465 * interrupts from misconfigured pins. 1438 1466 */ 1439 - for (i = 0; i < vg->soc_data->npins; i++) { 1440 - unsigned int pin = vg->soc_data->pins[i].number; 1467 + for (i = 0; i < vg->soc->npins; i++) { 1468 + unsigned int pin = vg->soc->pins[i].number; 1441 1469 1442 1470 reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); 1443 1471 if (!reg) { 1444 - dev_warn(&vg->pdev->dev, 1472 + dev_warn(vg->dev, 1445 1473 "Pin %i: could not retrieve conf0 register\n", 1446 1474 i); 1447 1475 continue; ··· 1449 1477 1450 1478 value = readl(reg); 1451 1479 if (value & BYT_DIRECT_IRQ_EN) { 1452 - clear_bit(i, chip->irq.valid_mask); 1453 - dev_dbg(dev, "excluding GPIO %d from IRQ domain\n", i); 1480 + clear_bit(i, valid_mask); 1481 + dev_dbg(vg->dev, "excluding GPIO %d from IRQ domain\n", i); 1454 1482 } else if ((value & BYT_PIN_MUX) == byt_get_gpio_mux(vg, i)) { 1455 1483 byt_gpio_clear_triggering(vg, i); 1456 - dev_dbg(dev, "disabling GPIO %d\n", i); 1484 + dev_dbg(vg->dev, "disabling GPIO %d\n", i); 1457 1485 } 1458 1486 } 1487 + } 1488 + 1489 + static int byt_gpio_irq_init_hw(struct gpio_chip *chip) 1490 + { 1491 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1492 + void __iomem *reg; 1493 + u32 base, value; 1459 1494 1460 1495 /* clear interrupt status trigger registers */ 1461 - for (base = 0; base < vg->soc_data->npins; base += 32) { 1496 + for (base = 0; base < vg->soc->npins; base += 32) { 1462 1497 reg = byt_gpio_reg(vg, base, BYT_INT_STAT_REG); 1463 1498 1464 1499 if (!reg) { 1465 - dev_warn(&vg->pdev->dev, 1500 + dev_warn(vg->dev, 1466 1501 "Pin %i: could not retrieve irq status reg\n", 1467 1502 base); 1468 1503 continue; ··· 1480 1501 might be misconfigured in bios */ 1481 1502 value = readl(reg); 1482 1503 if (value) 1483 - dev_err(&vg->pdev->dev, 1504 + dev_err(vg->dev, 1484 1505 "GPIO interrupt error, pins misconfigured. INT_STAT%u: 0x%08x\n", 1485 1506 base / 32, value); 1486 1507 } ··· 1490 1511 1491 1512 static int byt_gpio_add_pin_ranges(struct gpio_chip *chip) 1492 1513 { 1493 - struct byt_gpio *vg = gpiochip_get_data(chip); 1494 - struct device *dev = &vg->pdev->dev; 1514 + struct intel_pinctrl *vg = gpiochip_get_data(chip); 1515 + struct device *dev = vg->dev; 1495 1516 int ret; 1496 1517 1497 - ret = gpiochip_add_pin_range(chip, dev_name(dev), 0, 0, vg->soc_data->npins); 1518 + ret = gpiochip_add_pin_range(chip, dev_name(dev), 0, 0, vg->soc->npins); 1498 1519 if (ret) 1499 1520 dev_err(dev, "failed to add GPIO pin range\n"); 1500 1521 1501 1522 return ret; 1502 1523 } 1503 1524 1504 - static int byt_gpio_probe(struct byt_gpio *vg) 1525 + static int byt_gpio_probe(struct intel_pinctrl *vg) 1505 1526 { 1527 + struct platform_device *pdev = to_platform_device(vg->dev); 1506 1528 struct gpio_chip *gc; 1507 1529 struct resource *irq_rc; 1508 1530 int ret; ··· 1511 1531 /* Set up gpio chip */ 1512 1532 vg->chip = byt_gpio_chip; 1513 1533 gc = &vg->chip; 1514 - gc->label = dev_name(&vg->pdev->dev); 1534 + gc->label = dev_name(vg->dev); 1515 1535 gc->base = -1; 1516 1536 gc->can_sleep = false; 1517 1537 gc->add_pin_ranges = byt_gpio_add_pin_ranges; 1518 - gc->parent = &vg->pdev->dev; 1519 - gc->ngpio = vg->soc_data->npins; 1520 - gc->irq.init_valid_mask = byt_init_irq_valid_mask; 1538 + gc->parent = vg->dev; 1539 + gc->ngpio = vg->soc->npins; 1521 1540 1522 1541 #ifdef CONFIG_PM_SLEEP 1523 - vg->saved_context = devm_kcalloc(&vg->pdev->dev, gc->ngpio, 1524 - sizeof(*vg->saved_context), GFP_KERNEL); 1525 - if (!vg->saved_context) 1542 + vg->context.pads = devm_kcalloc(vg->dev, gc->ngpio, sizeof(*vg->context.pads), 1543 + GFP_KERNEL); 1544 + if (!vg->context.pads) 1526 1545 return -ENOMEM; 1527 1546 #endif 1528 1547 1529 1548 /* set up interrupts */ 1530 - irq_rc = platform_get_resource(vg->pdev, IORESOURCE_IRQ, 0); 1549 + irq_rc = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1531 1550 if (irq_rc && irq_rc->start) { 1532 1551 struct gpio_irq_chip *girq; 1533 1552 1553 + vg->irqchip.name = "BYT-GPIO", 1554 + vg->irqchip.irq_ack = byt_irq_ack, 1555 + vg->irqchip.irq_mask = byt_irq_mask, 1556 + vg->irqchip.irq_unmask = byt_irq_unmask, 1557 + vg->irqchip.irq_set_type = byt_irq_type, 1558 + vg->irqchip.flags = IRQCHIP_SKIP_SET_WAKE, 1559 + 1534 1560 girq = &gc->irq; 1535 - girq->chip = &byt_irqchip; 1561 + girq->chip = &vg->irqchip; 1536 1562 girq->init_hw = byt_gpio_irq_init_hw; 1563 + girq->init_valid_mask = byt_init_irq_valid_mask; 1537 1564 girq->parent_handler = byt_gpio_irq_handler; 1538 1565 girq->num_parents = 1; 1539 - girq->parents = devm_kcalloc(&vg->pdev->dev, girq->num_parents, 1566 + girq->parents = devm_kcalloc(vg->dev, girq->num_parents, 1540 1567 sizeof(*girq->parents), GFP_KERNEL); 1541 1568 if (!girq->parents) 1542 1569 return -ENOMEM; ··· 1552 1565 girq->handler = handle_bad_irq; 1553 1566 } 1554 1567 1555 - ret = devm_gpiochip_add_data(&vg->pdev->dev, gc, vg); 1568 + ret = devm_gpiochip_add_data(vg->dev, gc, vg); 1556 1569 if (ret) { 1557 - dev_err(&vg->pdev->dev, "failed adding byt-gpio chip\n"); 1570 + dev_err(vg->dev, "failed adding byt-gpio chip\n"); 1558 1571 return ret; 1559 1572 } 1560 1573 1561 1574 return ret; 1562 1575 } 1563 1576 1564 - static int byt_set_soc_data(struct byt_gpio *vg, 1565 - const struct intel_pinctrl_soc_data *soc_data) 1577 + static int byt_set_soc_data(struct intel_pinctrl *vg, 1578 + const struct intel_pinctrl_soc_data *soc) 1566 1579 { 1580 + struct platform_device *pdev = to_platform_device(vg->dev); 1567 1581 int i; 1568 1582 1569 - vg->soc_data = soc_data; 1570 - vg->communities_copy = devm_kcalloc(&vg->pdev->dev, 1571 - soc_data->ncommunities, 1572 - sizeof(*vg->communities_copy), 1573 - GFP_KERNEL); 1574 - if (!vg->communities_copy) 1583 + vg->soc = soc; 1584 + 1585 + vg->ncommunities = vg->soc->ncommunities; 1586 + vg->communities = devm_kcalloc(vg->dev, vg->ncommunities, 1587 + sizeof(*vg->communities), GFP_KERNEL); 1588 + if (!vg->communities) 1575 1589 return -ENOMEM; 1576 1590 1577 - for (i = 0; i < soc_data->ncommunities; i++) { 1578 - struct intel_community *comm = vg->communities_copy + i; 1591 + for (i = 0; i < vg->soc->ncommunities; i++) { 1592 + struct intel_community *comm = vg->communities + i; 1579 1593 1580 - *comm = vg->soc_data->communities[i]; 1594 + *comm = vg->soc->communities[i]; 1581 1595 1582 - comm->pad_regs = devm_platform_ioremap_resource(vg->pdev, 0); 1596 + comm->pad_regs = devm_platform_ioremap_resource(pdev, 0); 1583 1597 if (IS_ERR(comm->pad_regs)) 1584 1598 return PTR_ERR(comm->pad_regs); 1585 1599 } ··· 1598 1610 { 1599 1611 const struct intel_pinctrl_soc_data *soc_data = NULL; 1600 1612 const struct intel_pinctrl_soc_data **soc_table; 1613 + struct device *dev = &pdev->dev; 1601 1614 struct acpi_device *acpi_dev; 1602 - struct byt_gpio *vg; 1615 + struct intel_pinctrl *vg; 1603 1616 int i, ret; 1604 1617 1605 - acpi_dev = ACPI_COMPANION(&pdev->dev); 1618 + acpi_dev = ACPI_COMPANION(dev); 1606 1619 if (!acpi_dev) 1607 1620 return -ENODEV; 1608 1621 1609 - soc_table = (const struct intel_pinctrl_soc_data **)device_get_match_data(&pdev->dev); 1622 + soc_table = (const struct intel_pinctrl_soc_data **)device_get_match_data(dev); 1610 1623 1611 1624 for (i = 0; soc_table[i]; i++) { 1612 1625 if (!strcmp(acpi_dev->pnp.unique_id, soc_table[i]->uid)) { ··· 1619 1630 if (!soc_data) 1620 1631 return -ENODEV; 1621 1632 1622 - vg = devm_kzalloc(&pdev->dev, sizeof(*vg), GFP_KERNEL); 1633 + vg = devm_kzalloc(dev, sizeof(*vg), GFP_KERNEL); 1623 1634 if (!vg) 1624 1635 return -ENOMEM; 1625 1636 1626 - vg->pdev = pdev; 1637 + vg->dev = dev; 1627 1638 ret = byt_set_soc_data(vg, soc_data); 1628 1639 if (ret) { 1629 - dev_err(&pdev->dev, "failed to set soc data\n"); 1640 + dev_err(dev, "failed to set soc data\n"); 1630 1641 return ret; 1631 1642 } 1632 1643 1633 - vg->pctl_desc = byt_pinctrl_desc; 1634 - vg->pctl_desc.name = dev_name(&pdev->dev); 1635 - vg->pctl_desc.pins = vg->soc_data->pins; 1636 - vg->pctl_desc.npins = vg->soc_data->npins; 1644 + vg->pctldesc = byt_pinctrl_desc; 1645 + vg->pctldesc.name = dev_name(dev); 1646 + vg->pctldesc.pins = vg->soc->pins; 1647 + vg->pctldesc.npins = vg->soc->npins; 1637 1648 1638 - vg->pctl_dev = devm_pinctrl_register(&pdev->dev, &vg->pctl_desc, vg); 1639 - if (IS_ERR(vg->pctl_dev)) { 1640 - dev_err(&pdev->dev, "failed to register pinctrl driver\n"); 1641 - return PTR_ERR(vg->pctl_dev); 1649 + vg->pctldev = devm_pinctrl_register(dev, &vg->pctldesc, vg); 1650 + if (IS_ERR(vg->pctldev)) { 1651 + dev_err(dev, "failed to register pinctrl driver\n"); 1652 + return PTR_ERR(vg->pctldev); 1642 1653 } 1643 1654 1644 1655 ret = byt_gpio_probe(vg); ··· 1646 1657 return ret; 1647 1658 1648 1659 platform_set_drvdata(pdev, vg); 1649 - pm_runtime_enable(&pdev->dev); 1660 + pm_runtime_enable(dev); 1650 1661 1651 1662 return 0; 1652 1663 } ··· 1654 1665 #ifdef CONFIG_PM_SLEEP 1655 1666 static int byt_gpio_suspend(struct device *dev) 1656 1667 { 1657 - struct byt_gpio *vg = dev_get_drvdata(dev); 1668 + struct intel_pinctrl *vg = dev_get_drvdata(dev); 1658 1669 unsigned long flags; 1659 1670 int i; 1660 1671 1661 1672 raw_spin_lock_irqsave(&byt_lock, flags); 1662 1673 1663 - for (i = 0; i < vg->soc_data->npins; i++) { 1674 + for (i = 0; i < vg->soc->npins; i++) { 1664 1675 void __iomem *reg; 1665 1676 u32 value; 1666 - unsigned int pin = vg->soc_data->pins[i].number; 1677 + unsigned int pin = vg->soc->pins[i].number; 1667 1678 1668 1679 reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); 1669 1680 if (!reg) { 1670 - dev_warn(&vg->pdev->dev, 1681 + dev_warn(vg->dev, 1671 1682 "Pin %i: could not retrieve conf0 register\n", 1672 1683 i); 1673 1684 continue; 1674 1685 } 1675 1686 value = readl(reg) & BYT_CONF0_RESTORE_MASK; 1676 - vg->saved_context[i].conf0 = value; 1687 + vg->context.pads[i].conf0 = value; 1677 1688 1678 1689 reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); 1679 1690 value = readl(reg) & BYT_VAL_RESTORE_MASK; 1680 - vg->saved_context[i].val = value; 1691 + vg->context.pads[i].val = value; 1681 1692 } 1682 1693 1683 1694 raw_spin_unlock_irqrestore(&byt_lock, flags); ··· 1686 1697 1687 1698 static int byt_gpio_resume(struct device *dev) 1688 1699 { 1689 - struct byt_gpio *vg = dev_get_drvdata(dev); 1700 + struct intel_pinctrl *vg = dev_get_drvdata(dev); 1690 1701 unsigned long flags; 1691 1702 int i; 1692 1703 1693 1704 raw_spin_lock_irqsave(&byt_lock, flags); 1694 1705 1695 - for (i = 0; i < vg->soc_data->npins; i++) { 1706 + for (i = 0; i < vg->soc->npins; i++) { 1696 1707 void __iomem *reg; 1697 1708 u32 value; 1698 - unsigned int pin = vg->soc_data->pins[i].number; 1709 + unsigned int pin = vg->soc->pins[i].number; 1699 1710 1700 1711 reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); 1701 1712 if (!reg) { 1702 - dev_warn(&vg->pdev->dev, 1713 + dev_warn(vg->dev, 1703 1714 "Pin %i: could not retrieve conf0 register\n", 1704 1715 i); 1705 1716 continue; 1706 1717 } 1707 1718 value = readl(reg); 1708 1719 if ((value & BYT_CONF0_RESTORE_MASK) != 1709 - vg->saved_context[i].conf0) { 1720 + vg->context.pads[i].conf0) { 1710 1721 value &= ~BYT_CONF0_RESTORE_MASK; 1711 - value |= vg->saved_context[i].conf0; 1722 + value |= vg->context.pads[i].conf0; 1712 1723 writel(value, reg); 1713 1724 dev_info(dev, "restored pin %d conf0 %#08x", i, value); 1714 1725 } ··· 1716 1727 reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); 1717 1728 value = readl(reg); 1718 1729 if ((value & BYT_VAL_RESTORE_MASK) != 1719 - vg->saved_context[i].val) { 1730 + vg->context.pads[i].val) { 1720 1731 u32 v; 1721 1732 1722 1733 v = value & ~BYT_VAL_RESTORE_MASK; 1723 - v |= vg->saved_context[i].val; 1734 + v |= vg->context.pads[i].val; 1724 1735 if (v != value) { 1725 1736 writel(v, reg); 1726 1737 dev_dbg(dev, "restored pin %d val %#08x\n",
+4 -1
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 1289 1289 direction = ctrl0 & CHV_PADCTRL0_GPIOCFG_MASK; 1290 1290 direction >>= CHV_PADCTRL0_GPIOCFG_SHIFT; 1291 1291 1292 - return direction != CHV_PADCTRL0_GPIOCFG_GPO; 1292 + if (direction == CHV_PADCTRL0_GPIOCFG_GPO) 1293 + return GPIO_LINE_DIRECTION_OUT; 1294 + 1295 + return GPIO_LINE_DIRECTION_IN; 1293 1296 } 1294 1297 1295 1298 static int chv_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
+40 -61
drivers/pinctrl/intel/pinctrl-intel.c
··· 8 8 */ 9 9 10 10 #include <linux/acpi.h> 11 - #include <linux/interrupt.h> 12 11 #include <linux/gpio/driver.h> 12 + #include <linux/interrupt.h> 13 13 #include <linux/log2.h> 14 14 #include <linux/module.h> 15 15 #include <linux/platform_device.h> ··· 83 83 struct intel_community_context { 84 84 u32 *intmask; 85 85 u32 *hostown; 86 - }; 87 - 88 - struct intel_pinctrl_context { 89 - struct intel_pad_context *pads; 90 - struct intel_community_context *communities; 91 - }; 92 - 93 - /** 94 - * struct intel_pinctrl - Intel pinctrl private structure 95 - * @dev: Pointer to the device structure 96 - * @lock: Lock to serialize register access 97 - * @pctldesc: Pin controller description 98 - * @pctldev: Pointer to the pin controller device 99 - * @chip: GPIO chip in this pin controller 100 - * @irqchip: IRQ chip in this pin controller 101 - * @soc: SoC/PCH specific pin configuration data 102 - * @communities: All communities in this pin controller 103 - * @ncommunities: Number of communities in this pin controller 104 - * @context: Configuration saved over system sleep 105 - * @irq: pinctrl/GPIO chip irq number 106 - */ 107 - struct intel_pinctrl { 108 - struct device *dev; 109 - raw_spinlock_t lock; 110 - struct pinctrl_desc pctldesc; 111 - struct pinctrl_dev *pctldev; 112 - struct gpio_chip chip; 113 - struct irq_chip irqchip; 114 - const struct intel_pinctrl_soc_data *soc; 115 - struct intel_community *communities; 116 - size_t ncommunities; 117 - struct intel_pinctrl_context context; 118 - int irq; 119 86 }; 120 87 121 88 #define pin_to_padno(c, p) ((p) - (c)->pin_base) ··· 911 944 if (padcfg0 & PADCFG0_PMODE_MASK) 912 945 return -EINVAL; 913 946 914 - return !!(padcfg0 & PADCFG0_GPIOTXDIS); 947 + if (padcfg0 & PADCFG0_GPIOTXDIS) 948 + return GPIO_LINE_DIRECTION_IN; 949 + 950 + return GPIO_LINE_DIRECTION_OUT; 915 951 } 916 952 917 953 static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) ··· 1130 1160 return ret; 1131 1161 } 1132 1162 1133 - static int intel_gpio_add_pin_ranges(struct intel_pinctrl *pctrl, 1134 - const struct intel_community *community) 1163 + static int intel_gpio_add_community_ranges(struct intel_pinctrl *pctrl, 1164 + const struct intel_community *community) 1135 1165 { 1136 1166 int ret = 0, i; 1137 1167 ··· 1149 1179 } 1150 1180 1151 1181 return ret; 1182 + } 1183 + 1184 + static int intel_gpio_add_pin_ranges(struct gpio_chip *gc) 1185 + { 1186 + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 1187 + int ret, i; 1188 + 1189 + for (i = 0; i < pctrl->ncommunities; i++) { 1190 + struct intel_community *community = &pctrl->communities[i]; 1191 + 1192 + ret = intel_gpio_add_community_ranges(pctrl, community); 1193 + if (ret) { 1194 + dev_err(pctrl->dev, "failed to add GPIO pin range\n"); 1195 + return ret; 1196 + } 1197 + } 1198 + 1199 + return 0; 1152 1200 } 1153 1201 1154 1202 static unsigned int intel_gpio_ngpio(const struct intel_pinctrl *pctrl) ··· 1193 1205 1194 1206 static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) 1195 1207 { 1196 - int ret, i; 1208 + int ret; 1209 + struct gpio_irq_chip *girq; 1197 1210 1198 1211 pctrl->chip = intel_gpio_chip; 1199 1212 ··· 1203 1214 pctrl->chip.label = dev_name(pctrl->dev); 1204 1215 pctrl->chip.parent = pctrl->dev; 1205 1216 pctrl->chip.base = -1; 1217 + pctrl->chip.add_pin_ranges = intel_gpio_add_pin_ranges; 1206 1218 pctrl->irq = irq; 1207 1219 1208 1220 /* Setup IRQ chip */ ··· 1215 1225 pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake; 1216 1226 pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND; 1217 1227 1218 - ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl); 1219 - if (ret) { 1220 - dev_err(pctrl->dev, "failed to register gpiochip\n"); 1221 - return ret; 1222 - } 1223 - 1224 - for (i = 0; i < pctrl->ncommunities; i++) { 1225 - struct intel_community *community = &pctrl->communities[i]; 1226 - 1227 - ret = intel_gpio_add_pin_ranges(pctrl, community); 1228 - if (ret) { 1229 - dev_err(pctrl->dev, "failed to add GPIO pin range\n"); 1230 - return ret; 1231 - } 1232 - } 1233 - 1234 1228 /* 1235 - * We need to request the interrupt here (instead of providing chip 1236 - * to the irq directly) because on some platforms several GPIO 1237 - * controllers share the same interrupt line. 1229 + * On some platforms several GPIO controllers share the same interrupt 1230 + * line. 1238 1231 */ 1239 1232 ret = devm_request_irq(pctrl->dev, irq, intel_gpio_irq, 1240 1233 IRQF_SHARED | IRQF_NO_THREAD, ··· 1227 1254 return ret; 1228 1255 } 1229 1256 1230 - ret = gpiochip_irqchip_add(&pctrl->chip, &pctrl->irqchip, 0, 1231 - handle_bad_irq, IRQ_TYPE_NONE); 1257 + girq = &pctrl->chip.irq; 1258 + girq->chip = &pctrl->irqchip; 1259 + /* This will let us handle the IRQ in the driver */ 1260 + girq->parent_handler = NULL; 1261 + girq->num_parents = 0; 1262 + girq->default_type = IRQ_TYPE_NONE; 1263 + girq->handler = handle_bad_irq; 1264 + 1265 + ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl); 1232 1266 if (ret) { 1233 - dev_err(pctrl->dev, "failed to add irqchip\n"); 1267 + dev_err(pctrl->dev, "failed to register gpiochip\n"); 1234 1268 return ret; 1235 1269 } 1236 1270 1237 - gpiochip_set_chained_irqchip(&pctrl->chip, &pctrl->irqchip, irq, NULL); 1238 1271 return 0; 1239 1272 } 1240 1273
+44
drivers/pinctrl/intel/pinctrl-intel.h
··· 10 10 #ifndef PINCTRL_INTEL_H 11 11 #define PINCTRL_INTEL_H 12 12 13 + #include <linux/gpio/driver.h> 14 + #include <linux/irq.h> 13 15 #include <linux/pm.h> 16 + #include <linux/spinlock_types.h> 14 17 15 18 struct pinctrl_pin_desc; 16 19 struct platform_device; ··· 175 172 size_t nfunctions; 176 173 const struct intel_community *communities; 177 174 size_t ncommunities; 175 + }; 176 + 177 + struct intel_pad_context; 178 + struct intel_community_context; 179 + 180 + /** 181 + * struct intel_pinctrl_context - context to be saved during suspend-resume 182 + * @pads: Opaque context per pad (driver dependent) 183 + * @communities: Opaque context per community (driver dependent) 184 + */ 185 + struct intel_pinctrl_context { 186 + struct intel_pad_context *pads; 187 + struct intel_community_context *communities; 188 + }; 189 + 190 + /** 191 + * struct intel_pinctrl - Intel pinctrl private structure 192 + * @dev: Pointer to the device structure 193 + * @lock: Lock to serialize register access 194 + * @pctldesc: Pin controller description 195 + * @pctldev: Pointer to the pin controller device 196 + * @chip: GPIO chip in this pin controller 197 + * @irqchip: IRQ chip in this pin controller 198 + * @soc: SoC/PCH specific pin configuration data 199 + * @communities: All communities in this pin controller 200 + * @ncommunities: Number of communities in this pin controller 201 + * @context: Configuration saved over system sleep 202 + * @irq: pinctrl/GPIO chip irq number 203 + */ 204 + struct intel_pinctrl { 205 + struct device *dev; 206 + raw_spinlock_t lock; 207 + struct pinctrl_desc pctldesc; 208 + struct pinctrl_dev *pctldev; 209 + struct gpio_chip chip; 210 + struct irq_chip irqchip; 211 + const struct intel_pinctrl_soc_data *soc; 212 + struct intel_community *communities; 213 + size_t ncommunities; 214 + struct intel_pinctrl_context context; 215 + int irq; 178 216 }; 179 217 180 218 int intel_pinctrl_probe_by_hid(struct platform_device *pdev);
+975
drivers/pinctrl/intel/pinctrl-lynxpoint.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Intel Lynxpoint PCH pinctrl/GPIO driver 4 + * 5 + * Copyright (c) 2012, 2019, Intel Corporation 6 + * Authors: Mathias Nyman <mathias.nyman@linux.intel.com> 7 + * Andy Shevchenko <andriy.shevchenko@linux.intel.com> 8 + */ 9 + 10 + #include <linux/acpi.h> 11 + #include <linux/bitops.h> 12 + #include <linux/gpio/driver.h> 13 + #include <linux/interrupt.h> 14 + #include <linux/io.h> 15 + #include <linux/kernel.h> 16 + #include <linux/module.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/pm_runtime.h> 19 + #include <linux/slab.h> 20 + #include <linux/types.h> 21 + 22 + #include <linux/pinctrl/pinctrl.h> 23 + #include <linux/pinctrl/pinmux.h> 24 + #include <linux/pinctrl/pinconf.h> 25 + #include <linux/pinctrl/pinconf-generic.h> 26 + 27 + #include "pinctrl-intel.h" 28 + 29 + #define COMMUNITY(p, n) \ 30 + { \ 31 + .pin_base = (p), \ 32 + .npins = (n), \ 33 + } 34 + 35 + static const struct pinctrl_pin_desc lptlp_pins[] = { 36 + PINCTRL_PIN(0, "GP0_UART1_RXD"), 37 + PINCTRL_PIN(1, "GP1_UART1_TXD"), 38 + PINCTRL_PIN(2, "GP2_UART1_RTSB"), 39 + PINCTRL_PIN(3, "GP3_UART1_CTSB"), 40 + PINCTRL_PIN(4, "GP4_I2C0_SDA"), 41 + PINCTRL_PIN(5, "GP5_I2C0_SCL"), 42 + PINCTRL_PIN(6, "GP6_I2C1_SDA"), 43 + PINCTRL_PIN(7, "GP7_I2C1_SCL"), 44 + PINCTRL_PIN(8, "GP8"), 45 + PINCTRL_PIN(9, "GP9"), 46 + PINCTRL_PIN(10, "GP10"), 47 + PINCTRL_PIN(11, "GP11_SMBALERTB"), 48 + PINCTRL_PIN(12, "GP12_LANPHYPC"), 49 + PINCTRL_PIN(13, "GP13"), 50 + PINCTRL_PIN(14, "GP14"), 51 + PINCTRL_PIN(15, "GP15"), 52 + PINCTRL_PIN(16, "GP16_MGPIO9"), 53 + PINCTRL_PIN(17, "GP17_MGPIO10"), 54 + PINCTRL_PIN(18, "GP18_SRC0CLKRQB"), 55 + PINCTRL_PIN(19, "GP19_SRC1CLKRQB"), 56 + PINCTRL_PIN(20, "GP20_SRC2CLKRQB"), 57 + PINCTRL_PIN(21, "GP21_SRC3CLKRQB"), 58 + PINCTRL_PIN(22, "GP22_SRC4CLKRQB_TRST2"), 59 + PINCTRL_PIN(23, "GP23_SRC5CLKRQB_TDI2"), 60 + PINCTRL_PIN(24, "GP24_MGPIO0"), 61 + PINCTRL_PIN(25, "GP25_USBWAKEOUTB"), 62 + PINCTRL_PIN(26, "GP26_MGPIO5"), 63 + PINCTRL_PIN(27, "GP27_MGPIO6"), 64 + PINCTRL_PIN(28, "GP28_MGPIO7"), 65 + PINCTRL_PIN(29, "GP29_SLP_WLANB_MGPIO3"), 66 + PINCTRL_PIN(30, "GP30_SUSWARNB_SUSPWRDNACK_MGPIO1"), 67 + PINCTRL_PIN(31, "GP31_ACPRESENT_MGPIO2"), 68 + PINCTRL_PIN(32, "GP32_CLKRUNB"), 69 + PINCTRL_PIN(33, "GP33_DEVSLP0"), 70 + PINCTRL_PIN(34, "GP34_SATA0XPCIE6L3B_SATA0GP"), 71 + PINCTRL_PIN(35, "GP35_SATA1XPCIE6L2B_SATA1GP"), 72 + PINCTRL_PIN(36, "GP36_SATA2XPCIE6L1B_SATA2GP"), 73 + PINCTRL_PIN(37, "GP37_SATA3XPCIE6L0B_SATA3GP"), 74 + PINCTRL_PIN(38, "GP38_DEVSLP1"), 75 + PINCTRL_PIN(39, "GP39_DEVSLP2"), 76 + PINCTRL_PIN(40, "GP40_OC0B"), 77 + PINCTRL_PIN(41, "GP41_OC1B"), 78 + PINCTRL_PIN(42, "GP42_OC2B"), 79 + PINCTRL_PIN(43, "GP43_OC3B"), 80 + PINCTRL_PIN(44, "GP44"), 81 + PINCTRL_PIN(45, "GP45_TMS2"), 82 + PINCTRL_PIN(46, "GP46_TDO2"), 83 + PINCTRL_PIN(47, "GP47"), 84 + PINCTRL_PIN(48, "GP48"), 85 + PINCTRL_PIN(49, "GP49"), 86 + PINCTRL_PIN(50, "GP50"), 87 + PINCTRL_PIN(51, "GP51_GSXDOUT"), 88 + PINCTRL_PIN(52, "GP52_GSXSLOAD"), 89 + PINCTRL_PIN(53, "GP53_GSXDIN"), 90 + PINCTRL_PIN(54, "GP54_GSXSRESETB"), 91 + PINCTRL_PIN(55, "GP55_GSXCLK"), 92 + PINCTRL_PIN(56, "GP56"), 93 + PINCTRL_PIN(57, "GP57"), 94 + PINCTRL_PIN(58, "GP58"), 95 + PINCTRL_PIN(59, "GP59"), 96 + PINCTRL_PIN(60, "GP60_SML0ALERTB_MGPIO4"), 97 + PINCTRL_PIN(61, "GP61_SUS_STATB"), 98 + PINCTRL_PIN(62, "GP62_SUSCLK"), 99 + PINCTRL_PIN(63, "GP63_SLP_S5B"), 100 + PINCTRL_PIN(64, "GP64_SDIO_CLK"), 101 + PINCTRL_PIN(65, "GP65_SDIO_CMD"), 102 + PINCTRL_PIN(66, "GP66_SDIO_D0"), 103 + PINCTRL_PIN(67, "GP67_SDIO_D1"), 104 + PINCTRL_PIN(68, "GP68_SDIO_D2"), 105 + PINCTRL_PIN(69, "GP69_SDIO_D3"), 106 + PINCTRL_PIN(70, "GP70_SDIO_POWER_EN"), 107 + PINCTRL_PIN(71, "GP71_MPHYPC"), 108 + PINCTRL_PIN(72, "GP72_BATLOWB"), 109 + PINCTRL_PIN(73, "GP73_SML1ALERTB_PCHHOTB_MGPIO8"), 110 + PINCTRL_PIN(74, "GP74_SML1DATA_MGPIO12"), 111 + PINCTRL_PIN(75, "GP75_SML1CLK_MGPIO11"), 112 + PINCTRL_PIN(76, "GP76_BMBUSYB"), 113 + PINCTRL_PIN(77, "GP77_PIRQAB"), 114 + PINCTRL_PIN(78, "GP78_PIRQBB"), 115 + PINCTRL_PIN(79, "GP79_PIRQCB"), 116 + PINCTRL_PIN(80, "GP80_PIRQDB"), 117 + PINCTRL_PIN(81, "GP81_SPKR"), 118 + PINCTRL_PIN(82, "GP82_RCINB"), 119 + PINCTRL_PIN(83, "GP83_GSPI0_CSB"), 120 + PINCTRL_PIN(84, "GP84_GSPI0_CLK"), 121 + PINCTRL_PIN(85, "GP85_GSPI0_MISO"), 122 + PINCTRL_PIN(86, "GP86_GSPI0_MOSI"), 123 + PINCTRL_PIN(87, "GP87_GSPI1_CSB"), 124 + PINCTRL_PIN(88, "GP88_GSPI1_CLK"), 125 + PINCTRL_PIN(89, "GP89_GSPI1_MISO"), 126 + PINCTRL_PIN(90, "GP90_GSPI1_MOSI"), 127 + PINCTRL_PIN(91, "GP91_UART0_RXD"), 128 + PINCTRL_PIN(92, "GP92_UART0_TXD"), 129 + PINCTRL_PIN(93, "GP93_UART0_RTSB"), 130 + PINCTRL_PIN(94, "GP94_UART0_CTSB"), 131 + }; 132 + 133 + static const struct intel_community lptlp_communities[] = { 134 + COMMUNITY(0, 95), 135 + }; 136 + 137 + static const struct intel_pinctrl_soc_data lptlp_soc_data = { 138 + .pins = lptlp_pins, 139 + .npins = ARRAY_SIZE(lptlp_pins), 140 + .communities = lptlp_communities, 141 + .ncommunities = ARRAY_SIZE(lptlp_communities), 142 + }; 143 + 144 + /* LynxPoint chipset has support for 95 GPIO pins */ 145 + 146 + #define LP_NUM_GPIO 95 147 + 148 + /* Bitmapped register offsets */ 149 + #define LP_ACPI_OWNED 0x00 /* Bitmap, set by bios, 0: pin reserved for ACPI */ 150 + #define LP_IRQ2IOXAPIC 0x10 /* Bitmap, set by bios, 1: pin routed to IOxAPIC */ 151 + #define LP_GC 0x7C /* set APIC IRQ to IRQ14 or IRQ15 for all pins */ 152 + #define LP_INT_STAT 0x80 153 + #define LP_INT_ENABLE 0x90 154 + 155 + /* Each pin has two 32 bit config registers, starting at 0x100 */ 156 + #define LP_CONFIG1 0x100 157 + #define LP_CONFIG2 0x104 158 + 159 + /* LP_CONFIG1 reg bits */ 160 + #define OUT_LVL_BIT BIT(31) 161 + #define IN_LVL_BIT BIT(30) 162 + #define TRIG_SEL_BIT BIT(4) /* 0: Edge, 1: Level */ 163 + #define INT_INV_BIT BIT(3) /* Invert interrupt triggering */ 164 + #define DIR_BIT BIT(2) /* 0: Output, 1: Input */ 165 + #define USE_SEL_MASK GENMASK(1, 0) /* 0: Native, 1: GPIO, ... */ 166 + #define USE_SEL_NATIVE (0 << 0) 167 + #define USE_SEL_GPIO (1 << 0) 168 + 169 + /* LP_CONFIG2 reg bits */ 170 + #define GPINDIS_BIT BIT(2) /* disable input sensing */ 171 + #define GPIWP_MASK GENMASK(1, 0) /* weak pull options */ 172 + #define GPIWP_NONE 0 /* none */ 173 + #define GPIWP_DOWN 1 /* weak pull down */ 174 + #define GPIWP_UP 2 /* weak pull up */ 175 + 176 + /* 177 + * Lynxpoint gpios are controlled through both bitmapped registers and 178 + * per gpio specific registers. The bitmapped registers are in chunks of 179 + * 3 x 32bit registers to cover all 95 GPIOs 180 + * 181 + * per gpio specific registers consist of two 32bit registers per gpio 182 + * (LP_CONFIG1 and LP_CONFIG2), with 95 GPIOs there's a total of 183 + * 190 config registers. 184 + * 185 + * A simplified view of the register layout look like this: 186 + * 187 + * LP_ACPI_OWNED[31:0] gpio ownerships for gpios 0-31 (bitmapped registers) 188 + * LP_ACPI_OWNED[63:32] gpio ownerships for gpios 32-63 189 + * LP_ACPI_OWNED[94:64] gpio ownerships for gpios 63-94 190 + * ... 191 + * LP_INT_ENABLE[31:0] ... 192 + * LP_INT_ENABLE[63:32] ... 193 + * LP_INT_ENABLE[94:64] ... 194 + * LP0_CONFIG1 (gpio 0) config1 reg for gpio 0 (per gpio registers) 195 + * LP0_CONFIG2 (gpio 0) config2 reg for gpio 0 196 + * LP1_CONFIG1 (gpio 1) config1 reg for gpio 1 197 + * LP1_CONFIG2 (gpio 1) config2 reg for gpio 1 198 + * LP2_CONFIG1 (gpio 2) ... 199 + * LP2_CONFIG2 (gpio 2) ... 200 + * ... 201 + * LP94_CONFIG1 (gpio 94) ... 202 + * LP94_CONFIG2 (gpio 94) ... 203 + * 204 + * IOxAPIC redirection map applies only for gpio 8-10, 13-14, 45-55. 205 + */ 206 + 207 + static struct intel_community *lp_get_community(struct intel_pinctrl *lg, 208 + unsigned int pin) 209 + { 210 + struct intel_community *comm; 211 + int i; 212 + 213 + for (i = 0; i < lg->ncommunities; i++) { 214 + comm = &lg->communities[i]; 215 + if (pin < comm->pin_base + comm->npins && pin >= comm->pin_base) 216 + return comm; 217 + } 218 + 219 + return NULL; 220 + } 221 + 222 + static void __iomem *lp_gpio_reg(struct gpio_chip *chip, unsigned int offset, 223 + int reg) 224 + { 225 + struct intel_pinctrl *lg = gpiochip_get_data(chip); 226 + struct intel_community *comm; 227 + int reg_offset; 228 + 229 + comm = lp_get_community(lg, offset); 230 + if (!comm) 231 + return NULL; 232 + 233 + offset -= comm->pin_base; 234 + 235 + if (reg == LP_CONFIG1 || reg == LP_CONFIG2) 236 + /* per gpio specific config registers */ 237 + reg_offset = offset * 8; 238 + else 239 + /* bitmapped registers */ 240 + reg_offset = (offset / 32) * 4; 241 + 242 + return comm->regs + reg_offset + reg; 243 + } 244 + 245 + static bool lp_gpio_acpi_use(struct intel_pinctrl *lg, unsigned int pin) 246 + { 247 + void __iomem *acpi_use; 248 + 249 + acpi_use = lp_gpio_reg(&lg->chip, pin, LP_ACPI_OWNED); 250 + if (!acpi_use) 251 + return true; 252 + 253 + return !(ioread32(acpi_use) & BIT(pin % 32)); 254 + } 255 + 256 + static bool lp_gpio_ioxapic_use(struct gpio_chip *chip, unsigned int offset) 257 + { 258 + void __iomem *ioxapic_use = lp_gpio_reg(chip, offset, LP_IRQ2IOXAPIC); 259 + u32 value; 260 + 261 + value = ioread32(ioxapic_use); 262 + 263 + if (offset >= 8 && offset <= 10) 264 + return !!(value & BIT(offset - 8 + 0)); 265 + if (offset >= 13 && offset <= 14) 266 + return !!(value & BIT(offset - 13 + 3)); 267 + if (offset >= 45 && offset <= 55) 268 + return !!(value & BIT(offset - 45 + 5)); 269 + 270 + return false; 271 + } 272 + 273 + static int lp_get_groups_count(struct pinctrl_dev *pctldev) 274 + { 275 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 276 + 277 + return lg->soc->ngroups; 278 + } 279 + 280 + static const char *lp_get_group_name(struct pinctrl_dev *pctldev, 281 + unsigned int selector) 282 + { 283 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 284 + 285 + return lg->soc->groups[selector].name; 286 + } 287 + 288 + static int lp_get_group_pins(struct pinctrl_dev *pctldev, 289 + unsigned int selector, 290 + const unsigned int **pins, 291 + unsigned int *num_pins) 292 + { 293 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 294 + 295 + *pins = lg->soc->groups[selector].pins; 296 + *num_pins = lg->soc->groups[selector].npins; 297 + 298 + return 0; 299 + } 300 + 301 + static void lp_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, 302 + unsigned int pin) 303 + { 304 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 305 + void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); 306 + void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); 307 + u32 value, mode; 308 + 309 + value = ioread32(reg); 310 + 311 + mode = value & USE_SEL_MASK; 312 + if (mode == USE_SEL_GPIO) 313 + seq_puts(s, "GPIO "); 314 + else 315 + seq_printf(s, "mode %d ", mode); 316 + 317 + seq_printf(s, "0x%08x 0x%08x", value, ioread32(conf2)); 318 + 319 + if (lp_gpio_acpi_use(lg, pin)) 320 + seq_puts(s, " [ACPI]"); 321 + } 322 + 323 + static const struct pinctrl_ops lptlp_pinctrl_ops = { 324 + .get_groups_count = lp_get_groups_count, 325 + .get_group_name = lp_get_group_name, 326 + .get_group_pins = lp_get_group_pins, 327 + .pin_dbg_show = lp_pin_dbg_show, 328 + }; 329 + 330 + static int lp_get_functions_count(struct pinctrl_dev *pctldev) 331 + { 332 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 333 + 334 + return lg->soc->nfunctions; 335 + } 336 + 337 + static const char *lp_get_function_name(struct pinctrl_dev *pctldev, 338 + unsigned int selector) 339 + { 340 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 341 + 342 + return lg->soc->functions[selector].name; 343 + } 344 + 345 + static int lp_get_function_groups(struct pinctrl_dev *pctldev, 346 + unsigned int selector, 347 + const char * const **groups, 348 + unsigned int *num_groups) 349 + { 350 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 351 + 352 + *groups = lg->soc->functions[selector].groups; 353 + *num_groups = lg->soc->functions[selector].ngroups; 354 + 355 + return 0; 356 + } 357 + 358 + static int lp_pinmux_set_mux(struct pinctrl_dev *pctldev, 359 + unsigned int function, unsigned int group) 360 + { 361 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 362 + const struct intel_pingroup *grp = &lg->soc->groups[group]; 363 + unsigned long flags; 364 + int i; 365 + 366 + raw_spin_lock_irqsave(&lg->lock, flags); 367 + 368 + /* Now enable the mux setting for each pin in the group */ 369 + for (i = 0; i < grp->npins; i++) { 370 + void __iomem *reg = lp_gpio_reg(&lg->chip, grp->pins[i], LP_CONFIG1); 371 + u32 value; 372 + 373 + value = ioread32(reg); 374 + 375 + value &= ~USE_SEL_MASK; 376 + if (grp->modes) 377 + value |= grp->modes[i]; 378 + else 379 + value |= grp->mode; 380 + 381 + iowrite32(value, reg); 382 + } 383 + 384 + raw_spin_unlock_irqrestore(&lg->lock, flags); 385 + 386 + return 0; 387 + } 388 + 389 + static int lp_gpio_request_enable(struct pinctrl_dev *pctldev, 390 + struct pinctrl_gpio_range *range, 391 + unsigned int pin) 392 + { 393 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 394 + void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); 395 + void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); 396 + unsigned long flags; 397 + u32 value; 398 + 399 + pm_runtime_get(lg->dev); 400 + 401 + raw_spin_lock_irqsave(&lg->lock, flags); 402 + 403 + /* 404 + * Reconfigure pin to GPIO mode if needed and issue a warning, 405 + * since we expect firmware to configure it properly. 406 + */ 407 + value = ioread32(reg); 408 + if ((value & USE_SEL_MASK) != USE_SEL_GPIO) { 409 + iowrite32((value & USE_SEL_MASK) | USE_SEL_GPIO, reg); 410 + dev_warn(lg->dev, FW_BUG "pin %u forcibly reconfigured as GPIO\n", pin); 411 + } 412 + 413 + /* Enable input sensing */ 414 + iowrite32(ioread32(conf2) & ~GPINDIS_BIT, conf2); 415 + 416 + raw_spin_unlock_irqrestore(&lg->lock, flags); 417 + 418 + return 0; 419 + } 420 + 421 + static void lp_gpio_disable_free(struct pinctrl_dev *pctldev, 422 + struct pinctrl_gpio_range *range, 423 + unsigned int pin) 424 + { 425 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 426 + void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); 427 + unsigned long flags; 428 + 429 + raw_spin_lock_irqsave(&lg->lock, flags); 430 + 431 + /* Disable input sensing */ 432 + iowrite32(ioread32(conf2) | GPINDIS_BIT, conf2); 433 + 434 + raw_spin_unlock_irqrestore(&lg->lock, flags); 435 + 436 + pm_runtime_put(lg->dev); 437 + } 438 + 439 + static int lp_gpio_set_direction(struct pinctrl_dev *pctldev, 440 + struct pinctrl_gpio_range *range, 441 + unsigned int pin, bool input) 442 + { 443 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 444 + void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); 445 + unsigned long flags; 446 + u32 value; 447 + 448 + raw_spin_lock_irqsave(&lg->lock, flags); 449 + 450 + value = ioread32(reg); 451 + value &= ~DIR_BIT; 452 + if (input) { 453 + value |= DIR_BIT; 454 + } else { 455 + /* 456 + * Before making any direction modifications, do a check if GPIO 457 + * is set for direct IRQ. On Lynxpoint, setting GPIO to output 458 + * does not make sense, so let's at least warn the caller before 459 + * they shoot themselves in the foot. 460 + */ 461 + WARN(lp_gpio_ioxapic_use(&lg->chip, pin), 462 + "Potential Error: Setting GPIO to output with IOxAPIC redirection"); 463 + } 464 + iowrite32(value, reg); 465 + 466 + raw_spin_unlock_irqrestore(&lg->lock, flags); 467 + 468 + return 0; 469 + } 470 + 471 + static const struct pinmux_ops lptlp_pinmux_ops = { 472 + .get_functions_count = lp_get_functions_count, 473 + .get_function_name = lp_get_function_name, 474 + .get_function_groups = lp_get_function_groups, 475 + .set_mux = lp_pinmux_set_mux, 476 + .gpio_request_enable = lp_gpio_request_enable, 477 + .gpio_disable_free = lp_gpio_disable_free, 478 + .gpio_set_direction = lp_gpio_set_direction, 479 + }; 480 + 481 + static int lp_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin, 482 + unsigned long *config) 483 + { 484 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 485 + void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); 486 + enum pin_config_param param = pinconf_to_config_param(*config); 487 + unsigned long flags; 488 + u32 value, pull; 489 + u16 arg = 0; 490 + 491 + raw_spin_lock_irqsave(&lg->lock, flags); 492 + value = ioread32(conf2); 493 + raw_spin_unlock_irqrestore(&lg->lock, flags); 494 + 495 + pull = value & GPIWP_MASK; 496 + 497 + switch (param) { 498 + case PIN_CONFIG_BIAS_DISABLE: 499 + if (pull) 500 + return -EINVAL; 501 + break; 502 + case PIN_CONFIG_BIAS_PULL_DOWN: 503 + if (pull != GPIWP_DOWN) 504 + return -EINVAL; 505 + 506 + arg = 1; 507 + break; 508 + case PIN_CONFIG_BIAS_PULL_UP: 509 + if (pull != GPIWP_UP) 510 + return -EINVAL; 511 + 512 + arg = 1; 513 + break; 514 + default: 515 + return -ENOTSUPP; 516 + } 517 + 518 + *config = pinconf_to_config_packed(param, arg); 519 + 520 + return 0; 521 + } 522 + 523 + static int lp_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin, 524 + unsigned long *configs, unsigned int num_configs) 525 + { 526 + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); 527 + void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); 528 + enum pin_config_param param; 529 + unsigned long flags; 530 + int i, ret = 0; 531 + u32 value; 532 + 533 + raw_spin_lock_irqsave(&lg->lock, flags); 534 + 535 + value = ioread32(conf2); 536 + 537 + for (i = 0; i < num_configs; i++) { 538 + param = pinconf_to_config_param(configs[i]); 539 + 540 + switch (param) { 541 + case PIN_CONFIG_BIAS_DISABLE: 542 + value &= ~GPIWP_MASK; 543 + break; 544 + case PIN_CONFIG_BIAS_PULL_DOWN: 545 + value &= ~GPIWP_MASK; 546 + value |= GPIWP_DOWN; 547 + break; 548 + case PIN_CONFIG_BIAS_PULL_UP: 549 + value &= ~GPIWP_MASK; 550 + value |= GPIWP_UP; 551 + break; 552 + default: 553 + ret = -ENOTSUPP; 554 + } 555 + 556 + if (ret) 557 + break; 558 + } 559 + 560 + if (!ret) 561 + iowrite32(value, conf2); 562 + 563 + raw_spin_unlock_irqrestore(&lg->lock, flags); 564 + 565 + return ret; 566 + } 567 + 568 + static const struct pinconf_ops lptlp_pinconf_ops = { 569 + .is_generic = true, 570 + .pin_config_get = lp_pin_config_get, 571 + .pin_config_set = lp_pin_config_set, 572 + }; 573 + 574 + static const struct pinctrl_desc lptlp_pinctrl_desc = { 575 + .pctlops = &lptlp_pinctrl_ops, 576 + .pmxops = &lptlp_pinmux_ops, 577 + .confops = &lptlp_pinconf_ops, 578 + .owner = THIS_MODULE, 579 + }; 580 + 581 + static int lp_gpio_get(struct gpio_chip *chip, unsigned int offset) 582 + { 583 + void __iomem *reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 584 + return !!(ioread32(reg) & IN_LVL_BIT); 585 + } 586 + 587 + static void lp_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) 588 + { 589 + struct intel_pinctrl *lg = gpiochip_get_data(chip); 590 + void __iomem *reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 591 + unsigned long flags; 592 + 593 + raw_spin_lock_irqsave(&lg->lock, flags); 594 + 595 + if (value) 596 + iowrite32(ioread32(reg) | OUT_LVL_BIT, reg); 597 + else 598 + iowrite32(ioread32(reg) & ~OUT_LVL_BIT, reg); 599 + 600 + raw_spin_unlock_irqrestore(&lg->lock, flags); 601 + } 602 + 603 + static int lp_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) 604 + { 605 + return pinctrl_gpio_direction_input(chip->base + offset); 606 + } 607 + 608 + static int lp_gpio_direction_output(struct gpio_chip *chip, unsigned int offset, 609 + int value) 610 + { 611 + lp_gpio_set(chip, offset, value); 612 + 613 + return pinctrl_gpio_direction_output(chip->base + offset); 614 + } 615 + 616 + static int lp_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) 617 + { 618 + void __iomem *reg = lp_gpio_reg(chip, offset, LP_CONFIG1); 619 + 620 + if (ioread32(reg) & DIR_BIT) 621 + return GPIO_LINE_DIRECTION_IN; 622 + 623 + return GPIO_LINE_DIRECTION_OUT; 624 + } 625 + 626 + static void lp_gpio_irq_handler(struct irq_desc *desc) 627 + { 628 + struct irq_data *data = irq_desc_get_irq_data(desc); 629 + struct gpio_chip *gc = irq_desc_get_handler_data(desc); 630 + struct intel_pinctrl *lg = gpiochip_get_data(gc); 631 + struct irq_chip *chip = irq_data_get_irq_chip(data); 632 + void __iomem *reg, *ena; 633 + unsigned long pending; 634 + u32 base, pin; 635 + 636 + /* check from GPIO controller which pin triggered the interrupt */ 637 + for (base = 0; base < lg->chip.ngpio; base += 32) { 638 + reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); 639 + ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); 640 + 641 + /* Only interrupts that are enabled */ 642 + pending = ioread32(reg) & ioread32(ena); 643 + 644 + for_each_set_bit(pin, &pending, 32) { 645 + unsigned int irq; 646 + 647 + irq = irq_find_mapping(lg->chip.irq.domain, base + pin); 648 + generic_handle_irq(irq); 649 + } 650 + } 651 + chip->irq_eoi(data); 652 + } 653 + 654 + static void lp_irq_ack(struct irq_data *d) 655 + { 656 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 657 + struct intel_pinctrl *lg = gpiochip_get_data(gc); 658 + u32 hwirq = irqd_to_hwirq(d); 659 + void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT); 660 + unsigned long flags; 661 + 662 + raw_spin_lock_irqsave(&lg->lock, flags); 663 + iowrite32(BIT(hwirq % 32), reg); 664 + raw_spin_unlock_irqrestore(&lg->lock, flags); 665 + } 666 + 667 + static void lp_irq_unmask(struct irq_data *d) 668 + { 669 + } 670 + 671 + static void lp_irq_mask(struct irq_data *d) 672 + { 673 + } 674 + 675 + static void lp_irq_enable(struct irq_data *d) 676 + { 677 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 678 + struct intel_pinctrl *lg = gpiochip_get_data(gc); 679 + u32 hwirq = irqd_to_hwirq(d); 680 + void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); 681 + unsigned long flags; 682 + 683 + raw_spin_lock_irqsave(&lg->lock, flags); 684 + iowrite32(ioread32(reg) | BIT(hwirq % 32), reg); 685 + raw_spin_unlock_irqrestore(&lg->lock, flags); 686 + } 687 + 688 + static void lp_irq_disable(struct irq_data *d) 689 + { 690 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 691 + struct intel_pinctrl *lg = gpiochip_get_data(gc); 692 + u32 hwirq = irqd_to_hwirq(d); 693 + void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); 694 + unsigned long flags; 695 + 696 + raw_spin_lock_irqsave(&lg->lock, flags); 697 + iowrite32(ioread32(reg) & ~BIT(hwirq % 32), reg); 698 + raw_spin_unlock_irqrestore(&lg->lock, flags); 699 + } 700 + 701 + static int lp_irq_set_type(struct irq_data *d, unsigned int type) 702 + { 703 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 704 + struct intel_pinctrl *lg = gpiochip_get_data(gc); 705 + u32 hwirq = irqd_to_hwirq(d); 706 + void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_CONFIG1); 707 + unsigned long flags; 708 + u32 value; 709 + 710 + if (hwirq >= lg->chip.ngpio) 711 + return -EINVAL; 712 + 713 + /* Fail if BIOS reserved pin for ACPI use */ 714 + if (lp_gpio_acpi_use(lg, hwirq)) { 715 + dev_err(lg->dev, "pin %u can't be used as IRQ\n", hwirq); 716 + return -EBUSY; 717 + } 718 + 719 + raw_spin_lock_irqsave(&lg->lock, flags); 720 + value = ioread32(reg); 721 + 722 + /* set both TRIG_SEL and INV bits to 0 for rising edge */ 723 + if (type & IRQ_TYPE_EDGE_RISING) 724 + value &= ~(TRIG_SEL_BIT | INT_INV_BIT); 725 + 726 + /* TRIG_SEL bit 0, INV bit 1 for falling edge */ 727 + if (type & IRQ_TYPE_EDGE_FALLING) 728 + value = (value | INT_INV_BIT) & ~TRIG_SEL_BIT; 729 + 730 + /* TRIG_SEL bit 1, INV bit 0 for level low */ 731 + if (type & IRQ_TYPE_LEVEL_LOW) 732 + value = (value | TRIG_SEL_BIT) & ~INT_INV_BIT; 733 + 734 + /* TRIG_SEL bit 1, INV bit 1 for level high */ 735 + if (type & IRQ_TYPE_LEVEL_HIGH) 736 + value |= TRIG_SEL_BIT | INT_INV_BIT; 737 + 738 + iowrite32(value, reg); 739 + 740 + if (type & IRQ_TYPE_EDGE_BOTH) 741 + irq_set_handler_locked(d, handle_edge_irq); 742 + else if (type & IRQ_TYPE_LEVEL_MASK) 743 + irq_set_handler_locked(d, handle_level_irq); 744 + 745 + raw_spin_unlock_irqrestore(&lg->lock, flags); 746 + 747 + return 0; 748 + } 749 + 750 + static struct irq_chip lp_irqchip = { 751 + .name = "LP-GPIO", 752 + .irq_ack = lp_irq_ack, 753 + .irq_mask = lp_irq_mask, 754 + .irq_unmask = lp_irq_unmask, 755 + .irq_enable = lp_irq_enable, 756 + .irq_disable = lp_irq_disable, 757 + .irq_set_type = lp_irq_set_type, 758 + .flags = IRQCHIP_SKIP_SET_WAKE, 759 + }; 760 + 761 + static int lp_gpio_irq_init_hw(struct gpio_chip *chip) 762 + { 763 + struct intel_pinctrl *lg = gpiochip_get_data(chip); 764 + void __iomem *reg; 765 + unsigned int base; 766 + 767 + for (base = 0; base < lg->chip.ngpio; base += 32) { 768 + /* disable gpio pin interrupts */ 769 + reg = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE); 770 + iowrite32(0, reg); 771 + /* Clear interrupt status register */ 772 + reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT); 773 + iowrite32(0xffffffff, reg); 774 + } 775 + 776 + return 0; 777 + } 778 + 779 + static int lp_gpio_add_pin_ranges(struct gpio_chip *chip) 780 + { 781 + struct intel_pinctrl *lg = gpiochip_get_data(chip); 782 + struct device *dev = lg->dev; 783 + int ret; 784 + 785 + ret = gpiochip_add_pin_range(chip, dev_name(dev), 0, 0, lg->soc->npins); 786 + if (ret) 787 + dev_err(dev, "failed to add GPIO pin range\n"); 788 + 789 + return ret; 790 + } 791 + 792 + static int lp_gpio_probe(struct platform_device *pdev) 793 + { 794 + const struct intel_pinctrl_soc_data *soc; 795 + struct intel_pinctrl *lg; 796 + struct gpio_chip *gc; 797 + struct resource *io_rc, *irq_rc; 798 + struct device *dev = &pdev->dev; 799 + void __iomem *regs; 800 + unsigned int i; 801 + int ret; 802 + 803 + soc = (const struct intel_pinctrl_soc_data *)device_get_match_data(dev); 804 + if (!soc) 805 + return -ENODEV; 806 + 807 + lg = devm_kzalloc(dev, sizeof(*lg), GFP_KERNEL); 808 + if (!lg) 809 + return -ENOMEM; 810 + 811 + lg->dev = dev; 812 + lg->soc = soc; 813 + 814 + lg->ncommunities = lg->soc->ncommunities; 815 + lg->communities = devm_kcalloc(dev, lg->ncommunities, 816 + sizeof(*lg->communities), GFP_KERNEL); 817 + if (!lg->communities) 818 + return -ENOMEM; 819 + 820 + lg->pctldesc = lptlp_pinctrl_desc; 821 + lg->pctldesc.name = dev_name(dev); 822 + lg->pctldesc.pins = lg->soc->pins; 823 + lg->pctldesc.npins = lg->soc->npins; 824 + 825 + lg->pctldev = devm_pinctrl_register(dev, &lg->pctldesc, lg); 826 + if (IS_ERR(lg->pctldev)) { 827 + dev_err(dev, "failed to register pinctrl driver\n"); 828 + return PTR_ERR(lg->pctldev); 829 + } 830 + 831 + platform_set_drvdata(pdev, lg); 832 + 833 + io_rc = platform_get_resource(pdev, IORESOURCE_IO, 0); 834 + if (!io_rc) { 835 + dev_err(dev, "missing IO resources\n"); 836 + return -EINVAL; 837 + } 838 + 839 + regs = devm_ioport_map(dev, io_rc->start, resource_size(io_rc)); 840 + if (!regs) { 841 + dev_err(dev, "failed mapping IO region %pR\n", &io_rc); 842 + return -EBUSY; 843 + } 844 + 845 + for (i = 0; i < lg->soc->ncommunities; i++) { 846 + struct intel_community *comm = &lg->communities[i]; 847 + 848 + *comm = lg->soc->communities[i]; 849 + 850 + comm->regs = regs; 851 + comm->pad_regs = regs + 0x100; 852 + } 853 + 854 + raw_spin_lock_init(&lg->lock); 855 + 856 + gc = &lg->chip; 857 + gc->label = dev_name(dev); 858 + gc->owner = THIS_MODULE; 859 + gc->request = gpiochip_generic_request; 860 + gc->free = gpiochip_generic_free; 861 + gc->direction_input = lp_gpio_direction_input; 862 + gc->direction_output = lp_gpio_direction_output; 863 + gc->get = lp_gpio_get; 864 + gc->set = lp_gpio_set; 865 + gc->get_direction = lp_gpio_get_direction; 866 + gc->base = -1; 867 + gc->ngpio = LP_NUM_GPIO; 868 + gc->can_sleep = false; 869 + gc->add_pin_ranges = lp_gpio_add_pin_ranges; 870 + gc->parent = dev; 871 + 872 + /* set up interrupts */ 873 + irq_rc = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 874 + if (irq_rc && irq_rc->start) { 875 + struct gpio_irq_chip *girq; 876 + 877 + girq = &gc->irq; 878 + girq->chip = &lp_irqchip; 879 + girq->init_hw = lp_gpio_irq_init_hw; 880 + girq->parent_handler = lp_gpio_irq_handler; 881 + girq->num_parents = 1; 882 + girq->parents = devm_kcalloc(dev, girq->num_parents, 883 + sizeof(*girq->parents), 884 + GFP_KERNEL); 885 + if (!girq->parents) 886 + return -ENOMEM; 887 + girq->parents[0] = (unsigned int)irq_rc->start; 888 + girq->default_type = IRQ_TYPE_NONE; 889 + girq->handler = handle_bad_irq; 890 + } 891 + 892 + ret = devm_gpiochip_add_data(dev, gc, lg); 893 + if (ret) { 894 + dev_err(dev, "failed adding lp-gpio chip\n"); 895 + return ret; 896 + } 897 + 898 + pm_runtime_enable(dev); 899 + 900 + return 0; 901 + } 902 + 903 + static int lp_gpio_remove(struct platform_device *pdev) 904 + { 905 + pm_runtime_disable(&pdev->dev); 906 + return 0; 907 + } 908 + 909 + static int lp_gpio_runtime_suspend(struct device *dev) 910 + { 911 + return 0; 912 + } 913 + 914 + static int lp_gpio_runtime_resume(struct device *dev) 915 + { 916 + return 0; 917 + } 918 + 919 + static int lp_gpio_resume(struct device *dev) 920 + { 921 + struct intel_pinctrl *lg = dev_get_drvdata(dev); 922 + void __iomem *reg; 923 + int i; 924 + 925 + /* on some hardware suspend clears input sensing, re-enable it here */ 926 + for (i = 0; i < lg->chip.ngpio; i++) { 927 + if (gpiochip_is_requested(&lg->chip, i) != NULL) { 928 + reg = lp_gpio_reg(&lg->chip, i, LP_CONFIG2); 929 + iowrite32(ioread32(reg) & ~GPINDIS_BIT, reg); 930 + } 931 + } 932 + return 0; 933 + } 934 + 935 + static const struct dev_pm_ops lp_gpio_pm_ops = { 936 + .runtime_suspend = lp_gpio_runtime_suspend, 937 + .runtime_resume = lp_gpio_runtime_resume, 938 + .resume = lp_gpio_resume, 939 + }; 940 + 941 + static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = { 942 + { "INT33C7", (kernel_ulong_t)&lptlp_soc_data }, 943 + { "INT3437", (kernel_ulong_t)&lptlp_soc_data }, 944 + { } 945 + }; 946 + MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match); 947 + 948 + static struct platform_driver lp_gpio_driver = { 949 + .probe = lp_gpio_probe, 950 + .remove = lp_gpio_remove, 951 + .driver = { 952 + .name = "lp_gpio", 953 + .pm = &lp_gpio_pm_ops, 954 + .acpi_match_table = ACPI_PTR(lynxpoint_gpio_acpi_match), 955 + }, 956 + }; 957 + 958 + static int __init lp_gpio_init(void) 959 + { 960 + return platform_driver_register(&lp_gpio_driver); 961 + } 962 + 963 + static void __exit lp_gpio_exit(void) 964 + { 965 + platform_driver_unregister(&lp_gpio_driver); 966 + } 967 + 968 + subsys_initcall(lp_gpio_init); 969 + module_exit(lp_gpio_exit); 970 + 971 + MODULE_AUTHOR("Mathias Nyman (Intel)"); 972 + MODULE_AUTHOR("Andy Shevchenko (Intel)"); 973 + MODULE_DESCRIPTION("Intel Lynxpoint pinctrl driver"); 974 + MODULE_LICENSE("GPL v2"); 975 + MODULE_ALIAS("platform:lp_gpio");
+1
drivers/pinctrl/intel/pinctrl-sunrisepoint.c
··· 589 589 590 590 static const struct acpi_device_id spt_pinctrl_acpi_match[] = { 591 591 { "INT344B", (kernel_ulong_t)&sptlp_soc_data }, 592 + { "INT3451", (kernel_ulong_t)&spth_soc_data }, 592 593 { "INT345D", (kernel_ulong_t)&spth_soc_data }, 593 594 { } 594 595 };
+257 -304
drivers/pinctrl/intel/pinctrl-tigerlake.c
··· 2 2 /* 3 3 * Intel Tiger Lake PCH pinctrl/GPIO driver 4 4 * 5 - * Copyright (C) 2019, Intel Corporation 5 + * Copyright (C) 2019 - 2020, Intel Corporation 6 6 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7 7 * Mika Westerberg <mika.westerberg@linux.intel.com> 8 8 */ ··· 21 21 #define TGL_GPI_IS 0x100 22 22 #define TGL_GPI_IE 0x120 23 23 24 - #define TGL_GPP(r, s, e) \ 24 + #define TGL_NO_GPIO -1 25 + 26 + #define TGL_GPP(r, s, e, g) \ 25 27 { \ 26 28 .reg_num = (r), \ 27 29 .base = (s), \ 28 30 .size = ((e) - (s) + 1), \ 31 + .gpio_base = (g), \ 29 32 } 30 33 31 - #define TGL_COMMUNITY(s, e, g) \ 34 + #define TGL_COMMUNITY(b, s, e, g) \ 32 35 { \ 36 + .barno = (b), \ 33 37 .padown_offset = TGL_PAD_OWN, \ 34 38 .padcfglock_offset = TGL_PADCFGLOCK, \ 35 39 .hostown_offset = TGL_HOSTSW_OWN, \ ··· 46 42 } 47 43 48 44 /* Tiger Lake-LP */ 49 - static const struct pinctrl_pin_desc tgllp_community0_pins[] = { 45 + static const struct pinctrl_pin_desc tgllp_pins[] = { 50 46 /* GPP_B */ 51 47 PINCTRL_PIN(0, "CORE_VID_0"), 52 48 PINCTRL_PIN(1, "CORE_VID_1"), ··· 117 113 PINCTRL_PIN(64, "GPPC_A_22"), 118 114 PINCTRL_PIN(65, "I2S1_SCLK"), 119 115 PINCTRL_PIN(66, "ESPI_CLK_LOOPBK"), 116 + /* GPP_S */ 117 + PINCTRL_PIN(67, "SNDW0_CLK"), 118 + PINCTRL_PIN(68, "SNDW0_DATA"), 119 + PINCTRL_PIN(69, "SNDW1_CLK"), 120 + PINCTRL_PIN(70, "SNDW1_DATA"), 121 + PINCTRL_PIN(71, "SNDW2_CLK"), 122 + PINCTRL_PIN(72, "SNDW2_DATA"), 123 + PINCTRL_PIN(73, "SNDW3_CLK"), 124 + PINCTRL_PIN(74, "SNDW3_DATA"), 125 + /* GPP_H */ 126 + PINCTRL_PIN(75, "GPPC_H_0"), 127 + PINCTRL_PIN(76, "GPPC_H_1"), 128 + PINCTRL_PIN(77, "GPPC_H_2"), 129 + PINCTRL_PIN(78, "SX_EXIT_HOLDOFFB"), 130 + PINCTRL_PIN(79, "I2C2_SDA"), 131 + PINCTRL_PIN(80, "I2C2_SCL"), 132 + PINCTRL_PIN(81, "I2C3_SDA"), 133 + PINCTRL_PIN(82, "I2C3_SCL"), 134 + PINCTRL_PIN(83, "I2C4_SDA"), 135 + PINCTRL_PIN(84, "I2C4_SCL"), 136 + PINCTRL_PIN(85, "SRCCLKREQB_4"), 137 + PINCTRL_PIN(86, "SRCCLKREQB_5"), 138 + PINCTRL_PIN(87, "M2_SKT2_CFG_0"), 139 + PINCTRL_PIN(88, "M2_SKT2_CFG_1"), 140 + PINCTRL_PIN(89, "M2_SKT2_CFG_2"), 141 + PINCTRL_PIN(90, "M2_SKT2_CFG_3"), 142 + PINCTRL_PIN(91, "DDPB_CTRLCLK"), 143 + PINCTRL_PIN(92, "DDPB_CTRLDATA"), 144 + PINCTRL_PIN(93, "CPU_C10_GATEB"), 145 + PINCTRL_PIN(94, "TIME_SYNC_0"), 146 + PINCTRL_PIN(95, "IMGCLKOUT_1"), 147 + PINCTRL_PIN(96, "IMGCLKOUT_2"), 148 + PINCTRL_PIN(97, "IMGCLKOUT_3"), 149 + PINCTRL_PIN(98, "IMGCLKOUT_4"), 150 + /* GPP_D */ 151 + PINCTRL_PIN(99, "ISH_GP_0"), 152 + PINCTRL_PIN(100, "ISH_GP_1"), 153 + PINCTRL_PIN(101, "ISH_GP_2"), 154 + PINCTRL_PIN(102, "ISH_GP_3"), 155 + PINCTRL_PIN(103, "IMGCLKOUT_0"), 156 + PINCTRL_PIN(104, "SRCCLKREQB_0"), 157 + PINCTRL_PIN(105, "SRCCLKREQB_1"), 158 + PINCTRL_PIN(106, "SRCCLKREQB_2"), 159 + PINCTRL_PIN(107, "SRCCLKREQB_3"), 160 + PINCTRL_PIN(108, "ISH_SPI_CSB"), 161 + PINCTRL_PIN(109, "ISH_SPI_CLK"), 162 + PINCTRL_PIN(110, "ISH_SPI_MISO"), 163 + PINCTRL_PIN(111, "ISH_SPI_MOSI"), 164 + PINCTRL_PIN(112, "ISH_UART0_RXD"), 165 + PINCTRL_PIN(113, "ISH_UART0_TXD"), 166 + PINCTRL_PIN(114, "ISH_UART0_RTSB"), 167 + PINCTRL_PIN(115, "ISH_UART0_CTSB"), 168 + PINCTRL_PIN(116, "ISH_GP_4"), 169 + PINCTRL_PIN(117, "ISH_GP_5"), 170 + PINCTRL_PIN(118, "I2S_MCLK1_OUT"), 171 + PINCTRL_PIN(119, "GSPI2_CLK_LOOPBK"), 172 + /* GPP_U */ 173 + PINCTRL_PIN(120, "UART3_RXD"), 174 + PINCTRL_PIN(121, "UART3_TXD"), 175 + PINCTRL_PIN(122, "UART3_RTSB"), 176 + PINCTRL_PIN(123, "UART3_CTSB"), 177 + PINCTRL_PIN(124, "GSPI3_CS0B"), 178 + PINCTRL_PIN(125, "GSPI3_CLK"), 179 + PINCTRL_PIN(126, "GSPI3_MISO"), 180 + PINCTRL_PIN(127, "GSPI3_MOSI"), 181 + PINCTRL_PIN(128, "GSPI4_CS0B"), 182 + PINCTRL_PIN(129, "GSPI4_CLK"), 183 + PINCTRL_PIN(130, "GSPI4_MISO"), 184 + PINCTRL_PIN(131, "GSPI4_MOSI"), 185 + PINCTRL_PIN(132, "GSPI5_CS0B"), 186 + PINCTRL_PIN(133, "GSPI5_CLK"), 187 + PINCTRL_PIN(134, "GSPI5_MISO"), 188 + PINCTRL_PIN(135, "GSPI5_MOSI"), 189 + PINCTRL_PIN(136, "GSPI6_CS0B"), 190 + PINCTRL_PIN(137, "GSPI6_CLK"), 191 + PINCTRL_PIN(138, "GSPI6_MISO"), 192 + PINCTRL_PIN(139, "GSPI6_MOSI"), 193 + PINCTRL_PIN(140, "GSPI3_CLK_LOOPBK"), 194 + PINCTRL_PIN(141, "GSPI4_CLK_LOOPBK"), 195 + PINCTRL_PIN(142, "GSPI5_CLK_LOOPBK"), 196 + PINCTRL_PIN(143, "GSPI6_CLK_LOOPBK"), 197 + /* vGPIO */ 198 + PINCTRL_PIN(144, "CNV_BTEN"), 199 + PINCTRL_PIN(145, "CNV_BT_HOST_WAKEB"), 200 + PINCTRL_PIN(146, "CNV_BT_IF_SELECT"), 201 + PINCTRL_PIN(147, "vCNV_BT_UART_TXD"), 202 + PINCTRL_PIN(148, "vCNV_BT_UART_RXD"), 203 + PINCTRL_PIN(149, "vCNV_BT_UART_CTS_B"), 204 + PINCTRL_PIN(150, "vCNV_BT_UART_RTS_B"), 205 + PINCTRL_PIN(151, "vCNV_MFUART1_TXD"), 206 + PINCTRL_PIN(152, "vCNV_MFUART1_RXD"), 207 + PINCTRL_PIN(153, "vCNV_MFUART1_CTS_B"), 208 + PINCTRL_PIN(154, "vCNV_MFUART1_RTS_B"), 209 + PINCTRL_PIN(155, "vUART0_TXD"), 210 + PINCTRL_PIN(156, "vUART0_RXD"), 211 + PINCTRL_PIN(157, "vUART0_CTS_B"), 212 + PINCTRL_PIN(158, "vUART0_RTS_B"), 213 + PINCTRL_PIN(159, "vISH_UART0_TXD"), 214 + PINCTRL_PIN(160, "vISH_UART0_RXD"), 215 + PINCTRL_PIN(161, "vISH_UART0_CTS_B"), 216 + PINCTRL_PIN(162, "vISH_UART0_RTS_B"), 217 + PINCTRL_PIN(163, "vCNV_BT_I2S_BCLK"), 218 + PINCTRL_PIN(164, "vCNV_BT_I2S_WS_SYNC"), 219 + PINCTRL_PIN(165, "vCNV_BT_I2S_SDO"), 220 + PINCTRL_PIN(166, "vCNV_BT_I2S_SDI"), 221 + PINCTRL_PIN(167, "vI2S2_SCLK"), 222 + PINCTRL_PIN(168, "vI2S2_SFRM"), 223 + PINCTRL_PIN(169, "vI2S2_TXD"), 224 + PINCTRL_PIN(170, "vI2S2_RXD"), 225 + /* GPP_C */ 226 + PINCTRL_PIN(171, "SMBCLK"), 227 + PINCTRL_PIN(172, "SMBDATA"), 228 + PINCTRL_PIN(173, "SMBALERTB"), 229 + PINCTRL_PIN(174, "SML0CLK"), 230 + PINCTRL_PIN(175, "SML0DATA"), 231 + PINCTRL_PIN(176, "SML0ALERTB"), 232 + PINCTRL_PIN(177, "SML1CLK"), 233 + PINCTRL_PIN(178, "SML1DATA"), 234 + PINCTRL_PIN(179, "UART0_RXD"), 235 + PINCTRL_PIN(180, "UART0_TXD"), 236 + PINCTRL_PIN(181, "UART0_RTSB"), 237 + PINCTRL_PIN(182, "UART0_CTSB"), 238 + PINCTRL_PIN(183, "UART1_RXD"), 239 + PINCTRL_PIN(184, "UART1_TXD"), 240 + PINCTRL_PIN(185, "UART1_RTSB"), 241 + PINCTRL_PIN(186, "UART1_CTSB"), 242 + PINCTRL_PIN(187, "I2C0_SDA"), 243 + PINCTRL_PIN(188, "I2C0_SCL"), 244 + PINCTRL_PIN(189, "I2C1_SDA"), 245 + PINCTRL_PIN(190, "I2C1_SCL"), 246 + PINCTRL_PIN(191, "UART2_RXD"), 247 + PINCTRL_PIN(192, "UART2_TXD"), 248 + PINCTRL_PIN(193, "UART2_RTSB"), 249 + PINCTRL_PIN(194, "UART2_CTSB"), 250 + /* GPP_F */ 251 + PINCTRL_PIN(195, "CNV_BRI_DT"), 252 + PINCTRL_PIN(196, "CNV_BRI_RSP"), 253 + PINCTRL_PIN(197, "CNV_RGI_DT"), 254 + PINCTRL_PIN(198, "CNV_RGI_RSP"), 255 + PINCTRL_PIN(199, "CNV_RF_RESET_B"), 256 + PINCTRL_PIN(200, "GPPC_F_5"), 257 + PINCTRL_PIN(201, "CNV_PA_BLANKING"), 258 + PINCTRL_PIN(202, "GPPC_F_7"), 259 + PINCTRL_PIN(203, "I2S_MCLK2_INOUT"), 260 + PINCTRL_PIN(204, "BOOTMPC"), 261 + PINCTRL_PIN(205, "GPPC_F_10"), 262 + PINCTRL_PIN(206, "GPPC_F_11"), 263 + PINCTRL_PIN(207, "GSXDOUT"), 264 + PINCTRL_PIN(208, "GSXSLOAD"), 265 + PINCTRL_PIN(209, "GSXDIN"), 266 + PINCTRL_PIN(210, "GSXSRESETB"), 267 + PINCTRL_PIN(211, "GSXCLK"), 268 + PINCTRL_PIN(212, "GMII_MDC"), 269 + PINCTRL_PIN(213, "GMII_MDIO"), 270 + PINCTRL_PIN(214, "SRCCLKREQB_6"), 271 + PINCTRL_PIN(215, "EXT_PWR_GATEB"), 272 + PINCTRL_PIN(216, "EXT_PWR_GATE2B"), 273 + PINCTRL_PIN(217, "VNN_CTRL"), 274 + PINCTRL_PIN(218, "V1P05_CTRL"), 275 + PINCTRL_PIN(219, "GPPF_CLK_LOOPBACK"), 276 + /* HVCMOS */ 277 + PINCTRL_PIN(220, "L_BKLTEN"), 278 + PINCTRL_PIN(221, "L_BKLTCTL"), 279 + PINCTRL_PIN(222, "L_VDDEN"), 280 + PINCTRL_PIN(223, "SYS_PWROK"), 281 + PINCTRL_PIN(224, "SYS_RESETB"), 282 + PINCTRL_PIN(225, "MLK_RSTB"), 283 + /* GPP_E */ 284 + PINCTRL_PIN(226, "SATAXPCIE_0"), 285 + PINCTRL_PIN(227, "SPI1_IO_2"), 286 + PINCTRL_PIN(228, "SPI1_IO_3"), 287 + PINCTRL_PIN(229, "CPU_GP_0"), 288 + PINCTRL_PIN(230, "SATA_DEVSLP_0"), 289 + PINCTRL_PIN(231, "SATA_DEVSLP_1"), 290 + PINCTRL_PIN(232, "GPPC_E_6"), 291 + PINCTRL_PIN(233, "CPU_GP_1"), 292 + PINCTRL_PIN(234, "SPI1_CS1B"), 293 + PINCTRL_PIN(235, "USB2_OCB_0"), 294 + PINCTRL_PIN(236, "SPI1_CSB"), 295 + PINCTRL_PIN(237, "SPI1_CLK"), 296 + PINCTRL_PIN(238, "SPI1_MISO_IO_1"), 297 + PINCTRL_PIN(239, "SPI1_MOSI_IO_0"), 298 + PINCTRL_PIN(240, "DDSP_HPD_A"), 299 + PINCTRL_PIN(241, "ISH_GP_6"), 300 + PINCTRL_PIN(242, "ISH_GP_7"), 301 + PINCTRL_PIN(243, "GPPC_E_17"), 302 + PINCTRL_PIN(244, "DDP1_CTRLCLK"), 303 + PINCTRL_PIN(245, "DDP1_CTRLDATA"), 304 + PINCTRL_PIN(246, "DDP2_CTRLCLK"), 305 + PINCTRL_PIN(247, "DDP2_CTRLDATA"), 306 + PINCTRL_PIN(248, "DDPA_CTRLCLK"), 307 + PINCTRL_PIN(249, "DDPA_CTRLDATA"), 308 + PINCTRL_PIN(250, "SPI1_CLK_LOOPBK"), 309 + /* JTAG */ 310 + PINCTRL_PIN(251, "JTAG_TDO"), 311 + PINCTRL_PIN(252, "JTAGX"), 312 + PINCTRL_PIN(253, "PRDYB"), 313 + PINCTRL_PIN(254, "PREQB"), 314 + PINCTRL_PIN(255, "CPU_TRSTB"), 315 + PINCTRL_PIN(256, "JTAG_TDI"), 316 + PINCTRL_PIN(257, "JTAG_TMS"), 317 + PINCTRL_PIN(258, "JTAG_TCK"), 318 + PINCTRL_PIN(259, "DBG_PMODE"), 319 + /* GPP_R */ 320 + PINCTRL_PIN(260, "HDA_BCLK"), 321 + PINCTRL_PIN(261, "HDA_SYNC"), 322 + PINCTRL_PIN(262, "HDA_SDO"), 323 + PINCTRL_PIN(263, "HDA_SDI_0"), 324 + PINCTRL_PIN(264, "HDA_RSTB"), 325 + PINCTRL_PIN(265, "HDA_SDI_1"), 326 + PINCTRL_PIN(266, "GPP_R_6"), 327 + PINCTRL_PIN(267, "GPP_R_7"), 328 + /* SPI */ 329 + PINCTRL_PIN(268, "SPI0_IO_2"), 330 + PINCTRL_PIN(269, "SPI0_IO_3"), 331 + PINCTRL_PIN(270, "SPI0_MOSI_IO_0"), 332 + PINCTRL_PIN(271, "SPI0_MISO_IO_1"), 333 + PINCTRL_PIN(272, "SPI0_TPM_CSB"), 334 + PINCTRL_PIN(273, "SPI0_FLASH_0_CSB"), 335 + PINCTRL_PIN(274, "SPI0_FLASH_1_CSB"), 336 + PINCTRL_PIN(275, "SPI0_CLK"), 337 + PINCTRL_PIN(276, "SPI0_CLK_LOOPBK"), 120 338 }; 121 339 122 340 static const struct intel_padgroup tgllp_community0_gpps[] = { 123 - TGL_GPP(0, 0, 25), /* GPP_B */ 124 - TGL_GPP(1, 26, 41), /* GPP_T */ 125 - TGL_GPP(2, 42, 66), /* GPP_A */ 126 - }; 127 - 128 - static const struct intel_community tgllp_community0[] = { 129 - TGL_COMMUNITY(0, 66, tgllp_community0_gpps), 130 - }; 131 - 132 - static const struct intel_pinctrl_soc_data tgllp_community0_soc_data = { 133 - .uid = "0", 134 - .pins = tgllp_community0_pins, 135 - .npins = ARRAY_SIZE(tgllp_community0_pins), 136 - .communities = tgllp_community0, 137 - .ncommunities = ARRAY_SIZE(tgllp_community0), 138 - }; 139 - 140 - static const struct pinctrl_pin_desc tgllp_community1_pins[] = { 141 - /* GPP_S */ 142 - PINCTRL_PIN(0, "SNDW0_CLK"), 143 - PINCTRL_PIN(1, "SNDW0_DATA"), 144 - PINCTRL_PIN(2, "SNDW1_CLK"), 145 - PINCTRL_PIN(3, "SNDW1_DATA"), 146 - PINCTRL_PIN(4, "SNDW2_CLK"), 147 - PINCTRL_PIN(5, "SNDW2_DATA"), 148 - PINCTRL_PIN(6, "SNDW3_CLK"), 149 - PINCTRL_PIN(7, "SNDW3_DATA"), 150 - /* GPP_H */ 151 - PINCTRL_PIN(8, "GPPC_H_0"), 152 - PINCTRL_PIN(9, "GPPC_H_1"), 153 - PINCTRL_PIN(10, "GPPC_H_2"), 154 - PINCTRL_PIN(11, "SX_EXIT_HOLDOFFB"), 155 - PINCTRL_PIN(12, "I2C2_SDA"), 156 - PINCTRL_PIN(13, "I2C2_SCL"), 157 - PINCTRL_PIN(14, "I2C3_SDA"), 158 - PINCTRL_PIN(15, "I2C3_SCL"), 159 - PINCTRL_PIN(16, "I2C4_SDA"), 160 - PINCTRL_PIN(17, "I2C4_SCL"), 161 - PINCTRL_PIN(18, "SRCCLKREQB_4"), 162 - PINCTRL_PIN(19, "SRCCLKREQB_5"), 163 - PINCTRL_PIN(20, "M2_SKT2_CFG_0"), 164 - PINCTRL_PIN(21, "M2_SKT2_CFG_1"), 165 - PINCTRL_PIN(22, "M2_SKT2_CFG_2"), 166 - PINCTRL_PIN(23, "M2_SKT2_CFG_3"), 167 - PINCTRL_PIN(24, "DDPB_CTRLCLK"), 168 - PINCTRL_PIN(25, "DDPB_CTRLDATA"), 169 - PINCTRL_PIN(26, "CPU_C10_GATEB"), 170 - PINCTRL_PIN(27, "TIME_SYNC_0"), 171 - PINCTRL_PIN(28, "IMGCLKOUT_1"), 172 - PINCTRL_PIN(29, "IMGCLKOUT_2"), 173 - PINCTRL_PIN(30, "IMGCLKOUT_3"), 174 - PINCTRL_PIN(31, "IMGCLKOUT_4"), 175 - /* GPP_D */ 176 - PINCTRL_PIN(32, "ISH_GP_0"), 177 - PINCTRL_PIN(33, "ISH_GP_1"), 178 - PINCTRL_PIN(34, "ISH_GP_2"), 179 - PINCTRL_PIN(35, "ISH_GP_3"), 180 - PINCTRL_PIN(36, "IMGCLKOUT_0"), 181 - PINCTRL_PIN(37, "SRCCLKREQB_0"), 182 - PINCTRL_PIN(38, "SRCCLKREQB_1"), 183 - PINCTRL_PIN(39, "SRCCLKREQB_2"), 184 - PINCTRL_PIN(40, "SRCCLKREQB_3"), 185 - PINCTRL_PIN(41, "ISH_SPI_CSB"), 186 - PINCTRL_PIN(42, "ISH_SPI_CLK"), 187 - PINCTRL_PIN(43, "ISH_SPI_MISO"), 188 - PINCTRL_PIN(44, "ISH_SPI_MOSI"), 189 - PINCTRL_PIN(45, "ISH_UART0_RXD"), 190 - PINCTRL_PIN(46, "ISH_UART0_TXD"), 191 - PINCTRL_PIN(47, "ISH_UART0_RTSB"), 192 - PINCTRL_PIN(48, "ISH_UART0_CTSB"), 193 - PINCTRL_PIN(49, "ISH_GP_4"), 194 - PINCTRL_PIN(50, "ISH_GP_5"), 195 - PINCTRL_PIN(51, "I2S_MCLK1_OUT"), 196 - PINCTRL_PIN(52, "GSPI2_CLK_LOOPBK"), 197 - /* GPP_U */ 198 - PINCTRL_PIN(53, "UART3_RXD"), 199 - PINCTRL_PIN(54, "UART3_TXD"), 200 - PINCTRL_PIN(55, "UART3_RTSB"), 201 - PINCTRL_PIN(56, "UART3_CTSB"), 202 - PINCTRL_PIN(57, "GSPI3_CS0B"), 203 - PINCTRL_PIN(58, "GSPI3_CLK"), 204 - PINCTRL_PIN(59, "GSPI3_MISO"), 205 - PINCTRL_PIN(60, "GSPI3_MOSI"), 206 - PINCTRL_PIN(61, "GSPI4_CS0B"), 207 - PINCTRL_PIN(62, "GSPI4_CLK"), 208 - PINCTRL_PIN(63, "GSPI4_MISO"), 209 - PINCTRL_PIN(64, "GSPI4_MOSI"), 210 - PINCTRL_PIN(65, "GSPI5_CS0B"), 211 - PINCTRL_PIN(66, "GSPI5_CLK"), 212 - PINCTRL_PIN(67, "GSPI5_MISO"), 213 - PINCTRL_PIN(68, "GSPI5_MOSI"), 214 - PINCTRL_PIN(69, "GSPI6_CS0B"), 215 - PINCTRL_PIN(70, "GSPI6_CLK"), 216 - PINCTRL_PIN(71, "GSPI6_MISO"), 217 - PINCTRL_PIN(72, "GSPI6_MOSI"), 218 - PINCTRL_PIN(73, "GSPI3_CLK_LOOPBK"), 219 - PINCTRL_PIN(74, "GSPI4_CLK_LOOPBK"), 220 - PINCTRL_PIN(75, "GSPI5_CLK_LOOPBK"), 221 - PINCTRL_PIN(76, "GSPI6_CLK_LOOPBK"), 222 - /* vGPIO */ 223 - PINCTRL_PIN(77, "CNV_BTEN"), 224 - PINCTRL_PIN(78, "CNV_BT_HOST_WAKEB"), 225 - PINCTRL_PIN(79, "CNV_BT_IF_SELECT"), 226 - PINCTRL_PIN(80, "vCNV_BT_UART_TXD"), 227 - PINCTRL_PIN(81, "vCNV_BT_UART_RXD"), 228 - PINCTRL_PIN(82, "vCNV_BT_UART_CTS_B"), 229 - PINCTRL_PIN(83, "vCNV_BT_UART_RTS_B"), 230 - PINCTRL_PIN(84, "vCNV_MFUART1_TXD"), 231 - PINCTRL_PIN(85, "vCNV_MFUART1_RXD"), 232 - PINCTRL_PIN(86, "vCNV_MFUART1_CTS_B"), 233 - PINCTRL_PIN(87, "vCNV_MFUART1_RTS_B"), 234 - PINCTRL_PIN(88, "vUART0_TXD"), 235 - PINCTRL_PIN(89, "vUART0_RXD"), 236 - PINCTRL_PIN(90, "vUART0_CTS_B"), 237 - PINCTRL_PIN(91, "vUART0_RTS_B"), 238 - PINCTRL_PIN(92, "vISH_UART0_TXD"), 239 - PINCTRL_PIN(93, "vISH_UART0_RXD"), 240 - PINCTRL_PIN(94, "vISH_UART0_CTS_B"), 241 - PINCTRL_PIN(95, "vISH_UART0_RTS_B"), 242 - PINCTRL_PIN(96, "vCNV_BT_I2S_BCLK"), 243 - PINCTRL_PIN(97, "vCNV_BT_I2S_WS_SYNC"), 244 - PINCTRL_PIN(98, "vCNV_BT_I2S_SDO"), 245 - PINCTRL_PIN(99, "vCNV_BT_I2S_SDI"), 246 - PINCTRL_PIN(100, "vI2S2_SCLK"), 247 - PINCTRL_PIN(101, "vI2S2_SFRM"), 248 - PINCTRL_PIN(102, "vI2S2_TXD"), 249 - PINCTRL_PIN(103, "vI2S2_RXD"), 341 + TGL_GPP(0, 0, 25, 0), /* GPP_B */ 342 + TGL_GPP(1, 26, 41, 32), /* GPP_T */ 343 + TGL_GPP(2, 42, 66, 64), /* GPP_A */ 250 344 }; 251 345 252 346 static const struct intel_padgroup tgllp_community1_gpps[] = { 253 - TGL_GPP(0, 0, 7), /* GPP_S */ 254 - TGL_GPP(1, 8, 31), /* GPP_H */ 255 - TGL_GPP(2, 32, 52), /* GPP_D */ 256 - TGL_GPP(3, 53, 76), /* GPP_U */ 257 - TGL_GPP(4, 77, 103), /* vGPIO */ 258 - }; 259 - 260 - static const struct intel_community tgllp_community1[] = { 261 - TGL_COMMUNITY(0, 103, tgllp_community1_gpps), 262 - }; 263 - 264 - static const struct intel_pinctrl_soc_data tgllp_community1_soc_data = { 265 - .uid = "1", 266 - .pins = tgllp_community1_pins, 267 - .npins = ARRAY_SIZE(tgllp_community1_pins), 268 - .communities = tgllp_community1, 269 - .ncommunities = ARRAY_SIZE(tgllp_community1), 270 - }; 271 - 272 - static const struct pinctrl_pin_desc tgllp_community4_pins[] = { 273 - /* GPP_C */ 274 - PINCTRL_PIN(0, "SMBCLK"), 275 - PINCTRL_PIN(1, "SMBDATA"), 276 - PINCTRL_PIN(2, "SMBALERTB"), 277 - PINCTRL_PIN(3, "SML0CLK"), 278 - PINCTRL_PIN(4, "SML0DATA"), 279 - PINCTRL_PIN(5, "SML0ALERTB"), 280 - PINCTRL_PIN(6, "SML1CLK"), 281 - PINCTRL_PIN(7, "SML1DATA"), 282 - PINCTRL_PIN(8, "UART0_RXD"), 283 - PINCTRL_PIN(9, "UART0_TXD"), 284 - PINCTRL_PIN(10, "UART0_RTSB"), 285 - PINCTRL_PIN(11, "UART0_CTSB"), 286 - PINCTRL_PIN(12, "UART1_RXD"), 287 - PINCTRL_PIN(13, "UART1_TXD"), 288 - PINCTRL_PIN(14, "UART1_RTSB"), 289 - PINCTRL_PIN(15, "UART1_CTSB"), 290 - PINCTRL_PIN(16, "I2C0_SDA"), 291 - PINCTRL_PIN(17, "I2C0_SCL"), 292 - PINCTRL_PIN(18, "I2C1_SDA"), 293 - PINCTRL_PIN(19, "I2C1_SCL"), 294 - PINCTRL_PIN(20, "UART2_RXD"), 295 - PINCTRL_PIN(21, "UART2_TXD"), 296 - PINCTRL_PIN(22, "UART2_RTSB"), 297 - PINCTRL_PIN(23, "UART2_CTSB"), 298 - /* GPP_F */ 299 - PINCTRL_PIN(24, "CNV_BRI_DT"), 300 - PINCTRL_PIN(25, "CNV_BRI_RSP"), 301 - PINCTRL_PIN(26, "CNV_RGI_DT"), 302 - PINCTRL_PIN(27, "CNV_RGI_RSP"), 303 - PINCTRL_PIN(28, "CNV_RF_RESET_B"), 304 - PINCTRL_PIN(29, "GPPC_F_5"), 305 - PINCTRL_PIN(30, "CNV_PA_BLANKING"), 306 - PINCTRL_PIN(31, "GPPC_F_7"), 307 - PINCTRL_PIN(32, "I2S_MCLK2_INOUT"), 308 - PINCTRL_PIN(33, "BOOTMPC"), 309 - PINCTRL_PIN(34, "GPPC_F_10"), 310 - PINCTRL_PIN(35, "GPPC_F_11"), 311 - PINCTRL_PIN(36, "GSXDOUT"), 312 - PINCTRL_PIN(37, "GSXSLOAD"), 313 - PINCTRL_PIN(38, "GSXDIN"), 314 - PINCTRL_PIN(39, "GSXSRESETB"), 315 - PINCTRL_PIN(40, "GSXCLK"), 316 - PINCTRL_PIN(41, "GMII_MDC"), 317 - PINCTRL_PIN(42, "GMII_MDIO"), 318 - PINCTRL_PIN(43, "SRCCLKREQB_6"), 319 - PINCTRL_PIN(44, "EXT_PWR_GATEB"), 320 - PINCTRL_PIN(45, "EXT_PWR_GATE2B"), 321 - PINCTRL_PIN(46, "VNN_CTRL"), 322 - PINCTRL_PIN(47, "V1P05_CTRL"), 323 - PINCTRL_PIN(48, "GPPF_CLK_LOOPBACK"), 324 - /* HVCMOS */ 325 - PINCTRL_PIN(49, "L_BKLTEN"), 326 - PINCTRL_PIN(50, "L_BKLTCTL"), 327 - PINCTRL_PIN(51, "L_VDDEN"), 328 - PINCTRL_PIN(52, "SYS_PWROK"), 329 - PINCTRL_PIN(53, "SYS_RESETB"), 330 - PINCTRL_PIN(54, "MLK_RSTB"), 331 - /* GPP_E */ 332 - PINCTRL_PIN(55, "SATAXPCIE_0"), 333 - PINCTRL_PIN(56, "SPI1_IO_2"), 334 - PINCTRL_PIN(57, "SPI1_IO_3"), 335 - PINCTRL_PIN(58, "CPU_GP_0"), 336 - PINCTRL_PIN(59, "SATA_DEVSLP_0"), 337 - PINCTRL_PIN(60, "SATA_DEVSLP_1"), 338 - PINCTRL_PIN(61, "GPPC_E_6"), 339 - PINCTRL_PIN(62, "CPU_GP_1"), 340 - PINCTRL_PIN(63, "SPI1_CS1B"), 341 - PINCTRL_PIN(64, "USB2_OCB_0"), 342 - PINCTRL_PIN(65, "SPI1_CSB"), 343 - PINCTRL_PIN(66, "SPI1_CLK"), 344 - PINCTRL_PIN(67, "SPI1_MISO_IO_1"), 345 - PINCTRL_PIN(68, "SPI1_MOSI_IO_0"), 346 - PINCTRL_PIN(69, "DDSP_HPD_A"), 347 - PINCTRL_PIN(70, "ISH_GP_6"), 348 - PINCTRL_PIN(71, "ISH_GP_7"), 349 - PINCTRL_PIN(72, "GPPC_E_17"), 350 - PINCTRL_PIN(73, "DDP1_CTRLCLK"), 351 - PINCTRL_PIN(74, "DDP1_CTRLDATA"), 352 - PINCTRL_PIN(75, "DDP2_CTRLCLK"), 353 - PINCTRL_PIN(76, "DDP2_CTRLDATA"), 354 - PINCTRL_PIN(77, "DDPA_CTRLCLK"), 355 - PINCTRL_PIN(78, "DDPA_CTRLDATA"), 356 - PINCTRL_PIN(79, "SPI1_CLK_LOOPBK"), 357 - /* JTAG */ 358 - PINCTRL_PIN(80, "JTAG_TDO"), 359 - PINCTRL_PIN(81, "JTAGX"), 360 - PINCTRL_PIN(82, "PRDYB"), 361 - PINCTRL_PIN(83, "PREQB"), 362 - PINCTRL_PIN(84, "CPU_TRSTB"), 363 - PINCTRL_PIN(85, "JTAG_TDI"), 364 - PINCTRL_PIN(86, "JTAG_TMS"), 365 - PINCTRL_PIN(87, "JTAG_TCK"), 366 - PINCTRL_PIN(88, "DBG_PMODE"), 347 + TGL_GPP(0, 67, 74, 96), /* GPP_S */ 348 + TGL_GPP(1, 75, 98, 128), /* GPP_H */ 349 + TGL_GPP(2, 99, 119, 160), /* GPP_D */ 350 + TGL_GPP(3, 120, 143, 192), /* GPP_U */ 351 + TGL_GPP(4, 144, 170, 224), /* vGPIO */ 367 352 }; 368 353 369 354 static const struct intel_padgroup tgllp_community4_gpps[] = { 370 - TGL_GPP(0, 0, 23), /* GPP_C */ 371 - TGL_GPP(1, 24, 48), /* GPP_F */ 372 - TGL_GPP(2, 49, 54), /* HVCMOS */ 373 - TGL_GPP(3, 55, 79), /* GPP_E */ 374 - TGL_GPP(4, 80, 88), /* JTAG */ 375 - }; 376 - 377 - static const struct intel_community tgllp_community4[] = { 378 - TGL_COMMUNITY(0, 88, tgllp_community4_gpps), 379 - }; 380 - 381 - static const struct intel_pinctrl_soc_data tgllp_community4_soc_data = { 382 - .uid = "4", 383 - .pins = tgllp_community4_pins, 384 - .npins = ARRAY_SIZE(tgllp_community4_pins), 385 - .communities = tgllp_community4, 386 - .ncommunities = ARRAY_SIZE(tgllp_community4), 387 - }; 388 - 389 - static const struct pinctrl_pin_desc tgllp_community5_pins[] = { 390 - /* GPP_R */ 391 - PINCTRL_PIN(0, "HDA_BCLK"), 392 - PINCTRL_PIN(1, "HDA_SYNC"), 393 - PINCTRL_PIN(2, "HDA_SDO"), 394 - PINCTRL_PIN(3, "HDA_SDI_0"), 395 - PINCTRL_PIN(4, "HDA_RSTB"), 396 - PINCTRL_PIN(5, "HDA_SDI_1"), 397 - PINCTRL_PIN(6, "GPP_R_6"), 398 - PINCTRL_PIN(7, "GPP_R_7"), 399 - /* SPI */ 400 - PINCTRL_PIN(8, "SPI0_IO_2"), 401 - PINCTRL_PIN(9, "SPI0_IO_3"), 402 - PINCTRL_PIN(10, "SPI0_MOSI_IO_0"), 403 - PINCTRL_PIN(11, "SPI0_MISO_IO_1"), 404 - PINCTRL_PIN(12, "SPI0_TPM_CSB"), 405 - PINCTRL_PIN(13, "SPI0_FLASH_0_CSB"), 406 - PINCTRL_PIN(14, "SPI0_FLASH_1_CSB"), 407 - PINCTRL_PIN(15, "SPI0_CLK"), 408 - PINCTRL_PIN(16, "SPI0_CLK_LOOPBK"), 355 + TGL_GPP(0, 171, 194, 256), /* GPP_C */ 356 + TGL_GPP(1, 195, 219, 288), /* GPP_F */ 357 + TGL_GPP(2, 220, 225, TGL_NO_GPIO), /* HVCMOS */ 358 + TGL_GPP(3, 226, 250, 320), /* GPP_E */ 359 + TGL_GPP(4, 251, 259, TGL_NO_GPIO), /* JTAG */ 409 360 }; 410 361 411 362 static const struct intel_padgroup tgllp_community5_gpps[] = { 412 - TGL_GPP(0, 0, 7), /* GPP_R */ 413 - TGL_GPP(1, 8, 16), /* SPI */ 363 + TGL_GPP(0, 260, 267, 352), /* GPP_R */ 364 + TGL_GPP(1, 268, 276, TGL_NO_GPIO), /* SPI */ 414 365 }; 415 366 416 - static const struct intel_community tgllp_community5[] = { 417 - TGL_COMMUNITY(0, 16, tgllp_community5_gpps), 367 + static const struct intel_community tgllp_communities[] = { 368 + TGL_COMMUNITY(0, 0, 66, tgllp_community0_gpps), 369 + TGL_COMMUNITY(1, 67, 170, tgllp_community1_gpps), 370 + TGL_COMMUNITY(2, 171, 259, tgllp_community4_gpps), 371 + TGL_COMMUNITY(3, 260, 276, tgllp_community5_gpps), 418 372 }; 419 373 420 - static const struct intel_pinctrl_soc_data tgllp_community5_soc_data = { 421 - .uid = "5", 422 - .pins = tgllp_community5_pins, 423 - .npins = ARRAY_SIZE(tgllp_community5_pins), 424 - .communities = tgllp_community5, 425 - .ncommunities = ARRAY_SIZE(tgllp_community5), 426 - }; 427 - 428 - static const struct intel_pinctrl_soc_data *tgllp_soc_data_array[] = { 429 - &tgllp_community0_soc_data, 430 - &tgllp_community1_soc_data, 431 - &tgllp_community4_soc_data, 432 - &tgllp_community5_soc_data, 433 - NULL 374 + static const struct intel_pinctrl_soc_data tgllp_soc_data = { 375 + .pins = tgllp_pins, 376 + .npins = ARRAY_SIZE(tgllp_pins), 377 + .communities = tgllp_communities, 378 + .ncommunities = ARRAY_SIZE(tgllp_communities), 434 379 }; 435 380 436 381 static const struct acpi_device_id tgl_pinctrl_acpi_match[] = { 437 - { "INT34C5", (kernel_ulong_t)tgllp_soc_data_array }, 382 + { "INT34C5", (kernel_ulong_t)&tgllp_soc_data }, 438 383 { } 439 384 }; 440 385 MODULE_DEVICE_TABLE(acpi, tgl_pinctrl_acpi_match); ··· 391 438 static INTEL_PINCTRL_PM_OPS(tgl_pinctrl_pm_ops); 392 439 393 440 static struct platform_driver tgl_pinctrl_driver = { 394 - .probe = intel_pinctrl_probe_by_uid, 441 + .probe = intel_pinctrl_probe_by_hid, 395 442 .driver = { 396 443 .name = "tigerlake-pinctrl", 397 444 .acpi_match_table = tgl_pinctrl_acpi_match,
+1 -1
drivers/pinctrl/mediatek/pinctrl-mtk-mt2712.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 3 * Copyright (C) 2018 MediaTek Inc. 4 4 * Author: Zhiyong Tao <zhiyong.tao@mediatek.com>
+1 -1
drivers/pinctrl/meson/pinctrl-meson-axg-pmx.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ 1 2 /* 2 3 * Copyright (c) 2017 Baylibre SAS. 3 4 * Author: Jerome Brunet <jbrunet@baylibre.com> ··· 6 5 * Copyright (c) 2017 Amlogic, Inc. All rights reserved. 7 6 * Author: Xingyu Chen <xingyu.chen@amlogic.com> 8 7 * 9 - * SPDX-License-Identifier: (GPL-2.0+ or MIT) 10 8 */ 11 9 12 10 struct meson_pmx_bank {
+6 -1
drivers/pinctrl/meson/pinctrl-meson8b.c
··· 233 233 static const unsigned int hdmi_cec_0_pins[] = { GPIOH_3 }; 234 234 static const unsigned int eth_txd1_0_pins[] = { GPIOH_5 }; 235 235 static const unsigned int eth_txd0_0_pins[] = { GPIOH_6 }; 236 + static const unsigned int eth_rxd3_h_pins[] = { GPIOH_5 }; 237 + static const unsigned int eth_rxd2_h_pins[] = { GPIOH_6 }; 236 238 static const unsigned int clk_24m_out_pins[] = { GPIOH_9 }; 237 239 238 240 static const unsigned int spi_ss1_pins[] = { GPIOH_0 }; ··· 537 535 GROUP(spi_miso_1, 9, 12), 538 536 GROUP(spi_mosi_1, 9, 11), 539 537 GROUP(spi_sclk_1, 9, 10), 538 + GROUP(eth_rxd3_h, 6, 15), 539 + GROUP(eth_rxd2_h, 6, 14), 540 540 GROUP(eth_txd3, 6, 13), 541 541 GROUP(eth_txd2, 6, 12), 542 542 GROUP(eth_tx_clk, 6, 11), ··· 750 746 "eth_tx_clk", "eth_tx_en", "eth_txd1_0", "eth_txd1_1", 751 747 "eth_txd0_0", "eth_txd0_1", "eth_rx_clk", "eth_rx_dv", 752 748 "eth_rxd1", "eth_rxd0", "eth_mdio_en", "eth_mdc", "eth_ref_clk", 753 - "eth_txd2", "eth_txd3", "eth_rxd3", "eth_rxd2" 749 + "eth_txd2", "eth_txd3", "eth_rxd3", "eth_rxd2", 750 + "eth_rxd3_h", "eth_rxd2_h" 754 751 }; 755 752 756 753 static const char * const i2c_a_groups[] = {
+11 -5
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
··· 15 15 #include <linux/of.h> 16 16 #include <linux/of_address.h> 17 17 #include <linux/of_device.h> 18 - #include <linux/of_irq.h> 19 18 #include <linux/pinctrl/pinconf-generic.h> 20 19 #include <linux/pinctrl/pinconf.h> 21 20 #include <linux/pinctrl/pinctrl.h> ··· 732 733 ret = 0; 733 734 break; 734 735 } 735 - }; 736 + } 736 737 if (ret) { 737 738 dev_err(dev, "no gpio-controller child node\n"); 738 739 return ret; 739 740 } 740 741 741 - nr_irq_parent = of_irq_count(np); 742 + nr_irq_parent = platform_irq_count(pdev); 743 + if (nr_irq_parent < 0) { 744 + if (nr_irq_parent != -EPROBE_DEFER) 745 + dev_err(dev, "Couldn't determine irq count: %pe\n", 746 + ERR_PTR(nr_irq_parent)); 747 + return nr_irq_parent; 748 + } 749 + 742 750 spin_lock_init(&info->irq_lock); 743 751 744 752 if (!nr_irq_parent) { ··· 782 776 if (!girq->parents) 783 777 return -ENOMEM; 784 778 for (i = 0; i < nr_irq_parent; i++) { 785 - int irq = irq_of_parse_and_map(np, i); 779 + int irq = platform_get_irq(pdev, i); 786 780 787 781 if (irq < 0) 788 782 continue; ··· 806 800 ret = 0; 807 801 break; 808 802 } 809 - }; 803 + } 810 804 if (ret) 811 805 return ret; 812 806
+1 -1
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
··· 331 331 return 0; 332 332 } 333 333 334 - static struct irq_chip npcmgpio_irqchip = { 334 + static const struct irq_chip npcmgpio_irqchip = { 335 335 .name = "NPCM7XX-GPIO-IRQ", 336 336 .irq_ack = npcmgpio_irq_ack, 337 337 .irq_unmask = npcmgpio_irq_unmask,
+1 -1
drivers/pinctrl/pinctrl-artpec6.c
··· 798 798 enum pin_config_param param; 799 799 unsigned int arg; 800 800 unsigned int regval; 801 - unsigned int *reg; 801 + void __iomem *reg; 802 802 int i; 803 803 804 804 /* Check for valid pin */
+445 -198
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@zoho.com> 6 + * Copyright (c) 2019 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> 7 7 */ 8 8 9 9 #include <linux/compiler.h> ··· 42 42 #define JZ4760_GPIO_FLAG 0x50 43 43 #define JZ4760_GPIO_PEN 0x70 44 44 45 - #define X1000_GPIO_PZ_BASE 0x700 46 - #define X1000_GPIO_PZ_GID2LD 0x7f0 45 + #define X1830_GPIO_PEL 0x110 46 + #define X1830_GPIO_PEH 0x120 47 47 48 48 #define REG_SET(x) ((x) + 0x4) 49 49 #define REG_CLEAR(x) ((x) + 0x8) 50 + 51 + #define REG_PZ_BASE(x) ((x) * 7) 52 + #define REG_PZ_GID2LD(x) ((x) * 7 + 0xf0) 53 + 54 + #define GPIO_PULL_DIS 0 55 + #define GPIO_PULL_UP 1 56 + #define GPIO_PULL_DOWN 2 50 57 51 58 #define PINS_PER_GPIO_CHIP 32 52 59 ··· 61 54 ID_JZ4740, 62 55 ID_JZ4725B, 63 56 ID_JZ4760, 64 - ID_JZ4760B, 65 57 ID_JZ4770, 66 58 ID_JZ4780, 67 59 ID_X1000, 68 - ID_X1000E, 69 60 ID_X1500, 61 + ID_X1830, 70 62 }; 71 63 72 64 struct ingenic_chip_info { 73 65 unsigned int num_chips; 66 + unsigned int reg_offset; 67 + enum jz_version version; 74 68 75 69 const struct group_desc *groups; 76 70 unsigned int num_groups; ··· 87 79 struct regmap *map; 88 80 struct pinctrl_dev *pctl; 89 81 struct pinctrl_pin_desc *pdesc; 90 - enum jz_version version; 91 82 92 83 const struct ingenic_chip_info *info; 93 84 }; ··· 223 216 224 217 static const struct ingenic_chip_info jz4740_chip_info = { 225 218 .num_chips = 4, 219 + .reg_offset = 0x100, 220 + .version = ID_JZ4740, 226 221 .groups = jz4740_groups, 227 222 .num_groups = ARRAY_SIZE(jz4740_groups), 228 223 .functions = jz4740_functions, ··· 348 339 349 340 static const struct ingenic_chip_info jz4725b_chip_info = { 350 341 .num_chips = 4, 342 + .reg_offset = 0x100, 343 + .version = ID_JZ4725B, 351 344 .groups = jz4725b_groups, 352 345 .num_groups = ARRAY_SIZE(jz4725b_groups), 353 346 .functions = jz4725b_functions, ··· 603 592 604 593 static const struct ingenic_chip_info jz4760_chip_info = { 605 594 .num_chips = 6, 606 - .groups = jz4760_groups, 607 - .num_groups = ARRAY_SIZE(jz4760_groups), 608 - .functions = jz4760_functions, 609 - .num_functions = ARRAY_SIZE(jz4760_functions), 610 - .pull_ups = jz4760_pull_ups, 611 - .pull_downs = jz4760_pull_downs, 612 - }; 613 - 614 - static const struct ingenic_chip_info jz4760b_chip_info = { 615 - .num_chips = 6, 595 + .reg_offset = 0x100, 596 + .version = ID_JZ4760, 616 597 .groups = jz4760_groups, 617 598 .num_groups = ARRAY_SIZE(jz4760_groups), 618 599 .functions = jz4760_functions, ··· 883 880 884 881 static const struct ingenic_chip_info jz4770_chip_info = { 885 882 .num_chips = 6, 883 + .reg_offset = 0x100, 884 + .version = ID_JZ4770, 886 885 .groups = jz4770_groups, 887 886 .num_groups = ARRAY_SIZE(jz4770_groups), 888 887 .functions = jz4770_functions, ··· 1018 1013 1019 1014 static const struct ingenic_chip_info jz4780_chip_info = { 1020 1015 .num_chips = 6, 1016 + .reg_offset = 0x100, 1017 + .version = ID_JZ4780, 1021 1018 .groups = jz4780_groups, 1022 1019 .num_groups = ARRAY_SIZE(jz4780_groups), 1023 1020 .functions = jz4780_functions, ··· 1029 1022 }; 1030 1023 1031 1024 static const u32 x1000_pull_ups[4] = { 1032 - 0xffffffff, 0x8dffffff, 0x7d3fffff, 0xffffffff, 1025 + 0xffffffff, 0xfdffffff, 0x0dffffff, 0x0000003f, 1033 1026 }; 1034 1027 1035 1028 static const u32 x1000_pull_downs[4] = { ··· 1040 1033 static int x1000_uart0_hwflow_pins[] = { 0x4c, 0x4d, }; 1041 1034 static int x1000_uart1_data_a_pins[] = { 0x04, 0x05, }; 1042 1035 static int x1000_uart1_data_d_pins[] = { 0x62, 0x63, }; 1043 - static int x1000_uart1_hwflow_d_pins[] = { 0x64, 0x65, }; 1036 + static int x1000_uart1_hwflow_pins[] = { 0x64, 0x65, }; 1044 1037 static int x1000_uart2_data_a_pins[] = { 0x02, 0x03, }; 1045 1038 static int x1000_uart2_data_d_pins[] = { 0x65, 0x64, }; 1039 + static int x1000_sfc_pins[] = { 0x1d, 0x1c, 0x1e, 0x1f, 0x1a, 0x1b, }; 1040 + static int x1000_ssi_dt_a_22_pins[] = { 0x16, }; 1041 + static int x1000_ssi_dt_a_29_pins[] = { 0x1d, }; 1042 + static int x1000_ssi_dt_d_pins[] = { 0x62, }; 1043 + static int x1000_ssi_dr_a_23_pins[] = { 0x17, }; 1044 + static int x1000_ssi_dr_a_28_pins[] = { 0x1c, }; 1045 + static int x1000_ssi_dr_d_pins[] = { 0x63, }; 1046 + static int x1000_ssi_clk_a_24_pins[] = { 0x18, }; 1047 + static int x1000_ssi_clk_a_26_pins[] = { 0x1a, }; 1048 + static int x1000_ssi_clk_d_pins[] = { 0x60, }; 1049 + static int x1000_ssi_gpc_a_20_pins[] = { 0x14, }; 1050 + static int x1000_ssi_gpc_a_31_pins[] = { 0x1f, }; 1051 + static int x1000_ssi_ce0_a_25_pins[] = { 0x19, }; 1052 + static int x1000_ssi_ce0_a_27_pins[] = { 0x1b, }; 1053 + static int x1000_ssi_ce0_d_pins[] = { 0x61, }; 1054 + static int x1000_ssi_ce1_a_21_pins[] = { 0x15, }; 1055 + static int x1000_ssi_ce1_a_30_pins[] = { 0x1e, }; 1046 1056 static int x1000_mmc0_1bit_pins[] = { 0x18, 0x19, 0x17, }; 1047 1057 static int x1000_mmc0_4bit_pins[] = { 0x16, 0x15, 0x14, }; 1048 1058 static int x1000_mmc0_8bit_pins[] = { 0x13, 0x12, 0x11, 0x10, }; 1049 1059 static int x1000_mmc1_1bit_pins[] = { 0x40, 0x41, 0x42, }; 1050 1060 static int x1000_mmc1_4bit_pins[] = { 0x43, 0x44, 0x45, }; 1051 - static int x1000_nemc_8bit_data_pins[] = { 1061 + static int x1000_emc_8bit_data_pins[] = { 1052 1062 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1053 1063 }; 1054 - static int x1000_nemc_16bit_data_pins[] = { 1064 + static int x1000_emc_16bit_data_pins[] = { 1055 1065 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 1056 1066 }; 1057 - static int x1000_nemc_addr_pins[] = { 1067 + static int x1000_emc_addr_pins[] = { 1058 1068 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 1059 1069 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 1060 1070 }; 1061 - static int x1000_nemc_rd_we_pins[] = { 0x30, 0x31, }; 1062 - static int x1000_nemc_wait_pins[] = { 0x34, }; 1063 - static int x1000_nemc_cs1_pins[] = { 0x32, }; 1064 - static int x1000_nemc_cs2_pins[] = { 0x33, }; 1071 + static int x1000_emc_rd_we_pins[] = { 0x30, 0x31, }; 1072 + static int x1000_emc_wait_pins[] = { 0x34, }; 1073 + static int x1000_emc_cs1_pins[] = { 0x32, }; 1074 + static int x1000_emc_cs2_pins[] = { 0x33, }; 1065 1075 static int x1000_i2c0_pins[] = { 0x38, 0x37, }; 1066 1076 static int x1000_i2c1_a_pins[] = { 0x01, 0x00, }; 1067 1077 static int x1000_i2c1_c_pins[] = { 0x5b, 0x5a, }; ··· 1107 1083 static int x1000_uart0_hwflow_funcs[] = { 0, 0, }; 1108 1084 static int x1000_uart1_data_a_funcs[] = { 2, 2, }; 1109 1085 static int x1000_uart1_data_d_funcs[] = { 1, 1, }; 1110 - static int x1000_uart1_hwflow_d_funcs[] = { 1, 1, }; 1086 + static int x1000_uart1_hwflow_funcs[] = { 1, 1, }; 1111 1087 static int x1000_uart2_data_a_funcs[] = { 2, 2, }; 1112 1088 static int x1000_uart2_data_d_funcs[] = { 0, 0, }; 1089 + static int x1000_sfc_funcs[] = { 1, 1, 1, 1, 1, 1, }; 1090 + static int x1000_ssi_dt_a_22_funcs[] = { 2, }; 1091 + static int x1000_ssi_dt_a_29_funcs[] = { 2, }; 1092 + static int x1000_ssi_dt_d_funcs[] = { 0, }; 1093 + static int x1000_ssi_dr_a_23_funcs[] = { 2, }; 1094 + static int x1000_ssi_dr_a_28_funcs[] = { 2, }; 1095 + static int x1000_ssi_dr_d_funcs[] = { 0, }; 1096 + static int x1000_ssi_clk_a_24_funcs[] = { 2, }; 1097 + static int x1000_ssi_clk_a_26_funcs[] = { 2, }; 1098 + static int x1000_ssi_clk_d_funcs[] = { 0, }; 1099 + static int x1000_ssi_gpc_a_20_funcs[] = { 2, }; 1100 + static int x1000_ssi_gpc_a_31_funcs[] = { 2, }; 1101 + static int x1000_ssi_ce0_a_25_funcs[] = { 2, }; 1102 + static int x1000_ssi_ce0_a_27_funcs[] = { 2, }; 1103 + static int x1000_ssi_ce0_d_funcs[] = { 0, }; 1104 + static int x1000_ssi_ce1_a_21_funcs[] = { 2, }; 1105 + static int x1000_ssi_ce1_a_30_funcs[] = { 2, }; 1113 1106 static int x1000_mmc0_1bit_funcs[] = { 1, 1, 1, }; 1114 1107 static int x1000_mmc0_4bit_funcs[] = { 1, 1, 1, }; 1115 1108 static int x1000_mmc0_8bit_funcs[] = { 1, 1, 1, 1, 1, }; 1116 1109 static int x1000_mmc1_1bit_funcs[] = { 0, 0, 0, }; 1117 1110 static int x1000_mmc1_4bit_funcs[] = { 0, 0, 0, }; 1118 - static int x1000_nemc_8bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; 1119 - static int x1000_nemc_16bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; 1120 - static int x1000_nemc_addr_funcs[] = { 1111 + static int x1000_emc_8bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; 1112 + static int x1000_emc_16bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; 1113 + static int x1000_emc_addr_funcs[] = { 1121 1114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1122 1115 }; 1123 - static int x1000_nemc_rd_we_funcs[] = { 0, 0, }; 1124 - static int x1000_nemc_wait_funcs[] = { 0, }; 1125 - static int x1000_nemc_cs1_funcs[] = { 0, }; 1126 - static int x1000_nemc_cs2_funcs[] = { 0, }; 1116 + static int x1000_emc_rd_we_funcs[] = { 0, 0, }; 1117 + static int x1000_emc_wait_funcs[] = { 0, }; 1118 + static int x1000_emc_cs1_funcs[] = { 0, }; 1119 + static int x1000_emc_cs2_funcs[] = { 0, }; 1127 1120 static int x1000_i2c0_funcs[] = { 0, 0, }; 1128 1121 static int x1000_i2c1_a_funcs[] = { 2, 2, }; 1129 1122 static int x1000_i2c1_c_funcs[] = { 0, 0, }; ··· 1162 1121 INGENIC_PIN_GROUP("uart0-hwflow", x1000_uart0_hwflow), 1163 1122 INGENIC_PIN_GROUP("uart1-data-a", x1000_uart1_data_a), 1164 1123 INGENIC_PIN_GROUP("uart1-data-d", x1000_uart1_data_d), 1165 - INGENIC_PIN_GROUP("uart1-hwflow-d", x1000_uart1_hwflow_d), 1124 + INGENIC_PIN_GROUP("uart1-hwflow", x1000_uart1_hwflow), 1166 1125 INGENIC_PIN_GROUP("uart2-data-a", x1000_uart2_data_a), 1167 1126 INGENIC_PIN_GROUP("uart2-data-d", x1000_uart2_data_d), 1127 + INGENIC_PIN_GROUP("sfc", x1000_sfc), 1128 + INGENIC_PIN_GROUP("ssi-dt-a-22", x1000_ssi_dt_a_22), 1129 + INGENIC_PIN_GROUP("ssi-dt-a-29", x1000_ssi_dt_a_29), 1130 + INGENIC_PIN_GROUP("ssi-dt-d", x1000_ssi_dt_d), 1131 + INGENIC_PIN_GROUP("ssi-dr-a-23", x1000_ssi_dr_a_23), 1132 + INGENIC_PIN_GROUP("ssi-dr-a-28", x1000_ssi_dr_a_28), 1133 + INGENIC_PIN_GROUP("ssi-dr-d", x1000_ssi_dr_d), 1134 + INGENIC_PIN_GROUP("ssi-clk-a-24", x1000_ssi_clk_a_24), 1135 + INGENIC_PIN_GROUP("ssi-clk-a-26", x1000_ssi_clk_a_26), 1136 + INGENIC_PIN_GROUP("ssi-clk-d", x1000_ssi_clk_d), 1137 + INGENIC_PIN_GROUP("ssi-gpc-a-20", x1000_ssi_gpc_a_20), 1138 + INGENIC_PIN_GROUP("ssi-gpc-a-31", x1000_ssi_gpc_a_31), 1139 + INGENIC_PIN_GROUP("ssi-ce0-a-25", x1000_ssi_ce0_a_25), 1140 + INGENIC_PIN_GROUP("ssi-ce0-a-27", x1000_ssi_ce0_a_27), 1141 + INGENIC_PIN_GROUP("ssi-ce0-d", x1000_ssi_ce0_d), 1142 + INGENIC_PIN_GROUP("ssi-ce1-a-21", x1000_ssi_ce1_a_21), 1143 + INGENIC_PIN_GROUP("ssi-ce1-a-30", x1000_ssi_ce1_a_30), 1168 1144 INGENIC_PIN_GROUP("mmc0-1bit", x1000_mmc0_1bit), 1169 1145 INGENIC_PIN_GROUP("mmc0-4bit", x1000_mmc0_4bit), 1170 1146 INGENIC_PIN_GROUP("mmc0-8bit", x1000_mmc0_8bit), 1171 1147 INGENIC_PIN_GROUP("mmc1-1bit", x1000_mmc1_1bit), 1172 1148 INGENIC_PIN_GROUP("mmc1-4bit", x1000_mmc1_4bit), 1173 - INGENIC_PIN_GROUP("nemc-8bit-data", x1000_nemc_8bit_data), 1174 - INGENIC_PIN_GROUP("nemc-16bit-data", x1000_nemc_16bit_data), 1175 - INGENIC_PIN_GROUP("nemc-addr", x1000_nemc_addr), 1176 - INGENIC_PIN_GROUP("nemc-rd-we", x1000_nemc_rd_we), 1177 - INGENIC_PIN_GROUP("nemc-wait", x1000_nemc_wait), 1178 - INGENIC_PIN_GROUP("nemc-cs1", x1000_nemc_cs1), 1179 - INGENIC_PIN_GROUP("nemc-cs2", x1000_nemc_cs2), 1149 + INGENIC_PIN_GROUP("emc-8bit-data", x1000_emc_8bit_data), 1150 + INGENIC_PIN_GROUP("emc-16bit-data", x1000_emc_16bit_data), 1151 + INGENIC_PIN_GROUP("emc-addr", x1000_emc_addr), 1152 + INGENIC_PIN_GROUP("emc-rd-we", x1000_emc_rd_we), 1153 + INGENIC_PIN_GROUP("emc-wait", x1000_emc_wait), 1154 + INGENIC_PIN_GROUP("emc-cs1", x1000_emc_cs1), 1155 + INGENIC_PIN_GROUP("emc-cs2", x1000_emc_cs2), 1180 1156 INGENIC_PIN_GROUP("i2c0-data", x1000_i2c0), 1181 1157 INGENIC_PIN_GROUP("i2c1-data-a", x1000_i2c1_a), 1182 1158 INGENIC_PIN_GROUP("i2c1-data-c", x1000_i2c1_c), ··· 1212 1154 1213 1155 static const char *x1000_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 1214 1156 static const char *x1000_uart1_groups[] = { 1215 - "uart1-data-a", "uart1-data-d", "uart1-hwflow-d", 1157 + "uart1-data-a", "uart1-data-d", "uart1-hwflow", 1216 1158 }; 1217 1159 static const char *x1000_uart2_groups[] = { "uart2-data-a", "uart2-data-d", }; 1160 + static const char *x1000_sfc_groups[] = { "sfc", }; 1161 + static const char *x1000_ssi_groups[] = { 1162 + "ssi-dt-a-22", "ssi-dt-a-29", "ssi-dt-d", 1163 + "ssi-dr-a-23", "ssi-dr-a-28", "ssi-dr-d", 1164 + "ssi-clk-a-24", "ssi-clk-a-26", "ssi-clk-d", 1165 + "ssi-gpc-a-20", "ssi-gpc-a-31", 1166 + "ssi-ce0-a-25", "ssi-ce0-a-27", "ssi-ce0-d", 1167 + "ssi-ce1-a-21", "ssi-ce1-a-30", 1168 + }; 1218 1169 static const char *x1000_mmc0_groups[] = { 1219 1170 "mmc0-1bit", "mmc0-4bit", "mmc0-8bit", 1220 1171 }; 1221 1172 static const char *x1000_mmc1_groups[] = { 1222 - "mmc1-1bit-e", "mmc1-4bit-e", 1173 + "mmc1-1bit", "mmc1-4bit", 1223 1174 }; 1224 - static const char *x1000_nemc_groups[] = { 1225 - "nemc-8bit-data", "nemc-16bit-data", 1226 - "nemc-addr", "nemc-rd-we", "nemc-wait", 1175 + static const char *x1000_emc_groups[] = { 1176 + "emc-8bit-data", "emc-16bit-data", 1177 + "emc-addr", "emc-rd-we", "emc-wait", 1227 1178 }; 1228 - static const char *x1000_cs1_groups[] = { "nemc-cs1", }; 1229 - static const char *x1000_cs2_groups[] = { "nemc-cs2", }; 1179 + static const char *x1000_cs1_groups[] = { "emc-cs1", }; 1180 + static const char *x1000_cs2_groups[] = { "emc-cs2", }; 1230 1181 static const char *x1000_i2c0_groups[] = { "i2c0-data", }; 1231 1182 static const char *x1000_i2c1_groups[] = { "i2c1-data-a", "i2c1-data-c", }; 1232 1183 static const char *x1000_i2c2_groups[] = { "i2c2-data", }; ··· 1254 1187 { "uart0", x1000_uart0_groups, ARRAY_SIZE(x1000_uart0_groups), }, 1255 1188 { "uart1", x1000_uart1_groups, ARRAY_SIZE(x1000_uart1_groups), }, 1256 1189 { "uart2", x1000_uart2_groups, ARRAY_SIZE(x1000_uart2_groups), }, 1190 + { "sfc", x1000_sfc_groups, ARRAY_SIZE(x1000_sfc_groups), }, 1191 + { "ssi", x1000_ssi_groups, ARRAY_SIZE(x1000_ssi_groups), }, 1257 1192 { "mmc0", x1000_mmc0_groups, ARRAY_SIZE(x1000_mmc0_groups), }, 1258 1193 { "mmc1", x1000_mmc1_groups, ARRAY_SIZE(x1000_mmc1_groups), }, 1259 - { "nemc", x1000_nemc_groups, ARRAY_SIZE(x1000_nemc_groups), }, 1260 - { "nemc-cs1", x1000_cs1_groups, ARRAY_SIZE(x1000_cs1_groups), }, 1261 - { "nemc-cs2", x1000_cs2_groups, ARRAY_SIZE(x1000_cs2_groups), }, 1194 + { "emc", x1000_emc_groups, ARRAY_SIZE(x1000_emc_groups), }, 1195 + { "emc-cs1", x1000_cs1_groups, ARRAY_SIZE(x1000_cs1_groups), }, 1196 + { "emc-cs2", x1000_cs2_groups, ARRAY_SIZE(x1000_cs2_groups), }, 1262 1197 { "i2c0", x1000_i2c0_groups, ARRAY_SIZE(x1000_i2c0_groups), }, 1263 1198 { "i2c1", x1000_i2c1_groups, ARRAY_SIZE(x1000_i2c1_groups), }, 1264 1199 { "i2c2", x1000_i2c2_groups, ARRAY_SIZE(x1000_i2c2_groups), }, ··· 1276 1207 1277 1208 static const struct ingenic_chip_info x1000_chip_info = { 1278 1209 .num_chips = 4, 1279 - .groups = x1000_groups, 1280 - .num_groups = ARRAY_SIZE(x1000_groups), 1281 - .functions = x1000_functions, 1282 - .num_functions = ARRAY_SIZE(x1000_functions), 1283 - .pull_ups = x1000_pull_ups, 1284 - .pull_downs = x1000_pull_downs, 1285 - }; 1286 - 1287 - static const struct ingenic_chip_info x1000e_chip_info = { 1288 - .num_chips = 4, 1210 + .reg_offset = 0x100, 1211 + .version = ID_X1000, 1289 1212 .groups = x1000_groups, 1290 1213 .num_groups = ARRAY_SIZE(x1000_groups), 1291 1214 .functions = x1000_functions, ··· 1290 1229 static int x1500_uart0_hwflow_pins[] = { 0x4c, 0x4d, }; 1291 1230 static int x1500_uart1_data_a_pins[] = { 0x04, 0x05, }; 1292 1231 static int x1500_uart1_data_d_pins[] = { 0x62, 0x63, }; 1293 - static int x1500_uart1_hwflow_d_pins[] = { 0x64, 0x65, }; 1232 + static int x1500_uart1_hwflow_pins[] = { 0x64, 0x65, }; 1294 1233 static int x1500_uart2_data_a_pins[] = { 0x02, 0x03, }; 1295 1234 static int x1500_uart2_data_d_pins[] = { 0x65, 0x64, }; 1296 - static int x1500_mmc0_1bit_pins[] = { 0x18, 0x19, 0x17, }; 1297 - static int x1500_mmc0_4bit_pins[] = { 0x16, 0x15, 0x14, }; 1235 + static int x1500_mmc_1bit_pins[] = { 0x18, 0x19, 0x17, }; 1236 + static int x1500_mmc_4bit_pins[] = { 0x16, 0x15, 0x14, }; 1298 1237 static int x1500_i2c0_pins[] = { 0x38, 0x37, }; 1299 1238 static int x1500_i2c1_a_pins[] = { 0x01, 0x00, }; 1300 1239 static int x1500_i2c1_c_pins[] = { 0x5b, 0x5a, }; ··· 1313 1252 static int x1500_uart0_hwflow_funcs[] = { 0, 0, }; 1314 1253 static int x1500_uart1_data_a_funcs[] = { 2, 2, }; 1315 1254 static int x1500_uart1_data_d_funcs[] = { 1, 1, }; 1316 - static int x1500_uart1_hwflow_d_funcs[] = { 1, 1, }; 1255 + static int x1500_uart1_hwflow_funcs[] = { 1, 1, }; 1317 1256 static int x1500_uart2_data_a_funcs[] = { 2, 2, }; 1318 1257 static int x1500_uart2_data_d_funcs[] = { 0, 0, }; 1319 - static int x1500_mmc0_1bit_funcs[] = { 1, 1, 1, }; 1320 - static int x1500_mmc0_4bit_funcs[] = { 1, 1, 1, }; 1258 + static int x1500_mmc_1bit_funcs[] = { 1, 1, 1, }; 1259 + static int x1500_mmc_4bit_funcs[] = { 1, 1, 1, }; 1321 1260 static int x1500_i2c0_funcs[] = { 0, 0, }; 1322 1261 static int x1500_i2c1_a_funcs[] = { 2, 2, }; 1323 1262 static int x1500_i2c1_c_funcs[] = { 0, 0, }; ··· 1334 1273 INGENIC_PIN_GROUP("uart0-hwflow", x1500_uart0_hwflow), 1335 1274 INGENIC_PIN_GROUP("uart1-data-a", x1500_uart1_data_a), 1336 1275 INGENIC_PIN_GROUP("uart1-data-d", x1500_uart1_data_d), 1337 - INGENIC_PIN_GROUP("uart1-hwflow-d", x1500_uart1_hwflow_d), 1276 + INGENIC_PIN_GROUP("uart1-hwflow", x1500_uart1_hwflow), 1338 1277 INGENIC_PIN_GROUP("uart2-data-a", x1500_uart2_data_a), 1339 1278 INGENIC_PIN_GROUP("uart2-data-d", x1500_uart2_data_d), 1340 - INGENIC_PIN_GROUP("mmc0-1bit", x1500_mmc0_1bit), 1341 - INGENIC_PIN_GROUP("mmc0-4bit", x1500_mmc0_4bit), 1279 + INGENIC_PIN_GROUP("sfc", x1000_sfc), 1280 + INGENIC_PIN_GROUP("mmc-1bit", x1500_mmc_1bit), 1281 + INGENIC_PIN_GROUP("mmc-4bit", x1500_mmc_4bit), 1342 1282 INGENIC_PIN_GROUP("i2c0-data", x1500_i2c0), 1343 1283 INGENIC_PIN_GROUP("i2c1-data-a", x1500_i2c1_a), 1344 1284 INGENIC_PIN_GROUP("i2c1-data-c", x1500_i2c1_c), ··· 1355 1293 1356 1294 static const char *x1500_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 1357 1295 static const char *x1500_uart1_groups[] = { 1358 - "uart1-data-a", "uart1-data-d", "uart1-hwflow-d", 1296 + "uart1-data-a", "uart1-data-d", "uart1-hwflow", 1359 1297 }; 1360 1298 static const char *x1500_uart2_groups[] = { "uart2-data-a", "uart2-data-d", }; 1361 - static const char *x1500_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", }; 1299 + static const char *x1500_mmc_groups[] = { "mmc-1bit", "mmc-4bit", }; 1362 1300 static const char *x1500_i2c0_groups[] = { "i2c0-data", }; 1363 1301 static const char *x1500_i2c1_groups[] = { "i2c1-data-a", "i2c1-data-c", }; 1364 1302 static const char *x1500_i2c2_groups[] = { "i2c2-data", }; ··· 1374 1312 { "uart0", x1500_uart0_groups, ARRAY_SIZE(x1500_uart0_groups), }, 1375 1313 { "uart1", x1500_uart1_groups, ARRAY_SIZE(x1500_uart1_groups), }, 1376 1314 { "uart2", x1500_uart2_groups, ARRAY_SIZE(x1500_uart2_groups), }, 1377 - { "mmc0", x1500_mmc0_groups, ARRAY_SIZE(x1500_mmc0_groups), }, 1315 + { "sfc", x1000_sfc_groups, ARRAY_SIZE(x1000_sfc_groups), }, 1316 + { "mmc", x1500_mmc_groups, ARRAY_SIZE(x1500_mmc_groups), }, 1378 1317 { "i2c0", x1500_i2c0_groups, ARRAY_SIZE(x1500_i2c0_groups), }, 1379 1318 { "i2c1", x1500_i2c1_groups, ARRAY_SIZE(x1500_i2c1_groups), }, 1380 1319 { "i2c2", x1500_i2c2_groups, ARRAY_SIZE(x1500_i2c2_groups), }, ··· 1390 1327 1391 1328 static const struct ingenic_chip_info x1500_chip_info = { 1392 1329 .num_chips = 4, 1330 + .reg_offset = 0x100, 1331 + .version = ID_X1500, 1393 1332 .groups = x1500_groups, 1394 1333 .num_groups = ARRAY_SIZE(x1500_groups), 1395 1334 .functions = x1500_functions, 1396 1335 .num_functions = ARRAY_SIZE(x1500_functions), 1397 1336 .pull_ups = x1000_pull_ups, 1398 1337 .pull_downs = x1000_pull_downs, 1338 + }; 1339 + 1340 + static const u32 x1830_pull_ups[4] = { 1341 + 0x5fdfffc0, 0xffffefff, 0x1ffffbff, 0x0fcff3fc, 1342 + }; 1343 + 1344 + static const u32 x1830_pull_downs[4] = { 1345 + 0x5fdfffc0, 0xffffefff, 0x1ffffbff, 0x0fcff3fc, 1346 + }; 1347 + 1348 + static int x1830_uart0_data_pins[] = { 0x33, 0x36, }; 1349 + static int x1830_uart0_hwflow_pins[] = { 0x34, 0x35, }; 1350 + static int x1830_uart1_data_pins[] = { 0x38, 0x37, }; 1351 + static int x1830_sfc_pins[] = { 0x17, 0x18, 0x1a, 0x19, 0x1b, 0x1c, }; 1352 + static int x1830_ssi0_dt_pins[] = { 0x4c, }; 1353 + static int x1830_ssi0_dr_pins[] = { 0x4b, }; 1354 + static int x1830_ssi0_clk_pins[] = { 0x4f, }; 1355 + static int x1830_ssi0_gpc_pins[] = { 0x4d, }; 1356 + static int x1830_ssi0_ce0_pins[] = { 0x50, }; 1357 + static int x1830_ssi0_ce1_pins[] = { 0x4e, }; 1358 + static int x1830_ssi1_dt_c_pins[] = { 0x53, }; 1359 + static int x1830_ssi1_dr_c_pins[] = { 0x54, }; 1360 + static int x1830_ssi1_clk_c_pins[] = { 0x57, }; 1361 + static int x1830_ssi1_gpc_c_pins[] = { 0x55, }; 1362 + static int x1830_ssi1_ce0_c_pins[] = { 0x58, }; 1363 + static int x1830_ssi1_ce1_c_pins[] = { 0x56, }; 1364 + static int x1830_ssi1_dt_d_pins[] = { 0x62, }; 1365 + static int x1830_ssi1_dr_d_pins[] = { 0x63, }; 1366 + static int x1830_ssi1_clk_d_pins[] = { 0x66, }; 1367 + static int x1830_ssi1_gpc_d_pins[] = { 0x64, }; 1368 + static int x1830_ssi1_ce0_d_pins[] = { 0x67, }; 1369 + static int x1830_ssi1_ce1_d_pins[] = { 0x65, }; 1370 + static int x1830_mmc0_1bit_pins[] = { 0x24, 0x25, 0x20, }; 1371 + static int x1830_mmc0_4bit_pins[] = { 0x21, 0x22, 0x23, }; 1372 + static int x1830_mmc1_1bit_pins[] = { 0x42, 0x43, 0x44, }; 1373 + static int x1830_mmc1_4bit_pins[] = { 0x45, 0x46, 0x47, }; 1374 + static int x1830_i2c0_pins[] = { 0x0c, 0x0d, }; 1375 + static int x1830_i2c1_pins[] = { 0x39, 0x3a, }; 1376 + static int x1830_i2c2_pins[] = { 0x5b, 0x5c, }; 1377 + static int x1830_pwm_pwm0_b_pins[] = { 0x31, }; 1378 + static int x1830_pwm_pwm0_c_pins[] = { 0x4b, }; 1379 + static int x1830_pwm_pwm1_b_pins[] = { 0x32, }; 1380 + static int x1830_pwm_pwm1_c_pins[] = { 0x4c, }; 1381 + static int x1830_pwm_pwm2_c_8_pins[] = { 0x48, }; 1382 + static int x1830_pwm_pwm2_c_13_pins[] = { 0x4d, }; 1383 + static int x1830_pwm_pwm3_c_9_pins[] = { 0x49, }; 1384 + static int x1830_pwm_pwm3_c_14_pins[] = { 0x4e, }; 1385 + static int x1830_pwm_pwm4_c_15_pins[] = { 0x4f, }; 1386 + static int x1830_pwm_pwm4_c_25_pins[] = { 0x59, }; 1387 + static int x1830_pwm_pwm5_c_16_pins[] = { 0x50, }; 1388 + static int x1830_pwm_pwm5_c_26_pins[] = { 0x5a, }; 1389 + static int x1830_pwm_pwm6_c_17_pins[] = { 0x51, }; 1390 + static int x1830_pwm_pwm6_c_27_pins[] = { 0x5b, }; 1391 + static int x1830_pwm_pwm7_c_18_pins[] = { 0x52, }; 1392 + static int x1830_pwm_pwm7_c_28_pins[] = { 0x5c, }; 1393 + static int x1830_mac_pins[] = { 1394 + 0x29, 0x30, 0x2f, 0x28, 0x2e, 0x2d, 0x2a, 0x2b, 0x26, 0x27, 1395 + }; 1396 + 1397 + static int x1830_uart0_data_funcs[] = { 0, 0, }; 1398 + static int x1830_uart0_hwflow_funcs[] = { 0, 0, }; 1399 + static int x1830_uart1_data_funcs[] = { 0, 0, }; 1400 + static int x1830_sfc_funcs[] = { 1, 1, 1, 1, 1, 1, }; 1401 + static int x1830_ssi0_dt_funcs[] = { 0, }; 1402 + static int x1830_ssi0_dr_funcs[] = { 0, }; 1403 + static int x1830_ssi0_clk_funcs[] = { 0, }; 1404 + static int x1830_ssi0_gpc_funcs[] = { 0, }; 1405 + static int x1830_ssi0_ce0_funcs[] = { 0, }; 1406 + static int x1830_ssi0_ce1_funcs[] = { 0, }; 1407 + static int x1830_ssi1_dt_c_funcs[] = { 1, }; 1408 + static int x1830_ssi1_dr_c_funcs[] = { 1, }; 1409 + static int x1830_ssi1_clk_c_funcs[] = { 1, }; 1410 + static int x1830_ssi1_gpc_c_funcs[] = { 1, }; 1411 + static int x1830_ssi1_ce0_c_funcs[] = { 1, }; 1412 + static int x1830_ssi1_ce1_c_funcs[] = { 1, }; 1413 + static int x1830_ssi1_dt_d_funcs[] = { 2, }; 1414 + static int x1830_ssi1_dr_d_funcs[] = { 2, }; 1415 + static int x1830_ssi1_clk_d_funcs[] = { 2, }; 1416 + static int x1830_ssi1_gpc_d_funcs[] = { 2, }; 1417 + static int x1830_ssi1_ce0_d_funcs[] = { 2, }; 1418 + static int x1830_ssi1_ce1_d_funcs[] = { 2, }; 1419 + static int x1830_mmc0_1bit_funcs[] = { 0, 0, 0, }; 1420 + static int x1830_mmc0_4bit_funcs[] = { 0, 0, 0, }; 1421 + static int x1830_mmc1_1bit_funcs[] = { 0, 0, 0, }; 1422 + static int x1830_mmc1_4bit_funcs[] = { 0, 0, 0, }; 1423 + static int x1830_i2c0_funcs[] = { 1, 1, }; 1424 + static int x1830_i2c1_funcs[] = { 0, 0, }; 1425 + static int x1830_i2c2_funcs[] = { 1, 1, }; 1426 + static int x1830_pwm_pwm0_b_funcs[] = { 0, }; 1427 + static int x1830_pwm_pwm0_c_funcs[] = { 1, }; 1428 + static int x1830_pwm_pwm1_b_funcs[] = { 0, }; 1429 + static int x1830_pwm_pwm1_c_funcs[] = { 1, }; 1430 + static int x1830_pwm_pwm2_c_8_funcs[] = { 0, }; 1431 + static int x1830_pwm_pwm2_c_13_funcs[] = { 1, }; 1432 + static int x1830_pwm_pwm3_c_9_funcs[] = { 0, }; 1433 + static int x1830_pwm_pwm3_c_14_funcs[] = { 1, }; 1434 + static int x1830_pwm_pwm4_c_15_funcs[] = { 1, }; 1435 + static int x1830_pwm_pwm4_c_25_funcs[] = { 0, }; 1436 + static int x1830_pwm_pwm5_c_16_funcs[] = { 1, }; 1437 + static int x1830_pwm_pwm5_c_26_funcs[] = { 0, }; 1438 + static int x1830_pwm_pwm6_c_17_funcs[] = { 1, }; 1439 + static int x1830_pwm_pwm6_c_27_funcs[] = { 0, }; 1440 + static int x1830_pwm_pwm7_c_18_funcs[] = { 1, }; 1441 + static int x1830_pwm_pwm7_c_28_funcs[] = { 0, }; 1442 + static int x1830_mac_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; 1443 + 1444 + static const struct group_desc x1830_groups[] = { 1445 + INGENIC_PIN_GROUP("uart0-data", x1830_uart0_data), 1446 + INGENIC_PIN_GROUP("uart0-hwflow", x1830_uart0_hwflow), 1447 + INGENIC_PIN_GROUP("uart1-data", x1830_uart1_data), 1448 + INGENIC_PIN_GROUP("sfc", x1830_sfc), 1449 + INGENIC_PIN_GROUP("ssi0-dt", x1830_ssi0_dt), 1450 + INGENIC_PIN_GROUP("ssi0-dr", x1830_ssi0_dr), 1451 + INGENIC_PIN_GROUP("ssi0-clk", x1830_ssi0_clk), 1452 + INGENIC_PIN_GROUP("ssi0-gpc", x1830_ssi0_gpc), 1453 + INGENIC_PIN_GROUP("ssi0-ce0", x1830_ssi0_ce0), 1454 + INGENIC_PIN_GROUP("ssi0-ce1", x1830_ssi0_ce1), 1455 + INGENIC_PIN_GROUP("ssi1-dt-c", x1830_ssi1_dt_c), 1456 + INGENIC_PIN_GROUP("ssi1-dr-c", x1830_ssi1_dr_c), 1457 + INGENIC_PIN_GROUP("ssi1-clk-c", x1830_ssi1_clk_c), 1458 + INGENIC_PIN_GROUP("ssi1-gpc-c", x1830_ssi1_gpc_c), 1459 + INGENIC_PIN_GROUP("ssi1-ce0-c", x1830_ssi1_ce0_c), 1460 + INGENIC_PIN_GROUP("ssi1-ce1-c", x1830_ssi1_ce1_c), 1461 + INGENIC_PIN_GROUP("ssi1-dt-d", x1830_ssi1_dt_d), 1462 + INGENIC_PIN_GROUP("ssi1-dr-d", x1830_ssi1_dr_d), 1463 + INGENIC_PIN_GROUP("ssi1-clk-d", x1830_ssi1_clk_d), 1464 + INGENIC_PIN_GROUP("ssi1-gpc-d", x1830_ssi1_gpc_d), 1465 + INGENIC_PIN_GROUP("ssi1-ce0-d", x1830_ssi1_ce0_d), 1466 + INGENIC_PIN_GROUP("ssi1-ce1-d", x1830_ssi1_ce1_d), 1467 + INGENIC_PIN_GROUP("mmc0-1bit", x1830_mmc0_1bit), 1468 + INGENIC_PIN_GROUP("mmc0-4bit", x1830_mmc0_4bit), 1469 + INGENIC_PIN_GROUP("mmc1-1bit", x1830_mmc1_1bit), 1470 + INGENIC_PIN_GROUP("mmc1-4bit", x1830_mmc1_4bit), 1471 + INGENIC_PIN_GROUP("i2c0-data", x1830_i2c0), 1472 + INGENIC_PIN_GROUP("i2c1-data", x1830_i2c1), 1473 + INGENIC_PIN_GROUP("i2c2-data", x1830_i2c2), 1474 + INGENIC_PIN_GROUP("pwm0-b", x1830_pwm_pwm0_b), 1475 + INGENIC_PIN_GROUP("pwm0-c", x1830_pwm_pwm0_c), 1476 + INGENIC_PIN_GROUP("pwm1-b", x1830_pwm_pwm1_b), 1477 + INGENIC_PIN_GROUP("pwm1-c", x1830_pwm_pwm1_c), 1478 + INGENIC_PIN_GROUP("pwm2-c-8", x1830_pwm_pwm2_c_8), 1479 + INGENIC_PIN_GROUP("pwm2-c-13", x1830_pwm_pwm2_c_13), 1480 + INGENIC_PIN_GROUP("pwm3-c-9", x1830_pwm_pwm3_c_9), 1481 + INGENIC_PIN_GROUP("pwm3-c-14", x1830_pwm_pwm3_c_14), 1482 + INGENIC_PIN_GROUP("pwm4-c-15", x1830_pwm_pwm4_c_15), 1483 + INGENIC_PIN_GROUP("pwm4-c-25", x1830_pwm_pwm4_c_25), 1484 + INGENIC_PIN_GROUP("pwm5-c-16", x1830_pwm_pwm5_c_16), 1485 + INGENIC_PIN_GROUP("pwm5-c-26", x1830_pwm_pwm5_c_26), 1486 + INGENIC_PIN_GROUP("pwm6-c-17", x1830_pwm_pwm6_c_17), 1487 + INGENIC_PIN_GROUP("pwm6-c-27", x1830_pwm_pwm6_c_27), 1488 + INGENIC_PIN_GROUP("pwm7-c-18", x1830_pwm_pwm7_c_18), 1489 + INGENIC_PIN_GROUP("pwm7-c-28", x1830_pwm_pwm7_c_28), 1490 + INGENIC_PIN_GROUP("mac", x1830_mac), 1491 + }; 1492 + 1493 + static const char *x1830_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; 1494 + static const char *x1830_uart1_groups[] = { "uart1-data", }; 1495 + static const char *x1830_sfc_groups[] = { "sfc", }; 1496 + static const char *x1830_ssi0_groups[] = { 1497 + "ssi0-dt", "ssi0-dr", "ssi0-clk", "ssi0-gpc", "ssi0-ce0", "ssi0-ce1", 1498 + }; 1499 + static const char *x1830_ssi1_groups[] = { 1500 + "ssi1-dt-c", "ssi1-dt-d", 1501 + "ssi1-dr-c", "ssi1-dr-d", 1502 + "ssi1-clk-c", "ssi1-clk-d", 1503 + "ssi1-gpc-c", "ssi1-gpc-d", 1504 + "ssi1-ce0-c", "ssi1-ce0-d", 1505 + "ssi1-ce1-c", "ssi1-ce1-d", 1506 + }; 1507 + static const char *x1830_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", }; 1508 + static const char *x1830_mmc1_groups[] = { "mmc1-1bit", "mmc1-4bit", }; 1509 + static const char *x1830_i2c0_groups[] = { "i2c0-data", }; 1510 + static const char *x1830_i2c1_groups[] = { "i2c1-data", }; 1511 + static const char *x1830_i2c2_groups[] = { "i2c2-data", }; 1512 + static const char *x1830_pwm0_groups[] = { "pwm0-b", "pwm0-c", }; 1513 + static const char *x1830_pwm1_groups[] = { "pwm1-b", "pwm1-c", }; 1514 + static const char *x1830_pwm2_groups[] = { "pwm2-c-8", "pwm2-c-13", }; 1515 + static const char *x1830_pwm3_groups[] = { "pwm3-c-9", "pwm3-c-14", }; 1516 + static const char *x1830_pwm4_groups[] = { "pwm4-c-15", "pwm4-c-25", }; 1517 + static const char *x1830_pwm5_groups[] = { "pwm5-c-16", "pwm5-c-26", }; 1518 + static const char *x1830_pwm6_groups[] = { "pwm6-c-17", "pwm6-c-27", }; 1519 + static const char *x1830_pwm7_groups[] = { "pwm7-c-18", "pwm7-c-28", }; 1520 + static const char *x1830_mac_groups[] = { "mac", }; 1521 + 1522 + static const struct function_desc x1830_functions[] = { 1523 + { "uart0", x1830_uart0_groups, ARRAY_SIZE(x1830_uart0_groups), }, 1524 + { "uart1", x1830_uart1_groups, ARRAY_SIZE(x1830_uart1_groups), }, 1525 + { "sfc", x1830_sfc_groups, ARRAY_SIZE(x1830_sfc_groups), }, 1526 + { "ssi0", x1830_ssi0_groups, ARRAY_SIZE(x1830_ssi0_groups), }, 1527 + { "ssi1", x1830_ssi1_groups, ARRAY_SIZE(x1830_ssi1_groups), }, 1528 + { "mmc0", x1830_mmc0_groups, ARRAY_SIZE(x1830_mmc0_groups), }, 1529 + { "mmc1", x1830_mmc1_groups, ARRAY_SIZE(x1830_mmc1_groups), }, 1530 + { "i2c0", x1830_i2c0_groups, ARRAY_SIZE(x1830_i2c0_groups), }, 1531 + { "i2c1", x1830_i2c1_groups, ARRAY_SIZE(x1830_i2c1_groups), }, 1532 + { "i2c2", x1830_i2c2_groups, ARRAY_SIZE(x1830_i2c2_groups), }, 1533 + { "pwm0", x1830_pwm0_groups, ARRAY_SIZE(x1830_pwm0_groups), }, 1534 + { "pwm1", x1830_pwm1_groups, ARRAY_SIZE(x1830_pwm1_groups), }, 1535 + { "pwm2", x1830_pwm2_groups, ARRAY_SIZE(x1830_pwm2_groups), }, 1536 + { "pwm3", x1830_pwm3_groups, ARRAY_SIZE(x1830_pwm3_groups), }, 1537 + { "pwm4", x1830_pwm4_groups, ARRAY_SIZE(x1830_pwm4_groups), }, 1538 + { "pwm5", x1830_pwm5_groups, ARRAY_SIZE(x1830_pwm4_groups), }, 1539 + { "pwm6", x1830_pwm6_groups, ARRAY_SIZE(x1830_pwm4_groups), }, 1540 + { "pwm7", x1830_pwm7_groups, ARRAY_SIZE(x1830_pwm4_groups), }, 1541 + { "mac", x1830_mac_groups, ARRAY_SIZE(x1830_mac_groups), }, 1542 + }; 1543 + 1544 + static const struct ingenic_chip_info x1830_chip_info = { 1545 + .num_chips = 4, 1546 + .reg_offset = 0x1000, 1547 + .version = ID_X1830, 1548 + .groups = x1830_groups, 1549 + .num_groups = ARRAY_SIZE(x1830_groups), 1550 + .functions = x1830_functions, 1551 + .num_functions = ARRAY_SIZE(x1830_functions), 1552 + .pull_ups = x1830_pull_ups, 1553 + .pull_downs = x1830_pull_downs, 1399 1554 }; 1400 1555 1401 1556 static u32 ingenic_gpio_read_reg(struct ingenic_gpio_chip *jzgc, u8 reg) ··· 1644 1363 else 1645 1364 reg = REG_CLEAR(reg); 1646 1365 1647 - regmap_write(jzgc->jzpc->map, X1000_GPIO_PZ_BASE + reg, BIT(offset)); 1366 + regmap_write(jzgc->jzpc->map, REG_PZ_BASE( 1367 + jzgc->jzpc->info->reg_offset) + reg, BIT(offset)); 1648 1368 } 1649 1369 1650 1370 static void ingenic_gpio_shadow_set_bit_load(struct ingenic_gpio_chip *jzgc) 1651 1371 { 1652 - regmap_write(jzgc->jzpc->map, X1000_GPIO_PZ_GID2LD, 1372 + regmap_write(jzgc->jzpc->map, REG_PZ_GID2LD( 1373 + jzgc->jzpc->info->reg_offset), 1653 1374 jzgc->gc.base / PINS_PER_GPIO_CHIP); 1654 1375 } 1655 1376 ··· 1666 1383 static void ingenic_gpio_set_value(struct ingenic_gpio_chip *jzgc, 1667 1384 u8 offset, int value) 1668 1385 { 1669 - if (jzgc->jzpc->version >= ID_JZ4760) 1386 + if (jzgc->jzpc->info->version >= ID_JZ4760) 1670 1387 ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_PAT0, offset, !!value); 1671 1388 else 1672 1389 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, offset, !!value); ··· 1676 1393 u8 offset, unsigned int type) 1677 1394 { 1678 1395 u8 reg1, reg2; 1396 + bool val1, val2; 1679 1397 1680 - if (jzgc->jzpc->version >= ID_JZ4760) { 1398 + switch (type) { 1399 + case IRQ_TYPE_EDGE_RISING: 1400 + val1 = val2 = true; 1401 + break; 1402 + case IRQ_TYPE_EDGE_FALLING: 1403 + val1 = false; 1404 + val2 = true; 1405 + break; 1406 + case IRQ_TYPE_LEVEL_HIGH: 1407 + val1 = true; 1408 + val2 = false; 1409 + break; 1410 + case IRQ_TYPE_LEVEL_LOW: 1411 + default: 1412 + val1 = val2 = false; 1413 + break; 1414 + } 1415 + 1416 + if (jzgc->jzpc->info->version >= ID_JZ4760) { 1681 1417 reg1 = JZ4760_GPIO_PAT1; 1682 1418 reg2 = JZ4760_GPIO_PAT0; 1683 1419 } else { ··· 1704 1402 reg2 = JZ4740_GPIO_DIR; 1705 1403 } 1706 1404 1707 - switch (type) { 1708 - case IRQ_TYPE_EDGE_RISING: 1709 - if (jzgc->jzpc->version >= ID_X1000) { 1710 - ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, true); 1711 - ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, true); 1712 - ingenic_gpio_shadow_set_bit_load(jzgc); 1713 - } else { 1714 - ingenic_gpio_set_bit(jzgc, reg2, offset, true); 1715 - ingenic_gpio_set_bit(jzgc, reg1, offset, true); 1716 - } 1717 - break; 1718 - case IRQ_TYPE_EDGE_FALLING: 1719 - if (jzgc->jzpc->version >= ID_X1000) { 1720 - ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, false); 1721 - ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, true); 1722 - ingenic_gpio_shadow_set_bit_load(jzgc); 1723 - } else { 1724 - ingenic_gpio_set_bit(jzgc, reg2, offset, false); 1725 - ingenic_gpio_set_bit(jzgc, reg1, offset, true); 1726 - } 1727 - break; 1728 - case IRQ_TYPE_LEVEL_HIGH: 1729 - if (jzgc->jzpc->version >= ID_X1000) { 1730 - ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, true); 1731 - ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, false); 1732 - ingenic_gpio_shadow_set_bit_load(jzgc); 1733 - } else { 1734 - ingenic_gpio_set_bit(jzgc, reg2, offset, true); 1735 - ingenic_gpio_set_bit(jzgc, reg1, offset, false); 1736 - } 1737 - break; 1738 - case IRQ_TYPE_LEVEL_LOW: 1739 - default: 1740 - if (jzgc->jzpc->version >= ID_X1000) { 1741 - ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, false); 1742 - ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, false); 1743 - ingenic_gpio_shadow_set_bit_load(jzgc); 1744 - } else { 1745 - ingenic_gpio_set_bit(jzgc, reg2, offset, false); 1746 - ingenic_gpio_set_bit(jzgc, reg1, offset, false); 1747 - } 1748 - break; 1405 + if (jzgc->jzpc->info->version >= ID_X1000) { 1406 + ingenic_gpio_shadow_set_bit(jzgc, reg2, offset, val1); 1407 + ingenic_gpio_shadow_set_bit(jzgc, reg1, offset, val2); 1408 + ingenic_gpio_shadow_set_bit_load(jzgc); 1409 + } else { 1410 + ingenic_gpio_set_bit(jzgc, reg2, offset, val1); 1411 + ingenic_gpio_set_bit(jzgc, reg1, offset, val2); 1749 1412 } 1750 1413 } 1751 1414 ··· 1736 1469 struct ingenic_gpio_chip *jzgc = gpiochip_get_data(gc); 1737 1470 int irq = irqd->hwirq; 1738 1471 1739 - if (jzgc->jzpc->version >= ID_JZ4760) 1472 + if (jzgc->jzpc->info->version >= ID_JZ4760) 1740 1473 ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_INT, irq, true); 1741 1474 else 1742 1475 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, true); ··· 1752 1485 1753 1486 ingenic_gpio_irq_mask(irqd); 1754 1487 1755 - if (jzgc->jzpc->version >= ID_JZ4760) 1488 + if (jzgc->jzpc->info->version >= ID_JZ4760) 1756 1489 ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_INT, irq, false); 1757 1490 else 1758 1491 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, false); ··· 1777 1510 irq_set_type(jzgc, irq, IRQ_TYPE_EDGE_RISING); 1778 1511 } 1779 1512 1780 - if (jzgc->jzpc->version >= ID_JZ4760) 1513 + if (jzgc->jzpc->info->version >= ID_JZ4760) 1781 1514 ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_FLAG, irq, false); 1782 1515 else 1783 1516 ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, irq, true); ··· 1834 1567 1835 1568 chained_irq_enter(irq_chip, desc); 1836 1569 1837 - if (jzgc->jzpc->version >= ID_JZ4760) 1570 + if (jzgc->jzpc->info->version >= ID_JZ4760) 1838 1571 flag = ingenic_gpio_read_reg(jzgc, JZ4760_GPIO_FLAG); 1839 1572 else 1840 1573 flag = ingenic_gpio_read_reg(jzgc, JZ4740_GPIO_FLAG); ··· 1878 1611 unsigned int idx = pin % PINS_PER_GPIO_CHIP; 1879 1612 unsigned int offt = pin / PINS_PER_GPIO_CHIP; 1880 1613 1881 - regmap_write(jzpc->map, offt * 0x100 + 1614 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1882 1615 (set ? REG_SET(reg) : REG_CLEAR(reg)), BIT(idx)); 1883 1616 } 1884 1617 ··· 1887 1620 { 1888 1621 unsigned int idx = pin % PINS_PER_GPIO_CHIP; 1889 1622 1890 - regmap_write(jzpc->map, X1000_GPIO_PZ_BASE + 1623 + regmap_write(jzpc->map, REG_PZ_BASE(jzpc->info->reg_offset) + 1891 1624 (set ? REG_SET(reg) : REG_CLEAR(reg)), BIT(idx)); 1892 1625 } 1893 1626 1894 1627 static inline void ingenic_shadow_config_pin_load(struct ingenic_pinctrl *jzpc, 1895 1628 unsigned int pin) 1896 1629 { 1897 - regmap_write(jzpc->map, X1000_GPIO_PZ_GID2LD, pin / PINS_PER_GPIO_CHIP); 1630 + regmap_write(jzpc->map, REG_PZ_GID2LD(jzpc->info->reg_offset), 1631 + pin / PINS_PER_GPIO_CHIP); 1898 1632 } 1899 1633 1900 1634 static inline bool ingenic_get_pin_config(struct ingenic_pinctrl *jzpc, ··· 1905 1637 unsigned int offt = pin / PINS_PER_GPIO_CHIP; 1906 1638 unsigned int val; 1907 1639 1908 - regmap_read(jzpc->map, offt * 0x100 + reg, &val); 1640 + regmap_read(jzpc->map, offt * jzpc->info->reg_offset + reg, &val); 1909 1641 1910 1642 return val & BIT(idx); 1911 1643 } ··· 1916 1648 struct ingenic_pinctrl *jzpc = jzgc->jzpc; 1917 1649 unsigned int pin = gc->base + offset; 1918 1650 1919 - if (jzpc->version >= ID_JZ4760) 1651 + if (jzpc->info->version >= ID_JZ4760) 1920 1652 return ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PAT1); 1921 1653 1922 1654 if (ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_SELECT)) ··· 1942 1674 dev_dbg(jzpc->dev, "set pin P%c%u to function %u\n", 1943 1675 'A' + offt, idx, func); 1944 1676 1945 - if (jzpc->version >= ID_X1000) { 1677 + if (jzpc->info->version >= ID_X1000) { 1946 1678 ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_INT, false); 1947 1679 ingenic_shadow_config_pin(jzpc, pin, GPIO_MSK, false); 1948 1680 ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, func & 0x2); 1949 1681 ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT0, func & 0x1); 1950 1682 ingenic_shadow_config_pin_load(jzpc, pin); 1951 - } else if (jzpc->version >= ID_JZ4760) { 1683 + } else if (jzpc->info->version >= ID_JZ4760) { 1952 1684 ingenic_config_pin(jzpc, pin, JZ4760_GPIO_INT, false); 1953 1685 ingenic_config_pin(jzpc, pin, GPIO_MSK, false); 1954 1686 ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, func & 0x2); ··· 2001 1733 dev_dbg(pctldev->dev, "set pin P%c%u to %sput\n", 2002 1734 'A' + offt, idx, input ? "in" : "out"); 2003 1735 2004 - if (jzpc->version >= ID_X1000) { 1736 + if (jzpc->info->version >= ID_X1000) { 2005 1737 ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_INT, false); 2006 1738 ingenic_shadow_config_pin(jzpc, pin, GPIO_MSK, true); 2007 1739 ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, input); 2008 1740 ingenic_shadow_config_pin_load(jzpc, pin); 2009 - } else if (jzpc->version >= ID_JZ4760) { 1741 + } else if (jzpc->info->version >= ID_JZ4760) { 2010 1742 ingenic_config_pin(jzpc, pin, JZ4760_GPIO_INT, false); 2011 1743 ingenic_config_pin(jzpc, pin, GPIO_MSK, true); 2012 1744 ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, input); ··· 2036 1768 unsigned int offt = pin / PINS_PER_GPIO_CHIP; 2037 1769 bool pull; 2038 1770 2039 - if (jzpc->version >= ID_JZ4760) 1771 + if (jzpc->info->version >= ID_JZ4760) 2040 1772 pull = !ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PEN); 2041 1773 else 2042 1774 pull = !ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_PULL_DIS); ··· 2066 1798 } 2067 1799 2068 1800 static void ingenic_set_bias(struct ingenic_pinctrl *jzpc, 2069 - unsigned int pin, bool enabled) 1801 + unsigned int pin, unsigned int bias) 2070 1802 { 2071 - if (jzpc->version >= ID_JZ4760) 2072 - ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PEN, !enabled); 2073 - else 2074 - ingenic_config_pin(jzpc, pin, JZ4740_GPIO_PULL_DIS, !enabled); 1803 + if (jzpc->info->version >= ID_X1830) { 1804 + unsigned int idx = pin % PINS_PER_GPIO_CHIP; 1805 + unsigned int half = PINS_PER_GPIO_CHIP / 2; 1806 + unsigned int idxh = pin % half * 2; 1807 + unsigned int offt = pin / PINS_PER_GPIO_CHIP; 1808 + 1809 + if (idx < half) { 1810 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1811 + REG_CLEAR(X1830_GPIO_PEL), 3 << idxh); 1812 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1813 + REG_SET(X1830_GPIO_PEL), bias << idxh); 1814 + } else { 1815 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1816 + REG_CLEAR(X1830_GPIO_PEH), 3 << idxh); 1817 + regmap_write(jzpc->map, offt * jzpc->info->reg_offset + 1818 + REG_SET(X1830_GPIO_PEH), bias << idxh); 1819 + } 1820 + 1821 + } else if (jzpc->info->version >= ID_JZ4760) { 1822 + ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PEN, !bias); 1823 + } else { 1824 + ingenic_config_pin(jzpc, pin, JZ4740_GPIO_PULL_DIS, !bias); 1825 + } 2075 1826 } 2076 1827 2077 1828 static void ingenic_set_output_level(struct ingenic_pinctrl *jzpc, 2078 1829 unsigned int pin, bool high) 2079 1830 { 2080 - if (jzpc->version >= ID_JZ4760) 1831 + if (jzpc->info->version >= ID_JZ4760) 2081 1832 ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT0, high); 2082 1833 else 2083 1834 ingenic_config_pin(jzpc, pin, JZ4740_GPIO_DATA, high); ··· 2130 1843 case PIN_CONFIG_BIAS_DISABLE: 2131 1844 dev_dbg(jzpc->dev, "disable pull-over for pin P%c%u\n", 2132 1845 'A' + offt, idx); 2133 - ingenic_set_bias(jzpc, pin, false); 1846 + ingenic_set_bias(jzpc, pin, GPIO_PULL_DIS); 2134 1847 break; 2135 1848 2136 1849 case PIN_CONFIG_BIAS_PULL_UP: ··· 2138 1851 return -EINVAL; 2139 1852 dev_dbg(jzpc->dev, "set pull-up for pin P%c%u\n", 2140 1853 'A' + offt, idx); 2141 - ingenic_set_bias(jzpc, pin, true); 1854 + ingenic_set_bias(jzpc, pin, GPIO_PULL_UP); 2142 1855 break; 2143 1856 2144 1857 case PIN_CONFIG_BIAS_PULL_DOWN: ··· 2146 1859 return -EINVAL; 2147 1860 dev_dbg(jzpc->dev, "set pull-down for pin P%c%u\n", 2148 1861 'A' + offt, idx); 2149 - ingenic_set_bias(jzpc, pin, true); 1862 + ingenic_set_bias(jzpc, pin, GPIO_PULL_DOWN); 2150 1863 break; 2151 1864 2152 1865 case PIN_CONFIG_OUTPUT: ··· 2226 1939 .reg_stride = 4, 2227 1940 }; 2228 1941 2229 - static const struct of_device_id ingenic_pinctrl_of_match[] = { 2230 - { .compatible = "ingenic,jz4740-pinctrl", .data = (void *) ID_JZ4740 }, 2231 - { .compatible = "ingenic,jz4725b-pinctrl", .data = (void *)ID_JZ4725B }, 2232 - { .compatible = "ingenic,jz4760-pinctrl", .data = (void *) ID_JZ4760 }, 2233 - { .compatible = "ingenic,jz4760b-pinctrl", .data = (void *) ID_JZ4760B }, 2234 - { .compatible = "ingenic,jz4770-pinctrl", .data = (void *) ID_JZ4770 }, 2235 - { .compatible = "ingenic,jz4780-pinctrl", .data = (void *) ID_JZ4780 }, 2236 - { .compatible = "ingenic,x1000-pinctrl", .data = (void *) ID_X1000 }, 2237 - { .compatible = "ingenic,x1000e-pinctrl", .data = (void *) ID_X1000E }, 2238 - { .compatible = "ingenic,x1500-pinctrl", .data = (void *) ID_X1500 }, 2239 - {}, 2240 - }; 2241 - 2242 1942 static const struct of_device_id ingenic_gpio_of_match[] __initconst = { 2243 1943 { .compatible = "ingenic,jz4740-gpio", }, 2244 1944 { .compatible = "ingenic,jz4760-gpio", }, 2245 1945 { .compatible = "ingenic,jz4770-gpio", }, 2246 1946 { .compatible = "ingenic,jz4780-gpio", }, 2247 1947 { .compatible = "ingenic,x1000-gpio", }, 1948 + { .compatible = "ingenic,x1830-gpio", }, 2248 1949 {}, 2249 1950 }; 2250 1951 ··· 2256 1981 return -ENOMEM; 2257 1982 2258 1983 jzgc->jzpc = jzpc; 2259 - jzgc->reg_base = bank * 0x100; 1984 + jzgc->reg_base = bank * jzpc->info->reg_offset; 2260 1985 2261 1986 jzgc->gc.label = devm_kasprintf(dev, GFP_KERNEL, "GPIO%c", 'A' + bank); 2262 1987 if (!jzgc->gc.label) ··· 2323 2048 struct ingenic_pinctrl *jzpc; 2324 2049 struct pinctrl_desc *pctl_desc; 2325 2050 void __iomem *base; 2326 - const struct platform_device_id *id = platform_get_device_id(pdev); 2327 - const struct of_device_id *of_id = of_match_device( 2328 - ingenic_pinctrl_of_match, dev); 2329 2051 const struct ingenic_chip_info *chip_info; 2330 2052 struct device_node *node; 2331 2053 unsigned int i; ··· 2332 2060 if (!jzpc) 2333 2061 return -ENOMEM; 2334 2062 2335 - base = devm_ioremap_resource(dev, 2336 - platform_get_resource(pdev, IORESOURCE_MEM, 0)); 2063 + base = devm_platform_ioremap_resource(pdev, 0); 2337 2064 if (IS_ERR(base)) 2338 2065 return PTR_ERR(base); 2339 2066 ··· 2344 2073 } 2345 2074 2346 2075 jzpc->dev = dev; 2347 - 2348 - if (of_id) 2349 - jzpc->version = (enum jz_version)of_id->data; 2350 - else 2351 - jzpc->version = (enum jz_version)id->driver_data; 2352 - 2353 - if (jzpc->version >= ID_X1500) 2354 - chip_info = &x1500_chip_info; 2355 - else if (jzpc->version >= ID_X1000E) 2356 - chip_info = &x1000e_chip_info; 2357 - else if (jzpc->version >= ID_X1000) 2358 - chip_info = &x1000_chip_info; 2359 - else if (jzpc->version >= ID_JZ4780) 2360 - chip_info = &jz4780_chip_info; 2361 - else if (jzpc->version >= ID_JZ4770) 2362 - chip_info = &jz4770_chip_info; 2363 - else if (jzpc->version >= ID_JZ4760B) 2364 - chip_info = &jz4760b_chip_info; 2365 - else if (jzpc->version >= ID_JZ4760) 2366 - chip_info = &jz4760_chip_info; 2367 - else if (jzpc->version >= ID_JZ4725B) 2368 - chip_info = &jz4725b_chip_info; 2369 - else 2370 - chip_info = &jz4740_chip_info; 2371 - jzpc->info = chip_info; 2076 + jzpc->info = chip_info = of_device_get_match_data(dev); 2372 2077 2373 2078 pctl_desc = devm_kzalloc(&pdev->dev, sizeof(*pctl_desc), GFP_KERNEL); 2374 2079 if (!pctl_desc) ··· 2413 2166 return 0; 2414 2167 } 2415 2168 2416 - static const struct platform_device_id ingenic_pinctrl_ids[] = { 2417 - { "jz4740-pinctrl", ID_JZ4740 }, 2418 - { "jz4725b-pinctrl", ID_JZ4725B }, 2419 - { "jz4760-pinctrl", ID_JZ4760 }, 2420 - { "jz4760b-pinctrl", ID_JZ4760B }, 2421 - { "jz4770-pinctrl", ID_JZ4770 }, 2422 - { "jz4780-pinctrl", ID_JZ4780 }, 2423 - { "x1000-pinctrl", ID_X1000 }, 2424 - { "x1000e-pinctrl", ID_X1000E }, 2425 - { "x1500-pinctrl", ID_X1500 }, 2169 + static const struct of_device_id ingenic_pinctrl_of_match[] = { 2170 + { .compatible = "ingenic,jz4740-pinctrl", .data = &jz4740_chip_info }, 2171 + { .compatible = "ingenic,jz4725b-pinctrl", .data = &jz4725b_chip_info }, 2172 + { .compatible = "ingenic,jz4760-pinctrl", .data = &jz4760_chip_info }, 2173 + { .compatible = "ingenic,jz4760b-pinctrl", .data = &jz4760_chip_info }, 2174 + { .compatible = "ingenic,jz4770-pinctrl", .data = &jz4770_chip_info }, 2175 + { .compatible = "ingenic,jz4780-pinctrl", .data = &jz4780_chip_info }, 2176 + { .compatible = "ingenic,x1000-pinctrl", .data = &x1000_chip_info }, 2177 + { .compatible = "ingenic,x1000e-pinctrl", .data = &x1000_chip_info }, 2178 + { .compatible = "ingenic,x1500-pinctrl", .data = &x1500_chip_info }, 2179 + { .compatible = "ingenic,x1830-pinctrl", .data = &x1830_chip_info }, 2426 2180 {}, 2427 2181 }; 2428 2182 2429 2183 static struct platform_driver ingenic_pinctrl_driver = { 2430 2184 .driver = { 2431 2185 .name = "pinctrl-ingenic", 2432 - .of_match_table = of_match_ptr(ingenic_pinctrl_of_match), 2186 + .of_match_table = ingenic_pinctrl_of_match, 2433 2187 }, 2434 - .id_table = ingenic_pinctrl_ids, 2435 2188 }; 2436 2189 2437 2190 static int __init ingenic_pinctrl_drv_register(void)
+2 -2
drivers/pinctrl/pinctrl-rza1.c
··· 1229 1229 1230 1230 pinctrl_add_gpio_range(rza1_pctl->pctl, range); 1231 1231 1232 - dev_info(rza1_pctl->dev, "Parsed gpiochip %s with %d pins\n", 1233 - chip->label, chip->ngpio); 1232 + dev_dbg(rza1_pctl->dev, "Parsed gpiochip %s with %d pins\n", 1233 + chip->label, chip->ngpio); 1234 1234 1235 1235 return 0; 1236 1236 }
-5
drivers/pinctrl/qcom/pinctrl-msm.c
··· 960 960 { 961 961 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 962 962 struct msm_pinctrl *pctrl = gpiochip_get_data(gc); 963 - unsigned long flags; 964 963 965 964 /* 966 965 * While they may not wake up when the TLMM is powered off, ··· 970 971 if (d->parent_data) 971 972 irq_chip_set_wake_parent(d, on); 972 973 973 - raw_spin_lock_irqsave(&pctrl->lock, flags); 974 - 975 974 irq_set_irq_wake(pctrl->irq, on); 976 - 977 - raw_spin_unlock_irqrestore(&pctrl->lock, flags); 978 975 979 976 return 0; 980 977 }
+1 -1
drivers/pinctrl/qcom/pinctrl-msm8976.c
··· 589 589 static const char * const qdss_traceclk_a_groups[] = { 590 590 "gpio46", 591 591 }; 592 - const char * const m_voc_groups[] = { 592 + static const char * const m_voc_groups[] = { 593 593 "gpio123", "gpio124", 594 594 }; 595 595 static const char * const blsp_i2c5_groups[] = {
+58 -20
drivers/pinctrl/qcom/pinctrl-sc7180.c
··· 456 456 msm_mux_qspi_data, 457 457 msm_mux_qup00, 458 458 msm_mux_qup01, 459 - msm_mux_qup02, 459 + msm_mux_qup02_i2c, 460 + msm_mux_qup02_uart, 460 461 msm_mux_qup03, 461 - msm_mux_qup04, 462 + msm_mux_qup04_i2c, 463 + msm_mux_qup04_uart, 462 464 msm_mux_qup05, 463 465 msm_mux_qup10, 464 - msm_mux_qup11, 466 + msm_mux_qup11_i2c, 467 + msm_mux_qup11_uart, 465 468 msm_mux_qup12, 466 - msm_mux_qup13, 469 + msm_mux_qup13_i2c, 470 + msm_mux_qup13_uart, 467 471 msm_mux_qup14, 468 472 msm_mux_qup15, 469 473 msm_mux_sdc1_tb, ··· 547 543 static const char * const sdc2_tb_groups[] = { 548 544 "gpio5", 549 545 }; 550 - static const char * const qup11_groups[] = { 546 + static const char * const qup11_i2c_groups[] = { 547 + "gpio6", "gpio7", 548 + }; 549 + static const char * const qup11_uart_groups[] = { 551 550 "gpio6", "gpio7", 552 551 }; 553 552 static const char * const ddr_bist_groups[] = { ··· 600 593 static const char * const pll_reset_groups[] = { 601 594 "gpio14", 602 595 }; 603 - static const char * const qup02_groups[] = { 596 + static const char * const qup02_i2c_groups[] = { 597 + "gpio15", "gpio16", 598 + }; 599 + static const char * const qup02_uart_groups[] = { 604 600 "gpio15", "gpio16", 605 601 }; 606 602 static const char * const cci_i2c_groups[] = { ··· 708 698 static const char * const atest_usb13_groups[] = { 709 699 "gpio44", 710 700 }; 711 - static const char * const qup13_groups[] = { 701 + static const char * const qup13_i2c_groups[] = { 702 + "gpio46", "gpio47", 703 + }; 704 + static const char * const qup13_uart_groups[] = { 712 705 "gpio46", "gpio47", 713 706 }; 714 707 static const char * const gcc_gp1_groups[] = { ··· 861 848 static const char * const mss_lte_groups[] = { 862 849 "gpio108", "gpio109", 863 850 }; 864 - static const char * const qup04_groups[] = { 851 + static const char * const qup04_i2c_groups[] = { 852 + "gpio115", "gpio116", 853 + }; 854 + static const char * const qup04_uart_groups[] = { 865 855 "gpio115", "gpio116", 866 856 }; 867 857 ··· 945 929 FUNCTION(qspi_data), 946 930 FUNCTION(qup00), 947 931 FUNCTION(qup01), 948 - FUNCTION(qup02), 932 + FUNCTION(qup02_i2c), 933 + FUNCTION(qup02_uart), 949 934 FUNCTION(qup03), 950 - FUNCTION(qup04), 935 + FUNCTION(qup04_i2c), 936 + FUNCTION(qup04_uart), 951 937 FUNCTION(qup05), 952 938 FUNCTION(qup10), 953 - FUNCTION(qup11), 939 + FUNCTION(qup11_i2c), 940 + FUNCTION(qup11_uart), 954 941 FUNCTION(qup12), 955 - FUNCTION(qup13), 942 + FUNCTION(qup13_i2c), 943 + FUNCTION(qup13_uart), 956 944 FUNCTION(qup14), 957 945 FUNCTION(qup15), 958 946 FUNCTION(sdc1_tb), ··· 996 976 [3] = PINGROUP(3, SOUTH, qup01, sp_cmu, dbg_out, qdss_cti, _, _, _, _, _), 997 977 [4] = PINGROUP(4, NORTH, sdc1_tb, _, qdss_cti, _, _, _, _, _, _), 998 978 [5] = PINGROUP(5, NORTH, sdc2_tb, _, _, _, _, _, _, _, _), 999 - [6] = PINGROUP(6, NORTH, qup11, qup11, _, _, _, _, _, _, _), 1000 - [7] = PINGROUP(7, NORTH, qup11, qup11, ddr_bist, _, _, _, _, _, _), 979 + [6] = PINGROUP(6, NORTH, qup11_i2c, qup11_uart, _, _, _, _, _, _, _), 980 + [7] = PINGROUP(7, NORTH, qup11_i2c, qup11_uart, ddr_bist, _, _, _, _, _, _), 1001 981 [8] = PINGROUP(8, NORTH, gp_pdm1, ddr_bist, _, phase_flag, qdss_cti, _, _, _, _), 1002 982 [9] = PINGROUP(9, NORTH, ddr_bist, _, phase_flag, qdss_cti, _, _, _, _, _), 1003 983 [10] = PINGROUP(10, NORTH, mdp_vsync, ddr_bist, _, _, _, _, _, _, _), ··· 1005 985 [12] = PINGROUP(12, SOUTH, mdp_vsync, m_voc, qup01, _, phase_flag, wlan2_adc0, atest_usb10, ddr_pxi3, _), 1006 986 [13] = PINGROUP(13, SOUTH, cam_mclk, pll_bypassnl, qdss, _, _, _, _, _, _), 1007 987 [14] = PINGROUP(14, SOUTH, cam_mclk, pll_reset, qdss, _, _, _, _, _, _), 1008 - [15] = PINGROUP(15, SOUTH, cam_mclk, qup02, qup02, qdss, _, _, _, _, _), 1009 - [16] = PINGROUP(16, SOUTH, cam_mclk, qup02, qup02, qdss, _, _, _, _, _), 988 + [15] = PINGROUP(15, SOUTH, cam_mclk, qup02_i2c, qup02_uart, qdss, _, _, _, _, _), 989 + [16] = PINGROUP(16, SOUTH, cam_mclk, qup02_i2c, qup02_uart, qdss, _, _, _, _, _), 1010 990 [17] = PINGROUP(17, SOUTH, cci_i2c, _, phase_flag, qdss, _, wlan1_adc0, atest_usb12, ddr_pxi1, atest_char), 1011 991 [18] = PINGROUP(18, SOUTH, cci_i2c, agera_pll, _, phase_flag, qdss, vsense_trigger, ddr_pxi0, atest_char3, _), 1012 992 [19] = PINGROUP(19, SOUTH, cci_i2c, _, phase_flag, qdss, atest_char2, _, _, _, _), ··· 1036 1016 [43] = PINGROUP(43, NORTH, qup12, _, _, _, _, _, _, _, _), 1037 1017 [44] = PINGROUP(44, NORTH, qup12, _, phase_flag, qdss_cti, wlan1_adc1, atest_usb13, ddr_pxi1, _, _), 1038 1018 [45] = PINGROUP(45, NORTH, qup12, qdss_cti, _, _, _, _, _, _, _), 1039 - [46] = PINGROUP(46, NORTH, qup13, qup13, _, _, _, _, _, _, _), 1040 - [47] = PINGROUP(47, NORTH, qup13, qup13, _, _, _, _, _, _, _), 1019 + [46] = PINGROUP(46, NORTH, qup13_i2c, qup13_uart, _, _, _, _, _, _, _), 1020 + [47] = PINGROUP(47, NORTH, qup13_i2c, qup13_uart, _, _, _, _, _, _, _), 1041 1021 [48] = PINGROUP(48, NORTH, gcc_gp1, _, _, _, _, _, _, _, _), 1042 1022 [49] = PINGROUP(49, WEST, mi2s_1, btfm_slimbus, _, _, _, _, _, _, _), 1043 1023 [50] = PINGROUP(50, WEST, mi2s_1, btfm_slimbus, gp_pdm1, _, _, _, _, _, _), ··· 1105 1085 [112] = PINGROUP(112, NORTH, _, _, _, _, _, _, _, _, _), 1106 1086 [113] = PINGROUP(113, NORTH, _, _, _, _, _, _, _, _, _), 1107 1087 [114] = PINGROUP(114, NORTH, _, _, _, _, _, _, _, _, _), 1108 - [115] = PINGROUP(115, WEST, qup04, qup04, _, _, _, _, _, _, _), 1109 - [116] = PINGROUP(116, WEST, qup04, qup04, _, _, _, _, _, _, _), 1088 + [115] = PINGROUP(115, WEST, qup04_i2c, qup04_uart, _, _, _, _, _, _, _), 1089 + [116] = PINGROUP(116, WEST, qup04_i2c, qup04_uart, _, _, _, _, _, _, _), 1110 1090 [117] = PINGROUP(117, WEST, dp_hot, _, _, _, _, _, _, _, _), 1111 1091 [118] = PINGROUP(118, WEST, _, _, _, _, _, _, _, _, _), 1112 1092 [119] = UFS_RESET(ufs_reset, 0x7f000), ··· 1119 1099 [126] = SDC_QDSD_PINGROUP(sdc2_data, 0x7b000, 9, 0), 1120 1100 }; 1121 1101 1102 + static const struct msm_gpio_wakeirq_map sc7180_pdc_map[] = { 1103 + {0, 40}, {3, 50}, {4, 42}, {5, 70}, {6, 41}, {9, 35}, 1104 + {10, 80}, {11, 51}, {16, 20}, {21, 55}, {22, 90}, {23, 21}, 1105 + {24, 61}, {26, 52}, {28, 36}, {30, 100}, {31, 33}, {32, 81}, 1106 + {33, 62}, {34, 43}, {36, 91}, {37, 53}, {38, 63}, {39, 72}, 1107 + {41, 101}, {42, 7}, {43, 34}, {45, 73}, {47, 82}, {49, 17}, 1108 + {52, 109}, {53, 102}, {55, 92}, {56, 56}, {57, 57}, {58, 83}, 1109 + {59, 37}, {62, 110}, {63, 111}, {64, 74}, {65, 44}, {66, 93}, 1110 + {67, 58}, {68, 112}, {69, 32}, {70, 54}, {72, 59}, {73, 64}, 1111 + {74, 71}, {78, 31}, {82, 30}, {85, 103}, {86, 38}, {87, 39}, 1112 + {88, 45}, {89, 46}, {90, 47}, {91, 48}, {92, 60}, {93, 49}, 1113 + {94, 84}, {95, 94}, {98, 65}, {101, 66}, {104, 67}, {109, 104}, 1114 + {110, 68}, {113, 69}, {114, 113}, {115, 108}, {116, 121}, 1115 + {117, 114}, {118, 119}, 1116 + }; 1117 + 1122 1118 static const struct msm_pinctrl_soc_data sc7180_pinctrl = { 1123 1119 .pins = sc7180_pins, 1124 1120 .npins = ARRAY_SIZE(sc7180_pins), ··· 1145 1109 .ngpios = 120, 1146 1110 .tiles = sc7180_tiles, 1147 1111 .ntiles = ARRAY_SIZE(sc7180_tiles), 1112 + .wakeirq_map = sc7180_pdc_map, 1113 + .nwakeirq_map = ARRAY_SIZE(sc7180_pdc_map), 1148 1114 }; 1149 1115 1150 1116 static int sc7180_pinctrl_probe(struct platform_device *pdev)
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
··· 439 439 .pin_config_group_set = pm8xxx_pin_config_set, 440 440 }; 441 441 442 - static struct pinctrl_desc pm8xxx_pinctrl_desc = { 442 + static const struct pinctrl_desc pm8xxx_pinctrl_desc = { 443 443 .name = "pm8xxx_gpio", 444 444 .pctlops = &pm8xxx_pinctrl_ops, 445 445 .pmxops = &pm8xxx_pinmux_ops,
+1 -1
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
··· 430 430 .pin_config_group_set = pm8xxx_pin_config_set, 431 431 }; 432 432 433 - static struct pinctrl_desc pm8xxx_pinctrl_desc = { 433 + static const struct pinctrl_desc pm8xxx_pinctrl_desc = { 434 434 .name = "pm8xxx_mpp", 435 435 .pctlops = &pm8xxx_pinctrl_ops, 436 436 .pmxops = &pm8xxx_pinmux_ops,
+10 -6
drivers/pinctrl/samsung/Kconfig
··· 4 4 # 5 5 config PINCTRL_SAMSUNG 6 6 bool 7 + depends on OF_GPIO 7 8 select PINMUX 8 9 select PINCONF 9 10 10 11 config PINCTRL_EXYNOS 11 - bool "Pinctrl driver data for Samsung EXYNOS SoCs" 12 - depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210) 12 + bool "Pinctrl common driver part for Samsung Exynos SoCs" 13 + depends on OF_GPIO 14 + depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST 13 15 select PINCTRL_SAMSUNG 14 16 select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210) 15 17 select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS 16 18 17 19 config PINCTRL_EXYNOS_ARM 18 - bool "ARMv7-specific pinctrl driver data for Exynos" if COMPILE_TEST 20 + bool "ARMv7-specific pinctrl driver for Samsung Exynos SoCs" if COMPILE_TEST 19 21 depends on PINCTRL_EXYNOS 20 22 21 23 config PINCTRL_EXYNOS_ARM64 22 - bool "ARMv8-specific pinctrl driver data for Exynos" if COMPILE_TEST 24 + bool "ARMv8-specific pinctrl driver for Samsung Exynos SoCs" if COMPILE_TEST 23 25 depends on PINCTRL_EXYNOS 24 26 25 27 config PINCTRL_S3C24XX 26 28 bool "Samsung S3C24XX SoC pinctrl driver" 27 - depends on ARCH_S3C24XX && OF 29 + depends on OF_GPIO 30 + depends on ARCH_S3C24XX || COMPILE_TEST 28 31 select PINCTRL_SAMSUNG 29 32 30 33 config PINCTRL_S3C64XX 31 34 bool "Samsung S3C64XX SoC pinctrl driver" 32 - depends on ARCH_S3C64XX 35 + depends on OF_GPIO 36 + depends on ARCH_S3C64XX || COMPILE_TEST 33 37 select PINCTRL_SAMSUNG
+8 -4
drivers/pinctrl/sh-pfc/Kconfig
··· 26 26 select PINCTRL_PFC_R8A7792 if ARCH_R8A7792 27 27 select PINCTRL_PFC_R8A7793 if ARCH_R8A7793 28 28 select PINCTRL_PFC_R8A7794 if ARCH_R8A7794 29 - select PINCTRL_PFC_R8A7795 if ARCH_R8A7795 30 - select PINCTRL_PFC_R8A77960 if ARCH_R8A77960 || ARCH_R8A7796 29 + select PINCTRL_PFC_R8A77950 if ARCH_R8A77950 || ARCH_R8A7795 30 + select PINCTRL_PFC_R8A77951 if ARCH_R8A77951 || ARCH_R8A7795 31 + select PINCTRL_PFC_R8A77960 if ARCH_R8A77960 31 32 select PINCTRL_PFC_R8A77961 if ARCH_R8A77961 32 33 select PINCTRL_PFC_R8A77965 if ARCH_R8A77965 33 34 select PINCTRL_PFC_R8A77970 if ARCH_R8A77970 ··· 116 115 config PINCTRL_PFC_R8A7794 117 116 bool "R-Car E2 pin control support" if COMPILE_TEST 118 117 119 - config PINCTRL_PFC_R8A7795 120 - bool "R-Car H3 pin control support" if COMPILE_TEST 118 + config PINCTRL_PFC_R8A77950 119 + bool "R-Car H3 ES1.x pin control support" if COMPILE_TEST 120 + 121 + config PINCTRL_PFC_R8A77951 122 + bool "R-Car H3 ES2.0+ pin control support" if COMPILE_TEST 121 123 122 124 config PINCTRL_PFC_R8A77960 123 125 bool "R-Car M3-W pin control support" if COMPILE_TEST
+2 -2
drivers/pinctrl/sh-pfc/Makefile
··· 18 18 obj-$(CONFIG_PINCTRL_PFC_R8A7792) += pfc-r8a7792.o 19 19 obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o 20 20 obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o 21 - obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o 22 - obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795-es1.o 21 + obj-$(CONFIG_PINCTRL_PFC_R8A77950) += pfc-r8a77950.o 22 + obj-$(CONFIG_PINCTRL_PFC_R8A77951) += pfc-r8a77951.o 23 23 obj-$(CONFIG_PINCTRL_PFC_R8A77960) += pfc-r8a7796.o 24 24 obj-$(CONFIG_PINCTRL_PFC_R8A77961) += pfc-r8a7796.o 25 25 obj-$(CONFIG_PINCTRL_PFC_R8A77965) += pfc-r8a77965.o
+44 -13
drivers/pinctrl/sh-pfc/core.c
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/psci.h> 25 25 #include <linux/slab.h> 26 + #include <linux/sys_soc.h> 26 27 27 28 #include "core.h" 28 29 ··· 569 568 .data = &r8a7794_pinmux_info, 570 569 }, 571 570 #endif 572 - #ifdef CONFIG_PINCTRL_PFC_R8A7795 571 + /* Both r8a7795 entries must be present to make sanity checks work */ 572 + #ifdef CONFIG_PINCTRL_PFC_R8A77950 573 573 { 574 574 .compatible = "renesas,pfc-r8a7795", 575 - .data = &r8a7795_pinmux_info, 575 + .data = &r8a77950_pinmux_info, 576 576 }, 577 - #ifdef DEBUG 577 + #endif 578 + #ifdef CONFIG_PINCTRL_PFC_R8A77951 578 579 { 579 - /* For sanity checks only (nothing matches against this) */ 580 - .compatible = "renesas,pfc-r8a77950", /* R-Car H3 ES1.0 */ 581 - .data = &r8a7795es1_pinmux_info, 580 + .compatible = "renesas,pfc-r8a7795", 581 + .data = &r8a77951_pinmux_info, 582 582 }, 583 - #endif /* DEBUG */ 584 583 #endif 585 584 #ifdef CONFIG_PINCTRL_PFC_R8A77960 586 585 { ··· 887 886 static inline void sh_pfc_check_driver(struct platform_driver *pdrv) {} 888 887 #endif /* !DEBUG */ 889 888 889 + #ifdef CONFIG_OF 890 + static const void *sh_pfc_quirk_match(void) 891 + { 892 + #if defined(CONFIG_PINCTRL_PFC_R8A77950) || \ 893 + defined(CONFIG_PINCTRL_PFC_R8A77951) 894 + const struct soc_device_attribute *match; 895 + static const struct soc_device_attribute quirks[] = { 896 + { 897 + .soc_id = "r8a7795", .revision = "ES1.*", 898 + .data = &r8a77950_pinmux_info, 899 + }, 900 + { 901 + .soc_id = "r8a7795", 902 + .data = &r8a77951_pinmux_info, 903 + }, 904 + 905 + { /* sentinel */ } 906 + }; 907 + 908 + match = soc_device_match(quirks); 909 + if (match) 910 + return match->data ?: ERR_PTR(-ENODEV); 911 + #endif /* CONFIG_PINCTRL_PFC_R8A77950 || CONFIG_PINCTRL_PFC_R8A77951 */ 912 + 913 + return NULL; 914 + } 915 + #endif /* CONFIG_OF */ 916 + 890 917 static int sh_pfc_probe(struct platform_device *pdev) 891 918 { 892 - #ifdef CONFIG_OF 893 - struct device_node *np = pdev->dev.of_node; 894 - #endif 895 919 const struct sh_pfc_soc_info *info; 896 920 struct sh_pfc *pfc; 897 921 int ret; 898 922 899 923 #ifdef CONFIG_OF 900 - if (np) 901 - info = of_device_get_match_data(&pdev->dev); 902 - else 924 + if (pdev->dev.of_node) { 925 + info = sh_pfc_quirk_match(); 926 + if (IS_ERR(info)) 927 + return PTR_ERR(info); 928 + 929 + if (!info) 930 + info = of_device_get_match_data(&pdev->dev); 931 + } else 903 932 #endif 904 933 info = (const void *)platform_get_device_id(pdev)->driver_data; 905 934
+5 -6
drivers/pinctrl/sh-pfc/gpio.c
··· 386 386 } 387 387 388 388 /* Register the function GPIOs chip. */ 389 - if (pfc->info->nr_func_gpios == 0) 390 - return 0; 391 - 392 - chip = sh_pfc_add_gpiochip(pfc, gpio_function_setup, NULL); 393 - if (IS_ERR(chip)) 394 - return PTR_ERR(chip); 389 + if (pfc->info->nr_func_gpios) { 390 + chip = sh_pfc_add_gpiochip(pfc, gpio_function_setup, NULL); 391 + if (IS_ERR(chip)) 392 + return PTR_ERR(chip); 393 + } 395 394 #endif /* CONFIG_PINCTRL_SH_FUNC_GPIO */ 396 395 397 396 return 0;
+2 -2
drivers/pinctrl/sh-pfc/pfc-r8a7778.c
··· 2305 2305 FN_ATAG0_A, 0, FN_REMOCON_B, 0, 2306 2306 /* IP0_11_8 [4] */ 2307 2307 FN_SD1_DAT2_A, FN_MMC_D2, 0, FN_BS, 2308 - FN_ATADIR0_A, 0, FN_SDSELF_B, 0, 2308 + FN_ATADIR0_A, 0, FN_SDSELF_A, 0, 2309 2309 FN_PWM4_B, 0, 0, 0, 2310 2310 0, 0, 0, 0, 2311 2311 /* IP0_7_5 [3] */ ··· 2349 2349 FN_TS_SDAT0_A, 0, 0, 0, 2350 2350 0, 0, 0, 0, 2351 2351 /* IP1_10_8 [3] */ 2352 - FN_SD1_CLK_B, FN_MMC_D6, 0, FN_A24, 2352 + FN_SD1_CD_A, FN_MMC_D6, 0, FN_A24, 2353 2353 FN_DREQ1_A, 0, FN_HRX0_B, FN_TS_SPSYNC0_A, 2354 2354 /* IP1_7_5 [3] */ 2355 2355 FN_A23, FN_HTX0_B, FN_TX2_B, FN_DACK2_A,
+13 -13
drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c drivers/pinctrl/sh-pfc/pfc-r8a77950.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * R8A7795 ES1.x processor support - PFC hardware block. 3 + * R8A77950 processor support - PFC hardware block. 4 4 * 5 5 * Copyright (C) 2015-2017 Renesas Electronics Corporation 6 6 */ ··· 5562 5562 { /* sentinel */ }, 5563 5563 }; 5564 5564 5565 - static int r8a7795es1_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, 5566 - u32 *pocctrl) 5565 + static int r8a77950_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, 5566 + u32 *pocctrl) 5567 5567 { 5568 5568 int bit = -EINVAL; 5569 5569 ··· 5820 5820 { /* sentinel */ }, 5821 5821 }; 5822 5822 5823 - static unsigned int r8a7795es1_pinmux_get_bias(struct sh_pfc *pfc, 5824 - unsigned int pin) 5823 + static unsigned int r8a77950_pinmux_get_bias(struct sh_pfc *pfc, 5824 + unsigned int pin) 5825 5825 { 5826 5826 const struct pinmux_bias_reg *reg; 5827 5827 unsigned int bit; ··· 5838 5838 return PIN_CONFIG_BIAS_PULL_DOWN; 5839 5839 } 5840 5840 5841 - static void r8a7795es1_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 5842 - unsigned int bias) 5841 + static void r8a77950_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 5842 + unsigned int bias) 5843 5843 { 5844 5844 const struct pinmux_bias_reg *reg; 5845 5845 u32 enable, updown; ··· 5861 5861 sh_pfc_write(pfc, reg->puen, enable); 5862 5862 } 5863 5863 5864 - static const struct sh_pfc_soc_operations r8a7795es1_pinmux_ops = { 5865 - .pin_to_pocctrl = r8a7795es1_pin_to_pocctrl, 5866 - .get_bias = r8a7795es1_pinmux_get_bias, 5867 - .set_bias = r8a7795es1_pinmux_set_bias, 5864 + static const struct sh_pfc_soc_operations r8a77950_pinmux_ops = { 5865 + .pin_to_pocctrl = r8a77950_pin_to_pocctrl, 5866 + .get_bias = r8a77950_pinmux_get_bias, 5867 + .set_bias = r8a77950_pinmux_set_bias, 5868 5868 }; 5869 5869 5870 - const struct sh_pfc_soc_info r8a7795es1_pinmux_info = { 5870 + const struct sh_pfc_soc_info r8a77950_pinmux_info = { 5871 5871 .name = "r8a77950_pfc", 5872 - .ops = &r8a7795es1_pinmux_ops, 5872 + .ops = &r8a77950_pinmux_ops, 5873 5873 .unlock_reg = 0xe6060000, /* PMMR */ 5874 5874 5875 5875 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+13 -26
drivers/pinctrl/sh-pfc/pfc-r8a7795.c drivers/pinctrl/sh-pfc/pfc-r8a77951.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * R8A7795 ES2.0+ processor support - PFC hardware block. 3 + * R8A77951 processor support - PFC hardware block. 4 4 * 5 5 * Copyright (C) 2015-2019 Renesas Electronics Corporation 6 6 */ ··· 5915 5915 { /* sentinel */ }, 5916 5916 }; 5917 5917 5918 - static int r8a7795_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl) 5918 + static int r8a77951_pin_to_pocctrl(struct sh_pfc *pfc, 5919 + unsigned int pin, u32 *pocctrl) 5919 5920 { 5920 5921 int bit = -EINVAL; 5921 5922 ··· 6173 6172 { /* sentinel */ }, 6174 6173 }; 6175 6174 6176 - static unsigned int r8a7795_pinmux_get_bias(struct sh_pfc *pfc, 6177 - unsigned int pin) 6175 + static unsigned int r8a77951_pinmux_get_bias(struct sh_pfc *pfc, 6176 + unsigned int pin) 6178 6177 { 6179 6178 const struct pinmux_bias_reg *reg; 6180 6179 unsigned int bit; ··· 6191 6190 return PIN_CONFIG_BIAS_PULL_DOWN; 6192 6191 } 6193 6192 6194 - static void r8a7795_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 6195 - unsigned int bias) 6193 + static void r8a77951_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, 6194 + unsigned int bias) 6196 6195 { 6197 6196 const struct pinmux_bias_reg *reg; 6198 6197 u32 enable, updown; ··· 6214 6213 sh_pfc_write(pfc, reg->puen, enable); 6215 6214 } 6216 6215 6217 - static const struct soc_device_attribute r8a7795es1[] = { 6218 - { .soc_id = "r8a7795", .revision = "ES1.*" }, 6219 - { /* sentinel */ } 6216 + static const struct sh_pfc_soc_operations r8a77951_pinmux_ops = { 6217 + .pin_to_pocctrl = r8a77951_pin_to_pocctrl, 6218 + .get_bias = r8a77951_pinmux_get_bias, 6219 + .set_bias = r8a77951_pinmux_set_bias, 6220 6220 }; 6221 6221 6222 - static int r8a7795_pinmux_init(struct sh_pfc *pfc) 6223 - { 6224 - if (soc_device_match(r8a7795es1)) 6225 - pfc->info = &r8a7795es1_pinmux_info; 6226 - 6227 - return 0; 6228 - } 6229 - 6230 - static const struct sh_pfc_soc_operations r8a7795_pinmux_ops = { 6231 - .init = r8a7795_pinmux_init, 6232 - .pin_to_pocctrl = r8a7795_pin_to_pocctrl, 6233 - .get_bias = r8a7795_pinmux_get_bias, 6234 - .set_bias = r8a7795_pinmux_set_bias, 6235 - }; 6236 - 6237 - const struct sh_pfc_soc_info r8a7795_pinmux_info = { 6222 + const struct sh_pfc_soc_info r8a77951_pinmux_info = { 6238 6223 .name = "r8a77951_pfc", 6239 - .ops = &r8a7795_pinmux_ops, 6224 + .ops = &r8a77951_pinmux_ops, 6240 6225 .unlock_reg = 0xe6060000, /* PMMR */ 6241 6226 6242 6227 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+3 -3
drivers/pinctrl/sh-pfc/pfc-r8a77965.c
··· 5998 5998 { PIN_DU_DOTCLKIN1, 0, 2 }, /* DU_DOTCLKIN1 */ 5999 5999 } }, 6000 6000 { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) { 6001 - { PIN_DU_DOTCLKIN3, 28, 2 }, /* DU_DOTCLKIN3 */ 6001 + { PIN_DU_DOTCLKIN3, 24, 2 }, /* DU_DOTCLKIN3 */ 6002 6002 { PIN_FSCLKST, 20, 2 }, /* FSCLKST */ 6003 6003 { PIN_TMS, 4, 2 }, /* TMS */ 6004 6004 } }, ··· 6254 6254 [31] = PIN_DU_DOTCLKIN1, /* DU_DOTCLKIN1 */ 6255 6255 } }, 6256 6256 { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) { 6257 - [ 0] = PIN_DU_DOTCLKIN3, /* DU_DOTCLKIN3 */ 6258 - [ 1] = SH_PFC_PIN_NONE, 6257 + [ 0] = SH_PFC_PIN_NONE, 6258 + [ 1] = PIN_DU_DOTCLKIN3, /* DU_DOTCLKIN3 */ 6259 6259 [ 2] = PIN_FSCLKST, /* FSCLKST */ 6260 6260 [ 3] = PIN_EXTALR, /* EXTALR*/ 6261 6261 [ 4] = PIN_TRST_N, /* TRST# */
+16 -17
drivers/pinctrl/sh-pfc/pfc-sh7264.c
··· 497 497 SD_WP_MARK, SD_CLK_MARK, SD_CMD_MARK, 498 498 CRX0_MARK, CRX1_MARK, 499 499 CTX0_MARK, CTX1_MARK, 500 + CRX0_CRX1_MARK, CTX0_CTX1_MARK, 500 501 501 502 PWM1A_MARK, PWM1B_MARK, PWM1C_MARK, PWM1D_MARK, 502 503 PWM1E_MARK, PWM1F_MARK, PWM1G_MARK, PWM1H_MARK, 503 504 PWM2A_MARK, PWM2B_MARK, PWM2C_MARK, PWM2D_MARK, 504 505 PWM2E_MARK, PWM2F_MARK, PWM2G_MARK, PWM2H_MARK, 505 506 IERXD_MARK, IETXD_MARK, 506 - CRX0_CRX1_MARK, 507 507 WDTOVF_MARK, 508 - 509 - CRX0X1_MARK, 510 508 511 509 /* DMAC */ 512 510 TEND0_MARK, DACK0_MARK, DREQ0_MARK, ··· 993 995 994 996 PINMUX_DATA(PJ3_DATA, PJ3MD_00), 995 997 PINMUX_DATA(CRX1_MARK, PJ3MD_01), 996 - PINMUX_DATA(CRX0X1_MARK, PJ3MD_10), 998 + PINMUX_DATA(CRX0_CRX1_MARK, PJ3MD_10), 997 999 PINMUX_DATA(IRQ1_PJ_MARK, PJ3MD_11), 998 1000 999 1001 PINMUX_DATA(PJ2_DATA, PJ2MD_000), 1000 1002 PINMUX_DATA(CTX1_MARK, PJ2MD_001), 1001 - PINMUX_DATA(CRX0_CRX1_MARK, PJ2MD_010), 1003 + PINMUX_DATA(CTX0_CTX1_MARK, PJ2MD_010), 1002 1004 PINMUX_DATA(CS2_MARK, PJ2MD_011), 1003 1005 PINMUX_DATA(SCK0_MARK, PJ2MD_100), 1004 1006 PINMUX_DATA(LCD_M_DISP_MARK, PJ2MD_101), ··· 1243 1245 GPIO_FN(CTX1), 1244 1246 GPIO_FN(CRX1), 1245 1247 GPIO_FN(CTX0), 1248 + GPIO_FN(CTX0_CTX1), 1246 1249 GPIO_FN(CRX0), 1247 1250 GPIO_FN(CRX0_CRX1), 1248 1251 ··· 2019 2020 2020 2021 { PINMUX_CFG_REG("PKIOR0", 0xfffe3932, 16, 1, GROUP( 2021 2022 0, 0, 0, 0, 0, 0, 0, 0, 2022 - PJ11_IN, PJ11_OUT, 2023 - PJ10_IN, PJ10_OUT, 2024 - PJ9_IN, PJ9_OUT, 2025 - PJ8_IN, PJ8_OUT, 2026 - PJ7_IN, PJ7_OUT, 2027 - PJ6_IN, PJ6_OUT, 2028 - PJ5_IN, PJ5_OUT, 2029 - PJ4_IN, PJ4_OUT, 2030 - PJ3_IN, PJ3_OUT, 2031 - PJ2_IN, PJ2_OUT, 2032 - PJ1_IN, PJ1_OUT, 2033 - PJ0_IN, PJ0_OUT )) 2023 + PK11_IN, PK11_OUT, 2024 + PK10_IN, PK10_OUT, 2025 + PK9_IN, PK9_OUT, 2026 + PK8_IN, PK8_OUT, 2027 + PK7_IN, PK7_OUT, 2028 + PK6_IN, PK6_OUT, 2029 + PK5_IN, PK5_OUT, 2030 + PK4_IN, PK4_OUT, 2031 + PK3_IN, PK3_OUT, 2032 + PK2_IN, PK2_OUT, 2033 + PK1_IN, PK1_OUT, 2034 + PK0_IN, PK0_OUT )) 2034 2035 }, 2035 2036 {} 2036 2037 };
+27 -12
drivers/pinctrl/sh-pfc/pfc-sh7269.c
··· 737 737 CRX0_MARK, CTX0_MARK, 738 738 CRX1_MARK, CTX1_MARK, 739 739 CRX2_MARK, CTX2_MARK, 740 - CRX0_CRX1_MARK, 741 - CRX0_CRX1_CRX2_MARK, 742 - CTX0CTX1CTX2_MARK, 740 + CRX0_CRX1_MARK, CTX0_CTX1_MARK, 741 + CRX0_CRX1_CRX2_MARK, CTX0_CTX1_CTX2_MARK, 743 742 CRX1_PJ22_MARK, CTX1_PJ23_MARK, 744 743 CRX2_PJ20_MARK, CTX2_PJ21_MARK, 745 - CRX0CRX1_PJ22_MARK, 746 - CRX0CRX1CRX2_PJ20_MARK, 744 + CRX0_CRX1_PJ22_MARK, CTX0_CTX1_PJ23_MARK, 745 + CRX0_CRX1_CRX2_PJ20_MARK, CTX0_CTX1_CTX2_PJ21_MARK, 747 746 748 747 /* VDC */ 749 748 DV_CLK_MARK, ··· 820 821 PINMUX_DATA(CS3_MARK, PC8MD_001), 821 822 PINMUX_DATA(TXD7_MARK, PC8MD_010), 822 823 PINMUX_DATA(CTX1_MARK, PC8MD_011), 824 + PINMUX_DATA(CTX0_CTX1_MARK, PC8MD_100), 823 825 824 826 PINMUX_DATA(PC7_DATA, PC7MD_000), 825 827 PINMUX_DATA(CKE_MARK, PC7MD_001), ··· 833 833 PINMUX_DATA(CAS_MARK, PC6MD_001), 834 834 PINMUX_DATA(SCK7_MARK, PC6MD_010), 835 835 PINMUX_DATA(CTX0_MARK, PC6MD_011), 836 + PINMUX_DATA(CTX0_CTX1_CTX2_MARK, PC6MD_100), 836 837 837 838 PINMUX_DATA(PC5_DATA, PC5MD_000), 838 839 PINMUX_DATA(RAS_MARK, PC5MD_001), 839 840 PINMUX_DATA(CRX0_MARK, PC5MD_011), 840 - PINMUX_DATA(CTX0CTX1CTX2_MARK, PC5MD_100), 841 + PINMUX_DATA(CTX0_CTX1_CTX2_MARK, PC5MD_100), 841 842 PINMUX_DATA(IRQ0_PC_MARK, PC5MD_101), 842 843 843 844 PINMUX_DATA(PC4_DATA, PC4MD_00), ··· 1290 1289 PINMUX_DATA(LCD_DATA23_PJ23_MARK, PJ23MD_010), 1291 1290 PINMUX_DATA(LCD_TCON6_MARK, PJ23MD_011), 1292 1291 PINMUX_DATA(IRQ3_PJ_MARK, PJ23MD_100), 1293 - PINMUX_DATA(CTX1_MARK, PJ23MD_101), 1292 + PINMUX_DATA(CTX1_PJ23_MARK, PJ23MD_101), 1293 + PINMUX_DATA(CTX0_CTX1_PJ23_MARK, PJ23MD_110), 1294 1294 1295 1295 PINMUX_DATA(PJ22_DATA, PJ22MD_000), 1296 1296 PINMUX_DATA(DV_DATA22_MARK, PJ22MD_001), 1297 1297 PINMUX_DATA(LCD_DATA22_PJ22_MARK, PJ22MD_010), 1298 1298 PINMUX_DATA(LCD_TCON5_MARK, PJ22MD_011), 1299 1299 PINMUX_DATA(IRQ2_PJ_MARK, PJ22MD_100), 1300 - PINMUX_DATA(CRX1_MARK, PJ22MD_101), 1301 - PINMUX_DATA(CRX0_CRX1_MARK, PJ22MD_110), 1300 + PINMUX_DATA(CRX1_PJ22_MARK, PJ22MD_101), 1301 + PINMUX_DATA(CRX0_CRX1_PJ22_MARK, PJ22MD_110), 1302 1302 1303 1303 PINMUX_DATA(PJ21_DATA, PJ21MD_000), 1304 1304 PINMUX_DATA(DV_DATA21_MARK, PJ21MD_001), 1305 1305 PINMUX_DATA(LCD_DATA21_PJ21_MARK, PJ21MD_010), 1306 1306 PINMUX_DATA(LCD_TCON4_MARK, PJ21MD_011), 1307 1307 PINMUX_DATA(IRQ1_PJ_MARK, PJ21MD_100), 1308 - PINMUX_DATA(CTX2_MARK, PJ21MD_101), 1308 + PINMUX_DATA(CTX2_PJ21_MARK, PJ21MD_101), 1309 + PINMUX_DATA(CTX0_CTX1_CTX2_PJ21_MARK, PJ21MD_110), 1309 1310 1310 1311 PINMUX_DATA(PJ20_DATA, PJ20MD_000), 1311 1312 PINMUX_DATA(DV_DATA20_MARK, PJ20MD_001), 1312 1313 PINMUX_DATA(LCD_DATA20_PJ20_MARK, PJ20MD_010), 1313 1314 PINMUX_DATA(LCD_TCON3_MARK, PJ20MD_011), 1314 1315 PINMUX_DATA(IRQ0_PJ_MARK, PJ20MD_100), 1315 - PINMUX_DATA(CRX2_MARK, PJ20MD_101), 1316 - PINMUX_DATA(CRX0CRX1CRX2_PJ20_MARK, PJ20MD_110), 1316 + PINMUX_DATA(CRX2_PJ20_MARK, PJ20MD_101), 1317 + PINMUX_DATA(CRX0_CRX1_CRX2_PJ20_MARK, PJ20MD_110), 1317 1318 1318 1319 PINMUX_DATA(PJ19_DATA, PJ19MD_000), 1319 1320 PINMUX_DATA(DV_DATA19_MARK, PJ19MD_001), ··· 1666 1663 GPIO_FN(WDTOVF), 1667 1664 1668 1665 /* CAN */ 1666 + GPIO_FN(CTX2), 1667 + GPIO_FN(CRX2), 1669 1668 GPIO_FN(CTX1), 1670 1669 GPIO_FN(CRX1), 1671 1670 GPIO_FN(CTX0), 1672 1671 GPIO_FN(CRX0), 1672 + GPIO_FN(CTX0_CTX1), 1673 1673 GPIO_FN(CRX0_CRX1), 1674 + GPIO_FN(CTX0_CTX1_CTX2), 1674 1675 GPIO_FN(CRX0_CRX1_CRX2), 1676 + GPIO_FN(CTX2_PJ21), 1677 + GPIO_FN(CRX2_PJ20), 1678 + GPIO_FN(CTX1_PJ23), 1679 + GPIO_FN(CRX1_PJ22), 1680 + GPIO_FN(CTX0_CTX1_PJ23), 1681 + GPIO_FN(CRX0_CRX1_PJ22), 1682 + GPIO_FN(CTX0_CTX1_CTX2_PJ21), 1683 + GPIO_FN(CRX0_CRX1_CRX2_PJ20), 1675 1684 1676 1685 /* DMAC */ 1677 1686 GPIO_FN(TEND0),
+2 -2
drivers/pinctrl/sh-pfc/sh_pfc.h
··· 318 318 extern const struct sh_pfc_soc_info r8a7792_pinmux_info; 319 319 extern const struct sh_pfc_soc_info r8a7793_pinmux_info; 320 320 extern const struct sh_pfc_soc_info r8a7794_pinmux_info; 321 - extern const struct sh_pfc_soc_info r8a7795_pinmux_info; 322 - extern const struct sh_pfc_soc_info r8a7795es1_pinmux_info; 321 + extern const struct sh_pfc_soc_info r8a77950_pinmux_info __weak; 322 + extern const struct sh_pfc_soc_info r8a77951_pinmux_info __weak; 323 323 extern const struct sh_pfc_soc_info r8a77960_pinmux_info; 324 324 extern const struct sh_pfc_soc_info r8a77961_pinmux_info; 325 325 extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
+1 -1
drivers/pinctrl/stm32/pinctrl-stm32.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 3 * Copyright (C) Maxime Coquelin 2015 4 4 * Copyright (C) STMicroelectronics 2017
+11 -2
drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/of.h> 21 21 #include <linux/of_device.h> 22 - #include <linux/of_irq.h> 23 22 #include <linux/pinctrl/pinctrl.h> 24 23 25 24 #include "pinctrl-sunxi.h" ··· 548 549 549 550 static int sun50i_h5_pinctrl_probe(struct platform_device *pdev) 550 551 { 551 - switch (of_irq_count(pdev->dev.of_node)) { 552 + int ret; 553 + 554 + ret = platform_irq_count(pdev); 555 + if (ret < 0) { 556 + if (ret != -EPROBE_DEFER) 557 + dev_err(&pdev->dev, "Couldn't determine irq count: %pe\n", 558 + ERR_PTR(ret)); 559 + return ret; 560 + } 561 + 562 + switch (ret) { 552 563 case 2: 553 564 dev_warn(&pdev->dev, 554 565 "Your device tree's pinctrl node is broken, which has no IRQ of PG bank routed.\n");
+2 -2
drivers/pinctrl/tegra/pinctrl-tegra.c
··· 648 648 { 649 649 struct tegra_pmx *pmx = dev_get_drvdata(dev); 650 650 u32 *backup_regs = pmx->backup_regs; 651 - u32 *regs; 651 + u32 __iomem *regs; 652 652 size_t bank_size; 653 653 unsigned int i, k; 654 654 ··· 666 666 { 667 667 struct tegra_pmx *pmx = dev_get_drvdata(dev); 668 668 u32 *backup_regs = pmx->backup_regs; 669 - u32 *regs; 669 + u32 __iomem *regs; 670 670 size_t bank_size; 671 671 unsigned int i, k; 672 672
-5
include/linux/gpio/driver.h
··· 582 582 void gpiochip_irq_domain_deactivate(struct irq_domain *domain, 583 583 struct irq_data *data); 584 584 585 - void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, 586 - struct irq_chip *irqchip, 587 - unsigned int parent_irq, 588 - irq_flow_handler_t parent_handler); 589 - 590 585 void gpiochip_set_nested_irqchip(struct gpio_chip *gpiochip, 591 586 struct irq_chip *irqchip, 592 587 unsigned int parent_irq);
+5
include/linux/pinctrl/machine.h
··· 153 153 154 154 extern int pinctrl_register_mappings(const struct pinctrl_map *map, 155 155 unsigned num_maps); 156 + extern void pinctrl_unregister_mappings(const struct pinctrl_map *map); 156 157 extern void pinctrl_provide_dummies(void); 157 158 #else 158 159 ··· 161 160 unsigned num_maps) 162 161 { 163 162 return 0; 163 + } 164 + 165 + static inline void pinctrl_unregister_mappings(const struct pinctrl_map *map) 166 + { 164 167 } 165 168 166 169 static inline void pinctrl_provide_dummies(void)