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

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

Pull pin control updates from Linus Walleij:
"This is the bulk of pin control changes for v4.19:

Core changes:

- Augment pinctrl_generic_add_group() and pinmux_generic_add_function()
to return the selector for the added group/function to the caller
and augment (hopefully) all drivers to handle this

New subdrivers:

- Qualcomm PM8998 and PM8005 are supported in the SPMI pin control
and GPIO driver

- Intel Ice Lake PCH (platform controller hub) support

- NXP (ex Freescale) i.MX8MQ support

- Berlin AS370 support

Improvements to drivers:

- Support interrupts on the Ocelot pin controller

- Add SPI pins to the Uniphier driver

- Define a GPIO compatible per SoC in the Tegra driver

- Push Tegra initialization down in the initlevels

- Support external wakeup interrupts on the Exynos

- Add generic clocks pins to the meson driver

- Add USB and HSCIF pins for some Renesas PFC chips

- Suspend/resume support in the armada-37xx

- Interrupt support for the Actions Semiconductor S900 also known as
"owl"

- Correct the pin ordering in Cedarfork

- Debugfs output for INTF in the mcp23s08 driver

- Avoid divisions in context save/restore in pinctrl-single

The rest is minor bug fixes or cleanups"

* tag 'pinctrl-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (69 commits)
pinctrl: nomadik: silence uninitialized variable warning
pinctrl: axp209: Fix NULL pointer dereference after allocation
pinctrl: samsung: Remove duplicated "wakeup" in printk
pinctrl: ocelot: add support for interrupt controller
pinctrl: intel: Don't shadow error code of gpiochip_lock_as_irq()
pinctrl: berlin: fix 'pctrl->functions' allocation in berlin_pinctrl_build_state
gpio: tegra: Move driver registration to subsys_init level
pinctrl: tegra: Move drivers registration to arch_init level
pinctrl: baytrail: actually print the apparently misconfigured pin
MAINTAINERS: Replace Heikki as maintainer of Intel pinctrl
pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
pinctrl: uniphier: add spi pin-mux settings
pinctrl: cannonlake: Fix community ordering for H variant
pinctrl: tegra: define GPIO compatible node per SoC
pinctrl: intel: Do pin translation when lock IRQ
pinctrl: imx: off by one in imx_pinconf_group_dbg_show()
pinctrl: mediatek: include chained_irq.h header
pinctrl/amd: only handle irq if it is pending and unmasked
pinctrl/amd: fix gpio irq level in debugfs
pinctrl: stm32: add syscfg mask parameter
...

+2936 -302
+10
Documentation/devicetree/bindings/pinctrl/actions,s900-pinctrl.txt
··· 19 19 defines the interrupt number, the second encodes 20 20 the trigger flags described in 21 21 bindings/interrupt-controller/interrupts.txt 22 + - interrupts: The interrupt outputs from the controller. There is one GPIO 23 + interrupt per GPIO bank. The number of interrupts listed depends 24 + on the number of GPIO banks on the SoC. The interrupts must be 25 + ordered by bank, starting with bank 0. 22 26 23 27 Please refer to pinctrl-bindings.txt in this directory for details of the 24 28 common pinctrl bindings used by client devices, including the meaning of the ··· 184 180 #gpio-cells = <2>; 185 181 interrupt-controller; 186 182 #interrupt-cells = <2>; 183 + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, 184 + <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, 185 + <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 186 + <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 187 + <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 188 + <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; 187 189 188 190 uart2-default: uart2-default { 189 191 pinmux {
+3
Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
··· 36 36 - GENERIC_PINCONFIG: generic pinconfig options to use, bias-disable, 37 37 bias-pull-down, bias-pull-up, drive-open-drain, input-schmitt-enable, 38 38 input-debounce, output-low, output-high. 39 + - atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for 40 + high drive. The default value is low drive. 39 41 40 42 Example: 41 43 ··· 68 66 pinmux = <PIN_PB0>, 69 67 <PIN_PB5>; 70 68 bias-pull-up; 69 + atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>; 71 70 }; 72 71 73 72 pinctrl_sdmmc1_default: sdmmc1_default {
+2 -1
Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt
··· 23 23 "marvell,berlin2q-system-pinctrl", 24 24 "marvell,berlin4ct-avio-pinctrl", 25 25 "marvell,berlin4ct-soc-pinctrl", 26 - "marvell,berlin4ct-system-pinctrl" 26 + "marvell,berlin4ct-system-pinctrl", 27 + "syna,as370-soc-pinctrl" 27 28 28 29 Required subnode-properties: 29 30 - groups: a list of strings describing the group names.
+36
Documentation/devicetree/bindings/pinctrl/fsl,imx8mq-pinctrl.txt
··· 1 + * Freescale IMX8MQ IOMUX Controller 2 + 3 + Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory 4 + for common binding part and usage. 5 + 6 + Required properties: 7 + - compatible: "fsl,imx8mq-iomuxc" 8 + - reg: should contain the base physical address and size of the iomuxc 9 + registers. 10 + 11 + Required properties in sub-nodes: 12 + - fsl,pins: each entry consists of 6 integers and represents the mux and config 13 + setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val 14 + input_val> are specified using a PIN_FUNC_ID macro, which can be found in 15 + imx8mq-pinfunc.h under device tree source folder. The last integer CONFIG is 16 + the pad setting value like pull-up on this pin. Please refer to i.MX8M Quad 17 + Reference Manual for detailed CONFIG settings. 18 + 19 + Examples: 20 + 21 + &uart1 { 22 + pinctrl-names = "default"; 23 + pinctrl-0 = <&pinctrl_uart1>; 24 + }; 25 + 26 + iomuxc: pinctrl@30330000 { 27 + compatible = "fsl,imx8mq-iomuxc"; 28 + reg = <0x0 0x30330000 0x0 0x10000>; 29 + 30 + pinctrl_uart1: uart1grp { 31 + fsl,pins = < 32 + MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX 0x49 33 + MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX 0x49 34 + >; 35 + }; 36 + };
+6
Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 72 67 73 68 pinctrl-names = "default"; 74 69 pinctrl-0 = <&gsbi5_uart_default>; 70 + gpio-ranges = <&msmgpio 0 0 90>; 75 71 76 72 gsbi5_uart_default: gsbi5_uart_default { 77 73 mux {
+9
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 162 154 163 155 gpio-controller; 164 156 #gpio-cells = <2>; 157 + gpio-ranges = <&tlmm 0 0 147>; 165 158 interrupt-controller; 166 159 #interrupt-cells = <2>; 167 160 interrupts = <0 208 0>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
··· 13 13 - #gpio-cells : Should be two. 14 14 The first cell is the gpio pin number and the 15 15 second cell is used for optional parameters. 16 + - gpio-ranges: see ../gpio/gpio.txt 17 + 18 + Optional properties: 19 + 20 + - gpio-reserved-ranges: see ../gpio/gpio.txt 16 21 17 22 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 18 23 a general description of GPIO and interrupt bindings. ··· 69 64 70 65 gpio-controller; 71 66 #gpio-cells = <2>; 67 + gpio-ranges = <&tlmm 0 0 100>; 72 68 interrupt-controller; 73 69 #interrupt-cells = <2>; 74 70 interrupts = <0 208 0>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,ipq8064-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 72 67 73 68 gpio-controller; 74 69 #gpio-cells = <2>; 70 + gpio-ranges = <&pinmux 0 0 69>; 75 71 interrupt-controller; 76 72 #interrupt-cells = <2>; 77 73 interrupts = <0 32 0x4>;
+9
Documentation/devicetree/bindings/pinctrl/qcom,ipq8074-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 156 148 interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 157 149 gpio-controller; 158 150 #gpio-cells = <2>; 151 + gpio-ranges = <&tlmm 0 0 70>; 159 152 interrupt-controller; 160 153 #interrupt-cells = <2>; 161 154
+9
Documentation/devicetree/bindings/pinctrl/qcom,mdm9615-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 135 127 136 128 gpio-controller; 137 129 #gpio-cells = <2>; 130 + gpio-ranges = <&msmgpio 0 0 88>; 138 131 interrupt-controller; 139 132 #interrupt-cells = <2>; 140 133 interrupts = <0 16 0x4>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,msm8660-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 67 62 68 63 gpio-controller; 69 64 #gpio-cells = <2>; 65 + gpio-ranges = <&msmgpio 0 0 173>; 70 66 interrupt-controller; 71 67 #interrupt-cells = <2>; 72 68 interrupts = <0 16 0x4>;
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8916-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 170 162 interrupts = <0 208 0>; 171 163 gpio-controller; 172 164 #gpio-cells = <2>; 165 + gpio-ranges = <&tlmm 0 0 122>; 173 166 interrupt-controller; 174 167 #interrupt-cells = <2>; 175 168
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 164 156 165 157 gpio-controller; 166 158 #gpio-cells = <2>; 159 + gpio-ranges = <&msmgpio 0 0 152>; 167 160 interrupt-controller; 168 161 #interrupt-cells = <2>; 169 162 interrupts = <0 16 0x4>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 92 87 93 88 gpio-controller; 94 89 #gpio-cells = <2>; 90 + gpio-ranges = <&msmgpio 0 0 146>; 95 91 interrupt-controller; 96 92 #interrupt-cells = <2>; 97 93 interrupts = <0 208 0>;
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8994-pinctrl.txt
··· 42 42 Definition: must be 2. Specifying the pin number and flags, as defined 43 43 in <dt-bindings/gpio/gpio.h> 44 44 45 + - gpio-ranges: 46 + Usage: required 47 + Definition: see ../gpio/gpio.txt 48 + 49 + - gpio-reserved-ranges: 50 + Usage: optional 51 + Definition: see ../gpio/gpio.txt 52 + 45 53 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 46 54 a general description of GPIO and interrupt bindings. 47 55 ··· 168 160 interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 169 161 gpio-controller; 170 162 #gpio-cells = <2>; 163 + gpio-ranges = <&msmgpio 0 0 146>; 171 164 interrupt-controller; 172 165 #interrupt-cells = <2>; 173 166
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8996-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 188 180 reg = <0x01010000 0x300000>; 189 181 interrupts = <0 208 0>; 190 182 gpio-controller; 183 + gpio-ranges = <&tlmm 0 0 150>; 191 184 #gpio-cells = <2>; 192 185 interrupt-controller; 193 186 #interrupt-cells = <2>;
+4 -2
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
··· 7 7 Usage: required 8 8 Value type: <string> 9 9 Definition: must be one of: 10 + "qcom,pm8005-gpio" 10 11 "qcom,pm8018-gpio" 11 12 "qcom,pm8038-gpio" 12 13 "qcom,pm8058-gpio" ··· 16 15 "qcom,pm8921-gpio" 17 16 "qcom,pm8941-gpio" 18 17 "qcom,pm8994-gpio" 19 - "qcom,pmi8994-gpio" 18 + "qcom,pm8998-gpio" 20 19 "qcom,pma8084-gpio" 21 20 "qcom,pmi8994-gpio" 22 21 ··· 79 78 Value type: <string-array> 80 79 Definition: List of gpio pins affected by the properties specified in 81 80 this subnode. Valid pins are: 81 + gpio1-gpio4 for pm8005 82 82 gpio1-gpio6 for pm8018 83 83 gpio1-gpio12 for pm8038 84 84 gpio1-gpio40 for pm8058 ··· 88 86 gpio1-gpio44 for pm8921 89 87 gpio1-gpio36 for pm8941 90 88 gpio1-gpio22 for pm8994 91 - gpio1-gpio10 for pmi8994 89 + gpio1-gpio26 for pm8998 92 90 gpio1-gpio22 for pma8084 93 91 gpio1-gpio10 for pmi8994 94 92
+9 -2
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
··· 145 145 146 146 B. External Wakeup Interrupts: For supporting external wakeup interrupts, a 147 147 child node representing the external wakeup interrupt controller should be 148 - included in the pin-controller device node. This child node should include 149 - the following properties. 148 + included in the pin-controller device node. 149 + 150 + Only one pin-controller device node can include external wakeup interrupts 151 + child node (in other words, only one External Wakeup Interrupts 152 + pin-controller is supported). 153 + 154 + This child node should include following properties: 150 155 151 156 - compatible: identifies the type of the external wakeup interrupt controller 152 157 The possible values are: ··· 161 156 found on Samsung S3C2412 and S3C2413 SoCs, 162 157 - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller 163 158 found on Samsung S3C64xx SoCs, 159 + - samsung,s5pv210-wakeup-eint: represents wakeup interrupt controller 160 + found on Samsung S5Pv210 SoCs, 164 161 - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller 165 162 found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs. 166 163 - samsung,exynos7-wakeup-eint: represents wakeup interrupt controller
+6 -3
Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt
··· 39 39 - reset: : Reference to the reset controller 40 40 - interrupt-parent: phandle of the interrupt parent to which the external 41 41 GPIO interrupts are forwarded to. 42 - - st,syscfg: Should be phandle/offset pair. The phandle to the syscon node 43 - which includes IRQ mux selection register, and the offset of the IRQ mux 44 - selection register. 42 + - st,syscfg: Should be phandle/offset/mask. 43 + -The phandle to the syscon node which includes IRQ mux selection register. 44 + -The offset of the IRQ mux selection register 45 + -The field mask of IRQ mux, needed if different of 0xf. 45 46 - gpio-ranges: Define a dedicated mapping between a pin-controller and 46 47 a gpio controller. Format is <&phandle a b c> with: 47 48 -(phandle): phandle of pin-controller. ··· 56 55 NOTE: If "gpio-ranges" is used for a gpio controller, all gpio-controller 57 56 have to use a "gpio-ranges" entry. 58 57 More details in Documentation/devicetree/bindings/gpio/gpio.txt. 58 + - st,bank-ioport: should correspond to the EXTI IOport selection (EXTI line 59 + used to select GPIOs as interrupts). 59 60 60 61 Example 1: 61 62 #include <dt-bindings/pinctrl/stm32f429-pinfunc.h>
+1 -1
MAINTAINERS
··· 11263 11263 11264 11264 PIN CONTROLLER - INTEL 11265 11265 M: Mika Westerberg <mika.westerberg@linux.intel.com> 11266 - M: Heikki Krogerus <heikki.krogerus@linux.intel.com> 11266 + M: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 11267 11267 S: Maintained 11268 11268 F: drivers/pinctrl/intel/ 11269 11269
+1 -1
arch/arm/mach-exynos/suspend.c
··· 272 272 static void exynos_pm_set_wakeup_mask(void) 273 273 { 274 274 /* Set wake-up mask registers */ 275 - pmu_raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK); 275 + pmu_raw_writel(exynos_get_eint_wake_mask(), EXYNOS_EINT_WAKEUP_MASK); 276 276 pmu_raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); 277 277 } 278 278
+1 -1
drivers/gpio/gpio-tegra.c
··· 720 720 { 721 721 return platform_driver_register(&tegra_gpio_driver); 722 722 } 723 - postcore_initcall(tegra_gpio_init); 723 + subsys_initcall(tegra_gpio_init);
+5 -4
drivers/pinctrl/Kconfig
··· 161 161 select REGMAP_SPI if SPI_MASTER 162 162 select GENERIC_PINCONF 163 163 help 164 - SPI/I2C driver for Microchip MCP23S08/MCP23S17/MCP23008/MCP23017 165 - I/O expanders. 166 - This provides a GPIO interface supporting inputs and outputs. 167 - The I2C versions of the chips can be used as interrupt-controller. 164 + SPI/I2C driver for Microchip MCP23S08 / MCP23S17 / MCP23S18 / 165 + MCP23008 / MCP23017 / MCP23018 I/O expanders. 166 + This provides a GPIO interface supporting inputs and outputs and a 167 + corresponding interrupt-controller. 168 168 169 169 config PINCTRL_OXNAS 170 170 bool ··· 332 332 depends on OF 333 333 depends on MSCC_OCELOT || COMPILE_TEST 334 334 select GPIOLIB 335 + select GPIOLIB_IRQCHIP 335 336 select GENERIC_PINCONF 336 337 select GENERIC_PINCTRL_GROUPS 337 338 select GENERIC_PINMUX_FUNCTIONS
+1
drivers/pinctrl/actions/Kconfig
··· 5 5 select PINCONF 6 6 select GENERIC_PINCONF 7 7 select GPIOLIB 8 + select GPIOLIB_IRQCHIP 8 9 help 9 10 Say Y here to enable Actions Semi OWL pinctrl driver 10 11
+266 -4
drivers/pinctrl/actions/pinctrl-owl.c
··· 13 13 #include <linux/err.h> 14 14 #include <linux/gpio/driver.h> 15 15 #include <linux/io.h> 16 + #include <linux/irq.h> 16 17 #include <linux/module.h> 17 18 #include <linux/of.h> 18 19 #include <linux/platform_device.h> ··· 46 45 struct clk *clk; 47 46 const struct owl_pinctrl_soc_data *soc; 48 47 void __iomem *base; 48 + struct irq_chip irq_chip; 49 + unsigned int num_irq; 50 + unsigned int *irq; 49 51 }; 50 52 51 53 static void owl_update_bits(void __iomem *base, u32 mask, u32 val) ··· 705 701 return 0; 706 702 } 707 703 704 + static void irq_set_type(struct owl_pinctrl *pctrl, int gpio, unsigned int type) 705 + { 706 + const struct owl_gpio_port *port; 707 + void __iomem *gpio_base; 708 + unsigned long flags; 709 + unsigned int offset, value, irq_type = 0; 710 + 711 + switch (type) { 712 + case IRQ_TYPE_EDGE_BOTH: 713 + /* 714 + * Since the hardware doesn't support interrupts on both edges, 715 + * emulate it in the software by setting the single edge 716 + * interrupt and switching to the opposite edge while ACKing 717 + * the interrupt 718 + */ 719 + if (owl_gpio_get(&pctrl->chip, gpio)) 720 + irq_type = OWL_GPIO_INT_EDGE_FALLING; 721 + else 722 + irq_type = OWL_GPIO_INT_EDGE_RISING; 723 + break; 724 + 725 + case IRQ_TYPE_EDGE_RISING: 726 + irq_type = OWL_GPIO_INT_EDGE_RISING; 727 + break; 728 + 729 + case IRQ_TYPE_EDGE_FALLING: 730 + irq_type = OWL_GPIO_INT_EDGE_FALLING; 731 + break; 732 + 733 + case IRQ_TYPE_LEVEL_HIGH: 734 + irq_type = OWL_GPIO_INT_LEVEL_HIGH; 735 + break; 736 + 737 + case IRQ_TYPE_LEVEL_LOW: 738 + irq_type = OWL_GPIO_INT_LEVEL_LOW; 739 + break; 740 + 741 + default: 742 + break; 743 + } 744 + 745 + port = owl_gpio_get_port(pctrl, &gpio); 746 + if (WARN_ON(port == NULL)) 747 + return; 748 + 749 + gpio_base = pctrl->base + port->offset; 750 + 751 + raw_spin_lock_irqsave(&pctrl->lock, flags); 752 + 753 + offset = (gpio < 16) ? 4 : 0; 754 + value = readl_relaxed(gpio_base + port->intc_type + offset); 755 + value &= ~(OWL_GPIO_INT_MASK << ((gpio % 16) * 2)); 756 + value |= irq_type << ((gpio % 16) * 2); 757 + writel_relaxed(value, gpio_base + port->intc_type + offset); 758 + 759 + raw_spin_unlock_irqrestore(&pctrl->lock, flags); 760 + } 761 + 762 + static void owl_gpio_irq_mask(struct irq_data *data) 763 + { 764 + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); 765 + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); 766 + const struct owl_gpio_port *port; 767 + void __iomem *gpio_base; 768 + unsigned long flags; 769 + unsigned int gpio = data->hwirq; 770 + u32 val; 771 + 772 + port = owl_gpio_get_port(pctrl, &gpio); 773 + if (WARN_ON(port == NULL)) 774 + return; 775 + 776 + gpio_base = pctrl->base + port->offset; 777 + 778 + raw_spin_lock_irqsave(&pctrl->lock, flags); 779 + 780 + owl_gpio_update_reg(gpio_base + port->intc_msk, gpio, false); 781 + 782 + /* disable port interrupt if no interrupt pending bit is active */ 783 + val = readl_relaxed(gpio_base + port->intc_msk); 784 + if (val == 0) 785 + owl_gpio_update_reg(gpio_base + port->intc_ctl, 786 + OWL_GPIO_CTLR_ENABLE, false); 787 + 788 + raw_spin_unlock_irqrestore(&pctrl->lock, flags); 789 + } 790 + 791 + static void owl_gpio_irq_unmask(struct irq_data *data) 792 + { 793 + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); 794 + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); 795 + const struct owl_gpio_port *port; 796 + void __iomem *gpio_base; 797 + unsigned long flags; 798 + unsigned int gpio = data->hwirq; 799 + u32 value; 800 + 801 + port = owl_gpio_get_port(pctrl, &gpio); 802 + if (WARN_ON(port == NULL)) 803 + return; 804 + 805 + gpio_base = pctrl->base + port->offset; 806 + raw_spin_lock_irqsave(&pctrl->lock, flags); 807 + 808 + /* enable port interrupt */ 809 + value = readl_relaxed(gpio_base + port->intc_ctl); 810 + value |= BIT(OWL_GPIO_CTLR_ENABLE) | BIT(OWL_GPIO_CTLR_SAMPLE_CLK_24M); 811 + writel_relaxed(value, gpio_base + port->intc_ctl); 812 + 813 + /* enable GPIO interrupt */ 814 + owl_gpio_update_reg(gpio_base + port->intc_msk, gpio, true); 815 + 816 + raw_spin_unlock_irqrestore(&pctrl->lock, flags); 817 + } 818 + 819 + static void owl_gpio_irq_ack(struct irq_data *data) 820 + { 821 + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); 822 + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); 823 + const struct owl_gpio_port *port; 824 + void __iomem *gpio_base; 825 + unsigned long flags; 826 + unsigned int gpio = data->hwirq; 827 + 828 + /* 829 + * Switch the interrupt edge to the opposite edge of the interrupt 830 + * which got triggered for the case of emulating both edges 831 + */ 832 + if (irqd_get_trigger_type(data) == IRQ_TYPE_EDGE_BOTH) { 833 + if (owl_gpio_get(gc, gpio)) 834 + irq_set_type(pctrl, gpio, IRQ_TYPE_EDGE_FALLING); 835 + else 836 + irq_set_type(pctrl, gpio, IRQ_TYPE_EDGE_RISING); 837 + } 838 + 839 + port = owl_gpio_get_port(pctrl, &gpio); 840 + if (WARN_ON(port == NULL)) 841 + return; 842 + 843 + gpio_base = pctrl->base + port->offset; 844 + 845 + raw_spin_lock_irqsave(&pctrl->lock, flags); 846 + 847 + owl_gpio_update_reg(gpio_base + port->intc_ctl, 848 + OWL_GPIO_CTLR_PENDING, true); 849 + 850 + raw_spin_unlock_irqrestore(&pctrl->lock, flags); 851 + } 852 + 853 + static int owl_gpio_irq_set_type(struct irq_data *data, unsigned int type) 854 + { 855 + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); 856 + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); 857 + 858 + if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 859 + irq_set_handler_locked(data, handle_level_irq); 860 + else 861 + irq_set_handler_locked(data, handle_edge_irq); 862 + 863 + irq_set_type(pctrl, data->hwirq, type); 864 + 865 + return 0; 866 + } 867 + 868 + static void owl_gpio_irq_handler(struct irq_desc *desc) 869 + { 870 + struct owl_pinctrl *pctrl = irq_desc_get_handler_data(desc); 871 + struct irq_chip *chip = irq_desc_get_chip(desc); 872 + struct irq_domain *domain = pctrl->chip.irq.domain; 873 + unsigned int parent = irq_desc_get_irq(desc); 874 + const struct owl_gpio_port *port; 875 + void __iomem *base; 876 + unsigned int pin, irq, offset = 0, i; 877 + unsigned long pending_irq; 878 + 879 + chained_irq_enter(chip, desc); 880 + 881 + for (i = 0; i < pctrl->soc->nports; i++) { 882 + port = &pctrl->soc->ports[i]; 883 + base = pctrl->base + port->offset; 884 + 885 + /* skip ports that are not associated with this irq */ 886 + if (parent != pctrl->irq[i]) 887 + goto skip; 888 + 889 + pending_irq = readl_relaxed(base + port->intc_pd); 890 + 891 + for_each_set_bit(pin, &pending_irq, port->pins) { 892 + irq = irq_find_mapping(domain, offset + pin); 893 + generic_handle_irq(irq); 894 + 895 + /* clear pending interrupt */ 896 + owl_gpio_update_reg(base + port->intc_pd, pin, true); 897 + } 898 + 899 + skip: 900 + offset += port->pins; 901 + } 902 + 903 + chained_irq_exit(chip, desc); 904 + } 905 + 708 906 static int owl_gpio_init(struct owl_pinctrl *pctrl) 709 907 { 710 908 struct gpio_chip *chip; 711 - int ret; 909 + struct gpio_irq_chip *gpio_irq; 910 + int ret, i, j, offset; 712 911 713 912 chip = &pctrl->chip; 714 913 chip->base = -1; ··· 920 713 chip->parent = pctrl->dev; 921 714 chip->owner = THIS_MODULE; 922 715 chip->of_node = pctrl->dev->of_node; 716 + 717 + pctrl->irq_chip.name = chip->of_node->name; 718 + pctrl->irq_chip.irq_ack = owl_gpio_irq_ack; 719 + pctrl->irq_chip.irq_mask = owl_gpio_irq_mask; 720 + pctrl->irq_chip.irq_unmask = owl_gpio_irq_unmask; 721 + pctrl->irq_chip.irq_set_type = owl_gpio_irq_set_type; 722 + 723 + gpio_irq = &chip->irq; 724 + gpio_irq->chip = &pctrl->irq_chip; 725 + gpio_irq->handler = handle_simple_irq; 726 + gpio_irq->default_type = IRQ_TYPE_NONE; 727 + gpio_irq->parent_handler = owl_gpio_irq_handler; 728 + gpio_irq->parent_handler_data = pctrl; 729 + gpio_irq->num_parents = pctrl->num_irq; 730 + gpio_irq->parents = pctrl->irq; 731 + 732 + gpio_irq->map = devm_kcalloc(pctrl->dev, chip->ngpio, 733 + sizeof(*gpio_irq->map), GFP_KERNEL); 734 + if (!gpio_irq->map) 735 + return -ENOMEM; 736 + 737 + for (i = 0, offset = 0; i < pctrl->soc->nports; i++) { 738 + const struct owl_gpio_port *port = &pctrl->soc->ports[i]; 739 + 740 + for (j = 0; j < port->pins; j++) 741 + gpio_irq->map[offset + j] = gpio_irq->parents[i]; 742 + 743 + offset += port->pins; 744 + } 923 745 924 746 ret = gpiochip_add_data(&pctrl->chip, pctrl); 925 747 if (ret) { ··· 964 728 { 965 729 struct resource *res; 966 730 struct owl_pinctrl *pctrl; 967 - int ret; 731 + int ret, i; 968 732 969 733 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); 970 734 if (!pctrl) ··· 1008 772 &owl_pinctrl_desc, pctrl); 1009 773 if (IS_ERR(pctrl->pctrldev)) { 1010 774 dev_err(&pdev->dev, "could not register Actions OWL pinmux driver\n"); 1011 - return PTR_ERR(pctrl->pctrldev); 775 + ret = PTR_ERR(pctrl->pctrldev); 776 + goto err_exit; 777 + } 778 + 779 + ret = platform_irq_count(pdev); 780 + if (ret < 0) 781 + goto err_exit; 782 + 783 + pctrl->num_irq = ret; 784 + 785 + pctrl->irq = devm_kcalloc(&pdev->dev, pctrl->num_irq, 786 + sizeof(*pctrl->irq), GFP_KERNEL); 787 + if (!pctrl->irq) { 788 + ret = -ENOMEM; 789 + goto err_exit; 790 + } 791 + 792 + for (i = 0; i < pctrl->num_irq ; i++) { 793 + ret = platform_get_irq(pdev, i); 794 + if (ret < 0) 795 + goto err_exit; 796 + pctrl->irq[i] = ret; 1012 797 } 1013 798 1014 799 ret = owl_gpio_init(pctrl); 1015 800 if (ret) 1016 - return ret; 801 + goto err_exit; 1017 802 1018 803 platform_set_drvdata(pdev, pctrl); 1019 804 1020 805 return 0; 806 + 807 + err_exit: 808 + clk_disable_unprepare(pctrl->clk); 809 + 810 + return ret; 1021 811 }
+21 -1
drivers/pinctrl/actions/pinctrl-owl.h
··· 29 29 OWL_PINCONF_DRV_12MA, 30 30 }; 31 31 32 + /* GPIO CTRL Bit Definition */ 33 + #define OWL_GPIO_CTLR_PENDING 0 34 + #define OWL_GPIO_CTLR_ENABLE 1 35 + #define OWL_GPIO_CTLR_SAMPLE_CLK_24M 2 36 + 37 + /* GPIO TYPE Bit Definition */ 38 + #define OWL_GPIO_INT_LEVEL_HIGH 0 39 + #define OWL_GPIO_INT_LEVEL_LOW 1 40 + #define OWL_GPIO_INT_EDGE_RISING 2 41 + #define OWL_GPIO_INT_EDGE_FALLING 3 42 + #define OWL_GPIO_INT_MASK 3 43 + 32 44 /** 33 45 * struct owl_pullctl - Actions pad pull control register 34 46 * @reg: offset to the pull control register ··· 133 121 * @outen: offset of the output enable register. 134 122 * @inen: offset of the input enable register. 135 123 * @dat: offset of the data register. 124 + * @intc_ctl: offset of the interrupt control register. 125 + * @intc_pd: offset of the interrupt pending register. 126 + * @intc_msk: offset of the interrupt mask register. 127 + * @intc_type: offset of the interrupt type register. 136 128 */ 137 129 struct owl_gpio_port { 138 130 unsigned int offset; ··· 144 128 unsigned int outen; 145 129 unsigned int inen; 146 130 unsigned int dat; 131 + unsigned int intc_ctl; 132 + unsigned int intc_pd; 133 + unsigned int intc_msk; 134 + unsigned int intc_type; 147 135 }; 148 136 149 137 /** ··· 160 140 * @ngroups: number of entries in @groups. 161 141 * @padinfo: array describing the pad info of this SoC. 162 142 * @ngpios: number of pingroups the driver should expose as GPIOs. 163 - * @port: array describing all GPIO ports of this SoC. 143 + * @ports: array describing all GPIO ports of this SoC. 164 144 * @nports: number of GPIO ports in this SoC. 165 145 */ 166 146 struct owl_pinctrl_soc_data {
+18 -13
drivers/pinctrl/actions/pinctrl-s900.c
··· 1821 1821 [SGPIO3] = PAD_INFO_PULLCTL_ST(SGPIO3) 1822 1822 }; 1823 1823 1824 - #define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat) \ 1825 - [OWL_GPIO_PORT_##port] = { \ 1826 - .offset = base, \ 1827 - .pins = count, \ 1828 - .outen = _outen, \ 1829 - .inen = _inen, \ 1830 - .dat = _dat, \ 1824 + #define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat, \ 1825 + _intc_ctl, _intc_pd, _intc_msk, _intc_type) \ 1826 + [OWL_GPIO_PORT_##port] = { \ 1827 + .offset = base, \ 1828 + .pins = count, \ 1829 + .outen = _outen, \ 1830 + .inen = _inen, \ 1831 + .dat = _dat, \ 1832 + .intc_ctl = _intc_ctl, \ 1833 + .intc_pd = _intc_pd, \ 1834 + .intc_msk = _intc_msk, \ 1835 + .intc_type = _intc_type, \ 1831 1836 } 1832 1837 1833 1838 static const struct owl_gpio_port s900_gpio_ports[] = { 1834 - OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8), 1835 - OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8), 1836 - OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8), 1837 - OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8), 1838 - OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8), 1839 - OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8) 1839 + OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8, 0x204, 0x208, 0x20C, 0x240), 1840 + OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8, 0x534, 0x204, 0x208, 0x23C), 1841 + OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8, 0x52C, 0x200, 0x204, 0x238), 1842 + OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8, 0x524, 0x1FC, 0x200, 0x234), 1843 + OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8, 0x51C, 0x1F8, 0x1FC, 0x230), 1844 + OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8, 0x460, 0x140, 0x144, 0x178) 1840 1845 }; 1841 1846 1842 1847 static struct owl_pinctrl_soc_data s900_pinctrl_data = {
+2 -2
drivers/pinctrl/aspeed/pinctrl-aspeed.c
··· 95 95 * 96 96 * @desc: The signal descriptor of interest 97 97 * @enabled: True to query the enabled state, false to query disabled state 98 - * @regmap: The IP block's regmap instance 98 + * @map: The IP block's regmap instance 99 99 * 100 100 * Return: 1 if the descriptor's bitfield is configured to the state 101 101 * selected by @enabled, 0 if not, and less than zero if an unrecoverable ··· 594 594 /** 595 595 * @param: pinconf configuration parameter 596 596 * @arg: The supported argument for @param, or -1 if any value is supported 597 - * @value: The register value to write to configure @arg for @param 597 + * @val: The register value to write to configure @arg for @param 598 598 * 599 599 * The map is to be used in conjunction with the configuration array supplied 600 600 * by the driver implementation.
+5
drivers/pinctrl/berlin/Kconfig
··· 5 5 select PINMUX 6 6 select REGMAP_MMIO 7 7 8 + config PINCTRL_AS370 9 + bool "Synaptics as370 pin controller driver" 10 + depends on OF 11 + select PINCTRL_BERLIN 12 + 8 13 config PINCTRL_BERLIN_BG2 9 14 def_bool MACH_BERLIN_BG2 10 15 depends on OF
+1
drivers/pinctrl/berlin/Makefile
··· 3 3 obj-$(CONFIG_PINCTRL_BERLIN_BG2CD) += berlin-bg2cd.o 4 4 obj-$(CONFIG_PINCTRL_BERLIN_BG2Q) += berlin-bg2q.o 5 5 obj-$(CONFIG_PINCTRL_BERLIN_BG4CT) += berlin-bg4ct.o 6 + obj-$(CONFIG_PINCTRL_AS370) += pinctrl-as370.o
+8 -6
drivers/pinctrl/berlin/berlin.c
··· 216 216 } 217 217 218 218 /* we will reallocate later */ 219 - pctrl->functions = devm_kcalloc(&pdev->dev, 220 - max_functions, 221 - sizeof(*pctrl->functions), 222 - GFP_KERNEL); 219 + pctrl->functions = kcalloc(max_functions, 220 + sizeof(*pctrl->functions), GFP_KERNEL); 223 221 if (!pctrl->functions) 224 222 return -ENOMEM; 225 223 ··· 255 257 function++; 256 258 } 257 259 258 - if (!found) 260 + if (!found) { 261 + kfree(pctrl->functions); 259 262 return -EINVAL; 263 + } 260 264 261 265 if (!function->groups) { 262 266 function->groups = ··· 267 267 sizeof(char *), 268 268 GFP_KERNEL); 269 269 270 - if (!function->groups) 270 + if (!function->groups) { 271 + kfree(pctrl->functions); 271 272 return -ENOMEM; 273 + } 272 274 } 273 275 274 276 groups = function->groups;
+368
drivers/pinctrl/berlin/pinctrl-as370.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Synaptics AS370 pinctrl driver 4 + * 5 + * Copyright (C) 2018 Synaptics Incorporated 6 + * 7 + * Author: Jisheng Zhang <jszhang@kernel.org> 8 + */ 9 + 10 + #include <linux/init.h> 11 + #include <linux/of_device.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/regmap.h> 14 + 15 + #include "berlin.h" 16 + 17 + static const struct berlin_desc_group as370_soc_pinctrl_groups[] = { 18 + BERLIN_PINCTRL_GROUP("I2S1_BCLKIO", 0x0, 0x3, 0x00, 19 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO0 */ 20 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* BCLKIO */ 21 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG0 */ 22 + BERLIN_PINCTRL_GROUP("I2S1_LRCKIO", 0x0, 0x3, 0x03, 23 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO1 */ 24 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* LRCKIO */ 25 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG1 */ 26 + BERLIN_PINCTRL_GROUP("I2S1_DO0", 0x0, 0x3, 0x06, 27 + BERLIN_PINCTRL_FUNCTION(0x0, "por"), /* 1P8V RSTB*/ 28 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO0 */ 29 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio"), /* GPIO2 */ 30 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG2 */ 31 + BERLIN_PINCTRL_GROUP("I2S1_DO1", 0x0, 0x3, 0x09, 32 + BERLIN_PINCTRL_FUNCTION(0x0, "por"), /* 3P3V RSTB */ 33 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO1 */ 34 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio"), /* GPIO3 */ 35 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG3 */ 36 + BERLIN_PINCTRL_GROUP("I2S1_DO2", 0x0, 0x3, 0x0c, 37 + BERLIN_PINCTRL_FUNCTION(0x0, "por"), /* CORE RSTB */ 38 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO2 */ 39 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm4"), 40 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio"), /* GPIO4 */ 41 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG4 */ 42 + BERLIN_PINCTRL_GROUP("I2S1_DO3", 0x0, 0x3, 0x0f, 43 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO5 */ 44 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO3 */ 45 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm5"), 46 + BERLIN_PINCTRL_FUNCTION(0x3, "spififib"), /* SPDIFIB */ 47 + BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"), /* SPDIFO */ 48 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG5 */ 49 + BERLIN_PINCTRL_GROUP("I2S1_MCLK", 0x0, 0x3, 0x12, 50 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO6 */ 51 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* MCLK */ 52 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG6 */ 53 + BERLIN_PINCTRL_GROUP("I2S2_BCLKIO", 0x0, 0x3, 0x15, 54 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO7 */ 55 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* BCLKIO */ 56 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG7 */ 57 + BERLIN_PINCTRL_GROUP("I2S2_LRCKIO", 0x0, 0x3, 0x18, 58 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO8 */ 59 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* LRCKIO */ 60 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG8 */ 61 + BERLIN_PINCTRL_GROUP("I2S2_DI0", 0x0, 0x3, 0x1b, 62 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO9 */ 63 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI0 */ 64 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm2"), 65 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG9 */ 66 + BERLIN_PINCTRL_GROUP("I2S2_DI1", 0x4, 0x3, 0x00, 67 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO10 */ 68 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI1 */ 69 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm3"), 70 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG10 */ 71 + BERLIN_PINCTRL_GROUP("I2S2_DI2", 0x4, 0x3, 0x03, 72 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO11 */ 73 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI2 */ 74 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm6"), 75 + BERLIN_PINCTRL_FUNCTION(0x3, "spdific"), /* SPDIFIC */ 76 + BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"), /* SPDIFO */ 77 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG11 */ 78 + BERLIN_PINCTRL_GROUP("I2S2_DI3", 0x4, 0x3, 0x06, 79 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO12 */ 80 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI3 */ 81 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm7"), 82 + BERLIN_PINCTRL_FUNCTION(0x3, "spdifia"), /* SPDIFIA */ 83 + BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"), /* SPDIFO */ 84 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG12 */ 85 + BERLIN_PINCTRL_GROUP("PDM_CLKO", 0x4, 0x3, 0x09, 86 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO13 */ 87 + BERLIN_PINCTRL_FUNCTION(0x1, "pdm"), /* CLKO */ 88 + BERLIN_PINCTRL_FUNCTION(0x2, "i2s2"), /* MCLK */ 89 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG13 */ 90 + BERLIN_PINCTRL_GROUP("PDM_DI0", 0x4, 0x3, 0x0c, 91 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO14 */ 92 + BERLIN_PINCTRL_FUNCTION(0x1, "pdm"), /* DI0 */ 93 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG14 */ 94 + BERLIN_PINCTRL_GROUP("PDM_DI1", 0x4, 0x3, 0x0f, 95 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO15 */ 96 + BERLIN_PINCTRL_FUNCTION(0x1, "pdm"), /* DI1 */ 97 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG15 */ 98 + BERLIN_PINCTRL_GROUP("PDM_DI2", 0x4, 0x3, 0x12, 99 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO16 */ 100 + BERLIN_PINCTRL_FUNCTION(0x1, "pdm"), /* DI2 */ 101 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm4"), 102 + BERLIN_PINCTRL_FUNCTION(0x3, "spdifid"), /* SPDIFID */ 103 + BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"), /* SPDIFO */ 104 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG16 */ 105 + BERLIN_PINCTRL_GROUP("PDM_DI3", 0x4, 0x3, 0x15, 106 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO17 */ 107 + BERLIN_PINCTRL_FUNCTION(0x1, "pdm"), /* DI3 */ 108 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm5"), 109 + BERLIN_PINCTRL_FUNCTION(0x3, "spdifi"), /* SPDIFI */ 110 + BERLIN_PINCTRL_FUNCTION(0x4, "spdifo"), /* SPDIFO */ 111 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG17 */ 112 + BERLIN_PINCTRL_GROUP("NAND_IO0", 0x4, 0x3, 0x18, 113 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO0 */ 114 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* DATA0 */ 115 + BERLIN_PINCTRL_FUNCTION(0x4, "pcie0")), /* MDIO */ 116 + BERLIN_PINCTRL_GROUP("NAND_IO1", 0x4, 0x3, 0x1b, 117 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO1 */ 118 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* DATA1 */ 119 + BERLIN_PINCTRL_FUNCTION(0x4, "pcie0")), /* MDC */ 120 + BERLIN_PINCTRL_GROUP("NAND_IO2", 0x8, 0x3, 0x00, 121 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO2 */ 122 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* DATA2 */ 123 + BERLIN_PINCTRL_FUNCTION(0x4, "pcie1")), /* MDIO */ 124 + BERLIN_PINCTRL_GROUP("NAND_IO3", 0x8, 0x3, 0x03, 125 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO3 */ 126 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* DATA3 */ 127 + BERLIN_PINCTRL_FUNCTION(0x4, "pcie1")), /* MDC */ 128 + BERLIN_PINCTRL_GROUP("NAND_IO4", 0x8, 0x3, 0x06, 129 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO4 */ 130 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc")), /* DATA4 */ 131 + BERLIN_PINCTRL_GROUP("NAND_IO5", 0x8, 0x3, 0x09, 132 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO5 */ 133 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc")), /* DATA5 */ 134 + BERLIN_PINCTRL_GROUP("NAND_IO6", 0x8, 0x3, 0x0c, 135 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO6 */ 136 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc")), /* DATA6 */ 137 + BERLIN_PINCTRL_GROUP("NAND_IO7", 0x8, 0x3, 0x0f, 138 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* IO7 */ 139 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc")), /* DATA7 */ 140 + BERLIN_PINCTRL_GROUP("NAND_ALE", 0x8, 0x3, 0x12, 141 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* ALE */ 142 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm6"), 143 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO18 */ 144 + BERLIN_PINCTRL_GROUP("NAND_CLE", 0x8, 0x3, 0x15, 145 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* CLE */ 146 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm7"), 147 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO19 */ 148 + BERLIN_PINCTRL_GROUP("NAND_WEn", 0x8, 0x3, 0x18, 149 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* WEn */ 150 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO20 */ 151 + BERLIN_PINCTRL_GROUP("NAND_REn", 0x8, 0x3, 0x1b, 152 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* REn */ 153 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO21 */ 154 + BERLIN_PINCTRL_GROUP("NAND_WPn", 0xc, 0x3, 0x00, 155 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* WPn */ 156 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* CLK */ 157 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO22 */ 158 + BERLIN_PINCTRL_GROUP("NAND_CEn", 0xc, 0x3, 0x03, 159 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* CEn */ 160 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* RSTn */ 161 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO23 */ 162 + BERLIN_PINCTRL_GROUP("NAND_RDY", 0xc, 0x3, 0x06, 163 + BERLIN_PINCTRL_FUNCTION(0x0, "nand"), /* RDY */ 164 + BERLIN_PINCTRL_FUNCTION(0x1, "emmc"), /* CMD */ 165 + BERLIN_PINCTRL_FUNCTION(0x3, "gpio")), /* GPIO24 */ 166 + BERLIN_PINCTRL_GROUP("SPI1_SS0n", 0xc, 0x3, 0x09, 167 + BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n */ 168 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* GPIO25 */ 169 + BERLIN_PINCTRL_GROUP("SPI1_SS1n", 0xc, 0x3, 0x0c, 170 + BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS1n */ 171 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio"), /* GPIO26 */ 172 + BERLIN_PINCTRL_FUNCTION(0x3, "pwm2")), 173 + BERLIN_PINCTRL_GROUP("SPI1_SS2n", 0xc, 0x3, 0x0f, 174 + BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* RXD */ 175 + BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS2n */ 176 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio"), /* GPIO27 */ 177 + BERLIN_PINCTRL_FUNCTION(0x3, "pwm3")), 178 + BERLIN_PINCTRL_GROUP("SPI1_SS3n", 0xc, 0x3, 0x12, 179 + BERLIN_PINCTRL_FUNCTION(0x0, "uart0"), /* TXD */ 180 + BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS3n */ 181 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO28 */ 182 + BERLIN_PINCTRL_GROUP("SPI1_SCLK", 0xc, 0x3, 0x15, 183 + BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SCLK */ 184 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO29 */ 185 + BERLIN_PINCTRL_FUNCTION(0x3, "pwm4")), 186 + BERLIN_PINCTRL_GROUP("SPI1_SDO", 0xc, 0x3, 0x18, 187 + BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SDO */ 188 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO30 */ 189 + BERLIN_PINCTRL_FUNCTION(0x3, "pwm5")), 190 + BERLIN_PINCTRL_GROUP("SPI1_SDI", 0xc, 0x3, 0x1b, 191 + BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SDI */ 192 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio")), /* GPIO31 */ 193 + BERLIN_PINCTRL_GROUP("USB0_DRV_VBUS", 0x10, 0x3, 0x00, 194 + BERLIN_PINCTRL_FUNCTION(0x0, "usb0"), /* VBUS */ 195 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO32 */ 196 + BERLIN_PINCTRL_FUNCTION(0x3, "refclko")), /* 25M */ 197 + BERLIN_PINCTRL_GROUP("TW1_SCL", 0x10, 0x3, 0x03, 198 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO33 */ 199 + BERLIN_PINCTRL_FUNCTION(0x1, "tw1")), /* SCL */ 200 + BERLIN_PINCTRL_GROUP("TW1_SDA", 0x10, 0x3, 0x06, 201 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO34 */ 202 + BERLIN_PINCTRL_FUNCTION(0x1, "tw1")), /* SDA */ 203 + BERLIN_PINCTRL_GROUP("TW0_SCL", 0x10, 0x3, 0x09, 204 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO35 */ 205 + BERLIN_PINCTRL_FUNCTION(0x1, "tw0")), /* SCL */ 206 + BERLIN_PINCTRL_GROUP("TW0_SDA", 0x10, 0x3, 0x0c, 207 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO36 */ 208 + BERLIN_PINCTRL_FUNCTION(0x1, "tw0")), /* SDA */ 209 + BERLIN_PINCTRL_GROUP("TMS", 0x10, 0x3, 0x0f, 210 + BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TMS */ 211 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO37 */ 212 + BERLIN_PINCTRL_FUNCTION(0x4, "pwm0")), 213 + BERLIN_PINCTRL_GROUP("TDI", 0x10, 0x3, 0x12, 214 + BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDI */ 215 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO38 */ 216 + BERLIN_PINCTRL_FUNCTION(0x4, "pwm1")), 217 + BERLIN_PINCTRL_GROUP("TDO", 0x10, 0x3, 0x15, 218 + BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDO */ 219 + BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* GPIO39 */ 220 + BERLIN_PINCTRL_FUNCTION(0x4, "pwm0")), 221 + BERLIN_PINCTRL_GROUP("PWM6", 0x10, 0x3, 0x18, 222 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO40 */ 223 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm6")), 224 + BERLIN_PINCTRL_GROUP("PWM7", 0x10, 0x3, 0x1b, 225 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO41 */ 226 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm7")), 227 + BERLIN_PINCTRL_GROUP("PWM0", 0x14, 0x3, 0x00, 228 + BERLIN_PINCTRL_FUNCTION(0x0, "por"), /* VDDCPUSOC RSTB */ 229 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm0"), 230 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO42 */ 231 + BERLIN_PINCTRL_GROUP("PWM1", 0x14, 0x3, 0x03, 232 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO43 */ 233 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm1")), 234 + BERLIN_PINCTRL_GROUP("PWM2", 0x14, 0x3, 0x06, 235 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO44 */ 236 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm2")), 237 + BERLIN_PINCTRL_GROUP("PWM3", 0x14, 0x3, 0x09, 238 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO45 */ 239 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm3")), 240 + BERLIN_PINCTRL_GROUP("PWM4", 0x14, 0x3, 0x0c, 241 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO46 */ 242 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm4")), 243 + BERLIN_PINCTRL_GROUP("PWM5", 0x14, 0x3, 0x0f, 244 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO47 */ 245 + BERLIN_PINCTRL_FUNCTION(0x1, "pwm5")), 246 + BERLIN_PINCTRL_GROUP("URT1_RTSn", 0x14, 0x3, 0x12, 247 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO48 */ 248 + BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* RTSn */ 249 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm6"), 250 + BERLIN_PINCTRL_FUNCTION(0x3, "tw1a"), /* SCL */ 251 + BERLIN_PINCTRL_FUNCTION(0x4, "aio"), /* DBG0 */ 252 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG18 */ 253 + BERLIN_PINCTRL_GROUP("URT1_CTSn", 0x14, 0x3, 0x15, 254 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO49 */ 255 + BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* CTSn */ 256 + BERLIN_PINCTRL_FUNCTION(0x2, "pwm7"), 257 + BERLIN_PINCTRL_FUNCTION(0x3, "tw1a"), /* SDA */ 258 + BERLIN_PINCTRL_FUNCTION(0x4, "aio"), /* DBG1 */ 259 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG19 */ 260 + BERLIN_PINCTRL_GROUP("URT1_RXD", 0x14, 0x3, 0x18, 261 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO50 */ 262 + BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* RXD */ 263 + BERLIN_PINCTRL_FUNCTION(0x4, "aio"), /* DBG2 */ 264 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG20 */ 265 + BERLIN_PINCTRL_GROUP("URT1_TXD", 0x14, 0x3, 0x1b, 266 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO51 */ 267 + BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* TXD */ 268 + BERLIN_PINCTRL_FUNCTION(0x4, "aio"), /* DBG3 */ 269 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG21 */ 270 + BERLIN_PINCTRL_GROUP("I2S3_DI", 0x18, 0x3, 0x00, 271 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO52 */ 272 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* DI */ 273 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG22 */ 274 + BERLIN_PINCTRL_GROUP("I2S3_DO", 0x18, 0x3, 0x03, 275 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO53 */ 276 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* DO */ 277 + BERLIN_PINCTRL_FUNCTION(0x5, "phy")), /* DBG23 */ 278 + BERLIN_PINCTRL_GROUP("I2S3_BCLKIO", 0x18, 0x3, 0x06, 279 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO54 */ 280 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* BCLKIO */ 281 + BERLIN_PINCTRL_FUNCTION(0x5, "clk")), /* DBG */ 282 + BERLIN_PINCTRL_GROUP("I2S3_LRCKIO", 0x18, 0x3, 0x09, 283 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO55 */ 284 + BERLIN_PINCTRL_FUNCTION(0x1, "i2s3")), /* LRCKIO */ 285 + BERLIN_PINCTRL_GROUP("SD0_DAT0", 0x18, 0x3, 0x0c, 286 + BERLIN_PINCTRL_FUNCTION(0x0, "cpupll"), /* OUT */ 287 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT0 */ 288 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO56 */ 289 + BERLIN_PINCTRL_GROUP("SD0_DAT1", 0x18, 0x3, 0x0f, 290 + BERLIN_PINCTRL_FUNCTION(0x0, "syspll"), /* OUT */ 291 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT1 */ 292 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO57 */ 293 + BERLIN_PINCTRL_GROUP("SD0_CLK", 0x18, 0x3, 0x12, 294 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO58 */ 295 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0")), /* CLK */ 296 + BERLIN_PINCTRL_GROUP("SD0_DAT2", 0x18, 0x3, 0x15, 297 + BERLIN_PINCTRL_FUNCTION(0x0, "mempll"), /* OUT */ 298 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT2 */ 299 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO59 */ 300 + BERLIN_PINCTRL_GROUP("SD0_DAT3", 0x18, 0x3, 0x18, 301 + BERLIN_PINCTRL_FUNCTION(0x0, "apll0"), /* OUT */ 302 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* DAT3 */ 303 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO60 */ 304 + BERLIN_PINCTRL_GROUP("SD0_CMD", 0x18, 0x3, 0x1b, 305 + BERLIN_PINCTRL_FUNCTION(0x0, "apll1"), /* OUT */ 306 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CMD */ 307 + BERLIN_PINCTRL_FUNCTION(0x2, "gpio")), /* GPIO61 */ 308 + BERLIN_PINCTRL_GROUP("SD0_CDn", 0x1c, 0x3, 0x00, 309 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO62 */ 310 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* CDn */ 311 + BERLIN_PINCTRL_FUNCTION(0x3, "pwm2")), 312 + BERLIN_PINCTRL_GROUP("SD0_WP", 0x1c, 0x3, 0x03, 313 + BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO63 */ 314 + BERLIN_PINCTRL_FUNCTION(0x1, "sd0"), /* WP */ 315 + BERLIN_PINCTRL_FUNCTION(0x3, "pwm3")), 316 + }; 317 + 318 + static const struct berlin_pinctrl_desc as370_soc_pinctrl_data = { 319 + .groups = as370_soc_pinctrl_groups, 320 + .ngroups = ARRAY_SIZE(as370_soc_pinctrl_groups), 321 + }; 322 + 323 + static const struct of_device_id as370_pinctrl_match[] = { 324 + { 325 + .compatible = "syna,as370-soc-pinctrl", 326 + .data = &as370_soc_pinctrl_data, 327 + }, 328 + {} 329 + }; 330 + 331 + static int as370_pinctrl_probe(struct platform_device *pdev) 332 + { 333 + const struct of_device_id *match = 334 + of_match_device(as370_pinctrl_match, &pdev->dev); 335 + struct regmap_config *rmconfig; 336 + struct regmap *regmap; 337 + struct resource *res; 338 + void __iomem *base; 339 + 340 + rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL); 341 + if (!rmconfig) 342 + return -ENOMEM; 343 + 344 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 345 + base = devm_ioremap_resource(&pdev->dev, res); 346 + if (IS_ERR(base)) 347 + return PTR_ERR(base); 348 + 349 + rmconfig->reg_bits = 32, 350 + rmconfig->val_bits = 32, 351 + rmconfig->reg_stride = 4, 352 + rmconfig->max_register = resource_size(res); 353 + 354 + regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig); 355 + if (IS_ERR(regmap)) 356 + return PTR_ERR(regmap); 357 + 358 + return berlin_pinctrl_probe_regmap(pdev, match->data, regmap); 359 + } 360 + 361 + static struct platform_driver as370_pinctrl_driver = { 362 + .probe = as370_pinctrl_probe, 363 + .driver = { 364 + .name = "as370-pinctrl", 365 + .of_match_table = as370_pinctrl_match, 366 + }, 367 + }; 368 + builtin_platform_driver(as370_pinctrl_driver);
+32 -4
drivers/pinctrl/core.c
··· 21 21 #include <linux/slab.h> 22 22 #include <linux/err.h> 23 23 #include <linux/list.h> 24 - #include <linux/sysfs.h> 25 24 #include <linux/debugfs.h> 26 25 #include <linux/seq_file.h> 27 26 #include <linux/pinctrl/consumer.h> ··· 616 617 } 617 618 EXPORT_SYMBOL_GPL(pinctrl_generic_get_group); 618 619 620 + static int pinctrl_generic_group_name_to_selector(struct pinctrl_dev *pctldev, 621 + const char *function) 622 + { 623 + const struct pinctrl_ops *ops = pctldev->desc->pctlops; 624 + int ngroups = ops->get_groups_count(pctldev); 625 + int selector = 0; 626 + 627 + /* See if this pctldev has this group */ 628 + while (selector < ngroups) { 629 + const char *gname = ops->get_group_name(pctldev, selector); 630 + 631 + if (!strcmp(function, gname)) 632 + return selector; 633 + 634 + selector++; 635 + } 636 + 637 + return -EINVAL; 638 + } 639 + 619 640 /** 620 641 * pinctrl_generic_add_group() - adds a new pin group 621 642 * @pctldev: pin controller device ··· 650 631 int *pins, int num_pins, void *data) 651 632 { 652 633 struct group_desc *group; 634 + int selector; 635 + 636 + if (!name) 637 + return -EINVAL; 638 + 639 + selector = pinctrl_generic_group_name_to_selector(pctldev, name); 640 + if (selector >= 0) 641 + return selector; 642 + 643 + selector = pctldev->num_groups; 653 644 654 645 group = devm_kzalloc(pctldev->dev, sizeof(*group), GFP_KERNEL); 655 646 if (!group) ··· 670 641 group->num_pins = num_pins; 671 642 group->data = data; 672 643 673 - radix_tree_insert(&pctldev->pin_group_tree, pctldev->num_groups, 674 - group); 644 + radix_tree_insert(&pctldev->pin_group_tree, selector, group); 675 645 676 646 pctldev->num_groups++; 677 647 678 - return 0; 648 + return selector; 679 649 } 680 650 EXPORT_SYMBOL_GPL(pinctrl_generic_add_group); 681 651
-6
drivers/pinctrl/core.h
··· 218 218 int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev, 219 219 unsigned int group_selector); 220 220 221 - static inline int 222 - pinctrl_generic_remove_last_group(struct pinctrl_dev *pctldev) 223 - { 224 - return pinctrl_generic_remove_group(pctldev, pctldev->num_groups - 1); 225 - } 226 - 227 221 #endif /* CONFIG_GENERIC_PINCTRL_GROUPS */ 228 222 229 223 struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *dev_name);
+7
drivers/pinctrl/freescale/Kconfig
··· 117 117 help 118 118 Say Y here to enable the imx7ulp pinctrl driver 119 119 120 + config PINCTRL_IMX8MQ 121 + bool "IMX8MQ pinctrl driver" 122 + depends on SOC_IMX8MQ 123 + select PINCTRL_IMX 124 + help 125 + Say Y here to enable the imx8mq pinctrl driver 126 + 120 127 config PINCTRL_VF610 121 128 bool "Freescale Vybrid VF610 pinctrl driver" 122 129 depends on SOC_VF610
+1
drivers/pinctrl/freescale/Makefile
··· 17 17 obj-$(CONFIG_PINCTRL_IMX6UL) += pinctrl-imx6ul.o 18 18 obj-$(CONFIG_PINCTRL_IMX7D) += pinctrl-imx7d.o 19 19 obj-$(CONFIG_PINCTRL_IMX7ULP) += pinctrl-imx7ulp.o 20 + obj-$(CONFIG_PINCTRL_IMX8MQ) += pinctrl-imx8mq.o 20 21 obj-$(CONFIG_PINCTRL_VF610) += pinctrl-vf610.o 21 22 obj-$(CONFIG_PINCTRL_MXS) += pinctrl-mxs.o 22 23 obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o
+1 -1
drivers/pinctrl/freescale/pinctrl-imx.c
··· 383 383 const char *name; 384 384 int i, ret; 385 385 386 - if (group > pctldev->num_groups) 386 + if (group >= pctldev->num_groups) 387 387 return; 388 388 389 389 seq_puts(s, "\n");
+1 -1
drivers/pinctrl/freescale/pinctrl-imx1-core.c
··· 429 429 const char *name; 430 430 int i, ret; 431 431 432 - if (group > info->ngroups) 432 + if (group >= info->ngroups) 433 433 return; 434 434 435 435 seq_puts(s, "\n");
+351
drivers/pinctrl/freescale/pinctrl-imx8mq.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2016 Freescale Semiconductor, Inc. 4 + * Copyright 2017-2018 NXP 5 + * Copyright (C) 2018 Pengutronix, Lucas Stach <kernel@pengutronix.de> 6 + */ 7 + 8 + #include <linux/err.h> 9 + #include <linux/init.h> 10 + #include <linux/io.h> 11 + #include <linux/of.h> 12 + #include <linux/of_device.h> 13 + #include <linux/pinctrl/pinctrl.h> 14 + 15 + #include "pinctrl-imx.h" 16 + 17 + enum imx8mq_pads { 18 + MX8MQ_PAD_RESERVE0 = 0, 19 + MX8MQ_PAD_RESERVE1 = 1, 20 + MX8MQ_PAD_RESERVE2 = 2, 21 + MX8MQ_PAD_RESERVE3 = 3, 22 + MX8MQ_PAD_RESERVE4 = 4, 23 + MX8MQ_IOMUXC_PMIC_STBY_REQ_CCMSRCGPCMIX = 5, 24 + MX8MQ_IOMUXC_PMIC_ON_REQ_SNVSMIX = 6, 25 + MX8MQ_IOMUXC_ONOFF_SNVSMIX = 7, 26 + MX8MQ_IOMUXC_POR_B_SNVSMIX = 8, 27 + MX8MQ_IOMUXC_RTC_RESET_B_SNVSMIX = 9, 28 + MX8MQ_IOMUXC_GPIO1_IO00 = 10, 29 + MX8MQ_IOMUXC_GPIO1_IO01 = 11, 30 + MX8MQ_IOMUXC_GPIO1_IO02 = 12, 31 + MX8MQ_IOMUXC_GPIO1_IO03 = 13, 32 + MX8MQ_IOMUXC_GPIO1_IO04 = 14, 33 + MX8MQ_IOMUXC_GPIO1_IO05 = 15, 34 + MX8MQ_IOMUXC_GPIO1_IO06 = 16, 35 + MX8MQ_IOMUXC_GPIO1_IO07 = 17, 36 + MX8MQ_IOMUXC_GPIO1_IO08 = 18, 37 + MX8MQ_IOMUXC_GPIO1_IO09 = 19, 38 + MX8MQ_IOMUXC_GPIO1_IO10 = 20, 39 + MX8MQ_IOMUXC_GPIO1_IO11 = 21, 40 + MX8MQ_IOMUXC_GPIO1_IO12 = 22, 41 + MX8MQ_IOMUXC_GPIO1_IO13 = 23, 42 + MX8MQ_IOMUXC_GPIO1_IO14 = 24, 43 + MX8MQ_IOMUXC_GPIO1_IO15 = 25, 44 + MX8MQ_IOMUXC_ENET_MDC = 26, 45 + MX8MQ_IOMUXC_ENET_MDIO = 27, 46 + MX8MQ_IOMUXC_ENET_TD3 = 28, 47 + MX8MQ_IOMUXC_ENET_TD2 = 29, 48 + MX8MQ_IOMUXC_ENET_TD1 = 30, 49 + MX8MQ_IOMUXC_ENET_TD0 = 31, 50 + MX8MQ_IOMUXC_ENET_TX_CTL = 32, 51 + MX8MQ_IOMUXC_ENET_TXC = 33, 52 + MX8MQ_IOMUXC_ENET_RX_CTL = 34, 53 + MX8MQ_IOMUXC_ENET_RXC = 35, 54 + MX8MQ_IOMUXC_ENET_RD0 = 36, 55 + MX8MQ_IOMUXC_ENET_RD1 = 37, 56 + MX8MQ_IOMUXC_ENET_RD2 = 38, 57 + MX8MQ_IOMUXC_ENET_RD3 = 39, 58 + MX8MQ_IOMUXC_SD1_CLK = 40, 59 + MX8MQ_IOMUXC_SD1_CMD = 41, 60 + MX8MQ_IOMUXC_SD1_DATA0 = 42, 61 + MX8MQ_IOMUXC_SD1_DATA1 = 43, 62 + MX8MQ_IOMUXC_SD1_DATA2 = 44, 63 + MX8MQ_IOMUXC_SD1_DATA3 = 45, 64 + MX8MQ_IOMUXC_SD1_DATA4 = 46, 65 + MX8MQ_IOMUXC_SD1_DATA5 = 47, 66 + MX8MQ_IOMUXC_SD1_DATA6 = 48, 67 + MX8MQ_IOMUXC_SD1_DATA7 = 49, 68 + MX8MQ_IOMUXC_SD1_RESET_B = 50, 69 + MX8MQ_IOMUXC_SD1_STROBE = 51, 70 + MX8MQ_IOMUXC_SD2_CD_B = 52, 71 + MX8MQ_IOMUXC_SD2_CLK = 53, 72 + MX8MQ_IOMUXC_SD2_CMD = 54, 73 + MX8MQ_IOMUXC_SD2_DATA0 = 55, 74 + MX8MQ_IOMUXC_SD2_DATA1 = 56, 75 + MX8MQ_IOMUXC_SD2_DATA2 = 57, 76 + MX8MQ_IOMUXC_SD2_DATA3 = 58, 77 + MX8MQ_IOMUXC_SD2_RESET_B = 59, 78 + MX8MQ_IOMUXC_SD2_WP = 60, 79 + MX8MQ_IOMUXC_NAND_ALE = 61, 80 + MX8MQ_IOMUXC_NAND_CE0_B = 62, 81 + MX8MQ_IOMUXC_NAND_CE1_B = 63, 82 + MX8MQ_IOMUXC_NAND_CE2_B = 64, 83 + MX8MQ_IOMUXC_NAND_CE3_B = 65, 84 + MX8MQ_IOMUXC_NAND_CLE = 66, 85 + MX8MQ_IOMUXC_NAND_DATA00 = 67, 86 + MX8MQ_IOMUXC_NAND_DATA01 = 68, 87 + MX8MQ_IOMUXC_NAND_DATA02 = 69, 88 + MX8MQ_IOMUXC_NAND_DATA03 = 70, 89 + MX8MQ_IOMUXC_NAND_DATA04 = 71, 90 + MX8MQ_IOMUXC_NAND_DATA05 = 72, 91 + MX8MQ_IOMUXC_NAND_DATA06 = 73, 92 + MX8MQ_IOMUXC_NAND_DATA07 = 74, 93 + MX8MQ_IOMUXC_NAND_DQS = 75, 94 + MX8MQ_IOMUXC_NAND_RE_B = 76, 95 + MX8MQ_IOMUXC_NAND_READY_B = 77, 96 + MX8MQ_IOMUXC_NAND_WE_B = 78, 97 + MX8MQ_IOMUXC_NAND_WP_B = 79, 98 + MX8MQ_IOMUXC_SAI5_RXFS = 80, 99 + MX8MQ_IOMUXC_SAI5_RXC = 81, 100 + MX8MQ_IOMUXC_SAI5_RXD0 = 82, 101 + MX8MQ_IOMUXC_SAI5_RXD1 = 83, 102 + MX8MQ_IOMUXC_SAI5_RXD2 = 84, 103 + MX8MQ_IOMUXC_SAI5_RXD3 = 85, 104 + MX8MQ_IOMUXC_SAI5_MCLK = 86, 105 + MX8MQ_IOMUXC_SAI1_RXFS = 87, 106 + MX8MQ_IOMUXC_SAI1_RXC = 88, 107 + MX8MQ_IOMUXC_SAI1_RXD0 = 89, 108 + MX8MQ_IOMUXC_SAI1_RXD1 = 90, 109 + MX8MQ_IOMUXC_SAI1_RXD2 = 91, 110 + MX8MQ_IOMUXC_SAI1_RXD3 = 92, 111 + MX8MQ_IOMUXC_SAI1_RXD4 = 93, 112 + MX8MQ_IOMUXC_SAI1_RXD5 = 94, 113 + MX8MQ_IOMUXC_SAI1_RXD6 = 95, 114 + MX8MQ_IOMUXC_SAI1_RXD7 = 96, 115 + MX8MQ_IOMUXC_SAI1_TXFS = 97, 116 + MX8MQ_IOMUXC_SAI1_TXC = 98, 117 + MX8MQ_IOMUXC_SAI1_TXD0 = 99, 118 + MX8MQ_IOMUXC_SAI1_TXD1 = 100, 119 + MX8MQ_IOMUXC_SAI1_TXD2 = 101, 120 + MX8MQ_IOMUXC_SAI1_TXD3 = 102, 121 + MX8MQ_IOMUXC_SAI1_TXD4 = 103, 122 + MX8MQ_IOMUXC_SAI1_TXD5 = 104, 123 + MX8MQ_IOMUXC_SAI1_TXD6 = 105, 124 + MX8MQ_IOMUXC_SAI1_TXD7 = 106, 125 + MX8MQ_IOMUXC_SAI1_MCLK = 107, 126 + MX8MQ_IOMUXC_SAI2_RXFS = 108, 127 + MX8MQ_IOMUXC_SAI2_RXC = 109, 128 + MX8MQ_IOMUXC_SAI2_RXD0 = 110, 129 + MX8MQ_IOMUXC_SAI2_TXFS = 111, 130 + MX8MQ_IOMUXC_SAI2_TXC = 112, 131 + MX8MQ_IOMUXC_SAI2_TXD0 = 113, 132 + MX8MQ_IOMUXC_SAI2_MCLK = 114, 133 + MX8MQ_IOMUXC_SAI3_RXFS = 115, 134 + MX8MQ_IOMUXC_SAI3_RXC = 116, 135 + MX8MQ_IOMUXC_SAI3_RXD = 117, 136 + MX8MQ_IOMUXC_SAI3_TXFS = 118, 137 + MX8MQ_IOMUXC_SAI3_TXC = 119, 138 + MX8MQ_IOMUXC_SAI3_TXD = 120, 139 + MX8MQ_IOMUXC_SAI3_MCLK = 121, 140 + MX8MQ_IOMUXC_SPDIF_TX = 122, 141 + MX8MQ_IOMUXC_SPDIF_RX = 123, 142 + MX8MQ_IOMUXC_SPDIF_EXT_CLK = 124, 143 + MX8MQ_IOMUXC_ECSPI1_SCLK = 125, 144 + MX8MQ_IOMUXC_ECSPI1_MOSI = 126, 145 + MX8MQ_IOMUXC_ECSPI1_MISO = 127, 146 + MX8MQ_IOMUXC_ECSPI1_SS0 = 128, 147 + MX8MQ_IOMUXC_ECSPI2_SCLK = 129, 148 + MX8MQ_IOMUXC_ECSPI2_MOSI = 130, 149 + MX8MQ_IOMUXC_ECSPI2_MISO = 131, 150 + MX8MQ_IOMUXC_ECSPI2_SS0 = 132, 151 + MX8MQ_IOMUXC_I2C1_SCL = 133, 152 + MX8MQ_IOMUXC_I2C1_SDA = 134, 153 + MX8MQ_IOMUXC_I2C2_SCL = 135, 154 + MX8MQ_IOMUXC_I2C2_SDA = 136, 155 + MX8MQ_IOMUXC_I2C3_SCL = 137, 156 + MX8MQ_IOMUXC_I2C3_SDA = 138, 157 + MX8MQ_IOMUXC_I2C4_SCL = 139, 158 + MX8MQ_IOMUXC_I2C4_SDA = 140, 159 + MX8MQ_IOMUXC_UART1_RXD = 141, 160 + MX8MQ_IOMUXC_UART1_TXD = 142, 161 + MX8MQ_IOMUXC_UART2_RXD = 143, 162 + MX8MQ_IOMUXC_UART2_TXD = 144, 163 + MX8MQ_IOMUXC_UART3_RXD = 145, 164 + MX8MQ_IOMUXC_UART3_TXD = 146, 165 + MX8MQ_IOMUXC_UART4_RXD = 147, 166 + MX8MQ_IOMUXC_UART4_TXD = 148, 167 + }; 168 + 169 + /* Pad names for the pinmux subsystem */ 170 + static const struct pinctrl_pin_desc imx8mq_pinctrl_pads[] = { 171 + IMX_PINCTRL_PIN(MX8MQ_PAD_RESERVE0), 172 + IMX_PINCTRL_PIN(MX8MQ_PAD_RESERVE1), 173 + IMX_PINCTRL_PIN(MX8MQ_PAD_RESERVE2), 174 + IMX_PINCTRL_PIN(MX8MQ_PAD_RESERVE3), 175 + IMX_PINCTRL_PIN(MX8MQ_PAD_RESERVE4), 176 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_PMIC_STBY_REQ_CCMSRCGPCMIX), 177 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_PMIC_ON_REQ_SNVSMIX), 178 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ONOFF_SNVSMIX), 179 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_POR_B_SNVSMIX), 180 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_RTC_RESET_B_SNVSMIX), 181 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO00), 182 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO01), 183 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO02), 184 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO03), 185 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO04), 186 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO05), 187 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO06), 188 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO07), 189 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO08), 190 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO09), 191 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO10), 192 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO11), 193 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO12), 194 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO13), 195 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO14), 196 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_GPIO1_IO15), 197 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_MDC), 198 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_MDIO), 199 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_TD3), 200 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_TD2), 201 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_TD1), 202 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_TD0), 203 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_TX_CTL), 204 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_TXC), 205 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_RX_CTL), 206 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_RXC), 207 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_RD0), 208 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_RD1), 209 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_RD2), 210 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ENET_RD3), 211 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_CLK), 212 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_CMD), 213 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA0), 214 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA1), 215 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA2), 216 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA3), 217 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA4), 218 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA5), 219 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA6), 220 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_DATA7), 221 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_RESET_B), 222 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD1_STROBE), 223 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_CD_B), 224 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_CLK), 225 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_CMD), 226 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_DATA0), 227 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_DATA1), 228 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_DATA2), 229 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_DATA3), 230 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_RESET_B), 231 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SD2_WP), 232 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_ALE), 233 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_CE0_B), 234 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_CE1_B), 235 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_CE2_B), 236 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_CE3_B), 237 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_CLE), 238 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA00), 239 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA01), 240 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA02), 241 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA03), 242 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA04), 243 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA05), 244 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA06), 245 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DATA07), 246 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_DQS), 247 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_RE_B), 248 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_READY_B), 249 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_WE_B), 250 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_NAND_WP_B), 251 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_RXFS), 252 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_RXC), 253 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_RXD0), 254 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_RXD1), 255 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_RXD2), 256 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_RXD3), 257 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI5_MCLK), 258 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXFS), 259 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXC), 260 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD0), 261 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD1), 262 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD2), 263 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD3), 264 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD4), 265 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD5), 266 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD6), 267 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_RXD7), 268 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXFS), 269 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXC), 270 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD0), 271 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD1), 272 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD2), 273 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD3), 274 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD4), 275 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD5), 276 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD6), 277 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_TXD7), 278 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI1_MCLK), 279 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_RXFS), 280 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_RXC), 281 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_RXD0), 282 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_TXFS), 283 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_TXC), 284 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_TXD0), 285 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI2_MCLK), 286 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_RXFS), 287 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_RXC), 288 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_RXD), 289 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_TXFS), 290 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_TXC), 291 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_TXD), 292 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SAI3_MCLK), 293 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SPDIF_TX), 294 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SPDIF_RX), 295 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_SPDIF_EXT_CLK), 296 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI1_SCLK), 297 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI1_MOSI), 298 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI1_MISO), 299 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI1_SS0), 300 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI2_SCLK), 301 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI2_MOSI), 302 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI2_MISO), 303 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_ECSPI2_SS0), 304 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C1_SCL), 305 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C1_SDA), 306 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C2_SCL), 307 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C2_SDA), 308 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C3_SCL), 309 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C3_SDA), 310 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C4_SCL), 311 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_I2C4_SDA), 312 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART1_RXD), 313 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART1_TXD), 314 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART2_RXD), 315 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART2_TXD), 316 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART3_RXD), 317 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART3_TXD), 318 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART4_RXD), 319 + IMX_PINCTRL_PIN(MX8MQ_IOMUXC_UART4_TXD), 320 + }; 321 + 322 + static const struct imx_pinctrl_soc_info imx8mq_pinctrl_info = { 323 + .pins = imx8mq_pinctrl_pads, 324 + .npins = ARRAY_SIZE(imx8mq_pinctrl_pads), 325 + .gpr_compatible = "fsl,imx8mq-iomuxc-gpr", 326 + }; 327 + 328 + static const struct of_device_id imx8mq_pinctrl_of_match[] = { 329 + { .compatible = "fsl,imx8mq-iomuxc", .data = &imx8mq_pinctrl_info, }, 330 + { /* sentinel */ } 331 + }; 332 + 333 + static int imx8mq_pinctrl_probe(struct platform_device *pdev) 334 + { 335 + return imx_pinctrl_probe(pdev, &imx8mq_pinctrl_info); 336 + } 337 + 338 + static struct platform_driver imx8mq_pinctrl_driver = { 339 + .driver = { 340 + .name = "imx8mq-pinctrl", 341 + .of_match_table = of_match_ptr(imx8mq_pinctrl_of_match), 342 + .suppress_bind_attrs = true, 343 + }, 344 + .probe = imx8mq_pinctrl_probe, 345 + }; 346 + 347 + static int __init imx8mq_pinctrl_init(void) 348 + { 349 + return platform_driver_register(&imx8mq_pinctrl_driver); 350 + } 351 + arch_initcall(imx8mq_pinctrl_init);
+10 -2
drivers/pinctrl/intel/Kconfig
··· 1 - # 1 + # SPDX-License-Identifier: GPL-2.0 2 2 # Intel pin control drivers 3 - # 3 + 4 4 if (X86 || COMPILE_TEST) 5 5 6 6 config PINCTRL_BAYTRAIL ··· 89 89 help 90 90 This pinctrl driver provides an interface that allows configuring 91 91 of Intel Gemini Lake SoC pins and using them as GPIOs. 92 + 93 + config PINCTRL_ICELAKE 94 + tristate "Intel Ice Lake PCH pinctrl and GPIO driver" 95 + depends on ACPI 96 + select PINCTRL_INTEL 97 + help 98 + This pinctrl driver provides an interface that allows configuring 99 + of Intel Ice Lake PCH pins and using them as GPIOs. 92 100 93 101 config PINCTRL_LEWISBURG 94 102 tristate "Intel Lewisburg pinctrl and GPIO driver"
+1
drivers/pinctrl/intel/Makefile
··· 10 10 obj-$(CONFIG_PINCTRL_CEDARFORK) += pinctrl-cedarfork.o 11 11 obj-$(CONFIG_PINCTRL_DENVERTON) += pinctrl-denverton.o 12 12 obj-$(CONFIG_PINCTRL_GEMINILAKE) += pinctrl-geminilake.o 13 + obj-$(CONFIG_PINCTRL_ICELAKE) += pinctrl-icelake.o 13 14 obj-$(CONFIG_PINCTRL_LEWISBURG) += pinctrl-lewisburg.o 14 15 obj-$(CONFIG_PINCTRL_SUNRISEPOINT) += pinctrl-sunrisepoint.o
+6 -11
drivers/pinctrl/intel/pinctrl-baytrail.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Pinctrl GPIO driver for Intel Baytrail 3 - * Copyright (c) 2012-2013, Intel Corporation. 4 4 * 5 + * Copyright (c) 2012-2013, Intel Corporation 5 6 * Author: Mathias Nyman <mathias.nyman@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify it 8 - * under the terms and conditions of the GNU General Public License, 9 - * version 2, as published by the Free Software Foundation. 10 - * 11 - * This program is distributed in the hope it will be useful, but WITHOUT 12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 - * more details. 15 7 */ 16 8 17 9 #include <linux/kernel.h> ··· 1534 1542 switch (irqd_get_trigger_type(d)) { 1535 1543 case IRQ_TYPE_LEVEL_HIGH: 1536 1544 value |= BYT_TRIG_LVL; 1545 + /* fall through */ 1537 1546 case IRQ_TYPE_EDGE_RISING: 1538 1547 value |= BYT_TRIG_POS; 1539 1548 break; 1540 1549 case IRQ_TYPE_LEVEL_LOW: 1541 1550 value |= BYT_TRIG_LVL; 1551 + /* fall through */ 1542 1552 case IRQ_TYPE_EDGE_FALLING: 1543 1553 value |= BYT_TRIG_NEG; 1544 1554 break; ··· 1685 1691 value = readl(reg); 1686 1692 if (value) 1687 1693 dev_err(&vg->pdev->dev, 1688 - "GPIO interrupt error, pins misconfigured\n"); 1694 + "GPIO interrupt error, pins misconfigured. INT_STAT%u: 0x%08x\n", 1695 + base / 32, value); 1689 1696 } 1690 1697 } 1691 1698
+1 -4
drivers/pinctrl/intel/pinctrl-broxton.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Broxton SoC pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2015, 2016 Intel Corporation 5 6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 7 */ 11 8 12 9 #include <linux/acpi.h>
+3 -10
drivers/pinctrl/intel/pinctrl-cannonlake.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Cannon Lake PCH pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2017, Intel Corporation 5 6 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 6 7 * Mika Westerberg <mika.westerberg@linux.intel.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 8 */ 12 9 13 10 #include <linux/acpi.h> ··· 444 447 static const struct intel_community cnlh_communities[] = { 445 448 CNL_COMMUNITY(0, 0, 50, cnlh_community0_gpps), 446 449 CNL_COMMUNITY(1, 51, 154, cnlh_community1_gpps), 447 - /* 448 - * ACPI MMIO resources are returned in reverse order for 449 - * communities 3 and 4. 450 - */ 451 - CNL_COMMUNITY(3, 155, 248, cnlh_community3_gpps), 452 - CNL_COMMUNITY(2, 249, 298, cnlh_community4_gpps), 450 + CNL_COMMUNITY(2, 155, 248, cnlh_community3_gpps), 451 + CNL_COMMUNITY(3, 249, 298, cnlh_community4_gpps), 453 452 }; 454 453 455 454 static const struct intel_pinctrl_soc_data cnlh_soc_data = {
+47 -50
drivers/pinctrl/intel/pinctrl-cedarfork.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Cedar Fork PCH pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2017, Intel Corporation 5 6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 7 */ 11 8 12 9 #include <linux/acpi.h> ··· 237 240 PINCTRL_PIN(179, "GBE_GPIO10"), 238 241 PINCTRL_PIN(180, "GBE_GPIO11"), 239 242 PINCTRL_PIN(181, "GBE_GPIO12"), 240 - PINCTRL_PIN(182, "SATA0_LED_N"), 241 - PINCTRL_PIN(183, "SATA1_LED_N"), 242 - PINCTRL_PIN(184, "SATA_PDETECT0"), 243 - PINCTRL_PIN(185, "SATA_PDETECT1"), 244 - PINCTRL_PIN(186, "SATA0_SDOUT"), 245 - PINCTRL_PIN(187, "SATA1_SDOUT"), 246 - PINCTRL_PIN(188, "SATA2_LED_N"), 247 - PINCTRL_PIN(189, "SATA_PDETECT2"), 248 - PINCTRL_PIN(190, "SATA2_SDOUT"), 243 + PINCTRL_PIN(182, "PECI_SMB_DATA"), 244 + PINCTRL_PIN(183, "SATA0_LED_N"), 245 + PINCTRL_PIN(184, "SATA1_LED_N"), 246 + PINCTRL_PIN(185, "SATA_PDETECT0"), 247 + PINCTRL_PIN(186, "SATA_PDETECT1"), 248 + PINCTRL_PIN(187, "SATA0_SDOUT"), 249 + PINCTRL_PIN(188, "SATA1_SDOUT"), 250 + PINCTRL_PIN(189, "SATA2_LED_N"), 251 + PINCTRL_PIN(190, "SATA_PDETECT2"), 252 + PINCTRL_PIN(191, "SATA2_SDOUT"), 249 253 /* EAST3 */ 250 - PINCTRL_PIN(191, "ESPI_IO0"), 251 - PINCTRL_PIN(192, "ESPI_IO1"), 252 - PINCTRL_PIN(193, "ESPI_IO2"), 253 - PINCTRL_PIN(194, "ESPI_IO3"), 254 - PINCTRL_PIN(195, "ESPI_CLK"), 255 - PINCTRL_PIN(196, "ESPI_RST_N"), 256 - PINCTRL_PIN(197, "ESPI_CS0_N"), 257 - PINCTRL_PIN(198, "ESPI_ALRT0_N"), 258 - PINCTRL_PIN(199, "ESPI_CS1_N"), 259 - PINCTRL_PIN(200, "ESPI_ALRT1_N"), 260 - PINCTRL_PIN(201, "ESPI_CLK_LOOPBK"), 254 + PINCTRL_PIN(192, "ESPI_IO0"), 255 + PINCTRL_PIN(193, "ESPI_IO1"), 256 + PINCTRL_PIN(194, "ESPI_IO2"), 257 + PINCTRL_PIN(195, "ESPI_IO3"), 258 + PINCTRL_PIN(196, "ESPI_CLK"), 259 + PINCTRL_PIN(197, "ESPI_RST_N"), 260 + PINCTRL_PIN(198, "ESPI_CS0_N"), 261 + PINCTRL_PIN(199, "ESPI_ALRT0_N"), 262 + PINCTRL_PIN(200, "ESPI_CS1_N"), 263 + PINCTRL_PIN(201, "ESPI_ALRT1_N"), 264 + PINCTRL_PIN(202, "ESPI_CLK_LOOPBK"), 261 265 /* EAST0 */ 262 - PINCTRL_PIN(202, "SPI_CS0_N"), 263 - PINCTRL_PIN(203, "SPI_CS1_N"), 264 - PINCTRL_PIN(204, "SPI_MOSI_IO0"), 265 - PINCTRL_PIN(205, "SPI_MISO_IO1"), 266 - PINCTRL_PIN(206, "SPI_IO2"), 267 - PINCTRL_PIN(207, "SPI_IO3"), 268 - PINCTRL_PIN(208, "SPI_CLK"), 269 - PINCTRL_PIN(209, "SPI_CLK_LOOPBK"), 270 - PINCTRL_PIN(210, "SUSPWRDNACK"), 271 - PINCTRL_PIN(211, "PMU_SUSCLK"), 272 - PINCTRL_PIN(212, "ADR_COMPLETE"), 273 - PINCTRL_PIN(213, "ADR_TRIGGER_N"), 274 - PINCTRL_PIN(214, "PMU_SLP_S45_N"), 275 - PINCTRL_PIN(215, "PMU_SLP_S3_N"), 276 - PINCTRL_PIN(216, "PMU_WAKE_N"), 277 - PINCTRL_PIN(217, "PMU_PWRBTN_N"), 278 - PINCTRL_PIN(218, "PMU_RESETBUTTON_N"), 279 - PINCTRL_PIN(219, "PMU_PLTRST_N"), 280 - PINCTRL_PIN(220, "SUS_STAT_N"), 281 - PINCTRL_PIN(221, "PMU_I2C_CLK"), 282 - PINCTRL_PIN(222, "PMU_I2C_DATA"), 283 - PINCTRL_PIN(223, "PECI_SMB_CLK"), 284 - PINCTRL_PIN(224, "PECI_SMB_DATA"), 266 + PINCTRL_PIN(203, "SPI_CS0_N"), 267 + PINCTRL_PIN(204, "SPI_CS1_N"), 268 + PINCTRL_PIN(205, "SPI_MOSI_IO0"), 269 + PINCTRL_PIN(206, "SPI_MISO_IO1"), 270 + PINCTRL_PIN(207, "SPI_IO2"), 271 + PINCTRL_PIN(208, "SPI_IO3"), 272 + PINCTRL_PIN(209, "SPI_CLK"), 273 + PINCTRL_PIN(210, "SPI_CLK_LOOPBK"), 274 + PINCTRL_PIN(211, "SUSPWRDNACK"), 275 + PINCTRL_PIN(212, "PMU_SUSCLK"), 276 + PINCTRL_PIN(213, "ADR_COMPLETE"), 277 + PINCTRL_PIN(214, "ADR_TRIGGER_N"), 278 + PINCTRL_PIN(215, "PMU_SLP_S45_N"), 279 + PINCTRL_PIN(216, "PMU_SLP_S3_N"), 280 + PINCTRL_PIN(217, "PMU_WAKE_N"), 281 + PINCTRL_PIN(218, "PMU_PWRBTN_N"), 282 + PINCTRL_PIN(219, "PMU_RESETBUTTON_N"), 283 + PINCTRL_PIN(220, "PMU_PLTRST_N"), 284 + PINCTRL_PIN(221, "SUS_STAT_N"), 285 + PINCTRL_PIN(222, "PMU_I2C_CLK"), 286 + PINCTRL_PIN(223, "PMU_I2C_DATA"), 287 + PINCTRL_PIN(224, "PECI_SMB_CLK"), 285 288 PINCTRL_PIN(225, "PECI_SMB_ALRT_N"), 286 289 /* EMMC */ 287 290 PINCTRL_PIN(226, "EMMC_CMD"), ··· 312 315 }; 313 316 314 317 static const struct intel_padgroup cdf_community1_gpps[] = { 315 - CDF_GPP(0, 168, 190), /* EAST2 */ 316 - CDF_GPP(1, 191, 201), /* EAST3 */ 317 - CDF_GPP(2, 202, 225), /* EAST0 */ 318 + CDF_GPP(0, 168, 191), /* EAST2 */ 319 + CDF_GPP(1, 192, 202), /* EAST3 */ 320 + CDF_GPP(2, 203, 225), /* EAST0 */ 318 321 CDF_GPP(3, 226, 236), /* EMMC */ 319 322 }; 320 323
+1 -4
drivers/pinctrl/intel/pinctrl-cherryview.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Cherryview/Braswell pinctrl driver 3 4 * ··· 8 7 * This driver is based on the original Cherryview GPIO driver by 9 8 * Ning Li <ning.li@intel.com> 10 9 * Alan Cox <alan@linux.intel.com> 11 - * 12 - * This program is free software; you can redistribute it and/or modify 13 - * it under the terms of the GNU General Public License version 2 as 14 - * published by the Free Software Foundation. 15 10 */ 16 11 17 12 #include <linux/dmi.h>
+1 -4
drivers/pinctrl/intel/pinctrl-denverton.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Denverton SoC pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2017, Intel Corporation 5 6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 7 */ 11 8 12 9 #include <linux/acpi.h>
+1 -4
drivers/pinctrl/intel/pinctrl-geminilake.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Gemini Lake SoC pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2017 Intel Corporation 5 6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 7 */ 11 8 12 9 #include <linux/acpi.h>
+436
drivers/pinctrl/intel/pinctrl-icelake.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Intel Ice Lake PCH pinctrl/GPIO driver 4 + * 5 + * Copyright (C) 2018, Intel Corporation 6 + * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7 + * Mika Westerberg <mika.westerberg@linux.intel.com> 8 + */ 9 + 10 + #include <linux/acpi.h> 11 + #include <linux/module.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/pm.h> 14 + #include <linux/pinctrl/pinctrl.h> 15 + 16 + #include "pinctrl-intel.h" 17 + 18 + #define ICL_PAD_OWN 0x020 19 + #define ICL_PADCFGLOCK 0x080 20 + #define ICL_HOSTSW_OWN 0x0b0 21 + #define ICL_GPI_IE 0x110 22 + 23 + #define ICL_GPP(r, s, e, g) \ 24 + { \ 25 + .reg_num = (r), \ 26 + .base = (s), \ 27 + .size = ((e) - (s) + 1), \ 28 + .gpio_base = (g), \ 29 + } 30 + 31 + #define ICL_NO_GPIO -1 32 + 33 + #define ICL_COMMUNITY(b, s, e, g) \ 34 + { \ 35 + .barno = (b), \ 36 + .padown_offset = ICL_PAD_OWN, \ 37 + .padcfglock_offset = ICL_PADCFGLOCK, \ 38 + .hostown_offset = ICL_HOSTSW_OWN, \ 39 + .ie_offset = ICL_GPI_IE, \ 40 + .pin_base = (s), \ 41 + .npins = ((e) - (s) + 1), \ 42 + .gpps = (g), \ 43 + .ngpps = ARRAY_SIZE(g), \ 44 + } 45 + 46 + /* Ice Lake-LP */ 47 + static const struct pinctrl_pin_desc icllp_pins[] = { 48 + /* GPP_G */ 49 + PINCTRL_PIN(0, "SD3_CMD"), 50 + PINCTRL_PIN(1, "SD3_D0"), 51 + PINCTRL_PIN(2, "SD3_D1"), 52 + PINCTRL_PIN(3, "SD3_D2"), 53 + PINCTRL_PIN(4, "SD3_D3"), 54 + PINCTRL_PIN(5, "SD3_CDB"), 55 + PINCTRL_PIN(6, "SD3_CLK"), 56 + PINCTRL_PIN(7, "SD3_WP"), 57 + /* GPP_B */ 58 + PINCTRL_PIN(8, "CORE_VID_0"), 59 + PINCTRL_PIN(9, "CORE_VID_1"), 60 + PINCTRL_PIN(10, "VRALERTB"), 61 + PINCTRL_PIN(11, "CPU_GP_2"), 62 + PINCTRL_PIN(12, "CPU_GP_3"), 63 + PINCTRL_PIN(13, "ISH_I2C0_SDA"), 64 + PINCTRL_PIN(14, "ISH_I2C0_SCL"), 65 + PINCTRL_PIN(15, "ISH_I2C1_SDA"), 66 + PINCTRL_PIN(16, "ISH_I2C1_SCL"), 67 + PINCTRL_PIN(17, "I2C5_SDA"), 68 + PINCTRL_PIN(18, "I2C5_SCL"), 69 + PINCTRL_PIN(19, "PMCALERTB"), 70 + PINCTRL_PIN(20, "SLP_S0B"), 71 + PINCTRL_PIN(21, "PLTRSTB"), 72 + PINCTRL_PIN(22, "SPKR"), 73 + PINCTRL_PIN(23, "GSPI0_CS0B"), 74 + PINCTRL_PIN(24, "GSPI0_CLK"), 75 + PINCTRL_PIN(25, "GSPI0_MISO"), 76 + PINCTRL_PIN(26, "GSPI0_MOSI"), 77 + PINCTRL_PIN(27, "GSPI1_CS0B"), 78 + PINCTRL_PIN(28, "GSPI1_CLK"), 79 + PINCTRL_PIN(29, "GSPI1_MISO"), 80 + PINCTRL_PIN(30, "GSPI1_MOSI"), 81 + PINCTRL_PIN(31, "SML1ALERTB"), 82 + PINCTRL_PIN(32, "GSPI0_CLK_LOOPBK"), 83 + PINCTRL_PIN(33, "GSPI1_CLK_LOOPBK"), 84 + /* GPP_A */ 85 + PINCTRL_PIN(34, "ESPI_IO_0"), 86 + PINCTRL_PIN(35, "ESPI_IO_1"), 87 + PINCTRL_PIN(36, "ESPI_IO_2"), 88 + PINCTRL_PIN(37, "ESPI_IO_3"), 89 + PINCTRL_PIN(38, "ESPI_CSB"), 90 + PINCTRL_PIN(39, "ESPI_CLK"), 91 + PINCTRL_PIN(40, "ESPI_RESETB"), 92 + PINCTRL_PIN(41, "I2S2_SCLK"), 93 + PINCTRL_PIN(42, "I2S2_SFRM"), 94 + PINCTRL_PIN(43, "I2S2_TXD"), 95 + PINCTRL_PIN(44, "I2S2_RXD"), 96 + PINCTRL_PIN(45, "SATA_DEVSLP_2"), 97 + PINCTRL_PIN(46, "SATAXPCIE_1"), 98 + PINCTRL_PIN(47, "SATAXPCIE_2"), 99 + PINCTRL_PIN(48, "USB2_OCB_1"), 100 + PINCTRL_PIN(49, "USB2_OCB_2"), 101 + PINCTRL_PIN(50, "USB2_OCB_3"), 102 + PINCTRL_PIN(51, "DDSP_HPD_C"), 103 + PINCTRL_PIN(52, "DDSP_HPD_B"), 104 + PINCTRL_PIN(53, "DDSP_HPD_1"), 105 + PINCTRL_PIN(54, "DDSP_HPD_2"), 106 + PINCTRL_PIN(55, "I2S5_TXD"), 107 + PINCTRL_PIN(56, "I2S5_RXD"), 108 + PINCTRL_PIN(57, "I2S1_SCLK"), 109 + PINCTRL_PIN(58, "ESPI_CLK_LOOPBK"), 110 + /* GPP_H */ 111 + PINCTRL_PIN(59, "SD_1P8_SEL"), 112 + PINCTRL_PIN(60, "SD_PWR_EN_B"), 113 + PINCTRL_PIN(61, "GPPC_H_2"), 114 + PINCTRL_PIN(62, "SX_EXIT_HOLDOFFB"), 115 + PINCTRL_PIN(63, "I2C2_SDA"), 116 + PINCTRL_PIN(64, "I2C2_SCL"), 117 + PINCTRL_PIN(65, "I2C3_SDA"), 118 + PINCTRL_PIN(66, "I2C3_SCL"), 119 + PINCTRL_PIN(67, "I2C4_SDA"), 120 + PINCTRL_PIN(68, "I2C4_SCL"), 121 + PINCTRL_PIN(69, "SRCCLKREQB_4"), 122 + PINCTRL_PIN(70, "SRCCLKREQB_5"), 123 + PINCTRL_PIN(71, "M2_SKT2_CFG_0"), 124 + PINCTRL_PIN(72, "M2_SKT2_CFG_1"), 125 + PINCTRL_PIN(73, "M2_SKT2_CFG_2"), 126 + PINCTRL_PIN(74, "M2_SKT2_CFG_3"), 127 + PINCTRL_PIN(75, "DDPB_CTRLCLK"), 128 + PINCTRL_PIN(76, "DDPB_CTRLDATA"), 129 + PINCTRL_PIN(77, "CPU_VCCIO_PWR_GATEB"), 130 + PINCTRL_PIN(78, "TIME_SYNC_0"), 131 + PINCTRL_PIN(79, "IMGCLKOUT_1"), 132 + PINCTRL_PIN(80, "IMGCLKOUT_2"), 133 + PINCTRL_PIN(81, "IMGCLKOUT_3"), 134 + PINCTRL_PIN(82, "IMGCLKOUT_4"), 135 + /* GPP_D */ 136 + PINCTRL_PIN(83, "ISH_GP_0"), 137 + PINCTRL_PIN(84, "ISH_GP_1"), 138 + PINCTRL_PIN(85, "ISH_GP_2"), 139 + PINCTRL_PIN(86, "ISH_GP_3"), 140 + PINCTRL_PIN(87, "IMGCLKOUT_0"), 141 + PINCTRL_PIN(88, "SRCCLKREQB_0"), 142 + PINCTRL_PIN(89, "SRCCLKREQB_1"), 143 + PINCTRL_PIN(90, "SRCCLKREQB_2"), 144 + PINCTRL_PIN(91, "SRCCLKREQB_3"), 145 + PINCTRL_PIN(92, "ISH_SPI_CSB"), 146 + PINCTRL_PIN(93, "ISH_SPI_CLK"), 147 + PINCTRL_PIN(94, "ISH_SPI_MISO"), 148 + PINCTRL_PIN(95, "ISH_SPI_MOSI"), 149 + PINCTRL_PIN(96, "ISH_UART0_RXD"), 150 + PINCTRL_PIN(97, "ISH_UART0_TXD"), 151 + PINCTRL_PIN(98, "ISH_UART0_RTSB"), 152 + PINCTRL_PIN(99, "ISH_UART0_CTSB"), 153 + PINCTRL_PIN(100, "ISH_GP_4"), 154 + PINCTRL_PIN(101, "ISH_GP_5"), 155 + PINCTRL_PIN(102, "I2S_MCLK"), 156 + PINCTRL_PIN(103, "GSPI2_CLK_LOOPBK"), 157 + /* GPP_F */ 158 + PINCTRL_PIN(104, "CNV_BRI_DT"), 159 + PINCTRL_PIN(105, "CNV_BRI_RSP"), 160 + PINCTRL_PIN(106, "CNV_RGI_DT"), 161 + PINCTRL_PIN(107, "CNV_RGI_RSP"), 162 + PINCTRL_PIN(108, "CNV_RF_RESET_B"), 163 + PINCTRL_PIN(109, "EMMC_HIP_MON"), 164 + PINCTRL_PIN(110, "CNV_PA_BLANKING"), 165 + PINCTRL_PIN(111, "EMMC_CMD"), 166 + PINCTRL_PIN(112, "EMMC_DATA0"), 167 + PINCTRL_PIN(113, "EMMC_DATA1"), 168 + PINCTRL_PIN(114, "EMMC_DATA2"), 169 + PINCTRL_PIN(115, "EMMC_DATA3"), 170 + PINCTRL_PIN(116, "EMMC_DATA4"), 171 + PINCTRL_PIN(117, "EMMC_DATA5"), 172 + PINCTRL_PIN(118, "EMMC_DATA6"), 173 + PINCTRL_PIN(119, "EMMC_DATA7"), 174 + PINCTRL_PIN(120, "EMMC_RCLK"), 175 + PINCTRL_PIN(121, "EMMC_CLK"), 176 + PINCTRL_PIN(122, "EMMC_RESETB"), 177 + PINCTRL_PIN(123, "A4WP_PRESENT"), 178 + /* vGPIO */ 179 + PINCTRL_PIN(124, "CNV_BTEN"), 180 + PINCTRL_PIN(125, "CNV_WCEN"), 181 + PINCTRL_PIN(126, "CNV_BT_HOST_WAKEB"), 182 + PINCTRL_PIN(127, "CNV_BT_IF_SELECT"), 183 + PINCTRL_PIN(128, "vCNV_BT_UART_TXD"), 184 + PINCTRL_PIN(129, "vCNV_BT_UART_RXD"), 185 + PINCTRL_PIN(130, "vCNV_BT_UART_CTS_B"), 186 + PINCTRL_PIN(131, "vCNV_BT_UART_RTS_B"), 187 + PINCTRL_PIN(132, "vCNV_MFUART1_TXD"), 188 + PINCTRL_PIN(133, "vCNV_MFUART1_RXD"), 189 + PINCTRL_PIN(134, "vCNV_MFUART1_CTS_B"), 190 + PINCTRL_PIN(135, "vCNV_MFUART1_RTS_B"), 191 + PINCTRL_PIN(136, "vUART0_TXD"), 192 + PINCTRL_PIN(137, "vUART0_RXD"), 193 + PINCTRL_PIN(138, "vUART0_CTS_B"), 194 + PINCTRL_PIN(139, "vUART0_RTS_B"), 195 + PINCTRL_PIN(140, "vISH_UART0_TXD"), 196 + PINCTRL_PIN(141, "vISH_UART0_RXD"), 197 + PINCTRL_PIN(142, "vISH_UART0_CTS_B"), 198 + PINCTRL_PIN(143, "vISH_UART0_RTS_B"), 199 + PINCTRL_PIN(144, "vCNV_BT_I2S_BCLK"), 200 + PINCTRL_PIN(145, "vCNV_BT_I2S_WS_SYNC"), 201 + PINCTRL_PIN(146, "vCNV_BT_I2S_SDO"), 202 + PINCTRL_PIN(147, "vCNV_BT_I2S_SDI"), 203 + PINCTRL_PIN(148, "vI2S2_SCLK"), 204 + PINCTRL_PIN(149, "vI2S2_SFRM"), 205 + PINCTRL_PIN(150, "vI2S2_TXD"), 206 + PINCTRL_PIN(151, "vI2S2_RXD"), 207 + PINCTRL_PIN(152, "vSD3_CD_B"), 208 + /* GPP_C */ 209 + PINCTRL_PIN(153, "SMBCLK"), 210 + PINCTRL_PIN(154, "SMBDATA"), 211 + PINCTRL_PIN(155, "SMBALERTB"), 212 + PINCTRL_PIN(156, "SML0CLK"), 213 + PINCTRL_PIN(157, "SML0DATA"), 214 + PINCTRL_PIN(158, "SML0ALERTB"), 215 + PINCTRL_PIN(159, "SML1CLK"), 216 + PINCTRL_PIN(160, "SML1DATA"), 217 + PINCTRL_PIN(161, "UART0_RXD"), 218 + PINCTRL_PIN(162, "UART0_TXD"), 219 + PINCTRL_PIN(163, "UART0_RTSB"), 220 + PINCTRL_PIN(164, "UART0_CTSB"), 221 + PINCTRL_PIN(165, "UART1_RXD"), 222 + PINCTRL_PIN(166, "UART1_TXD"), 223 + PINCTRL_PIN(167, "UART1_RTSB"), 224 + PINCTRL_PIN(168, "UART1_CTSB"), 225 + PINCTRL_PIN(169, "I2C0_SDA"), 226 + PINCTRL_PIN(170, "I2C0_SCL"), 227 + PINCTRL_PIN(171, "I2C1_SDA"), 228 + PINCTRL_PIN(172, "I2C1_SCL"), 229 + PINCTRL_PIN(173, "UART2_RXD"), 230 + PINCTRL_PIN(174, "UART2_TXD"), 231 + PINCTRL_PIN(175, "UART2_RTSB"), 232 + PINCTRL_PIN(176, "UART2_CTSB"), 233 + /* HVCMOS */ 234 + PINCTRL_PIN(177, "L_BKLTEN"), 235 + PINCTRL_PIN(178, "L_BKLTCTL"), 236 + PINCTRL_PIN(179, "L_VDDEN"), 237 + PINCTRL_PIN(180, "SYS_PWROK"), 238 + PINCTRL_PIN(181, "SYS_RESETB"), 239 + PINCTRL_PIN(182, "MLK_RSTB"), 240 + /* GPP_E */ 241 + PINCTRL_PIN(183, "SATAXPCIE_0"), 242 + PINCTRL_PIN(184, "SPI1_IO_2"), 243 + PINCTRL_PIN(185, "SPI1_IO_3"), 244 + PINCTRL_PIN(186, "CPU_GP_0"), 245 + PINCTRL_PIN(187, "SATA_DEVSLP_0"), 246 + PINCTRL_PIN(188, "SATA_DEVSLP_1"), 247 + PINCTRL_PIN(189, "GPPC_E_6"), 248 + PINCTRL_PIN(190, "CPU_GP_1"), 249 + PINCTRL_PIN(191, "SATA_LEDB"), 250 + PINCTRL_PIN(192, "USB2_OCB_0"), 251 + PINCTRL_PIN(193, "SPI1_CSB"), 252 + PINCTRL_PIN(194, "SPI1_CLK"), 253 + PINCTRL_PIN(195, "SPI1_MISO_IO_1"), 254 + PINCTRL_PIN(196, "SPI1_MOSI_IO_0"), 255 + PINCTRL_PIN(197, "DDSP_HPD_A"), 256 + PINCTRL_PIN(198, "ISH_GP_6"), 257 + PINCTRL_PIN(199, "ISH_GP_7"), 258 + PINCTRL_PIN(200, "DISP_MISC_4"), 259 + PINCTRL_PIN(201, "DDP1_CTRLCLK"), 260 + PINCTRL_PIN(202, "DDP1_CTRLDATA"), 261 + PINCTRL_PIN(203, "DDP2_CTRLCLK"), 262 + PINCTRL_PIN(204, "DDP2_CTRLDATA"), 263 + PINCTRL_PIN(205, "DDPA_CTRLCLK"), 264 + PINCTRL_PIN(206, "DDPA_CTRLDATA"), 265 + /* JTAG */ 266 + PINCTRL_PIN(207, "JTAG_TDO"), 267 + PINCTRL_PIN(208, "JTAGX"), 268 + PINCTRL_PIN(209, "PRDYB"), 269 + PINCTRL_PIN(210, "PREQB"), 270 + PINCTRL_PIN(211, "CPU_TRSTB"), 271 + PINCTRL_PIN(212, "JTAG_TDI"), 272 + PINCTRL_PIN(213, "JTAG_TMS"), 273 + PINCTRL_PIN(214, "JTAG_TCK"), 274 + PINCTRL_PIN(215, "ITP_PMODE"), 275 + /* GPP_R */ 276 + PINCTRL_PIN(216, "HDA_BCLK"), 277 + PINCTRL_PIN(217, "HDA_SYNC"), 278 + PINCTRL_PIN(218, "HDA_SDO"), 279 + PINCTRL_PIN(219, "HDA_SDI_0"), 280 + PINCTRL_PIN(220, "HDA_RSTB"), 281 + PINCTRL_PIN(221, "HDA_SDI_1"), 282 + PINCTRL_PIN(222, "I2S1_TXD"), 283 + PINCTRL_PIN(223, "I2S1_RXD"), 284 + /* GPP_S */ 285 + PINCTRL_PIN(224, "SNDW1_CLK"), 286 + PINCTRL_PIN(225, "SNDW1_DATA"), 287 + PINCTRL_PIN(226, "SNDW2_CLK"), 288 + PINCTRL_PIN(227, "SNDW2_DATA"), 289 + PINCTRL_PIN(228, "SNDW3_CLK"), 290 + PINCTRL_PIN(229, "SNDW3_DATA"), 291 + PINCTRL_PIN(230, "SNDW4_CLK"), 292 + PINCTRL_PIN(231, "SNDW4_DATA"), 293 + /* SPI */ 294 + PINCTRL_PIN(232, "SPI0_IO_2"), 295 + PINCTRL_PIN(233, "SPI0_IO_3"), 296 + PINCTRL_PIN(234, "SPI0_MOSI_IO_0"), 297 + PINCTRL_PIN(235, "SPI0_MISO_IO_1"), 298 + PINCTRL_PIN(236, "SPI0_TPM_CSB"), 299 + PINCTRL_PIN(237, "SPI0_FLASH_0_CSB"), 300 + PINCTRL_PIN(238, "SPI0_FLASH_1_CSB"), 301 + PINCTRL_PIN(239, "SPI0_CLK"), 302 + PINCTRL_PIN(240, "SPI0_CLK_LOOPBK"), 303 + }; 304 + 305 + static const struct intel_padgroup icllp_community0_gpps[] = { 306 + ICL_GPP(0, 0, 7, 0), /* GPP_G */ 307 + ICL_GPP(1, 8, 33, 32), /* GPP_B */ 308 + ICL_GPP(2, 34, 58, 64), /* GPP_A */ 309 + }; 310 + 311 + static const struct intel_padgroup icllp_community1_gpps[] = { 312 + ICL_GPP(0, 59, 82, 96), /* GPP_H */ 313 + ICL_GPP(1, 83, 103, 128), /* GPP_D */ 314 + ICL_GPP(2, 104, 123, 160), /* GPP_F */ 315 + ICL_GPP(3, 124, 152, 192), /* vGPIO */ 316 + }; 317 + 318 + static const struct intel_padgroup icllp_community4_gpps[] = { 319 + ICL_GPP(0, 153, 176, 224), /* GPP_C */ 320 + ICL_GPP(1, 177, 182, ICL_NO_GPIO), /* HVCMOS */ 321 + ICL_GPP(2, 183, 206, 256), /* GPP_E */ 322 + ICL_GPP(3, 207, 215, ICL_NO_GPIO), /* JTAG */ 323 + }; 324 + 325 + static const struct intel_padgroup icllp_community5_gpps[] = { 326 + ICL_GPP(0, 216, 223, 288), /* GPP_R */ 327 + ICL_GPP(1, 224, 231, 320), /* GPP_S */ 328 + ICL_GPP(2, 232, 240, ICL_NO_GPIO), /* SPI */ 329 + }; 330 + 331 + static const struct intel_community icllp_communities[] = { 332 + ICL_COMMUNITY(0, 0, 58, icllp_community0_gpps), 333 + ICL_COMMUNITY(1, 59, 152, icllp_community1_gpps), 334 + ICL_COMMUNITY(2, 153, 215, icllp_community4_gpps), 335 + ICL_COMMUNITY(3, 216, 240, icllp_community5_gpps), 336 + }; 337 + 338 + static const unsigned int icllp_spi0_pins[] = { 22, 23, 24, 25, 26 }; 339 + static const unsigned int icllp_spi0_modes[] = { 3, 1, 1, 1, 1 }; 340 + static const unsigned int icllp_spi1_pins[] = { 27, 28, 29, 30, 31 }; 341 + static const unsigned int icllp_spi1_modes[] = { 1, 1, 1, 1, 3 }; 342 + static const unsigned int icllp_spi2_pins[] = { 92, 93, 94, 95, 98 }; 343 + static const unsigned int icllp_spi2_modes[] = { 3, 3, 3, 3, 2 }; 344 + 345 + static const unsigned int icllp_i2c0_pins[] = { 169, 170 }; 346 + static const unsigned int icllp_i2c1_pins[] = { 171, 172 }; 347 + static const unsigned int icllp_i2c2_pins[] = { 63, 64 }; 348 + static const unsigned int icllp_i2c3_pins[] = { 65, 66 }; 349 + static const unsigned int icllp_i2c4_pins[] = { 67, 68 }; 350 + 351 + static const unsigned int icllp_uart0_pins[] = { 161, 162, 163, 164 }; 352 + static const unsigned int icllp_uart1_pins[] = { 165, 166, 167, 168 }; 353 + static const unsigned int icllp_uart2_pins[] = { 173, 174, 175, 176 }; 354 + 355 + static const struct intel_pingroup icllp_groups[] = { 356 + PIN_GROUP("spi0_grp", icllp_spi0_pins, icllp_spi0_modes), 357 + PIN_GROUP("spi1_grp", icllp_spi1_pins, icllp_spi1_modes), 358 + PIN_GROUP("spi2_grp", icllp_spi2_pins, icllp_spi2_modes), 359 + PIN_GROUP("i2c0_grp", icllp_i2c0_pins, 1), 360 + PIN_GROUP("i2c1_grp", icllp_i2c1_pins, 1), 361 + PIN_GROUP("i2c2_grp", icllp_i2c2_pins, 1), 362 + PIN_GROUP("i2c3_grp", icllp_i2c3_pins, 1), 363 + PIN_GROUP("i2c4_grp", icllp_i2c4_pins, 1), 364 + PIN_GROUP("uart0_grp", icllp_uart0_pins, 1), 365 + PIN_GROUP("uart1_grp", icllp_uart1_pins, 1), 366 + PIN_GROUP("uart2_grp", icllp_uart2_pins, 1), 367 + }; 368 + 369 + static const char * const icllp_spi0_groups[] = { "spi0_grp" }; 370 + static const char * const icllp_spi1_groups[] = { "spi1_grp" }; 371 + static const char * const icllp_spi2_groups[] = { "spi2_grp" }; 372 + static const char * const icllp_i2c0_groups[] = { "i2c0_grp" }; 373 + static const char * const icllp_i2c1_groups[] = { "i2c1_grp" }; 374 + static const char * const icllp_i2c2_groups[] = { "i2c2_grp" }; 375 + static const char * const icllp_i2c3_groups[] = { "i2c3_grp" }; 376 + static const char * const icllp_i2c4_groups[] = { "i2c4_grp" }; 377 + static const char * const icllp_uart0_groups[] = { "uart0_grp" }; 378 + static const char * const icllp_uart1_groups[] = { "uart1_grp" }; 379 + static const char * const icllp_uart2_groups[] = { "uart2_grp" }; 380 + 381 + static const struct intel_function icllp_functions[] = { 382 + FUNCTION("spi0", icllp_spi0_groups), 383 + FUNCTION("spi1", icllp_spi1_groups), 384 + FUNCTION("spi2", icllp_spi2_groups), 385 + FUNCTION("i2c0", icllp_i2c0_groups), 386 + FUNCTION("i2c1", icllp_i2c1_groups), 387 + FUNCTION("i2c2", icllp_i2c2_groups), 388 + FUNCTION("i2c3", icllp_i2c3_groups), 389 + FUNCTION("i2c4", icllp_i2c4_groups), 390 + FUNCTION("uart0", icllp_uart0_groups), 391 + FUNCTION("uart1", icllp_uart1_groups), 392 + FUNCTION("uart2", icllp_uart2_groups), 393 + }; 394 + 395 + static const struct intel_pinctrl_soc_data icllp_soc_data = { 396 + .pins = icllp_pins, 397 + .npins = ARRAY_SIZE(icllp_pins), 398 + .groups = icllp_groups, 399 + .ngroups = ARRAY_SIZE(icllp_groups), 400 + .functions = icllp_functions, 401 + .nfunctions = ARRAY_SIZE(icllp_functions), 402 + .communities = icllp_communities, 403 + .ncommunities = ARRAY_SIZE(icllp_communities), 404 + }; 405 + 406 + static int icl_pinctrl_probe(struct platform_device *pdev) 407 + { 408 + return intel_pinctrl_probe(pdev, &icllp_soc_data); 409 + } 410 + 411 + static const struct dev_pm_ops icl_pinctrl_pm_ops = { 412 + SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend, 413 + intel_pinctrl_resume) 414 + }; 415 + 416 + static const struct acpi_device_id icl_pinctrl_acpi_match[] = { 417 + { "INT3455" }, 418 + { }, 419 + }; 420 + MODULE_DEVICE_TABLE(acpi, icl_pinctrl_acpi_match); 421 + 422 + static struct platform_driver icl_pinctrl_driver = { 423 + .probe = icl_pinctrl_probe, 424 + .driver = { 425 + .name = "icelake-pinctrl", 426 + .acpi_match_table = icl_pinctrl_acpi_match, 427 + .pm = &icl_pinctrl_pm_ops, 428 + }, 429 + }; 430 + 431 + module_platform_driver(icl_pinctrl_driver); 432 + 433 + MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>"); 434 + MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); 435 + MODULE_DESCRIPTION("Intel Ice Lake PCH pinctrl/GPIO driver"); 436 + MODULE_LICENSE("GPL v2");
+33 -4
drivers/pinctrl/intel/pinctrl-intel.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel pinctrl/GPIO core driver. 3 4 * 4 5 * Copyright (C) 2015, Intel Corporation 5 6 * Authors: Mathias Nyman <mathias.nyman@linux.intel.com> 6 7 * Mika Westerberg <mika.westerberg@linux.intel.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 8 */ 12 9 13 10 #include <linux/module.h> ··· 872 875 return -EINVAL; 873 876 } 874 877 878 + static int intel_gpio_irq_reqres(struct irq_data *d) 879 + { 880 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 881 + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 882 + int pin; 883 + int ret; 884 + 885 + pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL); 886 + if (pin >= 0) { 887 + ret = gpiochip_lock_as_irq(gc, pin); 888 + if (ret) { 889 + dev_err(pctrl->dev, "unable to lock HW IRQ %d for IRQ\n", 890 + pin); 891 + return ret; 892 + } 893 + } 894 + return 0; 895 + } 896 + 897 + static void intel_gpio_irq_relres(struct irq_data *d) 898 + { 899 + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 900 + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 901 + int pin; 902 + 903 + pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL); 904 + if (pin >= 0) 905 + gpiochip_unlock_as_irq(gc, pin); 906 + } 907 + 875 908 static void intel_gpio_irq_ack(struct irq_data *d) 876 909 { 877 910 struct gpio_chip *gc = irq_data_get_irq_chip_data(d); ··· 1117 1090 1118 1091 static struct irq_chip intel_gpio_irqchip = { 1119 1092 .name = "intel-gpio", 1093 + .irq_request_resources = intel_gpio_irq_reqres, 1094 + .irq_release_resources = intel_gpio_irq_relres, 1120 1095 .irq_enable = intel_gpio_irq_enable, 1121 1096 .irq_ack = intel_gpio_irq_ack, 1122 1097 .irq_mask = intel_gpio_irq_mask,
+1 -4
drivers/pinctrl/intel/pinctrl-intel.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 2 3 * Core pinctrl/GPIO driver for Intel GPIO controllers 3 4 * 4 5 * Copyright (C) 2015, Intel Corporation 5 6 * Authors: Mathias Nyman <mathias.nyman@linux.intel.com> 6 7 * Mika Westerberg <mika.westerberg@linux.intel.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 8 */ 12 9 13 10 #ifndef PINCTRL_INTEL_H
+1 -4
drivers/pinctrl/intel/pinctrl-lewisburg.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Lewisburg pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2017, Intel Corporation 5 6 * Author: Mika Westerberg <mika.westerberg@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 7 */ 11 8 12 9 #include <linux/acpi.h>
+1 -4
drivers/pinctrl/intel/pinctrl-merrifield.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Merrifield SoC pinctrl driver 3 4 * 4 5 * Copyright (C) 2016, Intel Corporation 5 6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 7 */ 11 8 12 9 #include <linux/bitops.h>
+1 -4
drivers/pinctrl/intel/pinctrl-sunrisepoint.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Intel Sunrisepoint PCH pinctrl/GPIO driver 3 4 * 4 5 * Copyright (C) 2015, Intel Corporation 5 6 * Authors: Mathias Nyman <mathias.nyman@linux.intel.com> 6 7 * Mika Westerberg <mika.westerberg@linux.intel.com> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 8 */ 12 9 13 10 #include <linux/acpi.h>
+1
drivers/pinctrl/mediatek/mtk-eint.c
··· 13 13 #include <linux/err.h> 14 14 #include <linux/gpio.h> 15 15 #include <linux/io.h> 16 + #include <linux/irqchip/chained_irq.h> 16 17 #include <linux/irqdomain.h> 17 18 #include <linux/of_irq.h> 18 19 #include <linux/platform_device.h>
+3 -2
drivers/pinctrl/mediatek/pinctrl-mt7622.c
··· 1263 1263 MTK_DISABLE); 1264 1264 if (err) 1265 1265 goto err; 1266 + /* else: fall through */ 1266 1267 case PIN_CONFIG_INPUT_ENABLE: 1267 1268 case PIN_CONFIG_SLEW_RATE: 1268 1269 reg = (param == PIN_CONFIG_SLEW_RATE) ? ··· 1538 1537 err = pinctrl_generic_add_group(hw->pctrl, group->name, 1539 1538 group->pins, group->num_pins, 1540 1539 group->data); 1541 - if (err) { 1540 + if (err < 0) { 1542 1541 dev_err(hw->dev, "Failed to register group %s\n", 1543 1542 group->name); 1544 1543 return err; ··· 1559 1558 func->group_names, 1560 1559 func->num_group_names, 1561 1560 func->data); 1562 - if (err) { 1561 + if (err < 0) { 1563 1562 dev_err(hw->dev, "Failed to register function %s\n", 1564 1563 func->name); 1565 1564 return err;
+9
drivers/pinctrl/meson/pinctrl-meson-axg.c
··· 672 672 static const unsigned int jtag_ao_clk_pins[] = {GPIOAO_5}; 673 673 static const unsigned int jtag_ao_tms_pins[] = {GPIOAO_7}; 674 674 675 + /* gen_clk */ 676 + static const unsigned int gen_clk_ee_pins[] = {GPIOAO_13}; 677 + 675 678 static struct meson_pmx_group meson_axg_aobus_groups[] = { 676 679 GPIO_GROUP(GPIOAO_0), 677 680 GPIO_GROUP(GPIOAO_1), ··· 721 718 GROUP(jtag_ao_tdo, 4), 722 719 GROUP(jtag_ao_clk, 4), 723 720 GROUP(jtag_ao_tms, 4), 721 + GROUP(gen_clk_ee, 4), 724 722 }; 725 723 726 724 static const char * const gpio_periphs_groups[] = { ··· 951 947 "tdmb_din2", "tdmb_dout2", "tdmb_din3", "tdmb_dout3", 952 948 }; 953 949 950 + static const char * const gen_clk_ee_groups[] = { 951 + "gen_clk_ee", 952 + }; 953 + 954 954 static struct meson_pmx_func meson_axg_periphs_functions[] = { 955 955 FUNCTION(gpio_periphs), 956 956 FUNCTION(emmc), ··· 1000 992 FUNCTION(pwm_ao_c), 1001 993 FUNCTION(pwm_ao_d), 1002 994 FUNCTION(jtag_ao), 995 + FUNCTION(gen_clk_ee), 1003 996 }; 1004 997 1005 998 static struct meson_bank meson_axg_periphs_banks[] = {
+8
drivers/pinctrl/meson/pinctrl-meson-gxbb.c
··· 243 243 244 244 static const unsigned int spdif_out_y_pins[] = { GPIOY_12 }; 245 245 246 + static const unsigned int gen_clk_out_pins[] = { GPIOY_15 }; 247 + 246 248 static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = { 247 249 MESON_PIN(GPIOAO_0), 248 250 MESON_PIN(GPIOAO_1), ··· 455 453 GROUP(i2s_out_ch45_y, 1, 6), 456 454 GROUP(i2s_out_ch67_y, 1, 7), 457 455 GROUP(spdif_out_y, 1, 9), 456 + GROUP(gen_clk_out, 6, 15), 458 457 459 458 /* Bank Z */ 460 459 GROUP(eth_mdio, 6, 1), ··· 709 706 "spdif_out_y", 710 707 }; 711 708 709 + static const char * const gen_clk_out_groups[] = { 710 + "gen_clk_out", 711 + }; 712 + 712 713 static const char * const gpio_aobus_groups[] = { 713 714 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", 714 715 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", ··· 797 790 FUNCTION(hdmi_i2c), 798 791 FUNCTION(i2s_out), 799 792 FUNCTION(spdif_out), 793 + FUNCTION(gen_clk_out), 800 794 }; 801 795 802 796 static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
+118
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
··· 80 80 unsigned int ngroups; 81 81 }; 82 82 83 + struct armada_37xx_pm_state { 84 + u32 out_en_l; 85 + u32 out_en_h; 86 + u32 out_val_l; 87 + u32 out_val_h; 88 + u32 irq_en_l; 89 + u32 irq_en_h; 90 + u32 irq_pol_l; 91 + u32 irq_pol_h; 92 + u32 selection; 93 + }; 94 + 83 95 struct armada_37xx_pinctrl { 84 96 struct regmap *regmap; 85 97 void __iomem *base; ··· 106 94 unsigned int ngroups; 107 95 struct armada_37xx_pmx_func *funcs; 108 96 unsigned int nfuncs; 97 + struct armada_37xx_pm_state pm; 109 98 }; 110 99 111 100 #define PIN_GRP(_name, _start, _nr, _mask, _func1, _func2) \ ··· 1009 996 return 0; 1010 997 } 1011 998 999 + #if defined(CONFIG_PM) 1000 + static int armada_3700_pinctrl_suspend(struct device *dev) 1001 + { 1002 + struct armada_37xx_pinctrl *info = dev_get_drvdata(dev); 1003 + 1004 + /* Save GPIO state */ 1005 + regmap_read(info->regmap, OUTPUT_EN, &info->pm.out_en_l); 1006 + regmap_read(info->regmap, OUTPUT_EN + sizeof(u32), &info->pm.out_en_h); 1007 + regmap_read(info->regmap, OUTPUT_VAL, &info->pm.out_val_l); 1008 + regmap_read(info->regmap, OUTPUT_VAL + sizeof(u32), 1009 + &info->pm.out_val_h); 1010 + 1011 + info->pm.irq_en_l = readl(info->base + IRQ_EN); 1012 + info->pm.irq_en_h = readl(info->base + IRQ_EN + sizeof(u32)); 1013 + info->pm.irq_pol_l = readl(info->base + IRQ_POL); 1014 + info->pm.irq_pol_h = readl(info->base + IRQ_POL + sizeof(u32)); 1015 + 1016 + /* Save pinctrl state */ 1017 + regmap_read(info->regmap, SELECTION, &info->pm.selection); 1018 + 1019 + return 0; 1020 + } 1021 + 1022 + static int armada_3700_pinctrl_resume(struct device *dev) 1023 + { 1024 + struct armada_37xx_pinctrl *info = dev_get_drvdata(dev); 1025 + struct gpio_chip *gc; 1026 + struct irq_domain *d; 1027 + int i; 1028 + 1029 + /* Restore GPIO state */ 1030 + regmap_write(info->regmap, OUTPUT_EN, info->pm.out_en_l); 1031 + regmap_write(info->regmap, OUTPUT_EN + sizeof(u32), 1032 + info->pm.out_en_h); 1033 + regmap_write(info->regmap, OUTPUT_VAL, info->pm.out_val_l); 1034 + regmap_write(info->regmap, OUTPUT_VAL + sizeof(u32), 1035 + info->pm.out_val_h); 1036 + 1037 + /* 1038 + * Input levels may change during suspend, which is not monitored at 1039 + * that time. GPIOs used for both-edge IRQs may not be synchronized 1040 + * anymore with their polarities (rising/falling edge) and must be 1041 + * re-configured manually. 1042 + */ 1043 + gc = &info->gpio_chip; 1044 + d = gc->irq.domain; 1045 + for (i = 0; i < gc->ngpio; i++) { 1046 + u32 irq_bit = BIT(i % GPIO_PER_REG); 1047 + u32 mask, *irq_pol, input_reg, virq, type, level; 1048 + 1049 + if (i < GPIO_PER_REG) { 1050 + mask = info->pm.irq_en_l; 1051 + irq_pol = &info->pm.irq_pol_l; 1052 + input_reg = INPUT_VAL; 1053 + } else { 1054 + mask = info->pm.irq_en_h; 1055 + irq_pol = &info->pm.irq_pol_h; 1056 + input_reg = INPUT_VAL + sizeof(u32); 1057 + } 1058 + 1059 + if (!(mask & irq_bit)) 1060 + continue; 1061 + 1062 + virq = irq_find_mapping(d, i); 1063 + type = irq_get_trigger_type(virq); 1064 + 1065 + /* 1066 + * Synchronize level and polarity for both-edge irqs: 1067 + * - a high input level expects a falling edge, 1068 + * - a low input level exepects a rising edge. 1069 + */ 1070 + if ((type & IRQ_TYPE_SENSE_MASK) == 1071 + IRQ_TYPE_EDGE_BOTH) { 1072 + regmap_read(info->regmap, input_reg, &level); 1073 + if ((*irq_pol ^ level) & irq_bit) 1074 + *irq_pol ^= irq_bit; 1075 + } 1076 + } 1077 + 1078 + writel(info->pm.irq_en_l, info->base + IRQ_EN); 1079 + writel(info->pm.irq_en_h, info->base + IRQ_EN + sizeof(u32)); 1080 + writel(info->pm.irq_pol_l, info->base + IRQ_POL); 1081 + writel(info->pm.irq_pol_h, info->base + IRQ_POL + sizeof(u32)); 1082 + 1083 + /* Restore pinctrl state */ 1084 + regmap_write(info->regmap, SELECTION, info->pm.selection); 1085 + 1086 + return 0; 1087 + } 1088 + 1089 + /* 1090 + * Since pinctrl is an infrastructure module, its resume should be issued prior 1091 + * to other IO drivers. 1092 + */ 1093 + static const struct dev_pm_ops armada_3700_pinctrl_pm_ops = { 1094 + .suspend_late = armada_3700_pinctrl_suspend, 1095 + .resume_early = armada_3700_pinctrl_resume, 1096 + }; 1097 + 1098 + #define PINCTRL_ARMADA_37XX_DEV_PM_OPS (&armada_3700_pinctrl_pm_ops) 1099 + #else 1100 + #define PINCTRL_ARMADA_37XX_DEV_PM_OPS NULL 1101 + #endif /* CONFIG_PM */ 1102 + 1012 1103 static const struct of_device_id armada_37xx_pinctrl_of_match[] = { 1013 1104 { 1014 1105 .compatible = "marvell,armada3710-sb-pinctrl", ··· 1166 1049 .driver = { 1167 1050 .name = "armada-37xx-pinctrl", 1168 1051 .of_match_table = armada_37xx_pinctrl_of_match, 1052 + .pm = PINCTRL_ARMADA_37XX_DEV_PM_OPS, 1169 1053 }, 1170 1054 }; 1171 1055
+6 -5
drivers/pinctrl/nomadik/pinctrl-abx500.c
··· 101 101 reg += offset / 8; 102 102 ret = abx500_get_register_interruptible(pct->dev, 103 103 AB8500_MISC, reg, &val); 104 - 105 - *bit = !!(val & BIT(pos)); 106 - 107 - if (ret < 0) 104 + if (ret < 0) { 108 105 dev_err(pct->dev, 109 106 "%s read reg =%x, offset=%x failed (%d)\n", 110 107 __func__, reg, offset, ret); 108 + return ret; 109 + } 111 110 112 - return ret; 111 + *bit = !!(val & BIT(pos)); 112 + 113 + return 0; 113 114 } 114 115 115 116 static int abx500_gpio_set_bits(struct gpio_chip *chip, u8 reg,
+9 -8
drivers/pinctrl/pinctrl-amd.c
··· 247 247 raw_spin_unlock_irqrestore(&gpio_dev->lock, flags); 248 248 249 249 if (pin_reg & BIT(INTERRUPT_ENABLE_OFF)) { 250 + u8 level = (pin_reg >> ACTIVE_LEVEL_OFF) & 251 + ACTIVE_LEVEL_MASK; 250 252 interrupt_enable = "interrupt is enabled|"; 251 253 252 - if (!(pin_reg & BIT(ACTIVE_LEVEL_OFF)) && 253 - !(pin_reg & BIT(ACTIVE_LEVEL_OFF + 1))) 254 - active_level = "Active low|"; 255 - else if (pin_reg & BIT(ACTIVE_LEVEL_OFF) && 256 - !(pin_reg & BIT(ACTIVE_LEVEL_OFF + 1))) 254 + if (level == ACTIVE_LEVEL_HIGH) 257 255 active_level = "Active high|"; 258 - else if (!(pin_reg & BIT(ACTIVE_LEVEL_OFF)) && 259 - pin_reg & BIT(ACTIVE_LEVEL_OFF + 1)) 256 + else if (level == ACTIVE_LEVEL_LOW) 257 + active_level = "Active low|"; 258 + else if (!(pin_reg & BIT(LEVEL_TRIG_OFF)) && 259 + level == ACTIVE_LEVEL_BOTH) 260 260 active_level = "Active on both|"; 261 261 else 262 262 active_level = "Unknown Active level|"; ··· 552 552 /* Each status bit covers four pins */ 553 553 for (i = 0; i < 4; i++) { 554 554 regval = readl(regs + i); 555 - if (!(regval & PIN_IRQ_PENDING)) 555 + if (!(regval & PIN_IRQ_PENDING) || 556 + !(regval & BIT(INTERRUPT_MASK_OFF))) 556 557 continue; 557 558 irq = irq_find_mapping(gc->irq.domain, irqnr + i); 558 559 generic_handle_irq(irq);
+4
drivers/pinctrl/pinctrl-amd.h
··· 54 54 #define ACTIVE_LEVEL_MASK 0x3UL 55 55 #define DRV_STRENGTH_SEL_MASK 0x3UL 56 56 57 + #define ACTIVE_LEVEL_HIGH 0x0UL 58 + #define ACTIVE_LEVEL_LOW 0x1UL 59 + #define ACTIVE_LEVEL_BOTH 0x2UL 60 + 57 61 #define DB_TYPE_NO_DEBOUNCE 0x0UL 58 62 #define DB_TYPE_PRESERVE_LOW_GLITCH 0x1UL 59 63 #define DB_TYPE_PRESERVE_HIGH_GLITCH 0x2UL
+42 -4
drivers/pinctrl/pinctrl-at91-pio4.c
··· 14 14 * GNU General Public License for more details. 15 15 */ 16 16 17 + #include <dt-bindings/pinctrl/at91.h> 17 18 #include <linux/clk.h> 18 19 #include <linux/gpio/driver.h> 19 20 /* FIXME: needed for gpio_to_irq(), get rid of this */ ··· 50 49 #define ATMEL_PIO_IFSCEN_MASK BIT(13) 51 50 #define ATMEL_PIO_OPD_MASK BIT(14) 52 51 #define ATMEL_PIO_SCHMITT_MASK BIT(15) 52 + #define ATMEL_PIO_DRVSTR_MASK GENMASK(17, 16) 53 + #define ATMEL_PIO_DRVSTR_OFFSET 16 53 54 #define ATMEL_PIO_CFGR_EVTSEL_MASK GENMASK(26, 24) 54 55 #define ATMEL_PIO_CFGR_EVTSEL_FALLING (0 << 24) 55 56 #define ATMEL_PIO_CFGR_EVTSEL_RISING (1 << 24) ··· 77 74 #define ATMEL_GET_PIN_NO(pinfunc) ((pinfunc) & 0xff) 78 75 #define ATMEL_GET_PIN_FUNC(pinfunc) ((pinfunc >> 16) & 0xf) 79 76 #define ATMEL_GET_PIN_IOSET(pinfunc) ((pinfunc >> 20) & 0xf) 77 + 78 + /* Custom pinconf parameters */ 79 + #define ATMEL_PIN_CONFIG_DRIVE_STRENGTH (PIN_CONFIG_END + 1) 80 80 81 81 struct atmel_pioctrl_data { 82 82 unsigned nbanks; ··· 143 137 144 138 static const char * const atmel_functions[] = { 145 139 "GPIO", "A", "B", "C", "D", "E", "F", "G" 140 + }; 141 + 142 + static const struct pinconf_generic_params atmel_custom_bindings[] = { 143 + {"atmel,drive-strength", ATMEL_PIN_CONFIG_DRIVE_STRENGTH, 0}, 146 144 }; 147 145 148 146 /* --- GPIO --- */ ··· 702 692 return -EINVAL; 703 693 arg = 1; 704 694 break; 695 + case ATMEL_PIN_CONFIG_DRIVE_STRENGTH: 696 + if (!(res & ATMEL_PIO_DRVSTR_MASK)) 697 + return -EINVAL; 698 + arg = (res & ATMEL_PIO_DRVSTR_MASK) >> ATMEL_PIO_DRVSTR_OFFSET; 699 + break; 705 700 default: 706 701 return -ENOTSUPP; 707 702 } ··· 792 777 ATMEL_PIO_SODR); 793 778 } 794 779 break; 780 + case ATMEL_PIN_CONFIG_DRIVE_STRENGTH: 781 + switch (arg) { 782 + case ATMEL_PIO_DRVSTR_LO: 783 + case ATMEL_PIO_DRVSTR_ME: 784 + case ATMEL_PIO_DRVSTR_HI: 785 + conf &= (~ATMEL_PIO_DRVSTR_MASK); 786 + conf |= arg << ATMEL_PIO_DRVSTR_OFFSET; 787 + break; 788 + default: 789 + dev_warn(pctldev->dev, "drive strength not updated (incorrect value)\n"); 790 + } 791 + break; 795 792 default: 796 793 dev_warn(pctldev->dev, 797 794 "unsupported configuration parameter: %u\n", ··· 843 816 seq_printf(s, "%s ", "open-drain"); 844 817 if (conf & ATMEL_PIO_SCHMITT_MASK) 845 818 seq_printf(s, "%s ", "schmitt"); 819 + if (conf & ATMEL_PIO_DRVSTR_MASK) { 820 + switch ((conf & ATMEL_PIO_DRVSTR_MASK) >> ATMEL_PIO_DRVSTR_OFFSET) { 821 + case ATMEL_PIO_DRVSTR_ME: 822 + seq_printf(s, "%s ", "medium-drive"); 823 + break; 824 + case ATMEL_PIO_DRVSTR_HI: 825 + seq_printf(s, "%s ", "high-drive"); 826 + break; 827 + /* ATMEL_PIO_DRVSTR_LO and 0 which is the default value at reset */ 828 + default: 829 + seq_printf(s, "%s ", "low-drive"); 830 + } 831 + } 846 832 } 847 833 848 834 static const struct pinconf_ops atmel_confops = { ··· 971 931 atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK; 972 932 973 933 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 974 - if (!res) { 975 - dev_err(dev, "unable to get atmel pinctrl resource\n"); 976 - return -EINVAL; 977 - } 978 934 atmel_pioctrl->reg_base = devm_ioremap_resource(dev, res); 979 935 if (IS_ERR(atmel_pioctrl->reg_base)) 980 936 return -EINVAL; ··· 994 958 return -ENOMEM; 995 959 atmel_pinctrl_desc.pins = pin_desc; 996 960 atmel_pinctrl_desc.npins = atmel_pioctrl->npins; 961 + atmel_pinctrl_desc.num_custom_params = ARRAY_SIZE(atmel_custom_bindings); 962 + atmel_pinctrl_desc.custom_params = atmel_custom_bindings; 997 963 998 964 /* One pin is one group since a pin can achieve all functions. */ 999 965 group_names = devm_kcalloc(dev,
+20 -6
drivers/pinctrl/pinctrl-axp209.c
··· 316 316 .get_group_pins = axp20x_group_pins, 317 317 }; 318 318 319 - static void axp20x_funcs_groups_from_mask(struct device *dev, unsigned int mask, 319 + static int axp20x_funcs_groups_from_mask(struct device *dev, unsigned int mask, 320 320 unsigned int mask_len, 321 321 struct axp20x_pinctrl_function *func, 322 322 const struct pinctrl_pin_desc *pins) ··· 331 331 func->groups = devm_kcalloc(dev, 332 332 ngroups, sizeof(const char *), 333 333 GFP_KERNEL); 334 + if (!func->groups) 335 + return -ENOMEM; 334 336 group = func->groups; 335 337 for_each_set_bit(bit, &mask_cpy, mask_len) { 336 338 *group = pins[bit].name; 337 339 group++; 338 340 } 339 341 } 342 + 343 + return 0; 340 344 } 341 345 342 - static void axp20x_build_funcs_groups(struct platform_device *pdev) 346 + static int axp20x_build_funcs_groups(struct platform_device *pdev) 343 347 { 344 348 struct axp20x_pctl *pctl = platform_get_drvdata(pdev); 345 - int i, pin, npins = pctl->desc->npins; 349 + int i, ret, pin, npins = pctl->desc->npins; 346 350 347 351 pctl->funcs[AXP20X_FUNC_GPIO_OUT].name = "gpio_out"; 348 352 pctl->funcs[AXP20X_FUNC_GPIO_OUT].muxval = AXP20X_MUX_GPIO_OUT; ··· 370 366 pctl->funcs[i].groups[pin] = pctl->desc->pins[pin].name; 371 367 } 372 368 373 - axp20x_funcs_groups_from_mask(&pdev->dev, pctl->desc->ldo_mask, 369 + ret = axp20x_funcs_groups_from_mask(&pdev->dev, pctl->desc->ldo_mask, 374 370 npins, &pctl->funcs[AXP20X_FUNC_LDO], 375 371 pctl->desc->pins); 372 + if (ret) 373 + return ret; 376 374 377 - axp20x_funcs_groups_from_mask(&pdev->dev, pctl->desc->adc_mask, 375 + ret = axp20x_funcs_groups_from_mask(&pdev->dev, pctl->desc->adc_mask, 378 376 npins, &pctl->funcs[AXP20X_FUNC_ADC], 379 377 pctl->desc->pins); 378 + if (ret) 379 + return ret; 380 + 381 + return 0; 380 382 } 381 383 382 384 static const struct of_device_id axp20x_pctl_match[] = { ··· 434 424 435 425 platform_set_drvdata(pdev, pctl); 436 426 437 - axp20x_build_funcs_groups(pdev); 427 + ret = axp20x_build_funcs_groups(pdev); 428 + if (ret) { 429 + dev_err(&pdev->dev, "failed to build groups\n"); 430 + return ret; 431 + } 438 432 439 433 pctrl_desc = devm_kzalloc(&pdev->dev, sizeof(*pctrl_desc), GFP_KERNEL); 440 434 if (!pctrl_desc)
+2
drivers/pinctrl/pinctrl-gemini.c
··· 1696 1696 .name = "gmii_gmac0_grp", 1697 1697 .pins = gmii_gmac0_3516_pins, 1698 1698 .num_pins = ARRAY_SIZE(gmii_gmac0_3516_pins), 1699 + .mask = GEMINI_GMAC_IOSEL_MASK, 1699 1700 .driving_mask = GENMASK(17, 16), 1700 1701 }, 1701 1702 { ··· 1704 1703 .pins = gmii_gmac1_3516_pins, 1705 1704 .num_pins = ARRAY_SIZE(gmii_gmac1_3516_pins), 1706 1705 /* Bring out RGMII on the GMAC1 pins */ 1706 + .mask = GEMINI_GMAC_IOSEL_MASK, 1707 1707 .value = GEMINI_GMAC_IOSEL_GMAC0_GMAC1_RGMII, 1708 1708 .driving_mask = GENMASK(19, 18), 1709 1709 },
+1 -1
drivers/pinctrl/pinctrl-mcp23s08.c
··· 666 666 * can be used to fix state for MCP23xxx, that temporary 667 667 * lost its power supply. 668 668 */ 669 - #define MCP23S08_CONFIG_REGS 8 669 + #define MCP23S08_CONFIG_REGS 7 670 670 static int __check_mcp23s08_reg_cache(struct mcp23s08 *mcp) 671 671 { 672 672 int cached[MCP23S08_CONFIG_REGS];
+101 -3
drivers/pinctrl/pinctrl-ocelot.c
··· 11 11 #include <linux/interrupt.h> 12 12 #include <linux/io.h> 13 13 #include <linux/of_device.h> 14 + #include <linux/of_irq.h> 14 15 #include <linux/of_platform.h> 15 16 #include <linux/pinctrl/pinctrl.h> 16 17 #include <linux/pinctrl/pinmux.h> ··· 133 132 OCELOT_P(1, SG0, NONE, NONE); 134 133 OCELOT_P(2, SG0, NONE, NONE); 135 134 OCELOT_P(3, SG0, NONE, NONE); 136 - OCELOT_P(4, IRQ0_IN, IRQ0_OUT, TWI); 135 + OCELOT_P(4, IRQ0_IN, IRQ0_OUT, TWI_SCL_M); 137 136 OCELOT_P(5, IRQ1_IN, IRQ1_OUT, PCI_WAKE); 138 137 OCELOT_P(6, UART, TWI_SCL_M, NONE); 139 138 OCELOT_P(7, UART, TWI_SCL_M, NONE); ··· 428 427 .owner = THIS_MODULE, 429 428 }; 430 429 430 + static void ocelot_irq_mask(struct irq_data *data) 431 + { 432 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 433 + struct ocelot_pinctrl *info = gpiochip_get_data(chip); 434 + unsigned int gpio = irqd_to_hwirq(data); 435 + 436 + regmap_update_bits(info->map, OCELOT_GPIO_INTR_ENA, BIT(gpio), 0); 437 + } 438 + 439 + static void ocelot_irq_unmask(struct irq_data *data) 440 + { 441 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 442 + struct ocelot_pinctrl *info = gpiochip_get_data(chip); 443 + unsigned int gpio = irqd_to_hwirq(data); 444 + 445 + regmap_update_bits(info->map, OCELOT_GPIO_INTR_ENA, BIT(gpio), 446 + BIT(gpio)); 447 + } 448 + 449 + static void ocelot_irq_ack(struct irq_data *data) 450 + { 451 + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); 452 + struct ocelot_pinctrl *info = gpiochip_get_data(chip); 453 + unsigned int gpio = irqd_to_hwirq(data); 454 + 455 + regmap_write_bits(info->map, OCELOT_GPIO_INTR, BIT(gpio), BIT(gpio)); 456 + } 457 + 458 + static int ocelot_irq_set_type(struct irq_data *data, unsigned int type); 459 + 460 + static struct irq_chip ocelot_eoi_irqchip = { 461 + .name = "gpio", 462 + .irq_mask = ocelot_irq_mask, 463 + .irq_eoi = ocelot_irq_ack, 464 + .irq_unmask = ocelot_irq_unmask, 465 + .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED, 466 + .irq_set_type = ocelot_irq_set_type, 467 + }; 468 + 469 + static struct irq_chip ocelot_irqchip = { 470 + .name = "gpio", 471 + .irq_mask = ocelot_irq_mask, 472 + .irq_ack = ocelot_irq_ack, 473 + .irq_unmask = ocelot_irq_unmask, 474 + .irq_set_type = ocelot_irq_set_type, 475 + }; 476 + 477 + static int ocelot_irq_set_type(struct irq_data *data, unsigned int type) 478 + { 479 + type &= IRQ_TYPE_SENSE_MASK; 480 + 481 + if (!(type & (IRQ_TYPE_EDGE_BOTH | IRQ_TYPE_LEVEL_HIGH))) 482 + return -EINVAL; 483 + 484 + if (type & IRQ_TYPE_LEVEL_HIGH) 485 + irq_set_chip_handler_name_locked(data, &ocelot_eoi_irqchip, 486 + handle_fasteoi_irq, NULL); 487 + if (type & IRQ_TYPE_EDGE_BOTH) 488 + irq_set_chip_handler_name_locked(data, &ocelot_irqchip, 489 + handle_edge_irq, NULL); 490 + 491 + return 0; 492 + } 493 + 494 + static void ocelot_irq_handler(struct irq_desc *desc) 495 + { 496 + struct irq_chip *parent_chip = irq_desc_get_chip(desc); 497 + struct gpio_chip *chip = irq_desc_get_handler_data(desc); 498 + struct ocelot_pinctrl *info = gpiochip_get_data(chip); 499 + unsigned int reg = 0, irq; 500 + unsigned long irqs; 501 + 502 + regmap_read(info->map, OCELOT_GPIO_INTR_IDENT, &reg); 503 + if (!reg) 504 + return; 505 + 506 + chained_irq_enter(parent_chip, desc); 507 + 508 + irqs = reg; 509 + 510 + for_each_set_bit(irq, &irqs, OCELOT_PINS) { 511 + generic_handle_irq(irq_linear_revmap(chip->irq.domain, irq)); 512 + } 513 + 514 + chained_irq_exit(parent_chip, desc); 515 + } 516 + 431 517 static int ocelot_gpiochip_register(struct platform_device *pdev, 432 518 struct ocelot_pinctrl *info) 433 519 { 434 520 struct gpio_chip *gc; 435 - int ret; 521 + int ret, irq; 436 522 437 523 info->gpio_chip = ocelot_gpiolib_chip; 438 524 ··· 534 446 if (ret) 535 447 return ret; 536 448 537 - /* TODO: this can be used as an irqchip but no board is using that */ 449 + irq = irq_of_parse_and_map(pdev->dev.of_node, 0); 450 + if (irq <= 0) 451 + return irq; 452 + 453 + ret = gpiochip_irqchip_add(gc, &ocelot_irqchip, 0, handle_edge_irq, 454 + IRQ_TYPE_NONE); 455 + if (ret) 456 + return ret; 457 + 458 + gpiochip_set_chained_irqchip(gc, &ocelot_irqchip, irq, 459 + ocelot_irq_handler); 538 460 539 461 return 0; 540 462 }
+13 -11
drivers/pinctrl/pinctrl-rza1.c
··· 1006 1006 const char *grpname; 1007 1007 const char **fngrps; 1008 1008 int ret, npins; 1009 + int gsel, fsel; 1009 1010 1010 1011 npins = rza1_dt_node_pin_count(np); 1011 1012 if (npins < 0) { ··· 1056 1055 fngrps[0] = grpname; 1057 1056 1058 1057 mutex_lock(&rza1_pctl->mutex); 1059 - ret = pinctrl_generic_add_group(pctldev, grpname, grpins, npins, 1060 - NULL); 1061 - if (ret) { 1058 + gsel = pinctrl_generic_add_group(pctldev, grpname, grpins, npins, 1059 + NULL); 1060 + if (gsel < 0) { 1062 1061 mutex_unlock(&rza1_pctl->mutex); 1063 - return ret; 1062 + return gsel; 1064 1063 } 1065 1064 1066 - ret = pinmux_generic_add_function(pctldev, grpname, fngrps, 1, 1067 - mux_confs); 1068 - if (ret) 1065 + fsel = pinmux_generic_add_function(pctldev, grpname, fngrps, 1, 1066 + mux_confs); 1067 + if (fsel < 0) { 1068 + ret = fsel; 1069 1069 goto remove_group; 1070 - mutex_unlock(&rza1_pctl->mutex); 1070 + } 1071 1071 1072 1072 dev_info(rza1_pctl->dev, "Parsed function and group %s with %d pins\n", 1073 1073 grpname, npins); ··· 1085 1083 (*map)->data.mux.group = np->name; 1086 1084 (*map)->data.mux.function = np->name; 1087 1085 *num_maps = 1; 1086 + mutex_unlock(&rza1_pctl->mutex); 1088 1087 1089 1088 return 0; 1090 1089 1091 1090 remove_function: 1092 - mutex_lock(&rza1_pctl->mutex); 1093 - pinmux_generic_remove_last_function(pctldev); 1091 + pinmux_generic_remove_function(pctldev, fsel); 1094 1092 1095 1093 remove_group: 1096 - pinctrl_generic_remove_last_group(pctldev); 1094 + pinctrl_generic_remove_group(pctldev, gsel); 1097 1095 mutex_unlock(&rza1_pctl->mutex); 1098 1096 1099 1097 dev_info(rza1_pctl->dev, "Unable to parse function and group %s\n",
+73 -54
drivers/pinctrl/pinctrl-single.c
··· 747 747 /** 748 748 * pcs_add_function() - adds a new function to the function list 749 749 * @pcs: pcs driver instance 750 - * @np: device node of the mux entry 750 + * @fcn: new function allocated 751 751 * @name: name of the function 752 752 * @vals: array of mux register value pairs used by the function 753 753 * @nvals: number of mux register value pairs 754 754 * @pgnames: array of pingroup names for the function 755 755 * @npgnames: number of pingroup names 756 + * 757 + * Caller must take care of locking. 756 758 */ 757 - static struct pcs_function *pcs_add_function(struct pcs_device *pcs, 758 - struct device_node *np, 759 - const char *name, 760 - struct pcs_func_vals *vals, 761 - unsigned nvals, 762 - const char **pgnames, 763 - unsigned npgnames) 759 + static int pcs_add_function(struct pcs_device *pcs, 760 + struct pcs_function **fcn, 761 + const char *name, 762 + struct pcs_func_vals *vals, 763 + unsigned int nvals, 764 + const char **pgnames, 765 + unsigned int npgnames) 764 766 { 765 767 struct pcs_function *function; 766 - int res; 768 + int selector; 767 769 768 770 function = devm_kzalloc(pcs->dev, sizeof(*function), GFP_KERNEL); 769 771 if (!function) 770 - return NULL; 772 + return -ENOMEM; 771 773 772 774 function->vals = vals; 773 775 function->nvals = nvals; 774 776 775 - res = pinmux_generic_add_function(pcs->pctl, name, 776 - pgnames, npgnames, 777 - function); 778 - if (res) 779 - return NULL; 777 + selector = pinmux_generic_add_function(pcs->pctl, name, 778 + pgnames, npgnames, 779 + function); 780 + if (selector < 0) { 781 + devm_kfree(pcs->dev, function); 782 + *fcn = NULL; 783 + } else { 784 + *fcn = function; 785 + } 780 786 781 - return function; 787 + return selector; 782 788 } 783 789 784 790 /** ··· 985 979 { 986 980 const char *name = "pinctrl-single,pins"; 987 981 struct pcs_func_vals *vals; 988 - int rows, *pins, found = 0, res = -ENOMEM, i; 989 - struct pcs_function *function; 982 + int rows, *pins, found = 0, res = -ENOMEM, i, fsel, gsel; 983 + struct pcs_function *function = NULL; 990 984 991 985 rows = pinctrl_count_index_with_args(np, name); 992 986 if (rows <= 0) { ··· 1036 1030 } 1037 1031 1038 1032 pgnames[0] = np->name; 1039 - function = pcs_add_function(pcs, np, np->name, vals, found, pgnames, 1); 1040 - if (!function) { 1041 - res = -ENOMEM; 1033 + mutex_lock(&pcs->mutex); 1034 + fsel = pcs_add_function(pcs, &function, np->name, vals, found, 1035 + pgnames, 1); 1036 + if (fsel < 0) { 1037 + res = fsel; 1042 1038 goto free_pins; 1043 1039 } 1044 1040 1045 - res = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs); 1046 - if (res < 0) 1041 + gsel = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs); 1042 + if (gsel < 0) { 1043 + res = gsel; 1047 1044 goto free_function; 1045 + } 1048 1046 1049 1047 (*map)->type = PIN_MAP_TYPE_MUX_GROUP; 1050 1048 (*map)->data.mux.group = np->name; 1051 1049 (*map)->data.mux.function = np->name; 1052 1050 1053 - if (PCS_HAS_PINCONF) { 1051 + if (PCS_HAS_PINCONF && function) { 1054 1052 res = pcs_parse_pinconf(pcs, np, function, map); 1055 1053 if (res) 1056 1054 goto free_pingroups; ··· 1062 1052 } else { 1063 1053 *num_maps = 1; 1064 1054 } 1055 + mutex_unlock(&pcs->mutex); 1056 + 1065 1057 return 0; 1066 1058 1067 1059 free_pingroups: 1068 - pinctrl_generic_remove_last_group(pcs->pctl); 1060 + pinctrl_generic_remove_group(pcs->pctl, gsel); 1069 1061 *num_maps = 1; 1070 1062 free_function: 1071 - pinmux_generic_remove_last_function(pcs->pctl); 1072 - 1063 + pinmux_generic_remove_function(pcs->pctl, fsel); 1073 1064 free_pins: 1065 + mutex_unlock(&pcs->mutex); 1074 1066 devm_kfree(pcs->dev, pins); 1075 1067 1076 1068 free_vals: ··· 1089 1077 { 1090 1078 const char *name = "pinctrl-single,bits"; 1091 1079 struct pcs_func_vals *vals; 1092 - int rows, *pins, found = 0, res = -ENOMEM, i; 1080 + int rows, *pins, found = 0, res = -ENOMEM, i, fsel, gsel; 1093 1081 int npins_in_row; 1094 - struct pcs_function *function; 1082 + struct pcs_function *function = NULL; 1095 1083 1096 1084 rows = pinctrl_count_index_with_args(np, name); 1097 1085 if (rows <= 0) { ··· 1178 1166 } 1179 1167 1180 1168 pgnames[0] = np->name; 1181 - function = pcs_add_function(pcs, np, np->name, vals, found, pgnames, 1); 1182 - if (!function) { 1183 - res = -ENOMEM; 1169 + mutex_lock(&pcs->mutex); 1170 + fsel = pcs_add_function(pcs, &function, np->name, vals, found, 1171 + pgnames, 1); 1172 + if (fsel < 0) { 1173 + res = fsel; 1184 1174 goto free_pins; 1185 1175 } 1186 1176 1187 - res = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs); 1188 - if (res < 0) 1177 + gsel = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs); 1178 + if (gsel < 0) { 1179 + res = gsel; 1189 1180 goto free_function; 1181 + } 1190 1182 1191 1183 (*map)->type = PIN_MAP_TYPE_MUX_GROUP; 1192 1184 (*map)->data.mux.group = np->name; ··· 1202 1186 } 1203 1187 1204 1188 *num_maps = 1; 1189 + mutex_unlock(&pcs->mutex); 1190 + 1205 1191 return 0; 1206 1192 1207 1193 free_pingroups: 1208 - pinctrl_generic_remove_last_group(pcs->pctl); 1194 + pinctrl_generic_remove_group(pcs->pctl, gsel); 1209 1195 *num_maps = 1; 1210 1196 free_function: 1211 - pinmux_generic_remove_last_function(pcs->pctl); 1197 + pinmux_generic_remove_function(pcs->pctl, fsel); 1212 1198 free_pins: 1199 + mutex_unlock(&pcs->mutex); 1213 1200 devm_kfree(pcs->dev, pins); 1214 1201 1215 1202 free_vals: ··· 1617 1598 1618 1599 switch (pcs->width) { 1619 1600 case 64: 1620 - regsl = (u64 *)pcs->saved_vals; 1621 - for (i = 0; i < pcs->size / mux_bytes; i++) 1622 - regsl[i] = pcs->read(pcs->base + i * mux_bytes); 1601 + regsl = pcs->saved_vals; 1602 + for (i = 0; i < pcs->size; i += mux_bytes) 1603 + *regsl++ = pcs->read(pcs->base + i); 1623 1604 break; 1624 1605 case 32: 1625 - regsw = (u32 *)pcs->saved_vals; 1626 - for (i = 0; i < pcs->size / mux_bytes; i++) 1627 - regsw[i] = pcs->read(pcs->base + i * mux_bytes); 1606 + regsw = pcs->saved_vals; 1607 + for (i = 0; i < pcs->size; i += mux_bytes) 1608 + *regsw++ = pcs->read(pcs->base + i); 1628 1609 break; 1629 1610 case 16: 1630 - regshw = (u16 *)pcs->saved_vals; 1631 - for (i = 0; i < pcs->size / mux_bytes; i++) 1632 - regshw[i] = pcs->read(pcs->base + i * mux_bytes); 1611 + regshw = pcs->saved_vals; 1612 + for (i = 0; i < pcs->size; i += mux_bytes) 1613 + *regshw++ = pcs->read(pcs->base + i); 1633 1614 break; 1634 1615 } 1635 1616 ··· 1647 1628 1648 1629 switch (pcs->width) { 1649 1630 case 64: 1650 - regsl = (u64 *)pcs->saved_vals; 1651 - for (i = 0; i < pcs->size / mux_bytes; i++) 1652 - pcs->write(regsl[i], pcs->base + i * mux_bytes); 1631 + regsl = pcs->saved_vals; 1632 + for (i = 0; i < pcs->size; i += mux_bytes) 1633 + pcs->write(*regsl++, pcs->base + i); 1653 1634 break; 1654 1635 case 32: 1655 - regsw = (u32 *)pcs->saved_vals; 1656 - for (i = 0; i < pcs->size / mux_bytes; i++) 1657 - pcs->write(regsw[i], pcs->base + i * mux_bytes); 1636 + regsw = pcs->saved_vals; 1637 + for (i = 0; i < pcs->size; i += mux_bytes) 1638 + pcs->write(*regsw++, pcs->base + i); 1658 1639 break; 1659 1640 case 16: 1660 - regshw = (u16 *)pcs->saved_vals; 1661 - for (i = 0; i < pcs->size / mux_bytes; i++) 1662 - pcs->write(regshw[i], pcs->base + i * mux_bytes); 1641 + regshw = pcs->saved_vals; 1642 + for (i = 0; i < pcs->size; i += mux_bytes) 1643 + pcs->write(*regshw++, pcs->base + i); 1663 1644 break; 1664 1645 } 1665 1646 }
+12 -5
drivers/pinctrl/pinmux.c
··· 22 22 #include <linux/err.h> 23 23 #include <linux/list.h> 24 24 #include <linux/string.h> 25 - #include <linux/sysfs.h> 26 25 #include <linux/debugfs.h> 27 26 #include <linux/seq_file.h> 28 27 #include <linux/pinctrl/machine.h> ··· 307 308 selector++; 308 309 } 309 310 310 - dev_err(pctldev->dev, "function '%s' not supported\n", function); 311 311 return -EINVAL; 312 312 } 313 313 ··· 773 775 void *data) 774 776 { 775 777 struct function_desc *function; 778 + int selector; 779 + 780 + if (!name) 781 + return -EINVAL; 782 + 783 + selector = pinmux_func_name_to_selector(pctldev, name); 784 + if (selector >= 0) 785 + return selector; 786 + 787 + selector = pctldev->num_functions; 776 788 777 789 function = devm_kzalloc(pctldev->dev, sizeof(*function), GFP_KERNEL); 778 790 if (!function) ··· 793 785 function->num_group_names = num_groups; 794 786 function->data = data; 795 787 796 - radix_tree_insert(&pctldev->pin_function_tree, pctldev->num_functions, 797 - function); 788 + radix_tree_insert(&pctldev->pin_function_tree, selector, function); 798 789 799 790 pctldev->num_functions++; 800 791 801 - return 0; 792 + return selector; 802 793 } 803 794 EXPORT_SYMBOL_GPL(pinmux_generic_add_function); 804 795
-7
drivers/pinctrl/pinmux.h
··· 150 150 int pinmux_generic_remove_function(struct pinctrl_dev *pctldev, 151 151 unsigned int selector); 152 152 153 - static inline int 154 - pinmux_generic_remove_last_function(struct pinctrl_dev *pctldev) 155 - { 156 - return pinmux_generic_remove_function(pctldev, 157 - pctldev->num_functions - 1); 158 - } 159 - 160 153 void pinmux_generic_free_functions(struct pinctrl_dev *pctldev); 161 154 162 155 #else
+11 -3
drivers/pinctrl/qcom/pinctrl-msm.c
··· 250 250 /* Convert register value to pinconf value */ 251 251 switch (param) { 252 252 case PIN_CONFIG_BIAS_DISABLE: 253 - arg = arg == MSM_NO_PULL; 253 + if (arg != MSM_NO_PULL) 254 + return -EINVAL; 255 + arg = 1; 254 256 break; 255 257 case PIN_CONFIG_BIAS_PULL_DOWN: 256 - arg = arg == MSM_PULL_DOWN; 258 + if (arg != MSM_PULL_DOWN) 259 + return -EINVAL; 260 + arg = 1; 257 261 break; 258 262 case PIN_CONFIG_BIAS_BUS_HOLD: 259 263 if (pctrl->soc->pull_no_keeper) 260 264 return -ENOTSUPP; 261 265 262 - arg = arg == MSM_KEEPER; 266 + if (arg != MSM_KEEPER) 267 + return -EINVAL; 268 + arg = 1; 263 269 break; 264 270 case PIN_CONFIG_BIAS_PULL_UP: 265 271 if (pctrl->soc->pull_no_keeper) 266 272 arg = arg == MSM_PULL_UP_NO_KEEPER; 267 273 else 268 274 arg = arg == MSM_PULL_UP; 275 + if (!arg) 276 + return -EINVAL; 269 277 break; 270 278 case PIN_CONFIG_DRIVE_STRENGTH: 271 279 arg = msm_regval_to_drive(arg);
+24 -8
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
··· 390 390 391 391 switch (param) { 392 392 case PIN_CONFIG_DRIVE_PUSH_PULL: 393 - arg = pad->buffer_type == PMIC_GPIO_OUT_BUF_CMOS; 393 + if (pad->buffer_type != PMIC_GPIO_OUT_BUF_CMOS) 394 + return -EINVAL; 395 + arg = 1; 394 396 break; 395 397 case PIN_CONFIG_DRIVE_OPEN_DRAIN: 396 - arg = pad->buffer_type == PMIC_GPIO_OUT_BUF_OPEN_DRAIN_NMOS; 398 + if (pad->buffer_type != PMIC_GPIO_OUT_BUF_OPEN_DRAIN_NMOS) 399 + return -EINVAL; 400 + arg = 1; 397 401 break; 398 402 case PIN_CONFIG_DRIVE_OPEN_SOURCE: 399 - arg = pad->buffer_type == PMIC_GPIO_OUT_BUF_OPEN_DRAIN_PMOS; 403 + if (pad->buffer_type != PMIC_GPIO_OUT_BUF_OPEN_DRAIN_PMOS) 404 + return -EINVAL; 405 + arg = 1; 400 406 break; 401 407 case PIN_CONFIG_BIAS_PULL_DOWN: 402 - arg = pad->pullup == PMIC_GPIO_PULL_DOWN; 408 + if (pad->pullup != PMIC_GPIO_PULL_DOWN) 409 + return -EINVAL; 410 + arg = 1; 403 411 break; 404 412 case PIN_CONFIG_BIAS_DISABLE: 405 - arg = pad->pullup = PMIC_GPIO_PULL_DISABLE; 413 + if (pad->pullup != PMIC_GPIO_PULL_DISABLE) 414 + return -EINVAL; 415 + arg = 1; 406 416 break; 407 417 case PIN_CONFIG_BIAS_PULL_UP: 408 - arg = pad->pullup == PMIC_GPIO_PULL_UP_30; 418 + if (pad->pullup != PMIC_GPIO_PULL_UP_30) 419 + return -EINVAL; 420 + arg = 1; 409 421 break; 410 422 case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: 411 - arg = !pad->is_enabled; 423 + if (pad->is_enabled) 424 + return -EINVAL; 425 + arg = 1; 412 426 break; 413 427 case PIN_CONFIG_POWER_SOURCE: 414 428 arg = pad->power_source; 415 429 break; 416 430 case PIN_CONFIG_INPUT_ENABLE: 417 - arg = pad->input_enabled; 431 + if (!pad->input_enabled) 432 + return -EINVAL; 433 + arg = 1; 418 434 break; 419 435 case PIN_CONFIG_OUTPUT: 420 436 arg = pad->out_value;
+16
drivers/pinctrl/samsung/pinctrl-exynos-arm.c
··· 616 616 .nr_banks = ARRAY_SIZE(exynos5260_pin_banks0), 617 617 .eint_gpio_init = exynos_eint_gpio_init, 618 618 .eint_wkup_init = exynos_eint_wkup_init, 619 + .suspend = exynos_pinctrl_suspend, 620 + .resume = exynos_pinctrl_resume, 619 621 }, { 620 622 /* pin-controller instance 1 data */ 621 623 .pin_banks = exynos5260_pin_banks1, 622 624 .nr_banks = ARRAY_SIZE(exynos5260_pin_banks1), 623 625 .eint_gpio_init = exynos_eint_gpio_init, 626 + .suspend = exynos_pinctrl_suspend, 627 + .resume = exynos_pinctrl_resume, 624 628 }, { 625 629 /* pin-controller instance 2 data */ 626 630 .pin_banks = exynos5260_pin_banks2, 627 631 .nr_banks = ARRAY_SIZE(exynos5260_pin_banks2), 628 632 .eint_gpio_init = exynos_eint_gpio_init, 633 + .suspend = exynos_pinctrl_suspend, 634 + .resume = exynos_pinctrl_resume, 629 635 }, 630 636 }; 631 637 ··· 848 842 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks0), 849 843 .eint_gpio_init = exynos_eint_gpio_init, 850 844 .eint_wkup_init = exynos_eint_wkup_init, 845 + .suspend = exynos_pinctrl_suspend, 846 + .resume = exynos_pinctrl_resume, 851 847 .retention_data = &exynos5420_retention_data, 852 848 }, { 853 849 /* pin-controller instance 1 data */ 854 850 .pin_banks = exynos5420_pin_banks1, 855 851 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks1), 856 852 .eint_gpio_init = exynos_eint_gpio_init, 853 + .suspend = exynos_pinctrl_suspend, 854 + .resume = exynos_pinctrl_resume, 857 855 .retention_data = &exynos5420_retention_data, 858 856 }, { 859 857 /* pin-controller instance 2 data */ 860 858 .pin_banks = exynos5420_pin_banks2, 861 859 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks2), 862 860 .eint_gpio_init = exynos_eint_gpio_init, 861 + .suspend = exynos_pinctrl_suspend, 862 + .resume = exynos_pinctrl_resume, 863 863 .retention_data = &exynos5420_retention_data, 864 864 }, { 865 865 /* pin-controller instance 3 data */ 866 866 .pin_banks = exynos5420_pin_banks3, 867 867 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks3), 868 868 .eint_gpio_init = exynos_eint_gpio_init, 869 + .suspend = exynos_pinctrl_suspend, 870 + .resume = exynos_pinctrl_resume, 869 871 .retention_data = &exynos5420_retention_data, 870 872 }, { 871 873 /* pin-controller instance 4 data */ 872 874 .pin_banks = exynos5420_pin_banks4, 873 875 .nr_banks = ARRAY_SIZE(exynos5420_pin_banks4), 874 876 .eint_gpio_init = exynos_eint_gpio_init, 877 + .suspend = exynos_pinctrl_suspend, 878 + .resume = exynos_pinctrl_resume, 875 879 .retention_data = &exynos4_audio_retention_data, 876 880 }, 877 881 };
+67 -1
drivers/pinctrl/samsung/pinctrl-exynos.c
··· 25 25 #include <linux/regmap.h> 26 26 #include <linux/err.h> 27 27 #include <linux/soc/samsung/exynos-pmu.h> 28 + #include <linux/soc/samsung/exynos-regs-pmu.h> 28 29 29 30 #include <dt-bindings/pinctrl/samsung.h> 30 31 ··· 38 37 u32 eint_con; 39 38 u32 eint_mask; 40 39 u32 eint_pend; 40 + u32 eint_wake_mask_value; 41 + u32 eint_wake_mask_reg; 41 42 }; 42 43 43 44 static inline struct exynos_irq_chip *to_exynos_irq_chip(struct irq_chip *chip) ··· 218 215 .eint_con = EXYNOS_GPIO_ECON_OFFSET, 219 216 .eint_mask = EXYNOS_GPIO_EMASK_OFFSET, 220 217 .eint_pend = EXYNOS_GPIO_EPEND_OFFSET, 218 + /* eint_wake_mask_value not used */ 221 219 }; 222 220 223 221 static int exynos_eint_irq_map(struct irq_domain *h, unsigned int virq, ··· 334 330 335 331 static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) 336 332 { 333 + struct irq_chip *chip = irq_data_get_irq_chip(irqd); 334 + struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); 337 335 struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); 338 336 unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq); 339 337 ··· 345 339 exynos_eint_wake_mask |= bit; 346 340 else 347 341 exynos_eint_wake_mask &= ~bit; 342 + our_chip->eint_wake_mask_value = exynos_eint_wake_mask; 348 343 349 344 return 0; 350 345 } ··· 353 346 /* 354 347 * irq_chip for wakeup interrupts 355 348 */ 349 + static const struct exynos_irq_chip s5pv210_wkup_irq_chip __initconst = { 350 + .chip = { 351 + .name = "s5pv210_wkup_irq_chip", 352 + .irq_unmask = exynos_irq_unmask, 353 + .irq_mask = exynos_irq_mask, 354 + .irq_ack = exynos_irq_ack, 355 + .irq_set_type = exynos_irq_set_type, 356 + .irq_set_wake = exynos_wkup_irq_set_wake, 357 + .irq_request_resources = exynos_irq_request_resources, 358 + .irq_release_resources = exynos_irq_release_resources, 359 + }, 360 + .eint_con = EXYNOS_WKUP_ECON_OFFSET, 361 + .eint_mask = EXYNOS_WKUP_EMASK_OFFSET, 362 + .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, 363 + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, 364 + /* Only difference with exynos4210_wkup_irq_chip: */ 365 + .eint_wake_mask_reg = S5PV210_EINT_WAKEUP_MASK, 366 + }; 367 + 356 368 static const struct exynos_irq_chip exynos4210_wkup_irq_chip __initconst = { 357 369 .chip = { 358 370 .name = "exynos4210_wkup_irq_chip", ··· 386 360 .eint_con = EXYNOS_WKUP_ECON_OFFSET, 387 361 .eint_mask = EXYNOS_WKUP_EMASK_OFFSET, 388 362 .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, 363 + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, 364 + .eint_wake_mask_reg = EXYNOS_EINT_WAKEUP_MASK, 389 365 }; 390 366 391 367 static const struct exynos_irq_chip exynos7_wkup_irq_chip __initconst = { ··· 404 376 .eint_con = EXYNOS7_WKUP_ECON_OFFSET, 405 377 .eint_mask = EXYNOS7_WKUP_EMASK_OFFSET, 406 378 .eint_pend = EXYNOS7_WKUP_EPEND_OFFSET, 379 + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, 380 + .eint_wake_mask_reg = EXYNOS5433_EINT_WAKEUP_MASK, 407 381 }; 408 382 409 383 /* list of external wakeup controllers supported */ 410 384 static const struct of_device_id exynos_wkup_irq_ids[] = { 385 + { .compatible = "samsung,s5pv210-wakeup-eint", 386 + .data = &s5pv210_wkup_irq_chip }, 411 387 { .compatible = "samsung,exynos4210-wakeup-eint", 412 388 .data = &exynos4210_wkup_irq_chip }, 413 389 { .compatible = "samsung,exynos7-wakeup-eint", ··· 574 542 return 0; 575 543 } 576 544 545 + static void 546 + exynos_pinctrl_set_eint_wakeup_mask(struct samsung_pinctrl_drv_data *drvdata, 547 + struct exynos_irq_chip *irq_chip) 548 + { 549 + struct regmap *pmu_regs; 550 + 551 + if (!drvdata->retention_ctrl || !drvdata->retention_ctrl->priv) { 552 + dev_warn(drvdata->dev, 553 + "No retention data configured bank with external wakeup interrupt. Wake-up mask will not be set.\n"); 554 + return; 555 + } 556 + 557 + pmu_regs = drvdata->retention_ctrl->priv; 558 + dev_info(drvdata->dev, 559 + "Setting external wakeup interrupt mask: 0x%x\n", 560 + irq_chip->eint_wake_mask_value); 561 + 562 + regmap_write(pmu_regs, irq_chip->eint_wake_mask_reg, 563 + irq_chip->eint_wake_mask_value); 564 + } 565 + 577 566 static void exynos_pinctrl_suspend_bank( 578 567 struct samsung_pinctrl_drv_data *drvdata, 579 568 struct samsung_pin_bank *bank) ··· 617 564 void exynos_pinctrl_suspend(struct samsung_pinctrl_drv_data *drvdata) 618 565 { 619 566 struct samsung_pin_bank *bank = drvdata->pin_banks; 567 + struct exynos_irq_chip *irq_chip = NULL; 620 568 int i; 621 569 622 - for (i = 0; i < drvdata->nr_banks; ++i, ++bank) 570 + for (i = 0; i < drvdata->nr_banks; ++i, ++bank) { 623 571 if (bank->eint_type == EINT_TYPE_GPIO) 624 572 exynos_pinctrl_suspend_bank(drvdata, bank); 573 + else if (bank->eint_type == EINT_TYPE_WKUP) { 574 + if (!irq_chip) { 575 + irq_chip = bank->irq_chip; 576 + exynos_pinctrl_set_eint_wakeup_mask(drvdata, 577 + irq_chip); 578 + } else if (bank->irq_chip != irq_chip) { 579 + dev_warn(drvdata->dev, 580 + "More than one external wakeup interrupt chip configured (bank: %s). This is not supported by hardware nor by driver.\n", 581 + bank->name); 582 + } 583 + } 584 + } 625 585 } 626 586 627 587 static void exynos_pinctrl_resume_bank(
+11
drivers/pinctrl/samsung/pinctrl-samsung.h
··· 223 223 * interrupts for the controller. 224 224 * @eint_wkup_init: platform specific callback to setup the external wakeup 225 225 * interrupts for the controller. 226 + * @suspend: platform specific suspend callback, executed during pin controller 227 + * device suspend, see samsung_pinctrl_suspend() 228 + * @resume: platform specific resume callback, executed during pin controller 229 + * device suspend, see samsung_pinctrl_resume() 230 + * 231 + * External wakeup interrupts must define at least eint_wkup_init, 232 + * retention_data and suspend in order for proper suspend/resume to work. 226 233 */ 227 234 struct samsung_pin_ctrl { 228 235 const struct samsung_pin_bank_data *pin_banks; ··· 262 255 * @pin_base: starting system wide pin number. 263 256 * @nr_pins: number of pins supported by the controller. 264 257 * @retention_ctrl: retention control runtime data. 258 + * @suspend: platform specific suspend callback, executed during pin controller 259 + * device suspend, see samsung_pinctrl_suspend() 260 + * @resume: platform specific resume callback, executed during pin controller 261 + * device suspend, see samsung_pinctrl_resume() 265 262 */ 266 263 struct samsung_pinctrl_drv_data { 267 264 struct list_head node;
+333
drivers/pinctrl/sh-pfc/pfc-r8a77965.c
··· 1758 1758 DU_DISP_MARK, 1759 1759 }; 1760 1760 1761 + /* - HSCIF0 ----------------------------------------------------------------- */ 1762 + static const unsigned int hscif0_data_pins[] = { 1763 + /* RX, TX */ 1764 + RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14), 1765 + }; 1766 + 1767 + static const unsigned int hscif0_data_mux[] = { 1768 + HRX0_MARK, HTX0_MARK, 1769 + }; 1770 + 1771 + static const unsigned int hscif0_clk_pins[] = { 1772 + /* SCK */ 1773 + RCAR_GP_PIN(5, 12), 1774 + }; 1775 + 1776 + static const unsigned int hscif0_clk_mux[] = { 1777 + HSCK0_MARK, 1778 + }; 1779 + 1780 + static const unsigned int hscif0_ctrl_pins[] = { 1781 + /* RTS, CTS */ 1782 + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 15), 1783 + }; 1784 + 1785 + static const unsigned int hscif0_ctrl_mux[] = { 1786 + HRTS0_N_MARK, HCTS0_N_MARK, 1787 + }; 1788 + 1789 + /* - HSCIF1 ----------------------------------------------------------------- */ 1790 + static const unsigned int hscif1_data_a_pins[] = { 1791 + /* RX, TX */ 1792 + RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 6), 1793 + }; 1794 + 1795 + static const unsigned int hscif1_data_a_mux[] = { 1796 + HRX1_A_MARK, HTX1_A_MARK, 1797 + }; 1798 + 1799 + static const unsigned int hscif1_clk_a_pins[] = { 1800 + /* SCK */ 1801 + RCAR_GP_PIN(6, 21), 1802 + }; 1803 + 1804 + static const unsigned int hscif1_clk_a_mux[] = { 1805 + HSCK1_A_MARK, 1806 + }; 1807 + 1808 + static const unsigned int hscif1_ctrl_a_pins[] = { 1809 + /* RTS, CTS */ 1810 + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 7), 1811 + }; 1812 + 1813 + static const unsigned int hscif1_ctrl_a_mux[] = { 1814 + HRTS1_N_A_MARK, HCTS1_N_A_MARK, 1815 + }; 1816 + 1817 + static const unsigned int hscif1_data_b_pins[] = { 1818 + /* RX, TX */ 1819 + RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2), 1820 + }; 1821 + 1822 + static const unsigned int hscif1_data_b_mux[] = { 1823 + HRX1_B_MARK, HTX1_B_MARK, 1824 + }; 1825 + 1826 + static const unsigned int hscif1_clk_b_pins[] = { 1827 + /* SCK */ 1828 + RCAR_GP_PIN(5, 0), 1829 + }; 1830 + 1831 + static const unsigned int hscif1_clk_b_mux[] = { 1832 + HSCK1_B_MARK, 1833 + }; 1834 + 1835 + static const unsigned int hscif1_ctrl_b_pins[] = { 1836 + /* RTS, CTS */ 1837 + RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 3), 1838 + }; 1839 + 1840 + static const unsigned int hscif1_ctrl_b_mux[] = { 1841 + HRTS1_N_B_MARK, HCTS1_N_B_MARK, 1842 + }; 1843 + 1844 + /* - HSCIF2 ----------------------------------------------------------------- */ 1845 + static const unsigned int hscif2_data_a_pins[] = { 1846 + /* RX, TX */ 1847 + RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9), 1848 + }; 1849 + 1850 + static const unsigned int hscif2_data_a_mux[] = { 1851 + HRX2_A_MARK, HTX2_A_MARK, 1852 + }; 1853 + 1854 + static const unsigned int hscif2_clk_a_pins[] = { 1855 + /* SCK */ 1856 + RCAR_GP_PIN(6, 10), 1857 + }; 1858 + 1859 + static const unsigned int hscif2_clk_a_mux[] = { 1860 + HSCK2_A_MARK, 1861 + }; 1862 + 1863 + static const unsigned int hscif2_ctrl_a_pins[] = { 1864 + /* RTS, CTS */ 1865 + RCAR_GP_PIN(6, 7), RCAR_GP_PIN(6, 6), 1866 + }; 1867 + 1868 + static const unsigned int hscif2_ctrl_a_mux[] = { 1869 + HRTS2_N_A_MARK, HCTS2_N_A_MARK, 1870 + }; 1871 + 1872 + static const unsigned int hscif2_data_b_pins[] = { 1873 + /* RX, TX */ 1874 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18), 1875 + }; 1876 + 1877 + static const unsigned int hscif2_data_b_mux[] = { 1878 + HRX2_B_MARK, HTX2_B_MARK, 1879 + }; 1880 + 1881 + static const unsigned int hscif2_clk_b_pins[] = { 1882 + /* SCK */ 1883 + RCAR_GP_PIN(6, 21), 1884 + }; 1885 + 1886 + static const unsigned int hscif2_clk_b_mux[] = { 1887 + HSCK2_B_MARK, 1888 + }; 1889 + 1890 + static const unsigned int hscif2_ctrl_b_pins[] = { 1891 + /* RTS, CTS */ 1892 + RCAR_GP_PIN(6, 20), RCAR_GP_PIN(6, 19), 1893 + }; 1894 + 1895 + static const unsigned int hscif2_ctrl_b_mux[] = { 1896 + HRTS2_N_B_MARK, HCTS2_N_B_MARK, 1897 + }; 1898 + 1899 + static const unsigned int hscif2_data_c_pins[] = { 1900 + /* RX, TX */ 1901 + RCAR_GP_PIN(6, 25), RCAR_GP_PIN(6, 26), 1902 + }; 1903 + 1904 + static const unsigned int hscif2_data_c_mux[] = { 1905 + HRX2_C_MARK, HTX2_C_MARK, 1906 + }; 1907 + 1908 + static const unsigned int hscif2_clk_c_pins[] = { 1909 + /* SCK */ 1910 + RCAR_GP_PIN(6, 24), 1911 + }; 1912 + 1913 + static const unsigned int hscif2_clk_c_mux[] = { 1914 + HSCK2_C_MARK, 1915 + }; 1916 + 1917 + static const unsigned int hscif2_ctrl_c_pins[] = { 1918 + /* RTS, CTS */ 1919 + RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 27), 1920 + }; 1921 + 1922 + static const unsigned int hscif2_ctrl_c_mux[] = { 1923 + HRTS2_N_C_MARK, HCTS2_N_C_MARK, 1924 + }; 1925 + 1926 + /* - HSCIF3 ----------------------------------------------------------------- */ 1927 + static const unsigned int hscif3_data_a_pins[] = { 1928 + /* RX, TX */ 1929 + RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 24), 1930 + }; 1931 + 1932 + static const unsigned int hscif3_data_a_mux[] = { 1933 + HRX3_A_MARK, HTX3_A_MARK, 1934 + }; 1935 + 1936 + static const unsigned int hscif3_clk_pins[] = { 1937 + /* SCK */ 1938 + RCAR_GP_PIN(1, 22), 1939 + }; 1940 + 1941 + static const unsigned int hscif3_clk_mux[] = { 1942 + HSCK3_MARK, 1943 + }; 1944 + 1945 + static const unsigned int hscif3_ctrl_pins[] = { 1946 + /* RTS, CTS */ 1947 + RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25), 1948 + }; 1949 + 1950 + static const unsigned int hscif3_ctrl_mux[] = { 1951 + HRTS3_N_MARK, HCTS3_N_MARK, 1952 + }; 1953 + 1954 + static const unsigned int hscif3_data_b_pins[] = { 1955 + /* RX, TX */ 1956 + RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11), 1957 + }; 1958 + 1959 + static const unsigned int hscif3_data_b_mux[] = { 1960 + HRX3_B_MARK, HTX3_B_MARK, 1961 + }; 1962 + 1963 + static const unsigned int hscif3_data_c_pins[] = { 1964 + /* RX, TX */ 1965 + RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15), 1966 + }; 1967 + 1968 + static const unsigned int hscif3_data_c_mux[] = { 1969 + HRX3_C_MARK, HTX3_C_MARK, 1970 + }; 1971 + 1972 + static const unsigned int hscif3_data_d_pins[] = { 1973 + /* RX, TX */ 1974 + RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8), 1975 + }; 1976 + 1977 + static const unsigned int hscif3_data_d_mux[] = { 1978 + HRX3_D_MARK, HTX3_D_MARK, 1979 + }; 1980 + 1981 + /* - HSCIF4 ----------------------------------------------------------------- */ 1982 + static const unsigned int hscif4_data_a_pins[] = { 1983 + /* RX, TX */ 1984 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13), 1985 + }; 1986 + 1987 + static const unsigned int hscif4_data_a_mux[] = { 1988 + HRX4_A_MARK, HTX4_A_MARK, 1989 + }; 1990 + 1991 + static const unsigned int hscif4_clk_pins[] = { 1992 + /* SCK */ 1993 + RCAR_GP_PIN(1, 11), 1994 + }; 1995 + 1996 + static const unsigned int hscif4_clk_mux[] = { 1997 + HSCK4_MARK, 1998 + }; 1999 + 2000 + static const unsigned int hscif4_ctrl_pins[] = { 2001 + /* RTS, CTS */ 2002 + RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), 2003 + }; 2004 + 2005 + static const unsigned int hscif4_ctrl_mux[] = { 2006 + HRTS4_N_MARK, HCTS4_N_MARK, 2007 + }; 2008 + 2009 + static const unsigned int hscif4_data_b_pins[] = { 2010 + /* RX, TX */ 2011 + RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11), 2012 + }; 2013 + 2014 + static const unsigned int hscif4_data_b_mux[] = { 2015 + HRX4_B_MARK, HTX4_B_MARK, 2016 + }; 2017 + 1761 2018 /* - I2C -------------------------------------------------------------------- */ 1762 2019 static const unsigned int i2c1_a_pins[] = { 1763 2020 /* SDA, SCL */ ··· 3426 3169 SH_PFC_PIN_GROUP(du_oddf), 3427 3170 SH_PFC_PIN_GROUP(du_cde), 3428 3171 SH_PFC_PIN_GROUP(du_disp), 3172 + SH_PFC_PIN_GROUP(hscif0_data), 3173 + SH_PFC_PIN_GROUP(hscif0_clk), 3174 + SH_PFC_PIN_GROUP(hscif0_ctrl), 3175 + SH_PFC_PIN_GROUP(hscif1_data_a), 3176 + SH_PFC_PIN_GROUP(hscif1_clk_a), 3177 + SH_PFC_PIN_GROUP(hscif1_ctrl_a), 3178 + SH_PFC_PIN_GROUP(hscif1_data_b), 3179 + SH_PFC_PIN_GROUP(hscif1_clk_b), 3180 + SH_PFC_PIN_GROUP(hscif1_ctrl_b), 3181 + SH_PFC_PIN_GROUP(hscif2_data_a), 3182 + SH_PFC_PIN_GROUP(hscif2_clk_a), 3183 + SH_PFC_PIN_GROUP(hscif2_ctrl_a), 3184 + SH_PFC_PIN_GROUP(hscif2_data_b), 3185 + SH_PFC_PIN_GROUP(hscif2_clk_b), 3186 + SH_PFC_PIN_GROUP(hscif2_ctrl_b), 3187 + SH_PFC_PIN_GROUP(hscif2_data_c), 3188 + SH_PFC_PIN_GROUP(hscif2_clk_c), 3189 + SH_PFC_PIN_GROUP(hscif2_ctrl_c), 3190 + SH_PFC_PIN_GROUP(hscif3_data_a), 3191 + SH_PFC_PIN_GROUP(hscif3_clk), 3192 + SH_PFC_PIN_GROUP(hscif3_ctrl), 3193 + SH_PFC_PIN_GROUP(hscif3_data_b), 3194 + SH_PFC_PIN_GROUP(hscif3_data_c), 3195 + SH_PFC_PIN_GROUP(hscif3_data_d), 3196 + SH_PFC_PIN_GROUP(hscif4_data_a), 3197 + SH_PFC_PIN_GROUP(hscif4_clk), 3198 + SH_PFC_PIN_GROUP(hscif4_ctrl), 3199 + SH_PFC_PIN_GROUP(hscif4_data_b), 3429 3200 SH_PFC_PIN_GROUP(i2c1_a), 3430 3201 SH_PFC_PIN_GROUP(i2c1_b), 3431 3202 SH_PFC_PIN_GROUP(i2c2_a), ··· 3662 3377 "du_oddf", 3663 3378 "du_cde", 3664 3379 "du_disp", 3380 + }; 3381 + 3382 + static const char * const hscif0_groups[] = { 3383 + "hscif0_data", 3384 + "hscif0_clk", 3385 + "hscif0_ctrl", 3386 + }; 3387 + 3388 + static const char * const hscif1_groups[] = { 3389 + "hscif1_data_a", 3390 + "hscif1_clk_a", 3391 + "hscif1_ctrl_a", 3392 + "hscif1_data_b", 3393 + "hscif1_clk_b", 3394 + "hscif1_ctrl_b", 3395 + }; 3396 + 3397 + static const char * const hscif2_groups[] = { 3398 + "hscif2_data_a", 3399 + "hscif2_clk_a", 3400 + "hscif2_ctrl_a", 3401 + "hscif2_data_b", 3402 + "hscif2_clk_b", 3403 + "hscif2_ctrl_b", 3404 + "hscif2_data_c", 3405 + "hscif2_clk_c", 3406 + "hscif2_ctrl_c", 3407 + }; 3408 + 3409 + static const char * const hscif3_groups[] = { 3410 + "hscif3_data_a", 3411 + "hscif3_clk", 3412 + "hscif3_ctrl", 3413 + "hscif3_data_b", 3414 + "hscif3_data_c", 3415 + "hscif3_data_d", 3416 + }; 3417 + 3418 + static const char * const hscif4_groups[] = { 3419 + "hscif4_data_a", 3420 + "hscif4_clk", 3421 + "hscif4_ctrl", 3422 + "hscif4_data_b", 3665 3423 }; 3666 3424 3667 3425 static const char * const i2c1_groups[] = { ··· 3979 3651 static const struct sh_pfc_function pinmux_functions[] = { 3980 3652 SH_PFC_FUNCTION(avb), 3981 3653 SH_PFC_FUNCTION(du), 3654 + SH_PFC_FUNCTION(hscif0), 3655 + SH_PFC_FUNCTION(hscif1), 3656 + SH_PFC_FUNCTION(hscif2), 3657 + SH_PFC_FUNCTION(hscif3), 3658 + SH_PFC_FUNCTION(hscif4), 3982 3659 SH_PFC_FUNCTION(i2c1), 3983 3660 SH_PFC_FUNCTION(i2c2), 3984 3661 SH_PFC_FUNCTION(i2c6),
+67 -2
drivers/pinctrl/sh-pfc/pfc-r8a77990.c
··· 277 277 #define IP11_15_12 FM(TX0_A) FM(HTX1_A) FM(SSI_WS2_A) FM(RIF1_D0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDAT1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 278 278 #define IP11_19_16 FM(CTS0_N_A) FM(NFDATA14_A) FM(AUDIO_CLKOUT_A) FM(RIF1_D1) FM(SCIF_CLK_A) FM(FMCLK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 279 279 #define IP11_23_20 FM(RTS0_N_TANS_A) FM(NFDATA15_A) FM(AUDIO_CLKOUT1_A) FM(RIF1_CLK) FM(SCL2_A) FM(FMIN_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 280 - #define IP11_27_24 FM(SCK0_A) FM(HSCK1_A) FM(USB3HS0_ID) FM(RTS1_N_TANS) FM(SDA2_A) FM(FMCLK_C) F_(0, 0) F_(0, 0) FM(USB1_ID) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 280 + #define IP11_27_24 FM(SCK0_A) FM(HSCK1_A) FM(USB3HS0_ID) FM(RTS1_N_TANS) FM(SDA2_A) FM(FMCLK_C) F_(0, 0) F_(0, 0) FM(USB0_ID) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 281 281 #define IP11_31_28 FM(RX1) FM(HRX2_B) FM(SSI_SCK9_B) FM(AUDIO_CLKOUT1_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) 282 282 283 283 /* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 - F */ ··· 1082 1082 PINMUX_IPSR_GPSR(IP11_27_24, RTS1_N_TANS), 1083 1083 PINMUX_IPSR_MSEL(IP11_27_24, SDA2_A, SEL_I2C2_0), 1084 1084 PINMUX_IPSR_MSEL(IP11_27_24, FMCLK_C, SEL_FM_2), 1085 - PINMUX_IPSR_GPSR(IP11_27_24, USB1_ID), 1085 + PINMUX_IPSR_GPSR(IP11_27_24, USB0_ID), 1086 1086 1087 1087 PINMUX_IPSR_GPSR(IP11_31_28, RX1), 1088 1088 PINMUX_IPSR_MSEL(IP11_31_28, HRX2_B, SEL_HSCIF2_1), ··· 1784 1784 SCIF_CLK_B_MARK, 1785 1785 }; 1786 1786 1787 + /* - USB0 ------------------------------------------------------------------- */ 1788 + static const unsigned int usb0_a_pins[] = { 1789 + /* PWEN, OVC */ 1790 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 9), 1791 + }; 1792 + 1793 + static const unsigned int usb0_a_mux[] = { 1794 + USB0_PWEN_A_MARK, USB0_OVC_A_MARK, 1795 + }; 1796 + 1797 + static const unsigned int usb0_b_pins[] = { 1798 + /* PWEN, OVC */ 1799 + RCAR_GP_PIN(6, 11), RCAR_GP_PIN(6, 12), 1800 + }; 1801 + 1802 + static const unsigned int usb0_b_mux[] = { 1803 + USB0_PWEN_B_MARK, USB0_OVC_B_MARK, 1804 + }; 1805 + 1806 + static const unsigned int usb0_id_pins[] = { 1807 + /* ID */ 1808 + RCAR_GP_PIN(5, 0) 1809 + }; 1810 + 1811 + static const unsigned int usb0_id_mux[] = { 1812 + USB0_ID_MARK, 1813 + }; 1814 + 1815 + /* - USB30 ------------------------------------------------------------------ */ 1816 + static const unsigned int usb30_pins[] = { 1817 + /* PWEN, OVC */ 1818 + RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 9), 1819 + }; 1820 + 1821 + static const unsigned int usb30_mux[] = { 1822 + USB30_PWEN_MARK, USB30_OVC_MARK, 1823 + }; 1824 + 1825 + static const unsigned int usb30_id_pins[] = { 1826 + /* ID */ 1827 + RCAR_GP_PIN(5, 0), 1828 + }; 1829 + 1830 + static const unsigned int usb30_id_mux[] = { 1831 + USB3HS0_ID_MARK, 1832 + }; 1833 + 1787 1834 static const struct sh_pfc_pin_group pinmux_groups[] = { 1788 1835 SH_PFC_PIN_GROUP(avb_link), 1789 1836 SH_PFC_PIN_GROUP(avb_magic), ··· 1884 1837 SH_PFC_PIN_GROUP(scif5_data_c), 1885 1838 SH_PFC_PIN_GROUP(scif_clk_a), 1886 1839 SH_PFC_PIN_GROUP(scif_clk_b), 1840 + SH_PFC_PIN_GROUP(usb0_a), 1841 + SH_PFC_PIN_GROUP(usb0_b), 1842 + SH_PFC_PIN_GROUP(usb0_id), 1843 + SH_PFC_PIN_GROUP(usb30), 1844 + SH_PFC_PIN_GROUP(usb30_id), 1887 1845 }; 1888 1846 1889 1847 static const char * const avb_groups[] = { ··· 1985 1933 "scif_clk_b", 1986 1934 }; 1987 1935 1936 + static const char * const usb0_groups[] = { 1937 + "usb0_a", 1938 + "usb0_b", 1939 + "usb0_id", 1940 + }; 1941 + 1942 + static const char * const usb30_groups[] = { 1943 + "usb30", 1944 + "usb30_id", 1945 + }; 1946 + 1988 1947 static const struct sh_pfc_function pinmux_functions[] = { 1989 1948 SH_PFC_FUNCTION(avb), 1990 1949 SH_PFC_FUNCTION(i2c1), ··· 2011 1948 SH_PFC_FUNCTION(scif4), 2012 1949 SH_PFC_FUNCTION(scif5), 2013 1950 SH_PFC_FUNCTION(scif_clk), 1951 + SH_PFC_FUNCTION(usb0), 1952 + SH_PFC_FUNCTION(usb30), 2014 1953 }; 2015 1954 2016 1955 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
+38 -5
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 46 46 #define STM32_GPIO_PINS_PER_BANK 16 47 47 #define STM32_GPIO_IRQ_LINE 16 48 48 49 + #define SYSCFG_IRQMUX_MASK GENMASK(3, 0) 50 + 49 51 #define gpio_range_to_bank(chip) \ 50 52 container_of(chip, struct stm32_gpio_bank, range) 51 53 ··· 75 73 struct fwnode_handle *fwnode; 76 74 struct irq_domain *domain; 77 75 u32 bank_nr; 76 + u32 bank_ioport_nr; 78 77 }; 79 78 80 79 struct stm32_pinctrl { ··· 301 298 struct stm32_gpio_bank *bank = d->host_data; 302 299 struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent); 303 300 304 - regmap_field_write(pctl->irqmux[irq_data->hwirq], bank->bank_nr); 301 + regmap_field_write(pctl->irqmux[irq_data->hwirq], bank->bank_ioport_nr); 305 302 return 0; 306 303 } 307 304 ··· 641 638 } 642 639 643 640 range = pinctrl_find_gpio_range_from_pin(pctldev, g->pin); 641 + if (!range) { 642 + dev_err(pctl->dev, "No gpio range defined.\n"); 643 + return -EINVAL; 644 + } 645 + 644 646 bank = gpiochip_get_data(range->gc); 645 647 pin = stm32_gpio_pin(g->pin); 646 648 ··· 814 806 unsigned int pin, enum pin_config_param param, 815 807 enum pin_config_param arg) 816 808 { 809 + struct stm32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); 817 810 struct pinctrl_gpio_range *range; 818 811 struct stm32_gpio_bank *bank; 819 812 int offset, ret = 0; 820 813 821 814 range = pinctrl_find_gpio_range_from_pin(pctldev, pin); 815 + if (!range) { 816 + dev_err(pctl->dev, "No gpio range defined.\n"); 817 + return -EINVAL; 818 + } 819 + 822 820 bank = gpiochip_get_data(range->gc); 823 821 offset = stm32_gpio_pin(pin); 824 822 ··· 906 892 bool val; 907 893 908 894 range = pinctrl_find_gpio_range_from_pin_nolock(pctldev, pin); 895 + if (!range) 896 + return; 897 + 909 898 bank = gpiochip_get_data(range->gc); 910 899 offset = stm32_gpio_pin(pin); 911 900 ··· 965 948 struct device_node *np) 966 949 { 967 950 struct stm32_gpio_bank *bank = &pctl->banks[pctl->nbanks]; 951 + int bank_ioport_nr; 968 952 struct pinctrl_gpio_range *range = &bank->range; 969 953 struct of_phandle_args args; 970 954 struct device *dev = pctl->dev; ··· 1016 998 pinctrl_add_gpio_range(pctl->pctl_dev, 1017 999 &pctl->banks[bank_nr].range); 1018 1000 } 1001 + 1002 + if (of_property_read_u32(np, "st,bank-ioport", &bank_ioport_nr)) 1003 + bank_ioport_nr = bank_nr; 1004 + 1019 1005 bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK; 1020 1006 1021 1007 bank->gpio_chip.ngpio = npins; 1022 1008 bank->gpio_chip.of_node = np; 1023 1009 bank->gpio_chip.parent = dev; 1024 1010 bank->bank_nr = bank_nr; 1011 + bank->bank_ioport_nr = bank_ioport_nr; 1025 1012 spin_lock_init(&bank->lock); 1026 1013 1027 1014 /* create irq hierarchical domain */ ··· 1056 1033 struct device *dev = &pdev->dev; 1057 1034 struct regmap *rm; 1058 1035 int offset, ret, i; 1036 + int mask, mask_width; 1059 1037 1060 1038 parent = of_irq_find_parent(np); 1061 1039 if (!parent) ··· 1076 1052 if (ret) 1077 1053 return ret; 1078 1054 1055 + ret = of_property_read_u32_index(np, "st,syscfg", 2, &mask); 1056 + if (ret) 1057 + mask = SYSCFG_IRQMUX_MASK; 1058 + 1059 + mask_width = fls(mask); 1060 + 1079 1061 for (i = 0; i < STM32_GPIO_PINS_PER_BANK; i++) { 1080 1062 struct reg_field mux; 1081 1063 1082 1064 mux.reg = offset + (i / 4) * 4; 1083 - mux.lsb = (i % 4) * 4; 1084 - mux.msb = mux.lsb + 3; 1065 + mux.lsb = (i % 4) * mask_width; 1066 + mux.msb = mux.lsb + mask_width - 1; 1067 + 1068 + dev_dbg(dev, "irqmux%d: reg:%#x, lsb:%d, msb:%d\n", 1069 + i, mux.reg, mux.lsb, mux.msb); 1085 1070 1086 1071 pctl->irqmux[i] = devm_regmap_field_alloc(dev, rm, mux); 1087 1072 if (IS_ERR(pctl->irqmux[i])) ··· 1199 1166 return PTR_ERR(pctl->pctl_dev); 1200 1167 } 1201 1168 1202 - for_each_child_of_node(np, child) 1169 + for_each_available_child_of_node(np, child) 1203 1170 if (of_property_read_bool(child, "gpio-controller")) 1204 1171 banks++; 1205 1172 ··· 1212 1179 if (!pctl->banks) 1213 1180 return -ENOMEM; 1214 1181 1215 - for_each_child_of_node(np, child) { 1182 + for_each_available_child_of_node(np, child) { 1216 1183 if (of_property_read_bool(child, "gpio-controller")) { 1217 1184 ret = stm32_gpiolib_register_bank(pctl, child); 1218 1185 if (ret)
+3 -3
drivers/pinctrl/tegra/pinctrl-tegra.c
··· 629 629 } 630 630 } 631 631 632 - static bool gpio_node_has_range(void) 632 + static bool gpio_node_has_range(const char *compatible) 633 633 { 634 634 struct device_node *np; 635 635 bool has_prop = false; 636 636 637 - np = of_find_compatible_node(NULL, NULL, "nvidia,tegra30-gpio"); 637 + np = of_find_compatible_node(NULL, NULL, compatible); 638 638 if (!np) 639 639 return has_prop; 640 640 ··· 728 728 729 729 tegra_pinctrl_clear_parked_bits(pmx); 730 730 731 - if (!gpio_node_has_range()) 731 + if (!gpio_node_has_range(pmx->soc->gpio_compatible)) 732 732 pinctrl_add_gpio_range(pmx->pctl, &tegra_pinctrl_gpio_range); 733 733 734 734 platform_set_drvdata(pdev, pmx);
+1
drivers/pinctrl/tegra/pinctrl-tegra.h
··· 189 189 */ 190 190 struct tegra_pinctrl_soc_data { 191 191 unsigned ngpios; 192 + const char *gpio_compatible; 192 193 const struct pinctrl_pin_desc *pins; 193 194 unsigned npins; 194 195 struct tegra_function *functions;
+7 -1
drivers/pinctrl/tegra/pinctrl-tegra114.c
··· 1839 1839 1840 1840 static const struct tegra_pinctrl_soc_data tegra114_pinctrl = { 1841 1841 .ngpios = NUM_GPIOS, 1842 + .gpio_compatible = "nvidia,tegra30-gpio", 1842 1843 .pins = tegra114_pins, 1843 1844 .npins = ARRAY_SIZE(tegra114_pins), 1844 1845 .functions = tegra114_functions, ··· 1868 1867 }, 1869 1868 .probe = tegra114_pinctrl_probe, 1870 1869 }; 1871 - builtin_platform_driver(tegra114_pinctrl_driver); 1870 + 1871 + static int __init tegra114_pinctrl_init(void) 1872 + { 1873 + return platform_driver_register(&tegra114_pinctrl_driver); 1874 + } 1875 + arch_initcall(tegra114_pinctrl_init);
+7 -1
drivers/pinctrl/tegra/pinctrl-tegra124.c
··· 2051 2051 2052 2052 static const struct tegra_pinctrl_soc_data tegra124_pinctrl = { 2053 2053 .ngpios = NUM_GPIOS, 2054 + .gpio_compatible = "nvidia,tegra30-gpio", 2054 2055 .pins = tegra124_pins, 2055 2056 .npins = ARRAY_SIZE(tegra124_pins), 2056 2057 .functions = tegra124_functions, ··· 2080 2079 }, 2081 2080 .probe = tegra124_pinctrl_probe, 2082 2081 }; 2083 - builtin_platform_driver(tegra124_pinctrl_driver); 2082 + 2083 + static int __init tegra124_pinctrl_init(void) 2084 + { 2085 + return platform_driver_register(&tegra124_pinctrl_driver); 2086 + } 2087 + arch_initcall(tegra124_pinctrl_init);
+7 -1
drivers/pinctrl/tegra/pinctrl-tegra20.c
··· 2221 2221 2222 2222 static const struct tegra_pinctrl_soc_data tegra20_pinctrl = { 2223 2223 .ngpios = NUM_GPIOS, 2224 + .gpio_compatible = "nvidia,tegra20-gpio", 2224 2225 .pins = tegra20_pins, 2225 2226 .npins = ARRAY_SIZE(tegra20_pins), 2226 2227 .functions = tegra20_functions, ··· 2277 2276 }, 2278 2277 .probe = tegra20_pinctrl_probe, 2279 2278 }; 2280 - builtin_platform_driver(tegra20_pinctrl_driver); 2279 + 2280 + static int __init tegra20_pinctrl_init(void) 2281 + { 2282 + return platform_driver_register(&tegra20_pinctrl_driver); 2283 + } 2284 + arch_initcall(tegra20_pinctrl_init);
+7 -1
drivers/pinctrl/tegra/pinctrl-tegra210.c
··· 1553 1553 1554 1554 static const struct tegra_pinctrl_soc_data tegra210_pinctrl = { 1555 1555 .ngpios = NUM_GPIOS, 1556 + .gpio_compatible = "nvidia,tegra30-gpio", 1556 1557 .pins = tegra210_pins, 1557 1558 .npins = ARRAY_SIZE(tegra210_pins), 1558 1559 .functions = tegra210_functions, ··· 1582 1581 }, 1583 1582 .probe = tegra210_pinctrl_probe, 1584 1583 }; 1585 - builtin_platform_driver(tegra210_pinctrl_driver); 1584 + 1585 + static int __init tegra210_pinctrl_init(void) 1586 + { 1587 + return platform_driver_register(&tegra210_pinctrl_driver); 1588 + } 1589 + arch_initcall(tegra210_pinctrl_init);
+7 -1
drivers/pinctrl/tegra/pinctrl-tegra30.c
··· 2474 2474 2475 2475 static const struct tegra_pinctrl_soc_data tegra30_pinctrl = { 2476 2476 .ngpios = NUM_GPIOS, 2477 + .gpio_compatible = "nvidia,tegra30-gpio", 2477 2478 .pins = tegra30_pins, 2478 2479 .npins = ARRAY_SIZE(tegra30_pins), 2479 2480 .functions = tegra30_functions, ··· 2503 2502 }, 2504 2503 .probe = tegra30_pinctrl_probe, 2505 2504 }; 2506 - builtin_platform_driver(tegra30_pinctrl_driver); 2505 + 2506 + static int __init tegra30_pinctrl_init(void) 2507 + { 2508 + return platform_driver_register(&tegra30_pinctrl_driver); 2509 + } 2510 + arch_initcall(tegra30_pinctrl_init);
+10
drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
··· 517 517 static const unsigned nand_pins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 518 518 15, 16, 17}; 519 519 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 520 + static const unsigned spi0_pins[] = {56, 57, 58, 59}; 521 + static const int spi0_muxvals[] = {0, 0, 0, 0}; 522 + static const unsigned spi1_pins[] = {169, 170, 171, 172}; 523 + static const int spi1_muxvals[] = {1, 1, 1, 1}; 520 524 static const unsigned system_bus_pins[] = {1, 2, 6, 7, 8, 9, 10, 11, 12, 13, 521 525 14, 15, 16, 17}; 522 526 static const int system_bus_muxvals[] = {0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ··· 600 596 UNIPHIER_PINCTRL_GROUP(i2c3), 601 597 UNIPHIER_PINCTRL_GROUP(i2c4), 602 598 UNIPHIER_PINCTRL_GROUP(nand), 599 + UNIPHIER_PINCTRL_GROUP(spi0), 600 + UNIPHIER_PINCTRL_GROUP(spi1), 603 601 UNIPHIER_PINCTRL_GROUP(system_bus), 604 602 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 605 603 UNIPHIER_PINCTRL_GROUP(uart0), ··· 638 632 static const char * const i2c3_groups[] = {"i2c3"}; 639 633 static const char * const i2c4_groups[] = {"i2c4"}; 640 634 static const char * const nand_groups[] = {"nand"}; 635 + static const char * const spi0_groups[] = {"spi0"}; 636 + static const char * const spi1_groups[] = {"spi1"}; 641 637 static const char * const system_bus_groups[] = {"system_bus", 642 638 "system_bus_cs1"}; 643 639 static const char * const uart0_groups[] = {"uart0"}; ··· 665 657 UNIPHIER_PINMUX_FUNCTION(i2c3), 666 658 UNIPHIER_PINMUX_FUNCTION(i2c4), 667 659 UNIPHIER_PINMUX_FUNCTION(nand), 660 + UNIPHIER_PINMUX_FUNCTION(spi0), 661 + UNIPHIER_PINMUX_FUNCTION(spi1), 668 662 UNIPHIER_PINMUX_FUNCTION(system_bus), 669 663 UNIPHIER_PINMUX_FUNCTION(uart0), 670 664 UNIPHIER_PINMUX_FUNCTION(uart1),
+20
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
··· 606 606 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 607 607 static const unsigned sd_pins[] = {10, 11, 12, 13, 14, 15, 16, 17}; 608 608 static const int sd_muxvals[] = {3, 3, 3, 3, 3, 3, 3, 3}; /* No SDVOLC */ 609 + static const unsigned spi0_pins[] = {56, 57, 58, 59}; 610 + static const int spi0_muxvals[] = {0, 0, 0, 0}; 611 + static const unsigned spi1_pins[] = {169, 170, 171, 172}; 612 + static const int spi1_muxvals[] = {1, 1, 1, 1}; 613 + static const unsigned spi2_pins[] = {86, 87, 88, 89}; 614 + static const int spi2_muxvals[] = {1, 1, 1, 1}; 615 + static const unsigned spi3_pins[] = {74, 75, 76, 77}; 616 + static const int spi3_muxvals[] = {1, 1, 1, 1}; 609 617 static const unsigned system_bus_pins[] = {1, 2, 6, 7, 8, 9, 10, 11, 12, 13, 610 618 14, 15, 16, 17}; 611 619 static const int system_bus_muxvals[] = {0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ··· 693 685 UNIPHIER_PINCTRL_GROUP(i2c4), 694 686 UNIPHIER_PINCTRL_GROUP(nand), 695 687 UNIPHIER_PINCTRL_GROUP(sd), 688 + UNIPHIER_PINCTRL_GROUP(spi0), 689 + UNIPHIER_PINCTRL_GROUP(spi1), 690 + UNIPHIER_PINCTRL_GROUP(spi2), 691 + UNIPHIER_PINCTRL_GROUP(spi3), 696 692 UNIPHIER_PINCTRL_GROUP(system_bus), 697 693 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 698 694 UNIPHIER_PINCTRL_GROUP(uart0), ··· 734 722 static const char * const i2c4_groups[] = {"i2c4"}; 735 723 static const char * const nand_groups[] = {"nand"}; 736 724 static const char * const sd_groups[] = {"sd"}; 725 + static const char * const spi0_groups[] = {"spi0"}; 726 + static const char * const spi1_groups[] = {"spi1"}; 727 + static const char * const spi2_groups[] = {"spi2"}; 728 + static const char * const spi3_groups[] = {"spi3"}; 737 729 static const char * const system_bus_groups[] = {"system_bus", 738 730 "system_bus_cs1"}; 739 731 static const char * const uart0_groups[] = {"uart0"}; ··· 767 751 UNIPHIER_PINMUX_FUNCTION(i2c4), 768 752 UNIPHIER_PINMUX_FUNCTION(nand), 769 753 UNIPHIER_PINMUX_FUNCTION(sd), 754 + UNIPHIER_PINMUX_FUNCTION(spi0), 755 + UNIPHIER_PINMUX_FUNCTION(spi1), 756 + UNIPHIER_PINMUX_FUNCTION(spi2), 757 + UNIPHIER_PINMUX_FUNCTION(spi3), 770 758 UNIPHIER_PINMUX_FUNCTION(system_bus), 771 759 UNIPHIER_PINMUX_FUNCTION(uart0), 772 760 UNIPHIER_PINMUX_FUNCTION(uart1),
+5
drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
··· 576 576 static const int nand_cs1_muxvals[] = {0, 0}; 577 577 static const unsigned sd_pins[] = {44, 45, 46, 47, 48, 49, 50, 51, 52}; 578 578 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 579 + static const unsigned spi0_pins[] = {135, 136, 137, 138}; 580 + static const int spi0_muxvals[] = {12, 12, 12, 12}; 579 581 static const unsigned system_bus_pins[] = {16, 17, 18, 19, 20, 165, 166, 167, 580 582 168, 169, 170, 171, 172, 173}; 581 583 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, ··· 642 640 UNIPHIER_PINCTRL_GROUP(nand), 643 641 UNIPHIER_PINCTRL_GROUP(nand_cs1), 644 642 UNIPHIER_PINCTRL_GROUP(sd), 643 + UNIPHIER_PINCTRL_GROUP(spi0), 645 644 UNIPHIER_PINCTRL_GROUP(system_bus), 646 645 UNIPHIER_PINCTRL_GROUP(system_bus_cs0), 647 646 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), ··· 670 667 static const char * const i2c3_groups[] = {"i2c3"}; 671 668 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 672 669 static const char * const sd_groups[] = {"sd"}; 670 + static const char * const spi0_groups[] = {"spi0"}; 673 671 static const char * const system_bus_groups[] = {"system_bus", 674 672 "system_bus_cs0", 675 673 "system_bus_cs1", ··· 694 690 UNIPHIER_PINMUX_FUNCTION(i2c3), 695 691 UNIPHIER_PINMUX_FUNCTION(nand), 696 692 UNIPHIER_PINMUX_FUNCTION(sd), 693 + UNIPHIER_PINMUX_FUNCTION(spi0), 697 694 UNIPHIER_PINMUX_FUNCTION(system_bus), 698 695 UNIPHIER_PINMUX_FUNCTION(uart0), 699 696 UNIPHIER_PINMUX_FUNCTION(uart1),
+10
drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
··· 769 769 static const int nand_cs1_muxvals[] = {0, 0}; 770 770 static const unsigned sd_pins[] = {47, 48, 49, 50, 51, 52, 53, 54, 55}; 771 771 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 772 + static const unsigned spi0_pins[] = {199, 200, 201, 202}; 773 + static const int spi0_muxvals[] = {8, 8, 8, 8}; 774 + static const unsigned spi1_pins[] = {93, 94, 95, 96}; 775 + static const int spi1_muxvals[] = {1, 1, 1, 1}; 772 776 static const unsigned system_bus_pins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 773 777 11, 12, 13}; 774 778 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ··· 855 851 UNIPHIER_PINCTRL_GROUP(nand), 856 852 UNIPHIER_PINCTRL_GROUP(nand_cs1), 857 853 UNIPHIER_PINCTRL_GROUP(sd), 854 + UNIPHIER_PINCTRL_GROUP(spi0), 855 + UNIPHIER_PINCTRL_GROUP(spi1), 858 856 UNIPHIER_PINCTRL_GROUP(system_bus), 859 857 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 860 858 UNIPHIER_PINCTRL_GROUP(system_bus_cs2), ··· 888 882 static const char * const i2c3_groups[] = {"i2c3"}; 889 883 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 890 884 static const char * const sd_groups[] = {"sd"}; 885 + static const char * const spi0_groups[] = {"spi0"}; 886 + static const char * const spi1_groups[] = {"spi1"}; 891 887 static const char * const system_bus_groups[] = {"system_bus", 892 888 "system_bus_cs1", 893 889 "system_bus_cs2", ··· 915 907 UNIPHIER_PINMUX_FUNCTION(i2c3), 916 908 UNIPHIER_PINMUX_FUNCTION(nand), 917 909 UNIPHIER_PINMUX_FUNCTION(sd), 910 + UNIPHIER_PINMUX_FUNCTION(spi0), 911 + UNIPHIER_PINMUX_FUNCTION(spi1), 918 912 UNIPHIER_PINMUX_FUNCTION(system_bus), 919 913 UNIPHIER_PINMUX_FUNCTION(uart0), 920 914 UNIPHIER_PINMUX_FUNCTION(uart1),
+10
drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
··· 1050 1050 static const unsigned sd1_pins[] = {319, 320, 321, 322, 323, 324, 325, 326, 1051 1051 327}; 1052 1052 static const int sd1_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 1053 + static const unsigned spi0_pins[] = {199, 200, 201, 202}; 1054 + static const int spi0_muxvals[] = {11, 11, 11, 11}; 1055 + static const unsigned spi1_pins[] = {195, 196, 197, 198, 235, 238, 239}; 1056 + static const int spi1_muxvals[] = {11, 11, 11, 11, 11, 11, 11}; 1053 1057 static const unsigned system_bus_pins[] = {25, 26, 27, 28, 29, 30, 31, 32, 33, 1054 1058 34, 35, 36, 37, 38}; 1055 1059 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ··· 1142 1138 UNIPHIER_PINCTRL_GROUP(nand_cs1), 1143 1139 UNIPHIER_PINCTRL_GROUP(sd), 1144 1140 UNIPHIER_PINCTRL_GROUP(sd1), 1141 + UNIPHIER_PINCTRL_GROUP(spi0), 1142 + UNIPHIER_PINCTRL_GROUP(spi1), 1145 1143 UNIPHIER_PINCTRL_GROUP(system_bus), 1146 1144 UNIPHIER_PINCTRL_GROUP(system_bus_cs0), 1147 1145 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), ··· 1177 1171 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 1178 1172 static const char * const sd_groups[] = {"sd"}; 1179 1173 static const char * const sd1_groups[] = {"sd1"}; 1174 + static const char * const spi0_groups[] = {"spi0"}; 1175 + static const char * const spi1_groups[] = {"spi1"}; 1180 1176 static const char * const system_bus_groups[] = {"system_bus", 1181 1177 "system_bus_cs0", 1182 1178 "system_bus_cs1", ··· 1210 1202 UNIPHIER_PINMUX_FUNCTION(nand), 1211 1203 UNIPHIER_PINMUX_FUNCTION(sd), 1212 1204 UNIPHIER_PINMUX_FUNCTION(sd1), 1205 + UNIPHIER_PINMUX_FUNCTION(spi0), 1206 + UNIPHIER_PINMUX_FUNCTION(spi1), 1213 1207 UNIPHIER_PINMUX_FUNCTION(system_bus), 1214 1208 UNIPHIER_PINMUX_FUNCTION(uart0), 1215 1209 UNIPHIER_PINMUX_FUNCTION(uart1),
+15
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
··· 818 818 static const int nand_cs1_muxvals[] = {0, 0}; 819 819 static const unsigned sd_pins[] = {250, 251, 252, 253, 254, 255, 256, 257, 258}; 820 820 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 821 + static const unsigned spi0_pins[] = {120, 121, 122, 123}; 822 + static const int spi0_muxvals[] = {0, 0, 0, 0}; 823 + static const unsigned spi1_pins[] = {134, 139, 85, 86}; 824 + static const int spi1_muxvals[] = {1, 1, 1, 1}; 825 + static const unsigned spi2_pins[] = {55, 56, 57, 58, 82, 83, 84}; 826 + static const int spi2_muxvals[] = {0, 0, 0, 0, 1, 1, 1}; 821 827 static const unsigned system_bus_pins[] = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 822 828 14, 15, 16, 17}; 823 829 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ··· 910 904 UNIPHIER_PINCTRL_GROUP(i2c5c), 911 905 UNIPHIER_PINCTRL_GROUP(i2c6), 912 906 UNIPHIER_PINCTRL_GROUP(sd), 907 + UNIPHIER_PINCTRL_GROUP(spi0), 908 + UNIPHIER_PINCTRL_GROUP(spi1), 909 + UNIPHIER_PINCTRL_GROUP(spi2), 913 910 UNIPHIER_PINCTRL_GROUP(system_bus), 914 911 UNIPHIER_PINCTRL_GROUP(system_bus_cs0), 915 912 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), ··· 943 934 static const char * const i2c6_groups[] = {"i2c6"}; 944 935 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 945 936 static const char * const sd_groups[] = {"sd"}; 937 + static const char * const spi0_groups[] = {"spi0"}; 938 + static const char * const spi1_groups[] = {"spi1"}; 939 + static const char * const spi2_groups[] = {"spi2"}; 946 940 static const char * const system_bus_groups[] = {"system_bus", 947 941 "system_bus_cs0", 948 942 "system_bus_cs1", ··· 973 961 UNIPHIER_PINMUX_FUNCTION(i2c6), 974 962 UNIPHIER_PINMUX_FUNCTION(nand), 975 963 UNIPHIER_PINMUX_FUNCTION(sd), 964 + UNIPHIER_PINMUX_FUNCTION(spi0), 965 + UNIPHIER_PINMUX_FUNCTION(spi1), 966 + UNIPHIER_PINMUX_FUNCTION(spi2), 976 967 UNIPHIER_PINMUX_FUNCTION(system_bus), 977 968 UNIPHIER_PINMUX_FUNCTION(uart0), 978 969 UNIPHIER_PINMUX_FUNCTION(uart1),
+10
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
··· 778 778 static const int nand_cs1_muxvals[] = {8, 8}; 779 779 static const unsigned sd_pins[] = {47, 48, 49, 50, 51, 52, 53, 54, 55}; 780 780 static const int sd_muxvals[] = {8, 8, 8, 8, 8, 8, 8, 8, 8}; 781 + static const unsigned spi0_pins[] = {199, 200, 201, 202}; 782 + static const int spi0_muxvals[] = {8, 8, 8, 8}; 783 + static const unsigned spi1_pins[] = {93, 94, 95, 96}; 784 + static const int spi1_muxvals[] = {1, 1, 1, 1}; 781 785 static const unsigned system_bus_pins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 782 786 11, 12, 13}; 783 787 static const int system_bus_muxvals[] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ··· 865 861 UNIPHIER_PINCTRL_GROUP(nand), 866 862 UNIPHIER_PINCTRL_GROUP(nand_cs1), 867 863 UNIPHIER_PINCTRL_GROUP(sd), 864 + UNIPHIER_PINCTRL_GROUP(spi0), 865 + UNIPHIER_PINCTRL_GROUP(spi1), 868 866 UNIPHIER_PINCTRL_GROUP(system_bus), 869 867 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 870 868 UNIPHIER_PINCTRL_GROUP(uart0), ··· 903 897 static const char * const i2c6_groups[] = {"i2c6"}; 904 898 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 905 899 static const char * const sd_groups[] = {"sd"}; 900 + static const char * const spi0_groups[] = {"spi0"}; 901 + static const char * const spi1_groups[] = {"spi1"}; 906 902 static const char * const system_bus_groups[] = {"system_bus", 907 903 "system_bus_cs1"}; 908 904 static const char * const uart0_groups[] = {"uart0", "uart0b", "uart0b_ctsrts"}; ··· 936 928 UNIPHIER_PINMUX_FUNCTION(i2c6), 937 929 UNIPHIER_PINMUX_FUNCTION(nand), 938 930 UNIPHIER_PINMUX_FUNCTION(sd), 931 + UNIPHIER_PINMUX_FUNCTION(spi0), 932 + UNIPHIER_PINMUX_FUNCTION(spi1), 939 933 UNIPHIER_PINMUX_FUNCTION(system_bus), 940 934 UNIPHIER_PINMUX_FUNCTION(uart0), 941 935 UNIPHIER_PINMUX_FUNCTION(uart1),
+10
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
··· 808 808 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 809 809 static const unsigned int sd_pins[] = {43, 44, 45, 46, 47, 48, 49, 50, 51}; 810 810 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 811 + static const unsigned spi0_pins[] = {100, 101, 102, 103}; 812 + static const int spi0_muxvals[] = {0, 0, 0, 0}; 813 + static const unsigned spi1_pins[] = {112, 113, 114, 115}; 814 + static const int spi1_muxvals[] = {2, 2, 2, 2}; 811 815 static const unsigned int system_bus_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 812 816 11, 12, 13, 14}; 813 817 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ··· 890 886 UNIPHIER_PINCTRL_GROUP(i2c3), 891 887 UNIPHIER_PINCTRL_GROUP(nand), 892 888 UNIPHIER_PINCTRL_GROUP(sd), 889 + UNIPHIER_PINCTRL_GROUP(spi0), 890 + UNIPHIER_PINCTRL_GROUP(spi1), 893 891 UNIPHIER_PINCTRL_GROUP(system_bus), 894 892 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 895 893 UNIPHIER_PINCTRL_GROUP(uart0), ··· 919 913 static const char * const i2c3_groups[] = {"i2c3"}; 920 914 static const char * const nand_groups[] = {"nand"}; 921 915 static const char * const sd_groups[] = {"sd"}; 916 + static const char * const spi0_groups[] = {"spi0"}; 917 + static const char * const spi1_groups[] = {"spi1"}; 922 918 static const char * const system_bus_groups[] = {"system_bus", 923 919 "system_bus_cs1"}; 924 920 static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts"}; ··· 944 936 UNIPHIER_PINMUX_FUNCTION(i2c3), 945 937 UNIPHIER_PINMUX_FUNCTION(nand), 946 938 UNIPHIER_PINMUX_FUNCTION(sd), 939 + UNIPHIER_PINMUX_FUNCTION(spi0), 940 + UNIPHIER_PINMUX_FUNCTION(spi1), 947 941 UNIPHIER_PINMUX_FUNCTION(system_bus), 948 942 UNIPHIER_PINMUX_FUNCTION(uart0), 949 943 UNIPHIER_PINMUX_FUNCTION(uart1),
+5
drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
··· 504 504 static const int nand_cs1_muxvals[] = {0, 0}; 505 505 static const unsigned sd_pins[] = {32, 33, 34, 35, 36, 37, 38, 39, 40}; 506 506 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 507 + static const unsigned spi0_pins[] = {118, 119, 120, 121}; 508 + static const int spi0_muxvals[] = {3, 3, 3, 3}; 507 509 static const unsigned system_bus_pins[] = {136, 137, 138, 139, 140, 141, 142, 508 510 143, 144, 145, 146, 147, 148, 149}; 509 511 static const int system_bus_muxvals[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, ··· 572 570 UNIPHIER_PINCTRL_GROUP(nand), 573 571 UNIPHIER_PINCTRL_GROUP(nand_cs1), 574 572 UNIPHIER_PINCTRL_GROUP(sd), 573 + UNIPHIER_PINCTRL_GROUP(spi0), 575 574 UNIPHIER_PINCTRL_GROUP(system_bus), 576 575 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 577 576 UNIPHIER_PINCTRL_GROUP(system_bus_cs2), ··· 601 598 static const char * const i2c3_groups[] = {"i2c3"}; 602 599 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 603 600 static const char * const sd_groups[] = {"sd"}; 601 + static const char * const spi0_groups[] = {"spi0"}; 604 602 static const char * const system_bus_groups[] = {"system_bus", 605 603 "system_bus_cs1", 606 604 "system_bus_cs2", ··· 626 622 UNIPHIER_PINMUX_FUNCTION(i2c3), 627 623 UNIPHIER_PINMUX_FUNCTION(nand), 628 624 UNIPHIER_PINMUX_FUNCTION(sd), 625 + UNIPHIER_PINMUX_FUNCTION(spi0), 629 626 UNIPHIER_PINMUX_FUNCTION(system_bus), 630 627 UNIPHIER_PINMUX_FUNCTION(uart0), 631 628 UNIPHIER_PINMUX_FUNCTION(uart1),
+4
include/dt-bindings/pinctrl/at91.h
··· 39 39 #define AT91_PERIPH_C 3 40 40 #define AT91_PERIPH_D 4 41 41 42 + #define ATMEL_PIO_DRVSTR_LO 1 43 + #define ATMEL_PIO_DRVSTR_ME 2 44 + #define ATMEL_PIO_DRVSTR_HI 3 45 + 42 46 #endif /* __DT_BINDINGS_AT91_PINCTRL_H__ */
+2 -5
include/dt-bindings/pinctrl/samsung.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 2 3 * Samsung's Exynos pinctrl bindings 3 4 * 4 5 * Copyright (c) 2016 Samsung Electronics Co., Ltd. 5 6 * http://www.samsung.com 6 7 * Author: Krzysztof Kozlowski <krzk@kernel.org> 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 8 + */ 12 9 13 10 #ifndef __DT_BINDINGS_PINCTRL_SAMSUNG_H__ 14 11 #define __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+2 -1
include/linux/pinctrl/pinconf.h
··· 28 28 * is not available on this controller this should return -ENOTSUPP 29 29 * and if it is available but disabled it should return -EINVAL 30 30 * @pin_config_set: configure an individual pin 31 - * @pin_config_group_get: get configurations for an entire pin group 31 + * @pin_config_group_get: get configurations for an entire pin group; should 32 + * return -ENOTSUPP and -EINVAL using the same rules as pin_config_get. 32 33 * @pin_config_group_set: configure all pins in a group 33 34 * @pin_config_dbg_parse_modify: optional debugfs to modify a pin configuration 34 35 * @pin_config_dbg_show: optional debugfs display hook that will provide
+7 -1
include/linux/soc/samsung/exynos-regs-pmu.h
··· 42 42 #define EXYNOS_SWRESET 0x0400 43 43 44 44 #define S5P_WAKEUP_STAT 0x0600 45 - #define S5P_EINT_WAKEUP_MASK 0x0604 45 + /* Value for EXYNOS_EINT_WAKEUP_MASK disabling all external wakeup interrupts */ 46 + #define EXYNOS_EINT_WAKEUP_MASK_DISABLED 0xffffffff 47 + #define EXYNOS_EINT_WAKEUP_MASK 0x0604 46 48 #define S5P_WAKEUP_MASK 0x0608 47 49 #define S5P_WAKEUP_MASK2 0x0614 48 50 ··· 181 179 #define S5P_CORE_LOCAL_PWR_EN 0x3 182 180 #define S5P_CORE_WAKEUP_FROM_LOCAL_CFG (0x3 << 8) 183 181 #define S5P_CORE_AUTOWAKEUP_EN (1 << 31) 182 + 183 + /* Only for S5Pv210 */ 184 + #define S5PV210_EINT_WAKEUP_MASK 0xC004 184 185 185 186 /* Only for EXYNOS4210 */ 186 187 #define S5P_CMU_CLKSTOP_LCD1_LOWPWR 0x1154 ··· 646 641 | EXYNOS5420_KFC_USE_STANDBY_WFI3) 647 642 648 643 /* For EXYNOS5433 */ 644 + #define EXYNOS5433_EINT_WAKEUP_MASK (0x060C) 649 645 #define EXYNOS5433_USBHOST30_PHY_CONTROL (0x0728) 650 646 #define EXYNOS5433_PAD_RETENTION_AUD_OPTION (0x3028) 651 647 #define EXYNOS5433_PAD_RETENTION_MMC2_OPTION (0x30C8)